From 3d5c6a97132a297e6ce87ba82f01610048a2ef76 Mon Sep 17 00:00:00 2001 From: Martin Reboredo Date: Wed, 8 Jun 2022 19:27:02 -0300 Subject: [PATCH 1/6] Shiboken generation in QMake --- Engine/Engine.pro | 93 ++++++++++++++------------------- Gui/Gui.pro | 49 +++++++++++++++-- INSTALL_LINUX.md | 25 ++------- INSTALL_MACOS.md | 42 ++------------- global.pri | 10 ++++ tools/utils/runPostShiboken.sh | 67 ++++++++++++++---------- tools/utils/runPostShiboken2.sh | 70 +++++++++++++------------ 7 files changed, 176 insertions(+), 180 deletions(-) diff --git a/Engine/Engine.pro b/Engine/Engine.pro index e91bdaf943..4ca0ab63e2 100644 --- a/Engine/Engine.pro +++ b/Engine/Engine.pro @@ -210,7 +210,6 @@ SOURCES += \ ../Global/PythonUtils.cpp \ ../Global/StrUtils.cpp \ ../libs/SequenceParsing/SequenceParsing.cpp \ - $${ENGINE_WRAPPER_DIR}/natronengine_module_wrapper.cpp \ HEADERS += \ AbortableRenderInfo.h \ @@ -427,7 +426,9 @@ HEADERS += \ ../libs/OpenFX/include/nuke/fnPublicOfxExtensions.h \ ../libs/OpenFX/include/tuttle/ofxReadWrite.h \ ../libs/OpenFX_extensions/ofxhParametricParam.h \ - $${ENGINE_WRAPPER_DIR}/natronengine_python.h \ + +GENERATED_SOURCES += $${ENGINE_WRAPPER_DIR}/natronengine_module_wrapper.cpp +GENERATED_HEADERS += $${ENGINE_WRAPPER_DIR}/natronengine_python.h ENGINE_GENERATED_SOURCES = \ animatedparam_wrapper \ @@ -480,67 +481,53 @@ ENGINE_GENERATED_SOURCES = \ userparamholder_wrapper \ for(name, ENGINE_GENERATED_SOURCES) { - SOURCES += $${ENGINE_WRAPPER_DIR}/$${name}.cpp - HEADERS += $${ENGINE_WRAPPER_DIR}/$${name}.h + GENERATED_SOURCES += $${ENGINE_WRAPPER_DIR}/$${name}.cpp + GENERATED_HEADERS += $${ENGINE_WRAPPER_DIR}/$${name}.h } OTHER_FILES += \ typesystem_engine.xml -# GENERATED_SOURCES = \ -# NatronEngine/animatedparam_wrapper.cpp \ -# NatronEngine/app_wrapper.cpp \ -# NatronEngine/beziercurve_wrapper.cpp \ -# NatronEngine/booleanparam_wrapper.cpp \ -# NatronEngine/buttonparam_wrapper.cpp \ -# NatronEngine/choiceparam_wrapper.cpp \ -# NatronEngine/colorparam_wrapper.cpp \ -# NatronEngine/colortuple_wrapper.cpp \ -# NatronEngine/double2dparam_wrapper.cpp \ -# NatronEngine/double2dtuple_wrapper.cpp \ -# NatronEngine/double3dparam_wrapper.cpp \ -# NatronEngine/double3dtuple_wrapper.cpp \ -# NatronEngine/doubleparam_wrapper.cpp \ -# NatronEngine/effect_wrapper.cpp \ -# NatronEngine/fileparam_wrapper.cpp \ -# NatronEngine/group_wrapper.cpp \ -# NatronEngine/groupparam_wrapper.cpp \ -# NatronEngine/int2dparam_wrapper.cpp \ -# NatronEngine/int2dtuple_wrapper.cpp \ -# NatronEngine/int3dparam_wrapper.cpp \ -# NatronEngine/int3dtuple_wrapper.cpp \ -# NatronEngine/intparam_wrapper.cpp \ -# NatronEngine/itembase_wrapper.cpp \ -# NatronEngine/layer_wrapper.cpp \ -# NatronEngine/natron_wrapper.cpp \ -# NatronEngine/natronengine_module_wrapper.cpp \ -# NatronEngine/outputfileparam_wrapper.cpp \ -# NatronEngine/pageparam_wrapper.cpp \ -# NatronEngine/param_wrapper.cpp \ -# NatronEngine/parametricparam_wrapper.cpp \ -# NatronEngine/pathparam_wrapper.cpp \ -# NatronEngine/roto_wrapper.cpp \ -# NatronEngine/stringparam_wrapper.cpp \ -# NatronEngine/stringparambase_wrapper.cpp +defineReplace(shibokenEngine) { + SOURCES += $$GENERATED_SOURCES + HEADERS += $$GENERATED_HEADERS + return("%_wrapper.cpp") +} -# defineReplace(shibokenWorkaround) { -# SOURCES += $$GENERATED_SOURCES -# return("%_wrapper.cpp") -# } +QT_INCLUDEPATH = $$PYTHON_INCLUDEPATH $$PYSIDE_INCLUDEDIR +for(dep, QT) { + QT_INCLUDEPATH += $$eval(QT.$${dep}.includes) + QT_INCLUDEPATH += $$absolute_path($$eval(QT.$${dep}.name), $$PYSIDE_INCLUDEDIR) +} + +equals(QT_MAJOR_VERSION, 5) { + PYENGINE_HEADER = PySide2_Engine_Python.h + POST_SHIBOKEN = bash $$shell_path(../tools/utils/runPostShiboken2.sh) +} else:equals(QT_MAJOR_VERSION, 4) { + PYENGINE_HEADER = Pyside_Engine_Python.h + POST_SHIBOKEN = bash $$shell_path(../tools/utils/runPostShiboken.sh) +} -# isEmpty(SHIBOKEN) { -# SHIBOKEN = shiboken -# } +SRC_PATH = $$relative_path($$PWD, $$OUT_PWD)/ +DEP_GROUP = $$PYENGINE_HEADER typesystem_engine.xml $$HEADERS +enginesbk.input = $$PYENGINE_HEADER typesystem_engine.xml +enginesbk.depends = $$eval($$list($$join(DEP_GROUP, " "$$SRC_PATH, $$SRC_PATH))) +enginesbk.target = enginesbk +enginesbk.commands = cd $$PWD && $$SHIBOKEN \ + --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero \ + --avoid-protected-hack --enable-pyside-extensions \ + -I.:..:../Global:../libs/OpenFX/include $$join(QT_INCLUDEPATH, ":", "-I") \ + -T$$TYPESYSTEMPATH --output-directory=$$OUT_PWD/Qt$$QT_MAJOR_VERSION \ + $$PYENGINE_HEADER typesystem_engine.xml && \ + $$POST_SHIBOKEN $$OUT_PWD/Qt$$QT_MAJOR_VERSION/NatronEngine natronengine +pyengine.depends = enginesbk +pyengine.target = $$shell_path($$ENGINE_WRAPPER_DIR/%_wrapper.cpp) +pyengine.output_function = shibokenEngine +pyengine.commands = bash -c 'true' -# SHIBOKEN_FILE = . # Need to give some bogus input -# SHIBOKEN.input = SHIBOKEN_FILE -# SHIBOKEN.output_function = shibokenWorkaround -# SHIBOKEN.commands = $$SHIBOKEN --include-paths=..:$$system(pkg-config --variable=includedir pyside) --typesystem-paths=$$system(pkg-config --variable=typesystemdir pyside) Pyside_Engine_Python.h typesystem_engine.xml -# SHIBOKEN.CONFIG = no_link # don't add the .cpp target file to OBJECTS -# SHIBOKEN.clean = dummy # don't remove the %_wrapper.cpp file by "make clean" +QMAKE_EXTRA_TARGETS += enginesbk pyengine -# QMAKE_EXTRA_COMPILERS += SHIBOKEN macx { OBJECTIVE_SOURCES += \ diff --git a/Gui/Gui.pro b/Gui/Gui.pro index ec30c66aba..1259fe0365 100644 --- a/Gui/Gui.pro +++ b/Gui/Gui.pro @@ -227,7 +227,6 @@ SOURCES += \ ViewerTabPrivate.cpp \ ViewerToolButton.cpp \ ticks.cpp \ - $${GUI_WRAPPER_DIR}/natrongui_module_wrapper.cpp \ HEADERS += \ AboutWindow.h \ @@ -384,7 +383,9 @@ HEADERS += \ ../libs/OpenFX/include/nuke/fnPublicOfxExtensions.h \ ../libs/OpenFX/include/tuttle/ofxReadWrite.h \ ../libs/OpenFX_extensions/ofxhParametricParam.h \ - $${GUI_WRAPPER_DIR}/natrongui_python.h \ + +GENERATED_SOURCES += $${GUI_WRAPPER_DIR}/natrongui_module_wrapper.cpp +GENERATED_HEADERS += $${GUI_WRAPPER_DIR}/natrongui_python.h GUI_GENERATED_SOURCES = \ guiapp_wrapper \ @@ -395,8 +396,8 @@ GUI_GENERATED_SOURCES = \ pyviewer_wrapper for(name, GUI_GENERATED_SOURCES) { - SOURCES += $${GUI_WRAPPER_DIR}/$${name}.cpp - HEADERS += $${GUI_WRAPPER_DIR}/$${name}.h + GENERATED_SOURCES += $${GUI_WRAPPER_DIR}/$${name}.cpp + GENERATED_HEADERS += $${GUI_WRAPPER_DIR}/$${name}.h } RESOURCES += \ @@ -420,6 +421,46 @@ OTHER_FILES += \ Resources/Images/searchSize.png \ Resources/Images/splashscreen.svg +defineReplace(shibokenGui) { + SOURCES += $$GENERATED_SOURCES + HEADERS += $$GENERATED_HEADERS + return("%_wrapper.cpp") +} + +QT_INCLUDEPATH = $$PYTHON_INCLUDEPATH $$PYSIDE_INCLUDEDIR +for(dep, QT) { + QT_INCLUDEPATH += $$eval(QT.$${dep}.includes) + QT_INCLUDEPATH += $$absolute_path($$eval(QT.$${dep}.name), $$PYSIDE_INCLUDEDIR) +} + +equals(QT_MAJOR_VERSION, 5) { + PYGUI_HEADER = PySide2_Gui_Python.h + POST_SHIBOKEN = bash $$shell_path($$PWD/../tools/utils/runPostShiboken2.sh) +} else:equals(QT_MAJOR_VERSION, 4) { + PYGUI_HEADER = Pyside_Gui_Python.h + POST_SHIBOKEN = bash $$shell_path($$PWD/../tools/utils/runPostShiboken.sh) +} + + +SRC_PATH = $$relative_path($$PWD, $$OUT_PWD)/ +DEP_GROUP = $$PYGUI_HEADER typesystem_natronGui.xml $$HEADERS +guisbk.input = $$PYGUI_HEADER typesystem_natronGui.xml +guisbk.depends = $$eval($$list($$join(DEP_GROUP, " "$$SRC_PATH, $$SRC_PATH))) +guisbk.target = guisbk +guisbk.commands = cd $$PWD && $$SHIBOKEN \ + --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero \ + --avoid-protected-hack --enable-pyside-extensions \ + -I.:..:../Global:../Engine:../libs/OpenFX/include $$join(QT_INCLUDEPATH, ":", "-I") \ + -T../Engine:$$TYPESYSTEMPATH --output-directory=$$OUT_PWD/Qt$$QT_MAJOR_VERSION \ + $$PYGUI_HEADER typesystem_natronGui.xml && \ + $$POST_SHIBOKEN $$OUT_PWD/Qt$$QT_MAJOR_VERSION/NatronGui natrongui +pygui.depends = guisbk +pygui.target = $$shell_path($$GUI_WRAPPER_DIR/%_wrapper.cpp) +pygui.output_function = shibokenGui +pygui.commands = bash -c 'true' + +QMAKE_EXTRA_TARGETS += guisbk pygui + macx { HEADERS += TaskBarMac.h OBJECTIVE_SOURCES += \ diff --git a/INSTALL_LINUX.md b/INSTALL_LINUX.md index 2a069c7783..3d79525907 100644 --- a/INSTALL_LINUX.md +++ b/INSTALL_LINUX.md @@ -482,25 +482,9 @@ shiboken { # Generating Python bindings -This is not required as generated files are already in the repository. You would need to run it if you were to extend or modify the Python bindings via the +This is not required as file generation occurs during build with Qt5 and generated files are already in the repository for Qt4. You would need to run it if you were both under Qt4 and either extend or modify the Python bindings via the typesystem.xml file. See the documentation of shiboken for an explanation of the command line arguments. -```sh -SDK_PREFIX=/usr # /opt/Natron-sdk if using the Natron SDK -PYSIDE_PREFIX=/usr # /opt/Natron-sdk if using the Natron SDK -PYV=3.10 -QT=5 -rm Engine/NatronEngine/* Gui/NatronGui/* - -shiboken2 --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Engine:Global:$SDK_PREFIX/include:$PYSIDE_PREFIX/include/PySide2 --typesystem-paths=$PYSIDE_PREFIX/lib/python${PYV}/site-packages/PySide2/typesystems --output-directory=Engine/Qt${QT} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml - -shiboken2 --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Engine:Gui:Global:$SDK_PREFIX/include:$PYSIDE_PREFIX/include/PySide2 --typesystem-paths=$PYSIDE_PREFIX/lib/python${PYV}/site-packages/PySide2/typesystems:Engine:Shiboken --output-directory=Gui/Qt${QT} Gui/Pyside2_Gui_Python.h Gui/typesystem_natronGui.xml - -tools/utils/runPostShiboken2.sh -#tools/utils/runPostShiboken2.sh Engine/Qt${QT}/NatronEngine natronengine -#tools/utils/runPostShiboken2.sh Gui/Qt${QT}/NatronGui natrongui -``` - If using PySide for Qt4, the command-line would be: ```sh @@ -513,10 +497,9 @@ shiboken --avoid-protected-hack --enable-pyside-extensions --include-paths=../En shiboken --avoid-protected-hack --enable-pyside-extensions --include-paths=../Engine:../Gui:../Global:$SDK_PREFIX/include:$PYSIDE_PREFIX/include/PySide --typesystem-paths=$PYSIDE_PREFIX/share/PySide/typesystems:Engine:Shiboken --output-directory=Gui/Qt${QT} Gui/Pyside_Gui_Python.h Gui/typesystem_natronGui.xml -tools/utils/runPostShiboken.sh -#tools/utils/runPostShiboken.sh Engine/Qt${QT}/NatronEngine natronengine -#tools/utils/runPostShiboken.sh Gui/Qt${QT}/NatronGui natrongui +tools/utils/runPostShiboken.sh Engine/Qt${QT}/NatronEngine natronengine +tools/utils/runPostShiboken.sh Gui/Qt${QT}/NatronGui natrongui ``` **Note** -Shiboken has a few glitches which needs fixing with some sed commands, run `tools/utils/runPostShiboken2.sh` for Qt5 or `tools/utils/runPostShiboken.sh` for Qt4 once shiboken is called. +Shiboken has a few glitches which needs fixing with some sed commands, run `tools/utils/runPostShiboken.sh` for Qt4 once shiboken is called. diff --git a/INSTALL_MACOS.md b/INSTALL_MACOS.md index 284c2ee3c4..bea03b3660 100644 --- a/INSTALL_MACOS.md +++ b/INSTALL_MACOS.md @@ -610,7 +610,7 @@ launchctl setenv PATH /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sb ## Generating Python bindings -This is not required as generated files are already in the repository. You would need to run it if you were to extend or modify the Python bindings via the +This is not required as file generation occurs during build with Qt5 and generated files are already in the repository for Qt4. You would need to run it if you were both under Qt4 and either extend or modify the Python bindings via the typesystem.xml file. See the documentation of shiboken-2.7 for an explanation of the command line arguments. On MacPorts with qt4-mac, py310-pyside, py310-shiboken: @@ -623,44 +623,8 @@ shiboken-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-path shiboken-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-paths=../Engine:../Gui:../Global:/opt/local/include:/opt/local/include/PySide-${PYV} --typesystem-paths=/opt/local/share/PySide-${PYV}/typesystems:Engine:Shiboken --output-directory=Gui/Qt${QT} Gui/Pyside_Gui_Python.h Gui/typesystem_natronGui.xml -tools/utils/runPostShiboken.sh -#tools/utils/runPostShiboken.sh Engine/Qt${QT}/NatronEngine natronengine -#tools/utils/runPostShiboken.sh Gui/Qt${QT}/NatronGui natrongui -``` - -On MacPorts with qt5, py310-pyside2: -```Shell -PYV=3.10 # Set to the python version -PYTHON_PREFIX=$(python${PYV}-config --prefix) -QT=5 -# Fix a missing link in the MacPorts package -[ ! -f ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/shiboken2_generator/shiboken2-${PYV} ] && sudo ln -s shiboken2 ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/shiboken2_generator/shiboken2-${PYV} - -rm Engine/Qt5/NatronEngine/* Gui/Qt5/NatronGui/* -# ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include -shiboken2-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Engine:Global:libs/OpenFX/include:/opt/local/include:/opt/local/libexec/qt${QT}/include:${PYTHON_PREFIX}/include/python${PYV}:${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include --typesystem-paths=${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/typesystems --output-directory=Engine/Qt${QT} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml - -shiboken2-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Engine:Global:libs/OpenFX/include:/opt/local/include:/opt/local/libexec/qt${QT}/include:/opt/local/libexec/qt${QT}/include/QtWidgets:${PYTHON_PREFIX}/include/python${PYV}:${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include --typesystem-paths=${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/typesystems:Engine:Shiboken --output-directory=Gui/Qt${QT} Gui/Pyside2_Gui_Python.h Gui/typesystem_natronGui.xml - -tools/utils/runPostShiboken2.sh -#tools/utils/runPostShiboken2.sh Engine/Qt${QT}/NatronEngine natronengine -#tools/utils/runPostShiboken2.sh Gui/Qt${QT}/NatronGui natrongui -``` - -on HomeBrew with Qt5/PySide2/Shiboken2: -```Shell -PYV=3.10 # Set to the python version -export PATH="/usr/local/opt/pyside@2/bin:$PATH" -QT=5 -rm Engine/Qt${QT}/NatronEngine/* Gui/Qt5/NatronGui/* - -shiboken2 --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Global:Engine:libs/OpenFX/include:/usr/local/Frameworks/Python.framework/Versions/${PYV}/include/python${PYV}:/usr/local/include:/usr/local/opt/pyside@2/include/PySide2:/usr/local/opt/qt@${QT}/include --typesystem-paths=/usr/local/opt/pyside@2/share/PySide2/typesystems --output-directory=Engine/Qt${QT} Engine/PySide2_Engine_Python.h Engine/typesystem_engine.xml - -shiboken2 --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Global:Engine:Gui:libs/OpenFX/include:/usr/local/Frameworks/Python.framework/Versions/${PYV}/include/python${PYV}:/usr/local/include:/usr/local/opt/pyside@2/include/PySide2:/usr/local/opt/qt@${QT}/include:/usr/local/opt/qt@5/include/QtWidgets --typesystem-paths=/usr/local/opt/pyside@2/share/PySide2/typesystems:Engine --output-directory=Gui/Qt${QT} Gui/PySide2_Gui_Python.h Gui/typesystem_natronGui.xml - -tools/utils/runPostShiboken2.sh -#tools/utils/runPostShiboken2.sh Engine/Qt${QT}/NatronEngine natronengine -#tools/utils/runPostShiboken2.sh Gui/Qt${QT}/NatronGui natrongui +tools/utils/runPostShiboken.sh Engine/Qt${QT}/NatronEngine natronengine +tools/utils/runPostShiboken.sh Gui/Qt${QT}/NatronGui natrongui ``` **Note** diff --git a/global.pri b/global.pri index 78a2cbb21a..c8b9cd2081 100644 --- a/global.pri +++ b/global.pri @@ -33,6 +33,8 @@ DEFINES += OFX_SUPPORTS_DIALOG #for QString(const char*) assumes ASCII strings, we may run into troubles DEFINES += QT_NO_CAST_FROM_ASCII +greaterThan(QT_MAJOR_VERSION, 4): CONFIG += python3 + # To run Natron without Python functionnalities (for debug purposes) run-without-python { message("Natron will run (not build) without Python") @@ -402,17 +404,21 @@ win32-g++ { cairo: PKGCONFIG += cairo fontconfig equals(QT_MAJOR_VERSION, 5) { shiboken: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/shiboken2 + shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken2) pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2 pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2/QtCore pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2/QtGui pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/PySide2/QtWidgets + pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside2) } equals(QT_MAJOR_VERSION, 4) { shiboken: PKGCONFIG += shiboken-py$$PYV + shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken) pyside: PKGCONFIG += pyside-py$$PYV PYSIDE_INCLUDEDIR = $$system(pkg-config --variable=includedir pyside-py$$PYV) pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtCore pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtGui + pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside) } python: PKGCONFIG += python-$$PYVER$$PY_PKG_SUFFIX boost: LIBS += -lboost_serialization-mt @@ -454,12 +460,14 @@ unix { equals(QT_MAJOR_VERSION, 5) { system(pkg-config --exists pyside2) { shiboken: PKGCONFIG += shiboken2 + shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken2) pyside: PKGCONFIG += pyside2 # add QtCore to includes PYSIDE_INCLUDEDIR = $$system(pkg-config --variable=includedir pyside2) pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtCore pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtGui pyside: INCLUDEPATH += $$PYSIDE_INCLUDEDIR/QtWidgets + pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside2) } } @@ -469,7 +477,9 @@ unix { # See for example tools/travis/install_dependencies.sh for a solution that works on Linux, # using a custom config.pri shiboken: PKGCONFIG += shiboken + shiboken: SHIBOKEN = $$system(pkg-config --variable=generator_location shiboken) pyside: PKGCONFIG += pyside + pyside: TYPESYSTEMPATH *= $$system(pkg-config --variable=typesystemdir pyside) # The following hack also works with Homebrew if pyside is installed with option --with-python3 macx { QMAKE_LFLAGS += '-Wl,-rpath,\'@loader_path/../Frameworks\'' diff --git a/tools/utils/runPostShiboken.sh b/tools/utils/runPostShiboken.sh index 11f3e59874..fc5aa80899 100755 --- a/tools/utils/runPostShiboken.sh +++ b/tools/utils/runPostShiboken.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # ***** BEGIN LICENSE BLOCK ***** # This file is part of Natron , # Copyright (C) 2016 INRIA and Alexandre Gauthier @@ -20,23 +20,32 @@ # exit if a command returns an error status set -e -# PySide version override, add 2 for Qt5/PySide2 -PYV="$1" +if [ "$#" -ne 2 ]; then + echo "usage: " 2>&1 + exit 1 +fi -# To be run after shiboken to fix errors +wrapper_dir="$1" +wrapper_name=$2 +wrapper_source=${wrapper_name}_module_wrapper.cpp +wrapper_header=${wrapper_name}_python.h -sed -e '//d' -i'.bak' Engine/NatronEngine/*.cpp -sed -e '//d' -i'.bak' Gui/NatronGui/*.cpp -sed -e "/SbkPySide${PYV}_QtCoreTypes;/d" -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp -sed -e "/SbkPySide${PYV}_QtCoreTypeConverters;/d" -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp -sed -e '/SbkNatronEngineTypes;/d' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp -sed -e '/SbkNatronEngineTypeConverters;/d' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp -sed -e 's/cleanTypesAttributes/cleanGuiTypesAttributes/g' -i'.bak' Gui/NatronGui/natrongui_module_wrapper.cpp -sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' Engine/NatronEngine/*.cpp -sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' Gui/NatronGui/*.cpp -sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' Engine/NatronEngine/*.cpp -sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' Gui/NatronGui/*.cpp +# To be run after shiboken to fix errors +sed -e '//d' -i'.bak' "$wrapper_dir"/*.cpp +sed -e '//d' -i'.bak' "$wrapper_dir"/*.cpp +sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' "$wrapper_dir"/*.cpp +sed -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' "$wrapper_dir"/*.cpp +sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' "$wrapper_dir"/*.cpp +sed -e '/Py_END_ALLOW_THREADS/d' -i'.bak' "$wrapper_dir"/*.cpp +if [ "$wrapper_name" = "natrongui" ]; then + $SED -e "/SbkPySide_QtCoreTypes;/d" -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e "/SbkPySide_QtCoreTypeConverters;/d" -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e '/SbkNatronEngineTypes;/d' -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e '/SbkNatronEngineTypeConverters;/d' -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e 's/cleanTypesAttributes/cleanGuiTypesAttributes/g' -i'.bak' "$wrapper_dir/$wrapper_source" +fi + # fix warnings sed -e 's@^#include $@#include "Global/Macros.h"\ CLANG_DIAG_OFF(mismatched-tags)\ @@ -45,32 +54,32 @@ GCC_DIAG_OFF(missing-field-initializers)\ GCC_DIAG_OFF(missing-declarations)\ GCC_DIAG_OFF(uninitialized)\ GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF\ -#include // produces many warnings@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp +#include // produces many warnings@' -i'.bak' "$wrapper_dir"/*.cpp sed -e 's@// Extra includes@// Extra includes\ -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp +NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' "$wrapper_dir"/*.cpp # replace NATRON_NAMESPACE with Natron for enums with flags (e.g. StandardButtonEnum) -sed -e 's@"NatronEngine\.NATRON_NAMESPACE@"NatronEngine.Natron@g' -e 's@, NatronEngine\.NATRON_NAMESPACE@, NatronEngine.Natron@g' -e 's@"NatronGui\.NATRON_NAMESPACE@"NatronGui.Natron@g' -e 's@"NATRON_NAMESPACE@"Natron@g' -i'.bak' Engine/NatronEngine/*_wrapper.cpp +sed -e 's@"NatronEngine\.NATRON_NAMESPACE@"NatronEngine.Natron@g' -e 's@, NatronEngine\.NATRON_NAMESPACE@, NatronEngine.Natron@g' -e 's@"NatronGui\.NATRON_NAMESPACE@"NatronGui.Natron@g' -e 's@"NATRON_NAMESPACE@"Natron@g' -i'.bak' "$wrapper_dir"/*_wrapper.cpp # re-add the Natron namespace #sed -e 's@" ::\([^s][^t][^d]\)@ NATRON_NAMESPACE::\1@g' -i'.bak' Engine/NatronEngine/*.cpp Engine/NatronEngine/*.h Gui/NatronGui/*.cpp Gui/NatronGui/*.h -sed -e 's@SbkType< ::@SbkType$@CLANG_DIAG_OFF(header-guard)\ -#include // has wrong header guards in pyside 1.2.2@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp +#include // has wrong header guards in pyside 1.2.2@' -i'.bak' "$wrapper_dir"/*.cpp sed -e 's@^#include $@CLANG_DIAG_OFF(deprecated)\ CLANG_DIAG_OFF(uninitialized)\ @@ -78,7 +87,7 @@ CLANG_DIAG_OFF(keyword-macro)\ #include // produces warnings\ CLANG_DIAG_ON(deprecated)\ CLANG_DIAG_ON(uninitialized)\ -CLANG_DIAG_ON(keyword-macro)@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp Engine/NatronEngine/*.h Gui/NatronGui/*.h +CLANG_DIAG_ON(keyword-macro)@' -i'.bak' "$wrapper_dir"/*.cpp "$wrapper_dir"/*.h sed -e 's@^#include $@CLANG_DIAG_OFF(deprecated)\ CLANG_DIAG_OFF(uninitialized)\ @@ -86,7 +95,7 @@ CLANG_DIAG_OFF(keyword-macro)\ #include // produces warnings\ CLANG_DIAG_ON(deprecated)\ CLANG_DIAG_ON(uninitialized)\ -CLANG_DIAG_ON(keyword-macro)@' -i'.bak' Engine/NatronEngine/*.cpp Gui/NatronGui/*.cpp Engine/NatronEngine/*.h Gui/NatronGui/*.h +CLANG_DIAG_ON(keyword-macro)@' -i'.bak' "$wrapper_dir"/*.cpp "$wrapper_dir"/*.h # clean up -rm Gui/NatronGui/*.bak Engine/NatronEngine/*.bak +rm "$wrapper_dir"/*.bak diff --git a/tools/utils/runPostShiboken2.sh b/tools/utils/runPostShiboken2.sh index 2434c71f58..ac27306838 100755 --- a/tools/utils/runPostShiboken2.sh +++ b/tools/utils/runPostShiboken2.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # ***** BEGIN LICENSE BLOCK ***** # This file is part of Natron , # Copyright (C) 2016 INRIA and Alexandre Gauthier @@ -20,14 +20,21 @@ # exit if a command returns an error status set -e -# PySide version override, add 2 for Qt5/PySide2 -PYV="${1:-2}" +if [ "$#" -ne 2 ]; then + echo "usage: " 2>&1 + exit 1 +fi + +wrapper_dir="$1" +wrapper_name="$2" +wrapper_source=${wrapper_name}_module_wrapper.cpp +wrapper_header=${wrapper_name}_python.h -SED=sed -if [ `uname` = "Darwin" ]; then +SED="sed" +if [ "$(uname)" = "Darwin" ]; then # this script uses the sed cammand "T;", which is a GNU extension SED=gsed - path_to_sed=`which $SED` + path_to_sed="$(which $SED)" if [ ! -x "$path_to_sed" ] ; then echo "$SED is required but not available; please install it:" echo "- 'brew install gnu-sed' on Homebrew," @@ -38,17 +45,13 @@ fi # To be run after shiboken to fix errors -$SED -e '//d' -i'.bak' Engine/Qt5/NatronEngine/*.cpp -$SED -e '//d' -i'.bak' Gui/Qt5/NatronGui/*.cpp -$SED -e "/SbkPySide${PYV}_QtCoreTypes;/d" -i'.bak' Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp -$SED -e "/SbkPySide${PYV}_QtCoreTypeConverters;/d" -i'.bak' Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp -$SED -e '/SbkNatronEngineTypes;/d' -i'.bak' Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp -$SED -e '/SbkNatronEngineTypeConverters;/d' -i'.bak' Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp -$SED -e 's/cleanTypesAttributes/cleanGuiTypesAttributes/g' -i'.bak' Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp -$SED -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' Engine/Qt5/NatronEngine/*.cpp -$SED -e '/Py_BEGIN_ALLOW_THREADS/d' -i'.bak' Gui/Qt5/NatronGui/*.cpp -$SED -e '/Py_END_ALLOW_THREADS/d' -i'.bak' Engine/Qt5/NatronEngine/*.cpp -$SED -e '/Py_END_ALLOW_THREADS/d' -i'.bak' Gui/Qt5/NatronGui/*.cpp +if [ "$wrapper_name" = "natrongui" ]; then + $SED -e "/SbkPySide2_QtCoreTypes;/d" -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e "/SbkPySide2_QtCoreTypeConverters;/d" -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e '/SbkNatronEngineTypes;/d' -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e '/SbkNatronEngineTypeConverters;/d' -i'.bak' "$wrapper_dir/$wrapper_source" + $SED -e 's/cleanTypesAttributes/cleanGuiTypesAttributes/g' -i'.bak' "$wrapper_dir/$wrapper_source" +fi # fix warnings $SED -e 's@^#include $@#include "Global/Macros.h"\ @@ -59,47 +62,46 @@ GCC_DIAG_OFF(missing-declarations)\ GCC_DIAG_OFF(uninitialized)\ GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF\ #include \ -#include // produces many warnings@' -i'.bak' Engine/Qt5/NatronEngine/*.cpp Gui/Qt5/NatronGui/*.cpp +#include // produces many warnings@' -i'.bak' "$wrapper_dir"/*.cpp $SED -e 's@// inner classes@// inner classes\ -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' Engine/Qt5/NatronEngine/*.cpp Gui/Qt5/NatronGui/*.cpp +NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' "$wrapper_dir"/*.cpp $SED -e 's@// Extra includes@// Extra includes\ -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' Engine/Qt5/NatronEngine/natronengine_module_wrapper.cpp Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp +NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING@' -i'.bak' "$wrapper_dir/$wrapper_source" # replace NATRON_NAMESPACE with Natron for enums with flags (e.g. StandardButtonEnum) -$SED -e 's@"1:NatronEngine\.NATRON_NAMESPACE@"1:NatronEngine.Natron@g' -e 's@, NatronEngine\.NATRON_NAMESPACE@, NatronEngine.Natron@g' -e 's@"1:NatronGui\.NATRON_NAMESPACE@"NatronGui.Natron@g' -e 's@"NATRON_NAMESPACE@"Natron@g' -i'.bak' Engine/Qt5/NatronEngine/*_wrapper.cpp +$SED -e 's@"1:NatronEngine\.NATRON_NAMESPACE@"1:NatronEngine.Natron@g' -e 's@, NatronEngine\.NATRON_NAMESPACE@, NatronEngine.Natron@g' -e 's@"1:NatronGui\.NATRON_NAMESPACE@"NatronGui.Natron@g' -e 's@"NATRON_NAMESPACE@"Natron@g' -i'.bak' "$wrapper_dir"/*_wrapper.cpp # re-add the Natron namespace #sed -e 's@" ::\([^s][^t][^d]\)@ NATRON_NAMESPACE::\1@g' -i'.bak' Engine/Qt5/NatronEngine/*.cpp Engine/Qt5/NatronEngine/*.h Gui/Qt5/NatronGui/*.cpp Gui/Qt5/NatronGui/*.h -# sed -e 's@SbkType< ::\(\(QFlags<\)\?Natron::.*\) >@SbkType< \1 >@g' -i Engine/Qt5/NatronEngine/natronengine_python.h -$SED -e 's@SbkType< ::@SbkType$@CLANG_DIAG_OFF(header-guard)\ -#include // has wrong header guards in pyside 1.2.2@' -i'.bak' Engine/Qt5/NatronEngine/*.cpp Gui/Qt5/NatronGui/*.cpp +#include // has wrong header guards in pyside 1.2.2@' -i'.bak' "$wrapper_dir"/*.cpp -$SED -e 's@^#include $@CLANG_DIAG_OFF(deprecated)\ +$SED -e 's@^#include $@CLANG_DIAG_OFF(deprecated)\ CLANG_DIAG_OFF(uninitialized)\ CLANG_DIAG_OFF(keyword-macro)\ -#include // produces warnings\ +#include // produces warnings\ CLANG_DIAG_ON(deprecated)\ CLANG_DIAG_ON(uninitialized)\ -CLANG_DIAG_ON(keyword-macro)@' -i'.bak' Engine/Qt5/NatronEngine/*.cpp Gui/Qt5/NatronGui/*.cpp Engine/Qt5/NatronEngine/*.h Gui/Qt5/NatronGui/*.h +CLANG_DIAG_ON(keyword-macro)@' -i'.bak' "$wrapper_dir"/*.cpp "$wrapper_dir"/*.h -$SED -e 's@^#include $@CLANG_DIAG_OFF(deprecated)\ +$SED -e 's@^#include $@CLANG_DIAG_OFF(deprecated)\ CLANG_DIAG_OFF(uninitialized)\ CLANG_DIAG_OFF(keyword-macro)\ -#include // produces warnings\ +#include // produces warnings\ CLANG_DIAG_ON(deprecated)\ CLANG_DIAG_ON(uninitialized)\ -CLANG_DIAG_ON(keyword-macro)@' -i'.bak' Engine/Qt5/NatronEngine/*.cpp Gui/Qt5/NatronGui/*.cpp Engine/Qt5/NatronEngine/*.h Gui/Qt5/NatronGui/*.h +CLANG_DIAG_ON(keyword-macro)@' -i'.bak' "$wrapper_dir"/*.cpp "$wrapper_dir"/*.h # clean up -rm Gui/Qt5/NatronGui/*.bak Engine/Qt5/NatronEngine/*.bak +rm "$wrapper_dir"/*.bak From c827947d17e94821b4a157fb9e638d38ad745977 Mon Sep 17 00:00:00 2001 From: Frederic Devernay Date: Thu, 30 Jun 2022 14:09:25 -0700 Subject: [PATCH 2/6] Update INSTALL_MACOS.md --- INSTALL_MACOS.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/INSTALL_MACOS.md b/INSTALL_MACOS.md index bea03b3660..165e9da19d 100644 --- a/INSTALL_MACOS.md +++ b/INSTALL_MACOS.md @@ -627,6 +627,39 @@ tools/utils/runPostShiboken.sh Engine/Qt${QT}/NatronEngine natronengine tools/utils/runPostShiboken.sh Gui/Qt${QT}/NatronGui natrongui ``` +On MacPorts with qt5, py310-pyside2: +```Shell +PYV=3.10 # Set to the python version +PYTHON_PREFIX=$(python${PYV}-config --prefix) +QT=5 +# Fix a missing link in the MacPorts package +[ ! -f ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/shiboken2_generator/shiboken2-${PYV} ] && sudo ln -s shiboken2 ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/shiboken2_generator/shiboken2-${PYV} + +rm Engine/Qt5/NatronEngine/* Gui/Qt5/NatronGui/* +# ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include +shiboken2-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Engine:Global:libs/OpenFX/include:/opt/local/include:/opt/local/libexec/qt${QT}/include:${PYTHON_PREFIX}/include/python${PYV}:${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include --typesystem-paths=${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/typesystems --output-directory=Engine/Qt${QT} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml + +shiboken2-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Engine:Global:libs/OpenFX/include:/opt/local/include:/opt/local/libexec/qt${QT}/include:/opt/local/libexec/qt${QT}/include/QtWidgets:${PYTHON_PREFIX}/include/python${PYV}:${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include --typesystem-paths=${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/typesystems:Engine:Shiboken --output-directory=Gui/Qt${QT} Gui/Pyside2_Gui_Python.h Gui/typesystem_natronGui.xml + +tools/utils/runPostShiboken2.sh Engine/Qt${QT}/NatronEngine natronengine +tools/utils/runPostShiboken2.sh Gui/Qt${QT}/NatronGui natrongui +``` + +on HomeBrew with Qt5/PySide2/Shiboken2: +```Shell +PYV=3.10 # Set to the python version +export PATH="/usr/local/opt/pyside@2/bin:$PATH" +QT=5 +rm Engine/Qt${QT}/NatronEngine/* Gui/Qt5/NatronGui/* + +shiboken2 --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Global:Engine:libs/OpenFX/include:/usr/local/Frameworks/Python.framework/Versions/${PYV}/include/python${PYV}:/usr/local/include:/usr/local/opt/pyside@2/include/PySide2:/usr/local/opt/qt@${QT}/include --typesystem-paths=/usr/local/opt/pyside@2/share/PySide2/typesystems --output-directory=Engine/Qt${QT} Engine/PySide2_Engine_Python.h Engine/typesystem_engine.xml + +shiboken2 --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Global:Engine:Gui:libs/OpenFX/include:/usr/local/Frameworks/Python.framework/Versions/${PYV}/include/python${PYV}:/usr/local/include:/usr/local/opt/pyside@2/include/PySide2:/usr/local/opt/qt@${QT}/include:/usr/local/opt/qt@5/include/QtWidgets --typesystem-paths=/usr/local/opt/pyside@2/share/PySide2/typesystems:Engine --output-directory=Gui/Qt${QT} Gui/PySide2_Gui_Python.h Gui/typesystem_natronGui.xml + +tools/utils/runPostShiboken2.sh Engine/Qt${QT}/NatronEngine natronengine +tools/utils/runPostShiboken2.sh Gui/Qt${QT}/NatronGui natrongui +``` + **Note** Shiboken has a few glitches which needs fixing with some sed commands, run tools/utils/runPostShiboken.sh once shiboken is called From 11362e7fa36756e921a4f8e1ceb7a93001879718 Mon Sep 17 00:00:00 2001 From: Frederic Devernay Date: Thu, 30 Jun 2022 14:10:16 -0700 Subject: [PATCH 3/6] Update config-macports.pri --- config-macports.pri | 1 + 1 file changed, 1 insertion(+) diff --git a/config-macports.pri b/config-macports.pri index 7e1c921415..04c66c65ba 100644 --- a/config-macports.pri +++ b/config-macports.pri @@ -2,6 +2,7 @@ boost { LIBS += -lboost_serialization-mt } equals(QT_MAJOR_VERSION, 5) { + shiboken: SHIBOKEN=shiboken2-$$PYVER shiboken: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/shiboken2_generator/include shiboken: LIBS += -L$$PYTHON_SITE_PACKAGES/shiboken2 -lshiboken2.cpython-$$PYVERNODOT-darwin.$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION} shiboken: QMAKE_RPATHDIR += $$PYTHON_SITE_PACKAGES/shiboken2 From d94a2d31f672d0a15ccc8e576e729f65e72c2ac9 Mon Sep 17 00:00:00 2001 From: Frederic Devernay Date: Thu, 30 Jun 2022 14:10:31 -0700 Subject: [PATCH 4/6] macports update --- tools/MacPorts/python/py-pyside2/Portfile | 123 ++++++++++++++++++ .../MacPorts/python/py-pyside2/Portfile.orig | 120 +++++++++++++++++ .../MacPorts/python/py-pyside2/Portfile.patch | 10 ++ .../files/patch-find-llvm-config.diff | 11 ++ .../py-pyside2/files/patch-py-mangle.diff | 18 +++ .../files/patch-shiboken2-docs.diff | 17 +++ .../files/shiboken2-5.15.2-numpy-1.23.patch | 28 ++++ 7 files changed, 327 insertions(+) create mode 100644 tools/MacPorts/python/py-pyside2/Portfile create mode 100644 tools/MacPorts/python/py-pyside2/Portfile.orig create mode 100644 tools/MacPorts/python/py-pyside2/Portfile.patch create mode 100644 tools/MacPorts/python/py-pyside2/files/patch-find-llvm-config.diff create mode 100644 tools/MacPorts/python/py-pyside2/files/patch-py-mangle.diff create mode 100644 tools/MacPorts/python/py-pyside2/files/patch-shiboken2-docs.diff create mode 100644 tools/MacPorts/python/py-pyside2/files/shiboken2-5.15.2-numpy-1.23.patch diff --git a/tools/MacPorts/python/py-pyside2/Portfile b/tools/MacPorts/python/py-pyside2/Portfile new file mode 100644 index 0000000000..b0d820818d --- /dev/null +++ b/tools/MacPorts/python/py-pyside2/Portfile @@ -0,0 +1,123 @@ +#-*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 +PortGroup python 1.0 + +name py-pyside2 +version 5.15.3 +revision 0 +categories-append devel aqua +platforms darwin +maintainers {pmetzger @pmetzger} {mcalhoun @MarcusCalhoun-Lopez} openmaintainer +description Python bindings for the Qt cross-platform application and UI framework +long_description ${description} +homepage https://wiki.qt.io/Qt_for_Python +# see ${worksrcdir}/sources/pyside2/PySide2/licensecomment.txt +license {GPL-2 GPL-3+ LGPL-3} +master_sites https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src +distname pyside-setup-opensource-src-${version} +use_xz yes + +checksums rmd160 e47a57c7d372862a286c7f1fa362896bff2e3b41 \ + sha256 7ff5f1cc4291fffb6d5a3098b3090abe4d415da2adec740b4e901893d95d7137 \ + size 3572248 + + +python.versions 36 37 38 39 310 + +set llvm_version 13 + +if {${name} ne ${subport}} { + PortGroup qt5 1.0 + + # fix error related to _Py_Mangle, which was half-patched in this version + # see: https://bugzilla.redhat.com/show_bug.cgi?id=1990768#c9 + patchfiles-append patch-py-mangle.diff + + # fix error with shiboken2 doc building + patchfiles-append patch-shiboken2-docs.diff + + # fix build with numpy 1.23+ + patchfiles-append shiboken2-5.15.2-numpy-1.23.patch + + # see https://trac.macports.org/ticket/62135#comment:4 + qt5.min_version 5.12 + + # Needed for generating shiboken2 documentation + qt5.depends_build_component sqlite-plugin + + depends_build-append \ + path:bin/cmake:cmake \ + port:py${python.version}-setuptools \ + port:py${python.version}-sphinx \ + port:py${python.version}-wheel + + build.args-append \ + --verbose-build \ + --qmake=${qt_qmake_cmd} \ + --cmake=${prefix}/bin/cmake \ + --parallel=${build.jobs} \ + --macos-deployment-target=${macosx_deployment_target} + + if {${configure.sdkroot} != ""} { + build.args-append \ + --macos-sysroot=${configure.sdkroot} + # see https://trac.macports.org/ticket/57355 + build.env-append \ + SDKROOT=${configure.sdkroot} + } + + destroot.args-append \ + --qmake=${qt_qmake_cmd} \ + --cmake=${prefix}/bin/cmake \ + --skip-cmake \ + --reuse-build + + depends_lib-append \ + port:libxml2 \ + port:libxslt \ + port:clang-${llvm_version} \ + port:llvm-${llvm_version} \ + port:py${python.version}-numpy + + # only find the llvm-config from the version we intend to + patchfiles-append patch-find-llvm-config.diff + build.env-append PATH=${prefix}/libexec/llvm-${llvm_version}/bin:$env(PATH) + + qt5.depends_component \ + qtxmlpatterns \ + qt3d \ + qtcharts \ + qtdatavis3d \ + qtdeclarative \ + qtgamepad \ + qtlocation \ + qtmacextras \ + qtmultimedia \ + qtscript \ + qtscxml \ + qtsensors \ + qtserialport \ + qtspeech \ + qtsvg \ + qttools \ + qtwebchannel \ + qtwebengine \ + qtwebsockets + + if {[vercmp ${qt5.version} 5.6] >=0 } { + qt5.depends_component \ + qtquickcontrols2 + } + + if {[vercmp ${qt5.version} 5.9] >=0 } { + qt5.depends_component \ + qtremoteobjects + } + + livecheck.type none +} else { + livecheck.type regex + livecheck.url https://download.qt.io/official_releases/QtForPython/pyside2/ + livecheck.regex (\\d+(\\.\\d+)+) +} diff --git a/tools/MacPorts/python/py-pyside2/Portfile.orig b/tools/MacPorts/python/py-pyside2/Portfile.orig new file mode 100644 index 0000000000..e32c692a75 --- /dev/null +++ b/tools/MacPorts/python/py-pyside2/Portfile.orig @@ -0,0 +1,120 @@ +#-*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 +PortGroup python 1.0 + +name py-pyside2 +version 5.15.3 +revision 0 +categories-append devel aqua +platforms darwin +maintainers {pmetzger @pmetzger} {mcalhoun @MarcusCalhoun-Lopez} openmaintainer +description Python bindings for the Qt cross-platform application and UI framework +long_description ${description} +homepage https://wiki.qt.io/Qt_for_Python +# see ${worksrcdir}/sources/pyside2/PySide2/licensecomment.txt +license {GPL-2 GPL-3+ LGPL-3} +master_sites https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src +distname pyside-setup-opensource-src-${version} +use_xz yes + +checksums rmd160 e47a57c7d372862a286c7f1fa362896bff2e3b41 \ + sha256 7ff5f1cc4291fffb6d5a3098b3090abe4d415da2adec740b4e901893d95d7137 \ + size 3572248 + + +python.versions 36 37 38 39 310 + +set llvm_version 13 + +if {${name} ne ${subport}} { + PortGroup qt5 1.0 + + # fix error related to _Py_Mangle, which was half-patched in this version + # see: https://bugzilla.redhat.com/show_bug.cgi?id=1990768#c9 + patchfiles-append patch-py-mangle.diff + + # fix error with shiboken2 doc building + patchfiles-append patch-shiboken2-docs.diff + + # see https://trac.macports.org/ticket/62135#comment:4 + qt5.min_version 5.12 + + # Needed for generating shiboken2 documentation + qt5.depends_build_component sqlite-plugin + + depends_build-append \ + path:bin/cmake:cmake \ + port:py${python.version}-setuptools \ + port:py${python.version}-sphinx \ + port:py${python.version}-wheel + + build.args-append \ + --verbose-build \ + --qmake=${qt_qmake_cmd} \ + --cmake=${prefix}/bin/cmake \ + --parallel=${build.jobs} \ + --macos-deployment-target=${macosx_deployment_target} + + if {${configure.sdkroot} != ""} { + build.args-append \ + --macos-sysroot=${configure.sdkroot} + # see https://trac.macports.org/ticket/57355 + build.env-append \ + SDKROOT=${configure.sdkroot} + } + + destroot.args-append \ + --qmake=${qt_qmake_cmd} \ + --cmake=${prefix}/bin/cmake \ + --skip-cmake \ + --reuse-build + + depends_lib-append \ + port:libxml2 \ + port:libxslt \ + port:clang-${llvm_version} \ + port:llvm-${llvm_version} \ + port:py${python.version}-numpy + + # only find the llvm-config from the version we intend to + patchfiles-append patch-find-llvm-config.diff + build.env-append PATH=${prefix}/libexec/llvm-${llvm_version}/bin:$env(PATH) + + qt5.depends_component \ + qtxmlpatterns \ + qt3d \ + qtcharts \ + qtdatavis3d \ + qtdeclarative \ + qtgamepad \ + qtlocation \ + qtmacextras \ + qtmultimedia \ + qtscript \ + qtscxml \ + qtsensors \ + qtserialport \ + qtspeech \ + qtsvg \ + qttools \ + qtwebchannel \ + qtwebengine \ + qtwebsockets + + if {[vercmp ${qt5.version} 5.6] >=0 } { + qt5.depends_component \ + qtquickcontrols2 + } + + if {[vercmp ${qt5.version} 5.9] >=0 } { + qt5.depends_component \ + qtremoteobjects + } + + livecheck.type none +} else { + livecheck.type regex + livecheck.url https://download.qt.io/official_releases/QtForPython/pyside2/ + livecheck.regex (\\d+(\\.\\d+)+) +} diff --git a/tools/MacPorts/python/py-pyside2/Portfile.patch b/tools/MacPorts/python/py-pyside2/Portfile.patch new file mode 100644 index 0000000000..d7e89b3ee6 --- /dev/null +++ b/tools/MacPorts/python/py-pyside2/Portfile.patch @@ -0,0 +1,10 @@ +--- Portfile.orig 2022-06-29 15:54:53.000000000 -0700 ++++ Portfile 2022-06-29 15:55:07.000000000 -0700 +@@ -67,7 +67,6 @@ + destroot.args-append \ + --qmake=${qt_qmake_cmd} \ + --cmake=${prefix}/bin/cmake \ +- --skip-cmake \ + --reuse-build + + depends_lib-append \ diff --git a/tools/MacPorts/python/py-pyside2/files/patch-find-llvm-config.diff b/tools/MacPorts/python/py-pyside2/files/patch-find-llvm-config.diff new file mode 100644 index 0000000000..bf33ca1d69 --- /dev/null +++ b/tools/MacPorts/python/py-pyside2/files/patch-find-llvm-config.diff @@ -0,0 +1,11 @@ +--- build_scripts/utils.py.orig 2018-07-26 23:19:42.000000000 -0700 ++++ build_scripts/utils.py 2018-08-24 10:32:58.000000000 -0700 +@@ -674,7 +674,7 @@ + version_re = re.compile(r'(\d+)\.(\d+)\.(\d+)') + result = None + last_version_string = '000000' +- for llvm_config in find_glob_in_path('llvm-config*'): ++ for llvm_config in find_glob_in_path('llvm-config'): + try: + output = run_process_output([llvm_config, '--version']) + if output: diff --git a/tools/MacPorts/python/py-pyside2/files/patch-py-mangle.diff b/tools/MacPorts/python/py-pyside2/files/patch-py-mangle.diff new file mode 100644 index 0000000000..e05d533ac8 --- /dev/null +++ b/tools/MacPorts/python/py-pyside2/files/patch-py-mangle.diff @@ -0,0 +1,18 @@ +--- sources/shiboken2/libshiboken/pep384impl.cpp 2022-03-16 09:18:06.000000000 +0100 ++++ sources/shiboken2/libshiboken/pep384impl.cpp.patched 2022-03-16 09:17:41.000000000 +0100 +@@ -751,9 +751,6 @@ + #endif // IS_PY2 + Shiboken::AutoDecRef privateobj(PyObject_GetAttr( + reinterpret_cast(Py_TYPE(self)), Shiboken::PyMagicName::name())); +-#ifndef Py_LIMITED_API +- return _Py_Mangle(privateobj, name); +-#else + // PYSIDE-1436: _Py_Mangle is no longer exposed; implement it always. + // The rest of this function is our own implementation of _Py_Mangle. + // Please compare the original function in compile.c . +@@ -789,7 +786,6 @@ + if (amount > big_stack) + free(resbuf); + return result; +-#endif // else Py_LIMITED_API + } diff --git a/tools/MacPorts/python/py-pyside2/files/patch-shiboken2-docs.diff b/tools/MacPorts/python/py-pyside2/files/patch-shiboken2-docs.diff new file mode 100644 index 0000000000..0d787a8a8f --- /dev/null +++ b/tools/MacPorts/python/py-pyside2/files/patch-shiboken2-docs.diff @@ -0,0 +1,17 @@ +--- sources/shiboken2/doc/index.rst 2022-01-05 14:26:23.000000000 +0100 ++++ sources/shiboken2/doc/index.rst.patch 2022-03-16 09:44:13.000000000 +0100 +@@ -1,13 +1,8 @@ + Shiboken + ******** + +-.. ifconfig:: output_format == 'html' + +- Shiboken is a fundamental piece on the `Qt for Python <../index.html>`__ project that serves two purposes: +- +-.. ifconfig:: output_format == 'qthelp' +- +- Shiboken is a fundamental piece on the `Qt for Python <../pyside2/index.html>`__ project that serves two purposes: ++Shiboken is a fundamental piece on the `Qt for Python <../pyside2/index.html>`__ project that serves two purposes: + + + * Generator_: Extract information from C or C++ headers and generate CPython_ code that allow diff --git a/tools/MacPorts/python/py-pyside2/files/shiboken2-5.15.2-numpy-1.23.patch b/tools/MacPorts/python/py-pyside2/files/shiboken2-5.15.2-numpy-1.23.patch new file mode 100644 index 0000000000..71c8e5e43d --- /dev/null +++ b/tools/MacPorts/python/py-pyside2/files/shiboken2-5.15.2-numpy-1.23.patch @@ -0,0 +1,28 @@ +Backport of https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=1422cf4a7f277fb13fd209f24a90d6c02641497d. + +From 1422cf4a7f277fb13fd209f24a90d6c02641497d Mon Sep 17 00:00:00 2001 +From: Friedemann Kleint +Date: Thu, 23 Jun 2022 10:44:01 +0200 +Subject: libshiboken: Fix build with numpy 1.23.0 + +Pick-to: 6.3 6.2 5.15 +Change-Id: I885c332d6c948820140946c73ae1926e88834143 +Reviewed-by: Christian Tismer +--- sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp.orig ++++ sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp +@@ -116,8 +116,13 @@ std::ostream &operator<<(std::ostream &str, PyArrayObject *o) + str << " NPY_ARRAY_NOTSWAPPED"; + if ((flags & NPY_ARRAY_WRITEABLE) != 0) + str << " NPY_ARRAY_WRITEABLE"; +- if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0) +- str << " NPY_ARRAY_UPDATEIFCOPY"; ++#if NPY_VERSION >= 0x00000010 // NPY_1_23_API_VERSION ++ if ((flags & NPY_ARRAY_WRITEBACKIFCOPY) != 0) ++ str << " NPY_ARRAY_WRITEBACKIFCOPY"; ++#else ++ if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0) ++ str << " NPY_ARRAY_UPDATEIFCOPY"; ++#endif + } else { + str << '0'; + } From 2e651df43e9d0f8879cb140ec993843ed8072da5 Mon Sep 17 00:00:00 2001 From: Frederic Devernay Date: Thu, 30 Jun 2022 16:49:41 -0700 Subject: [PATCH 5/6] pyside2: remove generated files --- .../NatronEngine/animatedparam_wrapper.cpp | 1140 -------- .../Qt5/NatronEngine/animatedparam_wrapper.h | 42 - Engine/Qt5/NatronEngine/app_wrapper.cpp | 1345 --------- Engine/Qt5/NatronEngine/app_wrapper.h | 48 - .../Qt5/NatronEngine/appsettings_wrapper.cpp | 340 --- Engine/Qt5/NatronEngine/appsettings_wrapper.h | 7 - .../Qt5/NatronEngine/beziercurve_wrapper.cpp | 1918 ------------- Engine/Qt5/NatronEngine/beziercurve_wrapper.h | 42 - .../Qt5/NatronEngine/booleanparam_wrapper.cpp | 716 ----- .../Qt5/NatronEngine/booleanparam_wrapper.h | 60 - .../boolnodecreationproperty_wrapper.cpp | 467 --- .../boolnodecreationproperty_wrapper.h | 43 - .../Qt5/NatronEngine/buttonparam_wrapper.cpp | 263 -- Engine/Qt5/NatronEngine/buttonparam_wrapper.h | 42 - .../Qt5/NatronEngine/choiceparam_wrapper.cpp | 967 ------- Engine/Qt5/NatronEngine/choiceparam_wrapper.h | 62 - .../Qt5/NatronEngine/colorparam_wrapper.cpp | 1609 ----------- Engine/Qt5/NatronEngine/colorparam_wrapper.h | 60 - .../Qt5/NatronEngine/colortuple_wrapper.cpp | 408 --- Engine/Qt5/NatronEngine/colortuple_wrapper.h | 7 - .../NatronEngine/double2dparam_wrapper.cpp | 494 ---- .../Qt5/NatronEngine/double2dparam_wrapper.h | 78 - .../NatronEngine/double2dtuple_wrapper.cpp | 335 --- .../Qt5/NatronEngine/double2dtuple_wrapper.h | 7 - .../NatronEngine/double3dparam_wrapper.cpp | 441 --- .../Qt5/NatronEngine/double3dparam_wrapper.h | 96 - .../NatronEngine/double3dtuple_wrapper.cpp | 371 --- .../Qt5/NatronEngine/double3dtuple_wrapper.h | 7 - .../Qt5/NatronEngine/doubleparam_wrapper.cpp | 1593 ----------- Engine/Qt5/NatronEngine/doubleparam_wrapper.h | 60 - Engine/Qt5/NatronEngine/effect_wrapper.cpp | 1869 ------------ Engine/Qt5/NatronEngine/effect_wrapper.h | 47 - Engine/Qt5/NatronEngine/exprutils_wrapper.cpp | 2506 ----------------- Engine/Qt5/NatronEngine/exprutils_wrapper.h | 7 - Engine/Qt5/NatronEngine/fileparam_wrapper.cpp | 329 --- Engine/Qt5/NatronEngine/fileparam_wrapper.h | 78 - .../floatnodecreationproperty_wrapper.cpp | 467 --- .../floatnodecreationproperty_wrapper.h | 43 - Engine/Qt5/NatronEngine/group_wrapper.cpp | 357 --- Engine/Qt5/NatronEngine/group_wrapper.h | 24 - .../Qt5/NatronEngine/groupparam_wrapper.cpp | 380 --- Engine/Qt5/NatronEngine/groupparam_wrapper.h | 42 - .../Qt5/NatronEngine/imagelayer_wrapper.cpp | 769 ----- Engine/Qt5/NatronEngine/imagelayer_wrapper.h | 7 - .../Qt5/NatronEngine/int2dparam_wrapper.cpp | 413 --- Engine/Qt5/NatronEngine/int2dparam_wrapper.h | 78 - .../Qt5/NatronEngine/int2dtuple_wrapper.cpp | 339 --- Engine/Qt5/NatronEngine/int2dtuple_wrapper.h | 7 - .../Qt5/NatronEngine/int3dparam_wrapper.cpp | 429 --- Engine/Qt5/NatronEngine/int3dparam_wrapper.h | 96 - .../Qt5/NatronEngine/int3dtuple_wrapper.cpp | 377 --- Engine/Qt5/NatronEngine/int3dtuple_wrapper.h | 7 - .../intnodecreationproperty_wrapper.cpp | 467 --- .../intnodecreationproperty_wrapper.h | 43 - Engine/Qt5/NatronEngine/intparam_wrapper.cpp | 1613 ----------- Engine/Qt5/NatronEngine/intparam_wrapper.h | 60 - Engine/Qt5/NatronEngine/itembase_wrapper.cpp | 619 ---- Engine/Qt5/NatronEngine/itembase_wrapper.h | 23 - Engine/Qt5/NatronEngine/layer_wrapper.cpp | 436 --- Engine/Qt5/NatronEngine/layer_wrapper.h | 42 - .../Qt5/NatronEngine/natron_enum_wrapper.cpp | 1863 ------------ Engine/Qt5/NatronEngine/natron_enum_wrapper.h | 7 - .../natronengine_module_wrapper.cpp | 1067 ------- Engine/Qt5/NatronEngine/natronengine_python.h | 231 -- .../nodecreationproperty_wrapper.cpp | 270 -- .../nodecreationproperty_wrapper.h | 20 - .../NatronEngine/outputfileparam_wrapper.cpp | 305 -- .../NatronEngine/outputfileparam_wrapper.h | 78 - Engine/Qt5/NatronEngine/pageparam_wrapper.cpp | 283 -- Engine/Qt5/NatronEngine/pageparam_wrapper.h | 42 - Engine/Qt5/NatronEngine/param_wrapper.cpp | 1775 ------------ Engine/Qt5/NatronEngine/param_wrapper.h | 23 - .../NatronEngine/parametricparam_wrapper.cpp | 932 ------ .../NatronEngine/parametricparam_wrapper.h | 42 - Engine/Qt5/NatronEngine/pathparam_wrapper.cpp | 404 --- Engine/Qt5/NatronEngine/pathparam_wrapper.h | 80 - .../pycoreapplication_wrapper.cpp | 1010 ------- .../NatronEngine/pycoreapplication_wrapper.h | 23 - Engine/Qt5/NatronEngine/rectd_wrapper.cpp | 1517 ---------- Engine/Qt5/NatronEngine/rectd_wrapper.h | 28 - Engine/Qt5/NatronEngine/recti_wrapper.cpp | 1494 ---------- Engine/Qt5/NatronEngine/recti_wrapper.h | 28 - Engine/Qt5/NatronEngine/roto_wrapper.cpp | 532 ---- Engine/Qt5/NatronEngine/roto_wrapper.h | 7 - .../NatronEngine/separatorparam_wrapper.cpp | 239 -- .../Qt5/NatronEngine/separatorparam_wrapper.h | 42 - .../stringnodecreationproperty_wrapper.cpp | 467 --- .../stringnodecreationproperty_wrapper.h | 43 - .../Qt5/NatronEngine/stringparam_wrapper.cpp | 337 --- Engine/Qt5/NatronEngine/stringparam_wrapper.h | 78 - .../NatronEngine/stringparambase_wrapper.cpp | 716 ----- .../NatronEngine/stringparambase_wrapper.h | 60 - Engine/Qt5/NatronEngine/track_wrapper.cpp | 385 --- Engine/Qt5/NatronEngine/track_wrapper.h | 7 - Engine/Qt5/NatronEngine/tracker_wrapper.cpp | 453 --- Engine/Qt5/NatronEngine/tracker_wrapper.h | 7 - .../NatronEngine/userparamholder_wrapper.cpp | 1467 ---------- .../NatronEngine/userparamholder_wrapper.h | 23 - Gui/Qt5/NatronGui/guiapp_wrapper.cpp | 1776 ------------ Gui/Qt5/NatronGui/guiapp_wrapper.h | 68 - .../NatronGui/natrongui_module_wrapper.cpp | 507 ---- Gui/Qt5/NatronGui/natrongui_python.h | 104 - .../NatronGui/pyguiapplication_wrapper.cpp | 685 ----- Gui/Qt5/NatronGui/pyguiapplication_wrapper.h | 43 - Gui/Qt5/NatronGui/pymodaldialog_wrapper.cpp | 888 ------ Gui/Qt5/NatronGui/pymodaldialog_wrapper.h | 81 - Gui/Qt5/NatronGui/pypanel_wrapper.cpp | 1129 -------- Gui/Qt5/NatronGui/pypanel_wrapper.h | 37 - Gui/Qt5/NatronGui/pytabwidget_wrapper.cpp | 797 ------ Gui/Qt5/NatronGui/pytabwidget_wrapper.h | 7 - Gui/Qt5/NatronGui/pyviewer_wrapper.cpp | 1083 ------- Gui/Qt5/NatronGui/pyviewer_wrapper.h | 7 - 112 files changed, 48639 deletions(-) delete mode 100644 Engine/Qt5/NatronEngine/animatedparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/animatedparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/app_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/app_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/appsettings_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/appsettings_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/beziercurve_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/beziercurve_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/booleanparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/booleanparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/buttonparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/buttonparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/choiceparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/choiceparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/colorparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/colorparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/colortuple_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/colortuple_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/double2dparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/double2dparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/double2dtuple_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/double2dtuple_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/double3dparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/double3dparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/double3dtuple_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/double3dtuple_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/doubleparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/doubleparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/effect_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/effect_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/exprutils_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/exprutils_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/fileparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/fileparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/group_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/group_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/groupparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/groupparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/imagelayer_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/imagelayer_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/int2dparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/int2dparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/int2dtuple_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/int2dtuple_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/int3dparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/int3dparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/int3dtuple_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/int3dtuple_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/intparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/intparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/itembase_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/itembase_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/layer_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/layer_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/natron_enum_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/natron_enum_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/natronengine_module_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/natronengine_python.h delete mode 100644 Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/outputfileparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/outputfileparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/pageparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/pageparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/param_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/param_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/parametricparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/parametricparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/pathparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/pathparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/pycoreapplication_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/pycoreapplication_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/rectd_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/rectd_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/recti_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/recti_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/roto_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/roto_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/separatorparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/separatorparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/stringparam_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/stringparam_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/stringparambase_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/stringparambase_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/track_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/track_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/tracker_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/tracker_wrapper.h delete mode 100644 Engine/Qt5/NatronEngine/userparamholder_wrapper.cpp delete mode 100644 Engine/Qt5/NatronEngine/userparamholder_wrapper.h delete mode 100644 Gui/Qt5/NatronGui/guiapp_wrapper.cpp delete mode 100644 Gui/Qt5/NatronGui/guiapp_wrapper.h delete mode 100644 Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp delete mode 100644 Gui/Qt5/NatronGui/natrongui_python.h delete mode 100644 Gui/Qt5/NatronGui/pyguiapplication_wrapper.cpp delete mode 100644 Gui/Qt5/NatronGui/pyguiapplication_wrapper.h delete mode 100644 Gui/Qt5/NatronGui/pymodaldialog_wrapper.cpp delete mode 100644 Gui/Qt5/NatronGui/pymodaldialog_wrapper.h delete mode 100644 Gui/Qt5/NatronGui/pypanel_wrapper.cpp delete mode 100644 Gui/Qt5/NatronGui/pypanel_wrapper.h delete mode 100644 Gui/Qt5/NatronGui/pytabwidget_wrapper.cpp delete mode 100644 Gui/Qt5/NatronGui/pytabwidget_wrapper.h delete mode 100644 Gui/Qt5/NatronGui/pyviewer_wrapper.cpp delete mode 100644 Gui/Qt5/NatronGui/pyviewer_wrapper.h diff --git a/Engine/Qt5/NatronEngine/animatedparam_wrapper.cpp b/Engine/Qt5/NatronEngine/animatedparam_wrapper.cpp deleted file mode 100644 index 9ab7b7c968..0000000000 --- a/Engine/Qt5/NatronEngine/animatedparam_wrapper.cpp +++ /dev/null @@ -1,1140 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "animatedparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void AnimatedParamWrapper::pysideInitQtMetaTypes() -{ -} - -void AnimatedParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -AnimatedParamWrapper::~AnimatedParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_AnimatedParamFunc_deleteValueAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.deleteValueAtTime(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.deleteValueAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:deleteValueAtTime", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::deleteValueAtTime(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // deleteValueAtTime(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // deleteValueAtTime(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_deleteValueAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.deleteValueAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_AnimatedParamFunc_deleteValueAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // deleteValueAtTime(double,int) - cppSelf->deleteValueAtTime(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_AnimatedParamFunc_deleteValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.deleteValueAtTime"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_getCurrentTime(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCurrentTime()const - int cppResult = const_cast(cppSelf)->getCurrentTime(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AnimatedParamFunc_getDerivativeAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getDerivativeAtTime(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getDerivativeAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:getDerivativeAtTime", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::getDerivativeAtTime(double,int)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // getDerivativeAtTime(double,int)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getDerivativeAtTime(double,int)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_getDerivativeAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getDerivativeAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_AnimatedParamFunc_getDerivativeAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getDerivativeAtTime(double,int)const - double cppResult = const_cast(cppSelf)->getDerivativeAtTime(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_getDerivativeAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.getDerivativeAtTime"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_getExpression(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: AnimatedParam::getExpression(int,bool*)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getExpression(int,bool*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_getExpression_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getExpression(int,bool*)const - // Begin code injection - bool hasRetVar; - QString cppResult = cppSelf->getExpression(cppArg0,&hasRetVar); - pyResult = PyTuple_New(2); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &hasRetVar)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_getExpression_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.AnimatedParam.getExpression"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_getIntegrateFromTimeToTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getIntegrateFromTimeToTime(): too many arguments"); - return {}; - } else if (numArgs < 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getIntegrateFromTimeToTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:getIntegrateFromTimeToTime", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::getIntegrateFromTimeToTime(double,double,int)const - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // getIntegrateFromTimeToTime(double,double,int)const - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // getIntegrateFromTimeToTime(double,double,int)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_getIntegrateFromTimeToTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getIntegrateFromTimeToTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_AnimatedParamFunc_getIntegrateFromTimeToTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2 = 0; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // getIntegrateFromTimeToTime(double,double,int)const - double cppResult = const_cast(cppSelf)->getIntegrateFromTimeToTime(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_getIntegrateFromTimeToTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.getIntegrateFromTimeToTime"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_getIsAnimated(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getIsAnimated(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getIsAnimated", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::getIsAnimated(int)const - if (numArgs == 0) { - overloadId = 0; // getIsAnimated(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getIsAnimated(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_getIsAnimated_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getIsAnimated(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_AnimatedParamFunc_getIsAnimated_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getIsAnimated(int)const - bool cppResult = const_cast(cppSelf)->getIsAnimated(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_getIsAnimated_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.getIsAnimated"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_getKeyIndex(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getKeyIndex(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getKeyIndex(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:getKeyIndex", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::getKeyIndex(double,int)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // getKeyIndex(double,int)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getKeyIndex(double,int)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_getKeyIndex_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getKeyIndex(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_AnimatedParamFunc_getKeyIndex_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getKeyIndex(double,int)const - int cppResult = const_cast(cppSelf)->getKeyIndex(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_getKeyIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.getKeyIndex"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_getKeyTime(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "getKeyTime", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::getKeyTime(int,int,double*)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getKeyTime(int,int,double*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_getKeyTime_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getKeyTime(int,int,double*)const - // Begin code injection - double time; - bool cppResult = cppSelf->getKeyTime(cppArg0, cppArg1,&time); - pyResult = PyTuple_New(2); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &time)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_getKeyTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.getKeyTime"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_getNumKeys(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getNumKeys(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getNumKeys", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::getNumKeys(int)const - if (numArgs == 0) { - overloadId = 0; // getNumKeys(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getNumKeys(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_getNumKeys_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.getNumKeys(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_AnimatedParamFunc_getNumKeys_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getNumKeys(int)const - int cppResult = const_cast(cppSelf)->getNumKeys(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_getNumKeys_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.getNumKeys"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_removeAnimation(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.removeAnimation(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:removeAnimation", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::removeAnimation(int) - if (numArgs == 0) { - overloadId = 0; // removeAnimation(int) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // removeAnimation(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_removeAnimation_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.removeAnimation(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_AnimatedParamFunc_removeAnimation_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // removeAnimation(int) - cppSelf->removeAnimation(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_AnimatedParamFunc_removeAnimation_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.removeAnimation"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_setExpression(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.setExpression(): too many arguments"); - return {}; - } else if (numArgs < 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.setExpression(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:setExpression", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::setExpression(QString,bool,int) - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // setExpression(QString,bool,int) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setExpression(QString,bool,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_setExpression_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.setExpression(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_AnimatedParamFunc_setExpression_TypeError; - } - } - } - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - bool cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2 = 0; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setExpression(QString,bool,int) - // Begin code injection - bool cppResult = cppSelf->setExpression(cppArg0,cppArg1,cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_setExpression_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.setExpression"); - return {}; -} - -static PyObject *Sbk_AnimatedParamFunc_setInterpolationAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.setInterpolationAtTime(): too many arguments"); - return {}; - } else if (numArgs < 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.setInterpolationAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:setInterpolationAtTime", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: AnimatedParam::setInterpolationAtTime(double,NATRON_ENUM::KeyframeTypeEnum,int) - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX])->converter, (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // setInterpolationAtTime(double,NATRON_ENUM::KeyframeTypeEnum,int) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setInterpolationAtTime(double,NATRON_ENUM::KeyframeTypeEnum,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AnimatedParamFunc_setInterpolationAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.AnimatedParam.setInterpolationAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_AnimatedParamFunc_setInterpolationAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::NATRON_ENUM::KeyframeTypeEnum cppArg1{NATRON_ENUM::eKeyframeTypeConstant}; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2 = 0; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setInterpolationAtTime(double,NATRON_ENUM::KeyframeTypeEnum,int) - bool cppResult = cppSelf->setInterpolationAtTime(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AnimatedParamFunc_setInterpolationAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.AnimatedParam.setInterpolationAtTime"); - return {}; -} - - -static const char *Sbk_AnimatedParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_AnimatedParam_methods[] = { - {"deleteValueAtTime", reinterpret_cast(Sbk_AnimatedParamFunc_deleteValueAtTime), METH_VARARGS|METH_KEYWORDS}, - {"getCurrentTime", reinterpret_cast(Sbk_AnimatedParamFunc_getCurrentTime), METH_NOARGS}, - {"getDerivativeAtTime", reinterpret_cast(Sbk_AnimatedParamFunc_getDerivativeAtTime), METH_VARARGS|METH_KEYWORDS}, - {"getExpression", reinterpret_cast(Sbk_AnimatedParamFunc_getExpression), METH_O}, - {"getIntegrateFromTimeToTime", reinterpret_cast(Sbk_AnimatedParamFunc_getIntegrateFromTimeToTime), METH_VARARGS|METH_KEYWORDS}, - {"getIsAnimated", reinterpret_cast(Sbk_AnimatedParamFunc_getIsAnimated), METH_VARARGS|METH_KEYWORDS}, - {"getKeyIndex", reinterpret_cast(Sbk_AnimatedParamFunc_getKeyIndex), METH_VARARGS|METH_KEYWORDS}, - {"getKeyTime", reinterpret_cast(Sbk_AnimatedParamFunc_getKeyTime), METH_VARARGS}, - {"getNumKeys", reinterpret_cast(Sbk_AnimatedParamFunc_getNumKeys), METH_VARARGS|METH_KEYWORDS}, - {"removeAnimation", reinterpret_cast(Sbk_AnimatedParamFunc_removeAnimation), METH_VARARGS|METH_KEYWORDS}, - {"setExpression", reinterpret_cast(Sbk_AnimatedParamFunc_setExpression), METH_VARARGS|METH_KEYWORDS}, - {"setInterpolationAtTime", reinterpret_cast(Sbk_AnimatedParamFunc_setInterpolationAtTime), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_AnimatedParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::AnimatedParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_AnimatedParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_AnimatedParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_AnimatedParam_Type = nullptr; -static SbkObjectType *Sbk_AnimatedParam_TypeF(void) -{ - return _Sbk_AnimatedParam_Type; -} - -static PyType_Slot Sbk_AnimatedParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_AnimatedParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_AnimatedParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_AnimatedParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_AnimatedParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_AnimatedParam_spec = { - "1:NatronEngine.AnimatedParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_AnimatedParam_slots -}; - -} //extern "C" - -static void *Sbk_AnimatedParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::AnimatedParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void AnimatedParam_PythonToCpp_AnimatedParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_AnimatedParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_AnimatedParam_PythonToCpp_AnimatedParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_AnimatedParam_TypeF()))) - return AnimatedParam_PythonToCpp_AnimatedParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *AnimatedParam_PTR_CppToPython_AnimatedParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_AnimatedParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *AnimatedParam_SignatureStrings[] = { - "NatronEngine.AnimatedParam.deleteValueAtTime(self,time:double,dimension:int=0)", - "NatronEngine.AnimatedParam.getCurrentTime(self)->int", - "NatronEngine.AnimatedParam.getDerivativeAtTime(self,time:double,dimension:int=0)->double", - "NatronEngine.AnimatedParam.getExpression(self,dimension:int,hasRetVariable:bool*)->QString", - "NatronEngine.AnimatedParam.getIntegrateFromTimeToTime(self,time1:double,time2:double,dimension:int=0)->double", - "NatronEngine.AnimatedParam.getIsAnimated(self,dimension:int=0)->bool", - "NatronEngine.AnimatedParam.getKeyIndex(self,time:double,dimension:int=0)->int", - "NatronEngine.AnimatedParam.getKeyTime(self,index:int,dimension:int,time:double*)->bool", - "NatronEngine.AnimatedParam.getNumKeys(self,dimension:int=0)->int", - "NatronEngine.AnimatedParam.removeAnimation(self,dimension:int=0)", - "NatronEngine.AnimatedParam.setExpression(self,expr:QString,hasRetVariable:bool,dimension:int=0)->bool", - "NatronEngine.AnimatedParam.setInterpolationAtTime(self,time:double,interpolation:NatronEngine.NATRON_ENUM.KeyframeTypeEnum,dimension:int=0)->bool", - nullptr}; // Sentinel - -void init_AnimatedParam(PyObject *module) -{ - _Sbk_AnimatedParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "AnimatedParam", - "AnimatedParam*", - &Sbk_AnimatedParam_spec, - &Shiboken::callCppDestructor< ::AnimatedParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_AnimatedParam_Type); - InitSignatureStrings(pyType, AnimatedParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_AnimatedParam_Type), Sbk_AnimatedParam_PropertyStrings); - SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX] - = reinterpret_cast(Sbk_AnimatedParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_AnimatedParam_TypeF(), - AnimatedParam_PythonToCpp_AnimatedParam_PTR, - is_AnimatedParam_PythonToCpp_AnimatedParam_PTR_Convertible, - AnimatedParam_PTR_CppToPython_AnimatedParam); - - Shiboken::Conversions::registerConverterName(converter, "AnimatedParam"); - Shiboken::Conversions::registerConverterName(converter, "AnimatedParam*"); - Shiboken::Conversions::registerConverterName(converter, "AnimatedParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::AnimatedParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::AnimatedParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_AnimatedParam_TypeF(), &Sbk_AnimatedParam_typeDiscovery); - - - AnimatedParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/animatedparam_wrapper.h b/Engine/Qt5/NatronEngine/animatedparam_wrapper.h deleted file mode 100644 index 2929bcfc0a..0000000000 --- a/Engine/Qt5/NatronEngine/animatedparam_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_ANIMATEDPARAMWRAPPER_H -#define SBK_ANIMATEDPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_ANIMATEDPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/app_wrapper.cpp b/Engine/Qt5/NatronEngine/app_wrapper.cpp deleted file mode 100644 index ea1c20b45a..0000000000 --- a/Engine/Qt5/NatronEngine/app_wrapper.cpp +++ /dev/null @@ -1,1345 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "app_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void AppWrapper::pysideInitQtMetaTypes() -{ -} - -void AppWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -AppWrapper::~AppWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_AppFunc_addFormat(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::addFormat(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // addFormat(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_addFormat_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // addFormat(QString) - cppSelf->addFormat(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_AppFunc_addFormat_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.addFormat"); - return {}; -} - -static PyObject *Sbk_AppFunc_addProjectLayer(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::addProjectLayer(ImageLayer) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), (pyArg)))) { - overloadId = 0; // addProjectLayer(ImageLayer) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_addProjectLayer_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); - ::ImageLayer *cppArg0 = &cppArg0_local; - if (Shiboken::Conversions::isImplicitConversion(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), pythonToCpp)) - pythonToCpp(pyArg, &cppArg0_local); - else - pythonToCpp(pyArg, &cppArg0); - - - if (!PyErr_Occurred()) { - // addProjectLayer(ImageLayer) - cppSelf->addProjectLayer(*cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_AppFunc_addProjectLayer_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.addProjectLayer"); - return {}; -} - -static PyObject *Sbk_AppFunc_closeProject(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // closeProject() - bool cppResult = cppSelf->closeProject(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_createNode(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createNode(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createNode(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:createNode", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: App::createNode(QString,int,Group*,std::map)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // createNode(QString,int,Group*,std::map)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // createNode(QString,int,Group*,std::map)const - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // createNode(QString,int,Group*,std::map)const - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], (pyArgs[3])))) { - overloadId = 0; // createNode(QString,int,Group*,std::map)const - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_createNode_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","majorVersion"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createNode(): got multiple values for keyword argument 'majorVersion'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_AppFunc_createNode_TypeError; - } - } - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createNode(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[2])))) - goto Sbk_AppFunc_createNode_TypeError; - } - } - keyName = Py_BuildValue("s","props"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createNode(): got multiple values for keyword argument 'props'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], (pyArgs[3])))) - goto Sbk_AppFunc_createNode_TypeError; - } - } - } - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = -1; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - if (!Shiboken::Object::isValid(pyArgs[2])) - return {}; - ::Group *cppArg2 = 0; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - ::std::map cppArg3; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // createNode(QString,int,Group*,std::map)const - // Begin code injection - Effect * cppResult = cppSelf->createNode(cppArg0,cppArg1,cppArg2, cppArg3); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_createNode_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.App.createNode"); - return {}; -} - -static PyObject *Sbk_AppFunc_createReader(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createReader(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createReader(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:createReader", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: App::createReader(QString,Group*,std::map)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // createReader(QString,Group*,std::map)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // createReader(QString,Group*,std::map)const - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], (pyArgs[2])))) { - overloadId = 0; // createReader(QString,Group*,std::map)const - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_createReader_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createReader(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[1])))) - goto Sbk_AppFunc_createReader_TypeError; - } - } - keyName = Py_BuildValue("s","props"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createReader(): got multiple values for keyword argument 'props'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], (pyArgs[2])))) - goto Sbk_AppFunc_createReader_TypeError; - } - } - } - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Group *cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - ::std::map cppArg2; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // createReader(QString,Group*,std::map)const - // Begin code injection - Effect * cppResult = cppSelf->createReader(cppArg0,cppArg1, cppArg2); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_createReader_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.App.createReader"); - return {}; -} - -static PyObject *Sbk_AppFunc_createWriter(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createWriter(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createWriter(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:createWriter", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: App::createWriter(QString,Group*,std::map)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // createWriter(QString,Group*,std::map)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // createWriter(QString,Group*,std::map)const - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], (pyArgs[2])))) { - overloadId = 0; // createWriter(QString,Group*,std::map)const - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_createWriter_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createWriter(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[1])))) - goto Sbk_AppFunc_createWriter_TypeError; - } - } - keyName = Py_BuildValue("s","props"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.createWriter(): got multiple values for keyword argument 'props'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], (pyArgs[2])))) - goto Sbk_AppFunc_createWriter_TypeError; - } - } - } - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Group *cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - ::std::map cppArg2; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // createWriter(QString,Group*,std::map)const - // Begin code injection - Effect * cppResult = cppSelf->createWriter(cppArg0,cppArg1, cppArg2); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_createWriter_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.App.createWriter"); - return {}; -} - -static PyObject *Sbk_AppFunc_getAppID(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getAppID()const - int cppResult = const_cast(cppSelf)->getAppID(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_getProjectParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::getProjectParam(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getProjectParam(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_getProjectParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getProjectParam(QString)const - Param * cppResult = const_cast(cppSelf)->getProjectParam(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_getProjectParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.getProjectParam"); - return {}; -} - -static PyObject *Sbk_AppFunc_getViewNames(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getViewNames()const - std::list cppResult = const_cast(cppSelf)->getViewNames(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_loadProject(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::loadProject(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // loadProject(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_loadProject_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // loadProject(QString) - // Begin code injection - App * cppResult = cppSelf->loadProject(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_APP_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_loadProject_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.loadProject"); - return {}; -} - -static PyObject *Sbk_AppFunc_newProject(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // newProject() - // Begin code injection - App * cppResult = cppSelf->newProject(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_APP_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_render(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.render(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.render(): not enough arguments"); - return {}; - } else if (numArgs == 2) - goto Sbk_AppFunc_render_TypeError; - - if (!PyArg_ParseTuple(args, "|OOOO:render", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: App::render(Effect*,int,int,int) - // 1: App::render(std::list,std::list,std::list,std::list) - if (numArgs >= 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // render(Effect*,int,int,int) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // render(Effect*,int,int,int) - } - } else if (numArgs == 1 - && PyList_Check(pyArgs[0])) { - overloadId = 1; // render(std::list,std::list,std::list,std::list) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_render_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // render(Effect * writeNode, int firstFrame, int lastFrame, int frameStep) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","frameStep"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.App.render(): got multiple values for keyword argument 'frameStep'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_AppFunc_render_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Effect *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - int cppArg3 = 1; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // render(Effect*,int,int,int) - cppSelf->render(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - case 1: // render(const std::list & effects, const std::list & firstFrames, const std::list & lastFrames, const std::list & frameSteps) - { - - if (!PyErr_Occurred()) { - // render(std::list,std::list,std::list,std::list) - // Begin code injection - if (!PyList_Check(pyArgs[1-1])) { - PyErr_SetString(PyExc_TypeError, "tasks must be a list of tuple objects."); - return 0; - } - std::list effects; - - std::list firstFrames; - - std::list lastFrames; - - std::list frameSteps; - - int size = (int)PyList_GET_SIZE(pyArgs[1-1]); - for (int i = 0; i < size; ++i) { - PyObject* tuple = PyList_GET_ITEM(pyArgs[1-1],i); - if (!tuple) { - PyErr_SetString(PyExc_TypeError, "tasks must be a list of tuple objects."); - return 0; - } - - int tupleSize = PyTuple_GET_SIZE(tuple); - if (tupleSize != 4 && tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 or 4 items."); - return 0; - } - ::Effect* writeNode{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), PyTuple_GET_ITEM(tuple, 0), &(writeNode)); - int firstFrame; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(tuple, 1), &(firstFrame)); - int lastFrame; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(tuple, 2), &(lastFrame)); - int frameStep; - if (tupleSize == 4) { - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(tuple, 3), &(frameStep)); - } else { - frameStep = INT_MIN; - } - effects.push_back(writeNode); - firstFrames.push_back(firstFrame); - lastFrames.push_back(lastFrame); - frameSteps.push_back(frameStep); - } - - cppSelf->render(effects,firstFrames,lastFrames, frameSteps); - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_AppFunc_render_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.App.render"); - return {}; -} - -static PyObject *Sbk_AppFunc_resetProject(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // resetProject() - bool cppResult = cppSelf->resetProject(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_saveProject(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::saveProject(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // saveProject(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_saveProject_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // saveProject(QString) - bool cppResult = cppSelf->saveProject(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_saveProject_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.saveProject"); - return {}; -} - -static PyObject *Sbk_AppFunc_saveProjectAs(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::saveProjectAs(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // saveProjectAs(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_saveProjectAs_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // saveProjectAs(QString) - bool cppResult = cppSelf->saveProjectAs(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_saveProjectAs_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.saveProjectAs"); - return {}; -} - -static PyObject *Sbk_AppFunc_saveTempProject(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::saveTempProject(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // saveTempProject(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_saveTempProject_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // saveTempProject(QString) - bool cppResult = cppSelf->saveTempProject(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppFunc_saveTempProject_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.saveTempProject"); - return {}; -} - -static PyObject *Sbk_AppFunc_timelineGetLeftBound(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // timelineGetLeftBound()const - int cppResult = const_cast(cppSelf)->timelineGetLeftBound(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_timelineGetRightBound(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // timelineGetRightBound()const - int cppResult = const_cast(cppSelf)->timelineGetRightBound(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_timelineGetTime(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // timelineGetTime()const - int cppResult = const_cast(cppSelf)->timelineGetTime(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppFunc_writeToScriptEditor(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: App::writeToScriptEditor(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // writeToScriptEditor(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppFunc_writeToScriptEditor_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // writeToScriptEditor(QString) - cppSelf->writeToScriptEditor(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_AppFunc_writeToScriptEditor_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.App.writeToScriptEditor"); - return {}; -} - - -static const char *Sbk_App_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_App_methods[] = { - {"addFormat", reinterpret_cast(Sbk_AppFunc_addFormat), METH_O}, - {"addProjectLayer", reinterpret_cast(Sbk_AppFunc_addProjectLayer), METH_O}, - {"closeProject", reinterpret_cast(Sbk_AppFunc_closeProject), METH_NOARGS}, - {"createNode", reinterpret_cast(Sbk_AppFunc_createNode), METH_VARARGS|METH_KEYWORDS}, - {"createReader", reinterpret_cast(Sbk_AppFunc_createReader), METH_VARARGS|METH_KEYWORDS}, - {"createWriter", reinterpret_cast(Sbk_AppFunc_createWriter), METH_VARARGS|METH_KEYWORDS}, - {"getAppID", reinterpret_cast(Sbk_AppFunc_getAppID), METH_NOARGS}, - {"getProjectParam", reinterpret_cast(Sbk_AppFunc_getProjectParam), METH_O}, - {"getViewNames", reinterpret_cast(Sbk_AppFunc_getViewNames), METH_NOARGS}, - {"loadProject", reinterpret_cast(Sbk_AppFunc_loadProject), METH_O}, - {"newProject", reinterpret_cast(Sbk_AppFunc_newProject), METH_NOARGS}, - {"render", reinterpret_cast(Sbk_AppFunc_render), METH_VARARGS|METH_KEYWORDS}, - {"resetProject", reinterpret_cast(Sbk_AppFunc_resetProject), METH_NOARGS}, - {"saveProject", reinterpret_cast(Sbk_AppFunc_saveProject), METH_O}, - {"saveProjectAs", reinterpret_cast(Sbk_AppFunc_saveProjectAs), METH_O}, - {"saveTempProject", reinterpret_cast(Sbk_AppFunc_saveTempProject), METH_O}, - {"timelineGetLeftBound", reinterpret_cast(Sbk_AppFunc_timelineGetLeftBound), METH_NOARGS}, - {"timelineGetRightBound", reinterpret_cast(Sbk_AppFunc_timelineGetRightBound), METH_NOARGS}, - {"timelineGetTime", reinterpret_cast(Sbk_AppFunc_timelineGetTime), METH_NOARGS}, - {"writeToScriptEditor", reinterpret_cast(Sbk_AppFunc_writeToScriptEditor), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_App_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::App *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APP_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_App_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_App_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_App_Type = nullptr; -static SbkObjectType *Sbk_App_TypeF(void) -{ - return _Sbk_App_Type; -} - -static PyType_Slot Sbk_App_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_App_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_App_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_App_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_App_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_App_spec = { - "1:NatronEngine.App", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_App_slots -}; - -} //extern "C" - -static void *Sbk_App_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Group >())) - return dynamic_cast< ::App *>(reinterpret_cast< ::Group *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void App_PythonToCpp_App_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_App_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_App_PythonToCpp_App_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_App_TypeF()))) - return App_PythonToCpp_App_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *App_PTR_CppToPython_App(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_App_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *App_SignatureStrings[] = { - "NatronEngine.App.addFormat(self,formatSpec:QString)", - "NatronEngine.App.addProjectLayer(self,layer:NatronEngine.ImageLayer)", - "NatronEngine.App.closeProject(self)->bool", - "NatronEngine.App.createNode(self,pluginID:QString,majorVersion:int=-1,group:NatronEngine.Group=0,props:std.map[QString, NatronEngine.NodeCreationProperty]=NodeCreationPropertyMap())->NatronEngine.Effect", - "NatronEngine.App.createReader(self,filename:QString,group:NatronEngine.Group=0,props:std.map[QString, NatronEngine.NodeCreationProperty]=NodeCreationPropertyMap())->NatronEngine.Effect", - "NatronEngine.App.createWriter(self,filename:QString,group:NatronEngine.Group=0,props:std.map[QString, NatronEngine.NodeCreationProperty]=NodeCreationPropertyMap())->NatronEngine.Effect", - "NatronEngine.App.getAppID(self)->int", - "NatronEngine.App.getProjectParam(self,name:QString)->NatronEngine.Param", - "NatronEngine.App.getViewNames(self)->std.list[QString]", - "NatronEngine.App.loadProject(self,filename:QString)->NatronEngine.App", - "NatronEngine.App.newProject(self)->NatronEngine.App", - "1:NatronEngine.App.render(self,writeNode:NatronEngine.Effect,firstFrame:int,lastFrame:int,frameStep:int=1)", - "0:NatronEngine.App.render(self,effects:std.list[NatronEngine.Effect],firstFrames:std.list[int],lastFrames:std.list[int],frameSteps:std.list[int])", - "NatronEngine.App.resetProject(self)->bool", - "NatronEngine.App.saveProject(self,filename:QString)->bool", - "NatronEngine.App.saveProjectAs(self,filename:QString)->bool", - "NatronEngine.App.saveTempProject(self,filename:QString)->bool", - "NatronEngine.App.timelineGetLeftBound(self)->int", - "NatronEngine.App.timelineGetRightBound(self)->int", - "NatronEngine.App.timelineGetTime(self)->int", - "NatronEngine.App.writeToScriptEditor(self,message:QString)", - nullptr}; // Sentinel - -void init_App(PyObject *module) -{ - _Sbk_App_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "App", - "App*", - &Sbk_App_spec, - &Shiboken::callCppDestructor< ::App >, - reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_App_Type); - InitSignatureStrings(pyType, App_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_App_Type), Sbk_App_PropertyStrings); - SbkNatronEngineTypes[SBK_APP_IDX] - = reinterpret_cast(Sbk_App_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_App_TypeF(), - App_PythonToCpp_App_PTR, - is_App_PythonToCpp_App_PTR_Convertible, - App_PTR_CppToPython_App); - - Shiboken::Conversions::registerConverterName(converter, "App"); - Shiboken::Conversions::registerConverterName(converter, "App*"); - Shiboken::Conversions::registerConverterName(converter, "App&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::App).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::AppWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_App_TypeF(), &Sbk_App_typeDiscovery); - - - AppWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/app_wrapper.h b/Engine/Qt5/NatronEngine/app_wrapper.h deleted file mode 100644 index 82ea5d6840..0000000000 --- a/Engine/Qt5/NatronEngine/app_wrapper.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef SBK_APPWRAPPER_H -#define SBK_APPWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AppWrapper : public App -{ -public: - inline void renderInternal_protected(bool forceBlocking, Effect * writeNode, int firstFrame, int lastFrame, int frameStep) { App::renderInternal(forceBlocking, writeNode, firstFrame, lastFrame, frameStep); } - inline void renderInternal_protected(bool forceBlocking, const std::list & effects, const std::list & firstFrames, const std::list & lastFrames, const std::list & frameSteps) { App::renderInternal(forceBlocking, effects, firstFrames, lastFrames, frameSteps); } - ~AppWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_GROUPWRAPPER_H -# define SBK_GROUPWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class GroupWrapper : public Group -{ -public: - GroupWrapper(); - ~GroupWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_GROUPWRAPPER_H - -#endif // SBK_APPWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/appsettings_wrapper.cpp b/Engine/Qt5/NatronEngine/appsettings_wrapper.cpp deleted file mode 100644 index bddd22bcd2..0000000000 --- a/Engine/Qt5/NatronEngine/appsettings_wrapper.cpp +++ /dev/null @@ -1,340 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "appsettings_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Extra includes -#include -#include - - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_AppSettingsFunc_getParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::AppSettings *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APPSETTINGS_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: AppSettings::getParam(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getParam(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_AppSettingsFunc_getParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getParam(QString)const - Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_AppSettingsFunc_getParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.AppSettings.getParam"); - return {}; -} - -static PyObject *Sbk_AppSettingsFunc_getParams(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::AppSettings *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APPSETTINGS_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getParams()const - // Begin code injection - std::list params = cppSelf->getParams(); - PyObject* ret = PyList_New((int) params.size()); - int idx = 0; - for (std::list::iterator it = params.begin(); it!=params.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_AppSettingsFunc_restoreDefaultSettings(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::AppSettings *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APPSETTINGS_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // restoreDefaultSettings() - cppSelf->restoreDefaultSettings(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_AppSettingsFunc_saveSettings(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::AppSettings *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_APPSETTINGS_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // saveSettings() - cppSelf->saveSettings(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - - -static const char *Sbk_AppSettings_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_AppSettings_methods[] = { - {"getParam", reinterpret_cast(Sbk_AppSettingsFunc_getParam), METH_O}, - {"getParams", reinterpret_cast(Sbk_AppSettingsFunc_getParams), METH_NOARGS}, - {"restoreDefaultSettings", reinterpret_cast(Sbk_AppSettingsFunc_restoreDefaultSettings), METH_NOARGS}, - {"saveSettings", reinterpret_cast(Sbk_AppSettingsFunc_saveSettings), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_AppSettings_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_AppSettings_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_AppSettings_Type = nullptr; -static SbkObjectType *Sbk_AppSettings_TypeF(void) -{ - return _Sbk_AppSettings_Type; -} - -static PyType_Slot Sbk_AppSettings_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_AppSettings_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_AppSettings_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_AppSettings_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_AppSettings_spec = { - "1:NatronEngine.AppSettings", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_AppSettings_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void AppSettings_PythonToCpp_AppSettings_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_AppSettings_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_AppSettings_PythonToCpp_AppSettings_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_AppSettings_TypeF()))) - return AppSettings_PythonToCpp_AppSettings_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *AppSettings_PTR_CppToPython_AppSettings(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_AppSettings_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *AppSettings_SignatureStrings[] = { - "NatronEngine.AppSettings.getParam(self,scriptName:QString)->NatronEngine.Param", - "NatronEngine.AppSettings.getParams(self)->std.list[NatronEngine.Param]", - "NatronEngine.AppSettings.restoreDefaultSettings(self)", - "NatronEngine.AppSettings.saveSettings(self)", - nullptr}; // Sentinel - -void init_AppSettings(PyObject *module) -{ - _Sbk_AppSettings_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "AppSettings", - "AppSettings*", - &Sbk_AppSettings_spec, - &Shiboken::callCppDestructor< ::AppSettings >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_AppSettings_Type); - InitSignatureStrings(pyType, AppSettings_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_AppSettings_Type), Sbk_AppSettings_PropertyStrings); - SbkNatronEngineTypes[SBK_APPSETTINGS_IDX] - = reinterpret_cast(Sbk_AppSettings_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_AppSettings_TypeF(), - AppSettings_PythonToCpp_AppSettings_PTR, - is_AppSettings_PythonToCpp_AppSettings_PTR_Convertible, - AppSettings_PTR_CppToPython_AppSettings); - - Shiboken::Conversions::registerConverterName(converter, "AppSettings"); - Shiboken::Conversions::registerConverterName(converter, "AppSettings*"); - Shiboken::Conversions::registerConverterName(converter, "AppSettings&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::AppSettings).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/appsettings_wrapper.h b/Engine/Qt5/NatronEngine/appsettings_wrapper.h deleted file mode 100644 index a2af92a0c0..0000000000 --- a/Engine/Qt5/NatronEngine/appsettings_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_APPSETTINGS_H -#define SBK_APPSETTINGS_H - -#include - -#endif // SBK_APPSETTINGS_H - diff --git a/Engine/Qt5/NatronEngine/beziercurve_wrapper.cpp b/Engine/Qt5/NatronEngine/beziercurve_wrapper.cpp deleted file mode 100644 index 2a857ab885..0000000000 --- a/Engine/Qt5/NatronEngine/beziercurve_wrapper.cpp +++ /dev/null @@ -1,1918 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "beziercurve_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void BezierCurveWrapper::pysideInitQtMetaTypes() -{ -} - -void BezierCurveWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -BezierCurveWrapper::~BezierCurveWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_BezierCurveFunc_addControlPoint(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addControlPoint", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::addControlPoint(double,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // addControlPoint(double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_addControlPoint_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // addControlPoint(double,double) - cppSelf->addControlPoint(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_addControlPoint_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.addControlPoint"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_addControlPointOnSegment(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addControlPointOnSegment", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::addControlPointOnSegment(int,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // addControlPointOnSegment(int,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_addControlPointOnSegment_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // addControlPointOnSegment(int,double) - cppSelf->addControlPointOnSegment(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_addControlPointOnSegment_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.addControlPointOnSegment"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getActivatedParam(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getActivatedParam()const - BooleanParam * cppResult = const_cast(cppSelf)->getActivatedParam(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getColor(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::getColor(double) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getColor(double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_getColor_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getColor(double) - ColorTuple* cppResult = new ColorTuple(cppSelf->getColor(cppArg0)); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]), cppResult, true, true); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BezierCurveFunc_getColor_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.getColor"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getColorParam(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getColorParam()const - ColorParam * cppResult = const_cast(cppSelf)->getColorParam(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getCompositingOperator(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCompositingOperator()const - NATRON_ENUM::MergingFunctionEnum cppResult = NATRON_ENUM::MergingFunctionEnum(const_cast(cppSelf)->getCompositingOperator()); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getCompositingOperatorParam(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCompositingOperatorParam()const - ChoiceParam * cppResult = const_cast(cppSelf)->getCompositingOperatorParam(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getControlPointPosition(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "getControlPointPosition", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::getControlPointPosition(int,double,double*,double*,double*,double*,double*,double*)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getControlPointPosition(int,double,double*,double*,double*,double*,double*,double*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_getControlPointPosition_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getControlPointPosition(int,double,double*,double*,double*,double*,double*,double*)const - // Begin code injection - double x,y,rx,ry,lx,ly; - cppSelf->getControlPointPosition(cppArg0, cppArg1, &x,&y, &lx,&ly,&rx,&ry); - - PyObject* ret = PyTuple_New(6); - PyTuple_SET_ITEM(ret, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &x)); - PyTuple_SET_ITEM(ret, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &y)); - PyTuple_SET_ITEM(ret, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &lx)); - PyTuple_SET_ITEM(ret, 3, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ly)); - PyTuple_SET_ITEM(ret, 4, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &rx)); - PyTuple_SET_ITEM(ret, 5, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ry)); - return ret; - - // End of code injection - - pyResult = Py_None; - Py_INCREF(Py_None); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BezierCurveFunc_getControlPointPosition_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.getControlPointPosition"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getFeatherDistance(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::getFeatherDistance(double)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getFeatherDistance(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_getFeatherDistance_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getFeatherDistance(double)const - double cppResult = const_cast(cppSelf)->getFeatherDistance(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BezierCurveFunc_getFeatherDistance_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.getFeatherDistance"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getFeatherDistanceParam(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getFeatherDistanceParam()const - DoubleParam * cppResult = const_cast(cppSelf)->getFeatherDistanceParam(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getFeatherFallOff(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::getFeatherFallOff(double)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getFeatherFallOff(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_getFeatherFallOff_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getFeatherFallOff(double)const - double cppResult = const_cast(cppSelf)->getFeatherFallOff(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BezierCurveFunc_getFeatherFallOff_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.getFeatherFallOff"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getFeatherFallOffParam(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getFeatherFallOffParam()const - DoubleParam * cppResult = const_cast(cppSelf)->getFeatherFallOffParam(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getFeatherPointPosition(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "getFeatherPointPosition", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::getFeatherPointPosition(int,double,double*,double*,double*,double*,double*,double*)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getFeatherPointPosition(int,double,double*,double*,double*,double*,double*,double*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_getFeatherPointPosition_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getFeatherPointPosition(int,double,double*,double*,double*,double*,double*,double*)const - // Begin code injection - double x,y,rx,ry,lx,ly; - cppSelf->getFeatherPointPosition(cppArg0, cppArg1, &x,&y, &lx,&ly,&rx,&ry); - - PyObject* ret = PyTuple_New(6); - PyTuple_SET_ITEM(ret, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &x)); - PyTuple_SET_ITEM(ret, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &y)); - PyTuple_SET_ITEM(ret, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &lx)); - PyTuple_SET_ITEM(ret, 3, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ly)); - PyTuple_SET_ITEM(ret, 4, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &rx)); - PyTuple_SET_ITEM(ret, 5, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ry)); - return ret; - - // End of code injection - - pyResult = Py_None; - Py_INCREF(Py_None); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BezierCurveFunc_getFeatherPointPosition_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.getFeatherPointPosition"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getIsActivated(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::getIsActivated(double) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getIsActivated(double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_getIsActivated_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getIsActivated(double) - bool cppResult = cppSelf->getIsActivated(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BezierCurveFunc_getIsActivated_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.getIsActivated"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getKeyframes(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getKeyframes(std::list*)const - // Begin code injection - std::list keys; - cppSelf->getKeyframes(&keys); - PyObject* ret = PyList_New((int) keys.size()); - int idx = 0; - for (std::list::iterator it = keys.begin(); it!=keys.end(); ++it,++idx) { - PyList_SET_ITEM(ret, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &*it)); - } - return ret; - - // End of code injection - - pyResult = Py_None; - Py_INCREF(Py_None); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getNumControlPoints(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNumControlPoints()const - int cppResult = const_cast(cppSelf)->getNumControlPoints(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getOpacity(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::getOpacity(double)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getOpacity(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_getOpacity_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getOpacity(double)const - double cppResult = const_cast(cppSelf)->getOpacity(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BezierCurveFunc_getOpacity_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.getOpacity"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_getOpacityParam(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getOpacityParam()const - DoubleParam * cppResult = const_cast(cppSelf)->getOpacityParam(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_getOverlayColor(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getOverlayColor()const - ColorTuple* cppResult = new ColorTuple(const_cast(cppSelf)->getOverlayColor()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]), cppResult, true, true); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_isCurveFinished(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isCurveFinished()const - bool cppResult = const_cast(cppSelf)->isCurveFinished(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BezierCurveFunc_moveFeatherByIndex(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "moveFeatherByIndex", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::moveFeatherByIndex(int,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // moveFeatherByIndex(int,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_moveFeatherByIndex_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // moveFeatherByIndex(int,double,double,double) - cppSelf->moveFeatherByIndex(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_moveFeatherByIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.moveFeatherByIndex"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_moveLeftBezierPoint(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "moveLeftBezierPoint", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::moveLeftBezierPoint(int,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // moveLeftBezierPoint(int,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_moveLeftBezierPoint_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // moveLeftBezierPoint(int,double,double,double) - cppSelf->moveLeftBezierPoint(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_moveLeftBezierPoint_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.moveLeftBezierPoint"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_movePointByIndex(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "movePointByIndex", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::movePointByIndex(int,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // movePointByIndex(int,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_movePointByIndex_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // movePointByIndex(int,double,double,double) - cppSelf->movePointByIndex(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_movePointByIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.movePointByIndex"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_moveRightBezierPoint(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "moveRightBezierPoint", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::moveRightBezierPoint(int,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // moveRightBezierPoint(int,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_moveRightBezierPoint_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // moveRightBezierPoint(int,double,double,double) - cppSelf->moveRightBezierPoint(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_moveRightBezierPoint_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.moveRightBezierPoint"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_removeControlPointByIndex(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::removeControlPointByIndex(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // removeControlPointByIndex(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_removeControlPointByIndex_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // removeControlPointByIndex(int) - cppSelf->removeControlPointByIndex(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_removeControlPointByIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.removeControlPointByIndex"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setActivated(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setActivated", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setActivated(double,bool) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setActivated(double,bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setActivated_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - bool cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setActivated(double,bool) - cppSelf->setActivated(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setActivated_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setActivated"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setColor(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setColor", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setColor(double,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // setColor(double,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setColor_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // setColor(double,double,double,double) - cppSelf->setColor(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setColor_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setColor"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setCompositingOperator(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::setCompositingOperator(NATRON_ENUM::MergingFunctionEnum) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX])->converter, (pyArg)))) { - overloadId = 0; // setCompositingOperator(NATRON_ENUM::MergingFunctionEnum) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setCompositingOperator_TypeError; - - // Call function/method - { - ::NATRON_ENUM::MergingFunctionEnum cppArg0{NATRON_ENUM::eMergeATop}; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setCompositingOperator(NATRON_ENUM::MergingFunctionEnum) - cppSelf->setCompositingOperator(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setCompositingOperator_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.setCompositingOperator"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setCurveFinished(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BezierCurve::setCurveFinished(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setCurveFinished(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setCurveFinished_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setCurveFinished(bool) - cppSelf->setCurveFinished(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setCurveFinished_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BezierCurve.setCurveFinished"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setFeatherDistance(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setFeatherDistance", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setFeatherDistance(double,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setFeatherDistance(double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setFeatherDistance_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setFeatherDistance(double,double) - cppSelf->setFeatherDistance(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setFeatherDistance_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setFeatherDistance"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setFeatherFallOff(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setFeatherFallOff", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setFeatherFallOff(double,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setFeatherFallOff(double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setFeatherFallOff_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setFeatherFallOff(double,double) - cppSelf->setFeatherFallOff(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setFeatherFallOff_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setFeatherFallOff"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setFeatherPointAtIndex(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0, 0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setFeatherPointAtIndex", 8, 8, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]), &(pyArgs[5]), &(pyArgs[6]), &(pyArgs[7]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setFeatherPointAtIndex(int,double,double,double,double,double,double,double) - if (numArgs == 8 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3]))) - && (pythonToCpp[4] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[4]))) - && (pythonToCpp[5] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[5]))) - && (pythonToCpp[6] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[6]))) - && (pythonToCpp[7] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[7])))) { - overloadId = 0; // setFeatherPointAtIndex(int,double,double,double,double,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setFeatherPointAtIndex_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - double cppArg4; - pythonToCpp[4](pyArgs[4], &cppArg4); - double cppArg5; - pythonToCpp[5](pyArgs[5], &cppArg5); - double cppArg6; - pythonToCpp[6](pyArgs[6], &cppArg6); - double cppArg7; - pythonToCpp[7](pyArgs[7], &cppArg7); - - if (!PyErr_Occurred()) { - // setFeatherPointAtIndex(int,double,double,double,double,double,double,double) - cppSelf->setFeatherPointAtIndex(cppArg0, cppArg1, cppArg2, cppArg3, cppArg4, cppArg5, cppArg6, cppArg7); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setFeatherPointAtIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setFeatherPointAtIndex"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setOpacity(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setOpacity", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setOpacity(double,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setOpacity(double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setOpacity_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setOpacity(double,double) - cppSelf->setOpacity(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setOpacity_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setOpacity"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setOverlayColor(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setOverlayColor", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setOverlayColor(double,double,double) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setOverlayColor(double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setOverlayColor_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setOverlayColor(double,double,double) - cppSelf->setOverlayColor(cppArg0, cppArg1, cppArg2); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setOverlayColor_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setOverlayColor"); - return {}; -} - -static PyObject *Sbk_BezierCurveFunc_setPointAtIndex(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0, 0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setPointAtIndex", 8, 8, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]), &(pyArgs[5]), &(pyArgs[6]), &(pyArgs[7]))) - return {}; - - - // Overloaded function decisor - // 0: BezierCurve::setPointAtIndex(int,double,double,double,double,double,double,double) - if (numArgs == 8 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3]))) - && (pythonToCpp[4] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[4]))) - && (pythonToCpp[5] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[5]))) - && (pythonToCpp[6] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[6]))) - && (pythonToCpp[7] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[7])))) { - overloadId = 0; // setPointAtIndex(int,double,double,double,double,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BezierCurveFunc_setPointAtIndex_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - double cppArg4; - pythonToCpp[4](pyArgs[4], &cppArg4); - double cppArg5; - pythonToCpp[5](pyArgs[5], &cppArg5); - double cppArg6; - pythonToCpp[6](pyArgs[6], &cppArg6); - double cppArg7; - pythonToCpp[7](pyArgs[7], &cppArg7); - - if (!PyErr_Occurred()) { - // setPointAtIndex(int,double,double,double,double,double,double,double) - cppSelf->setPointAtIndex(cppArg0, cppArg1, cppArg2, cppArg3, cppArg4, cppArg5, cppArg6, cppArg7); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BezierCurveFunc_setPointAtIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BezierCurve.setPointAtIndex"); - return {}; -} - - -static const char *Sbk_BezierCurve_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_BezierCurve_methods[] = { - {"addControlPoint", reinterpret_cast(Sbk_BezierCurveFunc_addControlPoint), METH_VARARGS}, - {"addControlPointOnSegment", reinterpret_cast(Sbk_BezierCurveFunc_addControlPointOnSegment), METH_VARARGS}, - {"getActivatedParam", reinterpret_cast(Sbk_BezierCurveFunc_getActivatedParam), METH_NOARGS}, - {"getColor", reinterpret_cast(Sbk_BezierCurveFunc_getColor), METH_O}, - {"getColorParam", reinterpret_cast(Sbk_BezierCurveFunc_getColorParam), METH_NOARGS}, - {"getCompositingOperator", reinterpret_cast(Sbk_BezierCurveFunc_getCompositingOperator), METH_NOARGS}, - {"getCompositingOperatorParam", reinterpret_cast(Sbk_BezierCurveFunc_getCompositingOperatorParam), METH_NOARGS}, - {"getControlPointPosition", reinterpret_cast(Sbk_BezierCurveFunc_getControlPointPosition), METH_VARARGS}, - {"getFeatherDistance", reinterpret_cast(Sbk_BezierCurveFunc_getFeatherDistance), METH_O}, - {"getFeatherDistanceParam", reinterpret_cast(Sbk_BezierCurveFunc_getFeatherDistanceParam), METH_NOARGS}, - {"getFeatherFallOff", reinterpret_cast(Sbk_BezierCurveFunc_getFeatherFallOff), METH_O}, - {"getFeatherFallOffParam", reinterpret_cast(Sbk_BezierCurveFunc_getFeatherFallOffParam), METH_NOARGS}, - {"getFeatherPointPosition", reinterpret_cast(Sbk_BezierCurveFunc_getFeatherPointPosition), METH_VARARGS}, - {"getIsActivated", reinterpret_cast(Sbk_BezierCurveFunc_getIsActivated), METH_O}, - {"getKeyframes", reinterpret_cast(Sbk_BezierCurveFunc_getKeyframes), METH_NOARGS}, - {"getNumControlPoints", reinterpret_cast(Sbk_BezierCurveFunc_getNumControlPoints), METH_NOARGS}, - {"getOpacity", reinterpret_cast(Sbk_BezierCurveFunc_getOpacity), METH_O}, - {"getOpacityParam", reinterpret_cast(Sbk_BezierCurveFunc_getOpacityParam), METH_NOARGS}, - {"getOverlayColor", reinterpret_cast(Sbk_BezierCurveFunc_getOverlayColor), METH_NOARGS}, - {"isCurveFinished", reinterpret_cast(Sbk_BezierCurveFunc_isCurveFinished), METH_NOARGS}, - {"moveFeatherByIndex", reinterpret_cast(Sbk_BezierCurveFunc_moveFeatherByIndex), METH_VARARGS}, - {"moveLeftBezierPoint", reinterpret_cast(Sbk_BezierCurveFunc_moveLeftBezierPoint), METH_VARARGS}, - {"movePointByIndex", reinterpret_cast(Sbk_BezierCurveFunc_movePointByIndex), METH_VARARGS}, - {"moveRightBezierPoint", reinterpret_cast(Sbk_BezierCurveFunc_moveRightBezierPoint), METH_VARARGS}, - {"removeControlPointByIndex", reinterpret_cast(Sbk_BezierCurveFunc_removeControlPointByIndex), METH_O}, - {"setActivated", reinterpret_cast(Sbk_BezierCurveFunc_setActivated), METH_VARARGS}, - {"setColor", reinterpret_cast(Sbk_BezierCurveFunc_setColor), METH_VARARGS}, - {"setCompositingOperator", reinterpret_cast(Sbk_BezierCurveFunc_setCompositingOperator), METH_O}, - {"setCurveFinished", reinterpret_cast(Sbk_BezierCurveFunc_setCurveFinished), METH_O}, - {"setFeatherDistance", reinterpret_cast(Sbk_BezierCurveFunc_setFeatherDistance), METH_VARARGS}, - {"setFeatherFallOff", reinterpret_cast(Sbk_BezierCurveFunc_setFeatherFallOff), METH_VARARGS}, - {"setFeatherPointAtIndex", reinterpret_cast(Sbk_BezierCurveFunc_setFeatherPointAtIndex), METH_VARARGS}, - {"setOpacity", reinterpret_cast(Sbk_BezierCurveFunc_setOpacity), METH_VARARGS}, - {"setOverlayColor", reinterpret_cast(Sbk_BezierCurveFunc_setOverlayColor), METH_VARARGS}, - {"setPointAtIndex", reinterpret_cast(Sbk_BezierCurveFunc_setPointAtIndex), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_BezierCurve_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::BezierCurve *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_BezierCurve_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_BezierCurve_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_BezierCurve_Type = nullptr; -static SbkObjectType *Sbk_BezierCurve_TypeF(void) -{ - return _Sbk_BezierCurve_Type; -} - -static PyType_Slot Sbk_BezierCurve_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_BezierCurve_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_BezierCurve_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_BezierCurve_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_BezierCurve_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_BezierCurve_spec = { - "1:NatronEngine.BezierCurve", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_BezierCurve_slots -}; - -} //extern "C" - -static void *Sbk_BezierCurve_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::ItemBase >())) - return dynamic_cast< ::BezierCurve *>(reinterpret_cast< ::ItemBase *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void BezierCurve_PythonToCpp_BezierCurve_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_BezierCurve_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_BezierCurve_PythonToCpp_BezierCurve_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_BezierCurve_TypeF()))) - return BezierCurve_PythonToCpp_BezierCurve_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *BezierCurve_PTR_CppToPython_BezierCurve(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_BezierCurve_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *BezierCurve_SignatureStrings[] = { - "NatronEngine.BezierCurve.addControlPoint(self,x:double,y:double)", - "NatronEngine.BezierCurve.addControlPointOnSegment(self,index:int,t:double)", - "NatronEngine.BezierCurve.getActivatedParam(self)->NatronEngine.BooleanParam", - "NatronEngine.BezierCurve.getColor(self,time:double)->NatronEngine.ColorTuple", - "NatronEngine.BezierCurve.getColorParam(self)->NatronEngine.ColorParam", - "NatronEngine.BezierCurve.getCompositingOperator(self)->NatronEngine.NATRON_ENUM.MergingFunctionEnum", - "NatronEngine.BezierCurve.getCompositingOperatorParam(self)->NatronEngine.ChoiceParam", - "NatronEngine.BezierCurve.getControlPointPosition(self,index:int,time:double,x:double*,y:double*,lx:double*,ly:double*,rx:double*,ry:double*)", - "NatronEngine.BezierCurve.getFeatherDistance(self,time:double)->double", - "NatronEngine.BezierCurve.getFeatherDistanceParam(self)->NatronEngine.DoubleParam", - "NatronEngine.BezierCurve.getFeatherFallOff(self,time:double)->double", - "NatronEngine.BezierCurve.getFeatherFallOffParam(self)->NatronEngine.DoubleParam", - "NatronEngine.BezierCurve.getFeatherPointPosition(self,index:int,time:double,x:double*,y:double*,lx:double*,ly:double*,rx:double*,ry:double*)", - "NatronEngine.BezierCurve.getIsActivated(self,time:double)->bool", - "NatronEngine.BezierCurve.getKeyframes(self,keys:std.list[double])", - "NatronEngine.BezierCurve.getNumControlPoints(self)->int", - "NatronEngine.BezierCurve.getOpacity(self,time:double)->double", - "NatronEngine.BezierCurve.getOpacityParam(self)->NatronEngine.DoubleParam", - "NatronEngine.BezierCurve.getOverlayColor(self)->NatronEngine.ColorTuple", - "NatronEngine.BezierCurve.isCurveFinished(self)->bool", - "NatronEngine.BezierCurve.moveFeatherByIndex(self,index:int,time:double,dx:double,dy:double)", - "NatronEngine.BezierCurve.moveLeftBezierPoint(self,index:int,time:double,dx:double,dy:double)", - "NatronEngine.BezierCurve.movePointByIndex(self,index:int,time:double,dx:double,dy:double)", - "NatronEngine.BezierCurve.moveRightBezierPoint(self,index:int,time:double,dx:double,dy:double)", - "NatronEngine.BezierCurve.removeControlPointByIndex(self,index:int)", - "NatronEngine.BezierCurve.setActivated(self,time:double,activated:bool)", - "NatronEngine.BezierCurve.setColor(self,time:double,r:double,g:double,b:double)", - "NatronEngine.BezierCurve.setCompositingOperator(self,op:NatronEngine.NATRON_ENUM.MergingFunctionEnum)", - "NatronEngine.BezierCurve.setCurveFinished(self,finished:bool)", - "NatronEngine.BezierCurve.setFeatherDistance(self,dist:double,time:double)", - "NatronEngine.BezierCurve.setFeatherFallOff(self,falloff:double,time:double)", - "NatronEngine.BezierCurve.setFeatherPointAtIndex(self,index:int,time:double,x:double,y:double,lx:double,ly:double,rx:double,ry:double)", - "NatronEngine.BezierCurve.setOpacity(self,opacity:double,time:double)", - "NatronEngine.BezierCurve.setOverlayColor(self,r:double,g:double,b:double)", - "NatronEngine.BezierCurve.setPointAtIndex(self,index:int,time:double,x:double,y:double,lx:double,ly:double,rx:double,ry:double)", - nullptr}; // Sentinel - -void init_BezierCurve(PyObject *module) -{ - _Sbk_BezierCurve_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "BezierCurve", - "BezierCurve*", - &Sbk_BezierCurve_spec, - &Shiboken::callCppDestructor< ::BezierCurve >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_BezierCurve_Type); - InitSignatureStrings(pyType, BezierCurve_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_BezierCurve_Type), Sbk_BezierCurve_PropertyStrings); - SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX] - = reinterpret_cast(Sbk_BezierCurve_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_BezierCurve_TypeF(), - BezierCurve_PythonToCpp_BezierCurve_PTR, - is_BezierCurve_PythonToCpp_BezierCurve_PTR_Convertible, - BezierCurve_PTR_CppToPython_BezierCurve); - - Shiboken::Conversions::registerConverterName(converter, "BezierCurve"); - Shiboken::Conversions::registerConverterName(converter, "BezierCurve*"); - Shiboken::Conversions::registerConverterName(converter, "BezierCurve&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::BezierCurve).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::BezierCurveWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_BezierCurve_TypeF(), &Sbk_BezierCurve_typeDiscovery); - - - BezierCurveWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/beziercurve_wrapper.h b/Engine/Qt5/NatronEngine/beziercurve_wrapper.h deleted file mode 100644 index 33cb411b90..0000000000 --- a/Engine/Qt5/NatronEngine/beziercurve_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_BEZIERCURVEWRAPPER_H -#define SBK_BEZIERCURVEWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class BezierCurveWrapper : public BezierCurve -{ -public: - ~BezierCurveWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ITEMBASEWRAPPER_H -# define SBK_ITEMBASEWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ItemBaseWrapper : public ItemBase -{ -public: - ~ItemBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ITEMBASEWRAPPER_H - -#endif // SBK_BEZIERCURVEWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/booleanparam_wrapper.cpp b/Engine/Qt5/NatronEngine/booleanparam_wrapper.cpp deleted file mode 100644 index 7f046488c8..0000000000 --- a/Engine/Qt5/NatronEngine/booleanparam_wrapper.cpp +++ /dev/null @@ -1,716 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "booleanparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void BooleanParamWrapper::pysideInitQtMetaTypes() -{ -} - -void BooleanParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -BooleanParamWrapper::~BooleanParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_BooleanParamFunc_addAsDependencyOf(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addAsDependencyOf", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: BooleanParam::addAsDependencyOf(int,Param*,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // addAsDependencyOf(int,Param*,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BooleanParamFunc_addAsDependencyOf_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Param *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // addAsDependencyOf(int,Param*,int) - bool cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BooleanParamFunc_addAsDependencyOf_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BooleanParam.addAsDependencyOf"); - return {}; -} - -static PyObject *Sbk_BooleanParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: BooleanParam::get()const - // 1: BooleanParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BooleanParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - bool cppResult = const_cast(cppSelf)->get(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - bool cppResult = const_cast(cppSelf)->get(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BooleanParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BooleanParam.get"); - return {}; -} - -static PyObject *Sbk_BooleanParamFunc_getDefaultValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getDefaultValue()const - bool cppResult = const_cast(cppSelf)->getDefaultValue(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BooleanParamFunc_getValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getValue()const - bool cppResult = const_cast(cppSelf)->getValue(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BooleanParamFunc_getValueAtTime(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BooleanParam::getValueAtTime(double)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getValueAtTime(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BooleanParamFunc_getValueAtTime_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getValueAtTime(double)const - bool cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_BooleanParamFunc_getValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BooleanParam.getValueAtTime"); - return {}; -} - -static PyObject *Sbk_BooleanParamFunc_restoreDefaultValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // restoreDefaultValue() - cppSelf->restoreDefaultValue(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_BooleanParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BooleanParam::set(bool) - // 1: BooleanParam::set(bool,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // set(bool) - } else if (numArgs == 2 - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 1; // set(bool,double) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BooleanParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(bool x) - { - bool cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(bool) - cppSelf->set(cppArg0); - } - break; - } - case 1: // set(bool x, double frame) - { - bool cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(bool,double) - cppSelf->set(cppArg0, cppArg1); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BooleanParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BooleanParam.set"); - return {}; -} - -static PyObject *Sbk_BooleanParamFunc_setDefaultValue(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BooleanParam::setDefaultValue(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setDefaultValue(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BooleanParamFunc_setDefaultValue_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setDefaultValue(bool) - cppSelf->setDefaultValue(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BooleanParamFunc_setDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BooleanParam.setDefaultValue"); - return {}; -} - -static PyObject *Sbk_BooleanParamFunc_setValue(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: BooleanParam::setValue(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setValue(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BooleanParamFunc_setValue_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setValue(bool) - cppSelf->setValue(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BooleanParamFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.BooleanParam.setValue"); - return {}; -} - -static PyObject *Sbk_BooleanParamFunc_setValueAtTime(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setValueAtTime", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BooleanParam::setValueAtTime(bool,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValueAtTime(bool,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BooleanParamFunc_setValueAtTime_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValueAtTime(bool,double) - cppSelf->setValueAtTime(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BooleanParamFunc_setValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BooleanParam.setValueAtTime"); - return {}; -} - - -static const char *Sbk_BooleanParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_BooleanParam_methods[] = { - {"addAsDependencyOf", reinterpret_cast(Sbk_BooleanParamFunc_addAsDependencyOf), METH_VARARGS}, - {"get", reinterpret_cast(Sbk_BooleanParamFunc_get), METH_VARARGS}, - {"getDefaultValue", reinterpret_cast(Sbk_BooleanParamFunc_getDefaultValue), METH_NOARGS}, - {"getValue", reinterpret_cast(Sbk_BooleanParamFunc_getValue), METH_NOARGS}, - {"getValueAtTime", reinterpret_cast(Sbk_BooleanParamFunc_getValueAtTime), METH_O}, - {"restoreDefaultValue", reinterpret_cast(Sbk_BooleanParamFunc_restoreDefaultValue), METH_NOARGS}, - {"set", reinterpret_cast(Sbk_BooleanParamFunc_set), METH_VARARGS}, - {"setDefaultValue", reinterpret_cast(Sbk_BooleanParamFunc_setDefaultValue), METH_O}, - {"setValue", reinterpret_cast(Sbk_BooleanParamFunc_setValue), METH_O}, - {"setValueAtTime", reinterpret_cast(Sbk_BooleanParamFunc_setValueAtTime), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_BooleanParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::BooleanParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_BooleanParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_BooleanParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_BooleanParam_Type = nullptr; -static SbkObjectType *Sbk_BooleanParam_TypeF(void) -{ - return _Sbk_BooleanParam_Type; -} - -static PyType_Slot Sbk_BooleanParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_BooleanParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_BooleanParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_BooleanParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_BooleanParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_BooleanParam_spec = { - "1:NatronEngine.BooleanParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_BooleanParam_slots -}; - -} //extern "C" - -static void *Sbk_BooleanParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::BooleanParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void BooleanParam_PythonToCpp_BooleanParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_BooleanParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_BooleanParam_PythonToCpp_BooleanParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_BooleanParam_TypeF()))) - return BooleanParam_PythonToCpp_BooleanParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *BooleanParam_PTR_CppToPython_BooleanParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_BooleanParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *BooleanParam_SignatureStrings[] = { - "NatronEngine.BooleanParam.addAsDependencyOf(self,fromExprDimension:int,param:NatronEngine.Param,thisDimension:int)->bool", - "1:NatronEngine.BooleanParam.get(self)->bool", - "0:NatronEngine.BooleanParam.get(self,frame:double)->bool", - "NatronEngine.BooleanParam.getDefaultValue(self)->bool", - "NatronEngine.BooleanParam.getValue(self)->bool", - "NatronEngine.BooleanParam.getValueAtTime(self,time:double)->bool", - "NatronEngine.BooleanParam.restoreDefaultValue(self)", - "1:NatronEngine.BooleanParam.set(self,x:bool)", - "0:NatronEngine.BooleanParam.set(self,x:bool,frame:double)", - "NatronEngine.BooleanParam.setDefaultValue(self,value:bool)", - "NatronEngine.BooleanParam.setValue(self,value:bool)", - "NatronEngine.BooleanParam.setValueAtTime(self,value:bool,time:double)", - nullptr}; // Sentinel - -void init_BooleanParam(PyObject *module) -{ - _Sbk_BooleanParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "BooleanParam", - "BooleanParam*", - &Sbk_BooleanParam_spec, - &Shiboken::callCppDestructor< ::BooleanParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_BooleanParam_Type); - InitSignatureStrings(pyType, BooleanParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_BooleanParam_Type), Sbk_BooleanParam_PropertyStrings); - SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX] - = reinterpret_cast(Sbk_BooleanParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_BooleanParam_TypeF(), - BooleanParam_PythonToCpp_BooleanParam_PTR, - is_BooleanParam_PythonToCpp_BooleanParam_PTR_Convertible, - BooleanParam_PTR_CppToPython_BooleanParam); - - Shiboken::Conversions::registerConverterName(converter, "BooleanParam"); - Shiboken::Conversions::registerConverterName(converter, "BooleanParam*"); - Shiboken::Conversions::registerConverterName(converter, "BooleanParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::BooleanParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::BooleanParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_BooleanParam_TypeF(), &Sbk_BooleanParam_typeDiscovery); - - - BooleanParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/booleanparam_wrapper.h b/Engine/Qt5/NatronEngine/booleanparam_wrapper.h deleted file mode 100644 index e7250b1060..0000000000 --- a/Engine/Qt5/NatronEngine/booleanparam_wrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SBK_BOOLEANPARAMWRAPPER_H -#define SBK_BOOLEANPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class BooleanParamWrapper : public BooleanParam -{ -public: - ~BooleanParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_BOOLEANPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.cpp b/Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.cpp deleted file mode 100644 index 4f9166dccb..0000000000 --- a/Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.cpp +++ /dev/null @@ -1,467 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "boolnodecreationproperty_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void BoolNodeCreationPropertyWrapper::pysideInitQtMetaTypes() -{ -} - -void BoolNodeCreationPropertyWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -BoolNodeCreationPropertyWrapper::BoolNodeCreationPropertyWrapper(bool value) : BoolNodeCreationProperty(value) -{ - resetPyMethodCache(); - // ... middle -} - -BoolNodeCreationPropertyWrapper::BoolNodeCreationPropertyWrapper(const std::vector & values) : BoolNodeCreationProperty(values) -{ - resetPyMethodCache(); - // ... middle -} - -BoolNodeCreationPropertyWrapper::~BoolNodeCreationPropertyWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_BoolNodeCreationProperty_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::BoolNodeCreationProperty >())) - return -1; - - ::BoolNodeCreationPropertyWrapper *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.BoolNodeCreationProperty(): too many arguments"); - return -1; - } - - if (!PyArg_ParseTuple(args, "|O:BoolNodeCreationProperty", &(pyArgs[0]))) - return -1; - - - // Overloaded function decisor - // 0: BoolNodeCreationProperty::BoolNodeCreationProperty(bool) - // 1: BoolNodeCreationProperty::BoolNodeCreationProperty(std::vector) - if (numArgs == 0) { - overloadId = 1; // BoolNodeCreationProperty(std::vector) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // BoolNodeCreationProperty(bool) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX], (pyArgs[0])))) { - overloadId = 1; // BoolNodeCreationProperty(std::vector) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BoolNodeCreationProperty_Init_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // BoolNodeCreationProperty(bool value) - { - bool cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // BoolNodeCreationProperty(bool) - cptr = new ::BoolNodeCreationPropertyWrapper(cppArg0); - } - break; - } - case 1: // BoolNodeCreationProperty(const std::vector & values) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","values"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.BoolNodeCreationProperty(): got multiple values for keyword argument 'values'."); - return -1; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX], (pyArgs[0])))) - goto Sbk_BoolNodeCreationProperty_Init_TypeError; - } - } - } - ::std::vector cppArg0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // BoolNodeCreationProperty(std::vector) - cptr = new ::BoolNodeCreationPropertyWrapper(cppArg0); - } - break; - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::BoolNodeCreationProperty >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_BoolNodeCreationProperty_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_BoolNodeCreationProperty_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BoolNodeCreationProperty"); - return -1; -} - -static PyObject *Sbk_BoolNodeCreationPropertyFunc_getValues(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BoolNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getValues()const - const std::vector & cppResult = const_cast(cppSelf)->getValues(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_BoolNodeCreationPropertyFunc_setValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::BoolNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.BoolNodeCreationProperty.setValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.BoolNodeCreationProperty.setValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: BoolNodeCreationProperty::setValue(bool,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setValue(bool,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValue(bool,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_BoolNodeCreationPropertyFunc_setValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","index"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.BoolNodeCreationProperty.setValue(): got multiple values for keyword argument 'index'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_BoolNodeCreationPropertyFunc_setValue_TypeError; - } - } - } - bool cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValue(bool,int) - cppSelf->setValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_BoolNodeCreationPropertyFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.BoolNodeCreationProperty.setValue"); - return {}; -} - - -static const char *Sbk_BoolNodeCreationProperty_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_BoolNodeCreationProperty_methods[] = { - {"getValues", reinterpret_cast(Sbk_BoolNodeCreationPropertyFunc_getValues), METH_NOARGS}, - {"setValue", reinterpret_cast(Sbk_BoolNodeCreationPropertyFunc_setValue), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_BoolNodeCreationProperty_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::BoolNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BOOLNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_BoolNodeCreationProperty_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_BoolNodeCreationProperty_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_BoolNodeCreationProperty_Type = nullptr; -static SbkObjectType *Sbk_BoolNodeCreationProperty_TypeF(void) -{ - return _Sbk_BoolNodeCreationProperty_Type; -} - -static PyType_Slot Sbk_BoolNodeCreationProperty_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_BoolNodeCreationProperty_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_BoolNodeCreationProperty_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_BoolNodeCreationProperty_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_BoolNodeCreationProperty_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_BoolNodeCreationProperty_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_BoolNodeCreationProperty_spec = { - "1:NatronEngine.BoolNodeCreationProperty", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_BoolNodeCreationProperty_slots -}; - -} //extern "C" - -static void *Sbk_BoolNodeCreationProperty_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::NodeCreationProperty >())) - return dynamic_cast< ::BoolNodeCreationProperty *>(reinterpret_cast< ::NodeCreationProperty *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void BoolNodeCreationProperty_PythonToCpp_BoolNodeCreationProperty_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_BoolNodeCreationProperty_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_BoolNodeCreationProperty_PythonToCpp_BoolNodeCreationProperty_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_BoolNodeCreationProperty_TypeF()))) - return BoolNodeCreationProperty_PythonToCpp_BoolNodeCreationProperty_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *BoolNodeCreationProperty_PTR_CppToPython_BoolNodeCreationProperty(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_BoolNodeCreationProperty_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *BoolNodeCreationProperty_SignatureStrings[] = { - "1:NatronEngine.BoolNodeCreationProperty(self,value:bool)", - "0:NatronEngine.BoolNodeCreationProperty(self,values:std.vector[bool]=std.vector< bool >())", - "NatronEngine.BoolNodeCreationProperty.getValues(self)->std.vector[bool]", - "NatronEngine.BoolNodeCreationProperty.setValue(self,value:bool,index:int=0)", - nullptr}; // Sentinel - -void init_BoolNodeCreationProperty(PyObject *module) -{ - _Sbk_BoolNodeCreationProperty_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "BoolNodeCreationProperty", - "BoolNodeCreationProperty*", - &Sbk_BoolNodeCreationProperty_spec, - &Shiboken::callCppDestructor< ::BoolNodeCreationProperty >, - reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_BoolNodeCreationProperty_Type); - InitSignatureStrings(pyType, BoolNodeCreationProperty_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_BoolNodeCreationProperty_Type), Sbk_BoolNodeCreationProperty_PropertyStrings); - SbkNatronEngineTypes[SBK_BOOLNODECREATIONPROPERTY_IDX] - = reinterpret_cast(Sbk_BoolNodeCreationProperty_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_BoolNodeCreationProperty_TypeF(), - BoolNodeCreationProperty_PythonToCpp_BoolNodeCreationProperty_PTR, - is_BoolNodeCreationProperty_PythonToCpp_BoolNodeCreationProperty_PTR_Convertible, - BoolNodeCreationProperty_PTR_CppToPython_BoolNodeCreationProperty); - - Shiboken::Conversions::registerConverterName(converter, "BoolNodeCreationProperty"); - Shiboken::Conversions::registerConverterName(converter, "BoolNodeCreationProperty*"); - Shiboken::Conversions::registerConverterName(converter, "BoolNodeCreationProperty&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::BoolNodeCreationProperty).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::BoolNodeCreationPropertyWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_BoolNodeCreationProperty_TypeF(), &Sbk_BoolNodeCreationProperty_typeDiscovery); - - - BoolNodeCreationPropertyWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.h b/Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.h deleted file mode 100644 index ef6d2e96e9..0000000000 --- a/Engine/Qt5/NatronEngine/boolnodecreationproperty_wrapper.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SBK_BOOLNODECREATIONPROPERTYWRAPPER_H -#define SBK_BOOLNODECREATIONPROPERTYWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class BoolNodeCreationPropertyWrapper : public BoolNodeCreationProperty -{ -public: - BoolNodeCreationPropertyWrapper(bool value); - BoolNodeCreationPropertyWrapper(const std::vector & values = std::vector< bool >()); - ~BoolNodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_NODECREATIONPROPERTYWRAPPER_H -# define SBK_NODECREATIONPROPERTYWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class NodeCreationPropertyWrapper : public NodeCreationProperty -{ -public: - NodeCreationPropertyWrapper(); - ~NodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_NODECREATIONPROPERTYWRAPPER_H - -#endif // SBK_BOOLNODECREATIONPROPERTYWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/buttonparam_wrapper.cpp b/Engine/Qt5/NatronEngine/buttonparam_wrapper.cpp deleted file mode 100644 index 2b277d9b68..0000000000 --- a/Engine/Qt5/NatronEngine/buttonparam_wrapper.cpp +++ /dev/null @@ -1,263 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "buttonparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void ButtonParamWrapper::pysideInitQtMetaTypes() -{ -} - -void ButtonParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -ButtonParamWrapper::~ButtonParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_ButtonParamFunc_trigger(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ButtonParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BUTTONPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // trigger() - cppSelf->trigger(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - - -static const char *Sbk_ButtonParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ButtonParam_methods[] = { - {"trigger", reinterpret_cast(Sbk_ButtonParamFunc_trigger), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_ButtonParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::ButtonParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_BUTTONPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_ButtonParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ButtonParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ButtonParam_Type = nullptr; -static SbkObjectType *Sbk_ButtonParam_TypeF(void) -{ - return _Sbk_ButtonParam_Type; -} - -static PyType_Slot Sbk_ButtonParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_ButtonParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_ButtonParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ButtonParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ButtonParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_ButtonParam_spec = { - "1:NatronEngine.ButtonParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ButtonParam_slots -}; - -} //extern "C" - -static void *Sbk_ButtonParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::ButtonParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ButtonParam_PythonToCpp_ButtonParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ButtonParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ButtonParam_PythonToCpp_ButtonParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ButtonParam_TypeF()))) - return ButtonParam_PythonToCpp_ButtonParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ButtonParam_PTR_CppToPython_ButtonParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ButtonParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ButtonParam_SignatureStrings[] = { - "NatronEngine.ButtonParam.trigger(self)", - nullptr}; // Sentinel - -void init_ButtonParam(PyObject *module) -{ - _Sbk_ButtonParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ButtonParam", - "ButtonParam*", - &Sbk_ButtonParam_spec, - &Shiboken::callCppDestructor< ::ButtonParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ButtonParam_Type); - InitSignatureStrings(pyType, ButtonParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ButtonParam_Type), Sbk_ButtonParam_PropertyStrings); - SbkNatronEngineTypes[SBK_BUTTONPARAM_IDX] - = reinterpret_cast(Sbk_ButtonParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ButtonParam_TypeF(), - ButtonParam_PythonToCpp_ButtonParam_PTR, - is_ButtonParam_PythonToCpp_ButtonParam_PTR_Convertible, - ButtonParam_PTR_CppToPython_ButtonParam); - - Shiboken::Conversions::registerConverterName(converter, "ButtonParam"); - Shiboken::Conversions::registerConverterName(converter, "ButtonParam*"); - Shiboken::Conversions::registerConverterName(converter, "ButtonParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ButtonParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::ButtonParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_ButtonParam_TypeF(), &Sbk_ButtonParam_typeDiscovery); - - - ButtonParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/buttonparam_wrapper.h b/Engine/Qt5/NatronEngine/buttonparam_wrapper.h deleted file mode 100644 index ec1c85c693..0000000000 --- a/Engine/Qt5/NatronEngine/buttonparam_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_BUTTONPARAMWRAPPER_H -#define SBK_BUTTONPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ButtonParamWrapper : public ButtonParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { ButtonParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ButtonParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_BUTTONPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/choiceparam_wrapper.cpp b/Engine/Qt5/NatronEngine/choiceparam_wrapper.cpp deleted file mode 100644 index 4f332aa67b..0000000000 --- a/Engine/Qt5/NatronEngine/choiceparam_wrapper.cpp +++ /dev/null @@ -1,967 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "choiceparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void ChoiceParamWrapper::pysideInitQtMetaTypes() -{ -} - -void ChoiceParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -ChoiceParamWrapper::~ChoiceParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_ChoiceParamFunc_addAsDependencyOf(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addAsDependencyOf", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: ChoiceParam::addAsDependencyOf(int,Param*,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // addAsDependencyOf(int,Param*,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_addAsDependencyOf_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Param *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // addAsDependencyOf(int,Param*,int) - int cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ChoiceParamFunc_addAsDependencyOf_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ChoiceParam.addAsDependencyOf"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_addOption(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addOption", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ChoiceParam::addOption(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // addOption(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_addOption_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // addOption(QString,QString) - cppSelf->addOption(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ChoiceParamFunc_addOption_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ChoiceParam.addOption"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: ChoiceParam::get()const - // 1: ChoiceParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - int cppResult = const_cast(cppSelf)->get(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - int cppResult = const_cast(cppSelf)->get(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ChoiceParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ChoiceParam.get"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_getDefaultValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getDefaultValue()const - int cppResult = const_cast(cppSelf)->getDefaultValue(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ChoiceParamFunc_getNumOptions(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNumOptions()const - int cppResult = const_cast(cppSelf)->getNumOptions(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ChoiceParamFunc_getOption(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ChoiceParam::getOption(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getOption(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_getOption_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getOption(int)const - QString cppResult = const_cast(cppSelf)->getOption(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ChoiceParamFunc_getOption_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ChoiceParam.getOption"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_getOptions(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getOptions()const - QStringList cppResult = const_cast(cppSelf)->getOptions(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ChoiceParamFunc_getValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getValue()const - int cppResult = const_cast(cppSelf)->getValue(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ChoiceParamFunc_getValueAtTime(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ChoiceParam::getValueAtTime(double)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getValueAtTime(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_getValueAtTime_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getValueAtTime(double)const - int cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ChoiceParamFunc_getValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ChoiceParam.getValueAtTime"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_restoreDefaultValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // restoreDefaultValue() - cppSelf->restoreDefaultValue(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_ChoiceParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ChoiceParam::set(QString) - // 1: ChoiceParam::set(int) - // 2: ChoiceParam::set(int,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 1; // set(int) - } else if (numArgs == 2 - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 2; // set(int,double) - } - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { - overloadId = 0; // set(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(const QString & label) - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(QString) - cppSelf->set(cppArg0); - } - break; - } - case 1: // set(int x) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(int) - cppSelf->set(cppArg0); - } - break; - } - case 2: // set(int x, double frame) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(int,double) - cppSelf->set(cppArg0, cppArg1); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ChoiceParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ChoiceParam.set"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_setDefaultValue(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ChoiceParam::setDefaultValue(QString) - // 1: ChoiceParam::setDefaultValue(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 1; // setDefaultValue(int) - } else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setDefaultValue(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_setDefaultValue_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // setDefaultValue(const QString & value) - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setDefaultValue(QString) - cppSelf->setDefaultValue(cppArg0); - } - break; - } - case 1: // setDefaultValue(int value) - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setDefaultValue(int) - cppSelf->setDefaultValue(cppArg0); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ChoiceParamFunc_setDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ChoiceParam.setDefaultValue"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_setOptions(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ChoiceParam::setOptions(std::list >) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setOptions(std::list >) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_setOptions_TypeError; - - // Call function/method - { - ::std::list > cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setOptions(std::list >) - cppSelf->setOptions(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ChoiceParamFunc_setOptions_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ChoiceParam.setOptions"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_setValue(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ChoiceParam::setValue(QString) - // 1: ChoiceParam::setValue(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 1; // setValue(int) - } else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setValue(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_setValue_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // setValue(const QString & label) - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setValue(QString) - cppSelf->setValue(cppArg0); - } - break; - } - case 1: // setValue(int value) - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setValue(int) - cppSelf->setValue(cppArg0); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ChoiceParamFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ChoiceParam.setValue"); - return {}; -} - -static PyObject *Sbk_ChoiceParamFunc_setValueAtTime(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setValueAtTime", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ChoiceParam::setValueAtTime(int,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValueAtTime(int,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ChoiceParamFunc_setValueAtTime_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValueAtTime(int,double) - cppSelf->setValueAtTime(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ChoiceParamFunc_setValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ChoiceParam.setValueAtTime"); - return {}; -} - - -static const char *Sbk_ChoiceParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ChoiceParam_methods[] = { - {"addAsDependencyOf", reinterpret_cast(Sbk_ChoiceParamFunc_addAsDependencyOf), METH_VARARGS}, - {"addOption", reinterpret_cast(Sbk_ChoiceParamFunc_addOption), METH_VARARGS}, - {"get", reinterpret_cast(Sbk_ChoiceParamFunc_get), METH_VARARGS}, - {"getDefaultValue", reinterpret_cast(Sbk_ChoiceParamFunc_getDefaultValue), METH_NOARGS}, - {"getNumOptions", reinterpret_cast(Sbk_ChoiceParamFunc_getNumOptions), METH_NOARGS}, - {"getOption", reinterpret_cast(Sbk_ChoiceParamFunc_getOption), METH_O}, - {"getOptions", reinterpret_cast(Sbk_ChoiceParamFunc_getOptions), METH_NOARGS}, - {"getValue", reinterpret_cast(Sbk_ChoiceParamFunc_getValue), METH_NOARGS}, - {"getValueAtTime", reinterpret_cast(Sbk_ChoiceParamFunc_getValueAtTime), METH_O}, - {"restoreDefaultValue", reinterpret_cast(Sbk_ChoiceParamFunc_restoreDefaultValue), METH_NOARGS}, - {"set", reinterpret_cast(Sbk_ChoiceParamFunc_set), METH_VARARGS}, - {"setDefaultValue", reinterpret_cast(Sbk_ChoiceParamFunc_setDefaultValue), METH_O}, - {"setOptions", reinterpret_cast(Sbk_ChoiceParamFunc_setOptions), METH_O}, - {"setValue", reinterpret_cast(Sbk_ChoiceParamFunc_setValue), METH_O}, - {"setValueAtTime", reinterpret_cast(Sbk_ChoiceParamFunc_setValueAtTime), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_ChoiceParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::ChoiceParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_ChoiceParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ChoiceParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ChoiceParam_Type = nullptr; -static SbkObjectType *Sbk_ChoiceParam_TypeF(void) -{ - return _Sbk_ChoiceParam_Type; -} - -static PyType_Slot Sbk_ChoiceParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_ChoiceParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_ChoiceParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ChoiceParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ChoiceParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_ChoiceParam_spec = { - "1:NatronEngine.ChoiceParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ChoiceParam_slots -}; - -} //extern "C" - -static void *Sbk_ChoiceParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::ChoiceParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ChoiceParam_PythonToCpp_ChoiceParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ChoiceParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ChoiceParam_PythonToCpp_ChoiceParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ChoiceParam_TypeF()))) - return ChoiceParam_PythonToCpp_ChoiceParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ChoiceParam_PTR_CppToPython_ChoiceParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ChoiceParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ChoiceParam_SignatureStrings[] = { - "NatronEngine.ChoiceParam.addAsDependencyOf(self,fromExprDimension:int,param:NatronEngine.Param,thisDimension:int)->int", - "NatronEngine.ChoiceParam.addOption(self,option:QString,help:QString)", - "1:NatronEngine.ChoiceParam.get(self)->int", - "0:NatronEngine.ChoiceParam.get(self,frame:double)->int", - "NatronEngine.ChoiceParam.getDefaultValue(self)->int", - "NatronEngine.ChoiceParam.getNumOptions(self)->int", - "NatronEngine.ChoiceParam.getOption(self,index:int)->QString", - "NatronEngine.ChoiceParam.getOptions(self)->QStringList", - "NatronEngine.ChoiceParam.getValue(self)->int", - "NatronEngine.ChoiceParam.getValueAtTime(self,time:double)->int", - "NatronEngine.ChoiceParam.restoreDefaultValue(self)", - "2:NatronEngine.ChoiceParam.set(self,label:QString)", - "1:NatronEngine.ChoiceParam.set(self,x:int)", - "0:NatronEngine.ChoiceParam.set(self,x:int,frame:double)", - "1:NatronEngine.ChoiceParam.setDefaultValue(self,value:QString)", - "0:NatronEngine.ChoiceParam.setDefaultValue(self,value:int)", - "NatronEngine.ChoiceParam.setOptions(self,options:std.list[std.pair[QString, QString]])", - "1:NatronEngine.ChoiceParam.setValue(self,label:QString)", - "0:NatronEngine.ChoiceParam.setValue(self,value:int)", - "NatronEngine.ChoiceParam.setValueAtTime(self,value:int,time:double)", - nullptr}; // Sentinel - -void init_ChoiceParam(PyObject *module) -{ - _Sbk_ChoiceParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ChoiceParam", - "ChoiceParam*", - &Sbk_ChoiceParam_spec, - &Shiboken::callCppDestructor< ::ChoiceParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ChoiceParam_Type); - InitSignatureStrings(pyType, ChoiceParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ChoiceParam_Type), Sbk_ChoiceParam_PropertyStrings); - SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX] - = reinterpret_cast(Sbk_ChoiceParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ChoiceParam_TypeF(), - ChoiceParam_PythonToCpp_ChoiceParam_PTR, - is_ChoiceParam_PythonToCpp_ChoiceParam_PTR_Convertible, - ChoiceParam_PTR_CppToPython_ChoiceParam); - - Shiboken::Conversions::registerConverterName(converter, "ChoiceParam"); - Shiboken::Conversions::registerConverterName(converter, "ChoiceParam*"); - Shiboken::Conversions::registerConverterName(converter, "ChoiceParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ChoiceParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::ChoiceParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_ChoiceParam_TypeF(), &Sbk_ChoiceParam_typeDiscovery); - - - ChoiceParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/choiceparam_wrapper.h b/Engine/Qt5/NatronEngine/choiceparam_wrapper.h deleted file mode 100644 index d30a968123..0000000000 --- a/Engine/Qt5/NatronEngine/choiceparam_wrapper.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef SBK_CHOICEPARAMWRAPPER_H -#define SBK_CHOICEPARAMWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ChoiceParamWrapper : public ChoiceParam -{ -public: - ~ChoiceParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_CHOICEPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/colorparam_wrapper.cpp b/Engine/Qt5/NatronEngine/colorparam_wrapper.cpp deleted file mode 100644 index 2d75da2730..0000000000 --- a/Engine/Qt5/NatronEngine/colorparam_wrapper.cpp +++ /dev/null @@ -1,1609 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "colorparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void ColorParamWrapper::pysideInitQtMetaTypes() -{ -} - -void ColorParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -ColorParamWrapper::~ColorParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_ColorParamFunc_addAsDependencyOf(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addAsDependencyOf", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::addAsDependencyOf(int,Param*,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // addAsDependencyOf(int,Param*,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_addAsDependencyOf_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Param *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // addAsDependencyOf(int,Param*,int) - double cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_addAsDependencyOf_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.addAsDependencyOf"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::get()const - // 1: ColorParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - ColorTuple* cppResult = new ColorTuple(const_cast(cppSelf)->get()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]), cppResult, true, true); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - ColorTuple* cppResult = new ColorTuple(const_cast(cppSelf)->get(cppArg0)); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]), cppResult, true, true); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.get"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_getDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getDefaultValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getDefaultValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::getDefaultValue(int)const - if (numArgs == 0) { - overloadId = 0; // getDefaultValue(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getDefaultValue(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_getDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ColorParamFunc_getDefaultValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getDefaultValue(int)const - double cppResult = const_cast(cppSelf)->getDefaultValue(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_getDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.getDefaultValue"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_getDisplayMaximum(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ColorParam::getDisplayMaximum(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getDisplayMaximum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_getDisplayMaximum_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getDisplayMaximum(int)const - double cppResult = const_cast(cppSelf)->getDisplayMaximum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_getDisplayMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ColorParam.getDisplayMaximum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_getDisplayMinimum(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ColorParam::getDisplayMinimum(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getDisplayMinimum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_getDisplayMinimum_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getDisplayMinimum(int)const - double cppResult = const_cast(cppSelf)->getDisplayMinimum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_getDisplayMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ColorParam.getDisplayMinimum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_getMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getMaximum(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getMaximum", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::getMaximum(int)const - if (numArgs == 0) { - overloadId = 0; // getMaximum(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getMaximum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_getMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ColorParamFunc_getMaximum_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getMaximum(int)const - double cppResult = const_cast(cppSelf)->getMaximum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_getMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.getMaximum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_getMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getMinimum(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getMinimum", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::getMinimum(int)const - if (numArgs == 0) { - overloadId = 0; // getMinimum(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getMinimum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_getMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ColorParamFunc_getMinimum_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getMinimum(int)const - double cppResult = const_cast(cppSelf)->getMinimum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_getMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.getMinimum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_getValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::getValue(int)const - if (numArgs == 0) { - overloadId = 0; // getValue(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getValue(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_getValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ColorParamFunc_getValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getValue(int)const - double cppResult = const_cast(cppSelf)->getValue(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_getValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.getValue"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_getValueAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getValueAtTime(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getValueAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:getValueAtTime", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::getValueAtTime(double,int)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // getValueAtTime(double,int)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getValueAtTime(double,int)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_getValueAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.getValueAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ColorParamFunc_getValueAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getValueAtTime(double,int)const - double cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ColorParamFunc_getValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.getValueAtTime"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_restoreDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.restoreDefaultValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:restoreDefaultValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::restoreDefaultValue(int) - if (numArgs == 0) { - overloadId = 0; // restoreDefaultValue(int) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // restoreDefaultValue(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_restoreDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.restoreDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ColorParamFunc_restoreDefaultValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // restoreDefaultValue(int) - cppSelf->restoreDefaultValue(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_restoreDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.restoreDefaultValue"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 4, 5, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::set(double,double,double,double) - // 1: ColorParam::set(double,double,double,double,double) - if (numArgs >= 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - if (numArgs == 4) { - overloadId = 0; // set(double,double,double,double) - } else if (numArgs == 5 - && (pythonToCpp[4] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[4])))) { - overloadId = 1; // set(double,double,double,double,double) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(double r, double g, double b, double a) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // set(double,double,double,double) - cppSelf->set(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - case 1: // set(double r, double g, double b, double a, double frame) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - double cppArg4; - pythonToCpp[4](pyArgs[4], &cppArg4); - - if (!PyErr_Occurred()) { - // set(double,double,double,double,double) - cppSelf->set(cppArg0, cppArg1, cppArg2, cppArg3, cppArg4); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.set"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_setDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDefaultValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDefaultValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDefaultValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::setDefaultValue(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDefaultValue(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDefaultValue(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_setDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ColorParamFunc_setDefaultValue_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDefaultValue(double,int) - cppSelf->setDefaultValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_setDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.setDefaultValue"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_setDisplayMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDisplayMaximum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDisplayMaximum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDisplayMaximum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::setDisplayMaximum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDisplayMaximum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDisplayMaximum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_setDisplayMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDisplayMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ColorParamFunc_setDisplayMaximum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDisplayMaximum(double,int) - cppSelf->setDisplayMaximum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_setDisplayMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.setDisplayMaximum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_setDisplayMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDisplayMinimum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDisplayMinimum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDisplayMinimum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::setDisplayMinimum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDisplayMinimum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDisplayMinimum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_setDisplayMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setDisplayMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ColorParamFunc_setDisplayMinimum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDisplayMinimum(double,int) - cppSelf->setDisplayMinimum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_setDisplayMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.setDisplayMinimum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_setMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setMaximum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setMaximum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setMaximum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::setMaximum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setMaximum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setMaximum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_setMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ColorParamFunc_setMaximum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setMaximum(double,int) - cppSelf->setMaximum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_setMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.setMaximum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_setMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setMinimum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setMinimum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setMinimum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::setMinimum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setMinimum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setMinimum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_setMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ColorParamFunc_setMinimum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setMinimum(double,int) - cppSelf->setMinimum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_setMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.setMinimum"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_setValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::setValue(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setValue(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValue(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_setValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ColorParamFunc_setValue_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValue(double,int) - cppSelf->setValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.setValue"); - return {}; -} - -static PyObject *Sbk_ColorParamFunc_setValueAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setValueAtTime(): too many arguments"); - return {}; - } else if (numArgs < 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setValueAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:setValueAtTime", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: ColorParam::setValueAtTime(double,double,int) - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // setValueAtTime(double,double,int) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setValueAtTime(double,double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ColorParamFunc_setValueAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ColorParam.setValueAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ColorParamFunc_setValueAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2 = 0; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setValueAtTime(double,double,int) - cppSelf->setValueAtTime(cppArg0, cppArg1, cppArg2); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ColorParamFunc_setValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ColorParam.setValueAtTime"); - return {}; -} - - -static const char *Sbk_ColorParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ColorParam_methods[] = { - {"addAsDependencyOf", reinterpret_cast(Sbk_ColorParamFunc_addAsDependencyOf), METH_VARARGS}, - {"get", reinterpret_cast(Sbk_ColorParamFunc_get), METH_VARARGS}, - {"getDefaultValue", reinterpret_cast(Sbk_ColorParamFunc_getDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"getDisplayMaximum", reinterpret_cast(Sbk_ColorParamFunc_getDisplayMaximum), METH_O}, - {"getDisplayMinimum", reinterpret_cast(Sbk_ColorParamFunc_getDisplayMinimum), METH_O}, - {"getMaximum", reinterpret_cast(Sbk_ColorParamFunc_getMaximum), METH_VARARGS|METH_KEYWORDS}, - {"getMinimum", reinterpret_cast(Sbk_ColorParamFunc_getMinimum), METH_VARARGS|METH_KEYWORDS}, - {"getValue", reinterpret_cast(Sbk_ColorParamFunc_getValue), METH_VARARGS|METH_KEYWORDS}, - {"getValueAtTime", reinterpret_cast(Sbk_ColorParamFunc_getValueAtTime), METH_VARARGS|METH_KEYWORDS}, - {"restoreDefaultValue", reinterpret_cast(Sbk_ColorParamFunc_restoreDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"set", reinterpret_cast(Sbk_ColorParamFunc_set), METH_VARARGS}, - {"setDefaultValue", reinterpret_cast(Sbk_ColorParamFunc_setDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"setDisplayMaximum", reinterpret_cast(Sbk_ColorParamFunc_setDisplayMaximum), METH_VARARGS|METH_KEYWORDS}, - {"setDisplayMinimum", reinterpret_cast(Sbk_ColorParamFunc_setDisplayMinimum), METH_VARARGS|METH_KEYWORDS}, - {"setMaximum", reinterpret_cast(Sbk_ColorParamFunc_setMaximum), METH_VARARGS|METH_KEYWORDS}, - {"setMinimum", reinterpret_cast(Sbk_ColorParamFunc_setMinimum), METH_VARARGS|METH_KEYWORDS}, - {"setValue", reinterpret_cast(Sbk_ColorParamFunc_setValue), METH_VARARGS|METH_KEYWORDS}, - {"setValueAtTime", reinterpret_cast(Sbk_ColorParamFunc_setValueAtTime), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_ColorParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::ColorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_ColorParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ColorParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ColorParam_Type = nullptr; -static SbkObjectType *Sbk_ColorParam_TypeF(void) -{ - return _Sbk_ColorParam_Type; -} - -static PyType_Slot Sbk_ColorParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_ColorParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_ColorParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ColorParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ColorParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_ColorParam_spec = { - "1:NatronEngine.ColorParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ColorParam_slots -}; - -} //extern "C" - -static void *Sbk_ColorParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::ColorParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ColorParam_PythonToCpp_ColorParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ColorParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ColorParam_PythonToCpp_ColorParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ColorParam_TypeF()))) - return ColorParam_PythonToCpp_ColorParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ColorParam_PTR_CppToPython_ColorParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ColorParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ColorParam_SignatureStrings[] = { - "NatronEngine.ColorParam.addAsDependencyOf(self,fromExprDimension:int,param:NatronEngine.Param,thisDimension:int)->double", - "1:NatronEngine.ColorParam.get(self)->NatronEngine.ColorTuple", - "0:NatronEngine.ColorParam.get(self,frame:double)->NatronEngine.ColorTuple", - "NatronEngine.ColorParam.getDefaultValue(self,dimension:int=0)->double", - "NatronEngine.ColorParam.getDisplayMaximum(self,dimension:int)->double", - "NatronEngine.ColorParam.getDisplayMinimum(self,dimension:int)->double", - "NatronEngine.ColorParam.getMaximum(self,dimension:int=0)->double", - "NatronEngine.ColorParam.getMinimum(self,dimension:int=0)->double", - "NatronEngine.ColorParam.getValue(self,dimension:int=0)->double", - "NatronEngine.ColorParam.getValueAtTime(self,time:double,dimension:int=0)->double", - "NatronEngine.ColorParam.restoreDefaultValue(self,dimension:int=0)", - "1:NatronEngine.ColorParam.set(self,r:double,g:double,b:double,a:double)", - "0:NatronEngine.ColorParam.set(self,r:double,g:double,b:double,a:double,frame:double)", - "NatronEngine.ColorParam.setDefaultValue(self,value:double,dimension:int=0)", - "NatronEngine.ColorParam.setDisplayMaximum(self,maximum:double,dimension:int=0)", - "NatronEngine.ColorParam.setDisplayMinimum(self,minimum:double,dimension:int=0)", - "NatronEngine.ColorParam.setMaximum(self,maximum:double,dimension:int=0)", - "NatronEngine.ColorParam.setMinimum(self,minimum:double,dimension:int=0)", - "NatronEngine.ColorParam.setValue(self,value:double,dimension:int=0)", - "NatronEngine.ColorParam.setValueAtTime(self,value:double,time:double,dimension:int=0)", - nullptr}; // Sentinel - -void init_ColorParam(PyObject *module) -{ - _Sbk_ColorParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ColorParam", - "ColorParam*", - &Sbk_ColorParam_spec, - &Shiboken::callCppDestructor< ::ColorParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ColorParam_Type); - InitSignatureStrings(pyType, ColorParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ColorParam_Type), Sbk_ColorParam_PropertyStrings); - SbkNatronEngineTypes[SBK_COLORPARAM_IDX] - = reinterpret_cast(Sbk_ColorParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ColorParam_TypeF(), - ColorParam_PythonToCpp_ColorParam_PTR, - is_ColorParam_PythonToCpp_ColorParam_PTR_Convertible, - ColorParam_PTR_CppToPython_ColorParam); - - Shiboken::Conversions::registerConverterName(converter, "ColorParam"); - Shiboken::Conversions::registerConverterName(converter, "ColorParam*"); - Shiboken::Conversions::registerConverterName(converter, "ColorParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ColorParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::ColorParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_ColorParam_TypeF(), &Sbk_ColorParam_typeDiscovery); - - - ColorParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/colorparam_wrapper.h b/Engine/Qt5/NatronEngine/colorparam_wrapper.h deleted file mode 100644 index d5779bf08e..0000000000 --- a/Engine/Qt5/NatronEngine/colorparam_wrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SBK_COLORPARAMWRAPPER_H -#define SBK_COLORPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ColorParamWrapper : public ColorParam -{ -public: - ~ColorParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_COLORPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/colortuple_wrapper.cpp b/Engine/Qt5/NatronEngine/colortuple_wrapper.cpp deleted file mode 100644 index 6e0c38bfc0..0000000000 --- a/Engine/Qt5/NatronEngine/colortuple_wrapper.cpp +++ /dev/null @@ -1,408 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "colortuple_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_ColorTuple_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::ColorTuple >())) - return -1; - - ::ColorTuple *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // ColorTuple() - cptr = new ::ColorTuple(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::ColorTuple >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - - -static const char *Sbk_ColorTuple_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ColorTuple_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -PyObject* Sbk_ColorTupleFunc___getitem__(PyObject *self, Py_ssize_t _i) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - // Begin code injection - if (_i < 0 || _i >= 4) { - PyErr_BadArgument(); - return 0; - } else { - double ret; - switch (_i) { - case 0: - ret = cppSelf->r; - break; - case 1: - ret = cppSelf->g; - break; - case 2: - ret = cppSelf->b; - break; - case 3: - ret = cppSelf->a; - break; - - } - return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - } - - // End of code injection - -} - -static PyObject *Sbk_ColorTuple_get_r(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->r); - return pyOut; -} -static int Sbk_ColorTuple_set_r(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'r' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'r', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->r; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_ColorTuple_get_g(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->g); - return pyOut; -} -static int Sbk_ColorTuple_set_g(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'g' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'g', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->g; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_ColorTuple_get_b(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->b); - return pyOut; -} -static int Sbk_ColorTuple_set_b(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'b' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'b', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->b; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_ColorTuple_get_a(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->a); - return pyOut; -} -static int Sbk_ColorTuple_set_a(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::ColorTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'a' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'a', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->a; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -// Getters and Setters for ColorTuple -static PyGetSetDef Sbk_ColorTuple_getsetlist[] = { - {const_cast("r"), Sbk_ColorTuple_get_r, Sbk_ColorTuple_set_r}, - {const_cast("g"), Sbk_ColorTuple_get_g, Sbk_ColorTuple_set_g}, - {const_cast("b"), Sbk_ColorTuple_get_b, Sbk_ColorTuple_set_b}, - {const_cast("a"), Sbk_ColorTuple_get_a, Sbk_ColorTuple_set_a}, - {nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_ColorTuple_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ColorTuple_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ColorTuple_Type = nullptr; -static SbkObjectType *Sbk_ColorTuple_TypeF(void) -{ - return _Sbk_ColorTuple_Type; -} - -static PyType_Slot Sbk_ColorTuple_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_ColorTuple_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ColorTuple_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ColorTuple_methods)}, - {Py_tp_getset, reinterpret_cast(Sbk_ColorTuple_getsetlist)}, - {Py_tp_init, reinterpret_cast(Sbk_ColorTuple_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - // type supports sequence protocol - {Py_sq_item, (void *)&Sbk_ColorTupleFunc___getitem__}, - {0, nullptr} -}; -static PyType_Spec Sbk_ColorTuple_spec = { - "1:NatronEngine.ColorTuple", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ColorTuple_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ColorTuple_PythonToCpp_ColorTuple_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ColorTuple_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ColorTuple_PythonToCpp_ColorTuple_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ColorTuple_TypeF()))) - return ColorTuple_PythonToCpp_ColorTuple_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ColorTuple_PTR_CppToPython_ColorTuple(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ColorTuple_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ColorTuple_SignatureStrings[] = { - "NatronEngine.ColorTuple(self)", - nullptr}; // Sentinel - -void init_ColorTuple(PyObject *module) -{ - _Sbk_ColorTuple_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ColorTuple", - "ColorTuple*", - &Sbk_ColorTuple_spec, - &Shiboken::callCppDestructor< ::ColorTuple >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ColorTuple_Type); - InitSignatureStrings(pyType, ColorTuple_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ColorTuple_Type), Sbk_ColorTuple_PropertyStrings); - SbkNatronEngineTypes[SBK_COLORTUPLE_IDX] - = reinterpret_cast(Sbk_ColorTuple_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ColorTuple_TypeF(), - ColorTuple_PythonToCpp_ColorTuple_PTR, - is_ColorTuple_PythonToCpp_ColorTuple_PTR_Convertible, - ColorTuple_PTR_CppToPython_ColorTuple); - - Shiboken::Conversions::registerConverterName(converter, "ColorTuple"); - Shiboken::Conversions::registerConverterName(converter, "ColorTuple*"); - Shiboken::Conversions::registerConverterName(converter, "ColorTuple&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ColorTuple).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/colortuple_wrapper.h b/Engine/Qt5/NatronEngine/colortuple_wrapper.h deleted file mode 100644 index 4cdffb7c7c..0000000000 --- a/Engine/Qt5/NatronEngine/colortuple_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_COLORTUPLE_H -#define SBK_COLORTUPLE_H - -#include - -#endif // SBK_COLORTUPLE_H - diff --git a/Engine/Qt5/NatronEngine/double2dparam_wrapper.cpp b/Engine/Qt5/NatronEngine/double2dparam_wrapper.cpp deleted file mode 100644 index 87d02bdb2b..0000000000 --- a/Engine/Qt5/NatronEngine/double2dparam_wrapper.cpp +++ /dev/null @@ -1,494 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "double2dparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void Double2DParamWrapper::pysideInitQtMetaTypes() -{ -} - -void Double2DParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -Double2DParamWrapper::~Double2DParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_Double2DParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::get()const - // 1: DoubleParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Double2DParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - Double2DTuple* cppResult = new Double2DTuple(const_cast(cppSelf)->get()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX]), cppResult, true, true); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - Double2DTuple* cppResult = new Double2DTuple(const_cast(cppSelf)->get(cppArg0)); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX]), cppResult, true, true); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_Double2DParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Double2DParam.get"); - return {}; -} - -static PyObject *Sbk_Double2DParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::set(double,double) - // 1: DoubleParam::set(double) - // 2: Double2DParam::set(double,double,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 1; // set(double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // set(double,double) - } else if (numArgs == 3 - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 2; // set(double,double,double) - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Double2DParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(double x, double y) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(double,double) - cppSelf->set(cppArg0, cppArg1); - } - break; - } - case 1: // set(double x) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(double) - reinterpret_cast(cppSelf)->set(cppArg0); - } - break; - } - case 2: // set(double x, double y, double frame) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // set(double,double,double) - cppSelf->set(cppArg0, cppArg1, cppArg2); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_Double2DParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Double2DParam.set"); - return {}; -} - -static PyObject *Sbk_Double2DParamFunc_setCanAutoFoldDimensions(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Double2DParam::setCanAutoFoldDimensions(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setCanAutoFoldDimensions(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Double2DParamFunc_setCanAutoFoldDimensions_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setCanAutoFoldDimensions(bool) - cppSelf->setCanAutoFoldDimensions(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_Double2DParamFunc_setCanAutoFoldDimensions_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Double2DParam.setCanAutoFoldDimensions"); - return {}; -} - -static PyObject *Sbk_Double2DParamFunc_setUsePointInteract(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Double2DParam::setUsePointInteract(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setUsePointInteract(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Double2DParamFunc_setUsePointInteract_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setUsePointInteract(bool) - cppSelf->setUsePointInteract(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_Double2DParamFunc_setUsePointInteract_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Double2DParam.setUsePointInteract"); - return {}; -} - - -static const char *Sbk_Double2DParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Double2DParam_methods[] = { - {"get", reinterpret_cast(Sbk_Double2DParamFunc_get), METH_VARARGS}, - {"set", reinterpret_cast(Sbk_Double2DParamFunc_set), METH_VARARGS}, - {"setCanAutoFoldDimensions", reinterpret_cast(Sbk_Double2DParamFunc_setCanAutoFoldDimensions), METH_O}, - {"setUsePointInteract", reinterpret_cast(Sbk_Double2DParamFunc_setUsePointInteract), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Double2DParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Double2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Double2DParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Double2DParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Double2DParam_Type = nullptr; -static SbkObjectType *Sbk_Double2DParam_TypeF(void) -{ - return _Sbk_Double2DParam_Type; -} - -static PyType_Slot Sbk_Double2DParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Double2DParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Double2DParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Double2DParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Double2DParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Double2DParam_spec = { - "1:NatronEngine.Double2DParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Double2DParam_slots -}; - -} //extern "C" - -static void *Sbk_Double2DParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::Double2DParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Double2DParam_PythonToCpp_Double2DParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Double2DParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Double2DParam_PythonToCpp_Double2DParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Double2DParam_TypeF()))) - return Double2DParam_PythonToCpp_Double2DParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Double2DParam_PTR_CppToPython_Double2DParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Double2DParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Double2DParam_SignatureStrings[] = { - "1:NatronEngine.Double2DParam.get(self)->NatronEngine.Double2DTuple", - "0:NatronEngine.Double2DParam.get(self,frame:double)->NatronEngine.Double2DTuple", - "2:NatronEngine.Double2DParam.set(self,x:double,y:double)", - "1:NatronEngine.Double2DParam.set(self,x:double)", - "0:NatronEngine.Double2DParam.set(self,x:double,y:double,frame:double)", - "NatronEngine.Double2DParam.setCanAutoFoldDimensions(self,can:bool)", - "NatronEngine.Double2DParam.setUsePointInteract(self,use:bool)", - nullptr}; // Sentinel - -void init_Double2DParam(PyObject *module) -{ - _Sbk_Double2DParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Double2DParam", - "Double2DParam*", - &Sbk_Double2DParam_spec, - &Shiboken::callCppDestructor< ::Double2DParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Double2DParam_Type); - InitSignatureStrings(pyType, Double2DParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Double2DParam_Type), Sbk_Double2DParam_PropertyStrings); - SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX] - = reinterpret_cast(Sbk_Double2DParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Double2DParam_TypeF(), - Double2DParam_PythonToCpp_Double2DParam_PTR, - is_Double2DParam_PythonToCpp_Double2DParam_PTR_Convertible, - Double2DParam_PTR_CppToPython_Double2DParam); - - Shiboken::Conversions::registerConverterName(converter, "Double2DParam"); - Shiboken::Conversions::registerConverterName(converter, "Double2DParam*"); - Shiboken::Conversions::registerConverterName(converter, "Double2DParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Double2DParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::Double2DParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_Double2DParam_TypeF(), &Sbk_Double2DParam_typeDiscovery); - - - Double2DParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/double2dparam_wrapper.h b/Engine/Qt5/NatronEngine/double2dparam_wrapper.h deleted file mode 100644 index d745e6aea1..0000000000 --- a/Engine/Qt5/NatronEngine/double2dparam_wrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef SBK_DOUBLE2DPARAMWRAPPER_H -#define SBK_DOUBLE2DPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class Double2DParamWrapper : public Double2DParam -{ -public: - ~Double2DParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_DOUBLEPARAMWRAPPER_H -# define SBK_DOUBLEPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class DoubleParamWrapper : public DoubleParam -{ -public: - ~DoubleParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_DOUBLEPARAMWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_DOUBLE2DPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/double2dtuple_wrapper.cpp b/Engine/Qt5/NatronEngine/double2dtuple_wrapper.cpp deleted file mode 100644 index 82080c00da..0000000000 --- a/Engine/Qt5/NatronEngine/double2dtuple_wrapper.cpp +++ /dev/null @@ -1,335 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "double2dtuple_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_Double2DTuple_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::Double2DTuple >())) - return -1; - - ::Double2DTuple *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // Double2DTuple() - cptr = new ::Double2DTuple(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::Double2DTuple >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - - -static const char *Sbk_Double2DTuple_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Double2DTuple_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -PyObject* Sbk_Double2DTupleFunc___getitem__(PyObject *self, Py_ssize_t _i) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - // Begin code injection - if (_i < 0 || _i >= 2) { - PyErr_BadArgument(); - return 0; - } else { - double ret; - switch (_i) { - case 0: - ret = cppSelf->x; - break; - case 1: - ret = cppSelf->y; - break; - } - return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - } - - // End of code injection - -} - -static PyObject *Sbk_Double2DTuple_get_x(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Double2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->x); - return pyOut; -} -static int Sbk_Double2DTuple_set_x(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Double2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->x; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_Double2DTuple_get_y(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Double2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->y); - return pyOut; -} -static int Sbk_Double2DTuple_set_y(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Double2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->y; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -// Getters and Setters for Double2DTuple -static PyGetSetDef Sbk_Double2DTuple_getsetlist[] = { - {const_cast("x"), Sbk_Double2DTuple_get_x, Sbk_Double2DTuple_set_x}, - {const_cast("y"), Sbk_Double2DTuple_get_y, Sbk_Double2DTuple_set_y}, - {nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_Double2DTuple_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Double2DTuple_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Double2DTuple_Type = nullptr; -static SbkObjectType *Sbk_Double2DTuple_TypeF(void) -{ - return _Sbk_Double2DTuple_Type; -} - -static PyType_Slot Sbk_Double2DTuple_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_Double2DTuple_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Double2DTuple_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Double2DTuple_methods)}, - {Py_tp_getset, reinterpret_cast(Sbk_Double2DTuple_getsetlist)}, - {Py_tp_init, reinterpret_cast(Sbk_Double2DTuple_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - // type supports sequence protocol - {Py_sq_item, (void *)&Sbk_Double2DTupleFunc___getitem__}, - {0, nullptr} -}; -static PyType_Spec Sbk_Double2DTuple_spec = { - "1:NatronEngine.Double2DTuple", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Double2DTuple_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Double2DTuple_PythonToCpp_Double2DTuple_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Double2DTuple_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Double2DTuple_PythonToCpp_Double2DTuple_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Double2DTuple_TypeF()))) - return Double2DTuple_PythonToCpp_Double2DTuple_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Double2DTuple_PTR_CppToPython_Double2DTuple(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Double2DTuple_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Double2DTuple_SignatureStrings[] = { - "NatronEngine.Double2DTuple(self)", - nullptr}; // Sentinel - -void init_Double2DTuple(PyObject *module) -{ - _Sbk_Double2DTuple_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Double2DTuple", - "Double2DTuple*", - &Sbk_Double2DTuple_spec, - &Shiboken::callCppDestructor< ::Double2DTuple >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Double2DTuple_Type); - InitSignatureStrings(pyType, Double2DTuple_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Double2DTuple_Type), Sbk_Double2DTuple_PropertyStrings); - SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX] - = reinterpret_cast(Sbk_Double2DTuple_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Double2DTuple_TypeF(), - Double2DTuple_PythonToCpp_Double2DTuple_PTR, - is_Double2DTuple_PythonToCpp_Double2DTuple_PTR_Convertible, - Double2DTuple_PTR_CppToPython_Double2DTuple); - - Shiboken::Conversions::registerConverterName(converter, "Double2DTuple"); - Shiboken::Conversions::registerConverterName(converter, "Double2DTuple*"); - Shiboken::Conversions::registerConverterName(converter, "Double2DTuple&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Double2DTuple).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/double2dtuple_wrapper.h b/Engine/Qt5/NatronEngine/double2dtuple_wrapper.h deleted file mode 100644 index bc1a9c9dcf..0000000000 --- a/Engine/Qt5/NatronEngine/double2dtuple_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_DOUBLE2DTUPLE_H -#define SBK_DOUBLE2DTUPLE_H - -#include - -#endif // SBK_DOUBLE2DTUPLE_H - diff --git a/Engine/Qt5/NatronEngine/double3dparam_wrapper.cpp b/Engine/Qt5/NatronEngine/double3dparam_wrapper.cpp deleted file mode 100644 index c66fa6061c..0000000000 --- a/Engine/Qt5/NatronEngine/double3dparam_wrapper.cpp +++ /dev/null @@ -1,441 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "double3dparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void Double3DParamWrapper::pysideInitQtMetaTypes() -{ -} - -void Double3DParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -Double3DParamWrapper::~Double3DParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_Double3DParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double3DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::get()const - // 1: DoubleParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Double3DParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - Double3DTuple* cppResult = new Double3DTuple(const_cast(cppSelf)->get()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX]), cppResult, true, true); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - Double3DTuple* cppResult = new Double3DTuple(const_cast(cppSelf)->get(cppArg0)); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX]), cppResult, true, true); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_Double3DParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Double3DParam.get"); - return {}; -} - -static PyObject *Sbk_Double3DParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double3DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: Double2DParam::set(double,double,double) - // 1: DoubleParam::set(double,double) - // 2: DoubleParam::set(double) - // 3: Double3DParam::set(double,double,double,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 2; // set(double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 1; // set(double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // set(double,double,double) - } else if (numArgs == 4 - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 3; // set(double,double,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Double3DParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(double x, double y, double z) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // set(double,double,double) - // Begin code injection - cppSelf->set(cppArg0,cppArg1,cppArg2); - - // End of code injection - - } - break; - } - case 1: // set(double x, double y) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(double,double) - reinterpret_cast(cppSelf)->set(cppArg0, cppArg1); - } - break; - } - case 2: // set(double x) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(double) - reinterpret_cast(cppSelf)->set(cppArg0); - } - break; - } - case 3: // set(double x, double y, double z, double frame) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // set(double,double,double,double) - // Begin code injection - cppSelf->set(cppArg0,cppArg1,cppArg2,cppArg3); - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_Double3DParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Double3DParam.set"); - return {}; -} - - -static const char *Sbk_Double3DParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Double3DParam_methods[] = { - {"get", reinterpret_cast(Sbk_Double3DParamFunc_get), METH_VARARGS}, - {"set", reinterpret_cast(Sbk_Double3DParamFunc_set), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Double3DParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Double3DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Double3DParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Double3DParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Double3DParam_Type = nullptr; -static SbkObjectType *Sbk_Double3DParam_TypeF(void) -{ - return _Sbk_Double3DParam_Type; -} - -static PyType_Slot Sbk_Double3DParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Double3DParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Double3DParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Double3DParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Double3DParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Double3DParam_spec = { - "1:NatronEngine.Double3DParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Double3DParam_slots -}; - -} //extern "C" - -static void *Sbk_Double3DParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::Double3DParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Double3DParam_PythonToCpp_Double3DParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Double3DParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Double3DParam_PythonToCpp_Double3DParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Double3DParam_TypeF()))) - return Double3DParam_PythonToCpp_Double3DParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Double3DParam_PTR_CppToPython_Double3DParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Double3DParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Double3DParam_SignatureStrings[] = { - "1:NatronEngine.Double3DParam.get(self)->NatronEngine.Double3DTuple", - "0:NatronEngine.Double3DParam.get(self,frame:double)->NatronEngine.Double3DTuple", - "3:NatronEngine.Double3DParam.set(self,x:double,y:double,z:double)", - "2:NatronEngine.Double3DParam.set(self,x:double,y:double)", - "1:NatronEngine.Double3DParam.set(self,x:double)", - "0:NatronEngine.Double3DParam.set(self,x:double,y:double,z:double,frame:double)", - nullptr}; // Sentinel - -void init_Double3DParam(PyObject *module) -{ - _Sbk_Double3DParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Double3DParam", - "Double3DParam*", - &Sbk_Double3DParam_spec, - &Shiboken::callCppDestructor< ::Double3DParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Double3DParam_Type); - InitSignatureStrings(pyType, Double3DParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Double3DParam_Type), Sbk_Double3DParam_PropertyStrings); - SbkNatronEngineTypes[SBK_DOUBLE3DPARAM_IDX] - = reinterpret_cast(Sbk_Double3DParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Double3DParam_TypeF(), - Double3DParam_PythonToCpp_Double3DParam_PTR, - is_Double3DParam_PythonToCpp_Double3DParam_PTR_Convertible, - Double3DParam_PTR_CppToPython_Double3DParam); - - Shiboken::Conversions::registerConverterName(converter, "Double3DParam"); - Shiboken::Conversions::registerConverterName(converter, "Double3DParam*"); - Shiboken::Conversions::registerConverterName(converter, "Double3DParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Double3DParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::Double3DParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_Double3DParam_TypeF(), &Sbk_Double3DParam_typeDiscovery); - - - Double3DParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/double3dparam_wrapper.h b/Engine/Qt5/NatronEngine/double3dparam_wrapper.h deleted file mode 100644 index a3b39879a5..0000000000 --- a/Engine/Qt5/NatronEngine/double3dparam_wrapper.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef SBK_DOUBLE3DPARAMWRAPPER_H -#define SBK_DOUBLE3DPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class Double3DParamWrapper : public Double3DParam -{ -public: - ~Double3DParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_DOUBLE2DPARAMWRAPPER_H -# define SBK_DOUBLE2DPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class Double2DParamWrapper : public Double2DParam -{ -public: - ~Double2DParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_DOUBLE2DPARAMWRAPPER_H - -# ifndef SBK_DOUBLEPARAMWRAPPER_H -# define SBK_DOUBLEPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class DoubleParamWrapper : public DoubleParam -{ -public: - ~DoubleParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_DOUBLEPARAMWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_DOUBLE3DPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/double3dtuple_wrapper.cpp b/Engine/Qt5/NatronEngine/double3dtuple_wrapper.cpp deleted file mode 100644 index 94b21dc04f..0000000000 --- a/Engine/Qt5/NatronEngine/double3dtuple_wrapper.cpp +++ /dev/null @@ -1,371 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "double3dtuple_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_Double3DTuple_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::Double3DTuple >())) - return -1; - - ::Double3DTuple *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // Double3DTuple() - cptr = new ::Double3DTuple(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::Double3DTuple >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - - -static const char *Sbk_Double3DTuple_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Double3DTuple_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -PyObject* Sbk_Double3DTupleFunc___getitem__(PyObject *self, Py_ssize_t _i) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Double3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - // Begin code injection - if (_i < 0 || _i >= 3) { - PyErr_BadArgument(); - return 0; - } else { - double ret; - switch (_i) { - case 0: - ret = cppSelf->x; - break; - case 1: - ret = cppSelf->y; - break; - case 2: - ret = cppSelf->z; - break; - } - return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - } - - // End of code injection - -} - -static PyObject *Sbk_Double3DTuple_get_x(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Double3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->x); - return pyOut; -} -static int Sbk_Double3DTuple_set_x(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Double3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->x; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_Double3DTuple_get_y(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Double3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->y); - return pyOut; -} -static int Sbk_Double3DTuple_set_y(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Double3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->y; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_Double3DTuple_get_z(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Double3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->z); - return pyOut; -} -static int Sbk_Double3DTuple_set_z(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Double3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'z' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'z', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->z; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -// Getters and Setters for Double3DTuple -static PyGetSetDef Sbk_Double3DTuple_getsetlist[] = { - {const_cast("x"), Sbk_Double3DTuple_get_x, Sbk_Double3DTuple_set_x}, - {const_cast("y"), Sbk_Double3DTuple_get_y, Sbk_Double3DTuple_set_y}, - {const_cast("z"), Sbk_Double3DTuple_get_z, Sbk_Double3DTuple_set_z}, - {nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_Double3DTuple_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Double3DTuple_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Double3DTuple_Type = nullptr; -static SbkObjectType *Sbk_Double3DTuple_TypeF(void) -{ - return _Sbk_Double3DTuple_Type; -} - -static PyType_Slot Sbk_Double3DTuple_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_Double3DTuple_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Double3DTuple_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Double3DTuple_methods)}, - {Py_tp_getset, reinterpret_cast(Sbk_Double3DTuple_getsetlist)}, - {Py_tp_init, reinterpret_cast(Sbk_Double3DTuple_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - // type supports sequence protocol - {Py_sq_item, (void *)&Sbk_Double3DTupleFunc___getitem__}, - {0, nullptr} -}; -static PyType_Spec Sbk_Double3DTuple_spec = { - "1:NatronEngine.Double3DTuple", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Double3DTuple_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Double3DTuple_PythonToCpp_Double3DTuple_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Double3DTuple_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Double3DTuple_PythonToCpp_Double3DTuple_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Double3DTuple_TypeF()))) - return Double3DTuple_PythonToCpp_Double3DTuple_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Double3DTuple_PTR_CppToPython_Double3DTuple(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Double3DTuple_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Double3DTuple_SignatureStrings[] = { - "NatronEngine.Double3DTuple(self)", - nullptr}; // Sentinel - -void init_Double3DTuple(PyObject *module) -{ - _Sbk_Double3DTuple_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Double3DTuple", - "Double3DTuple*", - &Sbk_Double3DTuple_spec, - &Shiboken::callCppDestructor< ::Double3DTuple >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Double3DTuple_Type); - InitSignatureStrings(pyType, Double3DTuple_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Double3DTuple_Type), Sbk_Double3DTuple_PropertyStrings); - SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX] - = reinterpret_cast(Sbk_Double3DTuple_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Double3DTuple_TypeF(), - Double3DTuple_PythonToCpp_Double3DTuple_PTR, - is_Double3DTuple_PythonToCpp_Double3DTuple_PTR_Convertible, - Double3DTuple_PTR_CppToPython_Double3DTuple); - - Shiboken::Conversions::registerConverterName(converter, "Double3DTuple"); - Shiboken::Conversions::registerConverterName(converter, "Double3DTuple*"); - Shiboken::Conversions::registerConverterName(converter, "Double3DTuple&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Double3DTuple).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/double3dtuple_wrapper.h b/Engine/Qt5/NatronEngine/double3dtuple_wrapper.h deleted file mode 100644 index 12b5054ba6..0000000000 --- a/Engine/Qt5/NatronEngine/double3dtuple_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_DOUBLE3DTUPLE_H -#define SBK_DOUBLE3DTUPLE_H - -#include - -#endif // SBK_DOUBLE3DTUPLE_H - diff --git a/Engine/Qt5/NatronEngine/doubleparam_wrapper.cpp b/Engine/Qt5/NatronEngine/doubleparam_wrapper.cpp deleted file mode 100644 index 9b67911c6f..0000000000 --- a/Engine/Qt5/NatronEngine/doubleparam_wrapper.cpp +++ /dev/null @@ -1,1593 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "doubleparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void DoubleParamWrapper::pysideInitQtMetaTypes() -{ -} - -void DoubleParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -DoubleParamWrapper::~DoubleParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_DoubleParamFunc_addAsDependencyOf(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addAsDependencyOf", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::addAsDependencyOf(int,Param*,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // addAsDependencyOf(int,Param*,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_addAsDependencyOf_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Param *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // addAsDependencyOf(int,Param*,int) - double cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_addAsDependencyOf_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.addAsDependencyOf"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::get()const - // 1: DoubleParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - double cppResult = const_cast(cppSelf)->get(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - double cppResult = const_cast(cppSelf)->get(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.get"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_getDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getDefaultValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getDefaultValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::getDefaultValue(int)const - if (numArgs == 0) { - overloadId = 0; // getDefaultValue(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getDefaultValue(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_getDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_DoubleParamFunc_getDefaultValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getDefaultValue(int)const - double cppResult = const_cast(cppSelf)->getDefaultValue(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_getDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.getDefaultValue"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_getDisplayMaximum(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: DoubleParam::getDisplayMaximum(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getDisplayMaximum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_getDisplayMaximum_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getDisplayMaximum(int)const - double cppResult = const_cast(cppSelf)->getDisplayMaximum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_getDisplayMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.DoubleParam.getDisplayMaximum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_getDisplayMinimum(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: DoubleParam::getDisplayMinimum(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getDisplayMinimum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_getDisplayMinimum_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getDisplayMinimum(int)const - double cppResult = const_cast(cppSelf)->getDisplayMinimum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_getDisplayMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.DoubleParam.getDisplayMinimum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_getMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getMaximum(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getMaximum", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::getMaximum(int)const - if (numArgs == 0) { - overloadId = 0; // getMaximum(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getMaximum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_getMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_DoubleParamFunc_getMaximum_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getMaximum(int)const - double cppResult = const_cast(cppSelf)->getMaximum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_getMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.getMaximum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_getMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getMinimum(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getMinimum", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::getMinimum(int)const - if (numArgs == 0) { - overloadId = 0; // getMinimum(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getMinimum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_getMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_DoubleParamFunc_getMinimum_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getMinimum(int)const - double cppResult = const_cast(cppSelf)->getMinimum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_getMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.getMinimum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_getValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::getValue(int)const - if (numArgs == 0) { - overloadId = 0; // getValue(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getValue(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_getValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_DoubleParamFunc_getValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getValue(int)const - double cppResult = const_cast(cppSelf)->getValue(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_getValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.getValue"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_getValueAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getValueAtTime(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getValueAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:getValueAtTime", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::getValueAtTime(double,int)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // getValueAtTime(double,int)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getValueAtTime(double,int)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_getValueAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.getValueAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_DoubleParamFunc_getValueAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getValueAtTime(double,int)const - double cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_DoubleParamFunc_getValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.getValueAtTime"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_restoreDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.restoreDefaultValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:restoreDefaultValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::restoreDefaultValue(int) - if (numArgs == 0) { - overloadId = 0; // restoreDefaultValue(int) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // restoreDefaultValue(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_restoreDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.restoreDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_DoubleParamFunc_restoreDefaultValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // restoreDefaultValue(int) - cppSelf->restoreDefaultValue(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_restoreDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.restoreDefaultValue"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::set(double) - // 1: DoubleParam::set(double,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // set(double) - } else if (numArgs == 2 - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 1; // set(double,double) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(double x) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(double) - cppSelf->set(cppArg0); - } - break; - } - case 1: // set(double x, double frame) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(double,double) - cppSelf->set(cppArg0, cppArg1); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.set"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_setDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDefaultValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDefaultValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDefaultValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::setDefaultValue(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDefaultValue(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDefaultValue(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_setDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_DoubleParamFunc_setDefaultValue_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDefaultValue(double,int) - cppSelf->setDefaultValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_setDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.setDefaultValue"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_setDisplayMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDisplayMaximum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDisplayMaximum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDisplayMaximum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::setDisplayMaximum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDisplayMaximum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDisplayMaximum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_setDisplayMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDisplayMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_DoubleParamFunc_setDisplayMaximum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDisplayMaximum(double,int) - cppSelf->setDisplayMaximum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_setDisplayMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.setDisplayMaximum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_setDisplayMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDisplayMinimum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDisplayMinimum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDisplayMinimum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::setDisplayMinimum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDisplayMinimum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDisplayMinimum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_setDisplayMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setDisplayMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_DoubleParamFunc_setDisplayMinimum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDisplayMinimum(double,int) - cppSelf->setDisplayMinimum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_setDisplayMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.setDisplayMinimum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_setMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setMaximum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setMaximum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setMaximum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::setMaximum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setMaximum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setMaximum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_setMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_DoubleParamFunc_setMaximum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setMaximum(double,int) - cppSelf->setMaximum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_setMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.setMaximum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_setMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setMinimum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setMinimum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setMinimum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::setMinimum(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setMinimum(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setMinimum(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_setMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_DoubleParamFunc_setMinimum_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setMinimum(double,int) - cppSelf->setMinimum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_setMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.setMinimum"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_setValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::setValue(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setValue(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValue(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_setValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_DoubleParamFunc_setValue_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValue(double,int) - cppSelf->setValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.setValue"); - return {}; -} - -static PyObject *Sbk_DoubleParamFunc_setValueAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setValueAtTime(): too many arguments"); - return {}; - } else if (numArgs < 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setValueAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:setValueAtTime", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: DoubleParam::setValueAtTime(double,double,int) - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // setValueAtTime(double,double,int) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setValueAtTime(double,double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_DoubleParamFunc_setValueAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.DoubleParam.setValueAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_DoubleParamFunc_setValueAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2 = 0; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setValueAtTime(double,double,int) - cppSelf->setValueAtTime(cppArg0, cppArg1, cppArg2); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_DoubleParamFunc_setValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.DoubleParam.setValueAtTime"); - return {}; -} - - -static const char *Sbk_DoubleParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_DoubleParam_methods[] = { - {"addAsDependencyOf", reinterpret_cast(Sbk_DoubleParamFunc_addAsDependencyOf), METH_VARARGS}, - {"get", reinterpret_cast(Sbk_DoubleParamFunc_get), METH_VARARGS}, - {"getDefaultValue", reinterpret_cast(Sbk_DoubleParamFunc_getDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"getDisplayMaximum", reinterpret_cast(Sbk_DoubleParamFunc_getDisplayMaximum), METH_O}, - {"getDisplayMinimum", reinterpret_cast(Sbk_DoubleParamFunc_getDisplayMinimum), METH_O}, - {"getMaximum", reinterpret_cast(Sbk_DoubleParamFunc_getMaximum), METH_VARARGS|METH_KEYWORDS}, - {"getMinimum", reinterpret_cast(Sbk_DoubleParamFunc_getMinimum), METH_VARARGS|METH_KEYWORDS}, - {"getValue", reinterpret_cast(Sbk_DoubleParamFunc_getValue), METH_VARARGS|METH_KEYWORDS}, - {"getValueAtTime", reinterpret_cast(Sbk_DoubleParamFunc_getValueAtTime), METH_VARARGS|METH_KEYWORDS}, - {"restoreDefaultValue", reinterpret_cast(Sbk_DoubleParamFunc_restoreDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"set", reinterpret_cast(Sbk_DoubleParamFunc_set), METH_VARARGS}, - {"setDefaultValue", reinterpret_cast(Sbk_DoubleParamFunc_setDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"setDisplayMaximum", reinterpret_cast(Sbk_DoubleParamFunc_setDisplayMaximum), METH_VARARGS|METH_KEYWORDS}, - {"setDisplayMinimum", reinterpret_cast(Sbk_DoubleParamFunc_setDisplayMinimum), METH_VARARGS|METH_KEYWORDS}, - {"setMaximum", reinterpret_cast(Sbk_DoubleParamFunc_setMaximum), METH_VARARGS|METH_KEYWORDS}, - {"setMinimum", reinterpret_cast(Sbk_DoubleParamFunc_setMinimum), METH_VARARGS|METH_KEYWORDS}, - {"setValue", reinterpret_cast(Sbk_DoubleParamFunc_setValue), METH_VARARGS|METH_KEYWORDS}, - {"setValueAtTime", reinterpret_cast(Sbk_DoubleParamFunc_setValueAtTime), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_DoubleParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::DoubleParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_DoubleParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_DoubleParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_DoubleParam_Type = nullptr; -static SbkObjectType *Sbk_DoubleParam_TypeF(void) -{ - return _Sbk_DoubleParam_Type; -} - -static PyType_Slot Sbk_DoubleParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_DoubleParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_DoubleParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_DoubleParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_DoubleParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_DoubleParam_spec = { - "1:NatronEngine.DoubleParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_DoubleParam_slots -}; - -} //extern "C" - -static void *Sbk_DoubleParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::DoubleParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void DoubleParam_PythonToCpp_DoubleParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_DoubleParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_DoubleParam_PythonToCpp_DoubleParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_DoubleParam_TypeF()))) - return DoubleParam_PythonToCpp_DoubleParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *DoubleParam_PTR_CppToPython_DoubleParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_DoubleParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *DoubleParam_SignatureStrings[] = { - "NatronEngine.DoubleParam.addAsDependencyOf(self,fromExprDimension:int,param:NatronEngine.Param,thisDimension:int)->double", - "1:NatronEngine.DoubleParam.get(self)->double", - "0:NatronEngine.DoubleParam.get(self,frame:double)->double", - "NatronEngine.DoubleParam.getDefaultValue(self,dimension:int=0)->double", - "NatronEngine.DoubleParam.getDisplayMaximum(self,dimension:int)->double", - "NatronEngine.DoubleParam.getDisplayMinimum(self,dimension:int)->double", - "NatronEngine.DoubleParam.getMaximum(self,dimension:int=0)->double", - "NatronEngine.DoubleParam.getMinimum(self,dimension:int=0)->double", - "NatronEngine.DoubleParam.getValue(self,dimension:int=0)->double", - "NatronEngine.DoubleParam.getValueAtTime(self,time:double,dimension:int=0)->double", - "NatronEngine.DoubleParam.restoreDefaultValue(self,dimension:int=0)", - "1:NatronEngine.DoubleParam.set(self,x:double)", - "0:NatronEngine.DoubleParam.set(self,x:double,frame:double)", - "NatronEngine.DoubleParam.setDefaultValue(self,value:double,dimension:int=0)", - "NatronEngine.DoubleParam.setDisplayMaximum(self,maximum:double,dimension:int=0)", - "NatronEngine.DoubleParam.setDisplayMinimum(self,minimum:double,dimension:int=0)", - "NatronEngine.DoubleParam.setMaximum(self,maximum:double,dimension:int=0)", - "NatronEngine.DoubleParam.setMinimum(self,minimum:double,dimension:int=0)", - "NatronEngine.DoubleParam.setValue(self,value:double,dimension:int=0)", - "NatronEngine.DoubleParam.setValueAtTime(self,value:double,time:double,dimension:int=0)", - nullptr}; // Sentinel - -void init_DoubleParam(PyObject *module) -{ - _Sbk_DoubleParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "DoubleParam", - "DoubleParam*", - &Sbk_DoubleParam_spec, - &Shiboken::callCppDestructor< ::DoubleParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_DoubleParam_Type); - InitSignatureStrings(pyType, DoubleParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_DoubleParam_Type), Sbk_DoubleParam_PropertyStrings); - SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX] - = reinterpret_cast(Sbk_DoubleParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_DoubleParam_TypeF(), - DoubleParam_PythonToCpp_DoubleParam_PTR, - is_DoubleParam_PythonToCpp_DoubleParam_PTR_Convertible, - DoubleParam_PTR_CppToPython_DoubleParam); - - Shiboken::Conversions::registerConverterName(converter, "DoubleParam"); - Shiboken::Conversions::registerConverterName(converter, "DoubleParam*"); - Shiboken::Conversions::registerConverterName(converter, "DoubleParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::DoubleParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::DoubleParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_DoubleParam_TypeF(), &Sbk_DoubleParam_typeDiscovery); - - - DoubleParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/doubleparam_wrapper.h b/Engine/Qt5/NatronEngine/doubleparam_wrapper.h deleted file mode 100644 index 9d06948d21..0000000000 --- a/Engine/Qt5/NatronEngine/doubleparam_wrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SBK_DOUBLEPARAMWRAPPER_H -#define SBK_DOUBLEPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class DoubleParamWrapper : public DoubleParam -{ -public: - ~DoubleParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_DOUBLEPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/effect_wrapper.cpp b/Engine/Qt5/NatronEngine/effect_wrapper.cpp deleted file mode 100644 index 33970997c2..0000000000 --- a/Engine/Qt5/NatronEngine/effect_wrapper.cpp +++ /dev/null @@ -1,1869 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "effect_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void EffectWrapper::pysideInitQtMetaTypes() -{ -} - -void EffectWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -EffectWrapper::~EffectWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_EffectFunc_addUserPlane(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addUserPlane", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::addUserPlane(QString,QStringList) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[1])))) { - overloadId = 0; // addUserPlane(QString,QStringList) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_addUserPlane_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QStringList cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // addUserPlane(QString,QStringList) - bool cppResult = cppSelf->addUserPlane(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_addUserPlane_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.addUserPlane"); - return {}; -} - -static PyObject *Sbk_EffectFunc_beginChanges(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // beginChanges() - cppSelf->beginChanges(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_EffectFunc_canConnectInput(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "canConnectInput", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::canConnectInput(int,const Effect*)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), (pyArgs[1])))) { - overloadId = 0; // canConnectInput(int,const Effect*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_canConnectInput_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Effect *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // canConnectInput(int,const Effect*)const - bool cppResult = const_cast(cppSelf)->canConnectInput(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_canConnectInput_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.canConnectInput"); - return {}; -} - -static PyObject *Sbk_EffectFunc_connectInput(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "connectInput", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::connectInput(int,const Effect*) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), (pyArgs[1])))) { - overloadId = 0; // connectInput(int,const Effect*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_connectInput_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Effect *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // connectInput(int,const Effect*) - // Begin code injection - bool cppResult = cppSelf->connectInput(cppArg0,cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_connectInput_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.connectInput"); - return {}; -} - -static PyObject *Sbk_EffectFunc_destroy(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Effect.destroy(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:destroy", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::destroy(bool) - if (numArgs == 0) { - overloadId = 0; // destroy(bool) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // destroy(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_destroy_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","autoReconnect"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Effect.destroy(): got multiple values for keyword argument 'autoReconnect'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_EffectFunc_destroy_TypeError; - } - } - } - bool cppArg0 = true; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // destroy(bool) - // Begin code injection - cppSelf->destroy(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_destroy_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.destroy"); - return {}; -} - -static PyObject *Sbk_EffectFunc_disconnectInput(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::disconnectInput(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // disconnectInput(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_disconnectInput_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // disconnectInput(int) - // Begin code injection - cppSelf->disconnectInput(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_disconnectInput_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.disconnectInput"); - return {}; -} - -static PyObject *Sbk_EffectFunc_endChanges(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // endChanges() - cppSelf->endChanges(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_EffectFunc_getAvailableLayers(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::getAvailableLayers(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getAvailableLayers(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_getAvailableLayers_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getAvailableLayers(int)const - std::list cppResult = const_cast(cppSelf)->getAvailableLayers(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_IMAGELAYER_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_getAvailableLayers_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.getAvailableLayers"); - return {}; -} - -static PyObject *Sbk_EffectFunc_getBitDepth(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getBitDepth()const - NATRON_ENUM::ImageBitDepthEnum cppResult = NATRON_ENUM::ImageBitDepthEnum(const_cast(cppSelf)->getBitDepth()); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getColor(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getColor(double*,double*,double*)const - // Begin code injection - double r,g,b; - cppSelf->getColor(&r,&g,&b); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &r)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &g)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &b)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getCurrentTime(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCurrentTime()const - int cppResult = const_cast(cppSelf)->getCurrentTime(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getFrameRate(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getFrameRate()const - double cppResult = const_cast(cppSelf)->getFrameRate(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getInput(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::getInput(QString)const - // 1: Effect::getInput(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 1; // getInput(int)const - } else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getInput(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_getInput_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // getInput(const QString & inputLabel) const - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getInput(QString)const - Effect * cppResult = const_cast(cppSelf)->getInput(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - break; - } - case 1: // getInput(int inputNumber) const - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getInput(int)const - Effect * cppResult = const_cast(cppSelf)->getInput(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_getInput_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.getInput"); - return {}; -} - -static PyObject *Sbk_EffectFunc_getInputLabel(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::getInputLabel(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getInputLabel(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_getInputLabel_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getInputLabel(int) - QString cppResult = cppSelf->getInputLabel(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_getInputLabel_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.getInputLabel"); - return {}; -} - -static PyObject *Sbk_EffectFunc_getLabel(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getLabel()const - QString cppResult = const_cast(cppSelf)->getLabel(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getMaxInputCount(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getMaxInputCount()const - int cppResult = const_cast(cppSelf)->getMaxInputCount(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getOutputFormat(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getOutputFormat()const - RectI* cppResult = new RectI(const_cast(cppSelf)->getOutputFormat()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), cppResult, true, true); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::getParam(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getParam(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_getParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getParam(QString)const - Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_getParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.getParam"); - return {}; -} - -static PyObject *Sbk_EffectFunc_getParams(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getParams()const - // Begin code injection - std::list params = cppSelf->getParams(); - PyObject* ret = PyList_New((int) params.size()); - int idx = 0; - for (std::list::iterator it = params.begin(); it!=params.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getPixelAspectRatio(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getPixelAspectRatio()const - double cppResult = const_cast(cppSelf)->getPixelAspectRatio(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getPluginID(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getPluginID()const - QString cppResult = const_cast(cppSelf)->getPluginID(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getPosition(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getPosition(double*,double*)const - // Begin code injection - double x,y; - cppSelf->getPosition(&x,&y); - pyResult = PyTuple_New(2); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &y)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getPremult(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getPremult()const - NATRON_ENUM::ImagePremultiplicationEnum cppResult = NATRON_ENUM::ImagePremultiplicationEnum(const_cast(cppSelf)->getPremult()); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getRegionOfDefinition(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "getRegionOfDefinition", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::getRegionOfDefinition(double,int)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getRegionOfDefinition(double,int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_getRegionOfDefinition_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getRegionOfDefinition(double,int)const - RectD* cppResult = new RectD(const_cast(cppSelf)->getRegionOfDefinition(cppArg0, cppArg1)); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), cppResult, true, true); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_getRegionOfDefinition_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.getRegionOfDefinition"); - return {}; -} - -static PyObject *Sbk_EffectFunc_getRotoContext(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getRotoContext()const - Roto * cppResult = const_cast(cppSelf)->getRotoContext(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_ROTO_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getScriptName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getScriptName()const - QString cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getSize(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getSize(double*,double*)const - // Begin code injection - double x,y; - cppSelf->getSize(&x,&y); - pyResult = PyTuple_New(2); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &y)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getTrackerContext(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getTrackerContext()const - Tracker * cppResult = const_cast(cppSelf)->getTrackerContext(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_TRACKER_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_getUserPageParam(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getUserPageParam()const - PageParam * cppResult = const_cast(cppSelf)->getUserPageParam(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PAGEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_isNodeSelected(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isNodeSelected()const - bool cppResult = const_cast(cppSelf)->isNodeSelected(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_isOutputNode(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isOutputNode() - bool cppResult = cppSelf->isOutputNode(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_isReaderNode(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isReaderNode() - bool cppResult = cppSelf->isReaderNode(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_isWriterNode(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isWriterNode() - bool cppResult = cppSelf->isWriterNode(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_EffectFunc_setColor(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setColor", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::setColor(double,double,double) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setColor(double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_setColor_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setColor(double,double,double) - cppSelf->setColor(cppArg0, cppArg1, cppArg2); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_setColor_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.setColor"); - return {}; -} - -static PyObject *Sbk_EffectFunc_setLabel(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::setLabel(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setLabel(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_setLabel_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setLabel(QString) - // Begin code injection - cppSelf->setLabel(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_setLabel_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.setLabel"); - return {}; -} - -static PyObject *Sbk_EffectFunc_setPagesOrder(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::setPagesOrder(QStringList) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArg)))) { - overloadId = 0; // setPagesOrder(QStringList) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_setPagesOrder_TypeError; - - // Call function/method - { - ::QStringList cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setPagesOrder(QStringList) - cppSelf->setPagesOrder(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_setPagesOrder_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.setPagesOrder"); - return {}; -} - -static PyObject *Sbk_EffectFunc_setPosition(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setPosition", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::setPosition(double,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setPosition(double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_setPosition_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setPosition(double,double) - cppSelf->setPosition(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_setPosition_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.setPosition"); - return {}; -} - -static PyObject *Sbk_EffectFunc_setScriptName(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::setScriptName(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setScriptName(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_setScriptName_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setScriptName(QString) - // Begin code injection - bool cppResult = cppSelf->setScriptName(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_EffectFunc_setScriptName_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.setScriptName"); - return {}; -} - -static PyObject *Sbk_EffectFunc_setSize(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setSize", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Effect::setSize(double,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setSize(double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_setSize_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setSize(double,double) - cppSelf->setSize(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_setSize_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Effect.setSize"); - return {}; -} - -static PyObject *Sbk_EffectFunc_setSubGraphEditable(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Effect::setSubGraphEditable(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setSubGraphEditable(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_EffectFunc_setSubGraphEditable_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setSubGraphEditable(bool) - cppSelf->setSubGraphEditable(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_EffectFunc_setSubGraphEditable_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Effect.setSubGraphEditable"); - return {}; -} - - -static const char *Sbk_Effect_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Effect_methods[] = { - {"addUserPlane", reinterpret_cast(Sbk_EffectFunc_addUserPlane), METH_VARARGS}, - {"beginChanges", reinterpret_cast(Sbk_EffectFunc_beginChanges), METH_NOARGS}, - {"canConnectInput", reinterpret_cast(Sbk_EffectFunc_canConnectInput), METH_VARARGS}, - {"connectInput", reinterpret_cast(Sbk_EffectFunc_connectInput), METH_VARARGS}, - {"destroy", reinterpret_cast(Sbk_EffectFunc_destroy), METH_VARARGS|METH_KEYWORDS}, - {"disconnectInput", reinterpret_cast(Sbk_EffectFunc_disconnectInput), METH_O}, - {"endChanges", reinterpret_cast(Sbk_EffectFunc_endChanges), METH_NOARGS}, - {"getAvailableLayers", reinterpret_cast(Sbk_EffectFunc_getAvailableLayers), METH_O}, - {"getBitDepth", reinterpret_cast(Sbk_EffectFunc_getBitDepth), METH_NOARGS}, - {"getColor", reinterpret_cast(Sbk_EffectFunc_getColor), METH_NOARGS}, - {"getCurrentTime", reinterpret_cast(Sbk_EffectFunc_getCurrentTime), METH_NOARGS}, - {"getFrameRate", reinterpret_cast(Sbk_EffectFunc_getFrameRate), METH_NOARGS}, - {"getInput", reinterpret_cast(Sbk_EffectFunc_getInput), METH_O}, - {"getInputLabel", reinterpret_cast(Sbk_EffectFunc_getInputLabel), METH_O}, - {"getLabel", reinterpret_cast(Sbk_EffectFunc_getLabel), METH_NOARGS}, - {"getMaxInputCount", reinterpret_cast(Sbk_EffectFunc_getMaxInputCount), METH_NOARGS}, - {"getOutputFormat", reinterpret_cast(Sbk_EffectFunc_getOutputFormat), METH_NOARGS}, - {"getParam", reinterpret_cast(Sbk_EffectFunc_getParam), METH_O}, - {"getParams", reinterpret_cast(Sbk_EffectFunc_getParams), METH_NOARGS}, - {"getPixelAspectRatio", reinterpret_cast(Sbk_EffectFunc_getPixelAspectRatio), METH_NOARGS}, - {"getPluginID", reinterpret_cast(Sbk_EffectFunc_getPluginID), METH_NOARGS}, - {"getPosition", reinterpret_cast(Sbk_EffectFunc_getPosition), METH_NOARGS}, - {"getPremult", reinterpret_cast(Sbk_EffectFunc_getPremult), METH_NOARGS}, - {"getRegionOfDefinition", reinterpret_cast(Sbk_EffectFunc_getRegionOfDefinition), METH_VARARGS}, - {"getRotoContext", reinterpret_cast(Sbk_EffectFunc_getRotoContext), METH_NOARGS}, - {"getScriptName", reinterpret_cast(Sbk_EffectFunc_getScriptName), METH_NOARGS}, - {"getSize", reinterpret_cast(Sbk_EffectFunc_getSize), METH_NOARGS}, - {"getTrackerContext", reinterpret_cast(Sbk_EffectFunc_getTrackerContext), METH_NOARGS}, - {"getUserPageParam", reinterpret_cast(Sbk_EffectFunc_getUserPageParam), METH_NOARGS}, - {"isNodeSelected", reinterpret_cast(Sbk_EffectFunc_isNodeSelected), METH_NOARGS}, - {"isOutputNode", reinterpret_cast(Sbk_EffectFunc_isOutputNode), METH_NOARGS}, - {"isReaderNode", reinterpret_cast(Sbk_EffectFunc_isReaderNode), METH_NOARGS}, - {"isWriterNode", reinterpret_cast(Sbk_EffectFunc_isWriterNode), METH_NOARGS}, - {"setColor", reinterpret_cast(Sbk_EffectFunc_setColor), METH_VARARGS}, - {"setLabel", reinterpret_cast(Sbk_EffectFunc_setLabel), METH_O}, - {"setPagesOrder", reinterpret_cast(Sbk_EffectFunc_setPagesOrder), METH_O}, - {"setPosition", reinterpret_cast(Sbk_EffectFunc_setPosition), METH_VARARGS}, - {"setScriptName", reinterpret_cast(Sbk_EffectFunc_setScriptName), METH_O}, - {"setSize", reinterpret_cast(Sbk_EffectFunc_setSize), METH_VARARGS}, - {"setSubGraphEditable", reinterpret_cast(Sbk_EffectFunc_setSubGraphEditable), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Effect_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Effect *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EFFECT_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Effect_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Effect_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -static int mi_offsets[] = { -1, -1, -1, -1, -1 }; -int * -Sbk_Effect_mi_init(const void *cptr) -{ - if (mi_offsets[0] == -1) { - std::set offsets; - const auto *class_ptr = reinterpret_cast(cptr); - const auto base = reinterpret_cast(class_ptr); - offsets.insert(int(reinterpret_cast(static_cast(class_ptr)) - base)); - offsets.insert(int(reinterpret_cast(static_cast(static_cast(static_cast(class_ptr)))) - base)); - offsets.insert(int(reinterpret_cast(static_cast(class_ptr)) - base)); - offsets.insert(int(reinterpret_cast(static_cast(static_cast(static_cast(class_ptr)))) - base)); - - offsets.erase(0); - - std::copy(offsets.cbegin(), offsets.cend(), mi_offsets); - } - return mi_offsets; -} -static void * Sbk_EffectSpecialCastFunction(void *obj, SbkObjectType *desiredType) -{ - auto me = reinterpret_cast< ::Effect *>(obj); - if (desiredType == reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX])) - return static_cast< ::Group *>(me); - else if (desiredType == reinterpret_cast(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX])) - return static_cast< ::UserParamHolder *>(me); - return me; -} - - -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Effect_Type = nullptr; -static SbkObjectType *Sbk_Effect_TypeF(void) -{ - return _Sbk_Effect_Type; -} - -static PyType_Slot Sbk_Effect_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Effect_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Effect_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Effect_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Effect_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Effect_spec = { - "1:NatronEngine.Effect", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Effect_slots -}; - -} //extern "C" - -static void *Sbk_Effect_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Group >())) - return dynamic_cast< ::Effect *>(reinterpret_cast< ::Group *>(cptr)); - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::UserParamHolder >())) - return dynamic_cast< ::Effect *>(reinterpret_cast< ::UserParamHolder *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Effect_PythonToCpp_Effect_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Effect_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Effect_PythonToCpp_Effect_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Effect_TypeF()))) - return Effect_PythonToCpp_Effect_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Effect_PTR_CppToPython_Effect(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Effect_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Effect_SignatureStrings[] = { - "NatronEngine.Effect.addUserPlane(self,planeName:QString,channels:QStringList)->bool", - "NatronEngine.Effect.beginChanges(self)", - "NatronEngine.Effect.canConnectInput(self,inputNumber:int,node:NatronEngine.Effect)->bool", - "NatronEngine.Effect.connectInput(self,inputNumber:int,input:NatronEngine.Effect)->bool", - "NatronEngine.Effect.destroy(self,autoReconnect:bool=true)", - "NatronEngine.Effect.disconnectInput(self,inputNumber:int)", - "NatronEngine.Effect.endChanges(self)", - "NatronEngine.Effect.getAvailableLayers(self,inputNb:int)->std.list[NatronEngine.ImageLayer]", - "NatronEngine.Effect.getBitDepth(self)->NatronEngine.NATRON_ENUM.ImageBitDepthEnum", - "NatronEngine.Effect.getColor(self,r:double*,g:double*,b:double*)", - "NatronEngine.Effect.getCurrentTime(self)->int", - "NatronEngine.Effect.getFrameRate(self)->double", - "1:NatronEngine.Effect.getInput(self,inputLabel:QString)->NatronEngine.Effect", - "0:NatronEngine.Effect.getInput(self,inputNumber:int)->NatronEngine.Effect", - "NatronEngine.Effect.getInputLabel(self,inputNumber:int)->QString", - "NatronEngine.Effect.getLabel(self)->QString", - "NatronEngine.Effect.getMaxInputCount(self)->int", - "NatronEngine.Effect.getOutputFormat(self)->NatronEngine.RectI", - "NatronEngine.Effect.getParam(self,name:QString)->NatronEngine.Param", - "NatronEngine.Effect.getParams(self)->std.list[NatronEngine.Param]", - "NatronEngine.Effect.getPixelAspectRatio(self)->double", - "NatronEngine.Effect.getPluginID(self)->QString", - "NatronEngine.Effect.getPosition(self,x:double*,y:double*)", - "NatronEngine.Effect.getPremult(self)->NatronEngine.NATRON_ENUM.ImagePremultiplicationEnum", - "NatronEngine.Effect.getRegionOfDefinition(self,time:double,view:int)->NatronEngine.RectD", - "NatronEngine.Effect.getRotoContext(self)->NatronEngine.Roto", - "NatronEngine.Effect.getScriptName(self)->QString", - "NatronEngine.Effect.getSize(self,w:double*,h:double*)", - "NatronEngine.Effect.getTrackerContext(self)->NatronEngine.Tracker", - "NatronEngine.Effect.getUserPageParam(self)->NatronEngine.PageParam", - "NatronEngine.Effect.isNodeSelected(self)->bool", - "NatronEngine.Effect.isOutputNode(self)->bool", - "NatronEngine.Effect.isReaderNode(self)->bool", - "NatronEngine.Effect.isWriterNode(self)->bool", - "NatronEngine.Effect.setColor(self,r:double,g:double,b:double)", - "NatronEngine.Effect.setLabel(self,name:QString)", - "NatronEngine.Effect.setPagesOrder(self,pages:QStringList)", - "NatronEngine.Effect.setPosition(self,x:double,y:double)", - "NatronEngine.Effect.setScriptName(self,scriptName:QString)->bool", - "NatronEngine.Effect.setSize(self,w:double,h:double)", - "NatronEngine.Effect.setSubGraphEditable(self,editable:bool)", - nullptr}; // Sentinel - -void init_Effect(PyObject *module) -{ - PyObject *Sbk_Effect_Type_bases = PyTuple_Pack(2, - reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), - reinterpret_cast(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX])); - - _Sbk_Effect_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Effect", - "Effect*", - &Sbk_Effect_spec, - &Shiboken::callCppDestructor< ::Effect >, - reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), - Sbk_Effect_Type_bases, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Effect_Type); - InitSignatureStrings(pyType, Effect_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Effect_Type), Sbk_Effect_PropertyStrings); - SbkNatronEngineTypes[SBK_EFFECT_IDX] - = reinterpret_cast(Sbk_Effect_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Effect_TypeF(), - Effect_PythonToCpp_Effect_PTR, - is_Effect_PythonToCpp_Effect_PTR_Convertible, - Effect_PTR_CppToPython_Effect); - - Shiboken::Conversions::registerConverterName(converter, "Effect"); - Shiboken::Conversions::registerConverterName(converter, "Effect*"); - Shiboken::Conversions::registerConverterName(converter, "Effect&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Effect).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::EffectWrapper).name()); - - - MultipleInheritanceInitFunction func = Sbk_Effect_mi_init; - Shiboken::ObjectType::setMultipleInheritanceFunction(Sbk_Effect_TypeF(), func); - Shiboken::ObjectType::setCastFunction(Sbk_Effect_TypeF(), &Sbk_EffectSpecialCastFunction); - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_Effect_TypeF(), &Sbk_Effect_typeDiscovery); - - - EffectWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/effect_wrapper.h b/Engine/Qt5/NatronEngine/effect_wrapper.h deleted file mode 100644 index 0543569e48..0000000000 --- a/Engine/Qt5/NatronEngine/effect_wrapper.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef SBK_EFFECTWRAPPER_H -#define SBK_EFFECTWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -#include -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class EffectWrapper : public Effect -{ -public: - ~EffectWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_GROUPWRAPPER_H -# define SBK_GROUPWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class GroupWrapper : public Group -{ -public: - GroupWrapper(); - ~GroupWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_GROUPWRAPPER_H - -#endif // SBK_EFFECTWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/exprutils_wrapper.cpp b/Engine/Qt5/NatronEngine/exprutils_wrapper.cpp deleted file mode 100644 index f06ec3ca5b..0000000000 --- a/Engine/Qt5/NatronEngine/exprutils_wrapper.cpp +++ /dev/null @@ -1,2506 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "exprutils_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Extra includes -#include -#include - - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_ExprUtils_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::ExprUtils >())) - return -1; - - ::ExprUtils *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // ExprUtils() - cptr = new ::ExprUtils(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::ExprUtils >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - -static PyObject *Sbk_ExprUtilsFunc_boxstep(PyObject *self, PyObject *args) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "boxstep", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::boxstep(double,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // boxstep(double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_boxstep_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // boxstep(double,double) - double cppResult = ::ExprUtils::boxstep(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_boxstep_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.boxstep"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_ccellnoise(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::ccellnoise(Double3DTuple) - if (true) { - overloadId = 0; // ccellnoise(Double3DTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_ccellnoise_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // ccellnoise(Double3DTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple ret = ExprUtils::ccellnoise(p); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_ccellnoise_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.ccellnoise"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_cellnoise(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::cellnoise(Double3DTuple) - if (true) { - overloadId = 0; // cellnoise(Double3DTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_cellnoise_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // cellnoise(Double3DTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - double ret = ExprUtils::cellnoise(p); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_cellnoise_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.cellnoise"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_cfbm(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:cfbm", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::cfbm(Double3DTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // cfbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // cfbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // cfbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // cfbm(Double3DTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_cfbm_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_cfbm_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_cfbm_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_cfbm_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // cfbm(Double3DTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple ret = ExprUtils::cfbm(p, cppArg1, cppArg2, cppArg3); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_cfbm_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.cfbm"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_cfbm4(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm4(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm4(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:cfbm4", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::cfbm4(ColorTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // cfbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // cfbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // cfbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // cfbm4(ColorTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_cfbm4_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm4(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_cfbm4_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm4(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_cfbm4_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cfbm4(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_cfbm4_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // cfbm4(ColorTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 4) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 4 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - double x4; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 3), &(x4)); - ColorTuple p = {x1, x2, x3, x4}; - Double3DTuple ret = ExprUtils::cfbm4(p, cppArg1, cppArg2, cppArg3); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_cfbm4_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.cfbm4"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_cnoise(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::cnoise(Double3DTuple) - if (true) { - overloadId = 0; // cnoise(Double3DTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_cnoise_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // cnoise(Double3DTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple ret = ExprUtils::cnoise(p); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_cnoise_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.cnoise"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_cnoise4(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::cnoise4(ColorTuple) - if (true) { - overloadId = 0; // cnoise4(ColorTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_cnoise4_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // cnoise4(ColorTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 4) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 4 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - double x4; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 3), &(x4)); - ColorTuple p = {x1, x2, x3, x4}; - Double3DTuple ret = ExprUtils::cnoise4(p); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_cnoise4_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.cnoise4"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_cturbulence(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cturbulence(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cturbulence(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:cturbulence", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::cturbulence(Double3DTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // cturbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // cturbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // cturbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // cturbulence(Double3DTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_cturbulence_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cturbulence(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_cturbulence_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cturbulence(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_cturbulence_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.cturbulence(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_cturbulence_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // cturbulence(Double3DTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple ret = ExprUtils::cturbulence(p, cppArg1, cppArg2, cppArg3); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_cturbulence_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.cturbulence"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_fbm(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:fbm", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::fbm(Double3DTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // fbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // fbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // fbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // fbm(Double3DTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_fbm_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_fbm_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_fbm_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_fbm_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // fbm(Double3DTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - double ret = ExprUtils::fbm(p, cppArg1, cppArg2, cppArg3); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_fbm_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.fbm"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_fbm4(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm4(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm4(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:fbm4", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::fbm4(ColorTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // fbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // fbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // fbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // fbm4(ColorTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_fbm4_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm4(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_fbm4_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm4(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_fbm4_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.fbm4(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_fbm4_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // fbm4(ColorTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 4) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 4 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - double x4; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 3), &(x4)); - ColorTuple p = {x1, x2, x3, x4}; - double ret = ExprUtils::fbm4(p, cppArg1, cppArg2, cppArg3); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_fbm4_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.fbm4"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_gaussstep(PyObject *self, PyObject *args) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "gaussstep", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::gaussstep(double,double,double) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // gaussstep(double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_gaussstep_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // gaussstep(double,double,double) - double cppResult = ::ExprUtils::gaussstep(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_gaussstep_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.gaussstep"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_hash(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::hash(std::vector) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX], (pyArg)))) { - overloadId = 0; // hash(std::vector) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_hash_TypeError; - - // Call function/method - { - ::std::vector cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // hash(std::vector) - double cppResult = ::ExprUtils::hash(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_hash_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.hash"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_linearstep(PyObject *self, PyObject *args) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "linearstep", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::linearstep(double,double,double) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // linearstep(double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_linearstep_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // linearstep(double,double,double) - double cppResult = ::ExprUtils::linearstep(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_linearstep_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.linearstep"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_mix(PyObject *self, PyObject *args) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "mix", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::mix(double,double,double) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // mix(double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_mix_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // mix(double,double,double) - double cppResult = ::ExprUtils::mix(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_mix_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.mix"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_noise(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::noise(Double2DTuple) - // 1: static ExprUtils::noise(double) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 1; // noise(double) - } else if (true) { - overloadId = 0; // noise(Double2DTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_noise_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // noise(const Double2DTuple & p) - { - - if (!PyErr_Occurred()) { - // noise(Double2DTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 4 && tupleSize != 3 && tupleSize != 2) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 2, 3 or 4 items."); - return 0; - } - - double ret = 0.; - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - if (tupleSize == 2) { - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - Double2DTuple p = {x1, x2}; - ret = ExprUtils::noise(p); - } else if (tupleSize == 3) { - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - ret = ExprUtils::noise(p); - } else if (tupleSize == 4) { - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - double x4; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 3), &(x4)); - ColorTuple p = {x1, x2, x3, x4}; - ret = ExprUtils::noise(p); - } - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - - return pyResult; - - // End of code injection - - } - break; - } - case 1: // noise(double x) - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // noise(double) - double cppResult = ::ExprUtils::noise(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_noise_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.noise"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_pnoise(PyObject *self, PyObject *args) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "pnoise", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::pnoise(Double3DTuple,Double3DTuple) - if (numArgs == 2) { - overloadId = 0; // pnoise(Double3DTuple,Double3DTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_pnoise_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // pnoise(Double3DTuple,Double3DTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - tupleSize = PyTuple_GET_SIZE(pyArgs[2-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - double p1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[2-1], 0), &(p1)); - double p2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[2-1], 1), &(p2)); - double p3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[2-1], 2), &(p3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple period = {p1, p2, p3}; - double ret = ExprUtils::pnoise(p, period); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_pnoise_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.pnoise"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_remap(PyObject *self, PyObject *args) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "remap", 5, 5, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::remap(double,double,double,double,double) - if (numArgs == 5 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3]))) - && (pythonToCpp[4] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[4])))) { - overloadId = 0; // remap(double,double,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_remap_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - double cppArg4; - pythonToCpp[4](pyArgs[4], &cppArg4); - - if (!PyErr_Occurred()) { - // remap(double,double,double,double,double) - double cppResult = ::ExprUtils::remap(cppArg0, cppArg1, cppArg2, cppArg3, cppArg4); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_remap_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.remap"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_smoothstep(PyObject *self, PyObject *args) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "smoothstep", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::smoothstep(double,double,double) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // smoothstep(double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_smoothstep_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // smoothstep(double,double,double) - double cppResult = ::ExprUtils::smoothstep(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_smoothstep_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.smoothstep"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_snoise(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ExprUtils *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_EXPRUTILS_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ExprUtils::snoise(Double3DTuple) - if (true) { - overloadId = 0; // snoise(Double3DTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_snoise_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // snoise(Double3DTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - double ret = cppSelf->snoise(p); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_snoise_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.snoise"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_snoise4(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::snoise4(ColorTuple) - if (true) { - overloadId = 0; // snoise4(ColorTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_snoise4_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // snoise4(ColorTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 4) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 4 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - double x4; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 3), &(x4)); - ColorTuple p = {x1, x2, x3, x4}; - double ret = ExprUtils::snoise4(p); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_snoise4_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.snoise4"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_turbulence(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.turbulence(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.turbulence(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:turbulence", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::turbulence(Double3DTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // turbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // turbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // turbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // turbulence(Double3DTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_turbulence_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.turbulence(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_turbulence_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.turbulence(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_turbulence_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.turbulence(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_turbulence_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // turbulence(Double3DTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - double ret = ExprUtils::turbulence(p, cppArg1, cppArg2, cppArg3); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_turbulence_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.turbulence"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_vfbm(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:vfbm", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::vfbm(Double3DTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // vfbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // vfbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // vfbm(Double3DTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // vfbm(Double3DTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_vfbm_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_vfbm_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_vfbm_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_vfbm_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // vfbm(Double3DTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple ret = ExprUtils::vfbm(p, cppArg1, cppArg2, cppArg3); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_vfbm_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.vfbm"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_vfbm4(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm4(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm4(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:vfbm4", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::vfbm4(ColorTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // vfbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // vfbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // vfbm4(ColorTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // vfbm4(ColorTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_vfbm4_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm4(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_vfbm4_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm4(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_vfbm4_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vfbm4(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_vfbm4_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // vfbm4(ColorTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 4) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 4 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - double x4; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 3), &(x4)); - ColorTuple p = {x1, x2, x3, x4}; - Double3DTuple ret = ExprUtils::vfbm4(p, cppArg1, cppArg2, cppArg3); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_vfbm4_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.vfbm4"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_vnoise(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::vnoise(Double3DTuple) - if (true) { - overloadId = 0; // vnoise(Double3DTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_vnoise_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // vnoise(Double3DTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple ret = ExprUtils::vnoise(p); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_vnoise_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.vnoise"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_vnoise4(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ExprUtils::vnoise4(ColorTuple) - if (true) { - overloadId = 0; // vnoise4(ColorTuple) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_vnoise4_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // vnoise4(ColorTuple) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArg); - if (tupleSize != 4) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 4 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 2), &(x3)); - double x4; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArg, 3), &(x4)); - ColorTuple p = {x1, x2, x3, x4}; - Double3DTuple ret = ExprUtils::vnoise4(p); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_vnoise4_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ExprUtils.vnoise4"); - return {}; -} - -static PyObject *Sbk_ExprUtilsFunc_vturbulence(PyObject *self, PyObject *args, PyObject *kwds) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vturbulence(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vturbulence(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:vturbulence", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: static ExprUtils::vturbulence(Double3DTuple,int,double,double) - if (true) { - if (numArgs == 1) { - overloadId = 0; // vturbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // vturbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // vturbulence(Double3DTuple,int,double,double) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // vturbulence(Double3DTuple,int,double,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ExprUtilsFunc_vturbulence_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","octaves"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vturbulence(): got multiple values for keyword argument 'octaves'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ExprUtilsFunc_vturbulence_TypeError; - } - } - keyName = Py_BuildValue("s","lacunarity"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vturbulence(): got multiple values for keyword argument 'lacunarity'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_ExprUtilsFunc_vturbulence_TypeError; - } - } - keyName = Py_BuildValue("s","gain"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ExprUtils.vturbulence(): got multiple values for keyword argument 'gain'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ExprUtilsFunc_vturbulence_TypeError; - } - } - } - int cppArg1 = 6; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2 = 2.; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3 = 0.5; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // vturbulence(Double3DTuple,int,double,double) - // Begin code injection - int tupleSize = PyTuple_GET_SIZE(pyArgs[1-1]); - if (tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 items."); - return 0; - } - double x1; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 0), &(x1)); - double x2; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 1), &(x2)); - double x3; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(pyArgs[1-1], 2), &(x3)); - Double3DTuple p = {x1, x2, x3}; - Double3DTuple ret = ExprUtils::vturbulence(p, cppArg1, cppArg2, cppArg3); - pyResult = PyTuple_New(3); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.y)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret.z)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ExprUtilsFunc_vturbulence_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ExprUtils.vturbulence"); - return {}; -} - - -static const char *Sbk_ExprUtils_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ExprUtils_methods[] = { - {"boxstep", reinterpret_cast(Sbk_ExprUtilsFunc_boxstep), METH_VARARGS|METH_STATIC}, - {"ccellnoise", reinterpret_cast(Sbk_ExprUtilsFunc_ccellnoise), METH_O|METH_STATIC}, - {"cellnoise", reinterpret_cast(Sbk_ExprUtilsFunc_cellnoise), METH_O|METH_STATIC}, - {"cfbm", reinterpret_cast(Sbk_ExprUtilsFunc_cfbm), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"cfbm4", reinterpret_cast(Sbk_ExprUtilsFunc_cfbm4), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"cnoise", reinterpret_cast(Sbk_ExprUtilsFunc_cnoise), METH_O|METH_STATIC}, - {"cnoise4", reinterpret_cast(Sbk_ExprUtilsFunc_cnoise4), METH_O|METH_STATIC}, - {"cturbulence", reinterpret_cast(Sbk_ExprUtilsFunc_cturbulence), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"fbm", reinterpret_cast(Sbk_ExprUtilsFunc_fbm), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"fbm4", reinterpret_cast(Sbk_ExprUtilsFunc_fbm4), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"gaussstep", reinterpret_cast(Sbk_ExprUtilsFunc_gaussstep), METH_VARARGS|METH_STATIC}, - {"hash", reinterpret_cast(Sbk_ExprUtilsFunc_hash), METH_O|METH_STATIC}, - {"linearstep", reinterpret_cast(Sbk_ExprUtilsFunc_linearstep), METH_VARARGS|METH_STATIC}, - {"mix", reinterpret_cast(Sbk_ExprUtilsFunc_mix), METH_VARARGS|METH_STATIC}, - {"noise", reinterpret_cast(Sbk_ExprUtilsFunc_noise), METH_O|METH_STATIC}, - {"pnoise", reinterpret_cast(Sbk_ExprUtilsFunc_pnoise), METH_VARARGS|METH_STATIC}, - {"remap", reinterpret_cast(Sbk_ExprUtilsFunc_remap), METH_VARARGS|METH_STATIC}, - {"smoothstep", reinterpret_cast(Sbk_ExprUtilsFunc_smoothstep), METH_VARARGS|METH_STATIC}, - {"snoise", reinterpret_cast(Sbk_ExprUtilsFunc_snoise), METH_O}, - {"snoise4", reinterpret_cast(Sbk_ExprUtilsFunc_snoise4), METH_O|METH_STATIC}, - {"turbulence", reinterpret_cast(Sbk_ExprUtilsFunc_turbulence), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"vfbm", reinterpret_cast(Sbk_ExprUtilsFunc_vfbm), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"vfbm4", reinterpret_cast(Sbk_ExprUtilsFunc_vfbm4), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - {"vnoise", reinterpret_cast(Sbk_ExprUtilsFunc_vnoise), METH_O|METH_STATIC}, - {"vnoise4", reinterpret_cast(Sbk_ExprUtilsFunc_vnoise4), METH_O|METH_STATIC}, - {"vturbulence", reinterpret_cast(Sbk_ExprUtilsFunc_vturbulence), METH_VARARGS|METH_KEYWORDS|METH_STATIC}, - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_ExprUtils_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ExprUtils_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ExprUtils_Type = nullptr; -static SbkObjectType *Sbk_ExprUtils_TypeF(void) -{ - return _Sbk_ExprUtils_Type; -} - -static PyType_Slot Sbk_ExprUtils_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_ExprUtils_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ExprUtils_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ExprUtils_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_ExprUtils_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_ExprUtils_spec = { - "1:NatronEngine.ExprUtils", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ExprUtils_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ExprUtils_PythonToCpp_ExprUtils_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ExprUtils_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ExprUtils_PythonToCpp_ExprUtils_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ExprUtils_TypeF()))) - return ExprUtils_PythonToCpp_ExprUtils_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ExprUtils_PTR_CppToPython_ExprUtils(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ExprUtils_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ExprUtils_SignatureStrings[] = { - "NatronEngine.ExprUtils(self)", - "NatronEngine.ExprUtils.boxstep(x:double,a:double)->double", - "NatronEngine.ExprUtils.ccellnoise(p:NatronEngine.Double3DTuple)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.cellnoise(p:NatronEngine.Double3DTuple)->double", - "NatronEngine.ExprUtils.cfbm(p:NatronEngine.Double3DTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.cfbm4(p:NatronEngine.ColorTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.cnoise(p:NatronEngine.Double3DTuple)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.cnoise4(p:NatronEngine.ColorTuple)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.cturbulence(p:NatronEngine.Double3DTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.fbm(p:NatronEngine.Double3DTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->double", - "NatronEngine.ExprUtils.fbm4(p:NatronEngine.ColorTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->double", - "NatronEngine.ExprUtils.gaussstep(x:double,a:double,b:double)->double", - "NatronEngine.ExprUtils.hash(args:std.vector[double])->double", - "NatronEngine.ExprUtils.linearstep(x:double,a:double,b:double)->double", - "NatronEngine.ExprUtils.mix(x:double,y:double,alpha:double)->double", - "1:NatronEngine.ExprUtils.noise(p:NatronEngine.Double2DTuple)->double", - "0:NatronEngine.ExprUtils.noise(x:double)->double", - "NatronEngine.ExprUtils.pnoise(p:NatronEngine.Double3DTuple,period:NatronEngine.Double3DTuple)->double", - "NatronEngine.ExprUtils.remap(x:double,source:double,range:double,falloff:double,interp:double)->double", - "NatronEngine.ExprUtils.smoothstep(x:double,a:double,b:double)->double", - "NatronEngine.ExprUtils.snoise(self,p:NatronEngine.Double3DTuple)->double", - "NatronEngine.ExprUtils.snoise4(p:NatronEngine.ColorTuple)->double", - "NatronEngine.ExprUtils.turbulence(p:NatronEngine.Double3DTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->double", - "NatronEngine.ExprUtils.vfbm(p:NatronEngine.Double3DTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.vfbm4(p:NatronEngine.ColorTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.vnoise(p:NatronEngine.Double3DTuple)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.vnoise4(p:NatronEngine.ColorTuple)->NatronEngine.Double3DTuple", - "NatronEngine.ExprUtils.vturbulence(p:NatronEngine.Double3DTuple,octaves:int=6,lacunarity:double=2.,gain:double=0.5)->NatronEngine.Double3DTuple", - nullptr}; // Sentinel - -void init_ExprUtils(PyObject *module) -{ - _Sbk_ExprUtils_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ExprUtils", - "ExprUtils*", - &Sbk_ExprUtils_spec, - &Shiboken::callCppDestructor< ::ExprUtils >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ExprUtils_Type); - InitSignatureStrings(pyType, ExprUtils_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ExprUtils_Type), Sbk_ExprUtils_PropertyStrings); - SbkNatronEngineTypes[SBK_EXPRUTILS_IDX] - = reinterpret_cast(Sbk_ExprUtils_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ExprUtils_TypeF(), - ExprUtils_PythonToCpp_ExprUtils_PTR, - is_ExprUtils_PythonToCpp_ExprUtils_PTR_Convertible, - ExprUtils_PTR_CppToPython_ExprUtils); - - Shiboken::Conversions::registerConverterName(converter, "ExprUtils"); - Shiboken::Conversions::registerConverterName(converter, "ExprUtils*"); - Shiboken::Conversions::registerConverterName(converter, "ExprUtils&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ExprUtils).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/exprutils_wrapper.h b/Engine/Qt5/NatronEngine/exprutils_wrapper.h deleted file mode 100644 index 43f2fed1e6..0000000000 --- a/Engine/Qt5/NatronEngine/exprutils_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_EXPRUTILS_H -#define SBK_EXPRUTILS_H - -#include - -#endif // SBK_EXPRUTILS_H - diff --git a/Engine/Qt5/NatronEngine/fileparam_wrapper.cpp b/Engine/Qt5/NatronEngine/fileparam_wrapper.cpp deleted file mode 100644 index bf04330ae2..0000000000 --- a/Engine/Qt5/NatronEngine/fileparam_wrapper.cpp +++ /dev/null @@ -1,329 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "fileparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void FileParamWrapper::pysideInitQtMetaTypes() -{ -} - -void FileParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -FileParamWrapper::~FileParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_FileParamFunc_openFile(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::FileParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_FILEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // openFile() - cppSelf->openFile(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_FileParamFunc_reloadFile(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::FileParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_FILEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // reloadFile() - cppSelf->reloadFile(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_FileParamFunc_setSequenceEnabled(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::FileParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_FILEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: FileParam::setSequenceEnabled(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setSequenceEnabled(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_FileParamFunc_setSequenceEnabled_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setSequenceEnabled(bool) - cppSelf->setSequenceEnabled(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_FileParamFunc_setSequenceEnabled_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.FileParam.setSequenceEnabled"); - return {}; -} - - -static const char *Sbk_FileParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_FileParam_methods[] = { - {"openFile", reinterpret_cast(Sbk_FileParamFunc_openFile), METH_NOARGS}, - {"reloadFile", reinterpret_cast(Sbk_FileParamFunc_reloadFile), METH_NOARGS}, - {"setSequenceEnabled", reinterpret_cast(Sbk_FileParamFunc_setSequenceEnabled), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_FileParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::FileParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_FILEPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_FileParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_FileParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_FileParam_Type = nullptr; -static SbkObjectType *Sbk_FileParam_TypeF(void) -{ - return _Sbk_FileParam_Type; -} - -static PyType_Slot Sbk_FileParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_FileParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_FileParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_FileParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_FileParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_FileParam_spec = { - "1:NatronEngine.FileParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_FileParam_slots -}; - -} //extern "C" - -static void *Sbk_FileParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::FileParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void FileParam_PythonToCpp_FileParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_FileParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_FileParam_PythonToCpp_FileParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_FileParam_TypeF()))) - return FileParam_PythonToCpp_FileParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *FileParam_PTR_CppToPython_FileParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_FileParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *FileParam_SignatureStrings[] = { - "NatronEngine.FileParam.openFile(self)", - "NatronEngine.FileParam.reloadFile(self)", - "NatronEngine.FileParam.setSequenceEnabled(self,enabled:bool)", - nullptr}; // Sentinel - -void init_FileParam(PyObject *module) -{ - _Sbk_FileParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "FileParam", - "FileParam*", - &Sbk_FileParam_spec, - &Shiboken::callCppDestructor< ::FileParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_FileParam_Type); - InitSignatureStrings(pyType, FileParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_FileParam_Type), Sbk_FileParam_PropertyStrings); - SbkNatronEngineTypes[SBK_FILEPARAM_IDX] - = reinterpret_cast(Sbk_FileParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_FileParam_TypeF(), - FileParam_PythonToCpp_FileParam_PTR, - is_FileParam_PythonToCpp_FileParam_PTR_Convertible, - FileParam_PTR_CppToPython_FileParam); - - Shiboken::Conversions::registerConverterName(converter, "FileParam"); - Shiboken::Conversions::registerConverterName(converter, "FileParam*"); - Shiboken::Conversions::registerConverterName(converter, "FileParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::FileParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::FileParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_FileParam_TypeF(), &Sbk_FileParam_typeDiscovery); - - - FileParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/fileparam_wrapper.h b/Engine/Qt5/NatronEngine/fileparam_wrapper.h deleted file mode 100644 index 78b566c063..0000000000 --- a/Engine/Qt5/NatronEngine/fileparam_wrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef SBK_FILEPARAMWRAPPER_H -#define SBK_FILEPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class FileParamWrapper : public FileParam -{ -public: - ~FileParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_STRINGPARAMBASEWRAPPER_H -# define SBK_STRINGPARAMBASEWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class StringParamBaseWrapper : public StringParamBase -{ -public: - ~StringParamBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_STRINGPARAMBASEWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_FILEPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.cpp b/Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.cpp deleted file mode 100644 index e6be64a5c7..0000000000 --- a/Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.cpp +++ /dev/null @@ -1,467 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "floatnodecreationproperty_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void FloatNodeCreationPropertyWrapper::pysideInitQtMetaTypes() -{ -} - -void FloatNodeCreationPropertyWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -FloatNodeCreationPropertyWrapper::FloatNodeCreationPropertyWrapper(const std::vector & values) : FloatNodeCreationProperty(values) -{ - resetPyMethodCache(); - // ... middle -} - -FloatNodeCreationPropertyWrapper::FloatNodeCreationPropertyWrapper(double value) : FloatNodeCreationProperty(value) -{ - resetPyMethodCache(); - // ... middle -} - -FloatNodeCreationPropertyWrapper::~FloatNodeCreationPropertyWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_FloatNodeCreationProperty_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::FloatNodeCreationProperty >())) - return -1; - - ::FloatNodeCreationPropertyWrapper *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.FloatNodeCreationProperty(): too many arguments"); - return -1; - } - - if (!PyArg_ParseTuple(args, "|O:FloatNodeCreationProperty", &(pyArgs[0]))) - return -1; - - - // Overloaded function decisor - // 0: FloatNodeCreationProperty::FloatNodeCreationProperty(std::vector) - // 1: FloatNodeCreationProperty::FloatNodeCreationProperty(double) - if (numArgs == 0) { - overloadId = 0; // FloatNodeCreationProperty(std::vector) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // FloatNodeCreationProperty(double) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX], (pyArgs[0])))) { - overloadId = 0; // FloatNodeCreationProperty(std::vector) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_FloatNodeCreationProperty_Init_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // FloatNodeCreationProperty(const std::vector & values) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","values"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.FloatNodeCreationProperty(): got multiple values for keyword argument 'values'."); - return -1; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX], (pyArgs[0])))) - goto Sbk_FloatNodeCreationProperty_Init_TypeError; - } - } - } - ::std::vector cppArg0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // FloatNodeCreationProperty(std::vector) - cptr = new ::FloatNodeCreationPropertyWrapper(cppArg0); - } - break; - } - case 1: // FloatNodeCreationProperty(double value) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // FloatNodeCreationProperty(double) - cptr = new ::FloatNodeCreationPropertyWrapper(cppArg0); - } - break; - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::FloatNodeCreationProperty >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_FloatNodeCreationProperty_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_FloatNodeCreationProperty_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.FloatNodeCreationProperty"); - return -1; -} - -static PyObject *Sbk_FloatNodeCreationPropertyFunc_getValues(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::FloatNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_FLOATNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getValues()const - const std::vector & cppResult = const_cast(cppSelf)->getValues(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_FloatNodeCreationPropertyFunc_setValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::FloatNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_FLOATNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.FloatNodeCreationProperty.setValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.FloatNodeCreationProperty.setValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: FloatNodeCreationProperty::setValue(double,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setValue(double,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValue(double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_FloatNodeCreationPropertyFunc_setValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","index"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.FloatNodeCreationProperty.setValue(): got multiple values for keyword argument 'index'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_FloatNodeCreationPropertyFunc_setValue_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValue(double,int) - cppSelf->setValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_FloatNodeCreationPropertyFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.FloatNodeCreationProperty.setValue"); - return {}; -} - - -static const char *Sbk_FloatNodeCreationProperty_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_FloatNodeCreationProperty_methods[] = { - {"getValues", reinterpret_cast(Sbk_FloatNodeCreationPropertyFunc_getValues), METH_NOARGS}, - {"setValue", reinterpret_cast(Sbk_FloatNodeCreationPropertyFunc_setValue), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_FloatNodeCreationProperty_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::FloatNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_FLOATNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_FloatNodeCreationProperty_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_FloatNodeCreationProperty_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_FloatNodeCreationProperty_Type = nullptr; -static SbkObjectType *Sbk_FloatNodeCreationProperty_TypeF(void) -{ - return _Sbk_FloatNodeCreationProperty_Type; -} - -static PyType_Slot Sbk_FloatNodeCreationProperty_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_FloatNodeCreationProperty_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_FloatNodeCreationProperty_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_FloatNodeCreationProperty_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_FloatNodeCreationProperty_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_FloatNodeCreationProperty_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_FloatNodeCreationProperty_spec = { - "1:NatronEngine.FloatNodeCreationProperty", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_FloatNodeCreationProperty_slots -}; - -} //extern "C" - -static void *Sbk_FloatNodeCreationProperty_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::NodeCreationProperty >())) - return dynamic_cast< ::FloatNodeCreationProperty *>(reinterpret_cast< ::NodeCreationProperty *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void FloatNodeCreationProperty_PythonToCpp_FloatNodeCreationProperty_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_FloatNodeCreationProperty_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_FloatNodeCreationProperty_PythonToCpp_FloatNodeCreationProperty_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_FloatNodeCreationProperty_TypeF()))) - return FloatNodeCreationProperty_PythonToCpp_FloatNodeCreationProperty_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *FloatNodeCreationProperty_PTR_CppToPython_FloatNodeCreationProperty(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_FloatNodeCreationProperty_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *FloatNodeCreationProperty_SignatureStrings[] = { - "1:NatronEngine.FloatNodeCreationProperty(self,values:std.vector[double]=std.vector< double >())", - "0:NatronEngine.FloatNodeCreationProperty(self,value:double)", - "NatronEngine.FloatNodeCreationProperty.getValues(self)->std.vector[double]", - "NatronEngine.FloatNodeCreationProperty.setValue(self,value:double,index:int=0)", - nullptr}; // Sentinel - -void init_FloatNodeCreationProperty(PyObject *module) -{ - _Sbk_FloatNodeCreationProperty_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "FloatNodeCreationProperty", - "FloatNodeCreationProperty*", - &Sbk_FloatNodeCreationProperty_spec, - &Shiboken::callCppDestructor< ::FloatNodeCreationProperty >, - reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_FloatNodeCreationProperty_Type); - InitSignatureStrings(pyType, FloatNodeCreationProperty_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_FloatNodeCreationProperty_Type), Sbk_FloatNodeCreationProperty_PropertyStrings); - SbkNatronEngineTypes[SBK_FLOATNODECREATIONPROPERTY_IDX] - = reinterpret_cast(Sbk_FloatNodeCreationProperty_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_FloatNodeCreationProperty_TypeF(), - FloatNodeCreationProperty_PythonToCpp_FloatNodeCreationProperty_PTR, - is_FloatNodeCreationProperty_PythonToCpp_FloatNodeCreationProperty_PTR_Convertible, - FloatNodeCreationProperty_PTR_CppToPython_FloatNodeCreationProperty); - - Shiboken::Conversions::registerConverterName(converter, "FloatNodeCreationProperty"); - Shiboken::Conversions::registerConverterName(converter, "FloatNodeCreationProperty*"); - Shiboken::Conversions::registerConverterName(converter, "FloatNodeCreationProperty&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::FloatNodeCreationProperty).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::FloatNodeCreationPropertyWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_FloatNodeCreationProperty_TypeF(), &Sbk_FloatNodeCreationProperty_typeDiscovery); - - - FloatNodeCreationPropertyWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.h b/Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.h deleted file mode 100644 index c8a19b44aa..0000000000 --- a/Engine/Qt5/NatronEngine/floatnodecreationproperty_wrapper.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SBK_FLOATNODECREATIONPROPERTYWRAPPER_H -#define SBK_FLOATNODECREATIONPROPERTYWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class FloatNodeCreationPropertyWrapper : public FloatNodeCreationProperty -{ -public: - FloatNodeCreationPropertyWrapper(const std::vector & values = std::vector< double >()); - FloatNodeCreationPropertyWrapper(double value); - ~FloatNodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_NODECREATIONPROPERTYWRAPPER_H -# define SBK_NODECREATIONPROPERTYWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class NodeCreationPropertyWrapper : public NodeCreationProperty -{ -public: - NodeCreationPropertyWrapper(); - ~NodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_NODECREATIONPROPERTYWRAPPER_H - -#endif // SBK_FLOATNODECREATIONPROPERTYWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/group_wrapper.cpp b/Engine/Qt5/NatronEngine/group_wrapper.cpp deleted file mode 100644 index b3464e2bb5..0000000000 --- a/Engine/Qt5/NatronEngine/group_wrapper.cpp +++ /dev/null @@ -1,357 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "group_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void GroupWrapper::pysideInitQtMetaTypes() -{ -} - -void GroupWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -GroupWrapper::GroupWrapper() : Group() -{ - resetPyMethodCache(); - // ... middle -} - -GroupWrapper::~GroupWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_Group_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::Group >())) - return -1; - - ::GroupWrapper *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // Group() - cptr = new ::GroupWrapper(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::Group >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - -static PyObject *Sbk_GroupFunc_getChildren(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Group *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getChildren()const - // Begin code injection - std::list effects = cppSelf->getChildren(); - PyObject* ret = PyList_New((int) effects.size()); - int idx = 0; - for (std::list::iterator it = effects.begin(); it!=effects.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_GroupFunc_getNode(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Group *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Group::getNode(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getNode(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GroupFunc_getNode_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getNode(QString)const - Effect * cppResult = const_cast(cppSelf)->getNode(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GroupFunc_getNode_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Group.getNode"); - return {}; -} - - -static const char *Sbk_Group_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Group_methods[] = { - {"getChildren", reinterpret_cast(Sbk_GroupFunc_getChildren), METH_NOARGS}, - {"getNode", reinterpret_cast(Sbk_GroupFunc_getNode), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Group_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Group *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUP_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Group_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Group_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Group_Type = nullptr; -static SbkObjectType *Sbk_Group_TypeF(void) -{ - return _Sbk_Group_Type; -} - -static PyType_Slot Sbk_Group_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Group_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Group_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Group_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Group_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_Group_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Group_spec = { - "1:NatronEngine.Group", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Group_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Group_PythonToCpp_Group_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Group_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Group_PythonToCpp_Group_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Group_TypeF()))) - return Group_PythonToCpp_Group_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Group_PTR_CppToPython_Group(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Group_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Group_SignatureStrings[] = { - "NatronEngine.Group(self)", - "NatronEngine.Group.getChildren(self)->std.list[NatronEngine.Effect]", - "NatronEngine.Group.getNode(self,fullySpecifiedName:QString)->NatronEngine.Effect", - nullptr}; // Sentinel - -void init_Group(PyObject *module) -{ - _Sbk_Group_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Group", - "Group*", - &Sbk_Group_spec, - &Shiboken::callCppDestructor< ::Group >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Group_Type); - InitSignatureStrings(pyType, Group_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Group_Type), Sbk_Group_PropertyStrings); - SbkNatronEngineTypes[SBK_GROUP_IDX] - = reinterpret_cast(Sbk_Group_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Group_TypeF(), - Group_PythonToCpp_Group_PTR, - is_Group_PythonToCpp_Group_PTR_Convertible, - Group_PTR_CppToPython_Group); - - Shiboken::Conversions::registerConverterName(converter, "Group"); - Shiboken::Conversions::registerConverterName(converter, "Group*"); - Shiboken::Conversions::registerConverterName(converter, "Group&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Group).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::GroupWrapper).name()); - - - - GroupWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/group_wrapper.h b/Engine/Qt5/NatronEngine/group_wrapper.h deleted file mode 100644 index b136537bf5..0000000000 --- a/Engine/Qt5/NatronEngine/group_wrapper.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef SBK_GROUPWRAPPER_H -#define SBK_GROUPWRAPPER_H - -#include - - -// Extra includes -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class GroupWrapper : public Group -{ -public: - GroupWrapper(); - ~GroupWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_GROUPWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/groupparam_wrapper.cpp b/Engine/Qt5/NatronEngine/groupparam_wrapper.cpp deleted file mode 100644 index 8f7fa210a6..0000000000 --- a/Engine/Qt5/NatronEngine/groupparam_wrapper.cpp +++ /dev/null @@ -1,380 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "groupparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void GroupParamWrapper::pysideInitQtMetaTypes() -{ -} - -void GroupParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -GroupParamWrapper::~GroupParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_GroupParamFunc_addParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::GroupParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUPPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GroupParam::addParam(const Param*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArg)))) { - overloadId = 0; // addParam(const Param*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GroupParamFunc_addParam_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::Param *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // addParam(const Param*) - cppSelf->addParam(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GroupParamFunc_addParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.GroupParam.addParam"); - return {}; -} - -static PyObject *Sbk_GroupParamFunc_getIsOpened(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::GroupParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUPPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getIsOpened()const - bool cppResult = const_cast(cppSelf)->getIsOpened(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_GroupParamFunc_setAsTab(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::GroupParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUPPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // setAsTab() - cppSelf->setAsTab(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_GroupParamFunc_setOpened(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::GroupParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUPPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GroupParam::setOpened(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setOpened(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GroupParamFunc_setOpened_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setOpened(bool) - // Begin code injection - cppSelf->setOpened(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GroupParamFunc_setOpened_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.GroupParam.setOpened"); - return {}; -} - - -static const char *Sbk_GroupParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_GroupParam_methods[] = { - {"addParam", reinterpret_cast(Sbk_GroupParamFunc_addParam), METH_O}, - {"getIsOpened", reinterpret_cast(Sbk_GroupParamFunc_getIsOpened), METH_NOARGS}, - {"setAsTab", reinterpret_cast(Sbk_GroupParamFunc_setAsTab), METH_NOARGS}, - {"setOpened", reinterpret_cast(Sbk_GroupParamFunc_setOpened), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_GroupParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::GroupParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_GROUPPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_GroupParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_GroupParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_GroupParam_Type = nullptr; -static SbkObjectType *Sbk_GroupParam_TypeF(void) -{ - return _Sbk_GroupParam_Type; -} - -static PyType_Slot Sbk_GroupParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_GroupParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_GroupParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_GroupParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_GroupParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_GroupParam_spec = { - "1:NatronEngine.GroupParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_GroupParam_slots -}; - -} //extern "C" - -static void *Sbk_GroupParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::GroupParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void GroupParam_PythonToCpp_GroupParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_GroupParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_GroupParam_PythonToCpp_GroupParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_GroupParam_TypeF()))) - return GroupParam_PythonToCpp_GroupParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *GroupParam_PTR_CppToPython_GroupParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_GroupParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *GroupParam_SignatureStrings[] = { - "NatronEngine.GroupParam.addParam(self,param:NatronEngine.Param)", - "NatronEngine.GroupParam.getIsOpened(self)->bool", - "NatronEngine.GroupParam.setAsTab(self)", - "NatronEngine.GroupParam.setOpened(self,opened:bool)", - nullptr}; // Sentinel - -void init_GroupParam(PyObject *module) -{ - _Sbk_GroupParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "GroupParam", - "GroupParam*", - &Sbk_GroupParam_spec, - &Shiboken::callCppDestructor< ::GroupParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_GroupParam_Type); - InitSignatureStrings(pyType, GroupParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_GroupParam_Type), Sbk_GroupParam_PropertyStrings); - SbkNatronEngineTypes[SBK_GROUPPARAM_IDX] - = reinterpret_cast(Sbk_GroupParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_GroupParam_TypeF(), - GroupParam_PythonToCpp_GroupParam_PTR, - is_GroupParam_PythonToCpp_GroupParam_PTR_Convertible, - GroupParam_PTR_CppToPython_GroupParam); - - Shiboken::Conversions::registerConverterName(converter, "GroupParam"); - Shiboken::Conversions::registerConverterName(converter, "GroupParam*"); - Shiboken::Conversions::registerConverterName(converter, "GroupParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::GroupParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::GroupParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_GroupParam_TypeF(), &Sbk_GroupParam_typeDiscovery); - - - GroupParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/groupparam_wrapper.h b/Engine/Qt5/NatronEngine/groupparam_wrapper.h deleted file mode 100644 index cd9c4c8e94..0000000000 --- a/Engine/Qt5/NatronEngine/groupparam_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_GROUPPARAMWRAPPER_H -#define SBK_GROUPPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class GroupParamWrapper : public GroupParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { GroupParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~GroupParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_GROUPPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/imagelayer_wrapper.cpp b/Engine/Qt5/NatronEngine/imagelayer_wrapper.cpp deleted file mode 100644 index 9ababf58eb..0000000000 --- a/Engine/Qt5/NatronEngine/imagelayer_wrapper.cpp +++ /dev/null @@ -1,769 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "imagelayer_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Extra includes -#include - - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_ImageLayer_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::ImageLayer >())) - return -1; - - ::ImageLayer *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "ImageLayer", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return -1; - - - // Overloaded function decisor - // 0: ImageLayer::ImageLayer(QString,QString,QStringList) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[2])))) { - overloadId = 0; // ImageLayer(QString,QString,QStringList) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ImageLayer_Init_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - ::QStringList cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // ImageLayer(QString,QString,QStringList) - cptr = new ::ImageLayer(cppArg0, cppArg1, cppArg2); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::ImageLayer >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_ImageLayer_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_ImageLayer_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ImageLayer"); - return -1; -} - -static PyObject *Sbk_ImageLayerFunc_getAlphaComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getAlphaComponents() - ImageLayer cppResult = ::ImageLayer::getAlphaComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getBackwardMotionComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getBackwardMotionComponents() - ImageLayer cppResult = ::ImageLayer::getBackwardMotionComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getComponentsNames(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getComponentsNames()const - const QStringList & cppResult = const_cast(cppSelf)->getComponentsNames(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getComponentsPrettyName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getComponentsPrettyName()const - const QString & cppResult = const_cast(cppSelf)->getComponentsPrettyName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getDisparityLeftComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getDisparityLeftComponents() - ImageLayer cppResult = ::ImageLayer::getDisparityLeftComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getDisparityRightComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getDisparityRightComponents() - ImageLayer cppResult = ::ImageLayer::getDisparityRightComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getForwardMotionComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getForwardMotionComponents() - ImageLayer cppResult = ::ImageLayer::getForwardMotionComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getHash(PyObject *self, PyObject *pyArg) -{ - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: static ImageLayer::getHash(ImageLayer) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), (pyArg)))) { - overloadId = 0; // getHash(ImageLayer) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ImageLayerFunc_getHash_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); - ::ImageLayer *cppArg0 = &cppArg0_local; - if (Shiboken::Conversions::isImplicitConversion(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), pythonToCpp)) - pythonToCpp(pyArg, &cppArg0_local); - else - pythonToCpp(pyArg, &cppArg0); - - - if (!PyErr_Occurred()) { - // getHash(ImageLayer) - int cppResult = ::ImageLayer::getHash(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ImageLayerFunc_getHash_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ImageLayer.getHash"); - return {}; -} - -static PyObject *Sbk_ImageLayerFunc_getLayerName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getLayerName()const - const QString & cppResult = const_cast(cppSelf)->getLayerName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getNoneComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNoneComponents() - ImageLayer cppResult = ::ImageLayer::getNoneComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getNumComponents(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNumComponents()const - int cppResult = const_cast(cppSelf)->getNumComponents(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getRGBAComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getRGBAComponents() - ImageLayer cppResult = ::ImageLayer::getRGBAComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_getRGBComponents(PyObject *self) -{ - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getRGBComponents() - ImageLayer cppResult = ::ImageLayer::getRGBComponents(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayerFunc_isColorPlane(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isColorPlane()const - bool cppResult = const_cast(cppSelf)->isColorPlane(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ImageLayer___copy__(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto &cppSelf = *reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - PyObject *pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppSelf); - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - - -static const char *Sbk_ImageLayer_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ImageLayer_methods[] = { - {"getAlphaComponents", reinterpret_cast(Sbk_ImageLayerFunc_getAlphaComponents), METH_NOARGS|METH_STATIC}, - {"getBackwardMotionComponents", reinterpret_cast(Sbk_ImageLayerFunc_getBackwardMotionComponents), METH_NOARGS|METH_STATIC}, - {"getComponentsNames", reinterpret_cast(Sbk_ImageLayerFunc_getComponentsNames), METH_NOARGS}, - {"getComponentsPrettyName", reinterpret_cast(Sbk_ImageLayerFunc_getComponentsPrettyName), METH_NOARGS}, - {"getDisparityLeftComponents", reinterpret_cast(Sbk_ImageLayerFunc_getDisparityLeftComponents), METH_NOARGS|METH_STATIC}, - {"getDisparityRightComponents", reinterpret_cast(Sbk_ImageLayerFunc_getDisparityRightComponents), METH_NOARGS|METH_STATIC}, - {"getForwardMotionComponents", reinterpret_cast(Sbk_ImageLayerFunc_getForwardMotionComponents), METH_NOARGS|METH_STATIC}, - {"getHash", reinterpret_cast(Sbk_ImageLayerFunc_getHash), METH_O|METH_STATIC}, - {"getLayerName", reinterpret_cast(Sbk_ImageLayerFunc_getLayerName), METH_NOARGS}, - {"getNoneComponents", reinterpret_cast(Sbk_ImageLayerFunc_getNoneComponents), METH_NOARGS|METH_STATIC}, - {"getNumComponents", reinterpret_cast(Sbk_ImageLayerFunc_getNumComponents), METH_NOARGS}, - {"getRGBAComponents", reinterpret_cast(Sbk_ImageLayerFunc_getRGBAComponents), METH_NOARGS|METH_STATIC}, - {"getRGBComponents", reinterpret_cast(Sbk_ImageLayerFunc_getRGBComponents), METH_NOARGS|METH_STATIC}, - {"isColorPlane", reinterpret_cast(Sbk_ImageLayerFunc_isColorPlane), METH_NOARGS}, - - {"__copy__", reinterpret_cast(Sbk_ImageLayer___copy__), METH_NOARGS}, - {nullptr, nullptr} // Sentinel -}; - -// Rich comparison -static PyObject * Sbk_ImageLayer_richcompare(PyObject *self, PyObject *pyArg, int op) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto &cppSelf = *reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - PythonToCppFunc pythonToCpp; - SBK_UNUSED(pythonToCpp) - - switch (op) { - case Py_NE: - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), (pyArg)))) { - // operator!=(const ImageLayer & other) const - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); - ::ImageLayer *cppArg0 = &cppArg0_local; - if (Shiboken::Conversions::isImplicitConversion(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), pythonToCpp)) - pythonToCpp(pyArg, &cppArg0_local); - else - pythonToCpp(pyArg, &cppArg0); - - bool cppResult = cppSelf !=(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } else { - pyResult = Py_True; - Py_INCREF(pyResult); - } - - break; - case Py_LT: - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), (pyArg)))) { - // operator<(const ImageLayer & other) const - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); - ::ImageLayer *cppArg0 = &cppArg0_local; - if (Shiboken::Conversions::isImplicitConversion(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), pythonToCpp)) - pythonToCpp(pyArg, &cppArg0_local); - else - pythonToCpp(pyArg, &cppArg0); - - bool cppResult = cppSelf <(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } else { - goto Sbk_ImageLayer_RichComparison_TypeError; - } - - break; - case Py_EQ: - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), (pyArg)))) { - // operator==(const ImageLayer & other) const - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::ImageLayer cppArg0_local = ::ImageLayer(::QString(), ::QString(), ::QStringList()); - ::ImageLayer *cppArg0 = &cppArg0_local; - if (Shiboken::Conversions::isImplicitConversion(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), pythonToCpp)) - pythonToCpp(pyArg, &cppArg0_local); - else - pythonToCpp(pyArg, &cppArg0); - - bool cppResult = cppSelf ==(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } else { - pyResult = Py_False; - Py_INCREF(pyResult); - } - - break; - default: - // PYSIDE-74: By default, we redirect to object's tp_richcompare (which is `==`, `!=`). - return FallbackRichCompare(self, pyArg, op); - goto Sbk_ImageLayer_RichComparison_TypeError; - } - - if (pyResult && !PyErr_Occurred()) - return pyResult; - Sbk_ImageLayer_RichComparison_TypeError: - PyErr_SetString(PyExc_NotImplementedError, "operator not implemented."); - return {}; - -} - -} // extern "C" - -static Py_hash_t Sbk_ImageLayer_HashFunc(PyObject *self) { - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - return Py_hash_t(ImageLayer::getHash(*cppSelf)); -} - -static int Sbk_ImageLayer_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ImageLayer_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ImageLayer_Type = nullptr; -static SbkObjectType *Sbk_ImageLayer_TypeF(void) -{ - return _Sbk_ImageLayer_Type; -} - -static PyType_Slot Sbk_ImageLayer_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, reinterpret_cast(&Sbk_ImageLayer_HashFunc)}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_ImageLayer_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ImageLayer_clear)}, - {Py_tp_richcompare, reinterpret_cast(Sbk_ImageLayer_richcompare)}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ImageLayer_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_ImageLayer_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_ImageLayer_spec = { - "1:NatronEngine.ImageLayer", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ImageLayer_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ImageLayer_PythonToCpp_ImageLayer_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ImageLayer_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ImageLayer_PythonToCpp_ImageLayer_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ImageLayer_TypeF()))) - return ImageLayer_PythonToCpp_ImageLayer_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ImageLayer_PTR_CppToPython_ImageLayer(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ImageLayer_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// C++ to Python copy conversion. -static PyObject *ImageLayer_COPY_CppToPython_ImageLayer(const void *cppIn) { - return Shiboken::Object::newObject(Sbk_ImageLayer_TypeF(), new ::ImageLayer(*reinterpret_cast(cppIn)), true, true); -} - -// Python to C++ copy conversion. -static void ImageLayer_PythonToCpp_ImageLayer_COPY(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::ImageLayer *>(cppOut) = *reinterpret_cast< ::ImageLayer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX], reinterpret_cast(pyIn))); -} -static PythonToCppFunc is_ImageLayer_PythonToCpp_ImageLayer_COPY_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ImageLayer_TypeF()))) - return ImageLayer_PythonToCpp_ImageLayer_COPY; - return {}; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ImageLayer_SignatureStrings[] = { - "NatronEngine.ImageLayer(self,layerName:QString,componentsPrettyName:QString,componentsName:QStringList)", - "NatronEngine.ImageLayer.getAlphaComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.getBackwardMotionComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.getComponentsNames(self)->QStringList", - "NatronEngine.ImageLayer.getComponentsPrettyName(self)->QString", - "NatronEngine.ImageLayer.getDisparityLeftComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.getDisparityRightComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.getForwardMotionComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.getHash(layer:NatronEngine.ImageLayer)->int", - "NatronEngine.ImageLayer.getLayerName(self)->QString", - "NatronEngine.ImageLayer.getNoneComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.getNumComponents(self)->int", - "NatronEngine.ImageLayer.getRGBAComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.getRGBComponents()->NatronEngine.ImageLayer", - "NatronEngine.ImageLayer.isColorPlane(self)->bool", - "NatronEngine.ImageLayer.__copy__()", - nullptr}; // Sentinel - -void init_ImageLayer(PyObject *module) -{ - _Sbk_ImageLayer_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ImageLayer", - "ImageLayer", - &Sbk_ImageLayer_spec, - &Shiboken::callCppDestructor< ::ImageLayer >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ImageLayer_Type); - InitSignatureStrings(pyType, ImageLayer_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ImageLayer_Type), Sbk_ImageLayer_PropertyStrings); - SbkNatronEngineTypes[SBK_IMAGELAYER_IDX] - = reinterpret_cast(Sbk_ImageLayer_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ImageLayer_TypeF(), - ImageLayer_PythonToCpp_ImageLayer_PTR, - is_ImageLayer_PythonToCpp_ImageLayer_PTR_Convertible, - ImageLayer_PTR_CppToPython_ImageLayer, - ImageLayer_COPY_CppToPython_ImageLayer); - - Shiboken::Conversions::registerConverterName(converter, "ImageLayer"); - Shiboken::Conversions::registerConverterName(converter, "ImageLayer*"); - Shiboken::Conversions::registerConverterName(converter, "ImageLayer&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ImageLayer).name()); - - // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter. - Shiboken::Conversions::addPythonToCppValueConversion(converter, - ImageLayer_PythonToCpp_ImageLayer_COPY, - is_ImageLayer_PythonToCpp_ImageLayer_COPY_Convertible); - - -} diff --git a/Engine/Qt5/NatronEngine/imagelayer_wrapper.h b/Engine/Qt5/NatronEngine/imagelayer_wrapper.h deleted file mode 100644 index 3b6199e3a6..0000000000 --- a/Engine/Qt5/NatronEngine/imagelayer_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_IMAGELAYER_H -#define SBK_IMAGELAYER_H - -#include - -#endif // SBK_IMAGELAYER_H - diff --git a/Engine/Qt5/NatronEngine/int2dparam_wrapper.cpp b/Engine/Qt5/NatronEngine/int2dparam_wrapper.cpp deleted file mode 100644 index 5b2812c26e..0000000000 --- a/Engine/Qt5/NatronEngine/int2dparam_wrapper.cpp +++ /dev/null @@ -1,413 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "int2dparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void Int2DParamWrapper::pysideInitQtMetaTypes() -{ -} - -void Int2DParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -Int2DParamWrapper::~Int2DParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_Int2DParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Int2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::get()const - // 1: IntParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Int2DParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - Int2DTuple* cppResult = new Int2DTuple(const_cast(cppSelf)->get()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX]), cppResult, true, true); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - Int2DTuple* cppResult = new Int2DTuple(const_cast(cppSelf)->get(cppArg0)); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX]), cppResult, true, true); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_Int2DParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Int2DParam.get"); - return {}; -} - -static PyObject *Sbk_Int2DParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Int2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::set(int) - // 1: Int2DParam::set(int,int) - // 2: Int2DParam::set(int,int,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // set(int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 1; // set(int,int) - } else if (numArgs == 3 - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 2; // set(int,int,double) - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Int2DParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(int x) - { - PyErr_Format(PyExc_TypeError, "%s is a private method.", "set(int x)"); - return {}; - break; - } - case 1: // set(int x, int y) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(int,int) - // Begin code injection - cppSelf->set(cppArg0,cppArg1); - - // End of code injection - - } - break; - } - case 2: // set(int x, int y, double frame) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // set(int,int,double) - // Begin code injection - cppSelf->set(cppArg0,cppArg1,cppArg2); - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_Int2DParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Int2DParam.set"); - return {}; -} - - -static const char *Sbk_Int2DParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Int2DParam_methods[] = { - {"get", reinterpret_cast(Sbk_Int2DParamFunc_get), METH_VARARGS}, - {"set", reinterpret_cast(Sbk_Int2DParamFunc_set), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Int2DParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Int2DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Int2DParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Int2DParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Int2DParam_Type = nullptr; -static SbkObjectType *Sbk_Int2DParam_TypeF(void) -{ - return _Sbk_Int2DParam_Type; -} - -static PyType_Slot Sbk_Int2DParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Int2DParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Int2DParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Int2DParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Int2DParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Int2DParam_spec = { - "1:NatronEngine.Int2DParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Int2DParam_slots -}; - -} //extern "C" - -static void *Sbk_Int2DParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::Int2DParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Int2DParam_PythonToCpp_Int2DParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Int2DParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Int2DParam_PythonToCpp_Int2DParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Int2DParam_TypeF()))) - return Int2DParam_PythonToCpp_Int2DParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Int2DParam_PTR_CppToPython_Int2DParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Int2DParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Int2DParam_SignatureStrings[] = { - "1:NatronEngine.Int2DParam.get(self)->NatronEngine.Int2DTuple", - "0:NatronEngine.Int2DParam.get(self,frame:double)->NatronEngine.Int2DTuple", - "2:NatronEngine.Int2DParam.set(self,x:int)", - "1:NatronEngine.Int2DParam.set(self,x:int,y:int)", - "0:NatronEngine.Int2DParam.set(self,x:int,y:int,frame:double)", - nullptr}; // Sentinel - -void init_Int2DParam(PyObject *module) -{ - _Sbk_Int2DParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Int2DParam", - "Int2DParam*", - &Sbk_Int2DParam_spec, - &Shiboken::callCppDestructor< ::Int2DParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_INTPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Int2DParam_Type); - InitSignatureStrings(pyType, Int2DParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Int2DParam_Type), Sbk_Int2DParam_PropertyStrings); - SbkNatronEngineTypes[SBK_INT2DPARAM_IDX] - = reinterpret_cast(Sbk_Int2DParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Int2DParam_TypeF(), - Int2DParam_PythonToCpp_Int2DParam_PTR, - is_Int2DParam_PythonToCpp_Int2DParam_PTR_Convertible, - Int2DParam_PTR_CppToPython_Int2DParam); - - Shiboken::Conversions::registerConverterName(converter, "Int2DParam"); - Shiboken::Conversions::registerConverterName(converter, "Int2DParam*"); - Shiboken::Conversions::registerConverterName(converter, "Int2DParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Int2DParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::Int2DParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_Int2DParam_TypeF(), &Sbk_Int2DParam_typeDiscovery); - - - Int2DParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/int2dparam_wrapper.h b/Engine/Qt5/NatronEngine/int2dparam_wrapper.h deleted file mode 100644 index 42cf6958cf..0000000000 --- a/Engine/Qt5/NatronEngine/int2dparam_wrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef SBK_INT2DPARAMWRAPPER_H -#define SBK_INT2DPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class Int2DParamWrapper : public Int2DParam -{ -public: - ~Int2DParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_INTPARAMWRAPPER_H -# define SBK_INTPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class IntParamWrapper : public IntParam -{ -public: - ~IntParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_INTPARAMWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_INT2DPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/int2dtuple_wrapper.cpp b/Engine/Qt5/NatronEngine/int2dtuple_wrapper.cpp deleted file mode 100644 index 178fdd846f..0000000000 --- a/Engine/Qt5/NatronEngine/int2dtuple_wrapper.cpp +++ /dev/null @@ -1,339 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "int2dtuple_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_Int2DTuple_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::Int2DTuple >())) - return -1; - - ::Int2DTuple *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // Int2DTuple() - cptr = new ::Int2DTuple(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::Int2DTuple >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - - -static const char *Sbk_Int2DTuple_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Int2DTuple_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -PyObject* Sbk_Int2DTupleFunc___getitem__(PyObject *self, Py_ssize_t _i) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Int2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - // Begin code injection - if (_i < 0 || _i >= 2) { - PyErr_BadArgument(); - return 0; - } else { - int ret; - switch (_i) { - case 0: - ret = cppSelf->x; - break; - case 1: - ret = cppSelf->y; - break; - } - return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - } - - // End of code injection - -} - -static PyObject *Sbk_Int2DTuple_get_x(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Int2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->x; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_Int2DTuple_set_x(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Int2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->x; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->x = cppOut_local; - - return 0; -} - -static PyObject *Sbk_Int2DTuple_get_y(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Int2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->y; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_Int2DTuple_set_y(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Int2DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->y; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->y = cppOut_local; - - return 0; -} - -// Getters and Setters for Int2DTuple -static PyGetSetDef Sbk_Int2DTuple_getsetlist[] = { - {const_cast("x"), Sbk_Int2DTuple_get_x, Sbk_Int2DTuple_set_x}, - {const_cast("y"), Sbk_Int2DTuple_get_y, Sbk_Int2DTuple_set_y}, - {nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_Int2DTuple_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Int2DTuple_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Int2DTuple_Type = nullptr; -static SbkObjectType *Sbk_Int2DTuple_TypeF(void) -{ - return _Sbk_Int2DTuple_Type; -} - -static PyType_Slot Sbk_Int2DTuple_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_Int2DTuple_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Int2DTuple_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Int2DTuple_methods)}, - {Py_tp_getset, reinterpret_cast(Sbk_Int2DTuple_getsetlist)}, - {Py_tp_init, reinterpret_cast(Sbk_Int2DTuple_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - // type supports sequence protocol - {Py_sq_item, (void *)&Sbk_Int2DTupleFunc___getitem__}, - {0, nullptr} -}; -static PyType_Spec Sbk_Int2DTuple_spec = { - "1:NatronEngine.Int2DTuple", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Int2DTuple_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Int2DTuple_PythonToCpp_Int2DTuple_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Int2DTuple_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Int2DTuple_PythonToCpp_Int2DTuple_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Int2DTuple_TypeF()))) - return Int2DTuple_PythonToCpp_Int2DTuple_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Int2DTuple_PTR_CppToPython_Int2DTuple(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Int2DTuple_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Int2DTuple_SignatureStrings[] = { - "NatronEngine.Int2DTuple(self)", - nullptr}; // Sentinel - -void init_Int2DTuple(PyObject *module) -{ - _Sbk_Int2DTuple_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Int2DTuple", - "Int2DTuple*", - &Sbk_Int2DTuple_spec, - &Shiboken::callCppDestructor< ::Int2DTuple >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Int2DTuple_Type); - InitSignatureStrings(pyType, Int2DTuple_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Int2DTuple_Type), Sbk_Int2DTuple_PropertyStrings); - SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX] - = reinterpret_cast(Sbk_Int2DTuple_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Int2DTuple_TypeF(), - Int2DTuple_PythonToCpp_Int2DTuple_PTR, - is_Int2DTuple_PythonToCpp_Int2DTuple_PTR_Convertible, - Int2DTuple_PTR_CppToPython_Int2DTuple); - - Shiboken::Conversions::registerConverterName(converter, "Int2DTuple"); - Shiboken::Conversions::registerConverterName(converter, "Int2DTuple*"); - Shiboken::Conversions::registerConverterName(converter, "Int2DTuple&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Int2DTuple).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/int2dtuple_wrapper.h b/Engine/Qt5/NatronEngine/int2dtuple_wrapper.h deleted file mode 100644 index 856bd9acba..0000000000 --- a/Engine/Qt5/NatronEngine/int2dtuple_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_INT2DTUPLE_H -#define SBK_INT2DTUPLE_H - -#include - -#endif // SBK_INT2DTUPLE_H - diff --git a/Engine/Qt5/NatronEngine/int3dparam_wrapper.cpp b/Engine/Qt5/NatronEngine/int3dparam_wrapper.cpp deleted file mode 100644 index 9b5e6233b8..0000000000 --- a/Engine/Qt5/NatronEngine/int3dparam_wrapper.cpp +++ /dev/null @@ -1,429 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "int3dparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void Int3DParamWrapper::pysideInitQtMetaTypes() -{ -} - -void Int3DParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -Int3DParamWrapper::~Int3DParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_Int3DParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Int3DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::get()const - // 1: IntParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Int3DParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - Int3DTuple* cppResult = new Int3DTuple(const_cast(cppSelf)->get()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX]), cppResult, true, true); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - Int3DTuple* cppResult = new Int3DTuple(const_cast(cppSelf)->get(cppArg0)); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX]), cppResult, true, true); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_Int3DParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Int3DParam.get"); - return {}; -} - -static PyObject *Sbk_Int3DParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Int3DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: Int2DParam::set(int,int) - // 1: IntParam::set(int) - // 2: Int3DParam::set(int,int,int) - // 3: Int3DParam::set(int,int,int,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 1; // set(int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // set(int,int) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 2; // set(int,int,int) - } else if (numArgs == 4 - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 3; // set(int,int,int,double) - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_Int3DParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(int x, int y) - { - PyErr_Format(PyExc_TypeError, "%s is a private method.", "set(int x, int y)"); - return {}; - break; - } - case 1: // set(int x) - { - PyErr_Format(PyExc_TypeError, "%s is a private method.", "set(int x)"); - return {}; - break; - } - case 2: // set(int x, int y, int z) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // set(int,int,int) - // Begin code injection - cppSelf->set(cppArg0,cppArg1,cppArg2); - - // End of code injection - - } - break; - } - case 3: // set(int x, int y, int z, double frame) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // set(int,int,int,double) - // Begin code injection - cppSelf->set(cppArg0,cppArg1,cppArg2,cppArg3); - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_Int3DParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Int3DParam.set"); - return {}; -} - - -static const char *Sbk_Int3DParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Int3DParam_methods[] = { - {"get", reinterpret_cast(Sbk_Int3DParamFunc_get), METH_VARARGS}, - {"set", reinterpret_cast(Sbk_Int3DParamFunc_set), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Int3DParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Int3DParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Int3DParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Int3DParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Int3DParam_Type = nullptr; -static SbkObjectType *Sbk_Int3DParam_TypeF(void) -{ - return _Sbk_Int3DParam_Type; -} - -static PyType_Slot Sbk_Int3DParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Int3DParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Int3DParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Int3DParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Int3DParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Int3DParam_spec = { - "1:NatronEngine.Int3DParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Int3DParam_slots -}; - -} //extern "C" - -static void *Sbk_Int3DParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::Int3DParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Int3DParam_PythonToCpp_Int3DParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Int3DParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Int3DParam_PythonToCpp_Int3DParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Int3DParam_TypeF()))) - return Int3DParam_PythonToCpp_Int3DParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Int3DParam_PTR_CppToPython_Int3DParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Int3DParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Int3DParam_SignatureStrings[] = { - "1:NatronEngine.Int3DParam.get(self)->NatronEngine.Int3DTuple", - "0:NatronEngine.Int3DParam.get(self,frame:double)->NatronEngine.Int3DTuple", - "3:NatronEngine.Int3DParam.set(self,x:int,y:int)", - "2:NatronEngine.Int3DParam.set(self,x:int)", - "1:NatronEngine.Int3DParam.set(self,x:int,y:int,z:int)", - "0:NatronEngine.Int3DParam.set(self,x:int,y:int,z:int,frame:double)", - nullptr}; // Sentinel - -void init_Int3DParam(PyObject *module) -{ - _Sbk_Int3DParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Int3DParam", - "Int3DParam*", - &Sbk_Int3DParam_spec, - &Shiboken::callCppDestructor< ::Int3DParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_INT2DPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Int3DParam_Type); - InitSignatureStrings(pyType, Int3DParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Int3DParam_Type), Sbk_Int3DParam_PropertyStrings); - SbkNatronEngineTypes[SBK_INT3DPARAM_IDX] - = reinterpret_cast(Sbk_Int3DParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Int3DParam_TypeF(), - Int3DParam_PythonToCpp_Int3DParam_PTR, - is_Int3DParam_PythonToCpp_Int3DParam_PTR_Convertible, - Int3DParam_PTR_CppToPython_Int3DParam); - - Shiboken::Conversions::registerConverterName(converter, "Int3DParam"); - Shiboken::Conversions::registerConverterName(converter, "Int3DParam*"); - Shiboken::Conversions::registerConverterName(converter, "Int3DParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Int3DParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::Int3DParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_Int3DParam_TypeF(), &Sbk_Int3DParam_typeDiscovery); - - - Int3DParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/int3dparam_wrapper.h b/Engine/Qt5/NatronEngine/int3dparam_wrapper.h deleted file mode 100644 index 73343375f9..0000000000 --- a/Engine/Qt5/NatronEngine/int3dparam_wrapper.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef SBK_INT3DPARAMWRAPPER_H -#define SBK_INT3DPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class Int3DParamWrapper : public Int3DParam -{ -public: - ~Int3DParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_INT2DPARAMWRAPPER_H -# define SBK_INT2DPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class Int2DParamWrapper : public Int2DParam -{ -public: - ~Int2DParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_INT2DPARAMWRAPPER_H - -# ifndef SBK_INTPARAMWRAPPER_H -# define SBK_INTPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class IntParamWrapper : public IntParam -{ -public: - ~IntParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_INTPARAMWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_INT3DPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/int3dtuple_wrapper.cpp b/Engine/Qt5/NatronEngine/int3dtuple_wrapper.cpp deleted file mode 100644 index 2fc1b6afc3..0000000000 --- a/Engine/Qt5/NatronEngine/int3dtuple_wrapper.cpp +++ /dev/null @@ -1,377 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "int3dtuple_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_Int3DTuple_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::Int3DTuple >())) - return -1; - - ::Int3DTuple *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // Int3DTuple() - cptr = new ::Int3DTuple(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::Int3DTuple >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - - -static const char *Sbk_Int3DTuple_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Int3DTuple_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -PyObject* Sbk_Int3DTupleFunc___getitem__(PyObject *self, Py_ssize_t _i) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Int3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - // Begin code injection - if (_i < 0 || _i >= 3) { - PyErr_BadArgument(); - return 0; - } else { - int ret; - switch (_i) { - case 0: - ret = cppSelf->x; - break; - case 1: - ret = cppSelf->y; - break; - case 2: - ret = cppSelf->z; - break; - } - return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &ret); - } - - // End of code injection - -} - -static PyObject *Sbk_Int3DTuple_get_x(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Int3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->x; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_Int3DTuple_set_x(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Int3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->x; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->x = cppOut_local; - - return 0; -} - -static PyObject *Sbk_Int3DTuple_get_y(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Int3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->y; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_Int3DTuple_set_y(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Int3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->y; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->y = cppOut_local; - - return 0; -} - -static PyObject *Sbk_Int3DTuple_get_z(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::Int3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->z; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_Int3DTuple_set_z(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::Int3DTuple *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'z' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'z', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->z; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->z = cppOut_local; - - return 0; -} - -// Getters and Setters for Int3DTuple -static PyGetSetDef Sbk_Int3DTuple_getsetlist[] = { - {const_cast("x"), Sbk_Int3DTuple_get_x, Sbk_Int3DTuple_set_x}, - {const_cast("y"), Sbk_Int3DTuple_get_y, Sbk_Int3DTuple_set_y}, - {const_cast("z"), Sbk_Int3DTuple_get_z, Sbk_Int3DTuple_set_z}, - {nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_Int3DTuple_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Int3DTuple_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Int3DTuple_Type = nullptr; -static SbkObjectType *Sbk_Int3DTuple_TypeF(void) -{ - return _Sbk_Int3DTuple_Type; -} - -static PyType_Slot Sbk_Int3DTuple_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_Int3DTuple_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Int3DTuple_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Int3DTuple_methods)}, - {Py_tp_getset, reinterpret_cast(Sbk_Int3DTuple_getsetlist)}, - {Py_tp_init, reinterpret_cast(Sbk_Int3DTuple_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - // type supports sequence protocol - {Py_sq_item, (void *)&Sbk_Int3DTupleFunc___getitem__}, - {0, nullptr} -}; -static PyType_Spec Sbk_Int3DTuple_spec = { - "1:NatronEngine.Int3DTuple", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Int3DTuple_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Int3DTuple_PythonToCpp_Int3DTuple_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Int3DTuple_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Int3DTuple_PythonToCpp_Int3DTuple_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Int3DTuple_TypeF()))) - return Int3DTuple_PythonToCpp_Int3DTuple_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Int3DTuple_PTR_CppToPython_Int3DTuple(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Int3DTuple_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Int3DTuple_SignatureStrings[] = { - "NatronEngine.Int3DTuple(self)", - nullptr}; // Sentinel - -void init_Int3DTuple(PyObject *module) -{ - _Sbk_Int3DTuple_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Int3DTuple", - "Int3DTuple*", - &Sbk_Int3DTuple_spec, - &Shiboken::callCppDestructor< ::Int3DTuple >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Int3DTuple_Type); - InitSignatureStrings(pyType, Int3DTuple_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Int3DTuple_Type), Sbk_Int3DTuple_PropertyStrings); - SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX] - = reinterpret_cast(Sbk_Int3DTuple_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Int3DTuple_TypeF(), - Int3DTuple_PythonToCpp_Int3DTuple_PTR, - is_Int3DTuple_PythonToCpp_Int3DTuple_PTR_Convertible, - Int3DTuple_PTR_CppToPython_Int3DTuple); - - Shiboken::Conversions::registerConverterName(converter, "Int3DTuple"); - Shiboken::Conversions::registerConverterName(converter, "Int3DTuple*"); - Shiboken::Conversions::registerConverterName(converter, "Int3DTuple&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Int3DTuple).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/int3dtuple_wrapper.h b/Engine/Qt5/NatronEngine/int3dtuple_wrapper.h deleted file mode 100644 index b5ba10f72a..0000000000 --- a/Engine/Qt5/NatronEngine/int3dtuple_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_INT3DTUPLE_H -#define SBK_INT3DTUPLE_H - -#include - -#endif // SBK_INT3DTUPLE_H - diff --git a/Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.cpp b/Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.cpp deleted file mode 100644 index 4683056c81..0000000000 --- a/Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.cpp +++ /dev/null @@ -1,467 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "intnodecreationproperty_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void IntNodeCreationPropertyWrapper::pysideInitQtMetaTypes() -{ -} - -void IntNodeCreationPropertyWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -IntNodeCreationPropertyWrapper::IntNodeCreationPropertyWrapper(const std::vector & values) : IntNodeCreationProperty(values) -{ - resetPyMethodCache(); - // ... middle -} - -IntNodeCreationPropertyWrapper::IntNodeCreationPropertyWrapper(int value) : IntNodeCreationProperty(value) -{ - resetPyMethodCache(); - // ... middle -} - -IntNodeCreationPropertyWrapper::~IntNodeCreationPropertyWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_IntNodeCreationProperty_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::IntNodeCreationProperty >())) - return -1; - - ::IntNodeCreationPropertyWrapper *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntNodeCreationProperty(): too many arguments"); - return -1; - } - - if (!PyArg_ParseTuple(args, "|O:IntNodeCreationProperty", &(pyArgs[0]))) - return -1; - - - // Overloaded function decisor - // 0: IntNodeCreationProperty::IntNodeCreationProperty(std::vector) - // 1: IntNodeCreationProperty::IntNodeCreationProperty(int) - if (numArgs == 0) { - overloadId = 0; // IntNodeCreationProperty(std::vector) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // IntNodeCreationProperty(int) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_INT_IDX], (pyArgs[0])))) { - overloadId = 0; // IntNodeCreationProperty(std::vector) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntNodeCreationProperty_Init_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // IntNodeCreationProperty(const std::vector & values) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","values"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntNodeCreationProperty(): got multiple values for keyword argument 'values'."); - return -1; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_INT_IDX], (pyArgs[0])))) - goto Sbk_IntNodeCreationProperty_Init_TypeError; - } - } - } - ::std::vector cppArg0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // IntNodeCreationProperty(std::vector) - cptr = new ::IntNodeCreationPropertyWrapper(cppArg0); - } - break; - } - case 1: // IntNodeCreationProperty(int value) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // IntNodeCreationProperty(int) - cptr = new ::IntNodeCreationPropertyWrapper(cppArg0); - } - break; - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::IntNodeCreationProperty >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_IntNodeCreationProperty_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_IntNodeCreationProperty_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntNodeCreationProperty"); - return -1; -} - -static PyObject *Sbk_IntNodeCreationPropertyFunc_getValues(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getValues()const - const std::vector & cppResult = const_cast(cppSelf)->getValues(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_INT_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_IntNodeCreationPropertyFunc_setValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntNodeCreationProperty.setValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntNodeCreationProperty.setValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntNodeCreationProperty::setValue(int,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setValue(int,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValue(int,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntNodeCreationPropertyFunc_setValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","index"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntNodeCreationProperty.setValue(): got multiple values for keyword argument 'index'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntNodeCreationPropertyFunc_setValue_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValue(int,int) - cppSelf->setValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntNodeCreationPropertyFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntNodeCreationProperty.setValue"); - return {}; -} - - -static const char *Sbk_IntNodeCreationProperty_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_IntNodeCreationProperty_methods[] = { - {"getValues", reinterpret_cast(Sbk_IntNodeCreationPropertyFunc_getValues), METH_NOARGS}, - {"setValue", reinterpret_cast(Sbk_IntNodeCreationPropertyFunc_setValue), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_IntNodeCreationProperty_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::IntNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_IntNodeCreationProperty_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_IntNodeCreationProperty_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_IntNodeCreationProperty_Type = nullptr; -static SbkObjectType *Sbk_IntNodeCreationProperty_TypeF(void) -{ - return _Sbk_IntNodeCreationProperty_Type; -} - -static PyType_Slot Sbk_IntNodeCreationProperty_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_IntNodeCreationProperty_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_IntNodeCreationProperty_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_IntNodeCreationProperty_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_IntNodeCreationProperty_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_IntNodeCreationProperty_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_IntNodeCreationProperty_spec = { - "1:NatronEngine.IntNodeCreationProperty", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_IntNodeCreationProperty_slots -}; - -} //extern "C" - -static void *Sbk_IntNodeCreationProperty_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::NodeCreationProperty >())) - return dynamic_cast< ::IntNodeCreationProperty *>(reinterpret_cast< ::NodeCreationProperty *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void IntNodeCreationProperty_PythonToCpp_IntNodeCreationProperty_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_IntNodeCreationProperty_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_IntNodeCreationProperty_PythonToCpp_IntNodeCreationProperty_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_IntNodeCreationProperty_TypeF()))) - return IntNodeCreationProperty_PythonToCpp_IntNodeCreationProperty_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *IntNodeCreationProperty_PTR_CppToPython_IntNodeCreationProperty(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_IntNodeCreationProperty_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *IntNodeCreationProperty_SignatureStrings[] = { - "1:NatronEngine.IntNodeCreationProperty(self,values:std.vector[int]=std.vector< int >())", - "0:NatronEngine.IntNodeCreationProperty(self,value:int)", - "NatronEngine.IntNodeCreationProperty.getValues(self)->std.vector[int]", - "NatronEngine.IntNodeCreationProperty.setValue(self,value:int,index:int=0)", - nullptr}; // Sentinel - -void init_IntNodeCreationProperty(PyObject *module) -{ - _Sbk_IntNodeCreationProperty_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "IntNodeCreationProperty", - "IntNodeCreationProperty*", - &Sbk_IntNodeCreationProperty_spec, - &Shiboken::callCppDestructor< ::IntNodeCreationProperty >, - reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_IntNodeCreationProperty_Type); - InitSignatureStrings(pyType, IntNodeCreationProperty_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_IntNodeCreationProperty_Type), Sbk_IntNodeCreationProperty_PropertyStrings); - SbkNatronEngineTypes[SBK_INTNODECREATIONPROPERTY_IDX] - = reinterpret_cast(Sbk_IntNodeCreationProperty_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_IntNodeCreationProperty_TypeF(), - IntNodeCreationProperty_PythonToCpp_IntNodeCreationProperty_PTR, - is_IntNodeCreationProperty_PythonToCpp_IntNodeCreationProperty_PTR_Convertible, - IntNodeCreationProperty_PTR_CppToPython_IntNodeCreationProperty); - - Shiboken::Conversions::registerConverterName(converter, "IntNodeCreationProperty"); - Shiboken::Conversions::registerConverterName(converter, "IntNodeCreationProperty*"); - Shiboken::Conversions::registerConverterName(converter, "IntNodeCreationProperty&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::IntNodeCreationProperty).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::IntNodeCreationPropertyWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_IntNodeCreationProperty_TypeF(), &Sbk_IntNodeCreationProperty_typeDiscovery); - - - IntNodeCreationPropertyWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.h b/Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.h deleted file mode 100644 index ca13c5f439..0000000000 --- a/Engine/Qt5/NatronEngine/intnodecreationproperty_wrapper.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SBK_INTNODECREATIONPROPERTYWRAPPER_H -#define SBK_INTNODECREATIONPROPERTYWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class IntNodeCreationPropertyWrapper : public IntNodeCreationProperty -{ -public: - IntNodeCreationPropertyWrapper(const std::vector & values = std::vector< int >()); - IntNodeCreationPropertyWrapper(int value); - ~IntNodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_NODECREATIONPROPERTYWRAPPER_H -# define SBK_NODECREATIONPROPERTYWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class NodeCreationPropertyWrapper : public NodeCreationProperty -{ -public: - NodeCreationPropertyWrapper(); - ~NodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_NODECREATIONPROPERTYWRAPPER_H - -#endif // SBK_INTNODECREATIONPROPERTYWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/intparam_wrapper.cpp b/Engine/Qt5/NatronEngine/intparam_wrapper.cpp deleted file mode 100644 index b057eb564e..0000000000 --- a/Engine/Qt5/NatronEngine/intparam_wrapper.cpp +++ /dev/null @@ -1,1613 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "intparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void IntParamWrapper::pysideInitQtMetaTypes() -{ -} - -void IntParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -IntParamWrapper::~IntParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_IntParamFunc_addAsDependencyOf(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addAsDependencyOf", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::addAsDependencyOf(int,Param*,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // addAsDependencyOf(int,Param*,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_addAsDependencyOf_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Param *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // addAsDependencyOf(int,Param*,int) - int cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_addAsDependencyOf_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.addAsDependencyOf"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::get()const - // 1: IntParam::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - int cppResult = const_cast(cppSelf)->get(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - int cppResult = const_cast(cppSelf)->get(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.get"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_getDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getDefaultValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getDefaultValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::getDefaultValue(int)const - if (numArgs == 0) { - overloadId = 0; // getDefaultValue(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getDefaultValue(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_getDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_IntParamFunc_getDefaultValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getDefaultValue(int)const - int cppResult = const_cast(cppSelf)->getDefaultValue(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_getDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.getDefaultValue"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_getDisplayMaximum(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: IntParam::getDisplayMaximum(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getDisplayMaximum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_getDisplayMaximum_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getDisplayMaximum(int)const - int cppResult = const_cast(cppSelf)->getDisplayMaximum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_getDisplayMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.IntParam.getDisplayMaximum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_getDisplayMinimum(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: IntParam::getDisplayMinimum(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getDisplayMinimum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_getDisplayMinimum_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getDisplayMinimum(int)const - int cppResult = const_cast(cppSelf)->getDisplayMinimum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_getDisplayMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.IntParam.getDisplayMinimum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_getMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getMaximum(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getMaximum", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::getMaximum(int)const - if (numArgs == 0) { - overloadId = 0; // getMaximum(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getMaximum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_getMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_IntParamFunc_getMaximum_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getMaximum(int)const - int cppResult = const_cast(cppSelf)->getMaximum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_getMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.getMaximum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_getMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getMinimum(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getMinimum", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::getMinimum(int)const - if (numArgs == 0) { - overloadId = 0; // getMinimum(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getMinimum(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_getMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_IntParamFunc_getMinimum_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getMinimum(int)const - int cppResult = const_cast(cppSelf)->getMinimum(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_getMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.getMinimum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_getValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::getValue(int)const - if (numArgs == 0) { - overloadId = 0; // getValue(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getValue(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_getValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_IntParamFunc_getValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getValue(int)const - int cppResult = const_cast(cppSelf)->getValue(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_getValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.getValue"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_getValueAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getValueAtTime(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getValueAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:getValueAtTime", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::getValueAtTime(double,int)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // getValueAtTime(double,int)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getValueAtTime(double,int)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_getValueAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.getValueAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntParamFunc_getValueAtTime_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getValueAtTime(double,int)const - int cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_IntParamFunc_getValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.getValueAtTime"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_restoreDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.restoreDefaultValue(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:restoreDefaultValue", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::restoreDefaultValue(int) - if (numArgs == 0) { - overloadId = 0; // restoreDefaultValue(int) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // restoreDefaultValue(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_restoreDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.restoreDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_IntParamFunc_restoreDefaultValue_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // restoreDefaultValue(int) - // Begin code injection - cppSelf->restoreDefaultValue(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_restoreDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.restoreDefaultValue"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::set(int) - // 1: IntParam::set(int,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // set(int) - } else if (numArgs == 2 - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 1; // set(int,double) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(int x) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(int) - // Begin code injection - cppSelf->set(cppArg0); - - // End of code injection - - } - break; - } - case 1: // set(int x, double frame) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(int,double) - // Begin code injection - cppSelf->set(cppArg0,cppArg1); - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.set"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_setDefaultValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDefaultValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDefaultValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDefaultValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::setDefaultValue(int,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDefaultValue(int,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDefaultValue(int,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_setDefaultValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDefaultValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntParamFunc_setDefaultValue_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDefaultValue(int,int) - cppSelf->setDefaultValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_setDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.setDefaultValue"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_setDisplayMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDisplayMaximum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDisplayMaximum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDisplayMaximum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::setDisplayMaximum(int,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDisplayMaximum(int,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDisplayMaximum(int,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_setDisplayMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDisplayMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntParamFunc_setDisplayMaximum_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDisplayMaximum(int,int) - cppSelf->setDisplayMaximum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_setDisplayMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.setDisplayMaximum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_setDisplayMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDisplayMinimum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDisplayMinimum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setDisplayMinimum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::setDisplayMinimum(int,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setDisplayMinimum(int,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setDisplayMinimum(int,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_setDisplayMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setDisplayMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntParamFunc_setDisplayMinimum_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setDisplayMinimum(int,int) - cppSelf->setDisplayMinimum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_setDisplayMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.setDisplayMinimum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_setMaximum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setMaximum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setMaximum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setMaximum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::setMaximum(int,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setMaximum(int,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setMaximum(int,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_setMaximum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setMaximum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntParamFunc_setMaximum_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setMaximum(int,int) - cppSelf->setMaximum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_setMaximum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.setMaximum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_setMinimum(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setMinimum(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setMinimum(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setMinimum", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::setMinimum(int,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setMinimum(int,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setMinimum(int,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_setMinimum_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setMinimum(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntParamFunc_setMinimum_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setMinimum(int,int) - cppSelf->setMinimum(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_setMinimum_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.setMinimum"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_setValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::setValue(int,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setValue(int,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValue(int,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_setValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setValue(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_IntParamFunc_setValue_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValue(int,int) - // Begin code injection - cppSelf->setValue(cppArg0,cppArg1); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.setValue"); - return {}; -} - -static PyObject *Sbk_IntParamFunc_setValueAtTime(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setValueAtTime(): too many arguments"); - return {}; - } else if (numArgs < 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setValueAtTime(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOO:setValueAtTime", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: IntParam::setValueAtTime(int,double,int) - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // setValueAtTime(int,double,int) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // setValueAtTime(int,double,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_IntParamFunc_setValueAtTime_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[2]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.IntParam.setValueAtTime(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[2] = value; - if (!(pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) - goto Sbk_IntParamFunc_setValueAtTime_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2 = 0; - if (pythonToCpp[2]) pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setValueAtTime(int,double,int) - // Begin code injection - cppSelf->setValueAtTime(cppArg0,cppArg1,cppArg2); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_IntParamFunc_setValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.IntParam.setValueAtTime"); - return {}; -} - - -static const char *Sbk_IntParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_IntParam_methods[] = { - {"addAsDependencyOf", reinterpret_cast(Sbk_IntParamFunc_addAsDependencyOf), METH_VARARGS}, - {"get", reinterpret_cast(Sbk_IntParamFunc_get), METH_VARARGS}, - {"getDefaultValue", reinterpret_cast(Sbk_IntParamFunc_getDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"getDisplayMaximum", reinterpret_cast(Sbk_IntParamFunc_getDisplayMaximum), METH_O}, - {"getDisplayMinimum", reinterpret_cast(Sbk_IntParamFunc_getDisplayMinimum), METH_O}, - {"getMaximum", reinterpret_cast(Sbk_IntParamFunc_getMaximum), METH_VARARGS|METH_KEYWORDS}, - {"getMinimum", reinterpret_cast(Sbk_IntParamFunc_getMinimum), METH_VARARGS|METH_KEYWORDS}, - {"getValue", reinterpret_cast(Sbk_IntParamFunc_getValue), METH_VARARGS|METH_KEYWORDS}, - {"getValueAtTime", reinterpret_cast(Sbk_IntParamFunc_getValueAtTime), METH_VARARGS|METH_KEYWORDS}, - {"restoreDefaultValue", reinterpret_cast(Sbk_IntParamFunc_restoreDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"set", reinterpret_cast(Sbk_IntParamFunc_set), METH_VARARGS}, - {"setDefaultValue", reinterpret_cast(Sbk_IntParamFunc_setDefaultValue), METH_VARARGS|METH_KEYWORDS}, - {"setDisplayMaximum", reinterpret_cast(Sbk_IntParamFunc_setDisplayMaximum), METH_VARARGS|METH_KEYWORDS}, - {"setDisplayMinimum", reinterpret_cast(Sbk_IntParamFunc_setDisplayMinimum), METH_VARARGS|METH_KEYWORDS}, - {"setMaximum", reinterpret_cast(Sbk_IntParamFunc_setMaximum), METH_VARARGS|METH_KEYWORDS}, - {"setMinimum", reinterpret_cast(Sbk_IntParamFunc_setMinimum), METH_VARARGS|METH_KEYWORDS}, - {"setValue", reinterpret_cast(Sbk_IntParamFunc_setValue), METH_VARARGS|METH_KEYWORDS}, - {"setValueAtTime", reinterpret_cast(Sbk_IntParamFunc_setValueAtTime), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_IntParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::IntParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_INTPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_IntParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_IntParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_IntParam_Type = nullptr; -static SbkObjectType *Sbk_IntParam_TypeF(void) -{ - return _Sbk_IntParam_Type; -} - -static PyType_Slot Sbk_IntParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_IntParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_IntParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_IntParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_IntParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_IntParam_spec = { - "1:NatronEngine.IntParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_IntParam_slots -}; - -} //extern "C" - -static void *Sbk_IntParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::IntParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void IntParam_PythonToCpp_IntParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_IntParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_IntParam_PythonToCpp_IntParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_IntParam_TypeF()))) - return IntParam_PythonToCpp_IntParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *IntParam_PTR_CppToPython_IntParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_IntParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *IntParam_SignatureStrings[] = { - "NatronEngine.IntParam.addAsDependencyOf(self,fromExprDimension:int,param:NatronEngine.Param,thisDimension:int)->int", - "1:NatronEngine.IntParam.get(self)->int", - "0:NatronEngine.IntParam.get(self,frame:double)->int", - "NatronEngine.IntParam.getDefaultValue(self,dimension:int=0)->int", - "NatronEngine.IntParam.getDisplayMaximum(self,dimension:int)->int", - "NatronEngine.IntParam.getDisplayMinimum(self,dimension:int)->int", - "NatronEngine.IntParam.getMaximum(self,dimension:int=0)->int", - "NatronEngine.IntParam.getMinimum(self,dimension:int=0)->int", - "NatronEngine.IntParam.getValue(self,dimension:int=0)->int", - "NatronEngine.IntParam.getValueAtTime(self,time:double,dimension:int=0)->int", - "NatronEngine.IntParam.restoreDefaultValue(self,dimension:int=0)", - "1:NatronEngine.IntParam.set(self,x:int)", - "0:NatronEngine.IntParam.set(self,x:int,frame:double)", - "NatronEngine.IntParam.setDefaultValue(self,value:int,dimension:int=0)", - "NatronEngine.IntParam.setDisplayMaximum(self,maximum:int,dimension:int=0)", - "NatronEngine.IntParam.setDisplayMinimum(self,minimum:int,dimension:int=0)", - "NatronEngine.IntParam.setMaximum(self,maximum:int,dimension:int=0)", - "NatronEngine.IntParam.setMinimum(self,minimum:int,dimension:int=0)", - "NatronEngine.IntParam.setValue(self,value:int,dimension:int=0)", - "NatronEngine.IntParam.setValueAtTime(self,value:int,time:double,dimension:int=0)", - nullptr}; // Sentinel - -void init_IntParam(PyObject *module) -{ - _Sbk_IntParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "IntParam", - "IntParam*", - &Sbk_IntParam_spec, - &Shiboken::callCppDestructor< ::IntParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_IntParam_Type); - InitSignatureStrings(pyType, IntParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_IntParam_Type), Sbk_IntParam_PropertyStrings); - SbkNatronEngineTypes[SBK_INTPARAM_IDX] - = reinterpret_cast(Sbk_IntParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_IntParam_TypeF(), - IntParam_PythonToCpp_IntParam_PTR, - is_IntParam_PythonToCpp_IntParam_PTR_Convertible, - IntParam_PTR_CppToPython_IntParam); - - Shiboken::Conversions::registerConverterName(converter, "IntParam"); - Shiboken::Conversions::registerConverterName(converter, "IntParam*"); - Shiboken::Conversions::registerConverterName(converter, "IntParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::IntParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::IntParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_IntParam_TypeF(), &Sbk_IntParam_typeDiscovery); - - - IntParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/intparam_wrapper.h b/Engine/Qt5/NatronEngine/intparam_wrapper.h deleted file mode 100644 index ac26a9fc9d..0000000000 --- a/Engine/Qt5/NatronEngine/intparam_wrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SBK_INTPARAMWRAPPER_H -#define SBK_INTPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class IntParamWrapper : public IntParam -{ -public: - ~IntParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_INTPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/itembase_wrapper.cpp b/Engine/Qt5/NatronEngine/itembase_wrapper.cpp deleted file mode 100644 index 4b10e20132..0000000000 --- a/Engine/Qt5/NatronEngine/itembase_wrapper.cpp +++ /dev/null @@ -1,619 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "itembase_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void ItemBaseWrapper::pysideInitQtMetaTypes() -{ -} - -void ItemBaseWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -ItemBaseWrapper::~ItemBaseWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_ItemBaseFunc_getLabel(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getLabel()const - QString cppResult = const_cast(cppSelf)->getLabel(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ItemBaseFunc_getLocked(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getLocked()const - bool cppResult = const_cast(cppSelf)->getLocked(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ItemBaseFunc_getLockedRecursive(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getLockedRecursive()const - bool cppResult = const_cast(cppSelf)->getLockedRecursive(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ItemBaseFunc_getParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ItemBase::getParam(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getParam(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ItemBaseFunc_getParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getParam(QString)const - Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ItemBaseFunc_getParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.getParam"); - return {}; -} - -static PyObject *Sbk_ItemBaseFunc_getParentLayer(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getParentLayer()const - Layer * cppResult = const_cast(cppSelf)->getParentLayer(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_LAYER_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ItemBaseFunc_getScriptName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getScriptName()const - QString cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ItemBaseFunc_getVisible(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getVisible()const - bool cppResult = const_cast(cppSelf)->getVisible(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ItemBaseFunc_setLabel(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ItemBase::setLabel(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setLabel(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ItemBaseFunc_setLabel_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setLabel(QString) - // Begin code injection - cppSelf->setLabel(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ItemBaseFunc_setLabel_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.setLabel"); - return {}; -} - -static PyObject *Sbk_ItemBaseFunc_setLocked(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ItemBase::setLocked(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setLocked(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ItemBaseFunc_setLocked_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setLocked(bool) - cppSelf->setLocked(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ItemBaseFunc_setLocked_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.setLocked"); - return {}; -} - -static PyObject *Sbk_ItemBaseFunc_setScriptName(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ItemBase::setScriptName(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setScriptName(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ItemBaseFunc_setScriptName_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setScriptName(QString) - // Begin code injection - bool cppResult = cppSelf->setScriptName(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ItemBaseFunc_setScriptName_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.setScriptName"); - return {}; -} - -static PyObject *Sbk_ItemBaseFunc_setVisible(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ItemBase::setVisible(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setVisible(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ItemBaseFunc_setVisible_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setVisible(bool) - cppSelf->setVisible(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ItemBaseFunc_setVisible_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ItemBase.setVisible"); - return {}; -} - - -static const char *Sbk_ItemBase_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ItemBase_methods[] = { - {"getLabel", reinterpret_cast(Sbk_ItemBaseFunc_getLabel), METH_NOARGS}, - {"getLocked", reinterpret_cast(Sbk_ItemBaseFunc_getLocked), METH_NOARGS}, - {"getLockedRecursive", reinterpret_cast(Sbk_ItemBaseFunc_getLockedRecursive), METH_NOARGS}, - {"getParam", reinterpret_cast(Sbk_ItemBaseFunc_getParam), METH_O}, - {"getParentLayer", reinterpret_cast(Sbk_ItemBaseFunc_getParentLayer), METH_NOARGS}, - {"getScriptName", reinterpret_cast(Sbk_ItemBaseFunc_getScriptName), METH_NOARGS}, - {"getVisible", reinterpret_cast(Sbk_ItemBaseFunc_getVisible), METH_NOARGS}, - {"setLabel", reinterpret_cast(Sbk_ItemBaseFunc_setLabel), METH_O}, - {"setLocked", reinterpret_cast(Sbk_ItemBaseFunc_setLocked), METH_O}, - {"setScriptName", reinterpret_cast(Sbk_ItemBaseFunc_setScriptName), METH_O}, - {"setVisible", reinterpret_cast(Sbk_ItemBaseFunc_setVisible), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_ItemBase_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::ItemBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_ItemBase_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ItemBase_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ItemBase_Type = nullptr; -static SbkObjectType *Sbk_ItemBase_TypeF(void) -{ - return _Sbk_ItemBase_Type; -} - -static PyType_Slot Sbk_ItemBase_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_ItemBase_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_ItemBase_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ItemBase_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ItemBase_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_ItemBase_spec = { - "1:NatronEngine.ItemBase", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ItemBase_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ItemBase_PythonToCpp_ItemBase_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ItemBase_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ItemBase_PythonToCpp_ItemBase_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ItemBase_TypeF()))) - return ItemBase_PythonToCpp_ItemBase_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ItemBase_PTR_CppToPython_ItemBase(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ItemBase_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ItemBase_SignatureStrings[] = { - "NatronEngine.ItemBase.getLabel(self)->QString", - "NatronEngine.ItemBase.getLocked(self)->bool", - "NatronEngine.ItemBase.getLockedRecursive(self)->bool", - "NatronEngine.ItemBase.getParam(self,name:QString)->NatronEngine.Param", - "NatronEngine.ItemBase.getParentLayer(self)->NatronEngine.Layer", - "NatronEngine.ItemBase.getScriptName(self)->QString", - "NatronEngine.ItemBase.getVisible(self)->bool", - "NatronEngine.ItemBase.setLabel(self,name:QString)", - "NatronEngine.ItemBase.setLocked(self,locked:bool)", - "NatronEngine.ItemBase.setScriptName(self,name:QString)->bool", - "NatronEngine.ItemBase.setVisible(self,activated:bool)", - nullptr}; // Sentinel - -void init_ItemBase(PyObject *module) -{ - _Sbk_ItemBase_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ItemBase", - "ItemBase*", - &Sbk_ItemBase_spec, - &Shiboken::callCppDestructor< ::ItemBase >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ItemBase_Type); - InitSignatureStrings(pyType, ItemBase_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ItemBase_Type), Sbk_ItemBase_PropertyStrings); - SbkNatronEngineTypes[SBK_ITEMBASE_IDX] - = reinterpret_cast(Sbk_ItemBase_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ItemBase_TypeF(), - ItemBase_PythonToCpp_ItemBase_PTR, - is_ItemBase_PythonToCpp_ItemBase_PTR_Convertible, - ItemBase_PTR_CppToPython_ItemBase); - - Shiboken::Conversions::registerConverterName(converter, "ItemBase"); - Shiboken::Conversions::registerConverterName(converter, "ItemBase*"); - Shiboken::Conversions::registerConverterName(converter, "ItemBase&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ItemBase).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::ItemBaseWrapper).name()); - - - - ItemBaseWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/itembase_wrapper.h b/Engine/Qt5/NatronEngine/itembase_wrapper.h deleted file mode 100644 index 67a27338df..0000000000 --- a/Engine/Qt5/NatronEngine/itembase_wrapper.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SBK_ITEMBASEWRAPPER_H -#define SBK_ITEMBASEWRAPPER_H - -#include - - -// Extra includes -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ItemBaseWrapper : public ItemBase -{ -public: - ~ItemBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_ITEMBASEWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/layer_wrapper.cpp b/Engine/Qt5/NatronEngine/layer_wrapper.cpp deleted file mode 100644 index cb0096b046..0000000000 --- a/Engine/Qt5/NatronEngine/layer_wrapper.cpp +++ /dev/null @@ -1,436 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "layer_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void LayerWrapper::pysideInitQtMetaTypes() -{ -} - -void LayerWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -LayerWrapper::~LayerWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_LayerFunc_addItem(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Layer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_LAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Layer::addItem(ItemBase*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), (pyArg)))) { - overloadId = 0; // addItem(ItemBase*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_LayerFunc_addItem_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::ItemBase *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // addItem(ItemBase*) - // Begin code injection - cppSelf->addItem(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_LayerFunc_addItem_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Layer.addItem"); - return {}; -} - -static PyObject *Sbk_LayerFunc_getChildren(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Layer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_LAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getChildren()const - // Begin code injection - std::list items = cppSelf->getChildren(); - PyObject* ret = PyList_New((int) items.size()); - int idx = 0; - for (std::list::iterator it = items.begin(); it!=items.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_LayerFunc_insertItem(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Layer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_LAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "insertItem", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Layer::insertItem(int,ItemBase*) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), (pyArgs[1])))) { - overloadId = 0; // insertItem(int,ItemBase*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_LayerFunc_insertItem_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::ItemBase *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // insertItem(int,ItemBase*) - // Begin code injection - cppSelf->insertItem(cppArg0,cppArg1); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_LayerFunc_insertItem_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Layer.insertItem"); - return {}; -} - -static PyObject *Sbk_LayerFunc_removeItem(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Layer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_LAYER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Layer::removeItem(ItemBase*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), (pyArg)))) { - overloadId = 0; // removeItem(ItemBase*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_LayerFunc_removeItem_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::ItemBase *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // removeItem(ItemBase*) - // Begin code injection - cppSelf->removeItem(cppArg0); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_LayerFunc_removeItem_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Layer.removeItem"); - return {}; -} - - -static const char *Sbk_Layer_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Layer_methods[] = { - {"addItem", reinterpret_cast(Sbk_LayerFunc_addItem), METH_O}, - {"getChildren", reinterpret_cast(Sbk_LayerFunc_getChildren), METH_NOARGS}, - {"insertItem", reinterpret_cast(Sbk_LayerFunc_insertItem), METH_VARARGS}, - {"removeItem", reinterpret_cast(Sbk_LayerFunc_removeItem), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Layer_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Layer *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_LAYER_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Layer_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Layer_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Layer_Type = nullptr; -static SbkObjectType *Sbk_Layer_TypeF(void) -{ - return _Sbk_Layer_Type; -} - -static PyType_Slot Sbk_Layer_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Layer_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Layer_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Layer_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Layer_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Layer_spec = { - "1:NatronEngine.Layer", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Layer_slots -}; - -} //extern "C" - -static void *Sbk_Layer_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::ItemBase >())) - return dynamic_cast< ::Layer *>(reinterpret_cast< ::ItemBase *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Layer_PythonToCpp_Layer_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Layer_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Layer_PythonToCpp_Layer_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Layer_TypeF()))) - return Layer_PythonToCpp_Layer_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Layer_PTR_CppToPython_Layer(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Layer_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Layer_SignatureStrings[] = { - "NatronEngine.Layer.addItem(self,item:NatronEngine.ItemBase)", - "NatronEngine.Layer.getChildren(self)->std.list[NatronEngine.ItemBase]", - "NatronEngine.Layer.insertItem(self,pos:int,item:NatronEngine.ItemBase)", - "NatronEngine.Layer.removeItem(self,item:NatronEngine.ItemBase)", - nullptr}; // Sentinel - -void init_Layer(PyObject *module) -{ - _Sbk_Layer_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Layer", - "Layer*", - &Sbk_Layer_spec, - &Shiboken::callCppDestructor< ::Layer >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Layer_Type); - InitSignatureStrings(pyType, Layer_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Layer_Type), Sbk_Layer_PropertyStrings); - SbkNatronEngineTypes[SBK_LAYER_IDX] - = reinterpret_cast(Sbk_Layer_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Layer_TypeF(), - Layer_PythonToCpp_Layer_PTR, - is_Layer_PythonToCpp_Layer_PTR_Convertible, - Layer_PTR_CppToPython_Layer); - - Shiboken::Conversions::registerConverterName(converter, "Layer"); - Shiboken::Conversions::registerConverterName(converter, "Layer*"); - Shiboken::Conversions::registerConverterName(converter, "Layer&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Layer).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::LayerWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_Layer_TypeF(), &Sbk_Layer_typeDiscovery); - - - LayerWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/layer_wrapper.h b/Engine/Qt5/NatronEngine/layer_wrapper.h deleted file mode 100644 index 2a67486a00..0000000000 --- a/Engine/Qt5/NatronEngine/layer_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_LAYERWRAPPER_H -#define SBK_LAYERWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class LayerWrapper : public Layer -{ -public: - ~LayerWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ITEMBASEWRAPPER_H -# define SBK_ITEMBASEWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ItemBaseWrapper : public ItemBase -{ -public: - ~ItemBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ITEMBASEWRAPPER_H - -#endif // SBK_LAYERWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/natron_enum_wrapper.cpp b/Engine/Qt5/NatronEngine/natron_enum_wrapper.cpp deleted file mode 100644 index e618f21d56..0000000000 --- a/Engine/Qt5/NatronEngine/natron_enum_wrapper.cpp +++ /dev/null @@ -1,1863 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "natron_enum_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { - -static const char *Sbk_NATRON_ENUM_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_NATRON_ENUM_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_NATRON_ENUM_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_NATRON_ENUM_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_NATRON_ENUM_Type = nullptr; -static SbkObjectType *Sbk_NATRON_ENUM_TypeF(void) -{ - return _Sbk_NATRON_ENUM_Type; -} - -static PyType_Slot Sbk_NATRON_ENUM_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(Sbk_object_dealloc /* PYSIDE-832: Prevent replacement of "0" with subtype_dealloc. */)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_NATRON_ENUM_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_NATRON_ENUM_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_NATRON_ENUM_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_NATRON_ENUM_spec = { - "1:NatronEngine.NATRON_ENUM", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_NATRON_ENUM_slots -}; - -} //extern "C" - -PyObject *SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___and__(PyObject *self, PyObject *pyArg) -{ - ::NATRON_ENUM::StandardButtons cppResult, cppSelf, cppArg; -#ifdef IS_PY3K - cppSelf = static_cast<::NATRON_ENUM::StandardButtons>(int(PyLong_AsLong(self))); - cppArg = static_cast(int(PyLong_AsLong(pyArg))); -#else - cppSelf = static_cast<::NATRON_ENUM::StandardButtons>(int(PyInt_AsLong(self))); - cppArg = static_cast(int(PyInt_AsLong(pyArg))); -#endif - - cppResult = cppSelf & cppArg; - return Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, &cppResult); -} - -PyObject *SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___or__(PyObject *self, PyObject *pyArg) -{ - ::NATRON_ENUM::StandardButtons cppResult, cppSelf, cppArg; -#ifdef IS_PY3K - cppSelf = static_cast<::NATRON_ENUM::StandardButtons>(int(PyLong_AsLong(self))); - cppArg = static_cast(int(PyLong_AsLong(pyArg))); -#else - cppSelf = static_cast<::NATRON_ENUM::StandardButtons>(int(PyInt_AsLong(self))); - cppArg = static_cast(int(PyInt_AsLong(pyArg))); -#endif - - cppResult = cppSelf | cppArg; - return Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, &cppResult); -} - -PyObject *SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___xor__(PyObject *self, PyObject *pyArg) -{ - ::NATRON_ENUM::StandardButtons cppResult, cppSelf, cppArg; -#ifdef IS_PY3K - cppSelf = static_cast<::NATRON_ENUM::StandardButtons>(int(PyLong_AsLong(self))); - cppArg = static_cast(int(PyLong_AsLong(pyArg))); -#else - cppSelf = static_cast<::NATRON_ENUM::StandardButtons>(int(PyInt_AsLong(self))); - cppArg = static_cast(int(PyInt_AsLong(pyArg))); -#endif - - cppResult = cppSelf ^ cppArg; - return Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, &cppResult); -} - -PyObject *SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___invert__(PyObject *self, PyObject *pyArg) -{ - ::NATRON_ENUM::StandardButtons cppSelf; - Shiboken::Conversions::pythonToCppCopy(*PepType_SGTP(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, self, &cppSelf); - ::NATRON_ENUM::StandardButtons cppResult = ~cppSelf; - return Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, &cppResult); -} - -static PyObject *SbkNatronEngine_NATRON_ENUM_StandardButtonEnum_long(PyObject *self) -{ - int val; - Shiboken::Conversions::pythonToCppCopy(*PepType_SGTP(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, self, &val); - return Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &val); -} -static int SbkNatronEngine_NATRON_ENUM_StandardButtonEnum__nonzero(PyObject *self) -{ - int val; - Shiboken::Conversions::pythonToCppCopy(*PepType_SGTP(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, self, &val); - return val != 0; -} - -static PyType_Slot SbkNatronEngine_NATRON_ENUM_StandardButtonEnum_number_slots[] = { -#ifdef IS_PY3K - {Py_nb_bool, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum__nonzero)}, -#else - {Py_nb_nonzero, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum__nonzero)}, - {Py_nb_long, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum_long)}, -#endif - {Py_nb_invert, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___invert__)}, - {Py_nb_and, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___and__)}, - {Py_nb_xor, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___xor__)}, - {Py_nb_or, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum___or__)}, - {Py_nb_int, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum_long)}, - {Py_nb_index, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum_long)}, -#ifndef IS_PY3K - {Py_nb_long, reinterpret_cast(SbkNatronEngine_NATRON_ENUM_StandardButtonEnum_long)}, -#endif - {0, nullptr} // sentinel -}; - - - -// Type conversion functions. - -// Python to C++ enum conversion. -static void NATRON_ENUM_StatusEnum_PythonToCpp_NATRON_ENUM_StatusEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::StatusEnum *>(cppOut) = - static_cast<::NATRON_ENUM::StatusEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_StatusEnum_PythonToCpp_NATRON_ENUM_StatusEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])) - return NATRON_ENUM_StatusEnum_PythonToCpp_NATRON_ENUM_StatusEnum; - return {}; -} -static PyObject *NATRON_ENUM_StatusEnum_CppToPython_NATRON_ENUM_StatusEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_StandardButtonEnum_PythonToCpp_NATRON_ENUM_StandardButtonEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::StandardButtonEnum *>(cppOut) = - static_cast<::NATRON_ENUM::StandardButtonEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_StandardButtonEnum_PythonToCpp_NATRON_ENUM_StandardButtonEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX])) - return NATRON_ENUM_StandardButtonEnum_PythonToCpp_NATRON_ENUM_StandardButtonEnum; - return {}; -} -static PyObject *NATRON_ENUM_StandardButtonEnum_CppToPython_NATRON_ENUM_StandardButtonEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], castCppIn); - -} - -static void QFlags_NATRON_ENUM_StandardButtonEnum__PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::QFlags *>(cppOut) = - ::QFlags(QFlag(int(PySide::QFlags::getValue(reinterpret_cast(pyIn))))); - -} -static PythonToCppFunc is_QFlags_NATRON_ENUM_StandardButtonEnum__PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum__Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])) - return QFlags_NATRON_ENUM_StandardButtonEnum__PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_; - return {}; -} -static PyObject *QFlags_NATRON_ENUM_StandardButtonEnum__CppToPython_QFlags_NATRON_ENUM_StandardButtonEnum_(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast *>(cppIn)); - return reinterpret_cast(PySide::QFlags::newObject(castCppIn, SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX])); - -} - -static void NATRON_ENUM_StandardButtonEnum_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::QFlags *>(cppOut) = - ::QFlags(QFlag(int(Shiboken::Enum::getValue(pyIn)))); - -} -static PythonToCppFunc is_NATRON_ENUM_StandardButtonEnum_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum__Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX])) - return NATRON_ENUM_StandardButtonEnum_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_; - return {}; -} -static void number_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_(PyObject *pyIn, void *cppOut) { - Shiboken::AutoDecRef pyLong(PyNumber_Long(pyIn)); - *reinterpret_cast<::QFlags *>(cppOut) = - ::QFlags(QFlag(int(PyLong_AsLong(pyLong.object())))); - -} -static PythonToCppFunc is_number_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum__Convertible(PyObject *pyIn) { - if (PyNumber_Check(pyIn) && PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX])) - return number_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_; - return {}; -} -static void NATRON_ENUM_KeyframeTypeEnum_PythonToCpp_NATRON_ENUM_KeyframeTypeEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::KeyframeTypeEnum *>(cppOut) = - static_cast<::NATRON_ENUM::KeyframeTypeEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_KeyframeTypeEnum_PythonToCpp_NATRON_ENUM_KeyframeTypeEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX])) - return NATRON_ENUM_KeyframeTypeEnum_PythonToCpp_NATRON_ENUM_KeyframeTypeEnum; - return {}; -} -static PyObject *NATRON_ENUM_KeyframeTypeEnum_CppToPython_NATRON_ENUM_KeyframeTypeEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_PixmapEnum_PythonToCpp_NATRON_ENUM_PixmapEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::PixmapEnum *>(cppOut) = - static_cast<::NATRON_ENUM::PixmapEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_PixmapEnum_PythonToCpp_NATRON_ENUM_PixmapEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX])) - return NATRON_ENUM_PixmapEnum_PythonToCpp_NATRON_ENUM_PixmapEnum; - return {}; -} -static PyObject *NATRON_ENUM_PixmapEnum_CppToPython_NATRON_ENUM_PixmapEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_ValueChangedReasonEnum_PythonToCpp_NATRON_ENUM_ValueChangedReasonEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::ValueChangedReasonEnum *>(cppOut) = - static_cast<::NATRON_ENUM::ValueChangedReasonEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_ValueChangedReasonEnum_PythonToCpp_NATRON_ENUM_ValueChangedReasonEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX])) - return NATRON_ENUM_ValueChangedReasonEnum_PythonToCpp_NATRON_ENUM_ValueChangedReasonEnum; - return {}; -} -static PyObject *NATRON_ENUM_ValueChangedReasonEnum_CppToPython_NATRON_ENUM_ValueChangedReasonEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_AnimationLevelEnum_PythonToCpp_NATRON_ENUM_AnimationLevelEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::AnimationLevelEnum *>(cppOut) = - static_cast<::NATRON_ENUM::AnimationLevelEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_AnimationLevelEnum_PythonToCpp_NATRON_ENUM_AnimationLevelEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX])) - return NATRON_ENUM_AnimationLevelEnum_PythonToCpp_NATRON_ENUM_AnimationLevelEnum; - return {}; -} -static PyObject *NATRON_ENUM_AnimationLevelEnum_CppToPython_NATRON_ENUM_AnimationLevelEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_ImagePremultiplicationEnum_PythonToCpp_NATRON_ENUM_ImagePremultiplicationEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::ImagePremultiplicationEnum *>(cppOut) = - static_cast<::NATRON_ENUM::ImagePremultiplicationEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_ImagePremultiplicationEnum_PythonToCpp_NATRON_ENUM_ImagePremultiplicationEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX])) - return NATRON_ENUM_ImagePremultiplicationEnum_PythonToCpp_NATRON_ENUM_ImagePremultiplicationEnum; - return {}; -} -static PyObject *NATRON_ENUM_ImagePremultiplicationEnum_CppToPython_NATRON_ENUM_ImagePremultiplicationEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_ViewerCompositingOperatorEnum_PythonToCpp_NATRON_ENUM_ViewerCompositingOperatorEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::ViewerCompositingOperatorEnum *>(cppOut) = - static_cast<::NATRON_ENUM::ViewerCompositingOperatorEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_ViewerCompositingOperatorEnum_PythonToCpp_NATRON_ENUM_ViewerCompositingOperatorEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX])) - return NATRON_ENUM_ViewerCompositingOperatorEnum_PythonToCpp_NATRON_ENUM_ViewerCompositingOperatorEnum; - return {}; -} -static PyObject *NATRON_ENUM_ViewerCompositingOperatorEnum_CppToPython_NATRON_ENUM_ViewerCompositingOperatorEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_ViewerColorSpaceEnum_PythonToCpp_NATRON_ENUM_ViewerColorSpaceEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::ViewerColorSpaceEnum *>(cppOut) = - static_cast<::NATRON_ENUM::ViewerColorSpaceEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_ViewerColorSpaceEnum_PythonToCpp_NATRON_ENUM_ViewerColorSpaceEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX])) - return NATRON_ENUM_ViewerColorSpaceEnum_PythonToCpp_NATRON_ENUM_ViewerColorSpaceEnum; - return {}; -} -static PyObject *NATRON_ENUM_ViewerColorSpaceEnum_CppToPython_NATRON_ENUM_ViewerColorSpaceEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_ImageBitDepthEnum_PythonToCpp_NATRON_ENUM_ImageBitDepthEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::ImageBitDepthEnum *>(cppOut) = - static_cast<::NATRON_ENUM::ImageBitDepthEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_ImageBitDepthEnum_PythonToCpp_NATRON_ENUM_ImageBitDepthEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX])) - return NATRON_ENUM_ImageBitDepthEnum_PythonToCpp_NATRON_ENUM_ImageBitDepthEnum; - return {}; -} -static PyObject *NATRON_ENUM_ImageBitDepthEnum_CppToPython_NATRON_ENUM_ImageBitDepthEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_OrientationEnum_PythonToCpp_NATRON_ENUM_OrientationEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::OrientationEnum *>(cppOut) = - static_cast<::NATRON_ENUM::OrientationEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_OrientationEnum_PythonToCpp_NATRON_ENUM_OrientationEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX])) - return NATRON_ENUM_OrientationEnum_PythonToCpp_NATRON_ENUM_OrientationEnum; - return {}; -} -static PyObject *NATRON_ENUM_OrientationEnum_CppToPython_NATRON_ENUM_OrientationEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_PlaybackModeEnum_PythonToCpp_NATRON_ENUM_PlaybackModeEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::PlaybackModeEnum *>(cppOut) = - static_cast<::NATRON_ENUM::PlaybackModeEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_PlaybackModeEnum_PythonToCpp_NATRON_ENUM_PlaybackModeEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX])) - return NATRON_ENUM_PlaybackModeEnum_PythonToCpp_NATRON_ENUM_PlaybackModeEnum; - return {}; -} -static PyObject *NATRON_ENUM_PlaybackModeEnum_CppToPython_NATRON_ENUM_PlaybackModeEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_DisplayChannelsEnum_PythonToCpp_NATRON_ENUM_DisplayChannelsEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::DisplayChannelsEnum *>(cppOut) = - static_cast<::NATRON_ENUM::DisplayChannelsEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_DisplayChannelsEnum_PythonToCpp_NATRON_ENUM_DisplayChannelsEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX])) - return NATRON_ENUM_DisplayChannelsEnum_PythonToCpp_NATRON_ENUM_DisplayChannelsEnum; - return {}; -} -static PyObject *NATRON_ENUM_DisplayChannelsEnum_CppToPython_NATRON_ENUM_DisplayChannelsEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], castCppIn); - -} - -static void NATRON_ENUM_MergingFunctionEnum_PythonToCpp_NATRON_ENUM_MergingFunctionEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::NATRON_ENUM::MergingFunctionEnum *>(cppOut) = - static_cast<::NATRON_ENUM::MergingFunctionEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_NATRON_ENUM_MergingFunctionEnum_PythonToCpp_NATRON_ENUM_MergingFunctionEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX])) - return NATRON_ENUM_MergingFunctionEnum_PythonToCpp_NATRON_ENUM_MergingFunctionEnum; - return {}; -} -static PyObject *NATRON_ENUM_MergingFunctionEnum_CppToPython_NATRON_ENUM_MergingFunctionEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], castCppIn); - -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *NatronEngineNATRON_ENUM_SignatureStrings[] = { - nullptr}; // Sentinel - -void init_NatronEngineNATRON_ENUM(PyObject *module) -{ - _Sbk_NATRON_ENUM_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "NATRON_ENUM", - "NATRON_ENUM", - &Sbk_NATRON_ENUM_spec, - 0, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_NATRON_ENUM_Type); - InitSignatureStrings(pyType, NatronEngineNATRON_ENUM_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_NATRON_ENUM_Type), Sbk_NATRON_ENUM_PropertyStrings); - SbkNatronEngineTypes[SBK_NatronEngineNATRON_ENUM_IDX] - = reinterpret_cast(Sbk_NATRON_ENUM_TypeF()); - - - // Initialization of enums. - - // Initialization of enum 'StatusEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "StatusEnum", - "1:NatronEngine.NATRON_ENUM.StatusEnum", - "NATRON_ENUM::StatusEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStatusOK", (long) NATRON_ENUM::StatusEnum::eStatusOK)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStatusFailed", (long) NATRON_ENUM::StatusEnum::eStatusFailed)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStatusOutOfMemory", (long) NATRON_ENUM::StatusEnum::eStatusOutOfMemory)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStatusReplyDefault", (long) NATRON_ENUM::StatusEnum::eStatusReplyDefault)) - return; - // Register converter for enum 'NATRON_ENUM::StatusEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX], - NATRON_ENUM_StatusEnum_CppToPython_NATRON_ENUM_StatusEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_StatusEnum_PythonToCpp_NATRON_ENUM_StatusEnum, - is_NATRON_ENUM_StatusEnum_PythonToCpp_NATRON_ENUM_StatusEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::StatusEnum"); - Shiboken::Conversions::registerConverterName(converter, "StatusEnum"); - } - // End of 'StatusEnum' enum. - - // Initialization of enum 'StandardButtonEnum'. - SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX] = PySide::QFlags::create("1:NatronEngine.NATRON_ENUM.StandardButtons", SbkNatronEngine_NATRON_ENUM_StandardButtonEnum_number_slots); - SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "StandardButtonEnum", - "1:NatronEngine.NATRON_ENUM.StandardButtonEnum", - "NATRON_ENUM::StandardButtonEnum", - SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX]); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonNoButton", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonNoButton)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonEscape", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonEscape)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonOk", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonOk)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonSave", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonSave)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonSaveAll", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonSaveAll)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonOpen", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonOpen)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonYes", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonYes)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonYesToAll", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonYesToAll)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonNo", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonNo)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonNoToAll", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonNoToAll)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonAbort", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonAbort)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonRetry", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonRetry)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonIgnore", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonIgnore)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonClose", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonClose)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonCancel", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonCancel)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonDiscard", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonDiscard)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonHelp", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonHelp)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonApply", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonApply)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonReset", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonReset)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eStandardButtonRestoreDefaults", (long) NATRON_ENUM::StandardButtonEnum::eStandardButtonRestoreDefaults)) - return; - // Register converter for enum 'NATRON_ENUM::StandardButtonEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - NATRON_ENUM_StandardButtonEnum_CppToPython_NATRON_ENUM_StandardButtonEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_StandardButtonEnum_PythonToCpp_NATRON_ENUM_StandardButtonEnum, - is_NATRON_ENUM_StandardButtonEnum_PythonToCpp_NATRON_ENUM_StandardButtonEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::StandardButtonEnum"); - Shiboken::Conversions::registerConverterName(converter, "StandardButtonEnum"); - } - // Register converter for flag 'QFlags'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX], - QFlags_NATRON_ENUM_StandardButtonEnum__CppToPython_QFlags_NATRON_ENUM_StandardButtonEnum_); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_StandardButtonEnum_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_, - is_NATRON_ENUM_StandardButtonEnum_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum__Convertible); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - QFlags_NATRON_ENUM_StandardButtonEnum__PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_, - is_QFlags_NATRON_ENUM_StandardButtonEnum__PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum__Convertible); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - number_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum_, - is_number_PythonToCpp_QFlags_NATRON_ENUM_StandardButtonEnum__Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::StandardButtons"); - Shiboken::Conversions::registerConverterName(converter, "StandardButtons"); - } - // End of 'StandardButtonEnum' enum/flags. - - // Initialization of enum 'KeyframeTypeEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "KeyframeTypeEnum", - "1:NatronEngine.NATRON_ENUM.KeyframeTypeEnum", - "NATRON_ENUM::KeyframeTypeEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeConstant", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeConstant)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeLinear", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeLinear)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeSmooth", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeSmooth)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeCatmullRom", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeCatmullRom)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeCubic", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeCubic)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeHorizontal", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeHorizontal)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeFree", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeFree)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeBroken", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeBroken)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eKeyframeTypeNone", (long) NATRON_ENUM::KeyframeTypeEnum::eKeyframeTypeNone)) - return; - // Register converter for enum 'NATRON_ENUM::KeyframeTypeEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], - NATRON_ENUM_KeyframeTypeEnum_CppToPython_NATRON_ENUM_KeyframeTypeEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_KeyframeTypeEnum_PythonToCpp_NATRON_ENUM_KeyframeTypeEnum, - is_NATRON_ENUM_KeyframeTypeEnum_PythonToCpp_NATRON_ENUM_KeyframeTypeEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::KeyframeTypeEnum"); - Shiboken::Conversions::registerConverterName(converter, "KeyframeTypeEnum"); - } - // End of 'KeyframeTypeEnum' enum. - - // Initialization of enum 'PixmapEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "PixmapEnum", - "1:NatronEngine.NATRON_ENUM.PixmapEnum", - "NATRON_ENUM::PixmapEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PREVIOUS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PREVIOUS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_FIRST_FRAME", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_FIRST_FRAME)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_NEXT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_NEXT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_LAST_FRAME", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_LAST_FRAME)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_NEXT_INCR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_NEXT_INCR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_NEXT_KEY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_NEXT_KEY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PREVIOUS_INCR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PREVIOUS_INCR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PREVIOUS_KEY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PREVIOUS_KEY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_REWIND_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_REWIND_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_REWIND_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_REWIND_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PLAY_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PLAY_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PLAY_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PLAY_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_STOP_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_STOP_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_STOP_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_STOP_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PAUSE_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PAUSE_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PAUSE_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PAUSE_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_LOOP_MODE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_LOOP_MODE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_BOUNCE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_BOUNCE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_PLAY_ONCE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_PLAY_ONCE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_TIMELINE_IN", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_TIMELINE_IN)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PLAYER_TIMELINE_OUT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PLAYER_TIMELINE_OUT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MAXIMIZE_WIDGET", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MAXIMIZE_WIDGET)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MINIMIZE_WIDGET", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MINIMIZE_WIDGET)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CLOSE_WIDGET", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CLOSE_WIDGET)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_HELP_WIDGET", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_HELP_WIDGET)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CLOSE_PANEL", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CLOSE_PANEL)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_HIDE_UNMODIFIED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_HIDE_UNMODIFIED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UNHIDE_UNMODIFIED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UNHIDE_UNMODIFIED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_GROUPBOX_FOLDED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_GROUPBOX_FOLDED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_GROUPBOX_UNFOLDED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_GROUPBOX_UNFOLDED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UNDO", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UNDO)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_REDO", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_REDO)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UNDO_GRAYSCALE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UNDO_GRAYSCALE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_REDO_GRAYSCALE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_REDO_GRAYSCALE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_RESTORE_DEFAULTS_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_RESTORE_DEFAULTS_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_RESTORE_DEFAULTS_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_RESTORE_DEFAULTS_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TAB_WIDGET_LAYOUT_BUTTON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TAB_WIDGET_LAYOUT_BUTTON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TAB_WIDGET_LAYOUT_BUTTON_ANCHOR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TAB_WIDGET_LAYOUT_BUTTON_ANCHOR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TAB_WIDGET_SPLIT_HORIZONTALLY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TAB_WIDGET_SPLIT_HORIZONTALLY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TAB_WIDGET_SPLIT_VERTICALLY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TAB_WIDGET_SPLIT_VERTICALLY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_CENTER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_CENTER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_CLIP_TO_PROJECT_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_CLIP_TO_PROJECT_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_CLIP_TO_PROJECT_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_CLIP_TO_PROJECT_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_FULL_FRAME_ON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_FULL_FRAME_ON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_FULL_FRAME_OFF", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_FULL_FRAME_OFF)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_REFRESH", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_REFRESH)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_REFRESH_ACTIVE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_REFRESH_ACTIVE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_ROI_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_ROI_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_ROI_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_ROI_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_RENDER_SCALE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_RENDER_SCALE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_RENDER_SCALE_CHECKED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_RENDER_SCALE_CHECKED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_AUTOCONTRAST_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_AUTOCONTRAST_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_AUTOCONTRAST_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_AUTOCONTRAST_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_OPEN_FILE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_OPEN_FILE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_COLORWHEEL", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_COLORWHEEL)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_OVERLAY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_OVERLAY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTO_MERGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTO_MERGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_COLOR_PICKER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_COLOR_PICKER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_IO_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_IO_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_3D_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_3D_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CHANNEL_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CHANNEL_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_COLOR_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_COLOR_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRANSFORM_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRANSFORM_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_DEEP_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_DEEP_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_FILTER_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_FILTER_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MULTIVIEW_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MULTIVIEW_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TOOLSETS_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TOOLSETS_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MISC_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MISC_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_OPEN_EFFECTS_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_OPEN_EFFECTS_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TIME_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TIME_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PAINT_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PAINT_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_KEYER_GROUPING", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_KEYER_GROUPING)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_OTHER_PLUGINS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_OTHER_PLUGINS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_READ_IMAGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_READ_IMAGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_WRITE_IMAGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_WRITE_IMAGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_COMBOBOX", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_COMBOBOX)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_COMBOBOX_PRESSED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_COMBOBOX_PRESSED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ADD_KEYFRAME", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ADD_KEYFRAME)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_REMOVE_KEYFRAME", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_REMOVE_KEYFRAME)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INVERTED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INVERTED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UNINVERTED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UNINVERTED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VISIBLE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VISIBLE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UNVISIBLE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UNVISIBLE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_LOCKED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_LOCKED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UNLOCKED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UNLOCKED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_LAYER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_LAYER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_BEZIER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_BEZIER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PENCIL", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PENCIL)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CURVE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CURVE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_BEZIER_32", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_BEZIER_32)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ELLIPSE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ELLIPSE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_RECTANGLE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_RECTANGLE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ADD_POINTS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ADD_POINTS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_REMOVE_POINTS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_REMOVE_POINTS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CUSP_POINTS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CUSP_POINTS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SMOOTH_POINTS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SMOOTH_POINTS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_REMOVE_FEATHER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_REMOVE_FEATHER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_OPEN_CLOSE_CURVE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_OPEN_CLOSE_CURVE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SELECT_ALL", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SELECT_ALL)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SELECT_POINTS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SELECT_POINTS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SELECT_FEATHER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SELECT_FEATHER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SELECT_CURVES", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SELECT_CURVES)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_AUTO_KEYING_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_AUTO_KEYING_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_AUTO_KEYING_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_AUTO_KEYING_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_STICKY_SELECTION_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_STICKY_SELECTION_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_STICKY_SELECTION_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_STICKY_SELECTION_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_FEATHER_LINK_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_FEATHER_LINK_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_FEATHER_LINK_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_FEATHER_LINK_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_FEATHER_VISIBLE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_FEATHER_VISIBLE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_FEATHER_UNVISIBLE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_FEATHER_UNVISIBLE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_RIPPLE_EDIT_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_RIPPLE_EDIT_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_RIPPLE_EDIT_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_RIPPLE_EDIT_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_BLUR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_BLUR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_BUILDUP_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_BUILDUP_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_BUILDUP_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_BUILDUP_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_BURN", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_BURN)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_CLONE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_CLONE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_DODGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_DODGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_ERASER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_ERASER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_PRESSURE_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_PRESSURE_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_PRESSURE_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_PRESSURE_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_REVEAL", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_REVEAL)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_SHARPEN", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_SHARPEN)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_SMEAR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_SMEAR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTOPAINT_SOLID", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTOPAINT_SOLID)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_BOLD_CHECKED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_BOLD_CHECKED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_BOLD_UNCHECKED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_BOLD_UNCHECKED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ITALIC_CHECKED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ITALIC_CHECKED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ITALIC_UNCHECKED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ITALIC_UNCHECKED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CLEAR_ALL_ANIMATION", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CLEAR_ALL_ANIMATION)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CLEAR_BACKWARD_ANIMATION", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CLEAR_BACKWARD_ANIMATION)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CLEAR_FORWARD_ANIMATION", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CLEAR_FORWARD_ANIMATION)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UPDATE_VIEWER_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UPDATE_VIEWER_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_UPDATE_VIEWER_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_UPDATE_VIEWER_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ADD_TRACK", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ADD_TRACK)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ADD_USER_KEY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ADD_USER_KEY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_REMOVE_USER_KEY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_REMOVE_USER_KEY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SHOW_TRACK_ERROR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SHOW_TRACK_ERROR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_HIDE_TRACK_ERROR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_HIDE_TRACK_ERROR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_RESET_TRACK_OFFSET", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_RESET_TRACK_OFFSET)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CREATE_USER_KEY_ON_MOVE_ON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CREATE_USER_KEY_ON_MOVE_ON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CREATE_USER_KEY_ON_MOVE_OFF", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CREATE_USER_KEY_ON_MOVE_OFF)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_RESET_USER_KEYS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_RESET_USER_KEYS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_CENTER_VIEWER_ON_TRACK", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_CENTER_VIEWER_ON_TRACK)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_BACKWARD_ON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_BACKWARD_ON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_BACKWARD_OFF", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_BACKWARD_OFF)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_FORWARD_ON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_FORWARD_ON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_FORWARD_OFF", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_FORWARD_OFF)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_PREVIOUS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_PREVIOUS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_NEXT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_NEXT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_RANGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_RANGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_ALL_KEYS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_ALL_KEYS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_TRACK_CURRENT_KEY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_TRACK_CURRENT_KEY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_NEXT_USER_KEY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_NEXT_USER_KEY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_PREV_USER_KEY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_PREV_USER_KEY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ENTER_GROUP", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ENTER_GROUP)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SETTINGS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SETTINGS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_FREEZE_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_FREEZE_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_FREEZE_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_FREEZE_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_ICON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_ICON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_CHECKERBOARD_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_CHECKERBOARD_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_CHECKERBOARD_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_CHECKERBOARD_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_ZEBRA_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_ZEBRA_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_ZEBRA_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_ZEBRA_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_GAMMA_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_GAMMA_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_GAMMA_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_GAMMA_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_GAIN_ENABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_GAIN_ENABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_VIEWER_GAIN_DISABLED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_VIEWER_GAIN_DISABLED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_CLEAR_OUTPUT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_CLEAR_OUTPUT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_EXEC_SCRIPT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_EXEC_SCRIPT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_LOAD_EXEC_SCRIPT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_LOAD_EXEC_SCRIPT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_LOAD_SCRIPT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_LOAD_SCRIPT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_NEXT_SCRIPT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_NEXT_SCRIPT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_OUTPUT_PANE_ACTIVATED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_OUTPUT_PANE_ACTIVATED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_OUTPUT_PANE_DEACTIVATED", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_OUTPUT_PANE_DEACTIVATED)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_PREVIOUS_SCRIPT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_PREVIOUS_SCRIPT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_SCRIPT_SAVE_SCRIPT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_SCRIPT_SAVE_SCRIPT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_ATOP", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_ATOP)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_AVERAGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_AVERAGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_COLOR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_COLOR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_COLOR_BURN", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_COLOR_BURN)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_COLOR_DODGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_COLOR_DODGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_CONJOINT_OVER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_CONJOINT_OVER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_COPY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_COPY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_DIFFERENCE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_DIFFERENCE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_DISJOINT_OVER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_DISJOINT_OVER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_DIVIDE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_DIVIDE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_EXCLUSION", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_EXCLUSION)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_FREEZE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_FREEZE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_FROM", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_FROM)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_GEOMETRIC", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_GEOMETRIC)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_GRAIN_EXTRACT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_GRAIN_EXTRACT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_GRAIN_MERGE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_GRAIN_MERGE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_HARD_LIGHT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_HARD_LIGHT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_HUE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_HUE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_HYPOT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_HYPOT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_IN", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_IN)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_LUMINOSITY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_LUMINOSITY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_MASK", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_MASK)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_MATTE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_MATTE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_MAX", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_MAX)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_MIN", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_MIN)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_MINUS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_MINUS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_MULTIPLY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_MULTIPLY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_OUT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_OUT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_OVER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_OVER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_OVERLAY", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_OVERLAY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_PINLIGHT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_PINLIGHT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_PLUS", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_PLUS)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_REFLECT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_REFLECT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_SATURATION", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_SATURATION)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_SCREEN", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_SCREEN)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_SOFT_LIGHT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_SOFT_LIGHT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_STENCIL", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_STENCIL)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_UNDER", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_UNDER)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_MERGE_XOR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_MERGE_XOR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_ROTO_NODE_ICON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_ROTO_NODE_ICON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_LINK_CURSOR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_LINK_CURSOR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_LINK_MULT_CURSOR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_LINK_MULT_CURSOR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_APP_ICON", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_APP_ICON)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_LINEAR", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_LINEAR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_CURVE", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_CURVE)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_CONSTANT", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_CONSTANT)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_BREAK", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_BREAK)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_CURVE_C", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_CURVE_C)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_CURVE_H", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_CURVE_H)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_CURVE_R", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_CURVE_R)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "NATRON_PIXMAP_INTERP_CURVE_Z", (long) NATRON_ENUM::PixmapEnum::NATRON_PIXMAP_INTERP_CURVE_Z)) - return; - // Register converter for enum 'NATRON_ENUM::PixmapEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], - NATRON_ENUM_PixmapEnum_CppToPython_NATRON_ENUM_PixmapEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_PixmapEnum_PythonToCpp_NATRON_ENUM_PixmapEnum, - is_NATRON_ENUM_PixmapEnum_PythonToCpp_NATRON_ENUM_PixmapEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::PixmapEnum"); - Shiboken::Conversions::registerConverterName(converter, "PixmapEnum"); - } - // End of 'PixmapEnum' enum. - - // Initialization of enum 'ValueChangedReasonEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "ValueChangedReasonEnum", - "1:NatronEngine.NATRON_ENUM.ValueChangedReasonEnum", - "NATRON_ENUM::ValueChangedReasonEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eValueChangedReasonUserEdited", (long) NATRON_ENUM::ValueChangedReasonEnum::eValueChangedReasonUserEdited)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eValueChangedReasonPluginEdited", (long) NATRON_ENUM::ValueChangedReasonEnum::eValueChangedReasonPluginEdited)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eValueChangedReasonNatronGuiEdited", (long) NATRON_ENUM::ValueChangedReasonEnum::eValueChangedReasonNatronGuiEdited)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eValueChangedReasonNatronInternalEdited", (long) NATRON_ENUM::ValueChangedReasonEnum::eValueChangedReasonNatronInternalEdited)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eValueChangedReasonTimeChanged", (long) NATRON_ENUM::ValueChangedReasonEnum::eValueChangedReasonTimeChanged)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eValueChangedReasonSlaveRefresh", (long) NATRON_ENUM::ValueChangedReasonEnum::eValueChangedReasonSlaveRefresh)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eValueChangedReasonRestoreDefault", (long) NATRON_ENUM::ValueChangedReasonEnum::eValueChangedReasonRestoreDefault)) - return; - // Register converter for enum 'NATRON_ENUM::ValueChangedReasonEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], - NATRON_ENUM_ValueChangedReasonEnum_CppToPython_NATRON_ENUM_ValueChangedReasonEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_ValueChangedReasonEnum_PythonToCpp_NATRON_ENUM_ValueChangedReasonEnum, - is_NATRON_ENUM_ValueChangedReasonEnum_PythonToCpp_NATRON_ENUM_ValueChangedReasonEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::ValueChangedReasonEnum"); - Shiboken::Conversions::registerConverterName(converter, "ValueChangedReasonEnum"); - } - // End of 'ValueChangedReasonEnum' enum. - - // Initialization of enum 'AnimationLevelEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "AnimationLevelEnum", - "1:NatronEngine.NATRON_ENUM.AnimationLevelEnum", - "NATRON_ENUM::AnimationLevelEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eAnimationLevelNone", (long) NATRON_ENUM::AnimationLevelEnum::eAnimationLevelNone)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eAnimationLevelInterpolatedValue", (long) NATRON_ENUM::AnimationLevelEnum::eAnimationLevelInterpolatedValue)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eAnimationLevelOnKeyframe", (long) NATRON_ENUM::AnimationLevelEnum::eAnimationLevelOnKeyframe)) - return; - // Register converter for enum 'NATRON_ENUM::AnimationLevelEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX], - NATRON_ENUM_AnimationLevelEnum_CppToPython_NATRON_ENUM_AnimationLevelEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_AnimationLevelEnum_PythonToCpp_NATRON_ENUM_AnimationLevelEnum, - is_NATRON_ENUM_AnimationLevelEnum_PythonToCpp_NATRON_ENUM_AnimationLevelEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::AnimationLevelEnum"); - Shiboken::Conversions::registerConverterName(converter, "AnimationLevelEnum"); - } - // End of 'AnimationLevelEnum' enum. - - // Initialization of enum 'ImagePremultiplicationEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "ImagePremultiplicationEnum", - "1:NatronEngine.NATRON_ENUM.ImagePremultiplicationEnum", - "NATRON_ENUM::ImagePremultiplicationEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImagePremultiplicationOpaque", (long) NATRON_ENUM::ImagePremultiplicationEnum::eImagePremultiplicationOpaque)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImagePremultiplicationPremultiplied", (long) NATRON_ENUM::ImagePremultiplicationEnum::eImagePremultiplicationPremultiplied)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImagePremultiplicationUnPremultiplied", (long) NATRON_ENUM::ImagePremultiplicationEnum::eImagePremultiplicationUnPremultiplied)) - return; - // Register converter for enum 'NATRON_ENUM::ImagePremultiplicationEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX], - NATRON_ENUM_ImagePremultiplicationEnum_CppToPython_NATRON_ENUM_ImagePremultiplicationEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_ImagePremultiplicationEnum_PythonToCpp_NATRON_ENUM_ImagePremultiplicationEnum, - is_NATRON_ENUM_ImagePremultiplicationEnum_PythonToCpp_NATRON_ENUM_ImagePremultiplicationEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::ImagePremultiplicationEnum"); - Shiboken::Conversions::registerConverterName(converter, "ImagePremultiplicationEnum"); - } - // End of 'ImagePremultiplicationEnum' enum. - - // Initialization of enum 'ViewerCompositingOperatorEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "ViewerCompositingOperatorEnum", - "1:NatronEngine.NATRON_ENUM.ViewerCompositingOperatorEnum", - "NATRON_ENUM::ViewerCompositingOperatorEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorNone", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorNone)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorWipeUnder", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorWipeUnder)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorWipeOver", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorWipeOver)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorWipeMinus", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorWipeMinus)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorWipeOnionSkin", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorWipeOnionSkin)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorStackUnder", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorStackUnder)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorStackOver", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorStackOver)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorStackMinus", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorStackMinus)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerCompositingOperatorStackOnionSkin", (long) NATRON_ENUM::ViewerCompositingOperatorEnum::eViewerCompositingOperatorStackOnionSkin)) - return; - // Register converter for enum 'NATRON_ENUM::ViewerCompositingOperatorEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], - NATRON_ENUM_ViewerCompositingOperatorEnum_CppToPython_NATRON_ENUM_ViewerCompositingOperatorEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_ViewerCompositingOperatorEnum_PythonToCpp_NATRON_ENUM_ViewerCompositingOperatorEnum, - is_NATRON_ENUM_ViewerCompositingOperatorEnum_PythonToCpp_NATRON_ENUM_ViewerCompositingOperatorEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::ViewerCompositingOperatorEnum"); - Shiboken::Conversions::registerConverterName(converter, "ViewerCompositingOperatorEnum"); - } - // End of 'ViewerCompositingOperatorEnum' enum. - - // Initialization of enum 'ViewerColorSpaceEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "ViewerColorSpaceEnum", - "1:NatronEngine.NATRON_ENUM.ViewerColorSpaceEnum", - "NATRON_ENUM::ViewerColorSpaceEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerColorSpaceSRGB", (long) NATRON_ENUM::ViewerColorSpaceEnum::eViewerColorSpaceSRGB)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerColorSpaceLinear", (long) NATRON_ENUM::ViewerColorSpaceEnum::eViewerColorSpaceLinear)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eViewerColorSpaceRec709", (long) NATRON_ENUM::ViewerColorSpaceEnum::eViewerColorSpaceRec709)) - return; - // Register converter for enum 'NATRON_ENUM::ViewerColorSpaceEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX], - NATRON_ENUM_ViewerColorSpaceEnum_CppToPython_NATRON_ENUM_ViewerColorSpaceEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_ViewerColorSpaceEnum_PythonToCpp_NATRON_ENUM_ViewerColorSpaceEnum, - is_NATRON_ENUM_ViewerColorSpaceEnum_PythonToCpp_NATRON_ENUM_ViewerColorSpaceEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::ViewerColorSpaceEnum"); - Shiboken::Conversions::registerConverterName(converter, "ViewerColorSpaceEnum"); - } - // End of 'ViewerColorSpaceEnum' enum. - - // Initialization of enum 'ImageBitDepthEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "ImageBitDepthEnum", - "1:NatronEngine.NATRON_ENUM.ImageBitDepthEnum", - "NATRON_ENUM::ImageBitDepthEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImageBitDepthNone", (long) NATRON_ENUM::ImageBitDepthEnum::eImageBitDepthNone)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImageBitDepthByte", (long) NATRON_ENUM::ImageBitDepthEnum::eImageBitDepthByte)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImageBitDepthShort", (long) NATRON_ENUM::ImageBitDepthEnum::eImageBitDepthShort)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImageBitDepthHalf", (long) NATRON_ENUM::ImageBitDepthEnum::eImageBitDepthHalf)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eImageBitDepthFloat", (long) NATRON_ENUM::ImageBitDepthEnum::eImageBitDepthFloat)) - return; - // Register converter for enum 'NATRON_ENUM::ImageBitDepthEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], - NATRON_ENUM_ImageBitDepthEnum_CppToPython_NATRON_ENUM_ImageBitDepthEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_ImageBitDepthEnum_PythonToCpp_NATRON_ENUM_ImageBitDepthEnum, - is_NATRON_ENUM_ImageBitDepthEnum_PythonToCpp_NATRON_ENUM_ImageBitDepthEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::ImageBitDepthEnum"); - Shiboken::Conversions::registerConverterName(converter, "ImageBitDepthEnum"); - } - // End of 'ImageBitDepthEnum' enum. - - // Initialization of enum 'OrientationEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "OrientationEnum", - "1:NatronEngine.NATRON_ENUM.OrientationEnum", - "NATRON_ENUM::OrientationEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eOrientationHorizontal", (long) NATRON_ENUM::OrientationEnum::eOrientationHorizontal)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eOrientationVertical", (long) NATRON_ENUM::OrientationEnum::eOrientationVertical)) - return; - // Register converter for enum 'NATRON_ENUM::OrientationEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX], - NATRON_ENUM_OrientationEnum_CppToPython_NATRON_ENUM_OrientationEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_OrientationEnum_PythonToCpp_NATRON_ENUM_OrientationEnum, - is_NATRON_ENUM_OrientationEnum_PythonToCpp_NATRON_ENUM_OrientationEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::OrientationEnum"); - Shiboken::Conversions::registerConverterName(converter, "OrientationEnum"); - } - // End of 'OrientationEnum' enum. - - // Initialization of enum 'PlaybackModeEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "PlaybackModeEnum", - "1:NatronEngine.NATRON_ENUM.PlaybackModeEnum", - "NATRON_ENUM::PlaybackModeEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "ePlaybackModeLoop", (long) NATRON_ENUM::PlaybackModeEnum::ePlaybackModeLoop)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "ePlaybackModeBounce", (long) NATRON_ENUM::PlaybackModeEnum::ePlaybackModeBounce)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "ePlaybackModeOnce", (long) NATRON_ENUM::PlaybackModeEnum::ePlaybackModeOnce)) - return; - // Register converter for enum 'NATRON_ENUM::PlaybackModeEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX], - NATRON_ENUM_PlaybackModeEnum_CppToPython_NATRON_ENUM_PlaybackModeEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_PlaybackModeEnum_PythonToCpp_NATRON_ENUM_PlaybackModeEnum, - is_NATRON_ENUM_PlaybackModeEnum_PythonToCpp_NATRON_ENUM_PlaybackModeEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::PlaybackModeEnum"); - Shiboken::Conversions::registerConverterName(converter, "PlaybackModeEnum"); - } - // End of 'PlaybackModeEnum' enum. - - // Initialization of enum 'DisplayChannelsEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "DisplayChannelsEnum", - "1:NatronEngine.NATRON_ENUM.DisplayChannelsEnum", - "NATRON_ENUM::DisplayChannelsEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eDisplayChannelsRGB", (long) NATRON_ENUM::DisplayChannelsEnum::eDisplayChannelsRGB)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eDisplayChannelsR", (long) NATRON_ENUM::DisplayChannelsEnum::eDisplayChannelsR)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eDisplayChannelsG", (long) NATRON_ENUM::DisplayChannelsEnum::eDisplayChannelsG)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eDisplayChannelsB", (long) NATRON_ENUM::DisplayChannelsEnum::eDisplayChannelsB)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eDisplayChannelsA", (long) NATRON_ENUM::DisplayChannelsEnum::eDisplayChannelsA)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eDisplayChannelsY", (long) NATRON_ENUM::DisplayChannelsEnum::eDisplayChannelsY)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eDisplayChannelsMatte", (long) NATRON_ENUM::DisplayChannelsEnum::eDisplayChannelsMatte)) - return; - // Register converter for enum 'NATRON_ENUM::DisplayChannelsEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], - NATRON_ENUM_DisplayChannelsEnum_CppToPython_NATRON_ENUM_DisplayChannelsEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_DisplayChannelsEnum_PythonToCpp_NATRON_ENUM_DisplayChannelsEnum, - is_NATRON_ENUM_DisplayChannelsEnum_PythonToCpp_NATRON_ENUM_DisplayChannelsEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::DisplayChannelsEnum"); - Shiboken::Conversions::registerConverterName(converter, "DisplayChannelsEnum"); - } - // End of 'DisplayChannelsEnum' enum. - - // Initialization of enum 'MergingFunctionEnum'. - SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_NATRON_ENUM_TypeF(), - "MergingFunctionEnum", - "1:NatronEngine.NATRON_ENUM.MergingFunctionEnum", - "NATRON_ENUM::MergingFunctionEnum"); - if (!SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeATop", (long) NATRON_ENUM::MergingFunctionEnum::eMergeATop)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeAverage", (long) NATRON_ENUM::MergingFunctionEnum::eMergeAverage)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeColor", (long) NATRON_ENUM::MergingFunctionEnum::eMergeColor)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeColorBurn", (long) NATRON_ENUM::MergingFunctionEnum::eMergeColorBurn)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeColorDodge", (long) NATRON_ENUM::MergingFunctionEnum::eMergeColorDodge)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeConjointOver", (long) NATRON_ENUM::MergingFunctionEnum::eMergeConjointOver)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeCopy", (long) NATRON_ENUM::MergingFunctionEnum::eMergeCopy)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeDifference", (long) NATRON_ENUM::MergingFunctionEnum::eMergeDifference)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeDisjointOver", (long) NATRON_ENUM::MergingFunctionEnum::eMergeDisjointOver)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeDivide", (long) NATRON_ENUM::MergingFunctionEnum::eMergeDivide)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeExclusion", (long) NATRON_ENUM::MergingFunctionEnum::eMergeExclusion)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeFreeze", (long) NATRON_ENUM::MergingFunctionEnum::eMergeFreeze)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeFrom", (long) NATRON_ENUM::MergingFunctionEnum::eMergeFrom)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeGeometric", (long) NATRON_ENUM::MergingFunctionEnum::eMergeGeometric)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeGrainExtract", (long) NATRON_ENUM::MergingFunctionEnum::eMergeGrainExtract)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeGrainMerge", (long) NATRON_ENUM::MergingFunctionEnum::eMergeGrainMerge)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeHardLight", (long) NATRON_ENUM::MergingFunctionEnum::eMergeHardLight)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeHue", (long) NATRON_ENUM::MergingFunctionEnum::eMergeHue)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeHypot", (long) NATRON_ENUM::MergingFunctionEnum::eMergeHypot)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeIn", (long) NATRON_ENUM::MergingFunctionEnum::eMergeIn)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeLuminosity", (long) NATRON_ENUM::MergingFunctionEnum::eMergeLuminosity)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeMask", (long) NATRON_ENUM::MergingFunctionEnum::eMergeMask)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeMatte", (long) NATRON_ENUM::MergingFunctionEnum::eMergeMatte)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeMax", (long) NATRON_ENUM::MergingFunctionEnum::eMergeMax)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeMin", (long) NATRON_ENUM::MergingFunctionEnum::eMergeMin)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeMinus", (long) NATRON_ENUM::MergingFunctionEnum::eMergeMinus)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeMultiply", (long) NATRON_ENUM::MergingFunctionEnum::eMergeMultiply)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeOut", (long) NATRON_ENUM::MergingFunctionEnum::eMergeOut)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeOver", (long) NATRON_ENUM::MergingFunctionEnum::eMergeOver)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeOverlay", (long) NATRON_ENUM::MergingFunctionEnum::eMergeOverlay)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergePinLight", (long) NATRON_ENUM::MergingFunctionEnum::eMergePinLight)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergePlus", (long) NATRON_ENUM::MergingFunctionEnum::eMergePlus)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeReflect", (long) NATRON_ENUM::MergingFunctionEnum::eMergeReflect)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeSaturation", (long) NATRON_ENUM::MergingFunctionEnum::eMergeSaturation)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeScreen", (long) NATRON_ENUM::MergingFunctionEnum::eMergeScreen)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeSoftLight", (long) NATRON_ENUM::MergingFunctionEnum::eMergeSoftLight)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeStencil", (long) NATRON_ENUM::MergingFunctionEnum::eMergeStencil)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeUnder", (long) NATRON_ENUM::MergingFunctionEnum::eMergeUnder)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - Sbk_NATRON_ENUM_TypeF(), "eMergeXOR", (long) NATRON_ENUM::MergingFunctionEnum::eMergeXOR)) - return; - // Register converter for enum 'NATRON_ENUM::MergingFunctionEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], - NATRON_ENUM_MergingFunctionEnum_CppToPython_NATRON_ENUM_MergingFunctionEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - NATRON_ENUM_MergingFunctionEnum_PythonToCpp_NATRON_ENUM_MergingFunctionEnum, - is_NATRON_ENUM_MergingFunctionEnum_PythonToCpp_NATRON_ENUM_MergingFunctionEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "NATRON_ENUM::MergingFunctionEnum"); - Shiboken::Conversions::registerConverterName(converter, "MergingFunctionEnum"); - } - // End of 'MergingFunctionEnum' enum. - - - qRegisterMetaType< ::NATRON_ENUM::StatusEnum >("NATRON_ENUM::StatusEnum"); - qRegisterMetaType< ::NATRON_ENUM::StandardButtonEnum >("NATRON_ENUM::StandardButtonEnum"); - qRegisterMetaType< ::NATRON_ENUM::StandardButtons >("NATRON_ENUM::StandardButtons"); - qRegisterMetaType< ::NATRON_ENUM::KeyframeTypeEnum >("NATRON_ENUM::KeyframeTypeEnum"); - qRegisterMetaType< ::NATRON_ENUM::PixmapEnum >("NATRON_ENUM::PixmapEnum"); - qRegisterMetaType< ::NATRON_ENUM::ValueChangedReasonEnum >("NATRON_ENUM::ValueChangedReasonEnum"); - qRegisterMetaType< ::NATRON_ENUM::AnimationLevelEnum >("NATRON_ENUM::AnimationLevelEnum"); - qRegisterMetaType< ::NATRON_ENUM::ImagePremultiplicationEnum >("NATRON_ENUM::ImagePremultiplicationEnum"); - qRegisterMetaType< ::NATRON_ENUM::ViewerCompositingOperatorEnum >("NATRON_ENUM::ViewerCompositingOperatorEnum"); - qRegisterMetaType< ::NATRON_ENUM::ViewerColorSpaceEnum >("NATRON_ENUM::ViewerColorSpaceEnum"); - qRegisterMetaType< ::NATRON_ENUM::ImageBitDepthEnum >("NATRON_ENUM::ImageBitDepthEnum"); - qRegisterMetaType< ::NATRON_ENUM::OrientationEnum >("NATRON_ENUM::OrientationEnum"); - qRegisterMetaType< ::NATRON_ENUM::PlaybackModeEnum >("NATRON_ENUM::PlaybackModeEnum"); - qRegisterMetaType< ::NATRON_ENUM::DisplayChannelsEnum >("NATRON_ENUM::DisplayChannelsEnum"); - qRegisterMetaType< ::NATRON_ENUM::MergingFunctionEnum >("NATRON_ENUM::MergingFunctionEnum"); -} diff --git a/Engine/Qt5/NatronEngine/natron_enum_wrapper.h b/Engine/Qt5/NatronEngine/natron_enum_wrapper.h deleted file mode 100644 index 425eef0376..0000000000 --- a/Engine/Qt5/NatronEngine/natron_enum_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_NATRON_ENUM_H -#define SBK_NATRON_ENUM_H - -#include - -#endif // SBK_NATRON_ENUM_H - diff --git a/Engine/Qt5/NatronEngine/natronengine_module_wrapper.cpp b/Engine/Qt5/NatronEngine/natronengine_module_wrapper.cpp deleted file mode 100644 index af397d4cea..0000000000 --- a/Engine/Qt5/NatronEngine/natronengine_module_wrapper.cpp +++ /dev/null @@ -1,1067 +0,0 @@ - -#include -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#include -#include -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include "natronengine_python.h" - - - -// Extra includes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Current module's type array. -PyTypeObject **SbkNatronEngineTypes = nullptr; -// Current module's PyObject pointer. -PyObject *SbkNatronEngineModuleObject = nullptr; -// Current module's converter array. -SbkConverter **SbkNatronEngineTypeConverters = nullptr; -void cleanTypesAttributes(void) { - if (PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03060000) - return; // PYSIDE-953: testbinding crashes in Python 3.5 when hasattr touches types! - for (int i = 0, imax = SBK_NatronEngine_IDX_COUNT; i < imax; i++) { - PyObject *pyType = reinterpret_cast(SbkNatronEngineTypes[i]); - Shiboken::AutoDecRef attrName(Py_BuildValue("s", "staticMetaObject")); - if (pyType && PyObject_HasAttr(pyType, attrName)) - PyObject_SetAttr(pyType, attrName, Py_None); - } -} -// Global functions ------------------------------------------------------------ - -static PyMethodDef NatronEngine_methods[] = { - {0} // Sentinel -}; - -// Classes initialization functions ------------------------------------------------------------ -void init_UserParamHolder(PyObject *module); -void init_Tracker(PyObject *module); -void init_Track(PyObject *module); -void init_Roto(PyObject *module); -void init_RectI(PyObject *module); -void init_RectD(PyObject *module); -void init_PyCoreApplication(PyObject *module); -void init_Param(PyObject *module); -void init_SeparatorParam(PyObject *module); -void init_ParametricParam(PyObject *module); -void init_PageParam(PyObject *module); -void init_NodeCreationProperty(PyObject *module); -void init_StringNodeCreationProperty(PyObject *module); -void init_NatronEngineNATRON_ENUM(PyObject *module); -void init_ItemBase(PyObject *module); -void init_Layer(PyObject *module); -void init_IntNodeCreationProperty(PyObject *module); -void init_Int3DTuple(PyObject *module); -void init_Int2DTuple(PyObject *module); -void init_ImageLayer(PyObject *module); -void init_GroupParam(PyObject *module); -void init_Group(PyObject *module); -void init_FloatNodeCreationProperty(PyObject *module); -void init_ExprUtils(PyObject *module); -void init_Effect(PyObject *module); -void init_Double3DTuple(PyObject *module); -void init_Double2DTuple(PyObject *module); -void init_ColorTuple(PyObject *module); -void init_ButtonParam(PyObject *module); -void init_BoolNodeCreationProperty(PyObject *module); -void init_BezierCurve(PyObject *module); -void init_AppSettings(PyObject *module); -void init_App(PyObject *module); -void init_AnimatedParam(PyObject *module); -void init_DoubleParam(PyObject *module); -void init_Double2DParam(PyObject *module); -void init_Double3DParam(PyObject *module); -void init_StringParamBase(PyObject *module); -void init_OutputFileParam(PyObject *module); -void init_StringParam(PyObject *module); -void init_PathParam(PyObject *module); -void init_FileParam(PyObject *module); -void init_IntParam(PyObject *module); -void init_Int2DParam(PyObject *module); -void init_Int3DParam(PyObject *module); -void init_ColorParam(PyObject *module); -void init_ChoiceParam(PyObject *module); -void init_BooleanParam(PyObject *module); - -// Required modules' type and converter arrays. -PyTypeObject **SbkPySide2_QtCoreTypes; -SbkConverter **SbkPySide2_QtCoreTypeConverters; - -// Module initialization ------------------------------------------------------------ - -// Primitive Type converters. - -// C++ to Python conversion for type 'std::size_t'. -static PyObject *std_size_t_CppToPython_std_size_t(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::size_t *>(const_cast(cppIn)); - return PyLong_FromSize_t(cppInRef); - -} -// Python to C++ conversions for type 'std::size_t'. -static void PyLong_PythonToCpp_std_size_t(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::std::size_t *>(cppOut) = std::size_t(PyLong_AsSsize_t(pyIn)); - -} -static PythonToCppFunc is_PyLong_PythonToCpp_std_size_t_Convertible(PyObject *pyIn) { - if (PyLong_Check(pyIn)) - return PyLong_PythonToCpp_std_size_t; - return {}; -} - - -// Container Type converters. - -// C++ to Python conversion for type 'const std::map &'. -static PyObject *conststd_map_QString_NodeCreationPropertyPTR_REF_CppToPython_conststd_map_QString_NodeCreationPropertyPTR_REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::map *>(const_cast(cppIn)); - // TEMPLATE - stdMapToPyDict - START - PyObject* pyOut = PyDict_New(); - ::std::map::const_iterator it = cppInRef.begin(); - for (; it != cppInRef.end(); ++it) { - ::QString key = it->first; - ::NodeCreationProperty* value = it->second; - PyObject* pyKey = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &key); - PyObject* pyValue = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), value); - PyDict_SetItem(pyOut, pyKey, pyValue); - Py_DECREF(pyKey); - Py_DECREF(pyValue); - } - return pyOut; - // TEMPLATE - stdMapToPyDict - END - -} -static void conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp_conststd_map_QString_NodeCreationPropertyPTR_REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::map *>(cppOut); - // TEMPLATE - pyDictToStdMap - START - PyObject* key; - PyObject* value; - Py_ssize_t pos = 0; - while (PyDict_Next(pyIn, &pos, &key, &value)) { - ::QString cppKey; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], key, &(cppKey)); - ::NodeCreationProperty* cppValue{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), value, &(cppValue)); - cppOutRef.insert(std::make_pair(cppKey, cppValue)); - } - // TEMPLATE - pyDictToStdMap - END - -} -static PythonToCppFunc is_conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp_conststd_map_QString_NodeCreationPropertyPTR_REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleDictTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], false, *PepType_SGTP(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX])->converter, true, pyIn)) - return conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp_conststd_map_QString_NodeCreationPropertyPTR_REF; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *std_list_EffectPTR__CppToPython_std_list_EffectPTR_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::Effect* cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_EffectPTR__PythonToCpp_std_list_EffectPTR_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::Effect* cppItem{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_EffectPTR__PythonToCpp_std_list_EffectPTR__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::checkSequenceTypes(SbkNatronEngineTypes[SBK_EFFECT_IDX], pyIn)) - return std_list_EffectPTR__PythonToCpp_std_list_EffectPTR_; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *std_list_QString__CppToPython_std_list_QString_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::QString cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_QString__PythonToCpp_std_list_QString_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::QString cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_QString__PythonToCpp_std_list_QString__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyIn)) - return std_list_QString__PythonToCpp_std_list_QString_; - return {}; -} - -// C++ to Python conversion for type 'const std::list &'. -static PyObject *conststd_list_int_REF_CppToPython_conststd_list_int_REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - int cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void conststd_list_int_REF_PythonToCpp_conststd_list_int_REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - int cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_conststd_list_int_REF_PythonToCpp_conststd_list_int_REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return conststd_list_int_REF_PythonToCpp_conststd_list_int_REF; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *std_list_ParamPTR__CppToPython_std_list_ParamPTR_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::Param* cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_ParamPTR__PythonToCpp_std_list_ParamPTR_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::Param* cppItem{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_ParamPTR__PythonToCpp_std_list_ParamPTR__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::checkSequenceTypes(SbkNatronEngineTypes[SBK_PARAM_IDX], pyIn)) - return std_list_ParamPTR__PythonToCpp_std_list_ParamPTR_; - return {}; -} - -// C++ to Python conversion for type 'std::list *'. -static PyObject *std_list_double_PTR_CppToPython_std_list_double_PTR(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - double cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_double_PTR_PythonToCpp_std_list_double_PTR(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - double cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_double_PTR_PythonToCpp_std_list_double_PTR_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return std_list_double_PTR_PythonToCpp_std_list_double_PTR; - return {}; -} - -// C++ to Python conversion for type 'const std::vector &'. -static PyObject *conststd_vector_bool_REF_CppToPython_conststd_vector_bool_REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::vector *>(const_cast(cppIn)); - // TEMPLATE - stdVectorToPyList - START - ::std::vector::size_type vectorSize = cppInRef.size(); - PyObject* pyOut = PyList_New((int) vectorSize); - for (::std::vector::size_type idx = 0; idx < vectorSize; ++idx) { - bool cppItem(cppInRef[idx]); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdVectorToPyList - END - -} -static void conststd_vector_bool_REF_PythonToCpp_conststd_vector_bool_REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::vector *>(cppOut); - // TEMPLATE - pySeqToStdVector - START - int vectorSize = PySequence_Size(pyIn); - cppOutRef.reserve(vectorSize); - for (int idx = 0; idx < vectorSize; ++idx) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, idx)); - bool cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pySeqToStdVector - END - -} -static PythonToCppFunc is_conststd_vector_bool_REF_PythonToCpp_conststd_vector_bool_REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return conststd_vector_bool_REF_PythonToCpp_conststd_vector_bool_REF; - return {}; -} - -// C++ to Python conversion for type 'std::pair'. -static PyObject *std_pair_QString_QString__CppToPython_std_pair_QString_QString_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::pair *>(const_cast(cppIn)); - PyObject* pyOut = PyTuple_New(2); - PyTuple_SET_ITEM(pyOut, 0, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppInRef.first)); - PyTuple_SET_ITEM(pyOut, 1, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppInRef.second)); - return pyOut; - -} -static void std_pair_QString_QString__PythonToCpp_std_pair_QString_QString_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::pair *>(cppOut); - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], PySequence_Fast_GET_ITEM(pyIn, 0), &(cppOutRef.first)); - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], PySequence_Fast_GET_ITEM(pyIn, 1), &(cppOutRef.second)); - -} -static PythonToCppFunc is_std_pair_QString_QString__PythonToCpp_std_pair_QString_QString__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertiblePairTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], false, SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], false, pyIn)) - return std_pair_QString_QString__PythonToCpp_std_pair_QString_QString_; - return {}; -} - -// C++ to Python conversion for type 'const std::list > &'. -static PyObject *conststd_list_std_pair_QString_QString__REF_CppToPython_conststd_list_std_pair_QString_QString__REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list > *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list >::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::std::pair cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list > *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::std::pair cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], pyIn)) - return conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *std_list_ImageLayer__CppToPython_std_list_ImageLayer_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::ImageLayer cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_ImageLayer__PythonToCpp_std_list_ImageLayer_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::ImageLayer cppItem = ::ImageLayer(::QString(), ::QString(), ::QStringList()); - Shiboken::Conversions::pythonToCppCopy(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_ImageLayer__PythonToCpp_std_list_ImageLayer__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]), pyIn)) - return std_list_ImageLayer__PythonToCpp_std_list_ImageLayer_; - return {}; -} - -// C++ to Python conversion for type 'const std::vector &'. -static PyObject *conststd_vector_double_REF_CppToPython_conststd_vector_double_REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::vector *>(const_cast(cppIn)); - // TEMPLATE - stdVectorToPyList - START - ::std::vector::size_type vectorSize = cppInRef.size(); - PyObject* pyOut = PyList_New((int) vectorSize); - for (::std::vector::size_type idx = 0; idx < vectorSize; ++idx) { - double cppItem(cppInRef[idx]); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdVectorToPyList - END - -} -static void conststd_vector_double_REF_PythonToCpp_conststd_vector_double_REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::vector *>(cppOut); - // TEMPLATE - pySeqToStdVector - START - int vectorSize = PySequence_Size(pyIn); - cppOutRef.reserve(vectorSize); - for (int idx = 0; idx < vectorSize; ++idx) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, idx)); - double cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pySeqToStdVector - END - -} -static PythonToCppFunc is_conststd_vector_double_REF_PythonToCpp_conststd_vector_double_REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return conststd_vector_double_REF_PythonToCpp_conststd_vector_double_REF; - return {}; -} - -// C++ to Python conversion for type 'const std::vector &'. -static PyObject *conststd_vector_int_REF_CppToPython_conststd_vector_int_REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::vector *>(const_cast(cppIn)); - // TEMPLATE - stdVectorToPyList - START - ::std::vector::size_type vectorSize = cppInRef.size(); - PyObject* pyOut = PyList_New((int) vectorSize); - for (::std::vector::size_type idx = 0; idx < vectorSize; ++idx) { - int cppItem(cppInRef[idx]); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdVectorToPyList - END - -} -static void conststd_vector_int_REF_PythonToCpp_conststd_vector_int_REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::vector *>(cppOut); - // TEMPLATE - pySeqToStdVector - START - int vectorSize = PySequence_Size(pyIn); - cppOutRef.reserve(vectorSize); - for (int idx = 0; idx < vectorSize; ++idx) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, idx)); - int cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pySeqToStdVector - END - -} -static PythonToCppFunc is_conststd_vector_int_REF_PythonToCpp_conststd_vector_int_REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return conststd_vector_int_REF_PythonToCpp_conststd_vector_int_REF; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *std_list_ItemBasePTR__CppToPython_std_list_ItemBasePTR_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::ItemBase* cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_ItemBasePTR__PythonToCpp_std_list_ItemBasePTR_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::ItemBase* cppItem{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_ItemBasePTR__PythonToCpp_std_list_ItemBasePTR__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::checkSequenceTypes(SbkNatronEngineTypes[SBK_ITEMBASE_IDX], pyIn)) - return std_list_ItemBasePTR__PythonToCpp_std_list_ItemBasePTR_; - return {}; -} - -// C++ to Python conversion for type 'std::vector'. -static PyObject *std_vector_std_string__CppToPython_std_vector_std_string_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::vector *>(const_cast(cppIn)); - // TEMPLATE - stdVectorToPyList - START - ::std::vector::size_type vectorSize = cppInRef.size(); - PyObject* pyOut = PyList_New((int) vectorSize); - for (::std::vector::size_type idx = 0; idx < vectorSize; ++idx) { - ::std::string cppItem(cppInRef[idx]); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdVectorToPyList - END - -} -static void std_vector_std_string__PythonToCpp_std_vector_std_string_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::vector *>(cppOut); - // TEMPLATE - pySeqToStdVector - START - int vectorSize = PySequence_Size(pyIn); - cppOutRef.reserve(vectorSize); - for (int idx = 0; idx < vectorSize; ++idx) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, idx)); - ::std::string cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pySeqToStdVector - END - -} -static PythonToCppFunc is_std_vector_std_string__PythonToCpp_std_vector_std_string__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return std_vector_std_string__PythonToCpp_std_vector_std_string_; - return {}; -} - -// C++ to Python conversion for type 'std::list > *'. -static PyObject *std_list_std_vector_std_string__PTR_CppToPython_std_list_std_vector_std_string__PTR(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list > *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list >::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::std::vector cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_std_vector_std_string__PTR_PythonToCpp_std_list_std_vector_std_string__PTR(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list > *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::std::vector cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_std_vector_std_string__PTR_PythonToCpp_std_list_std_vector_std_string__PTR_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], pyIn)) - return std_list_std_vector_std_string__PTR_PythonToCpp_std_list_std_vector_std_string__PTR; - return {}; -} - -// C++ to Python conversion for type 'std::vector'. -static PyObject *std_vector_RectI__CppToPython_std_vector_RectI_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::vector *>(const_cast(cppIn)); - // TEMPLATE - stdVectorToPyList - START - ::std::vector::size_type vectorSize = cppInRef.size(); - PyObject* pyOut = PyList_New((int) vectorSize); - for (::std::vector::size_type idx = 0; idx < vectorSize; ++idx) { - ::RectI cppItem(cppInRef[idx]); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), &cppItem)); - } - return pyOut; - // TEMPLATE - stdVectorToPyList - END - -} -static void std_vector_RectI__PythonToCpp_std_vector_RectI_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::vector *>(cppOut); - // TEMPLATE - pySeqToStdVector - START - int vectorSize = PySequence_Size(pyIn); - cppOutRef.reserve(vectorSize); - for (int idx = 0; idx < vectorSize; ++idx) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, idx)); - ::RectI cppItem; - Shiboken::Conversions::pythonToCppCopy(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pySeqToStdVector - END - -} -static PythonToCppFunc is_std_vector_RectI__PythonToCpp_std_vector_RectI__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), pyIn)) - return std_vector_RectI__PythonToCpp_std_vector_RectI_; - return {}; -} - -// C++ to Python conversion for type 'std::list *'. -static PyObject *std_list_TrackPTR_PTR_CppToPython_std_list_TrackPTR_PTR(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::Track* cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_TRACK_IDX]), cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void std_list_TrackPTR_PTR_PythonToCpp_std_list_TrackPTR_PTR(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::Track* cppItem{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_TRACK_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is_std_list_TrackPTR_PTR_PythonToCpp_std_list_TrackPTR_PTR_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::checkSequenceTypes(SbkNatronEngineTypes[SBK_TRACK_IDX], pyIn)) - return std_list_TrackPTR_PTR_PythonToCpp_std_list_TrackPTR_PTR; - return {}; -} - -// C++ to Python conversion for type 'QList'. -static PyObject *_QList_QVariant__CppToPython__QList_QVariant_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::QList *>(const_cast(cppIn)); - // TEMPLATE - cpplist_to_pylist_conversion - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::QList::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::QVariant cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - cpplist_to_pylist_conversion - END - -} -static void _QList_QVariant__PythonToCpp__QList_QVariant_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::QList *>(cppOut); - // TEMPLATE - pyseq_to_cpplist_conversion - START - // PYSIDE-795: Turn all sequences into iterables. - Shiboken::AutoDecRef it(PyObject_GetIter(pyIn)); - PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext; - for (;;) { - Shiboken::AutoDecRef pyItem(iternext(it)); - if (pyItem.isNull()) { - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) - PyErr_Clear(); - break; - } - ::QVariant cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], pyItem, &(cppItem)); - cppOutRef << cppItem; - } - // TEMPLATE - pyseq_to_cpplist_conversion - END - -} -static PythonToCppFunc is__QList_QVariant__PythonToCpp__QList_QVariant__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], pyIn)) - return _QList_QVariant__PythonToCpp__QList_QVariant_; - return {}; -} - -// C++ to Python conversion for type 'QList'. -static PyObject *_QList_QString__CppToPython__QList_QString_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::QList *>(const_cast(cppIn)); - // TEMPLATE - cpplist_to_pylist_conversion - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::QList::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::QString cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - cpplist_to_pylist_conversion - END - -} -static void _QList_QString__PythonToCpp__QList_QString_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::QList *>(cppOut); - // TEMPLATE - pyseq_to_cpplist_conversion - START - // PYSIDE-795: Turn all sequences into iterables. - Shiboken::AutoDecRef it(PyObject_GetIter(pyIn)); - PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext; - for (;;) { - Shiboken::AutoDecRef pyItem(iternext(it)); - if (pyItem.isNull()) { - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) - PyErr_Clear(); - break; - } - ::QString cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyItem, &(cppItem)); - cppOutRef << cppItem; - } - // TEMPLATE - pyseq_to_cpplist_conversion - END - -} -static PythonToCppFunc is__QList_QString__PythonToCpp__QList_QString__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyIn)) - return _QList_QString__PythonToCpp__QList_QString_; - return {}; -} - -// C++ to Python conversion for type 'QMap'. -static PyObject *_QMap_QString_QVariant__CppToPython__QMap_QString_QVariant_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::QMap *>(const_cast(cppIn)); - // TEMPLATE - cppmap_to_pymap_conversion - START - PyObject *pyOut = PyDict_New(); - for (::QMap::const_iterator it = cppInRef.begin(), end = cppInRef.end(); it != end; ++it) { - ::QString key = it.key(); - ::QVariant value = it.value(); - PyObject *pyKey = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &key); - PyObject *pyValue = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], &value); - PyDict_SetItem(pyOut, pyKey, pyValue); - Py_DECREF(pyKey); - Py_DECREF(pyValue); - } - return pyOut; - // TEMPLATE - cppmap_to_pymap_conversion - END - -} -static void _QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::QMap *>(cppOut); - // TEMPLATE - pydict_to_cppmap_conversion - START - PyObject *key; - PyObject *value; - Py_ssize_t pos = 0; - while (PyDict_Next(pyIn, &pos, &key, &value)) { - ::QString cppKey; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], key, &(cppKey)); - ::QVariant cppValue; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], value, &(cppValue)); - cppOutRef.insert(cppKey, cppValue); - } - // TEMPLATE - pydict_to_cppmap_conversion - END - -} -static PythonToCppFunc is__QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleDictTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], false, SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], false, pyIn)) - return _QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant_; - return {}; -} - - -#ifdef IS_PY3K -static struct PyModuleDef moduledef = { - /* m_base */ PyModuleDef_HEAD_INIT, - /* m_name */ "NatronEngine", - /* m_doc */ nullptr, - /* m_size */ -1, - /* m_methods */ NatronEngine_methods, - /* m_reload */ nullptr, - /* m_traverse */ nullptr, - /* m_clear */ nullptr, - /* m_free */ nullptr -}; - -#endif - -// The signatures string for the global functions. -// Multiple signatures have their index "n:" in front. -static const char *NatronEngine_SignatureStrings[] = { - nullptr}; // Sentinel - -SBK_MODULE_INIT_FUNCTION_BEGIN(NatronEngine) - { - Shiboken::AutoDecRef requiredModule(Shiboken::Module::import("PySide2.QtCore")); - if (requiredModule.isNull()) - return SBK_MODULE_INIT_ERROR; - SbkPySide2_QtCoreTypes = Shiboken::Module::getTypes(requiredModule); - SbkPySide2_QtCoreTypeConverters = Shiboken::Module::getTypeConverters(requiredModule); - } - - // Create an array of wrapper types for the current module. - static PyTypeObject *cppApi[SBK_NatronEngine_IDX_COUNT]; - SbkNatronEngineTypes = cppApi; - - // Create an array of primitive type converters for the current module. - static SbkConverter *sbkConverters[SBK_NatronEngine_CONVERTERS_IDX_COUNT]; - SbkNatronEngineTypeConverters = sbkConverters; - -#ifdef IS_PY3K - PyObject *module = Shiboken::Module::create("NatronEngine", &moduledef); -#else - PyObject *module = Shiboken::Module::create("NatronEngine", NatronEngine_methods); -#endif - - // Make module available from global scope - SbkNatronEngineModuleObject = module; - - // Initialize classes in the type system - init_UserParamHolder(module); - init_Tracker(module); - init_Track(module); - init_Roto(module); - init_RectI(module); - init_RectD(module); - init_PyCoreApplication(module); - init_Param(module); - init_SeparatorParam(module); - init_ParametricParam(module); - init_PageParam(module); - init_NodeCreationProperty(module); - init_StringNodeCreationProperty(module); - init_NatronEngineNATRON_ENUM(module); - init_ItemBase(module); - init_Layer(module); - init_IntNodeCreationProperty(module); - init_Int3DTuple(module); - init_Int2DTuple(module); - init_ImageLayer(module); - init_GroupParam(module); - init_Group(module); - init_FloatNodeCreationProperty(module); - init_ExprUtils(module); - init_Effect(module); - init_Double3DTuple(module); - init_Double2DTuple(module); - init_ColorTuple(module); - init_ButtonParam(module); - init_BoolNodeCreationProperty(module); - init_BezierCurve(module); - init_AppSettings(module); - init_App(module); - init_AnimatedParam(module); - init_DoubleParam(module); - init_Double2DParam(module); - init_Double3DParam(module); - init_StringParamBase(module); - init_OutputFileParam(module); - init_StringParam(module); - init_PathParam(module); - init_FileParam(module); - init_IntParam(module); - init_Int2DParam(module); - init_Int3DParam(module); - init_ColorParam(module); - init_ChoiceParam(module); - init_BooleanParam(module); - - // Register converter for type 'NatronEngine.std::size_t'. - SbkNatronEngineTypeConverters[SBK_STD_SIZE_T_IDX] = Shiboken::Conversions::createConverter(&PyLong_Type, std_size_t_CppToPython_std_size_t); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_STD_SIZE_T_IDX], "std::size_t"); - // Add user defined implicit conversions to type converter. - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_STD_SIZE_T_IDX], - PyLong_PythonToCpp_std_size_t, - is_PyLong_PythonToCpp_std_size_t_Convertible); - - - // Register converter for type 'const std::map&'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX] = Shiboken::Conversions::createConverter(&PyDict_Type, conststd_map_QString_NodeCreationPropertyPTR_REF_CppToPython_conststd_map_QString_NodeCreationPropertyPTR_REF); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], "const std::map&"); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], "std::map"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], - conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp_conststd_map_QString_NodeCreationPropertyPTR_REF, - is_conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp_conststd_map_QString_NodeCreationPropertyPTR_REF_Convertible); - - // Register converter for type 'std::list'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_EFFECTPTR_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_EffectPTR__CppToPython_std_list_EffectPTR_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_EFFECTPTR_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_EFFECTPTR_IDX], - std_list_EffectPTR__PythonToCpp_std_list_EffectPTR_, - is_std_list_EffectPTR__PythonToCpp_std_list_EffectPTR__Convertible); - - // Register converter for type 'std::list'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_QString__CppToPython_std_list_QString_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_QSTRING_IDX], - std_list_QString__PythonToCpp_std_list_QString_, - is_std_list_QString__PythonToCpp_std_list_QString__Convertible); - - // Register converter for type 'const std::list&'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_INT_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_list_int_REF_CppToPython_conststd_list_int_REF); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_INT_IDX], "const std::list&"); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_INT_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_INT_IDX], - conststd_list_int_REF_PythonToCpp_conststd_list_int_REF, - is_conststd_list_int_REF_PythonToCpp_conststd_list_int_REF_Convertible); - - // Register converter for type 'std::list'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_PARAMPTR_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_ParamPTR__CppToPython_std_list_ParamPTR_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_PARAMPTR_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_PARAMPTR_IDX], - std_list_ParamPTR__PythonToCpp_std_list_ParamPTR_, - is_std_list_ParamPTR__PythonToCpp_std_list_ParamPTR__Convertible); - - // Register converter for type 'std::list*'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_DOUBLE_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_double_PTR_CppToPython_std_list_double_PTR); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_DOUBLE_IDX], "std::list*"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_DOUBLE_IDX], - std_list_double_PTR_PythonToCpp_std_list_double_PTR, - is_std_list_double_PTR_PythonToCpp_std_list_double_PTR_Convertible); - - // Register converter for type 'const std::vector&'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_vector_bool_REF_CppToPython_conststd_vector_bool_REF); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX], "const std::vector&"); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX], "std::vector"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX], - conststd_vector_bool_REF_PythonToCpp_conststd_vector_bool_REF, - is_conststd_vector_bool_REF_PythonToCpp_conststd_vector_bool_REF_Convertible); - - // Register converter for type 'std::pair'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_pair_QString_QString__CppToPython_std_pair_QString_QString_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], "std::pair"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX], - std_pair_QString_QString__PythonToCpp_std_pair_QString_QString_, - is_std_pair_QString_QString__PythonToCpp_std_pair_QString_QString__Convertible); - - // Register converter for type 'const std::list>&'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_list_std_pair_QString_QString__REF_CppToPython_conststd_list_std_pair_QString_QString__REF); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], "const std::list>&"); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], "std::list>"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX], - conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF, - is_conststd_list_std_pair_QString_QString__REF_PythonToCpp_conststd_list_std_pair_QString_QString__REF_Convertible); - - // Register converter for type 'std::list'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_IMAGELAYER_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_ImageLayer__CppToPython_std_list_ImageLayer_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_IMAGELAYER_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_IMAGELAYER_IDX], - std_list_ImageLayer__PythonToCpp_std_list_ImageLayer_, - is_std_list_ImageLayer__PythonToCpp_std_list_ImageLayer__Convertible); - - // Register converter for type 'const std::vector&'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_vector_double_REF_CppToPython_conststd_vector_double_REF); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX], "const std::vector&"); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX], "std::vector"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX], - conststd_vector_double_REF_PythonToCpp_conststd_vector_double_REF, - is_conststd_vector_double_REF_PythonToCpp_conststd_vector_double_REF_Convertible); - - // Register converter for type 'const std::vector&'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_INT_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, conststd_vector_int_REF_CppToPython_conststd_vector_int_REF); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_INT_IDX], "const std::vector&"); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_INT_IDX], "std::vector"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_INT_IDX], - conststd_vector_int_REF_PythonToCpp_conststd_vector_int_REF, - is_conststd_vector_int_REF_PythonToCpp_conststd_vector_int_REF_Convertible); - - // Register converter for type 'std::list'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_ITEMBASEPTR_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_ItemBasePTR__CppToPython_std_list_ItemBasePTR_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_ITEMBASEPTR_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_ITEMBASEPTR_IDX], - std_list_ItemBasePTR__PythonToCpp_std_list_ItemBasePTR_, - is_std_list_ItemBasePTR__PythonToCpp_std_list_ItemBasePTR__Convertible); - - // Register converter for type 'std::vector'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_vector_std_string__CppToPython_std_vector_std_string_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], "std::vector"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], - std_vector_std_string__PythonToCpp_std_vector_std_string_, - is_std_vector_std_string__PythonToCpp_std_vector_std_string__Convertible); - - // Register converter for type 'std::list>*'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_VECTOR_STD_STRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_std_vector_std_string__PTR_CppToPython_std_list_std_vector_std_string__PTR); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_VECTOR_STD_STRING_IDX], "std::list>*"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_STD_VECTOR_STD_STRING_IDX], - std_list_std_vector_std_string__PTR_PythonToCpp_std_list_std_vector_std_string__PTR, - is_std_list_std_vector_std_string__PTR_PythonToCpp_std_list_std_vector_std_string__PTR_Convertible); - - // Register converter for type 'std::vector'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_RECTI_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_vector_RectI__CppToPython_std_vector_RectI_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_RECTI_IDX], "std::vector"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_RECTI_IDX], - std_vector_RectI__PythonToCpp_std_vector_RectI_, - is_std_vector_RectI__PythonToCpp_std_vector_RectI__Convertible); - - // Register converter for type 'std::list*'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_TRACKPTR_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, std_list_TrackPTR_PTR_CppToPython_std_list_TrackPTR_PTR); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_TRACKPTR_IDX], "std::list*"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_TRACKPTR_IDX], - std_list_TrackPTR_PTR_PythonToCpp_std_list_TrackPTR_PTR, - is_std_list_TrackPTR_PTR_PythonToCpp_std_list_TrackPTR_PTR_Convertible); - - // Register converter for type 'QList'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QLIST_QVARIANT_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _QList_QVariant__CppToPython__QList_QVariant_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QLIST_QVARIANT_IDX], "QList"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QLIST_QVARIANT_IDX], - _QList_QVariant__PythonToCpp__QList_QVariant_, - is__QList_QVariant__PythonToCpp__QList_QVariant__Convertible); - - // Register converter for type 'QList'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QLIST_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _QList_QString__CppToPython__QList_QString_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QLIST_QSTRING_IDX], "QList"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QLIST_QSTRING_IDX], - _QList_QString__PythonToCpp__QList_QString_, - is__QList_QString__PythonToCpp__QList_QString__Convertible); - - // Register converter for type 'QMap'. - SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QMAP_QSTRING_QVARIANT_IDX] = Shiboken::Conversions::createConverter(&PyDict_Type, _QMap_QString_QVariant__CppToPython__QMap_QString_QVariant_); - Shiboken::Conversions::registerConverterName(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QMAP_QSTRING_QVARIANT_IDX], "QMap"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_QMAP_QSTRING_QVARIANT_IDX], - _QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant_, - is__QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant__Convertible); - - // Register primitive types converters. - Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter(), "ushort"); - - Shiboken::Module::registerTypes(module, SbkNatronEngineTypes); - Shiboken::Module::registerTypeConverters(module, SbkNatronEngineTypeConverters); - - if (PyErr_Occurred()) { - PyErr_Print(); - Py_FatalError("can't initialize module NatronEngine"); - } - PySide::registerCleanupFunction(cleanTypesAttributes); - - FinishSignatureInitialization(module, NatronEngine_SignatureStrings); - -SBK_MODULE_INIT_FUNCTION_END diff --git a/Engine/Qt5/NatronEngine/natronengine_python.h b/Engine/Qt5/NatronEngine/natronengine_python.h deleted file mode 100644 index efbdc598f1..0000000000 --- a/Engine/Qt5/NatronEngine/natronengine_python.h +++ /dev/null @@ -1,231 +0,0 @@ - - -#ifndef SBK_NATRONENGINE_PYTHON_H -#define SBK_NATRONENGINE_PYTHON_H - -#include -#include -// Module Includes -CLANG_DIAG_OFF(deprecated) -CLANG_DIAG_OFF(uninitialized) -CLANG_DIAG_OFF(keyword-macro) -#include // produces warnings -CLANG_DIAG_ON(deprecated) -CLANG_DIAG_ON(uninitialized) -CLANG_DIAG_ON(keyword-macro) - -// Bound library includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// Conversion Includes - Primitive Types -#include -#include -#include -#include - -// Conversion Includes - Container Types -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Type indices -enum : int { - SBK_ANIMATEDPARAM_IDX = 0, - SBK_APP_IDX = 1, - SBK_APPSETTINGS_IDX = 2, - SBK_BEZIERCURVE_IDX = 3, - SBK_BOOLNODECREATIONPROPERTY_IDX = 4, - SBK_BOOLEANPARAM_IDX = 5, - SBK_BUTTONPARAM_IDX = 6, - SBK_CHOICEPARAM_IDX = 7, - SBK_COLORPARAM_IDX = 8, - SBK_COLORTUPLE_IDX = 9, - SBK_DOUBLE2DPARAM_IDX = 10, - SBK_DOUBLE2DTUPLE_IDX = 11, - SBK_DOUBLE3DPARAM_IDX = 12, - SBK_DOUBLE3DTUPLE_IDX = 13, - SBK_DOUBLEPARAM_IDX = 14, - SBK_EFFECT_IDX = 15, - SBK_EXPRUTILS_IDX = 16, - SBK_FILEPARAM_IDX = 17, - SBK_FLOATNODECREATIONPROPERTY_IDX = 18, - SBK_GROUP_IDX = 19, - SBK_GROUPPARAM_IDX = 20, - SBK_IMAGELAYER_IDX = 21, - SBK_INT2DPARAM_IDX = 22, - SBK_INT2DTUPLE_IDX = 23, - SBK_INT3DPARAM_IDX = 24, - SBK_INT3DTUPLE_IDX = 25, - SBK_INTNODECREATIONPROPERTY_IDX = 26, - SBK_INTPARAM_IDX = 27, - SBK_ITEMBASE_IDX = 28, - SBK_LAYER_IDX = 29, - SBK_NATRON_ENUM_STATUSENUM_IDX = 41, - SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX = 40, - SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX = 52, - SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX = 35, - SBK_NATRON_ENUM_PIXMAPENUM_IDX = 38, - SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX = 42, - SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX = 31, - SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX = 34, - SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX = 44, - SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX = 43, - SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX = 33, - SBK_NATRON_ENUM_ORIENTATIONENUM_IDX = 37, - SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX = 39, - SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX = 32, - SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX = 36, - SBK_NatronEngineNATRON_ENUM_IDX = 30, - SBK_NODECREATIONPROPERTY_IDX = 45, - SBK_OUTPUTFILEPARAM_IDX = 46, - SBK_PAGEPARAM_IDX = 47, - SBK_PARAM_IDX = 48, - SBK_PARAMETRICPARAM_IDX = 49, - SBK_PATHPARAM_IDX = 50, - SBK_PYCOREAPPLICATION_IDX = 51, - SBK_RECTD_IDX = 53, - SBK_RECTI_IDX = 54, - SBK_ROTO_IDX = 55, - SBK_SEPARATORPARAM_IDX = 56, - SBK_STRINGNODECREATIONPROPERTY_IDX = 57, - SBK_STRINGPARAM_TYPEENUM_IDX = 59, - SBK_STRINGPARAM_IDX = 58, - SBK_STRINGPARAMBASE_IDX = 60, - SBK_TRACK_IDX = 61, - SBK_TRACKER_IDX = 62, - SBK_USERPARAMHOLDER_IDX = 63, - SBK_NatronEngine_IDX_COUNT = 64 -}; -// This variable stores all Python types exported by this module. -extern PyTypeObject **SbkNatronEngineTypes; - -// This variable stores the Python module object exported by this module. -extern PyObject *SbkNatronEngineModuleObject; - -// This variable stores all type converters exported by this module. -extern SbkConverter **SbkNatronEngineTypeConverters; - -// Converter indices -enum : int { - SBK_STD_SIZE_T_IDX = 0, - SBK_NATRONENGINE_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX = 1, // const std::map & - SBK_NATRONENGINE_STD_LIST_EFFECTPTR_IDX = 2, // std::list - SBK_NATRONENGINE_STD_LIST_QSTRING_IDX = 3, // std::list - SBK_NATRONENGINE_STD_LIST_INT_IDX = 4, // const std::list & - SBK_NATRONENGINE_STD_LIST_PARAMPTR_IDX = 5, // std::list - SBK_NATRONENGINE_STD_LIST_DOUBLE_IDX = 6, // std::list * - SBK_NATRONENGINE_STD_VECTOR_BOOL_IDX = 7, // const std::vector & - SBK_NATRONENGINE_STD_PAIR_QSTRING_QSTRING_IDX = 8, // std::pair - SBK_NATRONENGINE_STD_LIST_STD_PAIR_QSTRING_QSTRING_IDX = 9, // const std::list > & - SBK_NATRONENGINE_STD_LIST_IMAGELAYER_IDX = 10, // std::list - SBK_NATRONENGINE_STD_VECTOR_DOUBLE_IDX = 11, // const std::vector & - SBK_NATRONENGINE_STD_VECTOR_INT_IDX = 12, // const std::vector & - SBK_NATRONENGINE_STD_LIST_ITEMBASEPTR_IDX = 13, // std::list - SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX = 14, // std::vector - SBK_NATRONENGINE_STD_LIST_STD_VECTOR_STD_STRING_IDX = 15, // std::list > * - SBK_NATRONENGINE_STD_VECTOR_RECTI_IDX = 16, // std::vector - SBK_NATRONENGINE_STD_LIST_TRACKPTR_IDX = 17, // std::list * - SBK_NATRONENGINE_QLIST_QVARIANT_IDX = 18, // QList - SBK_NATRONENGINE_QLIST_QSTRING_IDX = 19, // QList - SBK_NATRONENGINE_QMAP_QSTRING_QVARIANT_IDX = 20, // QMap - SBK_NatronEngine_CONVERTERS_IDX_COUNT = 21 -}; -// Macros for type check - -namespace Shiboken -{ - -// PyType functions, to get the PyObjectType for a type T -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_APP_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_APPSETTINGS_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_BOOLNODECREATIONPROPERTY_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_BUTTONPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_COLORPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE2DTUPLE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE3DPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE3DTUPLE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_EXPRUTILS_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_FILEPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_FLOATNODECREATIONPROPERTY_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_GROUPPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_IMAGELAYER_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_INT2DPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_INT2DTUPLE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_INT3DPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_INT3DTUPLE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_INTNODECREATIONPROPERTY_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_INTPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_LAYER_IDX]); } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX]; } -template<> inline PyTypeObject *SbkType< ::QFlags<::NATRON_ENUM::StandardButtonEnum> >() { return SbkNatronEngineTypes[SBK_QFLAGS_NATRON_ENUM_STANDARDBUTTONENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_VALUECHANGEDREASONENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_ANIMATIONLEVELENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEPREMULTIPLICATIONENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOLORSPACEENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_IMAGEBITDEPTHENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_ORIENTATIONENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_NATRON_ENUM_MERGINGFUNCTIONENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_OUTPUTFILEPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_PAGEPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_PATHPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_ROTO_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_SEPARATORPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGNODECREATIONPROPERTY_IDX]); } -template<> inline PyTypeObject *SbkType() { return SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX]; } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGPARAM_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_TRACK_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_TRACKER_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX]); } -QT_WARNING_POP - -} // namespace Shiboken - -#endif // SBK_NATRONENGINE_PYTHON_H - diff --git a/Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.cpp b/Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.cpp deleted file mode 100644 index 3d42194786..0000000000 --- a/Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.cpp +++ /dev/null @@ -1,270 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "nodecreationproperty_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void NodeCreationPropertyWrapper::pysideInitQtMetaTypes() -{ -} - -void NodeCreationPropertyWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -NodeCreationPropertyWrapper::NodeCreationPropertyWrapper() : NodeCreationProperty() -{ - resetPyMethodCache(); - // ... middle -} - -NodeCreationPropertyWrapper::~NodeCreationPropertyWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_NodeCreationProperty_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::NodeCreationProperty >())) - return -1; - - ::NodeCreationPropertyWrapper *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // NodeCreationProperty() - cptr = new ::NodeCreationPropertyWrapper(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::NodeCreationProperty >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - - -static const char *Sbk_NodeCreationProperty_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_NodeCreationProperty_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_NodeCreationProperty_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::NodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_NodeCreationProperty_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_NodeCreationProperty_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_NodeCreationProperty_Type = nullptr; -static SbkObjectType *Sbk_NodeCreationProperty_TypeF(void) -{ - return _Sbk_NodeCreationProperty_Type; -} - -static PyType_Slot Sbk_NodeCreationProperty_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_NodeCreationProperty_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_NodeCreationProperty_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_NodeCreationProperty_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_NodeCreationProperty_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_NodeCreationProperty_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_NodeCreationProperty_spec = { - "1:NatronEngine.NodeCreationProperty", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_NodeCreationProperty_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void NodeCreationProperty_PythonToCpp_NodeCreationProperty_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_NodeCreationProperty_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_NodeCreationProperty_PythonToCpp_NodeCreationProperty_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_NodeCreationProperty_TypeF()))) - return NodeCreationProperty_PythonToCpp_NodeCreationProperty_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *NodeCreationProperty_PTR_CppToPython_NodeCreationProperty(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_NodeCreationProperty_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *NodeCreationProperty_SignatureStrings[] = { - "NatronEngine.NodeCreationProperty(self)", - nullptr}; // Sentinel - -void init_NodeCreationProperty(PyObject *module) -{ - _Sbk_NodeCreationProperty_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "NodeCreationProperty", - "NodeCreationProperty*", - &Sbk_NodeCreationProperty_spec, - &Shiboken::callCppDestructor< ::NodeCreationProperty >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_NodeCreationProperty_Type); - InitSignatureStrings(pyType, NodeCreationProperty_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_NodeCreationProperty_Type), Sbk_NodeCreationProperty_PropertyStrings); - SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX] - = reinterpret_cast(Sbk_NodeCreationProperty_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_NodeCreationProperty_TypeF(), - NodeCreationProperty_PythonToCpp_NodeCreationProperty_PTR, - is_NodeCreationProperty_PythonToCpp_NodeCreationProperty_PTR_Convertible, - NodeCreationProperty_PTR_CppToPython_NodeCreationProperty); - - Shiboken::Conversions::registerConverterName(converter, "NodeCreationProperty"); - Shiboken::Conversions::registerConverterName(converter, "NodeCreationProperty*"); - Shiboken::Conversions::registerConverterName(converter, "NodeCreationProperty&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::NodeCreationProperty).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::NodeCreationPropertyWrapper).name()); - - - - NodeCreationPropertyWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.h b/Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.h deleted file mode 100644 index 9feb2e75e0..0000000000 --- a/Engine/Qt5/NatronEngine/nodecreationproperty_wrapper.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SBK_NODECREATIONPROPERTYWRAPPER_H -#define SBK_NODECREATIONPROPERTYWRAPPER_H - -#include - -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class NodeCreationPropertyWrapper : public NodeCreationProperty -{ -public: - NodeCreationPropertyWrapper(); - ~NodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_NODECREATIONPROPERTYWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/outputfileparam_wrapper.cpp b/Engine/Qt5/NatronEngine/outputfileparam_wrapper.cpp deleted file mode 100644 index c55c6d4f43..0000000000 --- a/Engine/Qt5/NatronEngine/outputfileparam_wrapper.cpp +++ /dev/null @@ -1,305 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "outputfileparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void OutputFileParamWrapper::pysideInitQtMetaTypes() -{ -} - -void OutputFileParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -OutputFileParamWrapper::~OutputFileParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_OutputFileParamFunc_openFile(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::OutputFileParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_OUTPUTFILEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // openFile() - cppSelf->openFile(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_OutputFileParamFunc_setSequenceEnabled(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::OutputFileParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_OUTPUTFILEPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: OutputFileParam::setSequenceEnabled(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setSequenceEnabled(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_OutputFileParamFunc_setSequenceEnabled_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setSequenceEnabled(bool) - cppSelf->setSequenceEnabled(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_OutputFileParamFunc_setSequenceEnabled_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.OutputFileParam.setSequenceEnabled"); - return {}; -} - - -static const char *Sbk_OutputFileParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_OutputFileParam_methods[] = { - {"openFile", reinterpret_cast(Sbk_OutputFileParamFunc_openFile), METH_NOARGS}, - {"setSequenceEnabled", reinterpret_cast(Sbk_OutputFileParamFunc_setSequenceEnabled), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_OutputFileParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::OutputFileParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_OUTPUTFILEPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_OutputFileParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_OutputFileParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_OutputFileParam_Type = nullptr; -static SbkObjectType *Sbk_OutputFileParam_TypeF(void) -{ - return _Sbk_OutputFileParam_Type; -} - -static PyType_Slot Sbk_OutputFileParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_OutputFileParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_OutputFileParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_OutputFileParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_OutputFileParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_OutputFileParam_spec = { - "1:NatronEngine.OutputFileParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_OutputFileParam_slots -}; - -} //extern "C" - -static void *Sbk_OutputFileParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::OutputFileParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void OutputFileParam_PythonToCpp_OutputFileParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_OutputFileParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_OutputFileParam_PythonToCpp_OutputFileParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_OutputFileParam_TypeF()))) - return OutputFileParam_PythonToCpp_OutputFileParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *OutputFileParam_PTR_CppToPython_OutputFileParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_OutputFileParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *OutputFileParam_SignatureStrings[] = { - "NatronEngine.OutputFileParam.openFile(self)", - "NatronEngine.OutputFileParam.setSequenceEnabled(self,enabled:bool)", - nullptr}; // Sentinel - -void init_OutputFileParam(PyObject *module) -{ - _Sbk_OutputFileParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "OutputFileParam", - "OutputFileParam*", - &Sbk_OutputFileParam_spec, - &Shiboken::callCppDestructor< ::OutputFileParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_OutputFileParam_Type); - InitSignatureStrings(pyType, OutputFileParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_OutputFileParam_Type), Sbk_OutputFileParam_PropertyStrings); - SbkNatronEngineTypes[SBK_OUTPUTFILEPARAM_IDX] - = reinterpret_cast(Sbk_OutputFileParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_OutputFileParam_TypeF(), - OutputFileParam_PythonToCpp_OutputFileParam_PTR, - is_OutputFileParam_PythonToCpp_OutputFileParam_PTR_Convertible, - OutputFileParam_PTR_CppToPython_OutputFileParam); - - Shiboken::Conversions::registerConverterName(converter, "OutputFileParam"); - Shiboken::Conversions::registerConverterName(converter, "OutputFileParam*"); - Shiboken::Conversions::registerConverterName(converter, "OutputFileParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::OutputFileParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::OutputFileParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_OutputFileParam_TypeF(), &Sbk_OutputFileParam_typeDiscovery); - - - OutputFileParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/outputfileparam_wrapper.h b/Engine/Qt5/NatronEngine/outputfileparam_wrapper.h deleted file mode 100644 index da7ba0e979..0000000000 --- a/Engine/Qt5/NatronEngine/outputfileparam_wrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef SBK_OUTPUTFILEPARAMWRAPPER_H -#define SBK_OUTPUTFILEPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class OutputFileParamWrapper : public OutputFileParam -{ -public: - ~OutputFileParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_STRINGPARAMBASEWRAPPER_H -# define SBK_STRINGPARAMBASEWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class StringParamBaseWrapper : public StringParamBase -{ -public: - ~StringParamBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_STRINGPARAMBASEWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_OUTPUTFILEPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/pageparam_wrapper.cpp b/Engine/Qt5/NatronEngine/pageparam_wrapper.cpp deleted file mode 100644 index 33dca60602..0000000000 --- a/Engine/Qt5/NatronEngine/pageparam_wrapper.cpp +++ /dev/null @@ -1,283 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "pageparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void PageParamWrapper::pysideInitQtMetaTypes() -{ -} - -void PageParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -PageParamWrapper::~PageParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_PageParamFunc_addParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PageParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PAGEPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PageParam::addParam(const Param*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArg)))) { - overloadId = 0; // addParam(const Param*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PageParamFunc_addParam_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::Param *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // addParam(const Param*) - cppSelf->addParam(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PageParamFunc_addParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PageParam.addParam"); - return {}; -} - - -static const char *Sbk_PageParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PageParam_methods[] = { - {"addParam", reinterpret_cast(Sbk_PageParamFunc_addParam), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_PageParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::PageParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PAGEPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_PageParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PageParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PageParam_Type = nullptr; -static SbkObjectType *Sbk_PageParam_TypeF(void) -{ - return _Sbk_PageParam_Type; -} - -static PyType_Slot Sbk_PageParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_PageParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_PageParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PageParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PageParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PageParam_spec = { - "1:NatronEngine.PageParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PageParam_slots -}; - -} //extern "C" - -static void *Sbk_PageParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::PageParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PageParam_PythonToCpp_PageParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PageParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PageParam_PythonToCpp_PageParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PageParam_TypeF()))) - return PageParam_PythonToCpp_PageParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PageParam_PTR_CppToPython_PageParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PageParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PageParam_SignatureStrings[] = { - "NatronEngine.PageParam.addParam(self,param:NatronEngine.Param)", - nullptr}; // Sentinel - -void init_PageParam(PyObject *module) -{ - _Sbk_PageParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PageParam", - "PageParam*", - &Sbk_PageParam_spec, - &Shiboken::callCppDestructor< ::PageParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PageParam_Type); - InitSignatureStrings(pyType, PageParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PageParam_Type), Sbk_PageParam_PropertyStrings); - SbkNatronEngineTypes[SBK_PAGEPARAM_IDX] - = reinterpret_cast(Sbk_PageParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PageParam_TypeF(), - PageParam_PythonToCpp_PageParam_PTR, - is_PageParam_PythonToCpp_PageParam_PTR_Convertible, - PageParam_PTR_CppToPython_PageParam); - - Shiboken::Conversions::registerConverterName(converter, "PageParam"); - Shiboken::Conversions::registerConverterName(converter, "PageParam*"); - Shiboken::Conversions::registerConverterName(converter, "PageParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PageParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::PageParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_PageParam_TypeF(), &Sbk_PageParam_typeDiscovery); - - - PageParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/pageparam_wrapper.h b/Engine/Qt5/NatronEngine/pageparam_wrapper.h deleted file mode 100644 index 517163ccc4..0000000000 --- a/Engine/Qt5/NatronEngine/pageparam_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_PAGEPARAMWRAPPER_H -#define SBK_PAGEPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class PageParamWrapper : public PageParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { PageParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~PageParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_PAGEPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/param_wrapper.cpp b/Engine/Qt5/NatronEngine/param_wrapper.cpp deleted file mode 100644 index 75d625ffb6..0000000000 --- a/Engine/Qt5/NatronEngine/param_wrapper.cpp +++ /dev/null @@ -1,1775 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "param_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void ParamWrapper::pysideInitQtMetaTypes() -{ -} - -void ParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -ParamWrapper::~ParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_ParamFunc__addAsDependencyOf(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "_addAsDependencyOf", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: Param::_addAsDependencyOf(int,Param*,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // _addAsDependencyOf(int,Param*,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc__addAsDependencyOf_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Param *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // _addAsDependencyOf(int,Param*,int) - static_cast<::ParamWrapper *>(cppSelf)->ParamWrapper::_addAsDependencyOf_protected(cppArg0, cppArg1, cppArg2); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc__addAsDependencyOf_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param._addAsDependencyOf"); - return {}; -} - -static PyObject *Sbk_ParamFunc_copy(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.copy(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.copy(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:copy", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Param::copy(Param*,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // copy(Param*,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // copy(Param*,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_copy_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.copy(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ParamFunc_copy_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Param *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = -1; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // copy(Param*,int) - bool cppResult = cppSelf->copy(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParamFunc_copy_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.copy"); - return {}; -} - -static PyObject *Sbk_ParamFunc_curve(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.curve(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.curve(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:curve", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Param::curve(double,int)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // curve(double,int)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // curve(double,int)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_curve_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.curve(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ParamFunc_curve_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // curve(double,int)const - double cppResult = const_cast(cppSelf)->curve(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParamFunc_curve_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.curve"); - return {}; -} - -static PyObject *Sbk_ParamFunc_getAddNewLine(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getAddNewLine() - bool cppResult = cppSelf->getAddNewLine(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getCanAnimate(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCanAnimate()const - bool cppResult = const_cast(cppSelf)->getCanAnimate(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getEvaluateOnChange(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getEvaluateOnChange()const - bool cppResult = const_cast(cppSelf)->getEvaluateOnChange(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getHelp(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getHelp()const - QString cppResult = const_cast(cppSelf)->getHelp(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getIsAnimationEnabled(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getIsAnimationEnabled()const - bool cppResult = const_cast(cppSelf)->getIsAnimationEnabled(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getIsEnabled(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.getIsEnabled(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getIsEnabled", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: Param::getIsEnabled(int)const - if (numArgs == 0) { - overloadId = 0; // getIsEnabled(int)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // getIsEnabled(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_getIsEnabled_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.getIsEnabled(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ParamFunc_getIsEnabled_TypeError; - } - } - } - int cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getIsEnabled(int)const - bool cppResult = const_cast(cppSelf)->getIsEnabled(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParamFunc_getIsEnabled_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.getIsEnabled"); - return {}; -} - -static PyObject *Sbk_ParamFunc_getIsPersistent(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getIsPersistent()const - bool cppResult = const_cast(cppSelf)->getIsPersistent(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getIsVisible(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getIsVisible()const - bool cppResult = const_cast(cppSelf)->getIsVisible(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getLabel(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getLabel()const - QString cppResult = const_cast(cppSelf)->getLabel(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getNumDimensions(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNumDimensions()const - int cppResult = const_cast(cppSelf)->getNumDimensions(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getParent(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getParent()const - Param * cppResult = const_cast(cppSelf)->getParent(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getScriptName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getScriptName()const - QString cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_getTypeName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getTypeName()const - QString cppResult = const_cast(cppSelf)->getTypeName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_ParamFunc_random(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.random(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:random", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: Param::random(double,double)const - // 1: Param::random(double,double,double,uint)const - if (numArgs == 0) { - overloadId = 0; // random(double,double)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // random(double,double)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // random(double,double)const - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 1; // random(double,double,double,uint)const - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // random(double,double,double,uint)const - } - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_random_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // random(double min, double max) const - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","min"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.random(): got multiple values for keyword argument 'min'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ParamFunc_random_TypeError; - } - } - keyName = Py_BuildValue("s","max"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.random(): got multiple values for keyword argument 'max'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ParamFunc_random_TypeError; - } - } - } - double cppArg0 = 0.; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1 = 1.; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // random(double,double)const - double cppResult = const_cast(cppSelf)->random(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // random(double min, double max, double time, unsigned int seed) const - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","seed"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.random(): got multiple values for keyword argument 'seed'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ParamFunc_random_TypeError; - } - } - } - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - unsigned int cppArg3 = 0; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // random(double,double,double,uint)const - double cppResult = const_cast(cppSelf)->random(cppArg0, cppArg1, cppArg2, cppArg3); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParamFunc_random_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.random"); - return {}; -} - -static PyObject *Sbk_ParamFunc_randomInt(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.randomInt(): too many arguments"); - return {}; - } else if (numArgs < 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.randomInt(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOO:randomInt", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: Param::randomInt(int,int) - // 1: Param::randomInt(int,int,double,uint)const - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // randomInt(int,int) - } else if ((pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 1; // randomInt(int,int,double,uint)const - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // randomInt(int,int,double,uint)const - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_randomInt_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // randomInt(int min, int max) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // randomInt(int,int) - int cppResult = cppSelf->randomInt(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // randomInt(int min, int max, double time, unsigned int seed) const - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","seed"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.randomInt(): got multiple values for keyword argument 'seed'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_ParamFunc_randomInt_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - unsigned int cppArg3 = 0; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // randomInt(int,int,double,uint)const - int cppResult = const_cast(cppSelf)->randomInt(cppArg0, cppArg1, cppArg2, cppArg3); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParamFunc_randomInt_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.randomInt"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setAddNewLine(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setAddNewLine(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setAddNewLine(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setAddNewLine_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setAddNewLine(bool) - cppSelf->setAddNewLine(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setAddNewLine_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setAddNewLine"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setAnimationEnabled(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setAnimationEnabled(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setAnimationEnabled(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setAnimationEnabled_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setAnimationEnabled(bool) - cppSelf->setAnimationEnabled(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setAnimationEnabled_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setAnimationEnabled"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setAsAlias(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setAsAlias(Param*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArg)))) { - overloadId = 0; // setAsAlias(Param*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setAsAlias_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::Param *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setAsAlias(Param*) - bool cppResult = cppSelf->setAsAlias(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParamFunc_setAsAlias_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setAsAlias"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setEnabled(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.setEnabled(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.setEnabled(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setEnabled", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: Param::setEnabled(bool,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setEnabled(bool,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setEnabled(bool,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setEnabled_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","dimension"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.setEnabled(): got multiple values for keyword argument 'dimension'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_ParamFunc_setEnabled_TypeError; - } - } - } - bool cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setEnabled(bool,int) - cppSelf->setEnabled(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setEnabled_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.setEnabled"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setEnabledByDefault(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.setEnabledByDefault(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:setEnabledByDefault", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: Param::setEnabledByDefault(bool) - if (numArgs == 0) { - overloadId = 0; // setEnabledByDefault(bool) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // setEnabledByDefault(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setEnabledByDefault_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","enabled"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.Param.setEnabledByDefault(): got multiple values for keyword argument 'enabled'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_ParamFunc_setEnabledByDefault_TypeError; - } - } - } - bool cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // setEnabledByDefault(bool) - cppSelf->setEnabledByDefault(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setEnabledByDefault_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.setEnabledByDefault"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setEvaluateOnChange(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setEvaluateOnChange(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setEvaluateOnChange(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setEvaluateOnChange_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setEvaluateOnChange(bool) - cppSelf->setEvaluateOnChange(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setEvaluateOnChange_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setEvaluateOnChange"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setHelp(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setHelp(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setHelp(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setHelp_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setHelp(QString) - cppSelf->setHelp(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setHelp_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setHelp"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setIconFilePath(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setIconFilePath(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setIconFilePath(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setIconFilePath_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setIconFilePath(QString) - cppSelf->setIconFilePath(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setIconFilePath_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setIconFilePath"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setPersistent(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setPersistent(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setPersistent(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setPersistent_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setPersistent(bool) - cppSelf->setPersistent(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setPersistent_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setPersistent"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setVisible(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setVisible(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setVisible(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setVisible_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setVisible(bool) - cppSelf->setVisible(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setVisible_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setVisible"); - return {}; -} - -static PyObject *Sbk_ParamFunc_setVisibleByDefault(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::setVisibleByDefault(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setVisibleByDefault(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_setVisibleByDefault_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setVisibleByDefault(bool) - cppSelf->setVisibleByDefault(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_setVisibleByDefault_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.setVisibleByDefault"); - return {}; -} - -static PyObject *Sbk_ParamFunc_slaveTo(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "slaveTo", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: Param::slaveTo(Param*,int,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // slaveTo(Param*,int,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_slaveTo_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Param *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // slaveTo(Param*,int,int) - bool cppResult = cppSelf->slaveTo(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParamFunc_slaveTo_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Param.slaveTo"); - return {}; -} - -static PyObject *Sbk_ParamFunc_unslave(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Param::unslave(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // unslave(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParamFunc_unslave_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // unslave(int) - cppSelf->unslave(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParamFunc_unslave_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Param.unslave"); - return {}; -} - - -static const char *Sbk_Param_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Param_methods[] = { - {"_addAsDependencyOf", reinterpret_cast(Sbk_ParamFunc__addAsDependencyOf), METH_VARARGS}, - {"copy", reinterpret_cast(Sbk_ParamFunc_copy), METH_VARARGS|METH_KEYWORDS}, - {"curve", reinterpret_cast(Sbk_ParamFunc_curve), METH_VARARGS|METH_KEYWORDS}, - {"getAddNewLine", reinterpret_cast(Sbk_ParamFunc_getAddNewLine), METH_NOARGS}, - {"getCanAnimate", reinterpret_cast(Sbk_ParamFunc_getCanAnimate), METH_NOARGS}, - {"getEvaluateOnChange", reinterpret_cast(Sbk_ParamFunc_getEvaluateOnChange), METH_NOARGS}, - {"getHelp", reinterpret_cast(Sbk_ParamFunc_getHelp), METH_NOARGS}, - {"getIsAnimationEnabled", reinterpret_cast(Sbk_ParamFunc_getIsAnimationEnabled), METH_NOARGS}, - {"getIsEnabled", reinterpret_cast(Sbk_ParamFunc_getIsEnabled), METH_VARARGS|METH_KEYWORDS}, - {"getIsPersistent", reinterpret_cast(Sbk_ParamFunc_getIsPersistent), METH_NOARGS}, - {"getIsVisible", reinterpret_cast(Sbk_ParamFunc_getIsVisible), METH_NOARGS}, - {"getLabel", reinterpret_cast(Sbk_ParamFunc_getLabel), METH_NOARGS}, - {"getNumDimensions", reinterpret_cast(Sbk_ParamFunc_getNumDimensions), METH_NOARGS}, - {"getParent", reinterpret_cast(Sbk_ParamFunc_getParent), METH_NOARGS}, - {"getScriptName", reinterpret_cast(Sbk_ParamFunc_getScriptName), METH_NOARGS}, - {"getTypeName", reinterpret_cast(Sbk_ParamFunc_getTypeName), METH_NOARGS}, - {"random", reinterpret_cast(Sbk_ParamFunc_random), METH_VARARGS|METH_KEYWORDS}, - {"randomInt", reinterpret_cast(Sbk_ParamFunc_randomInt), METH_VARARGS|METH_KEYWORDS}, - {"setAddNewLine", reinterpret_cast(Sbk_ParamFunc_setAddNewLine), METH_O}, - {"setAnimationEnabled", reinterpret_cast(Sbk_ParamFunc_setAnimationEnabled), METH_O}, - {"setAsAlias", reinterpret_cast(Sbk_ParamFunc_setAsAlias), METH_O}, - {"setEnabled", reinterpret_cast(Sbk_ParamFunc_setEnabled), METH_VARARGS|METH_KEYWORDS}, - {"setEnabledByDefault", reinterpret_cast(Sbk_ParamFunc_setEnabledByDefault), METH_VARARGS|METH_KEYWORDS}, - {"setEvaluateOnChange", reinterpret_cast(Sbk_ParamFunc_setEvaluateOnChange), METH_O}, - {"setHelp", reinterpret_cast(Sbk_ParamFunc_setHelp), METH_O}, - {"setIconFilePath", reinterpret_cast(Sbk_ParamFunc_setIconFilePath), METH_O}, - {"setPersistent", reinterpret_cast(Sbk_ParamFunc_setPersistent), METH_O}, - {"setVisible", reinterpret_cast(Sbk_ParamFunc_setVisible), METH_O}, - {"setVisibleByDefault", reinterpret_cast(Sbk_ParamFunc_setVisibleByDefault), METH_O}, - {"slaveTo", reinterpret_cast(Sbk_ParamFunc_slaveTo), METH_VARARGS}, - {"unslave", reinterpret_cast(Sbk_ParamFunc_unslave), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_Param_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::Param *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_Param_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Param_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Param_Type = nullptr; -static SbkObjectType *Sbk_Param_TypeF(void) -{ - return _Sbk_Param_Type; -} - -static PyType_Slot Sbk_Param_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_Param_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_Param_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Param_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Param_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Param_spec = { - "1:NatronEngine.Param", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Param_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Param_PythonToCpp_Param_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Param_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Param_PythonToCpp_Param_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Param_TypeF()))) - return Param_PythonToCpp_Param_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Param_PTR_CppToPython_Param(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Param_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Param_SignatureStrings[] = { - "NatronEngine.Param._addAsDependencyOf(self,fromExprDimension:int,param:NatronEngine.Param,thisDimension:int)", - "NatronEngine.Param.copy(self,other:NatronEngine.Param,dimension:int=-1)->bool", - "NatronEngine.Param.curve(self,time:double,dimension:int=0)->double", - "NatronEngine.Param.getAddNewLine(self)->bool", - "NatronEngine.Param.getCanAnimate(self)->bool", - "NatronEngine.Param.getEvaluateOnChange(self)->bool", - "NatronEngine.Param.getHelp(self)->QString", - "NatronEngine.Param.getIsAnimationEnabled(self)->bool", - "NatronEngine.Param.getIsEnabled(self,dimension:int=0)->bool", - "NatronEngine.Param.getIsPersistent(self)->bool", - "NatronEngine.Param.getIsVisible(self)->bool", - "NatronEngine.Param.getLabel(self)->QString", - "NatronEngine.Param.getNumDimensions(self)->int", - "NatronEngine.Param.getParent(self)->NatronEngine.Param", - "NatronEngine.Param.getScriptName(self)->QString", - "NatronEngine.Param.getTypeName(self)->QString", - "1:NatronEngine.Param.random(self,min:double=0.,max:double=1.)->double", - "0:NatronEngine.Param.random(self,min:double,max:double,time:double,seed:unsigned int=0)->double", - "1:NatronEngine.Param.randomInt(self,min:int,max:int)->int", - "0:NatronEngine.Param.randomInt(self,min:int,max:int,time:double,seed:unsigned int=0)->int", - "NatronEngine.Param.setAddNewLine(self,a:bool)", - "NatronEngine.Param.setAnimationEnabled(self,e:bool)", - "NatronEngine.Param.setAsAlias(self,other:NatronEngine.Param)->bool", - "NatronEngine.Param.setEnabled(self,enabled:bool,dimension:int=0)", - "NatronEngine.Param.setEnabledByDefault(self,enabled:bool=0)", - "NatronEngine.Param.setEvaluateOnChange(self,eval:bool)", - "NatronEngine.Param.setHelp(self,help:QString)", - "NatronEngine.Param.setIconFilePath(self,icon:QString)", - "NatronEngine.Param.setPersistent(self,persistent:bool)", - "NatronEngine.Param.setVisible(self,visible:bool)", - "NatronEngine.Param.setVisibleByDefault(self,visible:bool)", - "NatronEngine.Param.slaveTo(self,other:NatronEngine.Param,thisDimension:int,otherDimension:int)->bool", - "NatronEngine.Param.unslave(self,dimension:int)", - nullptr}; // Sentinel - -void init_Param(PyObject *module) -{ - _Sbk_Param_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Param", - "Param*", - &Sbk_Param_spec, - &Shiboken::callCppDestructor< ::Param >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Param_Type); - InitSignatureStrings(pyType, Param_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Param_Type), Sbk_Param_PropertyStrings); - SbkNatronEngineTypes[SBK_PARAM_IDX] - = reinterpret_cast(Sbk_Param_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Param_TypeF(), - Param_PythonToCpp_Param_PTR, - is_Param_PythonToCpp_Param_PTR_Convertible, - Param_PTR_CppToPython_Param); - - Shiboken::Conversions::registerConverterName(converter, "Param"); - Shiboken::Conversions::registerConverterName(converter, "Param*"); - Shiboken::Conversions::registerConverterName(converter, "Param&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Param).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::ParamWrapper).name()); - - - - ParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/param_wrapper.h b/Engine/Qt5/NatronEngine/param_wrapper.h deleted file mode 100644 index f8899c25fc..0000000000 --- a/Engine/Qt5/NatronEngine/param_wrapper.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SBK_PARAMWRAPPER_H -#define SBK_PARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_PARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/parametricparam_wrapper.cpp b/Engine/Qt5/NatronEngine/parametricparam_wrapper.cpp deleted file mode 100644 index 4fb7d339b8..0000000000 --- a/Engine/Qt5/NatronEngine/parametricparam_wrapper.cpp +++ /dev/null @@ -1,932 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "parametricparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void ParametricParamWrapper::pysideInitQtMetaTypes() -{ -} - -void ParametricParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -ParametricParamWrapper::~ParametricParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_ParametricParamFunc_addControlPoint(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 6) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ParametricParam.addControlPoint(): too many arguments"); - return {}; - } else if (numArgs < 3) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ParametricParam.addControlPoint(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OOOOOO:addControlPoint", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]), &(pyArgs[5]))) - return {}; - - - // Overloaded function decisor - // 0: ParametricParam::addControlPoint(int,double,double,NATRON_ENUM::KeyframeTypeEnum) - // 1: ParametricParam::addControlPoint(int,double,double,double,double,NATRON_ENUM::KeyframeTypeEnum) - if (numArgs >= 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // addControlPoint(int,double,double,NATRON_ENUM::KeyframeTypeEnum) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX])->converter, (pyArgs[3])))) { - overloadId = 0; // addControlPoint(int,double,double,NATRON_ENUM::KeyframeTypeEnum) - } else if (numArgs >= 5 - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3]))) - && (pythonToCpp[4] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[4])))) { - if (numArgs == 5) { - overloadId = 1; // addControlPoint(int,double,double,double,double,NATRON_ENUM::KeyframeTypeEnum) - } else if ((pythonToCpp[5] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX])->converter, (pyArgs[5])))) { - overloadId = 1; // addControlPoint(int,double,double,double,double,NATRON_ENUM::KeyframeTypeEnum) - } - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_addControlPoint_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // addControlPoint(int dimension, double key, double value, NATRON_ENUM::KeyframeTypeEnum interpolation) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","interpolation"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ParametricParam.addControlPoint(): got multiple values for keyword argument 'interpolation'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX])->converter, (pyArgs[3])))) - goto Sbk_ParametricParamFunc_addControlPoint_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - ::NATRON_ENUM::KeyframeTypeEnum cppArg3 = NATRON_ENUM::eKeyframeTypeSmooth; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // addControlPoint(int,double,double,NATRON_ENUM::KeyframeTypeEnum) - NATRON_ENUM::StatusEnum cppResult = NATRON_ENUM::StatusEnum(cppSelf->addControlPoint(cppArg0, cppArg1, cppArg2, cppArg3)); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])->converter, &cppResult); - } - break; - } - case 1: // addControlPoint(int dimension, double key, double value, double leftDerivative, double rightDerivative, NATRON_ENUM::KeyframeTypeEnum interpolation) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","interpolation"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[5]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.ParametricParam.addControlPoint(): got multiple values for keyword argument 'interpolation'."); - return {}; - } - if (value) { - pyArgs[5] = value; - if (!(pythonToCpp[5] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX])->converter, (pyArgs[5])))) - goto Sbk_ParametricParamFunc_addControlPoint_TypeError; - } - } - } - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - double cppArg4; - pythonToCpp[4](pyArgs[4], &cppArg4); - ::NATRON_ENUM::KeyframeTypeEnum cppArg5 = NATRON_ENUM::eKeyframeTypeSmooth; - if (pythonToCpp[5]) pythonToCpp[5](pyArgs[5], &cppArg5); - - if (!PyErr_Occurred()) { - // addControlPoint(int,double,double,double,double,NATRON_ENUM::KeyframeTypeEnum) - NATRON_ENUM::StatusEnum cppResult = NATRON_ENUM::StatusEnum(cppSelf->addControlPoint(cppArg0, cppArg1, cppArg2, cppArg3, cppArg4, cppArg5)); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])->converter, &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_addControlPoint_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ParametricParam.addControlPoint"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_deleteAllControlPoints(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ParametricParam::deleteAllControlPoints(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // deleteAllControlPoints(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_deleteAllControlPoints_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // deleteAllControlPoints(int) - NATRON_ENUM::StatusEnum cppResult = NATRON_ENUM::StatusEnum(cppSelf->deleteAllControlPoints(cppArg0)); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_deleteAllControlPoints_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ParametricParam.deleteAllControlPoints"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_deleteControlPoint(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "deleteControlPoint", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ParametricParam::deleteControlPoint(int,int) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // deleteControlPoint(int,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_deleteControlPoint_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // deleteControlPoint(int,int) - NATRON_ENUM::StatusEnum cppResult = NATRON_ENUM::StatusEnum(cppSelf->deleteControlPoint(cppArg0, cppArg1)); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_deleteControlPoint_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ParametricParam.deleteControlPoint"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_getCurveColor(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ParametricParam::getCurveColor(int,ColorTuple&)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getCurveColor(int,ColorTuple&)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_getCurveColor_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getCurveColor(int,ColorTuple&)const - // Begin code injection - ColorTuple t; - cppSelf->getCurveColor(cppArg0,t); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]), &t); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_getCurveColor_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ParametricParam.getCurveColor"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_getNControlPoints(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: ParametricParam::getNControlPoints(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getNControlPoints(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_getNControlPoints_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getNControlPoints(int)const - int cppResult = const_cast(cppSelf)->getNControlPoints(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_getNControlPoints_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.ParametricParam.getNControlPoints"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_getNthControlPoint(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "getNthControlPoint", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ParametricParam::getNthControlPoint(int,int,double*,double*,double*,double*)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getNthControlPoint(int,int,double*,double*,double*,double*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_getNthControlPoint_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getNthControlPoint(int,int,double*,double*,double*,double*)const - // Begin code injection - double key,value,left,right; - NATRON_ENUM::StatusEnum cppResult = cppSelf->getNthControlPoint(cppArg0, cppArg1,&key,&value, &left, &right); - pyResult = PyTuple_New(5); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])->converter, &cppResult)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &key)); - PyTuple_SET_ITEM(pyResult, 2, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &value)); - PyTuple_SET_ITEM(pyResult, 3, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &left)); - PyTuple_SET_ITEM(pyResult, 4, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &right)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_getNthControlPoint_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ParametricParam.getNthControlPoint"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_getValue(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "getValue", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: ParametricParam::getValue(int,double)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // getValue(int,double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_getValue_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getValue(int,double)const - double cppResult = const_cast(cppSelf)->getValue(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_getValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ParametricParam.getValue"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_setCurveColor(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setCurveColor", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: ParametricParam::setCurveColor(int,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // setCurveColor(int,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_setCurveColor_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // setCurveColor(int,double,double,double) - cppSelf->setCurveColor(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_ParametricParamFunc_setCurveColor_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ParametricParam.setCurveColor"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_setDefaultCurvesFromCurrentCurves(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // setDefaultCurvesFromCurrentCurves() - cppSelf->setDefaultCurvesFromCurrentCurves(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_ParametricParamFunc_setNthControlPoint(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setNthControlPoint", 6, 6, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]), &(pyArgs[5]))) - return {}; - - - // Overloaded function decisor - // 0: ParametricParam::setNthControlPoint(int,int,double,double,double,double) - if (numArgs == 6 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3]))) - && (pythonToCpp[4] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[4]))) - && (pythonToCpp[5] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[5])))) { - overloadId = 0; // setNthControlPoint(int,int,double,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_setNthControlPoint_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - double cppArg4; - pythonToCpp[4](pyArgs[4], &cppArg4); - double cppArg5; - pythonToCpp[5](pyArgs[5], &cppArg5); - - if (!PyErr_Occurred()) { - // setNthControlPoint(int,int,double,double,double,double) - NATRON_ENUM::StatusEnum cppResult = NATRON_ENUM::StatusEnum(cppSelf->setNthControlPoint(cppArg0, cppArg1, cppArg2, cppArg3, cppArg4, cppArg5)); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_setNthControlPoint_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ParametricParam.setNthControlPoint"); - return {}; -} - -static PyObject *Sbk_ParametricParamFunc_setNthControlPointInterpolation(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setNthControlPointInterpolation", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: ParametricParam::setNthControlPointInterpolation(int,int,NATRON_ENUM::KeyframeTypeEnum) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_KEYFRAMETYPEENUM_IDX])->converter, (pyArgs[2])))) { - overloadId = 0; // setNthControlPointInterpolation(int,int,NATRON_ENUM::KeyframeTypeEnum) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_ParametricParamFunc_setNthControlPointInterpolation_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - ::NATRON_ENUM::KeyframeTypeEnum cppArg2{NATRON_ENUM::eKeyframeTypeConstant}; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // setNthControlPointInterpolation(int,int,NATRON_ENUM::KeyframeTypeEnum) - NATRON_ENUM::StatusEnum cppResult = NATRON_ENUM::StatusEnum(cppSelf->setNthControlPointInterpolation(cppArg0, cppArg1, cppArg2)); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STATUSENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_ParametricParamFunc_setNthControlPointInterpolation_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.ParametricParam.setNthControlPointInterpolation"); - return {}; -} - - -static const char *Sbk_ParametricParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_ParametricParam_methods[] = { - {"addControlPoint", reinterpret_cast(Sbk_ParametricParamFunc_addControlPoint), METH_VARARGS|METH_KEYWORDS}, - {"deleteAllControlPoints", reinterpret_cast(Sbk_ParametricParamFunc_deleteAllControlPoints), METH_O}, - {"deleteControlPoint", reinterpret_cast(Sbk_ParametricParamFunc_deleteControlPoint), METH_VARARGS}, - {"getCurveColor", reinterpret_cast(Sbk_ParametricParamFunc_getCurveColor), METH_O}, - {"getNControlPoints", reinterpret_cast(Sbk_ParametricParamFunc_getNControlPoints), METH_O}, - {"getNthControlPoint", reinterpret_cast(Sbk_ParametricParamFunc_getNthControlPoint), METH_VARARGS}, - {"getValue", reinterpret_cast(Sbk_ParametricParamFunc_getValue), METH_VARARGS}, - {"setCurveColor", reinterpret_cast(Sbk_ParametricParamFunc_setCurveColor), METH_VARARGS}, - {"setDefaultCurvesFromCurrentCurves", reinterpret_cast(Sbk_ParametricParamFunc_setDefaultCurvesFromCurrentCurves), METH_NOARGS}, - {"setNthControlPoint", reinterpret_cast(Sbk_ParametricParamFunc_setNthControlPoint), METH_VARARGS}, - {"setNthControlPointInterpolation", reinterpret_cast(Sbk_ParametricParamFunc_setNthControlPointInterpolation), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_ParametricParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::ParametricParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_ParametricParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_ParametricParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_ParametricParam_Type = nullptr; -static SbkObjectType *Sbk_ParametricParam_TypeF(void) -{ - return _Sbk_ParametricParam_Type; -} - -static PyType_Slot Sbk_ParametricParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_ParametricParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_ParametricParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_ParametricParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_ParametricParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_ParametricParam_spec = { - "1:NatronEngine.ParametricParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_ParametricParam_slots -}; - -} //extern "C" - -static void *Sbk_ParametricParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::ParametricParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void ParametricParam_PythonToCpp_ParametricParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_ParametricParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_ParametricParam_PythonToCpp_ParametricParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_ParametricParam_TypeF()))) - return ParametricParam_PythonToCpp_ParametricParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *ParametricParam_PTR_CppToPython_ParametricParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_ParametricParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *ParametricParam_SignatureStrings[] = { - "1:NatronEngine.ParametricParam.addControlPoint(self,dimension:int,key:double,value:double,interpolation:NatronEngine.NATRON_ENUM.KeyframeTypeEnum=NATRON_ENUM.eKeyframeTypeSmooth)->NatronEngine.NATRON_ENUM.StatusEnum", - "0:NatronEngine.ParametricParam.addControlPoint(self,dimension:int,key:double,value:double,leftDerivative:double,rightDerivative:double,interpolation:NatronEngine.NATRON_ENUM.KeyframeTypeEnum=NATRON_ENUM.eKeyframeTypeSmooth)->NatronEngine.NATRON_ENUM.StatusEnum", - "NatronEngine.ParametricParam.deleteAllControlPoints(self,dimension:int)->NatronEngine.NATRON_ENUM.StatusEnum", - "NatronEngine.ParametricParam.deleteControlPoint(self,dimension:int,nthCtl:int)->NatronEngine.NATRON_ENUM.StatusEnum", - "NatronEngine.ParametricParam.getCurveColor(self,dimension:int,ret:NatronEngine.ColorTuple)", - "NatronEngine.ParametricParam.getNControlPoints(self,dimension:int)->int", - "NatronEngine.ParametricParam.getNthControlPoint(self,dimension:int,nthCtl:int,key:double*,value:double*,leftDerivative:double*,rightDerivative:double*)->NatronEngine.NATRON_ENUM.StatusEnum", - "NatronEngine.ParametricParam.getValue(self,dimension:int,parametricPosition:double)->double", - "NatronEngine.ParametricParam.setCurveColor(self,dimension:int,r:double,g:double,b:double)", - "NatronEngine.ParametricParam.setDefaultCurvesFromCurrentCurves(self)", - "NatronEngine.ParametricParam.setNthControlPoint(self,dimension:int,nthCtl:int,key:double,value:double,leftDerivative:double,rightDerivative:double)->NatronEngine.NATRON_ENUM.StatusEnum", - "NatronEngine.ParametricParam.setNthControlPointInterpolation(self,dimension:int,nThCtl:int,interpolation:NatronEngine.NATRON_ENUM.KeyframeTypeEnum)->NatronEngine.NATRON_ENUM.StatusEnum", - nullptr}; // Sentinel - -void init_ParametricParam(PyObject *module) -{ - _Sbk_ParametricParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "ParametricParam", - "ParametricParam*", - &Sbk_ParametricParam_spec, - &Shiboken::callCppDestructor< ::ParametricParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_ParametricParam_Type); - InitSignatureStrings(pyType, ParametricParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_ParametricParam_Type), Sbk_ParametricParam_PropertyStrings); - SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX] - = reinterpret_cast(Sbk_ParametricParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_ParametricParam_TypeF(), - ParametricParam_PythonToCpp_ParametricParam_PTR, - is_ParametricParam_PythonToCpp_ParametricParam_PTR_Convertible, - ParametricParam_PTR_CppToPython_ParametricParam); - - Shiboken::Conversions::registerConverterName(converter, "ParametricParam"); - Shiboken::Conversions::registerConverterName(converter, "ParametricParam*"); - Shiboken::Conversions::registerConverterName(converter, "ParametricParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::ParametricParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::ParametricParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_ParametricParam_TypeF(), &Sbk_ParametricParam_typeDiscovery); - - - ParametricParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/parametricparam_wrapper.h b/Engine/Qt5/NatronEngine/parametricparam_wrapper.h deleted file mode 100644 index 8fea5897e5..0000000000 --- a/Engine/Qt5/NatronEngine/parametricparam_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_PARAMETRICPARAMWRAPPER_H -#define SBK_PARAMETRICPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParametricParamWrapper : public ParametricParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { ParametricParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParametricParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_PARAMETRICPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/pathparam_wrapper.cpp b/Engine/Qt5/NatronEngine/pathparam_wrapper.cpp deleted file mode 100644 index e2efd4449d..0000000000 --- a/Engine/Qt5/NatronEngine/pathparam_wrapper.cpp +++ /dev/null @@ -1,404 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "pathparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void PathParamWrapper::pysideInitQtMetaTypes() -{ -} - -void PathParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -PathParamWrapper::~PathParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_PathParamFunc_getTable(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PathParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PATHPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getTable(std::list >*)const - // Begin code injection - std::list > table; - cppSelf->getTable(&table); - - std::size_t outListSize = table.size(); - PyObject* outList = PyList_New((int) outListSize); - - std::size_t i = 0; - for (std::list >::iterator it = table.begin(); it != table.end(); ++it, ++i) { - std::size_t subListSize = it->size(); - PyObject* subList = PyList_New((int) subListSize); - for (std::size_t j = 0; j < subListSize; ++j) { - std::string cppItem = (*it)[j]; - PyList_SET_ITEM(subList, j, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - PyList_SET_ITEM(outList, i, subList); - } - - return outList; - - // End of code injection - - pyResult = Py_None; - Py_INCREF(Py_None); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PathParamFunc_setAsMultiPathTable(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PathParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PATHPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // setAsMultiPathTable() - cppSelf->setAsMultiPathTable(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PathParamFunc_setTable(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PathParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PATHPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PathParam::setTable(std::list >) - if (Shiboken::String::checkIterable(pyArg)) { - overloadId = 0; // setTable(std::list >) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PathParamFunc_setTable_TypeError; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // setTable(std::list >) - // Begin code injection - - - if (!PyList_Check(pyArg)) { - PyErr_SetString(PyExc_TypeError, "table must be a list of list objects."); - return 0; - } - - std::list > table; - - int size = (int)PyList_GET_SIZE(pyArg); - for (int i = 0; i < size; ++i) { - - - PyObject* subList = PyList_GET_ITEM(pyArg,i); - if (!subList || !PyList_Check(subList)) { - PyErr_SetString(PyExc_TypeError, "table must be a list of list objects."); - return 0; - } - int subSize = (int)PyList_GET_SIZE(subList); - std::vector rowVec(subSize); - - for (int j = 0; j < subSize; ++j) { - PyObject* pyString = PyList_GET_ITEM(subList,j); -#if PY_MAJOR_VERSION < 3 - if ( PyString_Check(pyString) ) { - char* buf = PyString_AsString(pyString); - if (buf) { - std::string ret; - ret.append(buf); - rowVec[j] = ret; - } - } else if (PyUnicode_Check(pyString) ) { -#else - if (PyUnicode_Check(pyString) ) { -#endif - PyObject* utf8pyobj = PyUnicode_AsUTF8String(pyString); // newRef - if (utf8pyobj) { - char* cstr = PyBytes_AS_STRING(utf8pyobj); // Borrowed pointer - std::string ret; - ret.append(cstr); - Py_DECREF(utf8pyobj); - rowVec[j] = ret; - } - } - } - table.push_back(rowVec); - } - - cppSelf->setTable(table); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PathParamFunc_setTable_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PathParam.setTable"); - return {}; -} - - -static const char *Sbk_PathParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PathParam_methods[] = { - {"getTable", reinterpret_cast(Sbk_PathParamFunc_getTable), METH_NOARGS}, - {"setAsMultiPathTable", reinterpret_cast(Sbk_PathParamFunc_setAsMultiPathTable), METH_NOARGS}, - {"setTable", reinterpret_cast(Sbk_PathParamFunc_setTable), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_PathParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::PathParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PATHPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_PathParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PathParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PathParam_Type = nullptr; -static SbkObjectType *Sbk_PathParam_TypeF(void) -{ - return _Sbk_PathParam_Type; -} - -static PyType_Slot Sbk_PathParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_PathParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_PathParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PathParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PathParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PathParam_spec = { - "1:NatronEngine.PathParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PathParam_slots -}; - -} //extern "C" - -static void *Sbk_PathParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::PathParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PathParam_PythonToCpp_PathParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PathParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PathParam_PythonToCpp_PathParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PathParam_TypeF()))) - return PathParam_PythonToCpp_PathParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PathParam_PTR_CppToPython_PathParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PathParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PathParam_SignatureStrings[] = { - "NatronEngine.PathParam.getTable(self,table:std.list[std.vector[std.string]])", - "NatronEngine.PathParam.setAsMultiPathTable(self)", - "NatronEngine.PathParam.setTable(self,table:std.list[std.vector[std.string]])", - nullptr}; // Sentinel - -void init_PathParam(PyObject *module) -{ - _Sbk_PathParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PathParam", - "PathParam*", - &Sbk_PathParam_spec, - &Shiboken::callCppDestructor< ::PathParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PathParam_Type); - InitSignatureStrings(pyType, PathParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PathParam_Type), Sbk_PathParam_PropertyStrings); - SbkNatronEngineTypes[SBK_PATHPARAM_IDX] - = reinterpret_cast(Sbk_PathParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PathParam_TypeF(), - PathParam_PythonToCpp_PathParam_PTR, - is_PathParam_PythonToCpp_PathParam_PTR_Convertible, - PathParam_PTR_CppToPython_PathParam); - - Shiboken::Conversions::registerConverterName(converter, "PathParam"); - Shiboken::Conversions::registerConverterName(converter, "PathParam*"); - Shiboken::Conversions::registerConverterName(converter, "PathParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PathParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::PathParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_PathParam_TypeF(), &Sbk_PathParam_typeDiscovery); - - - PathParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/pathparam_wrapper.h b/Engine/Qt5/NatronEngine/pathparam_wrapper.h deleted file mode 100644 index a1d85138a1..0000000000 --- a/Engine/Qt5/NatronEngine/pathparam_wrapper.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef SBK_PATHPARAMWRAPPER_H -#define SBK_PATHPARAMWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class PathParamWrapper : public PathParam -{ -public: - ~PathParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_STRINGPARAMBASEWRAPPER_H -# define SBK_STRINGPARAMBASEWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class StringParamBaseWrapper : public StringParamBase -{ -public: - ~StringParamBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_STRINGPARAMBASEWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_PATHPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/pycoreapplication_wrapper.cpp b/Engine/Qt5/NatronEngine/pycoreapplication_wrapper.cpp deleted file mode 100644 index 2c62c77120..0000000000 --- a/Engine/Qt5/NatronEngine/pycoreapplication_wrapper.cpp +++ /dev/null @@ -1,1010 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "pycoreapplication_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void PyCoreApplicationWrapper::pysideInitQtMetaTypes() -{ -} - -void PyCoreApplicationWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -PyCoreApplicationWrapper::PyCoreApplicationWrapper() : PyCoreApplication() -{ - resetPyMethodCache(); - // ... middle -} - -PyCoreApplicationWrapper::~PyCoreApplicationWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_PyCoreApplication_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::PyCoreApplication >())) - return -1; - - ::PyCoreApplicationWrapper *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // PyCoreApplication() - cptr = new ::PyCoreApplicationWrapper(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::PyCoreApplication >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - -static PyObject *Sbk_PyCoreApplicationFunc_appendToNatronPath(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyCoreApplication::appendToNatronPath(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // appendToNatronPath(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyCoreApplicationFunc_appendToNatronPath_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // appendToNatronPath(QString) - cppSelf->appendToNatronPath(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyCoreApplicationFunc_appendToNatronPath_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PyCoreApplication.appendToNatronPath"); - return {}; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getActiveInstance(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getActiveInstance()const - App * cppResult = const_cast(cppSelf)->getActiveInstance(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_APP_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getBuildNumber(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getBuildNumber()const - int cppResult = const_cast(cppSelf)->getBuildNumber(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getInstance(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyCoreApplication::getInstance(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getInstance(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyCoreApplicationFunc_getInstance_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getInstance(int)const - App * cppResult = const_cast(cppSelf)->getInstance(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_APP_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyCoreApplicationFunc_getInstance_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PyCoreApplication.getInstance"); - return {}; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNatronDevelopmentStatus(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNatronDevelopmentStatus()const - QString cppResult = const_cast(cppSelf)->getNatronDevelopmentStatus(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNatronPath(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNatronPath()const - QStringList cppResult = const_cast(cppSelf)->getNatronPath(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNatronVersionEncoded(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNatronVersionEncoded()const - int cppResult = const_cast(cppSelf)->getNatronVersionEncoded(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNatronVersionMajor(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNatronVersionMajor()const - int cppResult = const_cast(cppSelf)->getNatronVersionMajor(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNatronVersionMinor(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNatronVersionMinor()const - int cppResult = const_cast(cppSelf)->getNatronVersionMinor(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNatronVersionRevision(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNatronVersionRevision()const - int cppResult = const_cast(cppSelf)->getNatronVersionRevision(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNatronVersionString(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNatronVersionString()const - QString cppResult = const_cast(cppSelf)->getNatronVersionString(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNumCpus(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNumCpus()const - int cppResult = const_cast(cppSelf)->getNumCpus(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getNumInstances(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getNumInstances()const - int cppResult = const_cast(cppSelf)->getNumInstances(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getPluginIDs(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "getPluginIDs", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: PyCoreApplication::getPluginIDs()const - // 1: PyCoreApplication::getPluginIDs(QString)const - if (numArgs == 0) { - overloadId = 0; // getPluginIDs()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { - overloadId = 1; // getPluginIDs(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyCoreApplicationFunc_getPluginIDs_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // getPluginIDs() const - { - - if (!PyErr_Occurred()) { - // getPluginIDs()const - QStringList cppResult = const_cast(cppSelf)->getPluginIDs(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); - } - break; - } - case 1: // getPluginIDs(const QString & filter) const - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getPluginIDs(QString)const - QStringList cppResult = const_cast(cppSelf)->getPluginIDs(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyCoreApplicationFunc_getPluginIDs_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.PyCoreApplication.getPluginIDs"); - return {}; -} - -static PyObject *Sbk_PyCoreApplicationFunc_getSettings(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getSettings()const - AppSettings * cppResult = const_cast(cppSelf)->getSettings(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_APPSETTINGS_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_is64Bit(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // is64Bit()const - bool cppResult = const_cast(cppSelf)->is64Bit(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_isBackground(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isBackground()const - bool cppResult = const_cast(cppSelf)->isBackground(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_isLinux(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isLinux()const - bool cppResult = const_cast(cppSelf)->isLinux(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_isMacOSX(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isMacOSX()const - bool cppResult = const_cast(cppSelf)->isMacOSX(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_isUnix(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isUnix()const - bool cppResult = const_cast(cppSelf)->isUnix(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_isWindows(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isWindows()const - bool cppResult = const_cast(cppSelf)->isWindows(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyCoreApplication::setOnProjectCreatedCallback(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setOnProjectCreatedCallback(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setOnProjectCreatedCallback(QString) - cppSelf->setOnProjectCreatedCallback(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PyCoreApplication.setOnProjectCreatedCallback"); - return {}; -} - -static PyObject *Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyCoreApplication::setOnProjectLoadedCallback(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setOnProjectLoadedCallback(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setOnProjectLoadedCallback(QString) - cppSelf->setOnProjectLoadedCallback(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.PyCoreApplication.setOnProjectLoadedCallback"); - return {}; -} - - -static const char *Sbk_PyCoreApplication_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PyCoreApplication_methods[] = { - {"appendToNatronPath", reinterpret_cast(Sbk_PyCoreApplicationFunc_appendToNatronPath), METH_O}, - {"getActiveInstance", reinterpret_cast(Sbk_PyCoreApplicationFunc_getActiveInstance), METH_NOARGS}, - {"getBuildNumber", reinterpret_cast(Sbk_PyCoreApplicationFunc_getBuildNumber), METH_NOARGS}, - {"getInstance", reinterpret_cast(Sbk_PyCoreApplicationFunc_getInstance), METH_O}, - {"getNatronDevelopmentStatus", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNatronDevelopmentStatus), METH_NOARGS}, - {"getNatronPath", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNatronPath), METH_NOARGS}, - {"getNatronVersionEncoded", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNatronVersionEncoded), METH_NOARGS}, - {"getNatronVersionMajor", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNatronVersionMajor), METH_NOARGS}, - {"getNatronVersionMinor", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNatronVersionMinor), METH_NOARGS}, - {"getNatronVersionRevision", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNatronVersionRevision), METH_NOARGS}, - {"getNatronVersionString", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNatronVersionString), METH_NOARGS}, - {"getNumCpus", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNumCpus), METH_NOARGS}, - {"getNumInstances", reinterpret_cast(Sbk_PyCoreApplicationFunc_getNumInstances), METH_NOARGS}, - {"getPluginIDs", reinterpret_cast(Sbk_PyCoreApplicationFunc_getPluginIDs), METH_VARARGS}, - {"getSettings", reinterpret_cast(Sbk_PyCoreApplicationFunc_getSettings), METH_NOARGS}, - {"is64Bit", reinterpret_cast(Sbk_PyCoreApplicationFunc_is64Bit), METH_NOARGS}, - {"isBackground", reinterpret_cast(Sbk_PyCoreApplicationFunc_isBackground), METH_NOARGS}, - {"isLinux", reinterpret_cast(Sbk_PyCoreApplicationFunc_isLinux), METH_NOARGS}, - {"isMacOSX", reinterpret_cast(Sbk_PyCoreApplicationFunc_isMacOSX), METH_NOARGS}, - {"isUnix", reinterpret_cast(Sbk_PyCoreApplicationFunc_isUnix), METH_NOARGS}, - {"isWindows", reinterpret_cast(Sbk_PyCoreApplicationFunc_isWindows), METH_NOARGS}, - {"setOnProjectCreatedCallback", reinterpret_cast(Sbk_PyCoreApplicationFunc_setOnProjectCreatedCallback), METH_O}, - {"setOnProjectLoadedCallback", reinterpret_cast(Sbk_PyCoreApplicationFunc_setOnProjectLoadedCallback), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_PyCoreApplication_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::PyCoreApplication *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_PyCoreApplication_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PyCoreApplication_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PyCoreApplication_Type = nullptr; -static SbkObjectType *Sbk_PyCoreApplication_TypeF(void) -{ - return _Sbk_PyCoreApplication_Type; -} - -static PyType_Slot Sbk_PyCoreApplication_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_PyCoreApplication_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_PyCoreApplication_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PyCoreApplication_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PyCoreApplication_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_PyCoreApplication_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PyCoreApplication_spec = { - "1:NatronEngine.PyCoreApplication", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PyCoreApplication_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PyCoreApplication_PythonToCpp_PyCoreApplication_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PyCoreApplication_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PyCoreApplication_PythonToCpp_PyCoreApplication_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PyCoreApplication_TypeF()))) - return PyCoreApplication_PythonToCpp_PyCoreApplication_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PyCoreApplication_PTR_CppToPython_PyCoreApplication(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PyCoreApplication_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PyCoreApplication_SignatureStrings[] = { - "NatronEngine.PyCoreApplication(self)", - "NatronEngine.PyCoreApplication.appendToNatronPath(self,path:QString)", - "NatronEngine.PyCoreApplication.getActiveInstance(self)->NatronEngine.App", - "NatronEngine.PyCoreApplication.getBuildNumber(self)->int", - "NatronEngine.PyCoreApplication.getInstance(self,idx:int)->NatronEngine.App", - "NatronEngine.PyCoreApplication.getNatronDevelopmentStatus(self)->QString", - "NatronEngine.PyCoreApplication.getNatronPath(self)->QStringList", - "NatronEngine.PyCoreApplication.getNatronVersionEncoded(self)->int", - "NatronEngine.PyCoreApplication.getNatronVersionMajor(self)->int", - "NatronEngine.PyCoreApplication.getNatronVersionMinor(self)->int", - "NatronEngine.PyCoreApplication.getNatronVersionRevision(self)->int", - "NatronEngine.PyCoreApplication.getNatronVersionString(self)->QString", - "NatronEngine.PyCoreApplication.getNumCpus(self)->int", - "NatronEngine.PyCoreApplication.getNumInstances(self)->int", - "1:NatronEngine.PyCoreApplication.getPluginIDs(self)->QStringList", - "0:NatronEngine.PyCoreApplication.getPluginIDs(self,filter:QString)->QStringList", - "NatronEngine.PyCoreApplication.getSettings(self)->NatronEngine.AppSettings", - "NatronEngine.PyCoreApplication.is64Bit(self)->bool", - "NatronEngine.PyCoreApplication.isBackground(self)->bool", - "NatronEngine.PyCoreApplication.isLinux(self)->bool", - "NatronEngine.PyCoreApplication.isMacOSX(self)->bool", - "NatronEngine.PyCoreApplication.isUnix(self)->bool", - "NatronEngine.PyCoreApplication.isWindows(self)->bool", - "NatronEngine.PyCoreApplication.setOnProjectCreatedCallback(self,pythonFunctionName:QString)", - "NatronEngine.PyCoreApplication.setOnProjectLoadedCallback(self,pythonFunctionName:QString)", - nullptr}; // Sentinel - -void init_PyCoreApplication(PyObject *module) -{ - _Sbk_PyCoreApplication_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PyCoreApplication", - "PyCoreApplication*", - &Sbk_PyCoreApplication_spec, - &Shiboken::callCppDestructor< ::PyCoreApplication >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PyCoreApplication_Type); - InitSignatureStrings(pyType, PyCoreApplication_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PyCoreApplication_Type), Sbk_PyCoreApplication_PropertyStrings); - SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX] - = reinterpret_cast(Sbk_PyCoreApplication_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PyCoreApplication_TypeF(), - PyCoreApplication_PythonToCpp_PyCoreApplication_PTR, - is_PyCoreApplication_PythonToCpp_PyCoreApplication_PTR_Convertible, - PyCoreApplication_PTR_CppToPython_PyCoreApplication); - - Shiboken::Conversions::registerConverterName(converter, "PyCoreApplication"); - Shiboken::Conversions::registerConverterName(converter, "PyCoreApplication*"); - Shiboken::Conversions::registerConverterName(converter, "PyCoreApplication&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyCoreApplication).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyCoreApplicationWrapper).name()); - - - - PyCoreApplicationWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/pycoreapplication_wrapper.h b/Engine/Qt5/NatronEngine/pycoreapplication_wrapper.h deleted file mode 100644 index f11f7cf8e0..0000000000 --- a/Engine/Qt5/NatronEngine/pycoreapplication_wrapper.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SBK_PYCOREAPPLICATIONWRAPPER_H -#define SBK_PYCOREAPPLICATIONWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class PyCoreApplicationWrapper : public PyCoreApplication -{ -public: - PyCoreApplicationWrapper(); - ~PyCoreApplicationWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_PYCOREAPPLICATIONWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/rectd_wrapper.cpp b/Engine/Qt5/NatronEngine/rectd_wrapper.cpp deleted file mode 100644 index b606fe0d75..0000000000 --- a/Engine/Qt5/NatronEngine/rectd_wrapper.cpp +++ /dev/null @@ -1,1517 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "rectd_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void RectDWrapper::pysideInitQtMetaTypes() -{ -} - -void RectDWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -RectDWrapper::RectDWrapper() : RectD() -{ - resetPyMethodCache(); - // ... middle -} - -RectDWrapper::RectDWrapper(double l, double b, double r, double t) : RectD(l, b, r, t) -{ - resetPyMethodCache(); - // ... middle -} - -RectDWrapper::~RectDWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_RectD_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::RectD >())) - return -1; - - ::RectDWrapper *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectD_Init_TypeError; - - if (!PyArg_UnpackTuple(args, "RectD", 0, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return -1; - - - // Overloaded function decisor - // 0: RectD::RectD() - // 1: RectD::RectD(RectD) - // 2: RectD::RectD(double,double,double,double) - if (numArgs == 0) { - overloadId = 0; // RectD() - } else if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 2; // RectD(double,double,double,double) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArgs[0])))) { - overloadId = 1; // RectD(RectD) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectD_Init_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // RectD() - { - - if (!PyErr_Occurred()) { - // RectD() - cptr = new ::RectDWrapper(); - } - break; - } - case 1: // RectD(const RectD & b) - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return -1; - ::RectD *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // RectD(RectD) - cptr = new ::RectDWrapper(*cppArg0); - } - break; - } - case 2: // RectD(double l, double b, double r, double t) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // RectD(double,double,double,double) - cptr = new ::RectDWrapper(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::RectD >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_RectD_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_RectD_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectD"); - return -1; -} - -static PyObject *Sbk_RectDFunc_area(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // area()const - double cppResult = const_cast(cppSelf)->area(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_bottom(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // bottom()const - double cppResult = const_cast(cppSelf)->bottom(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_clear(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // clear() - cppSelf->clear(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_RectDFunc_contains(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "contains", 1, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: RectD::contains(RectD)const - // 1: RectD::contains(double,double)const - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 1; // contains(double,double)const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArgs[0])))) { - overloadId = 0; // contains(RectD)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_contains_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // contains(const RectD & other) const - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectD *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // contains(RectD)const - bool cppResult = const_cast(cppSelf)->contains(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // contains(double x, double y) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // contains(double,double)const - bool cppResult = const_cast(cppSelf)->contains(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RectDFunc_contains_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectD.contains"); - return {}; -} - -static PyObject *Sbk_RectDFunc_height(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // height()const - double cppResult = const_cast(cppSelf)->height(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_intersect(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectDFunc_intersect_TypeError; - - if (!PyArg_UnpackTuple(args, "intersect", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectD::intersect(RectD,RectD*)const - // 1: RectD::intersect(double,double,double,double,RectD*)const - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // intersect(double,double,double,double,RectD*)const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArgs[0])))) { - overloadId = 0; // intersect(RectD,RectD*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_intersect_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // intersect(const RectD & r, RectD * intersection) const - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectD *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // intersect(RectD,RectD*)const - // Begin code injection - RectD t; - cppSelf->intersect(*cppArg0,&t); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), &t); - return pyResult; - - // End of code injection - - } - break; - } - case 1: // intersect(double l, double b, double r, double t, RectD * intersection) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // intersect(double,double,double,double,RectD*)const - // Begin code injection - RectD t; - cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3,&t); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), &t); - return pyResult; - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RectDFunc_intersect_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectD.intersect"); - return {}; -} - -static PyObject *Sbk_RectDFunc_intersects(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectDFunc_intersects_TypeError; - - if (!PyArg_UnpackTuple(args, "intersects", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectD::intersects(RectD)const - // 1: RectD::intersects(double,double,double,double)const - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // intersects(double,double,double,double)const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArgs[0])))) { - overloadId = 0; // intersects(RectD)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_intersects_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // intersects(const RectD & r) const - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectD *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // intersects(RectD)const - bool cppResult = const_cast(cppSelf)->intersects(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // intersects(double l, double b, double r, double t) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // intersects(double,double,double,double)const - bool cppResult = const_cast(cppSelf)->intersects(cppArg0, cppArg1, cppArg2, cppArg3); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RectDFunc_intersects_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectD.intersects"); - return {}; -} - -static PyObject *Sbk_RectDFunc_isInfinite(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isInfinite()const - bool cppResult = const_cast(cppSelf)->isInfinite(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_isNull(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isNull()const - bool cppResult = const_cast(cppSelf)->isNull(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_left(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // left()const - double cppResult = const_cast(cppSelf)->left(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_merge(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectDFunc_merge_TypeError; - - if (!PyArg_UnpackTuple(args, "merge", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectD::merge(RectD) - // 1: RectD::merge(double,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // merge(double,double,double,double) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArgs[0])))) { - overloadId = 0; // merge(RectD) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_merge_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // merge(const RectD & box) - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectD *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // merge(RectD) - cppSelf->merge(*cppArg0); - } - break; - } - case 1: // merge(double l, double b, double r, double t) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // merge(double,double,double,double) - cppSelf->merge(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectDFunc_merge_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectD.merge"); - return {}; -} - -static PyObject *Sbk_RectDFunc_right(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // right()const - double cppResult = const_cast(cppSelf)->right(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectDFunc_set_TypeError; - - if (!PyArg_UnpackTuple(args, "set", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectD::set(RectD) - // 1: RectD::set(double,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // set(double,double,double,double) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArgs[0])))) { - overloadId = 0; // set(RectD) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(const RectD & b) - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectD *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(RectD) - cppSelf->set(*cppArg0); - } - break; - } - case 1: // set(double l, double b, double r, double t) - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // set(double,double,double,double) - cppSelf->set(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectDFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectD.set"); - return {}; -} - -static PyObject *Sbk_RectDFunc_set_bottom(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectD::set_bottom(double) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_bottom(double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_set_bottom_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_bottom(double) - cppSelf->set_bottom(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectDFunc_set_bottom_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectD.set_bottom"); - return {}; -} - -static PyObject *Sbk_RectDFunc_set_left(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectD::set_left(double) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_left(double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_set_left_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_left(double) - cppSelf->set_left(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectDFunc_set_left_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectD.set_left"); - return {}; -} - -static PyObject *Sbk_RectDFunc_set_right(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectD::set_right(double) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_right(double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_set_right_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_right(double) - cppSelf->set_right(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectDFunc_set_right_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectD.set_right"); - return {}; -} - -static PyObject *Sbk_RectDFunc_set_top(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectD::set_top(double) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_top(double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_set_top_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_top(double) - cppSelf->set_top(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectDFunc_set_top_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectD.set_top"); - return {}; -} - -static PyObject *Sbk_RectDFunc_setupInfinity(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // setupInfinity() - cppSelf->setupInfinity(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_RectDFunc_top(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // top()const - double cppResult = const_cast(cppSelf)->top(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectDFunc_translate(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "translate", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: RectD::translate(int,int) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // translate(int,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectDFunc_translate_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // translate(int,int) - cppSelf->translate(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectDFunc_translate_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectD.translate"); - return {}; -} - -static PyObject *Sbk_RectDFunc_width(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // width()const - double cppResult = const_cast(cppSelf)->width(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - - -static const char *Sbk_RectD_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_RectD_methods[] = { - {"area", reinterpret_cast(Sbk_RectDFunc_area), METH_NOARGS}, - {"bottom", reinterpret_cast(Sbk_RectDFunc_bottom), METH_NOARGS}, - {"clear", reinterpret_cast(Sbk_RectDFunc_clear), METH_NOARGS}, - {"contains", reinterpret_cast(Sbk_RectDFunc_contains), METH_VARARGS}, - {"height", reinterpret_cast(Sbk_RectDFunc_height), METH_NOARGS}, - {"intersect", reinterpret_cast(Sbk_RectDFunc_intersect), METH_VARARGS}, - {"intersects", reinterpret_cast(Sbk_RectDFunc_intersects), METH_VARARGS}, - {"isInfinite", reinterpret_cast(Sbk_RectDFunc_isInfinite), METH_NOARGS}, - {"isNull", reinterpret_cast(Sbk_RectDFunc_isNull), METH_NOARGS}, - {"left", reinterpret_cast(Sbk_RectDFunc_left), METH_NOARGS}, - {"merge", reinterpret_cast(Sbk_RectDFunc_merge), METH_VARARGS}, - {"right", reinterpret_cast(Sbk_RectDFunc_right), METH_NOARGS}, - {"set", reinterpret_cast(Sbk_RectDFunc_set), METH_VARARGS}, - {"set_bottom", reinterpret_cast(Sbk_RectDFunc_set_bottom), METH_O}, - {"set_left", reinterpret_cast(Sbk_RectDFunc_set_left), METH_O}, - {"set_right", reinterpret_cast(Sbk_RectDFunc_set_right), METH_O}, - {"set_top", reinterpret_cast(Sbk_RectDFunc_set_top), METH_O}, - {"setupInfinity", reinterpret_cast(Sbk_RectDFunc_setupInfinity), METH_NOARGS}, - {"top", reinterpret_cast(Sbk_RectDFunc_top), METH_NOARGS}, - {"translate", reinterpret_cast(Sbk_RectDFunc_translate), METH_VARARGS}, - {"width", reinterpret_cast(Sbk_RectDFunc_width), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_RectD_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -static int Sbk_RectD___nb_bool(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return -1; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - return !cppSelf->isNull(); -} - -// Rich comparison -static PyObject * Sbk_RectD_richcompare(PyObject *self, PyObject *pyArg, int op) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto &cppSelf = *reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - PythonToCppFunc pythonToCpp; - SBK_UNUSED(pythonToCpp) - - switch (op) { - case Py_NE: - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArg)))) { - // operator!=(const RectD & b2) - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::RectD *cppArg0; - pythonToCpp(pyArg, &cppArg0); - bool cppResult = cppSelf !=(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } else { - pyResult = Py_True; - Py_INCREF(pyResult); - } - - break; - case Py_EQ: - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTD_IDX]), (pyArg)))) { - // operator==(const RectD & b2) - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::RectD *cppArg0; - pythonToCpp(pyArg, &cppArg0); - bool cppResult = cppSelf ==(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } else { - pyResult = Py_False; - Py_INCREF(pyResult); - } - - break; - default: - // PYSIDE-74: By default, we redirect to object's tp_richcompare (which is `==`, `!=`). - return FallbackRichCompare(self, pyArg, op); - goto Sbk_RectD_RichComparison_TypeError; - } - - if (pyResult && !PyErr_Occurred()) - return pyResult; - Sbk_RectD_RichComparison_TypeError: - PyErr_SetString(PyExc_NotImplementedError, "operator not implemented."); - return {}; - -} - -static PyObject *Sbk_RectD_get_x1(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->x1); - return pyOut; -} -static int Sbk_RectD_set_x1(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x1' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x1', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->x1; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_RectD_get_y1(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->y1); - return pyOut; -} -static int Sbk_RectD_set_y1(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y1' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y1', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->y1; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_RectD_get_x2(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->x2); - return pyOut; -} -static int Sbk_RectD_set_x2(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x2' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x2', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->x2; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -static PyObject *Sbk_RectD_get_y2(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppSelf->y2); - return pyOut; -} -static int Sbk_RectD_set_y2(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectD *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTD_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y2' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y2', 'double' or convertible type expected"); - return -1; - } - - double& cppOut_ptr = cppSelf->y2; - pythonToCpp(pyIn, &cppOut_ptr); - - return 0; -} - -// Getters and Setters for RectD -static PyGetSetDef Sbk_RectD_getsetlist[] = { - {const_cast("x1"), Sbk_RectD_get_x1, Sbk_RectD_set_x1}, - {const_cast("y1"), Sbk_RectD_get_y1, Sbk_RectD_set_y1}, - {const_cast("x2"), Sbk_RectD_get_x2, Sbk_RectD_set_x2}, - {const_cast("y2"), Sbk_RectD_get_y2, Sbk_RectD_set_y2}, - {nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_RectD_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_RectD_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_RectD_Type = nullptr; -static SbkObjectType *Sbk_RectD_TypeF(void) -{ - return _Sbk_RectD_Type; -} - -static PyType_Slot Sbk_RectD_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_RectD_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_RectD_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_RectD_clear)}, - {Py_tp_richcompare, reinterpret_cast(Sbk_RectD_richcompare)}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_RectD_methods)}, - {Py_tp_getset, reinterpret_cast(Sbk_RectD_getsetlist)}, - {Py_tp_init, reinterpret_cast(Sbk_RectD_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - // type supports number protocol -#ifdef IS_PY3K - {Py_nb_bool, (void *)Sbk_RectD___nb_bool}, -#else - {Py_nb_nonzero, (void *)Sbk_RectD___nb_bool}, -#endif - {0, nullptr} -}; -static PyType_Spec Sbk_RectD_spec = { - "1:NatronEngine.RectD", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_RectD_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void RectD_PythonToCpp_RectD_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_RectD_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_RectD_PythonToCpp_RectD_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_RectD_TypeF()))) - return RectD_PythonToCpp_RectD_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *RectD_PTR_CppToPython_RectD(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_RectD_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *RectD_SignatureStrings[] = { - "2:NatronEngine.RectD(self)", - "1:NatronEngine.RectD(self,b:NatronEngine.RectD)", - "0:NatronEngine.RectD(self,l:double,b:double,r:double,t:double)", - "NatronEngine.RectD.area(self)->double", - "NatronEngine.RectD.bottom(self)->double", - "NatronEngine.RectD.clear(self)", - "1:NatronEngine.RectD.contains(self,other:NatronEngine.RectD)->bool", - "0:NatronEngine.RectD.contains(self,x:double,y:double)->bool", - "NatronEngine.RectD.height(self)->double", - "1:NatronEngine.RectD.intersect(self,r:NatronEngine.RectD,intersection:NatronEngine.RectD)->bool", - "0:NatronEngine.RectD.intersect(self,l:double,b:double,r:double,t:double,intersection:NatronEngine.RectD)->bool", - "1:NatronEngine.RectD.intersects(self,r:NatronEngine.RectD)->bool", - "0:NatronEngine.RectD.intersects(self,l:double,b:double,r:double,t:double)->bool", - "NatronEngine.RectD.isInfinite(self)->bool", - "NatronEngine.RectD.isNull(self)->bool", - "NatronEngine.RectD.left(self)->double", - "1:NatronEngine.RectD.merge(self,box:NatronEngine.RectD)", - "0:NatronEngine.RectD.merge(self,l:double,b:double,r:double,t:double)", - "NatronEngine.RectD.right(self)->double", - "1:NatronEngine.RectD.set(self,b:NatronEngine.RectD)", - "0:NatronEngine.RectD.set(self,l:double,b:double,r:double,t:double)", - "NatronEngine.RectD.set_bottom(self,v:double)", - "NatronEngine.RectD.set_left(self,v:double)", - "NatronEngine.RectD.set_right(self,v:double)", - "NatronEngine.RectD.set_top(self,v:double)", - "NatronEngine.RectD.setupInfinity(self)", - "NatronEngine.RectD.top(self)->double", - "NatronEngine.RectD.translate(self,dx:int,dy:int)", - "NatronEngine.RectD.width(self)->double", - nullptr}; // Sentinel - -void init_RectD(PyObject *module) -{ - _Sbk_RectD_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "RectD", - "RectD*", - &Sbk_RectD_spec, - &Shiboken::callCppDestructor< ::RectD >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_RectD_Type); - InitSignatureStrings(pyType, RectD_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_RectD_Type), Sbk_RectD_PropertyStrings); - SbkNatronEngineTypes[SBK_RECTD_IDX] - = reinterpret_cast(Sbk_RectD_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_RectD_TypeF(), - RectD_PythonToCpp_RectD_PTR, - is_RectD_PythonToCpp_RectD_PTR_Convertible, - RectD_PTR_CppToPython_RectD); - - Shiboken::Conversions::registerConverterName(converter, "RectD"); - Shiboken::Conversions::registerConverterName(converter, "RectD*"); - Shiboken::Conversions::registerConverterName(converter, "RectD&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::RectD).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::RectDWrapper).name()); - - - - RectDWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/rectd_wrapper.h b/Engine/Qt5/NatronEngine/rectd_wrapper.h deleted file mode 100644 index b87eae77b7..0000000000 --- a/Engine/Qt5/NatronEngine/rectd_wrapper.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef SBK_RECTDWRAPPER_H -#define SBK_RECTDWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class RectDWrapper : public RectD -{ -public: - RectDWrapper(); - RectDWrapper(const RectD& self) : RectD(self) - { - } - - RectDWrapper(double l, double b, double r, double t); - ~RectDWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_RECTDWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/recti_wrapper.cpp b/Engine/Qt5/NatronEngine/recti_wrapper.cpp deleted file mode 100644 index c00025587c..0000000000 --- a/Engine/Qt5/NatronEngine/recti_wrapper.cpp +++ /dev/null @@ -1,1494 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "recti_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void RectIWrapper::pysideInitQtMetaTypes() -{ -} - -void RectIWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -RectIWrapper::RectIWrapper() : RectI() -{ - resetPyMethodCache(); - // ... middle -} - -RectIWrapper::RectIWrapper(int x1_, int y1_, int x2_, int y2_) : RectI(x1_, y1_, x2_, y2_) -{ - resetPyMethodCache(); - // ... middle -} - -RectIWrapper::~RectIWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_RectI_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::RectI >())) - return -1; - - ::RectIWrapper *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectI_Init_TypeError; - - if (!PyArg_UnpackTuple(args, "RectI", 0, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return -1; - - - // Overloaded function decisor - // 0: RectI::RectI() - // 1: RectI::RectI(RectI) - // 2: RectI::RectI(int,int,int,int) - if (numArgs == 0) { - overloadId = 0; // RectI() - } else if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 2; // RectI(int,int,int,int) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArgs[0])))) { - overloadId = 1; // RectI(RectI) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectI_Init_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // RectI() - { - - if (!PyErr_Occurred()) { - // RectI() - cptr = new ::RectIWrapper(); - } - break; - } - case 1: // RectI(const RectI & b) - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return -1; - ::RectI *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // RectI(RectI) - cptr = new ::RectIWrapper(*cppArg0); - } - break; - } - case 2: // RectI(int x1_, int y1_, int x2_, int y2_) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - int cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // RectI(int,int,int,int) - cptr = new ::RectIWrapper(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::RectI >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_RectI_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_RectI_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectI"); - return -1; -} - -static PyObject *Sbk_RectIFunc_bottom(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // bottom()const - int cppResult = const_cast(cppSelf)->bottom(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectIFunc_clear(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // clear() - cppSelf->clear(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_RectIFunc_contains(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "contains", 1, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: RectI::contains(RectI)const - // 1: RectI::contains(double,double)const - // 2: RectI::contains(int,int)const - if (numArgs == 2 - && PyFloat_Check(pyArgs[0]) && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 1; // contains(double,double)const - } else if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 2; // contains(int,int)const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArgs[0])))) { - overloadId = 0; // contains(RectI)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_contains_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // contains(const RectI & other) const - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectI *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // contains(RectI)const - bool cppResult = const_cast(cppSelf)->contains(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // contains(double x, double y) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // contains(double,double)const - bool cppResult = const_cast(cppSelf)->contains(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 2: // contains(int x, int y) const - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // contains(int,int)const - bool cppResult = const_cast(cppSelf)->contains(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RectIFunc_contains_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectI.contains"); - return {}; -} - -static PyObject *Sbk_RectIFunc_height(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // height()const - int cppResult = const_cast(cppSelf)->height(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectIFunc_intersect(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectIFunc_intersect_TypeError; - - if (!PyArg_UnpackTuple(args, "intersect", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectI::intersect(RectI,RectI*)const - // 1: RectI::intersect(int,int,int,int,RectI*)const - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // intersect(int,int,int,int,RectI*)const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArgs[0])))) { - overloadId = 0; // intersect(RectI,RectI*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_intersect_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // intersect(const RectI & r, RectI * intersection) const - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectI *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // intersect(RectI,RectI*)const - // Begin code injection - RectI t; - cppSelf->intersect(*cppArg0,&t); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), &t); - return pyResult; - - // End of code injection - - } - break; - } - case 1: // intersect(int x1_, int y1_, int x2_, int y2_, RectI * intersection) const - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - int cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // intersect(int,int,int,int,RectI*)const - // Begin code injection - RectI t; - cppSelf->intersect(cppArg0,cppArg1,cppArg2,cppArg3,&t); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), &t); - return pyResult; - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RectIFunc_intersect_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectI.intersect"); - return {}; -} - -static PyObject *Sbk_RectIFunc_intersects(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectIFunc_intersects_TypeError; - - if (!PyArg_UnpackTuple(args, "intersects", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectI::intersects(RectI)const - // 1: RectI::intersects(int,int,int,int)const - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // intersects(int,int,int,int)const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArgs[0])))) { - overloadId = 0; // intersects(RectI)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_intersects_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // intersects(const RectI & r) const - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectI *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // intersects(RectI)const - bool cppResult = const_cast(cppSelf)->intersects(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - case 1: // intersects(int x1_, int y1_, int x2_, int y2_) const - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - int cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // intersects(int,int,int,int)const - bool cppResult = const_cast(cppSelf)->intersects(cppArg0, cppArg1, cppArg2, cppArg3); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RectIFunc_intersects_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectI.intersects"); - return {}; -} - -static PyObject *Sbk_RectIFunc_isInfinite(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isInfinite()const - bool cppResult = const_cast(cppSelf)->isInfinite(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectIFunc_isNull(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isNull()const - bool cppResult = const_cast(cppSelf)->isNull(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectIFunc_left(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // left()const - int cppResult = const_cast(cppSelf)->left(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectIFunc_merge(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectIFunc_merge_TypeError; - - if (!PyArg_UnpackTuple(args, "merge", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectI::merge(RectI) - // 1: RectI::merge(int,int,int,int) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // merge(int,int,int,int) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArgs[0])))) { - overloadId = 0; // merge(RectI) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_merge_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // merge(const RectI & box) - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectI *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // merge(RectI) - cppSelf->merge(*cppArg0); - } - break; - } - case 1: // merge(int x1_, int y1_, int x2_, int y2_) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - int cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // merge(int,int,int,int) - cppSelf->merge(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectIFunc_merge_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectI.merge"); - return {}; -} - -static PyObject *Sbk_RectIFunc_right(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // right()const - int cppResult = const_cast(cppSelf)->right(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectIFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 2 || numArgs == 3) - goto Sbk_RectIFunc_set_TypeError; - - if (!PyArg_UnpackTuple(args, "set", 1, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: RectI::set(RectI) - // 1: RectI::set(int,int,int,int) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 1; // set(int,int,int,int) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArgs[0])))) { - overloadId = 0; // set(RectI) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(const RectI & b) - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::RectI *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(RectI) - cppSelf->set(*cppArg0); - } - break; - } - case 1: // set(int x1_, int y1_, int x2_, int y2_) - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - int cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // set(int,int,int,int) - cppSelf->set(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectIFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectI.set"); - return {}; -} - -static PyObject *Sbk_RectIFunc_set_bottom(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectI::set_bottom(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_bottom(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_set_bottom_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_bottom(int) - cppSelf->set_bottom(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectIFunc_set_bottom_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectI.set_bottom"); - return {}; -} - -static PyObject *Sbk_RectIFunc_set_left(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectI::set_left(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_left(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_set_left_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_left(int) - cppSelf->set_left(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectIFunc_set_left_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectI.set_left"); - return {}; -} - -static PyObject *Sbk_RectIFunc_set_right(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectI::set_right(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_right(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_set_right_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_right(int) - cppSelf->set_right(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectIFunc_set_right_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectI.set_right"); - return {}; -} - -static PyObject *Sbk_RectIFunc_set_top(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: RectI::set_top(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // set_top(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_set_top_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // set_top(int) - cppSelf->set_top(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectIFunc_set_top_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.RectI.set_top"); - return {}; -} - -static PyObject *Sbk_RectIFunc_top(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // top()const - int cppResult = const_cast(cppSelf)->top(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RectIFunc_translate(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "translate", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: RectI::translate(int,int) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // translate(int,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RectIFunc_translate_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // translate(int,int) - cppSelf->translate(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_RectIFunc_translate_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.RectI.translate"); - return {}; -} - -static PyObject *Sbk_RectIFunc_width(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // width()const - int cppResult = const_cast(cppSelf)->width(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - - -static const char *Sbk_RectI_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_RectI_methods[] = { - {"bottom", reinterpret_cast(Sbk_RectIFunc_bottom), METH_NOARGS}, - {"clear", reinterpret_cast(Sbk_RectIFunc_clear), METH_NOARGS}, - {"contains", reinterpret_cast(Sbk_RectIFunc_contains), METH_VARARGS}, - {"height", reinterpret_cast(Sbk_RectIFunc_height), METH_NOARGS}, - {"intersect", reinterpret_cast(Sbk_RectIFunc_intersect), METH_VARARGS}, - {"intersects", reinterpret_cast(Sbk_RectIFunc_intersects), METH_VARARGS}, - {"isInfinite", reinterpret_cast(Sbk_RectIFunc_isInfinite), METH_NOARGS}, - {"isNull", reinterpret_cast(Sbk_RectIFunc_isNull), METH_NOARGS}, - {"left", reinterpret_cast(Sbk_RectIFunc_left), METH_NOARGS}, - {"merge", reinterpret_cast(Sbk_RectIFunc_merge), METH_VARARGS}, - {"right", reinterpret_cast(Sbk_RectIFunc_right), METH_NOARGS}, - {"set", reinterpret_cast(Sbk_RectIFunc_set), METH_VARARGS}, - {"set_bottom", reinterpret_cast(Sbk_RectIFunc_set_bottom), METH_O}, - {"set_left", reinterpret_cast(Sbk_RectIFunc_set_left), METH_O}, - {"set_right", reinterpret_cast(Sbk_RectIFunc_set_right), METH_O}, - {"set_top", reinterpret_cast(Sbk_RectIFunc_set_top), METH_O}, - {"top", reinterpret_cast(Sbk_RectIFunc_top), METH_NOARGS}, - {"translate", reinterpret_cast(Sbk_RectIFunc_translate), METH_VARARGS}, - {"width", reinterpret_cast(Sbk_RectIFunc_width), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_RectI_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -static int Sbk_RectI___nb_bool(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return -1; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - return !cppSelf->isNull(); -} - -// Rich comparison -static PyObject * Sbk_RectI_richcompare(PyObject *self, PyObject *pyArg, int op) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto &cppSelf = *reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - PythonToCppFunc pythonToCpp; - SBK_UNUSED(pythonToCpp) - - switch (op) { - case Py_NE: - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArg)))) { - // operator!=(const RectI & b2) - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::RectI *cppArg0; - pythonToCpp(pyArg, &cppArg0); - bool cppResult = cppSelf !=(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } else { - pyResult = Py_True; - Py_INCREF(pyResult); - } - - break; - case Py_EQ: - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppReferenceConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_RECTI_IDX]), (pyArg)))) { - // operator==(const RectI & b2) - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::RectI *cppArg0; - pythonToCpp(pyArg, &cppArg0); - bool cppResult = cppSelf ==(*cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } else { - pyResult = Py_False; - Py_INCREF(pyResult); - } - - break; - default: - // PYSIDE-74: By default, we redirect to object's tp_richcompare (which is `==`, `!=`). - return FallbackRichCompare(self, pyArg, op); - goto Sbk_RectI_RichComparison_TypeError; - } - - if (pyResult && !PyErr_Occurred()) - return pyResult; - Sbk_RectI_RichComparison_TypeError: - PyErr_SetString(PyExc_NotImplementedError, "operator not implemented."); - return {}; - -} - -static PyObject *Sbk_RectI_get_x1(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->x1; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_RectI_set_x1(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x1' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x1', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->x1; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->x1 = cppOut_local; - - return 0; -} - -static PyObject *Sbk_RectI_get_y1(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->y1; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_RectI_set_y1(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y1' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y1', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->y1; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->y1 = cppOut_local; - - return 0; -} - -static PyObject *Sbk_RectI_get_x2(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->x2; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_RectI_set_x2(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'x2' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'x2', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->x2; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->x2 = cppOut_local; - - return 0; -} - -static PyObject *Sbk_RectI_get_y2(PyObject *self, void *) -{ - if (!Shiboken::Object::isValid(self)) - return nullptr; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int cppOut_local = cppSelf->y2; - PyObject *pyOut = {}; - pyOut = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppOut_local); - return pyOut; -} -static int Sbk_RectI_set_y2(PyObject *self, PyObject *pyIn, void *) -{ - if (!Shiboken::Object::isValid(self)) - return 0; - auto cppSelf = reinterpret_cast< ::RectI *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_RECTI_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - if (pyIn == nullptr) { - PyErr_SetString(PyExc_TypeError, "'y2' may not be deleted"); - return -1; - } - PythonToCppFunc pythonToCpp{nullptr}; - if (!(pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyIn)))) { - PyErr_SetString(PyExc_TypeError, "wrong type attributed to 'y2', 'int' or convertible type expected"); - return -1; - } - - int cppOut_local = cppSelf->y2; - pythonToCpp(pyIn, &cppOut_local); - cppSelf->y2 = cppOut_local; - - return 0; -} - -// Getters and Setters for RectI -static PyGetSetDef Sbk_RectI_getsetlist[] = { - {const_cast("x1"), Sbk_RectI_get_x1, Sbk_RectI_set_x1}, - {const_cast("y1"), Sbk_RectI_get_y1, Sbk_RectI_set_y1}, - {const_cast("x2"), Sbk_RectI_get_x2, Sbk_RectI_set_x2}, - {const_cast("y2"), Sbk_RectI_get_y2, Sbk_RectI_set_y2}, - {nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_RectI_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_RectI_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_RectI_Type = nullptr; -static SbkObjectType *Sbk_RectI_TypeF(void) -{ - return _Sbk_RectI_Type; -} - -static PyType_Slot Sbk_RectI_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_RectI_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_RectI_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_RectI_clear)}, - {Py_tp_richcompare, reinterpret_cast(Sbk_RectI_richcompare)}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_RectI_methods)}, - {Py_tp_getset, reinterpret_cast(Sbk_RectI_getsetlist)}, - {Py_tp_init, reinterpret_cast(Sbk_RectI_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - // type supports number protocol -#ifdef IS_PY3K - {Py_nb_bool, (void *)Sbk_RectI___nb_bool}, -#else - {Py_nb_nonzero, (void *)Sbk_RectI___nb_bool}, -#endif - {0, nullptr} -}; -static PyType_Spec Sbk_RectI_spec = { - "1:NatronEngine.RectI", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_RectI_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void RectI_PythonToCpp_RectI_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_RectI_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_RectI_PythonToCpp_RectI_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_RectI_TypeF()))) - return RectI_PythonToCpp_RectI_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *RectI_PTR_CppToPython_RectI(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_RectI_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *RectI_SignatureStrings[] = { - "2:NatronEngine.RectI(self)", - "1:NatronEngine.RectI(self,b:NatronEngine.RectI)", - "0:NatronEngine.RectI(self,x1_:int,y1_:int,x2_:int,y2_:int)", - "NatronEngine.RectI.bottom(self)->int", - "NatronEngine.RectI.clear(self)", - "2:NatronEngine.RectI.contains(self,other:NatronEngine.RectI)->bool", - "1:NatronEngine.RectI.contains(self,x:double,y:double)->bool", - "0:NatronEngine.RectI.contains(self,x:int,y:int)->bool", - "NatronEngine.RectI.height(self)->int", - "1:NatronEngine.RectI.intersect(self,r:NatronEngine.RectI,intersection:NatronEngine.RectI)->bool", - "0:NatronEngine.RectI.intersect(self,x1_:int,y1_:int,x2_:int,y2_:int,intersection:NatronEngine.RectI)->bool", - "1:NatronEngine.RectI.intersects(self,r:NatronEngine.RectI)->bool", - "0:NatronEngine.RectI.intersects(self,x1_:int,y1_:int,x2_:int,y2_:int)->bool", - "NatronEngine.RectI.isInfinite(self)->bool", - "NatronEngine.RectI.isNull(self)->bool", - "NatronEngine.RectI.left(self)->int", - "1:NatronEngine.RectI.merge(self,box:NatronEngine.RectI)", - "0:NatronEngine.RectI.merge(self,x1_:int,y1_:int,x2_:int,y2_:int)", - "NatronEngine.RectI.right(self)->int", - "1:NatronEngine.RectI.set(self,b:NatronEngine.RectI)", - "0:NatronEngine.RectI.set(self,x1_:int,y1_:int,x2_:int,y2_:int)", - "NatronEngine.RectI.set_bottom(self,v:int)", - "NatronEngine.RectI.set_left(self,v:int)", - "NatronEngine.RectI.set_right(self,v:int)", - "NatronEngine.RectI.set_top(self,v:int)", - "NatronEngine.RectI.top(self)->int", - "NatronEngine.RectI.translate(self,dx:int,dy:int)", - "NatronEngine.RectI.width(self)->int", - nullptr}; // Sentinel - -void init_RectI(PyObject *module) -{ - _Sbk_RectI_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "RectI", - "RectI*", - &Sbk_RectI_spec, - &Shiboken::callCppDestructor< ::RectI >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_RectI_Type); - InitSignatureStrings(pyType, RectI_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_RectI_Type), Sbk_RectI_PropertyStrings); - SbkNatronEngineTypes[SBK_RECTI_IDX] - = reinterpret_cast(Sbk_RectI_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_RectI_TypeF(), - RectI_PythonToCpp_RectI_PTR, - is_RectI_PythonToCpp_RectI_PTR_Convertible, - RectI_PTR_CppToPython_RectI); - - Shiboken::Conversions::registerConverterName(converter, "RectI"); - Shiboken::Conversions::registerConverterName(converter, "RectI*"); - Shiboken::Conversions::registerConverterName(converter, "RectI&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::RectI).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::RectIWrapper).name()); - - - - RectIWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/recti_wrapper.h b/Engine/Qt5/NatronEngine/recti_wrapper.h deleted file mode 100644 index f9f3d1ca74..0000000000 --- a/Engine/Qt5/NatronEngine/recti_wrapper.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef SBK_RECTIWRAPPER_H -#define SBK_RECTIWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class RectIWrapper : public RectI -{ -public: - RectIWrapper(); - RectIWrapper(const RectI& self) : RectI(self) - { - } - - RectIWrapper(int x1_, int y1_, int x2_, int y2_); - ~RectIWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_RECTIWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/roto_wrapper.cpp b/Engine/Qt5/NatronEngine/roto_wrapper.cpp deleted file mode 100644 index 5622926f76..0000000000 --- a/Engine/Qt5/NatronEngine/roto_wrapper.cpp +++ /dev/null @@ -1,532 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "roto_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Extra includes -#include - - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_RotoFunc_createBezier(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Roto *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ROTO_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createBezier", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: Roto::createBezier(double,double,double) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // createBezier(double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RotoFunc_createBezier_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // createBezier(double,double,double) - // Begin code injection - BezierCurve * cppResult = cppSelf->createBezier(cppArg0,cppArg1,cppArg2); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RotoFunc_createBezier_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Roto.createBezier"); - return {}; -} - -static PyObject *Sbk_RotoFunc_createEllipse(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Roto *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ROTO_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createEllipse", 5, 5, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]), &(pyArgs[4]))) - return {}; - - - // Overloaded function decisor - // 0: Roto::createEllipse(double,double,double,bool,double) - if (numArgs == 5 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3]))) - && (pythonToCpp[4] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[4])))) { - overloadId = 0; // createEllipse(double,double,double,bool,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RotoFunc_createEllipse_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - bool cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - double cppArg4; - pythonToCpp[4](pyArgs[4], &cppArg4); - - if (!PyErr_Occurred()) { - // createEllipse(double,double,double,bool,double) - // Begin code injection - BezierCurve * cppResult = cppSelf->createEllipse(cppArg0,cppArg1,cppArg2,cppArg3,cppArg4); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RotoFunc_createEllipse_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Roto.createEllipse"); - return {}; -} - -static PyObject *Sbk_RotoFunc_createLayer(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Roto *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ROTO_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // createLayer() - // Begin code injection - Layer * cppResult = cppSelf->createLayer(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_LAYER_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RotoFunc_createRectangle(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Roto *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ROTO_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createRectangle", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: Roto::createRectangle(double,double,double,double) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // createRectangle(double,double,double,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RotoFunc_createRectangle_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - double cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - double cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // createRectangle(double,double,double,double) - // Begin code injection - BezierCurve * cppResult = cppSelf->createRectangle(cppArg0,cppArg1,cppArg2,cppArg3); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_BEZIERCURVE_IDX]), cppResult); - - // End of code injection - - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RotoFunc_createRectangle_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Roto.createRectangle"); - return {}; -} - -static PyObject *Sbk_RotoFunc_getBaseLayer(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Roto *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ROTO_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getBaseLayer()const - Layer * cppResult = const_cast(cppSelf)->getBaseLayer(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_LAYER_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_RotoFunc_getItemByName(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Roto *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_ROTO_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Roto::getItemByName(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getItemByName(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_RotoFunc_getItemByName_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getItemByName(QString)const - ItemBase * cppResult = const_cast(cppSelf)->getItemByName(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_ITEMBASE_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_RotoFunc_getItemByName_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Roto.getItemByName"); - return {}; -} - - -static const char *Sbk_Roto_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Roto_methods[] = { - {"createBezier", reinterpret_cast(Sbk_RotoFunc_createBezier), METH_VARARGS}, - {"createEllipse", reinterpret_cast(Sbk_RotoFunc_createEllipse), METH_VARARGS}, - {"createLayer", reinterpret_cast(Sbk_RotoFunc_createLayer), METH_NOARGS}, - {"createRectangle", reinterpret_cast(Sbk_RotoFunc_createRectangle), METH_VARARGS}, - {"getBaseLayer", reinterpret_cast(Sbk_RotoFunc_getBaseLayer), METH_NOARGS}, - {"getItemByName", reinterpret_cast(Sbk_RotoFunc_getItemByName), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_Roto_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Roto_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Roto_Type = nullptr; -static SbkObjectType *Sbk_Roto_TypeF(void) -{ - return _Sbk_Roto_Type; -} - -static PyType_Slot Sbk_Roto_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_Roto_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Roto_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Roto_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Roto_spec = { - "1:NatronEngine.Roto", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Roto_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Roto_PythonToCpp_Roto_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Roto_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Roto_PythonToCpp_Roto_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Roto_TypeF()))) - return Roto_PythonToCpp_Roto_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Roto_PTR_CppToPython_Roto(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Roto_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Roto_SignatureStrings[] = { - "NatronEngine.Roto.createBezier(self,x:double,y:double,time:double)->NatronEngine.BezierCurve", - "NatronEngine.Roto.createEllipse(self,x:double,y:double,diameter:double,fromCenter:bool,time:double)->NatronEngine.BezierCurve", - "NatronEngine.Roto.createLayer(self)->NatronEngine.Layer", - "NatronEngine.Roto.createRectangle(self,x:double,y:double,size:double,time:double)->NatronEngine.BezierCurve", - "NatronEngine.Roto.getBaseLayer(self)->NatronEngine.Layer", - "NatronEngine.Roto.getItemByName(self,name:QString)->NatronEngine.ItemBase", - nullptr}; // Sentinel - -void init_Roto(PyObject *module) -{ - _Sbk_Roto_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Roto", - "Roto*", - &Sbk_Roto_spec, - &Shiboken::callCppDestructor< ::Roto >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Roto_Type); - InitSignatureStrings(pyType, Roto_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Roto_Type), Sbk_Roto_PropertyStrings); - SbkNatronEngineTypes[SBK_ROTO_IDX] - = reinterpret_cast(Sbk_Roto_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Roto_TypeF(), - Roto_PythonToCpp_Roto_PTR, - is_Roto_PythonToCpp_Roto_PTR_Convertible, - Roto_PTR_CppToPython_Roto); - - Shiboken::Conversions::registerConverterName(converter, "Roto"); - Shiboken::Conversions::registerConverterName(converter, "Roto*"); - Shiboken::Conversions::registerConverterName(converter, "Roto&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Roto).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/roto_wrapper.h b/Engine/Qt5/NatronEngine/roto_wrapper.h deleted file mode 100644 index 3ec2571012..0000000000 --- a/Engine/Qt5/NatronEngine/roto_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_ROTO_H -#define SBK_ROTO_H - -#include - -#endif // SBK_ROTO_H - diff --git a/Engine/Qt5/NatronEngine/separatorparam_wrapper.cpp b/Engine/Qt5/NatronEngine/separatorparam_wrapper.cpp deleted file mode 100644 index 9cf294bcd8..0000000000 --- a/Engine/Qt5/NatronEngine/separatorparam_wrapper.cpp +++ /dev/null @@ -1,239 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "separatorparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void SeparatorParamWrapper::pysideInitQtMetaTypes() -{ -} - -void SeparatorParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -SeparatorParamWrapper::~SeparatorParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { - -static const char *Sbk_SeparatorParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_SeparatorParam_methods[] = { - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_SeparatorParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::SeparatorParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_SEPARATORPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_SeparatorParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_SeparatorParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_SeparatorParam_Type = nullptr; -static SbkObjectType *Sbk_SeparatorParam_TypeF(void) -{ - return _Sbk_SeparatorParam_Type; -} - -static PyType_Slot Sbk_SeparatorParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_SeparatorParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_SeparatorParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_SeparatorParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_SeparatorParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_SeparatorParam_spec = { - "1:NatronEngine.SeparatorParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_SeparatorParam_slots -}; - -} //extern "C" - -static void *Sbk_SeparatorParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::SeparatorParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void SeparatorParam_PythonToCpp_SeparatorParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_SeparatorParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_SeparatorParam_PythonToCpp_SeparatorParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_SeparatorParam_TypeF()))) - return SeparatorParam_PythonToCpp_SeparatorParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *SeparatorParam_PTR_CppToPython_SeparatorParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_SeparatorParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *SeparatorParam_SignatureStrings[] = { - nullptr}; // Sentinel - -void init_SeparatorParam(PyObject *module) -{ - _Sbk_SeparatorParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "SeparatorParam", - "SeparatorParam*", - &Sbk_SeparatorParam_spec, - &Shiboken::callCppDestructor< ::SeparatorParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_SeparatorParam_Type); - InitSignatureStrings(pyType, SeparatorParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_SeparatorParam_Type), Sbk_SeparatorParam_PropertyStrings); - SbkNatronEngineTypes[SBK_SEPARATORPARAM_IDX] - = reinterpret_cast(Sbk_SeparatorParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_SeparatorParam_TypeF(), - SeparatorParam_PythonToCpp_SeparatorParam_PTR, - is_SeparatorParam_PythonToCpp_SeparatorParam_PTR_Convertible, - SeparatorParam_PTR_CppToPython_SeparatorParam); - - Shiboken::Conversions::registerConverterName(converter, "SeparatorParam"); - Shiboken::Conversions::registerConverterName(converter, "SeparatorParam*"); - Shiboken::Conversions::registerConverterName(converter, "SeparatorParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::SeparatorParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::SeparatorParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_SeparatorParam_TypeF(), &Sbk_SeparatorParam_typeDiscovery); - - - SeparatorParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/separatorparam_wrapper.h b/Engine/Qt5/NatronEngine/separatorparam_wrapper.h deleted file mode 100644 index d5d7f6556d..0000000000 --- a/Engine/Qt5/NatronEngine/separatorparam_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef SBK_SEPARATORPARAMWRAPPER_H -#define SBK_SEPARATORPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class SeparatorParamWrapper : public SeparatorParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { SeparatorParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~SeparatorParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_SEPARATORPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.cpp b/Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.cpp deleted file mode 100644 index 13efb6bbf0..0000000000 --- a/Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.cpp +++ /dev/null @@ -1,467 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "stringnodecreationproperty_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void StringNodeCreationPropertyWrapper::pysideInitQtMetaTypes() -{ -} - -void StringNodeCreationPropertyWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -StringNodeCreationPropertyWrapper::StringNodeCreationPropertyWrapper(const std::string & value) : StringNodeCreationProperty(value) -{ - resetPyMethodCache(); - // ... middle -} - -StringNodeCreationPropertyWrapper::StringNodeCreationPropertyWrapper(const std::vector & values) : StringNodeCreationProperty(values) -{ - resetPyMethodCache(); - // ... middle -} - -StringNodeCreationPropertyWrapper::~StringNodeCreationPropertyWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_StringNodeCreationProperty_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::StringNodeCreationProperty >())) - return -1; - - ::StringNodeCreationPropertyWrapper *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.StringNodeCreationProperty(): too many arguments"); - return -1; - } - - if (!PyArg_ParseTuple(args, "|O:StringNodeCreationProperty", &(pyArgs[0]))) - return -1; - - - // Overloaded function decisor - // 0: StringNodeCreationProperty::StringNodeCreationProperty(std::string) - // 1: StringNodeCreationProperty::StringNodeCreationProperty(std::vector) - if (numArgs == 0) { - overloadId = 1; // StringNodeCreationProperty(std::vector) - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // StringNodeCreationProperty(std::string) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], (pyArgs[0])))) { - overloadId = 1; // StringNodeCreationProperty(std::vector) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringNodeCreationProperty_Init_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // StringNodeCreationProperty(const std::string & value) - { - ::std::string cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // StringNodeCreationProperty(std::string) - cptr = new ::StringNodeCreationPropertyWrapper(cppArg0); - } - break; - } - case 1: // StringNodeCreationProperty(const std::vector & values) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","values"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.StringNodeCreationProperty(): got multiple values for keyword argument 'values'."); - return -1; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], (pyArgs[0])))) - goto Sbk_StringNodeCreationProperty_Init_TypeError; - } - } - } - ::std::vector cppArg0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // StringNodeCreationProperty(std::vector) - cptr = new ::StringNodeCreationPropertyWrapper(cppArg0); - } - break; - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::StringNodeCreationProperty >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_StringNodeCreationProperty_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_StringNodeCreationProperty_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringNodeCreationProperty"); - return -1; -} - -static PyObject *Sbk_StringNodeCreationPropertyFunc_getValues(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getValues()const - const std::vector & cppResult = const_cast(cppSelf)->getValues(); - pyResult = Shiboken::Conversions::copyToPython(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_VECTOR_STD_STRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_StringNodeCreationPropertyFunc_setValue(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.StringNodeCreationProperty.setValue(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.StringNodeCreationProperty.setValue(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:setValue", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: StringNodeCreationProperty::setValue(std::string,int) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // setValue(std::string,int) - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValue(std::string,int) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringNodeCreationPropertyFunc_setValue_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","index"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronEngine.StringNodeCreationProperty.setValue(): got multiple values for keyword argument 'index'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) - goto Sbk_StringNodeCreationPropertyFunc_setValue_TypeError; - } - } - } - ::std::string cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1 = 0; - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValue(std::string,int) - cppSelf->setValue(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_StringNodeCreationPropertyFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringNodeCreationProperty.setValue"); - return {}; -} - - -static const char *Sbk_StringNodeCreationProperty_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_StringNodeCreationProperty_methods[] = { - {"getValues", reinterpret_cast(Sbk_StringNodeCreationPropertyFunc_getValues), METH_NOARGS}, - {"setValue", reinterpret_cast(Sbk_StringNodeCreationPropertyFunc_setValue), METH_VARARGS|METH_KEYWORDS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_StringNodeCreationProperty_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::StringNodeCreationProperty *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGNODECREATIONPROPERTY_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_StringNodeCreationProperty_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_StringNodeCreationProperty_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_StringNodeCreationProperty_Type = nullptr; -static SbkObjectType *Sbk_StringNodeCreationProperty_TypeF(void) -{ - return _Sbk_StringNodeCreationProperty_Type; -} - -static PyType_Slot Sbk_StringNodeCreationProperty_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_StringNodeCreationProperty_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_StringNodeCreationProperty_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_StringNodeCreationProperty_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_StringNodeCreationProperty_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_StringNodeCreationProperty_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_StringNodeCreationProperty_spec = { - "1:NatronEngine.StringNodeCreationProperty", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_StringNodeCreationProperty_slots -}; - -} //extern "C" - -static void *Sbk_StringNodeCreationProperty_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::NodeCreationProperty >())) - return dynamic_cast< ::StringNodeCreationProperty *>(reinterpret_cast< ::NodeCreationProperty *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void StringNodeCreationProperty_PythonToCpp_StringNodeCreationProperty_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_StringNodeCreationProperty_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_StringNodeCreationProperty_PythonToCpp_StringNodeCreationProperty_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_StringNodeCreationProperty_TypeF()))) - return StringNodeCreationProperty_PythonToCpp_StringNodeCreationProperty_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *StringNodeCreationProperty_PTR_CppToPython_StringNodeCreationProperty(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_StringNodeCreationProperty_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *StringNodeCreationProperty_SignatureStrings[] = { - "1:NatronEngine.StringNodeCreationProperty(self,value:std.string)", - "0:NatronEngine.StringNodeCreationProperty(self,values:std.vector[std.string]=std.vector< std.string >())", - "NatronEngine.StringNodeCreationProperty.getValues(self)->std.vector[std.string]", - "NatronEngine.StringNodeCreationProperty.setValue(self,value:std.string,index:int=0)", - nullptr}; // Sentinel - -void init_StringNodeCreationProperty(PyObject *module) -{ - _Sbk_StringNodeCreationProperty_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "StringNodeCreationProperty", - "StringNodeCreationProperty*", - &Sbk_StringNodeCreationProperty_spec, - &Shiboken::callCppDestructor< ::StringNodeCreationProperty >, - reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_StringNodeCreationProperty_Type); - InitSignatureStrings(pyType, StringNodeCreationProperty_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_StringNodeCreationProperty_Type), Sbk_StringNodeCreationProperty_PropertyStrings); - SbkNatronEngineTypes[SBK_STRINGNODECREATIONPROPERTY_IDX] - = reinterpret_cast(Sbk_StringNodeCreationProperty_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_StringNodeCreationProperty_TypeF(), - StringNodeCreationProperty_PythonToCpp_StringNodeCreationProperty_PTR, - is_StringNodeCreationProperty_PythonToCpp_StringNodeCreationProperty_PTR_Convertible, - StringNodeCreationProperty_PTR_CppToPython_StringNodeCreationProperty); - - Shiboken::Conversions::registerConverterName(converter, "StringNodeCreationProperty"); - Shiboken::Conversions::registerConverterName(converter, "StringNodeCreationProperty*"); - Shiboken::Conversions::registerConverterName(converter, "StringNodeCreationProperty&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::StringNodeCreationProperty).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::StringNodeCreationPropertyWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_StringNodeCreationProperty_TypeF(), &Sbk_StringNodeCreationProperty_typeDiscovery); - - - StringNodeCreationPropertyWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.h b/Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.h deleted file mode 100644 index 15e9245f05..0000000000 --- a/Engine/Qt5/NatronEngine/stringnodecreationproperty_wrapper.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SBK_STRINGNODECREATIONPROPERTYWRAPPER_H -#define SBK_STRINGNODECREATIONPROPERTYWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class StringNodeCreationPropertyWrapper : public StringNodeCreationProperty -{ -public: - StringNodeCreationPropertyWrapper(const std::string & value); - StringNodeCreationPropertyWrapper(const std::vector & values = std::vector< std::string >()); - ~StringNodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_NODECREATIONPROPERTYWRAPPER_H -# define SBK_NODECREATIONPROPERTYWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class NodeCreationPropertyWrapper : public NodeCreationProperty -{ -public: - NodeCreationPropertyWrapper(); - ~NodeCreationPropertyWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_NODECREATIONPROPERTYWRAPPER_H - -#endif // SBK_STRINGNODECREATIONPROPERTYWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/stringparam_wrapper.cpp b/Engine/Qt5/NatronEngine/stringparam_wrapper.cpp deleted file mode 100644 index 640ec09022..0000000000 --- a/Engine/Qt5/NatronEngine/stringparam_wrapper.cpp +++ /dev/null @@ -1,337 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "stringparam_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void StringParamWrapper::pysideInitQtMetaTypes() -{ - qRegisterMetaType< ::StringParam::TypeEnum >("StringParam::TypeEnum"); -} - -void StringParamWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -StringParamWrapper::~StringParamWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_StringParamFunc_setType(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAM_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: StringParam::setType(StringParam::TypeEnum) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX])->converter, (pyArg)))) { - overloadId = 0; // setType(StringParam::TypeEnum) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamFunc_setType_TypeError; - - // Call function/method - { - ::StringParam::TypeEnum cppArg0{StringParam::eStringTypeLabel}; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setType(StringParam::TypeEnum) - cppSelf->setType(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_StringParamFunc_setType_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.StringParam.setType"); - return {}; -} - - -static const char *Sbk_StringParam_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_StringParam_methods[] = { - {"setType", reinterpret_cast(Sbk_StringParamFunc_setType), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_StringParam_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::StringParam *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAM_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_StringParam_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_StringParam_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_StringParam_Type = nullptr; -static SbkObjectType *Sbk_StringParam_TypeF(void) -{ - return _Sbk_StringParam_Type; -} - -static PyType_Slot Sbk_StringParam_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_StringParam_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_StringParam_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_StringParam_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_StringParam_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_StringParam_spec = { - "1:NatronEngine.StringParam", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_StringParam_slots -}; - -} //extern "C" - -static void *Sbk_StringParam_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::StringParam *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ enum conversion. -static void StringParam_TypeEnum_PythonToCpp_StringParam_TypeEnum(PyObject *pyIn, void *cppOut) { - *reinterpret_cast<::StringParam::TypeEnum *>(cppOut) = - static_cast<::StringParam::TypeEnum>(Shiboken::Enum::getValue(pyIn)); - -} -static PythonToCppFunc is_StringParam_TypeEnum_PythonToCpp_StringParam_TypeEnum_Convertible(PyObject *pyIn) { - if (PyObject_TypeCheck(pyIn, SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX])) - return StringParam_TypeEnum_PythonToCpp_StringParam_TypeEnum; - return {}; -} -static PyObject *StringParam_TypeEnum_CppToPython_StringParam_TypeEnum(const void *cppIn) { - const int castCppIn = int(*reinterpret_cast(cppIn)); - return Shiboken::Enum::newItem(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], castCppIn); - -} - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void StringParam_PythonToCpp_StringParam_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_StringParam_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_StringParam_PythonToCpp_StringParam_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_StringParam_TypeF()))) - return StringParam_PythonToCpp_StringParam_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *StringParam_PTR_CppToPython_StringParam(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_StringParam_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *StringParam_SignatureStrings[] = { - "NatronEngine.StringParam.setType(self,type:NatronEngine.StringParam.TypeEnum)", - nullptr}; // Sentinel - -void init_StringParam(PyObject *module) -{ - _Sbk_StringParam_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "StringParam", - "StringParam*", - &Sbk_StringParam_spec, - &Shiboken::callCppDestructor< ::StringParam >, - reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_StringParam_Type); - InitSignatureStrings(pyType, StringParam_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_StringParam_Type), Sbk_StringParam_PropertyStrings); - SbkNatronEngineTypes[SBK_STRINGPARAM_IDX] - = reinterpret_cast(Sbk_StringParam_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_StringParam_TypeF(), - StringParam_PythonToCpp_StringParam_PTR, - is_StringParam_PythonToCpp_StringParam_PTR_Convertible, - StringParam_PTR_CppToPython_StringParam); - - Shiboken::Conversions::registerConverterName(converter, "StringParam"); - Shiboken::Conversions::registerConverterName(converter, "StringParam*"); - Shiboken::Conversions::registerConverterName(converter, "StringParam&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::StringParam).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::StringParamWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_StringParam_TypeF(), &Sbk_StringParam_typeDiscovery); - - // Initialization of enums. - - // Initialization of enum 'TypeEnum'. - SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX] = Shiboken::Enum::createScopedEnum(Sbk_StringParam_TypeF(), - "TypeEnum", - "1:NatronEngine.StringParam.TypeEnum", - "StringParam::TypeEnum"); - if (!SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX]) - return; - - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], - Sbk_StringParam_TypeF(), "eStringTypeLabel", (long) StringParam::TypeEnum::eStringTypeLabel)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], - Sbk_StringParam_TypeF(), "eStringTypeMultiLine", (long) StringParam::TypeEnum::eStringTypeMultiLine)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], - Sbk_StringParam_TypeF(), "eStringTypeRichTextMultiLine", (long) StringParam::TypeEnum::eStringTypeRichTextMultiLine)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], - Sbk_StringParam_TypeF(), "eStringTypeCustom", (long) StringParam::TypeEnum::eStringTypeCustom)) - return; - if (!Shiboken::Enum::createScopedEnumItem(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], - Sbk_StringParam_TypeF(), "eStringTypeDefault", (long) StringParam::TypeEnum::eStringTypeDefault)) - return; - // Register converter for enum 'StringParam::TypeEnum'. - { - SbkConverter *converter = Shiboken::Conversions::createConverter(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], - StringParam_TypeEnum_CppToPython_StringParam_TypeEnum); - Shiboken::Conversions::addPythonToCppValueConversion(converter, - StringParam_TypeEnum_PythonToCpp_StringParam_TypeEnum, - is_StringParam_TypeEnum_PythonToCpp_StringParam_TypeEnum_Convertible); - Shiboken::Enum::setTypeConverter(SbkNatronEngineTypes[SBK_STRINGPARAM_TYPEENUM_IDX], converter); - Shiboken::Conversions::registerConverterName(converter, "StringParam::TypeEnum"); - Shiboken::Conversions::registerConverterName(converter, "TypeEnum"); - } - // End of 'TypeEnum' enum. - - - StringParamWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/stringparam_wrapper.h b/Engine/Qt5/NatronEngine/stringparam_wrapper.h deleted file mode 100644 index d245a8123c..0000000000 --- a/Engine/Qt5/NatronEngine/stringparam_wrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef SBK_STRINGPARAMWRAPPER_H -#define SBK_STRINGPARAMWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class StringParamWrapper : public StringParam -{ -public: - ~StringParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_STRINGPARAMBASEWRAPPER_H -# define SBK_STRINGPARAMBASEWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class StringParamBaseWrapper : public StringParamBase -{ -public: - ~StringParamBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_STRINGPARAMBASEWRAPPER_H - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_STRINGPARAMWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/stringparambase_wrapper.cpp b/Engine/Qt5/NatronEngine/stringparambase_wrapper.cpp deleted file mode 100644 index 476fb28aac..0000000000 --- a/Engine/Qt5/NatronEngine/stringparambase_wrapper.cpp +++ /dev/null @@ -1,716 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "stringparambase_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void StringParamBaseWrapper::pysideInitQtMetaTypes() -{ -} - -void StringParamBaseWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -StringParamBaseWrapper::~StringParamBaseWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_StringParamBaseFunc_addAsDependencyOf(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "addAsDependencyOf", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: StringParamBase::addAsDependencyOf(int,Param*,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // addAsDependencyOf(int,Param*,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamBaseFunc_addAsDependencyOf_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::Param *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // addAsDependencyOf(int,Param*,int) - QString cppResult = cppSelf->addAsDependencyOf(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_StringParamBaseFunc_addAsDependencyOf_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringParamBase.addAsDependencyOf"); - return {}; -} - -static PyObject *Sbk_StringParamBaseFunc_get(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "get", 0, 1, &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: StringParamBase::get()const - // 1: StringParamBase::get(double)const - if (numArgs == 0) { - overloadId = 0; // get()const - } else if (numArgs == 1 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 1; // get(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamBaseFunc_get_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // get() const - { - - if (!PyErr_Occurred()) { - // get()const - QString cppResult = const_cast(cppSelf)->get(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - break; - } - case 1: // get(double frame) const - { - double cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // get(double)const - QString cppResult = const_cast(cppSelf)->get(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - break; - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_StringParamBaseFunc_get_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringParamBase.get"); - return {}; -} - -static PyObject *Sbk_StringParamBaseFunc_getDefaultValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getDefaultValue()const - QString cppResult = const_cast(cppSelf)->getDefaultValue(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_StringParamBaseFunc_getValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getValue()const - QString cppResult = const_cast(cppSelf)->getValue(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_StringParamBaseFunc_getValueAtTime(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: StringParamBase::getValueAtTime(double)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getValueAtTime(double)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamBaseFunc_getValueAtTime_TypeError; - - // Call function/method - { - double cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getValueAtTime(double)const - QString cppResult = const_cast(cppSelf)->getValueAtTime(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_StringParamBaseFunc_getValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.StringParamBase.getValueAtTime"); - return {}; -} - -static PyObject *Sbk_StringParamBaseFunc_restoreDefaultValue(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // restoreDefaultValue() - cppSelf->restoreDefaultValue(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_StringParamBaseFunc_set(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "set", 1, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: StringParamBase::set(QString) - // 1: StringParamBase::set(QString,double) - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // set(QString) - } else if (numArgs == 2 - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 1; // set(QString,double) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamBaseFunc_set_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // set(const QString & x) - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // set(QString) - cppSelf->set(cppArg0); - } - break; - } - case 1: // set(const QString & x, double frame) - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // set(QString,double) - cppSelf->set(cppArg0, cppArg1); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_StringParamBaseFunc_set_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringParamBase.set"); - return {}; -} - -static PyObject *Sbk_StringParamBaseFunc_setDefaultValue(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: StringParamBase::setDefaultValue(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setDefaultValue(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamBaseFunc_setDefaultValue_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setDefaultValue(QString) - cppSelf->setDefaultValue(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_StringParamBaseFunc_setDefaultValue_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.StringParamBase.setDefaultValue"); - return {}; -} - -static PyObject *Sbk_StringParamBaseFunc_setValue(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: StringParamBase::setValue(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setValue(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamBaseFunc_setValue_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setValue(QString) - cppSelf->setValue(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_StringParamBaseFunc_setValue_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.StringParamBase.setValue"); - return {}; -} - -static PyObject *Sbk_StringParamBaseFunc_setValueAtTime(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setValueAtTime", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: StringParamBase::setValueAtTime(QString,double) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setValueAtTime(QString,double) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_StringParamBaseFunc_setValueAtTime_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - double cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setValueAtTime(QString,double) - cppSelf->setValueAtTime(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_StringParamBaseFunc_setValueAtTime_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.StringParamBase.setValueAtTime"); - return {}; -} - - -static const char *Sbk_StringParamBase_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_StringParamBase_methods[] = { - {"addAsDependencyOf", reinterpret_cast(Sbk_StringParamBaseFunc_addAsDependencyOf), METH_VARARGS}, - {"get", reinterpret_cast(Sbk_StringParamBaseFunc_get), METH_VARARGS}, - {"getDefaultValue", reinterpret_cast(Sbk_StringParamBaseFunc_getDefaultValue), METH_NOARGS}, - {"getValue", reinterpret_cast(Sbk_StringParamBaseFunc_getValue), METH_NOARGS}, - {"getValueAtTime", reinterpret_cast(Sbk_StringParamBaseFunc_getValueAtTime), METH_O}, - {"restoreDefaultValue", reinterpret_cast(Sbk_StringParamBaseFunc_restoreDefaultValue), METH_NOARGS}, - {"set", reinterpret_cast(Sbk_StringParamBaseFunc_set), METH_VARARGS}, - {"setDefaultValue", reinterpret_cast(Sbk_StringParamBaseFunc_setDefaultValue), METH_O}, - {"setValue", reinterpret_cast(Sbk_StringParamBaseFunc_setValue), METH_O}, - {"setValueAtTime", reinterpret_cast(Sbk_StringParamBaseFunc_setValueAtTime), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_StringParamBase_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::StringParamBase *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_StringParamBase_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_StringParamBase_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_StringParamBase_Type = nullptr; -static SbkObjectType *Sbk_StringParamBase_TypeF(void) -{ - return _Sbk_StringParamBase_Type; -} - -static PyType_Slot Sbk_StringParamBase_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_StringParamBase_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_StringParamBase_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_StringParamBase_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_StringParamBase_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_StringParamBase_spec = { - "1:NatronEngine.StringParamBase", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_StringParamBase_slots -}; - -} //extern "C" - -static void *Sbk_StringParamBase_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Param >())) - return dynamic_cast< ::StringParamBase *>(reinterpret_cast< ::Param *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void StringParamBase_PythonToCpp_StringParamBase_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_StringParamBase_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_StringParamBase_PythonToCpp_StringParamBase_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_StringParamBase_TypeF()))) - return StringParamBase_PythonToCpp_StringParamBase_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *StringParamBase_PTR_CppToPython_StringParamBase(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_StringParamBase_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *StringParamBase_SignatureStrings[] = { - "NatronEngine.StringParamBase.addAsDependencyOf(self,fromExprDimension:int,param:NatronEngine.Param,thisDimension:int)->QString", - "1:NatronEngine.StringParamBase.get(self)->QString", - "0:NatronEngine.StringParamBase.get(self,frame:double)->QString", - "NatronEngine.StringParamBase.getDefaultValue(self)->QString", - "NatronEngine.StringParamBase.getValue(self)->QString", - "NatronEngine.StringParamBase.getValueAtTime(self,time:double)->QString", - "NatronEngine.StringParamBase.restoreDefaultValue(self)", - "1:NatronEngine.StringParamBase.set(self,x:QString)", - "0:NatronEngine.StringParamBase.set(self,x:QString,frame:double)", - "NatronEngine.StringParamBase.setDefaultValue(self,value:QString)", - "NatronEngine.StringParamBase.setValue(self,value:QString)", - "NatronEngine.StringParamBase.setValueAtTime(self,value:QString,time:double)", - nullptr}; // Sentinel - -void init_StringParamBase(PyObject *module) -{ - _Sbk_StringParamBase_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "StringParamBase", - "StringParamBase*", - &Sbk_StringParamBase_spec, - &Shiboken::callCppDestructor< ::StringParamBase >, - reinterpret_cast(SbkNatronEngineTypes[SBK_ANIMATEDPARAM_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_StringParamBase_Type); - InitSignatureStrings(pyType, StringParamBase_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_StringParamBase_Type), Sbk_StringParamBase_PropertyStrings); - SbkNatronEngineTypes[SBK_STRINGPARAMBASE_IDX] - = reinterpret_cast(Sbk_StringParamBase_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_StringParamBase_TypeF(), - StringParamBase_PythonToCpp_StringParamBase_PTR, - is_StringParamBase_PythonToCpp_StringParamBase_PTR_Convertible, - StringParamBase_PTR_CppToPython_StringParamBase); - - Shiboken::Conversions::registerConverterName(converter, "StringParamBase"); - Shiboken::Conversions::registerConverterName(converter, "StringParamBase*"); - Shiboken::Conversions::registerConverterName(converter, "StringParamBase&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::StringParamBase).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::StringParamBaseWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_StringParamBase_TypeF(), &Sbk_StringParamBase_typeDiscovery); - - - StringParamBaseWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/stringparambase_wrapper.h b/Engine/Qt5/NatronEngine/stringparambase_wrapper.h deleted file mode 100644 index 2f9da05636..0000000000 --- a/Engine/Qt5/NatronEngine/stringparambase_wrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef SBK_STRINGPARAMBASEWRAPPER_H -#define SBK_STRINGPARAMBASEWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class StringParamBaseWrapper : public StringParamBase -{ -public: - ~StringParamBaseWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_ANIMATEDPARAMWRAPPER_H -# define SBK_ANIMATEDPARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AnimatedParamWrapper : public AnimatedParam -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { AnimatedParam::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~AnimatedParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_ANIMATEDPARAMWRAPPER_H - -# ifndef SBK_PARAMWRAPPER_H -# define SBK_PARAMWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class ParamWrapper : public Param -{ -public: - inline void _addAsDependencyOf_protected(int fromExprDimension, Param * param, int thisDimension) { Param::_addAsDependencyOf(fromExprDimension, param, thisDimension); } - ~ParamWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PARAMWRAPPER_H - -#endif // SBK_STRINGPARAMBASEWRAPPER_H - diff --git a/Engine/Qt5/NatronEngine/track_wrapper.cpp b/Engine/Qt5/NatronEngine/track_wrapper.cpp deleted file mode 100644 index 8c56696047..0000000000 --- a/Engine/Qt5/NatronEngine/track_wrapper.cpp +++ /dev/null @@ -1,385 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "track_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Extra includes -#include -#include - - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_TrackFunc_getParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Track *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACK_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Track::getParam(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getParam(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_TrackFunc_getParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getParam(QString)const - Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_TrackFunc_getParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Track.getParam"); - return {}; -} - -static PyObject *Sbk_TrackFunc_getParams(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Track *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACK_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getParams()const - // Begin code injection - std::list params = cppSelf->getParams(); - PyObject* ret = PyList_New((int) params.size()); - int idx = 0; - for (std::list::iterator it = params.begin(); it!=params.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_TrackFunc_getScriptName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Track *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACK_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getScriptName()const - QString cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_TrackFunc_reset(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Track *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACK_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // reset() - cppSelf->reset(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_TrackFunc_setScriptName(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Track *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACK_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Track::setScriptName(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setScriptName(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_TrackFunc_setScriptName_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setScriptName(QString) - cppSelf->setScriptName(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_TrackFunc_setScriptName_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Track.setScriptName"); - return {}; -} - - -static const char *Sbk_Track_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Track_methods[] = { - {"getParam", reinterpret_cast(Sbk_TrackFunc_getParam), METH_O}, - {"getParams", reinterpret_cast(Sbk_TrackFunc_getParams), METH_NOARGS}, - {"getScriptName", reinterpret_cast(Sbk_TrackFunc_getScriptName), METH_NOARGS}, - {"reset", reinterpret_cast(Sbk_TrackFunc_reset), METH_NOARGS}, - {"setScriptName", reinterpret_cast(Sbk_TrackFunc_setScriptName), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_Track_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Track_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Track_Type = nullptr; -static SbkObjectType *Sbk_Track_TypeF(void) -{ - return _Sbk_Track_Type; -} - -static PyType_Slot Sbk_Track_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_Track_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Track_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Track_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Track_spec = { - "1:NatronEngine.Track", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Track_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Track_PythonToCpp_Track_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Track_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Track_PythonToCpp_Track_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Track_TypeF()))) - return Track_PythonToCpp_Track_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Track_PTR_CppToPython_Track(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Track_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Track_SignatureStrings[] = { - "NatronEngine.Track.getParam(self,scriptName:QString)->NatronEngine.Param", - "NatronEngine.Track.getParams(self)->std.list[NatronEngine.Param]", - "NatronEngine.Track.getScriptName(self)->QString", - "NatronEngine.Track.reset(self)", - "NatronEngine.Track.setScriptName(self,scriptName:QString)", - nullptr}; // Sentinel - -void init_Track(PyObject *module) -{ - _Sbk_Track_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Track", - "Track*", - &Sbk_Track_spec, - &Shiboken::callCppDestructor< ::Track >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Track_Type); - InitSignatureStrings(pyType, Track_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Track_Type), Sbk_Track_PropertyStrings); - SbkNatronEngineTypes[SBK_TRACK_IDX] - = reinterpret_cast(Sbk_Track_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Track_TypeF(), - Track_PythonToCpp_Track_PTR, - is_Track_PythonToCpp_Track_PTR_Convertible, - Track_PTR_CppToPython_Track); - - Shiboken::Conversions::registerConverterName(converter, "Track"); - Shiboken::Conversions::registerConverterName(converter, "Track*"); - Shiboken::Conversions::registerConverterName(converter, "Track&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Track).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/track_wrapper.h b/Engine/Qt5/NatronEngine/track_wrapper.h deleted file mode 100644 index 97fd0d92e9..0000000000 --- a/Engine/Qt5/NatronEngine/track_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_TRACK_H -#define SBK_TRACK_H - -#include - -#endif // SBK_TRACK_H - diff --git a/Engine/Qt5/NatronEngine/tracker_wrapper.cpp b/Engine/Qt5/NatronEngine/tracker_wrapper.cpp deleted file mode 100644 index 6a5a646127..0000000000 --- a/Engine/Qt5/NatronEngine/tracker_wrapper.cpp +++ /dev/null @@ -1,453 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "tracker_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Extra includes -#include -#include - - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_TrackerFunc_createTrack(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Tracker *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACKER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // createTrack() - Track * cppResult = cppSelf->createTrack(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_TRACK_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_TrackerFunc_getAllTracks(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Tracker *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACKER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getAllTracks(std::list*)const - // Begin code injection - std::list tracks; - cppSelf->getAllTracks(&tracks); - PyObject* ret = PyList_New((int) tracks.size()); - int idx = 0; - for (std::list::iterator it = tracks.begin(); it!=tracks.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_TRACK_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - pyResult = Py_None; - Py_INCREF(Py_None); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_TrackerFunc_getSelectedTracks(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Tracker *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACKER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getSelectedTracks(std::list*)const - // Begin code injection - std::list tracks; - cppSelf->getSelectedTracks(&tracks); - PyObject* ret = PyList_New((int) tracks.size()); - int idx = 0; - for (std::list::iterator it = tracks.begin(); it!=tracks.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_TRACK_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - pyResult = Py_None; - Py_INCREF(Py_None); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_TrackerFunc_getTrackByName(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Tracker *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACKER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: Tracker::getTrackByName(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getTrackByName(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_TrackerFunc_getTrackByName_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getTrackByName(QString)const - Track * cppResult = const_cast(cppSelf)->getTrackByName(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_TRACK_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_TrackerFunc_getTrackByName_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.Tracker.getTrackByName"); - return {}; -} - -static PyObject *Sbk_TrackerFunc_startTracking(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Tracker *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACKER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "startTracking", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: Tracker::startTracking(std::list,int,int,bool) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronEngineTypeConverters[SBK_NATRONENGINE_STD_LIST_TRACKPTR_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // startTracking(std::list,int,int,bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_TrackerFunc_startTracking_TypeError; - - // Call function/method - { - ::std::list cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - bool cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // startTracking(std::list,int,int,bool) - cppSelf->startTracking(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_TrackerFunc_startTracking_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.Tracker.startTracking"); - return {}; -} - -static PyObject *Sbk_TrackerFunc_stopTracking(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::Tracker *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_TRACKER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // stopTracking() - cppSelf->stopTracking(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - - -static const char *Sbk_Tracker_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_Tracker_methods[] = { - {"createTrack", reinterpret_cast(Sbk_TrackerFunc_createTrack), METH_NOARGS}, - {"getAllTracks", reinterpret_cast(Sbk_TrackerFunc_getAllTracks), METH_NOARGS}, - {"getSelectedTracks", reinterpret_cast(Sbk_TrackerFunc_getSelectedTracks), METH_NOARGS}, - {"getTrackByName", reinterpret_cast(Sbk_TrackerFunc_getTrackByName), METH_O}, - {"startTracking", reinterpret_cast(Sbk_TrackerFunc_startTracking), METH_VARARGS}, - {"stopTracking", reinterpret_cast(Sbk_TrackerFunc_stopTracking), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_Tracker_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_Tracker_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_Tracker_Type = nullptr; -static SbkObjectType *Sbk_Tracker_TypeF(void) -{ - return _Sbk_Tracker_Type; -} - -static PyType_Slot Sbk_Tracker_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_Tracker_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_Tracker_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_Tracker_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_Tracker_spec = { - "1:NatronEngine.Tracker", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_Tracker_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void Tracker_PythonToCpp_Tracker_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_Tracker_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_Tracker_PythonToCpp_Tracker_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_Tracker_TypeF()))) - return Tracker_PythonToCpp_Tracker_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *Tracker_PTR_CppToPython_Tracker(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_Tracker_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *Tracker_SignatureStrings[] = { - "NatronEngine.Tracker.createTrack(self)->NatronEngine.Track", - "NatronEngine.Tracker.getAllTracks(self,markers:std.list[NatronEngine.Track])", - "NatronEngine.Tracker.getSelectedTracks(self,markers:std.list[NatronEngine.Track])", - "NatronEngine.Tracker.getTrackByName(self,name:QString)->NatronEngine.Track", - "NatronEngine.Tracker.startTracking(self,marks:std.list[NatronEngine.Track],start:int,end:int,forward:bool)", - "NatronEngine.Tracker.stopTracking(self)", - nullptr}; // Sentinel - -void init_Tracker(PyObject *module) -{ - _Sbk_Tracker_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "Tracker", - "Tracker*", - &Sbk_Tracker_spec, - &Shiboken::callCppDestructor< ::Tracker >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_Tracker_Type); - InitSignatureStrings(pyType, Tracker_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_Tracker_Type), Sbk_Tracker_PropertyStrings); - SbkNatronEngineTypes[SBK_TRACKER_IDX] - = reinterpret_cast(Sbk_Tracker_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_Tracker_TypeF(), - Tracker_PythonToCpp_Tracker_PTR, - is_Tracker_PythonToCpp_Tracker_PTR_Convertible, - Tracker_PTR_CppToPython_Tracker); - - Shiboken::Conversions::registerConverterName(converter, "Tracker"); - Shiboken::Conversions::registerConverterName(converter, "Tracker*"); - Shiboken::Conversions::registerConverterName(converter, "Tracker&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::Tracker).name()); - - - -} diff --git a/Engine/Qt5/NatronEngine/tracker_wrapper.h b/Engine/Qt5/NatronEngine/tracker_wrapper.h deleted file mode 100644 index e2f1dce725..0000000000 --- a/Engine/Qt5/NatronEngine/tracker_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_TRACKER_H -#define SBK_TRACKER_H - -#include - -#endif // SBK_TRACKER_H - diff --git a/Engine/Qt5/NatronEngine/userparamholder_wrapper.cpp b/Engine/Qt5/NatronEngine/userparamholder_wrapper.cpp deleted file mode 100644 index cbde3e624f..0000000000 --- a/Engine/Qt5/NatronEngine/userparamholder_wrapper.cpp +++ /dev/null @@ -1,1467 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natronengine_python.h" - -// main header -#include "userparamholder_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void UserParamHolderWrapper::pysideInitQtMetaTypes() -{ -} - -void UserParamHolderWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -UserParamHolderWrapper::UserParamHolderWrapper() : UserParamHolder() -{ - resetPyMethodCache(); - // ... middle -} - -UserParamHolderWrapper::~UserParamHolderWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_UserParamHolder_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::UserParamHolder >())) - return -1; - - ::UserParamHolderWrapper *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // UserParamHolder() - cptr = new ::UserParamHolderWrapper(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::UserParamHolder >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - -static PyObject *Sbk_UserParamHolderFunc_createBooleanParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createBooleanParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createBooleanParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createBooleanParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createBooleanParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createBooleanParam(QString,QString) - BooleanParam * cppResult = cppSelf->createBooleanParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_BOOLEANPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createBooleanParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createBooleanParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createButtonParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createButtonParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createButtonParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createButtonParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createButtonParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createButtonParam(QString,QString) - ButtonParam * cppResult = cppSelf->createButtonParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_BUTTONPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createButtonParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createButtonParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createChoiceParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createChoiceParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createChoiceParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createChoiceParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createChoiceParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createChoiceParam(QString,QString) - ChoiceParam * cppResult = cppSelf->createChoiceParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_CHOICEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createChoiceParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createChoiceParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createColorParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createColorParam", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createColorParam(QString,QString,bool) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // createColorParam(QString,QString,bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createColorParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - bool cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // createColorParam(QString,QString,bool) - ColorParam * cppResult = cppSelf->createColorParam(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createColorParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createColorParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createDouble2DParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createDouble2DParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createDouble2DParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createDouble2DParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createDouble2DParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createDouble2DParam(QString,QString) - Double2DParam * cppResult = cppSelf->createDouble2DParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE2DPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createDouble2DParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createDouble2DParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createDouble3DParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createDouble3DParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createDouble3DParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createDouble3DParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createDouble3DParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createDouble3DParam(QString,QString) - Double3DParam * cppResult = cppSelf->createDouble3DParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLE3DPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createDouble3DParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createDouble3DParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createDoubleParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createDoubleParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createDoubleParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createDoubleParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createDoubleParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createDoubleParam(QString,QString) - DoubleParam * cppResult = cppSelf->createDoubleParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_DOUBLEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createDoubleParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createDoubleParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createFileParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createFileParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createFileParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createFileParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createFileParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createFileParam(QString,QString) - FileParam * cppResult = cppSelf->createFileParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_FILEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createFileParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createFileParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createGroupParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createGroupParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createGroupParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createGroupParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createGroupParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createGroupParam(QString,QString) - GroupParam * cppResult = cppSelf->createGroupParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUPPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createGroupParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createGroupParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createInt2DParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createInt2DParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createInt2DParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createInt2DParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createInt2DParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createInt2DParam(QString,QString) - Int2DParam * cppResult = cppSelf->createInt2DParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_INT2DPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createInt2DParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createInt2DParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createInt3DParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createInt3DParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createInt3DParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createInt3DParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createInt3DParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createInt3DParam(QString,QString) - Int3DParam * cppResult = cppSelf->createInt3DParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_INT3DPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createInt3DParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createInt3DParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createIntParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createIntParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createIntParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createIntParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createIntParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createIntParam(QString,QString) - IntParam * cppResult = cppSelf->createIntParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_INTPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createIntParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createIntParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createOutputFileParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createOutputFileParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createOutputFileParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createOutputFileParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createOutputFileParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createOutputFileParam(QString,QString) - OutputFileParam * cppResult = cppSelf->createOutputFileParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_OUTPUTFILEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createOutputFileParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createOutputFileParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createPageParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createPageParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createPageParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createPageParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createPageParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createPageParam(QString,QString) - PageParam * cppResult = cppSelf->createPageParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PAGEPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createPageParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createPageParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createParametricParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createParametricParam", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createParametricParam(QString,QString,int) - if (numArgs == 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - overloadId = 0; // createParametricParam(QString,QString,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createParametricParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - - if (!PyErr_Occurred()) { - // createParametricParam(QString,QString,int) - ParametricParam * cppResult = cppSelf->createParametricParam(cppArg0, cppArg1, cppArg2); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAMETRICPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createParametricParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createParametricParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createPathParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createPathParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createPathParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createPathParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createPathParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createPathParam(QString,QString) - PathParam * cppResult = cppSelf->createPathParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PATHPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createPathParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createPathParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createSeparatorParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createSeparatorParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createSeparatorParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createSeparatorParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createSeparatorParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createSeparatorParam(QString,QString) - SeparatorParam * cppResult = cppSelf->createSeparatorParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_SEPARATORPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createSeparatorParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createSeparatorParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_createStringParam(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "createStringParam", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: UserParamHolder::createStringParam(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // createStringParam(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_createStringParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // createStringParam(QString,QString) - StringParam * cppResult = cppSelf->createStringParam(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_STRINGPARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_createStringParam_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronEngine.UserParamHolder.createStringParam"); - return {}; -} - -static PyObject *Sbk_UserParamHolderFunc_refreshUserParamsGUI(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // refreshUserParamsGUI() - // Begin code injection - cppSelf->refreshUserParamsGUI(); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_UserParamHolderFunc_removeParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: UserParamHolder::removeParam(Param*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), (pyArg)))) { - overloadId = 0; // removeParam(Param*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_UserParamHolderFunc_removeParam_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::Param *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // removeParam(Param*) - bool cppResult = cppSelf->removeParam(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_UserParamHolderFunc_removeParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronEngine.UserParamHolder.removeParam"); - return {}; -} - - -static const char *Sbk_UserParamHolder_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_UserParamHolder_methods[] = { - {"createBooleanParam", reinterpret_cast(Sbk_UserParamHolderFunc_createBooleanParam), METH_VARARGS}, - {"createButtonParam", reinterpret_cast(Sbk_UserParamHolderFunc_createButtonParam), METH_VARARGS}, - {"createChoiceParam", reinterpret_cast(Sbk_UserParamHolderFunc_createChoiceParam), METH_VARARGS}, - {"createColorParam", reinterpret_cast(Sbk_UserParamHolderFunc_createColorParam), METH_VARARGS}, - {"createDouble2DParam", reinterpret_cast(Sbk_UserParamHolderFunc_createDouble2DParam), METH_VARARGS}, - {"createDouble3DParam", reinterpret_cast(Sbk_UserParamHolderFunc_createDouble3DParam), METH_VARARGS}, - {"createDoubleParam", reinterpret_cast(Sbk_UserParamHolderFunc_createDoubleParam), METH_VARARGS}, - {"createFileParam", reinterpret_cast(Sbk_UserParamHolderFunc_createFileParam), METH_VARARGS}, - {"createGroupParam", reinterpret_cast(Sbk_UserParamHolderFunc_createGroupParam), METH_VARARGS}, - {"createInt2DParam", reinterpret_cast(Sbk_UserParamHolderFunc_createInt2DParam), METH_VARARGS}, - {"createInt3DParam", reinterpret_cast(Sbk_UserParamHolderFunc_createInt3DParam), METH_VARARGS}, - {"createIntParam", reinterpret_cast(Sbk_UserParamHolderFunc_createIntParam), METH_VARARGS}, - {"createOutputFileParam", reinterpret_cast(Sbk_UserParamHolderFunc_createOutputFileParam), METH_VARARGS}, - {"createPageParam", reinterpret_cast(Sbk_UserParamHolderFunc_createPageParam), METH_VARARGS}, - {"createParametricParam", reinterpret_cast(Sbk_UserParamHolderFunc_createParametricParam), METH_VARARGS}, - {"createPathParam", reinterpret_cast(Sbk_UserParamHolderFunc_createPathParam), METH_VARARGS}, - {"createSeparatorParam", reinterpret_cast(Sbk_UserParamHolderFunc_createSeparatorParam), METH_VARARGS}, - {"createStringParam", reinterpret_cast(Sbk_UserParamHolderFunc_createStringParam), METH_VARARGS}, - {"refreshUserParamsGUI", reinterpret_cast(Sbk_UserParamHolderFunc_refreshUserParamsGUI), METH_NOARGS}, - {"removeParam", reinterpret_cast(Sbk_UserParamHolderFunc_removeParam), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_UserParamHolder_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::UserParamHolder *>(Shiboken::Conversions::cppPointer(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_UserParamHolder_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_UserParamHolder_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_UserParamHolder_Type = nullptr; -static SbkObjectType *Sbk_UserParamHolder_TypeF(void) -{ - return _Sbk_UserParamHolder_Type; -} - -static PyType_Slot Sbk_UserParamHolder_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_UserParamHolder_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_UserParamHolder_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_UserParamHolder_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_UserParamHolder_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_UserParamHolder_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_UserParamHolder_spec = { - "1:NatronEngine.UserParamHolder", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_UserParamHolder_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void UserParamHolder_PythonToCpp_UserParamHolder_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_UserParamHolder_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_UserParamHolder_PythonToCpp_UserParamHolder_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_UserParamHolder_TypeF()))) - return UserParamHolder_PythonToCpp_UserParamHolder_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *UserParamHolder_PTR_CppToPython_UserParamHolder(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_UserParamHolder_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *UserParamHolder_SignatureStrings[] = { - "NatronEngine.UserParamHolder(self)", - "NatronEngine.UserParamHolder.createBooleanParam(self,name:QString,label:QString)->NatronEngine.BooleanParam", - "NatronEngine.UserParamHolder.createButtonParam(self,name:QString,label:QString)->NatronEngine.ButtonParam", - "NatronEngine.UserParamHolder.createChoiceParam(self,name:QString,label:QString)->NatronEngine.ChoiceParam", - "NatronEngine.UserParamHolder.createColorParam(self,name:QString,label:QString,useAlpha:bool)->NatronEngine.ColorParam", - "NatronEngine.UserParamHolder.createDouble2DParam(self,name:QString,label:QString)->NatronEngine.Double2DParam", - "NatronEngine.UserParamHolder.createDouble3DParam(self,name:QString,label:QString)->NatronEngine.Double3DParam", - "NatronEngine.UserParamHolder.createDoubleParam(self,name:QString,label:QString)->NatronEngine.DoubleParam", - "NatronEngine.UserParamHolder.createFileParam(self,name:QString,label:QString)->NatronEngine.FileParam", - "NatronEngine.UserParamHolder.createGroupParam(self,name:QString,label:QString)->NatronEngine.GroupParam", - "NatronEngine.UserParamHolder.createInt2DParam(self,name:QString,label:QString)->NatronEngine.Int2DParam", - "NatronEngine.UserParamHolder.createInt3DParam(self,name:QString,label:QString)->NatronEngine.Int3DParam", - "NatronEngine.UserParamHolder.createIntParam(self,name:QString,label:QString)->NatronEngine.IntParam", - "NatronEngine.UserParamHolder.createOutputFileParam(self,name:QString,label:QString)->NatronEngine.OutputFileParam", - "NatronEngine.UserParamHolder.createPageParam(self,name:QString,label:QString)->NatronEngine.PageParam", - "NatronEngine.UserParamHolder.createParametricParam(self,name:QString,label:QString,nbCurves:int)->NatronEngine.ParametricParam", - "NatronEngine.UserParamHolder.createPathParam(self,name:QString,label:QString)->NatronEngine.PathParam", - "NatronEngine.UserParamHolder.createSeparatorParam(self,name:QString,label:QString)->NatronEngine.SeparatorParam", - "NatronEngine.UserParamHolder.createStringParam(self,name:QString,label:QString)->NatronEngine.StringParam", - "NatronEngine.UserParamHolder.refreshUserParamsGUI(self)", - "NatronEngine.UserParamHolder.removeParam(self,param:NatronEngine.Param)->bool", - nullptr}; // Sentinel - -void init_UserParamHolder(PyObject *module) -{ - _Sbk_UserParamHolder_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "UserParamHolder", - "UserParamHolder*", - &Sbk_UserParamHolder_spec, - &Shiboken::callCppDestructor< ::UserParamHolder >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_UserParamHolder_Type); - InitSignatureStrings(pyType, UserParamHolder_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_UserParamHolder_Type), Sbk_UserParamHolder_PropertyStrings); - SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX] - = reinterpret_cast(Sbk_UserParamHolder_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_UserParamHolder_TypeF(), - UserParamHolder_PythonToCpp_UserParamHolder_PTR, - is_UserParamHolder_PythonToCpp_UserParamHolder_PTR_Convertible, - UserParamHolder_PTR_CppToPython_UserParamHolder); - - Shiboken::Conversions::registerConverterName(converter, "UserParamHolder"); - Shiboken::Conversions::registerConverterName(converter, "UserParamHolder*"); - Shiboken::Conversions::registerConverterName(converter, "UserParamHolder&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::UserParamHolder).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::UserParamHolderWrapper).name()); - - - - UserParamHolderWrapper::pysideInitQtMetaTypes(); -} diff --git a/Engine/Qt5/NatronEngine/userparamholder_wrapper.h b/Engine/Qt5/NatronEngine/userparamholder_wrapper.h deleted file mode 100644 index a202648750..0000000000 --- a/Engine/Qt5/NatronEngine/userparamholder_wrapper.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SBK_USERPARAMHOLDERWRAPPER_H -#define SBK_USERPARAMHOLDERWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class UserParamHolderWrapper : public UserParamHolder -{ -public: - UserParamHolderWrapper(); - ~UserParamHolderWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_USERPARAMHOLDERWRAPPER_H - diff --git a/Gui/Qt5/NatronGui/guiapp_wrapper.cpp b/Gui/Qt5/NatronGui/guiapp_wrapper.cpp deleted file mode 100644 index 5672685bdf..0000000000 --- a/Gui/Qt5/NatronGui/guiapp_wrapper.cpp +++ /dev/null @@ -1,1776 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natrongui_python.h" - -// main header -#include "guiapp_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void GuiAppWrapper::pysideInitQtMetaTypes() -{ -} - -void GuiAppWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -GuiAppWrapper::~GuiAppWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_GuiAppFunc_clearSelection(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.clearSelection(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:clearSelection", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::clearSelection(Group*) - if (numArgs == 0) { - overloadId = 0; // clearSelection(Group*) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) { - overloadId = 0; // clearSelection(Group*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_clearSelection_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.clearSelection(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) - goto Sbk_GuiAppFunc_clearSelection_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Group *cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // clearSelection(Group*) - cppSelf->clearSelection(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_clearSelection_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.clearSelection"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_copySelectedNodes(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.copySelectedNodes(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:copySelectedNodes", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::copySelectedNodes(Group*) - if (numArgs == 0) { - overloadId = 0; // copySelectedNodes(Group*) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) { - overloadId = 0; // copySelectedNodes(Group*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_copySelectedNodes_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.copySelectedNodes(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) - goto Sbk_GuiAppFunc_copySelectedNodes_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Group *cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // copySelectedNodes(Group*) - cppSelf->copySelectedNodes(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_copySelectedNodes_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.copySelectedNodes"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_createModalDialog(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // createModalDialog() - PyModalDialog * cppResult = cppSelf->createModalDialog(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX]), cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_GuiAppFunc_deselectNode(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GuiApp::deselectNode(Effect*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), (pyArg)))) { - overloadId = 0; // deselectNode(Effect*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_deselectNode_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::Effect *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // deselectNode(Effect*) - cppSelf->deselectNode(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_deselectNode_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.deselectNode"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_getActiveTabWidget(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getActiveTabWidget()const - PyTabWidget * cppResult = const_cast(cppSelf)->getActiveTabWidget(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_GuiAppFunc_getActiveViewer(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getActiveViewer()const - PyViewer * cppResult = const_cast(cppSelf)->getActiveViewer(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYVIEWER_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_GuiAppFunc_getDirectoryDialog(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getDirectoryDialog(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getDirectoryDialog", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::getDirectoryDialog(QString)const - if (numArgs == 0) { - overloadId = 0; // getDirectoryDialog(QString)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) { - overloadId = 0; // getDirectoryDialog(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_getDirectoryDialog_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","location"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getDirectoryDialog(): got multiple values for keyword argument 'location'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0])))) - goto Sbk_GuiAppFunc_getDirectoryDialog_TypeError; - } - } - } - ::QString cppArg0 = QString(); - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getDirectoryDialog(QString)const - QString cppResult = const_cast(cppSelf)->getDirectoryDialog(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_getDirectoryDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.getDirectoryDialog"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_getFilenameDialog(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getFilenameDialog(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getFilenameDialog(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:getFilenameDialog", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::getFilenameDialog(QStringList,QString)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // getFilenameDialog(QStringList,QString)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // getFilenameDialog(QStringList,QString)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_getFilenameDialog_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","location"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getFilenameDialog(): got multiple values for keyword argument 'location'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) - goto Sbk_GuiAppFunc_getFilenameDialog_TypeError; - } - } - } - ::QStringList cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1 = QString(); - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getFilenameDialog(QStringList,QString)const - QString cppResult = const_cast(cppSelf)->getFilenameDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_getFilenameDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.getFilenameDialog"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_getRGBColorDialog(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getRGBColorDialog()const - ColorTuple* cppResult = new ColorTuple(const_cast(cppSelf)->getRGBColorDialog()); - pyResult = Shiboken::Object::newObject(reinterpret_cast(SbkNatronEngineTypes[SBK_COLORTUPLE_IDX]), cppResult, true, true); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_GuiAppFunc_getSelectedNodes(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getSelectedNodes(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:getSelectedNodes", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::getSelectedNodes(Group*)const - if (numArgs == 0) { - overloadId = 0; // getSelectedNodes(Group*)const - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) { - overloadId = 0; // getSelectedNodes(Group*)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_getSelectedNodes_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getSelectedNodes(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) - goto Sbk_GuiAppFunc_getSelectedNodes_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Group *cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // getSelectedNodes(Group*)const - // Begin code injection - std::list effects = cppSelf->getSelectedNodes(cppArg0); - PyObject* ret = PyList_New((int) effects.size()); - int idx = 0; - for (std::list::iterator it = effects.begin(); it!=effects.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_getSelectedNodes_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.getSelectedNodes"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_getSequenceDialog(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getSequenceDialog(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getSequenceDialog(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:getSequenceDialog", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::getSequenceDialog(QStringList,QString)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // getSequenceDialog(QStringList,QString)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // getSequenceDialog(QStringList,QString)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_getSequenceDialog_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","location"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.getSequenceDialog(): got multiple values for keyword argument 'location'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) - goto Sbk_GuiAppFunc_getSequenceDialog_TypeError; - } - } - } - ::QStringList cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1 = QString(); - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // getSequenceDialog(QStringList,QString)const - QString cppResult = const_cast(cppSelf)->getSequenceDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_getSequenceDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.getSequenceDialog"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_getTabWidget(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GuiApp::getTabWidget(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getTabWidget(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_getTabWidget_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getTabWidget(QString)const - PyTabWidget * cppResult = const_cast(cppSelf)->getTabWidget(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_getTabWidget_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.getTabWidget"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_getUserPanel(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GuiApp::getUserPanel(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getUserPanel(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_getUserPanel_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getUserPanel(QString)const - PyPanel * cppResult = const_cast(cppSelf)->getUserPanel(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]), cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_getUserPanel_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.getUserPanel"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_getViewer(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GuiApp::getViewer(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getViewer(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_getViewer_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getViewer(QString)const - PyViewer * cppResult = const_cast(cppSelf)->getViewer(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYVIEWER_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_getViewer_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.getViewer"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_moveTab(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "moveTab", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::moveTab(QString,PyTabWidget*) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX]), (pyArgs[1])))) { - overloadId = 0; // moveTab(QString,PyTabWidget*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_moveTab_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::PyTabWidget *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // moveTab(QString,PyTabWidget*) - bool cppResult = cppSelf->moveTab(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_moveTab_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.moveTab"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_pasteNodes(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.pasteNodes(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:pasteNodes", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::pasteNodes(Group*) - if (numArgs == 0) { - overloadId = 0; // pasteNodes(Group*) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) { - overloadId = 0; // pasteNodes(Group*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_pasteNodes_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.pasteNodes(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) - goto Sbk_GuiAppFunc_pasteNodes_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Group *cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // pasteNodes(Group*) - cppSelf->pasteNodes(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_pasteNodes_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.pasteNodes"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_registerPythonPanel(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "registerPythonPanel", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::registerPythonPanel(PyPanel*,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // registerPythonPanel(PyPanel*,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_registerPythonPanel_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::PyPanel *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // registerPythonPanel(PyPanel*,QString) - cppSelf->registerPythonPanel(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_registerPythonPanel_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.registerPythonPanel"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_renderBlocking(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 4) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.renderBlocking(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.renderBlocking(): not enough arguments"); - return {}; - } else if (numArgs == 2) - goto Sbk_GuiAppFunc_renderBlocking_TypeError; - - if (!PyArg_ParseTuple(args, "|OOOO:renderBlocking", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::renderBlocking(Effect*,int,int,int) - // 1: GuiApp::renderBlocking(std::list,std::list,std::list,std::list) - if (numArgs >= 3 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2])))) { - if (numArgs == 3) { - overloadId = 0; // renderBlocking(Effect*,int,int,int) - } else if ((pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) { - overloadId = 0; // renderBlocking(Effect*,int,int,int) - } - } else if (numArgs == 1 - && PyList_Check(pyArgs[0])) { - overloadId = 1; // renderBlocking(std::list,std::list,std::list,std::list) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_renderBlocking_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // renderBlocking(Effect * writeNode, int firstFrame, int lastFrame, int frameStep) - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","frameStep"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[3]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.renderBlocking(): got multiple values for keyword argument 'frameStep'."); - return {}; - } - if (value) { - pyArgs[3] = value; - if (!(pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[3])))) - goto Sbk_GuiAppFunc_renderBlocking_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Effect *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - int cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - int cppArg3 = 1; - if (pythonToCpp[3]) pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // renderBlocking(Effect*,int,int,int) - cppSelf->renderBlocking(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - case 1: // renderBlocking(const std::list & effects, const std::list & firstFrames, const std::list & lastFrames, const std::list & frameSteps) - { - - if (!PyErr_Occurred()) { - // renderBlocking(std::list,std::list,std::list,std::list) - // Begin code injection - if (!PyList_Check(pyArgs[1-1])) { - PyErr_SetString(PyExc_TypeError, "tasks must be a list of tuple objects."); - return 0; - } - std::list effects; - - std::list firstFrames; - - std::list lastFrames; - - std::list frameSteps; - - int size = (int)PyList_GET_SIZE(pyArgs[1-1]); - for (int i = 0; i < size; ++i) { - PyObject* tuple = PyList_GET_ITEM(pyArgs[1-1],i); - if (!tuple) { - PyErr_SetString(PyExc_TypeError, "tasks must be a list of tuple objects."); - return 0; - } - - int tupleSize = PyTuple_GET_SIZE(tuple); - if (tupleSize != 4 && tupleSize != 3) { - PyErr_SetString(PyExc_TypeError, "the tuple must have 3 or 4 items."); - return 0; - } - ::Effect* writeNode{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), PyTuple_GET_ITEM(tuple, 0), &(writeNode)); - int firstFrame; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(tuple, 1), &(firstFrame)); - int lastFrame; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(tuple, 2), &(lastFrame)); - int frameStep; - if (tupleSize == 4) { - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), PyTuple_GET_ITEM(tuple, 3), &(frameStep)); - } else { - frameStep = INT_MIN; - } - effects.push_back(writeNode); - firstFrames.push_back(firstFrame); - lastFrames.push_back(lastFrame); - frameSteps.push_back(frameStep); - } - - cppSelf->renderBlocking(effects,firstFrames,lastFrames, frameSteps); - - // End of code injection - - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_renderBlocking_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.renderBlocking"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_saveFilenameDialog(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.saveFilenameDialog(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.saveFilenameDialog(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:saveFilenameDialog", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::saveFilenameDialog(QStringList,QString)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // saveFilenameDialog(QStringList,QString)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // saveFilenameDialog(QStringList,QString)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_saveFilenameDialog_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","location"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.saveFilenameDialog(): got multiple values for keyword argument 'location'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) - goto Sbk_GuiAppFunc_saveFilenameDialog_TypeError; - } - } - } - ::QStringList cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1 = QString(); - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // saveFilenameDialog(QStringList,QString)const - QString cppResult = const_cast(cppSelf)->saveFilenameDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_saveFilenameDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.saveFilenameDialog"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_saveSequenceDialog(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 2) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.saveSequenceDialog(): too many arguments"); - return {}; - } else if (numArgs < 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.saveSequenceDialog(): not enough arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|OO:saveSequenceDialog", &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::saveSequenceDialog(QStringList,QString)const - if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRINGLIST_IDX], (pyArgs[0])))) { - if (numArgs == 1) { - overloadId = 0; // saveSequenceDialog(QStringList,QString)const - } else if ((pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // saveSequenceDialog(QStringList,QString)const - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_saveSequenceDialog_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","location"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[1]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.saveSequenceDialog(): got multiple values for keyword argument 'location'."); - return {}; - } - if (value) { - pyArgs[1] = value; - if (!(pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) - goto Sbk_GuiAppFunc_saveSequenceDialog_TypeError; - } - } - } - ::QStringList cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1 = QString(); - if (pythonToCpp[1]) pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // saveSequenceDialog(QStringList,QString)const - QString cppResult = const_cast(cppSelf)->saveSequenceDialog(cppArg0, cppArg1); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_GuiAppFunc_saveSequenceDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.saveSequenceDialog"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_selectAllNodes(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.selectAllNodes(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:selectAllNodes", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::selectAllNodes(Group*) - if (numArgs == 0) { - overloadId = 0; // selectAllNodes(Group*) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) { - overloadId = 0; // selectAllNodes(Group*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_selectAllNodes_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","group"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.GuiApp.selectAllNodes(): got multiple values for keyword argument 'group'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_GROUP_IDX]), (pyArgs[0])))) - goto Sbk_GuiAppFunc_selectAllNodes_TypeError; - } - } - } - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Group *cppArg0 = 0; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // selectAllNodes(Group*) - cppSelf->selectAllNodes(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_selectAllNodes_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.selectAllNodes"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_selectNode(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "selectNode", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: GuiApp::selectNode(Effect*,bool) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // selectNode(Effect*,bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_selectNode_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArgs[0])) - return {}; - ::Effect *cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - bool cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // selectNode(Effect*,bool) - cppSelf->selectNode(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_selectNode_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.GuiApp.selectNode"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_setSelection(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GuiApp::setSelection(std::list) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_EFFECTPTR_IDX], (pyArg)))) { - overloadId = 0; // setSelection(std::list) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_setSelection_TypeError; - - // Call function/method - { - ::std::list cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setSelection(std::list) - cppSelf->setSelection(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_setSelection_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.setSelection"); - return {}; -} - -static PyObject *Sbk_GuiAppFunc_unregisterPythonPanel(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: GuiApp::unregisterPythonPanel(PyPanel*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]), (pyArg)))) { - overloadId = 0; // unregisterPythonPanel(PyPanel*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_GuiAppFunc_unregisterPythonPanel_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::PyPanel *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // unregisterPythonPanel(PyPanel*) - cppSelf->unregisterPythonPanel(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_GuiAppFunc_unregisterPythonPanel_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.GuiApp.unregisterPythonPanel"); - return {}; -} - - -static const char *Sbk_GuiApp_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_GuiApp_methods[] = { - {"clearSelection", reinterpret_cast(Sbk_GuiAppFunc_clearSelection), METH_VARARGS|METH_KEYWORDS}, - {"copySelectedNodes", reinterpret_cast(Sbk_GuiAppFunc_copySelectedNodes), METH_VARARGS|METH_KEYWORDS}, - {"createModalDialog", reinterpret_cast(Sbk_GuiAppFunc_createModalDialog), METH_NOARGS}, - {"deselectNode", reinterpret_cast(Sbk_GuiAppFunc_deselectNode), METH_O}, - {"getActiveTabWidget", reinterpret_cast(Sbk_GuiAppFunc_getActiveTabWidget), METH_NOARGS}, - {"getActiveViewer", reinterpret_cast(Sbk_GuiAppFunc_getActiveViewer), METH_NOARGS}, - {"getDirectoryDialog", reinterpret_cast(Sbk_GuiAppFunc_getDirectoryDialog), METH_VARARGS|METH_KEYWORDS}, - {"getFilenameDialog", reinterpret_cast(Sbk_GuiAppFunc_getFilenameDialog), METH_VARARGS|METH_KEYWORDS}, - {"getRGBColorDialog", reinterpret_cast(Sbk_GuiAppFunc_getRGBColorDialog), METH_NOARGS}, - {"getSelectedNodes", reinterpret_cast(Sbk_GuiAppFunc_getSelectedNodes), METH_VARARGS|METH_KEYWORDS}, - {"getSequenceDialog", reinterpret_cast(Sbk_GuiAppFunc_getSequenceDialog), METH_VARARGS|METH_KEYWORDS}, - {"getTabWidget", reinterpret_cast(Sbk_GuiAppFunc_getTabWidget), METH_O}, - {"getUserPanel", reinterpret_cast(Sbk_GuiAppFunc_getUserPanel), METH_O}, - {"getViewer", reinterpret_cast(Sbk_GuiAppFunc_getViewer), METH_O}, - {"moveTab", reinterpret_cast(Sbk_GuiAppFunc_moveTab), METH_VARARGS}, - {"pasteNodes", reinterpret_cast(Sbk_GuiAppFunc_pasteNodes), METH_VARARGS|METH_KEYWORDS}, - {"registerPythonPanel", reinterpret_cast(Sbk_GuiAppFunc_registerPythonPanel), METH_VARARGS}, - {"renderBlocking", reinterpret_cast(Sbk_GuiAppFunc_renderBlocking), METH_VARARGS|METH_KEYWORDS}, - {"saveFilenameDialog", reinterpret_cast(Sbk_GuiAppFunc_saveFilenameDialog), METH_VARARGS|METH_KEYWORDS}, - {"saveSequenceDialog", reinterpret_cast(Sbk_GuiAppFunc_saveSequenceDialog), METH_VARARGS|METH_KEYWORDS}, - {"selectAllNodes", reinterpret_cast(Sbk_GuiAppFunc_selectAllNodes), METH_VARARGS|METH_KEYWORDS}, - {"selectNode", reinterpret_cast(Sbk_GuiAppFunc_selectNode), METH_VARARGS}, - {"setSelection", reinterpret_cast(Sbk_GuiAppFunc_setSelection), METH_O}, - {"unregisterPythonPanel", reinterpret_cast(Sbk_GuiAppFunc_unregisterPythonPanel), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_GuiApp_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::GuiApp *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_GUIAPP_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_GuiApp_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_GuiApp_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_GuiApp_Type = nullptr; -static SbkObjectType *Sbk_GuiApp_TypeF(void) -{ - return _Sbk_GuiApp_Type; -} - -static PyType_Slot Sbk_GuiApp_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_GuiApp_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_GuiApp_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_GuiApp_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_GuiApp_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_GuiApp_spec = { - "1:NatronGui.GuiApp", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_GuiApp_slots -}; - -} //extern "C" - -static void *Sbk_GuiApp_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::Group >())) - return dynamic_cast< ::GuiApp *>(reinterpret_cast< ::Group *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void GuiApp_PythonToCpp_GuiApp_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_GuiApp_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_GuiApp_PythonToCpp_GuiApp_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_GuiApp_TypeF()))) - return GuiApp_PythonToCpp_GuiApp_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *GuiApp_PTR_CppToPython_GuiApp(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_GuiApp_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *GuiApp_SignatureStrings[] = { - "NatronGui.GuiApp.clearSelection(self,group:NatronEngine.Group=0)", - "NatronGui.GuiApp.copySelectedNodes(self,group:NatronEngine.Group=0)", - "NatronGui.GuiApp.createModalDialog(self)->NatronGui.PyModalDialog", - "NatronGui.GuiApp.deselectNode(self,effect:NatronEngine.Effect)", - "NatronGui.GuiApp.getActiveTabWidget(self)->NatronGui.PyTabWidget", - "NatronGui.GuiApp.getActiveViewer(self)->NatronGui.PyViewer", - "NatronGui.GuiApp.getDirectoryDialog(self,location:QString=QString())->QString", - "NatronGui.GuiApp.getFilenameDialog(self,filters:QStringList,location:QString=QString())->QString", - "NatronGui.GuiApp.getRGBColorDialog(self)->NatronEngine.ColorTuple", - "NatronGui.GuiApp.getSelectedNodes(self,group:NatronEngine.Group=0)->std.list[NatronEngine.Effect]", - "NatronGui.GuiApp.getSequenceDialog(self,filters:QStringList,location:QString=QString())->QString", - "NatronGui.GuiApp.getTabWidget(self,name:QString)->NatronGui.PyTabWidget", - "NatronGui.GuiApp.getUserPanel(self,scriptName:QString)->NatronGui.PyPanel", - "NatronGui.GuiApp.getViewer(self,scriptName:QString)->NatronGui.PyViewer", - "NatronGui.GuiApp.moveTab(self,scriptName:QString,pane:NatronGui.PyTabWidget)->bool", - "NatronGui.GuiApp.pasteNodes(self,group:NatronEngine.Group=0)", - "NatronGui.GuiApp.registerPythonPanel(self,panel:NatronGui.PyPanel,pythonFunction:QString)", - "1:NatronGui.GuiApp.renderBlocking(self,writeNode:NatronEngine.Effect,firstFrame:int,lastFrame:int,frameStep:int=1)", - "0:NatronGui.GuiApp.renderBlocking(self,effects:std.list[NatronEngine.Effect],firstFrames:std.list[int],lastFrames:std.list[int],frameSteps:std.list[int])", - "NatronGui.GuiApp.saveFilenameDialog(self,filters:QStringList,location:QString=QString())->QString", - "NatronGui.GuiApp.saveSequenceDialog(self,filters:QStringList,location:QString=QString())->QString", - "NatronGui.GuiApp.selectAllNodes(self,group:NatronEngine.Group=0)", - "NatronGui.GuiApp.selectNode(self,effect:NatronEngine.Effect,clearPreviousSelection:bool)", - "NatronGui.GuiApp.setSelection(self,nodes:std.list[NatronEngine.Effect])", - "NatronGui.GuiApp.unregisterPythonPanel(self,panel:NatronGui.PyPanel)", - nullptr}; // Sentinel - -void init_GuiApp(PyObject *module) -{ - _Sbk_GuiApp_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "GuiApp", - "GuiApp*", - &Sbk_GuiApp_spec, - &Shiboken::callCppDestructor< ::GuiApp >, - reinterpret_cast(SbkNatronEngineTypes[SBK_APP_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_GuiApp_Type); - InitSignatureStrings(pyType, GuiApp_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_GuiApp_Type), Sbk_GuiApp_PropertyStrings); - SbkNatronGuiTypes[SBK_GUIAPP_IDX] - = reinterpret_cast(Sbk_GuiApp_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_GuiApp_TypeF(), - GuiApp_PythonToCpp_GuiApp_PTR, - is_GuiApp_PythonToCpp_GuiApp_PTR_Convertible, - GuiApp_PTR_CppToPython_GuiApp); - - Shiboken::Conversions::registerConverterName(converter, "GuiApp"); - Shiboken::Conversions::registerConverterName(converter, "GuiApp*"); - Shiboken::Conversions::registerConverterName(converter, "GuiApp&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::GuiApp).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::GuiAppWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_GuiApp_TypeF(), &Sbk_GuiApp_typeDiscovery); - - - GuiAppWrapper::pysideInitQtMetaTypes(); -} diff --git a/Gui/Qt5/NatronGui/guiapp_wrapper.h b/Gui/Qt5/NatronGui/guiapp_wrapper.h deleted file mode 100644 index 95322a51ae..0000000000 --- a/Gui/Qt5/NatronGui/guiapp_wrapper.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef SBK_GUIAPPWRAPPER_H -#define SBK_GUIAPPWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -#include -#include -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class GuiAppWrapper : public GuiApp -{ -public: - ~GuiAppWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_APPWRAPPER_H -# define SBK_APPWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class AppWrapper : public App -{ -public: - inline void renderInternal_protected(bool forceBlocking, Effect * writeNode, int firstFrame, int lastFrame, int frameStep) { App::renderInternal(forceBlocking, writeNode, firstFrame, lastFrame, frameStep); } - inline void renderInternal_protected(bool forceBlocking, const std::list & effects, const std::list & firstFrames, const std::list & lastFrames, const std::list & frameSteps) { App::renderInternal(forceBlocking, effects, firstFrames, lastFrames, frameSteps); } - ~AppWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_APPWRAPPER_H - -# ifndef SBK_GROUPWRAPPER_H -# define SBK_GROUPWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class GroupWrapper : public Group -{ -public: - GroupWrapper(); - ~GroupWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_GROUPWRAPPER_H - -#endif // SBK_GUIAPPWRAPPER_H - diff --git a/Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp b/Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp deleted file mode 100644 index ba356f1648..0000000000 --- a/Gui/Qt5/NatronGui/natrongui_module_wrapper.cpp +++ /dev/null @@ -1,507 +0,0 @@ - -#include -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#include -#include -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include "natrongui_python.h" - - - -// Extra includes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Current module's type array. -PyTypeObject **SbkNatronGuiTypes = nullptr; -// Current module's PyObject pointer. -PyObject *SbkNatronGuiModuleObject = nullptr; -// Current module's converter array. -SbkConverter **SbkNatronGuiTypeConverters = nullptr; -void cleanGuiTypesAttributes(void) { - if (PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03060000) - return; // PYSIDE-953: testbinding crashes in Python 3.5 when hasattr touches types! - for (int i = 0, imax = SBK_NatronGui_IDX_COUNT; i < imax; i++) { - PyObject *pyType = reinterpret_cast(SbkNatronGuiTypes[i]); - Shiboken::AutoDecRef attrName(Py_BuildValue("s", "staticMetaObject")); - if (pyType && PyObject_HasAttr(pyType, attrName)) - PyObject_SetAttr(pyType, attrName, Py_None); - } -} -// Global functions ------------------------------------------------------------ - -static PyMethodDef NatronGui_methods[] = { - {0} // Sentinel -}; - -// Classes initialization functions ------------------------------------------------------------ -void init_PyViewer(PyObject *module); -void init_PyTabWidget(PyObject *module); -void init_PyModalDialog(PyObject *module); -void init_PyPanel(PyObject *module); -void init_PyGuiApplication(PyObject *module); -void init_GuiApp(PyObject *module); - -// Required modules' type and converter arrays. -PyTypeObject **SbkPySide2_QtGuiTypes; -SbkConverter **SbkPySide2_QtGuiTypeConverters; -PyTypeObject **SbkPySide2_QtWidgetsTypes; -SbkConverter **SbkPySide2_QtWidgetsTypeConverters; - -// Module initialization ------------------------------------------------------------ -// Container Type converters. - -// C++ to Python conversion for type 'const std::map &'. -static PyObject *_conststd_map_QString_NodeCreationPropertyPTR_REF_CppToPython__conststd_map_QString_NodeCreationPropertyPTR_REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::map *>(const_cast(cppIn)); - // TEMPLATE - stdMapToPyDict - START - PyObject* pyOut = PyDict_New(); - ::std::map::const_iterator it = cppInRef.begin(); - for (; it != cppInRef.end(); ++it) { - ::QString key = it->first; - ::NodeCreationProperty* value = it->second; - PyObject* pyKey = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &key); - PyObject* pyValue = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), value); - PyDict_SetItem(pyOut, pyKey, pyValue); - Py_DECREF(pyKey); - Py_DECREF(pyValue); - } - return pyOut; - // TEMPLATE - stdMapToPyDict - END - -} -static void _conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp__conststd_map_QString_NodeCreationPropertyPTR_REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::map *>(cppOut); - // TEMPLATE - pyDictToStdMap - START - PyObject* key; - PyObject* value; - Py_ssize_t pos = 0; - while (PyDict_Next(pyIn, &pos, &key, &value)) { - ::QString cppKey; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], key, &(cppKey)); - ::NodeCreationProperty* cppValue{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX]), value, &(cppValue)); - cppOutRef.insert(std::make_pair(cppKey, cppValue)); - } - // TEMPLATE - pyDictToStdMap - END - -} -static PythonToCppFunc is__conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp__conststd_map_QString_NodeCreationPropertyPTR_REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleDictTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], false, *PepType_SGTP(SbkNatronEngineTypes[SBK_NODECREATIONPROPERTY_IDX])->converter, true, pyIn)) - return _conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp__conststd_map_QString_NodeCreationPropertyPTR_REF; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *_std_list_EffectPTR__CppToPython__std_list_EffectPTR_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::Effect* cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void _std_list_EffectPTR__PythonToCpp__std_list_EffectPTR_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::Effect* cppItem{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_EFFECT_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is__std_list_EffectPTR__PythonToCpp__std_list_EffectPTR__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::checkSequenceTypes(SbkNatronEngineTypes[SBK_EFFECT_IDX], pyIn)) - return _std_list_EffectPTR__PythonToCpp__std_list_EffectPTR_; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *_std_list_QString__CppToPython__std_list_QString_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::QString cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void _std_list_QString__PythonToCpp__std_list_QString_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::QString cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is__std_list_QString__PythonToCpp__std_list_QString__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyIn)) - return _std_list_QString__PythonToCpp__std_list_QString_; - return {}; -} - -// C++ to Python conversion for type 'const std::list &'. -static PyObject *_conststd_list_int_REF_CppToPython__conststd_list_int_REF(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - int cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void _conststd_list_int_REF_PythonToCpp__conststd_list_int_REF(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - int cppItem; - Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter(), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is__conststd_list_int_REF_PythonToCpp__conststd_list_int_REF_Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(Shiboken::Conversions::PrimitiveTypeConverter(), pyIn)) - return _conststd_list_int_REF_PythonToCpp__conststd_list_int_REF; - return {}; -} - -// C++ to Python conversion for type 'std::list'. -static PyObject *_std_list_ParamPTR__CppToPython__std_list_ParamPTR_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::std::list *>(const_cast(cppIn)); - // TEMPLATE - stdListToPyList - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::std::list::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::Param* cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppItem)); - } - return pyOut; - // TEMPLATE - stdListToPyList - END - -} -static void _std_list_ParamPTR__PythonToCpp__std_list_ParamPTR_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::std::list *>(cppOut); - // TEMPLATE - pyListToStdList - START - for (int i = 0; i < PySequence_Size(pyIn); i++) { - Shiboken::AutoDecRef pyItem(PySequence_GetItem(pyIn, i)); - ::Param* cppItem{nullptr}; - Shiboken::Conversions::pythonToCppPointer(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), pyItem, &(cppItem)); - cppOutRef.push_back(cppItem); - } - // TEMPLATE - pyListToStdList - END - -} -static PythonToCppFunc is__std_list_ParamPTR__PythonToCpp__std_list_ParamPTR__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::checkSequenceTypes(SbkNatronEngineTypes[SBK_PARAM_IDX], pyIn)) - return _std_list_ParamPTR__PythonToCpp__std_list_ParamPTR_; - return {}; -} - -// C++ to Python conversion for type 'QList'. -static PyObject *_QList_QVariant__CppToPython__QList_QVariant_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::QList *>(const_cast(cppIn)); - // TEMPLATE - cpplist_to_pylist_conversion - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::QList::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::QVariant cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - cpplist_to_pylist_conversion - END - -} -static void _QList_QVariant__PythonToCpp__QList_QVariant_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::QList *>(cppOut); - // TEMPLATE - pyseq_to_cpplist_conversion - START - // PYSIDE-795: Turn all sequences into iterables. - Shiboken::AutoDecRef it(PyObject_GetIter(pyIn)); - PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext; - for (;;) { - Shiboken::AutoDecRef pyItem(iternext(it)); - if (pyItem.isNull()) { - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) - PyErr_Clear(); - break; - } - ::QVariant cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], pyItem, &(cppItem)); - cppOutRef << cppItem; - } - // TEMPLATE - pyseq_to_cpplist_conversion - END - -} -static PythonToCppFunc is__QList_QVariant__PythonToCpp__QList_QVariant__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], pyIn)) - return _QList_QVariant__PythonToCpp__QList_QVariant_; - return {}; -} - -// C++ to Python conversion for type 'QList'. -static PyObject *_QList_QString__CppToPython__QList_QString_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::QList *>(const_cast(cppIn)); - // TEMPLATE - cpplist_to_pylist_conversion - START - PyObject* pyOut = PyList_New((int) cppInRef.size()); - ::QList::const_iterator it = cppInRef.begin(); - for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { - ::QString cppItem(*it); - PyList_SET_ITEM(pyOut, idx, Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppItem)); - } - return pyOut; - // TEMPLATE - cpplist_to_pylist_conversion - END - -} -static void _QList_QString__PythonToCpp__QList_QString_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::QList *>(cppOut); - // TEMPLATE - pyseq_to_cpplist_conversion - START - // PYSIDE-795: Turn all sequences into iterables. - Shiboken::AutoDecRef it(PyObject_GetIter(pyIn)); - PyObject *(*iternext)(PyObject *) = *Py_TYPE(it)->tp_iternext; - for (;;) { - Shiboken::AutoDecRef pyItem(iternext(it)); - if (pyItem.isNull()) { - if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) - PyErr_Clear(); - break; - } - ::QString cppItem; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyItem, &(cppItem)); - cppOutRef << cppItem; - } - // TEMPLATE - pyseq_to_cpplist_conversion - END - -} -static PythonToCppFunc is__QList_QString__PythonToCpp__QList_QString__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleSequenceTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyIn)) - return _QList_QString__PythonToCpp__QList_QString_; - return {}; -} - -// C++ to Python conversion for type 'QMap'. -static PyObject *_QMap_QString_QVariant__CppToPython__QMap_QString_QVariant_(const void *cppIn) { - auto &cppInRef = *reinterpret_cast<::QMap *>(const_cast(cppIn)); - // TEMPLATE - cppmap_to_pymap_conversion - START - PyObject *pyOut = PyDict_New(); - for (::QMap::const_iterator it = cppInRef.begin(), end = cppInRef.end(); it != end; ++it) { - ::QString key = it.key(); - ::QVariant value = it.value(); - PyObject *pyKey = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &key); - PyObject *pyValue = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], &value); - PyDict_SetItem(pyOut, pyKey, pyValue); - Py_DECREF(pyKey); - Py_DECREF(pyValue); - } - return pyOut; - // TEMPLATE - cppmap_to_pymap_conversion - END - -} -static void _QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant_(PyObject *pyIn, void *cppOut) { - auto &cppOutRef = *reinterpret_cast<::QMap *>(cppOut); - // TEMPLATE - pydict_to_cppmap_conversion - START - PyObject *key; - PyObject *value; - Py_ssize_t pos = 0; - while (PyDict_Next(pyIn, &pos, &key, &value)) { - ::QString cppKey; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], key, &(cppKey)); - ::QVariant cppValue; - Shiboken::Conversions::pythonToCppCopy(SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], value, &(cppValue)); - cppOutRef.insert(cppKey, cppValue); - } - // TEMPLATE - pydict_to_cppmap_conversion - END - -} -static PythonToCppFunc is__QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant__Convertible(PyObject *pyIn) { - if (Shiboken::Conversions::convertibleDictTypes(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], false, SbkPySide2_QtCoreTypeConverters[SBK_QVARIANT_IDX], false, pyIn)) - return _QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant_; - return {}; -} - - -#ifdef IS_PY3K -static struct PyModuleDef moduledef = { - /* m_base */ PyModuleDef_HEAD_INIT, - /* m_name */ "NatronGui", - /* m_doc */ nullptr, - /* m_size */ -1, - /* m_methods */ NatronGui_methods, - /* m_reload */ nullptr, - /* m_traverse */ nullptr, - /* m_clear */ nullptr, - /* m_free */ nullptr -}; - -#endif - -// The signatures string for the global functions. -// Multiple signatures have their index "n:" in front. -static const char *NatronGui_SignatureStrings[] = { - nullptr}; // Sentinel - -SBK_MODULE_INIT_FUNCTION_BEGIN(NatronGui) - { - Shiboken::AutoDecRef requiredModule(Shiboken::Module::import("PySide2.QtGui")); - if (requiredModule.isNull()) - return SBK_MODULE_INIT_ERROR; - SbkPySide2_QtGuiTypes = Shiboken::Module::getTypes(requiredModule); - SbkPySide2_QtGuiTypeConverters = Shiboken::Module::getTypeConverters(requiredModule); - } - - { - Shiboken::AutoDecRef requiredModule(Shiboken::Module::import("PySide2.QtCore")); - if (requiredModule.isNull()) - return SBK_MODULE_INIT_ERROR; - SbkPySide2_QtCoreTypes = Shiboken::Module::getTypes(requiredModule); - SbkPySide2_QtCoreTypeConverters = Shiboken::Module::getTypeConverters(requiredModule); - } - - { - Shiboken::AutoDecRef requiredModule(Shiboken::Module::import("PySide2.QtWidgets")); - if (requiredModule.isNull()) - return SBK_MODULE_INIT_ERROR; - SbkPySide2_QtWidgetsTypes = Shiboken::Module::getTypes(requiredModule); - SbkPySide2_QtWidgetsTypeConverters = Shiboken::Module::getTypeConverters(requiredModule); - } - - { - Shiboken::AutoDecRef requiredModule(Shiboken::Module::import("NatronEngine")); - if (requiredModule.isNull()) - return SBK_MODULE_INIT_ERROR; - SbkNatronEngineTypes = Shiboken::Module::getTypes(requiredModule); - SbkNatronEngineTypeConverters = Shiboken::Module::getTypeConverters(requiredModule); - } - - // Create an array of wrapper types for the current module. - static PyTypeObject *cppApi[SBK_NatronGui_IDX_COUNT]; - SbkNatronGuiTypes = cppApi; - - // Create an array of primitive type converters for the current module. - static SbkConverter *sbkConverters[SBK_NatronGui_CONVERTERS_IDX_COUNT]; - SbkNatronGuiTypeConverters = sbkConverters; - -#ifdef IS_PY3K - PyObject *module = Shiboken::Module::create("NatronGui", &moduledef); -#else - PyObject *module = Shiboken::Module::create("NatronGui", NatronGui_methods); -#endif - - // Make module available from global scope - SbkNatronGuiModuleObject = module; - - // Initialize classes in the type system - init_PyViewer(module); - init_PyTabWidget(module); - init_PyModalDialog(module); - init_PyPanel(module); - init_PyGuiApplication(module); - init_GuiApp(module); - - // Register converter for type 'const std::map&'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX] = Shiboken::Conversions::createConverter(&PyDict_Type, _conststd_map_QString_NodeCreationPropertyPTR_REF_CppToPython__conststd_map_QString_NodeCreationPropertyPTR_REF); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], "const std::map&"); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], "std::map"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX], - _conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp__conststd_map_QString_NodeCreationPropertyPTR_REF, - is__conststd_map_QString_NodeCreationPropertyPTR_REF_PythonToCpp__conststd_map_QString_NodeCreationPropertyPTR_REF_Convertible); - - // Register converter for type 'std::list'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_EFFECTPTR_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _std_list_EffectPTR__CppToPython__std_list_EffectPTR_); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_EFFECTPTR_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_EFFECTPTR_IDX], - _std_list_EffectPTR__PythonToCpp__std_list_EffectPTR_, - is__std_list_EffectPTR__PythonToCpp__std_list_EffectPTR__Convertible); - - // Register converter for type 'std::list'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _std_list_QString__CppToPython__std_list_QString_); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_QSTRING_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_QSTRING_IDX], - _std_list_QString__PythonToCpp__std_list_QString_, - is__std_list_QString__PythonToCpp__std_list_QString__Convertible); - - // Register converter for type 'const std::list&'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_INT_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _conststd_list_int_REF_CppToPython__conststd_list_int_REF); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_INT_IDX], "const std::list&"); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_INT_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_INT_IDX], - _conststd_list_int_REF_PythonToCpp__conststd_list_int_REF, - is__conststd_list_int_REF_PythonToCpp__conststd_list_int_REF_Convertible); - - // Register converter for type 'std::list'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_PARAMPTR_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _std_list_ParamPTR__CppToPython__std_list_ParamPTR_); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_PARAMPTR_IDX], "std::list"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_STD_LIST_PARAMPTR_IDX], - _std_list_ParamPTR__PythonToCpp__std_list_ParamPTR_, - is__std_list_ParamPTR__PythonToCpp__std_list_ParamPTR__Convertible); - - // Register converter for type 'QList'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_QLIST_QVARIANT_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _QList_QVariant__CppToPython__QList_QVariant_); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_QLIST_QVARIANT_IDX], "QList"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_QLIST_QVARIANT_IDX], - _QList_QVariant__PythonToCpp__QList_QVariant_, - is__QList_QVariant__PythonToCpp__QList_QVariant__Convertible); - - // Register converter for type 'QList'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_QLIST_QSTRING_IDX] = Shiboken::Conversions::createConverter(&PyList_Type, _QList_QString__CppToPython__QList_QString_); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_QLIST_QSTRING_IDX], "QList"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_QLIST_QSTRING_IDX], - _QList_QString__PythonToCpp__QList_QString_, - is__QList_QString__PythonToCpp__QList_QString__Convertible); - - // Register converter for type 'QMap'. - SbkNatronGuiTypeConverters[SBK_NATRONGUI_QMAP_QSTRING_QVARIANT_IDX] = Shiboken::Conversions::createConverter(&PyDict_Type, _QMap_QString_QVariant__CppToPython__QMap_QString_QVariant_); - Shiboken::Conversions::registerConverterName(SbkNatronGuiTypeConverters[SBK_NATRONGUI_QMAP_QSTRING_QVARIANT_IDX], "QMap"); - Shiboken::Conversions::addPythonToCppValueConversion(SbkNatronGuiTypeConverters[SBK_NATRONGUI_QMAP_QSTRING_QVARIANT_IDX], - _QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant_, - is__QMap_QString_QVariant__PythonToCpp__QMap_QString_QVariant__Convertible); - - // Register primitive types converters. - - Shiboken::Module::registerTypes(module, SbkNatronGuiTypes); - Shiboken::Module::registerTypeConverters(module, SbkNatronGuiTypeConverters); - - if (PyErr_Occurred()) { - PyErr_Print(); - Py_FatalError("can't initialize module NatronGui"); - } - PySide::registerCleanupFunction(cleanGuiTypesAttributes); - - FinishSignatureInitialization(module, NatronGui_SignatureStrings); - -SBK_MODULE_INIT_FUNCTION_END diff --git a/Gui/Qt5/NatronGui/natrongui_python.h b/Gui/Qt5/NatronGui/natrongui_python.h deleted file mode 100644 index 87a653bd05..0000000000 --- a/Gui/Qt5/NatronGui/natrongui_python.h +++ /dev/null @@ -1,104 +0,0 @@ - - -#ifndef SBK_NATRONGUI_PYTHON_H -#define SBK_NATRONGUI_PYTHON_H - -#include -#include -// Module Includes -CLANG_DIAG_OFF(deprecated) -CLANG_DIAG_OFF(uninitialized) -CLANG_DIAG_OFF(keyword-macro) -#include // produces warnings -CLANG_DIAG_ON(deprecated) -CLANG_DIAG_ON(uninitialized) -CLANG_DIAG_ON(keyword-macro) -CLANG_DIAG_OFF(deprecated) -CLANG_DIAG_OFF(uninitialized) -CLANG_DIAG_OFF(keyword-macro) -#include // produces warnings -CLANG_DIAG_ON(deprecated) -CLANG_DIAG_ON(uninitialized) -CLANG_DIAG_ON(keyword-macro) -#include -#include - -// Bound library includes -#include -#include -#include -// Conversion Includes - Primitive Types -#include -#include -#include -#include - -// Conversion Includes - Container Types -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Type indices -enum : int { - SBK_GUIAPP_IDX = 0, - SBK_PYGUIAPPLICATION_IDX = 1, - SBK_PYMODALDIALOG_IDX = 2, - SBK_PYPANEL_IDX = 3, - SBK_PYTABWIDGET_IDX = 4, - SBK_PYVIEWER_IDX = 5, - SBK_NatronGui_IDX_COUNT = 6 -}; -// This variable stores all Python types exported by this module. -extern PyTypeObject **SbkNatronGuiTypes; - -// This variable stores the Python module object exported by this module. -extern PyObject *SbkNatronGuiModuleObject; - -// This variable stores all type converters exported by this module. -extern SbkConverter **SbkNatronGuiTypeConverters; - -// Converter indices -enum : int { - SBK_NATRONGUI_STD_MAP_QSTRING_NODECREATIONPROPERTYPTR_IDX = 0, // const std::map & - SBK_NATRONGUI_STD_LIST_EFFECTPTR_IDX = 1, // std::list - SBK_NATRONGUI_STD_LIST_QSTRING_IDX = 2, // std::list - SBK_NATRONGUI_STD_LIST_INT_IDX = 3, // const std::list & - SBK_NATRONGUI_STD_LIST_PARAMPTR_IDX = 4, // std::list - SBK_NATRONGUI_QLIST_QVARIANT_IDX = 5, // QList - SBK_NATRONGUI_QLIST_QSTRING_IDX = 6, // QList - SBK_NATRONGUI_QMAP_QSTRING_QVARIANT_IDX = 7, // QMap - SBK_NatronGui_CONVERTERS_IDX_COUNT = 8 -}; -// Macros for type check - -namespace Shiboken -{ - -// PyType functions, to get the PyObjectType for a type T -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_GUIAPP_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX]); } -template<> inline PyTypeObject *SbkType() { return reinterpret_cast(SbkNatronGuiTypes[SBK_PYVIEWER_IDX]); } -QT_WARNING_POP - -} // namespace Shiboken - -#endif // SBK_NATRONGUI_PYTHON_H - diff --git a/Gui/Qt5/NatronGui/pyguiapplication_wrapper.cpp b/Gui/Qt5/NatronGui/pyguiapplication_wrapper.cpp deleted file mode 100644 index f3a90c6d75..0000000000 --- a/Gui/Qt5/NatronGui/pyguiapplication_wrapper.cpp +++ /dev/null @@ -1,685 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natrongui_python.h" - -// main header -#include "pyguiapplication_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void PyGuiApplicationWrapper::pysideInitQtMetaTypes() -{ -} - -void PyGuiApplicationWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -PyGuiApplicationWrapper::PyGuiApplicationWrapper() : PyGuiApplication() -{ - resetPyMethodCache(); - // ... middle -} - -PyGuiApplicationWrapper::~PyGuiApplicationWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_PyGuiApplication_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::PyGuiApplication >())) - return -1; - - ::PyGuiApplicationWrapper *cptr{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // PyGuiApplication() - cptr = new ::PyGuiApplicationWrapper(); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::PyGuiApplication >(), cptr)) { - delete cptr; - return -1; - } - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; -} - -static PyObject *Sbk_PyGuiApplicationFunc_addMenuCommand(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - if (numArgs == 3) - goto Sbk_PyGuiApplicationFunc_addMenuCommand_TypeError; - - if (!PyArg_UnpackTuple(args, "addMenuCommand", 2, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return {}; - - - // Overloaded function decisor - // 0: PyGuiApplication::addMenuCommand(QString,QString) - // 1: PyGuiApplication::addMenuCommand(QString,QString,Qt::Key,QFlags) - if (numArgs >= 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - if (numArgs == 2) { - overloadId = 0; // addMenuCommand(QString,QString) - } else if (numArgs == 4 - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkPySide2_QtCoreTypes[SBK_QT_KEY_IDX])->converter, (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkPySide2_QtCoreTypes[SBK_QFLAGS_QT_KEYBOARDMODIFIER_IDX])->converter, (pyArgs[3])))) { - overloadId = 1; // addMenuCommand(QString,QString,Qt::Key,QFlags) - } - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyGuiApplicationFunc_addMenuCommand_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // addMenuCommand(const QString & grouping, const QString & pythonFunctionName) - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // addMenuCommand(QString,QString) - cppSelf->addMenuCommand(cppArg0, cppArg1); - } - break; - } - case 1: // addMenuCommand(const QString & grouping, const QString & pythonFunctionName, Qt::Key key, const QFlags & modifiers) - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - ::Qt::Key cppArg2 = static_cast< ::Qt::Key>(0); - pythonToCpp[2](pyArgs[2], &cppArg2); - ::QFlags cppArg3 = QFlags(0); - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // addMenuCommand(QString,QString,Qt::Key,QFlags) - cppSelf->addMenuCommand(cppArg0, cppArg1, cppArg2, cppArg3); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyGuiApplicationFunc_addMenuCommand_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.addMenuCommand"); - return {}; -} - -static PyObject *Sbk_PyGuiApplicationFunc_errorDialog(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "errorDialog", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyGuiApplication::errorDialog(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // errorDialog(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyGuiApplicationFunc_errorDialog_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // errorDialog(QString,QString) - cppSelf->errorDialog(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyGuiApplicationFunc_errorDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.errorDialog"); - return {}; -} - -static PyObject *Sbk_PyGuiApplicationFunc_getGuiInstance(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyGuiApplication::getGuiInstance(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getGuiInstance(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyGuiApplicationFunc_getGuiInstance_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getGuiInstance(int)const - GuiApp * cppResult = const_cast(cppSelf)->getGuiInstance(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_GUIAPP_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyGuiApplicationFunc_getGuiInstance_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyGuiApplication.getGuiInstance"); - return {}; -} - -static PyObject *Sbk_PyGuiApplicationFunc_getIcon(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyGuiApplication::getIcon(NATRON_ENUM::PixmapEnum)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_PIXMAPENUM_IDX])->converter, (pyArg)))) { - overloadId = 0; // getIcon(NATRON_ENUM::PixmapEnum)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyGuiApplicationFunc_getIcon_TypeError; - - // Call function/method - { - ::NATRON_ENUM::PixmapEnum cppArg0{NATRON_ENUM::NATRON_PIXMAP_PLAYER_PREVIOUS}; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getIcon(NATRON_ENUM::PixmapEnum)const - QPixmap cppResult = const_cast(cppSelf)->getIcon(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QPIXMAP_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyGuiApplicationFunc_getIcon_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyGuiApplication.getIcon"); - return {}; -} - -static PyObject *Sbk_PyGuiApplicationFunc_informationDialog(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "informationDialog", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyGuiApplication::informationDialog(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // informationDialog(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyGuiApplicationFunc_informationDialog_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // informationDialog(QString,QString) - cppSelf->informationDialog(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyGuiApplicationFunc_informationDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.informationDialog"); - return {}; -} - -static PyObject *Sbk_PyGuiApplicationFunc_questionDialog(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "questionDialog", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyGuiApplication::questionDialog(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // questionDialog(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyGuiApplicationFunc_questionDialog_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // questionDialog(QString,QString) - NATRON_ENUM::StandardButtonEnum cppResult = NATRON_ENUM::StandardButtonEnum(cppSelf->questionDialog(cppArg0, cppArg1)); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_STANDARDBUTTONENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyGuiApplicationFunc_questionDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.questionDialog"); - return {}; -} - -static PyObject *Sbk_PyGuiApplicationFunc_warningDialog(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "warningDialog", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyGuiApplication::warningDialog(QString,QString) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1])))) { - overloadId = 0; // warningDialog(QString,QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyGuiApplicationFunc_warningDialog_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // warningDialog(QString,QString) - cppSelf->warningDialog(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyGuiApplicationFunc_warningDialog_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyGuiApplication.warningDialog"); - return {}; -} - - -static const char *Sbk_PyGuiApplication_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PyGuiApplication_methods[] = { - {"addMenuCommand", reinterpret_cast(Sbk_PyGuiApplicationFunc_addMenuCommand), METH_VARARGS}, - {"errorDialog", reinterpret_cast(Sbk_PyGuiApplicationFunc_errorDialog), METH_VARARGS}, - {"getGuiInstance", reinterpret_cast(Sbk_PyGuiApplicationFunc_getGuiInstance), METH_O}, - {"getIcon", reinterpret_cast(Sbk_PyGuiApplicationFunc_getIcon), METH_O}, - {"informationDialog", reinterpret_cast(Sbk_PyGuiApplicationFunc_informationDialog), METH_VARARGS}, - {"questionDialog", reinterpret_cast(Sbk_PyGuiApplicationFunc_questionDialog), METH_VARARGS}, - {"warningDialog", reinterpret_cast(Sbk_PyGuiApplicationFunc_warningDialog), METH_VARARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_PyGuiApplication_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::PyGuiApplication *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_PyGuiApplication_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PyGuiApplication_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PyGuiApplication_Type = nullptr; -static SbkObjectType *Sbk_PyGuiApplication_TypeF(void) -{ - return _Sbk_PyGuiApplication_Type; -} - -static PyType_Slot Sbk_PyGuiApplication_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_PyGuiApplication_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_PyGuiApplication_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PyGuiApplication_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PyGuiApplication_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_PyGuiApplication_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PyGuiApplication_spec = { - "1:NatronGui.PyGuiApplication", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PyGuiApplication_slots -}; - -} //extern "C" - -static void *Sbk_PyGuiApplication_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::PyCoreApplication >())) - return dynamic_cast< ::PyGuiApplication *>(reinterpret_cast< ::PyCoreApplication *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PyGuiApplication_PythonToCpp_PyGuiApplication_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PyGuiApplication_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PyGuiApplication_PythonToCpp_PyGuiApplication_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PyGuiApplication_TypeF()))) - return PyGuiApplication_PythonToCpp_PyGuiApplication_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PyGuiApplication_PTR_CppToPython_PyGuiApplication(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PyGuiApplication_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PyGuiApplication_SignatureStrings[] = { - "NatronGui.PyGuiApplication(self)", - "1:NatronGui.PyGuiApplication.addMenuCommand(self,grouping:QString,pythonFunctionName:QString)", - "0:NatronGui.PyGuiApplication.addMenuCommand(self,grouping:QString,pythonFunctionName:QString,key:PySide2.QtCore.Qt.Key,modifiers:PySide2.QtCore.Qt.KeyboardModifiers)", - "NatronGui.PyGuiApplication.errorDialog(self,title:QString,message:QString)", - "NatronGui.PyGuiApplication.getGuiInstance(self,idx:int)->NatronGui.GuiApp", - "NatronGui.PyGuiApplication.getIcon(self,val:NatronEngine.NATRON_ENUM.PixmapEnum)->PySide2.QtGui.QPixmap", - "NatronGui.PyGuiApplication.informationDialog(self,title:QString,message:QString)", - "NatronGui.PyGuiApplication.questionDialog(self,title:QString,message:QString)->NatronEngine.NATRON_ENUM.StandardButtonEnum", - "NatronGui.PyGuiApplication.warningDialog(self,title:QString,message:QString)", - nullptr}; // Sentinel - -void init_PyGuiApplication(PyObject *module) -{ - _Sbk_PyGuiApplication_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PyGuiApplication", - "PyGuiApplication*", - &Sbk_PyGuiApplication_spec, - &Shiboken::callCppDestructor< ::PyGuiApplication >, - reinterpret_cast(SbkNatronEngineTypes[SBK_PYCOREAPPLICATION_IDX]), - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PyGuiApplication_Type); - InitSignatureStrings(pyType, PyGuiApplication_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PyGuiApplication_Type), Sbk_PyGuiApplication_PropertyStrings); - SbkNatronGuiTypes[SBK_PYGUIAPPLICATION_IDX] - = reinterpret_cast(Sbk_PyGuiApplication_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PyGuiApplication_TypeF(), - PyGuiApplication_PythonToCpp_PyGuiApplication_PTR, - is_PyGuiApplication_PythonToCpp_PyGuiApplication_PTR_Convertible, - PyGuiApplication_PTR_CppToPython_PyGuiApplication); - - Shiboken::Conversions::registerConverterName(converter, "PyGuiApplication"); - Shiboken::Conversions::registerConverterName(converter, "PyGuiApplication*"); - Shiboken::Conversions::registerConverterName(converter, "PyGuiApplication&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyGuiApplication).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyGuiApplicationWrapper).name()); - - - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_PyGuiApplication_TypeF(), &Sbk_PyGuiApplication_typeDiscovery); - - - PyGuiApplicationWrapper::pysideInitQtMetaTypes(); -} diff --git a/Gui/Qt5/NatronGui/pyguiapplication_wrapper.h b/Gui/Qt5/NatronGui/pyguiapplication_wrapper.h deleted file mode 100644 index 7f3fe657f8..0000000000 --- a/Gui/Qt5/NatronGui/pyguiapplication_wrapper.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SBK_PYGUIAPPLICATIONWRAPPER_H -#define SBK_PYGUIAPPLICATIONWRAPPER_H - -#include - - -// Extra includes -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class PyGuiApplicationWrapper : public PyGuiApplication -{ -public: - PyGuiApplicationWrapper(); - ~PyGuiApplicationWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_PYCOREAPPLICATIONWRAPPER_H -# define SBK_PYCOREAPPLICATIONWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class PyCoreApplicationWrapper : public PyCoreApplication -{ -public: - PyCoreApplicationWrapper(); - ~PyCoreApplicationWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[1]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_PYCOREAPPLICATIONWRAPPER_H - -#endif // SBK_PYGUIAPPLICATIONWRAPPER_H - diff --git a/Gui/Qt5/NatronGui/pymodaldialog_wrapper.cpp b/Gui/Qt5/NatronGui/pymodaldialog_wrapper.cpp deleted file mode 100644 index 015c4a120f..0000000000 --- a/Gui/Qt5/NatronGui/pymodaldialog_wrapper.cpp +++ /dev/null @@ -1,888 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include -#include -#include - -// module include -#include "natrongui_python.h" - -// main header -#include "pymodaldialog_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void PyModalDialogWrapper::pysideInitQtMetaTypes() -{ -} - -void PyModalDialogWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -void PyModalDialogWrapper::accept() -{ - if (m_PyMethodCache[0]) { - return this->::QDialog::accept(); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "accept"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[0] = true; - return this->::QDialog::accept(); - } - - Shiboken::AutoDecRef pyArgs(PyTuple_New(0)); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::closeEvent(QCloseEvent * arg__1) -{ - if (m_PyMethodCache[1]) { - return this->::QDialog::closeEvent(arg__1); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "closeEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[1] = true; - return this->::QDialog::closeEvent(arg__1); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QCLOSEEVENT_IDX]), arg__1) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::contextMenuEvent(QContextMenuEvent * arg__1) -{ - if (m_PyMethodCache[2]) { - return this->::QDialog::contextMenuEvent(arg__1); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "contextMenuEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[2] = true; - return this->::QDialog::contextMenuEvent(arg__1); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QCONTEXTMENUEVENT_IDX]), arg__1) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::done(int arg__1) -{ - if (m_PyMethodCache[3]) { - return this->::QDialog::done(arg__1); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "done"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[3] = true; - return this->::QDialog::done(arg__1); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(i)", - arg__1 - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -bool PyModalDialogWrapper::eventFilter(QObject * arg__1, QEvent * arg__2) -{ - if (m_PyMethodCache[4]) - return this->::QDialog::eventFilter(arg__1, arg__2); - Shiboken::GilState gil; - if (PyErr_Occurred()) - return false; - static PyObject *nameCache[2] = {}; - static const char *funcName = "eventFilter"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[4] = true; - return this->::QDialog::eventFilter(arg__1, arg__2); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(NN)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX]), arg__1), - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QEVENT_IDX]), arg__2) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return false; - } - // Check return type - PythonToCppFunc pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), pyResult); - if (!pythonToCpp) { - Shiboken::warning(PyExc_RuntimeWarning, 2, "Invalid return value in function %s, expected %s, got %s.", "PyModalDialog.eventFilter", "bool", Py_TYPE(pyResult)->tp_name); - return false; - } - bool cppResult; - pythonToCpp(pyResult, &cppResult); - return cppResult; -} - -int PyModalDialogWrapper::exec() -{ - if (m_PyMethodCache[5]) - return this->::QDialog::exec(); - Shiboken::GilState gil; - if (PyErr_Occurred()) - return 0; - static PyObject *nameCache[2] = {}; - static const char *funcName = "exec_"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[5] = true; - return this->::QDialog::exec(); - } - - Shiboken::AutoDecRef pyArgs(PyTuple_New(0)); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return 0; - } - // Check return type - PythonToCppFunc pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), pyResult); - if (!pythonToCpp) { - Shiboken::warning(PyExc_RuntimeWarning, 2, "Invalid return value in function %s, expected %s, got %s.", "PyModalDialog.exec_", "int", Py_TYPE(pyResult)->tp_name); - return 0; - } - int cppResult; - pythonToCpp(pyResult, &cppResult); - return cppResult; -} - -void PyModalDialogWrapper::keyPressEvent(QKeyEvent * arg__1) -{ - if (m_PyMethodCache[6]) { - return this->::QDialog::keyPressEvent(arg__1); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "keyPressEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[6] = true; - return this->::QDialog::keyPressEvent(arg__1); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QKEYEVENT_IDX]), arg__1) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::open() -{ - if (m_PyMethodCache[7]) { - return this->::QDialog::open(); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "open"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[7] = true; - return this->::QDialog::open(); - } - - Shiboken::AutoDecRef pyArgs(PyTuple_New(0)); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::reject() -{ - if (m_PyMethodCache[8]) { - return this->::QDialog::reject(); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "reject"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[8] = true; - return this->::QDialog::reject(); - } - - Shiboken::AutoDecRef pyArgs(PyTuple_New(0)); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::resizeEvent(QResizeEvent * arg__1) -{ - if (m_PyMethodCache[9]) { - return this->::QDialog::resizeEvent(arg__1); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "resizeEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[9] = true; - return this->::QDialog::resizeEvent(arg__1); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QRESIZEEVENT_IDX]), arg__1) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::setVisible(bool visible) -{ - if (m_PyMethodCache[10]) { - return this->::QDialog::setVisible(visible); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "setVisible"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[10] = true; - return this->::QDialog::setVisible(visible); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &visible) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyModalDialogWrapper::showEvent(QShowEvent * arg__1) -{ - if (m_PyMethodCache[11]) { - return this->::QDialog::showEvent(arg__1); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "showEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[11] = true; - return this->::QDialog::showEvent(arg__1); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QSHOWEVENT_IDX]), arg__1) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -PyModalDialogWrapper::~PyModalDialogWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_PyModalDialogFunc_addWidget(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyModalDialog *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyModalDialog::addWidget(QWidget*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QWIDGET_IDX]), (pyArg)))) { - overloadId = 0; // addWidget(QWidget*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyModalDialogFunc_addWidget_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::QWidget *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // addWidget(QWidget*) - cppSelf->addWidget(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyModalDialogFunc_addWidget_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyModalDialog.addWidget"); - return {}; -} - -static PyObject *Sbk_PyModalDialogFunc_getParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyModalDialog *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyModalDialog::getParam(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getParam(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyModalDialogFunc_getParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getParam(QString)const - Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyModalDialogFunc_getParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyModalDialog.getParam"); - return {}; -} - -static PyObject *Sbk_PyModalDialogFunc_insertWidget(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyModalDialog *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "insertWidget", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyModalDialog::insertWidget(int,QWidget*) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QWIDGET_IDX]), (pyArgs[1])))) { - overloadId = 0; // insertWidget(int,QWidget*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyModalDialogFunc_insertWidget_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::QWidget *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // insertWidget(int,QWidget*) - cppSelf->insertWidget(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyModalDialogFunc_insertWidget_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyModalDialog.insertWidget"); - return {}; -} - -static PyObject *Sbk_PyModalDialogFunc_minimumSizeHint(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyModalDialog *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // minimumSizeHint()const - QSize cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast(self)) - ? const_cast(cppSelf)->::PyModalDialog::minimumSizeHint() - : const_cast(cppSelf)->minimumSizeHint(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QSIZE_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyModalDialogFunc_setParamChangedCallback(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyModalDialog *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyModalDialog::setParamChangedCallback(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setParamChangedCallback(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyModalDialogFunc_setParamChangedCallback_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setParamChangedCallback(QString) - cppSelf->setParamChangedCallback(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyModalDialogFunc_setParamChangedCallback_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyModalDialog.setParamChangedCallback"); - return {}; -} - -static PyObject *Sbk_PyModalDialogFunc_sizeHint(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyModalDialog *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // sizeHint()const - QSize cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast(self)) - ? const_cast(cppSelf)->::PyModalDialog::sizeHint() - : const_cast(cppSelf)->sizeHint(); - pyResult = Shiboken::Conversions::copyToPython(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QSIZE_IDX]), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - - -static const char *Sbk_PyModalDialog_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PyModalDialog_methods[] = { - {"addWidget", reinterpret_cast(Sbk_PyModalDialogFunc_addWidget), METH_O}, - {"getParam", reinterpret_cast(Sbk_PyModalDialogFunc_getParam), METH_O}, - {"insertWidget", reinterpret_cast(Sbk_PyModalDialogFunc_insertWidget), METH_VARARGS}, - {"minimumSizeHint", reinterpret_cast(Sbk_PyModalDialogFunc_minimumSizeHint), METH_NOARGS}, - {"setParamChangedCallback", reinterpret_cast(Sbk_PyModalDialogFunc_setParamChangedCallback), METH_O}, - {"sizeHint", reinterpret_cast(Sbk_PyModalDialogFunc_sizeHint), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_PyModalDialog_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::PyModalDialog *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_PyModalDialog_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PyModalDialog_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -static int mi_offsets[] = { -1, -1, -1, -1, -1 }; -int * -Sbk_PyModalDialog_mi_init(const void *cptr) -{ - if (mi_offsets[0] == -1) { - std::set offsets; - const auto *class_ptr = reinterpret_cast(cptr); - const auto base = reinterpret_cast(class_ptr); - offsets.insert(int(reinterpret_cast(static_cast(class_ptr)) - base)); - offsets.insert(int(reinterpret_cast(static_cast(static_cast(static_cast(class_ptr)))) - base)); - offsets.insert(int(reinterpret_cast(static_cast(class_ptr)) - base)); - offsets.insert(int(reinterpret_cast(static_cast(static_cast(static_cast(class_ptr)))) - base)); - - offsets.erase(0); - - std::copy(offsets.cbegin(), offsets.cend(), mi_offsets); - } - return mi_offsets; -} -static void * Sbk_PyModalDialogSpecialCastFunction(void *obj, SbkObjectType *desiredType) -{ - auto me = reinterpret_cast< ::PyModalDialog *>(obj); - if (desiredType == reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QDIALOG_IDX])) - return static_cast< ::QDialog *>(me); - else if (desiredType == reinterpret_cast(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX])) - return static_cast< ::UserParamHolder *>(me); - return me; -} - - -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PyModalDialog_Type = nullptr; -static SbkObjectType *Sbk_PyModalDialog_TypeF(void) -{ - return _Sbk_PyModalDialog_Type; -} - -static PyType_Slot Sbk_PyModalDialog_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_PyModalDialog_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_PyModalDialog_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PyModalDialog_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PyModalDialog_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PyModalDialog_spec = { - "1:NatronGui.PyModalDialog", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PyModalDialog_slots -}; - -} //extern "C" - -static void *Sbk_PyModalDialog_typeDiscovery(void *cptr, SbkObjectType *instanceType) -{ - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::QDialog >())) - return dynamic_cast< ::PyModalDialog *>(reinterpret_cast< ::QDialog *>(cptr)); - if (instanceType == reinterpret_cast(Shiboken::SbkType< ::UserParamHolder >())) - return dynamic_cast< ::PyModalDialog *>(reinterpret_cast< ::UserParamHolder *>(cptr)); - return {}; -} - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PyModalDialog_PythonToCpp_PyModalDialog_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PyModalDialog_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PyModalDialog_PythonToCpp_PyModalDialog_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PyModalDialog_TypeF()))) - return PyModalDialog_PythonToCpp_PyModalDialog_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PyModalDialog_PTR_CppToPython_PyModalDialog(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PyModalDialog_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PyModalDialog_SignatureStrings[] = { - "NatronGui.PyModalDialog.addWidget(self,widget:PySide2.QtWidgets.QWidget)", - "NatronGui.PyModalDialog.getParam(self,scriptName:QString)->NatronEngine.Param", - "NatronGui.PyModalDialog.insertWidget(self,index:int,widget:PySide2.QtWidgets.QWidget)", - "NatronGui.PyModalDialog.minimumSizeHint(self)->PySide2.QtCore.QSize", - "NatronGui.PyModalDialog.setParamChangedCallback(self,callback:QString)", - "NatronGui.PyModalDialog.sizeHint(self)->PySide2.QtCore.QSize", - nullptr}; // Sentinel - -void init_PyModalDialog(PyObject *module) -{ - PyObject *Sbk_PyModalDialog_Type_bases = PyTuple_Pack(2, - reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QDIALOG_IDX]), - reinterpret_cast(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX])); - - _Sbk_PyModalDialog_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PyModalDialog", - "PyModalDialog*", - &Sbk_PyModalDialog_spec, - &Shiboken::callCppDestructor< ::PyModalDialog >, - reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QDIALOG_IDX]), - Sbk_PyModalDialog_Type_bases, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PyModalDialog_Type); - InitSignatureStrings(pyType, PyModalDialog_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PyModalDialog_Type), Sbk_PyModalDialog_PropertyStrings); - SbkNatronGuiTypes[SBK_PYMODALDIALOG_IDX] - = reinterpret_cast(Sbk_PyModalDialog_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PyModalDialog_TypeF(), - PyModalDialog_PythonToCpp_PyModalDialog_PTR, - is_PyModalDialog_PythonToCpp_PyModalDialog_PTR_Convertible, - PyModalDialog_PTR_CppToPython_PyModalDialog); - - Shiboken::Conversions::registerConverterName(converter, "PyModalDialog"); - Shiboken::Conversions::registerConverterName(converter, "PyModalDialog*"); - Shiboken::Conversions::registerConverterName(converter, "PyModalDialog&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyModalDialog).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyModalDialogWrapper).name()); - - - MultipleInheritanceInitFunction func = Sbk_PyModalDialog_mi_init; - Shiboken::ObjectType::setMultipleInheritanceFunction(Sbk_PyModalDialog_TypeF(), func); - Shiboken::ObjectType::setCastFunction(Sbk_PyModalDialog_TypeF(), &Sbk_PyModalDialogSpecialCastFunction); - Shiboken::ObjectType::setTypeDiscoveryFunctionV2(Sbk_PyModalDialog_TypeF(), &Sbk_PyModalDialog_typeDiscovery); - - PySide::Signal::registerSignals(Sbk_PyModalDialog_TypeF(), &::PyModalDialog::staticMetaObject); - - PyModalDialogWrapper::pysideInitQtMetaTypes(); -} diff --git a/Gui/Qt5/NatronGui/pymodaldialog_wrapper.h b/Gui/Qt5/NatronGui/pymodaldialog_wrapper.h deleted file mode 100644 index 4cb7ca397a..0000000000 --- a/Gui/Qt5/NatronGui/pymodaldialog_wrapper.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef SBK_PYMODALDIALOGWRAPPER_H -#define SBK_PYMODALDIALOGWRAPPER_H - -#include - - -// Extra includes -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class PyModalDialogWrapper : public PyModalDialog -{ -public: - void accept() override; - inline void adjustPosition_protected(QWidget * arg__1) { PyModalDialog::adjustPosition(arg__1); } - inline void closeEvent_protected(QCloseEvent * arg__1) { PyModalDialog::closeEvent(arg__1); } - void closeEvent(QCloseEvent * arg__1) override; - inline void contextMenuEvent_protected(QContextMenuEvent * arg__1) { PyModalDialog::contextMenuEvent(arg__1); } - void contextMenuEvent(QContextMenuEvent * arg__1) override; - void done(int arg__1) override; - inline bool eventFilter_protected(QObject * arg__1, QEvent * arg__2) { return PyModalDialog::eventFilter(arg__1, arg__2); } - bool eventFilter(QObject * arg__1, QEvent * arg__2) override; - int exec() override; - inline void keyPressEvent_protected(QKeyEvent * arg__1) { PyModalDialog::keyPressEvent(arg__1); } - void keyPressEvent(QKeyEvent * arg__1) override; - void open() override; - void reject() override; - inline void resizeEvent_protected(QResizeEvent * arg__1) { PyModalDialog::resizeEvent(arg__1); } - void resizeEvent(QResizeEvent * arg__1) override; - void setVisible(bool visible) override; - inline void showEvent_protected(QShowEvent * arg__1) { PyModalDialog::showEvent(arg__1); } - void showEvent(QShowEvent * arg__1) override; - ~PyModalDialogWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[12]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# ifndef SBK_QDIALOGWRAPPER_H -# define SBK_QDIALOGWRAPPER_H - -// Inherited base class: -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class QDialogWrapper : public QDialog -{ -public: - QDialogWrapper(QWidget * parent = nullptr, QFlags f = Qt::WindowFlags()); - void accept() override; - inline void adjustPosition_protected(QWidget * arg__1) { QDialog::adjustPosition(arg__1); } - inline void closeEvent_protected(QCloseEvent * arg__1) { QDialog::closeEvent(arg__1); } - void closeEvent(QCloseEvent * arg__1) override; - inline void contextMenuEvent_protected(QContextMenuEvent * arg__1) { QDialog::contextMenuEvent(arg__1); } - void contextMenuEvent(QContextMenuEvent * arg__1) override; - void done(int arg__1) override; - inline bool eventFilter_protected(QObject * arg__1, QEvent * arg__2) { return QDialog::eventFilter(arg__1, arg__2); } - bool eventFilter(QObject * arg__1, QEvent * arg__2) override; - int exec() override; - inline void keyPressEvent_protected(QKeyEvent * arg__1) { QDialog::keyPressEvent(arg__1); } - void keyPressEvent(QKeyEvent * arg__1) override; - QSize minimumSizeHint() const override; - void open() override; - void reject() override; - inline void resizeEvent_protected(QResizeEvent * arg__1) { QDialog::resizeEvent(arg__1); } - void resizeEvent(QResizeEvent * arg__1) override; - void setVisible(bool visible) override; - inline void showEvent_protected(QShowEvent * arg__1) { QDialog::showEvent(arg__1); } - void showEvent(QShowEvent * arg__1) override; - QSize sizeHint() const override; - ~QDialogWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[14]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -# endif // SBK_QDIALOGWRAPPER_H - -#endif // SBK_PYMODALDIALOGWRAPPER_H - diff --git a/Gui/Qt5/NatronGui/pypanel_wrapper.cpp b/Gui/Qt5/NatronGui/pypanel_wrapper.cpp deleted file mode 100644 index 53febc9109..0000000000 --- a/Gui/Qt5/NatronGui/pypanel_wrapper.cpp +++ /dev/null @@ -1,1129 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include -#include -#include - -// module include -#include "natrongui_python.h" - -// main header -#include "pypanel_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - -// Native --------------------------------------------------------- - -void PyPanelWrapper::pysideInitQtMetaTypes() -{ -} - -void PyPanelWrapper::resetPyMethodCache() -{ - std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false); -} - -PyPanelWrapper::PyPanelWrapper(const QString & scriptName, const QString & label, bool useUserParameters, GuiApp * app) : PyPanel(scriptName, label, useUserParameters, app) -{ - resetPyMethodCache(); - // ... middle -} - -void PyPanelWrapper::enterEvent(QEvent * e) -{ - if (m_PyMethodCache[0]) { - return this->::PyPanel::enterEvent(e); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "enterEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[0] = true; - return this->::PyPanel::enterEvent(e); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QEVENT_IDX]), e) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyPanelWrapper::keyPressEvent(QKeyEvent * e) -{ - if (m_PyMethodCache[1]) { - return this->::PyPanel::keyPressEvent(e); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "keyPressEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[1] = true; - return this->::PyPanel::keyPressEvent(e); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QKEYEVENT_IDX]), e) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyPanelWrapper::leaveEvent(QEvent * e) -{ - if (m_PyMethodCache[2]) { - return this->::PyPanel::leaveEvent(e); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "leaveEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[2] = true; - return this->::PyPanel::leaveEvent(e); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QEVENT_IDX]), e) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyPanelWrapper::mousePressEvent(QMouseEvent * e) -{ - if (m_PyMethodCache[3]) { - return this->::PyPanel::mousePressEvent(e); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "mousePressEvent"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[3] = true; - return this->::PyPanel::mousePressEvent(e); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QMOUSEEVENT_IDX]), e) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -void PyPanelWrapper::restore(const QString & arg__1) -{ - if (m_PyMethodCache[4]) { - return this->::PyPanel::restore(arg__1); - } - Shiboken::GilState gil; - if (PyErr_Occurred()) - return; - static PyObject *nameCache[2] = {}; - static const char *funcName = "restore"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[4] = true; - return this->::PyPanel::restore(arg__1); - } - - Shiboken::AutoDecRef pyArgs(Py_BuildValue("(N)", - Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &arg__1) - )); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return; - } -} - -QString PyPanelWrapper::save() -{ - if (m_PyMethodCache[5]) - return this->::PyPanel::save(); - Shiboken::GilState gil; - if (PyErr_Occurred()) - return ::QString(); - static PyObject *nameCache[2] = {}; - static const char *funcName = "save"; - Shiboken::AutoDecRef pyOverride(Shiboken::BindingManager::instance().getOverride(this, nameCache, funcName)); - if (pyOverride.isNull()) { - gil.release(); - m_PyMethodCache[5] = true; - return this->::PyPanel::save(); - } - - Shiboken::AutoDecRef pyArgs(PyTuple_New(0)); - - Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr)); - // An error happened in python code! - if (pyResult.isNull()) { - PyErr_Print(); - return ::QString(); - } - // Check return type - PythonToCppFunc pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], pyResult); - if (!pythonToCpp) { - Shiboken::warning(PyExc_RuntimeWarning, 2, "Invalid return value in function %s, expected %s, got %s.", "PyPanel.save", "QString", Py_TYPE(pyResult)->tp_name); - return ::QString(); - } - ::QString cppResult; - pythonToCpp(pyResult, &cppResult); - return cppResult; -} - -PyPanelWrapper::~PyPanelWrapper() -{ - SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this); - Shiboken::Object::destroy(wrapper, this); -} - -// Target --------------------------------------------------------- - -extern "C" { -static int -Sbk_PyPanel_Init(PyObject *self, PyObject *args, PyObject *kwds) -{ - SbkObject *sbkSelf = reinterpret_cast(self); - SbkObjectType *type = reinterpret_cast(self->ob_type); - SbkObjectType *myType = reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]); - if (type != myType) - Shiboken::ObjectType::copyMultipleInheritance(type, myType); - - if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::PyPanel >())) - return -1; - - ::PyPanelWrapper *cptr{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr, nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0, 0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "PyPanel", 4, 4, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2]), &(pyArgs[3]))) - return -1; - - - // Overloaded function decisor - // 0: PyPanel::PyPanel(QString,QString,bool,GuiApp*) - if (numArgs == 4 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArgs[1]))) - && (pythonToCpp[2] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[2]))) - && (pythonToCpp[3] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronGuiTypes[SBK_GUIAPP_IDX]), (pyArgs[3])))) { - overloadId = 0; // PyPanel(QString,QString,bool,GuiApp*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanel_Init_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - ::QString cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - bool cppArg2; - pythonToCpp[2](pyArgs[2], &cppArg2); - if (!Shiboken::Object::isValid(pyArgs[3])) - return -1; - ::GuiApp *cppArg3; - pythonToCpp[3](pyArgs[3], &cppArg3); - - if (!PyErr_Occurred()) { - // PyPanel(QString,QString,bool,GuiApp*) - cptr = new ::PyPanelWrapper(cppArg0, cppArg1, cppArg2, cppArg3); - } - } - - if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::PyPanel >(), cptr)) { - delete cptr; - return -1; - } - if (!cptr) goto Sbk_PyPanel_Init_TypeError; - - Shiboken::Object::setValidCpp(sbkSelf, true); - Shiboken::Object::setHasCppWrapper(sbkSelf, true); - if (Shiboken::BindingManager::instance().hasWrapper(cptr)) { - Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr)); - } - Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); - - - return 1; - - Sbk_PyPanel_Init_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyPanel"); - return -1; -} - -static PyObject *Sbk_PyPanelFunc_addWidget(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::addWidget(QWidget*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QWIDGET_IDX]), (pyArg)))) { - overloadId = 0; // addWidget(QWidget*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_addWidget_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::QWidget *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // addWidget(QWidget*) - cppSelf->addWidget(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_addWidget_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.addWidget"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_enterEvent(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::enterEvent(QEvent*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QEVENT_IDX]), (pyArg)))) { - overloadId = 0; // enterEvent(QEvent*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_enterEvent_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::QEvent *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // enterEvent(QEvent*) - static_cast<::PyPanelWrapper *>(cppSelf)->PyPanelWrapper::enterEvent_protected(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_enterEvent_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.enterEvent"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_getPanelLabel(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getPanelLabel()const - QString cppResult = const_cast(cppSelf)->getPanelLabel(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyPanelFunc_getPanelScriptName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getPanelScriptName()const - QString cppResult = const_cast(cppSelf)->getPanelScriptName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyPanelFunc_getParam(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::getParam(QString)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // getParam(QString)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_getParam_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getParam(QString)const - Param * cppResult = const_cast(cppSelf)->getParam(cppArg0); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyPanelFunc_getParam_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.getParam"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_getParams(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getParams()const - // Begin code injection - std::list params = cppSelf->getParams(); - PyObject* ret = PyList_New((int) params.size()); - int idx = 0; - for (std::list::iterator it = params.begin(); it!=params.end(); ++it,++idx) { - PyObject* item = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronEngineTypes[SBK_PARAM_IDX]), *it); - // Ownership transferences. - Shiboken::Object::getOwnership(item); - PyList_SET_ITEM(ret, idx, item); - } - return ret; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyPanelFunc_insertWidget(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "insertWidget", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyPanel::insertWidget(int,QWidget*) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QWIDGET_IDX]), (pyArgs[1])))) { - overloadId = 0; // insertWidget(int,QWidget*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_insertWidget_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::QWidget *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // insertWidget(int,QWidget*) - cppSelf->insertWidget(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_insertWidget_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyPanel.insertWidget"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_keyPressEvent(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::keyPressEvent(QKeyEvent*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QKEYEVENT_IDX]), (pyArg)))) { - overloadId = 0; // keyPressEvent(QKeyEvent*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_keyPressEvent_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::QKeyEvent *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // keyPressEvent(QKeyEvent*) - static_cast<::PyPanelWrapper *>(cppSelf)->PyPanelWrapper::keyPressEvent_protected(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_keyPressEvent_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.keyPressEvent"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_leaveEvent(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::leaveEvent(QEvent*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtCoreTypes[SBK_QEVENT_IDX]), (pyArg)))) { - overloadId = 0; // leaveEvent(QEvent*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_leaveEvent_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::QEvent *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // leaveEvent(QEvent*) - static_cast<::PyPanelWrapper *>(cppSelf)->PyPanelWrapper::leaveEvent_protected(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_leaveEvent_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.leaveEvent"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_mousePressEvent(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::mousePressEvent(QMouseEvent*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtGuiTypes[SBK_QMOUSEEVENT_IDX]), (pyArg)))) { - overloadId = 0; // mousePressEvent(QMouseEvent*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_mousePressEvent_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::QMouseEvent *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // mousePressEvent(QMouseEvent*) - static_cast<::PyPanelWrapper *>(cppSelf)->PyPanelWrapper::mousePressEvent_protected(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_mousePressEvent_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.mousePressEvent"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_onUserDataChanged(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // onUserDataChanged() - static_cast<::PyPanelWrapper *>(cppSelf)->PyPanelWrapper::onUserDataChanged_protected(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyPanelFunc_restore(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::restore(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // restore(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_restore_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // restore(QString) - Shiboken::Object::hasCppWrapper(reinterpret_cast(self)) - ? cppSelf->::PyPanel::restore(cppArg0) - : cppSelf->restore(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_restore_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.restore"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_save(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // save() - QString cppResult = static_cast<::PyPanelWrapper *>(cppSelf)->PyPanelWrapper::save_protected(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyPanelFunc_setPanelLabel(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::setPanelLabel(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setPanelLabel(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_setPanelLabel_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setPanelLabel(QString) - cppSelf->setPanelLabel(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_setPanelLabel_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.setPanelLabel"); - return {}; -} - -static PyObject *Sbk_PyPanelFunc_setParamChangedCallback(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = static_cast(reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self)))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyPanel::setParamChangedCallback(QString) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], (pyArg)))) { - overloadId = 0; // setParamChangedCallback(QString) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyPanelFunc_setParamChangedCallback_TypeError; - - // Call function/method - { - ::QString cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setParamChangedCallback(QString) - cppSelf->setParamChangedCallback(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyPanelFunc_setParamChangedCallback_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyPanel.setParamChangedCallback"); - return {}; -} - - -static const char *Sbk_PyPanel_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PyPanel_methods[] = { - {"addWidget", reinterpret_cast(Sbk_PyPanelFunc_addWidget), METH_O}, - {"enterEvent", reinterpret_cast(Sbk_PyPanelFunc_enterEvent), METH_O}, - {"getPanelLabel", reinterpret_cast(Sbk_PyPanelFunc_getPanelLabel), METH_NOARGS}, - {"getPanelScriptName", reinterpret_cast(Sbk_PyPanelFunc_getPanelScriptName), METH_NOARGS}, - {"getParam", reinterpret_cast(Sbk_PyPanelFunc_getParam), METH_O}, - {"getParams", reinterpret_cast(Sbk_PyPanelFunc_getParams), METH_NOARGS}, - {"insertWidget", reinterpret_cast(Sbk_PyPanelFunc_insertWidget), METH_VARARGS}, - {"keyPressEvent", reinterpret_cast(Sbk_PyPanelFunc_keyPressEvent), METH_O}, - {"leaveEvent", reinterpret_cast(Sbk_PyPanelFunc_leaveEvent), METH_O}, - {"mousePressEvent", reinterpret_cast(Sbk_PyPanelFunc_mousePressEvent), METH_O}, - {"onUserDataChanged", reinterpret_cast(Sbk_PyPanelFunc_onUserDataChanged), METH_NOARGS}, - {"restore", reinterpret_cast(Sbk_PyPanelFunc_restore), METH_O}, - {"save", reinterpret_cast(Sbk_PyPanelFunc_save), METH_NOARGS}, - {"setPanelLabel", reinterpret_cast(Sbk_PyPanelFunc_setPanelLabel), METH_O}, - {"setParamChangedCallback", reinterpret_cast(Sbk_PyPanelFunc_setParamChangedCallback), METH_O}, - - {nullptr, nullptr} // Sentinel -}; - -static int Sbk_PyPanel_setattro(PyObject *self, PyObject *name, PyObject *value) -{ - PySide::Feature::Select(self); - if (value && PyCallable_Check(value)) { - auto plain_inst = reinterpret_cast< ::PyPanel *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYPANEL_IDX], reinterpret_cast(self))); - auto inst = dynamic_cast(plain_inst); - if (inst) - inst->resetPyMethodCache(); - } - return PyObject_GenericSetAttr(self, name, value); -} - -} // extern "C" - -static int Sbk_PyPanel_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PyPanel_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -static int mi_offsets[] = { -1, -1, -1 }; -int * -Sbk_PyPanel_mi_init(const void *cptr) -{ - if (mi_offsets[0] == -1) { - std::set offsets; - const auto *class_ptr = reinterpret_cast(cptr); - const auto base = reinterpret_cast(class_ptr); - offsets.insert(int(reinterpret_cast(static_cast(class_ptr)) - base)); - offsets.insert(int(reinterpret_cast(static_cast(static_cast(static_cast(class_ptr)))) - base)); - - offsets.erase(0); - - std::copy(offsets.cbegin(), offsets.cend(), mi_offsets); - } - return mi_offsets; -} -static void * Sbk_PyPanelSpecialCastFunction(void *obj, SbkObjectType *desiredType) -{ - auto me = reinterpret_cast< ::PyPanel *>(obj); - if (desiredType == reinterpret_cast(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX])) - return static_cast< ::UserParamHolder *>(me); - return me; -} - - -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PyPanel_Type = nullptr; -static SbkObjectType *Sbk_PyPanel_TypeF(void) -{ - return _Sbk_PyPanel_Type; -} - -static PyType_Slot Sbk_PyPanel_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, reinterpret_cast(Sbk_PyPanel_setattro)}, - {Py_tp_traverse, reinterpret_cast(Sbk_PyPanel_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PyPanel_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PyPanel_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, reinterpret_cast(Sbk_PyPanel_Init)}, - {Py_tp_new, reinterpret_cast(SbkObjectTpNew)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PyPanel_spec = { - "1:NatronGui.PyPanel", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PyPanel_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PyPanel_PythonToCpp_PyPanel_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PyPanel_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PyPanel_PythonToCpp_PyPanel_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PyPanel_TypeF()))) - return PyPanel_PythonToCpp_PyPanel_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PyPanel_PTR_CppToPython_PyPanel(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PyPanel_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PyPanel_SignatureStrings[] = { - "NatronGui.PyPanel(self,scriptName:QString,label:QString,useUserParameters:bool,app:NatronGui.GuiApp)", - "NatronGui.PyPanel.addWidget(self,widget:PySide2.QtWidgets.QWidget)", - "NatronGui.PyPanel.enterEvent(self,e:PySide2.QtCore.QEvent)", - "NatronGui.PyPanel.getPanelLabel(self)->QString", - "NatronGui.PyPanel.getPanelScriptName(self)->QString", - "NatronGui.PyPanel.getParam(self,scriptName:QString)->NatronEngine.Param", - "NatronGui.PyPanel.getParams(self)->std.list[NatronEngine.Param]", - "NatronGui.PyPanel.insertWidget(self,index:int,widget:PySide2.QtWidgets.QWidget)", - "NatronGui.PyPanel.keyPressEvent(self,e:PySide2.QtGui.QKeyEvent)", - "NatronGui.PyPanel.leaveEvent(self,e:PySide2.QtCore.QEvent)", - "NatronGui.PyPanel.mousePressEvent(self,e:PySide2.QtGui.QMouseEvent)", - "NatronGui.PyPanel.onUserDataChanged(self)", - "NatronGui.PyPanel.restore(self,arg__1:QString)", - "NatronGui.PyPanel.save(self)->QString", - "NatronGui.PyPanel.setPanelLabel(self,label:QString)", - "NatronGui.PyPanel.setParamChangedCallback(self,callback:QString)", - nullptr}; // Sentinel - -void init_PyPanel(PyObject *module) -{ - PyObject *Sbk_PyPanel_Type_bases = PyTuple_Pack(1, - reinterpret_cast(SbkNatronEngineTypes[SBK_USERPARAMHOLDER_IDX])); - - _Sbk_PyPanel_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PyPanel", - "PyPanel*", - &Sbk_PyPanel_spec, - &Shiboken::callCppDestructor< ::PyPanel >, - 0, - Sbk_PyPanel_Type_bases, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PyPanel_Type); - InitSignatureStrings(pyType, PyPanel_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PyPanel_Type), Sbk_PyPanel_PropertyStrings); - SbkNatronGuiTypes[SBK_PYPANEL_IDX] - = reinterpret_cast(Sbk_PyPanel_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PyPanel_TypeF(), - PyPanel_PythonToCpp_PyPanel_PTR, - is_PyPanel_PythonToCpp_PyPanel_PTR_Convertible, - PyPanel_PTR_CppToPython_PyPanel); - - Shiboken::Conversions::registerConverterName(converter, "PyPanel"); - Shiboken::Conversions::registerConverterName(converter, "PyPanel*"); - Shiboken::Conversions::registerConverterName(converter, "PyPanel&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyPanel).name()); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyPanelWrapper).name()); - - - MultipleInheritanceInitFunction func = Sbk_PyPanel_mi_init; - Shiboken::ObjectType::setMultipleInheritanceFunction(Sbk_PyPanel_TypeF(), func); - Shiboken::ObjectType::setCastFunction(Sbk_PyPanel_TypeF(), &Sbk_PyPanelSpecialCastFunction); - - PyPanelWrapper::pysideInitQtMetaTypes(); -} diff --git a/Gui/Qt5/NatronGui/pypanel_wrapper.h b/Gui/Qt5/NatronGui/pypanel_wrapper.h deleted file mode 100644 index fa08a04aed..0000000000 --- a/Gui/Qt5/NatronGui/pypanel_wrapper.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef SBK_PYPANELWRAPPER_H -#define SBK_PYPANELWRAPPER_H - -#include - - -// Extra includes -#include -#include -#include -NATRON_NAMESPACE_ENTER NATRON_PYTHON_NAMESPACE_ENTER -class PyPanelWrapper : public PyPanel -{ -public: - PyPanelWrapper(const QString & scriptName, const QString & label, bool useUserParameters, GuiApp * app); - inline void enterEvent_protected(QEvent * e) { PyPanel::enterEvent(e); } - void enterEvent(QEvent * e) override; - inline void keyPressEvent_protected(QKeyEvent * e) { PyPanel::keyPressEvent(e); } - void keyPressEvent(QKeyEvent * e) override; - inline void leaveEvent_protected(QEvent * e) { PyPanel::leaveEvent(e); } - void leaveEvent(QEvent * e) override; - inline void mousePressEvent_protected(QMouseEvent * e) { PyPanel::mousePressEvent(e); } - void mousePressEvent(QMouseEvent * e) override; - inline void onUserDataChanged_protected() { PyPanel::onUserDataChanged(); } - void restore(const QString & arg__1) override; - inline QString save_protected() { return PyPanel::save(); } - QString save() override; - ~PyPanelWrapper(); - static void pysideInitQtMetaTypes(); - void resetPyMethodCache(); -private: - mutable bool m_PyMethodCache[6]; -}; -NATRON_PYTHON_NAMESPACE_EXIT NATRON_NAMESPACE_EXIT - -#endif // SBK_PYPANELWRAPPER_H - diff --git a/Gui/Qt5/NatronGui/pytabwidget_wrapper.cpp b/Gui/Qt5/NatronGui/pytabwidget_wrapper.cpp deleted file mode 100644 index 7415e8f0f1..0000000000 --- a/Gui/Qt5/NatronGui/pytabwidget_wrapper.cpp +++ /dev/null @@ -1,797 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natrongui_python.h" - -// main header -#include "pytabwidget_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -// Extra includes -#include - - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_PyTabWidgetFunc_appendTab(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyTabWidget::appendTab(PyPanel*) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]), (pyArg)))) { - overloadId = 0; // appendTab(PyPanel*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyTabWidgetFunc_appendTab_TypeError; - - // Call function/method - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::PyPanel *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // appendTab(PyPanel*) - // Begin code injection - bool cppResult = cppSelf->appendTab(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyTabWidgetFunc_appendTab_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyTabWidget.appendTab"); - return {}; -} - -static PyObject *Sbk_PyTabWidgetFunc_closeCurrentTab(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // closeCurrentTab() - cppSelf->closeCurrentTab(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyTabWidgetFunc_closePane(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // closePane() - cppSelf->closePane(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyTabWidgetFunc_closeTab(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyTabWidget::closeTab(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // closeTab(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyTabWidgetFunc_closeTab_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // closeTab(int) - cppSelf->closeTab(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyTabWidgetFunc_closeTab_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyTabWidget.closeTab"); - return {}; -} - -static PyObject *Sbk_PyTabWidgetFunc_count(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // count() - int cppResult = cppSelf->count(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyTabWidgetFunc_currentWidget(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // currentWidget() - QWidget * cppResult = cppSelf->currentWidget(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QWIDGET_IDX]), cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyTabWidgetFunc_floatCurrentTab(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // floatCurrentTab() - cppSelf->floatCurrentTab(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyTabWidgetFunc_floatPane(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // floatPane() - cppSelf->floatPane(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyTabWidgetFunc_getCurrentIndex(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCurrentIndex()const - int cppResult = const_cast(cppSelf)->getCurrentIndex(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyTabWidgetFunc_getScriptName(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getScriptName()const - QString cppResult = const_cast(cppSelf)->getScriptName(); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyTabWidgetFunc_getTabLabel(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyTabWidget::getTabLabel(int)const - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // getTabLabel(int)const - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyTabWidgetFunc_getTabLabel_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // getTabLabel(int)const - QString cppResult = const_cast(cppSelf)->getTabLabel(cppArg0); - pyResult = Shiboken::Conversions::copyToPython(SbkPySide2_QtCoreTypeConverters[SBK_QSTRING_IDX], &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; - - Sbk_PyTabWidgetFunc_getTabLabel_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyTabWidget.getTabLabel"); - return {}; -} - -static PyObject *Sbk_PyTabWidgetFunc_insertTab(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "insertTab", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyTabWidget::insertTab(int,PyPanel*) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkNatronGuiTypes[SBK_PYPANEL_IDX]), (pyArgs[1])))) { - overloadId = 0; // insertTab(int,PyPanel*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyTabWidgetFunc_insertTab_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - if (!Shiboken::Object::isValid(pyArgs[1])) - return {}; - ::PyPanel *cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // insertTab(int,PyPanel*) - // Begin code injection - cppSelf->insertTab(cppArg0,cppArg1); - - // End of code injection - - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyTabWidgetFunc_insertTab_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyTabWidget.insertTab"); - return {}; -} - -static PyObject *Sbk_PyTabWidgetFunc_removeTab(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyTabWidget::removeTab(QWidget*) - // 1: PyTabWidget::removeTab(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 1; // removeTab(int) - } else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppPointerConvertible(reinterpret_cast(SbkPySide2_QtWidgetsTypes[SBK_QWIDGET_IDX]), (pyArg)))) { - overloadId = 0; // removeTab(QWidget*) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyTabWidgetFunc_removeTab_TypeError; - - // Call function/method - switch (overloadId) { - case 0: // removeTab(QWidget * tab) - { - if (!Shiboken::Object::isValid(pyArg)) - return {}; - ::QWidget *cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // removeTab(QWidget*) - cppSelf->removeTab(cppArg0); - } - break; - } - case 1: // removeTab(int index) - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // removeTab(int) - cppSelf->removeTab(cppArg0); - } - break; - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyTabWidgetFunc_removeTab_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyTabWidget.removeTab"); - return {}; -} - -static PyObject *Sbk_PyTabWidgetFunc_setCurrentIndex(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyTabWidget::setCurrentIndex(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setCurrentIndex(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyTabWidgetFunc_setCurrentIndex_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setCurrentIndex(int) - cppSelf->setCurrentIndex(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyTabWidgetFunc_setCurrentIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyTabWidget.setCurrentIndex"); - return {}; -} - -static PyObject *Sbk_PyTabWidgetFunc_setNextTabCurrent(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // setNextTabCurrent() - cppSelf->setNextTabCurrent(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyTabWidgetFunc_splitHorizontally(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // splitHorizontally() - PyTabWidget * cppResult = cppSelf->splitHorizontally(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyTabWidgetFunc_splitVertically(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyTabWidget *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // splitVertically() - PyTabWidget * cppResult = cppSelf->splitVertically(); - pyResult = Shiboken::Conversions::pointerToPython(reinterpret_cast(SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX]), cppResult); - - // Ownership transferences. - Shiboken::Object::getOwnership(pyResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - - -static const char *Sbk_PyTabWidget_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PyTabWidget_methods[] = { - {"appendTab", reinterpret_cast(Sbk_PyTabWidgetFunc_appendTab), METH_O}, - {"closeCurrentTab", reinterpret_cast(Sbk_PyTabWidgetFunc_closeCurrentTab), METH_NOARGS}, - {"closePane", reinterpret_cast(Sbk_PyTabWidgetFunc_closePane), METH_NOARGS}, - {"closeTab", reinterpret_cast(Sbk_PyTabWidgetFunc_closeTab), METH_O}, - {"count", reinterpret_cast(Sbk_PyTabWidgetFunc_count), METH_NOARGS}, - {"currentWidget", reinterpret_cast(Sbk_PyTabWidgetFunc_currentWidget), METH_NOARGS}, - {"floatCurrentTab", reinterpret_cast(Sbk_PyTabWidgetFunc_floatCurrentTab), METH_NOARGS}, - {"floatPane", reinterpret_cast(Sbk_PyTabWidgetFunc_floatPane), METH_NOARGS}, - {"getCurrentIndex", reinterpret_cast(Sbk_PyTabWidgetFunc_getCurrentIndex), METH_NOARGS}, - {"getScriptName", reinterpret_cast(Sbk_PyTabWidgetFunc_getScriptName), METH_NOARGS}, - {"getTabLabel", reinterpret_cast(Sbk_PyTabWidgetFunc_getTabLabel), METH_O}, - {"insertTab", reinterpret_cast(Sbk_PyTabWidgetFunc_insertTab), METH_VARARGS}, - {"removeTab", reinterpret_cast(Sbk_PyTabWidgetFunc_removeTab), METH_O}, - {"setCurrentIndex", reinterpret_cast(Sbk_PyTabWidgetFunc_setCurrentIndex), METH_O}, - {"setNextTabCurrent", reinterpret_cast(Sbk_PyTabWidgetFunc_setNextTabCurrent), METH_NOARGS}, - {"splitHorizontally", reinterpret_cast(Sbk_PyTabWidgetFunc_splitHorizontally), METH_NOARGS}, - {"splitVertically", reinterpret_cast(Sbk_PyTabWidgetFunc_splitVertically), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_PyTabWidget_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PyTabWidget_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PyTabWidget_Type = nullptr; -static SbkObjectType *Sbk_PyTabWidget_TypeF(void) -{ - return _Sbk_PyTabWidget_Type; -} - -static PyType_Slot Sbk_PyTabWidget_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_PyTabWidget_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PyTabWidget_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PyTabWidget_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PyTabWidget_spec = { - "1:NatronGui.PyTabWidget", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PyTabWidget_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PyTabWidget_PythonToCpp_PyTabWidget_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PyTabWidget_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PyTabWidget_PythonToCpp_PyTabWidget_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PyTabWidget_TypeF()))) - return PyTabWidget_PythonToCpp_PyTabWidget_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PyTabWidget_PTR_CppToPython_PyTabWidget(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PyTabWidget_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PyTabWidget_SignatureStrings[] = { - "NatronGui.PyTabWidget.appendTab(self,tab:NatronGui.PyPanel)->bool", - "NatronGui.PyTabWidget.closeCurrentTab(self)", - "NatronGui.PyTabWidget.closePane(self)", - "NatronGui.PyTabWidget.closeTab(self,index:int)", - "NatronGui.PyTabWidget.count(self)->int", - "NatronGui.PyTabWidget.currentWidget(self)->PySide2.QtWidgets.QWidget", - "NatronGui.PyTabWidget.floatCurrentTab(self)", - "NatronGui.PyTabWidget.floatPane(self)", - "NatronGui.PyTabWidget.getCurrentIndex(self)->int", - "NatronGui.PyTabWidget.getScriptName(self)->QString", - "NatronGui.PyTabWidget.getTabLabel(self,index:int)->QString", - "NatronGui.PyTabWidget.insertTab(self,index:int,tab:NatronGui.PyPanel)", - "1:NatronGui.PyTabWidget.removeTab(self,tab:PySide2.QtWidgets.QWidget)", - "0:NatronGui.PyTabWidget.removeTab(self,index:int)", - "NatronGui.PyTabWidget.setCurrentIndex(self,index:int)", - "NatronGui.PyTabWidget.setNextTabCurrent(self)", - "NatronGui.PyTabWidget.splitHorizontally(self)->NatronGui.PyTabWidget", - "NatronGui.PyTabWidget.splitVertically(self)->NatronGui.PyTabWidget", - nullptr}; // Sentinel - -void init_PyTabWidget(PyObject *module) -{ - _Sbk_PyTabWidget_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PyTabWidget", - "PyTabWidget*", - &Sbk_PyTabWidget_spec, - &Shiboken::callCppDestructor< ::PyTabWidget >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PyTabWidget_Type); - InitSignatureStrings(pyType, PyTabWidget_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PyTabWidget_Type), Sbk_PyTabWidget_PropertyStrings); - SbkNatronGuiTypes[SBK_PYTABWIDGET_IDX] - = reinterpret_cast(Sbk_PyTabWidget_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PyTabWidget_TypeF(), - PyTabWidget_PythonToCpp_PyTabWidget_PTR, - is_PyTabWidget_PythonToCpp_PyTabWidget_PTR_Convertible, - PyTabWidget_PTR_CppToPython_PyTabWidget); - - Shiboken::Conversions::registerConverterName(converter, "PyTabWidget"); - Shiboken::Conversions::registerConverterName(converter, "PyTabWidget*"); - Shiboken::Conversions::registerConverterName(converter, "PyTabWidget&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyTabWidget).name()); - - - -} diff --git a/Gui/Qt5/NatronGui/pytabwidget_wrapper.h b/Gui/Qt5/NatronGui/pytabwidget_wrapper.h deleted file mode 100644 index 677b86d584..0000000000 --- a/Gui/Qt5/NatronGui/pytabwidget_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_PYTABWIDGET_H -#define SBK_PYTABWIDGET_H - -#include - -#endif // SBK_PYTABWIDGET_H - diff --git a/Gui/Qt5/NatronGui/pyviewer_wrapper.cpp b/Gui/Qt5/NatronGui/pyviewer_wrapper.cpp deleted file mode 100644 index 8d86958f8f..0000000000 --- a/Gui/Qt5/NatronGui/pyviewer_wrapper.cpp +++ /dev/null @@ -1,1083 +0,0 @@ - -// default includes -#include "Global/Macros.h" -CLANG_DIAG_OFF(mismatched-tags) -GCC_DIAG_OFF(unused-parameter) -GCC_DIAG_OFF(missing-field-initializers) -GCC_DIAG_OFF(missing-declarations) -GCC_DIAG_OFF(uninitialized) -GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF -#include -#include // produces many warnings -#ifndef QT_NO_VERSION_TAGGING -# define QT_NO_VERSION_TAGGING -#endif -#include -#include -#include -#include -#include -#include -#include - -QT_WARNING_DISABLE_DEPRECATED - -#include -#include - -// module include -#include "natrongui_python.h" - -// main header -#include "pyviewer_wrapper.h" - -// inner classes -NATRON_NAMESPACE_USING NATRON_PYTHON_NAMESPACE_USING - -#include -#include - - - -template -static const char *typeNameOf(const T &t) -{ - const char *typeName = typeid(t).name(); - auto size = std::strlen(typeName); -#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64" - if (auto lastStar = strchr(typeName, '*')) { - // MSVC: "class QPaintDevice * __ptr64" - while (*--lastStar == ' ') { - } - size = lastStar - typeName + 1; - } -#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice" - if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) { - ++typeName; - --size; - } -#endif - char *result = new char[size + 1]; - result[size] = '\0'; - memcpy(result, typeName, size); - return result; -} - - -// Target --------------------------------------------------------- - -extern "C" { -static PyObject *Sbk_PyViewerFunc_getAInput(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getAInput()const - int cppResult = const_cast(cppSelf)->getAInput(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getBInput(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getBInput()const - int cppResult = const_cast(cppSelf)->getBInput(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getChannels(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getChannels()const - NATRON_ENUM::DisplayChannelsEnum cppResult = NATRON_ENUM::DisplayChannelsEnum(const_cast(cppSelf)->getChannels()); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getCompositingOperator(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCompositingOperator()const - NATRON_ENUM::ViewerCompositingOperatorEnum cppResult = NATRON_ENUM::ViewerCompositingOperatorEnum(const_cast(cppSelf)->getCompositingOperator()); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getCurrentFrame(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCurrentFrame() - int cppResult = cppSelf->getCurrentFrame(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getCurrentView(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getCurrentView()const - int cppResult = const_cast(cppSelf)->getCurrentView(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getFrameRange(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getFrameRange(int*,int*)const - // Begin code injection - int x,y; - cppSelf->getFrameRange(&x,&y); - pyResult = PyTuple_New(2); - PyTuple_SET_ITEM(pyResult, 0, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &x)); - PyTuple_SET_ITEM(pyResult, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &y)); - return pyResult; - - // End of code injection - - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getPlaybackMode(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getPlaybackMode()const - NATRON_ENUM::PlaybackModeEnum cppResult = NATRON_ENUM::PlaybackModeEnum(const_cast(cppSelf)->getPlaybackMode()); - pyResult = Shiboken::Conversions::copyToPython(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX])->converter, &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_getProxyIndex(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // getProxyIndex()const - int cppResult = const_cast(cppSelf)->getProxyIndex(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_isProxyModeEnabled(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - PyObject *pyResult{}; - - // Call function/method - { - - if (!PyErr_Occurred()) { - // isProxyModeEnabled()const - bool cppResult = const_cast(cppSelf)->isProxyModeEnabled(); - pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppResult); - } - } - - if (PyErr_Occurred() || !pyResult) { - Py_XDECREF(pyResult); - return {}; - } - return pyResult; -} - -static PyObject *Sbk_PyViewerFunc_pause(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // pause() - cppSelf->pause(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyViewerFunc_redraw(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // redraw() - cppSelf->redraw(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyViewerFunc_renderCurrentFrame(PyObject *self, PyObject *args, PyObject *kwds) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numNamedArgs = (kwds ? PyDict_Size(kwds) : 0); - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0}; - - // invalid argument lengths - if (numArgs + numNamedArgs > 1) { - PyErr_SetString(PyExc_TypeError, "NatronGui.PyViewer.renderCurrentFrame(): too many arguments"); - return {}; - } - - if (!PyArg_ParseTuple(args, "|O:renderCurrentFrame", &(pyArgs[0]))) - return {}; - - - // Overloaded function decisor - // 0: PyViewer::renderCurrentFrame(bool) - if (numArgs == 0) { - overloadId = 0; // renderCurrentFrame(bool) - } else if ((pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) { - overloadId = 0; // renderCurrentFrame(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_renderCurrentFrame_TypeError; - - // Call function/method - { - if (kwds) { - PyObject *keyName = nullptr; - PyObject *value = nullptr; - keyName = Py_BuildValue("s","useCache"); - if (PyDict_Contains(kwds, keyName)) { - value = PyDict_GetItem(kwds, keyName); - if (value && pyArgs[0]) { - PyErr_SetString(PyExc_TypeError, "NatronGui.PyViewer.renderCurrentFrame(): got multiple values for keyword argument 'useCache'."); - return {}; - } - if (value) { - pyArgs[0] = value; - if (!(pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0])))) - goto Sbk_PyViewerFunc_renderCurrentFrame_TypeError; - } - } - } - bool cppArg0 = true; - if (pythonToCpp[0]) pythonToCpp[0](pyArgs[0], &cppArg0); - - if (!PyErr_Occurred()) { - // renderCurrentFrame(bool) - cppSelf->renderCurrentFrame(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_renderCurrentFrame_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyViewer.renderCurrentFrame"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_seek(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::seek(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // seek(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_seek_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // seek(int) - cppSelf->seek(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_seek_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.seek"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setAInput(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setAInput(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setAInput(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setAInput_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setAInput(int) - cppSelf->setAInput(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setAInput_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setAInput"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setBInput(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setBInput(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setBInput(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setBInput_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setBInput(int) - cppSelf->setBInput(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setBInput_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setBInput"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setChannels(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setChannels(NATRON_ENUM::DisplayChannelsEnum) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_DISPLAYCHANNELSENUM_IDX])->converter, (pyArg)))) { - overloadId = 0; // setChannels(NATRON_ENUM::DisplayChannelsEnum) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setChannels_TypeError; - - // Call function/method - { - ::NATRON_ENUM::DisplayChannelsEnum cppArg0{NATRON_ENUM::eDisplayChannelsRGB}; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setChannels(NATRON_ENUM::DisplayChannelsEnum) - cppSelf->setChannels(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setChannels_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setChannels"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setCompositingOperator(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setCompositingOperator(NATRON_ENUM::ViewerCompositingOperatorEnum) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_VIEWERCOMPOSITINGOPERATORENUM_IDX])->converter, (pyArg)))) { - overloadId = 0; // setCompositingOperator(NATRON_ENUM::ViewerCompositingOperatorEnum) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setCompositingOperator_TypeError; - - // Call function/method - { - ::NATRON_ENUM::ViewerCompositingOperatorEnum cppArg0{NATRON_ENUM::eViewerCompositingOperatorNone}; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setCompositingOperator(NATRON_ENUM::ViewerCompositingOperatorEnum) - cppSelf->setCompositingOperator(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setCompositingOperator_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setCompositingOperator"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setCurrentView(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setCurrentView(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setCurrentView(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setCurrentView_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setCurrentView(int) - cppSelf->setCurrentView(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setCurrentView_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setCurrentView"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setFrameRange(PyObject *self, PyObject *args) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp[] = { nullptr, nullptr }; - SBK_UNUSED(pythonToCpp) - const Py_ssize_t numArgs = PyTuple_GET_SIZE(args); - SBK_UNUSED(numArgs) - PyObject *pyArgs[] = {0, 0}; - - // invalid argument lengths - - - if (!PyArg_UnpackTuple(args, "setFrameRange", 2, 2, &(pyArgs[0]), &(pyArgs[1]))) - return {}; - - - // Overloaded function decisor - // 0: PyViewer::setFrameRange(int,int) - if (numArgs == 2 - && (pythonToCpp[0] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[0]))) - && (pythonToCpp[1] = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArgs[1])))) { - overloadId = 0; // setFrameRange(int,int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setFrameRange_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp[0](pyArgs[0], &cppArg0); - int cppArg1; - pythonToCpp[1](pyArgs[1], &cppArg1); - - if (!PyErr_Occurred()) { - // setFrameRange(int,int) - cppSelf->setFrameRange(cppArg0, cppArg1); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setFrameRange_TypeError: - Shiboken::setErrorAboutWrongArguments(args, "NatronGui.PyViewer.setFrameRange"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setPlaybackMode(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setPlaybackMode(NATRON_ENUM::PlaybackModeEnum) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(*PepType_SGTP(SbkNatronEngineTypes[SBK_NATRON_ENUM_PLAYBACKMODEENUM_IDX])->converter, (pyArg)))) { - overloadId = 0; // setPlaybackMode(NATRON_ENUM::PlaybackModeEnum) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setPlaybackMode_TypeError; - - // Call function/method - { - ::NATRON_ENUM::PlaybackModeEnum cppArg0{NATRON_ENUM::ePlaybackModeLoop}; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setPlaybackMode(NATRON_ENUM::PlaybackModeEnum) - cppSelf->setPlaybackMode(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setPlaybackMode_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setPlaybackMode"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setProxyIndex(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setProxyIndex(int) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setProxyIndex(int) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setProxyIndex_TypeError; - - // Call function/method - { - int cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setProxyIndex(int) - cppSelf->setProxyIndex(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setProxyIndex_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setProxyIndex"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_setProxyModeEnabled(PyObject *self, PyObject *pyArg) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - int overloadId = -1; - PythonToCppFunc pythonToCpp{}; - SBK_UNUSED(pythonToCpp) - - // Overloaded function decisor - // 0: PyViewer::setProxyModeEnabled(bool) - if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter(), (pyArg)))) { - overloadId = 0; // setProxyModeEnabled(bool) - } - - // Function signature not found. - if (overloadId == -1) goto Sbk_PyViewerFunc_setProxyModeEnabled_TypeError; - - // Call function/method - { - bool cppArg0; - pythonToCpp(pyArg, &cppArg0); - - if (!PyErr_Occurred()) { - // setProxyModeEnabled(bool) - cppSelf->setProxyModeEnabled(cppArg0); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; - - Sbk_PyViewerFunc_setProxyModeEnabled_TypeError: - Shiboken::setErrorAboutWrongArguments(pyArg, "NatronGui.PyViewer.setProxyModeEnabled"); - return {}; -} - -static PyObject *Sbk_PyViewerFunc_startBackward(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // startBackward() - cppSelf->startBackward(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - -static PyObject *Sbk_PyViewerFunc_startForward(PyObject *self) -{ - if (!Shiboken::Object::isValid(self)) - return {}; - auto cppSelf = reinterpret_cast< ::PyViewer *>(Shiboken::Conversions::cppPointer(SbkNatronGuiTypes[SBK_PYVIEWER_IDX], reinterpret_cast(self))); - SBK_UNUSED(cppSelf) - - // Call function/method - { - - if (!PyErr_Occurred()) { - // startForward() - cppSelf->startForward(); - } - } - - if (PyErr_Occurred()) { - return {}; - } - Py_RETURN_NONE; -} - - -static const char *Sbk_PyViewer_PropertyStrings[] = { - nullptr // Sentinel -}; - -static PyMethodDef Sbk_PyViewer_methods[] = { - {"getAInput", reinterpret_cast(Sbk_PyViewerFunc_getAInput), METH_NOARGS}, - {"getBInput", reinterpret_cast(Sbk_PyViewerFunc_getBInput), METH_NOARGS}, - {"getChannels", reinterpret_cast(Sbk_PyViewerFunc_getChannels), METH_NOARGS}, - {"getCompositingOperator", reinterpret_cast(Sbk_PyViewerFunc_getCompositingOperator), METH_NOARGS}, - {"getCurrentFrame", reinterpret_cast(Sbk_PyViewerFunc_getCurrentFrame), METH_NOARGS}, - {"getCurrentView", reinterpret_cast(Sbk_PyViewerFunc_getCurrentView), METH_NOARGS}, - {"getFrameRange", reinterpret_cast(Sbk_PyViewerFunc_getFrameRange), METH_NOARGS}, - {"getPlaybackMode", reinterpret_cast(Sbk_PyViewerFunc_getPlaybackMode), METH_NOARGS}, - {"getProxyIndex", reinterpret_cast(Sbk_PyViewerFunc_getProxyIndex), METH_NOARGS}, - {"isProxyModeEnabled", reinterpret_cast(Sbk_PyViewerFunc_isProxyModeEnabled), METH_NOARGS}, - {"pause", reinterpret_cast(Sbk_PyViewerFunc_pause), METH_NOARGS}, - {"redraw", reinterpret_cast(Sbk_PyViewerFunc_redraw), METH_NOARGS}, - {"renderCurrentFrame", reinterpret_cast(Sbk_PyViewerFunc_renderCurrentFrame), METH_VARARGS|METH_KEYWORDS}, - {"seek", reinterpret_cast(Sbk_PyViewerFunc_seek), METH_O}, - {"setAInput", reinterpret_cast(Sbk_PyViewerFunc_setAInput), METH_O}, - {"setBInput", reinterpret_cast(Sbk_PyViewerFunc_setBInput), METH_O}, - {"setChannels", reinterpret_cast(Sbk_PyViewerFunc_setChannels), METH_O}, - {"setCompositingOperator", reinterpret_cast(Sbk_PyViewerFunc_setCompositingOperator), METH_O}, - {"setCurrentView", reinterpret_cast(Sbk_PyViewerFunc_setCurrentView), METH_O}, - {"setFrameRange", reinterpret_cast(Sbk_PyViewerFunc_setFrameRange), METH_VARARGS}, - {"setPlaybackMode", reinterpret_cast(Sbk_PyViewerFunc_setPlaybackMode), METH_O}, - {"setProxyIndex", reinterpret_cast(Sbk_PyViewerFunc_setProxyIndex), METH_O}, - {"setProxyModeEnabled", reinterpret_cast(Sbk_PyViewerFunc_setProxyModeEnabled), METH_O}, - {"startBackward", reinterpret_cast(Sbk_PyViewerFunc_startBackward), METH_NOARGS}, - {"startForward", reinterpret_cast(Sbk_PyViewerFunc_startForward), METH_NOARGS}, - - {nullptr, nullptr} // Sentinel -}; - -} // extern "C" - -static int Sbk_PyViewer_traverse(PyObject *self, visitproc visit, void *arg) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_traverse(self, visit, arg); -} -static int Sbk_PyViewer_clear(PyObject *self) -{ - return reinterpret_cast(SbkObject_TypeF())->tp_clear(self); -} -// Class Definition ----------------------------------------------- -extern "C" { -static SbkObjectType *_Sbk_PyViewer_Type = nullptr; -static SbkObjectType *Sbk_PyViewer_TypeF(void) -{ - return _Sbk_PyViewer_Type; -} - -static PyType_Slot Sbk_PyViewer_slots[] = { - {Py_tp_base, nullptr}, // inserted by introduceWrapperType - {Py_tp_dealloc, reinterpret_cast(&SbkDeallocWrapper)}, - {Py_tp_repr, nullptr}, - {Py_tp_hash, nullptr}, - {Py_tp_call, nullptr}, - {Py_tp_str, nullptr}, - {Py_tp_getattro, nullptr}, - {Py_tp_setattro, nullptr}, - {Py_tp_traverse, reinterpret_cast(Sbk_PyViewer_traverse)}, - {Py_tp_clear, reinterpret_cast(Sbk_PyViewer_clear)}, - {Py_tp_richcompare, nullptr}, - {Py_tp_iter, nullptr}, - {Py_tp_iternext, nullptr}, - {Py_tp_methods, reinterpret_cast(Sbk_PyViewer_methods)}, - {Py_tp_getset, nullptr}, - {Py_tp_init, nullptr}, - {Py_tp_new, reinterpret_cast(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)}, - {0, nullptr} -}; -static PyType_Spec Sbk_PyViewer_spec = { - "1:NatronGui.PyViewer", - sizeof(SbkObject), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_GC, - Sbk_PyViewer_slots -}; - -} //extern "C" - - -// Type conversion functions. - -// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity). -static void PyViewer_PythonToCpp_PyViewer_PTR(PyObject *pyIn, void *cppOut) { - Shiboken::Conversions::pythonToCppPointer(Sbk_PyViewer_TypeF(), pyIn, cppOut); -} -static PythonToCppFunc is_PyViewer_PythonToCpp_PyViewer_PTR_Convertible(PyObject *pyIn) { - if (pyIn == Py_None) - return Shiboken::Conversions::nonePythonToCppNullPtr; - if (PyObject_TypeCheck(pyIn, reinterpret_cast(Sbk_PyViewer_TypeF()))) - return PyViewer_PythonToCpp_PyViewer_PTR; - return {}; -} - -// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity). -static PyObject *PyViewer_PTR_CppToPython_PyViewer(const void *cppIn) { - auto pyOut = reinterpret_cast(Shiboken::BindingManager::instance().retrieveWrapper(cppIn)); - if (pyOut) { - Py_INCREF(pyOut); - return pyOut; - } - bool changedTypeName = false; - auto tCppIn = reinterpret_cast(cppIn); - const char *typeName = typeid(*tCppIn).name(); - auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName); - if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) { - typeName = typeNameOf(tCppIn); - changedTypeName = true; - } - PyObject *result = Shiboken::Object::newObject(Sbk_PyViewer_TypeF(), const_cast(cppIn), false, /* exactType */ changedTypeName, typeName); - if (changedTypeName) - delete [] typeName; - return result; -} - -// The signatures string for the functions. -// Multiple signatures have their index "n:" in front. -static const char *PyViewer_SignatureStrings[] = { - "NatronGui.PyViewer.getAInput(self)->int", - "NatronGui.PyViewer.getBInput(self)->int", - "NatronGui.PyViewer.getChannels(self)->NatronEngine.NATRON_ENUM.DisplayChannelsEnum", - "NatronGui.PyViewer.getCompositingOperator(self)->NatronEngine.NATRON_ENUM.ViewerCompositingOperatorEnum", - "NatronGui.PyViewer.getCurrentFrame(self)->int", - "NatronGui.PyViewer.getCurrentView(self)->int", - "NatronGui.PyViewer.getFrameRange(self,firstFrame:int*,lastFrame:int*)", - "NatronGui.PyViewer.getPlaybackMode(self)->NatronEngine.NATRON_ENUM.PlaybackModeEnum", - "NatronGui.PyViewer.getProxyIndex(self)->int", - "NatronGui.PyViewer.isProxyModeEnabled(self)->bool", - "NatronGui.PyViewer.pause(self)", - "NatronGui.PyViewer.redraw(self)", - "NatronGui.PyViewer.renderCurrentFrame(self,useCache:bool=true)", - "NatronGui.PyViewer.seek(self,frame:int)", - "NatronGui.PyViewer.setAInput(self,index:int)", - "NatronGui.PyViewer.setBInput(self,index:int)", - "NatronGui.PyViewer.setChannels(self,channels:NatronEngine.NATRON_ENUM.DisplayChannelsEnum)", - "NatronGui.PyViewer.setCompositingOperator(self,op:NatronEngine.NATRON_ENUM.ViewerCompositingOperatorEnum)", - "NatronGui.PyViewer.setCurrentView(self,index:int)", - "NatronGui.PyViewer.setFrameRange(self,firstFrame:int,lastFrame:int)", - "NatronGui.PyViewer.setPlaybackMode(self,mode:NatronEngine.NATRON_ENUM.PlaybackModeEnum)", - "NatronGui.PyViewer.setProxyIndex(self,index:int)", - "NatronGui.PyViewer.setProxyModeEnabled(self,enabled:bool)", - "NatronGui.PyViewer.startBackward(self)", - "NatronGui.PyViewer.startForward(self)", - nullptr}; // Sentinel - -void init_PyViewer(PyObject *module) -{ - _Sbk_PyViewer_Type = Shiboken::ObjectType::introduceWrapperType( - module, - "PyViewer", - "PyViewer*", - &Sbk_PyViewer_spec, - &Shiboken::callCppDestructor< ::PyViewer >, - 0, - 0, - 0 ); - - auto pyType = reinterpret_cast(_Sbk_PyViewer_Type); - InitSignatureStrings(pyType, PyViewer_SignatureStrings); - SbkObjectType_SetPropertyStrings(reinterpret_cast(_Sbk_PyViewer_Type), Sbk_PyViewer_PropertyStrings); - SbkNatronGuiTypes[SBK_PYVIEWER_IDX] - = reinterpret_cast(Sbk_PyViewer_TypeF()); - - // Register Converter - SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_PyViewer_TypeF(), - PyViewer_PythonToCpp_PyViewer_PTR, - is_PyViewer_PythonToCpp_PyViewer_PTR_Convertible, - PyViewer_PTR_CppToPython_PyViewer); - - Shiboken::Conversions::registerConverterName(converter, "PyViewer"); - Shiboken::Conversions::registerConverterName(converter, "PyViewer*"); - Shiboken::Conversions::registerConverterName(converter, "PyViewer&"); - Shiboken::Conversions::registerConverterName(converter, typeid(::PyViewer).name()); - - - -} diff --git a/Gui/Qt5/NatronGui/pyviewer_wrapper.h b/Gui/Qt5/NatronGui/pyviewer_wrapper.h deleted file mode 100644 index 64fb1f1afb..0000000000 --- a/Gui/Qt5/NatronGui/pyviewer_wrapper.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SBK_PYVIEWER_H -#define SBK_PYVIEWER_H - -#include - -#endif // SBK_PYVIEWER_H - From 59fbb9c6e1444c3ab05c3961dad82f631955ae6c Mon Sep 17 00:00:00 2001 From: Frederic Devernay Date: Thu, 30 Jun 2022 16:50:55 -0700 Subject: [PATCH 6/6] fix mac build --- Engine/Engine.pro | 4 +- Gui/Gui.pro | 4 +- INSTALL_MACOS.md | 101 ++++++++++++++------------------------------ config-homebrew.pri | 18 ++++---- config-macports.pri | 2 + 5 files changed, 50 insertions(+), 79 deletions(-) diff --git a/Engine/Engine.pro b/Engine/Engine.pro index 4ca0ab63e2..91292ba086 100644 --- a/Engine/Engine.pro +++ b/Engine/Engine.pro @@ -517,7 +517,9 @@ enginesbk.target = enginesbk enginesbk.commands = cd $$PWD && $$SHIBOKEN \ --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero \ --avoid-protected-hack --enable-pyside-extensions \ - -I.:..:../Global:../libs/OpenFX/include $$join(QT_INCLUDEPATH, ":", "-I") \ + -I.:..:../Global:../libs/OpenFX/include:$$PYTHON_SITE_PACKAGES/PySide2/include:$$[QT_INSTALL_PREFIX]/include \ + $$join(INCLUDEPATH, ":", "-I") \ + $$join(QT_INCLUDEPATH, ":", "-I") \ -T$$TYPESYSTEMPATH --output-directory=$$OUT_PWD/Qt$$QT_MAJOR_VERSION \ $$PYENGINE_HEADER typesystem_engine.xml && \ $$POST_SHIBOKEN $$OUT_PWD/Qt$$QT_MAJOR_VERSION/NatronEngine natronengine diff --git a/Gui/Gui.pro b/Gui/Gui.pro index 1259fe0365..24b4223ffd 100644 --- a/Gui/Gui.pro +++ b/Gui/Gui.pro @@ -450,7 +450,9 @@ guisbk.target = guisbk guisbk.commands = cd $$PWD && $$SHIBOKEN \ --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero \ --avoid-protected-hack --enable-pyside-extensions \ - -I.:..:../Global:../Engine:../libs/OpenFX/include $$join(QT_INCLUDEPATH, ":", "-I") \ + -I.:..:../Global:../Engine:../libs/OpenFX/include:$$PYTHON_SITE_PACKAGES/PySide2/include:$$[QT_INSTALL_PREFIX]/include \ + $$join(INCLUDEPATH, ":", "-I") \ + $$join(QT_INCLUDEPATH, ":", "-I") \ -T../Engine:$$TYPESYSTEMPATH --output-directory=$$OUT_PWD/Qt$$QT_MAJOR_VERSION \ $$PYGUI_HEADER typesystem_natronGui.xml && \ $$POST_SHIBOKEN $$OUT_PWD/Qt$$QT_MAJOR_VERSION/NatronGui natrongui diff --git a/INSTALL_MACOS.md b/INSTALL_MACOS.md index 165e9da19d..03c3574e61 100644 --- a/INSTALL_MACOS.md +++ b/INSTALL_MACOS.md @@ -138,6 +138,22 @@ sudo port -v -N install fftw-3 Install Homebrew from +#### Qt5 + +Install Qt5 + +```Shell +brew install qt@5 pyside@2 +# compilation doesn't work with Qt6 linked) +brew unlink qt +# Fix the pkg-config files +brew install gnu-sed +gsed -e s@libdir=lib@libdir=\${prefix}/lib@ -i /usr/local/opt/pyside\@2/lib/pkgconfig/pyside2.pc +gsed -e s@libdir=lib@libdir=\${prefix}/lib@ -i /usr/local/opt/pyside\@2/lib/pkgconfig/shiboken2.pc +``` + +#### Python2 (optional) + Install Python 2.7 (yes, we know it's deprecated). ```Shell brew uninstall python@2 || true @@ -146,6 +162,8 @@ git checkout 3a877e3525d93cfeb076fc57579bdd589defc585 Formula/python@2.rb; brew install python@2 ``` +#### Qt4 (optional) + Qt 4 is not supported in Homebrew. Please enable the community-maintained recipe using: ```Shell @@ -178,6 +196,8 @@ and before the line that starts with `head`, add the following code: end ``` +#### Other dependencies + Install libraries: ```Shell @@ -352,80 +372,20 @@ If you installed libraries using MacPorts, use the following config.pri: ```Shell - # copy and paste the following in a terminal -cat > config.pri << EOF -boost { - LIBS += -lboost_serialization-mt -} -macx:openmp { - QMAKE_CC = /opt/local/bin/clang-mp-12 - QMAKE_CXX = /opt/local/bin/clang++-mp-12 - QMAKE_OBJECTIVE_CC = \$\$QMAKE_CC -stdlib=libc++ - QMAKE_LINK = \$\$QMAKE_CXX - - INCLUDEPATH += /opt/local/include /opt/local/include/libomp - LIBS += -L/opt/local/lib -L/opt/local/lib/libomp -liomp5 - cc_setting.name = CC - cc_setting.value = \$\$QMAKE_CC - cxx_setting.name = CXX - cxx_setting.value = \$\$QMAKE_CXX - ld_setting.name = LD - ld_setting.value = \$\$QMAKE_CC - ldplusplus_setting.name = LDPLUSPLUS - ldplusplus_setting.value = \$\$QMAKE_CXX - QMAKE_MAC_XCODE_SETTINGS += cc_setting cxx_setting ld_setting ldplusplus_setting - QMAKE_FLAGS = "-B /usr/bin" - - # clang (as of 12.0.1) does not yet support index-while-building functionality - # present in Xcode 9 and later, and Xcode's clang (as of 13.0) does not yet support OpenMP - compiler_index_store_enable_setting.name = COMPILER_INDEX_STORE_ENABLE - compiler_index_store_enable_setting.value = NO - QMAKE_MAC_XCODE_SETTINGS += compiler_index_store_enable_setting -} -EOF +# copy and paste the following in a terminal +cp config-macports.pri config.pri ``` If you installed libraries using Homebrew, use the following config.pri: ```Shell - # copy and paste the following in a terminal - # Get the LLVM version corresponding to your Xcode version, from - # the table at https://en.wikipedia.org/wiki/Xcode#Toolchain_versions - # Here it is LLVM 11 for Xcode 12.5.1 -cat > config.pri << EOF -boost: INCLUDEPATH += /usr/local/include -boost: LIBS += -L/usr/local/lib -lboost_serialization-mt -lboost_thread-mt -lboost_system-mt -expat: PKGCONFIG -= expat -expat: INCLUDEPATH += /usr/local/opt/expat/include -expat: LIBS += -L/usr/local/opt/expat/lib -lexpat -macx:openmp { - QMAKE_CC = /usr/local/opt/llvm@11/bin/clang - QMAKE_CXX = /usr/local/opt/llvm@11/bin/clang++ - QMAKE_OBJECTIVE_CC = \$\$QMAKE_CC -stdlib=libc++ - QMAKE_LINK = \$\$QMAKE_CXX - - LIBS += -L/usr/local/opt/llvm@11/lib -lomp - cc_setting.name = CC - cc_setting.value = \$\$QMAKE_CC - cxx_setting.name = CXX - cxx_setting.value = \$\$QMAKE_CXX - ld_setting.name = LD - ld_setting.value = \$\$QMAKE_CC - ldplusplus_setting.name = LDPLUSPLUS - ldplusplus_setting.value = \$\$QMAKE_CXX - QMAKE_MAC_XCODE_SETTINGS += cc_setting cxx_setting ld_setting ldplusplus_setting - QMAKE_FLAGS = "-B /usr/bin" - - # clang (as of 5.0) does not yet support index-while-building functionality - # present in Xcode 9, and Xcode 9's clang does not yet support OpenMP - compiler_index_store_enable_setting.name = COMPILER_INDEX_STORE_ENABLE - compiler_index_store_enable_setting.value = NO - QMAKE_MAC_XCODE_SETTINGS += compiler_index_store_enable_setting -} -EOF +# copy and paste the following in a terminal +cp config-homebrew.pri config.pri ``` +Then check at the top of the `config.pri` file that the `HOMEBREW` variable is set to the homebrew installation prefix (usually `/opt/homebrew`). + ## Build with Makefile You can generate a makefile by opening a Terminal, setting the current @@ -617,7 +577,7 @@ On MacPorts with qt4-mac, py310-pyside, py310-shiboken: ```Shell PYV=3.10 # Set to the python version QT=4 -rm Engine/Qt4/NatronEngine/* Gui/Qt4/NatronGui/* +rm Engine/Qt${QT}/NatronEngine/* Gui/Qt${QT}/NatronGui/* shiboken-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-paths=../Engine:../Global:/opt/local/include:/opt/local/include/PySide-${PYV} --typesystem-paths=/opt/local/share/PySide-${PYV}/typesystems --output-directory=Engine/Qt${QT} Engine/Pyside_Engine_Python.h Engine/typesystem_engine.xml @@ -627,6 +587,9 @@ tools/utils/runPostShiboken.sh Engine/Qt${QT}/NatronEngine natronengine tools/utils/runPostShiboken.sh Gui/Qt${QT}/NatronGui natrongui ``` +Building Natron with Qt5 should generate the Python bindings automatically, but in case it does not, +here are the commands to recreate the Python bindings: + On MacPorts with qt5, py310-pyside2: ```Shell PYV=3.10 # Set to the python version @@ -635,7 +598,7 @@ QT=5 # Fix a missing link in the MacPorts package [ ! -f ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/shiboken2_generator/shiboken2-${PYV} ] && sudo ln -s shiboken2 ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/shiboken2_generator/shiboken2-${PYV} -rm Engine/Qt5/NatronEngine/* Gui/Qt5/NatronGui/* +rm Engine/Qt${QT}/NatronEngine/* Gui/Qt${QT}/NatronGui/* # ${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include shiboken2-${PYV} --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Engine:Global:libs/OpenFX/include:/opt/local/include:/opt/local/libexec/qt${QT}/include:${PYTHON_PREFIX}/include/python${PYV}:${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/include --typesystem-paths=${PYTHON_PREFIX}/lib/python${PYV}/site-packages/PySide2/typesystems --output-directory=Engine/Qt${QT} Engine/Pyside2_Engine_Python.h Engine/typesystem_engine.xml @@ -650,7 +613,7 @@ on HomeBrew with Qt5/PySide2/Shiboken2: PYV=3.10 # Set to the python version export PATH="/usr/local/opt/pyside@2/bin:$PATH" QT=5 -rm Engine/Qt${QT}/NatronEngine/* Gui/Qt5/NatronGui/* +rm Engine/Qt${QT}/NatronEngine/* Gui/Qt${QT}/NatronGui/* shiboken2 --enable-parent-ctor-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack --enable-pyside-extensions --include-paths=.:Global:Engine:libs/OpenFX/include:/usr/local/Frameworks/Python.framework/Versions/${PYV}/include/python${PYV}:/usr/local/include:/usr/local/opt/pyside@2/include/PySide2:/usr/local/opt/qt@${QT}/include --typesystem-paths=/usr/local/opt/pyside@2/share/PySide2/typesystems --output-directory=Engine/Qt${QT} Engine/PySide2_Engine_Python.h Engine/typesystem_engine.xml diff --git a/config-homebrew.pri b/config-homebrew.pri index ef35f8d277..eac16ca029 100644 --- a/config-homebrew.pri +++ b/config-homebrew.pri @@ -1,19 +1,21 @@ -boost: INCLUDEPATH += /usr/local/include -boost: LIBS += -L/usr/local/lib -lboost_serialization-mt -lboost_thread-mt -lboost_system-mt -# libdir is buggy in pyside@2's pkg-config -pyside: LIBS += -L/usr/local/opt/pyside@2/lib +# Edit the following if the homebrew prefix is different. +# Older homebrew installations use /usr/local instead of /opt/homebrew +HOMEBREW = /usr/local + +boost: INCLUDEPATH += $$HOMEBREW/include +boost: LIBS += -L$$HOMEBREW/lib -lboost_serialization-mt -lboost_thread-mt -lboost_system-mt openmp { # clang 12+ is OK to build Natron, but libomp 12+ has a bug on macOS when # lanching tasks from a background thread, see https://bugs.llvm.org/show_bug.cgi?id=50579 - LIBS += -L/usr/local/opt/llvm@11/lib -lomp - QMAKE_CC = /usr/local/opt/llvm@11/bin/clang - QMAKE_CXX = /usr/local/opt/llvm@11/bin/clang++ + LIBS += -L$$HOMEBREW/opt/llvm@11/lib -lomp + QMAKE_CC = $$HOMEBREW/opt/llvm@11/bin/clang + QMAKE_CXX = $$HOMEBREW/opt/llvm@11/bin/clang++ # Recent clang cannot compile QtMac.mm QMAKE_OBJECTIVE_CC = clang QMAKE_OBJECTIVE_CXX = clang++ QMAKE_LINK = $$QMAKE_CXX - INCLUDEPATH += /usr/local/include + INCLUDEPATH += $HOMEBREW/include cc_setting.name = CC cc_setting.value = $$QMAKE_CC cxx_setting.name = CXX diff --git a/config-macports.pri b/config-macports.pri index 04c66c65ba..7003df0b2c 100644 --- a/config-macports.pri +++ b/config-macports.pri @@ -1,4 +1,5 @@ boost { + INCLUDEPATH += /opt/local/include LIBS += -lboost_serialization-mt } equals(QT_MAJOR_VERSION, 5) { @@ -12,6 +13,7 @@ equals(QT_MAJOR_VERSION, 5) { pyside: INCLUDEPATH += $$PYTHON_SITE_PACKAGES/PySide2/include/QtWidgets pyside: LIBS += -L$$PYTHON_SITE_PACKAGES/PySide2 -lpyside2.cpython-$$PYVERNODOT-darwin.$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION} pyside: QMAKE_RPATHDIR += $$PYTHON_SITE_PACKAGES/PySide2 + pyside: TYPESYSTEMPATH *= $$PYTHON_SITE_PACKAGES/PySide2/typesystems } macx:openmp {