ManimPango 0.4.3__cp38-cp38-win32.whl → 1.0.0a2__cp38-cp38-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/METADATA +2 -2
- ManimPango-1.0.0a2.dist-info/RECORD +85 -0
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/WHEEL +1 -1
- manimpango/__init__.py +5 -7
- manimpango/_distributor_init.py +36 -0
- manimpango/_version.py +1 -1
- manimpango/attributes/__init__.py +324 -0
- manimpango/attributes/attributes.pxi +219 -0
- manimpango/buffer.pxi +15 -0
- manimpango/cmanimpango.c +10025 -0
- manimpango/cmanimpango.cp38-win32.pyd +0 -0
- manimpango/enums.c +3721 -0
- manimpango/enums.cp38-win32.pyd +0 -0
- manimpango/enums.pyx +1 -10
- manimpango/exceptions.py +5 -0
- manimpango/fonts/__init__.py +153 -0
- manimpango/fonts/_font_desc.c +7576 -0
- manimpango/fonts/_font_desc.cp38-win32.pyd +0 -0
- manimpango/fonts/_font_desc.pxd +5 -0
- manimpango/fonts/_font_desc.pyi +25 -0
- manimpango/fonts/_font_desc.pyx +114 -0
- manimpango/fonts/enums.c +3628 -0
- manimpango/fonts/enums.cp38-win32.pyd +0 -0
- manimpango/fonts/enums.pyi +23 -0
- manimpango/fonts/enums.pyx +84 -0
- manimpango/{cairo.pxd → include/cairo.pxd} +21 -0
- manimpango/include/glib.pxd +36 -0
- manimpango/{pango.pxd → include/pango.pxd} +61 -0
- manimpango/include/pango_attributes.pxd +184 -0
- manimpango/layout/__init__.py +266 -0
- manimpango/layout/_layout.c +8630 -0
- manimpango/layout/_layout.cp38-win32.pyd +0 -0
- manimpango/layout/_layout.pyx +60 -0
- manimpango/layout/layout.pxi +52 -0
- manimpango/register_font.c +5016 -0
- manimpango/register_font.cp38-win32.pyd +0 -0
- manimpango/renderer/__init__.py +5 -0
- manimpango/renderer/cairo_utils.pxi +72 -0
- manimpango/renderer/image_renderer.c +12319 -0
- manimpango/renderer/image_renderer.cp38-win32.pyd +0 -0
- manimpango/renderer/image_renderer.pxd +23 -0
- manimpango/renderer/image_renderer.pyi +21 -0
- manimpango/renderer/image_renderer.pyx +219 -0
- manimpango/renderer/svg_renderer.c +10671 -0
- manimpango/renderer/svg_renderer.cp38-win32.pyd +0 -0
- manimpango/renderer/svg_renderer.pxd +23 -0
- manimpango/renderer/svg_renderer.pyi +17 -0
- manimpango/renderer/svg_renderer.pyx +174 -0
- manimpango/utils/__init__.py +3 -0
- manimpango/utils/_utils.cp38-win32.pyd +0 -0
- manimpango/utils/_utils.pyi +2 -0
- manimpango/utils/utils.c +3533 -0
- manimpango/{utils.py → utils/utils.py} +3 -1
- manimpango/utils/utils.pyx +27 -0
- ManimPango-0.4.3.dist-info/RECORD +0 -44
- manimpango/glib.pxd +0 -13
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE +0 -0
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE.win32 +0 -0
- {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/top_level.txt +0 -0
- /manimpango/{CORE_MANIM_cairo-2.dll → .libs/CORE_MANIM_cairo-2.dll} +0 -0
- /manimpango/{CORE_MANIM_cairo-gobject-2.dll → .libs/CORE_MANIM_cairo-gobject-2.dll} +0 -0
- /manimpango/{CORE_MANIM_cairo-script-interpreter-2.dll → .libs/CORE_MANIM_cairo-script-interpreter-2.dll} +0 -0
- /manimpango/{CORE_MANIM_expat.dll → .libs/CORE_MANIM_expat.dll} +0 -0
- /manimpango/{CORE_MANIM_ffi-7.dll → .libs/CORE_MANIM_ffi-7.dll} +0 -0
- /manimpango/{CORE_MANIM_fontconfig-1.dll → .libs/CORE_MANIM_fontconfig-1.dll} +0 -0
- /manimpango/{CORE_MANIM_freetype-6.dll → .libs/CORE_MANIM_freetype-6.dll} +0 -0
- /manimpango/{CORE_MANIM_fribidi-0.dll → .libs/CORE_MANIM_fribidi-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gio-2.0-0.dll → .libs/CORE_MANIM_gio-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_glib-2.0-0.dll → .libs/CORE_MANIM_glib-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gmodule-2.0-0.dll → .libs/CORE_MANIM_gmodule-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gobject-2.0-0.dll → .libs/CORE_MANIM_gobject-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_gthread-2.0-0.dll → .libs/CORE_MANIM_gthread-2.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_harfbuzz-gobject.dll → .libs/CORE_MANIM_harfbuzz-gobject.dll} +0 -0
- /manimpango/{CORE_MANIM_harfbuzz-subset.dll → .libs/CORE_MANIM_harfbuzz-subset.dll} +0 -0
- /manimpango/{CORE_MANIM_harfbuzz.dll → .libs/CORE_MANIM_harfbuzz.dll} +0 -0
- /manimpango/{CORE_MANIM_intl-8.dll → .libs/CORE_MANIM_intl-8.dll} +0 -0
- /manimpango/{CORE_MANIM_pango-1.0-0.dll → .libs/CORE_MANIM_pango-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pangocairo-1.0-0.dll → .libs/CORE_MANIM_pangocairo-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pangoft2-1.0-0.dll → .libs/CORE_MANIM_pangoft2-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pangowin32-1.0-0.dll → .libs/CORE_MANIM_pangowin32-1.0-0.dll} +0 -0
- /manimpango/{CORE_MANIM_pixman-1-0.dll → .libs/CORE_MANIM_pixman-1-0.dll} +0 -0
- /manimpango/{CORE_MANIM_png16-16.dll → .libs/CORE_MANIM_png16-16.dll} +0 -0
- /manimpango/{CORE_MANIM_z.dll → .libs/CORE_MANIM_z.dll} +0 -0
manimpango/fonts/enums.c
ADDED
@@ -0,0 +1,3628 @@
|
|
1
|
+
/* Generated by Cython 0.29.34 */
|
2
|
+
|
3
|
+
/* BEGIN: Cython Metadata
|
4
|
+
{
|
5
|
+
"distutils": {
|
6
|
+
"define_macros": [
|
7
|
+
[
|
8
|
+
"UNICODE",
|
9
|
+
1
|
10
|
+
]
|
11
|
+
],
|
12
|
+
"depends": [
|
13
|
+
"C:\\cibw\\vendor\\include\\cairo\\cairo-svg.h",
|
14
|
+
"C:\\cibw\\vendor\\include\\cairo\\cairo.h",
|
15
|
+
"C:\\cibw\\vendor\\include\\glib-2.0\\glib.h",
|
16
|
+
"C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pango.h",
|
17
|
+
"C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pangocairo.h"
|
18
|
+
],
|
19
|
+
"include_dirs": [
|
20
|
+
"C:/cibw/vendor/include/cairo",
|
21
|
+
"C:/cibw/vendor/include/pixman-1",
|
22
|
+
"C:/cibw/vendor/include/glib-2.0",
|
23
|
+
"C:/cibw/vendor/include/harfbuzz",
|
24
|
+
"C:/cibw/vendor/include/pango-1.0",
|
25
|
+
"C:/cibw/vendor/include",
|
26
|
+
"C:/cibw/vendor/include/fribidi",
|
27
|
+
"C:/cibw/vendor/include/freetype2",
|
28
|
+
"C:/cibw/vendor/lib/glib-2.0/include"
|
29
|
+
],
|
30
|
+
"libraries": [
|
31
|
+
"Gdi32",
|
32
|
+
"gobject-2.0",
|
33
|
+
"glib-2.0",
|
34
|
+
"fontconfig",
|
35
|
+
"harfbuzz",
|
36
|
+
"pangoft2-1.0",
|
37
|
+
"pangocairo-1.0",
|
38
|
+
"intl",
|
39
|
+
"freetype",
|
40
|
+
"pango-1.0",
|
41
|
+
"cairo"
|
42
|
+
],
|
43
|
+
"library_dirs": [
|
44
|
+
"C:/cibw/vendor/lib"
|
45
|
+
],
|
46
|
+
"name": "manimpango.fonts.enums",
|
47
|
+
"sources": [
|
48
|
+
"manimpango\\fonts\\enums.pyx"
|
49
|
+
]
|
50
|
+
},
|
51
|
+
"module_name": "manimpango.fonts.enums"
|
52
|
+
}
|
53
|
+
END: Cython Metadata */
|
54
|
+
|
55
|
+
#ifndef PY_SSIZE_T_CLEAN
|
56
|
+
#define PY_SSIZE_T_CLEAN
|
57
|
+
#endif /* PY_SSIZE_T_CLEAN */
|
58
|
+
#include "Python.h"
|
59
|
+
#ifndef Py_PYTHON_H
|
60
|
+
#error Python headers needed to compile C extensions, please install development version of Python.
|
61
|
+
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
|
62
|
+
#error Cython requires Python 2.6+ or Python 3.3+.
|
63
|
+
#else
|
64
|
+
#define CYTHON_ABI "0_29_34"
|
65
|
+
#define CYTHON_HEX_VERSION 0x001D22F0
|
66
|
+
#define CYTHON_FUTURE_DIVISION 1
|
67
|
+
#include <stddef.h>
|
68
|
+
#ifndef offsetof
|
69
|
+
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
|
70
|
+
#endif
|
71
|
+
#if !defined(WIN32) && !defined(MS_WINDOWS)
|
72
|
+
#ifndef __stdcall
|
73
|
+
#define __stdcall
|
74
|
+
#endif
|
75
|
+
#ifndef __cdecl
|
76
|
+
#define __cdecl
|
77
|
+
#endif
|
78
|
+
#ifndef __fastcall
|
79
|
+
#define __fastcall
|
80
|
+
#endif
|
81
|
+
#endif
|
82
|
+
#ifndef DL_IMPORT
|
83
|
+
#define DL_IMPORT(t) t
|
84
|
+
#endif
|
85
|
+
#ifndef DL_EXPORT
|
86
|
+
#define DL_EXPORT(t) t
|
87
|
+
#endif
|
88
|
+
#define __PYX_COMMA ,
|
89
|
+
#ifndef HAVE_LONG_LONG
|
90
|
+
#if PY_VERSION_HEX >= 0x02070000
|
91
|
+
#define HAVE_LONG_LONG
|
92
|
+
#endif
|
93
|
+
#endif
|
94
|
+
#ifndef PY_LONG_LONG
|
95
|
+
#define PY_LONG_LONG LONG_LONG
|
96
|
+
#endif
|
97
|
+
#ifndef Py_HUGE_VAL
|
98
|
+
#define Py_HUGE_VAL HUGE_VAL
|
99
|
+
#endif
|
100
|
+
#ifdef PYPY_VERSION
|
101
|
+
#define CYTHON_COMPILING_IN_PYPY 1
|
102
|
+
#define CYTHON_COMPILING_IN_PYSTON 0
|
103
|
+
#define CYTHON_COMPILING_IN_CPYTHON 0
|
104
|
+
#define CYTHON_COMPILING_IN_NOGIL 0
|
105
|
+
#undef CYTHON_USE_TYPE_SLOTS
|
106
|
+
#define CYTHON_USE_TYPE_SLOTS 0
|
107
|
+
#undef CYTHON_USE_PYTYPE_LOOKUP
|
108
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
109
|
+
#if PY_VERSION_HEX < 0x03050000
|
110
|
+
#undef CYTHON_USE_ASYNC_SLOTS
|
111
|
+
#define CYTHON_USE_ASYNC_SLOTS 0
|
112
|
+
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
|
113
|
+
#define CYTHON_USE_ASYNC_SLOTS 1
|
114
|
+
#endif
|
115
|
+
#undef CYTHON_USE_PYLIST_INTERNALS
|
116
|
+
#define CYTHON_USE_PYLIST_INTERNALS 0
|
117
|
+
#undef CYTHON_USE_UNICODE_INTERNALS
|
118
|
+
#define CYTHON_USE_UNICODE_INTERNALS 0
|
119
|
+
#undef CYTHON_USE_UNICODE_WRITER
|
120
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
121
|
+
#undef CYTHON_USE_PYLONG_INTERNALS
|
122
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
123
|
+
#undef CYTHON_AVOID_BORROWED_REFS
|
124
|
+
#define CYTHON_AVOID_BORROWED_REFS 1
|
125
|
+
#undef CYTHON_ASSUME_SAFE_MACROS
|
126
|
+
#define CYTHON_ASSUME_SAFE_MACROS 0
|
127
|
+
#undef CYTHON_UNPACK_METHODS
|
128
|
+
#define CYTHON_UNPACK_METHODS 0
|
129
|
+
#undef CYTHON_FAST_THREAD_STATE
|
130
|
+
#define CYTHON_FAST_THREAD_STATE 0
|
131
|
+
#undef CYTHON_FAST_PYCALL
|
132
|
+
#define CYTHON_FAST_PYCALL 0
|
133
|
+
#undef CYTHON_PEP489_MULTI_PHASE_INIT
|
134
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
|
135
|
+
#undef CYTHON_USE_TP_FINALIZE
|
136
|
+
#define CYTHON_USE_TP_FINALIZE 0
|
137
|
+
#undef CYTHON_USE_DICT_VERSIONS
|
138
|
+
#define CYTHON_USE_DICT_VERSIONS 0
|
139
|
+
#undef CYTHON_USE_EXC_INFO_STACK
|
140
|
+
#define CYTHON_USE_EXC_INFO_STACK 0
|
141
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
142
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
143
|
+
#endif
|
144
|
+
#elif defined(PYSTON_VERSION)
|
145
|
+
#define CYTHON_COMPILING_IN_PYPY 0
|
146
|
+
#define CYTHON_COMPILING_IN_PYSTON 1
|
147
|
+
#define CYTHON_COMPILING_IN_CPYTHON 0
|
148
|
+
#define CYTHON_COMPILING_IN_NOGIL 0
|
149
|
+
#ifndef CYTHON_USE_TYPE_SLOTS
|
150
|
+
#define CYTHON_USE_TYPE_SLOTS 1
|
151
|
+
#endif
|
152
|
+
#undef CYTHON_USE_PYTYPE_LOOKUP
|
153
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
154
|
+
#undef CYTHON_USE_ASYNC_SLOTS
|
155
|
+
#define CYTHON_USE_ASYNC_SLOTS 0
|
156
|
+
#undef CYTHON_USE_PYLIST_INTERNALS
|
157
|
+
#define CYTHON_USE_PYLIST_INTERNALS 0
|
158
|
+
#ifndef CYTHON_USE_UNICODE_INTERNALS
|
159
|
+
#define CYTHON_USE_UNICODE_INTERNALS 1
|
160
|
+
#endif
|
161
|
+
#undef CYTHON_USE_UNICODE_WRITER
|
162
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
163
|
+
#undef CYTHON_USE_PYLONG_INTERNALS
|
164
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
165
|
+
#ifndef CYTHON_AVOID_BORROWED_REFS
|
166
|
+
#define CYTHON_AVOID_BORROWED_REFS 0
|
167
|
+
#endif
|
168
|
+
#ifndef CYTHON_ASSUME_SAFE_MACROS
|
169
|
+
#define CYTHON_ASSUME_SAFE_MACROS 1
|
170
|
+
#endif
|
171
|
+
#ifndef CYTHON_UNPACK_METHODS
|
172
|
+
#define CYTHON_UNPACK_METHODS 1
|
173
|
+
#endif
|
174
|
+
#undef CYTHON_FAST_THREAD_STATE
|
175
|
+
#define CYTHON_FAST_THREAD_STATE 0
|
176
|
+
#undef CYTHON_FAST_PYCALL
|
177
|
+
#define CYTHON_FAST_PYCALL 0
|
178
|
+
#undef CYTHON_PEP489_MULTI_PHASE_INIT
|
179
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
|
180
|
+
#undef CYTHON_USE_TP_FINALIZE
|
181
|
+
#define CYTHON_USE_TP_FINALIZE 0
|
182
|
+
#undef CYTHON_USE_DICT_VERSIONS
|
183
|
+
#define CYTHON_USE_DICT_VERSIONS 0
|
184
|
+
#undef CYTHON_USE_EXC_INFO_STACK
|
185
|
+
#define CYTHON_USE_EXC_INFO_STACK 0
|
186
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
187
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
188
|
+
#endif
|
189
|
+
#elif defined(PY_NOGIL)
|
190
|
+
#define CYTHON_COMPILING_IN_PYPY 0
|
191
|
+
#define CYTHON_COMPILING_IN_PYSTON 0
|
192
|
+
#define CYTHON_COMPILING_IN_CPYTHON 0
|
193
|
+
#define CYTHON_COMPILING_IN_NOGIL 1
|
194
|
+
#ifndef CYTHON_USE_TYPE_SLOTS
|
195
|
+
#define CYTHON_USE_TYPE_SLOTS 1
|
196
|
+
#endif
|
197
|
+
#undef CYTHON_USE_PYTYPE_LOOKUP
|
198
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
199
|
+
#ifndef CYTHON_USE_ASYNC_SLOTS
|
200
|
+
#define CYTHON_USE_ASYNC_SLOTS 1
|
201
|
+
#endif
|
202
|
+
#undef CYTHON_USE_PYLIST_INTERNALS
|
203
|
+
#define CYTHON_USE_PYLIST_INTERNALS 0
|
204
|
+
#ifndef CYTHON_USE_UNICODE_INTERNALS
|
205
|
+
#define CYTHON_USE_UNICODE_INTERNALS 1
|
206
|
+
#endif
|
207
|
+
#undef CYTHON_USE_UNICODE_WRITER
|
208
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
209
|
+
#undef CYTHON_USE_PYLONG_INTERNALS
|
210
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
211
|
+
#ifndef CYTHON_AVOID_BORROWED_REFS
|
212
|
+
#define CYTHON_AVOID_BORROWED_REFS 0
|
213
|
+
#endif
|
214
|
+
#ifndef CYTHON_ASSUME_SAFE_MACROS
|
215
|
+
#define CYTHON_ASSUME_SAFE_MACROS 1
|
216
|
+
#endif
|
217
|
+
#ifndef CYTHON_UNPACK_METHODS
|
218
|
+
#define CYTHON_UNPACK_METHODS 1
|
219
|
+
#endif
|
220
|
+
#undef CYTHON_FAST_THREAD_STATE
|
221
|
+
#define CYTHON_FAST_THREAD_STATE 0
|
222
|
+
#undef CYTHON_FAST_PYCALL
|
223
|
+
#define CYTHON_FAST_PYCALL 0
|
224
|
+
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
225
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
226
|
+
#endif
|
227
|
+
#ifndef CYTHON_USE_TP_FINALIZE
|
228
|
+
#define CYTHON_USE_TP_FINALIZE 1
|
229
|
+
#endif
|
230
|
+
#undef CYTHON_USE_DICT_VERSIONS
|
231
|
+
#define CYTHON_USE_DICT_VERSIONS 0
|
232
|
+
#undef CYTHON_USE_EXC_INFO_STACK
|
233
|
+
#define CYTHON_USE_EXC_INFO_STACK 0
|
234
|
+
#else
|
235
|
+
#define CYTHON_COMPILING_IN_PYPY 0
|
236
|
+
#define CYTHON_COMPILING_IN_PYSTON 0
|
237
|
+
#define CYTHON_COMPILING_IN_CPYTHON 1
|
238
|
+
#define CYTHON_COMPILING_IN_NOGIL 0
|
239
|
+
#ifndef CYTHON_USE_TYPE_SLOTS
|
240
|
+
#define CYTHON_USE_TYPE_SLOTS 1
|
241
|
+
#endif
|
242
|
+
#if PY_VERSION_HEX < 0x02070000
|
243
|
+
#undef CYTHON_USE_PYTYPE_LOOKUP
|
244
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
245
|
+
#elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
|
246
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 1
|
247
|
+
#endif
|
248
|
+
#if PY_MAJOR_VERSION < 3
|
249
|
+
#undef CYTHON_USE_ASYNC_SLOTS
|
250
|
+
#define CYTHON_USE_ASYNC_SLOTS 0
|
251
|
+
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
|
252
|
+
#define CYTHON_USE_ASYNC_SLOTS 1
|
253
|
+
#endif
|
254
|
+
#if PY_VERSION_HEX < 0x02070000
|
255
|
+
#undef CYTHON_USE_PYLONG_INTERNALS
|
256
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
257
|
+
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
|
258
|
+
#define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
|
259
|
+
#endif
|
260
|
+
#ifndef CYTHON_USE_PYLIST_INTERNALS
|
261
|
+
#define CYTHON_USE_PYLIST_INTERNALS 1
|
262
|
+
#endif
|
263
|
+
#ifndef CYTHON_USE_UNICODE_INTERNALS
|
264
|
+
#define CYTHON_USE_UNICODE_INTERNALS 1
|
265
|
+
#endif
|
266
|
+
#if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
|
267
|
+
#undef CYTHON_USE_UNICODE_WRITER
|
268
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
269
|
+
#elif !defined(CYTHON_USE_UNICODE_WRITER)
|
270
|
+
#define CYTHON_USE_UNICODE_WRITER 1
|
271
|
+
#endif
|
272
|
+
#ifndef CYTHON_AVOID_BORROWED_REFS
|
273
|
+
#define CYTHON_AVOID_BORROWED_REFS 0
|
274
|
+
#endif
|
275
|
+
#ifndef CYTHON_ASSUME_SAFE_MACROS
|
276
|
+
#define CYTHON_ASSUME_SAFE_MACROS 1
|
277
|
+
#endif
|
278
|
+
#ifndef CYTHON_UNPACK_METHODS
|
279
|
+
#define CYTHON_UNPACK_METHODS 1
|
280
|
+
#endif
|
281
|
+
#if PY_VERSION_HEX >= 0x030B00A4
|
282
|
+
#undef CYTHON_FAST_THREAD_STATE
|
283
|
+
#define CYTHON_FAST_THREAD_STATE 0
|
284
|
+
#elif !defined(CYTHON_FAST_THREAD_STATE)
|
285
|
+
#define CYTHON_FAST_THREAD_STATE 1
|
286
|
+
#endif
|
287
|
+
#ifndef CYTHON_FAST_PYCALL
|
288
|
+
#define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
|
289
|
+
#endif
|
290
|
+
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
291
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
|
292
|
+
#endif
|
293
|
+
#ifndef CYTHON_USE_TP_FINALIZE
|
294
|
+
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
|
295
|
+
#endif
|
296
|
+
#ifndef CYTHON_USE_DICT_VERSIONS
|
297
|
+
#define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
|
298
|
+
#endif
|
299
|
+
#if PY_VERSION_HEX >= 0x030B00A4
|
300
|
+
#undef CYTHON_USE_EXC_INFO_STACK
|
301
|
+
#define CYTHON_USE_EXC_INFO_STACK 0
|
302
|
+
#elif !defined(CYTHON_USE_EXC_INFO_STACK)
|
303
|
+
#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
|
304
|
+
#endif
|
305
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
306
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
307
|
+
#endif
|
308
|
+
#endif
|
309
|
+
#if !defined(CYTHON_FAST_PYCCALL)
|
310
|
+
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
|
311
|
+
#endif
|
312
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
313
|
+
#if PY_MAJOR_VERSION < 3
|
314
|
+
#include "longintrepr.h"
|
315
|
+
#endif
|
316
|
+
#undef SHIFT
|
317
|
+
#undef BASE
|
318
|
+
#undef MASK
|
319
|
+
#ifdef SIZEOF_VOID_P
|
320
|
+
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
321
|
+
#endif
|
322
|
+
#endif
|
323
|
+
#ifndef __has_attribute
|
324
|
+
#define __has_attribute(x) 0
|
325
|
+
#endif
|
326
|
+
#ifndef __has_cpp_attribute
|
327
|
+
#define __has_cpp_attribute(x) 0
|
328
|
+
#endif
|
329
|
+
#ifndef CYTHON_RESTRICT
|
330
|
+
#if defined(__GNUC__)
|
331
|
+
#define CYTHON_RESTRICT __restrict__
|
332
|
+
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
333
|
+
#define CYTHON_RESTRICT __restrict
|
334
|
+
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
335
|
+
#define CYTHON_RESTRICT restrict
|
336
|
+
#else
|
337
|
+
#define CYTHON_RESTRICT
|
338
|
+
#endif
|
339
|
+
#endif
|
340
|
+
#ifndef CYTHON_UNUSED
|
341
|
+
# if defined(__GNUC__)
|
342
|
+
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
343
|
+
# define CYTHON_UNUSED __attribute__ ((__unused__))
|
344
|
+
# else
|
345
|
+
# define CYTHON_UNUSED
|
346
|
+
# endif
|
347
|
+
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
|
348
|
+
# define CYTHON_UNUSED __attribute__ ((__unused__))
|
349
|
+
# else
|
350
|
+
# define CYTHON_UNUSED
|
351
|
+
# endif
|
352
|
+
#endif
|
353
|
+
#ifndef CYTHON_MAYBE_UNUSED_VAR
|
354
|
+
# if defined(__cplusplus)
|
355
|
+
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
|
356
|
+
# else
|
357
|
+
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
|
358
|
+
# endif
|
359
|
+
#endif
|
360
|
+
#ifndef CYTHON_NCP_UNUSED
|
361
|
+
# if CYTHON_COMPILING_IN_CPYTHON
|
362
|
+
# define CYTHON_NCP_UNUSED
|
363
|
+
# else
|
364
|
+
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
|
365
|
+
# endif
|
366
|
+
#endif
|
367
|
+
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
|
368
|
+
#ifdef _MSC_VER
|
369
|
+
#ifndef _MSC_STDINT_H_
|
370
|
+
#if _MSC_VER < 1300
|
371
|
+
typedef unsigned char uint8_t;
|
372
|
+
typedef unsigned int uint32_t;
|
373
|
+
#else
|
374
|
+
typedef unsigned __int8 uint8_t;
|
375
|
+
typedef unsigned __int32 uint32_t;
|
376
|
+
#endif
|
377
|
+
#endif
|
378
|
+
#else
|
379
|
+
#include <stdint.h>
|
380
|
+
#endif
|
381
|
+
#ifndef CYTHON_FALLTHROUGH
|
382
|
+
#if defined(__cplusplus) && __cplusplus >= 201103L
|
383
|
+
#if __has_cpp_attribute(fallthrough)
|
384
|
+
#define CYTHON_FALLTHROUGH [[fallthrough]]
|
385
|
+
#elif __has_cpp_attribute(clang::fallthrough)
|
386
|
+
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
|
387
|
+
#elif __has_cpp_attribute(gnu::fallthrough)
|
388
|
+
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
|
389
|
+
#endif
|
390
|
+
#endif
|
391
|
+
#ifndef CYTHON_FALLTHROUGH
|
392
|
+
#if __has_attribute(fallthrough)
|
393
|
+
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
|
394
|
+
#else
|
395
|
+
#define CYTHON_FALLTHROUGH
|
396
|
+
#endif
|
397
|
+
#endif
|
398
|
+
#if defined(__clang__ ) && defined(__apple_build_version__)
|
399
|
+
#if __apple_build_version__ < 7000000
|
400
|
+
#undef CYTHON_FALLTHROUGH
|
401
|
+
#define CYTHON_FALLTHROUGH
|
402
|
+
#endif
|
403
|
+
#endif
|
404
|
+
#endif
|
405
|
+
|
406
|
+
#ifndef CYTHON_INLINE
|
407
|
+
#if defined(__clang__)
|
408
|
+
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
|
409
|
+
#elif defined(__GNUC__)
|
410
|
+
#define CYTHON_INLINE __inline__
|
411
|
+
#elif defined(_MSC_VER)
|
412
|
+
#define CYTHON_INLINE __inline
|
413
|
+
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
414
|
+
#define CYTHON_INLINE inline
|
415
|
+
#else
|
416
|
+
#define CYTHON_INLINE
|
417
|
+
#endif
|
418
|
+
#endif
|
419
|
+
|
420
|
+
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
|
421
|
+
#define Py_OptimizeFlag 0
|
422
|
+
#endif
|
423
|
+
#define __PYX_BUILD_PY_SSIZE_T "n"
|
424
|
+
#define CYTHON_FORMAT_SSIZE_T "z"
|
425
|
+
#if PY_MAJOR_VERSION < 3
|
426
|
+
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
|
427
|
+
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
|
428
|
+
PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
429
|
+
#define __Pyx_DefaultClassType PyClass_Type
|
430
|
+
#else
|
431
|
+
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
|
432
|
+
#define __Pyx_DefaultClassType PyType_Type
|
433
|
+
#if PY_VERSION_HEX >= 0x030B00A1
|
434
|
+
static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
|
435
|
+
PyObject *code, PyObject *c, PyObject* n, PyObject *v,
|
436
|
+
PyObject *fv, PyObject *cell, PyObject* fn,
|
437
|
+
PyObject *name, int fline, PyObject *lnos) {
|
438
|
+
PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
|
439
|
+
PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
|
440
|
+
const char *fn_cstr=NULL;
|
441
|
+
const char *name_cstr=NULL;
|
442
|
+
PyCodeObject* co=NULL;
|
443
|
+
PyObject *type, *value, *traceback;
|
444
|
+
PyErr_Fetch(&type, &value, &traceback);
|
445
|
+
if (!(kwds=PyDict_New())) goto end;
|
446
|
+
if (!(argcount=PyLong_FromLong(a))) goto end;
|
447
|
+
if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
|
448
|
+
if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
|
449
|
+
if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
|
450
|
+
if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
|
451
|
+
if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
|
452
|
+
if (!(nlocals=PyLong_FromLong(l))) goto end;
|
453
|
+
if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
|
454
|
+
if (!(stacksize=PyLong_FromLong(s))) goto end;
|
455
|
+
if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
|
456
|
+
if (!(flags=PyLong_FromLong(f))) goto end;
|
457
|
+
if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
|
458
|
+
if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
|
459
|
+
if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
|
460
|
+
if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
|
461
|
+
if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
|
462
|
+
if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
|
463
|
+
if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
|
464
|
+
if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
|
465
|
+
if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
|
466
|
+
if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
|
467
|
+
if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
|
468
|
+
if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
|
469
|
+
if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
|
470
|
+
if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
|
471
|
+
Py_XDECREF((PyObject*)co);
|
472
|
+
co = (PyCodeObject*)call_result;
|
473
|
+
call_result = NULL;
|
474
|
+
if (0) {
|
475
|
+
cleanup_code_too:
|
476
|
+
Py_XDECREF((PyObject*)co);
|
477
|
+
co = NULL;
|
478
|
+
}
|
479
|
+
end:
|
480
|
+
Py_XDECREF(kwds);
|
481
|
+
Py_XDECREF(argcount);
|
482
|
+
Py_XDECREF(posonlyargcount);
|
483
|
+
Py_XDECREF(kwonlyargcount);
|
484
|
+
Py_XDECREF(nlocals);
|
485
|
+
Py_XDECREF(stacksize);
|
486
|
+
Py_XDECREF(replace);
|
487
|
+
Py_XDECREF(call_result);
|
488
|
+
Py_XDECREF(empty);
|
489
|
+
if (type) {
|
490
|
+
PyErr_Restore(type, value, traceback);
|
491
|
+
}
|
492
|
+
return co;
|
493
|
+
}
|
494
|
+
#else
|
495
|
+
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
|
496
|
+
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
497
|
+
#endif
|
498
|
+
#define __Pyx_DefaultClassType PyType_Type
|
499
|
+
#endif
|
500
|
+
#ifndef Py_TPFLAGS_CHECKTYPES
|
501
|
+
#define Py_TPFLAGS_CHECKTYPES 0
|
502
|
+
#endif
|
503
|
+
#ifndef Py_TPFLAGS_HAVE_INDEX
|
504
|
+
#define Py_TPFLAGS_HAVE_INDEX 0
|
505
|
+
#endif
|
506
|
+
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
|
507
|
+
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
|
508
|
+
#endif
|
509
|
+
#ifndef Py_TPFLAGS_HAVE_FINALIZE
|
510
|
+
#define Py_TPFLAGS_HAVE_FINALIZE 0
|
511
|
+
#endif
|
512
|
+
#ifndef METH_STACKLESS
|
513
|
+
#define METH_STACKLESS 0
|
514
|
+
#endif
|
515
|
+
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
|
516
|
+
#ifndef METH_FASTCALL
|
517
|
+
#define METH_FASTCALL 0x80
|
518
|
+
#endif
|
519
|
+
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
|
520
|
+
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
|
521
|
+
Py_ssize_t nargs, PyObject *kwnames);
|
522
|
+
#else
|
523
|
+
#define __Pyx_PyCFunctionFast _PyCFunctionFast
|
524
|
+
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
|
525
|
+
#endif
|
526
|
+
#if CYTHON_FAST_PYCCALL
|
527
|
+
#define __Pyx_PyFastCFunction_Check(func)\
|
528
|
+
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
|
529
|
+
#else
|
530
|
+
#define __Pyx_PyFastCFunction_Check(func) 0
|
531
|
+
#endif
|
532
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
|
533
|
+
#define PyObject_Malloc(s) PyMem_Malloc(s)
|
534
|
+
#define PyObject_Free(p) PyMem_Free(p)
|
535
|
+
#define PyObject_Realloc(p) PyMem_Realloc(p)
|
536
|
+
#endif
|
537
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
|
538
|
+
#define PyMem_RawMalloc(n) PyMem_Malloc(n)
|
539
|
+
#define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
|
540
|
+
#define PyMem_RawFree(p) PyMem_Free(p)
|
541
|
+
#endif
|
542
|
+
#if CYTHON_COMPILING_IN_PYSTON
|
543
|
+
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
|
544
|
+
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
|
545
|
+
#else
|
546
|
+
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
|
547
|
+
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
|
548
|
+
#endif
|
549
|
+
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
|
550
|
+
#define __Pyx_PyThreadState_Current PyThreadState_GET()
|
551
|
+
#elif PY_VERSION_HEX >= 0x03060000
|
552
|
+
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
|
553
|
+
#elif PY_VERSION_HEX >= 0x03000000
|
554
|
+
#define __Pyx_PyThreadState_Current PyThreadState_GET()
|
555
|
+
#else
|
556
|
+
#define __Pyx_PyThreadState_Current _PyThreadState_Current
|
557
|
+
#endif
|
558
|
+
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
|
559
|
+
#include "pythread.h"
|
560
|
+
#define Py_tss_NEEDS_INIT 0
|
561
|
+
typedef int Py_tss_t;
|
562
|
+
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
|
563
|
+
*key = PyThread_create_key();
|
564
|
+
return 0;
|
565
|
+
}
|
566
|
+
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
|
567
|
+
Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
|
568
|
+
*key = Py_tss_NEEDS_INIT;
|
569
|
+
return key;
|
570
|
+
}
|
571
|
+
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
|
572
|
+
PyObject_Free(key);
|
573
|
+
}
|
574
|
+
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
|
575
|
+
return *key != Py_tss_NEEDS_INIT;
|
576
|
+
}
|
577
|
+
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
|
578
|
+
PyThread_delete_key(*key);
|
579
|
+
*key = Py_tss_NEEDS_INIT;
|
580
|
+
}
|
581
|
+
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
|
582
|
+
return PyThread_set_key_value(*key, value);
|
583
|
+
}
|
584
|
+
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
585
|
+
return PyThread_get_key_value(*key);
|
586
|
+
}
|
587
|
+
#endif
|
588
|
+
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
|
589
|
+
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
|
590
|
+
#else
|
591
|
+
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
|
592
|
+
#endif
|
593
|
+
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
|
594
|
+
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
|
595
|
+
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
|
596
|
+
#else
|
597
|
+
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
|
598
|
+
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
|
599
|
+
#endif
|
600
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
|
601
|
+
#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
|
602
|
+
#else
|
603
|
+
#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
|
604
|
+
#endif
|
605
|
+
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
|
606
|
+
#define CYTHON_PEP393_ENABLED 1
|
607
|
+
#if PY_VERSION_HEX >= 0x030C0000
|
608
|
+
#define __Pyx_PyUnicode_READY(op) (0)
|
609
|
+
#else
|
610
|
+
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
|
611
|
+
0 : _PyUnicode_Ready((PyObject *)(op)))
|
612
|
+
#endif
|
613
|
+
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
|
614
|
+
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
|
615
|
+
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
|
616
|
+
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
|
617
|
+
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
|
618
|
+
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
|
619
|
+
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
|
620
|
+
#if PY_VERSION_HEX >= 0x030C0000
|
621
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
|
622
|
+
#else
|
623
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
|
624
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
|
625
|
+
#else
|
626
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
|
627
|
+
#endif
|
628
|
+
#endif
|
629
|
+
#else
|
630
|
+
#define CYTHON_PEP393_ENABLED 0
|
631
|
+
#define PyUnicode_1BYTE_KIND 1
|
632
|
+
#define PyUnicode_2BYTE_KIND 2
|
633
|
+
#define PyUnicode_4BYTE_KIND 4
|
634
|
+
#define __Pyx_PyUnicode_READY(op) (0)
|
635
|
+
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
|
636
|
+
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
|
637
|
+
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
|
638
|
+
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
|
639
|
+
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
|
640
|
+
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
|
641
|
+
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
|
642
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
|
643
|
+
#endif
|
644
|
+
#if CYTHON_COMPILING_IN_PYPY
|
645
|
+
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
|
646
|
+
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
|
647
|
+
#else
|
648
|
+
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
|
649
|
+
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
|
650
|
+
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
|
651
|
+
#endif
|
652
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
|
653
|
+
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
|
654
|
+
#endif
|
655
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
|
656
|
+
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
|
657
|
+
#endif
|
658
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
|
659
|
+
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
|
660
|
+
#endif
|
661
|
+
#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))
|
662
|
+
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
|
663
|
+
#if PY_MAJOR_VERSION >= 3
|
664
|
+
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
|
665
|
+
#else
|
666
|
+
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
|
667
|
+
#endif
|
668
|
+
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
|
669
|
+
#define PyObject_ASCII(o) PyObject_Repr(o)
|
670
|
+
#endif
|
671
|
+
#if PY_MAJOR_VERSION >= 3
|
672
|
+
#define PyBaseString_Type PyUnicode_Type
|
673
|
+
#define PyStringObject PyUnicodeObject
|
674
|
+
#define PyString_Type PyUnicode_Type
|
675
|
+
#define PyString_Check PyUnicode_Check
|
676
|
+
#define PyString_CheckExact PyUnicode_CheckExact
|
677
|
+
#ifndef PyObject_Unicode
|
678
|
+
#define PyObject_Unicode PyObject_Str
|
679
|
+
#endif
|
680
|
+
#endif
|
681
|
+
#if PY_MAJOR_VERSION >= 3
|
682
|
+
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
|
683
|
+
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
|
684
|
+
#else
|
685
|
+
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
|
686
|
+
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
|
687
|
+
#endif
|
688
|
+
#ifndef PySet_CheckExact
|
689
|
+
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
|
690
|
+
#endif
|
691
|
+
#if PY_VERSION_HEX >= 0x030900A4
|
692
|
+
#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
|
693
|
+
#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
|
694
|
+
#else
|
695
|
+
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
|
696
|
+
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
|
697
|
+
#endif
|
698
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
699
|
+
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
|
700
|
+
#else
|
701
|
+
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
|
702
|
+
#endif
|
703
|
+
#if PY_MAJOR_VERSION >= 3
|
704
|
+
#define PyIntObject PyLongObject
|
705
|
+
#define PyInt_Type PyLong_Type
|
706
|
+
#define PyInt_Check(op) PyLong_Check(op)
|
707
|
+
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
|
708
|
+
#define PyInt_FromString PyLong_FromString
|
709
|
+
#define PyInt_FromUnicode PyLong_FromUnicode
|
710
|
+
#define PyInt_FromLong PyLong_FromLong
|
711
|
+
#define PyInt_FromSize_t PyLong_FromSize_t
|
712
|
+
#define PyInt_FromSsize_t PyLong_FromSsize_t
|
713
|
+
#define PyInt_AsLong PyLong_AsLong
|
714
|
+
#define PyInt_AS_LONG PyLong_AS_LONG
|
715
|
+
#define PyInt_AsSsize_t PyLong_AsSsize_t
|
716
|
+
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
|
717
|
+
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
|
718
|
+
#define PyNumber_Int PyNumber_Long
|
719
|
+
#endif
|
720
|
+
#if PY_MAJOR_VERSION >= 3
|
721
|
+
#define PyBoolObject PyLongObject
|
722
|
+
#endif
|
723
|
+
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
|
724
|
+
#ifndef PyUnicode_InternFromString
|
725
|
+
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
|
726
|
+
#endif
|
727
|
+
#endif
|
728
|
+
#if PY_VERSION_HEX < 0x030200A4
|
729
|
+
typedef long Py_hash_t;
|
730
|
+
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
|
731
|
+
#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
|
732
|
+
#else
|
733
|
+
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
|
734
|
+
#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
|
735
|
+
#endif
|
736
|
+
#if PY_MAJOR_VERSION >= 3
|
737
|
+
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
|
738
|
+
#else
|
739
|
+
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
|
740
|
+
#endif
|
741
|
+
#if CYTHON_USE_ASYNC_SLOTS
|
742
|
+
#if PY_VERSION_HEX >= 0x030500B1
|
743
|
+
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
|
744
|
+
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
|
745
|
+
#else
|
746
|
+
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
|
747
|
+
#endif
|
748
|
+
#else
|
749
|
+
#define __Pyx_PyType_AsAsync(obj) NULL
|
750
|
+
#endif
|
751
|
+
#ifndef __Pyx_PyAsyncMethodsStruct
|
752
|
+
typedef struct {
|
753
|
+
unaryfunc am_await;
|
754
|
+
unaryfunc am_aiter;
|
755
|
+
unaryfunc am_anext;
|
756
|
+
} __Pyx_PyAsyncMethodsStruct;
|
757
|
+
#endif
|
758
|
+
|
759
|
+
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
|
760
|
+
#if !defined(_USE_MATH_DEFINES)
|
761
|
+
#define _USE_MATH_DEFINES
|
762
|
+
#endif
|
763
|
+
#endif
|
764
|
+
#include <math.h>
|
765
|
+
#ifdef NAN
|
766
|
+
#define __PYX_NAN() ((float) NAN)
|
767
|
+
#else
|
768
|
+
static CYTHON_INLINE float __PYX_NAN() {
|
769
|
+
float value;
|
770
|
+
memset(&value, 0xFF, sizeof(value));
|
771
|
+
return value;
|
772
|
+
}
|
773
|
+
#endif
|
774
|
+
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
|
775
|
+
#define __Pyx_truncl trunc
|
776
|
+
#else
|
777
|
+
#define __Pyx_truncl truncl
|
778
|
+
#endif
|
779
|
+
|
780
|
+
#define __PYX_MARK_ERR_POS(f_index, lineno) \
|
781
|
+
{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
|
782
|
+
#define __PYX_ERR(f_index, lineno, Ln_error) \
|
783
|
+
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
|
784
|
+
|
785
|
+
#ifndef __PYX_EXTERN_C
|
786
|
+
#ifdef __cplusplus
|
787
|
+
#define __PYX_EXTERN_C extern "C"
|
788
|
+
#else
|
789
|
+
#define __PYX_EXTERN_C extern
|
790
|
+
#endif
|
791
|
+
#endif
|
792
|
+
|
793
|
+
#define __PYX_HAVE__manimpango__fonts__enums
|
794
|
+
#define __PYX_HAVE_API__manimpango__fonts__enums
|
795
|
+
/* Early includes */
|
796
|
+
#include "cairo.h"
|
797
|
+
#include "cairo-svg.h"
|
798
|
+
#include "glib.h"
|
799
|
+
#include "pango/pango.h"
|
800
|
+
#include "pango/pangocairo.h"
|
801
|
+
|
802
|
+
#if PANGO_VERSION_CHECK(1,44,0)
|
803
|
+
int set_line_width(PangoLayout *layout,float spacing)
|
804
|
+
{
|
805
|
+
pango_layout_set_line_spacing(layout, spacing);
|
806
|
+
return 1;
|
807
|
+
}
|
808
|
+
#else
|
809
|
+
int set_line_width(PangoLayout *layout,float spacing){return 0;}
|
810
|
+
#endif
|
811
|
+
|
812
|
+
#ifdef _OPENMP
|
813
|
+
#include <omp.h>
|
814
|
+
#endif /* _OPENMP */
|
815
|
+
|
816
|
+
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
|
817
|
+
#define CYTHON_WITHOUT_ASSERTIONS
|
818
|
+
#endif
|
819
|
+
|
820
|
+
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
|
821
|
+
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
|
822
|
+
|
823
|
+
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
|
824
|
+
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
|
825
|
+
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
|
826
|
+
#define __PYX_DEFAULT_STRING_ENCODING ""
|
827
|
+
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
|
828
|
+
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
829
|
+
#define __Pyx_uchar_cast(c) ((unsigned char)c)
|
830
|
+
#define __Pyx_long_cast(x) ((long)x)
|
831
|
+
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
|
832
|
+
(sizeof(type) < sizeof(Py_ssize_t)) ||\
|
833
|
+
(sizeof(type) > sizeof(Py_ssize_t) &&\
|
834
|
+
likely(v < (type)PY_SSIZE_T_MAX ||\
|
835
|
+
v == (type)PY_SSIZE_T_MAX) &&\
|
836
|
+
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
|
837
|
+
v == (type)PY_SSIZE_T_MIN))) ||\
|
838
|
+
(sizeof(type) == sizeof(Py_ssize_t) &&\
|
839
|
+
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
|
840
|
+
v == (type)PY_SSIZE_T_MAX))) )
|
841
|
+
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
|
842
|
+
return (size_t) i < (size_t) limit;
|
843
|
+
}
|
844
|
+
#if defined (__cplusplus) && __cplusplus >= 201103L
|
845
|
+
#include <cstdlib>
|
846
|
+
#define __Pyx_sst_abs(value) std::abs(value)
|
847
|
+
#elif SIZEOF_INT >= SIZEOF_SIZE_T
|
848
|
+
#define __Pyx_sst_abs(value) abs(value)
|
849
|
+
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
|
850
|
+
#define __Pyx_sst_abs(value) labs(value)
|
851
|
+
#elif defined (_MSC_VER)
|
852
|
+
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
|
853
|
+
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
854
|
+
#define __Pyx_sst_abs(value) llabs(value)
|
855
|
+
#elif defined (__GNUC__)
|
856
|
+
#define __Pyx_sst_abs(value) __builtin_llabs(value)
|
857
|
+
#else
|
858
|
+
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
|
859
|
+
#endif
|
860
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
|
861
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
|
862
|
+
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
|
863
|
+
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
|
864
|
+
#define __Pyx_PyBytes_FromString PyBytes_FromString
|
865
|
+
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
|
866
|
+
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
|
867
|
+
#if PY_MAJOR_VERSION < 3
|
868
|
+
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
|
869
|
+
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
870
|
+
#else
|
871
|
+
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
|
872
|
+
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
|
873
|
+
#endif
|
874
|
+
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
|
875
|
+
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
|
876
|
+
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
|
877
|
+
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
|
878
|
+
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
|
879
|
+
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
|
880
|
+
#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
|
881
|
+
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
|
882
|
+
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
|
883
|
+
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
|
884
|
+
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
|
885
|
+
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
|
886
|
+
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
|
887
|
+
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
|
888
|
+
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
|
889
|
+
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
|
890
|
+
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
|
891
|
+
const Py_UNICODE *u_end = u;
|
892
|
+
while (*u_end++) ;
|
893
|
+
return (size_t)(u_end - u - 1);
|
894
|
+
}
|
895
|
+
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
|
896
|
+
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
|
897
|
+
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
898
|
+
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
|
899
|
+
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
|
900
|
+
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
|
901
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
|
902
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
|
903
|
+
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
|
904
|
+
#define __Pyx_PySequence_Tuple(obj)\
|
905
|
+
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
|
906
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
|
907
|
+
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
|
908
|
+
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
909
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
910
|
+
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
|
911
|
+
#else
|
912
|
+
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
|
913
|
+
#endif
|
914
|
+
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
|
915
|
+
#if PY_MAJOR_VERSION >= 3
|
916
|
+
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
|
917
|
+
#else
|
918
|
+
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
|
919
|
+
#endif
|
920
|
+
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
|
921
|
+
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
922
|
+
static int __Pyx_sys_getdefaultencoding_not_ascii;
|
923
|
+
static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
924
|
+
PyObject* sys;
|
925
|
+
PyObject* default_encoding = NULL;
|
926
|
+
PyObject* ascii_chars_u = NULL;
|
927
|
+
PyObject* ascii_chars_b = NULL;
|
928
|
+
const char* default_encoding_c;
|
929
|
+
sys = PyImport_ImportModule("sys");
|
930
|
+
if (!sys) goto bad;
|
931
|
+
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
|
932
|
+
Py_DECREF(sys);
|
933
|
+
if (!default_encoding) goto bad;
|
934
|
+
default_encoding_c = PyBytes_AsString(default_encoding);
|
935
|
+
if (!default_encoding_c) goto bad;
|
936
|
+
if (strcmp(default_encoding_c, "ascii") == 0) {
|
937
|
+
__Pyx_sys_getdefaultencoding_not_ascii = 0;
|
938
|
+
} else {
|
939
|
+
char ascii_chars[128];
|
940
|
+
int c;
|
941
|
+
for (c = 0; c < 128; c++) {
|
942
|
+
ascii_chars[c] = c;
|
943
|
+
}
|
944
|
+
__Pyx_sys_getdefaultencoding_not_ascii = 1;
|
945
|
+
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
|
946
|
+
if (!ascii_chars_u) goto bad;
|
947
|
+
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
|
948
|
+
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
|
949
|
+
PyErr_Format(
|
950
|
+
PyExc_ValueError,
|
951
|
+
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
|
952
|
+
default_encoding_c);
|
953
|
+
goto bad;
|
954
|
+
}
|
955
|
+
Py_DECREF(ascii_chars_u);
|
956
|
+
Py_DECREF(ascii_chars_b);
|
957
|
+
}
|
958
|
+
Py_DECREF(default_encoding);
|
959
|
+
return 0;
|
960
|
+
bad:
|
961
|
+
Py_XDECREF(default_encoding);
|
962
|
+
Py_XDECREF(ascii_chars_u);
|
963
|
+
Py_XDECREF(ascii_chars_b);
|
964
|
+
return -1;
|
965
|
+
}
|
966
|
+
#endif
|
967
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
|
968
|
+
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
|
969
|
+
#else
|
970
|
+
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
|
971
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
972
|
+
static char* __PYX_DEFAULT_STRING_ENCODING;
|
973
|
+
static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
974
|
+
PyObject* sys;
|
975
|
+
PyObject* default_encoding = NULL;
|
976
|
+
char* default_encoding_c;
|
977
|
+
sys = PyImport_ImportModule("sys");
|
978
|
+
if (!sys) goto bad;
|
979
|
+
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
|
980
|
+
Py_DECREF(sys);
|
981
|
+
if (!default_encoding) goto bad;
|
982
|
+
default_encoding_c = PyBytes_AsString(default_encoding);
|
983
|
+
if (!default_encoding_c) goto bad;
|
984
|
+
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
|
985
|
+
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
|
986
|
+
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
|
987
|
+
Py_DECREF(default_encoding);
|
988
|
+
return 0;
|
989
|
+
bad:
|
990
|
+
Py_XDECREF(default_encoding);
|
991
|
+
return -1;
|
992
|
+
}
|
993
|
+
#endif
|
994
|
+
#endif
|
995
|
+
|
996
|
+
|
997
|
+
/* Test for GCC > 2.95 */
|
998
|
+
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
|
999
|
+
#define likely(x) __builtin_expect(!!(x), 1)
|
1000
|
+
#define unlikely(x) __builtin_expect(!!(x), 0)
|
1001
|
+
#else /* !__GNUC__ or GCC < 2.95 */
|
1002
|
+
#define likely(x) (x)
|
1003
|
+
#define unlikely(x) (x)
|
1004
|
+
#endif /* __GNUC__ */
|
1005
|
+
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
|
1006
|
+
|
1007
|
+
static PyObject *__pyx_m = NULL;
|
1008
|
+
static PyObject *__pyx_d;
|
1009
|
+
static PyObject *__pyx_b;
|
1010
|
+
static PyObject *__pyx_cython_runtime = NULL;
|
1011
|
+
static PyObject *__pyx_empty_tuple;
|
1012
|
+
static PyObject *__pyx_empty_bytes;
|
1013
|
+
static PyObject *__pyx_empty_unicode;
|
1014
|
+
static int __pyx_lineno;
|
1015
|
+
static int __pyx_clineno = 0;
|
1016
|
+
static const char * __pyx_cfilenm= __FILE__;
|
1017
|
+
static const char *__pyx_filename;
|
1018
|
+
|
1019
|
+
|
1020
|
+
static const char *__pyx_f[] = {
|
1021
|
+
"manimpango\\fonts\\enums.pyx",
|
1022
|
+
};
|
1023
|
+
|
1024
|
+
/*--- Type declarations ---*/
|
1025
|
+
|
1026
|
+
/* --- Runtime support code (head) --- */
|
1027
|
+
/* Refnanny.proto */
|
1028
|
+
#ifndef CYTHON_REFNANNY
|
1029
|
+
#define CYTHON_REFNANNY 0
|
1030
|
+
#endif
|
1031
|
+
#if CYTHON_REFNANNY
|
1032
|
+
typedef struct {
|
1033
|
+
void (*INCREF)(void*, PyObject*, int);
|
1034
|
+
void (*DECREF)(void*, PyObject*, int);
|
1035
|
+
void (*GOTREF)(void*, PyObject*, int);
|
1036
|
+
void (*GIVEREF)(void*, PyObject*, int);
|
1037
|
+
void* (*SetupContext)(const char*, int, const char*);
|
1038
|
+
void (*FinishContext)(void**);
|
1039
|
+
} __Pyx_RefNannyAPIStruct;
|
1040
|
+
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
|
1041
|
+
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
|
1042
|
+
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
|
1043
|
+
#ifdef WITH_THREAD
|
1044
|
+
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
|
1045
|
+
if (acquire_gil) {\
|
1046
|
+
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
|
1047
|
+
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
|
1048
|
+
PyGILState_Release(__pyx_gilstate_save);\
|
1049
|
+
} else {\
|
1050
|
+
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
|
1051
|
+
}
|
1052
|
+
#else
|
1053
|
+
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
|
1054
|
+
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
|
1055
|
+
#endif
|
1056
|
+
#define __Pyx_RefNannyFinishContext()\
|
1057
|
+
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
|
1058
|
+
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
1059
|
+
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
1060
|
+
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
1061
|
+
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
1062
|
+
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
|
1063
|
+
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
|
1064
|
+
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
|
1065
|
+
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
|
1066
|
+
#else
|
1067
|
+
#define __Pyx_RefNannyDeclarations
|
1068
|
+
#define __Pyx_RefNannySetupContext(name, acquire_gil)
|
1069
|
+
#define __Pyx_RefNannyFinishContext()
|
1070
|
+
#define __Pyx_INCREF(r) Py_INCREF(r)
|
1071
|
+
#define __Pyx_DECREF(r) Py_DECREF(r)
|
1072
|
+
#define __Pyx_GOTREF(r)
|
1073
|
+
#define __Pyx_GIVEREF(r)
|
1074
|
+
#define __Pyx_XINCREF(r) Py_XINCREF(r)
|
1075
|
+
#define __Pyx_XDECREF(r) Py_XDECREF(r)
|
1076
|
+
#define __Pyx_XGOTREF(r)
|
1077
|
+
#define __Pyx_XGIVEREF(r)
|
1078
|
+
#endif
|
1079
|
+
#define __Pyx_XDECREF_SET(r, v) do {\
|
1080
|
+
PyObject *tmp = (PyObject *) r;\
|
1081
|
+
r = v; __Pyx_XDECREF(tmp);\
|
1082
|
+
} while (0)
|
1083
|
+
#define __Pyx_DECREF_SET(r, v) do {\
|
1084
|
+
PyObject *tmp = (PyObject *) r;\
|
1085
|
+
r = v; __Pyx_DECREF(tmp);\
|
1086
|
+
} while (0)
|
1087
|
+
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
|
1088
|
+
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
|
1089
|
+
|
1090
|
+
/* PyObjectGetAttrStr.proto */
|
1091
|
+
#if CYTHON_USE_TYPE_SLOTS
|
1092
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
|
1093
|
+
#else
|
1094
|
+
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
|
1095
|
+
#endif
|
1096
|
+
|
1097
|
+
/* Import.proto */
|
1098
|
+
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
|
1099
|
+
|
1100
|
+
/* ImportFrom.proto */
|
1101
|
+
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
|
1102
|
+
|
1103
|
+
/* GetBuiltinName.proto */
|
1104
|
+
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
|
1105
|
+
|
1106
|
+
/* PyDictVersioning.proto */
|
1107
|
+
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
|
1108
|
+
#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
|
1109
|
+
#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
|
1110
|
+
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
|
1111
|
+
(version_var) = __PYX_GET_DICT_VERSION(dict);\
|
1112
|
+
(cache_var) = (value);
|
1113
|
+
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
|
1114
|
+
static PY_UINT64_T __pyx_dict_version = 0;\
|
1115
|
+
static PyObject *__pyx_dict_cached_value = NULL;\
|
1116
|
+
if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
|
1117
|
+
(VAR) = __pyx_dict_cached_value;\
|
1118
|
+
} else {\
|
1119
|
+
(VAR) = __pyx_dict_cached_value = (LOOKUP);\
|
1120
|
+
__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
|
1121
|
+
}\
|
1122
|
+
}
|
1123
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
|
1124
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
|
1125
|
+
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
|
1126
|
+
#else
|
1127
|
+
#define __PYX_GET_DICT_VERSION(dict) (0)
|
1128
|
+
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
|
1129
|
+
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
|
1130
|
+
#endif
|
1131
|
+
|
1132
|
+
/* GetModuleGlobalName.proto */
|
1133
|
+
#if CYTHON_USE_DICT_VERSIONS
|
1134
|
+
#define __Pyx_GetModuleGlobalName(var, name) do {\
|
1135
|
+
static PY_UINT64_T __pyx_dict_version = 0;\
|
1136
|
+
static PyObject *__pyx_dict_cached_value = NULL;\
|
1137
|
+
(var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
|
1138
|
+
(likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
|
1139
|
+
__Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
|
1140
|
+
} while(0)
|
1141
|
+
#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
|
1142
|
+
PY_UINT64_T __pyx_dict_version;\
|
1143
|
+
PyObject *__pyx_dict_cached_value;\
|
1144
|
+
(var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
|
1145
|
+
} while(0)
|
1146
|
+
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
|
1147
|
+
#else
|
1148
|
+
#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
|
1149
|
+
#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
|
1150
|
+
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
|
1151
|
+
#endif
|
1152
|
+
|
1153
|
+
/* CalculateMetaclass.proto */
|
1154
|
+
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
|
1155
|
+
|
1156
|
+
/* SetNameInClass.proto */
|
1157
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
|
1158
|
+
#define __Pyx_SetNameInClass(ns, name, value)\
|
1159
|
+
(likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
|
1160
|
+
#elif CYTHON_COMPILING_IN_CPYTHON
|
1161
|
+
#define __Pyx_SetNameInClass(ns, name, value)\
|
1162
|
+
(likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
|
1163
|
+
#else
|
1164
|
+
#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
|
1165
|
+
#endif
|
1166
|
+
|
1167
|
+
/* Py3ClassCreate.proto */
|
1168
|
+
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
|
1169
|
+
PyObject *mkw, PyObject *modname, PyObject *doc);
|
1170
|
+
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
|
1171
|
+
PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
|
1172
|
+
|
1173
|
+
/* PyThreadStateGet.proto */
|
1174
|
+
#if CYTHON_FAST_THREAD_STATE
|
1175
|
+
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
|
1176
|
+
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
|
1177
|
+
#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
|
1178
|
+
#else
|
1179
|
+
#define __Pyx_PyThreadState_declare
|
1180
|
+
#define __Pyx_PyThreadState_assign
|
1181
|
+
#define __Pyx_PyErr_Occurred() PyErr_Occurred()
|
1182
|
+
#endif
|
1183
|
+
|
1184
|
+
/* PyErrFetchRestore.proto */
|
1185
|
+
#if CYTHON_FAST_THREAD_STATE
|
1186
|
+
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
|
1187
|
+
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
|
1188
|
+
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
|
1189
|
+
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
|
1190
|
+
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
|
1191
|
+
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
|
1192
|
+
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
|
1193
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
1194
|
+
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
|
1195
|
+
#else
|
1196
|
+
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
1197
|
+
#endif
|
1198
|
+
#else
|
1199
|
+
#define __Pyx_PyErr_Clear() PyErr_Clear()
|
1200
|
+
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
1201
|
+
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
|
1202
|
+
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
|
1203
|
+
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
|
1204
|
+
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
|
1205
|
+
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
|
1206
|
+
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
|
1207
|
+
#endif
|
1208
|
+
|
1209
|
+
/* CLineInTraceback.proto */
|
1210
|
+
#ifdef CYTHON_CLINE_IN_TRACEBACK
|
1211
|
+
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
|
1212
|
+
#else
|
1213
|
+
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
|
1214
|
+
#endif
|
1215
|
+
|
1216
|
+
/* CodeObjectCache.proto */
|
1217
|
+
typedef struct {
|
1218
|
+
PyCodeObject* code_object;
|
1219
|
+
int code_line;
|
1220
|
+
} __Pyx_CodeObjectCacheEntry;
|
1221
|
+
struct __Pyx_CodeObjectCache {
|
1222
|
+
int count;
|
1223
|
+
int max_count;
|
1224
|
+
__Pyx_CodeObjectCacheEntry* entries;
|
1225
|
+
};
|
1226
|
+
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
|
1227
|
+
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
|
1228
|
+
static PyCodeObject *__pyx_find_code_object(int code_line);
|
1229
|
+
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
|
1230
|
+
|
1231
|
+
/* AddTraceback.proto */
|
1232
|
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
1233
|
+
int py_line, const char *filename);
|
1234
|
+
|
1235
|
+
/* GCCDiagnostics.proto */
|
1236
|
+
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
1237
|
+
#define __Pyx_HAS_GCC_DIAGNOSTIC
|
1238
|
+
#endif
|
1239
|
+
|
1240
|
+
/* CIntToPy.proto */
|
1241
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoStyle(PangoStyle value);
|
1242
|
+
|
1243
|
+
/* CIntToPy.proto */
|
1244
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoWeight(PangoWeight value);
|
1245
|
+
|
1246
|
+
/* CIntToPy.proto */
|
1247
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoVariant(PangoVariant value);
|
1248
|
+
|
1249
|
+
/* CIntToPy.proto */
|
1250
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
|
1251
|
+
|
1252
|
+
/* CIntFromPy.proto */
|
1253
|
+
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
|
1254
|
+
|
1255
|
+
/* CIntFromPy.proto */
|
1256
|
+
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
|
1257
|
+
|
1258
|
+
/* FastTypeChecks.proto */
|
1259
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
1260
|
+
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
|
1261
|
+
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
|
1262
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
|
1263
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
|
1264
|
+
#else
|
1265
|
+
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
|
1266
|
+
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
|
1267
|
+
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
|
1268
|
+
#endif
|
1269
|
+
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
|
1270
|
+
|
1271
|
+
/* CheckBinaryVersion.proto */
|
1272
|
+
static int __Pyx_check_binary_version(void);
|
1273
|
+
|
1274
|
+
/* InitStrings.proto */
|
1275
|
+
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
|
1276
|
+
|
1277
|
+
|
1278
|
+
/* Module declarations from 'cairo' */
|
1279
|
+
|
1280
|
+
/* Module declarations from 'glib' */
|
1281
|
+
|
1282
|
+
/* Module declarations from 'pango_attributes' */
|
1283
|
+
|
1284
|
+
/* Module declarations from 'pango' */
|
1285
|
+
|
1286
|
+
/* Module declarations from 'manimpango.fonts.enums' */
|
1287
|
+
#define __Pyx_MODULE_NAME "manimpango.fonts.enums"
|
1288
|
+
extern int __pyx_module_is_main_manimpango__fonts__enums;
|
1289
|
+
int __pyx_module_is_main_manimpango__fonts__enums = 0;
|
1290
|
+
|
1291
|
+
/* Implementation of 'manimpango.fonts.enums' */
|
1292
|
+
static const char __pyx_k_all[] = "__all__";
|
1293
|
+
static const char __pyx_k_doc[] = "__doc__";
|
1294
|
+
static const char __pyx_k_BOLD[] = "BOLD";
|
1295
|
+
static const char __pyx_k_BOOK[] = "BOOK";
|
1296
|
+
static const char __pyx_k_Enum[] = "Enum";
|
1297
|
+
static const char __pyx_k_THIN[] = "THIN";
|
1298
|
+
static const char __pyx_k_enum[] = "enum";
|
1299
|
+
static const char __pyx_k_main[] = "__main__";
|
1300
|
+
static const char __pyx_k_name[] = "__name__";
|
1301
|
+
static const char __pyx_k_test[] = "__test__";
|
1302
|
+
static const char __pyx_k_HEAVY[] = "HEAVY";
|
1303
|
+
static const char __pyx_k_LIGHT[] = "LIGHT";
|
1304
|
+
static const char __pyx_k_Style[] = "Style";
|
1305
|
+
static const char __pyx_k_ITALIC[] = "ITALIC";
|
1306
|
+
static const char __pyx_k_MEDIUM[] = "MEDIUM";
|
1307
|
+
static const char __pyx_k_NORMAL[] = "NORMAL";
|
1308
|
+
static const char __pyx_k_Weight[] = "Weight";
|
1309
|
+
static const char __pyx_k_import[] = "__import__";
|
1310
|
+
static const char __pyx_k_module[] = "__module__";
|
1311
|
+
static const char __pyx_k_OBLIQUE[] = "OBLIQUE";
|
1312
|
+
static const char __pyx_k_Variant[] = "Variant";
|
1313
|
+
static const char __pyx_k_prepare[] = "__prepare__";
|
1314
|
+
static const char __pyx_k_SEMIBOLD[] = "SEMIBOLD";
|
1315
|
+
static const char __pyx_k_qualname[] = "__qualname__";
|
1316
|
+
static const char __pyx_k_ULTRABOLD[] = "ULTRABOLD";
|
1317
|
+
static const char __pyx_k_metaclass[] = "__metaclass__";
|
1318
|
+
static const char __pyx_k_SMALL_CAPS[] = "SMALL_CAPS";
|
1319
|
+
static const char __pyx_k_ULTRAHEAVY[] = "ULTRAHEAVY";
|
1320
|
+
static const char __pyx_k_ULTRALIGHT[] = "ULTRALIGHT";
|
1321
|
+
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
|
1322
|
+
static const char __pyx_k_manimpango_fonts_enums[] = "manimpango.fonts.enums";
|
1323
|
+
static const char __pyx_k_An_enumeration_specifying_capit[] = "\n An enumeration specifying capitalization variant of the font.\n\n Attributes\n ----------\n NORMAL:\n A normal font.\n SMALL_CAPS:\n A font with the lower case characters replaced by smaller variants\n of the capital characters.\n ";
|
1324
|
+
static const char __pyx_k_An_enumeration_specifying_the_v[] = "\n An enumeration specifying the various slant styles possible for a font.\n\n Attributes\n ----------\n\n NORMAL:\n the font is upright.\n ITALIC:\n the font is slanted, but in a roman style.\n OBLIQUE:\n the font is slanted in an italic style.\n ";
|
1325
|
+
static const char __pyx_k_An_enumeration_specifying_the_w[] = "\n An enumeration specifying the weight (boldness) of a font.\n This is a numerical value ranging from 100 to 1000, but there are some predefined values\n Using numerical value other then that defined here is not supported.\n\n Attributes\n ----------\n NORMAL:\n the default weight (= 400)\n BOLD:\n the bold weight( = 700)\n THIN:\n the thin weight( = 100; Since: 1.24)\n ULTRALIGHT:\n the ultralight weight( = 200)\n LIGHT:\n the light weight( = 300)\n BOOK:\n the book weight( = 380; Since: 1.24)\n MEDIUM:\n the normal weight( = 500; Since: 1.24)\n SEMIBOLD:\n the semibold weight( = 600)\n ULTRABOLD:\n the ultrabold weight( = 800)\n HEAVY:\n the heavy weight( = 900)\n ULTRAHEAVY:\n the ultraheavy weight( = 1000; Since: 1.24)\n ";
|
1326
|
+
static const char __pyx_k_Contains_Enums_which_defines_tex[] = "Contains Enums which defines text properties from Pango.\n\nMost of these are used in :class:`FontDescription`.\n";
|
1327
|
+
static PyObject *__pyx_kp_s_An_enumeration_specifying_capit;
|
1328
|
+
static PyObject *__pyx_kp_s_An_enumeration_specifying_the_v;
|
1329
|
+
static PyObject *__pyx_kp_s_An_enumeration_specifying_the_w;
|
1330
|
+
static PyObject *__pyx_n_s_BOLD;
|
1331
|
+
static PyObject *__pyx_n_s_BOOK;
|
1332
|
+
static PyObject *__pyx_n_s_Enum;
|
1333
|
+
static PyObject *__pyx_n_s_HEAVY;
|
1334
|
+
static PyObject *__pyx_n_s_ITALIC;
|
1335
|
+
static PyObject *__pyx_n_s_LIGHT;
|
1336
|
+
static PyObject *__pyx_n_s_MEDIUM;
|
1337
|
+
static PyObject *__pyx_n_s_NORMAL;
|
1338
|
+
static PyObject *__pyx_n_s_OBLIQUE;
|
1339
|
+
static PyObject *__pyx_n_s_SEMIBOLD;
|
1340
|
+
static PyObject *__pyx_n_s_SMALL_CAPS;
|
1341
|
+
static PyObject *__pyx_n_s_Style;
|
1342
|
+
static PyObject *__pyx_n_u_Style;
|
1343
|
+
static PyObject *__pyx_n_s_THIN;
|
1344
|
+
static PyObject *__pyx_n_s_ULTRABOLD;
|
1345
|
+
static PyObject *__pyx_n_s_ULTRAHEAVY;
|
1346
|
+
static PyObject *__pyx_n_s_ULTRALIGHT;
|
1347
|
+
static PyObject *__pyx_n_s_Variant;
|
1348
|
+
static PyObject *__pyx_n_u_Variant;
|
1349
|
+
static PyObject *__pyx_n_s_Weight;
|
1350
|
+
static PyObject *__pyx_n_u_Weight;
|
1351
|
+
static PyObject *__pyx_n_s_all;
|
1352
|
+
static PyObject *__pyx_n_s_cline_in_traceback;
|
1353
|
+
static PyObject *__pyx_n_s_doc;
|
1354
|
+
static PyObject *__pyx_n_s_enum;
|
1355
|
+
static PyObject *__pyx_n_s_import;
|
1356
|
+
static PyObject *__pyx_n_s_main;
|
1357
|
+
static PyObject *__pyx_n_s_manimpango_fonts_enums;
|
1358
|
+
static PyObject *__pyx_n_s_metaclass;
|
1359
|
+
static PyObject *__pyx_n_s_module;
|
1360
|
+
static PyObject *__pyx_n_s_name;
|
1361
|
+
static PyObject *__pyx_n_s_prepare;
|
1362
|
+
static PyObject *__pyx_n_s_qualname;
|
1363
|
+
static PyObject *__pyx_n_s_test;
|
1364
|
+
/* Late includes */
|
1365
|
+
|
1366
|
+
static PyMethodDef __pyx_methods[] = {
|
1367
|
+
{0, 0, 0, 0}
|
1368
|
+
};
|
1369
|
+
|
1370
|
+
#if PY_MAJOR_VERSION >= 3
|
1371
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
1372
|
+
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
|
1373
|
+
static int __pyx_pymod_exec_enums(PyObject* module); /*proto*/
|
1374
|
+
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
|
1375
|
+
{Py_mod_create, (void*)__pyx_pymod_create},
|
1376
|
+
{Py_mod_exec, (void*)__pyx_pymod_exec_enums},
|
1377
|
+
{0, NULL}
|
1378
|
+
};
|
1379
|
+
#endif
|
1380
|
+
|
1381
|
+
static struct PyModuleDef __pyx_moduledef = {
|
1382
|
+
PyModuleDef_HEAD_INIT,
|
1383
|
+
"enums",
|
1384
|
+
__pyx_k_Contains_Enums_which_defines_tex, /* m_doc */
|
1385
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
1386
|
+
0, /* m_size */
|
1387
|
+
#else
|
1388
|
+
-1, /* m_size */
|
1389
|
+
#endif
|
1390
|
+
__pyx_methods /* m_methods */,
|
1391
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
1392
|
+
__pyx_moduledef_slots, /* m_slots */
|
1393
|
+
#else
|
1394
|
+
NULL, /* m_reload */
|
1395
|
+
#endif
|
1396
|
+
NULL, /* m_traverse */
|
1397
|
+
NULL, /* m_clear */
|
1398
|
+
NULL /* m_free */
|
1399
|
+
};
|
1400
|
+
#endif
|
1401
|
+
#ifndef CYTHON_SMALL_CODE
|
1402
|
+
#if defined(__clang__)
|
1403
|
+
#define CYTHON_SMALL_CODE
|
1404
|
+
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
1405
|
+
#define CYTHON_SMALL_CODE __attribute__((cold))
|
1406
|
+
#else
|
1407
|
+
#define CYTHON_SMALL_CODE
|
1408
|
+
#endif
|
1409
|
+
#endif
|
1410
|
+
|
1411
|
+
static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
1412
|
+
{&__pyx_kp_s_An_enumeration_specifying_capit, __pyx_k_An_enumeration_specifying_capit, sizeof(__pyx_k_An_enumeration_specifying_capit), 0, 0, 1, 0},
|
1413
|
+
{&__pyx_kp_s_An_enumeration_specifying_the_v, __pyx_k_An_enumeration_specifying_the_v, sizeof(__pyx_k_An_enumeration_specifying_the_v), 0, 0, 1, 0},
|
1414
|
+
{&__pyx_kp_s_An_enumeration_specifying_the_w, __pyx_k_An_enumeration_specifying_the_w, sizeof(__pyx_k_An_enumeration_specifying_the_w), 0, 0, 1, 0},
|
1415
|
+
{&__pyx_n_s_BOLD, __pyx_k_BOLD, sizeof(__pyx_k_BOLD), 0, 0, 1, 1},
|
1416
|
+
{&__pyx_n_s_BOOK, __pyx_k_BOOK, sizeof(__pyx_k_BOOK), 0, 0, 1, 1},
|
1417
|
+
{&__pyx_n_s_Enum, __pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 0, 1, 1},
|
1418
|
+
{&__pyx_n_s_HEAVY, __pyx_k_HEAVY, sizeof(__pyx_k_HEAVY), 0, 0, 1, 1},
|
1419
|
+
{&__pyx_n_s_ITALIC, __pyx_k_ITALIC, sizeof(__pyx_k_ITALIC), 0, 0, 1, 1},
|
1420
|
+
{&__pyx_n_s_LIGHT, __pyx_k_LIGHT, sizeof(__pyx_k_LIGHT), 0, 0, 1, 1},
|
1421
|
+
{&__pyx_n_s_MEDIUM, __pyx_k_MEDIUM, sizeof(__pyx_k_MEDIUM), 0, 0, 1, 1},
|
1422
|
+
{&__pyx_n_s_NORMAL, __pyx_k_NORMAL, sizeof(__pyx_k_NORMAL), 0, 0, 1, 1},
|
1423
|
+
{&__pyx_n_s_OBLIQUE, __pyx_k_OBLIQUE, sizeof(__pyx_k_OBLIQUE), 0, 0, 1, 1},
|
1424
|
+
{&__pyx_n_s_SEMIBOLD, __pyx_k_SEMIBOLD, sizeof(__pyx_k_SEMIBOLD), 0, 0, 1, 1},
|
1425
|
+
{&__pyx_n_s_SMALL_CAPS, __pyx_k_SMALL_CAPS, sizeof(__pyx_k_SMALL_CAPS), 0, 0, 1, 1},
|
1426
|
+
{&__pyx_n_s_Style, __pyx_k_Style, sizeof(__pyx_k_Style), 0, 0, 1, 1},
|
1427
|
+
{&__pyx_n_u_Style, __pyx_k_Style, sizeof(__pyx_k_Style), 0, 1, 0, 1},
|
1428
|
+
{&__pyx_n_s_THIN, __pyx_k_THIN, sizeof(__pyx_k_THIN), 0, 0, 1, 1},
|
1429
|
+
{&__pyx_n_s_ULTRABOLD, __pyx_k_ULTRABOLD, sizeof(__pyx_k_ULTRABOLD), 0, 0, 1, 1},
|
1430
|
+
{&__pyx_n_s_ULTRAHEAVY, __pyx_k_ULTRAHEAVY, sizeof(__pyx_k_ULTRAHEAVY), 0, 0, 1, 1},
|
1431
|
+
{&__pyx_n_s_ULTRALIGHT, __pyx_k_ULTRALIGHT, sizeof(__pyx_k_ULTRALIGHT), 0, 0, 1, 1},
|
1432
|
+
{&__pyx_n_s_Variant, __pyx_k_Variant, sizeof(__pyx_k_Variant), 0, 0, 1, 1},
|
1433
|
+
{&__pyx_n_u_Variant, __pyx_k_Variant, sizeof(__pyx_k_Variant), 0, 1, 0, 1},
|
1434
|
+
{&__pyx_n_s_Weight, __pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 0, 1, 1},
|
1435
|
+
{&__pyx_n_u_Weight, __pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 1, 0, 1},
|
1436
|
+
{&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
|
1437
|
+
{&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
|
1438
|
+
{&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
|
1439
|
+
{&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
|
1440
|
+
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
|
1441
|
+
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
|
1442
|
+
{&__pyx_n_s_manimpango_fonts_enums, __pyx_k_manimpango_fonts_enums, sizeof(__pyx_k_manimpango_fonts_enums), 0, 0, 1, 1},
|
1443
|
+
{&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
|
1444
|
+
{&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
|
1445
|
+
{&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
|
1446
|
+
{&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
|
1447
|
+
{&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
|
1448
|
+
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
|
1449
|
+
{0, 0, 0, 0, 0, 0, 0}
|
1450
|
+
};
|
1451
|
+
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
|
1452
|
+
return 0;
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
1456
|
+
__Pyx_RefNannyDeclarations
|
1457
|
+
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
|
1458
|
+
__Pyx_RefNannyFinishContext();
|
1459
|
+
return 0;
|
1460
|
+
}
|
1461
|
+
|
1462
|
+
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
|
1463
|
+
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1464
|
+
return 0;
|
1465
|
+
__pyx_L1_error:;
|
1466
|
+
return -1;
|
1467
|
+
}
|
1468
|
+
|
1469
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
|
1470
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
|
1471
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
|
1472
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
|
1473
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
|
1474
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
|
1475
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
|
1476
|
+
|
1477
|
+
static int __Pyx_modinit_global_init_code(void) {
|
1478
|
+
__Pyx_RefNannyDeclarations
|
1479
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
|
1480
|
+
/*--- Global init code ---*/
|
1481
|
+
__Pyx_RefNannyFinishContext();
|
1482
|
+
return 0;
|
1483
|
+
}
|
1484
|
+
|
1485
|
+
static int __Pyx_modinit_variable_export_code(void) {
|
1486
|
+
__Pyx_RefNannyDeclarations
|
1487
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
|
1488
|
+
/*--- Variable export code ---*/
|
1489
|
+
__Pyx_RefNannyFinishContext();
|
1490
|
+
return 0;
|
1491
|
+
}
|
1492
|
+
|
1493
|
+
static int __Pyx_modinit_function_export_code(void) {
|
1494
|
+
__Pyx_RefNannyDeclarations
|
1495
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
|
1496
|
+
/*--- Function export code ---*/
|
1497
|
+
__Pyx_RefNannyFinishContext();
|
1498
|
+
return 0;
|
1499
|
+
}
|
1500
|
+
|
1501
|
+
static int __Pyx_modinit_type_init_code(void) {
|
1502
|
+
__Pyx_RefNannyDeclarations
|
1503
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
|
1504
|
+
/*--- Type init code ---*/
|
1505
|
+
__Pyx_RefNannyFinishContext();
|
1506
|
+
return 0;
|
1507
|
+
}
|
1508
|
+
|
1509
|
+
static int __Pyx_modinit_type_import_code(void) {
|
1510
|
+
__Pyx_RefNannyDeclarations
|
1511
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
|
1512
|
+
/*--- Type import code ---*/
|
1513
|
+
__Pyx_RefNannyFinishContext();
|
1514
|
+
return 0;
|
1515
|
+
}
|
1516
|
+
|
1517
|
+
static int __Pyx_modinit_variable_import_code(void) {
|
1518
|
+
__Pyx_RefNannyDeclarations
|
1519
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
|
1520
|
+
/*--- Variable import code ---*/
|
1521
|
+
__Pyx_RefNannyFinishContext();
|
1522
|
+
return 0;
|
1523
|
+
}
|
1524
|
+
|
1525
|
+
static int __Pyx_modinit_function_import_code(void) {
|
1526
|
+
__Pyx_RefNannyDeclarations
|
1527
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
|
1528
|
+
/*--- Function import code ---*/
|
1529
|
+
__Pyx_RefNannyFinishContext();
|
1530
|
+
return 0;
|
1531
|
+
}
|
1532
|
+
|
1533
|
+
|
1534
|
+
#ifndef CYTHON_NO_PYINIT_EXPORT
|
1535
|
+
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
|
1536
|
+
#elif PY_MAJOR_VERSION < 3
|
1537
|
+
#ifdef __cplusplus
|
1538
|
+
#define __Pyx_PyMODINIT_FUNC extern "C" void
|
1539
|
+
#else
|
1540
|
+
#define __Pyx_PyMODINIT_FUNC void
|
1541
|
+
#endif
|
1542
|
+
#else
|
1543
|
+
#ifdef __cplusplus
|
1544
|
+
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
|
1545
|
+
#else
|
1546
|
+
#define __Pyx_PyMODINIT_FUNC PyObject *
|
1547
|
+
#endif
|
1548
|
+
#endif
|
1549
|
+
|
1550
|
+
|
1551
|
+
#if PY_MAJOR_VERSION < 3
|
1552
|
+
__Pyx_PyMODINIT_FUNC initenums(void) CYTHON_SMALL_CODE; /*proto*/
|
1553
|
+
__Pyx_PyMODINIT_FUNC initenums(void)
|
1554
|
+
#else
|
1555
|
+
__Pyx_PyMODINIT_FUNC PyInit_enums(void) CYTHON_SMALL_CODE; /*proto*/
|
1556
|
+
__Pyx_PyMODINIT_FUNC PyInit_enums(void)
|
1557
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
1558
|
+
{
|
1559
|
+
return PyModuleDef_Init(&__pyx_moduledef);
|
1560
|
+
}
|
1561
|
+
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
|
1562
|
+
#if PY_VERSION_HEX >= 0x030700A1
|
1563
|
+
static PY_INT64_T main_interpreter_id = -1;
|
1564
|
+
PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
|
1565
|
+
if (main_interpreter_id == -1) {
|
1566
|
+
main_interpreter_id = current_id;
|
1567
|
+
return (unlikely(current_id == -1)) ? -1 : 0;
|
1568
|
+
} else if (unlikely(main_interpreter_id != current_id))
|
1569
|
+
#else
|
1570
|
+
static PyInterpreterState *main_interpreter = NULL;
|
1571
|
+
PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
|
1572
|
+
if (!main_interpreter) {
|
1573
|
+
main_interpreter = current_interpreter;
|
1574
|
+
} else if (unlikely(main_interpreter != current_interpreter))
|
1575
|
+
#endif
|
1576
|
+
{
|
1577
|
+
PyErr_SetString(
|
1578
|
+
PyExc_ImportError,
|
1579
|
+
"Interpreter change detected - this module can only be loaded into one interpreter per process.");
|
1580
|
+
return -1;
|
1581
|
+
}
|
1582
|
+
return 0;
|
1583
|
+
}
|
1584
|
+
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) {
|
1585
|
+
PyObject *value = PyObject_GetAttrString(spec, from_name);
|
1586
|
+
int result = 0;
|
1587
|
+
if (likely(value)) {
|
1588
|
+
if (allow_none || value != Py_None) {
|
1589
|
+
result = PyDict_SetItemString(moddict, to_name, value);
|
1590
|
+
}
|
1591
|
+
Py_DECREF(value);
|
1592
|
+
} else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
1593
|
+
PyErr_Clear();
|
1594
|
+
} else {
|
1595
|
+
result = -1;
|
1596
|
+
}
|
1597
|
+
return result;
|
1598
|
+
}
|
1599
|
+
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
|
1600
|
+
PyObject *module = NULL, *moddict, *modname;
|
1601
|
+
if (__Pyx_check_single_interpreter())
|
1602
|
+
return NULL;
|
1603
|
+
if (__pyx_m)
|
1604
|
+
return __Pyx_NewRef(__pyx_m);
|
1605
|
+
modname = PyObject_GetAttrString(spec, "name");
|
1606
|
+
if (unlikely(!modname)) goto bad;
|
1607
|
+
module = PyModule_NewObject(modname);
|
1608
|
+
Py_DECREF(modname);
|
1609
|
+
if (unlikely(!module)) goto bad;
|
1610
|
+
moddict = PyModule_GetDict(module);
|
1611
|
+
if (unlikely(!moddict)) goto bad;
|
1612
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
|
1613
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
|
1614
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
|
1615
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
|
1616
|
+
return module;
|
1617
|
+
bad:
|
1618
|
+
Py_XDECREF(module);
|
1619
|
+
return NULL;
|
1620
|
+
}
|
1621
|
+
|
1622
|
+
|
1623
|
+
static CYTHON_SMALL_CODE int __pyx_pymod_exec_enums(PyObject *__pyx_pyinit_module)
|
1624
|
+
#endif
|
1625
|
+
#endif
|
1626
|
+
{
|
1627
|
+
PyObject *__pyx_t_1 = NULL;
|
1628
|
+
PyObject *__pyx_t_2 = NULL;
|
1629
|
+
PyObject *__pyx_t_3 = NULL;
|
1630
|
+
PyObject *__pyx_t_4 = NULL;
|
1631
|
+
int __pyx_lineno = 0;
|
1632
|
+
const char *__pyx_filename = NULL;
|
1633
|
+
int __pyx_clineno = 0;
|
1634
|
+
__Pyx_RefNannyDeclarations
|
1635
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
1636
|
+
if (__pyx_m) {
|
1637
|
+
if (__pyx_m == __pyx_pyinit_module) return 0;
|
1638
|
+
PyErr_SetString(PyExc_RuntimeError, "Module 'enums' has already been imported. Re-initialisation is not supported.");
|
1639
|
+
return -1;
|
1640
|
+
}
|
1641
|
+
#elif PY_MAJOR_VERSION >= 3
|
1642
|
+
if (__pyx_m) return __Pyx_NewRef(__pyx_m);
|
1643
|
+
#endif
|
1644
|
+
#if CYTHON_REFNANNY
|
1645
|
+
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
|
1646
|
+
if (!__Pyx_RefNanny) {
|
1647
|
+
PyErr_Clear();
|
1648
|
+
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
|
1649
|
+
if (!__Pyx_RefNanny)
|
1650
|
+
Py_FatalError("failed to import 'refnanny' module");
|
1651
|
+
}
|
1652
|
+
#endif
|
1653
|
+
__Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_enums(void)", 0);
|
1654
|
+
if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1655
|
+
#ifdef __Pxy_PyFrame_Initialize_Offsets
|
1656
|
+
__Pxy_PyFrame_Initialize_Offsets();
|
1657
|
+
#endif
|
1658
|
+
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1659
|
+
__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1660
|
+
__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1661
|
+
#ifdef __Pyx_CyFunction_USED
|
1662
|
+
if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1663
|
+
#endif
|
1664
|
+
#ifdef __Pyx_FusedFunction_USED
|
1665
|
+
if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1666
|
+
#endif
|
1667
|
+
#ifdef __Pyx_Coroutine_USED
|
1668
|
+
if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1669
|
+
#endif
|
1670
|
+
#ifdef __Pyx_Generator_USED
|
1671
|
+
if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1672
|
+
#endif
|
1673
|
+
#ifdef __Pyx_AsyncGen_USED
|
1674
|
+
if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1675
|
+
#endif
|
1676
|
+
#ifdef __Pyx_StopAsyncIteration_USED
|
1677
|
+
if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1678
|
+
#endif
|
1679
|
+
/*--- Library function declarations ---*/
|
1680
|
+
/*--- Threads initialization code ---*/
|
1681
|
+
#if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
|
1682
|
+
PyEval_InitThreads();
|
1683
|
+
#endif
|
1684
|
+
/*--- Module creation code ---*/
|
1685
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
1686
|
+
__pyx_m = __pyx_pyinit_module;
|
1687
|
+
Py_INCREF(__pyx_m);
|
1688
|
+
#else
|
1689
|
+
#if PY_MAJOR_VERSION < 3
|
1690
|
+
__pyx_m = Py_InitModule4("enums", __pyx_methods, __pyx_k_Contains_Enums_which_defines_tex, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
|
1691
|
+
#else
|
1692
|
+
__pyx_m = PyModule_Create(&__pyx_moduledef);
|
1693
|
+
#endif
|
1694
|
+
if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1695
|
+
#endif
|
1696
|
+
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1697
|
+
Py_INCREF(__pyx_d);
|
1698
|
+
__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1699
|
+
Py_INCREF(__pyx_b);
|
1700
|
+
__pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1701
|
+
Py_INCREF(__pyx_cython_runtime);
|
1702
|
+
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1703
|
+
/*--- Initialize various global constants etc. ---*/
|
1704
|
+
if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1705
|
+
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
|
1706
|
+
if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1707
|
+
#endif
|
1708
|
+
if (__pyx_module_is_main_manimpango__fonts__enums) {
|
1709
|
+
if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1710
|
+
}
|
1711
|
+
#if PY_MAJOR_VERSION >= 3
|
1712
|
+
{
|
1713
|
+
PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1714
|
+
if (!PyDict_GetItemString(modules, "manimpango.fonts.enums")) {
|
1715
|
+
if (unlikely(PyDict_SetItemString(modules, "manimpango.fonts.enums", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
1716
|
+
}
|
1717
|
+
}
|
1718
|
+
#endif
|
1719
|
+
/*--- Builtin init code ---*/
|
1720
|
+
if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1721
|
+
/*--- Constants init code ---*/
|
1722
|
+
if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1723
|
+
/*--- Global type/function init code ---*/
|
1724
|
+
(void)__Pyx_modinit_global_init_code();
|
1725
|
+
(void)__Pyx_modinit_variable_export_code();
|
1726
|
+
(void)__Pyx_modinit_function_export_code();
|
1727
|
+
(void)__Pyx_modinit_type_init_code();
|
1728
|
+
(void)__Pyx_modinit_type_import_code();
|
1729
|
+
(void)__Pyx_modinit_variable_import_code();
|
1730
|
+
(void)__Pyx_modinit_function_import_code();
|
1731
|
+
/*--- Execution code ---*/
|
1732
|
+
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
|
1733
|
+
if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
1734
|
+
#endif
|
1735
|
+
|
1736
|
+
/* "manimpango/fonts/enums.pyx":6
|
1737
|
+
* """
|
1738
|
+
* from pango cimport *
|
1739
|
+
* from enum import Enum # <<<<<<<<<<<<<<
|
1740
|
+
*
|
1741
|
+
* __all__ = ['Style', 'Weight', 'Variant']
|
1742
|
+
*/
|
1743
|
+
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
|
1744
|
+
__Pyx_GOTREF(__pyx_t_1);
|
1745
|
+
__Pyx_INCREF(__pyx_n_s_Enum);
|
1746
|
+
__Pyx_GIVEREF(__pyx_n_s_Enum);
|
1747
|
+
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Enum);
|
1748
|
+
__pyx_t_2 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
|
1749
|
+
__Pyx_GOTREF(__pyx_t_2);
|
1750
|
+
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
1751
|
+
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
|
1752
|
+
__Pyx_GOTREF(__pyx_t_1);
|
1753
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
|
1754
|
+
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
1755
|
+
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
1756
|
+
|
1757
|
+
/* "manimpango/fonts/enums.pyx":8
|
1758
|
+
* from enum import Enum
|
1759
|
+
*
|
1760
|
+
* __all__ = ['Style', 'Weight', 'Variant'] # <<<<<<<<<<<<<<
|
1761
|
+
*
|
1762
|
+
* class Style(Enum):
|
1763
|
+
*/
|
1764
|
+
__pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
|
1765
|
+
__Pyx_GOTREF(__pyx_t_2);
|
1766
|
+
__Pyx_INCREF(__pyx_n_u_Style);
|
1767
|
+
__Pyx_GIVEREF(__pyx_n_u_Style);
|
1768
|
+
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_Style);
|
1769
|
+
__Pyx_INCREF(__pyx_n_u_Weight);
|
1770
|
+
__Pyx_GIVEREF(__pyx_n_u_Weight);
|
1771
|
+
PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_Weight);
|
1772
|
+
__Pyx_INCREF(__pyx_n_u_Variant);
|
1773
|
+
__Pyx_GIVEREF(__pyx_n_u_Variant);
|
1774
|
+
PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_Variant);
|
1775
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
|
1776
|
+
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
1777
|
+
|
1778
|
+
/* "manimpango/fonts/enums.pyx":10
|
1779
|
+
* __all__ = ['Style', 'Weight', 'Variant']
|
1780
|
+
*
|
1781
|
+
* class Style(Enum): # <<<<<<<<<<<<<<
|
1782
|
+
* """
|
1783
|
+
* An enumeration specifying the various slant styles possible for a font.
|
1784
|
+
*/
|
1785
|
+
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
|
1786
|
+
__Pyx_GOTREF(__pyx_t_2);
|
1787
|
+
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
|
1788
|
+
__Pyx_GOTREF(__pyx_t_1);
|
1789
|
+
__Pyx_GIVEREF(__pyx_t_2);
|
1790
|
+
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
|
1791
|
+
__pyx_t_2 = 0;
|
1792
|
+
__pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
|
1793
|
+
__Pyx_GOTREF(__pyx_t_2);
|
1794
|
+
__pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Style, __pyx_n_s_Style, (PyObject *) NULL, __pyx_n_s_manimpango_fonts_enums, __pyx_kp_s_An_enumeration_specifying_the_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error)
|
1795
|
+
__Pyx_GOTREF(__pyx_t_3);
|
1796
|
+
|
1797
|
+
/* "manimpango/fonts/enums.pyx":24
|
1798
|
+
* the font is slanted in an italic style.
|
1799
|
+
* """
|
1800
|
+
* NORMAL = PANGO_STYLE_NORMAL # <<<<<<<<<<<<<<
|
1801
|
+
* ITALIC = PANGO_STYLE_ITALIC
|
1802
|
+
* OBLIQUE = PANGO_STYLE_OBLIQUE
|
1803
|
+
*/
|
1804
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoStyle(PANGO_STYLE_NORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
|
1805
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1806
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORMAL, __pyx_t_4) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
|
1807
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1808
|
+
|
1809
|
+
/* "manimpango/fonts/enums.pyx":25
|
1810
|
+
* """
|
1811
|
+
* NORMAL = PANGO_STYLE_NORMAL
|
1812
|
+
* ITALIC = PANGO_STYLE_ITALIC # <<<<<<<<<<<<<<
|
1813
|
+
* OBLIQUE = PANGO_STYLE_OBLIQUE
|
1814
|
+
*
|
1815
|
+
*/
|
1816
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoStyle(PANGO_STYLE_ITALIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
|
1817
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1818
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ITALIC, __pyx_t_4) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
|
1819
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1820
|
+
|
1821
|
+
/* "manimpango/fonts/enums.pyx":26
|
1822
|
+
* NORMAL = PANGO_STYLE_NORMAL
|
1823
|
+
* ITALIC = PANGO_STYLE_ITALIC
|
1824
|
+
* OBLIQUE = PANGO_STYLE_OBLIQUE # <<<<<<<<<<<<<<
|
1825
|
+
*
|
1826
|
+
* class Weight(Enum):
|
1827
|
+
*/
|
1828
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoStyle(PANGO_STYLE_OBLIQUE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
|
1829
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1830
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_OBLIQUE, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
|
1831
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1832
|
+
|
1833
|
+
/* "manimpango/fonts/enums.pyx":10
|
1834
|
+
* __all__ = ['Style', 'Weight', 'Variant']
|
1835
|
+
*
|
1836
|
+
* class Style(Enum): # <<<<<<<<<<<<<<
|
1837
|
+
* """
|
1838
|
+
* An enumeration specifying the various slant styles possible for a font.
|
1839
|
+
*/
|
1840
|
+
__pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Style, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error)
|
1841
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1842
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Style, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
|
1843
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1844
|
+
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
1845
|
+
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
1846
|
+
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
1847
|
+
|
1848
|
+
/* "manimpango/fonts/enums.pyx":28
|
1849
|
+
* OBLIQUE = PANGO_STYLE_OBLIQUE
|
1850
|
+
*
|
1851
|
+
* class Weight(Enum): # <<<<<<<<<<<<<<
|
1852
|
+
* """
|
1853
|
+
* An enumeration specifying the weight (boldness) of a font.
|
1854
|
+
*/
|
1855
|
+
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
|
1856
|
+
__Pyx_GOTREF(__pyx_t_1);
|
1857
|
+
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
|
1858
|
+
__Pyx_GOTREF(__pyx_t_2);
|
1859
|
+
__Pyx_GIVEREF(__pyx_t_1);
|
1860
|
+
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
|
1861
|
+
__pyx_t_1 = 0;
|
1862
|
+
__pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
|
1863
|
+
__Pyx_GOTREF(__pyx_t_1);
|
1864
|
+
__pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Weight, __pyx_n_s_Weight, (PyObject *) NULL, __pyx_n_s_manimpango_fonts_enums, __pyx_kp_s_An_enumeration_specifying_the_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
|
1865
|
+
__Pyx_GOTREF(__pyx_t_3);
|
1866
|
+
|
1867
|
+
/* "manimpango/fonts/enums.pyx":59
|
1868
|
+
* the ultraheavy weight( = 1000; Since: 1.24)
|
1869
|
+
* """
|
1870
|
+
* NORMAL = PANGO_WEIGHT_NORMAL # <<<<<<<<<<<<<<
|
1871
|
+
* BOLD = PANGO_WEIGHT_BOLD
|
1872
|
+
* THIN = PANGO_WEIGHT_THIN
|
1873
|
+
*/
|
1874
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_NORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
|
1875
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1876
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORMAL, __pyx_t_4) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
|
1877
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1878
|
+
|
1879
|
+
/* "manimpango/fonts/enums.pyx":60
|
1880
|
+
* """
|
1881
|
+
* NORMAL = PANGO_WEIGHT_NORMAL
|
1882
|
+
* BOLD = PANGO_WEIGHT_BOLD # <<<<<<<<<<<<<<
|
1883
|
+
* THIN = PANGO_WEIGHT_THIN
|
1884
|
+
* ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
|
1885
|
+
*/
|
1886
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_BOLD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
|
1887
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1888
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BOLD, __pyx_t_4) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
|
1889
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1890
|
+
|
1891
|
+
/* "manimpango/fonts/enums.pyx":61
|
1892
|
+
* NORMAL = PANGO_WEIGHT_NORMAL
|
1893
|
+
* BOLD = PANGO_WEIGHT_BOLD
|
1894
|
+
* THIN = PANGO_WEIGHT_THIN # <<<<<<<<<<<<<<
|
1895
|
+
* ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
|
1896
|
+
* LIGHT = PANGO_WEIGHT_LIGHT
|
1897
|
+
*/
|
1898
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_THIN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
|
1899
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1900
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_THIN, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
|
1901
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1902
|
+
|
1903
|
+
/* "manimpango/fonts/enums.pyx":62
|
1904
|
+
* BOLD = PANGO_WEIGHT_BOLD
|
1905
|
+
* THIN = PANGO_WEIGHT_THIN
|
1906
|
+
* ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT # <<<<<<<<<<<<<<
|
1907
|
+
* LIGHT = PANGO_WEIGHT_LIGHT
|
1908
|
+
* BOOK = PANGO_WEIGHT_BOOK
|
1909
|
+
*/
|
1910
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_ULTRALIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
|
1911
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1912
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ULTRALIGHT, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
|
1913
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1914
|
+
|
1915
|
+
/* "manimpango/fonts/enums.pyx":63
|
1916
|
+
* THIN = PANGO_WEIGHT_THIN
|
1917
|
+
* ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
|
1918
|
+
* LIGHT = PANGO_WEIGHT_LIGHT # <<<<<<<<<<<<<<
|
1919
|
+
* BOOK = PANGO_WEIGHT_BOOK
|
1920
|
+
* MEDIUM = PANGO_WEIGHT_MEDIUM
|
1921
|
+
*/
|
1922
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_LIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
|
1923
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1924
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LIGHT, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
|
1925
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1926
|
+
|
1927
|
+
/* "manimpango/fonts/enums.pyx":64
|
1928
|
+
* ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
|
1929
|
+
* LIGHT = PANGO_WEIGHT_LIGHT
|
1930
|
+
* BOOK = PANGO_WEIGHT_BOOK # <<<<<<<<<<<<<<
|
1931
|
+
* MEDIUM = PANGO_WEIGHT_MEDIUM
|
1932
|
+
* SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
|
1933
|
+
*/
|
1934
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_BOOK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
|
1935
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1936
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BOOK, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
|
1937
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1938
|
+
|
1939
|
+
/* "manimpango/fonts/enums.pyx":65
|
1940
|
+
* LIGHT = PANGO_WEIGHT_LIGHT
|
1941
|
+
* BOOK = PANGO_WEIGHT_BOOK
|
1942
|
+
* MEDIUM = PANGO_WEIGHT_MEDIUM # <<<<<<<<<<<<<<
|
1943
|
+
* SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
|
1944
|
+
* ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
|
1945
|
+
*/
|
1946
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_MEDIUM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
|
1947
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1948
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MEDIUM, __pyx_t_4) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
|
1949
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1950
|
+
|
1951
|
+
/* "manimpango/fonts/enums.pyx":66
|
1952
|
+
* BOOK = PANGO_WEIGHT_BOOK
|
1953
|
+
* MEDIUM = PANGO_WEIGHT_MEDIUM
|
1954
|
+
* SEMIBOLD = PANGO_WEIGHT_SEMIBOLD # <<<<<<<<<<<<<<
|
1955
|
+
* ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
|
1956
|
+
* HEAVY = PANGO_WEIGHT_HEAVY
|
1957
|
+
*/
|
1958
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_SEMIBOLD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
|
1959
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1960
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SEMIBOLD, __pyx_t_4) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
|
1961
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1962
|
+
|
1963
|
+
/* "manimpango/fonts/enums.pyx":67
|
1964
|
+
* MEDIUM = PANGO_WEIGHT_MEDIUM
|
1965
|
+
* SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
|
1966
|
+
* ULTRABOLD = PANGO_WEIGHT_ULTRABOLD # <<<<<<<<<<<<<<
|
1967
|
+
* HEAVY = PANGO_WEIGHT_HEAVY
|
1968
|
+
* ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
|
1969
|
+
*/
|
1970
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_ULTRABOLD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
|
1971
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1972
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ULTRABOLD, __pyx_t_4) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
|
1973
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1974
|
+
|
1975
|
+
/* "manimpango/fonts/enums.pyx":68
|
1976
|
+
* SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
|
1977
|
+
* ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
|
1978
|
+
* HEAVY = PANGO_WEIGHT_HEAVY # <<<<<<<<<<<<<<
|
1979
|
+
* ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
|
1980
|
+
*
|
1981
|
+
*/
|
1982
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_HEAVY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
|
1983
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1984
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HEAVY, __pyx_t_4) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
|
1985
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1986
|
+
|
1987
|
+
/* "manimpango/fonts/enums.pyx":69
|
1988
|
+
* ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
|
1989
|
+
* HEAVY = PANGO_WEIGHT_HEAVY
|
1990
|
+
* ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY # <<<<<<<<<<<<<<
|
1991
|
+
*
|
1992
|
+
* class Variant(Enum):
|
1993
|
+
*/
|
1994
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_ULTRAHEAVY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
|
1995
|
+
__Pyx_GOTREF(__pyx_t_4);
|
1996
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ULTRAHEAVY, __pyx_t_4) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
|
1997
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
1998
|
+
|
1999
|
+
/* "manimpango/fonts/enums.pyx":28
|
2000
|
+
* OBLIQUE = PANGO_STYLE_OBLIQUE
|
2001
|
+
*
|
2002
|
+
* class Weight(Enum): # <<<<<<<<<<<<<<
|
2003
|
+
* """
|
2004
|
+
* An enumeration specifying the weight (boldness) of a font.
|
2005
|
+
*/
|
2006
|
+
__pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Weight, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
|
2007
|
+
__Pyx_GOTREF(__pyx_t_4);
|
2008
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Weight, __pyx_t_4) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
|
2009
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
2010
|
+
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
2011
|
+
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
2012
|
+
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
2013
|
+
|
2014
|
+
/* "manimpango/fonts/enums.pyx":71
|
2015
|
+
* ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
|
2016
|
+
*
|
2017
|
+
* class Variant(Enum): # <<<<<<<<<<<<<<
|
2018
|
+
* """
|
2019
|
+
* An enumeration specifying capitalization variant of the font.
|
2020
|
+
*/
|
2021
|
+
__Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
|
2022
|
+
__Pyx_GOTREF(__pyx_t_2);
|
2023
|
+
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
|
2024
|
+
__Pyx_GOTREF(__pyx_t_1);
|
2025
|
+
__Pyx_GIVEREF(__pyx_t_2);
|
2026
|
+
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
|
2027
|
+
__pyx_t_2 = 0;
|
2028
|
+
__pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
|
2029
|
+
__Pyx_GOTREF(__pyx_t_2);
|
2030
|
+
__pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Variant, __pyx_n_s_Variant, (PyObject *) NULL, __pyx_n_s_manimpango_fonts_enums, __pyx_kp_s_An_enumeration_specifying_capit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
|
2031
|
+
__Pyx_GOTREF(__pyx_t_3);
|
2032
|
+
|
2033
|
+
/* "manimpango/fonts/enums.pyx":83
|
2034
|
+
* of the capital characters.
|
2035
|
+
* """
|
2036
|
+
* NORMAL = PANGO_VARIANT_NORMAL # <<<<<<<<<<<<<<
|
2037
|
+
* SMALL_CAPS = PANGO_VARIANT_SMALL_CAPS
|
2038
|
+
*/
|
2039
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoVariant(PANGO_VARIANT_NORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
|
2040
|
+
__Pyx_GOTREF(__pyx_t_4);
|
2041
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORMAL, __pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
|
2042
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
2043
|
+
|
2044
|
+
/* "manimpango/fonts/enums.pyx":84
|
2045
|
+
* """
|
2046
|
+
* NORMAL = PANGO_VARIANT_NORMAL
|
2047
|
+
* SMALL_CAPS = PANGO_VARIANT_SMALL_CAPS # <<<<<<<<<<<<<<
|
2048
|
+
*/
|
2049
|
+
__pyx_t_4 = __Pyx_PyInt_From_PangoVariant(PANGO_VARIANT_SMALL_CAPS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
|
2050
|
+
__Pyx_GOTREF(__pyx_t_4);
|
2051
|
+
if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SMALL_CAPS, __pyx_t_4) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
|
2052
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
2053
|
+
|
2054
|
+
/* "manimpango/fonts/enums.pyx":71
|
2055
|
+
* ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
|
2056
|
+
*
|
2057
|
+
* class Variant(Enum): # <<<<<<<<<<<<<<
|
2058
|
+
* """
|
2059
|
+
* An enumeration specifying capitalization variant of the font.
|
2060
|
+
*/
|
2061
|
+
__pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Variant, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
|
2062
|
+
__Pyx_GOTREF(__pyx_t_4);
|
2063
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Variant, __pyx_t_4) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
|
2064
|
+
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
2065
|
+
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
2066
|
+
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
2067
|
+
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
2068
|
+
|
2069
|
+
/* "manimpango/fonts/enums.pyx":1
|
2070
|
+
* """Contains Enums which defines text properties from Pango. # <<<<<<<<<<<<<<
|
2071
|
+
*
|
2072
|
+
* Most of these are used in :class:`FontDescription`.
|
2073
|
+
*/
|
2074
|
+
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
|
2075
|
+
__Pyx_GOTREF(__pyx_t_1);
|
2076
|
+
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
2077
|
+
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
2078
|
+
|
2079
|
+
/*--- Wrapped vars code ---*/
|
2080
|
+
|
2081
|
+
goto __pyx_L0;
|
2082
|
+
__pyx_L1_error:;
|
2083
|
+
__Pyx_XDECREF(__pyx_t_1);
|
2084
|
+
__Pyx_XDECREF(__pyx_t_2);
|
2085
|
+
__Pyx_XDECREF(__pyx_t_3);
|
2086
|
+
__Pyx_XDECREF(__pyx_t_4);
|
2087
|
+
if (__pyx_m) {
|
2088
|
+
if (__pyx_d) {
|
2089
|
+
__Pyx_AddTraceback("init manimpango.fonts.enums", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
2090
|
+
}
|
2091
|
+
Py_CLEAR(__pyx_m);
|
2092
|
+
} else if (!PyErr_Occurred()) {
|
2093
|
+
PyErr_SetString(PyExc_ImportError, "init manimpango.fonts.enums");
|
2094
|
+
}
|
2095
|
+
__pyx_L0:;
|
2096
|
+
__Pyx_RefNannyFinishContext();
|
2097
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
2098
|
+
return (__pyx_m != NULL) ? 0 : -1;
|
2099
|
+
#elif PY_MAJOR_VERSION >= 3
|
2100
|
+
return __pyx_m;
|
2101
|
+
#else
|
2102
|
+
return;
|
2103
|
+
#endif
|
2104
|
+
}
|
2105
|
+
|
2106
|
+
/* --- Runtime support code --- */
|
2107
|
+
/* Refnanny */
|
2108
|
+
#if CYTHON_REFNANNY
|
2109
|
+
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
|
2110
|
+
PyObject *m = NULL, *p = NULL;
|
2111
|
+
void *r = NULL;
|
2112
|
+
m = PyImport_ImportModule(modname);
|
2113
|
+
if (!m) goto end;
|
2114
|
+
p = PyObject_GetAttrString(m, "RefNannyAPI");
|
2115
|
+
if (!p) goto end;
|
2116
|
+
r = PyLong_AsVoidPtr(p);
|
2117
|
+
end:
|
2118
|
+
Py_XDECREF(p);
|
2119
|
+
Py_XDECREF(m);
|
2120
|
+
return (__Pyx_RefNannyAPIStruct *)r;
|
2121
|
+
}
|
2122
|
+
#endif
|
2123
|
+
|
2124
|
+
/* PyObjectGetAttrStr */
|
2125
|
+
#if CYTHON_USE_TYPE_SLOTS
|
2126
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
|
2127
|
+
PyTypeObject* tp = Py_TYPE(obj);
|
2128
|
+
if (likely(tp->tp_getattro))
|
2129
|
+
return tp->tp_getattro(obj, attr_name);
|
2130
|
+
#if PY_MAJOR_VERSION < 3
|
2131
|
+
if (likely(tp->tp_getattr))
|
2132
|
+
return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
|
2133
|
+
#endif
|
2134
|
+
return PyObject_GetAttr(obj, attr_name);
|
2135
|
+
}
|
2136
|
+
#endif
|
2137
|
+
|
2138
|
+
/* Import */
|
2139
|
+
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
|
2140
|
+
PyObject *empty_list = 0;
|
2141
|
+
PyObject *module = 0;
|
2142
|
+
PyObject *global_dict = 0;
|
2143
|
+
PyObject *empty_dict = 0;
|
2144
|
+
PyObject *list;
|
2145
|
+
#if PY_MAJOR_VERSION < 3
|
2146
|
+
PyObject *py_import;
|
2147
|
+
py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
|
2148
|
+
if (!py_import)
|
2149
|
+
goto bad;
|
2150
|
+
#endif
|
2151
|
+
if (from_list)
|
2152
|
+
list = from_list;
|
2153
|
+
else {
|
2154
|
+
empty_list = PyList_New(0);
|
2155
|
+
if (!empty_list)
|
2156
|
+
goto bad;
|
2157
|
+
list = empty_list;
|
2158
|
+
}
|
2159
|
+
global_dict = PyModule_GetDict(__pyx_m);
|
2160
|
+
if (!global_dict)
|
2161
|
+
goto bad;
|
2162
|
+
empty_dict = PyDict_New();
|
2163
|
+
if (!empty_dict)
|
2164
|
+
goto bad;
|
2165
|
+
{
|
2166
|
+
#if PY_MAJOR_VERSION >= 3
|
2167
|
+
if (level == -1) {
|
2168
|
+
if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
|
2169
|
+
module = PyImport_ImportModuleLevelObject(
|
2170
|
+
name, global_dict, empty_dict, list, 1);
|
2171
|
+
if (!module) {
|
2172
|
+
if (!PyErr_ExceptionMatches(PyExc_ImportError))
|
2173
|
+
goto bad;
|
2174
|
+
PyErr_Clear();
|
2175
|
+
}
|
2176
|
+
}
|
2177
|
+
level = 0;
|
2178
|
+
}
|
2179
|
+
#endif
|
2180
|
+
if (!module) {
|
2181
|
+
#if PY_MAJOR_VERSION < 3
|
2182
|
+
PyObject *py_level = PyInt_FromLong(level);
|
2183
|
+
if (!py_level)
|
2184
|
+
goto bad;
|
2185
|
+
module = PyObject_CallFunctionObjArgs(py_import,
|
2186
|
+
name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
|
2187
|
+
Py_DECREF(py_level);
|
2188
|
+
#else
|
2189
|
+
module = PyImport_ImportModuleLevelObject(
|
2190
|
+
name, global_dict, empty_dict, list, level);
|
2191
|
+
#endif
|
2192
|
+
}
|
2193
|
+
}
|
2194
|
+
bad:
|
2195
|
+
#if PY_MAJOR_VERSION < 3
|
2196
|
+
Py_XDECREF(py_import);
|
2197
|
+
#endif
|
2198
|
+
Py_XDECREF(empty_list);
|
2199
|
+
Py_XDECREF(empty_dict);
|
2200
|
+
return module;
|
2201
|
+
}
|
2202
|
+
|
2203
|
+
/* ImportFrom */
|
2204
|
+
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
|
2205
|
+
PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
|
2206
|
+
if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
2207
|
+
PyErr_Format(PyExc_ImportError,
|
2208
|
+
#if PY_MAJOR_VERSION < 3
|
2209
|
+
"cannot import name %.230s", PyString_AS_STRING(name));
|
2210
|
+
#else
|
2211
|
+
"cannot import name %S", name);
|
2212
|
+
#endif
|
2213
|
+
}
|
2214
|
+
return value;
|
2215
|
+
}
|
2216
|
+
|
2217
|
+
/* GetBuiltinName */
|
2218
|
+
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
|
2219
|
+
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
|
2220
|
+
if (unlikely(!result)) {
|
2221
|
+
PyErr_Format(PyExc_NameError,
|
2222
|
+
#if PY_MAJOR_VERSION >= 3
|
2223
|
+
"name '%U' is not defined", name);
|
2224
|
+
#else
|
2225
|
+
"name '%.200s' is not defined", PyString_AS_STRING(name));
|
2226
|
+
#endif
|
2227
|
+
}
|
2228
|
+
return result;
|
2229
|
+
}
|
2230
|
+
|
2231
|
+
/* PyDictVersioning */
|
2232
|
+
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
|
2233
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
|
2234
|
+
PyObject *dict = Py_TYPE(obj)->tp_dict;
|
2235
|
+
return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
|
2236
|
+
}
|
2237
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
|
2238
|
+
PyObject **dictptr = NULL;
|
2239
|
+
Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
|
2240
|
+
if (offset) {
|
2241
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
2242
|
+
dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
|
2243
|
+
#else
|
2244
|
+
dictptr = _PyObject_GetDictPtr(obj);
|
2245
|
+
#endif
|
2246
|
+
}
|
2247
|
+
return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
|
2248
|
+
}
|
2249
|
+
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
|
2250
|
+
PyObject *dict = Py_TYPE(obj)->tp_dict;
|
2251
|
+
if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
|
2252
|
+
return 0;
|
2253
|
+
return obj_dict_version == __Pyx_get_object_dict_version(obj);
|
2254
|
+
}
|
2255
|
+
#endif
|
2256
|
+
|
2257
|
+
/* GetModuleGlobalName */
|
2258
|
+
#if CYTHON_USE_DICT_VERSIONS
|
2259
|
+
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
|
2260
|
+
#else
|
2261
|
+
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
|
2262
|
+
#endif
|
2263
|
+
{
|
2264
|
+
PyObject *result;
|
2265
|
+
#if !CYTHON_AVOID_BORROWED_REFS
|
2266
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
|
2267
|
+
result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
|
2268
|
+
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
|
2269
|
+
if (likely(result)) {
|
2270
|
+
return __Pyx_NewRef(result);
|
2271
|
+
} else if (unlikely(PyErr_Occurred())) {
|
2272
|
+
return NULL;
|
2273
|
+
}
|
2274
|
+
#else
|
2275
|
+
result = PyDict_GetItem(__pyx_d, name);
|
2276
|
+
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
|
2277
|
+
if (likely(result)) {
|
2278
|
+
return __Pyx_NewRef(result);
|
2279
|
+
}
|
2280
|
+
#endif
|
2281
|
+
#else
|
2282
|
+
result = PyObject_GetItem(__pyx_d, name);
|
2283
|
+
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
|
2284
|
+
if (likely(result)) {
|
2285
|
+
return __Pyx_NewRef(result);
|
2286
|
+
}
|
2287
|
+
PyErr_Clear();
|
2288
|
+
#endif
|
2289
|
+
return __Pyx_GetBuiltinName(name);
|
2290
|
+
}
|
2291
|
+
|
2292
|
+
/* CalculateMetaclass */
|
2293
|
+
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
|
2294
|
+
Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
|
2295
|
+
for (i=0; i < nbases; i++) {
|
2296
|
+
PyTypeObject *tmptype;
|
2297
|
+
PyObject *tmp = PyTuple_GET_ITEM(bases, i);
|
2298
|
+
tmptype = Py_TYPE(tmp);
|
2299
|
+
#if PY_MAJOR_VERSION < 3
|
2300
|
+
if (tmptype == &PyClass_Type)
|
2301
|
+
continue;
|
2302
|
+
#endif
|
2303
|
+
if (!metaclass) {
|
2304
|
+
metaclass = tmptype;
|
2305
|
+
continue;
|
2306
|
+
}
|
2307
|
+
if (PyType_IsSubtype(metaclass, tmptype))
|
2308
|
+
continue;
|
2309
|
+
if (PyType_IsSubtype(tmptype, metaclass)) {
|
2310
|
+
metaclass = tmptype;
|
2311
|
+
continue;
|
2312
|
+
}
|
2313
|
+
PyErr_SetString(PyExc_TypeError,
|
2314
|
+
"metaclass conflict: "
|
2315
|
+
"the metaclass of a derived class "
|
2316
|
+
"must be a (non-strict) subclass "
|
2317
|
+
"of the metaclasses of all its bases");
|
2318
|
+
return NULL;
|
2319
|
+
}
|
2320
|
+
if (!metaclass) {
|
2321
|
+
#if PY_MAJOR_VERSION < 3
|
2322
|
+
metaclass = &PyClass_Type;
|
2323
|
+
#else
|
2324
|
+
metaclass = &PyType_Type;
|
2325
|
+
#endif
|
2326
|
+
}
|
2327
|
+
Py_INCREF((PyObject*) metaclass);
|
2328
|
+
return (PyObject*) metaclass;
|
2329
|
+
}
|
2330
|
+
|
2331
|
+
/* Py3ClassCreate */
|
2332
|
+
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
|
2333
|
+
PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
|
2334
|
+
PyObject *ns;
|
2335
|
+
if (metaclass) {
|
2336
|
+
PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
|
2337
|
+
if (prep) {
|
2338
|
+
PyObject *pargs = PyTuple_Pack(2, name, bases);
|
2339
|
+
if (unlikely(!pargs)) {
|
2340
|
+
Py_DECREF(prep);
|
2341
|
+
return NULL;
|
2342
|
+
}
|
2343
|
+
ns = PyObject_Call(prep, pargs, mkw);
|
2344
|
+
Py_DECREF(prep);
|
2345
|
+
Py_DECREF(pargs);
|
2346
|
+
} else {
|
2347
|
+
if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
|
2348
|
+
return NULL;
|
2349
|
+
PyErr_Clear();
|
2350
|
+
ns = PyDict_New();
|
2351
|
+
}
|
2352
|
+
} else {
|
2353
|
+
ns = PyDict_New();
|
2354
|
+
}
|
2355
|
+
if (unlikely(!ns))
|
2356
|
+
return NULL;
|
2357
|
+
if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
|
2358
|
+
if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
|
2359
|
+
if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
|
2360
|
+
return ns;
|
2361
|
+
bad:
|
2362
|
+
Py_DECREF(ns);
|
2363
|
+
return NULL;
|
2364
|
+
}
|
2365
|
+
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
|
2366
|
+
PyObject *dict, PyObject *mkw,
|
2367
|
+
int calculate_metaclass, int allow_py2_metaclass) {
|
2368
|
+
PyObject *result, *margs;
|
2369
|
+
PyObject *owned_metaclass = NULL;
|
2370
|
+
if (allow_py2_metaclass) {
|
2371
|
+
owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
|
2372
|
+
if (owned_metaclass) {
|
2373
|
+
metaclass = owned_metaclass;
|
2374
|
+
} else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
|
2375
|
+
PyErr_Clear();
|
2376
|
+
} else {
|
2377
|
+
return NULL;
|
2378
|
+
}
|
2379
|
+
}
|
2380
|
+
if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
|
2381
|
+
metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
|
2382
|
+
Py_XDECREF(owned_metaclass);
|
2383
|
+
if (unlikely(!metaclass))
|
2384
|
+
return NULL;
|
2385
|
+
owned_metaclass = metaclass;
|
2386
|
+
}
|
2387
|
+
margs = PyTuple_Pack(3, name, bases, dict);
|
2388
|
+
if (unlikely(!margs)) {
|
2389
|
+
result = NULL;
|
2390
|
+
} else {
|
2391
|
+
result = PyObject_Call(metaclass, margs, mkw);
|
2392
|
+
Py_DECREF(margs);
|
2393
|
+
}
|
2394
|
+
Py_XDECREF(owned_metaclass);
|
2395
|
+
return result;
|
2396
|
+
}
|
2397
|
+
|
2398
|
+
/* PyErrFetchRestore */
|
2399
|
+
#if CYTHON_FAST_THREAD_STATE
|
2400
|
+
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
|
2401
|
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
2402
|
+
tmp_type = tstate->curexc_type;
|
2403
|
+
tmp_value = tstate->curexc_value;
|
2404
|
+
tmp_tb = tstate->curexc_traceback;
|
2405
|
+
tstate->curexc_type = type;
|
2406
|
+
tstate->curexc_value = value;
|
2407
|
+
tstate->curexc_traceback = tb;
|
2408
|
+
Py_XDECREF(tmp_type);
|
2409
|
+
Py_XDECREF(tmp_value);
|
2410
|
+
Py_XDECREF(tmp_tb);
|
2411
|
+
}
|
2412
|
+
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
|
2413
|
+
*type = tstate->curexc_type;
|
2414
|
+
*value = tstate->curexc_value;
|
2415
|
+
*tb = tstate->curexc_traceback;
|
2416
|
+
tstate->curexc_type = 0;
|
2417
|
+
tstate->curexc_value = 0;
|
2418
|
+
tstate->curexc_traceback = 0;
|
2419
|
+
}
|
2420
|
+
#endif
|
2421
|
+
|
2422
|
+
/* CLineInTraceback */
|
2423
|
+
#ifndef CYTHON_CLINE_IN_TRACEBACK
|
2424
|
+
static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
|
2425
|
+
PyObject *use_cline;
|
2426
|
+
PyObject *ptype, *pvalue, *ptraceback;
|
2427
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
2428
|
+
PyObject **cython_runtime_dict;
|
2429
|
+
#endif
|
2430
|
+
if (unlikely(!__pyx_cython_runtime)) {
|
2431
|
+
return c_line;
|
2432
|
+
}
|
2433
|
+
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
2434
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
2435
|
+
cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
|
2436
|
+
if (likely(cython_runtime_dict)) {
|
2437
|
+
__PYX_PY_DICT_LOOKUP_IF_MODIFIED(
|
2438
|
+
use_cline, *cython_runtime_dict,
|
2439
|
+
__Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
|
2440
|
+
} else
|
2441
|
+
#endif
|
2442
|
+
{
|
2443
|
+
PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
|
2444
|
+
if (use_cline_obj) {
|
2445
|
+
use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
|
2446
|
+
Py_DECREF(use_cline_obj);
|
2447
|
+
} else {
|
2448
|
+
PyErr_Clear();
|
2449
|
+
use_cline = NULL;
|
2450
|
+
}
|
2451
|
+
}
|
2452
|
+
if (!use_cline) {
|
2453
|
+
c_line = 0;
|
2454
|
+
(void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
|
2455
|
+
}
|
2456
|
+
else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
|
2457
|
+
c_line = 0;
|
2458
|
+
}
|
2459
|
+
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
2460
|
+
return c_line;
|
2461
|
+
}
|
2462
|
+
#endif
|
2463
|
+
|
2464
|
+
/* CodeObjectCache */
|
2465
|
+
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
|
2466
|
+
int start = 0, mid = 0, end = count - 1;
|
2467
|
+
if (end >= 0 && code_line > entries[end].code_line) {
|
2468
|
+
return count;
|
2469
|
+
}
|
2470
|
+
while (start < end) {
|
2471
|
+
mid = start + (end - start) / 2;
|
2472
|
+
if (code_line < entries[mid].code_line) {
|
2473
|
+
end = mid;
|
2474
|
+
} else if (code_line > entries[mid].code_line) {
|
2475
|
+
start = mid + 1;
|
2476
|
+
} else {
|
2477
|
+
return mid;
|
2478
|
+
}
|
2479
|
+
}
|
2480
|
+
if (code_line <= entries[mid].code_line) {
|
2481
|
+
return mid;
|
2482
|
+
} else {
|
2483
|
+
return mid + 1;
|
2484
|
+
}
|
2485
|
+
}
|
2486
|
+
static PyCodeObject *__pyx_find_code_object(int code_line) {
|
2487
|
+
PyCodeObject* code_object;
|
2488
|
+
int pos;
|
2489
|
+
if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
|
2490
|
+
return NULL;
|
2491
|
+
}
|
2492
|
+
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
2493
|
+
if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
|
2494
|
+
return NULL;
|
2495
|
+
}
|
2496
|
+
code_object = __pyx_code_cache.entries[pos].code_object;
|
2497
|
+
Py_INCREF(code_object);
|
2498
|
+
return code_object;
|
2499
|
+
}
|
2500
|
+
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
|
2501
|
+
int pos, i;
|
2502
|
+
__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
|
2503
|
+
if (unlikely(!code_line)) {
|
2504
|
+
return;
|
2505
|
+
}
|
2506
|
+
if (unlikely(!entries)) {
|
2507
|
+
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
|
2508
|
+
if (likely(entries)) {
|
2509
|
+
__pyx_code_cache.entries = entries;
|
2510
|
+
__pyx_code_cache.max_count = 64;
|
2511
|
+
__pyx_code_cache.count = 1;
|
2512
|
+
entries[0].code_line = code_line;
|
2513
|
+
entries[0].code_object = code_object;
|
2514
|
+
Py_INCREF(code_object);
|
2515
|
+
}
|
2516
|
+
return;
|
2517
|
+
}
|
2518
|
+
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
2519
|
+
if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
|
2520
|
+
PyCodeObject* tmp = entries[pos].code_object;
|
2521
|
+
entries[pos].code_object = code_object;
|
2522
|
+
Py_DECREF(tmp);
|
2523
|
+
return;
|
2524
|
+
}
|
2525
|
+
if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
|
2526
|
+
int new_max = __pyx_code_cache.max_count + 64;
|
2527
|
+
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
|
2528
|
+
__pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
|
2529
|
+
if (unlikely(!entries)) {
|
2530
|
+
return;
|
2531
|
+
}
|
2532
|
+
__pyx_code_cache.entries = entries;
|
2533
|
+
__pyx_code_cache.max_count = new_max;
|
2534
|
+
}
|
2535
|
+
for (i=__pyx_code_cache.count; i>pos; i--) {
|
2536
|
+
entries[i] = entries[i-1];
|
2537
|
+
}
|
2538
|
+
entries[pos].code_line = code_line;
|
2539
|
+
entries[pos].code_object = code_object;
|
2540
|
+
__pyx_code_cache.count++;
|
2541
|
+
Py_INCREF(code_object);
|
2542
|
+
}
|
2543
|
+
|
2544
|
+
/* AddTraceback */
|
2545
|
+
#include "compile.h"
|
2546
|
+
#include "frameobject.h"
|
2547
|
+
#include "traceback.h"
|
2548
|
+
#if PY_VERSION_HEX >= 0x030b00a6
|
2549
|
+
#ifndef Py_BUILD_CORE
|
2550
|
+
#define Py_BUILD_CORE 1
|
2551
|
+
#endif
|
2552
|
+
#include "internal/pycore_frame.h"
|
2553
|
+
#endif
|
2554
|
+
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
2555
|
+
const char *funcname, int c_line,
|
2556
|
+
int py_line, const char *filename) {
|
2557
|
+
PyCodeObject *py_code = NULL;
|
2558
|
+
PyObject *py_funcname = NULL;
|
2559
|
+
#if PY_MAJOR_VERSION < 3
|
2560
|
+
PyObject *py_srcfile = NULL;
|
2561
|
+
py_srcfile = PyString_FromString(filename);
|
2562
|
+
if (!py_srcfile) goto bad;
|
2563
|
+
#endif
|
2564
|
+
if (c_line) {
|
2565
|
+
#if PY_MAJOR_VERSION < 3
|
2566
|
+
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
2567
|
+
if (!py_funcname) goto bad;
|
2568
|
+
#else
|
2569
|
+
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
2570
|
+
if (!py_funcname) goto bad;
|
2571
|
+
funcname = PyUnicode_AsUTF8(py_funcname);
|
2572
|
+
if (!funcname) goto bad;
|
2573
|
+
#endif
|
2574
|
+
}
|
2575
|
+
else {
|
2576
|
+
#if PY_MAJOR_VERSION < 3
|
2577
|
+
py_funcname = PyString_FromString(funcname);
|
2578
|
+
if (!py_funcname) goto bad;
|
2579
|
+
#endif
|
2580
|
+
}
|
2581
|
+
#if PY_MAJOR_VERSION < 3
|
2582
|
+
py_code = __Pyx_PyCode_New(
|
2583
|
+
0,
|
2584
|
+
0,
|
2585
|
+
0,
|
2586
|
+
0,
|
2587
|
+
0,
|
2588
|
+
__pyx_empty_bytes, /*PyObject *code,*/
|
2589
|
+
__pyx_empty_tuple, /*PyObject *consts,*/
|
2590
|
+
__pyx_empty_tuple, /*PyObject *names,*/
|
2591
|
+
__pyx_empty_tuple, /*PyObject *varnames,*/
|
2592
|
+
__pyx_empty_tuple, /*PyObject *freevars,*/
|
2593
|
+
__pyx_empty_tuple, /*PyObject *cellvars,*/
|
2594
|
+
py_srcfile, /*PyObject *filename,*/
|
2595
|
+
py_funcname, /*PyObject *name,*/
|
2596
|
+
py_line,
|
2597
|
+
__pyx_empty_bytes /*PyObject *lnotab*/
|
2598
|
+
);
|
2599
|
+
Py_DECREF(py_srcfile);
|
2600
|
+
#else
|
2601
|
+
py_code = PyCode_NewEmpty(filename, funcname, py_line);
|
2602
|
+
#endif
|
2603
|
+
Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
|
2604
|
+
return py_code;
|
2605
|
+
bad:
|
2606
|
+
Py_XDECREF(py_funcname);
|
2607
|
+
#if PY_MAJOR_VERSION < 3
|
2608
|
+
Py_XDECREF(py_srcfile);
|
2609
|
+
#endif
|
2610
|
+
return NULL;
|
2611
|
+
}
|
2612
|
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
2613
|
+
int py_line, const char *filename) {
|
2614
|
+
PyCodeObject *py_code = 0;
|
2615
|
+
PyFrameObject *py_frame = 0;
|
2616
|
+
PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
2617
|
+
PyObject *ptype, *pvalue, *ptraceback;
|
2618
|
+
if (c_line) {
|
2619
|
+
c_line = __Pyx_CLineForTraceback(tstate, c_line);
|
2620
|
+
}
|
2621
|
+
py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
|
2622
|
+
if (!py_code) {
|
2623
|
+
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
2624
|
+
py_code = __Pyx_CreateCodeObjectForTraceback(
|
2625
|
+
funcname, c_line, py_line, filename);
|
2626
|
+
if (!py_code) {
|
2627
|
+
/* If the code object creation fails, then we should clear the
|
2628
|
+
fetched exception references and propagate the new exception */
|
2629
|
+
Py_XDECREF(ptype);
|
2630
|
+
Py_XDECREF(pvalue);
|
2631
|
+
Py_XDECREF(ptraceback);
|
2632
|
+
goto bad;
|
2633
|
+
}
|
2634
|
+
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
2635
|
+
__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
|
2636
|
+
}
|
2637
|
+
py_frame = PyFrame_New(
|
2638
|
+
tstate, /*PyThreadState *tstate,*/
|
2639
|
+
py_code, /*PyCodeObject *code,*/
|
2640
|
+
__pyx_d, /*PyObject *globals,*/
|
2641
|
+
0 /*PyObject *locals*/
|
2642
|
+
);
|
2643
|
+
if (!py_frame) goto bad;
|
2644
|
+
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
|
2645
|
+
PyTraceBack_Here(py_frame);
|
2646
|
+
bad:
|
2647
|
+
Py_XDECREF(py_code);
|
2648
|
+
Py_XDECREF(py_frame);
|
2649
|
+
}
|
2650
|
+
|
2651
|
+
/* CIntToPy */
|
2652
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoStyle(PangoStyle value) {
|
2653
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2654
|
+
#pragma GCC diagnostic push
|
2655
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
2656
|
+
#endif
|
2657
|
+
const PangoStyle neg_one = (PangoStyle) -1, const_zero = (PangoStyle) 0;
|
2658
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2659
|
+
#pragma GCC diagnostic pop
|
2660
|
+
#endif
|
2661
|
+
const int is_unsigned = neg_one > const_zero;
|
2662
|
+
if (is_unsigned) {
|
2663
|
+
if (sizeof(PangoStyle) < sizeof(long)) {
|
2664
|
+
return PyInt_FromLong((long) value);
|
2665
|
+
} else if (sizeof(PangoStyle) <= sizeof(unsigned long)) {
|
2666
|
+
return PyLong_FromUnsignedLong((unsigned long) value);
|
2667
|
+
#ifdef HAVE_LONG_LONG
|
2668
|
+
} else if (sizeof(PangoStyle) <= sizeof(unsigned PY_LONG_LONG)) {
|
2669
|
+
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
2670
|
+
#endif
|
2671
|
+
}
|
2672
|
+
} else {
|
2673
|
+
if (sizeof(PangoStyle) <= sizeof(long)) {
|
2674
|
+
return PyInt_FromLong((long) value);
|
2675
|
+
#ifdef HAVE_LONG_LONG
|
2676
|
+
} else if (sizeof(PangoStyle) <= sizeof(PY_LONG_LONG)) {
|
2677
|
+
return PyLong_FromLongLong((PY_LONG_LONG) value);
|
2678
|
+
#endif
|
2679
|
+
}
|
2680
|
+
}
|
2681
|
+
{
|
2682
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
2683
|
+
unsigned char *bytes = (unsigned char *)&value;
|
2684
|
+
return _PyLong_FromByteArray(bytes, sizeof(PangoStyle),
|
2685
|
+
little, !is_unsigned);
|
2686
|
+
}
|
2687
|
+
}
|
2688
|
+
|
2689
|
+
/* CIntToPy */
|
2690
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoWeight(PangoWeight value) {
|
2691
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2692
|
+
#pragma GCC diagnostic push
|
2693
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
2694
|
+
#endif
|
2695
|
+
const PangoWeight neg_one = (PangoWeight) -1, const_zero = (PangoWeight) 0;
|
2696
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2697
|
+
#pragma GCC diagnostic pop
|
2698
|
+
#endif
|
2699
|
+
const int is_unsigned = neg_one > const_zero;
|
2700
|
+
if (is_unsigned) {
|
2701
|
+
if (sizeof(PangoWeight) < sizeof(long)) {
|
2702
|
+
return PyInt_FromLong((long) value);
|
2703
|
+
} else if (sizeof(PangoWeight) <= sizeof(unsigned long)) {
|
2704
|
+
return PyLong_FromUnsignedLong((unsigned long) value);
|
2705
|
+
#ifdef HAVE_LONG_LONG
|
2706
|
+
} else if (sizeof(PangoWeight) <= sizeof(unsigned PY_LONG_LONG)) {
|
2707
|
+
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
2708
|
+
#endif
|
2709
|
+
}
|
2710
|
+
} else {
|
2711
|
+
if (sizeof(PangoWeight) <= sizeof(long)) {
|
2712
|
+
return PyInt_FromLong((long) value);
|
2713
|
+
#ifdef HAVE_LONG_LONG
|
2714
|
+
} else if (sizeof(PangoWeight) <= sizeof(PY_LONG_LONG)) {
|
2715
|
+
return PyLong_FromLongLong((PY_LONG_LONG) value);
|
2716
|
+
#endif
|
2717
|
+
}
|
2718
|
+
}
|
2719
|
+
{
|
2720
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
2721
|
+
unsigned char *bytes = (unsigned char *)&value;
|
2722
|
+
return _PyLong_FromByteArray(bytes, sizeof(PangoWeight),
|
2723
|
+
little, !is_unsigned);
|
2724
|
+
}
|
2725
|
+
}
|
2726
|
+
|
2727
|
+
/* CIntToPy */
|
2728
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoVariant(PangoVariant value) {
|
2729
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2730
|
+
#pragma GCC diagnostic push
|
2731
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
2732
|
+
#endif
|
2733
|
+
const PangoVariant neg_one = (PangoVariant) -1, const_zero = (PangoVariant) 0;
|
2734
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2735
|
+
#pragma GCC diagnostic pop
|
2736
|
+
#endif
|
2737
|
+
const int is_unsigned = neg_one > const_zero;
|
2738
|
+
if (is_unsigned) {
|
2739
|
+
if (sizeof(PangoVariant) < sizeof(long)) {
|
2740
|
+
return PyInt_FromLong((long) value);
|
2741
|
+
} else if (sizeof(PangoVariant) <= sizeof(unsigned long)) {
|
2742
|
+
return PyLong_FromUnsignedLong((unsigned long) value);
|
2743
|
+
#ifdef HAVE_LONG_LONG
|
2744
|
+
} else if (sizeof(PangoVariant) <= sizeof(unsigned PY_LONG_LONG)) {
|
2745
|
+
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
2746
|
+
#endif
|
2747
|
+
}
|
2748
|
+
} else {
|
2749
|
+
if (sizeof(PangoVariant) <= sizeof(long)) {
|
2750
|
+
return PyInt_FromLong((long) value);
|
2751
|
+
#ifdef HAVE_LONG_LONG
|
2752
|
+
} else if (sizeof(PangoVariant) <= sizeof(PY_LONG_LONG)) {
|
2753
|
+
return PyLong_FromLongLong((PY_LONG_LONG) value);
|
2754
|
+
#endif
|
2755
|
+
}
|
2756
|
+
}
|
2757
|
+
{
|
2758
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
2759
|
+
unsigned char *bytes = (unsigned char *)&value;
|
2760
|
+
return _PyLong_FromByteArray(bytes, sizeof(PangoVariant),
|
2761
|
+
little, !is_unsigned);
|
2762
|
+
}
|
2763
|
+
}
|
2764
|
+
|
2765
|
+
/* CIntToPy */
|
2766
|
+
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
2767
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2768
|
+
#pragma GCC diagnostic push
|
2769
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
2770
|
+
#endif
|
2771
|
+
const long neg_one = (long) -1, const_zero = (long) 0;
|
2772
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2773
|
+
#pragma GCC diagnostic pop
|
2774
|
+
#endif
|
2775
|
+
const int is_unsigned = neg_one > const_zero;
|
2776
|
+
if (is_unsigned) {
|
2777
|
+
if (sizeof(long) < sizeof(long)) {
|
2778
|
+
return PyInt_FromLong((long) value);
|
2779
|
+
} else if (sizeof(long) <= sizeof(unsigned long)) {
|
2780
|
+
return PyLong_FromUnsignedLong((unsigned long) value);
|
2781
|
+
#ifdef HAVE_LONG_LONG
|
2782
|
+
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
|
2783
|
+
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
2784
|
+
#endif
|
2785
|
+
}
|
2786
|
+
} else {
|
2787
|
+
if (sizeof(long) <= sizeof(long)) {
|
2788
|
+
return PyInt_FromLong((long) value);
|
2789
|
+
#ifdef HAVE_LONG_LONG
|
2790
|
+
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
|
2791
|
+
return PyLong_FromLongLong((PY_LONG_LONG) value);
|
2792
|
+
#endif
|
2793
|
+
}
|
2794
|
+
}
|
2795
|
+
{
|
2796
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
2797
|
+
unsigned char *bytes = (unsigned char *)&value;
|
2798
|
+
return _PyLong_FromByteArray(bytes, sizeof(long),
|
2799
|
+
little, !is_unsigned);
|
2800
|
+
}
|
2801
|
+
}
|
2802
|
+
|
2803
|
+
/* CIntFromPyVerify */
|
2804
|
+
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
|
2805
|
+
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
|
2806
|
+
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
|
2807
|
+
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
|
2808
|
+
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
|
2809
|
+
{\
|
2810
|
+
func_type value = func_value;\
|
2811
|
+
if (sizeof(target_type) < sizeof(func_type)) {\
|
2812
|
+
if (unlikely(value != (func_type) (target_type) value)) {\
|
2813
|
+
func_type zero = 0;\
|
2814
|
+
if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
|
2815
|
+
return (target_type) -1;\
|
2816
|
+
if (is_unsigned && unlikely(value < zero))\
|
2817
|
+
goto raise_neg_overflow;\
|
2818
|
+
else\
|
2819
|
+
goto raise_overflow;\
|
2820
|
+
}\
|
2821
|
+
}\
|
2822
|
+
return (target_type) value;\
|
2823
|
+
}
|
2824
|
+
|
2825
|
+
/* CIntFromPy */
|
2826
|
+
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
|
2827
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2828
|
+
#pragma GCC diagnostic push
|
2829
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
2830
|
+
#endif
|
2831
|
+
const long neg_one = (long) -1, const_zero = (long) 0;
|
2832
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
2833
|
+
#pragma GCC diagnostic pop
|
2834
|
+
#endif
|
2835
|
+
const int is_unsigned = neg_one > const_zero;
|
2836
|
+
#if PY_MAJOR_VERSION < 3
|
2837
|
+
if (likely(PyInt_Check(x))) {
|
2838
|
+
if (sizeof(long) < sizeof(long)) {
|
2839
|
+
__PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
|
2840
|
+
} else {
|
2841
|
+
long val = PyInt_AS_LONG(x);
|
2842
|
+
if (is_unsigned && unlikely(val < 0)) {
|
2843
|
+
goto raise_neg_overflow;
|
2844
|
+
}
|
2845
|
+
return (long) val;
|
2846
|
+
}
|
2847
|
+
} else
|
2848
|
+
#endif
|
2849
|
+
if (likely(PyLong_Check(x))) {
|
2850
|
+
if (is_unsigned) {
|
2851
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
2852
|
+
const digit* digits = ((PyLongObject*)x)->ob_digit;
|
2853
|
+
switch (Py_SIZE(x)) {
|
2854
|
+
case 0: return (long) 0;
|
2855
|
+
case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
|
2856
|
+
case 2:
|
2857
|
+
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
|
2858
|
+
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
|
2859
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
2860
|
+
} else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
|
2861
|
+
return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
2862
|
+
}
|
2863
|
+
}
|
2864
|
+
break;
|
2865
|
+
case 3:
|
2866
|
+
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
|
2867
|
+
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
|
2868
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
2869
|
+
} else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
|
2870
|
+
return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
2871
|
+
}
|
2872
|
+
}
|
2873
|
+
break;
|
2874
|
+
case 4:
|
2875
|
+
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
|
2876
|
+
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
|
2877
|
+
__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])))
|
2878
|
+
} else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
|
2879
|
+
return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
2880
|
+
}
|
2881
|
+
}
|
2882
|
+
break;
|
2883
|
+
}
|
2884
|
+
#endif
|
2885
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
2886
|
+
if (unlikely(Py_SIZE(x) < 0)) {
|
2887
|
+
goto raise_neg_overflow;
|
2888
|
+
}
|
2889
|
+
#else
|
2890
|
+
{
|
2891
|
+
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
2892
|
+
if (unlikely(result < 0))
|
2893
|
+
return (long) -1;
|
2894
|
+
if (unlikely(result == 1))
|
2895
|
+
goto raise_neg_overflow;
|
2896
|
+
}
|
2897
|
+
#endif
|
2898
|
+
if (sizeof(long) <= sizeof(unsigned long)) {
|
2899
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
|
2900
|
+
#ifdef HAVE_LONG_LONG
|
2901
|
+
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
|
2902
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
2903
|
+
#endif
|
2904
|
+
}
|
2905
|
+
} else {
|
2906
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
2907
|
+
const digit* digits = ((PyLongObject*)x)->ob_digit;
|
2908
|
+
switch (Py_SIZE(x)) {
|
2909
|
+
case 0: return (long) 0;
|
2910
|
+
case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
|
2911
|
+
case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
|
2912
|
+
case -2:
|
2913
|
+
if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
|
2914
|
+
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
|
2915
|
+
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
2916
|
+
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
|
2917
|
+
return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
2918
|
+
}
|
2919
|
+
}
|
2920
|
+
break;
|
2921
|
+
case 2:
|
2922
|
+
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
|
2923
|
+
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
|
2924
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
2925
|
+
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
|
2926
|
+
return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
2927
|
+
}
|
2928
|
+
}
|
2929
|
+
break;
|
2930
|
+
case -3:
|
2931
|
+
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
|
2932
|
+
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
|
2933
|
+
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
2934
|
+
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
|
2935
|
+
return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
2936
|
+
}
|
2937
|
+
}
|
2938
|
+
break;
|
2939
|
+
case 3:
|
2940
|
+
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
|
2941
|
+
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
|
2942
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
2943
|
+
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
|
2944
|
+
return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
2945
|
+
}
|
2946
|
+
}
|
2947
|
+
break;
|
2948
|
+
case -4:
|
2949
|
+
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
|
2950
|
+
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
|
2951
|
+
__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])))
|
2952
|
+
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
|
2953
|
+
return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
2954
|
+
}
|
2955
|
+
}
|
2956
|
+
break;
|
2957
|
+
case 4:
|
2958
|
+
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
|
2959
|
+
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
|
2960
|
+
__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])))
|
2961
|
+
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
|
2962
|
+
return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
2963
|
+
}
|
2964
|
+
}
|
2965
|
+
break;
|
2966
|
+
}
|
2967
|
+
#endif
|
2968
|
+
if (sizeof(long) <= sizeof(long)) {
|
2969
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
|
2970
|
+
#ifdef HAVE_LONG_LONG
|
2971
|
+
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
|
2972
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
|
2973
|
+
#endif
|
2974
|
+
}
|
2975
|
+
}
|
2976
|
+
{
|
2977
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
|
2978
|
+
PyErr_SetString(PyExc_RuntimeError,
|
2979
|
+
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
|
2980
|
+
#else
|
2981
|
+
long val;
|
2982
|
+
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
|
2983
|
+
#if PY_MAJOR_VERSION < 3
|
2984
|
+
if (likely(v) && !PyLong_Check(v)) {
|
2985
|
+
PyObject *tmp = v;
|
2986
|
+
v = PyNumber_Long(tmp);
|
2987
|
+
Py_DECREF(tmp);
|
2988
|
+
}
|
2989
|
+
#endif
|
2990
|
+
if (likely(v)) {
|
2991
|
+
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
2992
|
+
unsigned char *bytes = (unsigned char *)&val;
|
2993
|
+
int ret = _PyLong_AsByteArray((PyLongObject *)v,
|
2994
|
+
bytes, sizeof(val),
|
2995
|
+
is_little, !is_unsigned);
|
2996
|
+
Py_DECREF(v);
|
2997
|
+
if (likely(!ret))
|
2998
|
+
return val;
|
2999
|
+
}
|
3000
|
+
#endif
|
3001
|
+
return (long) -1;
|
3002
|
+
}
|
3003
|
+
} else {
|
3004
|
+
long val;
|
3005
|
+
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
|
3006
|
+
if (!tmp) return (long) -1;
|
3007
|
+
val = __Pyx_PyInt_As_long(tmp);
|
3008
|
+
Py_DECREF(tmp);
|
3009
|
+
return val;
|
3010
|
+
}
|
3011
|
+
raise_overflow:
|
3012
|
+
PyErr_SetString(PyExc_OverflowError,
|
3013
|
+
"value too large to convert to long");
|
3014
|
+
return (long) -1;
|
3015
|
+
raise_neg_overflow:
|
3016
|
+
PyErr_SetString(PyExc_OverflowError,
|
3017
|
+
"can't convert negative value to long");
|
3018
|
+
return (long) -1;
|
3019
|
+
}
|
3020
|
+
|
3021
|
+
/* CIntFromPy */
|
3022
|
+
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
|
3023
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
3024
|
+
#pragma GCC diagnostic push
|
3025
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
3026
|
+
#endif
|
3027
|
+
const int neg_one = (int) -1, const_zero = (int) 0;
|
3028
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
3029
|
+
#pragma GCC diagnostic pop
|
3030
|
+
#endif
|
3031
|
+
const int is_unsigned = neg_one > const_zero;
|
3032
|
+
#if PY_MAJOR_VERSION < 3
|
3033
|
+
if (likely(PyInt_Check(x))) {
|
3034
|
+
if (sizeof(int) < sizeof(long)) {
|
3035
|
+
__PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
|
3036
|
+
} else {
|
3037
|
+
long val = PyInt_AS_LONG(x);
|
3038
|
+
if (is_unsigned && unlikely(val < 0)) {
|
3039
|
+
goto raise_neg_overflow;
|
3040
|
+
}
|
3041
|
+
return (int) val;
|
3042
|
+
}
|
3043
|
+
} else
|
3044
|
+
#endif
|
3045
|
+
if (likely(PyLong_Check(x))) {
|
3046
|
+
if (is_unsigned) {
|
3047
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
3048
|
+
const digit* digits = ((PyLongObject*)x)->ob_digit;
|
3049
|
+
switch (Py_SIZE(x)) {
|
3050
|
+
case 0: return (int) 0;
|
3051
|
+
case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
|
3052
|
+
case 2:
|
3053
|
+
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
|
3054
|
+
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
|
3055
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
3056
|
+
} else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
|
3057
|
+
return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
3058
|
+
}
|
3059
|
+
}
|
3060
|
+
break;
|
3061
|
+
case 3:
|
3062
|
+
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
|
3063
|
+
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
|
3064
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
3065
|
+
} else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
|
3066
|
+
return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
3067
|
+
}
|
3068
|
+
}
|
3069
|
+
break;
|
3070
|
+
case 4:
|
3071
|
+
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
|
3072
|
+
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
|
3073
|
+
__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])))
|
3074
|
+
} else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
|
3075
|
+
return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
3076
|
+
}
|
3077
|
+
}
|
3078
|
+
break;
|
3079
|
+
}
|
3080
|
+
#endif
|
3081
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
3082
|
+
if (unlikely(Py_SIZE(x) < 0)) {
|
3083
|
+
goto raise_neg_overflow;
|
3084
|
+
}
|
3085
|
+
#else
|
3086
|
+
{
|
3087
|
+
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
3088
|
+
if (unlikely(result < 0))
|
3089
|
+
return (int) -1;
|
3090
|
+
if (unlikely(result == 1))
|
3091
|
+
goto raise_neg_overflow;
|
3092
|
+
}
|
3093
|
+
#endif
|
3094
|
+
if (sizeof(int) <= sizeof(unsigned long)) {
|
3095
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
|
3096
|
+
#ifdef HAVE_LONG_LONG
|
3097
|
+
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
|
3098
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
3099
|
+
#endif
|
3100
|
+
}
|
3101
|
+
} else {
|
3102
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
3103
|
+
const digit* digits = ((PyLongObject*)x)->ob_digit;
|
3104
|
+
switch (Py_SIZE(x)) {
|
3105
|
+
case 0: return (int) 0;
|
3106
|
+
case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
|
3107
|
+
case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
|
3108
|
+
case -2:
|
3109
|
+
if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
|
3110
|
+
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
|
3111
|
+
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
3112
|
+
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
|
3113
|
+
return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
3114
|
+
}
|
3115
|
+
}
|
3116
|
+
break;
|
3117
|
+
case 2:
|
3118
|
+
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
|
3119
|
+
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
|
3120
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
3121
|
+
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
|
3122
|
+
return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
3123
|
+
}
|
3124
|
+
}
|
3125
|
+
break;
|
3126
|
+
case -3:
|
3127
|
+
if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
|
3128
|
+
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
|
3129
|
+
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
3130
|
+
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
|
3131
|
+
return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
3132
|
+
}
|
3133
|
+
}
|
3134
|
+
break;
|
3135
|
+
case 3:
|
3136
|
+
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
|
3137
|
+
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
|
3138
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
3139
|
+
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
|
3140
|
+
return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
3141
|
+
}
|
3142
|
+
}
|
3143
|
+
break;
|
3144
|
+
case -4:
|
3145
|
+
if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
|
3146
|
+
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
|
3147
|
+
__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])))
|
3148
|
+
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
|
3149
|
+
return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
3150
|
+
}
|
3151
|
+
}
|
3152
|
+
break;
|
3153
|
+
case 4:
|
3154
|
+
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
|
3155
|
+
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
|
3156
|
+
__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])))
|
3157
|
+
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
|
3158
|
+
return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
3159
|
+
}
|
3160
|
+
}
|
3161
|
+
break;
|
3162
|
+
}
|
3163
|
+
#endif
|
3164
|
+
if (sizeof(int) <= sizeof(long)) {
|
3165
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
|
3166
|
+
#ifdef HAVE_LONG_LONG
|
3167
|
+
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
|
3168
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
|
3169
|
+
#endif
|
3170
|
+
}
|
3171
|
+
}
|
3172
|
+
{
|
3173
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
|
3174
|
+
PyErr_SetString(PyExc_RuntimeError,
|
3175
|
+
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
|
3176
|
+
#else
|
3177
|
+
int val;
|
3178
|
+
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
|
3179
|
+
#if PY_MAJOR_VERSION < 3
|
3180
|
+
if (likely(v) && !PyLong_Check(v)) {
|
3181
|
+
PyObject *tmp = v;
|
3182
|
+
v = PyNumber_Long(tmp);
|
3183
|
+
Py_DECREF(tmp);
|
3184
|
+
}
|
3185
|
+
#endif
|
3186
|
+
if (likely(v)) {
|
3187
|
+
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
3188
|
+
unsigned char *bytes = (unsigned char *)&val;
|
3189
|
+
int ret = _PyLong_AsByteArray((PyLongObject *)v,
|
3190
|
+
bytes, sizeof(val),
|
3191
|
+
is_little, !is_unsigned);
|
3192
|
+
Py_DECREF(v);
|
3193
|
+
if (likely(!ret))
|
3194
|
+
return val;
|
3195
|
+
}
|
3196
|
+
#endif
|
3197
|
+
return (int) -1;
|
3198
|
+
}
|
3199
|
+
} else {
|
3200
|
+
int val;
|
3201
|
+
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
|
3202
|
+
if (!tmp) return (int) -1;
|
3203
|
+
val = __Pyx_PyInt_As_int(tmp);
|
3204
|
+
Py_DECREF(tmp);
|
3205
|
+
return val;
|
3206
|
+
}
|
3207
|
+
raise_overflow:
|
3208
|
+
PyErr_SetString(PyExc_OverflowError,
|
3209
|
+
"value too large to convert to int");
|
3210
|
+
return (int) -1;
|
3211
|
+
raise_neg_overflow:
|
3212
|
+
PyErr_SetString(PyExc_OverflowError,
|
3213
|
+
"can't convert negative value to int");
|
3214
|
+
return (int) -1;
|
3215
|
+
}
|
3216
|
+
|
3217
|
+
/* FastTypeChecks */
|
3218
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
3219
|
+
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
|
3220
|
+
while (a) {
|
3221
|
+
a = a->tp_base;
|
3222
|
+
if (a == b)
|
3223
|
+
return 1;
|
3224
|
+
}
|
3225
|
+
return b == &PyBaseObject_Type;
|
3226
|
+
}
|
3227
|
+
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
|
3228
|
+
PyObject *mro;
|
3229
|
+
if (a == b) return 1;
|
3230
|
+
mro = a->tp_mro;
|
3231
|
+
if (likely(mro)) {
|
3232
|
+
Py_ssize_t i, n;
|
3233
|
+
n = PyTuple_GET_SIZE(mro);
|
3234
|
+
for (i = 0; i < n; i++) {
|
3235
|
+
if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
|
3236
|
+
return 1;
|
3237
|
+
}
|
3238
|
+
return 0;
|
3239
|
+
}
|
3240
|
+
return __Pyx_InBases(a, b);
|
3241
|
+
}
|
3242
|
+
#if PY_MAJOR_VERSION == 2
|
3243
|
+
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
|
3244
|
+
PyObject *exception, *value, *tb;
|
3245
|
+
int res;
|
3246
|
+
__Pyx_PyThreadState_declare
|
3247
|
+
__Pyx_PyThreadState_assign
|
3248
|
+
__Pyx_ErrFetch(&exception, &value, &tb);
|
3249
|
+
res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
|
3250
|
+
if (unlikely(res == -1)) {
|
3251
|
+
PyErr_WriteUnraisable(err);
|
3252
|
+
res = 0;
|
3253
|
+
}
|
3254
|
+
if (!res) {
|
3255
|
+
res = PyObject_IsSubclass(err, exc_type2);
|
3256
|
+
if (unlikely(res == -1)) {
|
3257
|
+
PyErr_WriteUnraisable(err);
|
3258
|
+
res = 0;
|
3259
|
+
}
|
3260
|
+
}
|
3261
|
+
__Pyx_ErrRestore(exception, value, tb);
|
3262
|
+
return res;
|
3263
|
+
}
|
3264
|
+
#else
|
3265
|
+
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
|
3266
|
+
int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
|
3267
|
+
if (!res) {
|
3268
|
+
res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
|
3269
|
+
}
|
3270
|
+
return res;
|
3271
|
+
}
|
3272
|
+
#endif
|
3273
|
+
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
|
3274
|
+
Py_ssize_t i, n;
|
3275
|
+
assert(PyExceptionClass_Check(exc_type));
|
3276
|
+
n = PyTuple_GET_SIZE(tuple);
|
3277
|
+
#if PY_MAJOR_VERSION >= 3
|
3278
|
+
for (i=0; i<n; i++) {
|
3279
|
+
if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
|
3280
|
+
}
|
3281
|
+
#endif
|
3282
|
+
for (i=0; i<n; i++) {
|
3283
|
+
PyObject *t = PyTuple_GET_ITEM(tuple, i);
|
3284
|
+
#if PY_MAJOR_VERSION < 3
|
3285
|
+
if (likely(exc_type == t)) return 1;
|
3286
|
+
#endif
|
3287
|
+
if (likely(PyExceptionClass_Check(t))) {
|
3288
|
+
if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
|
3289
|
+
} else {
|
3290
|
+
}
|
3291
|
+
}
|
3292
|
+
return 0;
|
3293
|
+
}
|
3294
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
|
3295
|
+
if (likely(err == exc_type)) return 1;
|
3296
|
+
if (likely(PyExceptionClass_Check(err))) {
|
3297
|
+
if (likely(PyExceptionClass_Check(exc_type))) {
|
3298
|
+
return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
|
3299
|
+
} else if (likely(PyTuple_Check(exc_type))) {
|
3300
|
+
return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
|
3301
|
+
} else {
|
3302
|
+
}
|
3303
|
+
}
|
3304
|
+
return PyErr_GivenExceptionMatches(err, exc_type);
|
3305
|
+
}
|
3306
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
|
3307
|
+
assert(PyExceptionClass_Check(exc_type1));
|
3308
|
+
assert(PyExceptionClass_Check(exc_type2));
|
3309
|
+
if (likely(err == exc_type1 || err == exc_type2)) return 1;
|
3310
|
+
if (likely(PyExceptionClass_Check(err))) {
|
3311
|
+
return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
|
3312
|
+
}
|
3313
|
+
return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
|
3314
|
+
}
|
3315
|
+
#endif
|
3316
|
+
|
3317
|
+
/* CheckBinaryVersion */
|
3318
|
+
static int __Pyx_check_binary_version(void) {
|
3319
|
+
char ctversion[5];
|
3320
|
+
int same=1, i, found_dot;
|
3321
|
+
const char* rt_from_call = Py_GetVersion();
|
3322
|
+
PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
|
3323
|
+
found_dot = 0;
|
3324
|
+
for (i = 0; i < 4; i++) {
|
3325
|
+
if (!ctversion[i]) {
|
3326
|
+
same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
|
3327
|
+
break;
|
3328
|
+
}
|
3329
|
+
if (rt_from_call[i] != ctversion[i]) {
|
3330
|
+
same = 0;
|
3331
|
+
break;
|
3332
|
+
}
|
3333
|
+
}
|
3334
|
+
if (!same) {
|
3335
|
+
char rtversion[5] = {'\0'};
|
3336
|
+
char message[200];
|
3337
|
+
for (i=0; i<4; ++i) {
|
3338
|
+
if (rt_from_call[i] == '.') {
|
3339
|
+
if (found_dot) break;
|
3340
|
+
found_dot = 1;
|
3341
|
+
} else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
|
3342
|
+
break;
|
3343
|
+
}
|
3344
|
+
rtversion[i] = rt_from_call[i];
|
3345
|
+
}
|
3346
|
+
PyOS_snprintf(message, sizeof(message),
|
3347
|
+
"compiletime version %s of module '%.100s' "
|
3348
|
+
"does not match runtime version %s",
|
3349
|
+
ctversion, __Pyx_MODULE_NAME, rtversion);
|
3350
|
+
return PyErr_WarnEx(NULL, message, 1);
|
3351
|
+
}
|
3352
|
+
return 0;
|
3353
|
+
}
|
3354
|
+
|
3355
|
+
/* InitStrings */
|
3356
|
+
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
|
3357
|
+
while (t->p) {
|
3358
|
+
#if PY_MAJOR_VERSION < 3
|
3359
|
+
if (t->is_unicode) {
|
3360
|
+
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
|
3361
|
+
} else if (t->intern) {
|
3362
|
+
*t->p = PyString_InternFromString(t->s);
|
3363
|
+
} else {
|
3364
|
+
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
|
3365
|
+
}
|
3366
|
+
#else
|
3367
|
+
if (t->is_unicode | t->is_str) {
|
3368
|
+
if (t->intern) {
|
3369
|
+
*t->p = PyUnicode_InternFromString(t->s);
|
3370
|
+
} else if (t->encoding) {
|
3371
|
+
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
|
3372
|
+
} else {
|
3373
|
+
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
|
3374
|
+
}
|
3375
|
+
} else {
|
3376
|
+
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
|
3377
|
+
}
|
3378
|
+
#endif
|
3379
|
+
if (!*t->p)
|
3380
|
+
return -1;
|
3381
|
+
if (PyObject_Hash(*t->p) == -1)
|
3382
|
+
return -1;
|
3383
|
+
++t;
|
3384
|
+
}
|
3385
|
+
return 0;
|
3386
|
+
}
|
3387
|
+
|
3388
|
+
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
|
3389
|
+
return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
|
3390
|
+
}
|
3391
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
|
3392
|
+
Py_ssize_t ignore;
|
3393
|
+
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
|
3394
|
+
}
|
3395
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
3396
|
+
#if !CYTHON_PEP393_ENABLED
|
3397
|
+
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
3398
|
+
char* defenc_c;
|
3399
|
+
PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
|
3400
|
+
if (!defenc) return NULL;
|
3401
|
+
defenc_c = PyBytes_AS_STRING(defenc);
|
3402
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
3403
|
+
{
|
3404
|
+
char* end = defenc_c + PyBytes_GET_SIZE(defenc);
|
3405
|
+
char* c;
|
3406
|
+
for (c = defenc_c; c < end; c++) {
|
3407
|
+
if ((unsigned char) (*c) >= 128) {
|
3408
|
+
PyUnicode_AsASCIIString(o);
|
3409
|
+
return NULL;
|
3410
|
+
}
|
3411
|
+
}
|
3412
|
+
}
|
3413
|
+
#endif
|
3414
|
+
*length = PyBytes_GET_SIZE(defenc);
|
3415
|
+
return defenc_c;
|
3416
|
+
}
|
3417
|
+
#else
|
3418
|
+
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
3419
|
+
if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
|
3420
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
3421
|
+
if (likely(PyUnicode_IS_ASCII(o))) {
|
3422
|
+
*length = PyUnicode_GET_LENGTH(o);
|
3423
|
+
return PyUnicode_AsUTF8(o);
|
3424
|
+
} else {
|
3425
|
+
PyUnicode_AsASCIIString(o);
|
3426
|
+
return NULL;
|
3427
|
+
}
|
3428
|
+
#else
|
3429
|
+
return PyUnicode_AsUTF8AndSize(o, length);
|
3430
|
+
#endif
|
3431
|
+
}
|
3432
|
+
#endif
|
3433
|
+
#endif
|
3434
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
3435
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
3436
|
+
if (
|
3437
|
+
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
3438
|
+
__Pyx_sys_getdefaultencoding_not_ascii &&
|
3439
|
+
#endif
|
3440
|
+
PyUnicode_Check(o)) {
|
3441
|
+
return __Pyx_PyUnicode_AsStringAndSize(o, length);
|
3442
|
+
} else
|
3443
|
+
#endif
|
3444
|
+
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
|
3445
|
+
if (PyByteArray_Check(o)) {
|
3446
|
+
*length = PyByteArray_GET_SIZE(o);
|
3447
|
+
return PyByteArray_AS_STRING(o);
|
3448
|
+
} else
|
3449
|
+
#endif
|
3450
|
+
{
|
3451
|
+
char* result;
|
3452
|
+
int r = PyBytes_AsStringAndSize(o, &result, length);
|
3453
|
+
if (unlikely(r < 0)) {
|
3454
|
+
return NULL;
|
3455
|
+
} else {
|
3456
|
+
return result;
|
3457
|
+
}
|
3458
|
+
}
|
3459
|
+
}
|
3460
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
|
3461
|
+
int is_true = x == Py_True;
|
3462
|
+
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
|
3463
|
+
else return PyObject_IsTrue(x);
|
3464
|
+
}
|
3465
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
|
3466
|
+
int retval;
|
3467
|
+
if (unlikely(!x)) return -1;
|
3468
|
+
retval = __Pyx_PyObject_IsTrue(x);
|
3469
|
+
Py_DECREF(x);
|
3470
|
+
return retval;
|
3471
|
+
}
|
3472
|
+
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
|
3473
|
+
#if PY_MAJOR_VERSION >= 3
|
3474
|
+
if (PyLong_Check(result)) {
|
3475
|
+
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
3476
|
+
"__int__ returned non-int (type %.200s). "
|
3477
|
+
"The ability to return an instance of a strict subclass of int "
|
3478
|
+
"is deprecated, and may be removed in a future version of Python.",
|
3479
|
+
Py_TYPE(result)->tp_name)) {
|
3480
|
+
Py_DECREF(result);
|
3481
|
+
return NULL;
|
3482
|
+
}
|
3483
|
+
return result;
|
3484
|
+
}
|
3485
|
+
#endif
|
3486
|
+
PyErr_Format(PyExc_TypeError,
|
3487
|
+
"__%.4s__ returned non-%.4s (type %.200s)",
|
3488
|
+
type_name, type_name, Py_TYPE(result)->tp_name);
|
3489
|
+
Py_DECREF(result);
|
3490
|
+
return NULL;
|
3491
|
+
}
|
3492
|
+
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
|
3493
|
+
#if CYTHON_USE_TYPE_SLOTS
|
3494
|
+
PyNumberMethods *m;
|
3495
|
+
#endif
|
3496
|
+
const char *name = NULL;
|
3497
|
+
PyObject *res = NULL;
|
3498
|
+
#if PY_MAJOR_VERSION < 3
|
3499
|
+
if (likely(PyInt_Check(x) || PyLong_Check(x)))
|
3500
|
+
#else
|
3501
|
+
if (likely(PyLong_Check(x)))
|
3502
|
+
#endif
|
3503
|
+
return __Pyx_NewRef(x);
|
3504
|
+
#if CYTHON_USE_TYPE_SLOTS
|
3505
|
+
m = Py_TYPE(x)->tp_as_number;
|
3506
|
+
#if PY_MAJOR_VERSION < 3
|
3507
|
+
if (m && m->nb_int) {
|
3508
|
+
name = "int";
|
3509
|
+
res = m->nb_int(x);
|
3510
|
+
}
|
3511
|
+
else if (m && m->nb_long) {
|
3512
|
+
name = "long";
|
3513
|
+
res = m->nb_long(x);
|
3514
|
+
}
|
3515
|
+
#else
|
3516
|
+
if (likely(m && m->nb_int)) {
|
3517
|
+
name = "int";
|
3518
|
+
res = m->nb_int(x);
|
3519
|
+
}
|
3520
|
+
#endif
|
3521
|
+
#else
|
3522
|
+
if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
|
3523
|
+
res = PyNumber_Int(x);
|
3524
|
+
}
|
3525
|
+
#endif
|
3526
|
+
if (likely(res)) {
|
3527
|
+
#if PY_MAJOR_VERSION < 3
|
3528
|
+
if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
|
3529
|
+
#else
|
3530
|
+
if (unlikely(!PyLong_CheckExact(res))) {
|
3531
|
+
#endif
|
3532
|
+
return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
|
3533
|
+
}
|
3534
|
+
}
|
3535
|
+
else if (!PyErr_Occurred()) {
|
3536
|
+
PyErr_SetString(PyExc_TypeError,
|
3537
|
+
"an integer is required");
|
3538
|
+
}
|
3539
|
+
return res;
|
3540
|
+
}
|
3541
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
|
3542
|
+
Py_ssize_t ival;
|
3543
|
+
PyObject *x;
|
3544
|
+
#if PY_MAJOR_VERSION < 3
|
3545
|
+
if (likely(PyInt_CheckExact(b))) {
|
3546
|
+
if (sizeof(Py_ssize_t) >= sizeof(long))
|
3547
|
+
return PyInt_AS_LONG(b);
|
3548
|
+
else
|
3549
|
+
return PyInt_AsSsize_t(b);
|
3550
|
+
}
|
3551
|
+
#endif
|
3552
|
+
if (likely(PyLong_CheckExact(b))) {
|
3553
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
3554
|
+
const digit* digits = ((PyLongObject*)b)->ob_digit;
|
3555
|
+
const Py_ssize_t size = Py_SIZE(b);
|
3556
|
+
if (likely(__Pyx_sst_abs(size) <= 1)) {
|
3557
|
+
ival = likely(size) ? digits[0] : 0;
|
3558
|
+
if (size == -1) ival = -ival;
|
3559
|
+
return ival;
|
3560
|
+
} else {
|
3561
|
+
switch (size) {
|
3562
|
+
case 2:
|
3563
|
+
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
|
3564
|
+
return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
3565
|
+
}
|
3566
|
+
break;
|
3567
|
+
case -2:
|
3568
|
+
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
|
3569
|
+
return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
3570
|
+
}
|
3571
|
+
break;
|
3572
|
+
case 3:
|
3573
|
+
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
|
3574
|
+
return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
3575
|
+
}
|
3576
|
+
break;
|
3577
|
+
case -3:
|
3578
|
+
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
|
3579
|
+
return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
3580
|
+
}
|
3581
|
+
break;
|
3582
|
+
case 4:
|
3583
|
+
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
|
3584
|
+
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]));
|
3585
|
+
}
|
3586
|
+
break;
|
3587
|
+
case -4:
|
3588
|
+
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
|
3589
|
+
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]));
|
3590
|
+
}
|
3591
|
+
break;
|
3592
|
+
}
|
3593
|
+
}
|
3594
|
+
#endif
|
3595
|
+
return PyLong_AsSsize_t(b);
|
3596
|
+
}
|
3597
|
+
x = PyNumber_Index(b);
|
3598
|
+
if (!x) return -1;
|
3599
|
+
ival = PyInt_AsSsize_t(x);
|
3600
|
+
Py_DECREF(x);
|
3601
|
+
return ival;
|
3602
|
+
}
|
3603
|
+
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
|
3604
|
+
if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
|
3605
|
+
return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
|
3606
|
+
#if PY_MAJOR_VERSION < 3
|
3607
|
+
} else if (likely(PyInt_CheckExact(o))) {
|
3608
|
+
return PyInt_AS_LONG(o);
|
3609
|
+
#endif
|
3610
|
+
} else {
|
3611
|
+
Py_ssize_t ival;
|
3612
|
+
PyObject *x;
|
3613
|
+
x = PyNumber_Index(o);
|
3614
|
+
if (!x) return -1;
|
3615
|
+
ival = PyInt_AsLong(x);
|
3616
|
+
Py_DECREF(x);
|
3617
|
+
return ival;
|
3618
|
+
}
|
3619
|
+
}
|
3620
|
+
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
|
3621
|
+
return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
|
3622
|
+
}
|
3623
|
+
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
|
3624
|
+
return PyInt_FromSize_t(ival);
|
3625
|
+
}
|
3626
|
+
|
3627
|
+
|
3628
|
+
#endif /* Py_PYTHON_H */
|