diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-05-06 21:19:07 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-05-06 21:19:07 +0200 |
commit | 91b93e1021ccc06d13e0d66a43bf7f9063faeff3 (patch) | |
tree | f5270164466b42367d4df63d723b3a4db4d7d0fe /sources | |
parent | edae6185cef9c0ddd7c7c88bfa97c5043ba0d78a (diff) | |
parent | 06f97eca45ddadf4f04229cf14d5dc0bbd867316 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ia87a2e46bb051f1cccf3b7ba988aeb5eb32c0f0e
Diffstat (limited to 'sources')
58 files changed, 2082 insertions, 416 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt index 1e6f017d7..e5e5ab4e7 100644 --- a/sources/pyside2/CMakeLists.txt +++ b/sources/pyside2/CMakeLists.txt @@ -173,7 +173,10 @@ include(PySideModules) macro(COLLECT_MODULE_IF_FOUND shortname) set(name "Qt5${shortname}") - + set(_qt_module_name "${name}") + if ("${shortname}" STREQUAL "OpenGLFunctions") + set(_qt_module_name "Qt5Gui") + endif() # Determine essential/optional/missing set(module_state "missing") list(FIND ALL_ESSENTIAL_MODULES "${shortname}" essentialIndex) @@ -192,12 +195,12 @@ macro(COLLECT_MODULE_IF_FOUND shortname) set(quiet_argument "QUIET") endif() - find_package(${name} ${quiet_argument}) + find_package(${_qt_module_name} ${quiet_argument}) # If package is found, _name_found will be equal to 1 - set(_name_found "${name}_FOUND") + set(_name_found "${_qt_module_name}_FOUND") # _name_dir will keep the path to the directory where the CMake rules were found # e.g: ~/qt5.9-install/qtbase/lib/cmake/Qt5Core or /usr/lib64/cmake/Qt5Core - set(_name_dir "${name}_DIR") + set(_name_dir "${_qt_module_name}_DIR") # Qt5Core will set the base path to check if all the modules are on the same # directory, to avoid CMake looking in another path. # This will be saved in a global variable at the beginning of the modules @@ -256,7 +259,7 @@ endif() # Collect all optional modules. set(ALL_OPTIONAL_MODULES Xml XmlPatterns Help Multimedia -MultimediaWidgets OpenGL Positioning Location Qml Quick QuickWidgets RemoteObjects Scxml Script ScriptTools Sensors TextToSpeech Charts Svg DataVisualization) +MultimediaWidgets OpenGL OpenGLFunctions Positioning Location Qml Quick QuickWidgets RemoteObjects Scxml Script ScriptTools Sensors TextToSpeech Charts Svg DataVisualization) find_package(Qt5UiTools) if(Qt5UiTools_FOUND) list(APPEND ALL_OPTIONAL_MODULES UiTools) diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt index 5a371b8a9..d666751ea 100644 --- a/sources/pyside2/PySide2/CMakeLists.txt +++ b/sources/pyside2/PySide2/CMakeLists.txt @@ -43,7 +43,11 @@ file(READ "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" pyside2_global_contents foreach(shortname IN LISTS all_module_shortnames) set(name "Qt5${shortname}") - HAS_QT_MODULE(${name}_FOUND Qt${shortname}) + set(_qt_module_name "${name}") + if ("${shortname}" STREQUAL "OpenGLFunctions") + set(_qt_module_name "Qt5Gui") + endif() + HAS_QT_MODULE(${_qt_module_name}_FOUND Qt${shortname}) # Create a module header consisting of pyside2_global.h and the module # include. Note: The contents of pyside2_global.h must be copied instead of @@ -59,7 +63,7 @@ foreach(shortname IN LISTS all_module_shortnames) endif() set(module_header_content "${module_header_content}\n${pyside2_global_contents}") # AxContainer/AxServer from Active Qt do not have module headers - if(NOT "${shortname}" STREQUAL "AxContainer") + if(NOT "${shortname}" STREQUAL "AxContainer" AND NOT "${shortname}" STREQUAL "OpenGLFunctions") set(module_header_content "${module_header_content}\n#include <Qt${shortname}/Qt${shortname}>") endif() set(post_header "${CMAKE_CURRENT_BINARY_DIR}/Qt${shortname}/Qt${shortname}_global.post.h") @@ -87,6 +91,8 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/datavisualization_common.xml DESTINATION share/PySide2${pyside_SUFFIX}/typesystems) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/opengl_common.xml DESTINATION share/PySide2${pyside_SUFFIX}/typesystems) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/openglfunctions_common.xml + DESTINATION share/PySide2${pyside_SUFFIX}/typesystems) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/webkitwidgets_common.xml DESTINATION share/PySide2${pyside_SUFFIX}/typesystems) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/templates/xml_common.xml diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index cadfc33fa..71001140c 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -43,6 +43,7 @@ <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> <load-typesystem name="templates/core_common.xml" generate="no"/> <load-typesystem name="templates/gui_common.xml" generate="no"/> + <load-typesystem name="templates/openglfunctions_common.xml" generate="no"/> <rejection class="^Q.*$" argument-type="^QPlatform.*$"/> @@ -2906,12 +2907,7 @@ <modify-argument index="2"><array/></modify-argument> </modify-function> <!-- Add explicit signatures for the setUniformValue functions --> - <modify-function signature="setUniformValue(const char*, GLfloat)" remove="all"/> - <modify-function signature="setUniformValue(const char*, GLint)" remove="all"/> - <modify-function signature="setUniformValue(const char*, GLuint)" remove="all"/> - <modify-function signature="setUniformValue(int, GLfloat)" remove="all"/> - <modify-function signature="setUniformValue(int, GLint)" remove="all"/> - <modify-function signature="setUniformValue(int, GLuint)" remove="all"/> + <modify-function signature="^setUniformValue\(const char\*,(float|int|uint)\)$" remove="all"/> <!-- No need for a signature for GLuint, since Qt (internally) calls the same function: glUniform1i --> <add-function signature="setUniformValue1f(const char*, float)" return-type="void"> <inject-code file="../glue/qtgui.cpp" snippet="qopenglshaderprogram_setuniformvalue_float"/> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt new file mode 100644 index 000000000..72b3a16ca --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt @@ -0,0 +1,72 @@ +project(QtOpenGLFunctions) + +set(QtOpenGLFunctions_DROPPED_ENTRIES) + +get_property(QtOpenGLFunctions_enabled_features TARGET Qt5::Gui PROPERTY INTERFACE_QT_ENABLED_FEATURES) + +set(QtOpenGLFunctions_SRC ${QtOpenGLFunctions_GEN_DIR}/qtopenglfunctions_module_wrapper.cpp) + +# cf qtbase/src/gui/opengl/opengl.pri +list(FIND QtOpenGLFunctions_enabled_features "opengles2" _opengles2Index) +# ### fixme: For cmake >= 3.3: if(opengles2 IN_LIST QtOpenGLFunctions_enabled_features) +if(_opengles2Index GREATER -1) + list(APPEND QtOpenGLFunctions_DROPPED_ENTRIES QOpenGLTimeMonitor QOpenGLTimerQuery) + list(APPEND QtOpenGLFunctions_SRC + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_es2_wrapper.cpp) + message(STATUS "Qt5OpenGLFunctions: Dropping Desktop OpenGL classes (GLES2)") +else() + list(APPEND QtOpenGLFunctions_SRC + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_1_0_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_1_1_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_1_2_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_1_3_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_1_4_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_1_5_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_2_0_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_2_1_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_3_0_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_3_1_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_3_2_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_3_2_core_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_3_3_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_3_3_core_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_0_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_0_core_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_1_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_1_core_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_2_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_2_core_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_3_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_3_core_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_4_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_4_core_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_5_compatibility_wrapper.cpp + ${QtOpenGLFunctions_GEN_DIR}/qopenglfunctions_4_5_core_wrapper.cpp) + message(STATUS "Qt5OpenGLFunctions: Adding Desktop OpenGL classes") +endif() + +configure_file("${QtOpenGLFunctions_SOURCE_DIR}/QtOpenGLFunctions_global.post.h.in" + "${QtOpenGLFunctions_BINARY_DIR}/QtOpenGLFunctions_global.post.h" @ONLY) + +set(QtOpenGLFunctions_include_dirs ${QtGOpenGLFunctions_SOURCE_DIR} + ${QtOpenGLFunctions_BINARY_DIR} + ${pyside2_SOURCE_DIR} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${libpyside_SOURCE_DIR} + ${QtCore_GEN_DIR} + ${QtGui_GEN_DIR} + ) +set(QtOpenGLFunctions_libraries pyside2 + ${Qt5Gui_LIBRARIES}) + +set(QtOpenGLFunctions_deps QtGui) + +create_pyside_module(NAME QtOpenGLFunctions + INCLUDE_DIRS QtOpenGLFunctions_include_dirs + LIBRARIES QtOpenGLFunctions_libraries + DEPS QtOpenGLFunctions_deps + TYPESYSTEM_PATH QtOpenGLFunctions_SOURCE_DIR + SOURCES QtOpenGLFunctions_SRC + TYPESYSTEM_NAME ${QtOpenGLFunctions_BINARY_DIR}/typesystem_openglfunctions.xml + DROPPED_ENTRIES QtOpenGLFunctions_DROPPED_ENTRIES) diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in b/sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in new file mode 100644 index 000000000..6c8c77087 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/QtOpenGLFunctions_global.post.h.in @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtGui/qtgui-config.h> +// OpenGL functions are not in the QtGui module header +#if QT_CONFIG(opengl) +# include <QtGui/qopenglfunctions_1_0.h> +# include <QtGui/qopenglfunctions_1_1.h> +# include <QtGui/qopenglfunctions_1_2.h> +# include <QtGui/qopenglfunctions_1_3.h> +# include <QtGui/qopenglfunctions_1_4.h> +# include <QtGui/qopenglfunctions_1_5.h> +# include <QtGui/qopenglfunctions_2_0.h> +# include <QtGui/qopenglfunctions_2_1.h> +# include <QtGui/qopenglfunctions_3_0.h> +# include <QtGui/qopenglfunctions_3_1.h> +# include <QtGui/qopenglfunctions_3_2_compatibility.h> +# include <QtGui/qopenglfunctions_3_2_core.h> +# include <QtGui/qopenglfunctions_3_3_compatibility.h> +# include <QtGui/qopenglfunctions_3_3_core.h> +# include <QtGui/qopenglfunctions_4_0_compatibility.h> +# include <QtGui/qopenglfunctions_4_0_core.h> +# include <QtGui/qopenglfunctions_4_1_compatibility.h> +# include <QtGui/qopenglfunctions_4_1_core.h> +# include <QtGui/qopenglfunctions_4_2_compatibility.h> +# include <QtGui/qopenglfunctions_4_2_core.h> +# include <QtGui/qopenglfunctions_4_3_compatibility.h> +# include <QtGui/qopenglfunctions_4_3_core.h> +# include <QtGui/qopenglfunctions_4_4_compatibility.h> +# include <QtGui/qopenglfunctions_4_4_core.h> +# include <QtGui/qopenglfunctions_4_5_compatibility.h> +# include <QtGui/qopenglfunctions_4_5_core.h> +#endif +#if QT_CONFIG(opengles2) +# include <QtGui/qopenglfunctions_es2.h> +#endif diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml new file mode 100644 index 000000000..1d5b08edb --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions.xml @@ -0,0 +1,409 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem package="PySide2.QtOpenGLFunctions"> + <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/> + <load-typesystem name="templates/openglfunctions_common.xml" generate="no"/> + + <rejection class="^QOpenGL.*$" argument-type="^(const )?GLboolean ?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^GLchar\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?GLchar ?\*(const)?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^char\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?char ?\*\*$"/> + <rejection class="^QOpenGL.*$" argument-type="GLintptr"/> + <rejection class="^QOpenGL.*$" argument-type="GLsizeiptr"/> + <rejection class="^QOpenGL.*$" argument-type="GLsync"/> + <rejection class="^QOpenGL.*$" argument-type="^GLubyte( const)?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?QMatrix.x. ?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="qopengl_GLintptr"/> + <rejection class="^QOpenGL.*$" argument-type="qopengl_GLsizeiptr"/> + <rejection class="^QOpenGL.*$" argument-type="QOpenGLTextureHelper*"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?QVector.D ?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?void ?\*\*$"/> + <rejection class="^QOpenGLFunctions.*$" function-name="^glGet(Buffer|VertexAttrib)?Pointer.*$"/> + <rejection class="^QOpenGLFunctions.*$" function-name="^glMultiDrawElements.*$"/> + <!-- Reject any non-const array of the version functions --> + <rejection class="^QOpenGLFunctions_\d_\d.*$" argument-type="^GL\w+ ?\*$"/> + + <object-type name="QOpenGLFunctions_1_0" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + </object-type> + <object-type name="QOpenGLFunctions_1_1" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + </object-type> + <object-type name="QOpenGLFunctions_1_2" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + </object-type> + <object-type name="QOpenGLFunctions_1_3" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + </object-type> + <object-type name="QOpenGLFunctions_1_4" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + </object-type> + <object-type name="QOpenGLFunctions_1_5" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + </object-type> + <object-type name="QOpenGLFunctions_2_0" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + </object-type> + <object-type name="QOpenGLFunctions_2_1" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + </object-type> + <object-type name="QOpenGLFunctions_3_0" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + </object-type> + <object-type name="QOpenGLFunctions_3_1" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + </object-type> + <object-type name="QOpenGLFunctions_3_2_Compatibility" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + </object-type> + <object-type name="QOpenGLFunctions_3_2_Core" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + </object-type> + <object-type name="QOpenGLFunctions_3_3_Compatibility" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + </object-type> + <object-type name="QOpenGLFunctions_3_3_Core" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + </object-type> + <object-type name="QOpenGLFunctions_4_0_Compatibility" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + </object-type> + <object-type name="QOpenGLFunctions_4_0_Core" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + </object-type> + <object-type name="QOpenGLFunctions_4_1_Compatibility" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_1; + &openglfunctions_modifications4_0; + </object-type> + <object-type name="QOpenGLFunctions_4_1_Core" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + &openglfunctions_modifications_va; + </object-type> + <object-type name="QOpenGLFunctions_4_2_Compatibility" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + </object-type> + <object-type name="QOpenGLFunctions_4_2_Core" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + &openglfunctions_modifications_va; + </object-type> + <object-type name="QOpenGLFunctions_4_3_Compatibility" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + &openglfunctions_modifications4_3; + </object-type> + <object-type name="QOpenGLFunctions_4_3_Core" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_3; + &openglfunctions_modifications4_1; + &openglfunctions_modifications_va; + </object-type> + <object-type name="QOpenGLFunctions_4_4_Compatibility" since="5.5"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + &openglfunctions_modifications4_3; + &openglfunctions_modifications4_4; + &openglfunctions_modifications4_4_core; + </object-type> + <object-type name="QOpenGLFunctions_4_4_Core" since="5.5"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + &openglfunctions_modifications_va; + &openglfunctions_modifications4_3; + &openglfunctions_modifications4_4; + &openglfunctions_modifications4_4_core; + </object-type> + <object-type name="QOpenGLFunctions_4_5_Compatibility" since="5.5"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_0_compat; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_1_compat; + &openglfunctions_modifications1_2_compat; + &openglfunctions_modifications1_3_compat; + &openglfunctions_modifications1_4; + &openglfunctions_modifications1_4_compat; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_0_compat; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications3_3a; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + &openglfunctions_modifications4_3; + &openglfunctions_modifications4_4; + &openglfunctions_modifications4_4_core; + &openglfunctions_modifications4_5; + </object-type> + <object-type name="QOpenGLFunctions_4_5_Core" since="5.5"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + &openglfunctions_modifications1_4; + &openglfunctions_modifications2_0; + &openglfunctions_modifications2_1; + &openglfunctions_modifications3_0; + &openglfunctions_modifications3_3; + &openglfunctions_modifications4_0; + &openglfunctions_modifications4_1; + &openglfunctions_modifications4_3; + &openglfunctions_modifications4_4; + &openglfunctions_modifications4_4_core; + &openglfunctions_modifications4_5; + &openglfunctions_modifications_va; + </object-type> + <object-type name="QOpenGLFunctions_ES2" since="5.1"> + &openglfunctions_modifications1_0; + &openglfunctions_modifications1_1; + </object-type> + <suppress-warning text="^There's no user provided way.*QOpenGLFunctions_\d_\d.*::glIndex.*$"/> + +</typesystem> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_0.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_0.xml new file mode 100644 index 000000000..5652ad6b6 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_0.xml @@ -0,0 +1,51 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glGetStringi?\(.*$"> + <modify-argument index="return"> + <replace-type modified-type="QString"/> + </modify-argument> + <inject-code class="target" position="beginning"> + <insert-template name="glGetString_return_QString"/> + </inject-code> +</modify-function> +<modify-function signature="^glTexParameterI?u?[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_0_compat.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_0_compat.xml new file mode 100644 index 000000000..5793048cd --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_0_compat.xml @@ -0,0 +1,103 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glBitmap\(.*$" remove="all"/> +<modify-function signature="^glColor[34][a-z]{1,2}v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="glClipPlane(unsigned int,const double *)"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glEvalCoord\d[a-z]{1,2}v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glFog[fi]v\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glIndex[a-z]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glLoadMatrix[df]\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glLight[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glLightModel[fi]v\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glMap1[df]\(.*$"> + <modify-argument index="6"><array/></modify-argument> +</modify-function> +<modify-function signature="^glMap2[df]\(.*$"> + <modify-argument index="10"><array/></modify-argument> +</modify-function> +<modify-function signature="^glMaterial[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glMultMatrix[df]\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glNormal3.v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glPixelMap[a-z]{1,2}v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glPolygonStipple\(.*$" remove="all"/> +<modify-function signature="^glRasterPos\d[a-z]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glRect[dfis]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glTexCoord\d[dfis]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glTexEnv[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glTexGen[dfi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glVertex\d[dfis]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_1.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_1.xml new file mode 100644 index 000000000..9383fb83f --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_1.xml @@ -0,0 +1,44 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<!-- Except glGenLists/glDeleteLists --> +<modify-function signature="^glDelete[A-KM-Z].*s\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_1_compat.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_1_compat.xml new file mode 100644 index 000000000..3f8075b30 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_1_compat.xml @@ -0,0 +1,44 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glPrioritizeTextures\(.*$"> + <modify-argument index="2"><array/></modify-argument> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_2_compat.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_2_compat.xml new file mode 100644 index 000000000..c13b09b5b --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_2_compat.xml @@ -0,0 +1,46 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glColorTableParameter[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glConvolutionParameter[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_3_compat.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_3_compat.xml new file mode 100644 index 000000000..e35f3b334 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_3_compat.xml @@ -0,0 +1,46 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^gl(Load|Mult)TransposeMatrix[df]\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glMultiTexCoord\d[a-z]v\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_4.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_4.xml new file mode 100644 index 000000000..1102daea8 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_4.xml @@ -0,0 +1,47 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glMultiDrawArrays\(.*$"> + <modify-argument index="2"><array/></modify-argument> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glPointParameter[fi]v\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_4_compat.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_4_compat.xml new file mode 100644 index 000000000..4cb75d418 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications1_4_compat.xml @@ -0,0 +1,49 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glFogCoord[df]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glSecondaryColor3u?[bdfis]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> +<modify-function signature="^glWindowPos[23][dfis]v\(.*$"> + <modify-argument index="1"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_0.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_0.xml new file mode 100644 index 000000000..28a424e1a --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_0.xml @@ -0,0 +1,49 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glDrawBuffers\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glUniformMatrix\d[df]v\(.*$"> + <modify-argument index="4"><array/></modify-argument> +</modify-function> +<modify-function signature="^glUniform\d?.v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_0_compat.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_0_compat.xml new file mode 100644 index 000000000..49cbd5c05 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_0_compat.xml @@ -0,0 +1 @@ +&typesystem_openglfunctions_modifications_va.xml; diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_1.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_1.xml new file mode 100644 index 000000000..af515ed8c --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications2_1.xml @@ -0,0 +1,43 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glUniformMatrix\dx\d[a-z]v\(.*$"> + <modify-argument index="4"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_0.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_0.xml new file mode 100644 index 000000000..8377e440b --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_0.xml @@ -0,0 +1,46 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glClearBufferu?[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glUniform\duiv\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_3.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_3.xml new file mode 100644 index 000000000..7f4717170 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_3.xml @@ -0,0 +1,46 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glSamplerParameterI?u?[dfi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glVertexAttribP\duiv\(.*$"> + <modify-argument index="4"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_3a.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_3a.xml new file mode 100644 index 000000000..4bf2bc8f5 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications3_3a.xml @@ -0,0 +1,57 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +Present from 3.3..4.5 except 4.4 Core/4.5 Core +--> +<modify-function signature="^glColorP[34]uiv\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glMultiTexCoordP\duiv\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^gl(Normal|SecondaryColor)P3uiv\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glTexCoordP\duiv\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glVertexP\duiv\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_0.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_0.xml new file mode 100644 index 000000000..cf2e47a5c --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_0.xml @@ -0,0 +1,46 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glPatchParameterfv\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="^glUniformSubroutinesuiv\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_1.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_1.xml new file mode 100644 index 000000000..bc92ce80d --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_1.xml @@ -0,0 +1,58 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^gl(DepthRange|Scissor|Viewport)Arrayv\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glProgramUniform\du?[dfi]v\(.*$"> + <modify-argument index="4"><array/></modify-argument> +</modify-function> +<modify-function signature="^glProgramUniformMatrix\d[df]v\(.*$"> + <modify-argument index="5"><array/></modify-argument> +</modify-function> +<modify-function signature="^glProgramUniformMatrix\dx\d[df]v\(.*$"> + <modify-argument index="5"><array/></modify-argument> +</modify-function> +<modify-function signature="^gl(Scissor|Viewport)Indexedf?v\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> +<modify-function signature="glShaderBinary(int,const unsigned int*,unsigned int,const void *,int)"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_3.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_3.xml new file mode 100644 index 000000000..b3c2b618d --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_3.xml @@ -0,0 +1,43 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glInvalidate(Sub)?Framebuffer\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_4.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_4.xml new file mode 100644 index 000000000..ef6949a8e --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_4.xml @@ -0,0 +1,46 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glBindBuffersBase\(.*$"> + <modify-argument index="4"><array/></modify-argument> +</modify-function> +<modify-function signature="^glBind(ImageTextures|Samplers|Textures)\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_4_core.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_4_core.xml new file mode 100644 index 000000000..c747997aa --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_4_core.xml @@ -0,0 +1,43 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glDebugMessageControl\(.*$"> + <modify-argument index="5"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_5.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_5.xml new file mode 100644 index 000000000..0a83531e6 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_5.xml @@ -0,0 +1,52 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glClearNamedFramebufferu?[fi]v\(.*$"> + <modify-argument index="4"><array/></modify-argument> +</modify-function> +<modify-function signature="^glInvalidateNamedFramebuffer(Sub)?Data\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glNamedFramebufferDrawBuffers\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> +<modify-function signature="^glTextureParameterI?u?[fi]v\(.*$"> + <modify-argument index="3"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_5_core.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_5_core.xml new file mode 100644 index 000000000..5cd5161f8 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications4_5_core.xml @@ -0,0 +1,41 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + Remove me! +--> diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications_va.xml b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications_va.xml new file mode 100644 index 000000000..ae4d49ab1 --- /dev/null +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/typesystem_openglfunctions_modifications_va.xml @@ -0,0 +1,43 @@ +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<modify-function signature="^glVertexAttrib[IL]?\dN?u?[bdfis]v\(.*$"> + <modify-argument index="2"><array/></modify-argument> +</modify-function> diff --git a/sources/pyside2/PySide2/support/generate_pyi.py b/sources/pyside2/PySide2/support/generate_pyi.py index f286e34f1..377a53331 100644 --- a/sources/pyside2/PySide2/support/generate_pyi.py +++ b/sources/pyside2/PySide2/support/generate_pyi.py @@ -53,6 +53,7 @@ import re import subprocess import argparse import glob +import math from contextlib import contextmanager from textwrap import dedent import traceback @@ -183,6 +184,33 @@ def find_imports(text): return [imp for imp in PySide2.__all__ if imp + "." in text] +_cache = {} + +def check_if_skipable(outfilepath): + # A file can be skipped if it exists, and if it's file time is not + # older than this script or any of its dependencies. + def _do_find_newest_module(): + newest = 0 + for obj in sys.modules.values(): + if getattr(obj, "__file__", None) and os.path.isfile(obj.__file__): + sourcepath = os.path.splitext(obj.__file__)[0] + ".py" + if os.path.exists(sourcepath): + newest = max(os.path.getmtime(sourcepath), newest) + return newest + + def find_newest_module(): + cache_name = "newest_module" + if cache_name not in _cache: + _cache[cache_name] = _do_find_newest_module() + return _cache[cache_name] + + if os.path.exists(outfilepath): + stamp = os.path.getmtime(outfilepath) + if stamp >= find_newest_module(): + return True + return False + + def generate_pyi(import_name, outpath, options): """ Generates a .pyi file. @@ -198,7 +226,7 @@ def generate_pyi(import_name, outpath, options): pid = os.getpid() plainname = import_name.split(".")[-1] outfilepath = os.path.join(outpath, plainname + ".pyi") - if options.skip and os.path.exists(outfilepath): + if options.skip and check_if_skipable(outfilepath): logger.debug("{pid}:Skipped existing: {op}" .format(op=os.path.basename(outfilepath), **locals())) return -1 @@ -291,7 +319,17 @@ def generate_all_pyi(outpath, options): valid = check = 0 if not outpath: outpath = os.path.dirname(PySide2.__file__) - lockdir = os.path.join(outpath, "generate_pyi.lockfile") + lockdir = os.path.join(outpath, "generate_pyi.lockdir") + + pyi_var = "GENERATE_PYI_RECURSE {}".format(math.pi) # should not be set by anybody + if not os.environ.get(pyi_var, ""): + # To catch a possible crash, we run as a subprocess: + os.environ[pyi_var] = "yes" + ret = subprocess.call([sys.executable] + sys.argv) + if ret and os.path.exists(lockdir): + os.rmdir(lockdir) + sys.exit(ret) + # We are the subprocess. Do the real work. with single_process(lockdir) as locked: if locked: if is_ci: @@ -343,3 +381,4 @@ if __name__ == "__main__": else: parser_run.print_help() sys.exit(1) +# eof diff --git a/sources/pyside2/PySide2/templates/gui_common.xml b/sources/pyside2/PySide2/templates/gui_common.xml index 363422c8f..f3e772a8c 100644 --- a/sources/pyside2/PySide2/templates/gui_common.xml +++ b/sources/pyside2/PySide2/templates/gui_common.xml @@ -251,14 +251,6 @@ } </template> - <template name="glGetString_return_QString"> - %BEGIN_ALLOW_THREADS - const GLubyte *us = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES); - const QString s = QString::fromLocal8Bit(reinterpret_cast<const char *>(us)); - %END_ALLOW_THREADS - %PYARG_0 = %CONVERTTOPYTHON[QString](s); - </template> - <template name="fix_args,QRectF*"> QRectF rect_; %BEGIN_ALLOW_THREADS diff --git a/sources/pyside2/PySide2/templates/openglfunctions_common.xml b/sources/pyside2/PySide2/templates/openglfunctions_common.xml new file mode 100644 index 000000000..e01094004 --- /dev/null +++ b/sources/pyside2/PySide2/templates/openglfunctions_common.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt for Python. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem> + <template name="glGetString_return_QString"> + %BEGIN_ALLOW_THREADS + const GLubyte *us = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES); + const QString s = QString::fromLocal8Bit(reinterpret_cast<const char *>(us)); + %END_ALLOW_THREADS + %PYARG_0 = %CONVERTTOPYTHON[QString](s); + </template> +</typesystem> diff --git a/sources/pyside2/libpyside/dynamicqmetaobject.cpp b/sources/pyside2/libpyside/dynamicqmetaobject.cpp index 417ffef5f..c5de54aa0 100644 --- a/sources/pyside2/libpyside/dynamicqmetaobject.cpp +++ b/sources/pyside2/libpyside/dynamicqmetaobject.cpp @@ -464,16 +464,9 @@ void MetaObjectBuilderPrivate::parsePythonType(PyTypeObject *type) if (Signal::checkType(value)) { // Register signals. auto data = reinterpret_cast<PySideSignal *>(value); - const char *signalName = Shiboken::String::toCString(key); - data->signalName = strdup(signalName); - QByteArray sig; - sig.reserve(128); - for (int i = 0; i < data->signaturesSize; ++i) { - sig = signalName; - sig += '('; - if (data->signatures[i]) - sig += data->signatures[i]; - sig += ')'; + data->data->signalName = Shiboken::String::toCString(key); + for (const auto &s : data->data->signatures) { + const auto sig = data->data->signalName + '(' + s.signature + ')'; if (m_baseObject->indexOfSignal(sig) == -1) m_builder->addSignal(sig); } diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp index 091b0c447..c48a6f882 100644 --- a/sources/pyside2/libpyside/pysideproperty.cpp +++ b/sources/pyside2/libpyside/pysideproperty.cpp @@ -152,11 +152,6 @@ static PyObject *qpropertyTpNew(PyTypeObject *subtype, PyObject * /* args */, Py { PySideProperty* me = reinterpret_cast<PySideProperty*>(subtype->tp_alloc(subtype, 0)); me->d = new PySidePropertyPrivate; - memset(me->d, 0, sizeof(PySidePropertyPrivate)); - PySidePropertyPrivate* pData = me->d; - pData->designable = true; - pData->scriptable = true; - pData->stored = true; return reinterpret_cast<PyObject *>(me); } @@ -170,21 +165,29 @@ int qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds) static const char *kwlist[] = {"type", "fget", "fset", "freset", "fdel", "doc", "notify", "designable", "scriptable", "stored", "user", "constant", "final", 0}; + char *doc{}; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OOOOsObbbbbb:QtCore.QProperty", const_cast<char**>(kwlist), /*OO*/ &type, &(pData->fget), /*OOO*/ &(pData->fset), &(pData->freset), &(pData->fdel), - /*s*/ &(pData->doc), + /*s*/ &doc, /*O*/ &(pData->notify), /*bbbbbb*/ &(pData->designable), &(pData->scriptable), &(pData->stored), &(pData->user), &(pData->constant), &(pData->final))) { return 0; } + if (doc) { + pData->doc = doc; + free(doc); + } else { + pData->doc.clear(); + } pData->typeName = PySide::Signal::getTypeName(type); - if (!pData->typeName) + if (pData->typeName.isEmpty()) PyErr_SetString(PyExc_TypeError, "Invalid property type or type name."); else if (pData->constant && (pData->fset || pData->notify)) PyErr_SetString(PyExc_TypeError, "A constant property cannot have a WRITE method or a NOTIFY signal."); @@ -287,9 +290,6 @@ static int qpropertyClear(PyObject* self) Py_CLEAR(data->notify); - free(data->typeName); - free(data->doc); - free(data->notifySignature); delete data; reinterpret_cast<PySideProperty*>(self)->d = 0; return 0; @@ -459,13 +459,14 @@ bool isFinal(const PySideProperty* self) const char* getNotifyName(PySideProperty* self) { - if (!self->d->notifySignature) { + if (self->d->notifySignature.isEmpty()) { PyObject* str = PyObject_Str(self->d->notify); - self->d->notifySignature = strdup(Shiboken::String::toCString(str)); + self->d->notifySignature = Shiboken::String::toCString(str); Py_DECREF(str); } - return self->d->notifySignature; + return self->d->notifySignature.isEmpty() + ? nullptr : self->d->notifySignature.constData(); } void setMetaCallHandler(PySideProperty* self, MetaCallHandler handler) @@ -475,7 +476,7 @@ void setMetaCallHandler(PySideProperty* self, MetaCallHandler handler) void setTypeName(PySideProperty* self, const char* typeName) { - self->d->typeName = strdup(typeName); + self->d->typeName = typeName; } void setUserData(PySideProperty* self, void* data) diff --git a/sources/pyside2/libpyside/pysideproperty_p.h b/sources/pyside2/libpyside/pysideproperty_p.h index f08e5f540..4db638021 100644 --- a/sources/pyside2/libpyside/pysideproperty_p.h +++ b/sources/pyside2/libpyside/pysideproperty_p.h @@ -41,35 +41,32 @@ #define PYSIDE_QPROPERTY_P_H #include <sbkpython.h> +#include <QtCore/QByteArray> #include <QMetaObject> #include "pysideproperty.h" struct PySideProperty; -extern "C" +struct PySidePropertyPrivate { - -struct PySidePropertyPrivate { - char* typeName; - PySide::Property::MetaCallHandler metaCallHandler; - PyObject* fget; - PyObject* fset; - PyObject* freset; - PyObject* fdel; - PyObject* notify; - char* notifySignature; - char* doc; - bool designable; - bool scriptable; - bool stored; - bool user; - bool constant; - bool final; - void* userData; + QByteArray typeName; + PySide::Property::MetaCallHandler metaCallHandler = nullptr; + PyObject *fget = nullptr; + PyObject *fset = nullptr; + PyObject *freset = nullptr; + PyObject *fdel = nullptr; + PyObject *notify = nullptr; + QByteArray notifySignature; + QByteArray doc; + bool designable = true; + bool scriptable = true; + bool stored = true; + bool user = false; + bool constant = false; + bool final = false; + void *userData = nullptr; }; -} // extern "C" - namespace PySide { namespace Property { /** diff --git a/sources/pyside2/libpyside/pysidesignal.cpp b/sources/pyside2/libpyside/pysidesignal.cpp index cf99de785..0f1993e79 100644 --- a/sources/pyside2/libpyside/pysidesignal.cpp +++ b/sources/pyside2/libpyside/pysidesignal.cpp @@ -71,11 +71,11 @@ namespace Signal { QMetaMethod::Attributes m_attributes = QMetaMethod::Compatibility; }; - static char* buildSignature(const char*, const char*); + static QByteArray buildSignature(const QByteArray &, const QByteArray &); static void appendSignature(PySideSignal*, const SignalSignature &); static void instanceInitialize(PySideSignalInstance*, PyObject*, PySideSignal*, PyObject*, int); - static char* parseSignature(PyObject*); - static PyObject* buildQtCompatible(const char*); + static QByteArray parseSignature(PyObject *); + static PyObject* buildQtCompatible(const QByteArray &); } } @@ -215,28 +215,27 @@ int signalTpInit(PyObject* self, PyObject* args, PyObject* kwds) bool tupledArgs = false; PySideSignal* data = reinterpret_cast<PySideSignal*>(self); - if (argName) { - data->signalName = strdup(argName); - } + if (!data->data) + data->data = new PySideSignalData; + if (argName) + data->data->signalName = argName; for (Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) { PyObject* arg = PyTuple_GET_ITEM(args, i); if (PySequence_Check(arg) && !Shiboken::String::check(arg)) { tupledArgs = true; - char *sig = PySide::Signal::parseSignature(arg); + const auto sig = PySide::Signal::parseSignature(arg); PySide::Signal::appendSignature( data, PySide::Signal::SignalSignature(sig)); - free(sig); } } if (!tupledArgs) { - char *sig = PySide::Signal::parseSignature(args); + const auto sig = PySide::Signal::parseSignature(args); PySide::Signal::appendSignature( data, PySide::Signal::SignalSignature(sig)); - free(sig); } return 1; @@ -246,17 +245,8 @@ void signalFree(void* self) { PyObject* pySelf = reinterpret_cast<PyObject*>(self); PySideSignal* data = reinterpret_cast<PySideSignal*>(self); - - for (int i = 0, i_max = data->signaturesSize; i < i_max; i++) { - if (data->signatures[i]) - free(data->signatures[i]); - } - - free(data->signatures); - free(data->signatureAttributes); - free(data->signalName); - data->initialized = 0; - data->signaturesSize = 0; + delete data->data; + data->data = nullptr; Py_XDECREF(data->homonymousMethod); data->homonymousMethod = 0; @@ -266,20 +256,15 @@ void signalFree(void* self) PyObject* signalGetItem(PyObject* self, PyObject* key) { PySideSignal* data = reinterpret_cast<PySideSignal*>(self); - char* sigKey; + QByteArray sigKey; if (key) { sigKey = PySide::Signal::parseSignature(key); } else { - if (data->signatures[0]) - sigKey = strdup(data->signatures[0]); - else - sigKey = strdup("void"); + sigKey = data->data == nullptr || data->data->signatures.isEmpty() + ? PySide::Signal::voidType() : data->data->signatures.constFirst().signature; } - char* sig = PySide::Signal::buildSignature(data->signalName, sigKey); - free(sigKey); - PyObject* pySignature = Shiboken::String::fromCString(sig); - free(sig); - return pySignature; + auto sig = PySide::Signal::buildSignature(data->data->signalName, sigKey); + return Shiboken::String::fromCString(sig.constData()); } @@ -294,8 +279,6 @@ void signalInstanceFree(void* self) PySideSignalInstance* data = reinterpret_cast<PySideSignalInstance*>(self); PySideSignalInstancePrivate* dataPvt = data->d; - free(dataPvt->signalName); - free(dataPvt->signature); Py_XDECREF(dataPvt->homonymousMethod); @@ -422,7 +405,8 @@ PyObject* signalInstanceConnect(PyObject* self, PyObject* args, PyObject* kwds) Py_XDECREF(result); } if (!PyErr_Occurred()) // PYSIDE-79: inverse the logic. A Null return needs an error. - PyErr_Format(PyExc_RuntimeError, "Failed to connect signal %s.", source->d->signature); + PyErr_Format(PyExc_RuntimeError, "Failed to connect signal %s.", + source->d->signature.constData()); return 0; } @@ -472,23 +456,20 @@ PyObject* signalInstanceEmit(PyObject* self, PyObject* args) PyObject* signalInstanceGetItem(PyObject* self, PyObject* key) { PySideSignalInstance* data = reinterpret_cast<PySideSignalInstance*>(self); - char* sigKey = PySide::Signal::parseSignature(key); - char* sig = PySide::Signal::buildSignature(data->d->signalName, sigKey); - free(sigKey); - const char* sigName = data->d->signalName; - + const auto sigName = data->d->signalName; + const auto sigKey = PySide::Signal::parseSignature(key); + const auto sig = PySide::Signal::buildSignature(sigName, sigKey); while (data) { - if (strcmp(data->d->signature, sig) == 0) { - free(sig); + if (data->d->signature == sig) { PyObject* result = reinterpret_cast<PyObject*>(data); Py_INCREF(result); return result; } - data = reinterpret_cast<PySideSignalInstance*>(data->d->next); + data = data->d->next; } - PyErr_Format(PyExc_IndexError, "Signature %s not found for signal: %s", sig, sigName); - free(sig); + PyErr_Format(PyExc_IndexError, "Signature %s not found for signal: %s", + sig.constData(), sigName.constData()); return 0; } @@ -539,7 +520,8 @@ PyObject* signalInstanceDisconnect(PyObject* self, PyObject* args) Py_DECREF(result); } - PyErr_Format(PyExc_RuntimeError, "Failed to disconnect signal %s.", source->d->signature); + PyErr_Format(PyExc_RuntimeError, "Failed to disconnect signal %s.", + source->d->signature.constData()); return 0; } @@ -640,72 +622,59 @@ void updateSourceObject(PyObject* source) Py_XDECREF(objType); } -char* getTypeName(PyObject* type) +QByteArray getTypeName(PyObject *type) { if (PyType_Check(type)) { - char* typeName = NULL; if (PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(type), reinterpret_cast<PyTypeObject*>(SbkObject_TypeF()))) { SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(type); - typeName = strdup(Shiboken::ObjectType::getOriginalName(objType)); - } else { - // Translate python types to Qt names - PyTypeObject* objType = reinterpret_cast<PyTypeObject*>(type); - if (Shiboken::String::checkType(objType)) - typeName = strdup("QString"); - else if (objType == &PyInt_Type) - typeName = strdup("int"); - else if (objType == &PyLong_Type) - typeName = strdup("long"); - else if (objType == &PyFloat_Type) - typeName = strdup("double"); - else if (objType == &PyBool_Type) - typeName = strdup("bool"); - else if (Py_TYPE(objType) == SbkEnumType_TypeF()) - typeName = strdup(Shiboken::Enum::getCppName(objType)); - else - typeName = strdup("PyObject"); + return Shiboken::ObjectType::getOriginalName(objType); } - return typeName; + // Translate python types to Qt names + PyTypeObject* objType = reinterpret_cast<PyTypeObject*>(type); + if (Shiboken::String::checkType(objType)) + return QByteArrayLiteral("QString"); + if (objType == &PyInt_Type) + return QByteArrayLiteral("int"); + if (objType == &PyLong_Type) + return QByteArrayLiteral("long"); + if (objType == &PyFloat_Type) + return QByteArrayLiteral("double"); + if (objType == &PyBool_Type) + return QByteArrayLiteral("bool"); + if (Py_TYPE(objType) == SbkEnumType_TypeF()) + return Shiboken::Enum::getCppName(objType); + return QByteArrayLiteral("PyObject"); } if (type == Py_None) // Must be checked before as Shiboken::String::check accepts Py_None - return strdup("void"); + return voidType(); if (Shiboken::String::check(type)) { - const char *result = Shiboken::String::toCString(type); - if (!strcmp(result, "qreal")) + QByteArray result = Shiboken::String::toCString(type); + if (result == "qreal") result = sizeof(qreal) == sizeof(double) ? "double" : "float"; - return strdup(result); + return result; } - return 0; + return QByteArray(); } -char* buildSignature(const char* name, const char* signature) +QByteArray buildSignature(const QByteArray &name, const QByteArray &signature) { - QByteArray signal(name); - signal += '('; - signal += signature; - signal += ')'; - return strdup(QMetaObject::normalizedSignature(signal)); + return QMetaObject::normalizedSignature(name + '(' + signature + ')'); } -char* parseSignature(PyObject* args) +QByteArray parseSignature(PyObject* args) { - char* signature = 0; if (args && (Shiboken::String::check(args) || !PySequence_Check(args))) return getTypeName(args); + QByteArray signature; for (Py_ssize_t i = 0, i_max = PySequence_Size(args); i < i_max; i++) { Shiboken::AutoDecRef arg(PySequence_GetItem(args, i)); - char* typeName = getTypeName(arg); - if (typeName) { - if (signature) { - signature = reinterpret_cast<char*>(realloc(signature, (strlen(signature) + 1 + strlen(typeName)) * sizeof(char*))); - signature = strcat(signature, ","); - signature = strcat(signature, typeName); - free(typeName); - } else { - signature = typeName; - } + const auto typeName = getTypeName(arg); + if (!typeName.isEmpty()) { + if (!signature.isEmpty()) + signature += ','; + signature += typeName; } } return signature; @@ -713,17 +682,7 @@ char* parseSignature(PyObject* args) void appendSignature(PySideSignal* self, const SignalSignature &signature) { - self->signaturesSize++; - - if (self->signaturesSize > 1) { - self->signatures = reinterpret_cast<char **>(realloc(self->signatures, sizeof(char *) * self->signaturesSize)); - self->signatureAttributes = reinterpret_cast<int *>(realloc(self->signatureAttributes, sizeof(int) * self->signaturesSize)); - } else { - self->signatures = reinterpret_cast<char **>(malloc(sizeof(char *))); - self->signatureAttributes = reinterpret_cast<int *>(malloc(sizeof(int))); - } - self->signatures[self->signaturesSize - 1] = strdup(signature.m_parameterTypes); - self->signatureAttributes[self->signaturesSize - 1] = signature.m_attributes; + self->data->signatures.append({signature.m_parameterTypes, signature.m_attributes}); } PySideSignalInstance* initialize(PySideSignal* self, PyObject* name, PyObject* object) @@ -740,17 +699,15 @@ void instanceInitialize(PySideSignalInstance* self, PyObject* name, PySideSignal { self->d = new PySideSignalInstancePrivate; PySideSignalInstancePrivate* selfPvt = self->d; - selfPvt->next = 0; - if (data->signalName) - selfPvt->signalName = strdup(data->signalName); - else { - selfPvt->signalName = strdup(Shiboken::String::toCString(name)); - data->signalName = strdup(selfPvt->signalName); - } + selfPvt->next = nullptr; + if (data->data->signalName.isEmpty()) + data->data->signalName = Shiboken::String::toCString(name); + selfPvt->signalName = data->data->signalName; selfPvt->source = source; - selfPvt->signature = buildSignature(self->d->signalName, data->signatures[index]); - selfPvt->attributes = data->signatureAttributes[index]; + const auto &signature = data->data->signatures.at(index); + selfPvt->signature = buildSignature(self->d->signalName, signature.signature); + selfPvt->attributes = signature.attributes; selfPvt->homonymousMethod = 0; if (data->homonymousMethod) { selfPvt->homonymousMethod = data->homonymousMethod; @@ -758,7 +715,7 @@ void instanceInitialize(PySideSignalInstance* self, PyObject* name, PySideSignal } index++; - if (index < data->signaturesSize) { + if (index < data->data->signatures.size()) { selfPvt->next = PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF()); instanceInitialize(selfPvt->next, name, data, source, index); } @@ -800,8 +757,8 @@ PySideSignalInstance* newObjectFromMethod(PyObject* source, const QList<QMetaMet QByteArray cppName(m.methodSignature()); cppName.truncate(cppName.indexOf('(')); // separe SignalName - selfPvt->signalName = strdup(cppName.data()); - selfPvt->signature = strdup(m.methodSignature()); + selfPvt->signalName = cppName; + selfPvt->signature = m.methodSignature(); selfPvt->attributes = m.attributes(); selfPvt->homonymousMethod = 0; selfPvt->next = 0; @@ -814,11 +771,8 @@ PySideSignal* newObject(const char* name, ...) va_list listSignatures; char* sig = 0; PySideSignal* self = PyObject_New(PySideSignal, PySideSignalTypeF()); - self->signalName = strdup(name); - self->signaturesSize = 0; - self->signatures = 0; - self->signatureAttributes = 0; - self->initialized = 0; + self->data = new PySideSignalData; + self->data->signalName = name; self->homonymousMethod = 0; va_start(listSignatures, name); @@ -897,11 +851,8 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject) SignalSigMap::Iterator end = signalsFound.end(); for (; it != end; ++it) { PySideSignal* self = PyObject_New(PySideSignal, PySideSignalTypeF()); - self->signalName = strdup(it.key().constData()); - self->signaturesSize = 0; - self->signatures = 0; - self->signatureAttributes = 0; - self->initialized = false; + self->data = new PySideSignalData; + self->data->signalName = it.key(); self->homonymousMethod = 0; // Empty signatures comes first! So they will be the default signal signature @@ -918,11 +869,9 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject) } } -PyObject* buildQtCompatible(const char* signature) +PyObject* buildQtCompatible(const QByteArray &signature) { - QByteArray ba; - ba.append(QT_SIGNAL_SENTINEL); - ba.append(signature); + const auto ba = QT_SIGNAL_SENTINEL + signature; return Shiboken::String::fromStringAndSize(ba, ba.size()); } @@ -941,13 +890,6 @@ const char* getSignature(PySideSignalInstance* signal) return signal->d->signature; } -const char** getSignatures(PyObject* signal, int* size) -{ - PySideSignal* self = reinterpret_cast<PySideSignal*>(signal); - *size = self->signaturesSize; - return const_cast<const char**>(self->signatures); -} - QStringList getArgsFromSignature(const char* signature, bool* isShortCircuit) { const QString qsignature = QLatin1String(signature); @@ -1058,6 +1000,11 @@ QString codeCallbackName(PyObject* callback, const QString& funcName) return funcName + QString::number(quint64(callback), 16); } +QByteArray voidType() +{ + return QByteArrayLiteral("void"); +} + } //namespace Signal } //namespace PySide diff --git a/sources/pyside2/libpyside/pysidesignal_p.h b/sources/pyside2/libpyside/pysidesignal_p.h index 24cbde505..a5cd67f66 100644 --- a/sources/pyside2/libpyside/pysidesignal_p.h +++ b/sources/pyside2/libpyside/pysidesignal_p.h @@ -42,40 +42,51 @@ #include <sbkpython.h> +#include <QtCore/QByteArray> +#include <QtCore/QVector> + +struct PySideSignalData +{ + struct Signature + { + QByteArray signature; + int attributes; + }; + + QByteArray signalName; + QVector<Signature> signatures; +}; + extern "C" { extern PyTypeObject *PySideSignalTypeF(void); struct PySideSignal { PyObject_HEAD - bool initialized; - char* signalName; - char** signatures; - int* signatureAttributes; - int signaturesSize; + PySideSignalData *data; PyObject* homonymousMethod; }; struct PySideSignalInstance; - struct PySideSignalInstancePrivate { - char* signalName; - char* signature; - int attributes; - PyObject* source; - PyObject* homonymousMethod; - PySideSignalInstance* next; - }; - - }; //extern "C" +struct PySideSignalInstancePrivate +{ + QByteArray signalName; + QByteArray signature; + int attributes = 0; + PyObject *source = nullptr; + PyObject *homonymousMethod = nullptr; + PySideSignalInstance *next = nullptr; +}; + namespace PySide { namespace Signal { void init(PyObject* module); bool connect(PyObject* source, const char* signal, PyObject* callback); - char* getTypeName(PyObject*); - const char** getSignatures(PyObject* self, int *size); + QByteArray getTypeName(PyObject *); QString codeCallbackName(PyObject* callback, const QString& funcName); + QByteArray voidType(); }} //namespace PySide diff --git a/sources/pyside2/libpyside/pysideslot.cpp b/sources/pyside2/libpyside/pysideslot.cpp index 6f6658cf8..4104c090d 100644 --- a/sources/pyside2/libpyside/pysideslot.cpp +++ b/sources/pyside2/libpyside/pysideslot.cpp @@ -48,12 +48,17 @@ #define SLOT_DEC_NAME "Slot" +struct SlotData +{ + QByteArray name; + QByteArray args; + QByteArray resultType; +}; + typedef struct { PyObject_HEAD - char* slotName; - char* args; - char* resultType; + SlotData *slotData; } PySideSlot; extern "C" @@ -103,31 +108,25 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw) } PySideSlot *data = reinterpret_cast<PySideSlot*>(self); + if (!data->slotData) + data->slotData = new SlotData; for(Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) { PyObject *argType = PyTuple_GET_ITEM(args, i); - char *typeName = PySide::Signal::getTypeName(argType); - if (typeName) { - if (data->args) { - data->args = reinterpret_cast<char*>(realloc(data->args, (strlen(data->args) + 1 + strlen(typeName)) * sizeof(char*))); - data->args = strcat(data->args, ","); - data->args = strcat(data->args, typeName); - free(typeName); - } else { - data->args = typeName; - } - } else { + const auto typeName = PySide::Signal::getTypeName(argType); + if (typeName.isEmpty()) { PyErr_Format(PyExc_TypeError, "Unknown signal argument type: %s", Py_TYPE(argType)->tp_name); return -1; } + if (!data->slotData->args.isEmpty()) + data->slotData->args += ','; + data->slotData->args += typeName; } if (argName) - data->slotName = strdup(argName); + data->slotData->name = argName; - if (argResult) - data->resultType = PySide::Signal::getTypeName(argResult); - else - data->resultType = strdup("void"); + data->slotData->resultType = argResult + ? PySide::Signal::getTypeName(argResult) : PySide::Signal::voidType(); return 1; } @@ -142,15 +141,15 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) if (PyFunction_Check(callback)) { PySideSlot *data = reinterpret_cast<PySideSlot*>(self); - if (!data->slotName) { - PyObject *funcName = PepFunction_GetName(callback); - data->slotName = strdup(Shiboken::String::toCString(funcName)); - } + if (!data->slotData) + data->slotData = new SlotData; + if (data->slotData->name.isEmpty()) + data->slotData->name = Shiboken::String::toCString(PepFunction_GetName(callback)); - QByteArray returnType = QMetaObject::normalizedType(data->resultType); - QByteArray signature = QString().sprintf("%s(%s)", data->slotName, data->args).toUtf8(); - signature = returnType + " " + signature; + const QByteArray returnType = QMetaObject::normalizedType(data->slotData->resultType); + const QByteArray signature = + returnType + ' ' + data->slotData->name + '(' + data->slotData->args + ')'; if (!pySlotName) pySlotName = Shiboken::String::fromCString(PYSIDE_SLOT_LIST_ATTR); @@ -169,12 +168,8 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) Py_DECREF(pySignature); //clear data - free(data->slotName); - data->slotName = 0; - free(data->resultType); - data->resultType = 0; - free(data->args); - data->args = 0; + delete data->slotData; + data->slotData = nullptr; return callback; } return callback; diff --git a/sources/pyside2/tests/QtOpenGLFunctions/CMakeLists.txt b/sources/pyside2/tests/QtOpenGLFunctions/CMakeLists.txt new file mode 100644 index 000000000..2f7cb08b9 --- /dev/null +++ b/sources/pyside2/tests/QtOpenGLFunctions/CMakeLists.txt @@ -0,0 +1 @@ +# Please add some tests, here diff --git a/sources/pyside2/tests/registry/exists_darwin_5_12_0_ci.py b/sources/pyside2/tests/registry/exists_darwin_5_12_0_ci.py index a1fd624d9..689c17750 100644 --- a/sources/pyside2/tests/registry/exists_darwin_5_12_0_ci.py +++ b/sources/pyside2/tests/registry/exists_darwin_5_12_0_ci.py @@ -5184,7 +5184,9 @@ if "PySide2.QtGui" in sys.modules: "QOpenGLShaderProgram.setDefaultInnerTessellationLevels": ('list',), "QOpenGLShaderProgram.setDefaultOuterTessellationLevels": ('list',), "QOpenGLShaderProgram.setPatchVertexCount": ('int',), - "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List[typing.List[float]]'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'int'), ('str', 'typing.List[typing.List[float]]')], + "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List[typing.List[float]]'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'typing.List[typing.List[float]]')], + "QOpenGLShaderProgram.setUniformValue1i": [('str', 'int')], + "QOpenGLShaderProgram.setUniformValue1f": [('str', 'float')], "QOpenGLShaderProgram.setUniformValueArray": [('int', 'float', 'int', 'int'), ('int', 'int', 'int'), ('str', 'float', 'int', 'int'), ('str', 'int', 'int')], "QOpenGLShaderProgram.shaders": (), "QOpenGLShaderProgram.uniformLocation": [('PySide2.QtCore.QByteArray',), ('str',)], diff --git a/sources/pyside2/tests/registry/exists_opensuse423_5_12_0_ci.py b/sources/pyside2/tests/registry/exists_opensuse423_5_12_0_ci.py index 4b753386f..1bc359d3f 100644 --- a/sources/pyside2/tests/registry/exists_opensuse423_5_12_0_ci.py +++ b/sources/pyside2/tests/registry/exists_opensuse423_5_12_0_ci.py @@ -5183,7 +5183,9 @@ if "PySide2.QtGui" in sys.modules: "QOpenGLShaderProgram.setDefaultInnerTessellationLevels": ('list',), "QOpenGLShaderProgram.setDefaultOuterTessellationLevels": ('list',), "QOpenGLShaderProgram.setPatchVertexCount": ('int',), - "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List[typing.List[float]]'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'int'), ('str', 'typing.List[typing.List[float]]')], + "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List[typing.List[float]]'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'typing.List[typing.List[float]]')], + "QOpenGLShaderProgram.setUniformValue1i": [('str', 'int')], + "QOpenGLShaderProgram.setUniformValue1f": [('str', 'float')], "QOpenGLShaderProgram.setUniformValueArray": [('int', 'float', 'int', 'int'), ('int', 'int', 'int'), ('str', 'float', 'int', 'int'), ('str', 'int', 'int')], "QOpenGLShaderProgram.shaders": (), "QOpenGLShaderProgram.uniformLocation": [('PySide2.QtCore.QByteArray',), ('str',)], diff --git a/sources/pyside2/tests/registry/exists_redhatenterpriselinuxworkstation74_5_12_0_ci.py b/sources/pyside2/tests/registry/exists_redhatenterpriselinuxworkstation74_5_12_0_ci.py index 1a68c8c85..9e32998e1 100644 --- a/sources/pyside2/tests/registry/exists_redhatenterpriselinuxworkstation74_5_12_0_ci.py +++ b/sources/pyside2/tests/registry/exists_redhatenterpriselinuxworkstation74_5_12_0_ci.py @@ -5183,7 +5183,9 @@ if "PySide2.QtGui" in sys.modules: "QOpenGLShaderProgram.setDefaultInnerTessellationLevels": ('list',), "QOpenGLShaderProgram.setDefaultOuterTessellationLevels": ('list',), "QOpenGLShaderProgram.setPatchVertexCount": ('int',), - "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List[typing.List[float]]'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'int'), ('str', 'typing.List[typing.List[float]]')], + "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List[typing.List[float]]'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'typing.List[typing.List[float]]')], + "QOpenGLShaderProgram.setUniformValue1i": [('str', 'int')], + "QOpenGLShaderProgram.setUniformValue1f": [('str', 'float')], "QOpenGLShaderProgram.setUniformValueArray": [('int', 'float', 'int', 'int'), ('int', 'int', 'int'), ('str', 'float', 'int', 'int'), ('str', 'int', 'int')], "QOpenGLShaderProgram.shaders": (), "QOpenGLShaderProgram.uniformLocation": [('PySide2.QtCore.QByteArray',), ('str',)], diff --git a/sources/pyside2/tests/registry/exists_win32_5_12_0_ci.py b/sources/pyside2/tests/registry/exists_win32_5_12_0_ci.py index 10b2acf4c..ae170e517 100644 --- a/sources/pyside2/tests/registry/exists_win32_5_12_0_ci.py +++ b/sources/pyside2/tests/registry/exists_win32_5_12_0_ci.py @@ -5196,7 +5196,9 @@ if "PySide2.QtGui" in sys.modules: "QOpenGLShaderProgram.setDefaultInnerTessellationLevels": ('list',), "QOpenGLShaderProgram.setDefaultOuterTessellationLevels": ('list',), "QOpenGLShaderProgram.setPatchVertexCount": ('int',), - "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'int'), ('str', 'typing.List')], + "QOpenGLShaderProgram.setUniformValue": [('int', 'PySide2.QtCore.QPoint'), ('int', 'PySide2.QtCore.QPointF'), ('int', 'PySide2.QtCore.QSize'), ('int', 'PySide2.QtCore.QSizeF'), ('int', 'PySide2.QtGui.QColor'), ('int', 'PySide2.QtGui.QMatrix2x2'), ('int', 'PySide2.QtGui.QMatrix2x3'), ('int', 'PySide2.QtGui.QMatrix2x4'), ('int', 'PySide2.QtGui.QMatrix3x2'), ('int', 'PySide2.QtGui.QMatrix3x3'), ('int', 'PySide2.QtGui.QMatrix3x4'), ('int', 'PySide2.QtGui.QMatrix4x2'), ('int', 'PySide2.QtGui.QMatrix4x3'), ('int', 'PySide2.QtGui.QMatrix4x4'), ('int', 'PySide2.QtGui.QTransform'), ('int', 'PySide2.QtGui.QVector2D'), ('int', 'PySide2.QtGui.QVector3D'), ('int', 'PySide2.QtGui.QVector4D'), ('int', 'float'), ('int', 'float', 'float'), ('int', 'float', 'float', 'float'), ('int', 'float', 'float', 'float', 'float'), ('int', 'int'), ('int', 'typing.List'), ('str', 'PySide2.QtCore.QPoint'), ('str', 'PySide2.QtCore.QPointF'), ('str', 'PySide2.QtCore.QSize'), ('str', 'PySide2.QtCore.QSizeF'), ('str', 'PySide2.QtGui.QColor'), ('str', 'PySide2.QtGui.QMatrix2x2'), ('str', 'PySide2.QtGui.QMatrix2x3'), ('str', 'PySide2.QtGui.QMatrix2x4'), ('str', 'PySide2.QtGui.QMatrix3x2'), ('str', 'PySide2.QtGui.QMatrix3x3'), ('str', 'PySide2.QtGui.QMatrix3x4'), ('str', 'PySide2.QtGui.QMatrix4x2'), ('str', 'PySide2.QtGui.QMatrix4x3'), ('str', 'PySide2.QtGui.QMatrix4x4'), ('str', 'PySide2.QtGui.QTransform'), ('str', 'PySide2.QtGui.QVector2D'), ('str', 'PySide2.QtGui.QVector3D'), ('str', 'PySide2.QtGui.QVector4D'), ('str', 'float', 'float'), ('str', 'float', 'float', 'float'), ('str', 'float', 'float', 'float', 'float'), ('str', 'typing.List')], + "QOpenGLShaderProgram.setUniformValue1i": [('str', 'int')], + "QOpenGLShaderProgram.setUniformValue1f": [('str', 'float')], "QOpenGLShaderProgram.setUniformValueArray": [('int', 'float', 'int', 'int'), ('int', 'int', 'int'), ('str', 'float', 'int', 'int'), ('str', 'int', 'int')], "QOpenGLShaderProgram.shaders": (), "QOpenGLShaderProgram.uniformLocation": [('PySide2.QtCore.QByteArray',), ('str',)], diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index 6e95e79e7..7e998d315 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -428,20 +428,20 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom) // Start the generation... const ClassList &typeValues = dom->classes(); - ReportHandler::setProgressReference(typeValues); + + ReportHandler::startProgress("Generating class model (" + + QByteArray::number(typeValues.size()) + ")..."); for (const ClassModelItem &item : typeValues) { - ReportHandler::progress(QStringLiteral("Generating class model (%1)...") - .arg(typeValues.size())); if (AbstractMetaClass *cls = traverseClass(dom, item, nullptr)) addAbstractMetaClass(cls, item.data()); } // We need to know all global enums const EnumList &enums = dom->enums(); - ReportHandler::setProgressReference(enums); + + ReportHandler::startProgress("Generating enum model (" + + QByteArray::number(enums.size()) + ")..."); for (const EnumModelItem &item : enums) { - ReportHandler::progress(QStringLiteral("Generating enum model (%1)...") - .arg(enums.size())); AbstractMetaEnum *metaEnum = traverseEnum(item, 0, QSet<QString>()); if (metaEnum) { if (metaEnum->typeEntry()->generateCode()) @@ -450,10 +450,9 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom) } const auto &namespaceTypeValues = dom->namespaces(); - ReportHandler::setProgressReference(namespaceTypeValues); + ReportHandler::startProgress("Generating namespace model (" + + QByteArray::number(namespaceTypeValues.size()) + ")..."); for (const NamespaceModelItem &item : namespaceTypeValues) { - ReportHandler::progress(QStringLiteral("Generating namespace model (%1)...") - .arg(namespaceTypeValues.size())); if (AbstractMetaClass *metaClass = traverseNamespace(dom, item)) addAbstractMetaClass(metaClass, item.data()); } @@ -461,10 +460,9 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom) // Go through all typedefs to see if we have defined any // specific typedefs to be used as classes. const TypeDefList typeDefs = dom->typeDefs(); - ReportHandler::setProgressReference(typeDefs); + ReportHandler::startProgress("Resolving typedefs (" + + QByteArray::number(typeDefs.size()) + ")..."); for (const TypeDefModelItem &typeDef : typeDefs) { - ReportHandler::progress(QStringLiteral("Resolving typedefs (%1)...") - .arg(typeDefs.size())); if (AbstractMetaClass *cls = traverseTypeDef(dom, typeDef, nullptr)) addAbstractMetaClass(cls, typeDef.data()); } @@ -506,16 +504,14 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom) m_globalFunctions << metaFunc; } - ReportHandler::setProgressReference(m_metaClasses); + ReportHandler::startProgress("Fixing class inheritance..."); for (AbstractMetaClass *cls : qAsConst(m_metaClasses)) { - ReportHandler::progress(QLatin1String("Fixing class inheritance...")); if (!cls->isInterface() && !cls->isNamespace()) setupInheritance(cls); } - ReportHandler::setProgressReference(m_metaClasses); + ReportHandler::startProgress("Detecting inconsistencies in class model..."); for (AbstractMetaClass *cls : qAsConst(m_metaClasses)) { - ReportHandler::progress(QLatin1String("Detecting inconsistencies in class model...")); cls->fixFunctions(); if (!cls->typeEntry()) { @@ -538,8 +534,9 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom) cls->typeEntry()->setLookupName(cls->typeEntry()->targetLangName() + QLatin1String("$ConcreteWrapper")); } const auto &allEntries = types->entries(); - ReportHandler::progress(QStringLiteral("Detecting inconsistencies in typesystem (%1)...") - .arg(allEntries.size())); + + ReportHandler::startProgress("Detecting inconsistencies in typesystem (" + + QByteArray::number(allEntries.size()) + ")..."); for (auto it = allEntries.cbegin(), end = allEntries.cend(); it != end; ++it) { TypeEntry *entry = it.value(); if (!entry->isPrimitive()) { @@ -638,8 +635,12 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom) traverseStreamOperator(item, nullptr); } + ReportHandler::startProgress("Checking inconsistencies in function modifications..."); + checkFunctionModifications(); + ReportHandler::startProgress("Writing log files..."); + // sort all classes topologically m_metaClasses = classesTopologicalSorted(m_metaClasses); @@ -673,6 +674,8 @@ void AbstractMetaBuilderPrivate::traverseDom(const FileModelItem &dom) } m_itemToClass.clear(); + + ReportHandler::endProgress(); } static bool metaEnumLessThan(const AbstractMetaEnum *e1, const AbstractMetaEnum *e2) diff --git a/sources/shiboken2/ApiExtractor/reporthandler.cpp b/sources/shiboken2/ApiExtractor/reporthandler.cpp index 6ff5b8d03..c0c323029 100644 --- a/sources/shiboken2/ApiExtractor/reporthandler.cpp +++ b/sources/shiboken2/ApiExtractor/reporthandler.cpp @@ -52,22 +52,13 @@ static int m_warningCount = 0; static int m_suppressedCount = 0; static ReportHandler::DebugLevel m_debugLevel = ReportHandler::NoDebug; static QSet<QString> m_reportedWarnings; -static QString m_progressBuffer; static QString m_prefix; -static int m_step_size = 0; -static int m_step = -1; +static bool m_withinProgress = false; static int m_step_warning = 0; static QElapsedTimer m_timer; Q_LOGGING_CATEGORY(lcShiboken, "qt.shiboken") -static void printProgress() -{ - std::printf("%s", m_progressBuffer.toUtf8().data()); - std::fflush(stdout); - m_progressBuffer.clear(); -} - void ReportHandler::install() { qInstallMessageHandler(ReportHandler::messageOutput); @@ -94,12 +85,6 @@ int ReportHandler::warningCount() return m_warningCount; } -void ReportHandler::setProgressReference(int max) -{ - m_step_size = max; - m_step = -1; -} - bool ReportHandler::isSilent() { return m_silent; @@ -136,38 +121,45 @@ void ReportHandler::messageOutput(QtMsgType type, const QMessageLogContext &cont fprintf(stderr, "%s\n", qPrintable(qFormatLogMessage(type, context, message))); } -void ReportHandler::progress(const QString& str, ...) +static QByteArray timeStamp() +{ + const qint64 elapsed = m_timer.elapsed(); + return elapsed > 5000 + ? QByteArray::number(elapsed / 1000) + 's' + : QByteArray::number(elapsed) + "ms"; +} + +void ReportHandler::startProgress(const QByteArray& str) { if (m_silent) return; - if (m_step == -1) { - QTextStream buf(&m_progressBuffer); - buf.setFieldWidth(45); - buf.setFieldAlignment(QTextStream::AlignLeft); - buf << str; - printProgress(); - m_step = 0; - } - m_step++; - if (m_step >= m_step_size) { - if (m_step_warning == 0) { - m_progressBuffer = QLatin1String("[" COLOR_GREEN "OK" COLOR_END "]\n"); - } else { - m_progressBuffer = QLatin1String("[" COLOR_YELLOW "WARNING" COLOR_END "]\n"); - } - printProgress(); - m_step_warning = 0; - } + if (m_withinProgress) + endProgress(); + + m_withinProgress = true; + const auto ts = '[' + timeStamp() + ']'; + std::printf("%s %8s %-60s", qPrintable(m_prefix), ts.constData(), str.constData()); + std::fflush(stdout); +} + +void ReportHandler::endProgress() +{ + if (m_silent) + return; + + m_withinProgress = false; + const char *endMessage = m_step_warning == 0 + ? "[" COLOR_GREEN "OK" COLOR_END "]\n" + : "[" COLOR_YELLOW "WARNING" COLOR_END "]\n"; + std::fputs(endMessage, stdout); + std::fflush(stdout); + m_step_warning = 0; } QByteArray ReportHandler::doneMessage() { - QByteArray result = "Done, " + m_prefix.toUtf8() + ' '; - const qint64 elapsed = m_timer.elapsed(); - result += elapsed > 5000 - ? QByteArray::number(elapsed / 1000) + 's' - : QByteArray::number(elapsed) + "ms"; + QByteArray result = "Done, " + m_prefix.toUtf8() + ' ' + timeStamp(); if (m_warningCount) result += ", " + QByteArray::number(m_warningCount) + " warnings"; if (m_suppressedCount) diff --git a/sources/shiboken2/ApiExtractor/reporthandler.h b/sources/shiboken2/ApiExtractor/reporthandler.h index 8f97cb506..08ab7d23c 100644 --- a/sources/shiboken2/ApiExtractor/reporthandler.h +++ b/sources/shiboken2/ApiExtractor/reporthandler.h @@ -48,15 +48,8 @@ public: static int suppressedCount(); - template <typename T> - static void setProgressReference(T collection) - { - setProgressReference(collection.count()); - } - - static void setProgressReference(int max); - - static void progress(const QString &str, ...); + static void startProgress(const QByteArray &str); + static void endProgress(); static bool isDebug(DebugLevel level) { return debugLevel() >= level; } diff --git a/sources/shiboken2/doc/contents.rst b/sources/shiboken2/doc/contents.rst deleted file mode 100644 index 7cdc0063e..000000000 --- a/sources/shiboken2/doc/contents.rst +++ /dev/null @@ -1,18 +0,0 @@ -Table of contents -***************** -.. toctree:: - :maxdepth: 3 - - overview.rst - samplebinding.rst - commandlineoptions.rst - projectfile.rst - typesystemvariables.rst - typeconverters.rst - codeinjectionsemantics.rst - sequenceprotocol.rst - ownership.rst - wordsofadvice.rst - shibokenmodule.rst - faq.rst - typesystem.rst diff --git a/sources/shiboken2/doc/index.rst b/sources/shiboken2/doc/index.rst index 4cc5b204e..9403293ac 100644 --- a/sources/shiboken2/doc/index.rst +++ b/sources/shiboken2/doc/index.rst @@ -18,11 +18,22 @@ properly handle the data structures or types. The final outcome of this process is a set of wrappers written in CPython, which can be used as a module in your python code. -Refer to the following topics for more information and examples: +Table of contents +***************** .. toctree:: :maxdepth: 1 - overview - samplebinding - contents + overview.rst + samplebinding.rst + commandlineoptions.rst + projectfile.rst + typesystemvariables.rst + typeconverters.rst + codeinjectionsemantics.rst + sequenceprotocol.rst + ownership.rst + wordsofadvice.rst + shibokenmodule.rst + faq.rst + typesystem.rst diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp index 9beaf47c7..ac576d657 100644 --- a/sources/shiboken2/generator/main.cpp +++ b/sources/shiboken2/generator/main.cpp @@ -624,7 +624,10 @@ int main(int argc, char *argv[]) for (const GeneratorPtr &g : qAsConst(generators)) { g->setOutputDirectory(outputDirectory); g->setLicenseComment(licenseComment); - if (!g->setup(extractor) || !g->generate()) { + ReportHandler::startProgress(QByteArray("Running ") + g->name() + "..."); + const bool ok = g->setup(extractor) && g->generate(); + ReportHandler::endProgress(); + if (!ok) { errorPrint(QLatin1String("Error running generator: ") + QLatin1String(g->name()) + QLatin1Char('.')); return EXIT_FAILURE; diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 29220c739..58788d5ef 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -330,8 +330,8 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext) // The multiple inheritance initialization function // needs the 'set' class from C++ STL. - if (hasMultipleInheritanceInAncestry(metaClass)) - s << "#include <set>" << endl; + if (getMultipleInheritingClass(metaClass) != nullptr) + s << "#include <algorithm>\n#include <set>\n"; if (metaClass->generateExceptionHandling()) s << "#include <exception>" << endl; @@ -453,8 +453,8 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext) s << endl << "// Target ---------------------------------------------------------" << endl << endl; s << "extern \"C\" {" << endl; - const FunctionGroupMap &functionGroups = getFunctionGroups(metaClass); - for (FunctionGroupMapIt it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { + const auto &functionGroups = getFunctionGroups(metaClass); + for (auto it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { AbstractMetaFunctionList overloads; QSet<QString> seenSignatures; bool staticEncountered = false; @@ -1726,7 +1726,7 @@ void CppGenerator::writeConstructorWrapper(QTextStream &s, const AbstractMetaFun } { Indentation indentation(INDENT); - s << INDENT << "Shiboken::ObjectType::copyMultimpleheritance(type, myType);" << endl; + s << INDENT << "Shiboken::ObjectType::copyMultipleInheritance(type, myType);" << endl; } if (!metaClass->isAbstract()) s << INDENT << '}' << endl << endl; @@ -3553,11 +3553,18 @@ QStringList CppGenerator::getAncestorMultipleInheritance(const AbstractMetaClass const AbstractMetaClassList &baseClases = getBaseClasses(metaClass); if (!baseClases.isEmpty()) { for (const AbstractMetaClass *baseClass : baseClases) { - result.append(QString::fromLatin1("((size_t) static_cast<const %1*>(class_ptr)) - base") - .arg(baseClass->qualifiedCppName())); - result.append(QString::fromLatin1("((size_t) static_cast<const %1*>((%2*)((void*)class_ptr))) - base") - .arg(baseClass->qualifiedCppName(), metaClass->qualifiedCppName())); + QString offset; + QTextStream(&offset) << "reinterpret_cast<uintptr_t>(static_cast<const " + << baseClass->qualifiedCppName() << "*>(class_ptr)) - base"; + result.append(offset); + offset.clear(); + QTextStream(&offset) << "reinterpret_cast<uintptr_t>(static_cast<const " + << baseClass->qualifiedCppName() << "*>(static_cast<const " + << metaClass->qualifiedCppName() + << "*>(static_cast<const void*>(class_ptr)))) - base"; + result.append(offset); } + for (const AbstractMetaClass *baseClass : baseClases) result.append(getAncestorMultipleInheritance(baseClass)); } @@ -3579,25 +3586,17 @@ void CppGenerator::writeMultipleInheritanceInitializerFunction(QTextStream& s, c { Indentation indent(INDENT); s << INDENT << "std::set<int> offsets;" << endl; - s << INDENT << "std::set<int>::iterator it;" << endl; - s << INDENT << "const " << className << "* class_ptr = reinterpret_cast<const " << className << "*>(cptr);" << endl; - s << INDENT << "size_t base = (size_t) class_ptr;" << endl; + s << INDENT << "const auto* class_ptr = reinterpret_cast<const " << className << "*>(cptr);" << endl; + s << INDENT << "const auto base = reinterpret_cast<uintptr_t>(class_ptr);" << endl; for (const QString &ancestor : ancestors) - s << INDENT << "offsets.insert(" << ancestor << ");" << endl; + s << INDENT << "offsets.insert(int(" << ancestor << "));" << endl; s << endl; s << INDENT << "offsets.erase(0);" << endl; s << endl; - s << INDENT << "int i = 0;" << endl; - s << INDENT << "for (it = offsets.begin(); it != offsets.end(); it++) {" << endl; - { - Indentation indent(INDENT); - s << INDENT << "mi_offsets[i] = *it;" << endl; - s << INDENT << "i++;" << endl; - } - s << INDENT << '}' << endl; + s << INDENT << "std::copy(offsets.cbegin(), offsets.cend(), mi_offsets);\n"; } s << INDENT << '}' << endl; s << INDENT << "return mi_offsets;" << endl; @@ -3748,8 +3747,6 @@ void CppGenerator::writeExtendedConverterInitialization(QTextStream& s, const Ty QString CppGenerator::multipleInheritanceInitializerFunctionName(const AbstractMetaClass* metaClass) { - if (!hasMultipleInheritanceInAncestry(metaClass)) - return QString(); return cpythonBaseName(metaClass->typeEntry()) + QLatin1String("_mi_init"); } @@ -5050,7 +5047,7 @@ void CppGenerator::writeClassRegister(QTextStream &s, if (miClass == metaClass) { s << multipleInheritanceInitializerFunctionName(miClass) << ";" << endl; } else { - s << "Shiboken::ObjectType::getMultipleIheritanceFunction(reinterpret_cast<SbkObjectType*>("; + s << "Shiboken::ObjectType::getMultipleInheritanceFunction(reinterpret_cast<SbkObjectType*>("; s << cpythonTypeNameExt(miClass->typeEntry()) << "));" << endl; } s << INDENT << "Shiboken::ObjectType::setMultipleInheritanceFunction("; @@ -5404,8 +5401,8 @@ bool CppGenerator::finishGeneration() Indentation indent(INDENT); - const FunctionGroupMap &functionGroups = getFunctionGroups(); - for (FunctionGroupMapIt it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { + const auto functionGroups = getGlobalFunctionGroups(); + for (auto it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { AbstractMetaFunctionList overloads; for (AbstractMetaFunction *func : it.value()) { if (!func->isModifiedRemoved()) { @@ -5824,7 +5821,10 @@ bool CppGenerator::writeParentChildManagement(QTextStream& s, const AbstractMeta const int numArgs = func->arguments().count(); bool ctorHeuristicEnabled = func->isConstructor() && useCtorHeuristic() && useHeuristicPolicy; - bool usePyArgs = pythonFunctionWrapperUsesListOfArguments(OverloadData(getFunctionGroups(func->implementingClass())[func->name()], this)); + const auto &groups = func->implementingClass() + ? getFunctionGroups(func->implementingClass()) + : getGlobalFunctionGroups(); + bool usePyArgs = pythonFunctionWrapperUsesListOfArguments(OverloadData(groups[func->name()], this)); ArgumentOwner argOwner = getArgumentOwner(func, argIndex); ArgumentOwner::Action action = argOwner.action; diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.h b/sources/shiboken2/generator/shiboken2/cppgenerator.h index d2e04dba2..519e12b7b 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.h +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.h @@ -38,6 +38,9 @@ class CppGenerator : public ShibokenGenerator { public: CppGenerator(); + + const char *name() const override { return "Source generator"; } + protected: QString fileNameSuffix() const override; QString fileNameForContext(GeneratorContext &context) const override; diff --git a/sources/shiboken2/generator/shiboken2/headergenerator.h b/sources/shiboken2/generator/shiboken2/headergenerator.h index 821531aab..f59e0fd9a 100644 --- a/sources/shiboken2/generator/shiboken2/headergenerator.h +++ b/sources/shiboken2/generator/shiboken2/headergenerator.h @@ -42,6 +42,9 @@ class HeaderGenerator : public ShibokenGenerator { public: OptionDescriptions options() const override { return OptionDescriptions(); } + + const char *name() const override { return "Header generator"; } + protected: QString fileNameSuffix() const override; QString fileNameForContext(GeneratorContext &context) const override; diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index 002ab8cfb..44405c700 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -118,6 +118,16 @@ static QString resolveScopePrefix(const AbstractMetaEnum *metaEnum, return resolveScopePrefix(parts, value); } +struct GeneratorClassInfoCacheEntry +{ + ShibokenGenerator::FunctionGroups functionGroups; + bool needsGetattroFunction = false; +}; + +using GeneratorClassInfoCache = QHash<const AbstractMetaClass *, GeneratorClassInfoCacheEntry>; + +Q_GLOBAL_STATIC(GeneratorClassInfoCache, generatorClassInfoCache) + ShibokenGenerator::ShibokenGenerator() { if (m_pythonPrimitiveTypeName.isEmpty()) @@ -1739,7 +1749,10 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s, argsRemoved++; } - OverloadData od(getFunctionGroups(func->implementingClass())[func->name()], this); + const auto &groups = func->implementingClass() + ? getFunctionGroups(func->implementingClass()) + : getGlobalFunctionGroups(); + OverloadData od(groups[func->name()], this); bool usePyArgs = pythonFunctionWrapperUsesListOfArguments(od); // Replace %PYARG_# variables. @@ -2165,26 +2178,19 @@ bool ShibokenGenerator::injectedCodeUsesArgument(const AbstractMetaFunction* fun return false; } -bool ShibokenGenerator::hasMultipleInheritanceInAncestry(const AbstractMetaClass* metaClass) +bool ShibokenGenerator::classNeedsGetattroFunction(const AbstractMetaClass* metaClass) { - if (!metaClass || metaClass->baseClassNames().isEmpty()) - return false; - if (metaClass->baseClassNames().size() > 1) - return true; - return hasMultipleInheritanceInAncestry(metaClass->baseClass()); + return getGeneratorClassInfo(metaClass).needsGetattroFunction; } -typedef QMap<QString, AbstractMetaFunctionList> FunctionGroupMap; -typedef FunctionGroupMap::const_iterator FunctionGroupMapIt; - -bool ShibokenGenerator::classNeedsGetattroFunction(const AbstractMetaClass* metaClass) +bool ShibokenGenerator::classNeedsGetattroFunctionImpl(const AbstractMetaClass* metaClass) { if (!metaClass) return false; if (metaClass->typeEntry()->isSmartPointer()) return true; - const FunctionGroupMap &functionGroup = getFunctionGroups(metaClass); - for (FunctionGroupMapIt it = functionGroup.cbegin(), end = functionGroup.cend(); it != end; ++it) { + const auto &functionGroup = getFunctionGroups(metaClass); + for (auto it = functionGroup.cbegin(), end = functionGroup.cend(); it != end; ++it) { AbstractMetaFunctionList overloads; for (AbstractMetaFunction *func : qAsConst(it.value())) { if (func->isAssignmentOperator() || func->isCastOperator() || func->isModifiedRemoved() @@ -2212,8 +2218,8 @@ AbstractMetaFunctionList ShibokenGenerator::getMethodsWithBothStaticAndNonStatic { AbstractMetaFunctionList methods; if (metaClass) { - const FunctionGroupMap &functionGroups = getFunctionGroups(metaClass); - for (FunctionGroupMapIt it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { + const auto &functionGroups = getFunctionGroups(metaClass); + for (auto it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { AbstractMetaFunctionList overloads; for (AbstractMetaFunction *func : qAsConst(it.value())) { if (func->isAssignmentOperator() || func->isCastOperator() || func->isModifiedRemoved() @@ -2254,7 +2260,7 @@ AbstractMetaClassList ShibokenGenerator::getBaseClasses(const AbstractMetaClass* const AbstractMetaClass* ShibokenGenerator::getMultipleInheritingClass(const AbstractMetaClass* metaClass) { if (!metaClass || metaClass->baseClassNames().isEmpty()) - return 0; + return nullptr; if (metaClass->baseClassNames().size() > 1) return metaClass; return getMultipleInheritingClass(metaClass->baseClass()); @@ -2358,23 +2364,56 @@ static bool isGroupable(const AbstractMetaFunction* func) return true; } -QMap< QString, AbstractMetaFunctionList > ShibokenGenerator::getFunctionGroups(const AbstractMetaClass* scope) +ShibokenGenerator::FunctionGroups ShibokenGenerator::getGlobalFunctionGroups() const { - AbstractMetaFunctionList lst = scope ? scope->functions() : globalFunctions(); + const AbstractMetaFunctionList &lst = globalFunctions(); + FunctionGroups results; + for (AbstractMetaFunction *func : lst) { + if (isGroupable(func)) + results[func->name()].append(func); + } + return results; +} - QMap<QString, AbstractMetaFunctionList> results; - for (AbstractMetaFunction *func : qAsConst(lst)) { +const GeneratorClassInfoCacheEntry &ShibokenGenerator::getGeneratorClassInfo(const AbstractMetaClass *scope) +{ + auto cache = generatorClassInfoCache(); + auto it = cache->find(scope); + if (it == cache->end()) { + it = cache->insert(scope, {}); + it.value().functionGroups = getFunctionGroupsImpl(scope); + it.value().needsGetattroFunction = classNeedsGetattroFunctionImpl(scope); + } + return it.value(); +} + +ShibokenGenerator::FunctionGroups ShibokenGenerator::getFunctionGroups(const AbstractMetaClass *scope) +{ + Q_ASSERT(scope); + return getGeneratorClassInfo(scope).functionGroups; +} + +ShibokenGenerator::FunctionGroups ShibokenGenerator::getFunctionGroupsImpl(const AbstractMetaClass *scope) +{ + const AbstractMetaFunctionList &lst = scope->functions(); + + FunctionGroups results; + for (AbstractMetaFunction *func : lst) { if (isGroupable(func)) { - AbstractMetaFunctionList &list = results[func->name()]; - // If there are virtuals methods in the mix (PYSIDE-570, - // QFileSystemModel::index(QString,int) and - // QFileSystemModel::index(int,int,QModelIndex)) override, make sure - // the overriding method of the most-derived class is seen first - // and inserted into the "seenSignatures" set. - if (func->isVirtual()) - list.prepend(func); - else - list.append(func); + auto it = results.find(func->name()); + if (it == results.end()) { + results.insert(func->name(), AbstractMetaFunctionList(1, func)); + } else { + // If there are virtuals methods in the mix (PYSIDE-570, + // QFileSystemModel::index(QString,int) and + // QFileSystemModel::index(int,int,QModelIndex)) override, make sure + // the overriding method of the most-derived class is seen first + // and inserted into the "seenSignatures" set. + if (func->isVirtual()) + it.value().prepend(func); + else + it.value().append(func); + } } } return results; @@ -2503,8 +2542,8 @@ bool ShibokenGenerator::doSetup() Q_ASSERT(moduleEntry); getCode(snips, moduleEntry); - const FunctionGroupMap &functionGroups = getFunctionGroups(); - for (FunctionGroupMapIt it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { + const auto &functionGroups = getGlobalFunctionGroups(); + for (auto it = functionGroups.cbegin(), end = functionGroups.cend(); it != end; ++it) { for (AbstractMetaFunction *func : it.value()) getCode(snips, func->injectedCodeSnips()); } diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.h b/sources/shiboken2/generator/shiboken2/shibokengenerator.h index 80b172778..f5f291526 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.h +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.h @@ -54,6 +54,7 @@ extern const char *END_ALLOW_THREADS; class DocParser; class CodeSnip; class OverloadData; +struct GeneratorClassInfoCacheEntry; QT_FORWARD_DECLARE_CLASS(QTextStream) @@ -63,6 +64,8 @@ QT_FORWARD_DECLARE_CLASS(QTextStream) class ShibokenGenerator : public Generator { public: + using FunctionGroups = QMap<QString, AbstractMetaFunctionList>; // Sorted + ShibokenGenerator(); ~ShibokenGenerator() override; @@ -99,7 +102,8 @@ protected: * Example of return value: { "foo" -> ["foo(int)", "foo(int, long)], "bar" -> "bar(double)"} * \param scope Where to search for functions, null means all global functions. */ - QMap<QString, AbstractMetaFunctionList> getFunctionGroups(const AbstractMetaClass* scope = 0); + FunctionGroups getGlobalFunctionGroups() const; + static FunctionGroups getFunctionGroups(const AbstractMetaClass *scope); /** * Returns all different inherited overloads of func, and includes func as well. @@ -179,8 +183,8 @@ protected: Options options = NoOption, int arg_count = -1) const; - /// Returns true if there are cases of multiple inheritance in any of its ancestors. - bool hasMultipleInheritanceInAncestry(const AbstractMetaClass* metaClass); + /// Returns the top-most class that has multiple inheritance in the ancestry. + static const AbstractMetaClass *getMultipleInheritingClass(const AbstractMetaClass* metaClass); /// Returns true if the class needs to have a getattro function. bool classNeedsGetattroFunction(const AbstractMetaClass* metaClass); @@ -194,8 +198,6 @@ protected: /// Returns a list of parent classes for a given class. AbstractMetaClassList getBaseClasses(const AbstractMetaClass* metaClass) const; - const AbstractMetaClass* getMultipleInheritingClass(const AbstractMetaClass* metaClass); - void writeToPythonConversion(QTextStream& s, const AbstractMetaType* type, const AbstractMetaClass* context, const QString& argumentName); void writeToCppConversion(QTextStream& s, const AbstractMetaType* type, const AbstractMetaClass* context, const QString& inArgName, const QString& outArgName); @@ -440,6 +442,10 @@ protected: static QStringList m_knownPythonTypes; private: + static const GeneratorClassInfoCacheEntry &getGeneratorClassInfo(const AbstractMetaClass *scope); + static FunctionGroups getFunctionGroupsImpl(const AbstractMetaClass *scope); + static bool classNeedsGetattroFunctionImpl(const AbstractMetaClass *metaClass); + QString translateTypeForWrapperMethod(const AbstractMetaType* cType, const AbstractMetaClass* context, Options opt = NoOption) const; diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp index 3a043d849..6ea793a79 100644 --- a/sources/shiboken2/libshiboken/basewrapper.cpp +++ b/sources/shiboken2/libshiboken/basewrapper.cpp @@ -711,7 +711,7 @@ void setTypeDiscoveryFunctionV2(SbkObjectType* type, TypeDiscoveryFuncV2 func) PepType_SOTP(type)->type_discovery = func; } -void copyMultimpleheritance(SbkObjectType* type, SbkObjectType* other) +void copyMultipleInheritance(SbkObjectType *type, SbkObjectType *other) { PepType_SOTP(type)->mi_init = PepType_SOTP(other)->mi_init; PepType_SOTP(type)->mi_offsets = PepType_SOTP(other)->mi_offsets; @@ -723,7 +723,7 @@ void setMultipleInheritanceFunction(SbkObjectType* type, MultipleInheritanceInit PepType_SOTP(type)->mi_init = function; } -MultipleInheritanceInitFunction getMultipleIheritanceFunction(SbkObjectType* type) +MultipleInheritanceInitFunction getMultipleInheritanceFunction(SbkObjectType *type) { return PepType_SOTP(type)->mi_init; } diff --git a/sources/shiboken2/libshiboken/basewrapper.h b/sources/shiboken2/libshiboken/basewrapper.h index d12b7222b..55445b026 100644 --- a/sources/shiboken2/libshiboken/basewrapper.h +++ b/sources/shiboken2/libshiboken/basewrapper.h @@ -184,9 +184,9 @@ LIBSHIBOKEN_API void setOriginalName(SbkObjectType* self, const char* nam LIBSHIBOKEN_API const char* getOriginalName(SbkObjectType* self); LIBSHIBOKEN_API void setTypeDiscoveryFunctionV2(SbkObjectType* self, TypeDiscoveryFuncV2 func); -LIBSHIBOKEN_API void copyMultimpleheritance(SbkObjectType* self, SbkObjectType* other); +LIBSHIBOKEN_API void copyMultipleInheritance(SbkObjectType *self, SbkObjectType *other); LIBSHIBOKEN_API void setMultipleInheritanceFunction(SbkObjectType* self, MultipleInheritanceInitFunction func); -LIBSHIBOKEN_API MultipleInheritanceInitFunction getMultipleIheritanceFunction(SbkObjectType* self); +LIBSHIBOKEN_API MultipleInheritanceInitFunction getMultipleInheritanceFunction(SbkObjectType *self); LIBSHIBOKEN_API void setDestructorFunction(SbkObjectType* self, ObjectDestructor func); diff --git a/sources/shiboken2/libshiboken/embed/embedding_generator.py b/sources/shiboken2/libshiboken/embed/embedding_generator.py index b6bfb1467..77aa5c329 100644 --- a/sources/shiboken2/libshiboken/embed/embedding_generator.py +++ b/sources/shiboken2/libshiboken/embed/embedding_generator.py @@ -92,7 +92,7 @@ def create_zipfile(limited_api): flag = '-b' if sys.version_info >= (3,) else '' os.chdir(work_dir) - # Limited API: Remove all left-over py[co] files first, in case we use '--reuse-build'. + # Remove all left-over py[co] and other files first, in case we use '--reuse-build'. # Note that we could improve that with the PyZipfile function to use .pyc files # in different folders, but that makes only sense when COIN allows us to have # multiple Python versions in parallel. @@ -100,9 +100,9 @@ def create_zipfile(limited_api): for root, dirs, files in os.walk(work_dir): for name in files: fpath = os.path.join(root, name) - if name.endswith(".pyc") or name.endswith(".pyo"): + ew = name.endswith + if ew(".pyc") or ew(".pyo") or ew(".zip") or ew(".inc"): os.remove(fpath) - # We copy every Python file into this dir, but only for the right version. # For testing in the source dir, we need to filter. if sys.version_info[0] == 3: diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h index ffbc570a8..93f718988 100644 --- a/sources/shiboken2/libshiboken/pep384impl.h +++ b/sources/shiboken2/libshiboken/pep384impl.h @@ -201,7 +201,12 @@ LIBSHIBOKEN_API int Pep_GetVerboseFlag(void); LIBSHIBOKEN_API char *_PepUnicode_AsString(PyObject *); +#if PY_VERSION_HEX < 0x03000000 #define PyUnicode_GET_SIZE(op) PyUnicode_GetSize((PyObject *)(op)) +#else +// PyUnicode_GetSize is deprecated in favor of PyUnicode_GetLength +#define PyUnicode_GET_SIZE(op) PyUnicode_GetLength((PyObject *)(op)) +#endif #else #define _PepUnicode_AsString PyUnicode_AsUTF8 diff --git a/sources/shiboken2/libshiboken/pep384impl_doc.rst b/sources/shiboken2/libshiboken/pep384impl_doc.rst index ab286dd3e..2f3b7ea97 100644 --- a/sources/shiboken2/libshiboken/pep384impl_doc.rst +++ b/sources/shiboken2/libshiboken/pep384impl_doc.rst @@ -70,7 +70,8 @@ supported. We redefined it as macro ``Py_VerboseFlag`` which calls ``Pep_Verbose unicodeobject.h --------------- -The macro ``PyUnicode_GET_SIZE`` was redefined to call into ``PyUnicode_GetSize``. +The macro ``PyUnicode_GET_SIZE`` was redefined to call into ``PyUnicode_GetSize`` +for Python 2, and ``PyUnicode_GetLength`` for Python 3. Function ``_PyUnicode_AsString`` is unavailable and was replaced by a macro that calls ``_PepUnicode_AsString``. The implementation was a bit involved, and it would be better to change the code and replace this function. |