/* Generated by Cython 0.25.2 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_FASTCALL
  #define METH_FASTCALL 0x80
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
                                              Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE___qt_qtwes2
#define __PYX_HAVE_API___qt_qtwes2
#include <stdint.h>
#include <QtCore/QtGlobal>
#include <QtCore/Qt>
#include <QtCore/QByteArray>
#include <QtCore/QElapsedTimer>
#include <QtCore/QEvent>
#include <QtCore/QFileSystemWatcher>
#include <QtCore/QLibraryInfo>
#include <QtCore/QList>
#include <QtCore/QStringList>
#include <QtCore/QLocale>
#include <QtCore/QMap>
#include <QtCore/QMetaMethod>
#include <QtCore/QMetaObject>
#include <QtCore/QMetaProperty>
#include <QtCore/QMimeData>
#include <QtCore/QModelIndex>
#include <QtCore/QObject>
#include <QtCore/QPoint>
#include <QtCore/QPointF>
#include <QtCore/QSize>
#include <QtCore/QStandardPaths>
#include <QtCore/QString>
#include <QtCore/QTimer>
#include <QtCore/QTranslator>
#include <QtCore/QUrl>
#include <QtCore/QVariant>
#include <QtGui/QCloseEvent>
#include <QtGui/QColor>
#include <QtGui/QCursor>
#include <QtGui/QDragEnterEvent>
#include <QtGui/QDropEvent>
#include <QtGui/QFont>
#include <QtGui/QIcon>
#include <QtGui/QImage>
#include <QtGui/QKeyEvent>
#include <QtGui/QKeySequence>
#include <QtGui/QMouseEvent>
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLDebugLogger>
#include <QtGui/QOpenGLDebugMessage>
#include <QtGui/QOpenGLFramebufferObjectFormat>
#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QOpenGLTexture>
#include <QtGui/QPaintEvent>
#include <QtGui/QPixmap>
#include <QtGui/QResizeEvent>
#include <QtGui/QShowEvent>
#include <QtGui/QStandardItem>
#include <QtGui/QStandardItemModel>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QTextDocumentFragment>
#include <QtGui/QTransform>
#include <QtGui/QWheelEvent>
#include <QtCore/QCoreApplication>
#include <QtWidgets/QApplication>
#include <QtWidgets/QWidget>
#include <QtWidgets/QDialog>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QListWidgetItem>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QOpenGLWidget>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSizePolicy>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QTreeView>
#include "_qt_qtwes2_moc.h"
#include <stddef.h>
#include "GLES2/gl2.h"
#include <string.h>
#include <stdio.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "build/temp.linux-x86_64-3.5/pybiklib/ext/_qt_qtwes2.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name;
struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr;

/* "qt.pxd":23
 * 
 * 
 * ctypedef void CallbackVoid() nogil             # <<<<<<<<<<<<<<
 * ctypedef void CallbackInt(int) nogil
 * ctypedef void CallbackString(const QString &) nogil
 */
typedef void __pyx_t_2qt_CallbackVoid(void);

/* "qt.pxd":24
 * 
 * ctypedef void CallbackVoid() nogil
 * ctypedef void CallbackInt(int) nogil             # <<<<<<<<<<<<<<
 * ctypedef void CallbackString(const QString &) nogil
 * ctypedef void CallbackDebugMessage(const QOpenGLDebugMessage &) nogil
 */
typedef void __pyx_t_2qt_CallbackInt(int);

/* "qt.pxd":25
 * ctypedef void CallbackVoid() nogil
 * ctypedef void CallbackInt(int) nogil
 * ctypedef void CallbackString(const QString &) nogil             # <<<<<<<<<<<<<<
 * ctypedef void CallbackDebugMessage(const QOpenGLDebugMessage &) nogil
 * 
 */
typedef void __pyx_t_2qt_CallbackString(QString const &);

/* "qt.pxd":26
 * ctypedef void CallbackInt(int) nogil
 * ctypedef void CallbackString(const QString &) nogil
 * ctypedef void CallbackDebugMessage(const QOpenGLDebugMessage &) nogil             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef void __pyx_t_2qt_CallbackDebugMessage(QOpenGLDebugMessage const &);
struct __pyx_t_10_qt_qtwes2_RenderData;
struct __pyx_t_10_qt_qtwes2_UIData;

/* "_qt_qtwes2.pyx":86
 * #puts = print
 * 
 * cdef enum: # #px/             # <<<<<<<<<<<<<<
 * #if True:
 *     DEBUG_MSG = 0x0002
 */
enum  {
  __pyx_e_10_qt_qtwes2_DEBUG_MSG = 0x0002,
  __pyx_e_10_qt_qtwes2_DEBUG_MSGGL = 0x0004,
  __pyx_e_10_qt_qtwes2_DEBUG_MSGEXT = 0x0020,
  __pyx_e_10_qt_qtwes2_DEBUG_DRAW = 0x0040,
  __pyx_e_10_qt_qtwes2_DEBUG_FPS = 0x0080,
  __pyx_e_10_qt_qtwes2_DEBUG_VFPS = 0x0100,
  __pyx_e_10_qt_qtwes2_DEBUG_QML = 0x0200,
  __pyx_e_10_qt_qtwes2_DEBUG_GLDEBUG = 0x0400,
  __pyx_e_10_qt_qtwes2_DEBUG_PHONE = 0x0800,
  __pyx_e_10_qt_qtwes2_DEBUG_SIM = 0x1000,
  __pyx_e_10_qt_qtwes2_DEBUG_NOCONTROLS = 0x2000
};

/* "_qt_qtwes2.pyx":122
 * # #px+cdef enum:
 * #     #px/SAFE_MODIFIER_MASK = Qt.ShiftModifier | Qt.ControlModifier | Qt.KeypadModifier
 * cdef enum: #px+             # <<<<<<<<<<<<<<
 *     SHIFTMODIFIER = Qt.ShiftModifier #px+
 *     CONTROLMODIFIER = Qt.ControlModifier #px+
 */
enum  {

  /* "_qt_qtwes2.pyx":125
 *     SHIFTMODIFIER = Qt.ShiftModifier #px+
 *     CONTROLMODIFIER = Qt.ControlModifier #px+
 *     KEYPADMODIFIER = Qt.KeypadModifier #px+             # <<<<<<<<<<<<<<
 * cdef enum: #px+
 *     SAFE_MODIFIER_MASK = SHIFTMODIFIER | CONTROLMODIFIER | KEYPADMODIFIER #px/
 */
  __pyx_e_10_qt_qtwes2_SHIFTMODIFIER = Qt::ShiftModifier,
  __pyx_e_10_qt_qtwes2_CONTROLMODIFIER = Qt::ControlModifier,
  __pyx_e_10_qt_qtwes2_KEYPADMODIFIER = Qt::KeypadModifier
};

/* "_qt_qtwes2.pyx":126
 *     CONTROLMODIFIER = Qt.ControlModifier #px+
 *     KEYPADMODIFIER = Qt.KeypadModifier #px+
 * cdef enum: #px+             # <<<<<<<<<<<<<<
 *     SAFE_MODIFIER_MASK = SHIFTMODIFIER | CONTROLMODIFIER | KEYPADMODIFIER #px/
 * #SAFE_MODIFIER_MASK = int(Qt.ShiftModifier | Qt.ControlModifier | Qt.KeypadModifier)
 */
enum  {

  /* "_qt_qtwes2.pyx":127
 *     KEYPADMODIFIER = Qt.KeypadModifier #px+
 * cdef enum: #px+
 *     SAFE_MODIFIER_MASK = SHIFTMODIFIER | CONTROLMODIFIER | KEYPADMODIFIER #px/             # <<<<<<<<<<<<<<
 * #SAFE_MODIFIER_MASK = int(Qt.ShiftModifier | Qt.ControlModifier | Qt.KeypadModifier)
 * ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_e_10_qt_qtwes2_SAFE_MODIFIER_MASK = ((__pyx_e_10_qt_qtwes2_SHIFTMODIFIER | __pyx_e_10_qt_qtwes2_CONTROLMODIFIER) | __pyx_e_10_qt_qtwes2_KEYPADMODIFIER)
};

/* "_qt_qtwes2.pyx":148
 * #### Data ####
 * 
 * ctypedef QObject *pQObject #px+             # <<<<<<<<<<<<<<
 * ##pxm>IF 'qtw' == 'qtq'
 * #~ ctypedef QQuickItem *pQQuickItem
 */
typedef QObject *__pyx_t_10_qt_qtwes2_pQObject;

/* "_qt_qtwes2.pyx":153
 * #~ ##pxm>IF_END
 * 
 * cdef struct RenderData: #px/             # <<<<<<<<<<<<<<
 * #class renderdata: pass
 *     QOpenGLTexture* texture #px+
 */
struct __pyx_t_10_qt_qtwes2_RenderData {
  QOpenGLTexture *texture;
  int atlas_width;
  int atlas_height;
  QOpenGLFramebufferObject *pickbuffer;
  QOpenGLFramebufferObject *offscreenbuffer;
  QElapsedTimer *fps_monotonic_time;
  int fps_count;
  bool initialized;
  Renderer *renderer;
  bool atlas_changed;
  bool pickxy_changed;
  QOpenGLDebugLogger *gldebuglogger;
};

/* "_qt_qtwes2.pyx":172
 * DEF maxproxy = 21 #px+
 * 
 * cdef struct UIData: #px/             # <<<<<<<<<<<<<<
 * #class uidata:
 *     cbool atlas_changed #px+
 */
struct __pyx_t_10_qt_qtwes2_UIData {
  bool atlas_changed;
  int atlas_width;
  int atlas_height;
  bool pick_requested;
  float grid_unit_px;
  int width;
  int height;
  int gl_y;
  QFileSystemWatcher *filesystemwatcher;
  QTimer *settings_timer;
  QSurfaceFormat default_format;
  QCursor *cursors[18];
  QImage offscreen_image;
  MainView *mainwindow;
  int modelselect_currentpage;
  float speed;
  float animation_angle;
  float angle_max;
  QTimer *animate_timer;
  QStandardItemModel *treestore;
  MoveEdit *move_edit;
  QLabel *statuslabel;
  DrawingArea *drawingarea;
  PreferencesDialog *preferences;
  HelpDialog *help;
};

/* "_qt_qtwes2.pyx":1988
 * ##pxm>IF_END
 * 
 * def keyval_from_name(keystr):             # <<<<<<<<<<<<<<
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 */
struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name {
  PyObject_HEAD
  PyObject *__pyx_v_keystr;
};


/* "_qt_qtwes2.pyx":1989
 * 
 * def keyval_from_name(keystr):
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))             # <<<<<<<<<<<<<<
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 *     #keyseq = fromString(keystr, PortableText)
 */
struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *__pyx_outer_scope;
  PyObject *__pyx_v_k;
};


/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* IncludeStringH.proto */
#include <string.h>

/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
    PyObject_RichCompare(op1, op2, Py_EQ)
    #endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* None.proto */
static CYTHON_INLINE qint64 __Pyx_div_qint64(qint64, qint64);

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* None.proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* pop_index.proto */
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix);
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix);
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix);
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#else
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\
    __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
        __Pyx__PyObject_PopIndex(L, py_ix))
#endif

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?\
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Qt_3a__3a_Key(enum Qt::Key value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Qt_3a__3a_KeyboardModifier(enum Qt::KeyboardModifier value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Qt_3a__3a_MouseButton(enum Qt::MouseButton value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* None.proto */
static CYTHON_INLINE long __Pyx_pow_long(long, long);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Qt_3a__3a_KeyboardModifiers(Qt::KeyboardModifiers value);

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::bad_typeid& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static int __Pyx_Coroutine_clear(PyObject *self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);

/* FunctionImport.proto */
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'libc.stdint' */

/* Module declarations from 'libcpp' */

/* Module declarations from 'qt' */

/* Module declarations from 'libc.stddef' */

/* Module declarations from 'gl_es2' */

/* Module declarations from '_glarea_es2' */
static void (*__pyx_f_11_glarea_es2_render_resize)(int, int, int); /*proto*/
static void (*__pyx_f_11_glarea_es2_set_animation_next)(float); /*proto*/
static void (*__pyx_f_11_glarea_es2_sync_set_fixedshaders)(void); /*proto*/
static void (*__pyx_f_11_glarea_es2_sync_set_pick_position)(void); /*proto*/
static void (*__pyx_f_11_glarea_es2_sync_set_atlas_data)(void); /*proto*/
static void (*__pyx_f_11_glarea_es2_sync)(void); /*proto*/
static void (*__pyx_f_11_glarea_es2_gl_init)(void); /*proto*/
static void (*__pyx_f_11_glarea_es2_gl_exit)(void); /*proto*/
static void (*__pyx_f_11_glarea_es2_gl_set_atlas_texture)(int, int); /*proto*/
static void (*__pyx_f_11_glarea_es2_gl_render)(void); /*proto*/
static void (*__pyx_f_11_glarea_es2_gl_render_select_debug)(void); /*proto*/
static int (*__pyx_f_11_glarea_es2_gl_pick_polygons)(void); /*proto*/

/* Module declarations from '_qtui_' */
static void (*__pyx_f_6_qtui__init_module)(void); /*proto*/
static void (*__pyx_f_6_qtui__init_gettext)(PyObject *); /*proto*/
static void (*__pyx_f_6_qtui__setupUi_main)(QMainWindow *, QIcon const &, QIcon const &, QIcon const &, QKeySequence const &, QKeySequence const &, bool, bool); /*proto*/
static void (*__pyx_f_6_qtui__setupUi_pref)(QDialog *, int, int, int, int, int, QStandardItemModel *); /*proto*/
static void (*__pyx_f_6_qtui__setupUi_help)(QDialog *, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__setupUi_about)(QDialog *); /*proto*/
static void (*__pyx_f_6_qtui__set_shortcuts)(QKeySequence const &, QKeySequence const &, QKeySequence const &, QKeySequence const &); /*proto*/
static void (*__pyx_f_6_qtui__add_widgets)(QMainWindow *, QLineEdit *, QOpenGLWidget *); /*proto*/
static void (*__pyx_f_6_qtui__set_frame_editbar_visible)(bool); /*proto*/
static void (*__pyx_f_6_qtui__set_statusbar_visible)(bool); /*proto*/
static void (*__pyx_f_6_qtui__hide_controls)(void); /*proto*/
static void (*__pyx_f_6_qtui__get_splitter_sizes)(int &, int &); /*proto*/
static void (*__pyx_f_6_qtui__set_splitter_sizes)(int, int); /*proto*/
static void (*__pyx_f_6_qtui__splitter_update_minimumsize)(void); /*proto*/
static void (*__pyx_f_6_qtui__set_debug_text)(QString const &); /*proto*/
static void (*__pyx_f_6_qtui__set_toolbar_state)(int, int, int, int, int); /*proto*/
static void (*__pyx_f_6_qtui__clear_sidepane)(void); /*proto*/
static QPushButton *(*__pyx_f_6_qtui__create_sidepane_button)(QString const &); /*proto*/
static QTreeView *(*__pyx_f_6_qtui__create_sidepane_treeview)(QStandardItemModel *, int); /*proto*/
static void (*__pyx_f_6_qtui__set_active_plugin_group)(int); /*proto*/
static void (*__pyx_f_6_qtui__set_active_plugin_group_by_obj)(QObject *); /*proto*/
static int (*__pyx_f_6_qtui__get_plugin_group_count)(void); /*proto*/
static QModelIndex (*__pyx_f_6_qtui__root_index)(int); /*proto*/
static void (*__pyx_f_6_qtui__hide_row)(int, bool); /*proto*/
static void (*__pyx_f_6_qtui__set_row_hidden)(int, int, QModelIndex const &, bool); /*proto*/
static int (*__pyx_f_6_qtui__splitter_pos)(void); /*proto*/
static void (*__pyx_f_6_qtui__preferences_block_signals)(bool); /*proto*/
static void (*__pyx_f_6_qtui__combobox_add_shaderitem)(QString const &, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__combobox_add_samplesitem)(QString const &, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__add_movekey_row)(void); /*proto*/
static void (*__pyx_f_6_qtui__remove_movekey_row)(void); /*proto*/
static void (*__pyx_f_6_qtui__add_liststore_faces_row)(QString const &, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__finalize_liststore_faces)(QWidget *); /*proto*/
static QString (*__pyx_f_6_qtui__get_liststore_faces_facekey)(QModelIndex const &); /*proto*/
static void (*__pyx_f_6_qtui__set_button_color)(QString const &); /*proto*/
static QString (*__pyx_f_6_qtui__color_dialog)(QWidget *, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__set_imagemode)(int); /*proto*/
static void (*__pyx_f_6_qtui__add_combobox_image_item)(QIcon const &, QString const &, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__set_combobox_image)(int, QIcon const &, int); /*proto*/
static void (*__pyx_f_6_qtui__set_button_background_color)(QString const &); /*proto*/
static void (*__pyx_f_6_qtui__fill_page)(QVariant, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__set_page)(int); /*proto*/
static void (*__pyx_f_6_qtui__fill_header)(QString const &, QString const &, QString const &, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__fill_about_tab)(QString const &, QString const &, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__fill_contribute_tab)(QString const &); /*proto*/
static void (*__pyx_f_6_qtui__fill_license_tab)(QString const &, bool, QString const &); /*proto*/
static void (*__pyx_f_6_qtui__tab_widget_currentChanged)(int); /*proto*/
static void (*__pyx_f_6_qtui__update_animation)(bool); /*proto*/
static void (*__pyx_f_6_qtui__event_filter_stop_animation)(QEvent *); /*proto*/
static void (*__pyx_f_6_qtui__show_full_license)(bool, QUrl const &); /*proto*/

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from '_qt_qtwes2' */
static PyTypeObject *__pyx_ptype_10_qt_qtwes2___pyx_scope_struct__keyval_from_name = 0;
static PyTypeObject *__pyx_ptype_10_qt_qtwes2___pyx_scope_struct_1_genexpr = 0;
static long __pyx_v_10_qt_qtwes2_debug;
static struct __pyx_t_10_qt_qtwes2_RenderData __pyx_v_10_qt_qtwes2_renderdata;
static struct __pyx_t_10_qt_qtwes2_UIData __pyx_v_10_qt_qtwes2_uidata;
static void __pyx_f_10_qt_qtwes2_init_module(void); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_q2str(QString const &); /*proto*/
static QString __pyx_f_10_qt_qtwes2_str2q(PyObject *); /*proto*/
static QList<QVariant>  __pyx_f_10_qt_qtwes2__list2q(PyObject *); /*proto*/
static QVariant __pyx_f_10_qt_qtwes2_tovariant(PyObject *); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2__q2list(QList<QVariant>  const &); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2__qs2list(QStringList const &); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2__q2dict(QMap<QString, QVariant>  const &); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_fromvariant(QVariant const &); /*proto*/
static void __pyx_f_10_qt_qtwes2_render_update_atlas(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_render_fps(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_render_pick(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_render_init(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_render_destroy_texture(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_render_destroy(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_render_init_gldebuglogger(void); /*proto*/
static void __pyx_f_10_qt_qtwes2__pfmt(char *, int, int, int); /*proto*/
static void __pyx_f_10_qt_qtwes2__pfmt2(char *, int, int, int, int, int, int); /*proto*/
static void __pyx_f_10_qt_qtwes2_print_surface_info(void); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_set_atlas_size(int, int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_10_qt_qtwes2_set_default_surface_format(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_dump_info(char const *, QObject const *); /*proto*/
static void __pyx_f_10_qt_qtwes2_show_message_cb(void); /*proto*/
static void __pyx_f_10_qt_qtwes2__fill_treestore(QStandardItem *, PyObject *); /*proto*/
static bool __pyx_f_10_qt_qtwes2__hide_row(int, QModelIndex const &); /*proto*/
static QVariant __pyx_f_10_qt_qtwes2_create_stdmodel(PyObject *); /*proto*/
static void __pyx_f_10_qt_qtwes2_help_dialog(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_help_dialog_show(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_about_dialog(void); /*proto*/
static QIcon __pyx_f_10_qt_qtwes2_get_icon(PyObject *); /*proto*/
static void __pyx_f_10_qt_qtwes2__on_filesystemwatcher_changed_1(QString const &); /*proto*/
static void __pyx_f_10_qt_qtwes2__on_filesystemwatcher_changed_2(void); /*proto*/
static void __pyx_f_10_qt_qtwes2__on_singleShot(void); /*proto*/
static void __pyx_f_10_qt_qtwes2__on_settings_timer_timeout(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_settings_timer_create(void); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_settings_timer_start(int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_10_qt_qtwes2_settings_timer_destroy(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_animation_init(void); /*proto*/
static void __pyx_f_10_qt_qtwes2__on_animate_timer_timeout(void); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_animate_timer_start(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_10_qt_qtwes2_animate_timer_destroy(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_load_cursors(PyObject *); /*proto*/
static void __pyx_f_10_qt_qtwes2_destroy_cursors(void); /*proto*/
static void __pyx_f_10_qt_qtwes2_destroy_resources(void); /*proto*/
static void __pyx_f_10_qt_qtwes2__on_init_finalize(void); /*proto*/
#define __Pyx_MODULE_NAME "_qt_qtwes2"
int __pyx_module_is_main__qt_qtwes2 = 0;

/* Implementation of '_qt_qtwes2' */
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_RuntimeWarning;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_ValueError;
static const char __pyx_k_i[] = "i";
static const char __pyx_k_KP[] = "KP";
static const char __pyx_k__4[] = "_";
static const char __pyx_k__6[] = "";
static const char __pyx_k__7[] = " ";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_qt[] = "qt";
static const char __pyx_k_s1[] = "s1";
static const char __pyx_k_s2[] = "s2";
static const char __pyx_k_Key[] = "Key";
static const char __pyx_k_Num[] = "Num";
static const char __pyx_k__13[] = "/";
static const char __pyx_k__22[] = "+";
static const char __pyx_k_app[] = "app";
static const char __pyx_k_ccw[] = "ccw";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_Move[] = "Move";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_bool[] = "bool";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_font[] = "font";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_icon[] = "icon";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_msec[] = "msec";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_nick[] = "nick";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_text[] = "text";
static const char __pyx_k_void[] = "void*";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_Theme[] = "Theme";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_color[] = "color";
static const char __pyx_k_image[] = "image";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_plain[] = "plain";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_pyapp[] = "pyapp";
static const char __pyx_k_qpath[] = "qpath";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_theme[] = "theme";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tiled[] = "tiled";
static const char __pyx_k_title[] = "title";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_width[] = "width";
static const char __pyx_k_Key_Up[] = "Key_Up";
static const char __pyx_k_PyData[] = "PyData";
static const char __pyx_k_QtKeys[] = "QtKeys";
static const char __pyx_k_UI_DIR[] = "UI_DIR";
static const char __pyx_k_Ubuntu[] = "Ubuntu";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_button[] = "button";
static const char __pyx_k_config[] = "config_";
static const char __pyx_k_double[] = "double";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_height[] = "height";
static const char __pyx_k_images[] = "images";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_isfile[] = "isfile";
static const char __pyx_k_keyseq[] = "keyseq";
static const char __pyx_k_keystr[] = "keystr";
static const char __pyx_k_module[] = "module";
static const char __pyx_k_mosaic[] = "mosaic";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_pydata[] = "pydata";
static const char __pyx_k_select[] = "select \342\200\246";
static const char __pyx_k_simple[] = "simple";
static const char __pyx_k_transl[] = "transl";
static const char __pyx_k_void_2[] = "<void*>({})";
static const char __pyx_k_APPNAME[] = "APPNAME";
static const char __pyx_k_QObject[] = "QObject({})";
static const char __pyx_k_QString[] = "QString";
static const char __pyx_k_VERSION[] = "VERSION";
static const char __pyx_k_cursors[] = "cursors";
static const char __pyx_k_dirname[] = "dirname";
static const char __pyx_k_environ[] = "environ";
static const char __pyx_k_facekey[] = "facekey";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_gesture[] = "gesture";
static const char __pyx_k_gettext[] = "gettext";
static const char __pyx_k_load_ui[] = "load_ui";
static const char __pyx_k_maxsize[] = "maxsize";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_package[] = "__package__";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_subtree[] = "subtree";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_Key_Down[] = "Key_Down";
static const char __pyx_k_Key_Left[] = "Key_Left";
static const char __pyx_k_callback[] = "callback";
static const char __pyx_k_compiled[] = "  compiled:";
static const char __pyx_k_config_2[] = "config";
static const char __pyx_k_facename[] = "facename";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_module_2[] = "__module__";
static const char __pyx_k_pybiklib[] = "pybiklib";
static const char __pyx_k_quadrant[] = "quadrant";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_settings[] = "settings";
static const char __pyx_k_textures[] = "textures";
static const char __pyx_k_treeview[] = "treeview";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_COPYRIGHT[] = "COPYRIGHT";
static const char __pyx_k_DEBUG_FPS[] = "DEBUG_FPS";
static const char __pyx_k_DEBUG_MSG[] = "DEBUG_MSG";
static const char __pyx_k_DEBUG_QML[] = "DEBUG_QML";
static const char __pyx_k_DEBUG_SIM[] = "DEBUG_SIM";
static const char __pyx_k_Key_Right[] = "Key_Right";
static const char __pyx_k_OFFSCREEN[] = "  OFFSCREEN:";
static const char __pyx_k_angle_max[] = "angle_max";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_facenames[] = "facenames";
static const char __pyx_k_help_text[] = "help_text";
static const char __pyx_k_imagefile[] = "imagefile";
static const char __pyx_k_imagemode[] = "imagemode";
static const char __pyx_k_locations[] = "locations";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_mode_nick[] = "mode_nick";
static const char __pyx_k_qt_qtwes2[] = "_qt_qtwes2";
static const char __pyx_k_set_title[] = "set_title";
static const char __pyx_k_DEBUG_DRAW[] = "DEBUG_DRAW";
static const char __pyx_k_DEBUG_VFPS[] = "DEBUG_VFPS";
static const char __pyx_k_Key_Escape[] = "Key_Escape";
static const char __pyx_k_Key_Period[] = "Key_Period";
static const char __pyx_k_LeftButton[] = "LeftButton";
static const char __pyx_k_Open_Image[] = "Open Image";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_compiled_2[] = "__compiled";
static const char __pyx_k_drag_enter[] = "drag enter:";
static const char __pyx_k_draw_speed[] = "draw.speed";
static const char __pyx_k_imageindex[] = "imageindex";
static const char __pyx_k_index_icon[] = "index_icon";
static const char __pyx_k_mouse__png[] = "mouse_{}.png";
static const char __pyx_k_on_closing[] = "on_closing";
static const char __pyx_k_set_cursor[] = "set_cursor";
static const char __pyx_k_sizepolicy[] = "sizepolicy";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_stockicons[] = "stockicons";
static const char __pyx_k_DEBUG_MSGGL[] = "DEBUG_MSGGL";
static const char __pyx_k_DEBUG_PHONE[] = "DEBUG_PHONE";
static const char __pyx_k_GL_type_es2[] = "  GL-type: es2";
static const char __pyx_k_RightButton[] = "RightButton";
static const char __pyx_k_divider_pos[] = "divider_pos";
static const char __pyx_k_draw_accels[] = "draw.accels";
static const char __pyx_k_draw_shader[] = "draw.shader";
static const char __pyx_k_get_samples[] = "get_samples";
static const char __pyx_k_init_module[] = "init module:";
static const char __pyx_k_modelselect[] = "modelselect";
static const char __pyx_k_parse_color[] = "parse_color";
static const char __pyx_k_plugin_data[] = "plugin_data";
static const char __pyx_k_theme_faces[] = "theme.faces";
static const char __pyx_k_window_size[] = "window.size";
static const char __pyx_k_APPICON_FILE[] = "APPICON_FILE";
static const char __pyx_k_DEBUG_MSGEXT[] = "DEBUG_MSGEXT";
static const char __pyx_k_GRID_UNIT_PX[] = "GRID_UNIT_PX";
static const char __pyx_k_divider_pos2[] = "divider_pos2";
static const char __pyx_k_draw_samples[] = "draw.samples";
static const char __pyx_k_from_package[] = "  from package:";
static const char __pyx_k_scaled_width[] = "scaled_width";
static const char __pyx_k_shader_names[] = "shader_names";
static const char __pyx_k_show_message[] = "show_message";
static const char __pyx_k_text_to_html[] = "text_to_html";
static const char __pyx_k_unset_cursor[] = "unset_cursor";
static const char __pyx_k_DEBUG_GLDEBUG[] = "DEBUG_GLDEBUG";
static const char __pyx_k_ShiftModifier[] = "ShiftModifier";
static const char __pyx_k_about_website[] = "about_website";
static const char __pyx_k_create_window[] = "create_window";
static const char __pyx_k_currentfolder[] = "currentfolder";
static const char __pyx_k_fill_sidepane[] = "fill_sidepane";
static const char __pyx_k_fontpixelsize[] = "fontpixelsize";
static const char __pyx_k_get_imagefile[] = "get_imagefile";
static const char __pyx_k_on_model_back[] = "on_model_back";
static const char __pyx_k_on_mouse_zoom[] = "on_mouse_zoom";
static const char __pyx_k_parse_color_f[] = "parse_color_f";
static const char __pyx_k_scaled_height[] = "scaled_height";
static const char __pyx_k_theme_bgcolor[] = "theme.bgcolor";
static const char __pyx_k_warn_explicit[] = "warn_explicit";
static const char __pyx_k_RuntimeWarning[] = "RuntimeWarning";
static const char __pyx_k_Skip_mime_type[] = "Skip mime type:";
static const char __pyx_k_destroy_window[] = "destroy_window";
static const char __pyx_k_initial_resize[] = "initial_resize";
static const char __pyx_k_new_random_png[] = "new-random.png";
static const char __pyx_k_new_solved_png[] = "new-solved.png";
static const char __pyx_k_on_dialog_text[] = "on_dialog_text";
static const char __pyx_k_on_key_pressed[] = "on_key_pressed";
static const char __pyx_k_on_mouse_moved[] = "on_mouse_moved";
static const char __pyx_k_pick_requested[] = "pick_requested";
static const char __pyx_k_sample_buffers[] = "sample_buffers";
static const char __pyx_k_selection_nick[] = "selection_nick";
static const char __pyx_k_set_debug_text[] = "set_debug_text";
static const char __pyx_k_set_edit_moves[] = "set_edit_moves";
static const char __pyx_k_window_divider[] = "window.divider";
static const char __pyx_k_window_editbar[] = "window.editbar";
static const char __pyx_k_ControlModifier[] = "ControlModifier";
static const char __pyx_k_app_post_create[] = "app_post_create";
static const char __pyx_k_combobox_shader[] = "combobox_shader";
static const char __pyx_k_gl_delete_atlas[] = "gl_delete_atlas";
static const char __pyx_k_image_from_file[] = "image_from_file";
static const char __pyx_k_imageindex_icon[] = "imageindex_icon";
static const char __pyx_k_save_screenshot[] = "save_screenshot";
static const char __pyx_k_set_debug_flags[] = "set_debug_flags";
static const char __pyx_k_set_status_text[] = "set_status_text";
static const char __pyx_k_update_sidepane[] = "update_sidepane";
static const char __pyx_k_DEBUG_NOCONTROLS[] = "DEBUG_NOCONTROLS";
static const char __pyx_k_about_contribute[] = "about_contribute";
static const char __pyx_k_action_edit_cube[] = "action.edit_cube";
static const char __pyx_k_close_mainwindow[] = "close_mainwindow";
static const char __pyx_k_combobox_samples[] = "combobox_samples";
static const char __pyx_k_draw_speed_range[] = "draw.speed_range";
static const char __pyx_k_keyval_from_name[] = "keyval_from_name";
static const char __pyx_k_on_edit_finished[] = "on_edit_finished";
static const char __pyx_k_on_init_finalize[] = "on_init_finalize";
static const char __pyx_k_on_mouse_pressed[] = "on_mouse_pressed";
static const char __pyx_k_select_model_png[] = "select-model.png";
static const char __pyx_k_show_preferences[] = "show_preferences";
static const char __pyx_k_singleshot_queue[] = "singleshot_queue";
static const char __pyx_k_slider_animspeed[] = "slider_animspeed";
static const char __pyx_k_timer_singleShot[] = "timer_singleShot";
static const char __pyx_k_window_statusbar[] = "window.statusbar";
static const char __pyx_k_SHORT_DESCRIPTION[] = "SHORT_DESCRIPTION";
static const char __pyx_k_about_translators[] = "about_translators";
static const char __pyx_k_action_edit_moves[] = "action.edit_moves";
static const char __pyx_k_draw_mirror_faces[] = "draw.mirror_faces";
static const char __pyx_k_draw_shader_range[] = "draw.shader_range";
static const char __pyx_k_on_mouse_drop_url[] = "on_mouse_drop_url";
static const char __pyx_k_on_mouse_released[] = "on_mouse_released";
static const char __pyx_k_on_picking_result[] = "on_picking_result";
static const char __pyx_k_pybiklib_settings[] = "pybiklib.settings";
static const char __pyx_k_set_toolbar_state[] = "set_toolbar_state";
static const char __pyx_k_show_message_text[] = "show_message_text";
static const char __pyx_k_about_license_full[] = "about_license_full";
static const char __pyx_k_action_preferences[] = "action.preferences";
static const char __pyx_k_action_selectmodel[] = "action.selectmodel";
static const char __pyx_k_animate_timer_step[] = "animate_timer_step";
static const char __pyx_k_animate_timer_stop[] = "animate_timer_stop";
static const char __pyx_k_draw_samples_range[] = "draw.samples_range";
static const char __pyx_k_draw_speed_default[] = "draw.speed_default";
static const char __pyx_k_on_load_other_game[] = "on_load_other_game";
static const char __pyx_k_on_plugin_test_idx[] = "on_plugin_test_idx";
static const char __pyx_k_preferences_dialog[] = "preferences_dialog";
static const char __pyx_k_set_pick_requested[] = "set_pick_requested";
static const char __pyx_k_singleshot_handler[] = "singleshot_handler";
static const char __pyx_k_unknown_typename_s[] = "unknown typename %s";
static const char __pyx_k_update_drawingarea[] = "update_drawingarea";
static const char __pyx_k_about_license_short[] = "about_license_short";
static const char __pyx_k_draw_selection_nick[] = "draw.selection_nick";
static const char __pyx_k_draw_shader_default[] = "draw.shader_default";
static const char __pyx_k_get_pictures_folder[] = "get_pictures_folder";
static const char __pyx_k_on_animation_ending[] = "on_animation_ending";
static const char __pyx_k_on_mouse_drop_color[] = "on_mouse_drop_color";
static const char __pyx_k_on_plugin_activated[] = "on_plugin_activated";
static const char __pyx_k_set_animation_speed[] = "set_animation_speed";
static const char __pyx_k_value_has_wrong_typ[] = "value has wrong typ ";
static const char __pyx_k_action_initial_state[] = "action.initial_state";
static const char __pyx_k_button_mousemode_ext[] = "button_mousemode_ext";
static const char __pyx_k_draw_mirror_distance[] = "draw.mirror_distance";
static const char __pyx_k_draw_samples_default[] = "draw.samples_default";
static const char __pyx_k_load_image_from_file[] = "load_image_from_file";
static const char __pyx_k_spinbox_mirror_faces[] = "spinbox_mirror_faces";
static const char __pyx_k_action_reset_rotation[] = "action.reset_rotation";
static const char __pyx_k_button_mousemode_quad[] = "button_mousemode_quad";
static const char __pyx_k_checkbox_mirror_faces[] = "checkbox_mirror_faces";
static const char __pyx_k_label_needs_restarted[] = "label_needs_restarted";
static const char __pyx_k_about_license_notfound[] = "about_license_notfound";
static const char __pyx_k_filesystemwatcher_path[] = "filesystemwatcher_path";
static const char __pyx_k_on_edit_moves_nextword[] = "on_edit_moves_nextword";
static const char __pyx_k_on_edit_moves_prevword[] = "on_edit_moves_prevword";
static const char __pyx_k_on_edit_moves_swapnext[] = "on_edit_moves_swapnext";
static const char __pyx_k_on_edit_moves_swapprev[] = "on_edit_moves_swapprev";
static const char __pyx_k_on_model_get_modeldata[] = "on_model_get_modeldata";
static const char __pyx_k_text_FULL_LICENSE_TEXT[] = "text:FULL_LICENSE_TEXT";
static const char __pyx_k_button_mousemode_gesture[] = "button_mousemode_gesture";
static const char __pyx_k_create_filesystemwatcher[] = "create_filesystemwatcher";
static const char __pyx_k_get_filedialog_imagefile[] = "get_filedialog_imagefile";
static const char __pyx_k_on_action_next_triggered[] = "on_action_next_triggered";
static const char __pyx_k_on_action_play_triggered[] = "on_action_play_triggered";
static const char __pyx_k_on_action_stop_triggered[] = "on_action_stop_triggered";
static const char __pyx_k_on_convert_to_mtype_size[] = "on_convert_to_mtype_size";
static const char __pyx_k_draw_mirror_faces_default[] = "draw.mirror_faces_default";
static const char __pyx_k_on_settings_timer_timeout[] = "on_settings_timer_timeout";
static const char __pyx_k_draw_mirror_distance_range[] = "draw.mirror_distance_range";
static const char __pyx_k_filesystemwatcher_handlers[] = "filesystemwatcher_handlers";
static const char __pyx_k_on_action_rewind_triggered[] = "on_action_rewind_triggered";
static const char __pyx_k_set_combobox_current_image[] = "set_combobox_current_image";
static const char __pyx_k_on_action_forward_triggered[] = "on_action_forward_triggered";
static const char __pyx_k_draw_mirror_distance_default[] = "draw.mirror_distance_default";
static const char __pyx_k_on_action_mark_set_triggered[] = "on_action_mark_set_triggered";
static const char __pyx_k_on_action_previous_triggered[] = "on_action_previous_triggered";
static const char __pyx_k_on_action_challenge_triggered[] = "on_action_challenge_triggered";
static const char __pyx_k_on_action_edit_cube_triggered[] = "on_action_edit_cube_triggered";
static const char __pyx_k_on_dialog_change_current_face[] = "on_dialog_change_current_face";
static const char __pyx_k_on_dialog_reset_current_image[] = "on_dialog_reset_current_image";
static const char __pyx_k_on_action_new_solved_triggered[] = "on_action_new_solved_triggered";
static const char __pyx_k_on_dialog_change_current_image[] = "on_dialog_change_current_image";
static const char __pyx_k_tmp[] = "/tmp/build/temp.linux-x86_64-3.5/pybiklib/ext/_qt_qtwes2.pyx";
static const char __pyx_k_keyval_from_name_locals_genexpr[] = "keyval_from_name.<locals>.genexpr";
static const char __pyx_k_on_action_mark_remove_triggered[] = "on_action_mark_remove_triggered";
static const char __pyx_k_on_action_preferences_triggered[] = "on_action_preferences_triggered";
static const char __pyx_k_on_action_selectmodel_triggered[] = "on_action_selectmodel_triggered";
static const char __pyx_k_on_action_initial_state_triggere[] = "on_action_initial_state_triggered";
static const char __pyx_k_on_action_reset_rotation_trigger[] = "on_action_reset_rotation_triggered";
static const char __pyx_k_set_preferences_current_face_the[] = "set_preferences_current_face_theme";
static PyObject *__pyx_n_s_APPICON_FILE;
static PyObject *__pyx_n_s_APPNAME;
static PyObject *__pyx_n_s_COPYRIGHT;
static PyObject *__pyx_n_s_ControlModifier;
static PyObject *__pyx_n_s_DEBUG_DRAW;
static PyObject *__pyx_n_s_DEBUG_FPS;
static PyObject *__pyx_n_s_DEBUG_GLDEBUG;
static PyObject *__pyx_n_s_DEBUG_MSG;
static PyObject *__pyx_n_s_DEBUG_MSGEXT;
static PyObject *__pyx_n_s_DEBUG_MSGGL;
static PyObject *__pyx_n_s_DEBUG_NOCONTROLS;
static PyObject *__pyx_n_s_DEBUG_PHONE;
static PyObject *__pyx_n_s_DEBUG_QML;
static PyObject *__pyx_n_s_DEBUG_SIM;
static PyObject *__pyx_n_s_DEBUG_VFPS;
static PyObject *__pyx_kp_u_GL_type_es2;
static PyObject *__pyx_n_u_GRID_UNIT_PX;
static PyObject *__pyx_n_u_KP;
static PyObject *__pyx_n_u_Key;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_Key_Down;
static PyObject *__pyx_n_s_Key_Escape;
static PyObject *__pyx_n_s_Key_Left;
static PyObject *__pyx_n_s_Key_Period;
static PyObject *__pyx_n_s_Key_Right;
static PyObject *__pyx_n_s_Key_Up;
static PyObject *__pyx_n_s_LeftButton;
static PyObject *__pyx_n_u_Move;
static PyObject *__pyx_n_u_Num;
static PyObject *__pyx_kp_u_OFFSCREEN;
static PyObject *__pyx_kp_u_Open_Image;
static PyObject *__pyx_n_s_PyData;
static PyObject *__pyx_kp_u_QObject;
static PyObject *__pyx_n_b_QString;
static PyObject *__pyx_n_s_QtKeys;
static PyObject *__pyx_n_s_RightButton;
static PyObject *__pyx_n_s_RuntimeWarning;
static PyObject *__pyx_n_s_SHORT_DESCRIPTION;
static PyObject *__pyx_n_s_ShiftModifier;
static PyObject *__pyx_kp_u_Skip_mime_type;
static PyObject *__pyx_n_s_Theme;
static PyObject *__pyx_n_s_UI_DIR;
static PyObject *__pyx_n_u_Ubuntu;
static PyObject *__pyx_n_s_VERSION;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_u__13;
static PyObject *__pyx_kp_u__22;
static PyObject *__pyx_n_s__4;
static PyObject *__pyx_kp_u__6;
static PyObject *__pyx_kp_u__7;
static PyObject *__pyx_n_u_about_contribute;
static PyObject *__pyx_n_u_about_license_full;
static PyObject *__pyx_n_u_about_license_notfound;
static PyObject *__pyx_n_u_about_license_short;
static PyObject *__pyx_n_u_about_translators;
static PyObject *__pyx_n_u_about_website;
static PyObject *__pyx_kp_u_action_edit_cube;
static PyObject *__pyx_kp_u_action_edit_moves;
static PyObject *__pyx_kp_u_action_initial_state;
static PyObject *__pyx_kp_u_action_preferences;
static PyObject *__pyx_kp_u_action_reset_rotation;
static PyObject *__pyx_kp_u_action_selectmodel;
static PyObject *__pyx_n_s_angle_max;
static PyObject *__pyx_n_s_animate_timer_step;
static PyObject *__pyx_n_s_animate_timer_stop;
static PyObject *__pyx_n_s_app;
static PyObject *__pyx_n_s_app_post_create;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_b_bool;
static PyObject *__pyx_n_s_button;
static PyObject *__pyx_n_u_button_mousemode_ext;
static PyObject *__pyx_n_u_button_mousemode_gesture;
static PyObject *__pyx_n_u_button_mousemode_quad;
static PyObject *__pyx_n_s_callback;
static PyObject *__pyx_n_u_ccw;
static PyObject *__pyx_n_u_checkbox_mirror_faces;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_close_mainwindow;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_s_color;
static PyObject *__pyx_n_u_color;
static PyObject *__pyx_n_u_combobox_samples;
static PyObject *__pyx_n_u_combobox_shader;
static PyObject *__pyx_kp_u_compiled;
static PyObject *__pyx_n_s_compiled_2;
static PyObject *__pyx_n_s_config;
static PyObject *__pyx_n_s_config_2;
static PyObject *__pyx_n_s_create_filesystemwatcher;
static PyObject *__pyx_n_s_create_window;
static PyObject *__pyx_n_s_currentfolder;
static PyObject *__pyx_n_u_cursors;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_destroy_window;
static PyObject *__pyx_n_s_dirname;
static PyObject *__pyx_n_s_divider_pos;
static PyObject *__pyx_n_s_divider_pos2;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_b_double;
static PyObject *__pyx_kp_u_drag_enter;
static PyObject *__pyx_kp_u_draw_accels;
static PyObject *__pyx_kp_u_draw_mirror_distance;
static PyObject *__pyx_kp_u_draw_mirror_distance_default;
static PyObject *__pyx_kp_u_draw_mirror_distance_range;
static PyObject *__pyx_kp_u_draw_mirror_faces;
static PyObject *__pyx_kp_u_draw_mirror_faces_default;
static PyObject *__pyx_kp_u_draw_samples;
static PyObject *__pyx_kp_u_draw_samples_default;
static PyObject *__pyx_kp_u_draw_samples_range;
static PyObject *__pyx_kp_u_draw_selection_nick;
static PyObject *__pyx_kp_u_draw_shader;
static PyObject *__pyx_kp_u_draw_shader_default;
static PyObject *__pyx_kp_u_draw_shader_range;
static PyObject *__pyx_kp_u_draw_speed;
static PyObject *__pyx_kp_u_draw_speed_default;
static PyObject *__pyx_kp_u_draw_speed_range;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_environ;
static PyObject *__pyx_n_s_facekey;
static PyObject *__pyx_n_s_facename;
static PyObject *__pyx_n_s_facenames;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_filesystemwatcher_handlers;
static PyObject *__pyx_n_s_filesystemwatcher_path;
static PyObject *__pyx_n_s_fill_sidepane;
static PyObject *__pyx_n_s_font;
static PyObject *__pyx_n_s_fontpixelsize;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_kp_u_from_package;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_u_gesture;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_filedialog_imagefile;
static PyObject *__pyx_n_s_get_imagefile;
static PyObject *__pyx_n_s_get_pictures_folder;
static PyObject *__pyx_n_s_get_samples;
static PyObject *__pyx_n_s_gettext;
static PyObject *__pyx_n_s_gl_delete_atlas;
static PyObject *__pyx_n_s_height;
static PyObject *__pyx_n_u_help_text;
static PyObject *__pyx_kp_s_tmp;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_icon;
static PyObject *__pyx_n_s_image;
static PyObject *__pyx_n_u_image;
static PyObject *__pyx_n_s_image_from_file;
static PyObject *__pyx_n_s_imagefile;
static PyObject *__pyx_n_s_imageindex;
static PyObject *__pyx_n_s_imageindex_icon;
static PyObject *__pyx_n_s_imagemode;
static PyObject *__pyx_n_u_images;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_index_icon;
static PyObject *__pyx_kp_u_init_module;
static PyObject *__pyx_n_s_initial_resize;
static PyObject *__pyx_n_b_int;
static PyObject *__pyx_n_s_isfile;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_keyseq;
static PyObject *__pyx_n_s_keystr;
static PyObject *__pyx_n_s_keyval_from_name;
static PyObject *__pyx_n_s_keyval_from_name_locals_genexpr;
static PyObject *__pyx_n_u_label_needs_restarted;
static PyObject *__pyx_n_s_load_image_from_file;
static PyObject *__pyx_n_s_load_ui;
static PyObject *__pyx_n_s_locations;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_maxsize;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_u_mode_nick;
static PyObject *__pyx_n_s_modelselect;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_module_2;
static PyObject *__pyx_n_u_mosaic;
static PyObject *__pyx_kp_u_mouse__png;
static PyObject *__pyx_n_s_msec;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_kp_u_new_random_png;
static PyObject *__pyx_kp_u_new_solved_png;
static PyObject *__pyx_n_s_nick;
static PyObject *__pyx_n_s_on_action_challenge_triggered;
static PyObject *__pyx_n_s_on_action_edit_cube_triggered;
static PyObject *__pyx_n_s_on_action_forward_triggered;
static PyObject *__pyx_n_s_on_action_initial_state_triggere;
static PyObject *__pyx_n_s_on_action_mark_remove_triggered;
static PyObject *__pyx_n_s_on_action_mark_set_triggered;
static PyObject *__pyx_n_s_on_action_new_solved_triggered;
static PyObject *__pyx_n_s_on_action_next_triggered;
static PyObject *__pyx_n_s_on_action_play_triggered;
static PyObject *__pyx_n_s_on_action_preferences_triggered;
static PyObject *__pyx_n_s_on_action_previous_triggered;
static PyObject *__pyx_n_s_on_action_reset_rotation_trigger;
static PyObject *__pyx_n_s_on_action_rewind_triggered;
static PyObject *__pyx_n_s_on_action_selectmodel_triggered;
static PyObject *__pyx_n_s_on_action_stop_triggered;
static PyObject *__pyx_n_s_on_animation_ending;
static PyObject *__pyx_n_s_on_closing;
static PyObject *__pyx_n_s_on_convert_to_mtype_size;
static PyObject *__pyx_n_s_on_dialog_change_current_face;
static PyObject *__pyx_n_s_on_dialog_change_current_image;
static PyObject *__pyx_n_s_on_dialog_reset_current_image;
static PyObject *__pyx_n_s_on_dialog_text;
static PyObject *__pyx_n_s_on_edit_finished;
static PyObject *__pyx_n_s_on_edit_moves_nextword;
static PyObject *__pyx_n_s_on_edit_moves_prevword;
static PyObject *__pyx_n_s_on_edit_moves_swapnext;
static PyObject *__pyx_n_s_on_edit_moves_swapprev;
static PyObject *__pyx_n_s_on_init_finalize;
static PyObject *__pyx_n_s_on_key_pressed;
static PyObject *__pyx_n_s_on_load_other_game;
static PyObject *__pyx_n_s_on_model_back;
static PyObject *__pyx_n_s_on_model_get_modeldata;
static PyObject *__pyx_n_s_on_mouse_drop_color;
static PyObject *__pyx_n_s_on_mouse_drop_url;
static PyObject *__pyx_n_s_on_mouse_moved;
static PyObject *__pyx_n_s_on_mouse_pressed;
static PyObject *__pyx_n_s_on_mouse_released;
static PyObject *__pyx_n_s_on_mouse_zoom;
static PyObject *__pyx_n_s_on_picking_result;
static PyObject *__pyx_n_s_on_plugin_activated;
static PyObject *__pyx_n_s_on_plugin_test_idx;
static PyObject *__pyx_n_s_on_settings_timer_timeout;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_package;
static PyObject *__pyx_n_s_parse_color;
static PyObject *__pyx_n_s_parse_color_f;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pick_requested;
static PyObject *__pyx_n_u_plain;
static PyObject *__pyx_n_s_plugin_data;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_preferences_dialog;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_pyapp;
static PyObject *__pyx_n_s_pybiklib;
static PyObject *__pyx_n_s_pybiklib_settings;
static PyObject *__pyx_n_s_pydata;
static PyObject *__pyx_n_s_qpath;
static PyObject *__pyx_n_u_qt;
static PyObject *__pyx_n_s_qt_qtwes2;
static PyObject *__pyx_n_u_quadrant;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_s1;
static PyObject *__pyx_n_s_s2;
static PyObject *__pyx_n_s_sample_buffers;
static PyObject *__pyx_n_s_save_screenshot;
static PyObject *__pyx_n_s_scaled_height;
static PyObject *__pyx_n_s_scaled_width;
static PyObject *__pyx_kp_u_select;
static PyObject *__pyx_kp_u_select_model_png;
static PyObject *__pyx_n_s_selection_nick;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_set_animation_speed;
static PyObject *__pyx_n_s_set_combobox_current_image;
static PyObject *__pyx_n_s_set_cursor;
static PyObject *__pyx_n_s_set_debug_flags;
static PyObject *__pyx_n_s_set_debug_text;
static PyObject *__pyx_n_s_set_edit_moves;
static PyObject *__pyx_n_s_set_pick_requested;
static PyObject *__pyx_n_s_set_preferences_current_face_the;
static PyObject *__pyx_n_s_set_status_text;
static PyObject *__pyx_n_s_set_title;
static PyObject *__pyx_n_s_set_toolbar_state;
static PyObject *__pyx_n_s_settings;
static PyObject *__pyx_n_s_shader_names;
static PyObject *__pyx_n_s_show_message;
static PyObject *__pyx_n_s_show_message_text;
static PyObject *__pyx_n_s_show_preferences;
static PyObject *__pyx_n_u_simple;
static PyObject *__pyx_n_s_singleshot_handler;
static PyObject *__pyx_n_s_singleshot_queue;
static PyObject *__pyx_n_s_sizepolicy;
static PyObject *__pyx_n_u_slider_animspeed;
static PyObject *__pyx_n_u_spinbox_mirror_faces;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_stockicons;
static PyObject *__pyx_n_s_subtree;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_text;
static PyObject *__pyx_kp_u_text_FULL_LICENSE_TEXT;
static PyObject *__pyx_n_s_text_to_html;
static PyObject *__pyx_n_s_textures;
static PyObject *__pyx_n_s_theme;
static PyObject *__pyx_kp_u_theme_bgcolor;
static PyObject *__pyx_kp_u_theme_faces;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_u_tiled;
static PyObject *__pyx_n_s_timer_singleShot;
static PyObject *__pyx_n_s_title;
static PyObject *__pyx_n_s_transl;
static PyObject *__pyx_n_s_treeview;
static PyObject *__pyx_kp_u_unknown_typename_s;
static PyObject *__pyx_n_s_unset_cursor;
static PyObject *__pyx_n_s_update_drawingarea;
static PyObject *__pyx_n_s_update_sidepane;
static PyObject *__pyx_kp_u_utf_8;
static PyObject *__pyx_kp_u_value_has_wrong_typ;
static PyObject *__pyx_kp_b_void;
static PyObject *__pyx_kp_u_void_2;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warn_explicit;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_kp_u_window_divider;
static PyObject *__pyx_kp_u_window_editbar;
static PyObject *__pyx_kp_u_window_size;
static PyObject *__pyx_kp_u_window_statusbar;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_pf_10_qt_qtwes2_set_debug_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_2gl_delete_atlas(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_4set_pick_requested(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pick_requested); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_6set_atlas_size(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_width, int __pyx_v_height); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_8set_debug_text(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_10set_edit_moves(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code, PyObject *__pyx_v_pos); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_12set_status_text(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_14show_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_16fill_sidepane(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_plugin_data); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_18update_sidepane(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_20set_toolbar_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_22set_combobox_current_image(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index_icon, PyObject *__pyx_v_imagefile, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_24set_preferences_current_face_theme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_color, PyObject *__pyx_v_imageindex_icon, PyObject *__pyx_v_imagefile, PyObject *__pyx_v_imageindex, PyObject *__pyx_v_imagemode); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_26get_filedialog_imagefile(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_28preferences_dialog(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shader_names, CYTHON_UNUSED PyObject *__pyx_v_sample_buffers, PyObject *__pyx_v_facenames, PyObject *__pyx_v_stockicons); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_30show_preferences(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_32initial_resize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_34set_title(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_36load_ui(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_38close_mainwindow(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_40get_samples(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_42update_drawingarea(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_44set_cursor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_46unset_cursor(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_48save_screenshot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_50parse_color(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_52parse_color_f(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_54load_image_from_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_maxsize); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_16keyval_from_name_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_56keyval_from_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keystr); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_58get_pictures_folder(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_60get_imagefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_facekey); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_62text_to_html(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_64create_filesystemwatcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_66timer_singleShot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_msec, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_68settings_timer_start(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_70set_animation_speed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_72animate_timer_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_msec, PyObject *__pyx_v_angle_max); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_74animate_timer_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_angle_max); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_76animate_timer_stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_78create_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pyapp); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_80destroy_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_10_qt_qtwes2_82app_post_create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gettext); /* proto */
static PyObject *__pyx_tp_new_10_qt_qtwes2___pyx_scope_struct__keyval_from_name(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10_qt_qtwes2___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float_14_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_18;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__33;
static PyObject *__pyx_codeobj__35;
static PyObject *__pyx_codeobj__37;
static PyObject *__pyx_codeobj__39;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__47;
static PyObject *__pyx_codeobj__49;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__58;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__64;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__67;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__74;
static PyObject *__pyx_codeobj__76;
static PyObject *__pyx_codeobj__78;
static PyObject *__pyx_codeobj__80;
static PyObject *__pyx_codeobj__82;
static PyObject *__pyx_codeobj__84;
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;

/* "_qt_qtwes2.pyx":102
 * debug = 0
 * 
 * def set_debug_flags(module):             # <<<<<<<<<<<<<<
 *     global debug
 *     if module.DEBUG_MSG:   debug |= DEBUG_MSG
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_1set_debug_flags(PyObject *__pyx_self, PyObject *__pyx_v_module); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_1set_debug_flags = {"set_debug_flags", (PyCFunction)__pyx_pw_10_qt_qtwes2_1set_debug_flags, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_1set_debug_flags(PyObject *__pyx_self, PyObject *__pyx_v_module) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_debug_flags (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_set_debug_flags(__pyx_self, ((PyObject *)__pyx_v_module));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_set_debug_flags(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_module) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_debug_flags", 0);

  /* "_qt_qtwes2.pyx":104
 * def set_debug_flags(module):
 *     global debug
 *     if module.DEBUG_MSG:   debug |= DEBUG_MSG             # <<<<<<<<<<<<<<
 *     if module.DEBUG_MSGGL: debug |= DEBUG_MSGGL
 *     if module.DEBUG_MSGEXT: debug |= DEBUG_MSGEXT
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_MSG); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_MSG);
  }

  /* "_qt_qtwes2.pyx":105
 *     global debug
 *     if module.DEBUG_MSG:   debug |= DEBUG_MSG
 *     if module.DEBUG_MSGGL: debug |= DEBUG_MSGGL             # <<<<<<<<<<<<<<
 *     if module.DEBUG_MSGEXT: debug |= DEBUG_MSGEXT
 *     if module.DEBUG_DRAW: debug |= DEBUG_DRAW
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_MSGGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_MSGGL);
  }

  /* "_qt_qtwes2.pyx":106
 *     if module.DEBUG_MSG:   debug |= DEBUG_MSG
 *     if module.DEBUG_MSGGL: debug |= DEBUG_MSGGL
 *     if module.DEBUG_MSGEXT: debug |= DEBUG_MSGEXT             # <<<<<<<<<<<<<<
 *     if module.DEBUG_DRAW: debug |= DEBUG_DRAW
 *     if module.DEBUG_FPS: debug |= DEBUG_FPS
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_MSGEXT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_MSGEXT);
  }

  /* "_qt_qtwes2.pyx":107
 *     if module.DEBUG_MSGGL: debug |= DEBUG_MSGGL
 *     if module.DEBUG_MSGEXT: debug |= DEBUG_MSGEXT
 *     if module.DEBUG_DRAW: debug |= DEBUG_DRAW             # <<<<<<<<<<<<<<
 *     if module.DEBUG_FPS: debug |= DEBUG_FPS
 *     if module.DEBUG_VFPS: debug |= DEBUG_VFPS
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_DRAW); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_DRAW);
  }

  /* "_qt_qtwes2.pyx":108
 *     if module.DEBUG_MSGEXT: debug |= DEBUG_MSGEXT
 *     if module.DEBUG_DRAW: debug |= DEBUG_DRAW
 *     if module.DEBUG_FPS: debug |= DEBUG_FPS             # <<<<<<<<<<<<<<
 *     if module.DEBUG_VFPS: debug |= DEBUG_VFPS
 *     if module.DEBUG_QML: debug |= DEBUG_QML
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_FPS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_FPS);
  }

  /* "_qt_qtwes2.pyx":109
 *     if module.DEBUG_DRAW: debug |= DEBUG_DRAW
 *     if module.DEBUG_FPS: debug |= DEBUG_FPS
 *     if module.DEBUG_VFPS: debug |= DEBUG_VFPS             # <<<<<<<<<<<<<<
 *     if module.DEBUG_QML: debug |= DEBUG_QML
 *     if module.DEBUG_GLDEBUG: debug |= DEBUG_GLDEBUG
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_VFPS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_VFPS);
  }

  /* "_qt_qtwes2.pyx":110
 *     if module.DEBUG_FPS: debug |= DEBUG_FPS
 *     if module.DEBUG_VFPS: debug |= DEBUG_VFPS
 *     if module.DEBUG_QML: debug |= DEBUG_QML             # <<<<<<<<<<<<<<
 *     if module.DEBUG_GLDEBUG: debug |= DEBUG_GLDEBUG
 *     if module.DEBUG_PHONE: debug |= DEBUG_PHONE
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_QML); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_QML);
  }

  /* "_qt_qtwes2.pyx":111
 *     if module.DEBUG_VFPS: debug |= DEBUG_VFPS
 *     if module.DEBUG_QML: debug |= DEBUG_QML
 *     if module.DEBUG_GLDEBUG: debug |= DEBUG_GLDEBUG             # <<<<<<<<<<<<<<
 *     if module.DEBUG_PHONE: debug |= DEBUG_PHONE
 *     if module.DEBUG_SIM: debug |= DEBUG_SIM
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_GLDEBUG); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_GLDEBUG);
  }

  /* "_qt_qtwes2.pyx":112
 *     if module.DEBUG_QML: debug |= DEBUG_QML
 *     if module.DEBUG_GLDEBUG: debug |= DEBUG_GLDEBUG
 *     if module.DEBUG_PHONE: debug |= DEBUG_PHONE             # <<<<<<<<<<<<<<
 *     if module.DEBUG_SIM: debug |= DEBUG_SIM
 *     if module.DEBUG_NOCONTROLS: debug |= DEBUG_NOCONTROLS
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_PHONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_PHONE);
  }

  /* "_qt_qtwes2.pyx":113
 *     if module.DEBUG_GLDEBUG: debug |= DEBUG_GLDEBUG
 *     if module.DEBUG_PHONE: debug |= DEBUG_PHONE
 *     if module.DEBUG_SIM: debug |= DEBUG_SIM             # <<<<<<<<<<<<<<
 *     if module.DEBUG_NOCONTROLS: debug |= DEBUG_NOCONTROLS
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_SIM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_SIM);
  }

  /* "_qt_qtwes2.pyx":114
 *     if module.DEBUG_PHONE: debug |= DEBUG_PHONE
 *     if module.DEBUG_SIM: debug |= DEBUG_SIM
 *     if module.DEBUG_NOCONTROLS: debug |= DEBUG_NOCONTROLS             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_DEBUG_NOCONTROLS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
    __pyx_v_10_qt_qtwes2_debug = (__pyx_v_10_qt_qtwes2_debug | __pyx_e_10_qt_qtwes2_DEBUG_NOCONTROLS);
  }

  /* "_qt_qtwes2.pyx":102
 * debug = 0
 * 
 * def set_debug_flags(module):             # <<<<<<<<<<<<<<
 *     global debug
 *     if module.DEBUG_MSG:   debug |= DEBUG_MSG
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.set_debug_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":222
 * 
 * ##pxm-FUNC P
 * cdef void init_module():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.init_module()
 */

static void __pyx_f_10_qt_qtwes2_init_module(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("init_module", 0);

  /* "_qt_qtwes2.pyx":224
 * cdef void init_module():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.init_module()             # <<<<<<<<<<<<<<
 *     ##pxm>IF_END
 *     if debug & DEBUG_MSGEXT:
 */
  __pyx_f_6_qtui__init_module();

  /* "_qt_qtwes2.pyx":226
 *     qtui.init_module()
 *     ##pxm>IF_END
 *     if debug & DEBUG_MSGEXT:             # <<<<<<<<<<<<<<
 *         print('init module:', __name__)
 *         print('  from package:', __package__)
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_MSGEXT) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":227
 *     ##pxm>IF_END
 *     if debug & DEBUG_MSGEXT:
 *         print('init module:', __name__)             # <<<<<<<<<<<<<<
 *         print('  from package:', __package__)
 *         print('  compiled:', __compiled)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_kp_u_init_module);
    __Pyx_GIVEREF(__pyx_kp_u_init_module);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_init_module);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":228
 *     if debug & DEBUG_MSGEXT:
 *         print('init module:', __name__)
 *         print('  from package:', __package__)             # <<<<<<<<<<<<<<
 *         print('  compiled:', __compiled)
 *         print('  GL-type: es2') #px+
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_package); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_kp_u_from_package);
    __Pyx_GIVEREF(__pyx_kp_u_from_package);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_from_package);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":229
 *         print('init module:', __name__)
 *         print('  from package:', __package__)
 *         print('  compiled:', __compiled)             # <<<<<<<<<<<<<<
 *         print('  GL-type: es2') #px+
 *         print('  OFFSCREEN:', OFFSCREEN)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_compiled_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_kp_u_compiled);
    __Pyx_GIVEREF(__pyx_kp_u_compiled);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_compiled);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":230
 *         print('  from package:', __package__)
 *         print('  compiled:', __compiled)
 *         print('  GL-type: es2') #px+             # <<<<<<<<<<<<<<
 *         print('  OFFSCREEN:', OFFSCREEN)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":231
 *         print('  compiled:', __compiled)
 *         print('  GL-type: es2') #px+
 *         print('  OFFSCREEN:', OFFSCREEN)             # <<<<<<<<<<<<<<
 * 
 *     renderdata.renderer = NULL
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":226
 *     qtui.init_module()
 *     ##pxm>IF_END
 *     if debug & DEBUG_MSGEXT:             # <<<<<<<<<<<<<<
 *         print('init module:', __name__)
 *         print('  from package:', __package__)
 */
  }

  /* "_qt_qtwes2.pyx":233
 *         print('  OFFSCREEN:', OFFSCREEN)
 * 
 *     renderdata.renderer = NULL             # <<<<<<<<<<<<<<
 *     uidata.atlas_changed = False
 *     uidata.pick_requested = False
 */
  __pyx_v_10_qt_qtwes2_renderdata.renderer = NULL;

  /* "_qt_qtwes2.pyx":234
 * 
 *     renderdata.renderer = NULL
 *     uidata.atlas_changed = False             # <<<<<<<<<<<<<<
 *     uidata.pick_requested = False
 *     uidata.filesystemwatcher = NULL
 */
  __pyx_v_10_qt_qtwes2_uidata.atlas_changed = 0;

  /* "_qt_qtwes2.pyx":235
 *     renderdata.renderer = NULL
 *     uidata.atlas_changed = False
 *     uidata.pick_requested = False             # <<<<<<<<<<<<<<
 *     uidata.filesystemwatcher = NULL
 *     uidata.width = 0
 */
  __pyx_v_10_qt_qtwes2_uidata.pick_requested = 0;

  /* "_qt_qtwes2.pyx":236
 *     uidata.atlas_changed = False
 *     uidata.pick_requested = False
 *     uidata.filesystemwatcher = NULL             # <<<<<<<<<<<<<<
 *     uidata.width = 0
 *     uidata.height = 0
 */
  __pyx_v_10_qt_qtwes2_uidata.filesystemwatcher = NULL;

  /* "_qt_qtwes2.pyx":237
 *     uidata.pick_requested = False
 *     uidata.filesystemwatcher = NULL
 *     uidata.width = 0             # <<<<<<<<<<<<<<
 *     uidata.height = 0
 *     uidata.gl_y = 0
 */
  __pyx_v_10_qt_qtwes2_uidata.width = 0;

  /* "_qt_qtwes2.pyx":238
 *     uidata.filesystemwatcher = NULL
 *     uidata.width = 0
 *     uidata.height = 0             # <<<<<<<<<<<<<<
 *     uidata.gl_y = 0
 *     ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_v_10_qt_qtwes2_uidata.height = 0;

  /* "_qt_qtwes2.pyx":239
 *     uidata.width = 0
 *     uidata.height = 0
 *     uidata.gl_y = 0             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.help = NULL
 */
  __pyx_v_10_qt_qtwes2_uidata.gl_y = 0;

  /* "_qt_qtwes2.pyx":241
 *     uidata.gl_y = 0
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.help = NULL             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ uidata.model_pagevisible = False
 */
  __pyx_v_10_qt_qtwes2_uidata.help = NULL;

  /* "_qt_qtwes2.pyx":222
 * 
 * ##pxm-FUNC P
 * cdef void init_module():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.init_module()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("_qt_qtwes2.init_module", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":251
 * 
 * ##pxm-FUNC P
 * cdef q2str(const QString &qstr):             # <<<<<<<<<<<<<<
 *     cdef QByteArray data = qstr.toUtf8() #px+
 *     return data.data()[:data.size()].decode('utf-8') #px+
 */

static PyObject *__pyx_f_10_qt_qtwes2_q2str(QString const &__pyx_v_qstr) {
  QByteArray __pyx_v_data;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("q2str", 0);

  /* "_qt_qtwes2.pyx":252
 * ##pxm-FUNC P
 * cdef q2str(const QString &qstr):
 *     cdef QByteArray data = qstr.toUtf8() #px+             # <<<<<<<<<<<<<<
 *     return data.data()[:data.size()].decode('utf-8') #px+
 * ##pxm-FUNC P
 */
  __pyx_v_data = __pyx_v_qstr.toUtf8();

  /* "_qt_qtwes2.pyx":253
 * cdef q2str(const QString &qstr):
 *     cdef QByteArray data = qstr.toUtf8() #px+
 *     return data.data()[:data.size()].decode('utf-8') #px+             # <<<<<<<<<<<<<<
 * ##pxm-FUNC P
 * cdef QString str2q(pstr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_decode_c_string(__pyx_v_data.data(), 0, __pyx_v_data.size(), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":251
 * 
 * ##pxm-FUNC P
 * cdef q2str(const QString &qstr):             # <<<<<<<<<<<<<<
 *     cdef QByteArray data = qstr.toUtf8() #px+
 *     return data.data()[:data.size()].decode('utf-8') #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.q2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":255
 *     return data.data()[:data.size()].decode('utf-8') #px+
 * ##pxm-FUNC P
 * cdef QString str2q(pstr):             # <<<<<<<<<<<<<<
 *     data = pstr.encode('utf-8') #px+
 *     return fromUtf8(<char*>data, len(data)) #px+
 */

static QString __pyx_f_10_qt_qtwes2_str2q(PyObject *__pyx_v_pstr) {
  PyObject *__pyx_v_data = NULL;
  QString __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("str2q", 0);

  /* "_qt_qtwes2.pyx":256
 * ##pxm-FUNC P
 * cdef QString str2q(pstr):
 *     data = pstr.encode('utf-8') #px+             # <<<<<<<<<<<<<<
 *     return fromUtf8(<char*>data, len(data)) #px+
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pstr, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_data = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":257
 * cdef QString str2q(pstr):
 *     data = pstr.encode('utf-8') #px+
 *     return fromUtf8(<char*>data, len(data)) #px+             # <<<<<<<<<<<<<<
 * 
 * cdef QVariantList _list2q(value): #px+
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L1_error)
  __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 257, __pyx_L1_error)
  __pyx_r = QString::fromUtf8(((char *)__pyx_t_3), __pyx_t_4);
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":255
 *     return data.data()[:data.size()].decode('utf-8') #px+
 * ##pxm-FUNC P
 * cdef QString str2q(pstr):             # <<<<<<<<<<<<<<
 *     data = pstr.encode('utf-8') #px+
 *     return fromUtf8(<char*>data, len(data)) #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("_qt_qtwes2.str2q", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":259
 *     return fromUtf8(<char*>data, len(data)) #px+
 * 
 * cdef QVariantList _list2q(value): #px+             # <<<<<<<<<<<<<<
 *     cdef QVariantList qlist #px+
 *     cdef QVariant qvalue #px+
 */

static QList<QVariant>  __pyx_f_10_qt_qtwes2__list2q(PyObject *__pyx_v_value) {
  QList<QVariant>  __pyx_v_qlist;
  QVariant __pyx_v_qvalue;
  int __pyx_v_i;
  QList<QVariant>  __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_list2q", 0);

  /* "_qt_qtwes2.pyx":263
 *     cdef QVariant qvalue #px+
 *     cdef int i #px+
 *     qlist.reserve(len(value)) #px+             # <<<<<<<<<<<<<<
 *     for i in range(len(value)): #px+
 *         qvalue = tovariant(value[i]) #px+
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 263, __pyx_L1_error)
  __pyx_v_qlist.reserve(__pyx_t_1);

  /* "_qt_qtwes2.pyx":264
 *     cdef int i #px+
 *     qlist.reserve(len(value)) #px+
 *     for i in range(len(value)): #px+             # <<<<<<<<<<<<<<
 *         qvalue = tovariant(value[i]) #px+
 *         qlist.append(qvalue) #px+
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 264, __pyx_L1_error)
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "_qt_qtwes2.pyx":265
 *     qlist.reserve(len(value)) #px+
 *     for i in range(len(value)): #px+
 *         qvalue = tovariant(value[i]) #px+             # <<<<<<<<<<<<<<
 *         qlist.append(qvalue) #px+
 *     return qlist #px+
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_qvalue = __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_qt_qtwes2.pyx":266
 *     for i in range(len(value)): #px+
 *         qvalue = tovariant(value[i]) #px+
 *         qlist.append(qvalue) #px+             # <<<<<<<<<<<<<<
 *     return qlist #px+
 * 
 */
    __pyx_v_qlist.append(__pyx_v_qvalue);
  }

  /* "_qt_qtwes2.pyx":267
 *         qvalue = tovariant(value[i]) #px+
 *         qlist.append(qvalue) #px+
 *     return qlist #px+             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
  __pyx_r = __pyx_v_qlist;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":259
 *     return fromUtf8(<char*>data, len(data)) #px+
 * 
 * cdef QVariantList _list2q(value): #px+             # <<<<<<<<<<<<<<
 *     cdef QVariantList qlist #px+
 *     cdef QVariant qvalue #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("_qt_qtwes2._list2q", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":270
 * 
 * ##pxm-FUNC P
 * cdef QVariant tovariant(value):             # <<<<<<<<<<<<<<
 *     cdef QVariant qvalue #px/
 *     #qvalue = list(value) if type(value) == tuple else value
 */

static QVariant __pyx_f_10_qt_qtwes2_tovariant(PyObject *__pyx_v_value) {
  QVariant __pyx_v_qvalue;
  QVariant __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  bool __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("tovariant", 0);

  /* "_qt_qtwes2.pyx":273
 *     cdef QVariant qvalue #px/
 *     #qvalue = list(value) if type(value) == tuple else value
 *     if type(value) is bool: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[cbool](value) #px+
 *     elif type(value) is int: #px+
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject*)&PyBool_Type));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "_qt_qtwes2.pyx":274
 *     #qvalue = list(value) if type(value) == tuple else value
 *     if type(value) is bool: #px+
 *         qvalue.setValue[cbool](value) #px+             # <<<<<<<<<<<<<<
 *     elif type(value) is int: #px+
 *         qvalue.setValue[int](value) #px+
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L1_error)
    __pyx_v_qvalue.setValue<bool>(__pyx_t_3);

    /* "_qt_qtwes2.pyx":273
 *     cdef QVariant qvalue #px/
 *     #qvalue = list(value) if type(value) == tuple else value
 *     if type(value) is bool: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[cbool](value) #px+
 *     elif type(value) is int: #px+
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":275
 *     if type(value) is bool: #px+
 *         qvalue.setValue[cbool](value) #px+
 *     elif type(value) is int: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[int](value) #px+
 *     elif type(value) is float: #px+
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject *)(&PyInt_Type)));
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":276
 *         qvalue.setValue[cbool](value) #px+
 *     elif type(value) is int: #px+
 *         qvalue.setValue[int](value) #px+             # <<<<<<<<<<<<<<
 *     elif type(value) is float: #px+
 *         qvalue.setValue[double](value) #px+
 */
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error)
    __pyx_v_qvalue.setValue<int>(__pyx_t_4);

    /* "_qt_qtwes2.pyx":275
 *     if type(value) is bool: #px+
 *         qvalue.setValue[cbool](value) #px+
 *     elif type(value) is int: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[int](value) #px+
 *     elif type(value) is float: #px+
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":277
 *     elif type(value) is int: #px+
 *         qvalue.setValue[int](value) #px+
 *     elif type(value) is float: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[double](value) #px+
 *     elif type(value) is str: #px+
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject *)(&PyFloat_Type)));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "_qt_qtwes2.pyx":278
 *         qvalue.setValue[int](value) #px+
 *     elif type(value) is float: #px+
 *         qvalue.setValue[double](value) #px+             # <<<<<<<<<<<<<<
 *     elif type(value) is str: #px+
 *         qvalue.setValue[QString](str2q(value)) #px+
 */
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error)
    __pyx_v_qvalue.setValue<double>(__pyx_t_5);

    /* "_qt_qtwes2.pyx":277
 *     elif type(value) is int: #px+
 *         qvalue.setValue[int](value) #px+
 *     elif type(value) is float: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[double](value) #px+
 *     elif type(value) is str: #px+
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":279
 *     elif type(value) is float: #px+
 *         qvalue.setValue[double](value) #px+
 *     elif type(value) is str: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[QString](str2q(value)) #px+
 *     elif type(value) is list or type(value) is tuple: #px+
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject *)(&PyUnicode_Type)));
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":280
 *         qvalue.setValue[double](value) #px+
 *     elif type(value) is str: #px+
 *         qvalue.setValue[QString](str2q(value)) #px+             # <<<<<<<<<<<<<<
 *     elif type(value) is list or type(value) is tuple: #px+
 *         qvalue.setValue[QVariantList](_list2q(value)) #px+
 */
    __pyx_v_qvalue.setValue<QString>(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_value));

    /* "_qt_qtwes2.pyx":279
 *     elif type(value) is float: #px+
 *         qvalue.setValue[double](value) #px+
 *     elif type(value) is str: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[QString](str2q(value)) #px+
 *     elif type(value) is list or type(value) is tuple: #px+
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":281
 *     elif type(value) is str: #px+
 *         qvalue.setValue[QString](str2q(value)) #px+
 *     elif type(value) is list or type(value) is tuple: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[QVariantList](_list2q(value)) #px+
 *     else: #px+
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject *)(&PyList_Type)));
  __pyx_t_6 = (__pyx_t_2 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject *)(&PyTuple_Type)));
  __pyx_t_2 = (__pyx_t_6 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":282
 *         qvalue.setValue[QString](str2q(value)) #px+
 *     elif type(value) is list or type(value) is tuple: #px+
 *         qvalue.setValue[QVariantList](_list2q(value)) #px+             # <<<<<<<<<<<<<<
 *     else: #px+
 *         print('value has wrong typ ' + repr(type(value))) #px+
 */
    __pyx_v_qvalue.setValue<QList<QVariant> >(__pyx_f_10_qt_qtwes2__list2q(__pyx_v_value));

    /* "_qt_qtwes2.pyx":281
 *     elif type(value) is str: #px+
 *         qvalue.setValue[QString](str2q(value)) #px+
 *     elif type(value) is list or type(value) is tuple: #px+             # <<<<<<<<<<<<<<
 *         qvalue.setValue[QVariantList](_list2q(value)) #px+
 *     else: #px+
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":284
 *         qvalue.setValue[QVariantList](_list2q(value)) #px+
 *     else: #px+
 *         print('value has wrong typ ' + repr(type(value))) #px+             # <<<<<<<<<<<<<<
 *     return qvalue
 * 
 */
  /*else*/ {
    __pyx_t_7 = PyObject_Repr(((PyObject *)Py_TYPE(__pyx_v_value))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyUnicode_ConcatSafe(__pyx_kp_u_value_has_wrong_typ, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":285
 *     else: #px+
 *         print('value has wrong typ ' + repr(type(value))) #px+
 *     return qvalue             # <<<<<<<<<<<<<<
 * 
 * cdef _q2list(const QVariantList &ql): #px+
 */
  __pyx_r = __pyx_v_qvalue;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":270
 * 
 * ##pxm-FUNC P
 * cdef QVariant tovariant(value):             # <<<<<<<<<<<<<<
 *     cdef QVariant qvalue #px/
 *     #qvalue = list(value) if type(value) == tuple else value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("_qt_qtwes2.tovariant", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":287
 *     return qvalue
 * 
 * cdef _q2list(const QVariantList &ql): #px+             # <<<<<<<<<<<<<<
 *     return [fromvariant(ql.at(i)) for i in range(ql.size())] #px+
 * cdef _qs2list(const QStringList &ql): #px+
 */

static PyObject *__pyx_f_10_qt_qtwes2__q2list(QList<QVariant>  const &__pyx_v_ql) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_q2list", 0);

  /* "_qt_qtwes2.pyx":288
 * 
 * cdef _q2list(const QVariantList &ql): #px+
 *     return [fromvariant(ql.at(i)) for i in range(ql.size())] #px+             # <<<<<<<<<<<<<<
 * cdef _qs2list(const QStringList &ql): #px+
 *     return [q2str(ql[i]) for i in range(ql.size())] #px+
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    int __pyx_7genexpr__pyx_v_i;
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_ql.size();
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_7genexpr__pyx_v_i = __pyx_t_3;
      __pyx_t_4 = __pyx_f_10_qt_qtwes2_fromvariant(__pyx_v_ql.at(__pyx_7genexpr__pyx_v_i)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":287
 *     return qvalue
 * 
 * cdef _q2list(const QVariantList &ql): #px+             # <<<<<<<<<<<<<<
 *     return [fromvariant(ql.at(i)) for i in range(ql.size())] #px+
 * cdef _qs2list(const QStringList &ql): #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_qt_qtwes2._q2list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":289
 * cdef _q2list(const QVariantList &ql): #px+
 *     return [fromvariant(ql.at(i)) for i in range(ql.size())] #px+
 * cdef _qs2list(const QStringList &ql): #px+             # <<<<<<<<<<<<<<
 *     return [q2str(ql[i]) for i in range(ql.size())] #px+
 * cdef _q2dict(const QVariantMap &qm): #px+
 */

static PyObject *__pyx_f_10_qt_qtwes2__qs2list(QStringList const &__pyx_v_ql) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_qs2list", 0);

  /* "_qt_qtwes2.pyx":290
 *     return [fromvariant(ql.at(i)) for i in range(ql.size())] #px+
 * cdef _qs2list(const QStringList &ql): #px+
 *     return [q2str(ql[i]) for i in range(ql.size())] #px+             # <<<<<<<<<<<<<<
 * cdef _q2dict(const QVariantMap &qm): #px+
 *     cdef QStringList qkeys = qm.keys() #px+
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    int __pyx_8genexpr1__pyx_v_i;
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_ql.size();
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_8genexpr1__pyx_v_i = __pyx_t_3;
      __pyx_t_4 = __pyx_f_10_qt_qtwes2_q2str((__pyx_v_ql[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":289
 * cdef _q2list(const QVariantList &ql): #px+
 *     return [fromvariant(ql.at(i)) for i in range(ql.size())] #px+
 * cdef _qs2list(const QStringList &ql): #px+             # <<<<<<<<<<<<<<
 *     return [q2str(ql[i]) for i in range(ql.size())] #px+
 * cdef _q2dict(const QVariantMap &qm): #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_qt_qtwes2._qs2list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":291
 * cdef _qs2list(const QStringList &ql): #px+
 *     return [q2str(ql[i]) for i in range(ql.size())] #px+
 * cdef _q2dict(const QVariantMap &qm): #px+             # <<<<<<<<<<<<<<
 *     cdef QStringList qkeys = qm.keys() #px+
 *     cdef QVariantList qvals = qm.values() #px+
 */

static PyObject *__pyx_f_10_qt_qtwes2__q2dict(QMap<QString, QVariant>  const &__pyx_v_qm) {
  QStringList __pyx_v_qkeys;
  QList<QVariant>  __pyx_v_qvals;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  __Pyx_RefNannySetupContext("_q2dict", 0);

  /* "_qt_qtwes2.pyx":292
 *     return [q2str(ql[i]) for i in range(ql.size())] #px+
 * cdef _q2dict(const QVariantMap &qm): #px+
 *     cdef QStringList qkeys = qm.keys() #px+             # <<<<<<<<<<<<<<
 *     cdef QVariantList qvals = qm.values() #px+
 *     return {k:v for k,v in zip(_qs2list(qkeys), _q2list(qvals))} #px+
 */
  __pyx_v_qkeys = __pyx_v_qm.keys();

  /* "_qt_qtwes2.pyx":293
 * cdef _q2dict(const QVariantMap &qm): #px+
 *     cdef QStringList qkeys = qm.keys() #px+
 *     cdef QVariantList qvals = qm.values() #px+             # <<<<<<<<<<<<<<
 *     return {k:v for k,v in zip(_qs2list(qkeys), _q2list(qvals))} #px+
 * 
 */
  __pyx_v_qvals = __pyx_v_qm.values();

  /* "_qt_qtwes2.pyx":294
 *     cdef QStringList qkeys = qm.keys() #px+
 *     cdef QVariantList qvals = qm.values() #px+
 *     return {k:v for k,v in zip(_qs2list(qkeys), _q2list(qvals))} #px+             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    PyObject *__pyx_8genexpr2__pyx_v_k = NULL;
    PyObject *__pyx_8genexpr2__pyx_v_v = NULL;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_10_qt_qtwes2__qs2list(__pyx_v_qkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_f_10_qt_qtwes2__q2list(__pyx_v_qvals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 294, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 294, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 294, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 294, __pyx_L5_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
        index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_2);
        index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 294, __pyx_L5_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 294, __pyx_L5_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_k, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_v, __pyx_t_7);
      __pyx_t_7 = 0;
      if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr2__pyx_v_k, (PyObject*)__pyx_8genexpr2__pyx_v_v))) __PYX_ERR(0, 294, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v);
    goto __pyx_L10_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k);
    __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v);
    goto __pyx_L1_error;
    __pyx_L10_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":291
 * cdef _qs2list(const QStringList &ql): #px+
 *     return [q2str(ql[i]) for i in range(ql.size())] #px+
 * cdef _q2dict(const QVariantMap &qm): #px+             # <<<<<<<<<<<<<<
 *     cdef QStringList qkeys = qm.keys() #px+
 *     cdef QVariantList qvals = qm.values() #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_qt_qtwes2._q2dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":297
 * 
 * ##pxm-FUNC P
 * cdef fromvariant(const QVariant &qvalue):             # <<<<<<<<<<<<<<
 *     cdef const char* typename = qvalue.typeName() #px+
 *     if typename == NULL: #px+
 */

static PyObject *__pyx_f_10_qt_qtwes2_fromvariant(QVariant const &__pyx_v_qvalue) {
  char const *__pyx_v_typename;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("fromvariant", 0);

  /* "_qt_qtwes2.pyx":298
 * ##pxm-FUNC P
 * cdef fromvariant(const QVariant &qvalue):
 *     cdef const char* typename = qvalue.typeName() #px+             # <<<<<<<<<<<<<<
 *     if typename == NULL: #px+
 *         return None #px+
 */
  __pyx_v_typename = __pyx_v_qvalue.typeName();

  /* "_qt_qtwes2.pyx":299
 * cdef fromvariant(const QVariant &qvalue):
 *     cdef const char* typename = qvalue.typeName() #px+
 *     if typename == NULL: #px+             # <<<<<<<<<<<<<<
 *         return None #px+
 *     if typename == b'bool': #px+
 */
  __pyx_t_1 = ((__pyx_v_typename == NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":300
 *     cdef const char* typename = qvalue.typeName() #px+
 *     if typename == NULL: #px+
 *         return None #px+             # <<<<<<<<<<<<<<
 *     if typename == b'bool': #px+
 *         return qvalue.value[cbool]() #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":299
 * cdef fromvariant(const QVariant &qvalue):
 *     cdef const char* typename = qvalue.typeName() #px+
 *     if typename == NULL: #px+             # <<<<<<<<<<<<<<
 *         return None #px+
 *     if typename == b'bool': #px+
 */
  }

  /* "_qt_qtwes2.pyx":301
 *     if typename == NULL: #px+
 *         return None #px+
 *     if typename == b'bool': #px+             # <<<<<<<<<<<<<<
 *         return qvalue.value[cbool]() #px+
 *     elif typename == b'int': #px+
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_typename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_bool, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":302
 *         return None #px+
 *     if typename == b'bool': #px+
 *         return qvalue.value[cbool]() #px+             # <<<<<<<<<<<<<<
 *     elif typename == b'int': #px+
 *         return qvalue.value[int]() #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_qvalue.value<bool>()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":301
 *     if typename == NULL: #px+
 *         return None #px+
 *     if typename == b'bool': #px+             # <<<<<<<<<<<<<<
 *         return qvalue.value[cbool]() #px+
 *     elif typename == b'int': #px+
 */
  }

  /* "_qt_qtwes2.pyx":303
 *     if typename == b'bool': #px+
 *         return qvalue.value[cbool]() #px+
 *     elif typename == b'int': #px+             # <<<<<<<<<<<<<<
 *         return qvalue.value[int]() #px+
 *     elif typename == b'double': #px+
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_typename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_int, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":304
 *         return qvalue.value[cbool]() #px+
 *     elif typename == b'int': #px+
 *         return qvalue.value[int]() #px+             # <<<<<<<<<<<<<<
 *     elif typename == b'double': #px+
 *         return qvalue.value[double]() #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_qvalue.value<int>()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":303
 *     if typename == b'bool': #px+
 *         return qvalue.value[cbool]() #px+
 *     elif typename == b'int': #px+             # <<<<<<<<<<<<<<
 *         return qvalue.value[int]() #px+
 *     elif typename == b'double': #px+
 */
  }

  /* "_qt_qtwes2.pyx":305
 *     elif typename == b'int': #px+
 *         return qvalue.value[int]() #px+
 *     elif typename == b'double': #px+             # <<<<<<<<<<<<<<
 *         return qvalue.value[double]() #px+
 *     elif typename == b'QString': #px+
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_typename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_double, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":306
 *         return qvalue.value[int]() #px+
 *     elif typename == b'double': #px+
 *         return qvalue.value[double]() #px+             # <<<<<<<<<<<<<<
 *     elif typename == b'QString': #px+
 *         return q2str(qvalue.value[QString]()) #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_qvalue.value<double>()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":305
 *     elif typename == b'int': #px+
 *         return qvalue.value[int]() #px+
 *     elif typename == b'double': #px+             # <<<<<<<<<<<<<<
 *         return qvalue.value[double]() #px+
 *     elif typename == b'QString': #px+
 */
  }

  /* "_qt_qtwes2.pyx":307
 *     elif typename == b'double': #px+
 *         return qvalue.value[double]() #px+
 *     elif typename == b'QString': #px+             # <<<<<<<<<<<<<<
 *         return q2str(qvalue.value[QString]()) #px+
 *     elif typename == b'void*': #px+
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_typename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_QString, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":308
 *         return qvalue.value[double]() #px+
 *     elif typename == b'QString': #px+
 *         return q2str(qvalue.value[QString]()) #px+             # <<<<<<<<<<<<<<
 *     elif typename == b'void*': #px+
 *         res = qvalue.value[int]() #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_qvalue.value<QString>()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":307
 *     elif typename == b'double': #px+
 *         return qvalue.value[double]() #px+
 *     elif typename == b'QString': #px+             # <<<<<<<<<<<<<<
 *         return q2str(qvalue.value[QString]()) #px+
 *     elif typename == b'void*': #px+
 */
  }

  /* "_qt_qtwes2.pyx":309
 *     elif typename == b'QString': #px+
 *         return q2str(qvalue.value[QString]()) #px+
 *     elif typename == b'void*': #px+             # <<<<<<<<<<<<<<
 *         res = qvalue.value[int]() #px+
 *         return None if res == 0 else '<void*>({})'.format(res) #px+
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_typename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_kp_b_void, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":310
 *         return q2str(qvalue.value[QString]()) #px+
 *     elif typename == b'void*': #px+
 *         res = qvalue.value[int]() #px+             # <<<<<<<<<<<<<<
 *         return None if res == 0 else '<void*>({})'.format(res) #px+
 *     elif qvalue.canConvert[QVariantMap](): #px+
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_qvalue.value<int>()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_res = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":311
 *     elif typename == b'void*': #px+
 *         res = qvalue.value[int]() #px+
 *         return None if res == 0 else '<void*>({})'.format(res) #px+             # <<<<<<<<<<<<<<
 *     elif qvalue.canConvert[QVariantMap](): #px+
 *         return _q2dict(qvalue.value[QVariantMap]()) #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_res, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {
      __Pyx_INCREF(Py_None);
      __pyx_t_2 = Py_None;
    } else {
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_void_2, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_res); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_res};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_res};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(__pyx_v_res);
          __Pyx_GIVEREF(__pyx_v_res);
          PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_res);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":309
 *     elif typename == b'QString': #px+
 *         return q2str(qvalue.value[QString]()) #px+
 *     elif typename == b'void*': #px+             # <<<<<<<<<<<<<<
 *         res = qvalue.value[int]() #px+
 *         return None if res == 0 else '<void*>({})'.format(res) #px+
 */
  }

  /* "_qt_qtwes2.pyx":312
 *         res = qvalue.value[int]() #px+
 *         return None if res == 0 else '<void*>({})'.format(res) #px+
 *     elif qvalue.canConvert[QVariantMap](): #px+             # <<<<<<<<<<<<<<
 *         return _q2dict(qvalue.value[QVariantMap]()) #px+
 *     elif qvalue.canConvert[QVariantList](): #px+
 */
  __pyx_t_1 = (__pyx_v_qvalue.canConvert<QMap<QString, QVariant> >() != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":313
 *         return None if res == 0 else '<void*>({})'.format(res) #px+
 *     elif qvalue.canConvert[QVariantMap](): #px+
 *         return _q2dict(qvalue.value[QVariantMap]()) #px+             # <<<<<<<<<<<<<<
 *     elif qvalue.canConvert[QVariantList](): #px+
 *         return _q2list(qvalue.value[QVariantList]()) #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_10_qt_qtwes2__q2dict(__pyx_v_qvalue.value<QMap<QString, QVariant> >()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":312
 *         res = qvalue.value[int]() #px+
 *         return None if res == 0 else '<void*>({})'.format(res) #px+
 *     elif qvalue.canConvert[QVariantMap](): #px+             # <<<<<<<<<<<<<<
 *         return _q2dict(qvalue.value[QVariantMap]()) #px+
 *     elif qvalue.canConvert[QVariantList](): #px+
 */
  }

  /* "_qt_qtwes2.pyx":314
 *     elif qvalue.canConvert[QVariantMap](): #px+
 *         return _q2dict(qvalue.value[QVariantMap]()) #px+
 *     elif qvalue.canConvert[QVariantList](): #px+             # <<<<<<<<<<<<<<
 *         return _q2list(qvalue.value[QVariantList]()) #px+
 *     elif qvalue.canConvert[pQObject](): #px+
 */
  __pyx_t_1 = (__pyx_v_qvalue.canConvert<QList<QVariant> >() != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":315
 *         return _q2dict(qvalue.value[QVariantMap]()) #px+
 *     elif qvalue.canConvert[QVariantList](): #px+
 *         return _q2list(qvalue.value[QVariantList]()) #px+             # <<<<<<<<<<<<<<
 *     elif qvalue.canConvert[pQObject](): #px+
 *         return 'QObject({})'.format(q2str(qvalue.value[pQObject]().objectName())) #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_10_qt_qtwes2__q2list(__pyx_v_qvalue.value<QList<QVariant> >()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":314
 *     elif qvalue.canConvert[QVariantMap](): #px+
 *         return _q2dict(qvalue.value[QVariantMap]()) #px+
 *     elif qvalue.canConvert[QVariantList](): #px+             # <<<<<<<<<<<<<<
 *         return _q2list(qvalue.value[QVariantList]()) #px+
 *     elif qvalue.canConvert[pQObject](): #px+
 */
  }

  /* "_qt_qtwes2.pyx":316
 *     elif qvalue.canConvert[QVariantList](): #px+
 *         return _q2list(qvalue.value[QVariantList]()) #px+
 *     elif qvalue.canConvert[pQObject](): #px+             # <<<<<<<<<<<<<<
 *         return 'QObject({})'.format(q2str(qvalue.value[pQObject]().objectName())) #px+
 *     else: #px+
 */
  __pyx_t_1 = (__pyx_v_qvalue.canConvert<__pyx_t_10_qt_qtwes2_pQObject>() != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":317
 *         return _q2list(qvalue.value[QVariantList]()) #px+
 *     elif qvalue.canConvert[pQObject](): #px+
 *         return 'QObject({})'.format(q2str(qvalue.value[pQObject]().objectName())) #px+             # <<<<<<<<<<<<<<
 *     else: #px+
 *         warn(RuntimeWarning('unknown typename %s' % typename[:])) #px+
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_QObject, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_qvalue.value<__pyx_t_10_qt_qtwes2_pQObject>()->objectName()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":316
 *     elif qvalue.canConvert[QVariantList](): #px+
 *         return _q2list(qvalue.value[QVariantList]()) #px+
 *     elif qvalue.canConvert[pQObject](): #px+             # <<<<<<<<<<<<<<
 *         return 'QObject({})'.format(q2str(qvalue.value[pQObject]().objectName())) #px+
 *     else: #px+
 */
  }

  /* "_qt_qtwes2.pyx":319
 *         return 'QObject({})'.format(q2str(qvalue.value[pQObject]().objectName())) #px+
 *     else: #px+
 *         warn(RuntimeWarning('unknown typename %s' % typename[:])) #px+             # <<<<<<<<<<<<<<
 *         return None #px+
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_typename + 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_unknown_typename_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeWarning, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":320
 *     else: #px+
 *         warn(RuntimeWarning('unknown typename %s' % typename[:])) #px+
 *         return None #px+             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }

  /* "_qt_qtwes2.pyx":297
 * 
 * ##pxm-FUNC P
 * cdef fromvariant(const QVariant &qvalue):             # <<<<<<<<<<<<<<
 *     cdef const char* typename = qvalue.typeName() #px+
 *     if typename == NULL: #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_qt_qtwes2.fromvariant", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":339
 *     ##pxh>
 *     ##pxm-FUNC PH nogil
 *     void on_beforeRendering() nogil:             # <<<<<<<<<<<<<<
 *         if not renderdata.initialized:
 *             glarea.gl_init()
 */

void Renderer::on_beforeRendering(void) {
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":340
 *     ##pxm-FUNC PH nogil
 *     void on_beforeRendering() nogil:
 *         if not renderdata.initialized:             # <<<<<<<<<<<<<<
 *             glarea.gl_init()
 *             IF OFFSCREEN: #px+
 */
  __pyx_t_1 = ((!(__pyx_v_10_qt_qtwes2_renderdata.initialized != 0)) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":341
 *     void on_beforeRendering() nogil:
 *         if not renderdata.initialized:
 *             glarea.gl_init()             # <<<<<<<<<<<<<<
 *             IF OFFSCREEN: #px+
 *                 render_offscreen_init() #px+
 */
    __pyx_f_11_glarea_es2_gl_init();

    /* "_qt_qtwes2.pyx":344
 *             IF OFFSCREEN: #px+
 *                 render_offscreen_init() #px+
 *             renderdata.initialized = True             # <<<<<<<<<<<<<<
 *         ##pxm>IF 'qtw' == 'qtw'
 *         IF OFFSCREEN: #px+
 */
    __pyx_v_10_qt_qtwes2_renderdata.initialized = 1;

    /* "_qt_qtwes2.pyx":340
 *     ##pxm-FUNC PH nogil
 *     void on_beforeRendering() nogil:
 *         if not renderdata.initialized:             # <<<<<<<<<<<<<<
 *             glarea.gl_init()
 *             IF OFFSCREEN: #px+
 */
  }

  /* "_qt_qtwes2.pyx":349
 *             renderdata.offscreenbuffer.bind() #px+
 *         ##pxm>IF_END
 *         if renderdata.atlas_changed:             # <<<<<<<<<<<<<<
 *             render_update_atlas()
 *             renderdata.atlas_changed = False
 */
  __pyx_t_1 = (__pyx_v_10_qt_qtwes2_renderdata.atlas_changed != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":350
 *         ##pxm>IF_END
 *         if renderdata.atlas_changed:
 *             render_update_atlas()             # <<<<<<<<<<<<<<
 *             renderdata.atlas_changed = False
 *         else:
 */
    __pyx_f_10_qt_qtwes2_render_update_atlas();

    /* "_qt_qtwes2.pyx":351
 *         if renderdata.atlas_changed:
 *             render_update_atlas()
 *             renderdata.atlas_changed = False             # <<<<<<<<<<<<<<
 *         else:
 *             renderdata.texture.bind()
 */
    __pyx_v_10_qt_qtwes2_renderdata.atlas_changed = 0;

    /* "_qt_qtwes2.pyx":349
 *             renderdata.offscreenbuffer.bind() #px+
 *         ##pxm>IF_END
 *         if renderdata.atlas_changed:             # <<<<<<<<<<<<<<
 *             render_update_atlas()
 *             renderdata.atlas_changed = False
 */
    goto __pyx_L4;
  }

  /* "_qt_qtwes2.pyx":353
 *             renderdata.atlas_changed = False
 *         else:
 *             renderdata.texture.bind()             # <<<<<<<<<<<<<<
 *         glarea.gl_render()
 *         renderdata.texture.release()
 */
  /*else*/ {
    __pyx_v_10_qt_qtwes2_renderdata.texture->bind();
  }
  __pyx_L4:;

  /* "_qt_qtwes2.pyx":354
 *         else:
 *             renderdata.texture.bind()
 *         glarea.gl_render()             # <<<<<<<<<<<<<<
 *         renderdata.texture.release()
 *         if debug & DEBUG_DRAW:
 */
  __pyx_f_11_glarea_es2_gl_render();

  /* "_qt_qtwes2.pyx":355
 *             renderdata.texture.bind()
 *         glarea.gl_render()
 *         renderdata.texture.release()             # <<<<<<<<<<<<<<
 *         if debug & DEBUG_DRAW:
 *             glarea.gl_render_select_debug()
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture->release();

  /* "_qt_qtwes2.pyx":356
 *         glarea.gl_render()
 *         renderdata.texture.release()
 *         if debug & DEBUG_DRAW:             # <<<<<<<<<<<<<<
 *             glarea.gl_render_select_debug()
 *         if debug & DEBUG_FPS:
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_DRAW) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":357
 *         renderdata.texture.release()
 *         if debug & DEBUG_DRAW:
 *             glarea.gl_render_select_debug()             # <<<<<<<<<<<<<<
 *         if debug & DEBUG_FPS:
 *             render_fps()
 */
    __pyx_f_11_glarea_es2_gl_render_select_debug();

    /* "_qt_qtwes2.pyx":356
 *         glarea.gl_render()
 *         renderdata.texture.release()
 *         if debug & DEBUG_DRAW:             # <<<<<<<<<<<<<<
 *             glarea.gl_render_select_debug()
 *         if debug & DEBUG_FPS:
 */
  }

  /* "_qt_qtwes2.pyx":358
 *         if debug & DEBUG_DRAW:
 *             glarea.gl_render_select_debug()
 *         if debug & DEBUG_FPS:             # <<<<<<<<<<<<<<
 *             render_fps()
 *         if renderdata.pickxy_changed:
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_FPS) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":359
 *             glarea.gl_render_select_debug()
 *         if debug & DEBUG_FPS:
 *             render_fps()             # <<<<<<<<<<<<<<
 *         if renderdata.pickxy_changed:
 *             render_pick()
 */
    __pyx_f_10_qt_qtwes2_render_fps();

    /* "_qt_qtwes2.pyx":358
 *         if debug & DEBUG_DRAW:
 *             glarea.gl_render_select_debug()
 *         if debug & DEBUG_FPS:             # <<<<<<<<<<<<<<
 *             render_fps()
 *         if renderdata.pickxy_changed:
 */
  }

  /* "_qt_qtwes2.pyx":360
 *         if debug & DEBUG_FPS:
 *             render_fps()
 *         if renderdata.pickxy_changed:             # <<<<<<<<<<<<<<
 *             render_pick()
 *             renderdata.pickxy_changed = False
 */
  __pyx_t_1 = (__pyx_v_10_qt_qtwes2_renderdata.pickxy_changed != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":361
 *             render_fps()
 *         if renderdata.pickxy_changed:
 *             render_pick()             # <<<<<<<<<<<<<<
 *             renderdata.pickxy_changed = False
 *         IF OFFSCREEN: #px+
 */
    __pyx_f_10_qt_qtwes2_render_pick();

    /* "_qt_qtwes2.pyx":362
 *         if renderdata.pickxy_changed:
 *             render_pick()
 *             renderdata.pickxy_changed = False             # <<<<<<<<<<<<<<
 *         IF OFFSCREEN: #px+
 *             this.offscreen_image(renderdata.offscreenbuffer.toImage()) #px+
 */
    __pyx_v_10_qt_qtwes2_renderdata.pickxy_changed = 0;

    /* "_qt_qtwes2.pyx":360
 *         if debug & DEBUG_FPS:
 *             render_fps()
 *         if renderdata.pickxy_changed:             # <<<<<<<<<<<<<<
 *             render_pick()
 *             renderdata.pickxy_changed = False
 */
  }

  /* "_qt_qtwes2.pyx":339
 *     ##pxh>
 *     ##pxm-FUNC PH nogil
 *     void on_beforeRendering() nogil:             # <<<<<<<<<<<<<<
 *         if not renderdata.initialized:
 *             glarea.gl_init()
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":366
 *             this.offscreen_image(renderdata.offscreenbuffer.toImage()) #px+
 *     ##pxm-FUNC PHD nogil
 *     void on_messageLogged(const QOpenGLDebugMessage &msg) nogil:             # <<<<<<<<<<<<<<
 *         printf('GL%05x: %s\n', msg.id(), msg.message().toUtf8().data()) #px/
 *         #printf('GL%05x: %s\n', msg.id(), msg.message())
 */

void Renderer::on_messageLogged(QOpenGLDebugMessage const &__pyx_v_msg) {

  /* "_qt_qtwes2.pyx":367
 *     ##pxm-FUNC PHD nogil
 *     void on_messageLogged(const QOpenGLDebugMessage &msg) nogil:
 *         printf('GL%05x: %s\n', msg.id(), msg.message().toUtf8().data()) #px/             # <<<<<<<<<<<<<<
 *         #printf('GL%05x: %s\n', msg.id(), msg.message())
 *     ##pxh>
 */
  printf(((char const *)"GL%05x: %s\n"), __pyx_v_msg.id(), __pyx_v_msg.message().toUtf8().data());

  /* "_qt_qtwes2.pyx":366
 *             this.offscreen_image(renderdata.offscreenbuffer.toImage()) #px+
 *     ##pxm-FUNC PHD nogil
 *     void on_messageLogged(const QOpenGLDebugMessage &msg) nogil:             # <<<<<<<<<<<<<<
 *         printf('GL%05x: %s\n', msg.id(), msg.message().toUtf8().data()) #px/
 *         #printf('GL%05x: %s\n', msg.id(), msg.message())
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":384
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_update_atlas() nogil:             # <<<<<<<<<<<<<<
 *     render_destroy_texture()
 *     renderdata.texture = new QOpenGLTexture(Target2D) #px/
 */

static void __pyx_f_10_qt_qtwes2_render_update_atlas(void) {

  /* "_qt_qtwes2.pyx":385
 * ##pxm-FUNC P nogil
 * cdef void render_update_atlas() nogil:
 *     render_destroy_texture()             # <<<<<<<<<<<<<<
 *     renderdata.texture = new QOpenGLTexture(Target2D) #px/
 *     #renderdata.texture = QOpenGLTexture(Target2D)
 */
  __pyx_f_10_qt_qtwes2_render_destroy_texture();

  /* "_qt_qtwes2.pyx":386
 * cdef void render_update_atlas() nogil:
 *     render_destroy_texture()
 *     renderdata.texture = new QOpenGLTexture(Target2D) #px/             # <<<<<<<<<<<<<<
 *     #renderdata.texture = QOpenGLTexture(Target2D)
 *     renderdata.texture.setFormat(RGBA32F)
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture = new QOpenGLTexture(QOpenGLTexture::Target2D);

  /* "_qt_qtwes2.pyx":388
 *     renderdata.texture = new QOpenGLTexture(Target2D) #px/
 *     #renderdata.texture = QOpenGLTexture(Target2D)
 *     renderdata.texture.setFormat(RGBA32F)             # <<<<<<<<<<<<<<
 *     renderdata.texture.setSize(renderdata.atlas_width, renderdata.atlas_height, 1)
 *     renderdata.texture.setMinMagFilters(Linear, Linear)
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture->setFormat(QOpenGLTexture::RGBA32F);

  /* "_qt_qtwes2.pyx":389
 *     #renderdata.texture = QOpenGLTexture(Target2D)
 *     renderdata.texture.setFormat(RGBA32F)
 *     renderdata.texture.setSize(renderdata.atlas_width, renderdata.atlas_height, 1)             # <<<<<<<<<<<<<<
 *     renderdata.texture.setMinMagFilters(Linear, Linear)
 *     renderdata.texture.allocateStorage()
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture->setSize(__pyx_v_10_qt_qtwes2_renderdata.atlas_width, __pyx_v_10_qt_qtwes2_renderdata.atlas_height, 1);

  /* "_qt_qtwes2.pyx":390
 *     renderdata.texture.setFormat(RGBA32F)
 *     renderdata.texture.setSize(renderdata.atlas_width, renderdata.atlas_height, 1)
 *     renderdata.texture.setMinMagFilters(Linear, Linear)             # <<<<<<<<<<<<<<
 *     renderdata.texture.allocateStorage()
 *     renderdata.texture.bind()
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture->setMinMagFilters(QOpenGLTexture::Linear, QOpenGLTexture::Linear);

  /* "_qt_qtwes2.pyx":391
 *     renderdata.texture.setSize(renderdata.atlas_width, renderdata.atlas_height, 1)
 *     renderdata.texture.setMinMagFilters(Linear, Linear)
 *     renderdata.texture.allocateStorage()             # <<<<<<<<<<<<<<
 *     renderdata.texture.bind()
 *     glarea.gl_set_atlas_texture(renderdata.atlas_width, renderdata.atlas_height)
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture->allocateStorage();

  /* "_qt_qtwes2.pyx":392
 *     renderdata.texture.setMinMagFilters(Linear, Linear)
 *     renderdata.texture.allocateStorage()
 *     renderdata.texture.bind()             # <<<<<<<<<<<<<<
 *     glarea.gl_set_atlas_texture(renderdata.atlas_width, renderdata.atlas_height)
 * 
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture->bind();

  /* "_qt_qtwes2.pyx":393
 *     renderdata.texture.allocateStorage()
 *     renderdata.texture.bind()
 *     glarea.gl_set_atlas_texture(renderdata.atlas_width, renderdata.atlas_height)             # <<<<<<<<<<<<<<
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_f_11_glarea_es2_gl_set_atlas_texture(__pyx_v_10_qt_qtwes2_renderdata.atlas_width, __pyx_v_10_qt_qtwes2_renderdata.atlas_height);

  /* "_qt_qtwes2.pyx":384
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_update_atlas() nogil:             # <<<<<<<<<<<<<<
 *     render_destroy_texture()
 *     renderdata.texture = new QOpenGLTexture(Target2D) #px/
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":396
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 * def gl_delete_atlas():             # <<<<<<<<<<<<<<
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_3gl_delete_atlas(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_3gl_delete_atlas = {"gl_delete_atlas", (PyCFunction)__pyx_pw_10_qt_qtwes2_3gl_delete_atlas, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_3gl_delete_atlas(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_delete_atlas (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_2gl_delete_atlas(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_2gl_delete_atlas(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("gl_delete_atlas", 0);

  /* "_qt_qtwes2.pyx":397
 * ##pxm>IF 'qtw' == 'qtw'
 * def gl_delete_atlas():
 *     if renderdata.texture is not NULL:             # <<<<<<<<<<<<<<
 *         renderdata.texture.destroy()
 *         renderdata.texture = NULL
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.texture != NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":398
 * def gl_delete_atlas():
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()             # <<<<<<<<<<<<<<
 *         renderdata.texture = NULL
 * ##pxm>IF_END
 */
    __pyx_v_10_qt_qtwes2_renderdata.texture->destroy();

    /* "_qt_qtwes2.pyx":399
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 *         renderdata.texture = NULL             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * 
 */
    __pyx_v_10_qt_qtwes2_renderdata.texture = NULL;

    /* "_qt_qtwes2.pyx":397
 * ##pxm>IF 'qtw' == 'qtw'
 * def gl_delete_atlas():
 *     if renderdata.texture is not NULL:             # <<<<<<<<<<<<<<
 *         renderdata.texture.destroy()
 *         renderdata.texture = NULL
 */
  }

  /* "_qt_qtwes2.pyx":396
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 * def gl_delete_atlas():             # <<<<<<<<<<<<<<
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":403
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_fps() nogil:             # <<<<<<<<<<<<<<
 *     cdef int fps #px+
 *     renderdata.fps_count += 1
 */

static void __pyx_f_10_qt_qtwes2_render_fps(void) {
  int __pyx_v_fps;
  int __pyx_t_1;
  long __pyx_t_2;
  qint64 __pyx_t_3;

  /* "_qt_qtwes2.pyx":405
 * cdef void render_fps() nogil:
 *     cdef int fps #px+
 *     renderdata.fps_count += 1             # <<<<<<<<<<<<<<
 *     if not renderdata.fps_monotonic_time.hasExpired(1000):
 *         return
 */
  __pyx_v_10_qt_qtwes2_renderdata.fps_count = (__pyx_v_10_qt_qtwes2_renderdata.fps_count + 1);

  /* "_qt_qtwes2.pyx":406
 *     cdef int fps #px+
 *     renderdata.fps_count += 1
 *     if not renderdata.fps_monotonic_time.hasExpired(1000):             # <<<<<<<<<<<<<<
 *         return
 *     fps = 1000 * renderdata.fps_count // renderdata.fps_monotonic_time.restart()
 */
  __pyx_t_1 = ((!(__pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time->hasExpired(0x3E8) != 0)) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":407
 *     renderdata.fps_count += 1
 *     if not renderdata.fps_monotonic_time.hasExpired(1000):
 *         return             # <<<<<<<<<<<<<<
 *     fps = 1000 * renderdata.fps_count // renderdata.fps_monotonic_time.restart()
 *     renderdata.fps_count = 0
 */
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":406
 *     cdef int fps #px+
 *     renderdata.fps_count += 1
 *     if not renderdata.fps_monotonic_time.hasExpired(1000):             # <<<<<<<<<<<<<<
 *         return
 *     fps = 1000 * renderdata.fps_count // renderdata.fps_monotonic_time.restart()
 */
  }

  /* "_qt_qtwes2.pyx":408
 *     if not renderdata.fps_monotonic_time.hasExpired(1000):
 *         return
 *     fps = 1000 * renderdata.fps_count // renderdata.fps_monotonic_time.restart()             # <<<<<<<<<<<<<<
 *     renderdata.fps_count = 0
 *     renderdata.renderer.debug_fps(fps) #px/
 */
  __pyx_t_2 = (0x3E8 * __pyx_v_10_qt_qtwes2_renderdata.fps_count);
  __pyx_t_3 = __pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time->restart();
  if (unlikely(__pyx_t_3 == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 408, __pyx_L1_error)
  }
  else if (sizeof(qint64) == sizeof(long) && (!(((qint64)-1) > 0)) && unlikely(__pyx_t_3 == (qint64)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_2))) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    __PYX_ERR(0, 408, __pyx_L1_error)
  }
  __pyx_v_fps = __Pyx_div_qint64(__pyx_t_2, __pyx_t_3);

  /* "_qt_qtwes2.pyx":409
 *         return
 *     fps = 1000 * renderdata.fps_count // renderdata.fps_monotonic_time.restart()
 *     renderdata.fps_count = 0             # <<<<<<<<<<<<<<
 *     renderdata.renderer.debug_fps(fps) #px/
 *     #renderdata.renderer.debug_fps.emit(fps)
 */
  __pyx_v_10_qt_qtwes2_renderdata.fps_count = 0;

  /* "_qt_qtwes2.pyx":410
 *     fps = 1000 * renderdata.fps_count // renderdata.fps_monotonic_time.restart()
 *     renderdata.fps_count = 0
 *     renderdata.renderer.debug_fps(fps) #px/             # <<<<<<<<<<<<<<
 *     #renderdata.renderer.debug_fps.emit(fps)
 * 
 */
  __pyx_v_10_qt_qtwes2_renderdata.renderer->debug_fps(__pyx_v_fps);

  /* "_qt_qtwes2.pyx":403
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_fps() nogil:             # <<<<<<<<<<<<<<
 *     cdef int fps #px+
 *     renderdata.fps_count += 1
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("_qt_qtwes2.render_fps", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
  __pyx_L0:;
}

/* "_qt_qtwes2.pyx":414
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_pick() nogil:             # <<<<<<<<<<<<<<
 *     if renderdata.pickbuffer is NULL:
 *         renderdata.pickbuffer = new QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D) #px/
 */

static void __pyx_f_10_qt_qtwes2_render_pick(void) {
  int __pyx_v_index;
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":415
 * ##pxm-FUNC P nogil
 * cdef void render_pick() nogil:
 *     if renderdata.pickbuffer is NULL:             # <<<<<<<<<<<<<<
 *         renderdata.pickbuffer = new QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D) #px/
 *         #renderdata.pickbuffer = QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D)
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.pickbuffer == NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":416
 * cdef void render_pick() nogil:
 *     if renderdata.pickbuffer is NULL:
 *         renderdata.pickbuffer = new QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D) #px/             # <<<<<<<<<<<<<<
 *         #renderdata.pickbuffer = QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D)
 *         renderdata.pickbuffer.setAttachment(Depth)
 */
    __pyx_v_10_qt_qtwes2_renderdata.pickbuffer = new QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D);

    /* "_qt_qtwes2.pyx":418
 *         renderdata.pickbuffer = new QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D) #px/
 *         #renderdata.pickbuffer = QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D)
 *         renderdata.pickbuffer.setAttachment(Depth)             # <<<<<<<<<<<<<<
 *     renderdata.pickbuffer.bind()
 *     index = glarea.gl_pick_polygons()
 */
    __pyx_v_10_qt_qtwes2_renderdata.pickbuffer->setAttachment(QOpenGLFramebufferObject::Depth);

    /* "_qt_qtwes2.pyx":415
 * ##pxm-FUNC P nogil
 * cdef void render_pick() nogil:
 *     if renderdata.pickbuffer is NULL:             # <<<<<<<<<<<<<<
 *         renderdata.pickbuffer = new QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D) #px/
 *         #renderdata.pickbuffer = QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D)
 */
  }

  /* "_qt_qtwes2.pyx":419
 *         #renderdata.pickbuffer = QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D)
 *         renderdata.pickbuffer.setAttachment(Depth)
 *     renderdata.pickbuffer.bind()             # <<<<<<<<<<<<<<
 *     index = glarea.gl_pick_polygons()
 *     renderdata.pickbuffer.release()
 */
  __pyx_v_10_qt_qtwes2_renderdata.pickbuffer->bind();

  /* "_qt_qtwes2.pyx":420
 *         renderdata.pickbuffer.setAttachment(Depth)
 *     renderdata.pickbuffer.bind()
 *     index = glarea.gl_pick_polygons()             # <<<<<<<<<<<<<<
 *     renderdata.pickbuffer.release()
 *     renderdata.renderer.picking_result(index) #px/
 */
  __pyx_v_index = __pyx_f_11_glarea_es2_gl_pick_polygons();

  /* "_qt_qtwes2.pyx":421
 *     renderdata.pickbuffer.bind()
 *     index = glarea.gl_pick_polygons()
 *     renderdata.pickbuffer.release()             # <<<<<<<<<<<<<<
 *     renderdata.renderer.picking_result(index) #px/
 *     #renderdata.renderer.picking_result.emit(index)
 */
  __pyx_v_10_qt_qtwes2_renderdata.pickbuffer->release();

  /* "_qt_qtwes2.pyx":422
 *     index = glarea.gl_pick_polygons()
 *     renderdata.pickbuffer.release()
 *     renderdata.renderer.picking_result(index) #px/             # <<<<<<<<<<<<<<
 *     #renderdata.renderer.picking_result.emit(index)
 * 
 */
  __pyx_v_10_qt_qtwes2_renderdata.renderer->picking_result(__pyx_v_index);

  /* "_qt_qtwes2.pyx":414
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_pick() nogil:             # <<<<<<<<<<<<<<
 *     if renderdata.pickbuffer is NULL:
 *         renderdata.pickbuffer = new QOpenGLFramebufferObject(1, 1, GL_TEXTURE_2D) #px/
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":442
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_init() nogil:             # <<<<<<<<<<<<<<
 *     renderdata.texture = NULL
 *     renderdata.pickbuffer = NULL
 */

static void __pyx_f_10_qt_qtwes2_render_init(void) {
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":443
 * ##pxm-FUNC P nogil
 * cdef void render_init() nogil:
 *     renderdata.texture = NULL             # <<<<<<<<<<<<<<
 *     renderdata.pickbuffer = NULL
 *     renderdata.fps_monotonic_time = NULL
 */
  __pyx_v_10_qt_qtwes2_renderdata.texture = NULL;

  /* "_qt_qtwes2.pyx":444
 * cdef void render_init() nogil:
 *     renderdata.texture = NULL
 *     renderdata.pickbuffer = NULL             # <<<<<<<<<<<<<<
 *     renderdata.fps_monotonic_time = NULL
 *     renderdata.fps_count = 0
 */
  __pyx_v_10_qt_qtwes2_renderdata.pickbuffer = NULL;

  /* "_qt_qtwes2.pyx":445
 *     renderdata.texture = NULL
 *     renderdata.pickbuffer = NULL
 *     renderdata.fps_monotonic_time = NULL             # <<<<<<<<<<<<<<
 *     renderdata.fps_count = 0
 *     renderdata.atlas_width = 0
 */
  __pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time = NULL;

  /* "_qt_qtwes2.pyx":446
 *     renderdata.pickbuffer = NULL
 *     renderdata.fps_monotonic_time = NULL
 *     renderdata.fps_count = 0             # <<<<<<<<<<<<<<
 *     renderdata.atlas_width = 0
 *     renderdata.atlas_height = 0
 */
  __pyx_v_10_qt_qtwes2_renderdata.fps_count = 0;

  /* "_qt_qtwes2.pyx":447
 *     renderdata.fps_monotonic_time = NULL
 *     renderdata.fps_count = 0
 *     renderdata.atlas_width = 0             # <<<<<<<<<<<<<<
 *     renderdata.atlas_height = 0
 * 
 */
  __pyx_v_10_qt_qtwes2_renderdata.atlas_width = 0;

  /* "_qt_qtwes2.pyx":448
 *     renderdata.fps_count = 0
 *     renderdata.atlas_width = 0
 *     renderdata.atlas_height = 0             # <<<<<<<<<<<<<<
 * 
 *     renderdata.initialized = False
 */
  __pyx_v_10_qt_qtwes2_renderdata.atlas_height = 0;

  /* "_qt_qtwes2.pyx":450
 *     renderdata.atlas_height = 0
 * 
 *     renderdata.initialized = False             # <<<<<<<<<<<<<<
 *     renderdata.atlas_changed = False
 *     renderdata.pickxy_changed = False
 */
  __pyx_v_10_qt_qtwes2_renderdata.initialized = 0;

  /* "_qt_qtwes2.pyx":451
 * 
 *     renderdata.initialized = False
 *     renderdata.atlas_changed = False             # <<<<<<<<<<<<<<
 *     renderdata.pickxy_changed = False
 *     renderdata.renderer = new Renderer() #px/
 */
  __pyx_v_10_qt_qtwes2_renderdata.atlas_changed = 0;

  /* "_qt_qtwes2.pyx":452
 *     renderdata.initialized = False
 *     renderdata.atlas_changed = False
 *     renderdata.pickxy_changed = False             # <<<<<<<<<<<<<<
 *     renderdata.renderer = new Renderer() #px/
 *     #renderdata.renderer = Renderer()
 */
  __pyx_v_10_qt_qtwes2_renderdata.pickxy_changed = 0;

  /* "_qt_qtwes2.pyx":453
 *     renderdata.atlas_changed = False
 *     renderdata.pickxy_changed = False
 *     renderdata.renderer = new Renderer() #px/             # <<<<<<<<<<<<<<
 *     #renderdata.renderer = Renderer()
 *     renderdata.gldebuglogger = NULL
 */
  __pyx_v_10_qt_qtwes2_renderdata.renderer = new Renderer();

  /* "_qt_qtwes2.pyx":455
 *     renderdata.renderer = new Renderer() #px/
 *     #renderdata.renderer = Renderer()
 *     renderdata.gldebuglogger = NULL             # <<<<<<<<<<<<<<
 * 
 *     glarea.sync_set_fixedshaders()
 */
  __pyx_v_10_qt_qtwes2_renderdata.gldebuglogger = NULL;

  /* "_qt_qtwes2.pyx":457
 *     renderdata.gldebuglogger = NULL
 * 
 *     glarea.sync_set_fixedshaders()             # <<<<<<<<<<<<<<
 *     if debug & DEBUG_GLDEBUG:
 *         render_init_gldebuglogger()
 */
  __pyx_f_11_glarea_es2_sync_set_fixedshaders();

  /* "_qt_qtwes2.pyx":458
 * 
 *     glarea.sync_set_fixedshaders()
 *     if debug & DEBUG_GLDEBUG:             # <<<<<<<<<<<<<<
 *         render_init_gldebuglogger()
 *     if debug & DEBUG_FPS:
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_GLDEBUG) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":459
 *     glarea.sync_set_fixedshaders()
 *     if debug & DEBUG_GLDEBUG:
 *         render_init_gldebuglogger()             # <<<<<<<<<<<<<<
 *     if debug & DEBUG_FPS:
 *         renderdata.fps_monotonic_time = new QElapsedTimer() #px/
 */
    __pyx_f_10_qt_qtwes2_render_init_gldebuglogger();

    /* "_qt_qtwes2.pyx":458
 * 
 *     glarea.sync_set_fixedshaders()
 *     if debug & DEBUG_GLDEBUG:             # <<<<<<<<<<<<<<
 *         render_init_gldebuglogger()
 *     if debug & DEBUG_FPS:
 */
  }

  /* "_qt_qtwes2.pyx":460
 *     if debug & DEBUG_GLDEBUG:
 *         render_init_gldebuglogger()
 *     if debug & DEBUG_FPS:             # <<<<<<<<<<<<<<
 *         renderdata.fps_monotonic_time = new QElapsedTimer() #px/
 *         #renderdata.fps_monotonic_time = QElapsedTimer()
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_FPS) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":461
 *         render_init_gldebuglogger()
 *     if debug & DEBUG_FPS:
 *         renderdata.fps_monotonic_time = new QElapsedTimer() #px/             # <<<<<<<<<<<<<<
 *         #renderdata.fps_monotonic_time = QElapsedTimer()
 *         renderdata.fps_count = 0
 */
    __pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time = new QElapsedTimer();

    /* "_qt_qtwes2.pyx":463
 *         renderdata.fps_monotonic_time = new QElapsedTimer() #px/
 *         #renderdata.fps_monotonic_time = QElapsedTimer()
 *         renderdata.fps_count = 0             # <<<<<<<<<<<<<<
 *         renderdata.fps_monotonic_time.start()
 *     if debug & DEBUG_QML:
 */
    __pyx_v_10_qt_qtwes2_renderdata.fps_count = 0;

    /* "_qt_qtwes2.pyx":464
 *         #renderdata.fps_monotonic_time = QElapsedTimer()
 *         renderdata.fps_count = 0
 *         renderdata.fps_monotonic_time.start()             # <<<<<<<<<<<<<<
 *     if debug & DEBUG_QML:
 *         dump_info('Renderer', <QObject*>renderdata.renderer) #px/
 */
    __pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time->start();

    /* "_qt_qtwes2.pyx":460
 *     if debug & DEBUG_GLDEBUG:
 *         render_init_gldebuglogger()
 *     if debug & DEBUG_FPS:             # <<<<<<<<<<<<<<
 *         renderdata.fps_monotonic_time = new QElapsedTimer() #px/
 *         #renderdata.fps_monotonic_time = QElapsedTimer()
 */
  }

  /* "_qt_qtwes2.pyx":465
 *         renderdata.fps_count = 0
 *         renderdata.fps_monotonic_time.start()
 *     if debug & DEBUG_QML:             # <<<<<<<<<<<<<<
 *         dump_info('Renderer', <QObject*>renderdata.renderer) #px/
 *         #dump_info('Renderer', renderdata.renderer)
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_QML) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":466
 *         renderdata.fps_monotonic_time.start()
 *     if debug & DEBUG_QML:
 *         dump_info('Renderer', <QObject*>renderdata.renderer) #px/             # <<<<<<<<<<<<<<
 *         #dump_info('Renderer', renderdata.renderer)
 *     if debug & DEBUG_MSGGL:
 */
    __pyx_f_10_qt_qtwes2_dump_info(((char const *)"Renderer"), ((QObject *)__pyx_v_10_qt_qtwes2_renderdata.renderer));

    /* "_qt_qtwes2.pyx":465
 *         renderdata.fps_count = 0
 *         renderdata.fps_monotonic_time.start()
 *     if debug & DEBUG_QML:             # <<<<<<<<<<<<<<
 *         dump_info('Renderer', <QObject*>renderdata.renderer) #px/
 *         #dump_info('Renderer', renderdata.renderer)
 */
  }

  /* "_qt_qtwes2.pyx":468
 *         dump_info('Renderer', <QObject*>renderdata.renderer) #px/
 *         #dump_info('Renderer', renderdata.renderer)
 *     if debug & DEBUG_MSGGL:             # <<<<<<<<<<<<<<
 *         print_surface_info()
 * 
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_MSGGL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":469
 *         #dump_info('Renderer', renderdata.renderer)
 *     if debug & DEBUG_MSGGL:
 *         print_surface_info()             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P nogil
 */
    __pyx_f_10_qt_qtwes2_print_surface_info();

    /* "_qt_qtwes2.pyx":468
 *         dump_info('Renderer', <QObject*>renderdata.renderer) #px/
 *         #dump_info('Renderer', renderdata.renderer)
 *     if debug & DEBUG_MSGGL:             # <<<<<<<<<<<<<<
 *         print_surface_info()
 * 
 */
  }

  /* "_qt_qtwes2.pyx":442
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_init() nogil:             # <<<<<<<<<<<<<<
 *     renderdata.texture = NULL
 *     renderdata.pickbuffer = NULL
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":472
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_destroy_texture() nogil:             # <<<<<<<<<<<<<<
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 */

static void __pyx_f_10_qt_qtwes2_render_destroy_texture(void) {
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":473
 * ##pxm-FUNC P nogil
 * cdef void render_destroy_texture() nogil:
 *     if renderdata.texture is not NULL:             # <<<<<<<<<<<<<<
 *         renderdata.texture.destroy()
 *         del renderdata.texture
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.texture != NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":474
 * cdef void render_destroy_texture() nogil:
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()             # <<<<<<<<<<<<<<
 *         del renderdata.texture
 *         renderdata.texture = NULL
 */
    __pyx_v_10_qt_qtwes2_renderdata.texture->destroy();

    /* "_qt_qtwes2.pyx":475
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 *         del renderdata.texture             # <<<<<<<<<<<<<<
 *         renderdata.texture = NULL
 * 
 */
    delete __pyx_v_10_qt_qtwes2_renderdata.texture;

    /* "_qt_qtwes2.pyx":476
 *         renderdata.texture.destroy()
 *         del renderdata.texture
 *         renderdata.texture = NULL             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P nogil
 */
    __pyx_v_10_qt_qtwes2_renderdata.texture = NULL;

    /* "_qt_qtwes2.pyx":473
 * ##pxm-FUNC P nogil
 * cdef void render_destroy_texture() nogil:
 *     if renderdata.texture is not NULL:             # <<<<<<<<<<<<<<
 *         renderdata.texture.destroy()
 *         del renderdata.texture
 */
  }

  /* "_qt_qtwes2.pyx":472
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_destroy_texture() nogil:             # <<<<<<<<<<<<<<
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":479
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_destroy() nogil:             # <<<<<<<<<<<<<<
 *     render_destroy_texture()
 *     if renderdata.pickbuffer is not NULL:
 */

static void __pyx_f_10_qt_qtwes2_render_destroy(void) {
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":480
 * ##pxm-FUNC P nogil
 * cdef void render_destroy() nogil:
 *     render_destroy_texture()             # <<<<<<<<<<<<<<
 *     if renderdata.pickbuffer is not NULL:
 *         del renderdata.pickbuffer
 */
  __pyx_f_10_qt_qtwes2_render_destroy_texture();

  /* "_qt_qtwes2.pyx":481
 * cdef void render_destroy() nogil:
 *     render_destroy_texture()
 *     if renderdata.pickbuffer is not NULL:             # <<<<<<<<<<<<<<
 *         del renderdata.pickbuffer
 *         renderdata.pickbuffer = NULL
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.pickbuffer != NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":482
 *     render_destroy_texture()
 *     if renderdata.pickbuffer is not NULL:
 *         del renderdata.pickbuffer             # <<<<<<<<<<<<<<
 *         renderdata.pickbuffer = NULL
 *     if renderdata.fps_monotonic_time is not NULL:
 */
    delete __pyx_v_10_qt_qtwes2_renderdata.pickbuffer;

    /* "_qt_qtwes2.pyx":483
 *     if renderdata.pickbuffer is not NULL:
 *         del renderdata.pickbuffer
 *         renderdata.pickbuffer = NULL             # <<<<<<<<<<<<<<
 *     if renderdata.fps_monotonic_time is not NULL:
 *         del renderdata.fps_monotonic_time
 */
    __pyx_v_10_qt_qtwes2_renderdata.pickbuffer = NULL;

    /* "_qt_qtwes2.pyx":481
 * cdef void render_destroy() nogil:
 *     render_destroy_texture()
 *     if renderdata.pickbuffer is not NULL:             # <<<<<<<<<<<<<<
 *         del renderdata.pickbuffer
 *         renderdata.pickbuffer = NULL
 */
  }

  /* "_qt_qtwes2.pyx":484
 *         del renderdata.pickbuffer
 *         renderdata.pickbuffer = NULL
 *     if renderdata.fps_monotonic_time is not NULL:             # <<<<<<<<<<<<<<
 *         del renderdata.fps_monotonic_time
 *         renderdata.fps_monotonic_time = NULL
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time != NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":485
 *         renderdata.pickbuffer = NULL
 *     if renderdata.fps_monotonic_time is not NULL:
 *         del renderdata.fps_monotonic_time             # <<<<<<<<<<<<<<
 *         renderdata.fps_monotonic_time = NULL
 *     if renderdata.gldebuglogger is not NULL:
 */
    delete __pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time;

    /* "_qt_qtwes2.pyx":486
 *     if renderdata.fps_monotonic_time is not NULL:
 *         del renderdata.fps_monotonic_time
 *         renderdata.fps_monotonic_time = NULL             # <<<<<<<<<<<<<<
 *     if renderdata.gldebuglogger is not NULL:
 *         del renderdata.gldebuglogger
 */
    __pyx_v_10_qt_qtwes2_renderdata.fps_monotonic_time = NULL;

    /* "_qt_qtwes2.pyx":484
 *         del renderdata.pickbuffer
 *         renderdata.pickbuffer = NULL
 *     if renderdata.fps_monotonic_time is not NULL:             # <<<<<<<<<<<<<<
 *         del renderdata.fps_monotonic_time
 *         renderdata.fps_monotonic_time = NULL
 */
  }

  /* "_qt_qtwes2.pyx":487
 *         del renderdata.fps_monotonic_time
 *         renderdata.fps_monotonic_time = NULL
 *     if renderdata.gldebuglogger is not NULL:             # <<<<<<<<<<<<<<
 *         del renderdata.gldebuglogger
 *         renderdata.gldebuglogger = NULL
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.gldebuglogger != NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":488
 *         renderdata.fps_monotonic_time = NULL
 *     if renderdata.gldebuglogger is not NULL:
 *         del renderdata.gldebuglogger             # <<<<<<<<<<<<<<
 *         renderdata.gldebuglogger = NULL
 * 
 */
    delete __pyx_v_10_qt_qtwes2_renderdata.gldebuglogger;

    /* "_qt_qtwes2.pyx":489
 *     if renderdata.gldebuglogger is not NULL:
 *         del renderdata.gldebuglogger
 *         renderdata.gldebuglogger = NULL             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P nogil
 */
    __pyx_v_10_qt_qtwes2_renderdata.gldebuglogger = NULL;

    /* "_qt_qtwes2.pyx":487
 *         del renderdata.fps_monotonic_time
 *         renderdata.fps_monotonic_time = NULL
 *     if renderdata.gldebuglogger is not NULL:             # <<<<<<<<<<<<<<
 *         del renderdata.gldebuglogger
 *         renderdata.gldebuglogger = NULL
 */
  }

  /* "_qt_qtwes2.pyx":479
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_destroy() nogil:             # <<<<<<<<<<<<<<
 *     render_destroy_texture()
 *     if renderdata.pickbuffer is not NULL:
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":492
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_init_gldebuglogger() nogil:             # <<<<<<<<<<<<<<
 *     cdef OpenGLDebugMessageList messages #px+
 *     cdef QOpenGLDebugMessage message #px+
 */

static void __pyx_f_10_qt_qtwes2_render_init_gldebuglogger(void) {
  QList<QOpenGLDebugMessage> __pyx_v_messages;
  QOpenGLDebugMessage __pyx_v_message;
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "_qt_qtwes2.pyx":496
 *     cdef QOpenGLDebugMessage message #px+
 *     cdef int i #px+
 *     renderdata.gldebuglogger = new QOpenGLDebugLogger(<QObject*>renderdata.renderer) #px/             # <<<<<<<<<<<<<<
 *     #renderdata.gldebuglogger = QOpenGLDebugLogger(renderdata.renderer)
 *     if not renderdata.gldebuglogger.initialize():
 */
  __pyx_v_10_qt_qtwes2_renderdata.gldebuglogger = new QOpenGLDebugLogger(((QObject *)__pyx_v_10_qt_qtwes2_renderdata.renderer));

  /* "_qt_qtwes2.pyx":498
 *     renderdata.gldebuglogger = new QOpenGLDebugLogger(<QObject*>renderdata.renderer) #px/
 *     #renderdata.gldebuglogger = QOpenGLDebugLogger(renderdata.renderer)
 *     if not renderdata.gldebuglogger.initialize():             # <<<<<<<<<<<<<<
 *         puts('QOpenGLDebugLogger not successfully initialized')
 *         return
 */
  __pyx_t_1 = ((!(__pyx_v_10_qt_qtwes2_renderdata.gldebuglogger->initialize() != 0)) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":499
 *     #renderdata.gldebuglogger = QOpenGLDebugLogger(renderdata.renderer)
 *     if not renderdata.gldebuglogger.initialize():
 *         puts('QOpenGLDebugLogger not successfully initialized')             # <<<<<<<<<<<<<<
 *         return
 *     renderdata.gldebuglogger.enableMessages()
 */
    puts(((char const *)"QOpenGLDebugLogger not successfully initialized"));

    /* "_qt_qtwes2.pyx":500
 *     if not renderdata.gldebuglogger.initialize():
 *         puts('QOpenGLDebugLogger not successfully initialized')
 *         return             # <<<<<<<<<<<<<<
 *     renderdata.gldebuglogger.enableMessages()
 *     renderdata.renderer.connect_gldebuglogger(renderdata.gldebuglogger)
 */
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":498
 *     renderdata.gldebuglogger = new QOpenGLDebugLogger(<QObject*>renderdata.renderer) #px/
 *     #renderdata.gldebuglogger = QOpenGLDebugLogger(renderdata.renderer)
 *     if not renderdata.gldebuglogger.initialize():             # <<<<<<<<<<<<<<
 *         puts('QOpenGLDebugLogger not successfully initialized')
 *         return
 */
  }

  /* "_qt_qtwes2.pyx":501
 *         puts('QOpenGLDebugLogger not successfully initialized')
 *         return
 *     renderdata.gldebuglogger.enableMessages()             # <<<<<<<<<<<<<<
 *     renderdata.renderer.connect_gldebuglogger(renderdata.gldebuglogger)
 *     renderdata.gldebuglogger.startLogging(SynchronousLogging)
 */
  __pyx_v_10_qt_qtwes2_renderdata.gldebuglogger->enableMessages();

  /* "_qt_qtwes2.pyx":502
 *         return
 *     renderdata.gldebuglogger.enableMessages()
 *     renderdata.renderer.connect_gldebuglogger(renderdata.gldebuglogger)             # <<<<<<<<<<<<<<
 *     renderdata.gldebuglogger.startLogging(SynchronousLogging)
 *     messages = renderdata.gldebuglogger.loggedMessages()
 */
  __pyx_v_10_qt_qtwes2_renderdata.renderer->connect_gldebuglogger(__pyx_v_10_qt_qtwes2_renderdata.gldebuglogger);

  /* "_qt_qtwes2.pyx":503
 *     renderdata.gldebuglogger.enableMessages()
 *     renderdata.renderer.connect_gldebuglogger(renderdata.gldebuglogger)
 *     renderdata.gldebuglogger.startLogging(SynchronousLogging)             # <<<<<<<<<<<<<<
 *     messages = renderdata.gldebuglogger.loggedMessages()
 *     printf('QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n', messages.size()) #px/
 */
  __pyx_v_10_qt_qtwes2_renderdata.gldebuglogger->startLogging(QOpenGLDebugLogger::SynchronousLogging);

  /* "_qt_qtwes2.pyx":504
 *     renderdata.renderer.connect_gldebuglogger(renderdata.gldebuglogger)
 *     renderdata.gldebuglogger.startLogging(SynchronousLogging)
 *     messages = renderdata.gldebuglogger.loggedMessages()             # <<<<<<<<<<<<<<
 *     printf('QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n', messages.size()) #px/
 *     #printf('QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n', len(messages))
 */
  __pyx_v_messages = __pyx_v_10_qt_qtwes2_renderdata.gldebuglogger->loggedMessages();

  /* "_qt_qtwes2.pyx":505
 *     renderdata.gldebuglogger.startLogging(SynchronousLogging)
 *     messages = renderdata.gldebuglogger.loggedMessages()
 *     printf('QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n', messages.size()) #px/             # <<<<<<<<<<<<<<
 *     #printf('QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n', len(messages))
 *     for i in range(messages.size()): #px/
 */
  printf(((char const *)"QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n"), __pyx_v_messages.size());

  /* "_qt_qtwes2.pyx":507
 *     printf('QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n', messages.size()) #px/
 *     #printf('QOpenGLDebugLogger successfully initialized and started (%d initial messages)\n', len(messages))
 *     for i in range(messages.size()): #px/             # <<<<<<<<<<<<<<
 *     #for message in messages:
 *         message = messages.at(i) #px+
 */
  __pyx_t_2 = __pyx_v_messages.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "_qt_qtwes2.pyx":509
 *     for i in range(messages.size()): #px/
 *     #for message in messages:
 *         message = messages.at(i) #px+             # <<<<<<<<<<<<<<
 *         renderdata.renderer.on_messageLogged(message)
 * 
 */
    __pyx_v_message = __pyx_v_messages.at(__pyx_v_i);

    /* "_qt_qtwes2.pyx":510
 *     #for message in messages:
 *         message = messages.at(i) #px+
 *         renderdata.renderer.on_messageLogged(message)             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P nogil
 */
    __pyx_v_10_qt_qtwes2_renderdata.renderer->on_messageLogged(__pyx_v_message);
  }

  /* "_qt_qtwes2.pyx":492
 * 
 * ##pxm-FUNC P nogil
 * cdef void render_init_gldebuglogger() nogil:             # <<<<<<<<<<<<<<
 *     cdef OpenGLDebugMessageList messages #px+
 *     cdef QOpenGLDebugMessage message #px+
 */

  /* function exit code */
  __pyx_L0:;
}

/* "_qt_qtwes2.pyx":513
 * 
 * ##pxm-FUNC P nogil
 * cdef void _pfmt(char *name, int f, int rf, int df) nogil:             # <<<<<<<<<<<<<<
 *     printf('  %s: %d', name, f)
 *     if f != rf:  printf(' (%d)', rf)
 */

static void __pyx_f_10_qt_qtwes2__pfmt(char *__pyx_v_name, int __pyx_v_f, int __pyx_v_rf, int __pyx_v_df) {
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":514
 * ##pxm-FUNC P nogil
 * cdef void _pfmt(char *name, int f, int rf, int df) nogil:
 *     printf('  %s: %d', name, f)             # <<<<<<<<<<<<<<
 *     if f != rf:  printf(' (%d)', rf)
 *     if rf != df: printf(' [%d]', df)
 */
  printf(((char const *)"  %s: %d"), __pyx_v_name, __pyx_v_f);

  /* "_qt_qtwes2.pyx":515
 * cdef void _pfmt(char *name, int f, int rf, int df) nogil:
 *     printf('  %s: %d', name, f)
 *     if f != rf:  printf(' (%d)', rf)             # <<<<<<<<<<<<<<
 *     if rf != df: printf(' [%d]', df)
 *     puts('')
 */
  __pyx_t_1 = ((__pyx_v_f != __pyx_v_rf) != 0);
  if (__pyx_t_1) {
    printf(((char const *)" (%d)"), __pyx_v_rf);
  }

  /* "_qt_qtwes2.pyx":516
 *     printf('  %s: %d', name, f)
 *     if f != rf:  printf(' (%d)', rf)
 *     if rf != df: printf(' [%d]', df)             # <<<<<<<<<<<<<<
 *     puts('')
 * ##pxm-FUNC P nogil
 */
  __pyx_t_1 = ((__pyx_v_rf != __pyx_v_df) != 0);
  if (__pyx_t_1) {
    printf(((char const *)" [%d]"), __pyx_v_df);
  }

  /* "_qt_qtwes2.pyx":517
 *     if f != rf:  printf(' (%d)', rf)
 *     if rf != df: printf(' [%d]', df)
 *     puts('')             # <<<<<<<<<<<<<<
 * ##pxm-FUNC P nogil
 * cdef void _pfmt2(char *name, int f1, int f2, int rf1, int rf2, int df1, int df2) nogil:
 */
  puts(((char const *)""));

  /* "_qt_qtwes2.pyx":513
 * 
 * ##pxm-FUNC P nogil
 * cdef void _pfmt(char *name, int f, int rf, int df) nogil:             # <<<<<<<<<<<<<<
 *     printf('  %s: %d', name, f)
 *     if f != rf:  printf(' (%d)', rf)
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":519
 *     puts('')
 * ##pxm-FUNC P nogil
 * cdef void _pfmt2(char *name, int f1, int f2, int rf1, int rf2, int df1, int df2) nogil:             # <<<<<<<<<<<<<<
 *     printf('  %s: %d.%d', name, f1, f2)
 *     if f1 != rf1 or f2 != rf2:  printf(' (%d.%d)', rf1, rf2)
 */

static void __pyx_f_10_qt_qtwes2__pfmt2(char *__pyx_v_name, int __pyx_v_f1, int __pyx_v_f2, int __pyx_v_rf1, int __pyx_v_rf2, int __pyx_v_df1, int __pyx_v_df2) {
  int __pyx_t_1;
  int __pyx_t_2;

  /* "_qt_qtwes2.pyx":520
 * ##pxm-FUNC P nogil
 * cdef void _pfmt2(char *name, int f1, int f2, int rf1, int rf2, int df1, int df2) nogil:
 *     printf('  %s: %d.%d', name, f1, f2)             # <<<<<<<<<<<<<<
 *     if f1 != rf1 or f2 != rf2:  printf(' (%d.%d)', rf1, rf2)
 *     if rf1 != df1 or rf2 != df2: printf(' [%d.%d]', df1, df2)
 */
  printf(((char const *)"  %s: %d.%d"), __pyx_v_name, __pyx_v_f1, __pyx_v_f2);

  /* "_qt_qtwes2.pyx":521
 * cdef void _pfmt2(char *name, int f1, int f2, int rf1, int rf2, int df1, int df2) nogil:
 *     printf('  %s: %d.%d', name, f1, f2)
 *     if f1 != rf1 or f2 != rf2:  printf(' (%d.%d)', rf1, rf2)             # <<<<<<<<<<<<<<
 *     if rf1 != df1 or rf2 != df2: printf(' [%d.%d]', df1, df2)
 *     puts('')
 */
  __pyx_t_2 = ((__pyx_v_f1 != __pyx_v_rf1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_f2 != __pyx_v_rf2) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {
    printf(((char const *)" (%d.%d)"), __pyx_v_rf1, __pyx_v_rf2);
  }

  /* "_qt_qtwes2.pyx":522
 *     printf('  %s: %d.%d', name, f1, f2)
 *     if f1 != rf1 or f2 != rf2:  printf(' (%d.%d)', rf1, rf2)
 *     if rf1 != df1 or rf2 != df2: printf(' [%d.%d]', df1, df2)             # <<<<<<<<<<<<<<
 *     puts('')
 * 
 */
  __pyx_t_2 = ((__pyx_v_rf1 != __pyx_v_df1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_rf2 != __pyx_v_df2) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_1) {
    printf(((char const *)" [%d.%d]"), __pyx_v_df1, __pyx_v_df2);
  }

  /* "_qt_qtwes2.pyx":523
 *     if f1 != rf1 or f2 != rf2:  printf(' (%d.%d)', rf1, rf2)
 *     if rf1 != df1 or rf2 != df2: printf(' [%d.%d]', df1, df2)
 *     puts('')             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P nogil
 */
  puts(((char const *)""));

  /* "_qt_qtwes2.pyx":519
 *     puts('')
 * ##pxm-FUNC P nogil
 * cdef void _pfmt2(char *name, int f1, int f2, int rf1, int rf2, int df1, int df2) nogil:             # <<<<<<<<<<<<<<
 *     printf('  %s: %d.%d', name, f1, f2)
 *     if f1 != rf1 or f2 != rf2:  printf(' (%d.%d)', rf1, rf2)
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":526
 * 
 * ##pxm-FUNC P nogil
 * cdef void print_surface_info() nogil:             # <<<<<<<<<<<<<<
 *     cdef QOpenGLContext *glcontext #px+
 *     glcontext = currentContext()
 */

static void __pyx_f_10_qt_qtwes2_print_surface_info(void) {
  QOpenGLContext *__pyx_v_glcontext;
  QSurfaceFormat __pyx_v_glformat;
  QSurfaceFormat __pyx_v_glrformat;
  QSurfaceFormat __pyx_v_gldformat;
  int __pyx_v_i;
  QOpenGLFunctions *__pyx_v_glFuncs;
  int __pyx_v_features;
  QSurfaceFormat __pyx_t_1;
  int __pyx_t_2;

  /* "_qt_qtwes2.pyx":528
 * cdef void print_surface_info() nogil:
 *     cdef QOpenGLContext *glcontext #px+
 *     glcontext = currentContext()             # <<<<<<<<<<<<<<
 *     glformat = glcontext.format()
 *     glrformat = defaultFormat() # requested format
 */
  __pyx_v_glcontext = QOpenGLContext::currentContext();

  /* "_qt_qtwes2.pyx":529
 *     cdef QOpenGLContext *glcontext #px+
 *     glcontext = currentContext()
 *     glformat = glcontext.format()             # <<<<<<<<<<<<<<
 *     glrformat = defaultFormat() # requested format
 *     gldformat = uidata.default_format
 */
  __pyx_v_glformat = __pyx_v_glcontext->format();

  /* "_qt_qtwes2.pyx":530
 *     glcontext = currentContext()
 *     glformat = glcontext.format()
 *     glrformat = defaultFormat() # requested format             # <<<<<<<<<<<<<<
 *     gldformat = uidata.default_format
 *     puts('Surface format (requested (), default []):')
 */
  __pyx_v_glrformat = QSurfaceFormat::defaultFormat();

  /* "_qt_qtwes2.pyx":531
 *     glformat = glcontext.format()
 *     glrformat = defaultFormat() # requested format
 *     gldformat = uidata.default_format             # <<<<<<<<<<<<<<
 *     puts('Surface format (requested (), default []):')
 *     _pfmt('red', glformat.redBufferSize(), glrformat.redBufferSize(), gldformat.redBufferSize())
 */
  __pyx_t_1 = __pyx_v_10_qt_qtwes2_uidata.default_format;
  __pyx_v_gldformat = __pyx_t_1;

  /* "_qt_qtwes2.pyx":532
 *     glrformat = defaultFormat() # requested format
 *     gldformat = uidata.default_format
 *     puts('Surface format (requested (), default []):')             # <<<<<<<<<<<<<<
 *     _pfmt('red', glformat.redBufferSize(), glrformat.redBufferSize(), gldformat.redBufferSize())
 *     _pfmt('green', glformat.greenBufferSize(), glrformat.greenBufferSize(),  gldformat.greenBufferSize())
 */
  puts(((char const *)"Surface format (requested (), default []):"));

  /* "_qt_qtwes2.pyx":533
 *     gldformat = uidata.default_format
 *     puts('Surface format (requested (), default []):')
 *     _pfmt('red', glformat.redBufferSize(), glrformat.redBufferSize(), gldformat.redBufferSize())             # <<<<<<<<<<<<<<
 *     _pfmt('green', glformat.greenBufferSize(), glrformat.greenBufferSize(),  gldformat.greenBufferSize())
 *     _pfmt('blue', glformat.blueBufferSize(), glrformat.blueBufferSize(), gldformat.blueBufferSize())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"red"), __pyx_v_glformat.redBufferSize(), __pyx_v_glrformat.redBufferSize(), __pyx_v_gldformat.redBufferSize());

  /* "_qt_qtwes2.pyx":534
 *     puts('Surface format (requested (), default []):')
 *     _pfmt('red', glformat.redBufferSize(), glrformat.redBufferSize(), gldformat.redBufferSize())
 *     _pfmt('green', glformat.greenBufferSize(), glrformat.greenBufferSize(),  gldformat.greenBufferSize())             # <<<<<<<<<<<<<<
 *     _pfmt('blue', glformat.blueBufferSize(), glrformat.blueBufferSize(), gldformat.blueBufferSize())
 *     _pfmt('alpha', glformat.alphaBufferSize(), glrformat.alphaBufferSize(), gldformat.alphaBufferSize())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"green"), __pyx_v_glformat.greenBufferSize(), __pyx_v_glrformat.greenBufferSize(), __pyx_v_gldformat.greenBufferSize());

  /* "_qt_qtwes2.pyx":535
 *     _pfmt('red', glformat.redBufferSize(), glrformat.redBufferSize(), gldformat.redBufferSize())
 *     _pfmt('green', glformat.greenBufferSize(), glrformat.greenBufferSize(),  gldformat.greenBufferSize())
 *     _pfmt('blue', glformat.blueBufferSize(), glrformat.blueBufferSize(), gldformat.blueBufferSize())             # <<<<<<<<<<<<<<
 *     _pfmt('alpha', glformat.alphaBufferSize(), glrformat.alphaBufferSize(), gldformat.alphaBufferSize())
 *     _pfmt('depth', glformat.depthBufferSize(), glrformat.depthBufferSize(), gldformat.depthBufferSize())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"blue"), __pyx_v_glformat.blueBufferSize(), __pyx_v_glrformat.blueBufferSize(), __pyx_v_gldformat.blueBufferSize());

  /* "_qt_qtwes2.pyx":536
 *     _pfmt('green', glformat.greenBufferSize(), glrformat.greenBufferSize(),  gldformat.greenBufferSize())
 *     _pfmt('blue', glformat.blueBufferSize(), glrformat.blueBufferSize(), gldformat.blueBufferSize())
 *     _pfmt('alpha', glformat.alphaBufferSize(), glrformat.alphaBufferSize(), gldformat.alphaBufferSize())             # <<<<<<<<<<<<<<
 *     _pfmt('depth', glformat.depthBufferSize(), glrformat.depthBufferSize(), gldformat.depthBufferSize())
 *     _pfmt('options', glformat.options(), glrformat.options(), gldformat.options())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"alpha"), __pyx_v_glformat.alphaBufferSize(), __pyx_v_glrformat.alphaBufferSize(), __pyx_v_gldformat.alphaBufferSize());

  /* "_qt_qtwes2.pyx":537
 *     _pfmt('blue', glformat.blueBufferSize(), glrformat.blueBufferSize(), gldformat.blueBufferSize())
 *     _pfmt('alpha', glformat.alphaBufferSize(), glrformat.alphaBufferSize(), gldformat.alphaBufferSize())
 *     _pfmt('depth', glformat.depthBufferSize(), glrformat.depthBufferSize(), gldformat.depthBufferSize())             # <<<<<<<<<<<<<<
 *     _pfmt('options', glformat.options(), glrformat.options(), gldformat.options())
 *     _pfmt('profile', glformat.profile(), glrformat.profile(), gldformat.profile())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"depth"), __pyx_v_glformat.depthBufferSize(), __pyx_v_glrformat.depthBufferSize(), __pyx_v_gldformat.depthBufferSize());

  /* "_qt_qtwes2.pyx":538
 *     _pfmt('alpha', glformat.alphaBufferSize(), glrformat.alphaBufferSize(), gldformat.alphaBufferSize())
 *     _pfmt('depth', glformat.depthBufferSize(), glrformat.depthBufferSize(), gldformat.depthBufferSize())
 *     _pfmt('options', glformat.options(), glrformat.options(), gldformat.options())             # <<<<<<<<<<<<<<
 *     _pfmt('profile', glformat.profile(), glrformat.profile(), gldformat.profile())
 *     _pfmt('renderableType', glformat.renderableType(), glrformat.renderableType(), gldformat.renderableType())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"options"), __pyx_v_glformat.options(), __pyx_v_glrformat.options(), __pyx_v_gldformat.options());

  /* "_qt_qtwes2.pyx":539
 *     _pfmt('depth', glformat.depthBufferSize(), glrformat.depthBufferSize(), gldformat.depthBufferSize())
 *     _pfmt('options', glformat.options(), glrformat.options(), gldformat.options())
 *     _pfmt('profile', glformat.profile(), glrformat.profile(), gldformat.profile())             # <<<<<<<<<<<<<<
 *     _pfmt('renderableType', glformat.renderableType(), glrformat.renderableType(), gldformat.renderableType())
 *     _pfmt('samples', glformat.samples(), glrformat.samples(), gldformat.samples())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"profile"), __pyx_v_glformat.profile(), __pyx_v_glrformat.profile(), __pyx_v_gldformat.profile());

  /* "_qt_qtwes2.pyx":540
 *     _pfmt('options', glformat.options(), glrformat.options(), gldformat.options())
 *     _pfmt('profile', glformat.profile(), glrformat.profile(), gldformat.profile())
 *     _pfmt('renderableType', glformat.renderableType(), glrformat.renderableType(), gldformat.renderableType())             # <<<<<<<<<<<<<<
 *     _pfmt('samples', glformat.samples(), glrformat.samples(), gldformat.samples())
 *     _pfmt('stencil', glformat.stencilBufferSize(), glrformat.stencilBufferSize(), gldformat.stencilBufferSize())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"renderableType"), __pyx_v_glformat.renderableType(), __pyx_v_glrformat.renderableType(), __pyx_v_gldformat.renderableType());

  /* "_qt_qtwes2.pyx":541
 *     _pfmt('profile', glformat.profile(), glrformat.profile(), gldformat.profile())
 *     _pfmt('renderableType', glformat.renderableType(), glrformat.renderableType(), gldformat.renderableType())
 *     _pfmt('samples', glformat.samples(), glrformat.samples(), gldformat.samples())             # <<<<<<<<<<<<<<
 *     _pfmt('stencil', glformat.stencilBufferSize(), glrformat.stencilBufferSize(), gldformat.stencilBufferSize())
 *     _pfmt('stereo', glformat.stereo(), glrformat.stereo(), gldformat.stereo())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"samples"), __pyx_v_glformat.samples(), __pyx_v_glrformat.samples(), __pyx_v_gldformat.samples());

  /* "_qt_qtwes2.pyx":542
 *     _pfmt('renderableType', glformat.renderableType(), glrformat.renderableType(), gldformat.renderableType())
 *     _pfmt('samples', glformat.samples(), glrformat.samples(), gldformat.samples())
 *     _pfmt('stencil', glformat.stencilBufferSize(), glrformat.stencilBufferSize(), gldformat.stencilBufferSize())             # <<<<<<<<<<<<<<
 *     _pfmt('stereo', glformat.stereo(), glrformat.stereo(), gldformat.stereo())
 *     _pfmt('swapBehavior', glformat.swapBehavior(), glrformat.swapBehavior(), gldformat.swapBehavior())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"stencil"), __pyx_v_glformat.stencilBufferSize(), __pyx_v_glrformat.stencilBufferSize(), __pyx_v_gldformat.stencilBufferSize());

  /* "_qt_qtwes2.pyx":543
 *     _pfmt('samples', glformat.samples(), glrformat.samples(), gldformat.samples())
 *     _pfmt('stencil', glformat.stencilBufferSize(), glrformat.stencilBufferSize(), gldformat.stencilBufferSize())
 *     _pfmt('stereo', glformat.stereo(), glrformat.stereo(), gldformat.stereo())             # <<<<<<<<<<<<<<
 *     _pfmt('swapBehavior', glformat.swapBehavior(), glrformat.swapBehavior(), gldformat.swapBehavior())
 *     _pfmt('swapInterval', glformat.swapInterval(), glrformat.swapInterval(), gldformat.swapInterval())
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"stereo"), __pyx_v_glformat.stereo(), __pyx_v_glrformat.stereo(), __pyx_v_gldformat.stereo());

  /* "_qt_qtwes2.pyx":544
 *     _pfmt('stencil', glformat.stencilBufferSize(), glrformat.stencilBufferSize(), gldformat.stencilBufferSize())
 *     _pfmt('stereo', glformat.stereo(), glrformat.stereo(), gldformat.stereo())
 *     _pfmt('swapBehavior', glformat.swapBehavior(), glrformat.swapBehavior(), gldformat.swapBehavior())             # <<<<<<<<<<<<<<
 *     _pfmt('swapInterval', glformat.swapInterval(), glrformat.swapInterval(), gldformat.swapInterval())
 *     _pfmt2('version', glformat.majorVersion(), glformat.minorVersion(),
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"swapBehavior"), __pyx_v_glformat.swapBehavior(), __pyx_v_glrformat.swapBehavior(), __pyx_v_gldformat.swapBehavior());

  /* "_qt_qtwes2.pyx":545
 *     _pfmt('stereo', glformat.stereo(), glrformat.stereo(), gldformat.stereo())
 *     _pfmt('swapBehavior', glformat.swapBehavior(), glrformat.swapBehavior(), gldformat.swapBehavior())
 *     _pfmt('swapInterval', glformat.swapInterval(), glrformat.swapInterval(), gldformat.swapInterval())             # <<<<<<<<<<<<<<
 *     _pfmt2('version', glformat.majorVersion(), glformat.minorVersion(),
 *                      glrformat.majorVersion(), glrformat.minorVersion(),
 */
  __pyx_f_10_qt_qtwes2__pfmt(((char *)"swapInterval"), __pyx_v_glformat.swapInterval(), __pyx_v_glrformat.swapInterval(), __pyx_v_gldformat.swapInterval());

  /* "_qt_qtwes2.pyx":546
 *     _pfmt('swapBehavior', glformat.swapBehavior(), glrformat.swapBehavior(), gldformat.swapBehavior())
 *     _pfmt('swapInterval', glformat.swapInterval(), glrformat.swapInterval(), gldformat.swapInterval())
 *     _pfmt2('version', glformat.majorVersion(), glformat.minorVersion(),             # <<<<<<<<<<<<<<
 *                      glrformat.majorVersion(), glrformat.minorVersion(),
 *                      gldformat.majorVersion(), gldformat.minorVersion())
 */
  __pyx_f_10_qt_qtwes2__pfmt2(((char *)"version"), __pyx_v_glformat.majorVersion(), __pyx_v_glformat.minorVersion(), __pyx_v_glrformat.majorVersion(), __pyx_v_glrformat.minorVersion(), __pyx_v_gldformat.majorVersion(), __pyx_v_gldformat.minorVersion());

  /* "_qt_qtwes2.pyx":549
 *                      glrformat.majorVersion(), glrformat.minorVersion(),
 *                      gldformat.majorVersion(), gldformat.minorVersion())
 *     puts('OpenGL context:')             # <<<<<<<<<<<<<<
 *     cdef int i #px+
 *     i = openGLModuleType()
 */
  puts(((char const *)"OpenGL context:"));

  /* "_qt_qtwes2.pyx":551
 *     puts('OpenGL context:')
 *     cdef int i #px+
 *     i = openGLModuleType()             # <<<<<<<<<<<<<<
 *     if i == LibGL:
 *         puts('  module type: libGL')
 */
  __pyx_v_i = QOpenGLContext::openGLModuleType();

  /* "_qt_qtwes2.pyx":552
 *     cdef int i #px+
 *     i = openGLModuleType()
 *     if i == LibGL:             # <<<<<<<<<<<<<<
 *         puts('  module type: libGL')
 *     elif i == LibGLES:
 */
  switch (__pyx_v_i) {
    case QOpenGLContext::LibGL:

    /* "_qt_qtwes2.pyx":553
 *     i = openGLModuleType()
 *     if i == LibGL:
 *         puts('  module type: libGL')             # <<<<<<<<<<<<<<
 *     elif i == LibGLES:
 *         puts('  module type: LibGLES')
 */
    puts(((char const *)"  module type: libGL"));

    /* "_qt_qtwes2.pyx":552
 *     cdef int i #px+
 *     i = openGLModuleType()
 *     if i == LibGL:             # <<<<<<<<<<<<<<
 *         puts('  module type: libGL')
 *     elif i == LibGLES:
 */
    break;

    /* "_qt_qtwes2.pyx":554
 *     if i == LibGL:
 *         puts('  module type: libGL')
 *     elif i == LibGLES:             # <<<<<<<<<<<<<<
 *         puts('  module type: LibGLES')
 *     else:
 */
    case QOpenGLContext::LibGLES:

    /* "_qt_qtwes2.pyx":555
 *         puts('  module type: libGL')
 *     elif i == LibGLES:
 *         puts('  module type: LibGLES')             # <<<<<<<<<<<<<<
 *     else:
 *         printf('  unknown module type: %d\n', i)
 */
    puts(((char const *)"  module type: LibGLES"));

    /* "_qt_qtwes2.pyx":554
 *     if i == LibGL:
 *         puts('  module type: libGL')
 *     elif i == LibGLES:             # <<<<<<<<<<<<<<
 *         puts('  module type: LibGLES')
 *     else:
 */
    break;
    default:

    /* "_qt_qtwes2.pyx":557
 *         puts('  module type: LibGLES')
 *     else:
 *         printf('  unknown module type: %d\n', i)             # <<<<<<<<<<<<<<
 *     i = glcontext.isOpenGLES()
 *     if glcontext.isOpenGLES():
 */
    printf(((char const *)"  unknown module type: %d\n"), __pyx_v_i);
    break;
  }

  /* "_qt_qtwes2.pyx":558
 *     else:
 *         printf('  unknown module type: %d\n', i)
 *     i = glcontext.isOpenGLES()             # <<<<<<<<<<<<<<
 *     if glcontext.isOpenGLES():
 *         puts('  isOpenGLES: True')
 */
  __pyx_v_i = __pyx_v_glcontext->isOpenGLES();

  /* "_qt_qtwes2.pyx":559
 *         printf('  unknown module type: %d\n', i)
 *     i = glcontext.isOpenGLES()
 *     if glcontext.isOpenGLES():             # <<<<<<<<<<<<<<
 *         puts('  isOpenGLES: True')
 *     else:
 */
  __pyx_t_2 = (__pyx_v_glcontext->isOpenGLES() != 0);
  if (__pyx_t_2) {

    /* "_qt_qtwes2.pyx":560
 *     i = glcontext.isOpenGLES()
 *     if glcontext.isOpenGLES():
 *         puts('  isOpenGLES: True')             # <<<<<<<<<<<<<<
 *     else:
 *         puts('  isOpenGLES: False')
 */
    puts(((char const *)"  isOpenGLES: True"));

    /* "_qt_qtwes2.pyx":559
 *         printf('  unknown module type: %d\n', i)
 *     i = glcontext.isOpenGLES()
 *     if glcontext.isOpenGLES():             # <<<<<<<<<<<<<<
 *         puts('  isOpenGLES: True')
 *     else:
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":562
 *         puts('  isOpenGLES: True')
 *     else:
 *         puts('  isOpenGLES: False')             # <<<<<<<<<<<<<<
 *     if glcontext.hasExtension(QByteArray(b"GL_KHR_debug")):
 *         puts('  hasExtension GL_KHR_debug: True')
 */
  /*else*/ {
    puts(((char const *)"  isOpenGLES: False"));
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":563
 *     else:
 *         puts('  isOpenGLES: False')
 *     if glcontext.hasExtension(QByteArray(b"GL_KHR_debug")):             # <<<<<<<<<<<<<<
 *         puts('  hasExtension GL_KHR_debug: True')
 *     else:
 */
  __pyx_t_2 = (__pyx_v_glcontext->hasExtension(QByteArray(((char const *)"GL_KHR_debug"))) != 0);
  if (__pyx_t_2) {

    /* "_qt_qtwes2.pyx":564
 *         puts('  isOpenGLES: False')
 *     if glcontext.hasExtension(QByteArray(b"GL_KHR_debug")):
 *         puts('  hasExtension GL_KHR_debug: True')             # <<<<<<<<<<<<<<
 *     else:
 *         puts('  hasExtension GL_KHR_debug: False')
 */
    puts(((char const *)"  hasExtension GL_KHR_debug: True"));

    /* "_qt_qtwes2.pyx":563
 *     else:
 *         puts('  isOpenGLES: False')
 *     if glcontext.hasExtension(QByteArray(b"GL_KHR_debug")):             # <<<<<<<<<<<<<<
 *         puts('  hasExtension GL_KHR_debug: True')
 *     else:
 */
    goto __pyx_L4;
  }

  /* "_qt_qtwes2.pyx":566
 *         puts('  hasExtension GL_KHR_debug: True')
 *     else:
 *         puts('  hasExtension GL_KHR_debug: False')             # <<<<<<<<<<<<<<
 *     #XXX: not available in PyQt
 *     #puts('OpenGL functions:')
 */
  /*else*/ {
    puts(((char const *)"  hasExtension GL_KHR_debug: False"));
  }
  __pyx_L4:;

  /* "_qt_qtwes2.pyx":569
 *     #XXX: not available in PyQt
 *     #puts('OpenGL functions:')
 *     cdef QOpenGLFunctions *glFuncs = glcontext.functions() #px+             # <<<<<<<<<<<<<<
 *     # needed for clang
 *     cdef int features = glFuncs.openGLFeatures() #px+
 */
  __pyx_v_glFuncs = __pyx_v_glcontext->functions();

  /* "_qt_qtwes2.pyx":571
 *     cdef QOpenGLFunctions *glFuncs = glcontext.functions() #px+
 *     # needed for clang
 *     cdef int features = glFuncs.openGLFeatures() #px+             # <<<<<<<<<<<<<<
 *     printf('  features: 0x%0x\n', features) #px+
 * 
 */
  __pyx_v_features = __pyx_v_glFuncs->openGLFeatures();

  /* "_qt_qtwes2.pyx":572
 *     # needed for clang
 *     cdef int features = glFuncs.openGLFeatures() #px+
 *     printf('  features: 0x%0x\n', features) #px+             # <<<<<<<<<<<<<<
 * 
 * 
 */
  printf(((char const *)"  features: 0x%0x\n"), __pyx_v_features);

  /* "_qt_qtwes2.pyx":526
 * 
 * ##pxm-FUNC P nogil
 * cdef void print_surface_info() nogil:             # <<<<<<<<<<<<<<
 *     cdef QOpenGLContext *glcontext #px+
 *     glcontext = currentContext()
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":577
 * #### ui: communicate with render-thread  ####
 * 
 * def set_pick_requested(pick_requested):             # <<<<<<<<<<<<<<
 *     uidata.pick_requested = pick_requested
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_5set_pick_requested(PyObject *__pyx_self, PyObject *__pyx_v_pick_requested); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_5set_pick_requested = {"set_pick_requested", (PyCFunction)__pyx_pw_10_qt_qtwes2_5set_pick_requested, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_5set_pick_requested(PyObject *__pyx_self, PyObject *__pyx_v_pick_requested) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_pick_requested (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_4set_pick_requested(__pyx_self, ((PyObject *)__pyx_v_pick_requested));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_4set_pick_requested(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pick_requested) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  __Pyx_RefNannySetupContext("set_pick_requested", 0);

  /* "_qt_qtwes2.pyx":578
 * 
 * def set_pick_requested(pick_requested):
 *     uidata.pick_requested = pick_requested             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pick_requested); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
  __pyx_v_10_qt_qtwes2_uidata.pick_requested = __pyx_t_1;

  /* "_qt_qtwes2.pyx":577
 * #### ui: communicate with render-thread  ####
 * 
 * def set_pick_requested(pick_requested):             # <<<<<<<<<<<<<<
 *     uidata.pick_requested = pick_requested
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_qt_qtwes2.set_pick_requested", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":581
 * 
 * ##pxm-FUNC P
 * cpdef set_atlas_size(int width, int height):             # <<<<<<<<<<<<<<
 *     uidata.atlas_changed = True
 *     uidata.atlas_width = width
 */

static PyObject *__pyx_pw_10_qt_qtwes2_7set_atlas_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_set_atlas_size(int __pyx_v_width, int __pyx_v_height, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_atlas_size", 0);

  /* "_qt_qtwes2.pyx":582
 * ##pxm-FUNC P
 * cpdef set_atlas_size(int width, int height):
 *     uidata.atlas_changed = True             # <<<<<<<<<<<<<<
 *     uidata.atlas_width = width
 *     uidata.atlas_height = height
 */
  __pyx_v_10_qt_qtwes2_uidata.atlas_changed = 1;

  /* "_qt_qtwes2.pyx":583
 * cpdef set_atlas_size(int width, int height):
 *     uidata.atlas_changed = True
 *     uidata.atlas_width = width             # <<<<<<<<<<<<<<
 *     uidata.atlas_height = height
 * 
 */
  __pyx_v_10_qt_qtwes2_uidata.atlas_width = __pyx_v_width;

  /* "_qt_qtwes2.pyx":584
 *     uidata.atlas_changed = True
 *     uidata.atlas_width = width
 *     uidata.atlas_height = height             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
  __pyx_v_10_qt_qtwes2_uidata.atlas_height = __pyx_v_height;

  /* "_qt_qtwes2.pyx":581
 * 
 * ##pxm-FUNC P
 * cpdef set_atlas_size(int width, int height):             # <<<<<<<<<<<<<<
 *     uidata.atlas_changed = True
 *     uidata.atlas_width = width
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_7set_atlas_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10_qt_qtwes2_7set_atlas_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_width;
  int __pyx_v_height;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_atlas_size (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_width,&__pyx_n_s_height,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_atlas_size", 1, 2, 2, 1); __PYX_ERR(0, 581, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_atlas_size") < 0)) __PYX_ERR(0, 581, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_width = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L3_error)
    __pyx_v_height = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_height == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_atlas_size", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 581, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.set_atlas_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_6set_atlas_size(__pyx_self, __pyx_v_width, __pyx_v_height);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_6set_atlas_size(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_width, int __pyx_v_height) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_atlas_size", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_set_atlas_size(__pyx_v_width, __pyx_v_height, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.set_atlas_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":587
 * 
 * ##pxm-FUNC P
 * cdef void set_default_surface_format():             # <<<<<<<<<<<<<<
 *     cdef QSurfaceFormat glformat #px/
 *     #glformat = QSurfaceFormat()
 */

static void __pyx_f_10_qt_qtwes2_set_default_surface_format(void) {
  QSurfaceFormat __pyx_v_glformat;
  int __pyx_v_samples;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("set_default_surface_format", 0);

  /* "_qt_qtwes2.pyx":591
 *     #glformat = QSurfaceFormat()
 *     cdef int samples #px+
 *     samples = settings['draw.samples']             # <<<<<<<<<<<<<<
 *     if samples > 0:
 *         glformat.setSamples(2**samples)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_samples = __pyx_t_3;

  /* "_qt_qtwes2.pyx":592
 *     cdef int samples #px+
 *     samples = settings['draw.samples']
 *     if samples > 0:             # <<<<<<<<<<<<<<
 *         glformat.setSamples(2**samples)
 *     if debug & DEBUG_VFPS:
 */
  __pyx_t_4 = ((__pyx_v_samples > 0) != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":593
 *     samples = settings['draw.samples']
 *     if samples > 0:
 *         glformat.setSamples(2**samples)             # <<<<<<<<<<<<<<
 *     if debug & DEBUG_VFPS:
 *         glformat.setSwapInterval(0)
 */
    __pyx_v_glformat.setSamples(__Pyx_pow_long(2, ((long)__pyx_v_samples)));

    /* "_qt_qtwes2.pyx":592
 *     cdef int samples #px+
 *     samples = settings['draw.samples']
 *     if samples > 0:             # <<<<<<<<<<<<<<
 *         glformat.setSamples(2**samples)
 *     if debug & DEBUG_VFPS:
 */
  }

  /* "_qt_qtwes2.pyx":594
 *     if samples > 0:
 *         glformat.setSamples(2**samples)
 *     if debug & DEBUG_VFPS:             # <<<<<<<<<<<<<<
 *         glformat.setSwapInterval(0)
 *     IF 'es2' != 'ogl': #px+
 */
  __pyx_t_4 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_VFPS) != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":595
 *         glformat.setSamples(2**samples)
 *     if debug & DEBUG_VFPS:
 *         glformat.setSwapInterval(0)             # <<<<<<<<<<<<<<
 *     IF 'es2' != 'ogl': #px+
 *         glformat.setRenderableType(OpenGLES) #px+
 */
    __pyx_v_glformat.setSwapInterval(0);

    /* "_qt_qtwes2.pyx":594
 *     if samples > 0:
 *         glformat.setSamples(2**samples)
 *     if debug & DEBUG_VFPS:             # <<<<<<<<<<<<<<
 *         glformat.setSwapInterval(0)
 *     IF 'es2' != 'ogl': #px+
 */
  }

  /* "_qt_qtwes2.pyx":597
 *         glformat.setSwapInterval(0)
 *     IF 'es2' != 'ogl': #px+
 *         glformat.setRenderableType(OpenGLES) #px+             # <<<<<<<<<<<<<<
 *     if debug & DEBUG_GLDEBUG:
 *         glformat.setOption(DebugContext)
 */
  __pyx_v_glformat.setRenderableType(QSurfaceFormat::OpenGLES);

  /* "_qt_qtwes2.pyx":598
 *     IF 'es2' != 'ogl': #px+
 *         glformat.setRenderableType(OpenGLES) #px+
 *     if debug & DEBUG_GLDEBUG:             # <<<<<<<<<<<<<<
 *         glformat.setOption(DebugContext)
 *     uidata.default_format = defaultFormat()
 */
  __pyx_t_4 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_GLDEBUG) != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":599
 *         glformat.setRenderableType(OpenGLES) #px+
 *     if debug & DEBUG_GLDEBUG:
 *         glformat.setOption(DebugContext)             # <<<<<<<<<<<<<<
 *     uidata.default_format = defaultFormat()
 *     setDefaultFormat(glformat)
 */
    __pyx_v_glformat.setOption(QSurfaceFormat::DebugContext);

    /* "_qt_qtwes2.pyx":598
 *     IF 'es2' != 'ogl': #px+
 *         glformat.setRenderableType(OpenGLES) #px+
 *     if debug & DEBUG_GLDEBUG:             # <<<<<<<<<<<<<<
 *         glformat.setOption(DebugContext)
 *     uidata.default_format = defaultFormat()
 */
  }

  /* "_qt_qtwes2.pyx":600
 *     if debug & DEBUG_GLDEBUG:
 *         glformat.setOption(DebugContext)
 *     uidata.default_format = defaultFormat()             # <<<<<<<<<<<<<<
 *     setDefaultFormat(glformat)
 * 
 */
  __pyx_v_10_qt_qtwes2_uidata.default_format = QSurfaceFormat::defaultFormat();

  /* "_qt_qtwes2.pyx":601
 *         glformat.setOption(DebugContext)
 *     uidata.default_format = defaultFormat()
 *     setDefaultFormat(glformat)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  QSurfaceFormat::setDefaultFormat(__pyx_v_glformat);

  /* "_qt_qtwes2.pyx":587
 * 
 * ##pxm-FUNC P
 * cdef void set_default_surface_format():             # <<<<<<<<<<<<<<
 *     cdef QSurfaceFormat glformat #px/
 *     #glformat = QSurfaceFormat()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("_qt_qtwes2.set_default_surface_format", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":945
 * # also used in beforeSynchronizing
 * ##pxm-FUNC P nogil
 * cdef void dump_info(const char *msg, const QObject *qtobj) nogil:             # <<<<<<<<<<<<<<
 *     cdef const QMetaObject *mo #px+
 *     cdef QMetaProperty p #px+
 */

static void __pyx_f_10_qt_qtwes2_dump_info(char const *__pyx_v_msg, QObject const *__pyx_v_qtobj) {
  QMetaObject const *__pyx_v_mo;
  QMetaProperty __pyx_v_p;
  QMetaMethod __pyx_v_m;
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "_qt_qtwes2.pyx":951
 *     cdef int i #px+
 * 
 *     mo = qtobj.metaObject()             # <<<<<<<<<<<<<<
 * 
 *     printf('==== %s\n', msg)
 */
  __pyx_v_mo = __pyx_v_qtobj->metaObject();

  /* "_qt_qtwes2.pyx":953
 *     mo = qtobj.metaObject()
 * 
 *     printf('==== %s\n', msg)             # <<<<<<<<<<<<<<
 *     #printf('Object-Name: %s\n', q2charp(qtobj.objectName()))
 *     printf('Class-Name: %s\n', mo.className())
 */
  printf(((char const *)"==== %s\n"), __pyx_v_msg);

  /* "_qt_qtwes2.pyx":955
 *     printf('==== %s\n', msg)
 *     #printf('Object-Name: %s\n', q2charp(qtobj.objectName()))
 *     printf('Class-Name: %s\n', mo.className())             # <<<<<<<<<<<<<<
 *     if 0 < mo.propertyCount():
 *         printf('Properties: %d (%d inherited)\n', mo.propertyCount(), mo.propertyOffset())
 */
  printf(((char const *)"Class-Name: %s\n"), __pyx_v_mo->className());

  /* "_qt_qtwes2.pyx":956
 *     #printf('Object-Name: %s\n', q2charp(qtobj.objectName()))
 *     printf('Class-Name: %s\n', mo.className())
 *     if 0 < mo.propertyCount():             # <<<<<<<<<<<<<<
 *         printf('Properties: %d (%d inherited)\n', mo.propertyCount(), mo.propertyOffset())
 *         for i in range(mo.propertyCount()):
 */
  __pyx_t_1 = ((0 < __pyx_v_mo->propertyCount()) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":957
 *     printf('Class-Name: %s\n', mo.className())
 *     if 0 < mo.propertyCount():
 *         printf('Properties: %d (%d inherited)\n', mo.propertyCount(), mo.propertyOffset())             # <<<<<<<<<<<<<<
 *         for i in range(mo.propertyCount()):
 *             p = mo.property(i)
 */
    printf(((char const *)"Properties: %d (%d inherited)\n"), __pyx_v_mo->propertyCount(), __pyx_v_mo->propertyOffset());

    /* "_qt_qtwes2.pyx":958
 *     if 0 < mo.propertyCount():
 *         printf('Properties: %d (%d inherited)\n', mo.propertyCount(), mo.propertyOffset())
 *         for i in range(mo.propertyCount()):             # <<<<<<<<<<<<<<
 *             p = mo.property(i)
 *             printf('  %d %s %s\n', i, p.typeName(), p.name())
 */
    __pyx_t_2 = __pyx_v_mo->propertyCount();
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "_qt_qtwes2.pyx":959
 *         printf('Properties: %d (%d inherited)\n', mo.propertyCount(), mo.propertyOffset())
 *         for i in range(mo.propertyCount()):
 *             p = mo.property(i)             # <<<<<<<<<<<<<<
 *             printf('  %d %s %s\n', i, p.typeName(), p.name())
 *     if 0 < mo.methodCount():
 */
      __pyx_v_p = __pyx_v_mo->property(__pyx_v_i);

      /* "_qt_qtwes2.pyx":960
 *         for i in range(mo.propertyCount()):
 *             p = mo.property(i)
 *             printf('  %d %s %s\n', i, p.typeName(), p.name())             # <<<<<<<<<<<<<<
 *     if 0 < mo.methodCount():
 *         printf('Methods: %d (%d inherited)\n', mo.methodCount(), mo.methodOffset())
 */
      printf(((char const *)"  %d %s %s\n"), __pyx_v_i, __pyx_v_p.typeName(), __pyx_v_p.name());
    }

    /* "_qt_qtwes2.pyx":956
 *     #printf('Object-Name: %s\n', q2charp(qtobj.objectName()))
 *     printf('Class-Name: %s\n', mo.className())
 *     if 0 < mo.propertyCount():             # <<<<<<<<<<<<<<
 *         printf('Properties: %d (%d inherited)\n', mo.propertyCount(), mo.propertyOffset())
 *         for i in range(mo.propertyCount()):
 */
  }

  /* "_qt_qtwes2.pyx":961
 *             p = mo.property(i)
 *             printf('  %d %s %s\n', i, p.typeName(), p.name())
 *     if 0 < mo.methodCount():             # <<<<<<<<<<<<<<
 *         printf('Methods: %d (%d inherited)\n', mo.methodCount(), mo.methodOffset())
 *         for i in range(mo.methodCount()):
 */
  __pyx_t_1 = ((0 < __pyx_v_mo->methodCount()) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":962
 *             printf('  %d %s %s\n', i, p.typeName(), p.name())
 *     if 0 < mo.methodCount():
 *         printf('Methods: %d (%d inherited)\n', mo.methodCount(), mo.methodOffset())             # <<<<<<<<<<<<<<
 *         for i in range(mo.methodCount()):
 *             m = mo.method(i)
 */
    printf(((char const *)"Methods: %d (%d inherited)\n"), __pyx_v_mo->methodCount(), __pyx_v_mo->methodOffset());

    /* "_qt_qtwes2.pyx":963
 *     if 0 < mo.methodCount():
 *         printf('Methods: %d (%d inherited)\n', mo.methodCount(), mo.methodOffset())
 *         for i in range(mo.methodCount()):             # <<<<<<<<<<<<<<
 *             m = mo.method(i)
 *             printf('  %d %s %s\n', i, m.typeName(), m.methodSignature().data())
 */
    __pyx_t_2 = __pyx_v_mo->methodCount();
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "_qt_qtwes2.pyx":964
 *         printf('Methods: %d (%d inherited)\n', mo.methodCount(), mo.methodOffset())
 *         for i in range(mo.methodCount()):
 *             m = mo.method(i)             # <<<<<<<<<<<<<<
 *             printf('  %d %s %s\n', i, m.typeName(), m.methodSignature().data())
 * 
 */
      __pyx_v_m = __pyx_v_mo->method(__pyx_v_i);

      /* "_qt_qtwes2.pyx":965
 *         for i in range(mo.methodCount()):
 *             m = mo.method(i)
 *             printf('  %d %s %s\n', i, m.typeName(), m.methodSignature().data())             # <<<<<<<<<<<<<<
 * 
 * ##pxm>IF 'qtw' == 'qtq'
 */
      printf(((char const *)"  %d %s %s\n"), __pyx_v_i, __pyx_v_m.typeName(), __pyx_v_m.methodSignature().data());
    }

    /* "_qt_qtwes2.pyx":961
 *             p = mo.property(i)
 *             printf('  %d %s %s\n', i, p.typeName(), p.name())
 *     if 0 < mo.methodCount():             # <<<<<<<<<<<<<<
 *         printf('Methods: %d (%d inherited)\n', mo.methodCount(), mo.methodOffset())
 *         for i in range(mo.methodCount()):
 */
  }

  /* "_qt_qtwes2.pyx":945
 * # also used in beforeSynchronizing
 * ##pxm-FUNC P nogil
 * cdef void dump_info(const char *msg, const QObject *qtobj) nogil:             # <<<<<<<<<<<<<<
 *     cdef const QMetaObject *mo #px+
 *     cdef QMetaProperty p #px+
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":981
 * #~ ##pxm>IF_END
 * 
 * def set_debug_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_debug_text(str2q(text))
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_9set_debug_text(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_9set_debug_text = {"set_debug_text", (PyCFunction)__pyx_pw_10_qt_qtwes2_9set_debug_text, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_9set_debug_text(PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_debug_text (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_8set_debug_text(__pyx_self, ((PyObject *)__pyx_v_text));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_8set_debug_text(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_debug_text", 0);

  /* "_qt_qtwes2.pyx":983
 * def set_debug_text(text):
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_debug_text(str2q(text))             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'debugmsg', text)
 */
  __pyx_f_6_qtui__set_debug_text(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_text));

  /* "_qt_qtwes2.pyx":981
 * #~ ##pxm>IF_END
 * 
 * def set_debug_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_debug_text(str2q(text))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":988
 *     #~ ##pxm>IF_END
 * 
 * def set_edit_moves(code, pos):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.move_edit.setText(str2q(code))
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_11set_edit_moves(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_11set_edit_moves = {"set_edit_moves", (PyCFunction)__pyx_pw_10_qt_qtwes2_11set_edit_moves, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_11set_edit_moves(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_edit_moves (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_code,&__pyx_n_s_pos,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_edit_moves", 1, 2, 2, 1); __PYX_ERR(0, 988, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_edit_moves") < 0)) __PYX_ERR(0, 988, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_code = values[0];
    __pyx_v_pos = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_edit_moves", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 988, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.set_edit_moves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_10set_edit_moves(__pyx_self, __pyx_v_code, __pyx_v_pos);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_10set_edit_moves(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_code, PyObject *__pyx_v_pos) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_edit_moves", 0);

  /* "_qt_qtwes2.pyx":990
 * def set_edit_moves(code, pos):
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.move_edit.setText(str2q(code))             # <<<<<<<<<<<<<<
 *     uidata.move_edit.setCursorPosition(pos)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_v_10_qt_qtwes2_uidata.move_edit->setText(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_code));

  /* "_qt_qtwes2.pyx":991
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.move_edit.setText(str2q(code))
 *     uidata.move_edit.setCursorPosition(pos)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'edittext', code)
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_pos); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error)
  __pyx_v_10_qt_qtwes2_uidata.move_edit->setCursorPosition(__pyx_t_1);

  /* "_qt_qtwes2.pyx":988
 *     #~ ##pxm>IF_END
 * 
 * def set_edit_moves(code, pos):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.move_edit.setText(str2q(code))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_qt_qtwes2.set_edit_moves", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":997
 *     #~ ##pxm>IF_END
 * 
 * def set_status_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.statuslabel.setText(str2q(text))
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_13set_status_text(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_13set_status_text = {"set_status_text", (PyCFunction)__pyx_pw_10_qt_qtwes2_13set_status_text, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_13set_status_text(PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_status_text (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_12set_status_text(__pyx_self, ((PyObject *)__pyx_v_text));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_12set_status_text(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_status_text", 0);

  /* "_qt_qtwes2.pyx":999
 * def set_status_text(text):
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.statuslabel.setText(str2q(text))             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'status', text)
 */
  __pyx_v_10_qt_qtwes2_uidata.statuslabel->setText(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_text));

  /* "_qt_qtwes2.pyx":997
 *     #~ ##pxm>IF_END
 * 
 * def set_status_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.statuslabel.setText(str2q(text))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1006
 * show_message_text = None
 * ##pxm-FUNC P with gil
 * cdef void show_message_cb() with gil:             # <<<<<<<<<<<<<<
 *     global show_message_text
 *     ##pxm>IF 'qtw' == 'qtw'
 */

static void __pyx_f_10_qt_qtwes2_show_message_cb(void) {
  QMessageBox *__pyx_v_dialog;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("show_message_cb", 0);

  /* "_qt_qtwes2.pyx":1009
 *     global show_message_text
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef QMessageBox *dialog = new QMessageBox(uidata.mainwindow) #px/             # <<<<<<<<<<<<<<
 *     #dialog = QMessageBox(uidata.mainwindow)
 *     dialog.setWindowTitle(str2q(_(config_.APPNAME)))
 */
  __pyx_v_dialog = new QMessageBox(__pyx_v_10_qt_qtwes2_uidata.mainwindow);

  /* "_qt_qtwes2.pyx":1011
 *     cdef QMessageBox *dialog = new QMessageBox(uidata.mainwindow) #px/
 *     #dialog = QMessageBox(uidata.mainwindow)
 *     dialog.setWindowTitle(str2q(_(config_.APPNAME)))             # <<<<<<<<<<<<<<
 *     dialog.setText(str2q(show_message_text))
 *     dialog.setIcon(QMessageBox_Information)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_APPNAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dialog->setWindowTitle(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1012
 *     #dialog = QMessageBox(uidata.mainwindow)
 *     dialog.setWindowTitle(str2q(_(config_.APPNAME)))
 *     dialog.setText(str2q(show_message_text))             # <<<<<<<<<<<<<<
 *     dialog.setIcon(QMessageBox_Information)
 *     dialog.setStandardButtons(QMessageBox_Close)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_show_message_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dialog->setText(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1013
 *     dialog.setWindowTitle(str2q(_(config_.APPNAME)))
 *     dialog.setText(str2q(show_message_text))
 *     dialog.setIcon(QMessageBox_Information)             # <<<<<<<<<<<<<<
 *     dialog.setStandardButtons(QMessageBox_Close)
 *     dialog.exec()
 */
  __pyx_v_dialog->setIcon(QMessageBox::Information);

  /* "_qt_qtwes2.pyx":1014
 *     dialog.setText(str2q(show_message_text))
 *     dialog.setIcon(QMessageBox_Information)
 *     dialog.setStandardButtons(QMessageBox_Close)             # <<<<<<<<<<<<<<
 *     dialog.exec()
 *     del dialog #px+
 */
  __pyx_v_dialog->setStandardButtons(QMessageBox::Close);

  /* "_qt_qtwes2.pyx":1015
 *     dialog.setIcon(QMessageBox_Information)
 *     dialog.setStandardButtons(QMessageBox_Close)
 *     dialog.exec()             # <<<<<<<<<<<<<<
 *     del dialog #px+
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_v_dialog->exec();

  /* "_qt_qtwes2.pyx":1016
 *     dialog.setStandardButtons(QMessageBox_Close)
 *     dialog.exec()
 *     del dialog #px+             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'messagetext', show_message_text)
 */
  delete __pyx_v_dialog;

  /* "_qt_qtwes2.pyx":1021
 *     #~ ctx_set(b'messagebox_visible', True)
 *     #~ ##pxm>IF_END
 *     show_message_text = None             # <<<<<<<<<<<<<<
 * def show_message(message):
 *     global show_message_text
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_show_message_text, Py_None) < 0) __PYX_ERR(0, 1021, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1006
 * show_message_text = None
 * ##pxm-FUNC P with gil
 * cdef void show_message_cb() with gil:             # <<<<<<<<<<<<<<
 *     global show_message_text
 *     ##pxm>IF 'qtw' == 'qtw'
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("_qt_qtwes2.show_message_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1022
 *     #~ ##pxm>IF_END
 *     show_message_text = None
 * def show_message(message):             # <<<<<<<<<<<<<<
 *     global show_message_text
 *     show_message_text = message
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_15show_message(PyObject *__pyx_self, PyObject *__pyx_v_message); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_15show_message = {"show_message", (PyCFunction)__pyx_pw_10_qt_qtwes2_15show_message, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_15show_message(PyObject *__pyx_self, PyObject *__pyx_v_message) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("show_message (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_14show_message(__pyx_self, ((PyObject *)__pyx_v_message));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_14show_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("show_message", 0);

  /* "_qt_qtwes2.pyx":1024
 * def show_message(message):
 *     global show_message_text
 *     show_message_text = message             # <<<<<<<<<<<<<<
 *     singleShot(100, show_message_cb) #px/
 *     #QTimer.singleShot(100, show_message_cb)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_show_message_text, __pyx_v_message) < 0) __PYX_ERR(0, 1024, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1025
 *     global show_message_text
 *     show_message_text = message
 *     singleShot(100, show_message_cb) #px/             # <<<<<<<<<<<<<<
 *     #QTimer.singleShot(100, show_message_cb)
 * 
 */
  QTimer::singleShot(0x64, __pyx_f_10_qt_qtwes2_show_message_cb);

  /* "_qt_qtwes2.pyx":1022
 *     #~ ##pxm>IF_END
 *     show_message_text = None
 * def show_message(message):             # <<<<<<<<<<<<<<
 *     global show_message_text
 *     show_message_text = message
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_qt_qtwes2.show_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1030
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef void _fill_treestore(QStandardItem *parent, tree):             # <<<<<<<<<<<<<<
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in tree:
 */

static void __pyx_f_10_qt_qtwes2__fill_treestore(QStandardItem *__pyx_v_parent, PyObject *__pyx_v_tree) {
  QStandardItem *__pyx_v_item;
  PyObject *__pyx_v_transl = NULL;
  PyObject *__pyx_v_func = NULL;
  PyObject *__pyx_v_subtree = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("_fill_treestore", 0);

  /* "_qt_qtwes2.pyx":1032
 * cdef void _fill_treestore(QStandardItem *parent, tree):
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in tree:             # <<<<<<<<<<<<<<
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 */
  if (likely(PyList_CheckExact(__pyx_v_tree)) || PyTuple_CheckExact(__pyx_v_tree)) {
    __pyx_t_1 = __pyx_v_tree; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_tree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1032, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1032, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1032, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 1032, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1032, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_transl, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_subtree, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "_qt_qtwes2.pyx":1033
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in tree:
 *         item = new QStandardItem(str2q(transl)) #px/             # <<<<<<<<<<<<<<
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:
 */
    __pyx_v_item = new QStandardItem(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_transl));

    /* "_qt_qtwes2.pyx":1035
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:             # <<<<<<<<<<<<<<
 *             item.setData(tovariant(func))
 *         parent.appendRow(item)
 */
    __pyx_t_10 = (__pyx_v_func != Py_None);
    __pyx_t_11 = (__pyx_t_10 != 0);
    if (__pyx_t_11) {

      /* "_qt_qtwes2.pyx":1036
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:
 *             item.setData(tovariant(func))             # <<<<<<<<<<<<<<
 *         parent.appendRow(item)
 *         _fill_treestore(item, subtree)
 */
      __pyx_v_item->setData(__pyx_f_10_qt_qtwes2_tovariant(__pyx_v_func));

      /* "_qt_qtwes2.pyx":1035
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:             # <<<<<<<<<<<<<<
 *             item.setData(tovariant(func))
 *         parent.appendRow(item)
 */
    }

    /* "_qt_qtwes2.pyx":1037
 *         if func is not None:
 *             item.setData(tovariant(func))
 *         parent.appendRow(item)             # <<<<<<<<<<<<<<
 *         _fill_treestore(item, subtree)
 * ##pxm>IF_END
 */
    __pyx_v_parent->appendRow(__pyx_v_item);

    /* "_qt_qtwes2.pyx":1038
 *             item.setData(tovariant(func))
 *         parent.appendRow(item)
 *         _fill_treestore(item, subtree)             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * 
 */
    __pyx_f_10_qt_qtwes2__fill_treestore(__pyx_v_item, __pyx_v_subtree);

    /* "_qt_qtwes2.pyx":1032
 * cdef void _fill_treestore(QStandardItem *parent, tree):
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in tree:             # <<<<<<<<<<<<<<
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1030
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef void _fill_treestore(QStandardItem *parent, tree):             # <<<<<<<<<<<<<<
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in tree:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("_qt_qtwes2._fill_treestore", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_transl);
  __Pyx_XDECREF(__pyx_v_func);
  __Pyx_XDECREF(__pyx_v_subtree);
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":1041
 * ##pxm>IF_END
 * 
 * def fill_sidepane(plugin_data):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     # remove old plugins
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_17fill_sidepane(PyObject *__pyx_self, PyObject *__pyx_v_plugin_data); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_17fill_sidepane = {"fill_sidepane", (PyCFunction)__pyx_pw_10_qt_qtwes2_17fill_sidepane, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_17fill_sidepane(PyObject *__pyx_self, PyObject *__pyx_v_plugin_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fill_sidepane (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_16fill_sidepane(__pyx_self, ((PyObject *)__pyx_v_plugin_data));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_16fill_sidepane(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_plugin_data) {
  QStandardItem *__pyx_v_item;
  PyObject *__pyx_v_transl = NULL;
  PyObject *__pyx_v_func = NULL;
  PyObject *__pyx_v_subtree = NULL;
  QPushButton *__pyx_v_button;
  QTreeView *__pyx_v_treeview;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("fill_sidepane", 0);

  /* "_qt_qtwes2.pyx":1044
 *     ##pxm>IF 'qtw' == 'qtw'
 *     # remove old plugins
 *     uidata.treestore.clear()             # <<<<<<<<<<<<<<
 *     qtui.clear_sidepane()
 *     #self.plugin_group_widgets.clear()
 */
  __pyx_v_10_qt_qtwes2_uidata.treestore->clear();

  /* "_qt_qtwes2.pyx":1045
 *     # remove old plugins
 *     uidata.treestore.clear()
 *     qtui.clear_sidepane()             # <<<<<<<<<<<<<<
 *     #self.plugin_group_widgets.clear()
 *     # fill treestore with plugins
 */
  __pyx_f_6_qtui__clear_sidepane();

  /* "_qt_qtwes2.pyx":1049
 *     # fill treestore with plugins
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in plugin_data:             # <<<<<<<<<<<<<<
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 */
  if (likely(PyList_CheckExact(__pyx_v_plugin_data)) || PyTuple_CheckExact(__pyx_v_plugin_data)) {
    __pyx_t_1 = __pyx_v_plugin_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_plugin_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1049, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1049, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1049, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1049, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 1049, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1049, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_transl, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_subtree, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "_qt_qtwes2.pyx":1050
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in plugin_data:
 *         item = new QStandardItem(str2q(transl)) #px/             # <<<<<<<<<<<<<<
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:
 */
    __pyx_v_item = new QStandardItem(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_transl));

    /* "_qt_qtwes2.pyx":1052
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:             # <<<<<<<<<<<<<<
 *             item.setData(tovariant(func))
 *         uidata.treestore.appendRow(item)
 */
    __pyx_t_10 = (__pyx_v_func != Py_None);
    __pyx_t_11 = (__pyx_t_10 != 0);
    if (__pyx_t_11) {

      /* "_qt_qtwes2.pyx":1053
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:
 *             item.setData(tovariant(func))             # <<<<<<<<<<<<<<
 *         uidata.treestore.appendRow(item)
 *         _fill_treestore(item, subtree)
 */
      __pyx_v_item->setData(__pyx_f_10_qt_qtwes2_tovariant(__pyx_v_func));

      /* "_qt_qtwes2.pyx":1052
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 *         if func is not None:             # <<<<<<<<<<<<<<
 *             item.setData(tovariant(func))
 *         uidata.treestore.appendRow(item)
 */
    }

    /* "_qt_qtwes2.pyx":1054
 *         if func is not None:
 *             item.setData(tovariant(func))
 *         uidata.treestore.appendRow(item)             # <<<<<<<<<<<<<<
 *         _fill_treestore(item, subtree)
 *     # create widgets in the sidepane to display the plugins
 */
    __pyx_v_10_qt_qtwes2_uidata.treestore->appendRow(__pyx_v_item);

    /* "_qt_qtwes2.pyx":1055
 *             item.setData(tovariant(func))
 *         uidata.treestore.appendRow(item)
 *         _fill_treestore(item, subtree)             # <<<<<<<<<<<<<<
 *     # create widgets in the sidepane to display the plugins
 *     cdef QPushButton *button #px+
 */
    __pyx_f_10_qt_qtwes2__fill_treestore(__pyx_v_item, __pyx_v_subtree);

    /* "_qt_qtwes2.pyx":1049
 *     # fill treestore with plugins
 *     cdef QStandardItem *item #px+
 *     for transl, func, subtree in plugin_data:             # <<<<<<<<<<<<<<
 *         item = new QStandardItem(str2q(transl)) #px/
 *         #item = QStandardItem(str2q(transl))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1059
 *     cdef QPushButton *button #px+
 *     cdef QTreeView *treeview #px+
 *     for i, [transl, func, subtree] in enumerate(plugin_data):             # <<<<<<<<<<<<<<
 *         button = qtui.create_sidepane_button(str2q(transl))
 *         treeview = qtui.create_sidepane_treeview(uidata.treestore, i)
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_plugin_data)) || PyTuple_CheckExact(__pyx_v_plugin_data)) {
    __pyx_t_4 = __pyx_v_plugin_data; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_plugin_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1059, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1059, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_3(__pyx_t_4);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1059, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1059, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_12)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_6)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 2; __pyx_t_8 = __pyx_t_9(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_12), 3) < 0) __PYX_ERR(0, 1059, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1059, __pyx_L1_error)
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_transl, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_subtree, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "_qt_qtwes2.pyx":1060
 *     cdef QTreeView *treeview #px+
 *     for i, [transl, func, subtree] in enumerate(plugin_data):
 *         button = qtui.create_sidepane_button(str2q(transl))             # <<<<<<<<<<<<<<
 *         treeview = qtui.create_sidepane_treeview(uidata.treestore, i)
 *         uidata.mainwindow.connect_sidepane(button, treeview)
 */
    __pyx_v_button = __pyx_f_6_qtui__create_sidepane_button(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_transl));

    /* "_qt_qtwes2.pyx":1061
 *     for i, [transl, func, subtree] in enumerate(plugin_data):
 *         button = qtui.create_sidepane_button(str2q(transl))
 *         treeview = qtui.create_sidepane_treeview(uidata.treestore, i)             # <<<<<<<<<<<<<<
 *         uidata.mainwindow.connect_sidepane(button, treeview)
 *         qtui.set_active_plugin_group(-1)
 */
    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1061, __pyx_L1_error)
    __pyx_v_treeview = __pyx_f_6_qtui__create_sidepane_treeview(__pyx_v_10_qt_qtwes2_uidata.treestore, __pyx_t_13);

    /* "_qt_qtwes2.pyx":1062
 *         button = qtui.create_sidepane_button(str2q(transl))
 *         treeview = qtui.create_sidepane_treeview(uidata.treestore, i)
 *         uidata.mainwindow.connect_sidepane(button, treeview)             # <<<<<<<<<<<<<<
 *         qtui.set_active_plugin_group(-1)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
    __pyx_v_10_qt_qtwes2_uidata.mainwindow->connect_sidepane(__pyx_v_button, __pyx_v_treeview);

    /* "_qt_qtwes2.pyx":1063
 *         treeview = qtui.create_sidepane_treeview(uidata.treestore, i)
 *         uidata.mainwindow.connect_sidepane(button, treeview)
 *         qtui.set_active_plugin_group(-1)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ pydata.plugin_data = plugin_data
 */
    __pyx_f_6_qtui__set_active_plugin_group(-1);

    /* "_qt_qtwes2.pyx":1059
 *     cdef QPushButton *button #px+
 *     cdef QTreeView *treeview #px+
 *     for i, [transl, func, subtree] in enumerate(plugin_data):             # <<<<<<<<<<<<<<
 *         button = qtui.create_sidepane_button(str2q(transl))
 *         treeview = qtui.create_sidepane_treeview(uidata.treestore, i)
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1041
 * ##pxm>IF_END
 * 
 * def fill_sidepane(plugin_data):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     # remove old plugins
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("_qt_qtwes2.fill_sidepane", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_transl);
  __Pyx_XDECREF(__pyx_v_func);
  __Pyx_XDECREF(__pyx_v_subtree);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1070
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef cbool _hide_row(int treeview, const QModelIndex &index):             # <<<<<<<<<<<<<<
 *     funcidx = fromvariant(index.data(Qt.UserRole + 1))
 *     if not pydata.app.on_plugin_test_idx(funcidx):
 */

static bool __pyx_f_10_qt_qtwes2__hide_row(int __pyx_v_treeview, QModelIndex const &__pyx_v_index) {
  PyObject *__pyx_v_funcidx = NULL;
  PyObject *__pyx_v_hide_all = NULL;
  int __pyx_v_rows;
  int __pyx_v_r;
  bool __pyx_v_hide;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  bool __pyx_t_9;
  __Pyx_RefNannySetupContext("_hide_row", 0);

  /* "_qt_qtwes2.pyx":1071
 * ##pxm-FUNC P
 * cdef cbool _hide_row(int treeview, const QModelIndex &index):
 *     funcidx = fromvariant(index.data(Qt.UserRole + 1))             # <<<<<<<<<<<<<<
 *     if not pydata.app.on_plugin_test_idx(funcidx):
 *         return True
 */
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_fromvariant(__pyx_v_index.data((Qt::UserRole + 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_funcidx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1072
 * cdef cbool _hide_row(int treeview, const QModelIndex &index):
 *     funcidx = fromvariant(index.data(Qt.UserRole + 1))
 *     if not pydata.app.on_plugin_test_idx(funcidx):             # <<<<<<<<<<<<<<
 *         return True
 *     hide_all = funcidx is None
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_plugin_test_idx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_funcidx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_funcidx};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_funcidx};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1072, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_funcidx);
      __Pyx_GIVEREF(__pyx_v_funcidx);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_funcidx);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = ((!__pyx_t_5) != 0);
  if (__pyx_t_6) {

    /* "_qt_qtwes2.pyx":1073
 *     funcidx = fromvariant(index.data(Qt.UserRole + 1))
 *     if not pydata.app.on_plugin_test_idx(funcidx):
 *         return True             # <<<<<<<<<<<<<<
 *     hide_all = funcidx is None
 *     rows = uidata.treestore.rowCount(index)
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":1072
 * cdef cbool _hide_row(int treeview, const QModelIndex &index):
 *     funcidx = fromvariant(index.data(Qt.UserRole + 1))
 *     if not pydata.app.on_plugin_test_idx(funcidx):             # <<<<<<<<<<<<<<
 *         return True
 *     hide_all = funcidx is None
 */
  }

  /* "_qt_qtwes2.pyx":1074
 *     if not pydata.app.on_plugin_test_idx(funcidx):
 *         return True
 *     hide_all = funcidx is None             # <<<<<<<<<<<<<<
 *     rows = uidata.treestore.rowCount(index)
 *     for r in range(rows):
 */
  __pyx_t_6 = (__pyx_v_funcidx == Py_None);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hide_all = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1075
 *         return True
 *     hide_all = funcidx is None
 *     rows = uidata.treestore.rowCount(index)             # <<<<<<<<<<<<<<
 *     for r in range(rows):
 *         hide = _hide_row(treeview, uidata.treestore.index(r, 0, index))
 */
  __pyx_v_rows = __pyx_v_10_qt_qtwes2_uidata.treestore->rowCount(__pyx_v_index);

  /* "_qt_qtwes2.pyx":1076
 *     hide_all = funcidx is None
 *     rows = uidata.treestore.rowCount(index)
 *     for r in range(rows):             # <<<<<<<<<<<<<<
 *         hide = _hide_row(treeview, uidata.treestore.index(r, 0, index))
 *         qtui.set_row_hidden(treeview, r, index, hide)
 */
  __pyx_t_7 = __pyx_v_rows;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_r = __pyx_t_8;

    /* "_qt_qtwes2.pyx":1077
 *     rows = uidata.treestore.rowCount(index)
 *     for r in range(rows):
 *         hide = _hide_row(treeview, uidata.treestore.index(r, 0, index))             # <<<<<<<<<<<<<<
 *         qtui.set_row_hidden(treeview, r, index, hide)
 *         hide_all = hide_all and hide
 */
    __pyx_v_hide = __pyx_f_10_qt_qtwes2__hide_row(__pyx_v_treeview, __pyx_v_10_qt_qtwes2_uidata.treestore->index(__pyx_v_r, 0, __pyx_v_index));

    /* "_qt_qtwes2.pyx":1078
 *     for r in range(rows):
 *         hide = _hide_row(treeview, uidata.treestore.index(r, 0, index))
 *         qtui.set_row_hidden(treeview, r, index, hide)             # <<<<<<<<<<<<<<
 *         hide_all = hide_all and hide
 *     return hide_all
 */
    __pyx_f_6_qtui__set_row_hidden(__pyx_v_treeview, __pyx_v_r, __pyx_v_index, __pyx_v_hide);

    /* "_qt_qtwes2.pyx":1079
 *         hide = _hide_row(treeview, uidata.treestore.index(r, 0, index))
 *         qtui.set_row_hidden(treeview, r, index, hide)
 *         hide_all = hide_all and hide             # <<<<<<<<<<<<<<
 *     return hide_all
 * ##pxm>IF_END
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_hide_all); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1079, __pyx_L1_error)
    if (__pyx_t_6) {
    } else {
      __Pyx_INCREF(__pyx_v_hide_all);
      __pyx_t_1 = __pyx_v_hide_all;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_hide); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_L6_bool_binop_done:;
    __Pyx_DECREF_SET(__pyx_v_hide_all, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "_qt_qtwes2.pyx":1080
 *         qtui.set_row_hidden(treeview, r, index, hide)
 *         hide_all = hide_all and hide
 *     return hide_all             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * def update_sidepane():
 */
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_hide_all); if (unlikely((__pyx_t_9 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1080, __pyx_L1_error)
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1070
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef cbool _hide_row(int treeview, const QModelIndex &index):             # <<<<<<<<<<<<<<
 *     funcidx = fromvariant(index.data(Qt.UserRole + 1))
 *     if not pydata.app.on_plugin_test_idx(funcidx):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("_qt_qtwes2._hide_row", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_funcidx);
  __Pyx_XDECREF(__pyx_v_hide_all);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1082
 *     return hide_all
 * ##pxm>IF_END
 * def update_sidepane():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef QModelIndex index #px+
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_19update_sidepane(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_19update_sidepane = {"update_sidepane", (PyCFunction)__pyx_pw_10_qt_qtwes2_19update_sidepane, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_19update_sidepane(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_sidepane (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_18update_sidepane(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_18update_sidepane(CYTHON_UNUSED PyObject *__pyx_self) {
  QModelIndex __pyx_v_index;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("update_sidepane", 0);

  /* "_qt_qtwes2.pyx":1085
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef QModelIndex index #px+
 *     for i in range(qtui.get_plugin_group_count()):             # <<<<<<<<<<<<<<
 *         index = qtui.root_index(i)
 *         qtui.hide_row(i, _hide_row(i, index))
 */
  __pyx_t_1 = __pyx_f_6_qtui__get_plugin_group_count();
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "_qt_qtwes2.pyx":1086
 *     cdef QModelIndex index #px+
 *     for i in range(qtui.get_plugin_group_count()):
 *         index = qtui.root_index(i)             # <<<<<<<<<<<<<<
 *         qtui.hide_row(i, _hide_row(i, index))
 *     ##pxm>IF 'qtw' == 'qtq'
 */
    __pyx_v_index = __pyx_f_6_qtui__root_index(__pyx_v_i);

    /* "_qt_qtwes2.pyx":1087
 *     for i in range(qtui.get_plugin_group_count()):
 *         index = qtui.root_index(i)
 *         qtui.hide_row(i, _hide_row(i, index))             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ def filter_plugin_data(tree):
 */
    __pyx_f_6_qtui__hide_row(__pyx_v_i, __pyx_f_10_qt_qtwes2__hide_row(__pyx_v_i, __pyx_v_index));
  }

  /* "_qt_qtwes2.pyx":1082
 *     return hide_all
 * ##pxm>IF_END
 * def update_sidepane():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef QModelIndex index #px+
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1108
 *     #~ ##pxm>IF_END
 * 
 * def set_toolbar_state(state):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_toolbar_state(state[0], state[1], state[2], state[3], state[4])
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_21set_toolbar_state(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_21set_toolbar_state = {"set_toolbar_state", (PyCFunction)__pyx_pw_10_qt_qtwes2_21set_toolbar_state, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_21set_toolbar_state(PyObject *__pyx_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_toolbar_state (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_20set_toolbar_state(__pyx_self, ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_20set_toolbar_state(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("set_toolbar_state", 0);

  /* "_qt_qtwes2.pyx":1110
 * def set_toolbar_state(state):
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_toolbar_state(state[0], state[1], state[2], state[3], state[4])             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'toolbarstate', state)
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_f_6_qtui__set_toolbar_state(__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);

  /* "_qt_qtwes2.pyx":1108
 *     #~ ##pxm>IF_END
 * 
 * def set_toolbar_state(state):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_toolbar_state(state[0], state[1], state[2], state[3], state[4])
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.set_toolbar_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1148
 * 
 * ##pxm-FUNC P
 * cdef QVariant create_stdmodel(values):             # <<<<<<<<<<<<<<
 *     cdef QObjectList qlist #px/
 *     #items = []
 */

static QVariant __pyx_f_10_qt_qtwes2_create_stdmodel(PyObject *__pyx_v_values) {
  QList<QObject*>  __pyx_v_qlist;
  PyObject *__pyx_v_text = NULL;
  PyObject *__pyx_v_key = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_unused = NULL;
  QVariant __pyx_v_items;
  QVariant __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("create_stdmodel", 0);

  /* "_qt_qtwes2.pyx":1151
 *     cdef QObjectList qlist #px/
 *     #items = []
 *     for text, key, *unused in values:             # <<<<<<<<<<<<<<
 *         qlist.append(<QObject*>new TextKeyItem(str2q(text), str2q(key))) #px/
 *         #items.append({'text': text, 'key': key})
 */
  if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
    __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1151, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1151, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1151, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1151, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    {
      Py_ssize_t index = -1;
      PyObject** temps[3] = {&__pyx_t_5,&__pyx_t_6};
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      for (index=0; index < 2; index++) {
        PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1151, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_t_9 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_unused, ((PyObject*)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "_qt_qtwes2.pyx":1152
 *     #items = []
 *     for text, key, *unused in values:
 *         qlist.append(<QObject*>new TextKeyItem(str2q(text), str2q(key))) #px/             # <<<<<<<<<<<<<<
 *         #items.append({'text': text, 'key': key})
 *     cdef QVariant items #px+
 */
    __pyx_v_qlist.append(((QObject *)new TextKeyItem(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_text), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_key))));

    /* "_qt_qtwes2.pyx":1151
 *     cdef QObjectList qlist #px/
 *     #items = []
 *     for text, key, *unused in values:             # <<<<<<<<<<<<<<
 *         qlist.append(<QObject*>new TextKeyItem(str2q(text), str2q(key))) #px/
 *         #items.append({'text': text, 'key': key})
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1155
 *         #items.append({'text': text, 'key': key})
 *     cdef QVariant items #px+
 *     items.setValue[QObjectList](qlist) #px+             # <<<<<<<<<<<<<<
 *     return items
 * 
 */
  __pyx_v_items.setValue<QList<QObject*> >(__pyx_v_qlist);

  /* "_qt_qtwes2.pyx":1156
 *     cdef QVariant items #px+
 *     items.setValue[QObjectList](qlist) #px+
 *     return items             # <<<<<<<<<<<<<<
 * 
 * ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_r = __pyx_v_items;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1148
 * 
 * ##pxm-FUNC P
 * cdef QVariant create_stdmodel(values):             # <<<<<<<<<<<<<<
 *     cdef QObjectList qlist #px/
 *     #items = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("_qt_qtwes2.create_stdmodel", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_text);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1224
 * ##pxh>
 *     ##pxm-FUNC PH with gil
 *     void _on_picking_result(int index) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_picking_result(index)
 * 
 */

void MainView::_on_picking_result(int __pyx_v_index) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_picking_result", 0);

  /* "_qt_qtwes2.pyx":1225
 *     ##pxm-FUNC PH with gil
 *     void _on_picking_result(int index) with gil:
 *         pydata.app.on_picking_result(index)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH nogil
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_picking_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1224
 * ##pxh>
 *     ##pxm-FUNC PH with gil
 *     void _on_picking_result(int index) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_picking_result(index)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("MainView._on_picking_result", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1228
 * 
 *     ##pxm-FUNC PH nogil
 *     void _on_debug_fps(int fps) nogil:             # <<<<<<<<<<<<<<
 *         ##pxm>IF 'qtw' == 'qtw'
 *         qtui.set_debug_text(QString_number(fps))
 */

void MainView::_on_debug_fps(int __pyx_v_fps) {

  /* "_qt_qtwes2.pyx":1230
 *     void _on_debug_fps(int fps) nogil:
 *         ##pxm>IF 'qtw' == 'qtw'
 *         qtui.set_debug_text(QString_number(fps))             # <<<<<<<<<<<<<<
 *         ##pxm>IF 'qtw' == 'qtq'
 *         #~ uidata.ctx.setProperty(b'debugmsg', QVariant(fps))
 */
  __pyx_f_6_qtui__set_debug_text(QString::number(__pyx_v_fps));

  /* "_qt_qtwes2.pyx":1228
 * 
 *     ##pxm-FUNC PH nogil
 *     void _on_debug_fps(int fps) nogil:             # <<<<<<<<<<<<<<
 *         ##pxm>IF 'qtw' == 'qtw'
 *         qtui.set_debug_text(QString_number(fps))
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1236
 * 
 *     ##pxm-FUNC PH nogil
 *     void _on_offscreen_image(QImage image) nogil:             # <<<<<<<<<<<<<<
 *         uidata.offscreen_image = image
 * 
 */

void MainView::_on_offscreen_image(QImage __pyx_v_image) {

  /* "_qt_qtwes2.pyx":1237
 *     ##pxm-FUNC PH nogil
 *     void _on_offscreen_image(QImage image) nogil:
 *         uidata.offscreen_image = image             # <<<<<<<<<<<<<<
 * 
 *     ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_v_10_qt_qtwes2_uidata.offscreen_image = __pyx_v_image;

  /* "_qt_qtwes2.pyx":1236
 * 
 *     ##pxm-FUNC PH nogil
 *     void _on_offscreen_image(QImage image) nogil:             # <<<<<<<<<<<<<<
 *         uidata.offscreen_image = image
 * 
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1243
 *     ##pxm>IF_END
 *     ##pxm-FUNC PH nogil
 *     void on_beforeSynchronizing() nogil:             # <<<<<<<<<<<<<<
 *         if renderdata.renderer is NULL:
 *             render_init()
 */

void MainView::on_beforeSynchronizing(void) {
  int __pyx_t_1;
  int __pyx_t_2;

  /* "_qt_qtwes2.pyx":1244
 *     ##pxm-FUNC PH nogil
 *     void on_beforeSynchronizing() nogil:
 *         if renderdata.renderer is NULL:             # <<<<<<<<<<<<<<
 *             render_init()
 *             this.connect_renderer(renderdata.renderer)
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.renderer == NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1245
 *     void on_beforeSynchronizing() nogil:
 *         if renderdata.renderer is NULL:
 *             render_init()             # <<<<<<<<<<<<<<
 *             this.connect_renderer(renderdata.renderer)
 *             IF OFFSCREEN: #px+
 */
    __pyx_f_10_qt_qtwes2_render_init();

    /* "_qt_qtwes2.pyx":1246
 *         if renderdata.renderer is NULL:
 *             render_init()
 *             this.connect_renderer(renderdata.renderer)             # <<<<<<<<<<<<<<
 *             IF OFFSCREEN: #px+
 *                 this.connect_renderer_offscreen(renderdata.renderer) #px+
 */
    this->connect_renderer(__pyx_v_10_qt_qtwes2_renderdata.renderer);

    /* "_qt_qtwes2.pyx":1244
 *     ##pxm-FUNC PH nogil
 *     void on_beforeSynchronizing() nogil:
 *         if renderdata.renderer is NULL:             # <<<<<<<<<<<<<<
 *             render_init()
 *             this.connect_renderer(renderdata.renderer)
 */
  }

  /* "_qt_qtwes2.pyx":1249
 *             IF OFFSCREEN: #px+
 *                 this.connect_renderer_offscreen(renderdata.renderer) #px+
 *         glarea.render_resize(uidata.gl_y, uidata.width, uidata.height)             # <<<<<<<<<<<<<<
 *         glarea.sync()
 * 
 */
  __pyx_f_11_glarea_es2_render_resize(__pyx_v_10_qt_qtwes2_uidata.gl_y, __pyx_v_10_qt_qtwes2_uidata.width, __pyx_v_10_qt_qtwes2_uidata.height);

  /* "_qt_qtwes2.pyx":1250
 *                 this.connect_renderer_offscreen(renderdata.renderer) #px+
 *         glarea.render_resize(uidata.gl_y, uidata.width, uidata.height)
 *         glarea.sync()             # <<<<<<<<<<<<<<
 * 
 *         if uidata.atlas_changed:
 */
  __pyx_f_11_glarea_es2_sync();

  /* "_qt_qtwes2.pyx":1252
 *         glarea.sync()
 * 
 *         if uidata.atlas_changed:             # <<<<<<<<<<<<<<
 *             renderdata.atlas_changed = True
 *             renderdata.atlas_width = uidata.atlas_width
 */
  __pyx_t_1 = (__pyx_v_10_qt_qtwes2_uidata.atlas_changed != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1253
 * 
 *         if uidata.atlas_changed:
 *             renderdata.atlas_changed = True             # <<<<<<<<<<<<<<
 *             renderdata.atlas_width = uidata.atlas_width
 *             renderdata.atlas_height = uidata.atlas_height
 */
    __pyx_v_10_qt_qtwes2_renderdata.atlas_changed = 1;

    /* "_qt_qtwes2.pyx":1254
 *         if uidata.atlas_changed:
 *             renderdata.atlas_changed = True
 *             renderdata.atlas_width = uidata.atlas_width             # <<<<<<<<<<<<<<
 *             renderdata.atlas_height = uidata.atlas_height
 *             glarea.sync_set_atlas_data()
 */
    __pyx_t_2 = __pyx_v_10_qt_qtwes2_uidata.atlas_width;
    __pyx_v_10_qt_qtwes2_renderdata.atlas_width = __pyx_t_2;

    /* "_qt_qtwes2.pyx":1255
 *             renderdata.atlas_changed = True
 *             renderdata.atlas_width = uidata.atlas_width
 *             renderdata.atlas_height = uidata.atlas_height             # <<<<<<<<<<<<<<
 *             glarea.sync_set_atlas_data()
 *             uidata.atlas_changed = False
 */
    __pyx_t_2 = __pyx_v_10_qt_qtwes2_uidata.atlas_height;
    __pyx_v_10_qt_qtwes2_renderdata.atlas_height = __pyx_t_2;

    /* "_qt_qtwes2.pyx":1256
 *             renderdata.atlas_width = uidata.atlas_width
 *             renderdata.atlas_height = uidata.atlas_height
 *             glarea.sync_set_atlas_data()             # <<<<<<<<<<<<<<
 *             uidata.atlas_changed = False
 *         if uidata.pick_requested:
 */
    __pyx_f_11_glarea_es2_sync_set_atlas_data();

    /* "_qt_qtwes2.pyx":1257
 *             renderdata.atlas_height = uidata.atlas_height
 *             glarea.sync_set_atlas_data()
 *             uidata.atlas_changed = False             # <<<<<<<<<<<<<<
 *         if uidata.pick_requested:
 *             renderdata.pickxy_changed = True
 */
    __pyx_v_10_qt_qtwes2_uidata.atlas_changed = 0;

    /* "_qt_qtwes2.pyx":1252
 *         glarea.sync()
 * 
 *         if uidata.atlas_changed:             # <<<<<<<<<<<<<<
 *             renderdata.atlas_changed = True
 *             renderdata.atlas_width = uidata.atlas_width
 */
  }

  /* "_qt_qtwes2.pyx":1258
 *             glarea.sync_set_atlas_data()
 *             uidata.atlas_changed = False
 *         if uidata.pick_requested:             # <<<<<<<<<<<<<<
 *             renderdata.pickxy_changed = True
 *             glarea.sync_set_pick_position()
 */
  __pyx_t_1 = (__pyx_v_10_qt_qtwes2_uidata.pick_requested != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1259
 *             uidata.atlas_changed = False
 *         if uidata.pick_requested:
 *             renderdata.pickxy_changed = True             # <<<<<<<<<<<<<<
 *             glarea.sync_set_pick_position()
 * 
 */
    __pyx_v_10_qt_qtwes2_renderdata.pickxy_changed = 1;

    /* "_qt_qtwes2.pyx":1260
 *         if uidata.pick_requested:
 *             renderdata.pickxy_changed = True
 *             glarea.sync_set_pick_position()             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH nogil
 */
    __pyx_f_11_glarea_es2_sync_set_pick_position();

    /* "_qt_qtwes2.pyx":1258
 *             glarea.sync_set_atlas_data()
 *             uidata.atlas_changed = False
 *         if uidata.pick_requested:             # <<<<<<<<<<<<<<
 *             renderdata.pickxy_changed = True
 *             glarea.sync_set_pick_position()
 */
  }

  /* "_qt_qtwes2.pyx":1243
 *     ##pxm>IF_END
 *     ##pxm-FUNC PH nogil
 *     void on_beforeSynchronizing() nogil:             # <<<<<<<<<<<<<<
 *         if renderdata.renderer is NULL:
 *             render_init()
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1263
 * 
 *     ##pxm-FUNC PH nogil
 *     void on_sceneGraphInvalidated() nogil:             # <<<<<<<<<<<<<<
 *         if renderdata.renderer is not NULL:
 *             render_destroy()
 */

void MainView::on_sceneGraphInvalidated(void) {
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":1264
 *     ##pxm-FUNC PH nogil
 *     void on_sceneGraphInvalidated() nogil:
 *         if renderdata.renderer is not NULL:             # <<<<<<<<<<<<<<
 *             render_destroy()
 *             del renderdata.renderer
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_renderdata.renderer != NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1265
 *     void on_sceneGraphInvalidated() nogil:
 *         if renderdata.renderer is not NULL:
 *             render_destroy()             # <<<<<<<<<<<<<<
 *             del renderdata.renderer
 *             renderdata.renderer = NULL
 */
    __pyx_f_10_qt_qtwes2_render_destroy();

    /* "_qt_qtwes2.pyx":1266
 *         if renderdata.renderer is not NULL:
 *             render_destroy()
 *             del renderdata.renderer             # <<<<<<<<<<<<<<
 *             renderdata.renderer = NULL
 * 
 */
    delete __pyx_v_10_qt_qtwes2_renderdata.renderer;

    /* "_qt_qtwes2.pyx":1267
 *             render_destroy()
 *             del renderdata.renderer
 *             renderdata.renderer = NULL             # <<<<<<<<<<<<<<
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 */
    __pyx_v_10_qt_qtwes2_renderdata.renderer = NULL;

    /* "_qt_qtwes2.pyx":1264
 *     ##pxm-FUNC PH nogil
 *     void on_sceneGraphInvalidated() nogil:
 *         if renderdata.renderer is not NULL:             # <<<<<<<<<<<<<<
 *             render_destroy()
 *             del renderdata.renderer
 */
  }

  /* "_qt_qtwes2.pyx":1263
 * 
 *     ##pxm-FUNC PH nogil
 *     void on_sceneGraphInvalidated() nogil:             # <<<<<<<<<<<<<<
 *         if renderdata.renderer is not NULL:
 *             render_destroy()
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1272
 * ##pxh>
 *     ##pxm-FUNC PH with gil
 *     void resizeEvent(QResizeEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         settings['window.size'] = event.size().width(), event.size().height()
 *         pos = qtui.splitter_pos()
 */

void MainView::resizeEvent(QResizeEvent *__pyx_v_event) {
  int __pyx_v_pos;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("resizeEvent", 0);

  /* "_qt_qtwes2.pyx":1273
 *     ##pxm-FUNC PH with gil
 *     void resizeEvent(QResizeEvent *event) with gil:
 *         settings['window.size'] = event.size().width(), event.size().height()             # <<<<<<<<<<<<<<
 *         pos = qtui.splitter_pos()
 *         if pos > 0:  # ignore the first resize event where sizes==[0,0]
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_event->size().width()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_event->size().height()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_window_size, __pyx_t_3) < 0)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1274
 *     void resizeEvent(QResizeEvent *event) with gil:
 *         settings['window.size'] = event.size().width(), event.size().height()
 *         pos = qtui.splitter_pos()             # <<<<<<<<<<<<<<
 *         if pos > 0:  # ignore the first resize event where sizes==[0,0]
 *             settings['window.divider'] = pos
 */
  __pyx_v_pos = __pyx_f_6_qtui__splitter_pos();

  /* "_qt_qtwes2.pyx":1275
 *         settings['window.size'] = event.size().width(), event.size().height()
 *         pos = qtui.splitter_pos()
 *         if pos > 0:  # ignore the first resize event where sizes==[0,0]             # <<<<<<<<<<<<<<
 *             settings['window.divider'] = pos
 *         this.QWidget_resizeEvent(event) #px/
 */
  __pyx_t_4 = ((__pyx_v_pos > 0) != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":1276
 *         pos = qtui.splitter_pos()
 *         if pos > 0:  # ignore the first resize event where sizes==[0,0]
 *             settings['window.divider'] = pos             # <<<<<<<<<<<<<<
 *         this.QWidget_resizeEvent(event) #px/
 *         #QWidget.resizeEvent(this, event)
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_window_divider, __pyx_t_3) < 0)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_qt_qtwes2.pyx":1275
 *         settings['window.size'] = event.size().width(), event.size().height()
 *         pos = qtui.splitter_pos()
 *         if pos > 0:  # ignore the first resize event where sizes==[0,0]             # <<<<<<<<<<<<<<
 *             settings['window.divider'] = pos
 *         this.QWidget_resizeEvent(event) #px/
 */
  }

  /* "_qt_qtwes2.pyx":1277
 *         if pos > 0:  # ignore the first resize event where sizes==[0,0]
 *             settings['window.divider'] = pos
 *         this.QWidget_resizeEvent(event) #px/             # <<<<<<<<<<<<<<
 *         #QWidget.resizeEvent(this, event)
 *     ##pxm-FUNC PH with gil
 */
  this->QWidget::resizeEvent(__pyx_v_event);

  /* "_qt_qtwes2.pyx":1272
 * ##pxh>
 *     ##pxm-FUNC PH with gil
 *     void resizeEvent(QResizeEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         settings['window.size'] = event.size().width(), event.size().height()
 *         pos = qtui.splitter_pos()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.resizeEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1280
 *         #QWidget.resizeEvent(this, event)
 *     ##pxm-FUNC PH with gil
 *     void closeEvent(QCloseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         destroy_resources()
 *         try:
 */

void MainView::closeEvent(QCloseEvent *__pyx_v_event) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("closeEvent", 0);

  /* "_qt_qtwes2.pyx":1281
 *     ##pxm-FUNC PH with gil
 *     void closeEvent(QCloseEvent *event) with gil:
 *         destroy_resources()             # <<<<<<<<<<<<<<
 *         try:
 *             pydata.app.on_closing()
 */
  __pyx_f_10_qt_qtwes2_destroy_resources();

  /* "_qt_qtwes2.pyx":1282
 *     void closeEvent(QCloseEvent *event) with gil:
 *         destroy_resources()
 *         try:             # <<<<<<<<<<<<<<
 *             pydata.app.on_closing()
 *         finally:
 */
  /*try:*/ {

    /* "_qt_qtwes2.pyx":1283
 *         destroy_resources()
 *         try:
 *             pydata.app.on_closing()             # <<<<<<<<<<<<<<
 *         finally:
 *             this.QWidget_closeEvent(event) #px/
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_closing); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L4_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "_qt_qtwes2.pyx":1285
 *             pydata.app.on_closing()
 *         finally:
 *             this.QWidget_closeEvent(event) #px/             # <<<<<<<<<<<<<<
 *             #QWidget.closeEvent(this, event)
 *     ##pxm-FUNC PH with gil
 */
  /*finally:*/ {
    /*normal exit:*/{
      this->QWidget::closeEvent(__pyx_v_event);
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __pyx_L4_error:;
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        this->QWidget::closeEvent(__pyx_v_event);
      }
      __Pyx_PyThreadState_assign
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "_qt_qtwes2.pyx":1280
 *         #QWidget.resizeEvent(this, event)
 *     ##pxm-FUNC PH with gil
 *     void closeEvent(QCloseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         destroy_resources()
 *         try:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.closeEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1288
 *             #QWidget.closeEvent(this, event)
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         if not pydata.app.on_key_pressed(event.key(), int(event.modifiers()) & SAFE_MODIFIER_MASK, False):
 *             event.ignore()
 */

void MainView::keyPressEvent(QKeyEvent *__pyx_v_event) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("keyPressEvent", 0);

  /* "_qt_qtwes2.pyx":1289
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if not pydata.app.on_key_pressed(event.key(), int(event.modifiers()) & SAFE_MODIFIER_MASK, False):             # <<<<<<<<<<<<<<
 *             event.ignore()
 *             this.QWidget_keyPressEvent(event) #px/
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_key_pressed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_event->key()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_Qt_3a__3a_KeyboardModifiers(__pyx_v_event->modifiers()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_e_10_qt_qtwes2_SAFE_MODIFIER_MASK); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_And(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_6, Py_False};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_6, Py_False};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_t_6);
    __Pyx_INCREF(Py_False);
    __Pyx_GIVEREF(Py_False);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_7, Py_False);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "_qt_qtwes2.pyx":1290
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if not pydata.app.on_key_pressed(event.key(), int(event.modifiers()) & SAFE_MODIFIER_MASK, False):
 *             event.ignore()             # <<<<<<<<<<<<<<
 *             this.QWidget_keyPressEvent(event) #px/
 *             #QWidget.keyPressEvent(this, event)
 */
    __pyx_v_event->ignore();

    /* "_qt_qtwes2.pyx":1291
 *         if not pydata.app.on_key_pressed(event.key(), int(event.modifiers()) & SAFE_MODIFIER_MASK, False):
 *             event.ignore()
 *             this.QWidget_keyPressEvent(event) #px/             # <<<<<<<<<<<<<<
 *             #QWidget.keyPressEvent(this, event)
 * ##pxh>
 */
    this->QWidget::keyPressEvent(__pyx_v_event);

    /* "_qt_qtwes2.pyx":1289
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if not pydata.app.on_key_pressed(event.key(), int(event.modifiers()) & SAFE_MODIFIER_MASK, False):             # <<<<<<<<<<<<<<
 *             event.ignore()
 *             this.QWidget_keyPressEvent(event) #px/
 */
  }

  /* "_qt_qtwes2.pyx":1288
 *             #QWidget.closeEvent(this, event)
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         if not pydata.app.on_key_pressed(event.key(), int(event.modifiers()) & SAFE_MODIFIER_MASK, False):
 *             event.ignore()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("MainView.keyPressEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1295
 * ##pxh>
 *     ##pxm:ACTION
 *     void on_action_challenge_triggered() with gil:  pydata.app.on_action_challenge_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_new_solved_triggered() with gil:  pydata.app.on_action_new_solved_triggered()
 *     void on_action_preferences_triggered() with gil:  pydata.app.on_action_preferences_triggered()
 */

void MainView::on_action_challenge_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_challenge_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_challenge_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_challenge_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1296
 *     ##pxm:ACTION
 *     void on_action_challenge_triggered() with gil:  pydata.app.on_action_challenge_triggered()
 *     void on_action_new_solved_triggered() with gil:  pydata.app.on_action_new_solved_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_preferences_triggered() with gil:  pydata.app.on_action_preferences_triggered()
 *     void on_action_reset_rotation_triggered() with gil:  pydata.app.on_action_reset_rotation_triggered()
 */

void MainView::on_action_new_solved_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_new_solved_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_new_solved_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_new_solved_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1297
 *     void on_action_challenge_triggered() with gil:  pydata.app.on_action_challenge_triggered()
 *     void on_action_new_solved_triggered() with gil:  pydata.app.on_action_new_solved_triggered()
 *     void on_action_preferences_triggered() with gil:  pydata.app.on_action_preferences_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_reset_rotation_triggered() with gil:  pydata.app.on_action_reset_rotation_triggered()
 *     void on_action_rewind_triggered() with gil:  pydata.app.on_action_rewind_triggered()
 */

void MainView::on_action_preferences_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_preferences_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_preferences_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_preferences_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1298
 *     void on_action_new_solved_triggered() with gil:  pydata.app.on_action_new_solved_triggered()
 *     void on_action_preferences_triggered() with gil:  pydata.app.on_action_preferences_triggered()
 *     void on_action_reset_rotation_triggered() with gil:  pydata.app.on_action_reset_rotation_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_rewind_triggered() with gil:  pydata.app.on_action_rewind_triggered()
 *     void on_action_previous_triggered() with gil:  pydata.app.on_action_previous_triggered()
 */

void MainView::on_action_reset_rotation_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_reset_rotation_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_reset_rotation_trigger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_reset_rotation_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1299
 *     void on_action_preferences_triggered() with gil:  pydata.app.on_action_preferences_triggered()
 *     void on_action_reset_rotation_triggered() with gil:  pydata.app.on_action_reset_rotation_triggered()
 *     void on_action_rewind_triggered() with gil:  pydata.app.on_action_rewind_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_previous_triggered() with gil:  pydata.app.on_action_previous_triggered()
 *     void on_action_stop_triggered() with gil:  pydata.app.on_action_stop_triggered()
 */

void MainView::on_action_rewind_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_rewind_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_rewind_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_rewind_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1300
 *     void on_action_reset_rotation_triggered() with gil:  pydata.app.on_action_reset_rotation_triggered()
 *     void on_action_rewind_triggered() with gil:  pydata.app.on_action_rewind_triggered()
 *     void on_action_previous_triggered() with gil:  pydata.app.on_action_previous_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_stop_triggered() with gil:  pydata.app.on_action_stop_triggered()
 *     void on_action_play_triggered() with gil:  pydata.app.on_action_play_triggered()
 */

void MainView::on_action_previous_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_previous_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_previous_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1300, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_previous_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1301
 *     void on_action_rewind_triggered() with gil:  pydata.app.on_action_rewind_triggered()
 *     void on_action_previous_triggered() with gil:  pydata.app.on_action_previous_triggered()
 *     void on_action_stop_triggered() with gil:  pydata.app.on_action_stop_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_play_triggered() with gil:  pydata.app.on_action_play_triggered()
 *     void on_action_next_triggered() with gil:  pydata.app.on_action_next_triggered()
 */

void MainView::on_action_stop_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_stop_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_stop_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_stop_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1302
 *     void on_action_previous_triggered() with gil:  pydata.app.on_action_previous_triggered()
 *     void on_action_stop_triggered() with gil:  pydata.app.on_action_stop_triggered()
 *     void on_action_play_triggered() with gil:  pydata.app.on_action_play_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_next_triggered() with gil:  pydata.app.on_action_next_triggered()
 *     void on_action_forward_triggered() with gil:  pydata.app.on_action_forward_triggered()
 */

void MainView::on_action_play_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_play_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_play_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_play_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1303
 *     void on_action_stop_triggered() with gil:  pydata.app.on_action_stop_triggered()
 *     void on_action_play_triggered() with gil:  pydata.app.on_action_play_triggered()
 *     void on_action_next_triggered() with gil:  pydata.app.on_action_next_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_forward_triggered() with gil:  pydata.app.on_action_forward_triggered()
 *     void on_action_mark_set_triggered() with gil:  pydata.app.on_action_mark_set_triggered()
 */

void MainView::on_action_next_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_next_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_next_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_next_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1304
 *     void on_action_play_triggered() with gil:  pydata.app.on_action_play_triggered()
 *     void on_action_next_triggered() with gil:  pydata.app.on_action_next_triggered()
 *     void on_action_forward_triggered() with gil:  pydata.app.on_action_forward_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_mark_set_triggered() with gil:  pydata.app.on_action_mark_set_triggered()
 *     void on_action_mark_remove_triggered() with gil:  pydata.app.on_action_mark_remove_triggered()
 */

void MainView::on_action_forward_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_forward_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_forward_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_forward_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1305
 *     void on_action_next_triggered() with gil:  pydata.app.on_action_next_triggered()
 *     void on_action_forward_triggered() with gil:  pydata.app.on_action_forward_triggered()
 *     void on_action_mark_set_triggered() with gil:  pydata.app.on_action_mark_set_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_mark_remove_triggered() with gil:  pydata.app.on_action_mark_remove_triggered()
 *     void on_action_initial_state_triggered() with gil:  pydata.app.on_action_initial_state_triggered()
 */

void MainView::on_action_mark_set_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_mark_set_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_mark_set_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_mark_set_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1306
 *     void on_action_forward_triggered() with gil:  pydata.app.on_action_forward_triggered()
 *     void on_action_mark_set_triggered() with gil:  pydata.app.on_action_mark_set_triggered()
 *     void on_action_mark_remove_triggered() with gil:  pydata.app.on_action_mark_remove_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_initial_state_triggered() with gil:  pydata.app.on_action_initial_state_triggered()
 *     void on_action_edit_cube_triggered() with gil:  pydata.app.on_action_edit_cube_triggered()
 */

void MainView::on_action_mark_remove_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_mark_remove_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_mark_remove_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_mark_remove_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1307
 *     void on_action_mark_set_triggered() with gil:  pydata.app.on_action_mark_set_triggered()
 *     void on_action_mark_remove_triggered() with gil:  pydata.app.on_action_mark_remove_triggered()
 *     void on_action_initial_state_triggered() with gil:  pydata.app.on_action_initial_state_triggered()             # <<<<<<<<<<<<<<
 *     void on_action_edit_cube_triggered() with gil:  pydata.app.on_action_edit_cube_triggered()
 *     ##px.
 */

void MainView::on_action_initial_state_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_initial_state_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_initial_state_triggere); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_initial_state_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1308
 *     void on_action_mark_remove_triggered() with gil:  pydata.app.on_action_mark_remove_triggered()
 *     void on_action_initial_state_triggered() with gil:  pydata.app.on_action_initial_state_triggered()
 *     void on_action_edit_cube_triggered() with gil:  pydata.app.on_action_edit_cube_triggered()             # <<<<<<<<<<<<<<
 *     ##px.
 * 
 */

void MainView::on_action_edit_cube_triggered(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_edit_cube_triggered", 0);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_action_edit_cube_triggered); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_action_edit_cube_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1312
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_triggered() with gil:             # <<<<<<<<<<<<<<
 *         if pydata.modelselect is None:
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()
 */

void MainView::on_action_selectmodel_triggered(void) {
  PyObject *__pyx_v_items = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_title = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_selectmodel_triggered", 0);

  /* "_qt_qtwes2.pyx":1313
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_triggered() with gil:
 *         if pydata.modelselect is None:             # <<<<<<<<<<<<<<
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()
 *         uidata.modelselect_currentpage = 1
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modelselect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":1314
 *     void on_action_selectmodel_triggered() with gil:
 *         if pydata.modelselect is None:
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()             # <<<<<<<<<<<<<<
 *         uidata.modelselect_currentpage = 1
 *         items, index, title = pydata.modelselect.on_model_get_modeldata(1)
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_app); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_on_action_selectmodel_triggered); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_modelselect, __pyx_t_2) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1313
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_triggered() with gil:
 *         if pydata.modelselect is None:             # <<<<<<<<<<<<<<
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()
 *         uidata.modelselect_currentpage = 1
 */
  }

  /* "_qt_qtwes2.pyx":1315
 *         if pydata.modelselect is None:
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()
 *         uidata.modelselect_currentpage = 1             # <<<<<<<<<<<<<<
 *         items, index, title = pydata.modelselect.on_model_get_modeldata(1)
 *         qtui.fill_page(create_stdmodel(items), str2q(title))
 */
  __pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage = 1;

  /* "_qt_qtwes2.pyx":1316
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()
 *         uidata.modelselect_currentpage = 1
 *         items, index, title = pydata.modelselect.on_model_get_modeldata(1)             # <<<<<<<<<<<<<<
 *         qtui.fill_page(create_stdmodel(items), str2q(title))
 *         qtui.set_page(1)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_modelselect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_on_model_get_modeldata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1316, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(0, 1316, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L5_unpacking_done;
    __pyx_L4_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1316, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_items = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_index = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_title = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "_qt_qtwes2.pyx":1317
 *         uidata.modelselect_currentpage = 1
 *         items, index, title = pydata.modelselect.on_model_get_modeldata(1)
 *         qtui.fill_page(create_stdmodel(items), str2q(title))             # <<<<<<<<<<<<<<
 *         qtui.set_page(1)
 *     ##pxm-FUNC PH with gil
 */
  __pyx_f_6_qtui__fill_page(__pyx_f_10_qt_qtwes2_create_stdmodel(__pyx_v_items), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_title));

  /* "_qt_qtwes2.pyx":1318
 *         items, index, title = pydata.modelselect.on_model_get_modeldata(1)
 *         qtui.fill_page(create_stdmodel(items), str2q(title))
 *         qtui.set_page(1)             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_back_triggered() with gil:
 */
  __pyx_f_6_qtui__set_page(1);

  /* "_qt_qtwes2.pyx":1312
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_triggered() with gil:             # <<<<<<<<<<<<<<
 *         if pydata.modelselect is None:
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("MainView.on_action_selectmodel_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1320
 *         qtui.set_page(1)
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_back_triggered() with gil:             # <<<<<<<<<<<<<<
 *         if pydata.modelselect.on_model_back():
 *             uidata.modelselect_currentpage -= 1
 */

void MainView::on_action_selectmodel_back_triggered(void) {
  PyObject *__pyx_v_items = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_title = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_selectmodel_back_triggered", 0);

  /* "_qt_qtwes2.pyx":1321
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_back_triggered() with gil:
 *         if pydata.modelselect.on_model_back():             # <<<<<<<<<<<<<<
 *             uidata.modelselect_currentpage -= 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_modelselect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_model_back); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":1322
 *     void on_action_selectmodel_back_triggered() with gil:
 *         if pydata.modelselect.on_model_back():
 *             uidata.modelselect_currentpage -= 1             # <<<<<<<<<<<<<<
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 *             qtui.fill_page(create_stdmodel(items), str2q(title))
 */
    __pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage = (__pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage - 1);

    /* "_qt_qtwes2.pyx":1323
 *         if pydata.modelselect.on_model_back():
 *             uidata.modelselect_currentpage -= 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)             # <<<<<<<<<<<<<<
 *             qtui.fill_page(create_stdmodel(items), str2q(title))
 *             qtui.set_page(1)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_modelselect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_model_get_modeldata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1323, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_5), 3) < 0) __PYX_ERR(0, 1323, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1323, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_items = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_index = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_title = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_qt_qtwes2.pyx":1324
 *             uidata.modelselect_currentpage -= 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 *             qtui.fill_page(create_stdmodel(items), str2q(title))             # <<<<<<<<<<<<<<
 *             qtui.set_page(1)
 *         else:
 */
    __pyx_f_6_qtui__fill_page(__pyx_f_10_qt_qtwes2_create_stdmodel(__pyx_v_items), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_title));

    /* "_qt_qtwes2.pyx":1325
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 *             qtui.fill_page(create_stdmodel(items), str2q(title))
 *             qtui.set_page(1)             # <<<<<<<<<<<<<<
 *         else:
 *             qtui.set_page(0)
 */
    __pyx_f_6_qtui__set_page(1);

    /* "_qt_qtwes2.pyx":1321
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_back_triggered() with gil:
 *         if pydata.modelselect.on_model_back():             # <<<<<<<<<<<<<<
 *             uidata.modelselect_currentpage -= 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1327
 *             qtui.set_page(1)
 *         else:
 *             qtui.set_page(0)             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PHD with gil
 *     void _listwidget_itemActivated(QListWidgetItem *item) with gil:
 */
  /*else*/ {
    __pyx_f_6_qtui__set_page(0);
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":1320
 *         qtui.set_page(1)
 *     ##pxm-FUNC PH with gil
 *     void on_action_selectmodel_back_triggered() with gil:             # <<<<<<<<<<<<<<
 *         if pydata.modelselect.on_model_back():
 *             uidata.modelselect_currentpage -= 1
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("MainView.on_action_selectmodel_back_triggered", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1329
 *             qtui.set_page(0)
 *     ##pxm-FUNC PHD with gil
 *     void _listwidget_itemActivated(QListWidgetItem *item) with gil:             # <<<<<<<<<<<<<<
 *         index = item.listWidget().currentRow()  #TODO: store index in item
 *         mtype_size = pydata.modelselect.on_convert_to_mtype_size(uidata.modelselect_currentpage, index)
 */

void MainView::_listwidget_itemActivated(QListWidgetItem *__pyx_v_item) {
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_mtype_size = NULL;
  PyObject *__pyx_v_items = NULL;
  PyObject *__pyx_v_title = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_listwidget_itemActivated", 0);

  /* "_qt_qtwes2.pyx":1330
 *     ##pxm-FUNC PHD with gil
 *     void _listwidget_itemActivated(QListWidgetItem *item) with gil:
 *         index = item.listWidget().currentRow()  #TODO: store index in item             # <<<<<<<<<<<<<<
 *         mtype_size = pydata.modelselect.on_convert_to_mtype_size(uidata.modelselect_currentpage, index)
 *         if mtype_size is None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_item->listWidget()->currentRow()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_index = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1331
 *     void _listwidget_itemActivated(QListWidgetItem *item) with gil:
 *         index = item.listWidget().currentRow()  #TODO: store index in item
 *         mtype_size = pydata.modelselect.on_convert_to_mtype_size(uidata.modelselect_currentpage, index)             # <<<<<<<<<<<<<<
 *         if mtype_size is None:
 *             uidata.modelselect_currentpage += 1
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_modelselect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_convert_to_mtype_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_index};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_index};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_index);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_mtype_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1332
 *         index = item.listWidget().currentRow()  #TODO: store index in item
 *         mtype_size = pydata.modelselect.on_convert_to_mtype_size(uidata.modelselect_currentpage, index)
 *         if mtype_size is None:             # <<<<<<<<<<<<<<
 *             uidata.modelselect_currentpage += 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 */
  __pyx_t_7 = (__pyx_v_mtype_size == Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "_qt_qtwes2.pyx":1333
 *         mtype_size = pydata.modelselect.on_convert_to_mtype_size(uidata.modelselect_currentpage, index)
 *         if mtype_size is None:
 *             uidata.modelselect_currentpage += 1             # <<<<<<<<<<<<<<
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 *             qtui.fill_page(create_stdmodel(items), str2q(title))
 */
    __pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage = (__pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage + 1);

    /* "_qt_qtwes2.pyx":1334
 *         if mtype_size is None:
 *             uidata.modelselect_currentpage += 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)             # <<<<<<<<<<<<<<
 *             qtui.fill_page(create_stdmodel(items), str2q(title))
 *         else:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_modelselect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_on_model_get_modeldata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_10_qt_qtwes2_uidata.modelselect_currentpage); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1334, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1334, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_6 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 3) < 0) __PYX_ERR(0, 1334, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1334, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_items = __pyx_t_2;
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_title = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "_qt_qtwes2.pyx":1335
 *             uidata.modelselect_currentpage += 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 *             qtui.fill_page(create_stdmodel(items), str2q(title))             # <<<<<<<<<<<<<<
 *         else:
 *             pydata.app.on_load_other_game(*mtype_size)
 */
    __pyx_f_6_qtui__fill_page(__pyx_f_10_qt_qtwes2_create_stdmodel(__pyx_v_items), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_title));

    /* "_qt_qtwes2.pyx":1332
 *         index = item.listWidget().currentRow()  #TODO: store index in item
 *         mtype_size = pydata.modelselect.on_convert_to_mtype_size(uidata.modelselect_currentpage, index)
 *         if mtype_size is None:             # <<<<<<<<<<<<<<
 *             uidata.modelselect_currentpage += 1
 *             items, index, title = pydata.modelselect.on_model_get_modeldata(uidata.modelselect_currentpage)
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1337
 *             qtui.fill_page(create_stdmodel(items), str2q(title))
 *         else:
 *             pydata.app.on_load_other_game(*mtype_size)             # <<<<<<<<<<<<<<
 *             qtui.set_page(0)
 *             while pydata.modelselect.on_model_back():
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_app); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_on_load_other_game); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PySequence_Tuple(__pyx_v_mtype_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_qt_qtwes2.pyx":1338
 *         else:
 *             pydata.app.on_load_other_game(*mtype_size)
 *             qtui.set_page(0)             # <<<<<<<<<<<<<<
 *             while pydata.modelselect.on_model_back():
 *                 pass
 */
    __pyx_f_6_qtui__set_page(0);

    /* "_qt_qtwes2.pyx":1339
 *             pydata.app.on_load_other_game(*mtype_size)
 *             qtui.set_page(0)
 *             while pydata.modelselect.on_model_back():             # <<<<<<<<<<<<<<
 *                 pass
 *     ##pxm-FUNC PH with gil
 */
    while (1) {
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_modelselect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_on_model_back); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1339, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1339, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1339, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1339, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_8) break;
    }
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":1329
 *             qtui.set_page(0)
 *     ##pxm-FUNC PHD with gil
 *     void _listwidget_itemActivated(QListWidgetItem *item) with gil:             # <<<<<<<<<<<<<<
 *         index = item.listWidget().currentRow()  #TODO: store index in item
 *         mtype_size = pydata.modelselect.on_convert_to_mtype_size(uidata.modelselect_currentpage, index)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("MainView._listwidget_itemActivated", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_mtype_size);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XDECREF(__pyx_v_title);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1342
 *                 pass
 *     ##pxm-FUNC PH with gil
 *     void on_listwidget_itemActivated(QListWidgetItem *item) with gil:             # <<<<<<<<<<<<<<
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 */

void MainView::on_listwidget_itemActivated(QListWidgetItem *__pyx_v_item) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_listwidget_itemActivated", 0);

  /* "_qt_qtwes2.pyx":1343
 *     ##pxm-FUNC PH with gil
 *     void on_listwidget_itemActivated(QListWidgetItem *item) with gil:
 *         this._listwidget_itemActivated(item)             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_listwidget_itemClicked(QListWidgetItem *item) with gil:
 */
  this->_listwidget_itemActivated(__pyx_v_item);

  /* "_qt_qtwes2.pyx":1342
 *                 pass
 *     ##pxm-FUNC PH with gil
 *     void on_listwidget_itemActivated(QListWidgetItem *item) with gil:             # <<<<<<<<<<<<<<
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1345
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 *     void on_listwidget_itemClicked(QListWidgetItem *item) with gil:             # <<<<<<<<<<<<<<
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 */

void MainView::on_listwidget_itemClicked(QListWidgetItem *__pyx_v_item) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_listwidget_itemClicked", 0);

  /* "_qt_qtwes2.pyx":1346
 *     ##pxm-FUNC PH with gil
 *     void on_listwidget_itemClicked(QListWidgetItem *item) with gil:
 *         this._listwidget_itemActivated(item)             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_action_quit_triggered() with gil:
 */
  this->_listwidget_itemActivated(__pyx_v_item);

  /* "_qt_qtwes2.pyx":1345
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 *     void on_listwidget_itemClicked(QListWidgetItem *item) with gil:             # <<<<<<<<<<<<<<
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1348
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 *     void on_action_quit_triggered() with gil:             # <<<<<<<<<<<<<<
 *         this.close()
 *     ##pxm-FUNC PH with gil
 */

void MainView::on_action_quit_triggered(void) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_quit_triggered", 0);

  /* "_qt_qtwes2.pyx":1349
 *     ##pxm-FUNC PH with gil
 *     void on_action_quit_triggered() with gil:
 *         this.close()             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_action_editbar_toggled(cbool checked) with gil:
 */
  this->close();

  /* "_qt_qtwes2.pyx":1348
 *         this._listwidget_itemActivated(item)
 *     ##pxm-FUNC PH with gil
 *     void on_action_quit_triggered() with gil:             # <<<<<<<<<<<<<<
 *         this.close()
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1351
 *         this.close()
 *     ##pxm-FUNC PH with gil
 *     void on_action_editbar_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         qtui.set_frame_editbar_visible(checked)
 *         settings['window.editbar'] = checked
 */

void MainView::on_action_editbar_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_editbar_toggled", 0);

  /* "_qt_qtwes2.pyx":1352
 *     ##pxm-FUNC PH with gil
 *     void on_action_editbar_toggled(cbool checked) with gil:
 *         qtui.set_frame_editbar_visible(checked)             # <<<<<<<<<<<<<<
 *         settings['window.editbar'] = checked
 *     ##pxm-FUNC PH with gil
 */
  __pyx_f_6_qtui__set_frame_editbar_visible(__pyx_v_checked);

  /* "_qt_qtwes2.pyx":1353
 *     void on_action_editbar_toggled(cbool checked) with gil:
 *         qtui.set_frame_editbar_visible(checked)
 *         settings['window.editbar'] = checked             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_action_statusbar_toggled(cbool checked) with gil:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_checked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_window_editbar, __pyx_t_1) < 0)) __PYX_ERR(0, 1353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1351
 *         this.close()
 *     ##pxm-FUNC PH with gil
 *     void on_action_editbar_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         qtui.set_frame_editbar_visible(checked)
 *         settings['window.editbar'] = checked
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("MainView.on_action_editbar_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1355
 *         settings['window.editbar'] = checked
 *     ##pxm-FUNC PH with gil
 *     void on_action_statusbar_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         qtui.set_statusbar_visible(checked)
 *         settings['window.statusbar'] = checked
 */

void MainView::on_action_statusbar_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_statusbar_toggled", 0);

  /* "_qt_qtwes2.pyx":1356
 *     ##pxm-FUNC PH with gil
 *     void on_action_statusbar_toggled(cbool checked) with gil:
 *         qtui.set_statusbar_visible(checked)             # <<<<<<<<<<<<<<
 *         settings['window.statusbar'] = checked
 *     ##pxm-FUNC PH nogil
 */
  __pyx_f_6_qtui__set_statusbar_visible(__pyx_v_checked);

  /* "_qt_qtwes2.pyx":1357
 *     void on_action_statusbar_toggled(cbool checked) with gil:
 *         qtui.set_statusbar_visible(checked)
 *         settings['window.statusbar'] = checked             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH nogil
 *     void on_action_help_triggered() nogil:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_checked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_window_statusbar, __pyx_t_1) < 0)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1355
 *         settings['window.editbar'] = checked
 *     ##pxm-FUNC PH with gil
 *     void on_action_statusbar_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         qtui.set_statusbar_visible(checked)
 *         settings['window.statusbar'] = checked
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("MainView.on_action_statusbar_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1359
 *         settings['window.statusbar'] = checked
 *     ##pxm-FUNC PH nogil
 *     void on_action_help_triggered() nogil:             # <<<<<<<<<<<<<<
 *         if uidata.help == NULL:
 *             help_dialog()
 */

void MainView::on_action_help_triggered(void) {
  int __pyx_t_1;

  /* "_qt_qtwes2.pyx":1360
 *     ##pxm-FUNC PH nogil
 *     void on_action_help_triggered() nogil:
 *         if uidata.help == NULL:             # <<<<<<<<<<<<<<
 *             help_dialog()
 *         help_dialog_show()
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_uidata.help == NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1361
 *     void on_action_help_triggered() nogil:
 *         if uidata.help == NULL:
 *             help_dialog()             # <<<<<<<<<<<<<<
 *         help_dialog_show()
 *     ##pxm-FUNC PH nogil
 */
    __pyx_f_10_qt_qtwes2_help_dialog();

    /* "_qt_qtwes2.pyx":1360
 *     ##pxm-FUNC PH nogil
 *     void on_action_help_triggered() nogil:
 *         if uidata.help == NULL:             # <<<<<<<<<<<<<<
 *             help_dialog()
 *         help_dialog_show()
 */
  }

  /* "_qt_qtwes2.pyx":1362
 *         if uidata.help == NULL:
 *             help_dialog()
 *         help_dialog_show()             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH nogil
 *     void on_action_info_triggered() nogil:
 */
  __pyx_f_10_qt_qtwes2_help_dialog_show();

  /* "_qt_qtwes2.pyx":1359
 *         settings['window.statusbar'] = checked
 *     ##pxm-FUNC PH nogil
 *     void on_action_help_triggered() nogil:             # <<<<<<<<<<<<<<
 *         if uidata.help == NULL:
 *             help_dialog()
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1364
 *         help_dialog_show()
 *     ##pxm-FUNC PH nogil
 *     void on_action_info_triggered() nogil:             # <<<<<<<<<<<<<<
 *         about_dialog()
 *     ##pxm-FUNC PH with gil
 */

void MainView::on_action_info_triggered(void) {

  /* "_qt_qtwes2.pyx":1365
 *     ##pxm-FUNC PH nogil
 *     void on_action_info_triggered() nogil:
 *         about_dialog()             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_splitter_splitterMoved(int pos, int index) with gil:
 */
  __pyx_f_10_qt_qtwes2_about_dialog();

  /* "_qt_qtwes2.pyx":1364
 *         help_dialog_show()
 *     ##pxm-FUNC PH nogil
 *     void on_action_info_triggered() nogil:             # <<<<<<<<<<<<<<
 *         about_dialog()
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1367
 *         about_dialog()
 *     ##pxm-FUNC PH with gil
 *     void on_splitter_splitterMoved(int pos, int index) with gil:             # <<<<<<<<<<<<<<
 *         if index == 1:
 *             settings['window.divider'] = pos
 */

void MainView::on_splitter_splitterMoved(int __pyx_v_pos, int __pyx_v_index) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_splitter_splitterMoved", 0);

  /* "_qt_qtwes2.pyx":1368
 *     ##pxm-FUNC PH with gil
 *     void on_splitter_splitterMoved(int pos, int index) with gil:
 *         if index == 1:             # <<<<<<<<<<<<<<
 *             settings['window.divider'] = pos
 *             qtui.splitter_update_minimumsize()
 */
  __pyx_t_1 = ((__pyx_v_index == 1) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1369
 *     void on_splitter_splitterMoved(int pos, int index) with gil:
 *         if index == 1:
 *             settings['window.divider'] = pos             # <<<<<<<<<<<<<<
 *             qtui.splitter_update_minimumsize()
 *     ##pxm-FUNC PH with gil
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_kp_u_window_divider, __pyx_t_2) < 0)) __PYX_ERR(0, 1369, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1370
 *         if index == 1:
 *             settings['window.divider'] = pos
 *             qtui.splitter_update_minimumsize()             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_clear_clicked() with gil:
 */
    __pyx_f_6_qtui__splitter_update_minimumsize();

    /* "_qt_qtwes2.pyx":1368
 *     ##pxm-FUNC PH with gil
 *     void on_splitter_splitterMoved(int pos, int index) with gil:
 *         if index == 1:             # <<<<<<<<<<<<<<
 *             settings['window.divider'] = pos
 *             qtui.splitter_update_minimumsize()
 */
  }

  /* "_qt_qtwes2.pyx":1367
 *         about_dialog()
 *     ##pxm-FUNC PH with gil
 *     void on_splitter_splitterMoved(int pos, int index) with gil:             # <<<<<<<<<<<<<<
 *         if index == 1:
 *             settings['window.divider'] = pos
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("MainView.on_splitter_splitterMoved", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1372
 *             qtui.splitter_update_minimumsize()
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_clear_clicked() with gil:             # <<<<<<<<<<<<<<
 *         uidata.move_edit.setText(str2q(''))
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 */

void MainView::on_button_edit_clear_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_edit_clear_clicked", 0);

  /* "_qt_qtwes2.pyx":1373
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_clear_clicked() with gil:
 *         uidata.move_edit.setText(str2q(''))             # <<<<<<<<<<<<<<
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 *     ##pxm-FUNC PH with gil
 */
  __pyx_v_10_qt_qtwes2_uidata.move_edit->setText(__pyx_f_10_qt_qtwes2_str2q(__pyx_kp_u__6));

  /* "_qt_qtwes2.pyx":1374
 *     void on_button_edit_clear_clicked() with gil:
 *         uidata.move_edit.setText(str2q(''))
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_exec_clicked() with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_edit_finished); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_10_qt_qtwes2_uidata.move_edit->text()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_10_qt_qtwes2_uidata.move_edit->cursorPosition()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1372
 *             qtui.splitter_update_minimumsize()
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_clear_clicked() with gil:             # <<<<<<<<<<<<<<
 *         uidata.move_edit.setText(str2q(''))
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("MainView.on_button_edit_clear_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1376
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_exec_clicked() with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 *     ##pxm-FUNC PH with gil
 */

void MainView::on_button_edit_exec_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_edit_exec_clicked", 0);

  /* "_qt_qtwes2.pyx":1377
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_exec_clicked() with gil:
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_action_jump_to_editbar_triggered() with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_edit_finished); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_10_qt_qtwes2_uidata.move_edit->text()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_10_qt_qtwes2_uidata.move_edit->cursorPosition()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1376
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 *     ##pxm-FUNC PH with gil
 *     void on_button_edit_exec_clicked() with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("MainView.on_button_edit_exec_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1379
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 *     ##pxm-FUNC PH with gil
 *     void on_action_jump_to_editbar_triggered() with gil:             # <<<<<<<<<<<<<<
 *         uidata.move_edit.setFocus()
 * 
 */

void MainView::on_action_jump_to_editbar_triggered(void) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_action_jump_to_editbar_triggered", 0);

  /* "_qt_qtwes2.pyx":1380
 *     ##pxm-FUNC PH with gil
 *     void on_action_jump_to_editbar_triggered() with gil:
 *         uidata.move_edit.setFocus()             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_v_10_qt_qtwes2_uidata.move_edit->setFocus();

  /* "_qt_qtwes2.pyx":1379
 *         pydata.app.on_edit_finished(q2str(uidata.move_edit.text()), uidata.move_edit.cursorPosition())
 *     ##pxm-FUNC PH with gil
 *     void on_action_jump_to_editbar_triggered() with gil:             # <<<<<<<<<<<<<<
 *         uidata.move_edit.setFocus()
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1383
 * 
 *     ##pxm-FUNC PH with gil
 *     void _on_button_sidepane_clicked() with gil:             # <<<<<<<<<<<<<<
 *         qtui.set_active_plugin_group_by_obj(this.sender())
 *     ##pxm-FUNC PH with gil
 */

void MainView::_on_button_sidepane_clicked(void) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_button_sidepane_clicked", 0);

  /* "_qt_qtwes2.pyx":1384
 *     ##pxm-FUNC PH with gil
 *     void _on_button_sidepane_clicked() with gil:
 *         qtui.set_active_plugin_group_by_obj(this.sender())             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void _on_treeview_activated(const QModelIndex &index) with gil:
 */
  __pyx_f_6_qtui__set_active_plugin_group_by_obj(this->sender());

  /* "_qt_qtwes2.pyx":1383
 * 
 *     ##pxm-FUNC PH with gil
 *     void _on_button_sidepane_clicked() with gil:             # <<<<<<<<<<<<<<
 *         qtui.set_active_plugin_group_by_obj(this.sender())
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1386
 *         qtui.set_active_plugin_group_by_obj(this.sender())
 *     ##pxm-FUNC PH with gil
 *     void _on_treeview_activated(const QModelIndex &index) with gil:             # <<<<<<<<<<<<<<
 *         func_idx = fromvariant(index.data(Qt.UserRole + 1))
 *         if func_idx is None:
 */

void MainView::_on_treeview_activated(QModelIndex const &__pyx_v_index) {
  PyObject *__pyx_v_func_idx = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_treeview_activated", 0);

  /* "_qt_qtwes2.pyx":1387
 *     ##pxm-FUNC PH with gil
 *     void _on_treeview_activated(const QModelIndex &index) with gil:
 *         func_idx = fromvariant(index.data(Qt.UserRole + 1))             # <<<<<<<<<<<<<<
 *         if func_idx is None:
 *             return
 */
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_fromvariant(__pyx_v_index.data((Qt::UserRole + 1))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_func_idx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1388
 *     void _on_treeview_activated(const QModelIndex &index) with gil:
 *         func_idx = fromvariant(index.data(Qt.UserRole + 1))
 *         if func_idx is None:             # <<<<<<<<<<<<<<
 *             return
 *         pydata.app.on_plugin_activated(func_idx)
 */
  __pyx_t_2 = (__pyx_v_func_idx == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "_qt_qtwes2.pyx":1389
 *         func_idx = fromvariant(index.data(Qt.UserRole + 1))
 *         if func_idx is None:
 *             return             # <<<<<<<<<<<<<<
 *         pydata.app.on_plugin_activated(func_idx)
 * ##pxm>IF_END
 */
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":1388
 *     void _on_treeview_activated(const QModelIndex &index) with gil:
 *         func_idx = fromvariant(index.data(Qt.UserRole + 1))
 *         if func_idx is None:             # <<<<<<<<<<<<<<
 *             return
 *         pydata.app.on_plugin_activated(func_idx)
 */
  }

  /* "_qt_qtwes2.pyx":1390
 *         if func_idx is None:
 *             return
 *         pydata.app.on_plugin_activated(func_idx)             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * ##pxm>CPPCLASS_END
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_app); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_on_plugin_activated); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_func_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_func_idx};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_func_idx};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_func_idx);
      __Pyx_GIVEREF(__pyx_v_func_idx);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_func_idx);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1386
 *         qtui.set_active_plugin_group_by_obj(this.sender())
 *     ##pxm-FUNC PH with gil
 *     void _on_treeview_activated(const QModelIndex &index) with gil:             # <<<<<<<<<<<<<<
 *         func_idx = fromvariant(index.data(Qt.UserRole + 1))
 *         if func_idx is None:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("MainView._on_treeview_activated", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_func_idx);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1406
 *         ##pxc>}
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         if event.matches(MoveToNextWord):
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())
 */

void MoveEdit::keyPressEvent(QKeyEvent *__pyx_v_event) {
  PyObject *__pyx_v_pos = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("keyPressEvent", 0);

  /* "_qt_qtwes2.pyx":1407
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if event.matches(MoveToNextWord):             # <<<<<<<<<<<<<<
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 */
  __pyx_t_1 = (__pyx_v_event->matches(QKeySequence::MoveToNextWord) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1408
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if event.matches(MoveToNextWord):
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())             # <<<<<<<<<<<<<<
 *             this.setCursorPosition(pos)
 *         elif event.matches(MoveToPreviousWord):
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_on_edit_moves_nextword); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_f_10_qt_qtwes2_q2str(this->text()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(this->cursorPosition()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_pos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1409
 *         if event.matches(MoveToNextWord):
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)             # <<<<<<<<<<<<<<
 *         elif event.matches(MoveToPreviousWord):
 *             pos = pydata.app.on_edit_moves_prevword(q2str(this.text()), this.cursorPosition())
 */
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_pos); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L1_error)
    this->setCursorPosition(__pyx_t_7);

    /* "_qt_qtwes2.pyx":1407
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if event.matches(MoveToNextWord):             # <<<<<<<<<<<<<<
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1410
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 *         elif event.matches(MoveToPreviousWord):             # <<<<<<<<<<<<<<
 *             pos = pydata.app.on_edit_moves_prevword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 */
  __pyx_t_1 = (__pyx_v_event->matches(QKeySequence::MoveToPreviousWord) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1411
 *             this.setCursorPosition(pos)
 *         elif event.matches(MoveToPreviousWord):
 *             pos = pydata.app.on_edit_moves_prevword(q2str(this.text()), this.cursorPosition())             # <<<<<<<<<<<<<<
 *             this.setCursorPosition(pos)
 *         elif event.key() == Qt.Key_Right and event.modifiers() == Qt.AltModifier:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_on_edit_moves_prevword); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_10_qt_qtwes2_q2str(this->text()); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyInt_From_int(this->cursorPosition()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_8 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_pos = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1412
 *         elif event.matches(MoveToPreviousWord):
 *             pos = pydata.app.on_edit_moves_prevword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)             # <<<<<<<<<<<<<<
 *         elif event.key() == Qt.Key_Right and event.modifiers() == Qt.AltModifier:
 *             pydata.app.on_edit_moves_swapnext(q2str(this.text()), this.cursorPosition())
 */
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_pos); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1412, __pyx_L1_error)
    this->setCursorPosition(__pyx_t_7);

    /* "_qt_qtwes2.pyx":1410
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 *         elif event.matches(MoveToPreviousWord):             # <<<<<<<<<<<<<<
 *             pos = pydata.app.on_edit_moves_prevword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1413
 *             pos = pydata.app.on_edit_moves_prevword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 *         elif event.key() == Qt.Key_Right and event.modifiers() == Qt.AltModifier:             # <<<<<<<<<<<<<<
 *             pydata.app.on_edit_moves_swapnext(q2str(this.text()), this.cursorPosition())
 *         elif event.key() == Qt.Key_Left and event.modifiers() == Qt.AltModifier:
 */
  __pyx_t_9 = ((__pyx_v_event->key() == Qt::Key_Right) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_1 = __pyx_t_9;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_9 = ((__pyx_v_event->modifiers() == Qt::AltModifier) != 0);
  __pyx_t_1 = __pyx_t_9;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1414
 *             this.setCursorPosition(pos)
 *         elif event.key() == Qt.Key_Right and event.modifiers() == Qt.AltModifier:
 *             pydata.app.on_edit_moves_swapnext(q2str(this.text()), this.cursorPosition())             # <<<<<<<<<<<<<<
 *         elif event.key() == Qt.Key_Left and event.modifiers() == Qt.AltModifier:
 *             pydata.app.on_edit_moves_swapprev(q2str(this.text()), this.cursorPosition())
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_on_edit_moves_swapnext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_f_10_qt_qtwes2_q2str(this->text()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyInt_From_int(this->cursorPosition()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1413
 *             pos = pydata.app.on_edit_moves_prevword(q2str(this.text()), this.cursorPosition())
 *             this.setCursorPosition(pos)
 *         elif event.key() == Qt.Key_Right and event.modifiers() == Qt.AltModifier:             # <<<<<<<<<<<<<<
 *             pydata.app.on_edit_moves_swapnext(q2str(this.text()), this.cursorPosition())
 *         elif event.key() == Qt.Key_Left and event.modifiers() == Qt.AltModifier:
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1415
 *         elif event.key() == Qt.Key_Right and event.modifiers() == Qt.AltModifier:
 *             pydata.app.on_edit_moves_swapnext(q2str(this.text()), this.cursorPosition())
 *         elif event.key() == Qt.Key_Left and event.modifiers() == Qt.AltModifier:             # <<<<<<<<<<<<<<
 *             pydata.app.on_edit_moves_swapprev(q2str(this.text()), this.cursorPosition())
 *         else:
 */
  __pyx_t_9 = ((__pyx_v_event->key() == Qt::Key_Left) != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_1 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_9 = ((__pyx_v_event->modifiers() == Qt::AltModifier) != 0);
  __pyx_t_1 = __pyx_t_9;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1416
 *             pydata.app.on_edit_moves_swapnext(q2str(this.text()), this.cursorPosition())
 *         elif event.key() == Qt.Key_Left and event.modifiers() == Qt.AltModifier:
 *             pydata.app.on_edit_moves_swapprev(q2str(this.text()), this.cursorPosition())             # <<<<<<<<<<<<<<
 *         else:
 *             this.QLineEdit_keyPressEvent(event) #px/
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_on_edit_moves_swapprev); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_f_10_qt_qtwes2_q2str(this->text()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(this->cursorPosition()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1415
 *         elif event.key() == Qt.Key_Right and event.modifiers() == Qt.AltModifier:
 *             pydata.app.on_edit_moves_swapnext(q2str(this.text()), this.cursorPosition())
 *         elif event.key() == Qt.Key_Left and event.modifiers() == Qt.AltModifier:             # <<<<<<<<<<<<<<
 *             pydata.app.on_edit_moves_swapprev(q2str(this.text()), this.cursorPosition())
 *         else:
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1418
 *             pydata.app.on_edit_moves_swapprev(q2str(this.text()), this.cursorPosition())
 *         else:
 *             this.QLineEdit_keyPressEvent(event) #px/             # <<<<<<<<<<<<<<
 *             #QLineEdit.keyPressEvent(self, event)
 *     ##pxm-FUNC PH with gil const
 */
  /*else*/ {
    this->QLineEdit::keyPressEvent(__pyx_v_event);
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":1406
 *         ##pxc>}
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         if event.matches(MoveToNextWord):
 *             pos = pydata.app.on_edit_moves_nextword(q2str(this.text()), this.cursorPosition())
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("MoveEdit.keyPressEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1421
 *             #QLineEdit.keyPressEvent(self, event)
 *     ##pxm-FUNC PH with gil const
 *     void on_returnpressed() with gil const:             # <<<<<<<<<<<<<<
 *         pydata.app.on_edit_finished(q2str(this.text()), this.cursorPosition())
 * ##pxm>CPPCLASS_END
 */

void MoveEdit::on_returnpressed(void) const {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_returnpressed", 0);

  /* "_qt_qtwes2.pyx":1422
 *     ##pxm-FUNC PH with gil const
 *     void on_returnpressed() with gil const:
 *         pydata.app.on_edit_finished(q2str(this.text()), this.cursorPosition())             # <<<<<<<<<<<<<<
 * ##pxm>CPPCLASS_END
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_edit_finished); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(this->text()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(this->cursorPosition()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1421
 *             #QLineEdit.keyPressEvent(self, event)
 *     ##pxm-FUNC PH with gil const
 *     void on_returnpressed() with gil const:             # <<<<<<<<<<<<<<
 *         pydata.app.on_edit_finished(q2str(this.text()), this.cursorPosition())
 * ##pxm>CPPCLASS_END
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("MoveEdit.on_returnpressed", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1432
 *         ##pxh> : QOpenGLWidget() {}
 *     ##pxm-FUNC PHD with gil
 *     void init() with gil:             # <<<<<<<<<<<<<<
 *         this.setAcceptDrops(True)
 *         this.setFocusPolicy(Qt.StrongFocus)
 */

void DrawingArea::init(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("init", 0);

  /* "_qt_qtwes2.pyx":1433
 *     ##pxm-FUNC PHD with gil
 *     void init() with gil:
 *         this.setAcceptDrops(True)             # <<<<<<<<<<<<<<
 *         this.setFocusPolicy(Qt.StrongFocus)
 *         if debug & DEBUG_NOCONTROLS:
 */
  this->setAcceptDrops(1);

  /* "_qt_qtwes2.pyx":1434
 *     void init() with gil:
 *         this.setAcceptDrops(True)
 *         this.setFocusPolicy(Qt.StrongFocus)             # <<<<<<<<<<<<<<
 *         if debug & DEBUG_NOCONTROLS:
 *             this.setMinimumSize(128, 128)  # for thumbnail generation
 */
  this->setFocusPolicy(Qt::StrongFocus);

  /* "_qt_qtwes2.pyx":1435
 *         this.setAcceptDrops(True)
 *         this.setFocusPolicy(Qt.StrongFocus)
 *         if debug & DEBUG_NOCONTROLS:             # <<<<<<<<<<<<<<
 *             this.setMinimumSize(128, 128)  # for thumbnail generation
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_NOCONTROLS) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1436
 *         this.setFocusPolicy(Qt.StrongFocus)
 *         if debug & DEBUG_NOCONTROLS:
 *             this.setMinimumSize(128, 128)  # for thumbnail generation             # <<<<<<<<<<<<<<
 *         else:
 *             this.setMinimumSize(300, 300)
 */
    this->setMinimumSize(0x80, 0x80);

    /* "_qt_qtwes2.pyx":1435
 *         this.setAcceptDrops(True)
 *         this.setFocusPolicy(Qt.StrongFocus)
 *         if debug & DEBUG_NOCONTROLS:             # <<<<<<<<<<<<<<
 *             this.setMinimumSize(128, 128)  # for thumbnail generation
 *         else:
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1438
 *             this.setMinimumSize(128, 128)  # for thumbnail generation
 *         else:
 *             this.setMinimumSize(300, 300)             # <<<<<<<<<<<<<<
 *         this.setMouseTracking(True)
 *     ##pxm-FUNC PH nogil
 */
  /*else*/ {
    this->setMinimumSize(0x12C, 0x12C);
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":1439
 *         else:
 *             this.setMinimumSize(300, 300)
 *         this.setMouseTracking(True)             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH nogil
 *     void paintGL() nogil:
 */
  this->setMouseTracking(1);

  /* "_qt_qtwes2.pyx":1432
 *         ##pxh> : QOpenGLWidget() {}
 *     ##pxm-FUNC PHD with gil
 *     void init() with gil:             # <<<<<<<<<<<<<<
 *         this.setAcceptDrops(True)
 *         this.setFocusPolicy(Qt.StrongFocus)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1441
 *         this.setMouseTracking(True)
 *     ##pxm-FUNC PH nogil
 *     void paintGL() nogil:             # <<<<<<<<<<<<<<
 *         uidata.mainwindow.on_beforeSynchronizing()
 *         renderdata.renderer.on_beforeRendering()
 */

void DrawingArea::paintGL(void) {

  /* "_qt_qtwes2.pyx":1442
 *     ##pxm-FUNC PH nogil
 *     void paintGL() nogil:
 *         uidata.mainwindow.on_beforeSynchronizing()             # <<<<<<<<<<<<<<
 *         renderdata.renderer.on_beforeRendering()
 *     ##pxm-FUNC PH with gil
 */
  __pyx_v_10_qt_qtwes2_uidata.mainwindow->on_beforeSynchronizing();

  /* "_qt_qtwes2.pyx":1443
 *     void paintGL() nogil:
 *         uidata.mainwindow.on_beforeSynchronizing()
 *         renderdata.renderer.on_beforeRendering()             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void resizeGL(int width, int height) with gil:
 */
  __pyx_v_10_qt_qtwes2_renderdata.renderer->on_beforeRendering();

  /* "_qt_qtwes2.pyx":1441
 *         this.setMouseTracking(True)
 *     ##pxm-FUNC PH nogil
 *     void paintGL() nogil:             # <<<<<<<<<<<<<<
 *         uidata.mainwindow.on_beforeSynchronizing()
 *         renderdata.renderer.on_beforeRendering()
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1445
 *         renderdata.renderer.on_beforeRendering()
 *     ##pxm-FUNC PH with gil
 *     void resizeGL(int width, int height) with gil:             # <<<<<<<<<<<<<<
 *         uidata.width = width
 *         uidata.height = height
 */

void DrawingArea::resizeGL(int __pyx_v_width, int __pyx_v_height) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("resizeGL", 0);

  /* "_qt_qtwes2.pyx":1446
 *     ##pxm-FUNC PH with gil
 *     void resizeGL(int width, int height) with gil:
 *         uidata.width = width             # <<<<<<<<<<<<<<
 *         uidata.height = height
 *     ##pxm-FUNC PH with gil
 */
  __pyx_v_10_qt_qtwes2_uidata.width = __pyx_v_width;

  /* "_qt_qtwes2.pyx":1447
 *     void resizeGL(int width, int height) with gil:
 *         uidata.width = width
 *         uidata.height = height             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:
 */
  __pyx_v_10_qt_qtwes2_uidata.height = __pyx_v_height;

  /* "_qt_qtwes2.pyx":1445
 *         renderdata.renderer.on_beforeRendering()
 *     ##pxm-FUNC PH with gil
 *     void resizeGL(int width, int height) with gil:             # <<<<<<<<<<<<<<
 *         uidata.width = width
 *         uidata.height = height
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1449
 *         uidata.height = height
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         if not pydata.app.on_key_pressed(event.key(), event.modifiers() & SAFE_MODIFIER_MASK, True):
 *             this.QWidget_keyPressEvent(event) #px/
 */

void DrawingArea::keyPressEvent(QKeyEvent *__pyx_v_event) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("keyPressEvent", 0);

  /* "_qt_qtwes2.pyx":1450
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if not pydata.app.on_key_pressed(event.key(), event.modifiers() & SAFE_MODIFIER_MASK, True):             # <<<<<<<<<<<<<<
 *             this.QWidget_keyPressEvent(event) #px/
 *             #QWidget.keyPressEvent(this, event)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_key_pressed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_event->key()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_Qt_3a__3a_KeyboardModifiers((__pyx_v_event->modifiers() & __pyx_e_10_qt_qtwes2_SAFE_MODIFIER_MASK)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, Py_True};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, __pyx_t_4, Py_True};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_True);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "_qt_qtwes2.pyx":1451
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if not pydata.app.on_key_pressed(event.key(), event.modifiers() & SAFE_MODIFIER_MASK, True):
 *             this.QWidget_keyPressEvent(event) #px/             # <<<<<<<<<<<<<<
 *             #QWidget.keyPressEvent(this, event)
 *     ##pxm-FUNC PH with gil
 */
    this->QWidget::keyPressEvent(__pyx_v_event);

    /* "_qt_qtwes2.pyx":1450
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:
 *         if not pydata.app.on_key_pressed(event.key(), event.modifiers() & SAFE_MODIFIER_MASK, True):             # <<<<<<<<<<<<<<
 *             this.QWidget_keyPressEvent(event) #px/
 *             #QWidget.keyPressEvent(this, event)
 */
  }

  /* "_qt_qtwes2.pyx":1449
 *         uidata.height = height
 *     ##pxm-FUNC PH with gil
 *     void keyPressEvent(QKeyEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         if not pydata.app.on_key_pressed(event.key(), event.modifiers() & SAFE_MODIFIER_MASK, True):
 *             this.QWidget_keyPressEvent(event) #px/
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("DrawingArea.keyPressEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1454
 *             #QWidget.keyPressEvent(this, event)
 *     ##pxm-FUNC PH with gil
 *     void mousePressEvent(QMouseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_pressed(event.modifiers(), event.button(), event.x(), event.y(), this.height())
 *     ##pxm-FUNC PH with gil
 */

void DrawingArea::mousePressEvent(QMouseEvent *__pyx_v_event) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("mousePressEvent", 0);

  /* "_qt_qtwes2.pyx":1455
 *     ##pxm-FUNC PH with gil
 *     void mousePressEvent(QMouseEvent *event) with gil:
 *         pydata.app.on_mouse_pressed(event.modifiers(), event.button(), event.x(), event.y(), this.height())             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void mouseReleaseEvent(QMouseEvent *event) with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_mouse_pressed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_Qt_3a__3a_KeyboardModifiers(__pyx_v_event->modifiers()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_enum__Qt_3a__3a_MouseButton(__pyx_v_event->button()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_event->x()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_event->y()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_int(this->height()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_8, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 5+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_10 = PyTuple_New(5+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_9, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1454
 *             #QWidget.keyPressEvent(this, event)
 *     ##pxm-FUNC PH with gil
 *     void mousePressEvent(QMouseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_pressed(event.modifiers(), event.button(), event.x(), event.y(), this.height())
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_WriteUnraisable("DrawingArea.mousePressEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1457
 *         pydata.app.on_mouse_pressed(event.modifiers(), event.button(), event.x(), event.y(), this.height())
 *     ##pxm-FUNC PH with gil
 *     void mouseReleaseEvent(QMouseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_released(event.x(), event.y())
 *     ##pxm-FUNC PH with gil
 */

void DrawingArea::mouseReleaseEvent(QMouseEvent *__pyx_v_event) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("mouseReleaseEvent", 0);

  /* "_qt_qtwes2.pyx":1458
 *     ##pxm-FUNC PH with gil
 *     void mouseReleaseEvent(QMouseEvent *event) with gil:
 *         pydata.app.on_mouse_released(event.x(), event.y())             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void mouseMoveEvent(QMouseEvent *event) with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_mouse_released); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_event->x()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_event->y()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1457
 *         pydata.app.on_mouse_pressed(event.modifiers(), event.button(), event.x(), event.y(), this.height())
 *     ##pxm-FUNC PH with gil
 *     void mouseReleaseEvent(QMouseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_released(event.x(), event.y())
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("DrawingArea.mouseReleaseEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1460
 *         pydata.app.on_mouse_released(event.x(), event.y())
 *     ##pxm-FUNC PH with gil
 *     void mouseMoveEvent(QMouseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_moved(True, event.x(), event.y(), this.height(), 4)
 *     ##pxm-FUNC PH with gil
 */

void DrawingArea::mouseMoveEvent(QMouseEvent *__pyx_v_event) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("mouseMoveEvent", 0);

  /* "_qt_qtwes2.pyx":1461
 *     ##pxm-FUNC PH with gil
 *     void mouseMoveEvent(QMouseEvent *event) with gil:
 *         pydata.app.on_mouse_moved(True, event.x(), event.y(), this.height(), 4)             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void wheelEvent(QWheelEvent *event) with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_mouse_moved); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_event->x()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_event->y()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(this->height()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_6, Py_True, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_int_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 5+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_6, Py_True, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_int_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 5+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(5+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, Py_True);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_5);
    __Pyx_INCREF(__pyx_int_4);
    __Pyx_GIVEREF(__pyx_int_4);
    PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_int_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1460
 *         pydata.app.on_mouse_released(event.x(), event.y())
 *     ##pxm-FUNC PH with gil
 *     void mouseMoveEvent(QMouseEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_moved(True, event.x(), event.y(), this.height(), 4)
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("DrawingArea.mouseMoveEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1463
 *         pydata.app.on_mouse_moved(True, event.x(), event.y(), this.height(), 4)
 *     ##pxm-FUNC PH with gil
 *     void wheelEvent(QWheelEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_zoom(event.angleDelta().y() / 120)
 *     ##pxm-FUNC PH with gil
 */

void DrawingArea::wheelEvent(QWheelEvent *__pyx_v_event) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("wheelEvent", 0);

  /* "_qt_qtwes2.pyx":1464
 *     ##pxm-FUNC PH with gil
 *     void wheelEvent(QWheelEvent *event) with gil:
 *         pydata.app.on_mouse_zoom(event.angleDelta().y() / 120)             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void dragEnterEvent(QDragEnterEvent *event) with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_mouse_zoom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyFloat_FromDouble((((double)__pyx_v_event->angleDelta().y()) / 120.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1463
 *         pydata.app.on_mouse_moved(True, event.x(), event.y(), this.height(), 4)
 *     ##pxm-FUNC PH with gil
 *     void wheelEvent(QWheelEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_mouse_zoom(event.angleDelta().y() / 120)
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("DrawingArea.wheelEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1466
 *         pydata.app.on_mouse_zoom(event.angleDelta().y() / 120)
 *     ##pxm-FUNC PH with gil
 *     void dragEnterEvent(QDragEnterEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 */

void DrawingArea::dragEnterEvent(QDragEnterEvent *__pyx_v_event) {
  QMimeData const *__pyx_v_mime_data;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("dragEnterEvent", 0);

  /* "_qt_qtwes2.pyx":1468
 *     void dragEnterEvent(QDragEnterEvent *event) with gil:
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()             # <<<<<<<<<<<<<<
 *         if debug & DEBUG_MSG:
 *             print('drag enter:', _qs2list(mime_data.formats())) #px/
 */
  __pyx_v_mime_data = __pyx_v_event->mimeData();

  /* "_qt_qtwes2.pyx":1469
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 *         if debug & DEBUG_MSG:             # <<<<<<<<<<<<<<
 *             print('drag enter:', _qs2list(mime_data.formats())) #px/
 *             #print('drag enter:', mime_data.formats())
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_MSG) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1470
 *         mime_data = event.mimeData()
 *         if debug & DEBUG_MSG:
 *             print('drag enter:', _qs2list(mime_data.formats())) #px/             # <<<<<<<<<<<<<<
 *             #print('drag enter:', mime_data.formats())
 *         if mime_data.hasColor():
 */
    __pyx_t_2 = __pyx_f_10_qt_qtwes2__qs2list(__pyx_v_mime_data->formats()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_kp_u_drag_enter);
    __Pyx_GIVEREF(__pyx_kp_u_drag_enter);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_drag_enter);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1469
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 *         if debug & DEBUG_MSG:             # <<<<<<<<<<<<<<
 *             print('drag enter:', _qs2list(mime_data.formats())) #px/
 *             #print('drag enter:', mime_data.formats())
 */
  }

  /* "_qt_qtwes2.pyx":1472
 *             print('drag enter:', _qs2list(mime_data.formats())) #px/
 *             #print('drag enter:', mime_data.formats())
 *         if mime_data.hasColor():             # <<<<<<<<<<<<<<
 *             event.acceptProposedAction()
 *         elif mime_data.hasUrls() and mime_data.urls().at(0).isLocalFile():
 */
  __pyx_t_1 = (__pyx_v_mime_data->hasColor() != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1473
 *             #print('drag enter:', mime_data.formats())
 *         if mime_data.hasColor():
 *             event.acceptProposedAction()             # <<<<<<<<<<<<<<
 *         elif mime_data.hasUrls() and mime_data.urls().at(0).isLocalFile():
 *             event.acceptProposedAction()
 */
    __pyx_v_event->acceptProposedAction();

    /* "_qt_qtwes2.pyx":1472
 *             print('drag enter:', _qs2list(mime_data.formats())) #px/
 *             #print('drag enter:', mime_data.formats())
 *         if mime_data.hasColor():             # <<<<<<<<<<<<<<
 *             event.acceptProposedAction()
 *         elif mime_data.hasUrls() and mime_data.urls().at(0).isLocalFile():
 */
    goto __pyx_L4;
  }

  /* "_qt_qtwes2.pyx":1474
 *         if mime_data.hasColor():
 *             event.acceptProposedAction()
 *         elif mime_data.hasUrls() and mime_data.urls().at(0).isLocalFile():             # <<<<<<<<<<<<<<
 *             event.acceptProposedAction()
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_4 = (__pyx_v_mime_data->hasUrls() != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_mime_data->urls().at(0).isLocalFile() != 0);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1475
 *             event.acceptProposedAction()
 *         elif mime_data.hasUrls() and mime_data.urls().at(0).isLocalFile():
 *             event.acceptProposedAction()             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void dropEvent(QDropEvent *event) with gil:
 */
    __pyx_v_event->acceptProposedAction();

    /* "_qt_qtwes2.pyx":1474
 *         if mime_data.hasColor():
 *             event.acceptProposedAction()
 *         elif mime_data.hasUrls() and mime_data.urls().at(0).isLocalFile():             # <<<<<<<<<<<<<<
 *             event.acceptProposedAction()
 *     ##pxm-FUNC PH with gil
 */
  }
  __pyx_L4:;

  /* "_qt_qtwes2.pyx":1466
 *         pydata.app.on_mouse_zoom(event.angleDelta().y() / 120)
 *     ##pxm-FUNC PH with gil
 *     void dragEnterEvent(QDragEnterEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("DrawingArea.dragEnterEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1477
 *             event.acceptProposedAction()
 *     ##pxm-FUNC PH with gil
 *     void dropEvent(QDropEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 */

void DrawingArea::dropEvent(QDropEvent *__pyx_v_event) {
  QMimeData const *__pyx_v_mime_data;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("dropEvent", 0);

  /* "_qt_qtwes2.pyx":1479
 *     void dropEvent(QDropEvent *event) with gil:
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()             # <<<<<<<<<<<<<<
 *         if mime_data.hasColor():
 *             pydata.app.on_mouse_drop_color(event.pos().x(), this.height() - event.pos().y(),
 */
  __pyx_v_mime_data = __pyx_v_event->mimeData();

  /* "_qt_qtwes2.pyx":1480
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 *         if mime_data.hasColor():             # <<<<<<<<<<<<<<
 *             pydata.app.on_mouse_drop_color(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.colorData().toString()))
 */
  __pyx_t_1 = (__pyx_v_mime_data->hasColor() != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1481
 *         mime_data = event.mimeData()
 *         if mime_data.hasColor():
 *             pydata.app.on_mouse_drop_color(event.pos().x(), this.height() - event.pos().y(),             # <<<<<<<<<<<<<<
 *                                                 q2str(mime_data.colorData().toString()))
 *         elif mime_data.hasUrls():
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_on_mouse_drop_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_event->pos().x()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int((this->height() - __pyx_v_event->pos().y())); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "_qt_qtwes2.pyx":1482
 *         if mime_data.hasColor():
 *             pydata.app.on_mouse_drop_color(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.colorData().toString()))             # <<<<<<<<<<<<<<
 *         elif mime_data.hasUrls():
 *             pydata.app.on_mouse_drop_url(event.pos().x(), this.height() - event.pos().y(),
 */
    __pyx_t_6 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_mime_data->colorData().toString()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_4, __pyx_t_5, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1480
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 *         if mime_data.hasColor():             # <<<<<<<<<<<<<<
 *             pydata.app.on_mouse_drop_color(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.colorData().toString()))
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1483
 *             pydata.app.on_mouse_drop_color(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.colorData().toString()))
 *         elif mime_data.hasUrls():             # <<<<<<<<<<<<<<
 *             pydata.app.on_mouse_drop_url(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.urls().at(0).toString()))
 */
  __pyx_t_1 = (__pyx_v_mime_data->hasUrls() != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1484
 *                                                 q2str(mime_data.colorData().toString()))
 *         elif mime_data.hasUrls():
 *             pydata.app.on_mouse_drop_url(event.pos().x(), this.height() - event.pos().y(),             # <<<<<<<<<<<<<<
 *                                                 q2str(mime_data.urls().at(0).toString()))
 *         else:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_on_mouse_drop_url); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_event->pos().x()); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = __Pyx_PyInt_From_int((this->height() - __pyx_v_event->pos().y())); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "_qt_qtwes2.pyx":1485
 *         elif mime_data.hasUrls():
 *             pydata.app.on_mouse_drop_url(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.urls().at(0).toString()))             # <<<<<<<<<<<<<<
 *         else:
 *             if debug & DEBUG_MSG:
 */
    __pyx_t_5 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_mime_data->urls().at(0).toString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_9, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_9, __pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_t_5);
      __pyx_t_9 = 0;
      __pyx_t_6 = 0;
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1483
 *             pydata.app.on_mouse_drop_color(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.colorData().toString()))
 *         elif mime_data.hasUrls():             # <<<<<<<<<<<<<<
 *             pydata.app.on_mouse_drop_url(event.pos().x(), this.height() - event.pos().y(),
 *                                                 q2str(mime_data.urls().at(0).toString()))
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1487
 *                                                 q2str(mime_data.urls().at(0).toString()))
 *         else:
 *             if debug & DEBUG_MSG:             # <<<<<<<<<<<<<<
 *                 print('Skip mime type:', ' '.join(_qs2list(mime_data.formats()))) #px/
 *                 #print('Skip mime type:', ' '.join(mime_data.formats()))
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_MSG) != 0);
    if (__pyx_t_1) {

      /* "_qt_qtwes2.pyx":1488
 *         else:
 *             if debug & DEBUG_MSG:
 *                 print('Skip mime type:', ' '.join(_qs2list(mime_data.formats()))) #px/             # <<<<<<<<<<<<<<
 *                 #print('Skip mime type:', ' '.join(mime_data.formats()))
 * ##pxm>CPPCLASS_END
 */
      __pyx_t_2 = __pyx_f_10_qt_qtwes2__qs2list(__pyx_v_mime_data->formats()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_kp_u_Skip_mime_type);
      __Pyx_GIVEREF(__pyx_kp_u_Skip_mime_type);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Skip_mime_type);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "_qt_qtwes2.pyx":1487
 *                                                 q2str(mime_data.urls().at(0).toString()))
 *         else:
 *             if debug & DEBUG_MSG:             # <<<<<<<<<<<<<<
 *                 print('Skip mime type:', ' '.join(_qs2list(mime_data.formats()))) #px/
 *                 #print('Skip mime type:', ' '.join(mime_data.formats()))
 */
    }
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":1477
 *             event.acceptProposedAction()
 *     ##pxm-FUNC PH with gil
 *     void dropEvent(QDropEvent *event) with gil:             # <<<<<<<<<<<<<<
 *         cdef const QMimeData *mime_data #px+
 *         mime_data = event.mimeData()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("DrawingArea.dropEvent", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1508
 *         ##pxh> : QDialog(parent), liststore_blocked(false) {}
 *     ##pxm-FUNC PHD
 *     void init():             # <<<<<<<<<<<<<<
 *         speed_min, speed_max = settings['draw.speed_range']
 *         mirror_min, mirror_max = settings['draw.mirror_distance_range']
 */

void PreferencesDialog::init(void) {
  PyObject *__pyx_v_speed_min = NULL;
  PyObject *__pyx_v_speed_max = NULL;
  PyObject *__pyx_v_mirror_min = NULL;
  PyObject *__pyx_v_mirror_max = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("init", 0);

  /* "_qt_qtwes2.pyx":1509
 *     ##pxm-FUNC PHD
 *     void init():
 *         speed_min, speed_max = settings['draw.speed_range']             # <<<<<<<<<<<<<<
 *         mirror_min, mirror_max = settings['draw.mirror_distance_range']
 *         this.liststore_movekeys = new QStandardItemModel(<QObject*>this) #px/
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_speed_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1509, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1509, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1509, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_speed_min = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_speed_max = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1510
 *     void init():
 *         speed_min, speed_max = settings['draw.speed_range']
 *         mirror_min, mirror_max = settings['draw.mirror_distance_range']             # <<<<<<<<<<<<<<
 *         this.liststore_movekeys = new QStandardItemModel(<QObject*>this) #px/
 *         #this.liststore_movekeys = QStandardItemModel(this)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_draw_mirror_distance_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1510, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1510, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1510, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_mirror_min = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_mirror_max = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1511
 *         speed_min, speed_max = settings['draw.speed_range']
 *         mirror_min, mirror_max = settings['draw.mirror_distance_range']
 *         this.liststore_movekeys = new QStandardItemModel(<QObject*>this) #px/             # <<<<<<<<<<<<<<
 *         #this.liststore_movekeys = QStandardItemModel(this)
 *         qtui.setupUi_pref(this,
 */
  this->liststore_movekeys = new QStandardItemModel(((QObject *)this));

  /* "_qt_qtwes2.pyx":1514
 *         #this.liststore_movekeys = QStandardItemModel(this)
 *         qtui.setupUi_pref(this,
 *                 settings['draw.speed'], speed_min, speed_max,             # <<<<<<<<<<<<<<
 *                 mirror_min, mirror_max, this.liststore_movekeys)
 * ##pxh>
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_kp_u_draw_speed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_speed_min); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_speed_max); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1515
 *         qtui.setupUi_pref(this,
 *                 settings['draw.speed'], speed_min, speed_max,
 *                 mirror_min, mirror_max, this.liststore_movekeys)             # <<<<<<<<<<<<<<
 * ##pxh>
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_mirror_min); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1515, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_mirror_max); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1515, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1513
 *         this.liststore_movekeys = new QStandardItemModel(<QObject*>this) #px/
 *         #this.liststore_movekeys = QStandardItemModel(this)
 *         qtui.setupUi_pref(this,             # <<<<<<<<<<<<<<
 *                 settings['draw.speed'], speed_min, speed_max,
 *                 mirror_min, mirror_max, this.liststore_movekeys)
 */
  __pyx_f_6_qtui__setupUi_pref(this, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, this->liststore_movekeys);

  /* "_qt_qtwes2.pyx":1508
 *         ##pxh> : QDialog(parent), liststore_blocked(false) {}
 *     ##pxm-FUNC PHD
 *     void init():             # <<<<<<<<<<<<<<
 *         speed_min, speed_max = settings['draw.speed_range']
 *         mirror_min, mirror_max = settings['draw.mirror_distance_range']
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("PreferencesDialog.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_speed_min);
  __Pyx_XDECREF(__pyx_v_speed_max);
  __Pyx_XDECREF(__pyx_v_mirror_min);
  __Pyx_XDECREF(__pyx_v_mirror_max);
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":1518
 * ##pxh>
 *     ##pxm-FUNC PH with gil
 *     void on_slider_animspeed_valueChanged(int value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.speed'] = value
 *     ##pxm-FUNC PH with gil
 */

void PreferencesDialog::on_slider_animspeed_valueChanged(int __pyx_v_value) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_slider_animspeed_valueChanged", 0);

  /* "_qt_qtwes2.pyx":1519
 *     ##pxm-FUNC PH with gil
 *     void on_slider_animspeed_valueChanged(int value) with gil:
 *         settings['draw.speed'] = value             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_animspeed_reset_clicked() with gil:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_speed, __pyx_t_1) < 0)) __PYX_ERR(0, 1519, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1518
 * ##pxh>
 *     ##pxm-FUNC PH with gil
 *     void on_slider_animspeed_valueChanged(int value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.speed'] = value
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_slider_animspeed_valueChanged", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1521
 *         settings['draw.speed'] = value
 *     ##pxm-FUNC PH with gil
 *     void on_button_animspeed_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('slider_animspeed')).setProperty(b'value', tovariant(settings['draw.speed_default']))
 *         del settings['draw.speed']
 */

void PreferencesDialog::on_button_animspeed_reset_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_animspeed_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1522
 *     ##pxm-FUNC PH with gil
 *     void on_button_animspeed_reset_clicked() with gil:
 *         this.findChild(str2q('slider_animspeed')).setProperty(b'value', tovariant(settings['draw.speed_default']))             # <<<<<<<<<<<<<<
 *         del settings['draw.speed']
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_speed_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  this->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_slider_animspeed))->setProperty(((char const *)"value"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1523
 *     void on_button_animspeed_reset_clicked() with gil:
 *         this.findChild(str2q('slider_animspeed')).setProperty(b'value', tovariant(settings['draw.speed_default']))
 *         del settings['draw.speed']             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_shader_currentIndexChanged(int value) with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_kp_u_draw_speed) < 0)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1521
 *         settings['draw.speed'] = value
 *     ##pxm-FUNC PH with gil
 *     void on_button_animspeed_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('slider_animspeed')).setProperty(b'value', tovariant(settings['draw.speed_default']))
 *         del settings['draw.speed']
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_animspeed_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1525
 *         del settings['draw.speed']
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_shader_currentIndexChanged(int value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.shader'] = value
 *     ##pxm-FUNC PH with gil
 */

void PreferencesDialog::on_combobox_shader_currentIndexChanged(int __pyx_v_value) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_combobox_shader_currentIndexChanged", 0);

  /* "_qt_qtwes2.pyx":1526
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_shader_currentIndexChanged(int value) with gil:
 *         settings['draw.shader'] = value             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_shader_reset_clicked() with gil:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_shader, __pyx_t_1) < 0)) __PYX_ERR(0, 1526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1525
 *         del settings['draw.speed']
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_shader_currentIndexChanged(int value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.shader'] = value
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_combobox_shader_currentIndexChanged", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1528
 *         settings['draw.shader'] = value
 *     ##pxm-FUNC PH with gil
 *     void on_button_shader_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader_default']))
 *         del settings['draw.shader']
 */

void PreferencesDialog::on_button_shader_reset_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_shader_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1529
 *     ##pxm-FUNC PH with gil
 *     void on_button_shader_reset_clicked() with gil:
 *         this.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader_default']))             # <<<<<<<<<<<<<<
 *         del settings['draw.shader']
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_shader_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  this->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_combobox_shader))->setProperty(((char const *)"currentIndex"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1530
 *     void on_button_shader_reset_clicked() with gil:
 *         this.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader_default']))
 *         del settings['draw.shader']             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_samples_currentIndexChanged(int value) with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_kp_u_draw_shader) < 0)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1528
 *         settings['draw.shader'] = value
 *     ##pxm-FUNC PH with gil
 *     void on_button_shader_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader_default']))
 *         del settings['draw.shader']
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_shader_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1532
 *         del settings['draw.shader']
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_samples_currentIndexChanged(int value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.samples'] = value
 *         #visible = (this.sample_buffers != 2**settings['draw.samples'])
 */

void PreferencesDialog::on_combobox_samples_currentIndexChanged(int __pyx_v_value) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_combobox_samples_currentIndexChanged", 0);

  /* "_qt_qtwes2.pyx":1533
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_samples_currentIndexChanged(int value) with gil:
 *         settings['draw.samples'] = value             # <<<<<<<<<<<<<<
 *         #visible = (this.sample_buffers != 2**settings['draw.samples'])
 *         this.findChild(str2q('label_needs_restarted')).setProperty(b'visible', tovariant(True))
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_samples, __pyx_t_1) < 0)) __PYX_ERR(0, 1533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1535
 *         settings['draw.samples'] = value
 *         #visible = (this.sample_buffers != 2**settings['draw.samples'])
 *         this.findChild(str2q('label_needs_restarted')).setProperty(b'visible', tovariant(True))             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_antialiasing_reset_clicked() with gil:
 */
  this->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_label_needs_restarted))->setProperty(((char const *)"visible"), __pyx_f_10_qt_qtwes2_tovariant(Py_True));

  /* "_qt_qtwes2.pyx":1532
 *         del settings['draw.shader']
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_samples_currentIndexChanged(int value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.samples'] = value
 *         #visible = (this.sample_buffers != 2**settings['draw.samples'])
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_combobox_samples_currentIndexChanged", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1537
 *         this.findChild(str2q('label_needs_restarted')).setProperty(b'visible', tovariant(True))
 *     ##pxm-FUNC PH with gil
 *     void on_button_antialiasing_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples_default']))
 *         del settings['draw.samples']
 */

void PreferencesDialog::on_button_antialiasing_reset_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_antialiasing_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1538
 *     ##pxm-FUNC PH with gil
 *     void on_button_antialiasing_reset_clicked() with gil:
 *         this.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples_default']))             # <<<<<<<<<<<<<<
 *         del settings['draw.samples']
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_samples_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  this->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_combobox_samples))->setProperty(((char const *)"currentIndex"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1539
 *     void on_button_antialiasing_reset_clicked() with gil:
 *         this.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples_default']))
 *         del settings['draw.samples']             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_checkbox_mirror_faces_toggled(cbool checked) with gil:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_kp_u_draw_samples) < 0)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1537
 *         this.findChild(str2q('label_needs_restarted')).setProperty(b'visible', tovariant(True))
 *     ##pxm-FUNC PH with gil
 *     void on_button_antialiasing_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples_default']))
 *         del settings['draw.samples']
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_antialiasing_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1541
 *         del settings['draw.samples']
 *     ##pxm-FUNC PH with gil
 *     void on_checkbox_mirror_faces_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('spinbox_mirror_faces')).setProperty(b'enabled', tovariant(checked))
 *         settings['draw.mirror_faces'] = checked
 */

void PreferencesDialog::on_checkbox_mirror_faces_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_checkbox_mirror_faces_toggled", 0);

  /* "_qt_qtwes2.pyx":1542
 *     ##pxm-FUNC PH with gil
 *     void on_checkbox_mirror_faces_toggled(cbool checked) with gil:
 *         uidata.preferences.findChild(str2q('spinbox_mirror_faces')).setProperty(b'enabled', tovariant(checked))             # <<<<<<<<<<<<<<
 *         settings['draw.mirror_faces'] = checked
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_checked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_spinbox_mirror_faces))->setProperty(((char const *)"enabled"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1543
 *     void on_checkbox_mirror_faces_toggled(cbool checked) with gil:
 *         uidata.preferences.findChild(str2q('spinbox_mirror_faces')).setProperty(b'enabled', tovariant(checked))
 *         settings['draw.mirror_faces'] = checked             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_spinbox_mirror_faces_valueChanged(double value) with gil:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_checked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_mirror_faces, __pyx_t_1) < 0)) __PYX_ERR(0, 1543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1541
 *         del settings['draw.samples']
 *     ##pxm-FUNC PH with gil
 *     void on_checkbox_mirror_faces_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('spinbox_mirror_faces')).setProperty(b'enabled', tovariant(checked))
 *         settings['draw.mirror_faces'] = checked
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_checkbox_mirror_faces_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1545
 *         settings['draw.mirror_faces'] = checked
 *     ##pxm-FUNC PH with gil
 *     void on_spinbox_mirror_faces_valueChanged(double value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.mirror_distance'] = value
 *     ##pxm-FUNC PH with gil
 */

void PreferencesDialog::on_spinbox_mirror_faces_valueChanged(double __pyx_v_value) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_spinbox_mirror_faces_valueChanged", 0);

  /* "_qt_qtwes2.pyx":1546
 *     ##pxm-FUNC PH with gil
 *     void on_spinbox_mirror_faces_valueChanged(double value) with gil:
 *         settings['draw.mirror_distance'] = value             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_mirror_faces_reset_clicked() with gil:
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_mirror_distance, __pyx_t_1) < 0)) __PYX_ERR(0, 1546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1545
 *         settings['draw.mirror_faces'] = checked
 *     ##pxm-FUNC PH with gil
 *     void on_spinbox_mirror_faces_valueChanged(double value) with gil:             # <<<<<<<<<<<<<<
 *         settings['draw.mirror_distance'] = value
 *     ##pxm-FUNC PH with gil
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_spinbox_mirror_faces_valueChanged", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1548
 *         settings['draw.mirror_distance'] = value
 *     ##pxm-FUNC PH with gil
 *     void on_button_mirror_faces_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces_default']))
 *         del settings['draw.mirror_faces']
 */

void PreferencesDialog::on_button_mirror_faces_reset_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_mirror_faces_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1549
 *     ##pxm-FUNC PH with gil
 *     void on_button_mirror_faces_reset_clicked() with gil:
 *         this.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces_default']))             # <<<<<<<<<<<<<<
 *         del settings['draw.mirror_faces']
 *         this.findChild(str2q('spinbox_mirror_faces')).setProperty(b'value', tovariant(settings['draw.mirror_distance_default']))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_mirror_faces_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  this->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_checkbox_mirror_faces))->setProperty(((char const *)"checked"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1550
 *     void on_button_mirror_faces_reset_clicked() with gil:
 *         this.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces_default']))
 *         del settings['draw.mirror_faces']             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('spinbox_mirror_faces')).setProperty(b'value', tovariant(settings['draw.mirror_distance_default']))
 *         del settings['draw.mirror_distance']
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_DelItem(__pyx_t_2, __pyx_kp_u_draw_mirror_faces) < 0)) __PYX_ERR(0, 1550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1551
 *         this.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces_default']))
 *         del settings['draw.mirror_faces']
 *         this.findChild(str2q('spinbox_mirror_faces')).setProperty(b'value', tovariant(settings['draw.mirror_distance_default']))             # <<<<<<<<<<<<<<
 *         del settings['draw.mirror_distance']
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_draw_mirror_distance_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  this->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_spinbox_mirror_faces))->setProperty(((char const *)"value"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1552
 *         del settings['draw.mirror_faces']
 *         this.findChild(str2q('spinbox_mirror_faces')).setProperty(b'value', tovariant(settings['draw.mirror_distance_default']))
 *         del settings['draw.mirror_distance']             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_quad_toggled(cbool checked) with gil:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_kp_u_draw_mirror_distance) < 0)) __PYX_ERR(0, 1552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1548
 *         settings['draw.mirror_distance'] = value
 *     ##pxm-FUNC PH with gil
 *     void on_button_mirror_faces_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces_default']))
 *         del settings['draw.mirror_faces']
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_mirror_faces_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1554
 *         del settings['draw.mirror_distance']
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_quad_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['draw.selection_nick'] = 'quadrant'
 */

void PreferencesDialog::on_button_mousemode_quad_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_mousemode_quad_toggled", 0);

  /* "_qt_qtwes2.pyx":1555
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_quad_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['draw.selection_nick'] = 'quadrant'
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = (__pyx_v_checked != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1556
 *     void on_button_mousemode_quad_toggled(cbool checked) with gil:
 *         if checked:
 *             settings['draw.selection_nick'] = 'quadrant'             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_ext_toggled(cbool checked) with gil:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_selection_nick, __pyx_n_u_quadrant) < 0)) __PYX_ERR(0, 1556, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1555
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_quad_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['draw.selection_nick'] = 'quadrant'
 *     ##pxm-FUNC PH with gil
 */
  }

  /* "_qt_qtwes2.pyx":1554
 *         del settings['draw.mirror_distance']
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_quad_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['draw.selection_nick'] = 'quadrant'
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_mousemode_quad_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1558
 *             settings['draw.selection_nick'] = 'quadrant'
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_ext_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['draw.selection_nick'] = 'simple'
 */

void PreferencesDialog::on_button_mousemode_ext_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_mousemode_ext_toggled", 0);

  /* "_qt_qtwes2.pyx":1559
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_ext_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['draw.selection_nick'] = 'simple'
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = (__pyx_v_checked != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1560
 *     void on_button_mousemode_ext_toggled(cbool checked) with gil:
 *         if checked:
 *             settings['draw.selection_nick'] = 'simple'             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_gesture_toggled(cbool checked) with gil:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_selection_nick, __pyx_n_u_simple) < 0)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1559
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_ext_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['draw.selection_nick'] = 'simple'
 *     ##pxm-FUNC PH with gil
 */
  }

  /* "_qt_qtwes2.pyx":1558
 *             settings['draw.selection_nick'] = 'quadrant'
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_ext_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['draw.selection_nick'] = 'simple'
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_mousemode_ext_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1562
 *             settings['draw.selection_nick'] = 'simple'
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_gesture_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['draw.selection_nick'] = 'gesture'
 */

void PreferencesDialog::on_button_mousemode_gesture_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_mousemode_gesture_toggled", 0);

  /* "_qt_qtwes2.pyx":1563
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_gesture_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['draw.selection_nick'] = 'gesture'
 * 
 */
  __pyx_t_1 = (__pyx_v_checked != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1564
 *     void on_button_mousemode_gesture_toggled(cbool checked) with gil:
 *         if checked:
 *             settings['draw.selection_nick'] = 'gesture'             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PHD
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_selection_nick, __pyx_n_u_gesture) < 0)) __PYX_ERR(0, 1564, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1563
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_gesture_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['draw.selection_nick'] = 'gesture'
 * 
 */
  }

  /* "_qt_qtwes2.pyx":1562
 *             settings['draw.selection_nick'] = 'simple'
 *     ##pxm-FUNC PH with gil
 *     void on_button_mousemode_gesture_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['draw.selection_nick'] = 'gesture'
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_mousemode_gesture_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1567
 * 
 *     ##pxm-FUNC PHD
 *     void fill_move_key_list():             # <<<<<<<<<<<<<<
 *         this.liststore_blocked = True
 *         cdef QStandardItem *item #px+
 */

void PreferencesDialog::fill_move_key_list(void) {
  QStandardItem *__pyx_v_item;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_move = NULL;
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("fill_move_key_list", 0);

  /* "_qt_qtwes2.pyx":1568
 *     ##pxm-FUNC PHD
 *     void fill_move_key_list():
 *         this.liststore_blocked = True             # <<<<<<<<<<<<<<
 *         cdef QStandardItem *item #px+
 *         for i, (move, key) in enumerate(settings['draw.accels']):
 */
  this->liststore_blocked = 1;

  /* "_qt_qtwes2.pyx":1570
 *         this.liststore_blocked = True
 *         cdef QStandardItem *item #px+
 *         for i, (move, key) in enumerate(settings['draw.accels']):             # <<<<<<<<<<<<<<
 *             item = new QStandardItem(str2q(move)) #px/
 *             #item = QStandardItem(str2q(move))
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_draw_accels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1570, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1570, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1570, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1570, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1570, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1570, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_move, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_qt_qtwes2.pyx":1571
 *         cdef QStandardItem *item #px+
 *         for i, (move, key) in enumerate(settings['draw.accels']):
 *             item = new QStandardItem(str2q(move)) #px/             # <<<<<<<<<<<<<<
 *             #item = QStandardItem(str2q(move))
 *             this.liststore_movekeys.setItem(i, 0, item)
 */
    __pyx_v_item = new QStandardItem(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_move));

    /* "_qt_qtwes2.pyx":1573
 *             item = new QStandardItem(str2q(move)) #px/
 *             #item = QStandardItem(str2q(move))
 *             this.liststore_movekeys.setItem(i, 0, item)             # <<<<<<<<<<<<<<
 *             item = new QStandardItem(str2q(key)) #px/
 *             #item = QStandardItem(str2q(key))
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1573, __pyx_L1_error)
    this->liststore_movekeys->setItem(__pyx_t_10, 0, __pyx_v_item);

    /* "_qt_qtwes2.pyx":1574
 *             #item = QStandardItem(str2q(move))
 *             this.liststore_movekeys.setItem(i, 0, item)
 *             item = new QStandardItem(str2q(key)) #px/             # <<<<<<<<<<<<<<
 *             #item = QStandardItem(str2q(key))
 *             this.liststore_movekeys.setItem(i, 1, item)
 */
    __pyx_v_item = new QStandardItem(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_key));

    /* "_qt_qtwes2.pyx":1576
 *             item = new QStandardItem(str2q(key)) #px/
 *             #item = QStandardItem(str2q(key))
 *             this.liststore_movekeys.setItem(i, 1, item)             # <<<<<<<<<<<<<<
 *         item = new QStandardItem(str2q(_('Move'))) #px/
 *         #item = QStandardItem(str2q(_('Move')))
 */
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1576, __pyx_L1_error)
    this->liststore_movekeys->setItem(__pyx_t_10, 1, __pyx_v_item);

    /* "_qt_qtwes2.pyx":1570
 *         this.liststore_blocked = True
 *         cdef QStandardItem *item #px+
 *         for i, (move, key) in enumerate(settings['draw.accels']):             # <<<<<<<<<<<<<<
 *             item = new QStandardItem(str2q(move)) #px/
 *             #item = QStandardItem(str2q(move))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1577
 *             #item = QStandardItem(str2q(key))
 *             this.liststore_movekeys.setItem(i, 1, item)
 *         item = new QStandardItem(str2q(_('Move'))) #px/             # <<<<<<<<<<<<<<
 *         #item = QStandardItem(str2q(_('Move')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(0, item)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_item = new QStandardItem(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1579
 *         item = new QStandardItem(str2q(_('Move'))) #px/
 *         #item = QStandardItem(str2q(_('Move')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(0, item)             # <<<<<<<<<<<<<<
 *         item = new QStandardItem(str2q(_('Key'))) #px/
 *         #item = QStandardItem(str2q(_('Key')))
 */
  this->liststore_movekeys->setHorizontalHeaderItem(0, __pyx_v_item);

  /* "_qt_qtwes2.pyx":1580
 *         #item = QStandardItem(str2q(_('Move')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(0, item)
 *         item = new QStandardItem(str2q(_('Key'))) #px/             # <<<<<<<<<<<<<<
 *         #item = QStandardItem(str2q(_('Key')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(1, item)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_item = new QStandardItem(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1582
 *         item = new QStandardItem(str2q(_('Key'))) #px/
 *         #item = QStandardItem(str2q(_('Key')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(1, item)             # <<<<<<<<<<<<<<
 *         this.liststore_blocked = False
 * 
 */
  this->liststore_movekeys->setHorizontalHeaderItem(1, __pyx_v_item);

  /* "_qt_qtwes2.pyx":1583
 *         #item = QStandardItem(str2q(_('Key')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(1, item)
 *         this.liststore_blocked = False             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PHD
 */
  this->liststore_blocked = 0;

  /* "_qt_qtwes2.pyx":1567
 * 
 *     ##pxm-FUNC PHD
 *     void fill_move_key_list():             # <<<<<<<<<<<<<<
 *         this.liststore_blocked = True
 *         cdef QStandardItem *item #px+
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("PreferencesDialog.fill_move_key_list", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_move);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":1586
 * 
 *     ##pxm-FUNC PHD
 *     object get_move_key_list():             # <<<<<<<<<<<<<<
 *         move_keys = []
 *         row_count = this.liststore_movekeys.rowCount()
 */

PyObject *PreferencesDialog::get_move_key_list(void) {
  PyObject *__pyx_v_move_keys = NULL;
  int __pyx_v_row_count;
  int __pyx_v_i;
  PyObject *__pyx_v_move = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("get_move_key_list", 0);

  /* "_qt_qtwes2.pyx":1587
 *     ##pxm-FUNC PHD
 *     object get_move_key_list():
 *         move_keys = []             # <<<<<<<<<<<<<<
 *         row_count = this.liststore_movekeys.rowCount()
 *         for i in range(row_count):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_move_keys = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1588
 *     object get_move_key_list():
 *         move_keys = []
 *         row_count = this.liststore_movekeys.rowCount()             # <<<<<<<<<<<<<<
 *         for i in range(row_count):
 *             move = fromvariant(this.liststore_movekeys.item(i, 0).data(Qt.DisplayRole))
 */
  __pyx_v_row_count = this->liststore_movekeys->rowCount();

  /* "_qt_qtwes2.pyx":1589
 *         move_keys = []
 *         row_count = this.liststore_movekeys.rowCount()
 *         for i in range(row_count):             # <<<<<<<<<<<<<<
 *             move = fromvariant(this.liststore_movekeys.item(i, 0).data(Qt.DisplayRole))
 *             key = fromvariant(this.liststore_movekeys.item(i, 1).data(Qt.DisplayRole))
 */
  __pyx_t_2 = __pyx_v_row_count;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "_qt_qtwes2.pyx":1590
 *         row_count = this.liststore_movekeys.rowCount()
 *         for i in range(row_count):
 *             move = fromvariant(this.liststore_movekeys.item(i, 0).data(Qt.DisplayRole))             # <<<<<<<<<<<<<<
 *             key = fromvariant(this.liststore_movekeys.item(i, 1).data(Qt.DisplayRole))
 *             move_keys.append((move, key))
 */
    __pyx_t_1 = __pyx_f_10_qt_qtwes2_fromvariant(this->liststore_movekeys->item(__pyx_v_i, 0)->data(Qt::DisplayRole)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_move, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1591
 *         for i in range(row_count):
 *             move = fromvariant(this.liststore_movekeys.item(i, 0).data(Qt.DisplayRole))
 *             key = fromvariant(this.liststore_movekeys.item(i, 1).data(Qt.DisplayRole))             # <<<<<<<<<<<<<<
 *             move_keys.append((move, key))
 *         return move_keys
 */
    __pyx_t_1 = __pyx_f_10_qt_qtwes2_fromvariant(this->liststore_movekeys->item(__pyx_v_i, 1)->data(Qt::DisplayRole)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1592
 *             move = fromvariant(this.liststore_movekeys.item(i, 0).data(Qt.DisplayRole))
 *             key = fromvariant(this.liststore_movekeys.item(i, 1).data(Qt.DisplayRole))
 *             move_keys.append((move, key))             # <<<<<<<<<<<<<<
 *         return move_keys
 * 
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_move);
    __Pyx_GIVEREF(__pyx_v_move);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_move);
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_key);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_move_keys, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 1592, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "_qt_qtwes2.pyx":1593
 *             key = fromvariant(this.liststore_movekeys.item(i, 1).data(Qt.DisplayRole))
 *             move_keys.append((move, key))
 *         return move_keys             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_move_keys);
  __pyx_r = __pyx_v_move_keys;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1586
 * 
 *     ##pxm-FUNC PHD
 *     object get_move_key_list():             # <<<<<<<<<<<<<<
 *         move_keys = []
 *         row_count = this.liststore_movekeys.rowCount()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("PreferencesDialog.get_move_key_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_move_keys);
  __Pyx_XDECREF(__pyx_v_move);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1596
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_liststore_movekeys_itemChanged(QStandardItem *unused_item) with gil:             # <<<<<<<<<<<<<<
 *         if this.liststore_blocked:  return
 *         settings['draw.accels'] = this.get_move_key_list()
 */

void PreferencesDialog::on_liststore_movekeys_itemChanged(CYTHON_UNUSED QStandardItem *__pyx_v_unused_item) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_liststore_movekeys_itemChanged", 0);

  /* "_qt_qtwes2.pyx":1597
 *     ##pxm-FUNC PH with gil
 *     void on_liststore_movekeys_itemChanged(QStandardItem *unused_item) with gil:
 *         if this.liststore_blocked:  return             # <<<<<<<<<<<<<<
 *         settings['draw.accels'] = this.get_move_key_list()
 * 
 */
  __pyx_t_1 = (this->liststore_blocked != 0);
  if (__pyx_t_1) {
    goto __pyx_L0;
  }

  /* "_qt_qtwes2.pyx":1598
 *     void on_liststore_movekeys_itemChanged(QStandardItem *unused_item) with gil:
 *         if this.liststore_blocked:  return
 *         settings['draw.accels'] = this.get_move_key_list()             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_2 = this->get_move_key_list(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_kp_u_draw_accels, __pyx_t_2) < 0)) __PYX_ERR(0, 1598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1596
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_liststore_movekeys_itemChanged(QStandardItem *unused_item) with gil:             # <<<<<<<<<<<<<<
 *         if this.liststore_blocked:  return
 *         settings['draw.accels'] = this.get_move_key_list()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("PreferencesDialog.on_liststore_movekeys_itemChanged", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1601
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_add_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.liststore_blocked = True
 *         qtui.add_movekey_row()
 */

void PreferencesDialog::on_button_movekey_add_clicked(void) {
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_movekey_add_clicked", 0);

  /* "_qt_qtwes2.pyx":1602
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_add_clicked() with gil:
 *         this.liststore_blocked = True             # <<<<<<<<<<<<<<
 *         qtui.add_movekey_row()
 *         this.liststore_blocked = False
 */
  this->liststore_blocked = 1;

  /* "_qt_qtwes2.pyx":1603
 *     void on_button_movekey_add_clicked() with gil:
 *         this.liststore_blocked = True
 *         qtui.add_movekey_row()             # <<<<<<<<<<<<<<
 *         this.liststore_blocked = False
 * 
 */
  __pyx_f_6_qtui__add_movekey_row();

  /* "_qt_qtwes2.pyx":1604
 *         this.liststore_blocked = True
 *         qtui.add_movekey_row()
 *         this.liststore_blocked = False             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  this->liststore_blocked = 0;

  /* "_qt_qtwes2.pyx":1601
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_add_clicked() with gil:             # <<<<<<<<<<<<<<
 *         this.liststore_blocked = True
 *         qtui.add_movekey_row()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1607
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_remove_clicked() with gil:             # <<<<<<<<<<<<<<
 *         qtui.remove_movekey_row()
 *         settings['draw.accels'] = this.get_move_key_list()
 */

void PreferencesDialog::on_button_movekey_remove_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_movekey_remove_clicked", 0);

  /* "_qt_qtwes2.pyx":1608
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_remove_clicked() with gil:
 *         qtui.remove_movekey_row()             # <<<<<<<<<<<<<<
 *         settings['draw.accels'] = this.get_move_key_list()
 * 
 */
  __pyx_f_6_qtui__remove_movekey_row();

  /* "_qt_qtwes2.pyx":1609
 *     void on_button_movekey_remove_clicked() with gil:
 *         qtui.remove_movekey_row()
 *         settings['draw.accels'] = this.get_move_key_list()             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = this->get_move_key_list(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_kp_u_draw_accels, __pyx_t_1) < 0)) __PYX_ERR(0, 1609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1607
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_remove_clicked() with gil:             # <<<<<<<<<<<<<<
 *         qtui.remove_movekey_row()
 *         settings['draw.accels'] = this.get_move_key_list()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_movekey_remove_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1612
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         del settings['draw.accels']
 *         this.fill_move_key_list()
 */

void PreferencesDialog::on_button_movekey_reset_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_movekey_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1613
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_reset_clicked() with gil:
 *         del settings['draw.accels']             # <<<<<<<<<<<<<<
 *         this.fill_move_key_list()
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_kp_u_draw_accels) < 0)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1614
 *     void on_button_movekey_reset_clicked() with gil:
 *         del settings['draw.accels']
 *         this.fill_move_key_list()             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  this->fill_move_key_list();

  /* "_qt_qtwes2.pyx":1612
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_movekey_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         del settings['draw.accels']
 *         this.fill_move_key_list()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_movekey_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1617
 * 
 *     ##pxm-FUNC PH with gil
 *     void _on_listview_faces_currentRowChanged(const QModelIndex &current) with gil:             # <<<<<<<<<<<<<<
 *         this.current_facekey = qtui.get_liststore_faces_facekey(current)
 *         pydata.app.on_dialog_change_current_face(q2str(this.current_facekey))
 */

void PreferencesDialog::_on_listview_faces_currentRowChanged(QModelIndex const &__pyx_v_current) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_listview_faces_currentRowChanged", 0);

  /* "_qt_qtwes2.pyx":1618
 *     ##pxm-FUNC PH with gil
 *     void _on_listview_faces_currentRowChanged(const QModelIndex &current) with gil:
 *         this.current_facekey = qtui.get_liststore_faces_facekey(current)             # <<<<<<<<<<<<<<
 *         pydata.app.on_dialog_change_current_face(q2str(this.current_facekey))
 * 
 */
  this->current_facekey = __pyx_f_6_qtui__get_liststore_faces_facekey(__pyx_v_current);

  /* "_qt_qtwes2.pyx":1619
 *     void _on_listview_faces_currentRowChanged(const QModelIndex &current) with gil:
 *         this.current_facekey = qtui.get_liststore_faces_facekey(current)
 *         pydata.app.on_dialog_change_current_face(q2str(this.current_facekey))             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_dialog_change_current_face); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(this->current_facekey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1619, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1617
 * 
 *     ##pxm-FUNC PH with gil
 *     void _on_listview_faces_currentRowChanged(const QModelIndex &current) with gil:             # <<<<<<<<<<<<<<
 *         this.current_facekey = qtui.get_liststore_faces_facekey(current)
 *         pydata.app.on_dialog_change_current_face(q2str(this.current_facekey))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("PreferencesDialog._on_listview_faces_currentRowChanged", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1622
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_color_clicked() with gil:             # <<<<<<<<<<<<<<
 *         cdef QString color #px+
 *         current_facekey = q2str(this.current_facekey)
 */

void PreferencesDialog::on_button_color_clicked(void) {
  QString __pyx_v_color;
  PyObject *__pyx_v_current_facekey = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_color_clicked", 0);

  /* "_qt_qtwes2.pyx":1624
 *     void on_button_color_clicked() with gil:
 *         cdef QString color #px+
 *         current_facekey = q2str(this.current_facekey)             # <<<<<<<<<<<<<<
 *         color = str2q(settings['theme.faces',current_facekey,'color'])
 *         color = qtui.color_dialog(this, color)
 */
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_q2str(this->current_facekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_current_facekey = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1625
 *         cdef QString color #px+
 *         current_facekey = q2str(this.current_facekey)
 *         color = str2q(settings['theme.faces',current_facekey,'color'])             # <<<<<<<<<<<<<<
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_kp_u_theme_faces);
  __Pyx_GIVEREF(__pyx_kp_u_theme_faces);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_theme_faces);
  __Pyx_INCREF(__pyx_v_current_facekey);
  __Pyx_GIVEREF(__pyx_v_current_facekey);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_current_facekey);
  __Pyx_INCREF(__pyx_n_u_color);
  __Pyx_GIVEREF(__pyx_n_u_color);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_color);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_color = __pyx_f_10_qt_qtwes2_str2q(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1626
 *         current_facekey = q2str(this.current_facekey)
 *         color = str2q(settings['theme.faces',current_facekey,'color'])
 *         color = qtui.color_dialog(this, color)             # <<<<<<<<<<<<<<
 *         if q2str(color):
 *             qtui.set_button_color(color)
 */
  __pyx_v_color = __pyx_f_6_qtui__color_dialog(this, __pyx_v_color);

  /* "_qt_qtwes2.pyx":1627
 *         color = str2q(settings['theme.faces',current_facekey,'color'])
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):             # <<<<<<<<<<<<<<
 *             qtui.set_button_color(color)
 *             settings['theme.faces',current_facekey,'color'] = q2str(color)
 */
  __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":1628
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):
 *             qtui.set_button_color(color)             # <<<<<<<<<<<<<<
 *             settings['theme.faces',current_facekey,'color'] = q2str(color)
 * 
 */
    __pyx_f_6_qtui__set_button_color(__pyx_v_color);

    /* "_qt_qtwes2.pyx":1629
 *         if q2str(color):
 *             qtui.set_button_color(color)
 *             settings['theme.faces',current_facekey,'color'] = q2str(color)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
    __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_kp_u_theme_faces);
    __Pyx_GIVEREF(__pyx_kp_u_theme_faces);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_theme_faces);
    __Pyx_INCREF(__pyx_v_current_facekey);
    __Pyx_GIVEREF(__pyx_v_current_facekey);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_current_facekey);
    __Pyx_INCREF(__pyx_n_u_color);
    __Pyx_GIVEREF(__pyx_n_u_color);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_color);
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_t_3) < 0)) __PYX_ERR(0, 1629, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_qt_qtwes2.pyx":1627
 *         color = str2q(settings['theme.faces',current_facekey,'color'])
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):             # <<<<<<<<<<<<<<
 *             qtui.set_button_color(color)
 *             settings['theme.faces',current_facekey,'color'] = q2str(color)
 */
  }

  /* "_qt_qtwes2.pyx":1622
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_color_clicked() with gil:             # <<<<<<<<<<<<<<
 *         cdef QString color #px+
 *         current_facekey = q2str(this.current_facekey)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_color_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current_facekey);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1632
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_color_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         current_facekey = q2str(this.current_facekey)
 *         del settings['theme.faces',current_facekey,'color']
 */

void PreferencesDialog::on_button_color_reset_clicked(void) {
  PyObject *__pyx_v_current_facekey = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_color_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1633
 *     ##pxm-FUNC PH with gil
 *     void on_button_color_reset_clicked() with gil:
 *         current_facekey = q2str(this.current_facekey)             # <<<<<<<<<<<<<<
 *         del settings['theme.faces',current_facekey,'color']
 *         qtui.set_button_color(str2q(settings['theme.faces',current_facekey,'color']))
 */
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_q2str(this->current_facekey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_current_facekey = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1634
 *     void on_button_color_reset_clicked() with gil:
 *         current_facekey = q2str(this.current_facekey)
 *         del settings['theme.faces',current_facekey,'color']             # <<<<<<<<<<<<<<
 *         qtui.set_button_color(str2q(settings['theme.faces',current_facekey,'color']))
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_kp_u_theme_faces);
  __Pyx_GIVEREF(__pyx_kp_u_theme_faces);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_theme_faces);
  __Pyx_INCREF(__pyx_v_current_facekey);
  __Pyx_GIVEREF(__pyx_v_current_facekey);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_current_facekey);
  __Pyx_INCREF(__pyx_n_u_color);
  __Pyx_GIVEREF(__pyx_n_u_color);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_color);
  if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_t_2) < 0)) __PYX_ERR(0, 1634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1635
 *         current_facekey = q2str(this.current_facekey)
 *         del settings['theme.faces',current_facekey,'color']
 *         qtui.set_button_color(str2q(settings['theme.faces',current_facekey,'color']))             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_kp_u_theme_faces);
  __Pyx_GIVEREF(__pyx_kp_u_theme_faces);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_theme_faces);
  __Pyx_INCREF(__pyx_v_current_facekey);
  __Pyx_GIVEREF(__pyx_v_current_facekey);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_current_facekey);
  __Pyx_INCREF(__pyx_n_u_color);
  __Pyx_GIVEREF(__pyx_n_u_color);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_color);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_f_6_qtui__set_button_color(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_3));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1632
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_color_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         current_facekey = q2str(this.current_facekey)
 *         del settings['theme.faces',current_facekey,'color']
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_color_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current_facekey);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1638
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_image_activated(int index) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_dialog_change_current_image(q2str(this.current_facekey), index)
 * 
 */

void PreferencesDialog::on_combobox_image_activated(int __pyx_v_index) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_combobox_image_activated", 0);

  /* "_qt_qtwes2.pyx":1639
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_image_activated(int index) with gil:
 *         pydata.app.on_dialog_change_current_image(q2str(this.current_facekey), index)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_dialog_change_current_image); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(this->current_facekey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1638
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_combobox_image_activated(int index) with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_dialog_change_current_image(q2str(this.current_facekey), index)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("PreferencesDialog.on_combobox_image_activated", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1642
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_image_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_dialog_reset_current_image(q2str(this.current_facekey))
 * 
 */

void PreferencesDialog::on_button_image_reset_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_image_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1643
 *     ##pxm-FUNC PH with gil
 *     void on_button_image_reset_clicked() with gil:
 *         pydata.app.on_dialog_reset_current_image(q2str(this.current_facekey))             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_dialog_reset_current_image); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(this->current_facekey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1642
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_image_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         pydata.app.on_dialog_reset_current_image(q2str(this.current_facekey))
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_image_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1646
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_tiled_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'tiled'
 */

void PreferencesDialog::on_radiobutton_tiled_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_radiobutton_tiled_toggled", 0);

  /* "_qt_qtwes2.pyx":1647
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_tiled_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'tiled'
 *     ##pxm-FUNC PH with gil
 */
  __pyx_t_1 = (__pyx_v_checked != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1648
 *     void on_radiobutton_tiled_toggled(cbool checked) with gil:
 *         if checked:
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'tiled'             # <<<<<<<<<<<<<<
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_mosaic_toggled(cbool checked) with gil:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(this->current_facekey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_kp_u_theme_faces);
    __Pyx_GIVEREF(__pyx_kp_u_theme_faces);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_theme_faces);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __Pyx_INCREF(__pyx_n_u_mode_nick);
    __Pyx_GIVEREF(__pyx_n_u_mode_nick);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_n_u_mode_nick);
    __pyx_t_3 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_4, __pyx_n_u_tiled) < 0)) __PYX_ERR(0, 1648, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_qt_qtwes2.pyx":1647
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_tiled_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'tiled'
 *     ##pxm-FUNC PH with gil
 */
  }

  /* "_qt_qtwes2.pyx":1646
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_tiled_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'tiled'
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("PreferencesDialog.on_radiobutton_tiled_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1650
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'tiled'
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_mosaic_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'mosaic'
 */

void PreferencesDialog::on_radiobutton_mosaic_toggled(bool __pyx_v_checked) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_radiobutton_mosaic_toggled", 0);

  /* "_qt_qtwes2.pyx":1651
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_mosaic_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'mosaic'
 * 
 */
  __pyx_t_1 = (__pyx_v_checked != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1652
 *     void on_radiobutton_mosaic_toggled(cbool checked) with gil:
 *         if checked:
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'mosaic'             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_f_10_qt_qtwes2_q2str(this->current_facekey); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_kp_u_theme_faces);
    __Pyx_GIVEREF(__pyx_kp_u_theme_faces);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_theme_faces);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
    __Pyx_INCREF(__pyx_n_u_mode_nick);
    __Pyx_GIVEREF(__pyx_n_u_mode_nick);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_n_u_mode_nick);
    __pyx_t_3 = 0;
    if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_4, __pyx_n_u_mosaic) < 0)) __PYX_ERR(0, 1652, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_qt_qtwes2.pyx":1651
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_mosaic_toggled(cbool checked) with gil:
 *         if checked:             # <<<<<<<<<<<<<<
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'mosaic'
 * 
 */
  }

  /* "_qt_qtwes2.pyx":1650
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'tiled'
 *     ##pxm-FUNC PH with gil
 *     void on_radiobutton_mosaic_toggled(cbool checked) with gil:             # <<<<<<<<<<<<<<
 *         if checked:
 *             settings['theme.faces',q2str(this.current_facekey),'mode_nick'] = 'mosaic'
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("PreferencesDialog.on_radiobutton_mosaic_toggled", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1655
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_background_color_clicked() with gil:             # <<<<<<<<<<<<<<
 *         cdef QString color #px+
 *         color = str2q(settings['theme.bgcolor'])
 */

void PreferencesDialog::on_button_background_color_clicked(void) {
  QString __pyx_v_color;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_background_color_clicked", 0);

  /* "_qt_qtwes2.pyx":1657
 *     void on_button_background_color_clicked() with gil:
 *         cdef QString color #px+
 *         color = str2q(settings['theme.bgcolor'])             # <<<<<<<<<<<<<<
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_theme_bgcolor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_color = __pyx_f_10_qt_qtwes2_str2q(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1658
 *         cdef QString color #px+
 *         color = str2q(settings['theme.bgcolor'])
 *         color = qtui.color_dialog(this, color)             # <<<<<<<<<<<<<<
 *         if q2str(color):
 *             qtui.set_button_background_color(color)
 */
  __pyx_v_color = __pyx_f_6_qtui__color_dialog(this, __pyx_v_color);

  /* "_qt_qtwes2.pyx":1659
 *         color = str2q(settings['theme.bgcolor'])
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):             # <<<<<<<<<<<<<<
 *             qtui.set_button_background_color(color)
 *             settings['theme.bgcolor'] = q2str(color)
 */
  __pyx_t_2 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1659, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "_qt_qtwes2.pyx":1660
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):
 *             qtui.set_button_background_color(color)             # <<<<<<<<<<<<<<
 *             settings['theme.bgcolor'] = q2str(color)
 * 
 */
    __pyx_f_6_qtui__set_button_background_color(__pyx_v_color);

    /* "_qt_qtwes2.pyx":1661
 *         if q2str(color):
 *             qtui.set_button_background_color(color)
 *             settings['theme.bgcolor'] = q2str(color)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
    __pyx_t_2 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_color); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_kp_u_theme_bgcolor, __pyx_t_2) < 0)) __PYX_ERR(0, 1661, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1659
 *         color = str2q(settings['theme.bgcolor'])
 *         color = qtui.color_dialog(this, color)
 *         if q2str(color):             # <<<<<<<<<<<<<<
 *             qtui.set_button_background_color(color)
 *             settings['theme.bgcolor'] = q2str(color)
 */
  }

  /* "_qt_qtwes2.pyx":1655
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_background_color_clicked() with gil:             # <<<<<<<<<<<<<<
 *         cdef QString color #px+
 *         color = str2q(settings['theme.bgcolor'])
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_background_color_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1664
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_background_color_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         del settings['theme.bgcolor']
 *         qtui.set_button_background_color(str2q(settings['theme.bgcolor']))
 */

void PreferencesDialog::on_button_background_color_reset_clicked(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_button_background_color_reset_clicked", 0);

  /* "_qt_qtwes2.pyx":1665
 *     ##pxm-FUNC PH with gil
 *     void on_button_background_color_reset_clicked() with gil:
 *         del settings['theme.bgcolor']             # <<<<<<<<<<<<<<
 *         qtui.set_button_background_color(str2q(settings['theme.bgcolor']))
 * ##pxm>CPPCLASS_END
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyObject_DelItem(__pyx_t_1, __pyx_kp_u_theme_bgcolor) < 0)) __PYX_ERR(0, 1665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1666
 *     void on_button_background_color_reset_clicked() with gil:
 *         del settings['theme.bgcolor']
 *         qtui.set_button_background_color(str2q(settings['theme.bgcolor']))             # <<<<<<<<<<<<<<
 * ##pxm>CPPCLASS_END
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_theme_bgcolor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_f_6_qtui__set_button_background_color(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1664
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_button_background_color_reset_clicked() with gil:             # <<<<<<<<<<<<<<
 *         del settings['theme.bgcolor']
 *         qtui.set_button_background_color(str2q(settings['theme.bgcolor']))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("PreferencesDialog.on_button_background_color_reset_clicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1669
 * ##pxm>CPPCLASS_END
 * 
 * def set_combobox_current_image(index_icon, imagefile, index):             # <<<<<<<<<<<<<<
 *     cdef QIcon icon #px/
 *     #icon = QIcon()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_23set_combobox_current_image(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_23set_combobox_current_image = {"set_combobox_current_image", (PyCFunction)__pyx_pw_10_qt_qtwes2_23set_combobox_current_image, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_23set_combobox_current_image(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index_icon = 0;
  PyObject *__pyx_v_imagefile = 0;
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_combobox_current_image (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index_icon,&__pyx_n_s_imagefile,&__pyx_n_s_index,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index_icon)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imagefile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_combobox_current_image", 1, 3, 3, 1); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_combobox_current_image", 1, 3, 3, 2); __PYX_ERR(0, 1669, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_combobox_current_image") < 0)) __PYX_ERR(0, 1669, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_index_icon = values[0];
    __pyx_v_imagefile = values[1];
    __pyx_v_index = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_combobox_current_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1669, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.set_combobox_current_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_22set_combobox_current_image(__pyx_self, __pyx_v_index_icon, __pyx_v_imagefile, __pyx_v_index);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_22set_combobox_current_image(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index_icon, PyObject *__pyx_v_imagefile, PyObject *__pyx_v_index) {
  QIcon __pyx_v_icon;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("set_combobox_current_image", 0);

  /* "_qt_qtwes2.pyx":1672
 *     cdef QIcon icon #px/
 *     #icon = QIcon()
 *     if imagefile is not None:             # <<<<<<<<<<<<<<
 *         icon.addFile(str2q(imagefile))
 *     qtui.set_combobox_image(index_icon, icon, index)
 */
  __pyx_t_1 = (__pyx_v_imagefile != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "_qt_qtwes2.pyx":1673
 *     #icon = QIcon()
 *     if imagefile is not None:
 *         icon.addFile(str2q(imagefile))             # <<<<<<<<<<<<<<
 *     qtui.set_combobox_image(index_icon, icon, index)
 * 
 */
    __pyx_v_icon.addFile(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_imagefile));

    /* "_qt_qtwes2.pyx":1672
 *     cdef QIcon icon #px/
 *     #icon = QIcon()
 *     if imagefile is not None:             # <<<<<<<<<<<<<<
 *         icon.addFile(str2q(imagefile))
 *     qtui.set_combobox_image(index_icon, icon, index)
 */
  }

  /* "_qt_qtwes2.pyx":1674
 *     if imagefile is not None:
 *         icon.addFile(str2q(imagefile))
 *     qtui.set_combobox_image(index_icon, icon, index)             # <<<<<<<<<<<<<<
 * 
 * def set_preferences_current_face_theme(color, imageindex_icon, imagefile, imageindex, imagemode):
 */
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_index_icon); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1674, __pyx_L1_error)
  __pyx_f_6_qtui__set_combobox_image(__pyx_t_3, __pyx_v_icon, __pyx_t_4);

  /* "_qt_qtwes2.pyx":1669
 * ##pxm>CPPCLASS_END
 * 
 * def set_combobox_current_image(index_icon, imagefile, index):             # <<<<<<<<<<<<<<
 *     cdef QIcon icon #px/
 *     #icon = QIcon()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_qt_qtwes2.set_combobox_current_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1676
 *     qtui.set_combobox_image(index_icon, icon, index)
 * 
 * def set_preferences_current_face_theme(color, imageindex_icon, imagefile, imageindex, imagemode):             # <<<<<<<<<<<<<<
 *     qtui.set_button_color(str2q(color))
 *     set_combobox_current_image(imageindex_icon, imagefile, imageindex)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_25set_preferences_current_face_theme(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_25set_preferences_current_face_theme = {"set_preferences_current_face_theme", (PyCFunction)__pyx_pw_10_qt_qtwes2_25set_preferences_current_face_theme, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_25set_preferences_current_face_theme(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_imageindex_icon = 0;
  PyObject *__pyx_v_imagefile = 0;
  PyObject *__pyx_v_imageindex = 0;
  PyObject *__pyx_v_imagemode = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_preferences_current_face_theme (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_imageindex_icon,&__pyx_n_s_imagefile,&__pyx_n_s_imageindex,&__pyx_n_s_imagemode,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imageindex_icon)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_preferences_current_face_theme", 1, 5, 5, 1); __PYX_ERR(0, 1676, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imagefile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_preferences_current_face_theme", 1, 5, 5, 2); __PYX_ERR(0, 1676, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imageindex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_preferences_current_face_theme", 1, 5, 5, 3); __PYX_ERR(0, 1676, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_imagemode)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_preferences_current_face_theme", 1, 5, 5, 4); __PYX_ERR(0, 1676, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_preferences_current_face_theme") < 0)) __PYX_ERR(0, 1676, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_color = values[0];
    __pyx_v_imageindex_icon = values[1];
    __pyx_v_imagefile = values[2];
    __pyx_v_imageindex = values[3];
    __pyx_v_imagemode = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_preferences_current_face_theme", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1676, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.set_preferences_current_face_theme", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_24set_preferences_current_face_theme(__pyx_self, __pyx_v_color, __pyx_v_imageindex_icon, __pyx_v_imagefile, __pyx_v_imageindex, __pyx_v_imagemode);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_24set_preferences_current_face_theme(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_color, PyObject *__pyx_v_imageindex_icon, PyObject *__pyx_v_imagefile, PyObject *__pyx_v_imageindex, PyObject *__pyx_v_imagemode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("set_preferences_current_face_theme", 0);

  /* "_qt_qtwes2.pyx":1677
 * 
 * def set_preferences_current_face_theme(color, imageindex_icon, imagefile, imageindex, imagemode):
 *     qtui.set_button_color(str2q(color))             # <<<<<<<<<<<<<<
 *     set_combobox_current_image(imageindex_icon, imagefile, imageindex)
 *     qtui.set_imagemode(imagemode)
 */
  __pyx_f_6_qtui__set_button_color(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_color));

  /* "_qt_qtwes2.pyx":1678
 * def set_preferences_current_face_theme(color, imageindex_icon, imagefile, imageindex, imagemode):
 *     qtui.set_button_color(str2q(color))
 *     set_combobox_current_image(imageindex_icon, imagefile, imageindex)             # <<<<<<<<<<<<<<
 *     qtui.set_imagemode(imagemode)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_combobox_current_image); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_imageindex_icon, __pyx_v_imagefile, __pyx_v_imageindex};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_imageindex_icon, __pyx_v_imagefile, __pyx_v_imageindex};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_imageindex_icon);
    __Pyx_GIVEREF(__pyx_v_imageindex_icon);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_imageindex_icon);
    __Pyx_INCREF(__pyx_v_imagefile);
    __Pyx_GIVEREF(__pyx_v_imagefile);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_imagefile);
    __Pyx_INCREF(__pyx_v_imageindex);
    __Pyx_GIVEREF(__pyx_v_imageindex);
    PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_imageindex);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1679
 *     qtui.set_button_color(str2q(color))
 *     set_combobox_current_image(imageindex_icon, imagefile, imageindex)
 *     qtui.set_imagemode(imagemode)             # <<<<<<<<<<<<<<
 * 
 * def get_filedialog_imagefile():
 */
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_imagemode); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1679, __pyx_L1_error)
  __pyx_f_6_qtui__set_imagemode(__pyx_t_4);

  /* "_qt_qtwes2.pyx":1676
 *     qtui.set_combobox_image(index_icon, icon, index)
 * 
 * def set_preferences_current_face_theme(color, imageindex_icon, imagefile, imageindex, imagemode):             # <<<<<<<<<<<<<<
 *     qtui.set_button_color(str2q(color))
 *     set_combobox_current_image(imageindex_icon, imagefile, imageindex)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_qt_qtwes2.set_preferences_current_face_theme", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1681
 *     qtui.set_imagemode(imagemode)
 * 
 * def get_filedialog_imagefile():             # <<<<<<<<<<<<<<
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))
 *     if filename:
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_27get_filedialog_imagefile(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_27get_filedialog_imagefile = {"get_filedialog_imagefile", (PyCFunction)__pyx_pw_10_qt_qtwes2_27get_filedialog_imagefile, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_27get_filedialog_imagefile(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_filedialog_imagefile (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_26get_filedialog_imagefile(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_26get_filedialog_imagefile(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_filename = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("get_filedialog_imagefile", 0);

  /* "_qt_qtwes2.pyx":1682
 * 
 * def get_filedialog_imagefile():
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))             # <<<<<<<<<<<<<<
 *     if filename:
 *         uidata.preferences.image_dirname = str2q(os.path.dirname(filename))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_q2str(QFileDialog::getOpenFileName(__pyx_v_10_qt_qtwes2_uidata.preferences, __pyx_f_10_qt_qtwes2_str2q(__pyx_t_2), __pyx_v_10_qt_qtwes2_uidata.preferences->image_dirname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_filename = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1683
 * def get_filedialog_imagefile():
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))
 *     if filename:             # <<<<<<<<<<<<<<
 *         uidata.preferences.image_dirname = str2q(os.path.dirname(filename))
 *     return filename
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_filename); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1683, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "_qt_qtwes2.pyx":1684
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))
 *     if filename:
 *         uidata.preferences.image_dirname = str2q(os.path.dirname(filename))             # <<<<<<<<<<<<<<
 *     return filename
 * ##pxm>IF_END
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dirname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_filename);
        __Pyx_GIVEREF(__pyx_v_filename);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_10_qt_qtwes2_uidata.preferences->image_dirname = __pyx_f_10_qt_qtwes2_str2q(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1683
 * def get_filedialog_imagefile():
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))
 *     if filename:             # <<<<<<<<<<<<<<
 *         uidata.preferences.image_dirname = str2q(os.path.dirname(filename))
 *     return filename
 */
  }

  /* "_qt_qtwes2.pyx":1685
 *     if filename:
 *         uidata.preferences.image_dirname = str2q(os.path.dirname(filename))
 *     return filename             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_filename);
  __pyx_r = __pyx_v_filename;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1681
 *     qtui.set_imagemode(imagemode)
 * 
 * def get_filedialog_imagefile():             # <<<<<<<<<<<<<<
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))
 *     if filename:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_qt_qtwes2.get_filedialog_imagefile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1688
 * ##pxm>IF_END
 * 
 * def preferences_dialog(shader_names, sample_buffers, facenames, stockicons):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences = new PreferencesDialog(uidata.mainwindow) #px/
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_29preferences_dialog(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_29preferences_dialog = {"preferences_dialog", (PyCFunction)__pyx_pw_10_qt_qtwes2_29preferences_dialog, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_29preferences_dialog(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shader_names = 0;
  CYTHON_UNUSED PyObject *__pyx_v_sample_buffers = 0;
  PyObject *__pyx_v_facenames = 0;
  PyObject *__pyx_v_stockicons = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("preferences_dialog (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shader_names,&__pyx_n_s_sample_buffers,&__pyx_n_s_facenames,&__pyx_n_s_stockicons,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shader_names)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_buffers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("preferences_dialog", 1, 4, 4, 1); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_facenames)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("preferences_dialog", 1, 4, 4, 2); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stockicons)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("preferences_dialog", 1, 4, 4, 3); __PYX_ERR(0, 1688, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "preferences_dialog") < 0)) __PYX_ERR(0, 1688, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_shader_names = values[0];
    __pyx_v_sample_buffers = values[1];
    __pyx_v_facenames = values[2];
    __pyx_v_stockicons = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("preferences_dialog", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1688, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.preferences_dialog", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_28preferences_dialog(__pyx_self, __pyx_v_shader_names, __pyx_v_sample_buffers, __pyx_v_facenames, __pyx_v_stockicons);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_28preferences_dialog(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shader_names, CYTHON_UNUSED PyObject *__pyx_v_sample_buffers, PyObject *__pyx_v_facenames, PyObject *__pyx_v_stockicons) {
  PyObject *__pyx_v_nick = NULL;
  PyObject *__pyx_v_text = NULL;
  PyObject *__pyx_v_selection_nick = NULL;
  PyObject *__pyx_v_facename = NULL;
  PyObject *__pyx_v_facekey = NULL;
  PyObject *__pyx_v_filename = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  __Pyx_RefNannySetupContext("preferences_dialog", 0);

  /* "_qt_qtwes2.pyx":1690
 * def preferences_dialog(shader_names, sample_buffers, facenames, stockicons):
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences = new PreferencesDialog(uidata.mainwindow) #px/             # <<<<<<<<<<<<<<
 *     #uidata.preferences = PreferencesDialog(uidata.mainwindow)
 *     uidata.preferences.init()
 */
  __pyx_v_10_qt_qtwes2_uidata.preferences = new PreferencesDialog(__pyx_v_10_qt_qtwes2_uidata.mainwindow);

  /* "_qt_qtwes2.pyx":1692
 *     uidata.preferences = new PreferencesDialog(uidata.mainwindow) #px/
 *     #uidata.preferences = PreferencesDialog(uidata.mainwindow)
 *     uidata.preferences.init()             # <<<<<<<<<<<<<<
 *     qtui.preferences_block_signals(True)
 * 
 */
  __pyx_v_10_qt_qtwes2_uidata.preferences->init();

  /* "_qt_qtwes2.pyx":1693
 *     #uidata.preferences = PreferencesDialog(uidata.mainwindow)
 *     uidata.preferences.init()
 *     qtui.preferences_block_signals(True)             # <<<<<<<<<<<<<<
 * 
 *     # graphic tab
 */
  __pyx_f_6_qtui__preferences_block_signals(1);

  /* "_qt_qtwes2.pyx":1696
 * 
 *     # graphic tab
 *     for nick in settings['draw.shader_range']:             # <<<<<<<<<<<<<<
 *         qtui.combobox_add_shaderitem(str2q(shader_names.get(nick, nick)), str2q(nick))
 *     uidata.preferences.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader']))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_shader_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1696, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1696, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1696, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1696, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_nick, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1697
 *     # graphic tab
 *     for nick in settings['draw.shader_range']:
 *         qtui.combobox_add_shaderitem(str2q(shader_names.get(nick, nick)), str2q(nick))             # <<<<<<<<<<<<<<
 *     uidata.preferences.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader']))
 *     for text in settings['draw.samples_range']:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shader_names, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_nick, __pyx_v_nick};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_nick, __pyx_v_nick};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_nick);
      __Pyx_GIVEREF(__pyx_v_nick);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_nick);
      __Pyx_INCREF(__pyx_v_nick);
      __Pyx_GIVEREF(__pyx_v_nick);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_nick);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_f_6_qtui__combobox_add_shaderitem(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_nick));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1696
 * 
 *     # graphic tab
 *     for nick in settings['draw.shader_range']:             # <<<<<<<<<<<<<<
 *         qtui.combobox_add_shaderitem(str2q(shader_names.get(nick, nick)), str2q(nick))
 *     uidata.preferences.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader']))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1698
 *     for nick in settings['draw.shader_range']:
 *         qtui.combobox_add_shaderitem(str2q(shader_names.get(nick, nick)), str2q(nick))
 *     uidata.preferences.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader']))             # <<<<<<<<<<<<<<
 *     for text in settings['draw.samples_range']:
 *         qtui.combobox_add_samplesitem(str2q(_(text)), str2q(text))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_shader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_combobox_shader))->setProperty(((char const *)"currentIndex"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1699
 *         qtui.combobox_add_shaderitem(str2q(shader_names.get(nick, nick)), str2q(nick))
 *     uidata.preferences.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader']))
 *     for text in settings['draw.samples_range']:             # <<<<<<<<<<<<<<
 *         qtui.combobox_add_samplesitem(str2q(_(text)), str2q(text))
 *     uidata.preferences.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples']))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_draw_samples_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1699, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1699, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1699, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1699, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1700
 *     uidata.preferences.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader']))
 *     for text in settings['draw.samples_range']:
 *         qtui.combobox_add_samplesitem(str2q(_(text)), str2q(text))             # <<<<<<<<<<<<<<
 *     uidata.preferences.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples']))
 *     uidata.preferences.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces']))
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_text};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_text};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1700, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_text);
        __Pyx_GIVEREF(__pyx_v_text);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_text);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_f_6_qtui__combobox_add_samplesitem(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_text));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1699
 *         qtui.combobox_add_shaderitem(str2q(shader_names.get(nick, nick)), str2q(nick))
 *     uidata.preferences.findChild(str2q('combobox_shader')).setProperty(b'currentIndex', tovariant(settings['draw.shader']))
 *     for text in settings['draw.samples_range']:             # <<<<<<<<<<<<<<
 *         qtui.combobox_add_samplesitem(str2q(_(text)), str2q(text))
 *     uidata.preferences.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples']))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1701
 *     for text in settings['draw.samples_range']:
 *         qtui.combobox_add_samplesitem(str2q(_(text)), str2q(text))
 *     uidata.preferences.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples']))             # <<<<<<<<<<<<<<
 *     uidata.preferences.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces']))
 *     uidata.preferences.findChild(str2q('spinbox_mirror_faces')).setProperty(b'value', tovariant(settings['draw.mirror_distance']))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_draw_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_combobox_samples))->setProperty(((char const *)"currentIndex"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1702
 *         qtui.combobox_add_samplesitem(str2q(_(text)), str2q(text))
 *     uidata.preferences.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples']))
 *     uidata.preferences.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces']))             # <<<<<<<<<<<<<<
 *     uidata.preferences.findChild(str2q('spinbox_mirror_faces')).setProperty(b'value', tovariant(settings['draw.mirror_distance']))
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_mirror_faces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_checkbox_mirror_faces))->setProperty(((char const *)"checked"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1703
 *     uidata.preferences.findChild(str2q('combobox_samples')).setProperty(b'currentIndex', tovariant(settings['draw.samples']))
 *     uidata.preferences.findChild(str2q('checkbox_mirror_faces')).setProperty(b'checked', tovariant(settings['draw.mirror_faces']))
 *     uidata.preferences.findChild(str2q('spinbox_mirror_faces')).setProperty(b'value', tovariant(settings['draw.mirror_distance']))             # <<<<<<<<<<<<<<
 * 
 *     # mouse tab
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_draw_mirror_distance); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_spinbox_mirror_faces))->setProperty(((char const *)"value"), __pyx_f_10_qt_qtwes2_tovariant(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1706
 * 
 *     # mouse tab
 *     selection_nick = settings['draw.selection_nick']             # <<<<<<<<<<<<<<
 *     if selection_nick == 'quadrant':
 *         uidata.preferences.findChild(str2q('button_mousemode_quad')).setProperty(b'checked', tovariant(True))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_selection_nick); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_selection_nick = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1707
 *     # mouse tab
 *     selection_nick = settings['draw.selection_nick']
 *     if selection_nick == 'quadrant':             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('button_mousemode_quad')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'simple':
 */
  __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_selection_nick, __pyx_n_u_quadrant, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1707, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "_qt_qtwes2.pyx":1708
 *     selection_nick = settings['draw.selection_nick']
 *     if selection_nick == 'quadrant':
 *         uidata.preferences.findChild(str2q('button_mousemode_quad')).setProperty(b'checked', tovariant(True))             # <<<<<<<<<<<<<<
 *     elif selection_nick == 'simple':
 *         uidata.preferences.findChild(str2q('button_mousemode_ext')).setProperty(b'checked', tovariant(True))
 */
    __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_button_mousemode_quad))->setProperty(((char const *)"checked"), __pyx_f_10_qt_qtwes2_tovariant(Py_True));

    /* "_qt_qtwes2.pyx":1707
 *     # mouse tab
 *     selection_nick = settings['draw.selection_nick']
 *     if selection_nick == 'quadrant':             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('button_mousemode_quad')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'simple':
 */
    goto __pyx_L7;
  }

  /* "_qt_qtwes2.pyx":1709
 *     if selection_nick == 'quadrant':
 *         uidata.preferences.findChild(str2q('button_mousemode_quad')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'simple':             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('button_mousemode_ext')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'gesture':
 */
  __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_selection_nick, __pyx_n_u_simple, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1709, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "_qt_qtwes2.pyx":1710
 *         uidata.preferences.findChild(str2q('button_mousemode_quad')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'simple':
 *         uidata.preferences.findChild(str2q('button_mousemode_ext')).setProperty(b'checked', tovariant(True))             # <<<<<<<<<<<<<<
 *     elif selection_nick == 'gesture':
 *         uidata.preferences.findChild(str2q('button_mousemode_gesture')).setProperty(b'checked', tovariant(True))
 */
    __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_button_mousemode_ext))->setProperty(((char const *)"checked"), __pyx_f_10_qt_qtwes2_tovariant(Py_True));

    /* "_qt_qtwes2.pyx":1709
 *     if selection_nick == 'quadrant':
 *         uidata.preferences.findChild(str2q('button_mousemode_quad')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'simple':             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('button_mousemode_ext')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'gesture':
 */
    goto __pyx_L7;
  }

  /* "_qt_qtwes2.pyx":1711
 *     elif selection_nick == 'simple':
 *         uidata.preferences.findChild(str2q('button_mousemode_ext')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'gesture':             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('button_mousemode_gesture')).setProperty(b'checked', tovariant(True))
 * 
 */
  __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_selection_nick, __pyx_n_u_gesture, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1711, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "_qt_qtwes2.pyx":1712
 *         uidata.preferences.findChild(str2q('button_mousemode_ext')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'gesture':
 *         uidata.preferences.findChild(str2q('button_mousemode_gesture')).setProperty(b'checked', tovariant(True))             # <<<<<<<<<<<<<<
 * 
 *     # keys tab
 */
    __pyx_v_10_qt_qtwes2_uidata.preferences->findChild<QObject*>(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_button_mousemode_gesture))->setProperty(((char const *)"checked"), __pyx_f_10_qt_qtwes2_tovariant(Py_True));

    /* "_qt_qtwes2.pyx":1711
 *     elif selection_nick == 'simple':
 *         uidata.preferences.findChild(str2q('button_mousemode_ext')).setProperty(b'checked', tovariant(True))
 *     elif selection_nick == 'gesture':             # <<<<<<<<<<<<<<
 *         uidata.preferences.findChild(str2q('button_mousemode_gesture')).setProperty(b'checked', tovariant(True))
 * 
 */
  }
  __pyx_L7:;

  /* "_qt_qtwes2.pyx":1715
 * 
 *     # keys tab
 *     uidata.preferences.fill_move_key_list()             # <<<<<<<<<<<<<<
 * 
 *     # theme tab
 */
  __pyx_v_10_qt_qtwes2_uidata.preferences->fill_move_key_list();

  /* "_qt_qtwes2.pyx":1718
 * 
 *     # theme tab
 *     for facename, facekey in facenames:             # <<<<<<<<<<<<<<
 *         qtui.add_liststore_faces_row(str2q(facename), str2q(facekey))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))
 */
  if (likely(PyList_CheckExact(__pyx_v_facenames)) || PyTuple_CheckExact(__pyx_v_facenames)) {
    __pyx_t_2 = __pyx_v_facenames; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_facenames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1718, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1718, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1718, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1718, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1718, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L10_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1718, __pyx_L1_error)
      __pyx_t_10 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L11_unpacking_done;
      __pyx_L10_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1718, __pyx_L1_error)
      __pyx_L11_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_facename, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_facekey, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "_qt_qtwes2.pyx":1719
 *     # theme tab
 *     for facename, facekey in facenames:
 *         qtui.add_liststore_faces_row(str2q(facename), str2q(facekey))             # <<<<<<<<<<<<<<
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))
 *     for filename in stockicons:
 */
    __pyx_f_6_qtui__add_liststore_faces_row(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_facename), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_facekey));

    /* "_qt_qtwes2.pyx":1718
 * 
 *     # theme tab
 *     for facename, facekey in facenames:             # <<<<<<<<<<<<<<
 *         qtui.add_liststore_faces_row(str2q(facename), str2q(facekey))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1720
 *     for facename, facekey in facenames:
 *         qtui.add_liststore_faces_row(str2q(facename), str2q(facekey))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))             # <<<<<<<<<<<<<<
 *     for filename in stockicons:
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_f_6_qtui__add_combobox_image_item(QIcon(), __pyx_f_10_qt_qtwes2_str2q(__pyx_t_1), __pyx_f_10_qt_qtwes2_str2q(__pyx_kp_u__6));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1721
 *         qtui.add_liststore_faces_row(str2q(facename), str2q(facekey))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))
 *     for filename in stockicons:             # <<<<<<<<<<<<<<
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('select ')), str2q('/'))
 */
  if (likely(PyList_CheckExact(__pyx_v_stockicons)) || PyTuple_CheckExact(__pyx_v_stockicons)) {
    __pyx_t_1 = __pyx_v_stockicons; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_stockicons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1721, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1721, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1721, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1721, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1721, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1721, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1722
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))
 *     for filename in stockicons:
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))             # <<<<<<<<<<<<<<
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('select ')), str2q('/'))
 *     uidata.preferences.image_dirname = str2q(get_pictures_folder())
 */
    __pyx_f_6_qtui__add_combobox_image_item(__pyx_f_10_qt_qtwes2_get_icon(__pyx_v_filename), __pyx_f_10_qt_qtwes2_str2q(__pyx_kp_u__6), __pyx_f_10_qt_qtwes2_str2q(__pyx_v_filename));

    /* "_qt_qtwes2.pyx":1721
 *         qtui.add_liststore_faces_row(str2q(facename), str2q(facekey))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))
 *     for filename in stockicons:             # <<<<<<<<<<<<<<
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('select ')), str2q('/'))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1723
 *     for filename in stockicons:
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('select ')), str2q('/'))             # <<<<<<<<<<<<<<
 *     uidata.preferences.image_dirname = str2q(get_pictures_folder())
 *     qtui.finalize_liststore_faces(uidata.preferences)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_f_6_qtui__add_combobox_image_item(QIcon(), __pyx_f_10_qt_qtwes2_str2q(__pyx_t_2), __pyx_f_10_qt_qtwes2_str2q(__pyx_kp_u__13));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1724
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('select ')), str2q('/'))
 *     uidata.preferences.image_dirname = str2q(get_pictures_folder())             # <<<<<<<<<<<<<<
 *     qtui.finalize_liststore_faces(uidata.preferences)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_pictures_folder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_10_qt_qtwes2_uidata.preferences->image_dirname = __pyx_f_10_qt_qtwes2_str2q(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1725
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('select ')), str2q('/'))
 *     uidata.preferences.image_dirname = str2q(get_pictures_folder())
 *     qtui.finalize_liststore_faces(uidata.preferences)             # <<<<<<<<<<<<<<
 * 
 *     qtui.set_button_background_color(str2q(settings['theme.bgcolor']))
 */
  __pyx_f_6_qtui__finalize_liststore_faces(__pyx_v_10_qt_qtwes2_uidata.preferences);

  /* "_qt_qtwes2.pyx":1727
 *     qtui.finalize_liststore_faces(uidata.preferences)
 * 
 *     qtui.set_button_background_color(str2q(settings['theme.bgcolor']))             # <<<<<<<<<<<<<<
 * 
 *     qtui.preferences_block_signals(False)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_theme_bgcolor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_f_6_qtui__set_button_background_color(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1729
 *     qtui.set_button_background_color(str2q(settings['theme.bgcolor']))
 * 
 *     qtui.preferences_block_signals(False)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set_stdmodel(b'shadermodel', ([shader_names.get(nick, nick), nick] for nick in settings['draw.shader_range']))
 */
  __pyx_f_6_qtui__preferences_block_signals(0);

  /* "_qt_qtwes2.pyx":1688
 * ##pxm>IF_END
 * 
 * def preferences_dialog(shader_names, sample_buffers, facenames, stockicons):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences = new PreferencesDialog(uidata.mainwindow) #px/
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_qt_qtwes2.preferences_dialog", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nick);
  __Pyx_XDECREF(__pyx_v_text);
  __Pyx_XDECREF(__pyx_v_selection_nick);
  __Pyx_XDECREF(__pyx_v_facename);
  __Pyx_XDECREF(__pyx_v_facekey);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1743
 *     #~ ##pxm>IF_END
 * 
 * def show_preferences():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences.show()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_31show_preferences(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_31show_preferences = {"show_preferences", (PyCFunction)__pyx_pw_10_qt_qtwes2_31show_preferences, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_31show_preferences(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("show_preferences (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_30show_preferences(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_30show_preferences(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("show_preferences", 0);

  /* "_qt_qtwes2.pyx":1745
 * def show_preferences():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences.show()             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'preferences_visible', True)
 */
  __pyx_v_10_qt_qtwes2_uidata.preferences->show();

  /* "_qt_qtwes2.pyx":1743
 *     #~ ##pxm>IF_END
 * 
 * def show_preferences():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences.show()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1758
 *         ##pxh> : QDialog(parent) {}
 *     ##pxm-FUNC PHD
 *     void init(const QString &helptext):             # <<<<<<<<<<<<<<
 *         qtui.setupUi_help(this, helptext)
 * ##pxm>CPPCLASS_END
 */

void HelpDialog::init(QString const &__pyx_v_helptext) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "_qt_qtwes2.pyx":1759
 *     ##pxm-FUNC PHD
 *     void init(const QString &helptext):
 *         qtui.setupUi_help(this, helptext)             # <<<<<<<<<<<<<<
 * ##pxm>CPPCLASS_END
 * 
 */
  __pyx_f_6_qtui__setupUi_help(this, __pyx_v_helptext);

  /* "_qt_qtwes2.pyx":1758
 *         ##pxh> : QDialog(parent) {}
 *     ##pxm-FUNC PHD
 *     void init(const QString &helptext):             # <<<<<<<<<<<<<<
 *         qtui.setupUi_help(this, helptext)
 * ##pxm>CPPCLASS_END
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":1763
 * 
 * ##pxm-FUNC P with gil
 * cdef void help_dialog() with gil:             # <<<<<<<<<<<<<<
 *     uidata.help = new HelpDialog(uidata.mainwindow) #px/
 *     #uidata.help = HelpDialog(uidata.mainwindow)
 */

static void __pyx_f_10_qt_qtwes2_help_dialog(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("help_dialog", 0);

  /* "_qt_qtwes2.pyx":1764
 * ##pxm-FUNC P with gil
 * cdef void help_dialog() with gil:
 *     uidata.help = new HelpDialog(uidata.mainwindow) #px/             # <<<<<<<<<<<<<<
 *     #uidata.help = HelpDialog(uidata.mainwindow)
 *     uidata.help.init(str2q(pydata.app.on_dialog_text('help_text')))
 */
  __pyx_v_10_qt_qtwes2_uidata.help = new HelpDialog(__pyx_v_10_qt_qtwes2_uidata.mainwindow);

  /* "_qt_qtwes2.pyx":1766
 *     uidata.help = new HelpDialog(uidata.mainwindow) #px/
 *     #uidata.help = HelpDialog(uidata.mainwindow)
 *     uidata.help.init(str2q(pydata.app.on_dialog_text('help_text')))             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P nogil
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_app); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_10_qt_qtwes2_uidata.help->init(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1763
 * 
 * ##pxm-FUNC P with gil
 * cdef void help_dialog() with gil:             # <<<<<<<<<<<<<<
 *     uidata.help = new HelpDialog(uidata.mainwindow) #px/
 *     #uidata.help = HelpDialog(uidata.mainwindow)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("_qt_qtwes2.help_dialog", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1769
 * 
 * ##pxm-FUNC P nogil
 * cdef void help_dialog_show() nogil:             # <<<<<<<<<<<<<<
 *     uidata.help.show()
 * 
 */

static void __pyx_f_10_qt_qtwes2_help_dialog_show(void) {

  /* "_qt_qtwes2.pyx":1770
 * ##pxm-FUNC P nogil
 * cdef void help_dialog_show() nogil:
 *     uidata.help.show()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_10_qt_qtwes2_uidata.help->show();

  /* "_qt_qtwes2.pyx":1769
 * 
 * ##pxm-FUNC P nogil
 * cdef void help_dialog_show() nogil:             # <<<<<<<<<<<<<<
 *     uidata.help.show()
 * 
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1779
 *         ##pxh> : QDialog(parent) {}
 *     ##pxm-FUNC PHD
 *     void init():             # <<<<<<<<<<<<<<
 *         qtui.setupUi_about(this)
 * 
 */

void AboutDialog::init(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "_qt_qtwes2.pyx":1780
 *     ##pxm-FUNC PHD
 *     void init():
 *         qtui.setupUi_about(this)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH nogil
 */
  __pyx_f_6_qtui__setupUi_about(this);

  /* "_qt_qtwes2.pyx":1779
 *         ##pxh> : QDialog(parent) {}
 *     ##pxm-FUNC PHD
 *     void init():             # <<<<<<<<<<<<<<
 *         qtui.setupUi_about(this)
 * 
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":1783
 * 
 *     ##pxm-FUNC PH nogil
 *     void showEvent(QShowEvent *unused_event) nogil:             # <<<<<<<<<<<<<<
 *         qtui.update_animation(True)
 * 
 */

void AboutDialog::showEvent(CYTHON_UNUSED QShowEvent *__pyx_v_unused_event) {

  /* "_qt_qtwes2.pyx":1784
 *     ##pxm-FUNC PH nogil
 *     void showEvent(QShowEvent *unused_event) nogil:
 *         qtui.update_animation(True)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH nogil
 */
  __pyx_f_6_qtui__update_animation(1);

  /* "_qt_qtwes2.pyx":1783
 * 
 *     ##pxm-FUNC PH nogil
 *     void showEvent(QShowEvent *unused_event) nogil:             # <<<<<<<<<<<<<<
 *         qtui.update_animation(True)
 * 
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1787
 * 
 *     ##pxm-FUNC PH nogil
 *     void resizeEvent(QResizeEvent *unused_event) nogil:             # <<<<<<<<<<<<<<
 *         qtui.update_animation(False)
 * 
 */

void AboutDialog::resizeEvent(CYTHON_UNUSED QResizeEvent *__pyx_v_unused_event) {

  /* "_qt_qtwes2.pyx":1788
 *     ##pxm-FUNC PH nogil
 *     void resizeEvent(QResizeEvent *unused_event) nogil:
 *         qtui.update_animation(False)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH nogil
 */
  __pyx_f_6_qtui__update_animation(0);

  /* "_qt_qtwes2.pyx":1787
 * 
 *     ##pxm-FUNC PH nogil
 *     void resizeEvent(QResizeEvent *unused_event) nogil:             # <<<<<<<<<<<<<<
 *         qtui.update_animation(False)
 * 
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1791
 * 
 *     ##pxm-FUNC PH nogil
 *     cbool eventFilter(QObject *unused_watched, QEvent *event) nogil:             # <<<<<<<<<<<<<<
 *         qtui.event_filter_stop_animation(event)
 *         return False
 */

bool AboutDialog::eventFilter(CYTHON_UNUSED QObject *__pyx_v_unused_watched, QEvent *__pyx_v_event) {
  bool __pyx_r;

  /* "_qt_qtwes2.pyx":1792
 *     ##pxm-FUNC PH nogil
 *     cbool eventFilter(QObject *unused_watched, QEvent *event) nogil:
 *         qtui.event_filter_stop_animation(event)             # <<<<<<<<<<<<<<
 *         return False
 * ##pxh>
 */
  __pyx_f_6_qtui__event_filter_stop_animation(__pyx_v_event);

  /* "_qt_qtwes2.pyx":1793
 *     cbool eventFilter(QObject *unused_watched, QEvent *event) nogil:
 *         qtui.event_filter_stop_animation(event)
 *         return False             # <<<<<<<<<<<<<<
 * ##pxh>
 *     ##pxm-FUNC HD nogil
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1791
 * 
 *     ##pxm-FUNC PH nogil
 *     cbool eventFilter(QObject *unused_watched, QEvent *event) nogil:             # <<<<<<<<<<<<<<
 *         qtui.event_filter_stop_animation(event)
 *         return False
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1800
 * 
 *     ##pxm-FUNC PH nogil
 *     void on_tab_widget_currentChanged(int index) nogil:             # <<<<<<<<<<<<<<
 *         qtui.tab_widget_currentChanged(index)
 * 
 */

void AboutDialog::on_tab_widget_currentChanged(int __pyx_v_index) {

  /* "_qt_qtwes2.pyx":1801
 *     ##pxm-FUNC PH nogil
 *     void on_tab_widget_currentChanged(int index) nogil:
 *         qtui.tab_widget_currentChanged(index)             # <<<<<<<<<<<<<<
 * 
 *     ##pxm-FUNC PH with gil
 */
  __pyx_f_6_qtui__tab_widget_currentChanged(__pyx_v_index);

  /* "_qt_qtwes2.pyx":1800
 * 
 *     ##pxm-FUNC PH nogil
 *     void on_tab_widget_currentChanged(int index) nogil:             # <<<<<<<<<<<<<<
 *         qtui.tab_widget_currentChanged(index)
 * 
 */

  /* function exit code */
}

/* "_qt_qtwes2.pyx":1804
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_text_license_short_anchorClicked(const QUrl &url) with gil:             # <<<<<<<<<<<<<<
 *         qtui.show_full_license(q2str(url.toString()) == 'text:FULL_LICENSE_TEXT', url)
 * ##pxm>CPPCLASS_END
 */

void AboutDialog::on_text_license_short_anchorClicked(QUrl const &__pyx_v_url) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  bool __pyx_t_3;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("on_text_license_short_anchorClicked", 0);

  /* "_qt_qtwes2.pyx":1805
 *     ##pxm-FUNC PH with gil
 *     void on_text_license_short_anchorClicked(const QUrl &url) with gil:
 *         qtui.show_full_license(q2str(url.toString()) == 'text:FULL_LICENSE_TEXT', url)             # <<<<<<<<<<<<<<
 * ##pxm>CPPCLASS_END
 * 
 */
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_url.toString()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_kp_u_text_FULL_LICENSE_TEXT, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_f_6_qtui__show_full_license(__pyx_t_3, __pyx_v_url);

  /* "_qt_qtwes2.pyx":1804
 * 
 *     ##pxm-FUNC PH with gil
 *     void on_text_license_short_anchorClicked(const QUrl &url) with gil:             # <<<<<<<<<<<<<<
 *         qtui.show_full_license(q2str(url.toString()) == 'text:FULL_LICENSE_TEXT', url)
 * ##pxm>CPPCLASS_END
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("AboutDialog.on_text_license_short_anchorClicked", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1809
 * 
 * ##pxm-FUNC P with gil
 * cdef void about_dialog() with gil:             # <<<<<<<<<<<<<<
 *     cdef AboutDialog *about = new AboutDialog(uidata.mainwindow) #px/
 *     #about = AboutDialog(uidata.mainwindow)
 */

static void __pyx_f_10_qt_qtwes2_about_dialog(void) {
  AboutDialog *__pyx_v_about;
  PyObject *__pyx_v_license_full = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("about_dialog", 0);

  /* "_qt_qtwes2.pyx":1810
 * ##pxm-FUNC P with gil
 * cdef void about_dialog() with gil:
 *     cdef AboutDialog *about = new AboutDialog(uidata.mainwindow) #px/             # <<<<<<<<<<<<<<
 *     #about = AboutDialog(uidata.mainwindow)
 *     about.init()
 */
  __pyx_v_about = new AboutDialog(__pyx_v_10_qt_qtwes2_uidata.mainwindow);

  /* "_qt_qtwes2.pyx":1812
 *     cdef AboutDialog *about = new AboutDialog(uidata.mainwindow) #px/
 *     #about = AboutDialog(uidata.mainwindow)
 *     about.init()             # <<<<<<<<<<<<<<
 * 
 *     qtui.fill_header(str2q(config_.APPICON_FILE), str2q(_(config_.APPNAME)),
 */
  __pyx_v_about->init();

  /* "_qt_qtwes2.pyx":1814
 *     about.init()
 * 
 *     qtui.fill_header(str2q(config_.APPICON_FILE), str2q(_(config_.APPNAME)),             # <<<<<<<<<<<<<<
 *                      str2q(config_.VERSION), str2q(_(config_.SHORT_DESCRIPTION)))
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_APPICON_FILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_APPNAME); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1814, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1814, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1815
 * 
 *     qtui.fill_header(str2q(config_.APPICON_FILE), str2q(_(config_.APPNAME)),
 *                      str2q(config_.VERSION), str2q(_(config_.SHORT_DESCRIPTION)))             # <<<<<<<<<<<<<<
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),
 *                         str2q(pydata.app.on_dialog_text('about_website')),
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_VERSION); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_SHORT_DESCRIPTION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "_qt_qtwes2.pyx":1814
 *     about.init()
 * 
 *     qtui.fill_header(str2q(config_.APPICON_FILE), str2q(_(config_.APPNAME)),             # <<<<<<<<<<<<<<
 *                      str2q(config_.VERSION), str2q(_(config_.SHORT_DESCRIPTION)))
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),
 */
  __pyx_f_6_qtui__fill_header(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2), __pyx_f_10_qt_qtwes2_str2q(__pyx_t_1), __pyx_f_10_qt_qtwes2_str2q(__pyx_t_6), __pyx_f_10_qt_qtwes2_str2q(__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1816
 *     qtui.fill_header(str2q(config_.APPICON_FILE), str2q(_(config_.APPNAME)),
 *                      str2q(config_.VERSION), str2q(_(config_.SHORT_DESCRIPTION)))
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),             # <<<<<<<<<<<<<<
 *                         str2q(pydata.app.on_dialog_text('about_website')),
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_COPYRIGHT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1817
 *                      str2q(config_.VERSION), str2q(_(config_.SHORT_DESCRIPTION)))
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),
 *                         str2q(pydata.app.on_dialog_text('about_website')),             # <<<<<<<<<<<<<<
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1818
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),
 *                         str2q(pydata.app.on_dialog_text('about_website')),
 *                         str2q(pydata.app.on_dialog_text('about_translators')))             # <<<<<<<<<<<<<<
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_app); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":1816
 *     qtui.fill_header(str2q(config_.APPICON_FILE), str2q(_(config_.APPNAME)),
 *                      str2q(config_.VERSION), str2q(_(config_.SHORT_DESCRIPTION)))
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),             # <<<<<<<<<<<<<<
 *                         str2q(pydata.app.on_dialog_text('about_website')),
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 */
  __pyx_f_6_qtui__fill_about_tab(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_6), __pyx_f_10_qt_qtwes2_str2q(__pyx_t_1), __pyx_f_10_qt_qtwes2_str2q(__pyx_t_2));
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1819
 *                         str2q(pydata.app.on_dialog_text('about_website')),
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))             # <<<<<<<<<<<<<<
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 *     if license_full:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_f_6_qtui__fill_contribute_tab(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1820
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 *     license_full = pydata.app.on_dialog_text('about_license_full')             # <<<<<<<<<<<<<<
 *     if license_full:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_app); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_license_full = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1821
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 *     if license_full:             # <<<<<<<<<<<<<<
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 *                               False, str2q(license_full))
 */
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_license_full); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1821, __pyx_L1_error)
  if (__pyx_t_9) {

    /* "_qt_qtwes2.pyx":1822
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 *     if license_full:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),             # <<<<<<<<<<<<<<
 *                               False, str2q(license_full))
 *     else:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":1823
 *     if license_full:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 *                               False, str2q(license_full))             # <<<<<<<<<<<<<<
 *     else:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 */
    __pyx_f_6_qtui__fill_license_tab(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1), 0, __pyx_f_10_qt_qtwes2_str2q(__pyx_v_license_full));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1821
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 *     if license_full:             # <<<<<<<<<<<<<<
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 *                               False, str2q(license_full))
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":1825
 *                               False, str2q(license_full))
 *     else:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),             # <<<<<<<<<<<<<<
 *                               True, str2q(pydata.app.on_dialog_text('about_license_notfound')))
 *     about.exec()
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_app); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1826
 *     else:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 *                               True, str2q(pydata.app.on_dialog_text('about_license_notfound')))             # <<<<<<<<<<<<<<
 *     about.exec()
 *     about.deleteLater()
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_app); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_on_dialog_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1825
 *                               False, str2q(license_full))
 *     else:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),             # <<<<<<<<<<<<<<
 *                               True, str2q(pydata.app.on_dialog_text('about_license_notfound')))
 *     about.exec()
 */
    __pyx_f_6_qtui__fill_license_tab(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2), 1, __pyx_f_10_qt_qtwes2_str2q(__pyx_t_6));
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":1827
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 *                               True, str2q(pydata.app.on_dialog_text('about_license_notfound')))
 *     about.exec()             # <<<<<<<<<<<<<<
 *     about.deleteLater()
 * ##pxm>IF_END
 */
  __pyx_v_about->exec();

  /* "_qt_qtwes2.pyx":1828
 *                               True, str2q(pydata.app.on_dialog_text('about_license_notfound')))
 *     about.exec()
 *     about.deleteLater()             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * 
 */
  __pyx_v_about->deleteLater();

  /* "_qt_qtwes2.pyx":1809
 * 
 * ##pxm-FUNC P with gil
 * cdef void about_dialog() with gil:             # <<<<<<<<<<<<<<
 *     cdef AboutDialog *about = new AboutDialog(uidata.mainwindow) #px/
 *     #about = AboutDialog(uidata.mainwindow)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("_qt_qtwes2.about_dialog", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_license_full);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":1832
 * 
 * 
 * def initial_resize():             # <<<<<<<<<<<<<<
 *     uidata.width, uidata.height = settings['window.size']
 *     uidata.mainwindow.resize(uidata.width, uidata.height)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_33initial_resize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_33initial_resize = {"initial_resize", (PyCFunction)__pyx_pw_10_qt_qtwes2_33initial_resize, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_33initial_resize(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initial_resize (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_32initial_resize(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_32initial_resize(CYTHON_UNUSED PyObject *__pyx_self) {
  int __pyx_v_s1;
  int __pyx_v_s2;
  int __pyx_v_divider_pos;
  int __pyx_v_divider_pos2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("initial_resize", 0);

  /* "_qt_qtwes2.pyx":1833
 * 
 * def initial_resize():
 *     uidata.width, uidata.height = settings['window.size']             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.resize(uidata.width, uidata.height)
 *     ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_window_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1833, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 1833, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 1833, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_10_qt_qtwes2_uidata.width = __pyx_t_6;
  __pyx_v_10_qt_qtwes2_uidata.height = __pyx_t_7;

  /* "_qt_qtwes2.pyx":1834
 * def initial_resize():
 *     uidata.width, uidata.height = settings['window.size']
 *     uidata.mainwindow.resize(uidata.width, uidata.height)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef int s1=0, s2=0, divider_pos, divider_pos2 #px+
 */
  __pyx_v_10_qt_qtwes2_uidata.mainwindow->resize(__pyx_v_10_qt_qtwes2_uidata.width, __pyx_v_10_qt_qtwes2_uidata.height);

  /* "_qt_qtwes2.pyx":1836
 *     uidata.mainwindow.resize(uidata.width, uidata.height)
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef int s1=0, s2=0, divider_pos, divider_pos2 #px+             # <<<<<<<<<<<<<<
 *     divider_pos = settings['window.divider']
 *     uidata.mainwindow.show()
 */
  __pyx_v_s1 = 0;
  __pyx_v_s2 = 0;

  /* "_qt_qtwes2.pyx":1837
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef int s1=0, s2=0, divider_pos, divider_pos2 #px+
 *     divider_pos = settings['window.divider']             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.show()
 *     qtui.get_splitter_sizes(s1, s2) #px/
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_kp_u_window_divider); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_divider_pos = __pyx_t_7;

  /* "_qt_qtwes2.pyx":1838
 *     cdef int s1=0, s2=0, divider_pos, divider_pos2 #px+
 *     divider_pos = settings['window.divider']
 *     uidata.mainwindow.show()             # <<<<<<<<<<<<<<
 *     qtui.get_splitter_sizes(s1, s2) #px/
 *     #s1, s2 = qtui.get_splitter_sizes()
 */
  __pyx_v_10_qt_qtwes2_uidata.mainwindow->show();

  /* "_qt_qtwes2.pyx":1839
 *     divider_pos = settings['window.divider']
 *     uidata.mainwindow.show()
 *     qtui.get_splitter_sizes(s1, s2) #px/             # <<<<<<<<<<<<<<
 *     #s1, s2 = qtui.get_splitter_sizes()
 *     divider_pos2 = s1 + s2 - divider_pos
 */
  __pyx_f_6_qtui__get_splitter_sizes(__pyx_v_s1, __pyx_v_s2);

  /* "_qt_qtwes2.pyx":1841
 *     qtui.get_splitter_sizes(s1, s2) #px/
 *     #s1, s2 = qtui.get_splitter_sizes()
 *     divider_pos2 = s1 + s2 - divider_pos             # <<<<<<<<<<<<<<
 *     qtui.set_splitter_sizes(divider_pos, divider_pos2)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_v_divider_pos2 = ((__pyx_v_s1 + __pyx_v_s2) - __pyx_v_divider_pos);

  /* "_qt_qtwes2.pyx":1842
 *     #s1, s2 = qtui.get_splitter_sizes()
 *     divider_pos2 = s1 + s2 - divider_pos
 *     qtui.set_splitter_sizes(divider_pos, divider_pos2)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ uidata.mainwindow.show()
 */
  __pyx_f_6_qtui__set_splitter_sizes(__pyx_v_divider_pos, __pyx_v_divider_pos2);

  /* "_qt_qtwes2.pyx":1846
 *     #~ uidata.mainwindow.show()
 *     #~ ##pxm>IF_END
 *     singleShot(20, _on_init_finalize) #px/             # <<<<<<<<<<<<<<
 *     #QTimer.singleShot(20, _on_init_finalize)
 * 
 */
  QTimer::singleShot(20, __pyx_f_10_qt_qtwes2__on_init_finalize);

  /* "_qt_qtwes2.pyx":1832
 * 
 * 
 * def initial_resize():             # <<<<<<<<<<<<<<
 *     uidata.width, uidata.height = settings['window.size']
 *     uidata.mainwindow.resize(uidata.width, uidata.height)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_qt_qtwes2.initial_resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1849
 *     #QTimer.singleShot(20, _on_init_finalize)
 * 
 * def set_title(title):             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.setTitle(str2q(title))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_35set_title(PyObject *__pyx_self, PyObject *__pyx_v_title); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_35set_title = {"set_title", (PyCFunction)__pyx_pw_10_qt_qtwes2_35set_title, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_35set_title(PyObject *__pyx_self, PyObject *__pyx_v_title) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_title (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_34set_title(__pyx_self, ((PyObject *)__pyx_v_title));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_34set_title(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_title) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_title", 0);

  /* "_qt_qtwes2.pyx":1850
 * 
 * def set_title(title):
 *     uidata.mainwindow.setTitle(str2q(title))             # <<<<<<<<<<<<<<
 * 
 * def load_ui(path):
 */
  __pyx_v_10_qt_qtwes2_uidata.mainwindow->setWindowTitle(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_title));

  /* "_qt_qtwes2.pyx":1849
 *     #QTimer.singleShot(20, _on_init_finalize)
 * 
 * def set_title(title):             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.setTitle(str2q(title))
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1852
 *     uidata.mainwindow.setTitle(str2q(title))
 * 
 * def load_ui(path):             # <<<<<<<<<<<<<<
 *     pass
 *     ##pxm>IF 'qtw' == 'qtq'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_37load_ui(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_37load_ui = {"load_ui", (PyCFunction)__pyx_pw_10_qt_qtwes2_37load_ui, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_37load_ui(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_ui (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_36load_ui(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_36load_ui(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_path) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_ui", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1865
 *     #~ ##pxm>IF_END
 * 
 * def close_mainwindow():             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_39close_mainwindow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_39close_mainwindow = {"close_mainwindow", (PyCFunction)__pyx_pw_10_qt_qtwes2_39close_mainwindow, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_39close_mainwindow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_mainwindow (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_38close_mainwindow(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_38close_mainwindow(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close_mainwindow", 0);

  /* "_qt_qtwes2.pyx":1866
 * 
 * def close_mainwindow():
 *     uidata.mainwindow.close()             # <<<<<<<<<<<<<<
 * 
 * def get_samples():
 */
  __pyx_v_10_qt_qtwes2_uidata.mainwindow->close();

  /* "_qt_qtwes2.pyx":1865
 *     #~ ##pxm>IF_END
 * 
 * def close_mainwindow():             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1868
 *     uidata.mainwindow.close()
 * 
 * def get_samples():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     #TODO: uidata.drawingarea.format().samples() returns only 0 here
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_41get_samples(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_41get_samples = {"get_samples", (PyCFunction)__pyx_pw_10_qt_qtwes2_41get_samples, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_41get_samples(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_samples (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_40get_samples(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_40get_samples(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_samples", 0);

  /* "_qt_qtwes2.pyx":1871
 *     ##pxm>IF 'qtw' == 'qtw'
 *     #TODO: uidata.drawingarea.format().samples() returns only 0 here
 *     return defaultFormat().samples()             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ return uidata.mainwindow.format().samples()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(QSurfaceFormat::defaultFormat().samples()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1868
 *     uidata.mainwindow.close()
 * 
 * def get_samples():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     #TODO: uidata.drawingarea.format().samples() returns only 0 here
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.get_samples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1876
 *     #~ ##pxm>IF_END
 * 
 * def update_drawingarea():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.update()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_43update_drawingarea(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_43update_drawingarea = {"update_drawingarea", (PyCFunction)__pyx_pw_10_qt_qtwes2_43update_drawingarea, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_43update_drawingarea(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_drawingarea (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_42update_drawingarea(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_42update_drawingarea(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_drawingarea", 0);

  /* "_qt_qtwes2.pyx":1878
 * def update_drawingarea():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.update()             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ uidata.mainwindow.update()
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->update();

  /* "_qt_qtwes2.pyx":1876
 *     #~ ##pxm>IF_END
 * 
 * def update_drawingarea():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.update()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1883
 *     #~ ##pxm>IF_END
 * 
 * def set_cursor(index):             # <<<<<<<<<<<<<<
 *     if index < 0:
 *         index += 18
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_45set_cursor(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_45set_cursor = {"set_cursor", (PyCFunction)__pyx_pw_10_qt_qtwes2_45set_cursor, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_45set_cursor(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_cursor (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_44set_cursor(__pyx_self, ((PyObject *)__pyx_v_index));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_44set_cursor(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("set_cursor", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "_qt_qtwes2.pyx":1884
 * 
 * def set_cursor(index):
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += 18
 *     ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "_qt_qtwes2.pyx":1885
 * def set_cursor(index):
 *     if index < 0:
 *         index += 18             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.setCursor(uidata.cursors[index][0]) #px/
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_18, 18, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":1884
 * 
 * def set_cursor(index):
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += 18
 *     ##pxm>IF 'qtw' == 'qtw'
 */
  }

  /* "_qt_qtwes2.pyx":1887
 *         index += 18
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.setCursor(uidata.cursors[index][0]) #px/             # <<<<<<<<<<<<<<
 *     #uidata.drawingarea.setCursor(uidata.cursors[index])
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1887, __pyx_L1_error)
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->setCursor(((__pyx_v_10_qt_qtwes2_uidata.cursors[__pyx_t_3])[0]));

  /* "_qt_qtwes2.pyx":1883
 *     #~ ##pxm>IF_END
 * 
 * def set_cursor(index):             # <<<<<<<<<<<<<<
 *     if index < 0:
 *         index += 18
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.set_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1895
 *     #~ ##pxm>IF_END
 * 
 * def unset_cursor():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.unsetCursor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_47unset_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_47unset_cursor = {"unset_cursor", (PyCFunction)__pyx_pw_10_qt_qtwes2_47unset_cursor, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_47unset_cursor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unset_cursor (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_46unset_cursor(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_46unset_cursor(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unset_cursor", 0);

  /* "_qt_qtwes2.pyx":1897
 * def unset_cursor():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.unsetCursor()             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ if uidata.entered:
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->unsetCursor();

  /* "_qt_qtwes2.pyx":1895
 *     #~ ##pxm>IF_END
 * 
 * def unset_cursor():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.unsetCursor()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1913
 * #~ ##pxm>IF_END
 * 
 * def save_screenshot(filename):             # <<<<<<<<<<<<<<
 *     IF OFFSCREEN: #px+
 *         cdef QImage image #px+
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_49save_screenshot(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_49save_screenshot = {"save_screenshot", (PyCFunction)__pyx_pw_10_qt_qtwes2_49save_screenshot, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_49save_screenshot(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("save_screenshot (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_48save_screenshot(__pyx_self, ((PyObject *)__pyx_v_filename));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_48save_screenshot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  QPixmap __pyx_v_image;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("save_screenshot", 0);

  /* "_qt_qtwes2.pyx":1921
 *     ##pxm>IF 'qtw' == 'qtw'
 *         cdef QPixmap image #px+
 *         image = uidata.mainwindow.grab()             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *         #~ cdef QImage image
 */
  __pyx_v_image = __pyx_v_10_qt_qtwes2_uidata.mainwindow->grab();

  /* "_qt_qtwes2.pyx":1926
 *         #~ image = uidata.mainwindow.grabWindow()
 *     #~ ##pxm>IF_END
 *     if not (debug & DEBUG_SIM):             # <<<<<<<<<<<<<<
 *         image.save(str2q(filename), NULL, -1)
 * 
 */
  __pyx_t_1 = ((!((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_SIM) != 0)) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1927
 *     #~ ##pxm>IF_END
 *     if not (debug & DEBUG_SIM):
 *         image.save(str2q(filename), NULL, -1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_image.save(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_filename), NULL, -1);

    /* "_qt_qtwes2.pyx":1926
 *         #~ image = uidata.mainwindow.grabWindow()
 *     #~ ##pxm>IF_END
 *     if not (debug & DEBUG_SIM):             # <<<<<<<<<<<<<<
 *         image.save(str2q(filename), NULL, -1)
 * 
 */
  }

  /* "_qt_qtwes2.pyx":1913
 * #~ ##pxm>IF_END
 * 
 * def save_screenshot(filename):             # <<<<<<<<<<<<<<
 *     IF OFFSCREEN: #px+
 *         cdef QImage image #px+
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1932
 * #### misc qt ####
 * 
 * def parse_color(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_51parse_color(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_51parse_color = {"parse_color", (PyCFunction)__pyx_pw_10_qt_qtwes2_51parse_color, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_51parse_color(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse_color (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_50parse_color(__pyx_self, ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_50parse_color(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  QColor __pyx_v_color;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("parse_color", 0);

  /* "_qt_qtwes2.pyx":1935
 *     cdef QColor color #px/
 *     #color = QColor()
 *     color.setNamedColor(str2q(name))             # <<<<<<<<<<<<<<
 *     return color.red(), color.green(), color.blue()
 * 
 */
  __pyx_v_color.setNamedColor(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_name));

  /* "_qt_qtwes2.pyx":1936
 *     #color = QColor()
 *     color.setNamedColor(str2q(name))
 *     return color.red(), color.green(), color.blue()             # <<<<<<<<<<<<<<
 * 
 * def parse_color_f(name):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_color.red()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_color.green()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_color.blue()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1932
 * #### misc qt ####
 * 
 * def parse_color(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_qt_qtwes2.parse_color", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1938
 *     return color.red(), color.green(), color.blue()
 * 
 * def parse_color_f(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_53parse_color_f(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_53parse_color_f = {"parse_color_f", (PyCFunction)__pyx_pw_10_qt_qtwes2_53parse_color_f, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_53parse_color_f(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse_color_f (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_52parse_color_f(__pyx_self, ((PyObject *)__pyx_v_name));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_52parse_color_f(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  QColor __pyx_v_color;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("parse_color_f", 0);

  /* "_qt_qtwes2.pyx":1941
 *     cdef QColor color #px/
 *     #color = QColor()
 *     color.setNamedColor(str2q(name))             # <<<<<<<<<<<<<<
 *     return color.redF(), color.greenF(), color.blueF()
 * 
 */
  __pyx_v_color.setNamedColor(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_name));

  /* "_qt_qtwes2.pyx":1942
 *     #color = QColor()
 *     color.setNamedColor(str2q(name))
 *     return color.redF(), color.greenF(), color.blueF()             # <<<<<<<<<<<<<<
 * 
 * def load_image_from_file(filename, maxsize):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_color.redF()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_color.greenF()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_color.blueF()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1938
 *     return color.red(), color.green(), color.blue()
 * 
 * def parse_color_f(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_qt_qtwes2.parse_color_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1944
 *     return color.redF(), color.greenF(), color.blueF()
 * 
 * def load_image_from_file(filename, maxsize):             # <<<<<<<<<<<<<<
 *     cdef int width, height, scaled_width, scaled_height #px+
 *     cdef bytes data #px+
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_55load_image_from_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_55load_image_from_file = {"load_image_from_file", (PyCFunction)__pyx_pw_10_qt_qtwes2_55load_image_from_file, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_55load_image_from_file(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_maxsize = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_image_from_file (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_maxsize,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxsize)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("load_image_from_file", 1, 2, 2, 1); __PYX_ERR(0, 1944, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_image_from_file") < 0)) __PYX_ERR(0, 1944, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_filename = values[0];
    __pyx_v_maxsize = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_image_from_file", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1944, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.load_image_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_54load_image_from_file(__pyx_self, __pyx_v_filename, __pyx_v_maxsize);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_54load_image_from_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_maxsize) {
  int __pyx_v_width;
  int __pyx_v_height;
  int __pyx_v_scaled_width;
  int __pyx_v_scaled_height;
  PyObject *__pyx_v_data = 0;
  QImage __pyx_v_image;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("load_image_from_file", 0);

  /* "_qt_qtwes2.pyx":1949
 *     cdef QImage image #px/
 *     #image = QImage()
 *     image.load(str2q(filename), NULL)             # <<<<<<<<<<<<<<
 *     if image.isNull():
 *         return None
 */
  __pyx_v_image.load(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_filename), NULL);

  /* "_qt_qtwes2.pyx":1950
 *     #image = QImage()
 *     image.load(str2q(filename), NULL)
 *     if image.isNull():             # <<<<<<<<<<<<<<
 *         return None
 *     # scale the image to size 2^n for OpenGL
 */
  __pyx_t_1 = (__pyx_v_image.isNull() != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1951
 *     image.load(str2q(filename), NULL)
 *     if image.isNull():
 *         return None             # <<<<<<<<<<<<<<
 *     # scale the image to size 2^n for OpenGL
 *     width = image.width()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":1950
 *     #image = QImage()
 *     image.load(str2q(filename), NULL)
 *     if image.isNull():             # <<<<<<<<<<<<<<
 *         return None
 *     # scale the image to size 2^n for OpenGL
 */
  }

  /* "_qt_qtwes2.pyx":1953
 *         return None
 *     # scale the image to size 2^n for OpenGL
 *     width = image.width()             # <<<<<<<<<<<<<<
 *     height = image.height()
 *     if width < 1 or height < 1:
 */
  __pyx_v_width = __pyx_v_image.width();

  /* "_qt_qtwes2.pyx":1954
 *     # scale the image to size 2^n for OpenGL
 *     width = image.width()
 *     height = image.height()             # <<<<<<<<<<<<<<
 *     if width < 1 or height < 1:
 *         return None
 */
  __pyx_v_height = __pyx_v_image.height();

  /* "_qt_qtwes2.pyx":1955
 *     width = image.width()
 *     height = image.height()
 *     if width < 1 or height < 1:             # <<<<<<<<<<<<<<
 *         return None
 *     scaled_width = maxsize
 */
  __pyx_t_2 = ((__pyx_v_width < 1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_height < 1) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":1956
 *     height = image.height()
 *     if width < 1 or height < 1:
 *         return None             # <<<<<<<<<<<<<<
 *     scaled_width = maxsize
 *     while scaled_width > width:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":1955
 *     width = image.width()
 *     height = image.height()
 *     if width < 1 or height < 1:             # <<<<<<<<<<<<<<
 *         return None
 *     scaled_width = maxsize
 */
  }

  /* "_qt_qtwes2.pyx":1957
 *     if width < 1 or height < 1:
 *         return None
 *     scaled_width = maxsize             # <<<<<<<<<<<<<<
 *     while scaled_width > width:
 *         scaled_width //= 2
 */
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_maxsize); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1957, __pyx_L1_error)
  __pyx_v_scaled_width = __pyx_t_3;

  /* "_qt_qtwes2.pyx":1958
 *         return None
 *     scaled_width = maxsize
 *     while scaled_width > width:             # <<<<<<<<<<<<<<
 *         scaled_width //= 2
 *     scaled_height = maxsize
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_scaled_width > __pyx_v_width) != 0);
    if (!__pyx_t_1) break;

    /* "_qt_qtwes2.pyx":1959
 *     scaled_width = maxsize
 *     while scaled_width > width:
 *         scaled_width //= 2             # <<<<<<<<<<<<<<
 *     scaled_height = maxsize
 *     while scaled_height > height:
 */
    __pyx_v_scaled_width = __Pyx_div_long(__pyx_v_scaled_width, 2);
  }

  /* "_qt_qtwes2.pyx":1960
 *     while scaled_width > width:
 *         scaled_width //= 2
 *     scaled_height = maxsize             # <<<<<<<<<<<<<<
 *     while scaled_height > height:
 *         scaled_height //= 2
 */
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_maxsize); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1960, __pyx_L1_error)
  __pyx_v_scaled_height = __pyx_t_3;

  /* "_qt_qtwes2.pyx":1961
 *         scaled_width //= 2
 *     scaled_height = maxsize
 *     while scaled_height > height:             # <<<<<<<<<<<<<<
 *         scaled_height //= 2
 *     image = image.scaled(scaled_width, scaled_height, Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_scaled_height > __pyx_v_height) != 0);
    if (!__pyx_t_1) break;

    /* "_qt_qtwes2.pyx":1962
 *     scaled_height = maxsize
 *     while scaled_height > height:
 *         scaled_height //= 2             # <<<<<<<<<<<<<<
 *     image = image.scaled(scaled_width, scaled_height, Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
 *     image = image.convertToFormat(Format_RGBA8888, Qt.AutoColor)
 */
    __pyx_v_scaled_height = __Pyx_div_long(__pyx_v_scaled_height, 2);
  }

  /* "_qt_qtwes2.pyx":1963
 *     while scaled_height > height:
 *         scaled_height //= 2
 *     image = image.scaled(scaled_width, scaled_height, Qt.IgnoreAspectRatio, Qt.SmoothTransformation)             # <<<<<<<<<<<<<<
 *     image = image.convertToFormat(Format_RGBA8888, Qt.AutoColor)
 *     data = image.bits()[:image.byteCount()] #px+
 */
  __pyx_v_image = __pyx_v_image.scaled(__pyx_v_scaled_width, __pyx_v_scaled_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);

  /* "_qt_qtwes2.pyx":1964
 *         scaled_height //= 2
 *     image = image.scaled(scaled_width, scaled_height, Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
 *     image = image.convertToFormat(Format_RGBA8888, Qt.AutoColor)             # <<<<<<<<<<<<<<
 *     data = image.bits()[:image.byteCount()] #px+
 *     ##px:
 */
  __pyx_v_image = __pyx_v_image.convertToFormat(QImage::Format_RGBA8888, Qt::AutoColor);

  /* "_qt_qtwes2.pyx":1965
 *     image = image.scaled(scaled_width, scaled_height, Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
 *     image = image.convertToFormat(Format_RGBA8888, Qt.AutoColor)
 *     data = image.bits()[:image.byteCount()] #px+             # <<<<<<<<<<<<<<
 *     ##px:
 *     #data = image.bits()
 */
  __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_image.bits()) + 0, __pyx_v_image.byteCount() - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_data = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1971
 *     #data = bytes(data)
 *     ##px.
 *     return image.width(), image.height(), data             # <<<<<<<<<<<<<<
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_image.width()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_image.height()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_data);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1944
 *     return color.redF(), color.greenF(), color.blueF()
 * 
 * def load_image_from_file(filename, maxsize):             # <<<<<<<<<<<<<<
 *     cdef int width, height, scaled_width, scaled_height #px+
 *     cdef bytes data #px+
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_qt_qtwes2.load_image_from_file", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1975
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef QIcon get_icon(filename):             # <<<<<<<<<<<<<<
 *     cdef QPixmap pixmap #px+
 *     from ..theme import Theme
 */

static QIcon __pyx_f_10_qt_qtwes2_get_icon(PyObject *__pyx_v_filename) {
  QPixmap __pyx_v_pixmap;
  PyObject *__pyx_v_Theme = NULL;
  PyObject *__pyx_v_image = NULL;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_data = NULL;
  QIcon __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  uchar const *__pyx_t_10;
  __Pyx_RefNannySetupContext("get_icon", 0);

  /* "_qt_qtwes2.pyx":1977
 * cdef QIcon get_icon(filename):
 *     cdef QPixmap pixmap #px+
 *     from ..theme import Theme             # <<<<<<<<<<<<<<
 *     image = Theme.textures.image_from_file(filename)
 *     if image is None:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Theme);
  __Pyx_GIVEREF(__pyx_n_s_Theme);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Theme);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_theme, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Theme); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_Theme = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1978
 *     cdef QPixmap pixmap #px+
 *     from ..theme import Theme
 *     image = Theme.textures.image_from_file(filename)             # <<<<<<<<<<<<<<
 *     if image is None:
 *         return QIcon()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_Theme, __pyx_n_s_textures); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_image_from_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_filename};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_filename};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(__pyx_v_filename);
      __Pyx_GIVEREF(__pyx_v_filename);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_image = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":1979
 *     from ..theme import Theme
 *     image = Theme.textures.image_from_file(filename)
 *     if image is None:             # <<<<<<<<<<<<<<
 *         return QIcon()
 *     else:
 */
  __pyx_t_5 = (__pyx_v_image == Py_None);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "_qt_qtwes2.pyx":1980
 *     image = Theme.textures.image_from_file(filename)
 *     if image is None:
 *         return QIcon()             # <<<<<<<<<<<<<<
 *     else:
 *         width, height, data = image
 */
    __pyx_r = QIcon();
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":1979
 *     from ..theme import Theme
 *     image = Theme.textures.image_from_file(filename)
 *     if image is None:             # <<<<<<<<<<<<<<
 *         return QIcon()
 *     else:
 */
  }

  /* "_qt_qtwes2.pyx":1982
 *         return QIcon()
 *     else:
 *         width, height, data = image             # <<<<<<<<<<<<<<
 *         pixmap = QPixmap(width, height)
 *         pixmap.convertFromImage(QImage(data, width, height, Format_RGBA8888))
 */
  /*else*/ {
    if ((likely(PyTuple_CheckExact(__pyx_v_image))) || (PyList_CheckExact(__pyx_v_image))) {
      PyObject* sequence = __pyx_v_image;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1982, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1982, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_v_image); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_1), 3) < 0) __PYX_ERR(0, 1982, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 1982, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_width = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_height = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_data = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "_qt_qtwes2.pyx":1983
 *     else:
 *         width, height, data = image
 *         pixmap = QPixmap(width, height)             # <<<<<<<<<<<<<<
 *         pixmap.convertFromImage(QImage(data, width, height, Format_RGBA8888))
 *         return QIcon(pixmap)
 */
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L1_error)
    __pyx_v_pixmap = QPixmap(__pyx_t_8, __pyx_t_9);

    /* "_qt_qtwes2.pyx":1984
 *         width, height, data = image
 *         pixmap = QPixmap(width, height)
 *         pixmap.convertFromImage(QImage(data, width, height, Format_RGBA8888))             # <<<<<<<<<<<<<<
 *         return QIcon(pixmap)
 * ##pxm>IF_END
 */
    __pyx_t_10 = __Pyx_PyObject_AsUString(__pyx_v_data); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L1_error)
    __pyx_v_pixmap.convertFromImage(QImage(__pyx_t_10, __pyx_t_9, __pyx_t_8, QImage::Format_RGBA8888));

    /* "_qt_qtwes2.pyx":1985
 *         pixmap = QPixmap(width, height)
 *         pixmap.convertFromImage(QImage(data, width, height, Format_RGBA8888))
 *         return QIcon(pixmap)             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * 
 */
    __pyx_r = QIcon(__pyx_v_pixmap);
    goto __pyx_L0;
  }

  /* "_qt_qtwes2.pyx":1975
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef QIcon get_icon(filename):             # <<<<<<<<<<<<<<
 *     cdef QPixmap pixmap #px+
 *     from ..theme import Theme
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("_qt_qtwes2.get_icon", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Theme);
  __Pyx_XDECREF(__pyx_v_image);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1988
 * ##pxm>IF_END
 * 
 * def keyval_from_name(keystr):             # <<<<<<<<<<<<<<
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_57keyval_from_name(PyObject *__pyx_self, PyObject *__pyx_v_keystr); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_57keyval_from_name = {"keyval_from_name", (PyCFunction)__pyx_pw_10_qt_qtwes2_57keyval_from_name, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_57keyval_from_name(PyObject *__pyx_self, PyObject *__pyx_v_keystr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keyval_from_name (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_56keyval_from_name(__pyx_self, ((PyObject *)__pyx_v_keystr));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10_qt_qtwes2_16keyval_from_name_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "_qt_qtwes2.pyx":1989
 * 
 * def keyval_from_name(keystr):
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))             # <<<<<<<<<<<<<<
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 *     #keyseq = fromString(keystr, PortableText)
 */

static PyObject *__pyx_pf_10_qt_qtwes2_16keyval_from_name_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10_qt_qtwes2___pyx_scope_struct_1_genexpr(__pyx_ptype_10_qt_qtwes2___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1989, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10_qt_qtwes2_16keyval_from_name_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_keyval_from_name_locals_genexpr, __pyx_n_s_qt_qtwes2); if (unlikely(!gen)) __PYX_ERR(0, 1989, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_qt_qtwes2.keyval_from_name.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10_qt_qtwes2_16keyval_from_name_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_keystr)) { __Pyx_RaiseClosureNameError("keystr"); __PYX_ERR(0, 1989, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_keystr, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1989, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1989, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1989, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1989, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_k, __pyx_n_u_KP, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1989, __pyx_L1_error)
    if (__pyx_t_5) {
      __Pyx_INCREF(__pyx_n_u_Num);
      __pyx_t_2 = __pyx_n_u_Num;
    } else {
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_k);
      __pyx_t_2 = __pyx_cur_scope->__pyx_v_k;
    }
    if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1989, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1988
 * ##pxm>IF_END
 * 
 * def keyval_from_name(keystr):             # <<<<<<<<<<<<<<
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 */

static PyObject *__pyx_pf_10_qt_qtwes2_56keyval_from_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keystr) {
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *__pyx_cur_scope;
  QKeySequence __pyx_v_keyseq;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("keyval_from_name", 0);
  __pyx_cur_scope = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *)__pyx_tp_new_10_qt_qtwes2___pyx_scope_struct__keyval_from_name(__pyx_ptype_10_qt_qtwes2___pyx_scope_struct__keyval_from_name, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 1988, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_keystr = __pyx_v_keystr;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_keystr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_keystr);

  /* "_qt_qtwes2.pyx":1989
 * 
 * def keyval_from_name(keystr):
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))             # <<<<<<<<<<<<<<
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 *     #keyseq = fromString(keystr, PortableText)
 */
  __pyx_t_1 = __pyx_pf_10_qt_qtwes2_16keyval_from_name_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__22, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_keystr);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_keystr, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1990
 * def keyval_from_name(keystr):
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/             # <<<<<<<<<<<<<<
 *     #keyseq = fromString(keystr, PortableText)
 *     if keyseq.count() == 0:
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_keystr;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_keyseq = QKeySequence::fromString(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1), QKeySequence::PortableText);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":1992
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 *     #keyseq = fromString(keystr, PortableText)
 *     if keyseq.count() == 0:             # <<<<<<<<<<<<<<
 *         return 0
 *     return keyseq[0]
 */
  __pyx_t_3 = ((__pyx_v_keyseq.count() == 0) != 0);
  if (__pyx_t_3) {

    /* "_qt_qtwes2.pyx":1993
 *     #keyseq = fromString(keystr, PortableText)
 *     if keyseq.count() == 0:
 *         return 0             # <<<<<<<<<<<<<<
 *     return keyseq[0]
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":1992
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 *     #keyseq = fromString(keystr, PortableText)
 *     if keyseq.count() == 0:             # <<<<<<<<<<<<<<
 *         return 0
 *     return keyseq[0]
 */
  }

  /* "_qt_qtwes2.pyx":1994
 *     if keyseq.count() == 0:
 *         return 0
 *     return keyseq[0]             # <<<<<<<<<<<<<<
 * 
 * def get_pictures_folder():
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_keyseq[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1988
 * ##pxm>IF_END
 * 
 * def keyval_from_name(keystr):             # <<<<<<<<<<<<<<
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_qt_qtwes2.keyval_from_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":1996
 *     return keyseq[0]
 * 
 * def get_pictures_folder():             # <<<<<<<<<<<<<<
 *     cdef QStringList locations = standardLocations(PicturesLocation) #px/
 *     #locations = standardLocations(PicturesLocation)
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_59get_pictures_folder(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_59get_pictures_folder = {"get_pictures_folder", (PyCFunction)__pyx_pw_10_qt_qtwes2_59get_pictures_folder, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_59get_pictures_folder(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_pictures_folder (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_58get_pictures_folder(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_58get_pictures_folder(CYTHON_UNUSED PyObject *__pyx_self) {
  QStringList __pyx_v_locations;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_pictures_folder", 0);

  /* "_qt_qtwes2.pyx":1997
 * 
 * def get_pictures_folder():
 *     cdef QStringList locations = standardLocations(PicturesLocation) #px/             # <<<<<<<<<<<<<<
 *     #locations = standardLocations(PicturesLocation)
 *     if locations.size() <= 0: #px/
 */
  __pyx_v_locations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);

  /* "_qt_qtwes2.pyx":1999
 *     cdef QStringList locations = standardLocations(PicturesLocation) #px/
 *     #locations = standardLocations(PicturesLocation)
 *     if locations.size() <= 0: #px/             # <<<<<<<<<<<<<<
 *     #if not locations:
 *         locations = standardLocations(HomeLocation)
 */
  __pyx_t_1 = ((__pyx_v_locations.size() <= 0) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":2001
 *     if locations.size() <= 0: #px/
 *     #if not locations:
 *         locations = standardLocations(HomeLocation)             # <<<<<<<<<<<<<<
 *         if locations.size() <= 0: #px/
 *         #if not locations:
 */
    __pyx_v_locations = QStandardPaths::standardLocations(QStandardPaths::HomeLocation);

    /* "_qt_qtwes2.pyx":2002
 *     #if not locations:
 *         locations = standardLocations(HomeLocation)
 *         if locations.size() <= 0: #px/             # <<<<<<<<<<<<<<
 *         #if not locations:
 *             return ''
 */
    __pyx_t_1 = ((__pyx_v_locations.size() <= 0) != 0);
    if (__pyx_t_1) {

      /* "_qt_qtwes2.pyx":2004
 *         if locations.size() <= 0: #px/
 *         #if not locations:
 *             return ''             # <<<<<<<<<<<<<<
 *     return q2str(locations[0])
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_kp_u__6);
      __pyx_r = __pyx_kp_u__6;
      goto __pyx_L0;

      /* "_qt_qtwes2.pyx":2002
 *     #if not locations:
 *         locations = standardLocations(HomeLocation)
 *         if locations.size() <= 0: #px/             # <<<<<<<<<<<<<<
 *         #if not locations:
 *             return ''
 */
    }

    /* "_qt_qtwes2.pyx":1999
 *     cdef QStringList locations = standardLocations(PicturesLocation) #px/
 *     #locations = standardLocations(PicturesLocation)
 *     if locations.size() <= 0: #px/             # <<<<<<<<<<<<<<
 *     #if not locations:
 *         locations = standardLocations(HomeLocation)
 */
  }

  /* "_qt_qtwes2.pyx":2005
 *         #if not locations:
 *             return ''
 *     return q2str(locations[0])             # <<<<<<<<<<<<<<
 * 
 * def get_imagefile(facekey):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_10_qt_qtwes2_q2str((__pyx_v_locations[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":1996
 *     return keyseq[0]
 * 
 * def get_pictures_folder():             # <<<<<<<<<<<<<<
 *     cdef QStringList locations = standardLocations(PicturesLocation) #px/
 *     #locations = standardLocations(PicturesLocation)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_qt_qtwes2.get_pictures_folder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2007
 *     return q2str(locations[0])
 * 
 * def get_imagefile(facekey):             # <<<<<<<<<<<<<<
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_61get_imagefile(PyObject *__pyx_self, PyObject *__pyx_v_facekey); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_61get_imagefile = {"get_imagefile", (PyCFunction)__pyx_pw_10_qt_qtwes2_61get_imagefile, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_61get_imagefile(PyObject *__pyx_self, PyObject *__pyx_v_facekey) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_imagefile (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_60get_imagefile(__pyx_self, ((PyObject *)__pyx_v_facekey));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_60get_imagefile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_facekey) {
  PyObject *__pyx_v_imagefile = NULL;
  PyObject *__pyx_v_currentfolder = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("get_imagefile", 0);

  /* "_qt_qtwes2.pyx":2008
 * 
 * def get_imagefile(facekey):
 *     imagefile = settings['theme.faces',facekey,'image']             # <<<<<<<<<<<<<<
 *     currentfolder = get_pictures_folder()
 *     if imagefile.startswith('/'):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_kp_u_theme_faces);
  __Pyx_GIVEREF(__pyx_kp_u_theme_faces);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_theme_faces);
  __Pyx_INCREF(__pyx_v_facekey);
  __Pyx_GIVEREF(__pyx_v_facekey);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_facekey);
  __Pyx_INCREF(__pyx_n_u_image);
  __Pyx_GIVEREF(__pyx_n_u_image);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_image);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_imagefile = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":2009
 * def get_imagefile(facekey):
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()             # <<<<<<<<<<<<<<
 *     if imagefile.startswith('/'):
 *         currentfolder = os.path.dirname(imagefile)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_pictures_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_currentfolder = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":2010
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()
 *     if imagefile.startswith('/'):             # <<<<<<<<<<<<<<
 *         currentfolder = os.path.dirname(imagefile)
 *     elif imagefile:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_imagefile, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":2011
 *     currentfolder = get_pictures_folder()
 *     if imagefile.startswith('/'):
 *         currentfolder = os.path.dirname(imagefile)             # <<<<<<<<<<<<<<
 *     elif imagefile:
 *         imagefile = os.path.join(config_.UI_DIR, 'images', imagefile)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dirname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_imagefile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2011, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_imagefile};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2011, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_imagefile};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2011, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_INCREF(__pyx_v_imagefile);
        __Pyx_GIVEREF(__pyx_v_imagefile);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_imagefile);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_currentfolder, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2010
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()
 *     if imagefile.startswith('/'):             # <<<<<<<<<<<<<<
 *         currentfolder = os.path.dirname(imagefile)
 *     elif imagefile:
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":2012
 *     if imagefile.startswith('/'):
 *         currentfolder = os.path.dirname(imagefile)
 *     elif imagefile:             # <<<<<<<<<<<<<<
 *         imagefile = os.path.join(config_.UI_DIR, 'images', imagefile)
 *     return currentfolder, imagefile
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_imagefile); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2012, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":2013
 *         currentfolder = os.path.dirname(imagefile)
 *     elif imagefile:
 *         imagefile = os.path.join(config_.UI_DIR, 'images', imagefile)             # <<<<<<<<<<<<<<
 *     return currentfolder, imagefile
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_UI_DIR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_1, __pyx_n_u_images, __pyx_v_imagefile};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_1, __pyx_n_u_images, __pyx_v_imagefile};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2013, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_1);
      __Pyx_INCREF(__pyx_n_u_images);
      __Pyx_GIVEREF(__pyx_n_u_images);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_u_images);
      __Pyx_INCREF(__pyx_v_imagefile);
      __Pyx_GIVEREF(__pyx_v_imagefile);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_imagefile);
      __pyx_t_1 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_imagefile, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2012
 *     if imagefile.startswith('/'):
 *         currentfolder = os.path.dirname(imagefile)
 *     elif imagefile:             # <<<<<<<<<<<<<<
 *         imagefile = os.path.join(config_.UI_DIR, 'images', imagefile)
 *     return currentfolder, imagefile
 */
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":2014
 *     elif imagefile:
 *         imagefile = os.path.join(config_.UI_DIR, 'images', imagefile)
 *     return currentfolder, imagefile             # <<<<<<<<<<<<<<
 * 
 * def text_to_html(text):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_currentfolder);
  __Pyx_GIVEREF(__pyx_v_currentfolder);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_currentfolder);
  __Pyx_INCREF(__pyx_v_imagefile);
  __Pyx_GIVEREF(__pyx_v_imagefile);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_imagefile);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":2007
 *     return q2str(locations[0])
 * 
 * def get_imagefile(facekey):             # <<<<<<<<<<<<<<
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_qt_qtwes2.get_imagefile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_imagefile);
  __Pyx_XDECREF(__pyx_v_currentfolder);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2016
 *     return currentfolder, imagefile
 * 
 * def text_to_html(text):             # <<<<<<<<<<<<<<
 *     return q2str(fromPlainText(str2q(text)).toHtml())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_63text_to_html(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_63text_to_html = {"text_to_html", (PyCFunction)__pyx_pw_10_qt_qtwes2_63text_to_html, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_63text_to_html(PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("text_to_html (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_62text_to_html(__pyx_self, ((PyObject *)__pyx_v_text));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_62text_to_html(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_text) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("text_to_html", 0);

  /* "_qt_qtwes2.pyx":2017
 * 
 * def text_to_html(text):
 *     return q2str(fromPlainText(str2q(text)).toHtml())             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P with gil
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_q2str(QTextDocumentFragment::fromPlainText(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_text)).toHtml()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_qt_qtwes2.pyx":2016
 *     return currentfolder, imagefile
 * 
 * def text_to_html(text):             # <<<<<<<<<<<<<<
 *     return q2str(fromPlainText(str2q(text)).toHtml())
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.text_to_html", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2020
 * 
 * ##pxm-FUNC P with gil
 * cdef void _on_filesystemwatcher_changed_1(const QString &qpath) with gil:             # <<<<<<<<<<<<<<
 *     if pydata.filesystemwatcher_path is not None:
 *         return
 */

static void __pyx_f_10_qt_qtwes2__on_filesystemwatcher_changed_1(QString const &__pyx_v_qpath) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_filesystemwatcher_changed_1", 0);

  /* "_qt_qtwes2.pyx":2021
 * ##pxm-FUNC P with gil
 * cdef void _on_filesystemwatcher_changed_1(const QString &qpath) with gil:
 *     if pydata.filesystemwatcher_path is not None:             # <<<<<<<<<<<<<<
 *         return
 *     pydata.filesystemwatcher_path = q2str(qpath)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_filesystemwatcher_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":2022
 * cdef void _on_filesystemwatcher_changed_1(const QString &qpath) with gil:
 *     if pydata.filesystemwatcher_path is not None:
 *         return             # <<<<<<<<<<<<<<
 *     pydata.filesystemwatcher_path = q2str(qpath)
 *     singleShot(100, _on_filesystemwatcher_changed_2) #px/
 */
    goto __pyx_L0;

    /* "_qt_qtwes2.pyx":2021
 * ##pxm-FUNC P with gil
 * cdef void _on_filesystemwatcher_changed_1(const QString &qpath) with gil:
 *     if pydata.filesystemwatcher_path is not None:             # <<<<<<<<<<<<<<
 *         return
 *     pydata.filesystemwatcher_path = q2str(qpath)
 */
  }

  /* "_qt_qtwes2.pyx":2023
 *     if pydata.filesystemwatcher_path is not None:
 *         return
 *     pydata.filesystemwatcher_path = q2str(qpath)             # <<<<<<<<<<<<<<
 *     singleShot(100, _on_filesystemwatcher_changed_2) #px/
 *     #QTimer.singleShot(100, _on_filesystemwatcher_changed_2)
 */
  __pyx_t_2 = __pyx_f_10_qt_qtwes2_q2str(__pyx_v_qpath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_filesystemwatcher_path, __pyx_t_2) < 0) __PYX_ERR(0, 2023, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2024
 *         return
 *     pydata.filesystemwatcher_path = q2str(qpath)
 *     singleShot(100, _on_filesystemwatcher_changed_2) #px/             # <<<<<<<<<<<<<<
 *     #QTimer.singleShot(100, _on_filesystemwatcher_changed_2)
 * ##pxm-FUNC P with gil
 */
  QTimer::singleShot(0x64, __pyx_f_10_qt_qtwes2__on_filesystemwatcher_changed_2);

  /* "_qt_qtwes2.pyx":2020
 * 
 * ##pxm-FUNC P with gil
 * cdef void _on_filesystemwatcher_changed_1(const QString &qpath) with gil:             # <<<<<<<<<<<<<<
 *     if pydata.filesystemwatcher_path is not None:
 *         return
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("_qt_qtwes2._on_filesystemwatcher_changed_1", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":2027
 *     #QTimer.singleShot(100, _on_filesystemwatcher_changed_2)
 * ##pxm-FUNC P with gil
 * cdef void _on_filesystemwatcher_changed_2() with gil:             # <<<<<<<<<<<<<<
 *     path = pydata.filesystemwatcher_path
 *     pydata.filesystemwatcher_path = None
 */

static void __pyx_f_10_qt_qtwes2__on_filesystemwatcher_changed_2(void) {
  PyObject *__pyx_v_path = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_filesystemwatcher_changed_2", 0);

  /* "_qt_qtwes2.pyx":2028
 * ##pxm-FUNC P with gil
 * cdef void _on_filesystemwatcher_changed_2() with gil:
 *     path = pydata.filesystemwatcher_path             # <<<<<<<<<<<<<<
 *     pydata.filesystemwatcher_path = None
 *     pydata.filesystemwatcher_handlers[path]()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_filesystemwatcher_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_path = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":2029
 * cdef void _on_filesystemwatcher_changed_2() with gil:
 *     path = pydata.filesystemwatcher_path
 *     pydata.filesystemwatcher_path = None             # <<<<<<<<<<<<<<
 *     pydata.filesystemwatcher_handlers[path]()
 *     if os.path.isfile(path):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_filesystemwatcher_path, Py_None) < 0) __PYX_ERR(0, 2029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":2030
 *     path = pydata.filesystemwatcher_path
 *     pydata.filesystemwatcher_path = None
 *     pydata.filesystemwatcher_handlers[path]()             # <<<<<<<<<<<<<<
 *     if os.path.isfile(path):
 *         uidata.filesystemwatcher.addPath(str2q(path))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_filesystemwatcher_handlers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2030, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2030, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":2031
 *     pydata.filesystemwatcher_path = None
 *     pydata.filesystemwatcher_handlers[path]()
 *     if os.path.isfile(path):             # <<<<<<<<<<<<<<
 *         uidata.filesystemwatcher.addPath(str2q(path))
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_path};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2031, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_path);
      __Pyx_GIVEREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_path);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2031, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "_qt_qtwes2.pyx":2032
 *     pydata.filesystemwatcher_handlers[path]()
 *     if os.path.isfile(path):
 *         uidata.filesystemwatcher.addPath(str2q(path))             # <<<<<<<<<<<<<<
 * 
 * def create_filesystemwatcher(path, callback):
 */
    __pyx_v_10_qt_qtwes2_uidata.filesystemwatcher->addPath(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_path));

    /* "_qt_qtwes2.pyx":2031
 *     pydata.filesystemwatcher_path = None
 *     pydata.filesystemwatcher_handlers[path]()
 *     if os.path.isfile(path):             # <<<<<<<<<<<<<<
 *         uidata.filesystemwatcher.addPath(str2q(path))
 * 
 */
  }

  /* "_qt_qtwes2.pyx":2027
 *     #QTimer.singleShot(100, _on_filesystemwatcher_changed_2)
 * ##pxm-FUNC P with gil
 * cdef void _on_filesystemwatcher_changed_2() with gil:             # <<<<<<<<<<<<<<
 *     path = pydata.filesystemwatcher_path
 *     pydata.filesystemwatcher_path = None
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("_qt_qtwes2._on_filesystemwatcher_changed_2", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_path);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":2034
 *         uidata.filesystemwatcher.addPath(str2q(path))
 * 
 * def create_filesystemwatcher(path, callback):             # <<<<<<<<<<<<<<
 *     cdef QString qpath = str2q(path) #px/
 *     #qpath = path
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_65create_filesystemwatcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_65create_filesystemwatcher = {"create_filesystemwatcher", (PyCFunction)__pyx_pw_10_qt_qtwes2_65create_filesystemwatcher, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_65create_filesystemwatcher(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_filesystemwatcher (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("create_filesystemwatcher", 1, 2, 2, 1); __PYX_ERR(0, 2034, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_filesystemwatcher") < 0)) __PYX_ERR(0, 2034, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_path = values[0];
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_filesystemwatcher", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2034, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.create_filesystemwatcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_64create_filesystemwatcher(__pyx_self, __pyx_v_path, __pyx_v_callback);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_64create_filesystemwatcher(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_callback) {
  QString __pyx_v_qpath;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("create_filesystemwatcher", 0);

  /* "_qt_qtwes2.pyx":2035
 * 
 * def create_filesystemwatcher(path, callback):
 *     cdef QString qpath = str2q(path) #px/             # <<<<<<<<<<<<<<
 *     #qpath = path
 *     if uidata.filesystemwatcher is NULL:
 */
  __pyx_v_qpath = __pyx_f_10_qt_qtwes2_str2q(__pyx_v_path);

  /* "_qt_qtwes2.pyx":2037
 *     cdef QString qpath = str2q(path) #px/
 *     #qpath = path
 *     if uidata.filesystemwatcher is NULL:             # <<<<<<<<<<<<<<
 *         uidata.filesystemwatcher = new QFileSystemWatcher(NULL) #px/
 *         #uidata.filesystemwatcher = QFileSystemWatcher(None)
 */
  __pyx_t_1 = ((__pyx_v_10_qt_qtwes2_uidata.filesystemwatcher == NULL) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":2038
 *     #qpath = path
 *     if uidata.filesystemwatcher is NULL:
 *         uidata.filesystemwatcher = new QFileSystemWatcher(NULL) #px/             # <<<<<<<<<<<<<<
 *         #uidata.filesystemwatcher = QFileSystemWatcher(None)
 *         connect(uidata.filesystemwatcher, &directoryChanged, _on_filesystemwatcher_changed_1) #px/
 */
    __pyx_v_10_qt_qtwes2_uidata.filesystemwatcher = new QFileSystemWatcher(NULL);

    /* "_qt_qtwes2.pyx":2040
 *         uidata.filesystemwatcher = new QFileSystemWatcher(NULL) #px/
 *         #uidata.filesystemwatcher = QFileSystemWatcher(None)
 *         connect(uidata.filesystemwatcher, &directoryChanged, _on_filesystemwatcher_changed_1) #px/             # <<<<<<<<<<<<<<
 *         #uidata.filesystemwatcher.directoryChanged.connect(_on_filesystemwatcher_changed_1)
 *         connect(uidata.filesystemwatcher, &fileChanged, _on_filesystemwatcher_changed_1) #px/
 */
    QObject::connect(__pyx_v_10_qt_qtwes2_uidata.filesystemwatcher, (&QFileSystemWatcher::directoryChanged), __pyx_f_10_qt_qtwes2__on_filesystemwatcher_changed_1);

    /* "_qt_qtwes2.pyx":2042
 *         connect(uidata.filesystemwatcher, &directoryChanged, _on_filesystemwatcher_changed_1) #px/
 *         #uidata.filesystemwatcher.directoryChanged.connect(_on_filesystemwatcher_changed_1)
 *         connect(uidata.filesystemwatcher, &fileChanged, _on_filesystemwatcher_changed_1) #px/             # <<<<<<<<<<<<<<
 *         #uidata.filesystemwatcher.fileChanged.connect(_on_filesystemwatcher_changed_1)
 *     pydata.filesystemwatcher_handlers[path] = callback
 */
    QObject::connect(__pyx_v_10_qt_qtwes2_uidata.filesystemwatcher, (&QFileSystemWatcher::fileChanged), __pyx_f_10_qt_qtwes2__on_filesystemwatcher_changed_1);

    /* "_qt_qtwes2.pyx":2037
 *     cdef QString qpath = str2q(path) #px/
 *     #qpath = path
 *     if uidata.filesystemwatcher is NULL:             # <<<<<<<<<<<<<<
 *         uidata.filesystemwatcher = new QFileSystemWatcher(NULL) #px/
 *         #uidata.filesystemwatcher = QFileSystemWatcher(None)
 */
  }

  /* "_qt_qtwes2.pyx":2044
 *         connect(uidata.filesystemwatcher, &fileChanged, _on_filesystemwatcher_changed_1) #px/
 *         #uidata.filesystemwatcher.fileChanged.connect(_on_filesystemwatcher_changed_1)
 *     pydata.filesystemwatcher_handlers[path] = callback             # <<<<<<<<<<<<<<
 *     uidata.filesystemwatcher.addPath(qpath)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_filesystemwatcher_handlers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_v_path, __pyx_v_callback) < 0)) __PYX_ERR(0, 2044, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":2045
 *         #uidata.filesystemwatcher.fileChanged.connect(_on_filesystemwatcher_changed_1)
 *     pydata.filesystemwatcher_handlers[path] = callback
 *     uidata.filesystemwatcher.addPath(qpath)             # <<<<<<<<<<<<<<
 * 
 * #XXX: avoid this function, only one active singleShot-handler
 */
  __pyx_v_10_qt_qtwes2_uidata.filesystemwatcher->addPath(__pyx_v_qpath);

  /* "_qt_qtwes2.pyx":2034
 *         uidata.filesystemwatcher.addPath(str2q(path))
 * 
 * def create_filesystemwatcher(path, callback):             # <<<<<<<<<<<<<<
 *     cdef QString qpath = str2q(path) #px/
 *     #qpath = path
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_qt_qtwes2.create_filesystemwatcher", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2048
 * 
 * #XXX: avoid this function, only one active singleShot-handler
 * cdef void _on_singleShot() with gil: #px+             # <<<<<<<<<<<<<<
 *     pydata.singleshot_handler() #px+
 *     if pydata.singleshot_queue: #px+
 */

static void __pyx_f_10_qt_qtwes2__on_singleShot(void) {
  PyObject *__pyx_v_msec = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_singleShot", 0);

  /* "_qt_qtwes2.pyx":2049
 * #XXX: avoid this function, only one active singleShot-handler
 * cdef void _on_singleShot() with gil: #px+
 *     pydata.singleshot_handler() #px+             # <<<<<<<<<<<<<<
 *     if pydata.singleshot_queue: #px+
 *         msec, pydata.singleshot_handler = pydata.singleshot_queue.pop(0) #px+
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_singleshot_handler); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2049, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2049, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2050
 * cdef void _on_singleShot() with gil: #px+
 *     pydata.singleshot_handler() #px+
 *     if pydata.singleshot_queue: #px+             # <<<<<<<<<<<<<<
 *         msec, pydata.singleshot_handler = pydata.singleshot_queue.pop(0) #px+
 *         singleShot(msec, _on_singleShot) #px+
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_singleshot_queue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2050, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":2051
 *     pydata.singleshot_handler() #px+
 *     if pydata.singleshot_queue: #px+
 *         msec, pydata.singleshot_handler = pydata.singleshot_queue.pop(0) #px+             # <<<<<<<<<<<<<<
 *         singleShot(msec, _on_singleShot) #px+
 *     else: #px+
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_singleshot_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_PopIndex(__pyx_t_1, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2051, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2051, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2051, __pyx_L1_error)
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2051, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_msec = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_singleshot_handler, __pyx_t_2) < 0) __PYX_ERR(0, 2051, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "_qt_qtwes2.pyx":2052
 *     if pydata.singleshot_queue: #px+
 *         msec, pydata.singleshot_handler = pydata.singleshot_queue.pop(0) #px+
 *         singleShot(msec, _on_singleShot) #px+             # <<<<<<<<<<<<<<
 *     else: #px+
 *         pydata.singleshot_handler = None #px+
 */
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_msec); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2052, __pyx_L1_error)
    QTimer::singleShot(__pyx_t_7, __pyx_f_10_qt_qtwes2__on_singleShot);

    /* "_qt_qtwes2.pyx":2050
 * cdef void _on_singleShot() with gil: #px+
 *     pydata.singleshot_handler() #px+
 *     if pydata.singleshot_queue: #px+             # <<<<<<<<<<<<<<
 *         msec, pydata.singleshot_handler = pydata.singleshot_queue.pop(0) #px+
 *         singleShot(msec, _on_singleShot) #px+
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":2054
 *         singleShot(msec, _on_singleShot) #px+
 *     else: #px+
 *         pydata.singleshot_handler = None #px+             # <<<<<<<<<<<<<<
 * def timer_singleShot(msec, func):
 *     if pydata.singleshot_handler is None: #px+
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_singleshot_handler, Py_None) < 0) __PYX_ERR(0, 2054, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":2048
 * 
 * #XXX: avoid this function, only one active singleShot-handler
 * cdef void _on_singleShot() with gil: #px+             # <<<<<<<<<<<<<<
 *     pydata.singleshot_handler() #px+
 *     if pydata.singleshot_queue: #px+
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("_qt_qtwes2._on_singleShot", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msec);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":2055
 *     else: #px+
 *         pydata.singleshot_handler = None #px+
 * def timer_singleShot(msec, func):             # <<<<<<<<<<<<<<
 *     if pydata.singleshot_handler is None: #px+
 *         pydata.singleshot_handler = func #px+
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_67timer_singleShot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_67timer_singleShot = {"timer_singleShot", (PyCFunction)__pyx_pw_10_qt_qtwes2_67timer_singleShot, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_67timer_singleShot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_msec = 0;
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timer_singleShot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msec,&__pyx_n_s_func,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_msec)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("timer_singleShot", 1, 2, 2, 1); __PYX_ERR(0, 2055, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_singleShot") < 0)) __PYX_ERR(0, 2055, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_msec = values[0];
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timer_singleShot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2055, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.timer_singleShot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_66timer_singleShot(__pyx_self, __pyx_v_msec, __pyx_v_func);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_66timer_singleShot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_msec, PyObject *__pyx_v_func) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("timer_singleShot", 0);

  /* "_qt_qtwes2.pyx":2056
 *         pydata.singleshot_handler = None #px+
 * def timer_singleShot(msec, func):
 *     if pydata.singleshot_handler is None: #px+             # <<<<<<<<<<<<<<
 *         pydata.singleshot_handler = func #px+
 *         singleShot(msec, _on_singleShot) #px+
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_singleshot_handler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":2057
 * def timer_singleShot(msec, func):
 *     if pydata.singleshot_handler is None: #px+
 *         pydata.singleshot_handler = func #px+             # <<<<<<<<<<<<<<
 *         singleShot(msec, _on_singleShot) #px+
 *     else: #px+
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_singleshot_handler, __pyx_v_func) < 0) __PYX_ERR(0, 2057, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2058
 *     if pydata.singleshot_handler is None: #px+
 *         pydata.singleshot_handler = func #px+
 *         singleShot(msec, _on_singleShot) #px+             # <<<<<<<<<<<<<<
 *     else: #px+
 *         pydata.singleshot_queue.append((msec, func)) #px+
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_msec); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L1_error)
    QTimer::singleShot(__pyx_t_5, __pyx_f_10_qt_qtwes2__on_singleShot);

    /* "_qt_qtwes2.pyx":2056
 *         pydata.singleshot_handler = None #px+
 * def timer_singleShot(msec, func):
 *     if pydata.singleshot_handler is None: #px+             # <<<<<<<<<<<<<<
 *         pydata.singleshot_handler = func #px+
 *         singleShot(msec, _on_singleShot) #px+
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":2060
 *         singleShot(msec, _on_singleShot) #px+
 *     else: #px+
 *         pydata.singleshot_queue.append((msec, func)) #px+             # <<<<<<<<<<<<<<
 *     ##px-
 *     #QTimer.singleShot(msec, func)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_singleshot_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_msec);
    __Pyx_GIVEREF(__pyx_v_msec);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_msec);
    __Pyx_INCREF(__pyx_v_func);
    __Pyx_GIVEREF(__pyx_v_func);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_func);
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2060, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":2055
 *     else: #px+
 *         pydata.singleshot_handler = None #px+
 * def timer_singleShot(msec, func):             # <<<<<<<<<<<<<<
 *     if pydata.singleshot_handler is None: #px+
 *         pydata.singleshot_handler = func #px+
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_qt_qtwes2.timer_singleShot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2065
 * 
 * ##pxm-FUNC P with gil
 * cdef void _on_settings_timer_timeout() with gil:             # <<<<<<<<<<<<<<
 *     pydata.app.on_settings_timer_timeout()
 * 
 */

static void __pyx_f_10_qt_qtwes2__on_settings_timer_timeout(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_settings_timer_timeout", 0);

  /* "_qt_qtwes2.pyx":2066
 * ##pxm-FUNC P with gil
 * cdef void _on_settings_timer_timeout() with gil:
 *     pydata.app.on_settings_timer_timeout()             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_settings_timer_timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2066, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2066, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2065
 * 
 * ##pxm-FUNC P with gil
 * cdef void _on_settings_timer_timeout() with gil:             # <<<<<<<<<<<<<<
 *     pydata.app.on_settings_timer_timeout()
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("_qt_qtwes2._on_settings_timer_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":2069
 * 
 * ##pxm-FUNC P
 * cdef void settings_timer_create():             # <<<<<<<<<<<<<<
 *     uidata.settings_timer = new QTimer() #px/
 *     #uidata.settings_timer = QTimer()
 */

static void __pyx_f_10_qt_qtwes2_settings_timer_create(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("settings_timer_create", 0);

  /* "_qt_qtwes2.pyx":2070
 * ##pxm-FUNC P
 * cdef void settings_timer_create():
 *     uidata.settings_timer = new QTimer() #px/             # <<<<<<<<<<<<<<
 *     #uidata.settings_timer = QTimer()
 *     uidata.settings_timer.setInterval(5000)
 */
  __pyx_v_10_qt_qtwes2_uidata.settings_timer = new QTimer();

  /* "_qt_qtwes2.pyx":2072
 *     uidata.settings_timer = new QTimer() #px/
 *     #uidata.settings_timer = QTimer()
 *     uidata.settings_timer.setInterval(5000)             # <<<<<<<<<<<<<<
 *     uidata.settings_timer.setSingleShot(True)
 *     connect(uidata.settings_timer, &timeout, _on_settings_timer_timeout) #px/
 */
  __pyx_v_10_qt_qtwes2_uidata.settings_timer->setInterval(0x1388);

  /* "_qt_qtwes2.pyx":2073
 *     #uidata.settings_timer = QTimer()
 *     uidata.settings_timer.setInterval(5000)
 *     uidata.settings_timer.setSingleShot(True)             # <<<<<<<<<<<<<<
 *     connect(uidata.settings_timer, &timeout, _on_settings_timer_timeout) #px/
 *     #uidata.settings_timer.timeout.connect(_on_settings_timer_timeout)
 */
  __pyx_v_10_qt_qtwes2_uidata.settings_timer->setSingleShot(1);

  /* "_qt_qtwes2.pyx":2074
 *     uidata.settings_timer.setInterval(5000)
 *     uidata.settings_timer.setSingleShot(True)
 *     connect(uidata.settings_timer, &timeout, _on_settings_timer_timeout) #px/             # <<<<<<<<<<<<<<
 *     #uidata.settings_timer.timeout.connect(_on_settings_timer_timeout)
 * 
 */
  QObject::connect(__pyx_v_10_qt_qtwes2_uidata.settings_timer, (&QTimer::timeout), __pyx_f_10_qt_qtwes2__on_settings_timer_timeout);

  /* "_qt_qtwes2.pyx":2069
 * 
 * ##pxm-FUNC P
 * cdef void settings_timer_create():             # <<<<<<<<<<<<<<
 *     uidata.settings_timer = new QTimer() #px/
 *     #uidata.settings_timer = QTimer()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":2078
 * 
 * ##pxm-FUNC P
 * cpdef settings_timer_start():             # <<<<<<<<<<<<<<
 *     if not uidata.settings_timer.isActive():
 *         uidata.settings_timer.start()
 */

static PyObject *__pyx_pw_10_qt_qtwes2_69settings_timer_start(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_settings_timer_start(CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("settings_timer_start", 0);

  /* "_qt_qtwes2.pyx":2079
 * ##pxm-FUNC P
 * cpdef settings_timer_start():
 *     if not uidata.settings_timer.isActive():             # <<<<<<<<<<<<<<
 *         uidata.settings_timer.start()
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_10_qt_qtwes2_uidata.settings_timer->isActive() != 0)) != 0);
  if (__pyx_t_1) {

    /* "_qt_qtwes2.pyx":2080
 * cpdef settings_timer_start():
 *     if not uidata.settings_timer.isActive():
 *         uidata.settings_timer.start()             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
    __pyx_v_10_qt_qtwes2_uidata.settings_timer->start();

    /* "_qt_qtwes2.pyx":2079
 * ##pxm-FUNC P
 * cpdef settings_timer_start():
 *     if not uidata.settings_timer.isActive():             # <<<<<<<<<<<<<<
 *         uidata.settings_timer.start()
 * 
 */
  }

  /* "_qt_qtwes2.pyx":2078
 * 
 * ##pxm-FUNC P
 * cpdef settings_timer_start():             # <<<<<<<<<<<<<<
 *     if not uidata.settings_timer.isActive():
 *         uidata.settings_timer.start()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_69settings_timer_start(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10_qt_qtwes2_69settings_timer_start(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("settings_timer_start (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_68settings_timer_start(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_68settings_timer_start(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("settings_timer_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_settings_timer_start(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.settings_timer_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2083
 * 
 * ##pxm-FUNC P
 * cdef void settings_timer_destroy():             # <<<<<<<<<<<<<<
 *     uidata.settings_timer.stop()
 *     uidata.settings_timer.deleteLater()
 */

static void __pyx_f_10_qt_qtwes2_settings_timer_destroy(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("settings_timer_destroy", 0);

  /* "_qt_qtwes2.pyx":2084
 * ##pxm-FUNC P
 * cdef void settings_timer_destroy():
 *     uidata.settings_timer.stop()             # <<<<<<<<<<<<<<
 *     uidata.settings_timer.deleteLater()
 *     uidata.settings_timer = NULL
 */
  __pyx_v_10_qt_qtwes2_uidata.settings_timer->stop();

  /* "_qt_qtwes2.pyx":2085
 * cdef void settings_timer_destroy():
 *     uidata.settings_timer.stop()
 *     uidata.settings_timer.deleteLater()             # <<<<<<<<<<<<<<
 *     uidata.settings_timer = NULL
 * 
 */
  __pyx_v_10_qt_qtwes2_uidata.settings_timer->deleteLater();

  /* "_qt_qtwes2.pyx":2086
 *     uidata.settings_timer.stop()
 *     uidata.settings_timer.deleteLater()
 *     uidata.settings_timer = NULL             # <<<<<<<<<<<<<<
 * 
 * def set_animation_speed():
 */
  __pyx_v_10_qt_qtwes2_uidata.settings_timer = NULL;

  /* "_qt_qtwes2.pyx":2083
 * 
 * ##pxm-FUNC P
 * cdef void settings_timer_destroy():             # <<<<<<<<<<<<<<
 *     uidata.settings_timer.stop()
 *     uidata.settings_timer.deleteLater()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":2088
 *     uidata.settings_timer = NULL
 * 
 * def set_animation_speed():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.speed = settings['draw.speed']
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_71set_animation_speed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_71set_animation_speed = {"set_animation_speed", (PyCFunction)__pyx_pw_10_qt_qtwes2_71set_animation_speed, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_71set_animation_speed(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_animation_speed (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_70set_animation_speed(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_70set_animation_speed(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  float __pyx_t_3;
  __Pyx_RefNannySetupContext("set_animation_speed", 0);

  /* "_qt_qtwes2.pyx":2090
 * def set_animation_speed():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.speed = settings['draw.speed']             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_invoke(b'animation_speed_changed')
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_kp_u_draw_speed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_10_qt_qtwes2_uidata.speed = __pyx_t_3;

  /* "_qt_qtwes2.pyx":2088
 *     uidata.settings_timer = NULL
 * 
 * def set_animation_speed():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.speed = settings['draw.speed']
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_qt_qtwes2.set_animation_speed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2096
 * 
 * ##pxm-FUNC P
 * cdef void animation_init():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer = new QTimer() #px/
 */

static void __pyx_f_10_qt_qtwes2_animation_init(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("animation_init", 0);

  /* "_qt_qtwes2.pyx":2098
 * cdef void animation_init():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer = new QTimer() #px/             # <<<<<<<<<<<<<<
 *     #uidata.animate_timer = QTimer()
 *     #uidata.animate_timer.setInterval(5000)
 */
  __pyx_v_10_qt_qtwes2_uidata.animate_timer = new QTimer();

  /* "_qt_qtwes2.pyx":2101
 *     #uidata.animate_timer = QTimer()
 *     #uidata.animate_timer.setInterval(5000)
 *     connect(uidata.animate_timer, &timeout, _on_animate_timer_timeout) #px/             # <<<<<<<<<<<<<<
 *     #uidata.animate_timer.timeout.connect(_on_animate_timer_timeout)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  QObject::connect(__pyx_v_10_qt_qtwes2_uidata.animate_timer, (&QTimer::timeout), __pyx_f_10_qt_qtwes2__on_animate_timer_timeout);

  /* "_qt_qtwes2.pyx":2106
 *     #~ ctx_set(b'animation_running', False)
 *     #~ ##pxm>IF_END
 *     set_animation_speed()             # <<<<<<<<<<<<<<
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_animation_speed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2096
 * 
 * ##pxm-FUNC P
 * cdef void animation_init():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer = new QTimer() #px/
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("_qt_qtwes2.animation_init", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":2110
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P with gil
 * cdef void _on_animate_timer_timeout() with gil:             # <<<<<<<<<<<<<<
 *     cdef float increment #px+
 *     increment = uidata.speed * 1e-02 * 20
 */

static void __pyx_f_10_qt_qtwes2__on_animate_timer_timeout(void) {
  float __pyx_v_increment;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  float __pyx_t_2;
  float __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_animate_timer_timeout", 0);

  /* "_qt_qtwes2.pyx":2112
 * cdef void _on_animate_timer_timeout() with gil:
 *     cdef float increment #px+
 *     increment = uidata.speed * 1e-02 * 20             # <<<<<<<<<<<<<<
 *     increment = min(increment, 45)
 *     uidata.animation_angle += increment
 */
  __pyx_v_increment = ((__pyx_v_10_qt_qtwes2_uidata.speed * 1e-02) * 20.0);

  /* "_qt_qtwes2.pyx":2113
 *     cdef float increment #px+
 *     increment = uidata.speed * 1e-02 * 20
 *     increment = min(increment, 45)             # <<<<<<<<<<<<<<
 *     uidata.animation_angle += increment
 *     glarea.set_animation_next(uidata.animation_angle)
 */
  __pyx_t_1 = 45;
  __pyx_t_2 = __pyx_v_increment;
  if (((__pyx_t_1 < __pyx_t_2) != 0)) {
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  __pyx_v_increment = __pyx_t_3;

  /* "_qt_qtwes2.pyx":2114
 *     increment = uidata.speed * 1e-02 * 20
 *     increment = min(increment, 45)
 *     uidata.animation_angle += increment             # <<<<<<<<<<<<<<
 *     glarea.set_animation_next(uidata.animation_angle)
 *     if uidata.animation_angle < uidata.angle_max:
 */
  __pyx_v_10_qt_qtwes2_uidata.animation_angle = (__pyx_v_10_qt_qtwes2_uidata.animation_angle + __pyx_v_increment);

  /* "_qt_qtwes2.pyx":2115
 *     increment = min(increment, 45)
 *     uidata.animation_angle += increment
 *     glarea.set_animation_next(uidata.animation_angle)             # <<<<<<<<<<<<<<
 *     if uidata.animation_angle < uidata.angle_max:
 *         update_drawingarea()
 */
  __pyx_f_11_glarea_es2_set_animation_next(__pyx_v_10_qt_qtwes2_uidata.animation_angle);

  /* "_qt_qtwes2.pyx":2116
 *     uidata.animation_angle += increment
 *     glarea.set_animation_next(uidata.animation_angle)
 *     if uidata.animation_angle < uidata.angle_max:             # <<<<<<<<<<<<<<
 *         update_drawingarea()
 *     else:
 */
  __pyx_t_4 = ((__pyx_v_10_qt_qtwes2_uidata.animation_angle < __pyx_v_10_qt_qtwes2_uidata.angle_max) != 0);
  if (__pyx_t_4) {

    /* "_qt_qtwes2.pyx":2117
 *     glarea.set_animation_next(uidata.animation_angle)
 *     if uidata.animation_angle < uidata.angle_max:
 *         update_drawingarea()             # <<<<<<<<<<<<<<
 *     else:
 *         pydata.app.on_animation_ending()
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_update_drawingarea); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2117, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2117, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "_qt_qtwes2.pyx":2116
 *     uidata.animation_angle += increment
 *     glarea.set_animation_next(uidata.animation_angle)
 *     if uidata.animation_angle < uidata.angle_max:             # <<<<<<<<<<<<<<
 *         update_drawingarea()
 *     else:
 */
    goto __pyx_L3;
  }

  /* "_qt_qtwes2.pyx":2119
 *         update_drawingarea()
 *     else:
 *         pydata.app.on_animation_ending()             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * 
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_app); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_on_animation_ending); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2119, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2119, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "_qt_qtwes2.pyx":2110
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P with gil
 * cdef void _on_animate_timer_timeout() with gil:             # <<<<<<<<<<<<<<
 *     cdef float increment #px+
 *     increment = uidata.speed * 1e-02 * 20
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("_qt_qtwes2._on_animate_timer_timeout", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":2123
 * 
 * ##pxm-FUNC P
 * cpdef animate_timer_start(msec, angle_max):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animation_angle = 0.
 */

static PyObject *__pyx_pw_10_qt_qtwes2_73animate_timer_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10_qt_qtwes2_animate_timer_start(PyObject *__pyx_v_msec, PyObject *__pyx_v_angle_max, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("animate_timer_start", 0);

  /* "_qt_qtwes2.pyx":2125
 * cpdef animate_timer_start(msec, angle_max):
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animation_angle = 0.             # <<<<<<<<<<<<<<
 *     uidata.angle_max = angle_max
 *     if not uidata.animate_timer.isActive():
 */
  __pyx_v_10_qt_qtwes2_uidata.animation_angle = 0.;

  /* "_qt_qtwes2.pyx":2126
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animation_angle = 0.
 *     uidata.angle_max = angle_max             # <<<<<<<<<<<<<<
 *     if not uidata.animate_timer.isActive():
 *         uidata.animate_timer.start(msec)
 */
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_angle_max); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2126, __pyx_L1_error)
  __pyx_v_10_qt_qtwes2_uidata.angle_max = __pyx_t_1;

  /* "_qt_qtwes2.pyx":2127
 *     uidata.animation_angle = 0.
 *     uidata.angle_max = angle_max
 *     if not uidata.animate_timer.isActive():             # <<<<<<<<<<<<<<
 *         uidata.animate_timer.start(msec)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_t_2 = ((!(__pyx_v_10_qt_qtwes2_uidata.animate_timer->isActive() != 0)) != 0);
  if (__pyx_t_2) {

    /* "_qt_qtwes2.pyx":2128
 *     uidata.angle_max = angle_max
 *     if not uidata.animate_timer.isActive():
 *         uidata.animate_timer.start(msec)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'animation_maxangle', angle_max)
 */
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_msec); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2128, __pyx_L1_error)
    __pyx_v_10_qt_qtwes2_uidata.animate_timer->start(__pyx_t_3);

    /* "_qt_qtwes2.pyx":2127
 *     uidata.animation_angle = 0.
 *     uidata.angle_max = angle_max
 *     if not uidata.animate_timer.isActive():             # <<<<<<<<<<<<<<
 *         uidata.animate_timer.start(msec)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  }

  /* "_qt_qtwes2.pyx":2123
 * 
 * ##pxm-FUNC P
 * cpdef animate_timer_start(msec, angle_max):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animation_angle = 0.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_qt_qtwes2.animate_timer_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_73animate_timer_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10_qt_qtwes2_73animate_timer_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_msec = 0;
  PyObject *__pyx_v_angle_max = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("animate_timer_start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msec,&__pyx_n_s_angle_max,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_msec)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle_max)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("animate_timer_start", 1, 2, 2, 1); __PYX_ERR(0, 2123, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "animate_timer_start") < 0)) __PYX_ERR(0, 2123, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_msec = values[0];
    __pyx_v_angle_max = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("animate_timer_start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2123, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_qt_qtwes2.animate_timer_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10_qt_qtwes2_72animate_timer_start(__pyx_self, __pyx_v_msec, __pyx_v_angle_max);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_72animate_timer_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_msec, PyObject *__pyx_v_angle_max) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("animate_timer_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10_qt_qtwes2_animate_timer_start(__pyx_v_msec, __pyx_v_angle_max, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.animate_timer_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2135
 * 
 * # only for demos
 * def animate_timer_step(angle_max):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.angle_max = angle_max
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_75animate_timer_step(PyObject *__pyx_self, PyObject *__pyx_v_angle_max); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_75animate_timer_step = {"animate_timer_step", (PyCFunction)__pyx_pw_10_qt_qtwes2_75animate_timer_step, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_75animate_timer_step(PyObject *__pyx_self, PyObject *__pyx_v_angle_max) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("animate_timer_step (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_74animate_timer_step(__pyx_self, ((PyObject *)__pyx_v_angle_max));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_74animate_timer_step(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_angle_max) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  __Pyx_RefNannySetupContext("animate_timer_step", 0);

  /* "_qt_qtwes2.pyx":2137
 * def animate_timer_step(angle_max):
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.angle_max = angle_max             # <<<<<<<<<<<<<<
 *     _on_animate_timer_timeout()
 *     ##pxm>IF_END
 */
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_angle_max); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2137, __pyx_L1_error)
  __pyx_v_10_qt_qtwes2_uidata.angle_max = __pyx_t_1;

  /* "_qt_qtwes2.pyx":2138
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.angle_max = angle_max
 *     _on_animate_timer_timeout()             # <<<<<<<<<<<<<<
 *     ##pxm>IF_END
 *     pass
 */
  __pyx_f_10_qt_qtwes2__on_animate_timer_timeout();

  /* "_qt_qtwes2.pyx":2135
 * 
 * # only for demos
 * def animate_timer_step(angle_max):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.angle_max = angle_max
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_qt_qtwes2.animate_timer_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2142
 *     pass
 * 
 * def animate_timer_stop():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer.stop()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_77animate_timer_stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_77animate_timer_stop = {"animate_timer_stop", (PyCFunction)__pyx_pw_10_qt_qtwes2_77animate_timer_stop, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_77animate_timer_stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("animate_timer_stop (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_76animate_timer_stop(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_76animate_timer_stop(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("animate_timer_stop", 0);

  /* "_qt_qtwes2.pyx":2144
 * def animate_timer_stop():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer.stop()             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ ctx_set(b'animation_running', False)
 */
  __pyx_v_10_qt_qtwes2_uidata.animate_timer->stop();

  /* "_qt_qtwes2.pyx":2142
 *     pass
 * 
 * def animate_timer_stop():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer.stop()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2151
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef void animate_timer_destroy():             # <<<<<<<<<<<<<<
 *     uidata.animate_timer.stop()
 *     uidata.animate_timer.deleteLater()
 */

static void __pyx_f_10_qt_qtwes2_animate_timer_destroy(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("animate_timer_destroy", 0);

  /* "_qt_qtwes2.pyx":2152
 * ##pxm-FUNC P
 * cdef void animate_timer_destroy():
 *     uidata.animate_timer.stop()             # <<<<<<<<<<<<<<
 *     uidata.animate_timer.deleteLater()
 *     uidata.animate_timer = NULL
 */
  __pyx_v_10_qt_qtwes2_uidata.animate_timer->stop();

  /* "_qt_qtwes2.pyx":2153
 * cdef void animate_timer_destroy():
 *     uidata.animate_timer.stop()
 *     uidata.animate_timer.deleteLater()             # <<<<<<<<<<<<<<
 *     uidata.animate_timer = NULL
 * ##pxm>IF_END
 */
  __pyx_v_10_qt_qtwes2_uidata.animate_timer->deleteLater();

  /* "_qt_qtwes2.pyx":2154
 *     uidata.animate_timer.stop()
 *     uidata.animate_timer.deleteLater()
 *     uidata.animate_timer = NULL             # <<<<<<<<<<<<<<
 * ##pxm>IF_END
 * 
 */
  __pyx_v_10_qt_qtwes2_uidata.animate_timer = NULL;

  /* "_qt_qtwes2.pyx":2151
 * ##pxm>IF 'qtw' == 'qtw'
 * ##pxm-FUNC P
 * cdef void animate_timer_destroy():             # <<<<<<<<<<<<<<
 *     uidata.animate_timer.stop()
 *     uidata.animate_timer.deleteLater()
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":2158
 * 
 * ##pxm-FUNC P
 * cdef void load_cursors(filepattern):             # <<<<<<<<<<<<<<
 *     cdef QImage images[17] #px/
 *     #images = [None]*17
 */

static void __pyx_f_10_qt_qtwes2_load_cursors(PyObject *__pyx_v_filepattern) {
  QImage __pyx_v_images[17];
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_filename = NULL;
  QTransform __pyx_v_transform;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("load_cursors", 0);

  /* "_qt_qtwes2.pyx":2161
 *     cdef QImage images[17] #px/
 *     #images = [None]*17
 *     pos = []             # <<<<<<<<<<<<<<
 *     # Load 3 cursors from file (n - ne)
 *     for i, (x, y) in enumerate([(8, 0), (15, 0), (15, 0)]):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pos = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2163
 *     pos = []
 *     # Load 3 cursors from file (n - ne)
 *     for i, (x, y) in enumerate([(8, 0), (15, 0), (15, 0)]):             # <<<<<<<<<<<<<<
 *         filename = filepattern.format(i)
 *         images[i+1] = QImage(str2q(filename))
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__25);
  __Pyx_INCREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_tuple__26);
  __Pyx_INCREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_tuple__27);
  __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_4 >= 3) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2163, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2163, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2163, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2163, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2164
 *     # Load 3 cursors from file (n - ne)
 *     for i, (x, y) in enumerate([(8, 0), (15, 0), (15, 0)]):
 *         filename = filepattern.format(i)             # <<<<<<<<<<<<<<
 *         images[i+1] = QImage(str2q(filename))
 *         pos.append((x, y))
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_filepattern, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_i};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2164, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_i};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2164, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2164, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_i);
        __Pyx_GIVEREF(__pyx_v_i);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_i);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2164, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2165
 *     for i, (x, y) in enumerate([(8, 0), (15, 0), (15, 0)]):
 *         filename = filepattern.format(i)
 *         images[i+1] = QImage(str2q(filename))             # <<<<<<<<<<<<<<
 *         pos.append((x, y))
 *     # 1 cursor (nnw)
 */
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (__pyx_v_images[__pyx_t_9]) = QImage(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_filename));

    /* "_qt_qtwes2.pyx":2166
 *         filename = filepattern.format(i)
 *         images[i+1] = QImage(str2q(filename))
 *         pos.append((x, y))             # <<<<<<<<<<<<<<
 *     # 1 cursor (nnw)
 *     x, y = pos[1]
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
    __Pyx_INCREF(__pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_y);
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_pos, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2166, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2163
 *     pos = []
 *     # Load 3 cursors from file (n - ne)
 *     for i, (x, y) in enumerate([(8, 0), (15, 0), (15, 0)]):             # <<<<<<<<<<<<<<
 *         filename = filepattern.format(i)
 *         images[i+1] = QImage(str2q(filename))
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2168
 *         pos.append((x, y))
 *     # 1 cursor (nnw)
 *     x, y = pos[1]             # <<<<<<<<<<<<<<
 *     images[0] = images[2].mirrored(True, False)
 *     pos.insert(0, (15-x, y))
 */
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 2168, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_6), 2) < 0) __PYX_ERR(0, 2168, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 2168, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
  __pyx_t_3 = 0;
  __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":2169
 *     # 1 cursor (nnw)
 *     x, y = pos[1]
 *     images[0] = images[2].mirrored(True, False)             # <<<<<<<<<<<<<<
 *     pos.insert(0, (15-x, y))
 *     # 12 cursors (ene - nw)
 */
  (__pyx_v_images[0]) = (__pyx_v_images[2]).mirrored(1, 0);

  /* "_qt_qtwes2.pyx":2170
 *     x, y = pos[1]
 *     images[0] = images[2].mirrored(True, False)
 *     pos.insert(0, (15-x, y))             # <<<<<<<<<<<<<<
 *     # 12 cursors (ene - nw)
 *     cdef QTransform transform #px/
 */
  __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_15, __pyx_v_x, 15, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_y);
  __pyx_t_1 = 0;
  __pyx_t_10 = PyList_Insert(__pyx_v_pos, 0, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":2174
 *     cdef QTransform transform #px/
 *     #transform = QTransform()
 *     transform.rotate(90)             # <<<<<<<<<<<<<<
 *     for i in range(4, 16):
 *         x, y = pos[i-4]
 */
  __pyx_v_transform.rotate(90.0);

  /* "_qt_qtwes2.pyx":2175
 *     #transform = QTransform()
 *     transform.rotate(90)
 *     for i in range(4, 16):             # <<<<<<<<<<<<<<
 *         x, y = pos[i-4]
 *         images[i] = images[i-4].transformed(transform)
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2175, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2175, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2175, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_11(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2175, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2176
 *     transform.rotate(90)
 *     for i in range(4, 16):
 *         x, y = pos[i-4]             # <<<<<<<<<<<<<<
 *         images[i] = images[i-4].transformed(transform)
 *         pos.append((15-y, x))
 */
    __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetItem(__pyx_v_pos, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2176, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2176, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12_unpacking_done;
      __pyx_L11_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2176, __pyx_L1_error)
      __pyx_L12_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "_qt_qtwes2.pyx":2177
 *     for i in range(4, 16):
 *         x, y = pos[i-4]
 *         images[i] = images[i-4].transformed(transform)             # <<<<<<<<<<<<<<
 *         pos.append((15-y, x))
 *     images[16] = images[0]
 */
    __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L1_error)
    (__pyx_v_images[__pyx_t_12]) = (__pyx_v_images[__pyx_t_9]).transformed(__pyx_v_transform);

    /* "_qt_qtwes2.pyx":2178
 *         x, y = pos[i-4]
 *         images[i] = images[i-4].transformed(transform)
 *         pos.append((15-y, x))             # <<<<<<<<<<<<<<
 *     images[16] = images[0]
 *     pos.append(pos[0])
 */
    __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_15, __pyx_v_y, 15, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_x);
    __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_pos, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2178, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "_qt_qtwes2.pyx":2175
 *     #transform = QTransform()
 *     transform.rotate(90)
 *     for i in range(4, 16):             # <<<<<<<<<<<<<<
 *         x, y = pos[i-4]
 *         images[i] = images[i-4].transformed(transform)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2179
 *         images[i] = images[i-4].transformed(transform)
 *         pos.append((15-y, x))
 *     images[16] = images[0]             # <<<<<<<<<<<<<<
 *     pos.append(pos[0])
 *     for i in range(16):
 */
  (__pyx_v_images[16]) = (__pyx_v_images[0]);

  /* "_qt_qtwes2.pyx":2180
 *         pos.append((15-y, x))
 *     images[16] = images[0]
 *     pos.append(pos[0])             # <<<<<<<<<<<<<<
 *     for i in range(16):
 *         x, y = pos[i+1]
 */
  __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_pos, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2181
 *     images[16] = images[0]
 *     pos.append(pos[0])
 *     for i in range(16):             # <<<<<<<<<<<<<<
 *         x, y = pos[i+1]
 *         uidata.cursors[i] = new QCursor(fromImage(images[i+1]), x, y) #px/
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2181, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2181, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2181, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_11(__pyx_t_6);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2181, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "_qt_qtwes2.pyx":2182
 *     pos.append(pos[0])
 *     for i in range(16):
 *         x, y = pos[i+1]             # <<<<<<<<<<<<<<
 *         uidata.cursors[i] = new QCursor(fromImage(images[i+1]), x, y) #px/
 *         #uidata.cursors[i] = QCursor(fromImage(images[i+1]), x, y)
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetItem(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2182, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2182, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2182, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_qt_qtwes2.pyx":2183
 *     for i in range(16):
 *         x, y = pos[i+1]
 *         uidata.cursors[i] = new QCursor(fromImage(images[i+1]), x, y) #px/             # <<<<<<<<<<<<<<
 *         #uidata.cursors[i] = QCursor(fromImage(images[i+1]), x, y)
 *     # cursor for center faces
 */
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L1_error)
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L1_error)
    __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L1_error)
    (__pyx_v_10_qt_qtwes2_uidata.cursors[__pyx_t_12]) = new QCursor(QPixmap::fromImage((__pyx_v_images[__pyx_t_9])), __pyx_t_13, __pyx_t_14);

    /* "_qt_qtwes2.pyx":2181
 *     images[16] = images[0]
 *     pos.append(pos[0])
 *     for i in range(16):             # <<<<<<<<<<<<<<
 *         x, y = pos[i+1]
 *         uidata.cursors[i] = new QCursor(fromImage(images[i+1]), x, y) #px/
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_qt_qtwes2.pyx":2186
 *         #uidata.cursors[i] = QCursor(fromImage(images[i+1]), x, y)
 *     # cursor for center faces
 *     filename = filepattern.format('ccw')             # <<<<<<<<<<<<<<
 *     uidata.cursors[16] = new QCursor(QPixmap(str2q(filename)), 7, 7) #px/
 *     #uidata.cursors[16] = QCursor(QPixmap(str2q(filename)), 7, 7)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_filepattern, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":2187
 *     # cursor for center faces
 *     filename = filepattern.format('ccw')
 *     uidata.cursors[16] = new QCursor(QPixmap(str2q(filename)), 7, 7) #px/             # <<<<<<<<<<<<<<
 *     #uidata.cursors[16] = QCursor(QPixmap(str2q(filename)), 7, 7)
 *     # background cursor
 */
  (__pyx_v_10_qt_qtwes2_uidata.cursors[16]) = new QCursor(QPixmap(__pyx_f_10_qt_qtwes2_str2q(__pyx_v_filename)), 7, 7);

  /* "_qt_qtwes2.pyx":2190
 *     #uidata.cursors[16] = QCursor(QPixmap(str2q(filename)), 7, 7)
 *     # background cursor
 *     uidata.cursors[17] = new QCursor() #px/             # <<<<<<<<<<<<<<
 *     #uidata.cursors[17] = QCursor()
 *     uidata.cursors[17].setShape(Qt.CrossCursor)
 */
  (__pyx_v_10_qt_qtwes2_uidata.cursors[17]) = new QCursor();

  /* "_qt_qtwes2.pyx":2192
 *     uidata.cursors[17] = new QCursor() #px/
 *     #uidata.cursors[17] = QCursor()
 *     uidata.cursors[17].setShape(Qt.CrossCursor)             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
  (__pyx_v_10_qt_qtwes2_uidata.cursors[17])->setShape(Qt::CrossCursor);

  /* "_qt_qtwes2.pyx":2158
 * 
 * ##pxm-FUNC P
 * cdef void load_cursors(filepattern):             # <<<<<<<<<<<<<<
 *     cdef QImage images[17] #px/
 *     #images = [None]*17
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("_qt_qtwes2.load_cursors", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":2195
 * 
 * ##pxm-FUNC P
 * cdef void destroy_cursors():             # <<<<<<<<<<<<<<
 *     for i in range(18):
 *         del uidata.cursors[i] #px+
 */

static void __pyx_f_10_qt_qtwes2_destroy_cursors(void) {
  long __pyx_v_i;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  __Pyx_RefNannySetupContext("destroy_cursors", 0);

  /* "_qt_qtwes2.pyx":2196
 * ##pxm-FUNC P
 * cdef void destroy_cursors():
 *     for i in range(18):             # <<<<<<<<<<<<<<
 *         del uidata.cursors[i] #px+
 *         uidata.cursors[i] = NULL
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 18; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "_qt_qtwes2.pyx":2197
 * cdef void destroy_cursors():
 *     for i in range(18):
 *         del uidata.cursors[i] #px+             # <<<<<<<<<<<<<<
 *         uidata.cursors[i] = NULL
 * 
 */
    delete (__pyx_v_10_qt_qtwes2_uidata.cursors[__pyx_v_i]);

    /* "_qt_qtwes2.pyx":2198
 *     for i in range(18):
 *         del uidata.cursors[i] #px+
 *         uidata.cursors[i] = NULL             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
    (__pyx_v_10_qt_qtwes2_uidata.cursors[__pyx_v_i]) = NULL;
  }

  /* "_qt_qtwes2.pyx":2195
 * 
 * ##pxm-FUNC P
 * cdef void destroy_cursors():             # <<<<<<<<<<<<<<
 *     for i in range(18):
 *         del uidata.cursors[i] #px+
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":2201
 * 
 * ##pxm-FUNC P
 * cdef void destroy_resources():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.makeCurrent()
 */

static void __pyx_f_10_qt_qtwes2_destroy_resources(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("destroy_resources", 0);

  /* "_qt_qtwes2.pyx":2203
 * cdef void destroy_resources():
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.makeCurrent()             # <<<<<<<<<<<<<<
 *     gl_delete_atlas()
 *     glarea.gl_exit()
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->makeCurrent();

  /* "_qt_qtwes2.pyx":2204
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.makeCurrent()
 *     gl_delete_atlas()             # <<<<<<<<<<<<<<
 *     glarea.gl_exit()
 *     uidata.drawingarea.doneCurrent()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gl_delete_atlas); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2205
 *     uidata.drawingarea.makeCurrent()
 *     gl_delete_atlas()
 *     glarea.gl_exit()             # <<<<<<<<<<<<<<
 *     uidata.drawingarea.doneCurrent()
 *     uidata.drawingarea.setMouseTracking(False)
 */
  __pyx_f_11_glarea_es2_gl_exit();

  /* "_qt_qtwes2.pyx":2206
 *     gl_delete_atlas()
 *     glarea.gl_exit()
 *     uidata.drawingarea.doneCurrent()             # <<<<<<<<<<<<<<
 *     uidata.drawingarea.setMouseTracking(False)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->doneCurrent();

  /* "_qt_qtwes2.pyx":2207
 *     glarea.gl_exit()
 *     uidata.drawingarea.doneCurrent()
 *     uidata.drawingarea.setMouseTracking(False)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ settings['window.size'] = uidata.mainwindow.width(), uidata.mainwindow.height()
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->setMouseTracking(0);

  /* "_qt_qtwes2.pyx":2201
 * 
 * ##pxm-FUNC P
 * cdef void destroy_resources():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.makeCurrent()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("_qt_qtwes2.destroy_resources", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "_qt_qtwes2.pyx":2212
 *     #~ ##pxm>IF_END
 * 
 * def create_window(pyapp):             # <<<<<<<<<<<<<<
 *     pydata.app = pyapp
 *     init_module()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_79create_window(PyObject *__pyx_self, PyObject *__pyx_v_pyapp); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_79create_window = {"create_window", (PyCFunction)__pyx_pw_10_qt_qtwes2_79create_window, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_79create_window(PyObject *__pyx_self, PyObject *__pyx_v_pyapp) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_window (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_78create_window(__pyx_self, ((PyObject *)__pyx_v_pyapp));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_78create_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pyapp) {
  QSizePolicy __pyx_v_sizepolicy;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  bool __pyx_t_9;
  bool __pyx_t_10;
  QLabel *__pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("create_window", 0);

  /* "_qt_qtwes2.pyx":2213
 * 
 * def create_window(pyapp):
 *     pydata.app = pyapp             # <<<<<<<<<<<<<<
 *     init_module()
 *     # Set default format before any widget is created, so that everything uses the same format.
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_app, __pyx_v_pyapp) < 0) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2214
 * def create_window(pyapp):
 *     pydata.app = pyapp
 *     init_module()             # <<<<<<<<<<<<<<
 *     # Set default format before any widget is created, so that everything uses the same format.
 *     # To test this use DEBUG_VFPS. The framerate should be then >60.
 */
  __pyx_f_10_qt_qtwes2_init_module();

  /* "_qt_qtwes2.pyx":2217
 *     # Set default format before any widget is created, so that everything uses the same format.
 *     # To test this use DEBUG_VFPS. The framerate should be then >60.
 *     set_default_surface_format()             # <<<<<<<<<<<<<<
 * 
 *     ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_f_10_qt_qtwes2_set_default_surface_format();

  /* "_qt_qtwes2.pyx":2220
 * 
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.mainwindow = new MainView() #px/             # <<<<<<<<<<<<<<
 *     #uidata.mainwindow = MainView()
 *     uidata.treestore = new QStandardItemModel() #px/
 */
  __pyx_v_10_qt_qtwes2_uidata.mainwindow = new MainView();

  /* "_qt_qtwes2.pyx":2222
 *     uidata.mainwindow = new MainView() #px/
 *     #uidata.mainwindow = MainView()
 *     uidata.treestore = new QStandardItemModel() #px/             # <<<<<<<<<<<<<<
 *     #uidata.treestore = QStandardItemModel()
 *     uidata.drawingarea = new DrawingArea() #px/
 */
  __pyx_v_10_qt_qtwes2_uidata.treestore = new QStandardItemModel();

  /* "_qt_qtwes2.pyx":2224
 *     uidata.treestore = new QStandardItemModel() #px/
 *     #uidata.treestore = QStandardItemModel()
 *     uidata.drawingarea = new DrawingArea() #px/             # <<<<<<<<<<<<<<
 *     #uidata.drawingarea = DrawingArea()
 * 
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea = new DrawingArea();

  /* "_qt_qtwes2.pyx":2228
 * 
 *     qtui.setupUi_main(uidata.mainwindow,
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-random.png'))),             # <<<<<<<<<<<<<<
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-solved.png'))),
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'select-model.png'))),
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UI_DIR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_t_4, __pyx_n_u_qt, __pyx_n_u_images, __pyx_kp_u_new_random_png};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2228, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_t_4, __pyx_n_u_qt, __pyx_n_u_images, __pyx_kp_u_new_random_png};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2228, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_4);
    __Pyx_INCREF(__pyx_n_u_qt);
    __Pyx_GIVEREF(__pyx_n_u_qt);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_u_qt);
    __Pyx_INCREF(__pyx_n_u_images);
    __Pyx_GIVEREF(__pyx_n_u_images);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_n_u_images);
    __Pyx_INCREF(__pyx_kp_u_new_random_png);
    __Pyx_GIVEREF(__pyx_kp_u_new_random_png);
    PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_kp_u_new_random_png);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_qt_qtwes2.pyx":2229
 *     qtui.setupUi_main(uidata.mainwindow,
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-random.png'))),
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-solved.png'))),             # <<<<<<<<<<<<<<
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'select-model.png'))),
 *                             QKeySequence(str2q(settings['action.edit_moves'])),
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_UI_DIR); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_3, __pyx_n_u_qt, __pyx_n_u_images, __pyx_kp_u_new_solved_png};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_3, __pyx_n_u_qt, __pyx_n_u_images, __pyx_kp_u_new_solved_png};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_n_u_qt);
    __Pyx_GIVEREF(__pyx_n_u_qt);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_n_u_qt);
    __Pyx_INCREF(__pyx_n_u_images);
    __Pyx_GIVEREF(__pyx_n_u_images);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_5, __pyx_n_u_images);
    __Pyx_INCREF(__pyx_kp_u_new_solved_png);
    __Pyx_GIVEREF(__pyx_kp_u_new_solved_png);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_5, __pyx_kp_u_new_solved_png);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_qt_qtwes2.pyx":2230
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-random.png'))),
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-solved.png'))),
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'select-model.png'))),             # <<<<<<<<<<<<<<
 *                             QKeySequence(str2q(settings['action.edit_moves'])),
 *                             QKeySequence(str2q(settings['action.edit_cube'])),
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UI_DIR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_t_4, __pyx_n_u_qt, __pyx_n_u_images, __pyx_kp_u_select_model_png};
    __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2230, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
    PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_t_4, __pyx_n_u_qt, __pyx_n_u_images, __pyx_kp_u_select_model_png};
    __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2230, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_4);
    __Pyx_INCREF(__pyx_n_u_qt);
    __Pyx_GIVEREF(__pyx_n_u_qt);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_n_u_qt);
    __Pyx_INCREF(__pyx_n_u_images);
    __Pyx_GIVEREF(__pyx_n_u_images);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_n_u_images);
    __Pyx_INCREF(__pyx_kp_u_select_model_png);
    __Pyx_GIVEREF(__pyx_kp_u_select_model_png);
    PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_5, __pyx_kp_u_select_model_png);
    __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_qt_qtwes2.pyx":2231
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-solved.png'))),
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'select-model.png'))),
 *                             QKeySequence(str2q(settings['action.edit_moves'])),             # <<<<<<<<<<<<<<
 *                             QKeySequence(str2q(settings['action.edit_cube'])),
 *                             settings['window.editbar'],
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyObject_GetItem(__pyx_t_7, __pyx_kp_u_action_edit_moves); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_qt_qtwes2.pyx":2232
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'select-model.png'))),
 *                             QKeySequence(str2q(settings['action.edit_moves'])),
 *                             QKeySequence(str2q(settings['action.edit_cube'])),             # <<<<<<<<<<<<<<
 *                             settings['window.editbar'],
 *                             settings['window.statusbar'])
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_kp_u_action_edit_cube); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_qt_qtwes2.pyx":2233
 *                             QKeySequence(str2q(settings['action.edit_moves'])),
 *                             QKeySequence(str2q(settings['action.edit_cube'])),
 *                             settings['window.editbar'],             # <<<<<<<<<<<<<<
 *                             settings['window.statusbar'])
 *     uidata.mainwindow.setWindowIcon(QIcon(str2q(config_.APPICON_FILE)))
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_7, __pyx_kp_u_window_editbar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":2234
 *                             QKeySequence(str2q(settings['action.edit_cube'])),
 *                             settings['window.editbar'],
 *                             settings['window.statusbar'])             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.setWindowIcon(QIcon(str2q(config_.APPICON_FILE)))
 *     qtui.set_shortcuts(QKeySequence(str2q(settings['action.selectmodel'])),
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_kp_u_window_statusbar); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "_qt_qtwes2.pyx":2227
 *     #uidata.drawingarea = DrawingArea()
 * 
 *     qtui.setupUi_main(uidata.mainwindow,             # <<<<<<<<<<<<<<
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-random.png'))),
 *                             QIcon(str2q(os.path.join(config_.UI_DIR, 'qt', 'images', 'new-solved.png'))),
 */
  __pyx_f_6_qtui__setupUi_main(__pyx_v_10_qt_qtwes2_uidata.mainwindow, QIcon(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1)), QIcon(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2)), QIcon(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_6)), QKeySequence(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_8)), QKeySequence(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_4)), __pyx_t_9, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2235
 *                             settings['window.editbar'],
 *                             settings['window.statusbar'])
 *     uidata.mainwindow.setWindowIcon(QIcon(str2q(config_.APPICON_FILE)))             # <<<<<<<<<<<<<<
 *     qtui.set_shortcuts(QKeySequence(str2q(settings['action.selectmodel'])),
 *                        QKeySequence(str2q(settings['action.initial_state'])),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_APPICON_FILE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_10_qt_qtwes2_uidata.mainwindow->setWindowIcon(QIcon(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_8)));
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "_qt_qtwes2.pyx":2236
 *                             settings['window.statusbar'])
 *     uidata.mainwindow.setWindowIcon(QIcon(str2q(config_.APPICON_FILE)))
 *     qtui.set_shortcuts(QKeySequence(str2q(settings['action.selectmodel'])),             # <<<<<<<<<<<<<<
 *                        QKeySequence(str2q(settings['action.initial_state'])),
 *                        QKeySequence(str2q(settings['action.reset_rotation'])),
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyObject_GetItem(__pyx_t_8, __pyx_kp_u_action_selectmodel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "_qt_qtwes2.pyx":2237
 *     uidata.mainwindow.setWindowIcon(QIcon(str2q(config_.APPICON_FILE)))
 *     qtui.set_shortcuts(QKeySequence(str2q(settings['action.selectmodel'])),
 *                        QKeySequence(str2q(settings['action.initial_state'])),             # <<<<<<<<<<<<<<
 *                        QKeySequence(str2q(settings['action.reset_rotation'])),
 *                        QKeySequence(str2q(settings['action.preferences'])),
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = PyObject_GetItem(__pyx_t_8, __pyx_kp_u_action_initial_state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "_qt_qtwes2.pyx":2238
 *     qtui.set_shortcuts(QKeySequence(str2q(settings['action.selectmodel'])),
 *                        QKeySequence(str2q(settings['action.initial_state'])),
 *                        QKeySequence(str2q(settings['action.reset_rotation'])),             # <<<<<<<<<<<<<<
 *                        QKeySequence(str2q(settings['action.preferences'])),
 *                       )
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_8, __pyx_kp_u_action_reset_rotation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "_qt_qtwes2.pyx":2239
 *                        QKeySequence(str2q(settings['action.initial_state'])),
 *                        QKeySequence(str2q(settings['action.reset_rotation'])),
 *                        QKeySequence(str2q(settings['action.preferences'])),             # <<<<<<<<<<<<<<
 *                       )
 *     uidata.move_edit = new MoveEdit() #px/
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_settings); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_kp_u_action_preferences); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "_qt_qtwes2.pyx":2236
 *                             settings['window.statusbar'])
 *     uidata.mainwindow.setWindowIcon(QIcon(str2q(config_.APPICON_FILE)))
 *     qtui.set_shortcuts(QKeySequence(str2q(settings['action.selectmodel'])),             # <<<<<<<<<<<<<<
 *                        QKeySequence(str2q(settings['action.initial_state'])),
 *                        QKeySequence(str2q(settings['action.reset_rotation'])),
 */
  __pyx_f_6_qtui__set_shortcuts(QKeySequence(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_4)), QKeySequence(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_6)), QKeySequence(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_2)), QKeySequence(__pyx_f_10_qt_qtwes2_str2q(__pyx_t_1)));
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2241
 *                        QKeySequence(str2q(settings['action.preferences'])),
 *                       )
 *     uidata.move_edit = new MoveEdit() #px/             # <<<<<<<<<<<<<<
 *     #uidata.move_edit = MoveEdit()
 *     uidata.drawingarea.init()
 */
  __pyx_v_10_qt_qtwes2_uidata.move_edit = new MoveEdit();

  /* "_qt_qtwes2.pyx":2243
 *     uidata.move_edit = new MoveEdit() #px/
 *     #uidata.move_edit = MoveEdit()
 *     uidata.drawingarea.init()             # <<<<<<<<<<<<<<
 *     qtui.add_widgets(uidata.mainwindow, uidata.move_edit, uidata.drawingarea)
 *     uidata.statuslabel = new QLabel() #px/
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->init();

  /* "_qt_qtwes2.pyx":2244
 *     #uidata.move_edit = MoveEdit()
 *     uidata.drawingarea.init()
 *     qtui.add_widgets(uidata.mainwindow, uidata.move_edit, uidata.drawingarea)             # <<<<<<<<<<<<<<
 *     uidata.statuslabel = new QLabel() #px/
 *     #uidata.statuslabel = QLabel()
 */
  __pyx_f_6_qtui__add_widgets(__pyx_v_10_qt_qtwes2_uidata.mainwindow, __pyx_v_10_qt_qtwes2_uidata.move_edit, __pyx_v_10_qt_qtwes2_uidata.drawingarea);

  /* "_qt_qtwes2.pyx":2245
 *     uidata.drawingarea.init()
 *     qtui.add_widgets(uidata.mainwindow, uidata.move_edit, uidata.drawingarea)
 *     uidata.statuslabel = new QLabel() #px/             # <<<<<<<<<<<<<<
 *     #uidata.statuslabel = QLabel()
 *     uidata.mainwindow.statusBar().addWidget(uidata.statuslabel, 1)
 */
  try {
    __pyx_t_11 = new QLabel();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(0, 2245, __pyx_L1_error)
  }
  __pyx_v_10_qt_qtwes2_uidata.statuslabel = __pyx_t_11;

  /* "_qt_qtwes2.pyx":2247
 *     uidata.statuslabel = new QLabel() #px/
 *     #uidata.statuslabel = QLabel()
 *     uidata.mainwindow.statusBar().addWidget(uidata.statuslabel, 1)             # <<<<<<<<<<<<<<
 *     if debug & DEBUG_NOCONTROLS:
 *         qtui.hide_controls()
 */
  __pyx_v_10_qt_qtwes2_uidata.mainwindow->statusBar()->addWidget(__pyx_v_10_qt_qtwes2_uidata.statuslabel, 1);

  /* "_qt_qtwes2.pyx":2248
 *     #uidata.statuslabel = QLabel()
 *     uidata.mainwindow.statusBar().addWidget(uidata.statuslabel, 1)
 *     if debug & DEBUG_NOCONTROLS:             # <<<<<<<<<<<<<<
 *         qtui.hide_controls()
 * 
 */
  __pyx_t_12 = ((__pyx_v_10_qt_qtwes2_debug & __pyx_e_10_qt_qtwes2_DEBUG_NOCONTROLS) != 0);
  if (__pyx_t_12) {

    /* "_qt_qtwes2.pyx":2249
 *     uidata.mainwindow.statusBar().addWidget(uidata.statuslabel, 1)
 *     if debug & DEBUG_NOCONTROLS:
 *         qtui.hide_controls()             # <<<<<<<<<<<<<<
 * 
 *     cdef QSizePolicy sizepolicy #px+
 */
    __pyx_f_6_qtui__hide_controls();

    /* "_qt_qtwes2.pyx":2248
 *     #uidata.statuslabel = QLabel()
 *     uidata.mainwindow.statusBar().addWidget(uidata.statuslabel, 1)
 *     if debug & DEBUG_NOCONTROLS:             # <<<<<<<<<<<<<<
 *         qtui.hide_controls()
 * 
 */
  }

  /* "_qt_qtwes2.pyx":2252
 * 
 *     cdef QSizePolicy sizepolicy #px+
 *     sizepolicy = QSizePolicy(Expanding, Expanding)             # <<<<<<<<<<<<<<
 *     sizepolicy.setHorizontalStretch(0)
 *     sizepolicy.setVerticalStretch(0)
 */
  __pyx_v_sizepolicy = QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

  /* "_qt_qtwes2.pyx":2253
 *     cdef QSizePolicy sizepolicy #px+
 *     sizepolicy = QSizePolicy(Expanding, Expanding)
 *     sizepolicy.setHorizontalStretch(0)             # <<<<<<<<<<<<<<
 *     sizepolicy.setVerticalStretch(0)
 *     uidata.drawingarea.setSizePolicy(sizepolicy)
 */
  __pyx_v_sizepolicy.setHorizontalStretch(0);

  /* "_qt_qtwes2.pyx":2254
 *     sizepolicy = QSizePolicy(Expanding, Expanding)
 *     sizepolicy.setHorizontalStretch(0)
 *     sizepolicy.setVerticalStretch(0)             # <<<<<<<<<<<<<<
 *     uidata.drawingarea.setSizePolicy(sizepolicy)
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_v_sizepolicy.setVerticalStretch(0);

  /* "_qt_qtwes2.pyx":2255
 *     sizepolicy.setHorizontalStretch(0)
 *     sizepolicy.setVerticalStretch(0)
 *     uidata.drawingarea.setSizePolicy(sizepolicy)             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtq'
 *     #~ uidata.engine = new QQmlEngine()
 */
  __pyx_v_10_qt_qtwes2_uidata.drawingarea->setSizePolicy(__pyx_v_sizepolicy);

  /* "_qt_qtwes2.pyx":2278
 *     #~ uidata.mainwindow.setClearBeforeRendering(False)
 *     #~ ##pxm>IF_END
 *     animation_init()             # <<<<<<<<<<<<<<
 *     settings_timer_create()
 *     load_cursors(os.path.join(config_.UI_DIR, 'cursors', 'mouse_{}.png'))
 */
  __pyx_f_10_qt_qtwes2_animation_init();

  /* "_qt_qtwes2.pyx":2279
 *     #~ ##pxm>IF_END
 *     animation_init()
 *     settings_timer_create()             # <<<<<<<<<<<<<<
 *     load_cursors(os.path.join(config_.UI_DIR, 'cursors', 'mouse_{}.png'))
 * 
 */
  __pyx_f_10_qt_qtwes2_settings_timer_create();

  /* "_qt_qtwes2.pyx":2280
 *     animation_init()
 *     settings_timer_create()
 *     load_cursors(os.path.join(config_.UI_DIR, 'cursors', 'mouse_{}.png'))             # <<<<<<<<<<<<<<
 * 
 * def destroy_window():
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_UI_DIR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_n_u_cursors, __pyx_kp_u_mouse__png};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_n_u_cursors, __pyx_kp_u_mouse__png};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_4);
    __Pyx_INCREF(__pyx_n_u_cursors);
    __Pyx_GIVEREF(__pyx_n_u_cursors);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_n_u_cursors);
    __Pyx_INCREF(__pyx_kp_u_mouse__png);
    __Pyx_GIVEREF(__pyx_kp_u_mouse__png);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_kp_u_mouse__png);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_f_10_qt_qtwes2_load_cursors(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2212
 *     #~ ##pxm>IF_END
 * 
 * def create_window(pyapp):             # <<<<<<<<<<<<<<
 *     pydata.app = pyapp
 *     init_module()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_qt_qtwes2.create_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2282
 *     load_cursors(os.path.join(config_.UI_DIR, 'cursors', 'mouse_{}.png'))
 * 
 * def destroy_window():             # <<<<<<<<<<<<<<
 *     destroy_cursors()
 *     settings_timer_destroy()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_81destroy_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_81destroy_window = {"destroy_window", (PyCFunction)__pyx_pw_10_qt_qtwes2_81destroy_window, METH_NOARGS, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_81destroy_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroy_window (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_80destroy_window(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_80destroy_window(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("destroy_window", 0);

  /* "_qt_qtwes2.pyx":2283
 * 
 * def destroy_window():
 *     destroy_cursors()             # <<<<<<<<<<<<<<
 *     settings_timer_destroy()
 *     ##pxm>IF 'qtw' == 'qtw'
 */
  __pyx_f_10_qt_qtwes2_destroy_cursors();

  /* "_qt_qtwes2.pyx":2284
 * def destroy_window():
 *     destroy_cursors()
 *     settings_timer_destroy()             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     animate_timer_destroy()
 */
  __pyx_f_10_qt_qtwes2_settings_timer_destroy();

  /* "_qt_qtwes2.pyx":2286
 *     settings_timer_destroy()
 *     ##pxm>IF 'qtw' == 'qtw'
 *     animate_timer_destroy()             # <<<<<<<<<<<<<<
 *     ##pxm>IF_END
 *     pydata.app = None
 */
  __pyx_f_10_qt_qtwes2_animate_timer_destroy();

  /* "_qt_qtwes2.pyx":2288
 *     animate_timer_destroy()
 *     ##pxm>IF_END
 *     pydata.app = None             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P with gil
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_app, Py_None) < 0) __PYX_ERR(0, 2288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2282
 *     load_cursors(os.path.join(config_.UI_DIR, 'cursors', 'mouse_{}.png'))
 * 
 * def destroy_window():             # <<<<<<<<<<<<<<
 *     destroy_cursors()
 *     settings_timer_destroy()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_qt_qtwes2.destroy_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_qt_qtwes2.pyx":2291
 * 
 * ##pxm-FUNC P with gil
 * cdef void _on_init_finalize() with gil:             # <<<<<<<<<<<<<<
 *     pydata.app.on_init_finalize()
 * 
 */

static void __pyx_f_10_qt_qtwes2__on_init_finalize(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_on_init_finalize", 0);

  /* "_qt_qtwes2.pyx":2292
 * ##pxm-FUNC P with gil
 * cdef void _on_init_finalize() with gil:
 *     pydata.app.on_init_finalize()             # <<<<<<<<<<<<<<
 * 
 * ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pydata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_app); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_on_init_finalize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_qt_qtwes2.pyx":2291
 * 
 * ##pxm-FUNC P with gil
 * cdef void _on_init_finalize() with gil:             # <<<<<<<<<<<<<<
 *     pydata.app.on_init_finalize()
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("_qt_qtwes2._on_init_finalize", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "_qt_qtwes2.pyx":2302
 * #~ ##pxm>IF_END
 * 
 * def app_post_create(gettext):             # <<<<<<<<<<<<<<
 *     cdef QApplication *app = <QApplication*>QCoreApplication_instance() #px/
 *     #app = QCoreApplication.instance()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10_qt_qtwes2_83app_post_create(PyObject *__pyx_self, PyObject *__pyx_v_gettext); /*proto*/
static PyMethodDef __pyx_mdef_10_qt_qtwes2_83app_post_create = {"app_post_create", (PyCFunction)__pyx_pw_10_qt_qtwes2_83app_post_create, METH_O, 0};
static PyObject *__pyx_pw_10_qt_qtwes2_83app_post_create(PyObject *__pyx_self, PyObject *__pyx_v_gettext) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("app_post_create (wrapper)", 0);
  __pyx_r = __pyx_pf_10_qt_qtwes2_82app_post_create(__pyx_self, ((PyObject *)__pyx_v_gettext));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10_qt_qtwes2_82app_post_create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_gettext) {
  QApplication *__pyx_v_app;
  QFont __pyx_v_font;
  PyObject *__pyx_v_fontpixelsize = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  qreal __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("app_post_create", 0);

  /* "_qt_qtwes2.pyx":2303
 * 
 * def app_post_create(gettext):
 *     cdef QApplication *app = <QApplication*>QCoreApplication_instance() #px/             # <<<<<<<<<<<<<<
 *     #app = QCoreApplication.instance()
 * 
 */
  __pyx_v_app = ((QApplication *)QCoreApplication::instance());

  /* "_qt_qtwes2.pyx":2308
 *     # font
 *     cdef QFont font #px+
 *     try:             # <<<<<<<<<<<<<<
 *         uidata.grid_unit_px = float(os.environ['GRID_UNIT_PX']) / 8
 *     except (KeyError, ValueError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "_qt_qtwes2.pyx":2309
 *     cdef QFont font #px+
 *     try:
 *         uidata.grid_unit_px = float(os.environ['GRID_UNIT_PX']) / 8             # <<<<<<<<<<<<<<
 *     except (KeyError, ValueError):
 *         uidata.grid_unit_px = 1.
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2309, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2309, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_u_GRID_UNIT_PX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2309, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_t_4); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2309, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_10_qt_qtwes2_uidata.grid_unit_px = (__pyx_t_6 / 8.0);

      /* "_qt_qtwes2.pyx":2308
 *     # font
 *     cdef QFont font #px+
 *     try:             # <<<<<<<<<<<<<<
 *         uidata.grid_unit_px = float(os.environ['GRID_UNIT_PX']) / 8
 *     except (KeyError, ValueError):
 */
    }

    /* "_qt_qtwes2.pyx":2315
 *     else:
 *         # On the Ubuntu phone the default font is broken without Ubuntu.Components imported
 *         font = app.font()             # <<<<<<<<<<<<<<
 *         # Default in ubuntu-ui-toolkit: fontUnits = 14.0f (to small, use 18.0), DEFAULT_GRID_UNIT_PX = 8
 *         #TODO: use QWindow.devicePixelRatio
 */
    /*else:*/ {
      __pyx_v_font = __pyx_v_app->font();

      /* "_qt_qtwes2.pyx":2318
 *         # Default in ubuntu-ui-toolkit: fontUnits = 14.0f (to small, use 18.0), DEFAULT_GRID_UNIT_PX = 8
 *         #TODO: use QWindow.devicePixelRatio
 *         fontpixelsize = 18.0 * uidata.grid_unit_px / app.devicePixelRatio()             # <<<<<<<<<<<<<<
 *         font.setFamily(str2q("Ubuntu"))
 *         font.setPixelSize(int(fontpixelsize))
 */
      __pyx_t_6 = (18.0 * __pyx_v_10_qt_qtwes2_uidata.grid_unit_px);
      __pyx_t_7 = __pyx_v_app->devicePixelRatio();
      if (unlikely(__pyx_t_7 == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 2318, __pyx_L5_except_error)
      }
      __pyx_t_4 = PyFloat_FromDouble((((qreal)__pyx_t_6) / __pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2318, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_fontpixelsize = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "_qt_qtwes2.pyx":2319
 *         #TODO: use QWindow.devicePixelRatio
 *         fontpixelsize = 18.0 * uidata.grid_unit_px / app.devicePixelRatio()
 *         font.setFamily(str2q("Ubuntu"))             # <<<<<<<<<<<<<<
 *         font.setPixelSize(int(fontpixelsize))
 *         font.setWeight(50)
 */
      __pyx_v_font.setFamily(__pyx_f_10_qt_qtwes2_str2q(__pyx_n_u_Ubuntu));

      /* "_qt_qtwes2.pyx":2320
 *         fontpixelsize = 18.0 * uidata.grid_unit_px / app.devicePixelRatio()
 *         font.setFamily(str2q("Ubuntu"))
 *         font.setPixelSize(int(fontpixelsize))             # <<<<<<<<<<<<<<
 *         font.setWeight(50)
 *         app.setFont(font)
 */
      __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_v_fontpixelsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2320, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2320, __pyx_L5_except_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_font.setPixelSize(__pyx_t_8);

      /* "_qt_qtwes2.pyx":2321
 *         font.setFamily(str2q("Ubuntu"))
 *         font.setPixelSize(int(fontpixelsize))
 *         font.setWeight(50)             # <<<<<<<<<<<<<<
 *         app.setFont(font)
 * 
 */
      __pyx_v_font.setWeight(50);

      /* "_qt_qtwes2.pyx":2322
 *         font.setPixelSize(int(fontpixelsize))
 *         font.setWeight(50)
 *         app.setFont(font)             # <<<<<<<<<<<<<<
 * 
 *     global _
 */
      __pyx_v_app->setFont(__pyx_v_font);
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_qt_qtwes2.pyx":2310
 *     try:
 *         uidata.grid_unit_px = float(os.environ['GRID_UNIT_PX']) / 8
 *     except (KeyError, ValueError):             # <<<<<<<<<<<<<<
 *         uidata.grid_unit_px = 1.
 *         fontpixelsize = 14.0
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("_qt_qtwes2.app_post_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(0, 2310, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_9);

      /* "_qt_qtwes2.pyx":2311
 *         uidata.grid_unit_px = float(os.environ['GRID_UNIT_PX']) / 8
 *     except (KeyError, ValueError):
 *         uidata.grid_unit_px = 1.             # <<<<<<<<<<<<<<
 *         fontpixelsize = 14.0
 *     else:
 */
      __pyx_v_10_qt_qtwes2_uidata.grid_unit_px = 1.;

      /* "_qt_qtwes2.pyx":2312
 *     except (KeyError, ValueError):
 *         uidata.grid_unit_px = 1.
 *         fontpixelsize = 14.0             # <<<<<<<<<<<<<<
 *     else:
 *         # On the Ubuntu phone the default font is broken without Ubuntu.Components imported
 */
      __Pyx_INCREF(__pyx_float_14_0);
      __pyx_v_fontpixelsize = __pyx_float_14_0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "_qt_qtwes2.pyx":2308
 *     # font
 *     cdef QFont font #px+
 *     try:             # <<<<<<<<<<<<<<
 *         uidata.grid_unit_px = float(os.environ['GRID_UNIT_PX']) / 8
 *     except (KeyError, ValueError):
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  /* "_qt_qtwes2.pyx":2325
 * 
 *     global _
 *     _ = gettext             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.init_gettext(_)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__4, __pyx_v_gettext) < 0) __PYX_ERR(0, 2325, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2327
 *     _ = gettext
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.init_gettext(_)             # <<<<<<<<<<<<<<
 *     ##pxm>IF_END
 * 
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s__4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_f_6_qtui__init_gettext(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "_qt_qtwes2.pyx":2302
 * #~ ##pxm>IF_END
 * 
 * def app_post_create(gettext):             # <<<<<<<<<<<<<<
 *     cdef QApplication *app = <QApplication*>QCoreApplication_instance() #px/
 *     #app = QCoreApplication.instance()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("_qt_qtwes2.app_post_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fontpixelsize);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *__pyx_freelist_10_qt_qtwes2___pyx_scope_struct__keyval_from_name[8];
static int __pyx_freecount_10_qt_qtwes2___pyx_scope_struct__keyval_from_name = 0;

static PyObject *__pyx_tp_new_10_qt_qtwes2___pyx_scope_struct__keyval_from_name(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10_qt_qtwes2___pyx_scope_struct__keyval_from_name > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name)))) {
    o = (PyObject*)__pyx_freelist_10_qt_qtwes2___pyx_scope_struct__keyval_from_name[--__pyx_freecount_10_qt_qtwes2___pyx_scope_struct__keyval_from_name];
    memset(o, 0, sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10_qt_qtwes2___pyx_scope_struct__keyval_from_name(PyObject *o) {
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *p = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_keystr);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10_qt_qtwes2___pyx_scope_struct__keyval_from_name < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name)))) {
    __pyx_freelist_10_qt_qtwes2___pyx_scope_struct__keyval_from_name[__pyx_freecount_10_qt_qtwes2___pyx_scope_struct__keyval_from_name++] = ((struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10_qt_qtwes2___pyx_scope_struct__keyval_from_name(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *p = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *)o;
  if (p->__pyx_v_keystr) {
    e = (*v)(p->__pyx_v_keystr, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10_qt_qtwes2___pyx_scope_struct__keyval_from_name(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *p = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *)o;
  tmp = ((PyObject*)p->__pyx_v_keystr);
  p->__pyx_v_keystr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_10_qt_qtwes2___pyx_scope_struct__keyval_from_name = {
  PyVarObject_HEAD_INIT(0, 0)
  "_qt_qtwes2.__pyx_scope_struct__keyval_from_name", /*tp_name*/
  sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10_qt_qtwes2___pyx_scope_struct__keyval_from_name, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10_qt_qtwes2___pyx_scope_struct__keyval_from_name, /*tp_traverse*/
  __pyx_tp_clear_10_qt_qtwes2___pyx_scope_struct__keyval_from_name, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10_qt_qtwes2___pyx_scope_struct__keyval_from_name, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *__pyx_freelist_10_qt_qtwes2___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_10_qt_qtwes2___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_10_qt_qtwes2___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10_qt_qtwes2___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_10_qt_qtwes2___pyx_scope_struct_1_genexpr[--__pyx_freecount_10_qt_qtwes2___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_10_qt_qtwes2___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_k);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10_qt_qtwes2___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_10_qt_qtwes2___pyx_scope_struct_1_genexpr[__pyx_freecount_10_qt_qtwes2___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10_qt_qtwes2___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10_qt_qtwes2___pyx_scope_struct_1_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct__keyval_from_name *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_k);
  p->__pyx_v_k = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_10_qt_qtwes2___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "_qt_qtwes2.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_10_qt_qtwes2___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10_qt_qtwes2___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10_qt_qtwes2___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  __pyx_tp_clear_10_qt_qtwes2___pyx_scope_struct_1_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10_qt_qtwes2___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"set_atlas_size", (PyCFunction)__pyx_pw_10_qt_qtwes2_7set_atlas_size, METH_VARARGS|METH_KEYWORDS, 0},
  {"settings_timer_start", (PyCFunction)__pyx_pw_10_qt_qtwes2_69settings_timer_start, METH_NOARGS, 0},
  {"animate_timer_start", (PyCFunction)__pyx_pw_10_qt_qtwes2_73animate_timer_start, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "_qt_qtwes2",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_APPICON_FILE, __pyx_k_APPICON_FILE, sizeof(__pyx_k_APPICON_FILE), 0, 0, 1, 1},
  {&__pyx_n_s_APPNAME, __pyx_k_APPNAME, sizeof(__pyx_k_APPNAME), 0, 0, 1, 1},
  {&__pyx_n_s_COPYRIGHT, __pyx_k_COPYRIGHT, sizeof(__pyx_k_COPYRIGHT), 0, 0, 1, 1},
  {&__pyx_n_s_ControlModifier, __pyx_k_ControlModifier, sizeof(__pyx_k_ControlModifier), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_DRAW, __pyx_k_DEBUG_DRAW, sizeof(__pyx_k_DEBUG_DRAW), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_FPS, __pyx_k_DEBUG_FPS, sizeof(__pyx_k_DEBUG_FPS), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_GLDEBUG, __pyx_k_DEBUG_GLDEBUG, sizeof(__pyx_k_DEBUG_GLDEBUG), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_MSG, __pyx_k_DEBUG_MSG, sizeof(__pyx_k_DEBUG_MSG), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_MSGEXT, __pyx_k_DEBUG_MSGEXT, sizeof(__pyx_k_DEBUG_MSGEXT), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_MSGGL, __pyx_k_DEBUG_MSGGL, sizeof(__pyx_k_DEBUG_MSGGL), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_NOCONTROLS, __pyx_k_DEBUG_NOCONTROLS, sizeof(__pyx_k_DEBUG_NOCONTROLS), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_PHONE, __pyx_k_DEBUG_PHONE, sizeof(__pyx_k_DEBUG_PHONE), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_QML, __pyx_k_DEBUG_QML, sizeof(__pyx_k_DEBUG_QML), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_SIM, __pyx_k_DEBUG_SIM, sizeof(__pyx_k_DEBUG_SIM), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG_VFPS, __pyx_k_DEBUG_VFPS, sizeof(__pyx_k_DEBUG_VFPS), 0, 0, 1, 1},
  {&__pyx_kp_u_GL_type_es2, __pyx_k_GL_type_es2, sizeof(__pyx_k_GL_type_es2), 0, 1, 0, 0},
  {&__pyx_n_u_GRID_UNIT_PX, __pyx_k_GRID_UNIT_PX, sizeof(__pyx_k_GRID_UNIT_PX), 0, 1, 0, 1},
  {&__pyx_n_u_KP, __pyx_k_KP, sizeof(__pyx_k_KP), 0, 1, 0, 1},
  {&__pyx_n_u_Key, __pyx_k_Key, sizeof(__pyx_k_Key), 0, 1, 0, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_Key_Down, __pyx_k_Key_Down, sizeof(__pyx_k_Key_Down), 0, 0, 1, 1},
  {&__pyx_n_s_Key_Escape, __pyx_k_Key_Escape, sizeof(__pyx_k_Key_Escape), 0, 0, 1, 1},
  {&__pyx_n_s_Key_Left, __pyx_k_Key_Left, sizeof(__pyx_k_Key_Left), 0, 0, 1, 1},
  {&__pyx_n_s_Key_Period, __pyx_k_Key_Period, sizeof(__pyx_k_Key_Period), 0, 0, 1, 1},
  {&__pyx_n_s_Key_Right, __pyx_k_Key_Right, sizeof(__pyx_k_Key_Right), 0, 0, 1, 1},
  {&__pyx_n_s_Key_Up, __pyx_k_Key_Up, sizeof(__pyx_k_Key_Up), 0, 0, 1, 1},
  {&__pyx_n_s_LeftButton, __pyx_k_LeftButton, sizeof(__pyx_k_LeftButton), 0, 0, 1, 1},
  {&__pyx_n_u_Move, __pyx_k_Move, sizeof(__pyx_k_Move), 0, 1, 0, 1},
  {&__pyx_n_u_Num, __pyx_k_Num, sizeof(__pyx_k_Num), 0, 1, 0, 1},
  {&__pyx_kp_u_OFFSCREEN, __pyx_k_OFFSCREEN, sizeof(__pyx_k_OFFSCREEN), 0, 1, 0, 0},
  {&__pyx_kp_u_Open_Image, __pyx_k_Open_Image, sizeof(__pyx_k_Open_Image), 0, 1, 0, 0},
  {&__pyx_n_s_PyData, __pyx_k_PyData, sizeof(__pyx_k_PyData), 0, 0, 1, 1},
  {&__pyx_kp_u_QObject, __pyx_k_QObject, sizeof(__pyx_k_QObject), 0, 1, 0, 0},
  {&__pyx_n_b_QString, __pyx_k_QString, sizeof(__pyx_k_QString), 0, 0, 0, 1},
  {&__pyx_n_s_QtKeys, __pyx_k_QtKeys, sizeof(__pyx_k_QtKeys), 0, 0, 1, 1},
  {&__pyx_n_s_RightButton, __pyx_k_RightButton, sizeof(__pyx_k_RightButton), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeWarning, __pyx_k_RuntimeWarning, sizeof(__pyx_k_RuntimeWarning), 0, 0, 1, 1},
  {&__pyx_n_s_SHORT_DESCRIPTION, __pyx_k_SHORT_DESCRIPTION, sizeof(__pyx_k_SHORT_DESCRIPTION), 0, 0, 1, 1},
  {&__pyx_n_s_ShiftModifier, __pyx_k_ShiftModifier, sizeof(__pyx_k_ShiftModifier), 0, 0, 1, 1},
  {&__pyx_kp_u_Skip_mime_type, __pyx_k_Skip_mime_type, sizeof(__pyx_k_Skip_mime_type), 0, 1, 0, 0},
  {&__pyx_n_s_Theme, __pyx_k_Theme, sizeof(__pyx_k_Theme), 0, 0, 1, 1},
  {&__pyx_n_s_UI_DIR, __pyx_k_UI_DIR, sizeof(__pyx_k_UI_DIR), 0, 0, 1, 1},
  {&__pyx_n_u_Ubuntu, __pyx_k_Ubuntu, sizeof(__pyx_k_Ubuntu), 0, 1, 0, 1},
  {&__pyx_n_s_VERSION, __pyx_k_VERSION, sizeof(__pyx_k_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
  {&__pyx_kp_u__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0, 0},
  {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1},
  {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
  {&__pyx_n_u_about_contribute, __pyx_k_about_contribute, sizeof(__pyx_k_about_contribute), 0, 1, 0, 1},
  {&__pyx_n_u_about_license_full, __pyx_k_about_license_full, sizeof(__pyx_k_about_license_full), 0, 1, 0, 1},
  {&__pyx_n_u_about_license_notfound, __pyx_k_about_license_notfound, sizeof(__pyx_k_about_license_notfound), 0, 1, 0, 1},
  {&__pyx_n_u_about_license_short, __pyx_k_about_license_short, sizeof(__pyx_k_about_license_short), 0, 1, 0, 1},
  {&__pyx_n_u_about_translators, __pyx_k_about_translators, sizeof(__pyx_k_about_translators), 0, 1, 0, 1},
  {&__pyx_n_u_about_website, __pyx_k_about_website, sizeof(__pyx_k_about_website), 0, 1, 0, 1},
  {&__pyx_kp_u_action_edit_cube, __pyx_k_action_edit_cube, sizeof(__pyx_k_action_edit_cube), 0, 1, 0, 0},
  {&__pyx_kp_u_action_edit_moves, __pyx_k_action_edit_moves, sizeof(__pyx_k_action_edit_moves), 0, 1, 0, 0},
  {&__pyx_kp_u_action_initial_state, __pyx_k_action_initial_state, sizeof(__pyx_k_action_initial_state), 0, 1, 0, 0},
  {&__pyx_kp_u_action_preferences, __pyx_k_action_preferences, sizeof(__pyx_k_action_preferences), 0, 1, 0, 0},
  {&__pyx_kp_u_action_reset_rotation, __pyx_k_action_reset_rotation, sizeof(__pyx_k_action_reset_rotation), 0, 1, 0, 0},
  {&__pyx_kp_u_action_selectmodel, __pyx_k_action_selectmodel, sizeof(__pyx_k_action_selectmodel), 0, 1, 0, 0},
  {&__pyx_n_s_angle_max, __pyx_k_angle_max, sizeof(__pyx_k_angle_max), 0, 0, 1, 1},
  {&__pyx_n_s_animate_timer_step, __pyx_k_animate_timer_step, sizeof(__pyx_k_animate_timer_step), 0, 0, 1, 1},
  {&__pyx_n_s_animate_timer_stop, __pyx_k_animate_timer_stop, sizeof(__pyx_k_animate_timer_stop), 0, 0, 1, 1},
  {&__pyx_n_s_app, __pyx_k_app, sizeof(__pyx_k_app), 0, 0, 1, 1},
  {&__pyx_n_s_app_post_create, __pyx_k_app_post_create, sizeof(__pyx_k_app_post_create), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_b_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 0, 1},
  {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1},
  {&__pyx_n_u_button_mousemode_ext, __pyx_k_button_mousemode_ext, sizeof(__pyx_k_button_mousemode_ext), 0, 1, 0, 1},
  {&__pyx_n_u_button_mousemode_gesture, __pyx_k_button_mousemode_gesture, sizeof(__pyx_k_button_mousemode_gesture), 0, 1, 0, 1},
  {&__pyx_n_u_button_mousemode_quad, __pyx_k_button_mousemode_quad, sizeof(__pyx_k_button_mousemode_quad), 0, 1, 0, 1},
  {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1},
  {&__pyx_n_u_ccw, __pyx_k_ccw, sizeof(__pyx_k_ccw), 0, 1, 0, 1},
  {&__pyx_n_u_checkbox_mirror_faces, __pyx_k_checkbox_mirror_faces, sizeof(__pyx_k_checkbox_mirror_faces), 0, 1, 0, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_close_mainwindow, __pyx_k_close_mainwindow, sizeof(__pyx_k_close_mainwindow), 0, 0, 1, 1},
  {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
  {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
  {&__pyx_n_u_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 1, 0, 1},
  {&__pyx_n_u_combobox_samples, __pyx_k_combobox_samples, sizeof(__pyx_k_combobox_samples), 0, 1, 0, 1},
  {&__pyx_n_u_combobox_shader, __pyx_k_combobox_shader, sizeof(__pyx_k_combobox_shader), 0, 1, 0, 1},
  {&__pyx_kp_u_compiled, __pyx_k_compiled, sizeof(__pyx_k_compiled), 0, 1, 0, 0},
  {&__pyx_n_s_compiled_2, __pyx_k_compiled_2, sizeof(__pyx_k_compiled_2), 0, 0, 1, 1},
  {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
  {&__pyx_n_s_config_2, __pyx_k_config_2, sizeof(__pyx_k_config_2), 0, 0, 1, 1},
  {&__pyx_n_s_create_filesystemwatcher, __pyx_k_create_filesystemwatcher, sizeof(__pyx_k_create_filesystemwatcher), 0, 0, 1, 1},
  {&__pyx_n_s_create_window, __pyx_k_create_window, sizeof(__pyx_k_create_window), 0, 0, 1, 1},
  {&__pyx_n_s_currentfolder, __pyx_k_currentfolder, sizeof(__pyx_k_currentfolder), 0, 0, 1, 1},
  {&__pyx_n_u_cursors, __pyx_k_cursors, sizeof(__pyx_k_cursors), 0, 1, 0, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_destroy_window, __pyx_k_destroy_window, sizeof(__pyx_k_destroy_window), 0, 0, 1, 1},
  {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  {&__pyx_n_s_divider_pos, __pyx_k_divider_pos, sizeof(__pyx_k_divider_pos), 0, 0, 1, 1},
  {&__pyx_n_s_divider_pos2, __pyx_k_divider_pos2, sizeof(__pyx_k_divider_pos2), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_b_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 0, 1},
  {&__pyx_kp_u_drag_enter, __pyx_k_drag_enter, sizeof(__pyx_k_drag_enter), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_accels, __pyx_k_draw_accels, sizeof(__pyx_k_draw_accels), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_mirror_distance, __pyx_k_draw_mirror_distance, sizeof(__pyx_k_draw_mirror_distance), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_mirror_distance_default, __pyx_k_draw_mirror_distance_default, sizeof(__pyx_k_draw_mirror_distance_default), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_mirror_distance_range, __pyx_k_draw_mirror_distance_range, sizeof(__pyx_k_draw_mirror_distance_range), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_mirror_faces, __pyx_k_draw_mirror_faces, sizeof(__pyx_k_draw_mirror_faces), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_mirror_faces_default, __pyx_k_draw_mirror_faces_default, sizeof(__pyx_k_draw_mirror_faces_default), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_samples, __pyx_k_draw_samples, sizeof(__pyx_k_draw_samples), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_samples_default, __pyx_k_draw_samples_default, sizeof(__pyx_k_draw_samples_default), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_samples_range, __pyx_k_draw_samples_range, sizeof(__pyx_k_draw_samples_range), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_selection_nick, __pyx_k_draw_selection_nick, sizeof(__pyx_k_draw_selection_nick), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_shader, __pyx_k_draw_shader, sizeof(__pyx_k_draw_shader), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_shader_default, __pyx_k_draw_shader_default, sizeof(__pyx_k_draw_shader_default), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_shader_range, __pyx_k_draw_shader_range, sizeof(__pyx_k_draw_shader_range), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_speed, __pyx_k_draw_speed, sizeof(__pyx_k_draw_speed), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_speed_default, __pyx_k_draw_speed_default, sizeof(__pyx_k_draw_speed_default), 0, 1, 0, 0},
  {&__pyx_kp_u_draw_speed_range, __pyx_k_draw_speed_range, sizeof(__pyx_k_draw_speed_range), 0, 1, 0, 0},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1},
  {&__pyx_n_s_facekey, __pyx_k_facekey, sizeof(__pyx_k_facekey), 0, 0, 1, 1},
  {&__pyx_n_s_facename, __pyx_k_facename, sizeof(__pyx_k_facename), 0, 0, 1, 1},
  {&__pyx_n_s_facenames, __pyx_k_facenames, sizeof(__pyx_k_facenames), 0, 0, 1, 1},
  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
  {&__pyx_n_s_filesystemwatcher_handlers, __pyx_k_filesystemwatcher_handlers, sizeof(__pyx_k_filesystemwatcher_handlers), 0, 0, 1, 1},
  {&__pyx_n_s_filesystemwatcher_path, __pyx_k_filesystemwatcher_path, sizeof(__pyx_k_filesystemwatcher_path), 0, 0, 1, 1},
  {&__pyx_n_s_fill_sidepane, __pyx_k_fill_sidepane, sizeof(__pyx_k_fill_sidepane), 0, 0, 1, 1},
  {&__pyx_n_s_font, __pyx_k_font, sizeof(__pyx_k_font), 0, 0, 1, 1},
  {&__pyx_n_s_fontpixelsize, __pyx_k_fontpixelsize, sizeof(__pyx_k_fontpixelsize), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_kp_u_from_package, __pyx_k_from_package, sizeof(__pyx_k_from_package), 0, 1, 0, 0},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_u_gesture, __pyx_k_gesture, sizeof(__pyx_k_gesture), 0, 1, 0, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_filedialog_imagefile, __pyx_k_get_filedialog_imagefile, sizeof(__pyx_k_get_filedialog_imagefile), 0, 0, 1, 1},
  {&__pyx_n_s_get_imagefile, __pyx_k_get_imagefile, sizeof(__pyx_k_get_imagefile), 0, 0, 1, 1},
  {&__pyx_n_s_get_pictures_folder, __pyx_k_get_pictures_folder, sizeof(__pyx_k_get_pictures_folder), 0, 0, 1, 1},
  {&__pyx_n_s_get_samples, __pyx_k_get_samples, sizeof(__pyx_k_get_samples), 0, 0, 1, 1},
  {&__pyx_n_s_gettext, __pyx_k_gettext, sizeof(__pyx_k_gettext), 0, 0, 1, 1},
  {&__pyx_n_s_gl_delete_atlas, __pyx_k_gl_delete_atlas, sizeof(__pyx_k_gl_delete_atlas), 0, 0, 1, 1},
  {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
  {&__pyx_n_u_help_text, __pyx_k_help_text, sizeof(__pyx_k_help_text), 0, 1, 0, 1},
  {&__pyx_kp_s_tmp, __pyx_k_tmp, sizeof(__pyx_k_tmp), 0, 0, 1, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_icon, __pyx_k_icon, sizeof(__pyx_k_icon), 0, 0, 1, 1},
  {&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1},
  {&__pyx_n_u_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 1, 0, 1},
  {&__pyx_n_s_image_from_file, __pyx_k_image_from_file, sizeof(__pyx_k_image_from_file), 0, 0, 1, 1},
  {&__pyx_n_s_imagefile, __pyx_k_imagefile, sizeof(__pyx_k_imagefile), 0, 0, 1, 1},
  {&__pyx_n_s_imageindex, __pyx_k_imageindex, sizeof(__pyx_k_imageindex), 0, 0, 1, 1},
  {&__pyx_n_s_imageindex_icon, __pyx_k_imageindex_icon, sizeof(__pyx_k_imageindex_icon), 0, 0, 1, 1},
  {&__pyx_n_s_imagemode, __pyx_k_imagemode, sizeof(__pyx_k_imagemode), 0, 0, 1, 1},
  {&__pyx_n_u_images, __pyx_k_images, sizeof(__pyx_k_images), 0, 1, 0, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_index_icon, __pyx_k_index_icon, sizeof(__pyx_k_index_icon), 0, 0, 1, 1},
  {&__pyx_kp_u_init_module, __pyx_k_init_module, sizeof(__pyx_k_init_module), 0, 1, 0, 0},
  {&__pyx_n_s_initial_resize, __pyx_k_initial_resize, sizeof(__pyx_k_initial_resize), 0, 0, 1, 1},
  {&__pyx_n_b_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 0, 1},
  {&__pyx_n_s_isfile, __pyx_k_isfile, sizeof(__pyx_k_isfile), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_keyseq, __pyx_k_keyseq, sizeof(__pyx_k_keyseq), 0, 0, 1, 1},
  {&__pyx_n_s_keystr, __pyx_k_keystr, sizeof(__pyx_k_keystr), 0, 0, 1, 1},
  {&__pyx_n_s_keyval_from_name, __pyx_k_keyval_from_name, sizeof(__pyx_k_keyval_from_name), 0, 0, 1, 1},
  {&__pyx_n_s_keyval_from_name_locals_genexpr, __pyx_k_keyval_from_name_locals_genexpr, sizeof(__pyx_k_keyval_from_name_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_u_label_needs_restarted, __pyx_k_label_needs_restarted, sizeof(__pyx_k_label_needs_restarted), 0, 1, 0, 1},
  {&__pyx_n_s_load_image_from_file, __pyx_k_load_image_from_file, sizeof(__pyx_k_load_image_from_file), 0, 0, 1, 1},
  {&__pyx_n_s_load_ui, __pyx_k_load_ui, sizeof(__pyx_k_load_ui), 0, 0, 1, 1},
  {&__pyx_n_s_locations, __pyx_k_locations, sizeof(__pyx_k_locations), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_u_mode_nick, __pyx_k_mode_nick, sizeof(__pyx_k_mode_nick), 0, 1, 0, 1},
  {&__pyx_n_s_modelselect, __pyx_k_modelselect, sizeof(__pyx_k_modelselect), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
  {&__pyx_n_u_mosaic, __pyx_k_mosaic, sizeof(__pyx_k_mosaic), 0, 1, 0, 1},
  {&__pyx_kp_u_mouse__png, __pyx_k_mouse__png, sizeof(__pyx_k_mouse__png), 0, 1, 0, 0},
  {&__pyx_n_s_msec, __pyx_k_msec, sizeof(__pyx_k_msec), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_kp_u_new_random_png, __pyx_k_new_random_png, sizeof(__pyx_k_new_random_png), 0, 1, 0, 0},
  {&__pyx_kp_u_new_solved_png, __pyx_k_new_solved_png, sizeof(__pyx_k_new_solved_png), 0, 1, 0, 0},
  {&__pyx_n_s_nick, __pyx_k_nick, sizeof(__pyx_k_nick), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_challenge_triggered, __pyx_k_on_action_challenge_triggered, sizeof(__pyx_k_on_action_challenge_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_edit_cube_triggered, __pyx_k_on_action_edit_cube_triggered, sizeof(__pyx_k_on_action_edit_cube_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_forward_triggered, __pyx_k_on_action_forward_triggered, sizeof(__pyx_k_on_action_forward_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_initial_state_triggere, __pyx_k_on_action_initial_state_triggere, sizeof(__pyx_k_on_action_initial_state_triggere), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_mark_remove_triggered, __pyx_k_on_action_mark_remove_triggered, sizeof(__pyx_k_on_action_mark_remove_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_mark_set_triggered, __pyx_k_on_action_mark_set_triggered, sizeof(__pyx_k_on_action_mark_set_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_new_solved_triggered, __pyx_k_on_action_new_solved_triggered, sizeof(__pyx_k_on_action_new_solved_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_next_triggered, __pyx_k_on_action_next_triggered, sizeof(__pyx_k_on_action_next_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_play_triggered, __pyx_k_on_action_play_triggered, sizeof(__pyx_k_on_action_play_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_preferences_triggered, __pyx_k_on_action_preferences_triggered, sizeof(__pyx_k_on_action_preferences_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_previous_triggered, __pyx_k_on_action_previous_triggered, sizeof(__pyx_k_on_action_previous_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_reset_rotation_trigger, __pyx_k_on_action_reset_rotation_trigger, sizeof(__pyx_k_on_action_reset_rotation_trigger), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_rewind_triggered, __pyx_k_on_action_rewind_triggered, sizeof(__pyx_k_on_action_rewind_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_selectmodel_triggered, __pyx_k_on_action_selectmodel_triggered, sizeof(__pyx_k_on_action_selectmodel_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_action_stop_triggered, __pyx_k_on_action_stop_triggered, sizeof(__pyx_k_on_action_stop_triggered), 0, 0, 1, 1},
  {&__pyx_n_s_on_animation_ending, __pyx_k_on_animation_ending, sizeof(__pyx_k_on_animation_ending), 0, 0, 1, 1},
  {&__pyx_n_s_on_closing, __pyx_k_on_closing, sizeof(__pyx_k_on_closing), 0, 0, 1, 1},
  {&__pyx_n_s_on_convert_to_mtype_size, __pyx_k_on_convert_to_mtype_size, sizeof(__pyx_k_on_convert_to_mtype_size), 0, 0, 1, 1},
  {&__pyx_n_s_on_dialog_change_current_face, __pyx_k_on_dialog_change_current_face, sizeof(__pyx_k_on_dialog_change_current_face), 0, 0, 1, 1},
  {&__pyx_n_s_on_dialog_change_current_image, __pyx_k_on_dialog_change_current_image, sizeof(__pyx_k_on_dialog_change_current_image), 0, 0, 1, 1},
  {&__pyx_n_s_on_dialog_reset_current_image, __pyx_k_on_dialog_reset_current_image, sizeof(__pyx_k_on_dialog_reset_current_image), 0, 0, 1, 1},
  {&__pyx_n_s_on_dialog_text, __pyx_k_on_dialog_text, sizeof(__pyx_k_on_dialog_text), 0, 0, 1, 1},
  {&__pyx_n_s_on_edit_finished, __pyx_k_on_edit_finished, sizeof(__pyx_k_on_edit_finished), 0, 0, 1, 1},
  {&__pyx_n_s_on_edit_moves_nextword, __pyx_k_on_edit_moves_nextword, sizeof(__pyx_k_on_edit_moves_nextword), 0, 0, 1, 1},
  {&__pyx_n_s_on_edit_moves_prevword, __pyx_k_on_edit_moves_prevword, sizeof(__pyx_k_on_edit_moves_prevword), 0, 0, 1, 1},
  {&__pyx_n_s_on_edit_moves_swapnext, __pyx_k_on_edit_moves_swapnext, sizeof(__pyx_k_on_edit_moves_swapnext), 0, 0, 1, 1},
  {&__pyx_n_s_on_edit_moves_swapprev, __pyx_k_on_edit_moves_swapprev, sizeof(__pyx_k_on_edit_moves_swapprev), 0, 0, 1, 1},
  {&__pyx_n_s_on_init_finalize, __pyx_k_on_init_finalize, sizeof(__pyx_k_on_init_finalize), 0, 0, 1, 1},
  {&__pyx_n_s_on_key_pressed, __pyx_k_on_key_pressed, sizeof(__pyx_k_on_key_pressed), 0, 0, 1, 1},
  {&__pyx_n_s_on_load_other_game, __pyx_k_on_load_other_game, sizeof(__pyx_k_on_load_other_game), 0, 0, 1, 1},
  {&__pyx_n_s_on_model_back, __pyx_k_on_model_back, sizeof(__pyx_k_on_model_back), 0, 0, 1, 1},
  {&__pyx_n_s_on_model_get_modeldata, __pyx_k_on_model_get_modeldata, sizeof(__pyx_k_on_model_get_modeldata), 0, 0, 1, 1},
  {&__pyx_n_s_on_mouse_drop_color, __pyx_k_on_mouse_drop_color, sizeof(__pyx_k_on_mouse_drop_color), 0, 0, 1, 1},
  {&__pyx_n_s_on_mouse_drop_url, __pyx_k_on_mouse_drop_url, sizeof(__pyx_k_on_mouse_drop_url), 0, 0, 1, 1},
  {&__pyx_n_s_on_mouse_moved, __pyx_k_on_mouse_moved, sizeof(__pyx_k_on_mouse_moved), 0, 0, 1, 1},
  {&__pyx_n_s_on_mouse_pressed, __pyx_k_on_mouse_pressed, sizeof(__pyx_k_on_mouse_pressed), 0, 0, 1, 1},
  {&__pyx_n_s_on_mouse_released, __pyx_k_on_mouse_released, sizeof(__pyx_k_on_mouse_released), 0, 0, 1, 1},
  {&__pyx_n_s_on_mouse_zoom, __pyx_k_on_mouse_zoom, sizeof(__pyx_k_on_mouse_zoom), 0, 0, 1, 1},
  {&__pyx_n_s_on_picking_result, __pyx_k_on_picking_result, sizeof(__pyx_k_on_picking_result), 0, 0, 1, 1},
  {&__pyx_n_s_on_plugin_activated, __pyx_k_on_plugin_activated, sizeof(__pyx_k_on_plugin_activated), 0, 0, 1, 1},
  {&__pyx_n_s_on_plugin_test_idx, __pyx_k_on_plugin_test_idx, sizeof(__pyx_k_on_plugin_test_idx), 0, 0, 1, 1},
  {&__pyx_n_s_on_settings_timer_timeout, __pyx_k_on_settings_timer_timeout, sizeof(__pyx_k_on_settings_timer_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_package, __pyx_k_package, sizeof(__pyx_k_package), 0, 0, 1, 1},
  {&__pyx_n_s_parse_color, __pyx_k_parse_color, sizeof(__pyx_k_parse_color), 0, 0, 1, 1},
  {&__pyx_n_s_parse_color_f, __pyx_k_parse_color_f, sizeof(__pyx_k_parse_color_f), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pick_requested, __pyx_k_pick_requested, sizeof(__pyx_k_pick_requested), 0, 0, 1, 1},
  {&__pyx_n_u_plain, __pyx_k_plain, sizeof(__pyx_k_plain), 0, 1, 0, 1},
  {&__pyx_n_s_plugin_data, __pyx_k_plugin_data, sizeof(__pyx_k_plugin_data), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_preferences_dialog, __pyx_k_preferences_dialog, sizeof(__pyx_k_preferences_dialog), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_pyapp, __pyx_k_pyapp, sizeof(__pyx_k_pyapp), 0, 0, 1, 1},
  {&__pyx_n_s_pybiklib, __pyx_k_pybiklib, sizeof(__pyx_k_pybiklib), 0, 0, 1, 1},
  {&__pyx_n_s_pybiklib_settings, __pyx_k_pybiklib_settings, sizeof(__pyx_k_pybiklib_settings), 0, 0, 1, 1},
  {&__pyx_n_s_pydata, __pyx_k_pydata, sizeof(__pyx_k_pydata), 0, 0, 1, 1},
  {&__pyx_n_s_qpath, __pyx_k_qpath, sizeof(__pyx_k_qpath), 0, 0, 1, 1},
  {&__pyx_n_u_qt, __pyx_k_qt, sizeof(__pyx_k_qt), 0, 1, 0, 1},
  {&__pyx_n_s_qt_qtwes2, __pyx_k_qt_qtwes2, sizeof(__pyx_k_qt_qtwes2), 0, 0, 1, 1},
  {&__pyx_n_u_quadrant, __pyx_k_quadrant, sizeof(__pyx_k_quadrant), 0, 1, 0, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_s1, __pyx_k_s1, sizeof(__pyx_k_s1), 0, 0, 1, 1},
  {&__pyx_n_s_s2, __pyx_k_s2, sizeof(__pyx_k_s2), 0, 0, 1, 1},
  {&__pyx_n_s_sample_buffers, __pyx_k_sample_buffers, sizeof(__pyx_k_sample_buffers), 0, 0, 1, 1},
  {&__pyx_n_s_save_screenshot, __pyx_k_save_screenshot, sizeof(__pyx_k_save_screenshot), 0, 0, 1, 1},
  {&__pyx_n_s_scaled_height, __pyx_k_scaled_height, sizeof(__pyx_k_scaled_height), 0, 0, 1, 1},
  {&__pyx_n_s_scaled_width, __pyx_k_scaled_width, sizeof(__pyx_k_scaled_width), 0, 0, 1, 1},
  {&__pyx_kp_u_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 1, 0, 0},
  {&__pyx_kp_u_select_model_png, __pyx_k_select_model_png, sizeof(__pyx_k_select_model_png), 0, 1, 0, 0},
  {&__pyx_n_s_selection_nick, __pyx_k_selection_nick, sizeof(__pyx_k_selection_nick), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_set_animation_speed, __pyx_k_set_animation_speed, sizeof(__pyx_k_set_animation_speed), 0, 0, 1, 1},
  {&__pyx_n_s_set_combobox_current_image, __pyx_k_set_combobox_current_image, sizeof(__pyx_k_set_combobox_current_image), 0, 0, 1, 1},
  {&__pyx_n_s_set_cursor, __pyx_k_set_cursor, sizeof(__pyx_k_set_cursor), 0, 0, 1, 1},
  {&__pyx_n_s_set_debug_flags, __pyx_k_set_debug_flags, sizeof(__pyx_k_set_debug_flags), 0, 0, 1, 1},
  {&__pyx_n_s_set_debug_text, __pyx_k_set_debug_text, sizeof(__pyx_k_set_debug_text), 0, 0, 1, 1},
  {&__pyx_n_s_set_edit_moves, __pyx_k_set_edit_moves, sizeof(__pyx_k_set_edit_moves), 0, 0, 1, 1},
  {&__pyx_n_s_set_pick_requested, __pyx_k_set_pick_requested, sizeof(__pyx_k_set_pick_requested), 0, 0, 1, 1},
  {&__pyx_n_s_set_preferences_current_face_the, __pyx_k_set_preferences_current_face_the, sizeof(__pyx_k_set_preferences_current_face_the), 0, 0, 1, 1},
  {&__pyx_n_s_set_status_text, __pyx_k_set_status_text, sizeof(__pyx_k_set_status_text), 0, 0, 1, 1},
  {&__pyx_n_s_set_title, __pyx_k_set_title, sizeof(__pyx_k_set_title), 0, 0, 1, 1},
  {&__pyx_n_s_set_toolbar_state, __pyx_k_set_toolbar_state, sizeof(__pyx_k_set_toolbar_state), 0, 0, 1, 1},
  {&__pyx_n_s_settings, __pyx_k_settings, sizeof(__pyx_k_settings), 0, 0, 1, 1},
  {&__pyx_n_s_shader_names, __pyx_k_shader_names, sizeof(__pyx_k_shader_names), 0, 0, 1, 1},
  {&__pyx_n_s_show_message, __pyx_k_show_message, sizeof(__pyx_k_show_message), 0, 0, 1, 1},
  {&__pyx_n_s_show_message_text, __pyx_k_show_message_text, sizeof(__pyx_k_show_message_text), 0, 0, 1, 1},
  {&__pyx_n_s_show_preferences, __pyx_k_show_preferences, sizeof(__pyx_k_show_preferences), 0, 0, 1, 1},
  {&__pyx_n_u_simple, __pyx_k_simple, sizeof(__pyx_k_simple), 0, 1, 0, 1},
  {&__pyx_n_s_singleshot_handler, __pyx_k_singleshot_handler, sizeof(__pyx_k_singleshot_handler), 0, 0, 1, 1},
  {&__pyx_n_s_singleshot_queue, __pyx_k_singleshot_queue, sizeof(__pyx_k_singleshot_queue), 0, 0, 1, 1},
  {&__pyx_n_s_sizepolicy, __pyx_k_sizepolicy, sizeof(__pyx_k_sizepolicy), 0, 0, 1, 1},
  {&__pyx_n_u_slider_animspeed, __pyx_k_slider_animspeed, sizeof(__pyx_k_slider_animspeed), 0, 1, 0, 1},
  {&__pyx_n_u_spinbox_mirror_faces, __pyx_k_spinbox_mirror_faces, sizeof(__pyx_k_spinbox_mirror_faces), 0, 1, 0, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_stockicons, __pyx_k_stockicons, sizeof(__pyx_k_stockicons), 0, 0, 1, 1},
  {&__pyx_n_s_subtree, __pyx_k_subtree, sizeof(__pyx_k_subtree), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
  {&__pyx_kp_u_text_FULL_LICENSE_TEXT, __pyx_k_text_FULL_LICENSE_TEXT, sizeof(__pyx_k_text_FULL_LICENSE_TEXT), 0, 1, 0, 0},
  {&__pyx_n_s_text_to_html, __pyx_k_text_to_html, sizeof(__pyx_k_text_to_html), 0, 0, 1, 1},
  {&__pyx_n_s_textures, __pyx_k_textures, sizeof(__pyx_k_textures), 0, 0, 1, 1},
  {&__pyx_n_s_theme, __pyx_k_theme, sizeof(__pyx_k_theme), 0, 0, 1, 1},
  {&__pyx_kp_u_theme_bgcolor, __pyx_k_theme_bgcolor, sizeof(__pyx_k_theme_bgcolor), 0, 1, 0, 0},
  {&__pyx_kp_u_theme_faces, __pyx_k_theme_faces, sizeof(__pyx_k_theme_faces), 0, 1, 0, 0},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_u_tiled, __pyx_k_tiled, sizeof(__pyx_k_tiled), 0, 1, 0, 1},
  {&__pyx_n_s_timer_singleShot, __pyx_k_timer_singleShot, sizeof(__pyx_k_timer_singleShot), 0, 0, 1, 1},
  {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1},
  {&__pyx_n_s_transl, __pyx_k_transl, sizeof(__pyx_k_transl), 0, 0, 1, 1},
  {&__pyx_n_s_treeview, __pyx_k_treeview, sizeof(__pyx_k_treeview), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_typename_s, __pyx_k_unknown_typename_s, sizeof(__pyx_k_unknown_typename_s), 0, 1, 0, 0},
  {&__pyx_n_s_unset_cursor, __pyx_k_unset_cursor, sizeof(__pyx_k_unset_cursor), 0, 0, 1, 1},
  {&__pyx_n_s_update_drawingarea, __pyx_k_update_drawingarea, sizeof(__pyx_k_update_drawingarea), 0, 0, 1, 1},
  {&__pyx_n_s_update_sidepane, __pyx_k_update_sidepane, sizeof(__pyx_k_update_sidepane), 0, 0, 1, 1},
  {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
  {&__pyx_kp_u_value_has_wrong_typ, __pyx_k_value_has_wrong_typ, sizeof(__pyx_k_value_has_wrong_typ), 0, 1, 0, 0},
  {&__pyx_kp_b_void, __pyx_k_void, sizeof(__pyx_k_void), 0, 0, 0, 0},
  {&__pyx_kp_u_void_2, __pyx_k_void_2, sizeof(__pyx_k_void_2), 0, 1, 0, 0},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warn_explicit, __pyx_k_warn_explicit, sizeof(__pyx_k_warn_explicit), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
  {&__pyx_kp_u_window_divider, __pyx_k_window_divider, sizeof(__pyx_k_window_divider), 0, 1, 0, 0},
  {&__pyx_kp_u_window_editbar, __pyx_k_window_editbar, sizeof(__pyx_k_window_editbar), 0, 1, 0, 0},
  {&__pyx_kp_u_window_size, __pyx_k_window_size, sizeof(__pyx_k_window_size), 0, 1, 0, 0},
  {&__pyx_kp_u_window_statusbar, __pyx_k_window_statusbar, sizeof(__pyx_k_window_statusbar), 0, 1, 0, 0},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 227, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 264, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 294, __pyx_L1_error)
  __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 319, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1059, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 2310, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 2310, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "_qt_qtwes2.pyx":230
 *         print('  from package:', __package__)
 *         print('  compiled:', __compiled)
 *         print('  GL-type: es2') #px+             # <<<<<<<<<<<<<<
 *         print('  OFFSCREEN:', OFFSCREEN)
 * 
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_GL_type_es2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "_qt_qtwes2.pyx":231
 *         print('  compiled:', __compiled)
 *         print('  GL-type: es2') #px+
 *         print('  OFFSCREEN:', OFFSCREEN)             # <<<<<<<<<<<<<<
 * 
 *     renderdata.renderer = NULL
 */
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_kp_u_OFFSCREEN, Py_False); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "_qt_qtwes2.pyx":256
 * ##pxm-FUNC P
 * cdef QString str2q(pstr):
 *     data = pstr.encode('utf-8') #px+             # <<<<<<<<<<<<<<
 *     return fromUtf8(<char*>data, len(data)) #px+
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "_qt_qtwes2.pyx":1316
 *             pydata.modelselect = pydata.app.on_action_selectmodel_triggered()
 *         uidata.modelselect_currentpage = 1
 *         items, index, title = pydata.modelselect.on_model_get_modeldata(1)             # <<<<<<<<<<<<<<
 *         qtui.fill_page(create_stdmodel(items), str2q(title))
 *         qtui.set_page(1)
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "_qt_qtwes2.pyx":1577
 *             #item = QStandardItem(str2q(key))
 *             this.liststore_movekeys.setItem(i, 1, item)
 *         item = new QStandardItem(str2q(_('Move'))) #px/             # <<<<<<<<<<<<<<
 *         #item = QStandardItem(str2q(_('Move')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(0, item)
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_u_Move); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "_qt_qtwes2.pyx":1580
 *         #item = QStandardItem(str2q(_('Move')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(0, item)
 *         item = new QStandardItem(str2q(_('Key'))) #px/             # <<<<<<<<<<<<<<
 *         #item = QStandardItem(str2q(_('Key')))
 *         this.liststore_movekeys.setHorizontalHeaderItem(1, item)
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_u_Key); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "_qt_qtwes2.pyx":1682
 * 
 * def get_filedialog_imagefile():
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))             # <<<<<<<<<<<<<<
 *     if filename:
 *         uidata.preferences.image_dirname = str2q(os.path.dirname(filename))
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Open_Image); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "_qt_qtwes2.pyx":1720
 *     for facename, facekey in facenames:
 *         qtui.add_liststore_faces_row(str2q(facename), str2q(facekey))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('plain')), str2q(''))             # <<<<<<<<<<<<<<
 *     for filename in stockicons:
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_u_plain); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "_qt_qtwes2.pyx":1723
 *     for filename in stockicons:
 *         qtui.add_combobox_image_item(get_icon(filename), str2q(''), str2q(filename))
 *     qtui.add_combobox_image_item(QIcon(), str2q(_('select ')), str2q('/'))             # <<<<<<<<<<<<<<
 *     uidata.preferences.image_dirname = str2q(get_pictures_folder())
 *     qtui.finalize_liststore_faces(uidata.preferences)
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_select); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "_qt_qtwes2.pyx":1766
 *     uidata.help = new HelpDialog(uidata.mainwindow) #px/
 *     #uidata.help = HelpDialog(uidata.mainwindow)
 *     uidata.help.init(str2q(pydata.app.on_dialog_text('help_text')))             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P nogil
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_u_help_text); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "_qt_qtwes2.pyx":1817
 *                      str2q(config_.VERSION), str2q(_(config_.SHORT_DESCRIPTION)))
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),
 *                         str2q(pydata.app.on_dialog_text('about_website')),             # <<<<<<<<<<<<<<
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_u_about_website); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "_qt_qtwes2.pyx":1818
 *     qtui.fill_about_tab(str2q(config_.COPYRIGHT),
 *                         str2q(pydata.app.on_dialog_text('about_website')),
 *                         str2q(pydata.app.on_dialog_text('about_translators')))             # <<<<<<<<<<<<<<
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_u_about_translators); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "_qt_qtwes2.pyx":1819
 *                         str2q(pydata.app.on_dialog_text('about_website')),
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))             # <<<<<<<<<<<<<<
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 *     if license_full:
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_u_about_contribute); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "_qt_qtwes2.pyx":1820
 *                         str2q(pydata.app.on_dialog_text('about_translators')))
 *     qtui.fill_contribute_tab(str2q(pydata.app.on_dialog_text('about_contribute')))
 *     license_full = pydata.app.on_dialog_text('about_license_full')             # <<<<<<<<<<<<<<
 *     if license_full:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_u_about_license_full); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "_qt_qtwes2.pyx":1822
 *     license_full = pydata.app.on_dialog_text('about_license_full')
 *     if license_full:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),             # <<<<<<<<<<<<<<
 *                               False, str2q(license_full))
 *     else:
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_u_about_license_short); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "_qt_qtwes2.pyx":1825
 *                               False, str2q(license_full))
 *     else:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),             # <<<<<<<<<<<<<<
 *                               True, str2q(pydata.app.on_dialog_text('about_license_notfound')))
 *     about.exec()
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_u_about_license_short); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "_qt_qtwes2.pyx":1826
 *     else:
 *         qtui.fill_license_tab(str2q(pydata.app.on_dialog_text('about_license_short')),
 *                               True, str2q(pydata.app.on_dialog_text('about_license_notfound')))             # <<<<<<<<<<<<<<
 *     about.exec()
 *     about.deleteLater()
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_u_about_license_notfound); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "_qt_qtwes2.pyx":1989
 * 
 * def keyval_from_name(keystr):
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))             # <<<<<<<<<<<<<<
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 *     #keyseq = fromString(keystr, PortableText)
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u__22); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "_qt_qtwes2.pyx":2010
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()
 *     if imagefile.startswith('/'):             # <<<<<<<<<<<<<<
 *         currentfolder = os.path.dirname(imagefile)
 *     elif imagefile:
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u__13); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 2010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "_qt_qtwes2.pyx":2163
 *     pos = []
 *     # Load 3 cursors from file (n - ne)
 *     for i, (x, y) in enumerate([(8, 0), (15, 0), (15, 0)]):             # <<<<<<<<<<<<<<
 *         filename = filepattern.format(i)
 *         images[i+1] = QImage(str2q(filename))
 */
  __pyx_tuple__25 = PyTuple_Pack(2, __pyx_int_8, __pyx_int_0); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);
  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_int_15, __pyx_int_0); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);
  __pyx_tuple__27 = PyTuple_Pack(2, __pyx_int_15, __pyx_int_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "_qt_qtwes2.pyx":2175
 *     #transform = QTransform()
 *     transform.rotate(90)
 *     for i in range(4, 16):             # <<<<<<<<<<<<<<
 *         x, y = pos[i-4]
 *         images[i] = images[i-4].transformed(transform)
 */
  __pyx_tuple__28 = PyTuple_Pack(2, __pyx_int_4, __pyx_int_16); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "_qt_qtwes2.pyx":2181
 *     images[16] = images[0]
 *     pos.append(pos[0])
 *     for i in range(16):             # <<<<<<<<<<<<<<
 *         x, y = pos[i+1]
 *         uidata.cursors[i] = new QCursor(fromImage(images[i+1]), x, y) #px/
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_16); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "_qt_qtwes2.pyx":2186
 *         #uidata.cursors[i] = QCursor(fromImage(images[i+1]), x, y)
 *     # cursor for center faces
 *     filename = filepattern.format('ccw')             # <<<<<<<<<<<<<<
 *     uidata.cursors[16] = new QCursor(QPixmap(str2q(filename)), 7, 7) #px/
 *     #uidata.cursors[16] = QCursor(QPixmap(str2q(filename)), 7, 7)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_u_ccw); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "_qt_qtwes2.pyx":102
 * debug = 0
 * 
 * def set_debug_flags(module):             # <<<<<<<<<<<<<<
 *     global debug
 *     if module.DEBUG_MSG:   debug |= DEBUG_MSG
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_module); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_debug_flags, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 102, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":396
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 * def gl_delete_atlas():             # <<<<<<<<<<<<<<
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 */
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_gl_delete_atlas, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 396, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":577
 * #### ui: communicate with render-thread  ####
 * 
 * def set_pick_requested(pick_requested):             # <<<<<<<<<<<<<<
 *     uidata.pick_requested = pick_requested
 * 
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_pick_requested); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_pick_requested, 577, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 577, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":981
 * #~ ##pxm>IF_END
 * 
 * def set_debug_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_debug_text(str2q(text))
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_text); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_debug_text, 981, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 981, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":988
 *     #~ ##pxm>IF_END
 * 
 * def set_edit_moves(code, pos):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.move_edit.setText(str2q(code))
 */
  __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_code, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_edit_moves, 988, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 988, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":997
 *     #~ ##pxm>IF_END
 * 
 * def set_status_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.statuslabel.setText(str2q(text))
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_text); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_status_text, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 997, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1022
 *     #~ ##pxm>IF_END
 *     show_message_text = None
 * def show_message(message):             # <<<<<<<<<<<<<<
 *     global show_message_text
 *     show_message_text = message
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_show_message, 1022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 1022, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1041
 * ##pxm>IF_END
 * 
 * def fill_sidepane(plugin_data):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     # remove old plugins
 */
  __pyx_tuple__44 = PyTuple_Pack(8, __pyx_n_s_plugin_data, __pyx_n_s_item, __pyx_n_s_transl, __pyx_n_s_func, __pyx_n_s_subtree, __pyx_n_s_button, __pyx_n_s_treeview, __pyx_n_s_i); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_fill_sidepane, 1041, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 1041, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1082
 *     return hide_all
 * ##pxm>IF_END
 * def update_sidepane():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef QModelIndex index #px+
 */
  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_index, __pyx_n_s_i); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_update_sidepane, 1082, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 1082, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1108
 *     #~ ##pxm>IF_END
 * 
 * def set_toolbar_state(state):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_toolbar_state(state[0], state[1], state[2], state[3], state[4])
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_toolbar_state, 1108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 1108, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1669
 * ##pxm>CPPCLASS_END
 * 
 * def set_combobox_current_image(index_icon, imagefile, index):             # <<<<<<<<<<<<<<
 *     cdef QIcon icon #px/
 *     #icon = QIcon()
 */
  __pyx_tuple__50 = PyTuple_Pack(4, __pyx_n_s_index_icon, __pyx_n_s_imagefile, __pyx_n_s_index, __pyx_n_s_icon); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_combobox_current_image, 1669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 1669, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1676
 *     qtui.set_combobox_image(index_icon, icon, index)
 * 
 * def set_preferences_current_face_theme(color, imageindex_icon, imagefile, imageindex, imagemode):             # <<<<<<<<<<<<<<
 *     qtui.set_button_color(str2q(color))
 *     set_combobox_current_image(imageindex_icon, imagefile, imageindex)
 */
  __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_color, __pyx_n_s_imageindex_icon, __pyx_n_s_imagefile, __pyx_n_s_imageindex, __pyx_n_s_imagemode); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_preferences_current_face_the, 1676, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 1676, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1681
 *     qtui.set_imagemode(imagemode)
 * 
 * def get_filedialog_imagefile():             # <<<<<<<<<<<<<<
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))
 *     if filename:
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_get_filedialog_imagefile, 1681, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 1681, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1688
 * ##pxm>IF_END
 * 
 * def preferences_dialog(shader_names, sample_buffers, facenames, stockicons):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences = new PreferencesDialog(uidata.mainwindow) #px/
 */
  __pyx_tuple__56 = PyTuple_Pack(10, __pyx_n_s_shader_names, __pyx_n_s_sample_buffers, __pyx_n_s_facenames, __pyx_n_s_stockicons, __pyx_n_s_nick, __pyx_n_s_text, __pyx_n_s_selection_nick, __pyx_n_s_facename, __pyx_n_s_facekey, __pyx_n_s_filename); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_preferences_dialog, 1688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 1688, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1743
 *     #~ ##pxm>IF_END
 * 
 * def show_preferences():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences.show()
 */
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_show_preferences, 1743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 1743, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1832
 * 
 * 
 * def initial_resize():             # <<<<<<<<<<<<<<
 *     uidata.width, uidata.height = settings['window.size']
 *     uidata.mainwindow.resize(uidata.width, uidata.height)
 */
  __pyx_tuple__59 = PyTuple_Pack(4, __pyx_n_s_s1, __pyx_n_s_s2, __pyx_n_s_divider_pos, __pyx_n_s_divider_pos2); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_initial_resize, 1832, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 1832, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1849
 *     #QTimer.singleShot(20, _on_init_finalize)
 * 
 * def set_title(title):             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.setTitle(str2q(title))
 * 
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_title); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_title, 1849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1849, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1852
 *     uidata.mainwindow.setTitle(str2q(title))
 * 
 * def load_ui(path):             # <<<<<<<<<<<<<<
 *     pass
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_load_ui, 1852, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1852, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1865
 *     #~ ##pxm>IF_END
 * 
 * def close_mainwindow():             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.close()
 * 
 */
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_close_mainwindow, 1865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 1865, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1868
 *     uidata.mainwindow.close()
 * 
 * def get_samples():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     #TODO: uidata.drawingarea.format().samples() returns only 0 here
 */
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_get_samples, 1868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 1868, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1876
 *     #~ ##pxm>IF_END
 * 
 * def update_drawingarea():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.update()
 */
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_update_drawingarea, 1876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1876, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1883
 *     #~ ##pxm>IF_END
 * 
 * def set_cursor(index):             # <<<<<<<<<<<<<<
 *     if index < 0:
 *         index += 18
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_index); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_cursor, 1883, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1883, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1895
 *     #~ ##pxm>IF_END
 * 
 * def unset_cursor():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.unsetCursor()
 */
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_unset_cursor, 1895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1895, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1913
 * #~ ##pxm>IF_END
 * 
 * def save_screenshot(filename):             # <<<<<<<<<<<<<<
 *     IF OFFSCREEN: #px+
 *         cdef QImage image #px+
 */
  __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_image); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 1913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_save_screenshot, 1913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1913, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1932
 * #### misc qt ####
 * 
 * def parse_color(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */
  __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_name_2, __pyx_n_s_color); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_parse_color, 1932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1932, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1938
 *     return color.red(), color.green(), color.blue()
 * 
 * def parse_color_f(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */
  __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_name_2, __pyx_n_s_color); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);
  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_parse_color_f, 1938, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 1938, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1944
 *     return color.redF(), color.greenF(), color.blueF()
 * 
 * def load_image_from_file(filename, maxsize):             # <<<<<<<<<<<<<<
 *     cdef int width, height, scaled_width, scaled_height #px+
 *     cdef bytes data #px+
 */
  __pyx_tuple__77 = PyTuple_Pack(8, __pyx_n_s_filename, __pyx_n_s_maxsize, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_scaled_width, __pyx_n_s_scaled_height, __pyx_n_s_data, __pyx_n_s_image); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);
  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_load_image_from_file, 1944, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1944, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1988
 * ##pxm>IF_END
 * 
 * def keyval_from_name(keystr):             # <<<<<<<<<<<<<<
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 */
  __pyx_tuple__79 = PyTuple_Pack(4, __pyx_n_s_keystr, __pyx_n_s_keyseq, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);
  __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_keyval_from_name, 1988, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1988, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1996
 *     return keyseq[0]
 * 
 * def get_pictures_folder():             # <<<<<<<<<<<<<<
 *     cdef QStringList locations = standardLocations(PicturesLocation) #px/
 *     #locations = standardLocations(PicturesLocation)
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_s_locations); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);
  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_get_pictures_folder, 1996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1996, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2007
 *     return q2str(locations[0])
 * 
 * def get_imagefile(facekey):             # <<<<<<<<<<<<<<
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()
 */
  __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_facekey, __pyx_n_s_imagefile, __pyx_n_s_currentfolder); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);
  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_get_imagefile, 2007, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 2007, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2016
 *     return currentfolder, imagefile
 * 
 * def text_to_html(text):             # <<<<<<<<<<<<<<
 *     return q2str(fromPlainText(str2q(text)).toHtml())
 * 
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_text); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_text_to_html, 2016, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 2016, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2034
 *         uidata.filesystemwatcher.addPath(str2q(path))
 * 
 * def create_filesystemwatcher(path, callback):             # <<<<<<<<<<<<<<
 *     cdef QString qpath = str2q(path) #px/
 *     #qpath = path
 */
  __pyx_tuple__87 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_callback, __pyx_n_s_qpath); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 2034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_create_filesystemwatcher, 2034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 2034, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2055
 *     else: #px+
 *         pydata.singleshot_handler = None #px+
 * def timer_singleShot(msec, func):             # <<<<<<<<<<<<<<
 *     if pydata.singleshot_handler is None: #px+
 *         pydata.singleshot_handler = func #px+
 */
  __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_msec, __pyx_n_s_func); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_timer_singleShot, 2055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 2055, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2088
 *     uidata.settings_timer = NULL
 * 
 * def set_animation_speed():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.speed = settings['draw.speed']
 */
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_set_animation_speed, 2088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 2088, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2135
 * 
 * # only for demos
 * def animate_timer_step(angle_max):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.angle_max = angle_max
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_angle_max); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_animate_timer_step, 2135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 2135, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2142
 *     pass
 * 
 * def animate_timer_stop():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer.stop()
 */
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_animate_timer_stop, 2142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 2142, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2212
 *     #~ ##pxm>IF_END
 * 
 * def create_window(pyapp):             # <<<<<<<<<<<<<<
 *     pydata.app = pyapp
 *     init_module()
 */
  __pyx_tuple__95 = PyTuple_Pack(2, __pyx_n_s_pyapp, __pyx_n_s_sizepolicy); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_create_window, 2212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 2212, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2282
 *     load_cursors(os.path.join(config_.UI_DIR, 'cursors', 'mouse_{}.png'))
 * 
 * def destroy_window():             # <<<<<<<<<<<<<<
 *     destroy_cursors()
 *     settings_timer_destroy()
 */
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_destroy_window, 2282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 2282, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":2302
 * #~ ##pxm>IF_END
 * 
 * def app_post_create(gettext):             # <<<<<<<<<<<<<<
 *     cdef QApplication *app = <QApplication*>QCoreApplication_instance() #px/
 *     #app = QCoreApplication.instance()
 */
  __pyx_tuple__98 = PyTuple_Pack(4, __pyx_n_s_gettext, __pyx_n_s_app, __pyx_n_s_font, __pyx_n_s_fontpixelsize); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 2302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_tmp, __pyx_n_s_app_post_create, 2302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 2302, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float_14_0 = PyFloat_FromDouble(14.0); if (unlikely(!__pyx_float_14_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_qt_qtwes2(void); /*proto*/
PyMODINIT_FUNC init_qt_qtwes2(void)
#else
PyMODINIT_FUNC PyInit__qt_qtwes2(void); /*proto*/
PyMODINIT_FUNC PyInit__qt_qtwes2(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__qt_qtwes2(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_qt_qtwes2", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main__qt_qtwes2) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "_qt_qtwes2")) {
      if (unlikely(PyDict_SetItemString(modules, "_qt_qtwes2", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_10_qt_qtwes2___pyx_scope_struct__keyval_from_name) < 0) __PYX_ERR(0, 1988, __pyx_L1_error)
  __pyx_type_10_qt_qtwes2___pyx_scope_struct__keyval_from_name.tp_print = 0;
  __pyx_ptype_10_qt_qtwes2___pyx_scope_struct__keyval_from_name = &__pyx_type_10_qt_qtwes2___pyx_scope_struct__keyval_from_name;
  if (PyType_Ready(&__pyx_type_10_qt_qtwes2___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 1989, __pyx_L1_error)
  __pyx_type_10_qt_qtwes2___pyx_scope_struct_1_genexpr.tp_print = 0;
  __pyx_ptype_10_qt_qtwes2___pyx_scope_struct_1_genexpr = &__pyx_type_10_qt_qtwes2___pyx_scope_struct_1_genexpr;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("_glarea_es2"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "render_resize", (void (**)(void))&__pyx_f_11_glarea_es2_render_resize, "void (int, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "set_animation_next", (void (**)(void))&__pyx_f_11_glarea_es2_set_animation_next, "void (float)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "sync_set_fixedshaders", (void (**)(void))&__pyx_f_11_glarea_es2_sync_set_fixedshaders, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "sync_set_pick_position", (void (**)(void))&__pyx_f_11_glarea_es2_sync_set_pick_position, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "sync_set_atlas_data", (void (**)(void))&__pyx_f_11_glarea_es2_sync_set_atlas_data, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "sync", (void (**)(void))&__pyx_f_11_glarea_es2_sync, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "gl_init", (void (**)(void))&__pyx_f_11_glarea_es2_gl_init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "gl_exit", (void (**)(void))&__pyx_f_11_glarea_es2_gl_exit, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "gl_set_atlas_texture", (void (**)(void))&__pyx_f_11_glarea_es2_gl_set_atlas_texture, "void (int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "gl_render", (void (**)(void))&__pyx_f_11_glarea_es2_gl_render, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "gl_render_select_debug", (void (**)(void))&__pyx_f_11_glarea_es2_gl_render_select_debug, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_1, "gl_pick_polygons", (void (**)(void))&__pyx_f_11_glarea_es2_gl_pick_polygons, "int (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_ImportModule("_qtui_"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "init_module", (void (**)(void))&__pyx_f_6_qtui__init_module, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "init_gettext", (void (**)(void))&__pyx_f_6_qtui__init_gettext, "void (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "setupUi_main", (void (**)(void))&__pyx_f_6_qtui__setupUi_main, "void (QMainWindow *, QIcon const &, QIcon const &, QIcon const &, QKeySequence const &, QKeySequence const &, bool, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "setupUi_pref", (void (**)(void))&__pyx_f_6_qtui__setupUi_pref, "void (QDialog *, int, int, int, int, int, QStandardItemModel *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "setupUi_help", (void (**)(void))&__pyx_f_6_qtui__setupUi_help, "void (QDialog *, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "setupUi_about", (void (**)(void))&__pyx_f_6_qtui__setupUi_about, "void (QDialog *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_shortcuts", (void (**)(void))&__pyx_f_6_qtui__set_shortcuts, "void (QKeySequence const &, QKeySequence const &, QKeySequence const &, QKeySequence const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "add_widgets", (void (**)(void))&__pyx_f_6_qtui__add_widgets, "void (QMainWindow *, QLineEdit *, QOpenGLWidget *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_frame_editbar_visible", (void (**)(void))&__pyx_f_6_qtui__set_frame_editbar_visible, "void (bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_statusbar_visible", (void (**)(void))&__pyx_f_6_qtui__set_statusbar_visible, "void (bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "hide_controls", (void (**)(void))&__pyx_f_6_qtui__hide_controls, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "get_splitter_sizes", (void (**)(void))&__pyx_f_6_qtui__get_splitter_sizes, "void (int &, int &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_splitter_sizes", (void (**)(void))&__pyx_f_6_qtui__set_splitter_sizes, "void (int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "splitter_update_minimumsize", (void (**)(void))&__pyx_f_6_qtui__splitter_update_minimumsize, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_debug_text", (void (**)(void))&__pyx_f_6_qtui__set_debug_text, "void (QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_toolbar_state", (void (**)(void))&__pyx_f_6_qtui__set_toolbar_state, "void (int, int, int, int, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "clear_sidepane", (void (**)(void))&__pyx_f_6_qtui__clear_sidepane, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "create_sidepane_button", (void (**)(void))&__pyx_f_6_qtui__create_sidepane_button, "QPushButton *(QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "create_sidepane_treeview", (void (**)(void))&__pyx_f_6_qtui__create_sidepane_treeview, "QTreeView *(QStandardItemModel *, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_active_plugin_group", (void (**)(void))&__pyx_f_6_qtui__set_active_plugin_group, "void (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_active_plugin_group_by_obj", (void (**)(void))&__pyx_f_6_qtui__set_active_plugin_group_by_obj, "void (QObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "get_plugin_group_count", (void (**)(void))&__pyx_f_6_qtui__get_plugin_group_count, "int (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "root_index", (void (**)(void))&__pyx_f_6_qtui__root_index, "QModelIndex (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "hide_row", (void (**)(void))&__pyx_f_6_qtui__hide_row, "void (int, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_row_hidden", (void (**)(void))&__pyx_f_6_qtui__set_row_hidden, "void (int, int, QModelIndex const &, bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "splitter_pos", (void (**)(void))&__pyx_f_6_qtui__splitter_pos, "int (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "preferences_block_signals", (void (**)(void))&__pyx_f_6_qtui__preferences_block_signals, "void (bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "combobox_add_shaderitem", (void (**)(void))&__pyx_f_6_qtui__combobox_add_shaderitem, "void (QString const &, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "combobox_add_samplesitem", (void (**)(void))&__pyx_f_6_qtui__combobox_add_samplesitem, "void (QString const &, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "add_movekey_row", (void (**)(void))&__pyx_f_6_qtui__add_movekey_row, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "remove_movekey_row", (void (**)(void))&__pyx_f_6_qtui__remove_movekey_row, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "add_liststore_faces_row", (void (**)(void))&__pyx_f_6_qtui__add_liststore_faces_row, "void (QString const &, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "finalize_liststore_faces", (void (**)(void))&__pyx_f_6_qtui__finalize_liststore_faces, "void (QWidget *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "get_liststore_faces_facekey", (void (**)(void))&__pyx_f_6_qtui__get_liststore_faces_facekey, "QString (QModelIndex const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_button_color", (void (**)(void))&__pyx_f_6_qtui__set_button_color, "void (QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "color_dialog", (void (**)(void))&__pyx_f_6_qtui__color_dialog, "QString (QWidget *, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_imagemode", (void (**)(void))&__pyx_f_6_qtui__set_imagemode, "void (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "add_combobox_image_item", (void (**)(void))&__pyx_f_6_qtui__add_combobox_image_item, "void (QIcon const &, QString const &, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_combobox_image", (void (**)(void))&__pyx_f_6_qtui__set_combobox_image, "void (int, QIcon const &, int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_button_background_color", (void (**)(void))&__pyx_f_6_qtui__set_button_background_color, "void (QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "fill_page", (void (**)(void))&__pyx_f_6_qtui__fill_page, "void (QVariant, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "set_page", (void (**)(void))&__pyx_f_6_qtui__set_page, "void (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "fill_header", (void (**)(void))&__pyx_f_6_qtui__fill_header, "void (QString const &, QString const &, QString const &, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "fill_about_tab", (void (**)(void))&__pyx_f_6_qtui__fill_about_tab, "void (QString const &, QString const &, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "fill_contribute_tab", (void (**)(void))&__pyx_f_6_qtui__fill_contribute_tab, "void (QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "fill_license_tab", (void (**)(void))&__pyx_f_6_qtui__fill_license_tab, "void (QString const &, bool, QString const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "tab_widget_currentChanged", (void (**)(void))&__pyx_f_6_qtui__tab_widget_currentChanged, "void (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "update_animation", (void (**)(void))&__pyx_f_6_qtui__update_animation, "void (bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "event_filter_stop_animation", (void (**)(void))&__pyx_f_6_qtui__event_filter_stop_animation, "void (QEvent *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction(__pyx_t_2, "show_full_license", (void (**)(void))&__pyx_f_6_qtui__show_full_license, "void (bool, QUrl const &)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "_qt_qtwes2.pyx":25
 * # This line makes cython happy
 * global __name__, __package__    # pylint: disable=W0604
 * __compiled = True #px/             # <<<<<<<<<<<<<<
 * #__compiled = False
 * DEF OFFSCREEN = False #px/
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compiled_2, Py_True) < 0) __PYX_ERR(0, 25, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":30
 * #OFFSCREEN = False
 * 
 * import sys, os             # <<<<<<<<<<<<<<
 * from warnings import warn_explicit, warn
 * 
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":31
 * 
 * import sys, os
 * from warnings import warn_explicit, warn             # <<<<<<<<<<<<<<
 * 
 * cimport gl_es2 as gl #px+
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_warn_explicit);
  __Pyx_GIVEREF(__pyx_n_s_warn_explicit);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_warn_explicit);
  __Pyx_INCREF(__pyx_n_s_warn);
  __Pyx_GIVEREF(__pyx_n_s_warn);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_warn);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_warn_explicit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn_explicit, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_3) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":35
 * cimport gl_es2 as gl #px+
 * 
 * from pybiklib import config as config_             # <<<<<<<<<<<<<<
 * from pybiklib.settings import settings
 * 
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_config_2);
  __Pyx_GIVEREF(__pyx_n_s_config_2);
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_config_2);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pybiklib, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_config_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_config, __pyx_t_4) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":36
 * 
 * from pybiklib import config as config_
 * from pybiklib.settings import settings             # <<<<<<<<<<<<<<
 * 
 * cimport _glarea_es2 as glarea #px/
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_settings);
  __Pyx_GIVEREF(__pyx_n_s_settings);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_settings);
  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pybiklib_settings, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_settings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_settings, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":100
 *     DEBUG_NOCONTROLS = 0x2000
 * cdef long debug #px+
 * debug = 0             # <<<<<<<<<<<<<<
 * 
 * def set_debug_flags(module):
 */
  __pyx_v_10_qt_qtwes2_debug = 0;

  /* "_qt_qtwes2.pyx":102
 * debug = 0
 * 
 * def set_debug_flags(module):             # <<<<<<<<<<<<<<
 *     global debug
 *     if module.DEBUG_MSG:   debug |= DEBUG_MSG
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_1set_debug_flags, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_debug_flags, __pyx_t_4) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":133
 *                #~ Qt.Key_CapsLock, Qt.Key_NumLock, Qt.Key_ScrollLock]
 * #~ ##pxm>IF_END
 * class QtKeys:             # <<<<<<<<<<<<<<
 *     Key_Period = Qt.Key_Period
 *     Key_Escape = Qt.Key_Escape
 */
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_QtKeys, __pyx_n_s_QtKeys, (PyObject *) NULL, __pyx_n_s_qt_qtwes2, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "_qt_qtwes2.pyx":134
 * #~ ##pxm>IF_END
 * class QtKeys:
 *     Key_Period = Qt.Key_Period             # <<<<<<<<<<<<<<
 *     Key_Escape = Qt.Key_Escape
 *     Key_Right = Qt.Key_Right
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_Key(Qt::Key_Period); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_Key_Period, __pyx_t_3) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":135
 * class QtKeys:
 *     Key_Period = Qt.Key_Period
 *     Key_Escape = Qt.Key_Escape             # <<<<<<<<<<<<<<
 *     Key_Right = Qt.Key_Right
 *     Key_Left = Qt.Key_Left
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_Key(Qt::Key_Escape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_Key_Escape, __pyx_t_3) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":136
 *     Key_Period = Qt.Key_Period
 *     Key_Escape = Qt.Key_Escape
 *     Key_Right = Qt.Key_Right             # <<<<<<<<<<<<<<
 *     Key_Left = Qt.Key_Left
 *     Key_Up = Qt.Key_Up
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_Key(Qt::Key_Right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_Key_Right, __pyx_t_3) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":137
 *     Key_Escape = Qt.Key_Escape
 *     Key_Right = Qt.Key_Right
 *     Key_Left = Qt.Key_Left             # <<<<<<<<<<<<<<
 *     Key_Up = Qt.Key_Up
 *     Key_Down = Qt.Key_Down
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_Key(Qt::Key_Left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_Key_Left, __pyx_t_3) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":138
 *     Key_Right = Qt.Key_Right
 *     Key_Left = Qt.Key_Left
 *     Key_Up = Qt.Key_Up             # <<<<<<<<<<<<<<
 *     Key_Down = Qt.Key_Down
 *     ShiftModifier = Qt.ShiftModifier
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_Key(Qt::Key_Up); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_Key_Up, __pyx_t_3) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":139
 *     Key_Left = Qt.Key_Left
 *     Key_Up = Qt.Key_Up
 *     Key_Down = Qt.Key_Down             # <<<<<<<<<<<<<<
 *     ShiftModifier = Qt.ShiftModifier
 *     ControlModifier = Qt.ControlModifier
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_Key(Qt::Key_Down); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_Key_Down, __pyx_t_3) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":140
 *     Key_Up = Qt.Key_Up
 *     Key_Down = Qt.Key_Down
 *     ShiftModifier = Qt.ShiftModifier             # <<<<<<<<<<<<<<
 *     ControlModifier = Qt.ControlModifier
 *     LeftButton = Qt.LeftButton
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_KeyboardModifier(Qt::ShiftModifier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_ShiftModifier, __pyx_t_3) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":141
 *     Key_Down = Qt.Key_Down
 *     ShiftModifier = Qt.ShiftModifier
 *     ControlModifier = Qt.ControlModifier             # <<<<<<<<<<<<<<
 *     LeftButton = Qt.LeftButton
 *     RightButton = Qt.RightButton
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_KeyboardModifier(Qt::ControlModifier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_ControlModifier, __pyx_t_3) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":142
 *     ShiftModifier = Qt.ShiftModifier
 *     ControlModifier = Qt.ControlModifier
 *     LeftButton = Qt.LeftButton             # <<<<<<<<<<<<<<
 *     RightButton = Qt.RightButton
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_MouseButton(Qt::LeftButton); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_LeftButton, __pyx_t_3) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":143
 *     ControlModifier = Qt.ControlModifier
 *     LeftButton = Qt.LeftButton
 *     RightButton = Qt.RightButton             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_enum__Qt_3a__3a_MouseButton(Qt::RightButton); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_RightButton, __pyx_t_3) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":133
 *                #~ Qt.Key_CapsLock, Qt.Key_NumLock, Qt.Key_ScrollLock]
 * #~ ##pxm>IF_END
 * class QtKeys:             # <<<<<<<<<<<<<<
 *     Key_Period = Qt.Key_Period
 *     Key_Escape = Qt.Key_Escape
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_QtKeys, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_QtKeys, __pyx_t_3) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":212
 * cdef UIData uidata #px+
 * 
 * class PyData:             # <<<<<<<<<<<<<<
 *     filesystemwatcher_path = None
 *     filesystemwatcher_handlers = {}
 */
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PyData, __pyx_n_s_PyData, (PyObject *) NULL, __pyx_n_s_qt_qtwes2, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "_qt_qtwes2.pyx":213
 * 
 * class PyData:
 *     filesystemwatcher_path = None             # <<<<<<<<<<<<<<
 *     filesystemwatcher_handlers = {}
 *     singleshot_handler = None #px+
 */
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_filesystemwatcher_path, Py_None) < 0) __PYX_ERR(0, 213, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":214
 * class PyData:
 *     filesystemwatcher_path = None
 *     filesystemwatcher_handlers = {}             # <<<<<<<<<<<<<<
 *     singleshot_handler = None #px+
 *     singleshot_queue = [] #px+
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_filesystemwatcher_handlers, __pyx_t_3) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":215
 *     filesystemwatcher_path = None
 *     filesystemwatcher_handlers = {}
 *     singleshot_handler = None #px+             # <<<<<<<<<<<<<<
 *     singleshot_queue = [] #px+
 *     app = None
 */
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_singleshot_handler, Py_None) < 0) __PYX_ERR(0, 215, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":216
 *     filesystemwatcher_handlers = {}
 *     singleshot_handler = None #px+
 *     singleshot_queue = [] #px+             # <<<<<<<<<<<<<<
 *     app = None
 *     modelselect = None
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_singleshot_queue, __pyx_t_3) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_qt_qtwes2.pyx":217
 *     singleshot_handler = None #px+
 *     singleshot_queue = [] #px+
 *     app = None             # <<<<<<<<<<<<<<
 *     modelselect = None
 * pydata = PyData()
 */
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_app, Py_None) < 0) __PYX_ERR(0, 217, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":218
 *     singleshot_queue = [] #px+
 *     app = None
 *     modelselect = None             # <<<<<<<<<<<<<<
 * pydata = PyData()
 * 
 */
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_modelselect, Py_None) < 0) __PYX_ERR(0, 218, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":212
 * cdef UIData uidata #px+
 * 
 * class PyData:             # <<<<<<<<<<<<<<
 *     filesystemwatcher_path = None
 *     filesystemwatcher_handlers = {}
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_PyData, __pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PyData, __pyx_t_3) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":219
 *     app = None
 *     modelselect = None
 * pydata = PyData()             # <<<<<<<<<<<<<<
 * 
 * ##pxm-FUNC P
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_PyData); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydata, __pyx_t_4) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":396
 * 
 * ##pxm>IF 'qtw' == 'qtw'
 * def gl_delete_atlas():             # <<<<<<<<<<<<<<
 *     if renderdata.texture is not NULL:
 *         renderdata.texture.destroy()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_3gl_delete_atlas, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_delete_atlas, __pyx_t_4) < 0) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":577
 * #### ui: communicate with render-thread  ####
 * 
 * def set_pick_requested(pick_requested):             # <<<<<<<<<<<<<<
 *     uidata.pick_requested = pick_requested
 * 
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_5set_pick_requested, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pick_requested, __pyx_t_4) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":981
 * #~ ##pxm>IF_END
 * 
 * def set_debug_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_debug_text(str2q(text))
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_9set_debug_text, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_debug_text, __pyx_t_4) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":988
 *     #~ ##pxm>IF_END
 * 
 * def set_edit_moves(code, pos):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.move_edit.setText(str2q(code))
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_11set_edit_moves, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_edit_moves, __pyx_t_4) < 0) __PYX_ERR(0, 988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":997
 *     #~ ##pxm>IF_END
 * 
 * def set_status_text(text):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.statuslabel.setText(str2q(text))
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_13set_status_text, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_status_text, __pyx_t_4) < 0) __PYX_ERR(0, 997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1004
 *     #~ ##pxm>IF_END
 * 
 * show_message_text = None             # <<<<<<<<<<<<<<
 * ##pxm-FUNC P with gil
 * cdef void show_message_cb() with gil:
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_show_message_text, Py_None) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)

  /* "_qt_qtwes2.pyx":1022
 *     #~ ##pxm>IF_END
 *     show_message_text = None
 * def show_message(message):             # <<<<<<<<<<<<<<
 *     global show_message_text
 *     show_message_text = message
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_15show_message, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_show_message, __pyx_t_4) < 0) __PYX_ERR(0, 1022, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1041
 * ##pxm>IF_END
 * 
 * def fill_sidepane(plugin_data):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     # remove old plugins
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_17fill_sidepane, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_sidepane, __pyx_t_4) < 0) __PYX_ERR(0, 1041, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1082
 *     return hide_all
 * ##pxm>IF_END
 * def update_sidepane():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     cdef QModelIndex index #px+
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_19update_sidepane, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_update_sidepane, __pyx_t_4) < 0) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1108
 *     #~ ##pxm>IF_END
 * 
 * def set_toolbar_state(state):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     qtui.set_toolbar_state(state[0], state[1], state[2], state[3], state[4])
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_21set_toolbar_state, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_toolbar_state, __pyx_t_4) < 0) __PYX_ERR(0, 1108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1669
 * ##pxm>CPPCLASS_END
 * 
 * def set_combobox_current_image(index_icon, imagefile, index):             # <<<<<<<<<<<<<<
 *     cdef QIcon icon #px/
 *     #icon = QIcon()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_23set_combobox_current_image, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_combobox_current_image, __pyx_t_4) < 0) __PYX_ERR(0, 1669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1676
 *     qtui.set_combobox_image(index_icon, icon, index)
 * 
 * def set_preferences_current_face_theme(color, imageindex_icon, imagefile, imageindex, imagemode):             # <<<<<<<<<<<<<<
 *     qtui.set_button_color(str2q(color))
 *     set_combobox_current_image(imageindex_icon, imagefile, imageindex)
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_25set_preferences_current_face_theme, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_preferences_current_face_the, __pyx_t_4) < 0) __PYX_ERR(0, 1676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1681
 *     qtui.set_imagemode(imagemode)
 * 
 * def get_filedialog_imagefile():             # <<<<<<<<<<<<<<
 *     filename = q2str(getOpenFileName(uidata.preferences, str2q(_("Open Image")), uidata.preferences.image_dirname))
 *     if filename:
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_27get_filedialog_imagefile, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_filedialog_imagefile, __pyx_t_4) < 0) __PYX_ERR(0, 1681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1688
 * ##pxm>IF_END
 * 
 * def preferences_dialog(shader_names, sample_buffers, facenames, stockicons):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences = new PreferencesDialog(uidata.mainwindow) #px/
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_29preferences_dialog, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_preferences_dialog, __pyx_t_4) < 0) __PYX_ERR(0, 1688, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1743
 *     #~ ##pxm>IF_END
 * 
 * def show_preferences():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.preferences.show()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_31show_preferences, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_show_preferences, __pyx_t_4) < 0) __PYX_ERR(0, 1743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1832
 * 
 * 
 * def initial_resize():             # <<<<<<<<<<<<<<
 *     uidata.width, uidata.height = settings['window.size']
 *     uidata.mainwindow.resize(uidata.width, uidata.height)
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_33initial_resize, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_initial_resize, __pyx_t_4) < 0) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1849
 *     #QTimer.singleShot(20, _on_init_finalize)
 * 
 * def set_title(title):             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.setTitle(str2q(title))
 * 
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_35set_title, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_title, __pyx_t_4) < 0) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1852
 *     uidata.mainwindow.setTitle(str2q(title))
 * 
 * def load_ui(path):             # <<<<<<<<<<<<<<
 *     pass
 *     ##pxm>IF 'qtw' == 'qtq'
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_37load_ui, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_load_ui, __pyx_t_4) < 0) __PYX_ERR(0, 1852, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1865
 *     #~ ##pxm>IF_END
 * 
 * def close_mainwindow():             # <<<<<<<<<<<<<<
 *     uidata.mainwindow.close()
 * 
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_39close_mainwindow, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_close_mainwindow, __pyx_t_4) < 0) __PYX_ERR(0, 1865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1868
 *     uidata.mainwindow.close()
 * 
 * def get_samples():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     #TODO: uidata.drawingarea.format().samples() returns only 0 here
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_41get_samples, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_samples, __pyx_t_4) < 0) __PYX_ERR(0, 1868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1876
 *     #~ ##pxm>IF_END
 * 
 * def update_drawingarea():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.update()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_43update_drawingarea, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_update_drawingarea, __pyx_t_4) < 0) __PYX_ERR(0, 1876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1883
 *     #~ ##pxm>IF_END
 * 
 * def set_cursor(index):             # <<<<<<<<<<<<<<
 *     if index < 0:
 *         index += 18
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_45set_cursor, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_cursor, __pyx_t_4) < 0) __PYX_ERR(0, 1883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1895
 *     #~ ##pxm>IF_END
 * 
 * def unset_cursor():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.drawingarea.unsetCursor()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_47unset_cursor, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unset_cursor, __pyx_t_4) < 0) __PYX_ERR(0, 1895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1913
 * #~ ##pxm>IF_END
 * 
 * def save_screenshot(filename):             # <<<<<<<<<<<<<<
 *     IF OFFSCREEN: #px+
 *         cdef QImage image #px+
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_49save_screenshot, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_save_screenshot, __pyx_t_4) < 0) __PYX_ERR(0, 1913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1932
 * #### misc qt ####
 * 
 * def parse_color(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_51parse_color, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_color, __pyx_t_4) < 0) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1938
 *     return color.red(), color.green(), color.blue()
 * 
 * def parse_color_f(name):             # <<<<<<<<<<<<<<
 *     cdef QColor color #px/
 *     #color = QColor()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_53parse_color_f, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_color_f, __pyx_t_4) < 0) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1944
 *     return color.redF(), color.greenF(), color.blueF()
 * 
 * def load_image_from_file(filename, maxsize):             # <<<<<<<<<<<<<<
 *     cdef int width, height, scaled_width, scaled_height #px+
 *     cdef bytes data #px+
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_55load_image_from_file, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_load_image_from_file, __pyx_t_4) < 0) __PYX_ERR(0, 1944, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1988
 * ##pxm>IF_END
 * 
 * def keyval_from_name(keystr):             # <<<<<<<<<<<<<<
 *     keystr = '+'.join(('Num' if k == 'KP' else k) for k in keystr.split('+'))
 *     cdef QKeySequence keyseq = fromString(str2q(keystr), PortableText) #px/
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_57keyval_from_name, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyval_from_name, __pyx_t_4) < 0) __PYX_ERR(0, 1988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1996
 *     return keyseq[0]
 * 
 * def get_pictures_folder():             # <<<<<<<<<<<<<<
 *     cdef QStringList locations = standardLocations(PicturesLocation) #px/
 *     #locations = standardLocations(PicturesLocation)
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_59get_pictures_folder, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pictures_folder, __pyx_t_4) < 0) __PYX_ERR(0, 1996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2007
 *     return q2str(locations[0])
 * 
 * def get_imagefile(facekey):             # <<<<<<<<<<<<<<
 *     imagefile = settings['theme.faces',facekey,'image']
 *     currentfolder = get_pictures_folder()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_61get_imagefile, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_imagefile, __pyx_t_4) < 0) __PYX_ERR(0, 2007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2016
 *     return currentfolder, imagefile
 * 
 * def text_to_html(text):             # <<<<<<<<<<<<<<
 *     return q2str(fromPlainText(str2q(text)).toHtml())
 * 
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_63text_to_html, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_text_to_html, __pyx_t_4) < 0) __PYX_ERR(0, 2016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2034
 *         uidata.filesystemwatcher.addPath(str2q(path))
 * 
 * def create_filesystemwatcher(path, callback):             # <<<<<<<<<<<<<<
 *     cdef QString qpath = str2q(path) #px/
 *     #qpath = path
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_65create_filesystemwatcher, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_filesystemwatcher, __pyx_t_4) < 0) __PYX_ERR(0, 2034, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2055
 *     else: #px+
 *         pydata.singleshot_handler = None #px+
 * def timer_singleShot(msec, func):             # <<<<<<<<<<<<<<
 *     if pydata.singleshot_handler is None: #px+
 *         pydata.singleshot_handler = func #px+
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_67timer_singleShot, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_singleShot, __pyx_t_4) < 0) __PYX_ERR(0, 2055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2088
 *     uidata.settings_timer = NULL
 * 
 * def set_animation_speed():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.speed = settings['draw.speed']
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_71set_animation_speed, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_animation_speed, __pyx_t_4) < 0) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2135
 * 
 * # only for demos
 * def animate_timer_step(angle_max):             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.angle_max = angle_max
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_75animate_timer_step, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_animate_timer_step, __pyx_t_4) < 0) __PYX_ERR(0, 2135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2142
 *     pass
 * 
 * def animate_timer_stop():             # <<<<<<<<<<<<<<
 *     ##pxm>IF 'qtw' == 'qtw'
 *     uidata.animate_timer.stop()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_77animate_timer_stop, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_animate_timer_stop, __pyx_t_4) < 0) __PYX_ERR(0, 2142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2212
 *     #~ ##pxm>IF_END
 * 
 * def create_window(pyapp):             # <<<<<<<<<<<<<<
 *     pydata.app = pyapp
 *     init_module()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_79create_window, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_window, __pyx_t_4) < 0) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2282
 *     load_cursors(os.path.join(config_.UI_DIR, 'cursors', 'mouse_{}.png'))
 * 
 * def destroy_window():             # <<<<<<<<<<<<<<
 *     destroy_cursors()
 *     settings_timer_destroy()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_81destroy_window, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy_window, __pyx_t_4) < 0) __PYX_ERR(0, 2282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":2302
 * #~ ##pxm>IF_END
 * 
 * def app_post_create(gettext):             # <<<<<<<<<<<<<<
 *     cdef QApplication *app = <QApplication*>QCoreApplication_instance() #px/
 *     #app = QCoreApplication.instance()
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_10_qt_qtwes2_83app_post_create, NULL, __pyx_n_s_qt_qtwes2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_app_post_create, __pyx_t_4) < 0) __PYX_ERR(0, 2302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_qt_qtwes2.pyx":1
 * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
 * # cython: profile=False
 * 
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init _qt_qtwes2", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init _qt_qtwes2");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* PyObjectCall */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyErrFetchRestore */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
  static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* decode_c_string */
  static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    Py_ssize_t length;
    if (unlikely((start < 0) | (stop < 0))) {
        size_t slen = strlen(cstring);
        if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
            PyErr_SetString(PyExc_OverflowError,
                            "c-string too long to convert to Python");
            return NULL;
        }
        length = (Py_ssize_t) slen;
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* GetItemInt */
  static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* RaiseTooManyValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
  static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* BytesEquals */
  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* PyCFunctionFastCall */
  #if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
}
#endif  // CYTHON_FAST_PYCCALL

/* PyFunctionFastCall */
  #if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = PyThreadState_GET();
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = f->f_localsplus;
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif  // CPython < 3.6
#endif  // CYTHON_FAST_PYCALL

/* PyObjectCallMethO */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* None */
    static CYTHON_INLINE qint64 __Pyx_div_qint64(qint64 a, qint64 b) {
    qint64 q = a / b;
    qint64 r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* RaiseArgTupleInvalid */
    static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
    static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
    static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyIntBinop */
    #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyObjectCallNoArg */
    #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* GetException */
      #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* SwapException */
        #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* SaveResetException */
        #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* UnicodeEquals */
        static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* None */
        static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* Import */
        static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
        static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* None */
        static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* PyObjectCallMethod1 */
        static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto done;
#if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyCFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            args = PyTuple_New(2);
            if (unlikely(!args)) goto done;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
done:
    Py_XDECREF(method);
    return result;
}

/* pop_index */
        static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
    PyObject *r;
    if (unlikely(!py_ix)) return NULL;
    r = __Pyx__PyObject_PopIndex(L, py_ix);
    Py_DECREF(py_ix);
    return r;
}
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
    return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
    Py_ssize_t size = PyList_GET_SIZE(L);
    if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
        Py_ssize_t cix = ix;
        if (cix < 0) {
            cix += size;
        }
        if (likely(0 <= cix && cix < size)) {
            PyObject* v = PyList_GET_ITEM(L, cix);
            Py_SIZE(L) -= 1;
            size -= 1;
            memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
            return v;
        }
    }
    if (py_ix == Py_None) {
        return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

/* append */
        static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyIntBinop */
        #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* PyIntBinop */
        #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* pyobject_as_double */
        static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
    float_value = PyNumber_Float(obj);  if (0) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

/* PyErrExceptionMatches */
        #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* CalculateMetaclass */
        static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
        static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module_2, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CodeObjectCache */
        static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
        #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
        static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Qt_3a__3a_Key(enum Qt::Key value) {
    const enum Qt::Key neg_one = (enum Qt::Key) -1, const_zero = (enum Qt::Key) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum Qt::Key) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum Qt::Key) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Qt::Key) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum Qt::Key) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Qt::Key) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum Qt::Key),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
        static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Qt_3a__3a_KeyboardModifier(enum Qt::KeyboardModifier value) {
    const enum Qt::KeyboardModifier neg_one = (enum Qt::KeyboardModifier) -1, const_zero = (enum Qt::KeyboardModifier) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum Qt::KeyboardModifier) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum Qt::KeyboardModifier) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Qt::KeyboardModifier) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum Qt::KeyboardModifier) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Qt::KeyboardModifier) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum Qt::KeyboardModifier),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
        static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Qt_3a__3a_MouseButton(enum Qt::MouseButton value) {
    const enum Qt::MouseButton neg_one = (enum Qt::MouseButton) -1, const_zero = (enum Qt::MouseButton) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum Qt::MouseButton) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum Qt::MouseButton) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Qt::MouseButton) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum Qt::MouseButton) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Qt::MouseButton) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum Qt::MouseButton),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
        #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
        static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* None */
        static CYTHON_INLINE long __Pyx_pow_long(long b, long e) {
    long t = b;
    switch (e) {
        case 3:
            t *= b;
        case 2:
            t *= b;
        case 1:
            return t;
        case 0:
            return 1;
    }
    #if 1
    if (unlikely(e<0)) return 0;
    #endif
    t = 1;
    while (likely(e)) {
        t *= (b * (e&1)) | ((~e)&1);
        b *= b;
        e >>= 1;
    }
    return t;
}

/* CIntToPy */
        static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
        static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Qt_3a__3a_KeyboardModifiers(Qt::KeyboardModifiers value) {
    const Qt::KeyboardModifiers neg_one = (Qt::KeyboardModifiers) -1, const_zero = (Qt::KeyboardModifiers) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(Qt::KeyboardModifiers) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(Qt::KeyboardModifiers) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Qt::KeyboardModifiers) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(Qt::KeyboardModifiers) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(Qt::KeyboardModifiers) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(Qt::KeyboardModifiers),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
        static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
        static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* FetchCommonType */
        static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* RaiseException */
        #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* CoroutineBase */
          #include <structmember.h>
#include <frameobject.h>
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
#endif
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
    PyObject *retval;
    __Pyx_PyThreadState_declare
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    __Pyx_PyThreadState_assign
    if (value) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(__pyx_tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = __pyx_tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
    if (unlikely(!retval && !PyErr_Occurred())) {
        PyErr_SetNone(PyExc_StopIteration);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Coroutine_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value);
    }
    return __Pyx_Coroutine_MethodReturn(retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
            goto throw_here;
        }
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
}
static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label > 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Coroutine_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
              static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
              #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (!abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_VERSION_HEX >= 0x03030000) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if (0) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
              static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Coroutine_del,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
              static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* ModuleImport */
              #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

/* FunctionImport */
              #ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* InitStrings */
              static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
  #else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
  #endif
#else
  res = PyNumber_Int(x);
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
