aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.h
Commit message (Collapse)AuthorAgeFilesLines
* shiboken: Refactor attribute parsing in typesystem parserFriedemann Kleint2018-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | Split up the 1400 lines Handler::startElement() function into smaller helper functions. Previously, the function populated a hash with the default values of all attributes. The values were then set by fetchAttributes() from the XML attributes and applied later on. In this setup, it is not possible to add deprecation warnings since it not possible to tell which attributes were actually present in the file. Change this to operate on the QXmlStreamAttributes list from which the consumed options are removed. Add a warning about unused attributes. It is now possible to add deprecation warnings and the default values are now more obvious. Task-number: PYSIDE-743 Change-Id: I1ee04e9490b3664bba4c976fe654183819610b58 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Refactor attribute enumeration lookups in parserFriedemann Kleint2018-07-191-20/+2
| | | | | | | | | | | | Replace the static QHashes in Handler::startElement() and other places which required converting and lower-casing the QStringRef's returned by the QXmlStreamReader by lookup functions that take a QStringView, which can be constructed from QString or QStringRef. Task-number: PYSIDE-743 Change-Id: I10234f2ddfff13ee7e0ee67f9aee118a088e5ab8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Improve debug output of TypeEntry classesFriedemann Kleint2018-07-161-0/+10
| | | | | | Task-number: PYSIDE-743 Change-Id: Ie4794c6387ef5ffaf8a5813b744fa725427b5f09 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Make revision and SBK index a member of TypeEntryFriedemann Kleint2018-07-131-0/+7
| | | | | | | | | | | | | | | | | | They were previously stored in a global hash, apparently due to BC issues. Replace the global set/getTypeIndex/Revision functions by member functions of TypeEntry in typedatabase.cpp. As a drive-by change, simplify the code assigning the SBK numbers to use a flat list of entries ordered by revision and name instead of a grouped hash (bearing in mind that revision is rarely used) and might be removed one day). Also replace the use of std::unique() by the !contains()/append() pattern since std::unique() assumes an ordered list which is likely not the case. Task-number: PYSIDE-725 Task-number: PYSIDE-743 Change-Id: I9356acf1f5795446c08f266c1323f1db65cd490c Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Remove global-static hashes used for members of TypeEntryFriedemann Kleint2018-07-131-0/+2
| | | | | | | | | | | TypeEntry::customConversion and ComplexTypeEntry::defaultConstructor where previously stored in global-static hashes, apparently due to BC issues. This can now be fixed. Task-number: PYSIDE-725 Task-number: PYSIDE-743 Change-Id: If4f28246a5b83e3772021a518058a9d152bb3e3f Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Make targetLangPackage() a normal property of TypeEntryFriedemann Kleint2018-07-131-19/+3
| | | | | | | | | | Normally, only the root typesystem element has a package specification; there is no need to have virtual functions for it. Task-number: PYSIDE-725 Task-number: PYSIDE-743 Change-Id: I3b86c8418cf16ce372c1953279a115e2eff0e984 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Remove unused TypeEntry classesFriedemann Kleint2018-07-131-38/+0
| | | | | | | Task-number: PYSIDE-725 Task-number: PYSIDE-743 Change-Id: I61fcd8af7329c14ef064795c13787005b4375548 Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Improve error message about missing function for modificationFriedemann Kleint2018-06-221-0/+4
| | | | | | | | | The signature is passed through TypeDatabase::normalizedSignature() which calls QMetaObject::normalizedSignature(). Keep the original signature and output it in the error message. Change-Id: Ibd1ddd0dee17d828710caf4bf6d674c35776b4c2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change license from all the filesCristian Maureira-Fredes2018-05-031-1/+1
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename PySide references to Qt for PythonCristian Maureira-Fredes2018-04-271-1/+1
| | | | | | | | | When referring to the project one should use "Qt for Python" and for the module "PySide2" Change-Id: I36497df245c9f6dd60d6e160e2fc805e48cefcae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Detect class enums by Clang entirelyFriedemann Kleint2018-04-191-13/+0
| | | | | | | | | | | | | | The Clang function clang_EnumDecl_isScoped() tells whether an enum is a class, so, there is no need to specify that in the typesystem. Use that information to pass it up to the metalang classes and revert the parts of 44cb6c51e6c3b43376f284941454dc8c13b81c3f that added it to the type system. Task-number: PYSIDE-487 Change-Id: Ie10885f74168821d0307e91b6f1f7f3f30dd074b Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* siboken/Typesystem: Replace double used for versions by QVersionNumberFriedemann Kleint2018-03-201-28/+26
| | | | | | | | | | | | | - Change TypeSystemEntry::m_version from double to QVersionNumber. - Determine version at the beginning of the start element processing of the parser and use that. - Remove AddedFunction::m_version which is not needed. - Remove unused parameter double vr from AbstractMetaBuilderPrivate::translateType(). Change-Id: I2941667ba565f8c11aa0c14446ec7d6934da99dc Reviewed-by: Christian Tismer <tismer@stackless.com>
* Type system: Add attribute indicating C++ 11 enum classesFriedemann Kleint2018-02-281-10/+13
| | | | | | | | | | | | | Introduce enumeration for the type to EnumTypeEntry which can be specified by the boolean "class" attribute. For the enum classes, the value names need to be qualified by the enum name to match the C++ API. For the C++ generator, add an overload to Shiboken::createScopedEnumItem() that takes a PyTypeObject and add the enum items to the enum so that the name is in the enum scope. Change-Id: Ia0e469d13b08c196b9ddd965b9cf3cc62a38630b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Remove unused code related to enumerationsFriedemann Kleint2018-02-281-16/+2
| | | | | | | | Remove class struct EnumValueRedirection and add explanatory comment to EnumValueTypeEntry. Change-Id: Ic4665436f301943805c7985188bc41c4ad3e8336 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Refactor typesystem modification structsFriedemann Kleint2017-12-051-119/+52
| | | | | | | | | | | - Use member initialization where possible - Make constructors explicit - Remove unused version attributes, unused comparison operators of FunctionModification and unused struct ExpensePolicy - Rearrange members to minimize Clang warnings about padding Change-Id: I1423f120b2117237c2674cdbb6d06923c842999f Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Cleanup of the TypeEntry hierarchyFriedemann Kleint2017-12-041-260/+71
| | | | | | | | | | | Use member initialization where possible. Move constructors/destructors of classes in hierarchies out of line (fixing Clang warnings about classes having no virtual out of line methods). Add override and move virtual functions out of line. Remove unused method ComplexTypeEntry *ComplexTypeEntry::copy(). Change-Id: Ie4a6c30cb0c99be35697f29ebe407b327079222a Reviewed-by: Christian Tismer <tismer@stackless.com>
* FunctionModification: Make it possible to specify a regular expressionFriedemann Kleint2017-08-291-1/+11
| | | | | | | | | It should make it easier to specify the <array> modifications for GL functions. Task-number: PYSIDE-516 Change-Id: Ieb2e540f61785d13ee46a196a18d03b311d308e1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add new <array> argument modification indicating array usageFriedemann Kleint2017-08-031-2/+3
| | | | | | | | | | | | The modification can be used to indicate that for example int* is meant to be used as int[]. This is reflected in the NativePointerAsArrayPattern usage pattern of AbstractMetaType. Task-number: PYSIDE-354 Task-number: PYSIDE-516 Change-Id: Icaeb3cce4be9ce06caa2cab628d4e8fc1b684819 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* move everying into sources/shiboken2 (5.9 edition)Oswald Buddenhagen2017-05-221-0/+1975
in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.