aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-05-13 08:45:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-05-17 11:25:54 +0200
commitae31d1dc8776a0bd35e80494ca30e9c7d1c644f8 (patch)
tree6e68765006cba14a8b2c35de8e64a52a26aebd2e /sources
parent4a92abf5082e4ffcc76a1ed241af06c8f7ebe461 (diff)
shiboken6: Split the typesystem header
It was growing too large to be maintainable. Change-Id: I7d646fa92a08dd598d673c81668210c1b188b635 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp14
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetabuilder_helpers.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetaenum.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetafield.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetafunction.cpp5
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetatype.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractor.cpp7
-rw-r--r--sources/shiboken6/ApiExtractor/apiextractorresult.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/arraytypeentry.h53
-rw-r--r--sources/shiboken6/ApiExtractor/complextypeentry.h168
-rw-r--r--sources/shiboken6/ApiExtractor/constantvaluetypeentry.h48
-rw-r--r--sources/shiboken6/ApiExtractor/containertypeentry.h73
-rw-r--r--sources/shiboken6/ApiExtractor/customconversion.h89
-rw-r--r--sources/shiboken6/ApiExtractor/customtypenentry.h55
-rw-r--r--sources/shiboken6/ApiExtractor/doxygenparser.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/enclosingclassmixin.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/enumtypeentry.h67
-rw-r--r--sources/shiboken6/ApiExtractor/enumvaluetypeentry.h56
-rw-r--r--sources/shiboken6/ApiExtractor/flagstypeentry.h60
-rw-r--r--sources/shiboken6/ApiExtractor/functiontypeentry.h60
-rw-r--r--sources/shiboken6/ApiExtractor/messages.cpp4
-rw-r--r--sources/shiboken6/ApiExtractor/namespacetypeentry.h75
-rw-r--r--sources/shiboken6/ApiExtractor/objecttypeentry.h46
-rw-r--r--sources/shiboken6/ApiExtractor/primitivetypeentry.h91
-rw-r--r--sources/shiboken6/ApiExtractor/propertyspec.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/pythontypeentry.h53
-rw-r--r--sources/shiboken6/ApiExtractor/qtdocparser.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/smartpointertypeentry.h78
-rw-r--r--sources/shiboken6/ApiExtractor/templateargumententry.h51
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testaddfunction.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testarrayargument.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testcodeinjection.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testcontainer.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testconversionruletag.cpp4
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testenum.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testextrainclude.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testimplicitconversions.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testinserttemplate.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testmodifydocumentation.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testnestedtypes.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testprimitivetypetag.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testremoveimplconv.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testtemplates.cpp3
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testtyperevision.cpp4
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testvaluetypedefaultctortag.cpp2
-rw-r--r--sources/shiboken6/ApiExtractor/typedatabase.cpp23
-rw-r--r--sources/shiboken6/ApiExtractor/typedefentry.h62
-rw-r--r--sources/shiboken6/ApiExtractor/typesystem.cpp21
-rw-r--r--sources/shiboken6/ApiExtractor/typesystem.h651
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp18
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser_p.h6
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemtypeentry.h49
-rw-r--r--sources/shiboken6/ApiExtractor/valuetypeentry.h50
-rw-r--r--sources/shiboken6/ApiExtractor/varargstypeentry.h45
-rw-r--r--sources/shiboken6/ApiExtractor/voidtypeentry.h45
-rw-r--r--sources/shiboken6/generator/generator.cpp7
-rw-r--r--sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp4
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.cpp8
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator.h1
-rw-r--r--sources/shiboken6/generator/shiboken/cppgenerator_container.cpp1
-rw-r--r--sources/shiboken6/generator/shiboken/headergenerator.cpp8
-rw-r--r--sources/shiboken6/generator/shiboken/headergenerator.h1
-rw-r--r--sources/shiboken6/generator/shiboken/overloaddata.cpp4
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.cpp8
-rw-r--r--sources/shiboken6/generator/shiboken/shibokengenerator.h3
67 files changed, 1554 insertions, 684 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
index 936f1683e..fe093c928 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder.cpp
@@ -37,7 +37,19 @@
#include "reporthandler.h"
#include "sourcelocation.h"
#include "typedatabase.h"
-#include "typesystem.h"
+#include "enumtypeentry.h"
+#include "enumvaluetypeentry.h"
+#include "arraytypeentry.h"
+#include "constantvaluetypeentry.h"
+#include "containertypeentry.h"
+#include "flagstypeentry.h"
+#include "functiontypeentry.h"
+#include "namespacetypeentry.h"
+#include "primitivetypeentry.h"
+#include "smartpointertypeentry.h"
+#include "templateargumententry.h"
+#include "typedefentry.h"
+#include "typesystemtypeentry.h"
#include "usingmember.h"
#include "parser/codemodel.h"
diff --git a/sources/shiboken6/ApiExtractor/abstractmetabuilder_helpers.cpp b/sources/shiboken6/ApiExtractor/abstractmetabuilder_helpers.cpp
index 3db29b6fc..ddda1cb24 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetabuilder_helpers.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetabuilder_helpers.cpp
@@ -31,7 +31,8 @@
#include "abstractmetaenum.h"
#include "abstractmetafield.h"
#include "abstractmetalang.h"
-#include "typesystem.h"
+#include "enumtypeentry.h"
+#include "flagstypeentry.h"
using QStringViewList = QList<QStringView>;
diff --git a/sources/shiboken6/ApiExtractor/abstractmetaenum.cpp b/sources/shiboken6/ApiExtractor/abstractmetaenum.cpp
index 8e0b45d4e..651105061 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetaenum.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetaenum.cpp
@@ -29,7 +29,7 @@
#include "abstractmetaenum.h"
#include "abstractmetalang.h"
#include "documentation.h"
-#include "typesystem.h"
+#include "enumtypeentry.h"
#include "parser/enumvalue.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/abstractmetafield.cpp b/sources/shiboken6/ApiExtractor/abstractmetafield.cpp
index 0d2761ac8..6b92b379b 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetafield.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetafield.cpp
@@ -32,7 +32,8 @@
#include "abstractmetatype.h"
#include "documentation.h"
#include "modifications.h"
-#include "typesystem.h"
+#include "complextypeentry.h"
+#include "typesystemtypeentry.h"
#include "parser/codemodel.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
index 1f725967f..df78eb7f8 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetafunction.cpp
@@ -40,7 +40,10 @@
#include "reporthandler.h"
#include "sourcelocation.h"
#include "typedatabase.h"
-#include "typesystem.h"
+#include "complextypeentry.h"
+#include "functiontypeentry.h"
+#include "primitivetypeentry.h"
+#include "typesystemtypeentry.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp
index 76547cdef..3568d5c3a 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.cpp
@@ -38,7 +38,8 @@
#include "reporthandler.h"
#include "sourcelocation.h"
#include "typedatabase.h"
-#include "typesystem.h"
+#include "enumtypeentry.h"
+#include "namespacetypeentry.h"
#include "usingmember.h"
#include <QtCore/QDebug>
diff --git a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp
index b5fa4100c..78d07c6f9 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetatype.cpp
+++ b/sources/shiboken6/ApiExtractor/abstractmetatype.cpp
@@ -31,7 +31,7 @@
#include "abstractmetalang.h"
#include "messages.h"
#include "typedatabase.h"
-#include "typesystem.h"
+#include "containertypeentry.h"
#include "parser/codemodel.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/apiextractor.cpp b/sources/shiboken6/ApiExtractor/apiextractor.cpp
index 147610711..4315b9de8 100644
--- a/sources/shiboken6/ApiExtractor/apiextractor.cpp
+++ b/sources/shiboken6/ApiExtractor/apiextractor.cpp
@@ -40,7 +40,12 @@
#include "modifications.h"
#include "reporthandler.h"
#include "typedatabase.h"
-#include "typesystem.h"
+#include "customconversion.h"
+#include "containertypeentry.h"
+#include "primitivetypeentry.h"
+#include "smartpointertypeentry.h"
+#include "typedefentry.h"
+#include "typesystemtypeentry.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/apiextractorresult.cpp b/sources/shiboken6/ApiExtractor/apiextractorresult.cpp
index 8a275db55..41cf61e61 100644
--- a/sources/shiboken6/ApiExtractor/apiextractorresult.cpp
+++ b/sources/shiboken6/ApiExtractor/apiextractorresult.cpp
@@ -31,7 +31,8 @@
#include "abstractmetalang.h"
#include "abstractmetaenum.h"
-#include "typesystem.h"
+#include "enumtypeentry.h"
+#include "flagstypeentry.h"
ApiExtractorResultData::ApiExtractorResultData() = default;
diff --git a/sources/shiboken6/ApiExtractor/arraytypeentry.h b/sources/shiboken6/ApiExtractor/arraytypeentry.h
new file mode 100644
index 000000000..4c5233381
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/arraytypeentry.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef ARRAYTYPEENTRY_H
+#define ARRAYTYPEENTRY_H
+
+#include "typesystem.h"
+
+class ArrayTypeEntryPrivate;
+
+class ArrayTypeEntry : public TypeEntry
+{
+public:
+ explicit ArrayTypeEntry(const TypeEntry *nested_type, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ void setNestedTypeEntry(TypeEntry *nested);
+ const TypeEntry *nestedTypeEntry() const;
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit ArrayTypeEntry(ArrayTypeEntryPrivate *d);
+
+ QString buildTargetLangName() const override;
+};
+
+#endif // ARRAYTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/complextypeentry.h b/sources/shiboken6/ApiExtractor/complextypeentry.h
new file mode 100644
index 000000000..008f7c257
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/complextypeentry.h
@@ -0,0 +1,168 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef COMPLEXTYPEENTRY_H
+#define COMPLEXTYPEENTRY_H
+
+#include "typesystem.h"
+
+#include <QtCore/QSet>
+
+class ComplexTypeEntryPrivate;
+
+struct TypeSystemProperty
+{
+ bool isValid() const { return !name.isEmpty() && !read.isEmpty() && !type.isEmpty(); }
+
+ QString type;
+ QString name;
+ QString read;
+ QString write;
+ QString reset;
+ QString designable;
+ // Indicates whether actual code is generated instead of relying on libpyside.
+ bool generateGetSetDef = false;
+};
+
+class ComplexTypeEntry : public TypeEntry
+{
+public:
+ enum TypeFlag {
+ DisableWrapper = 0x1,
+ Deprecated = 0x4,
+ ForceAbstract = 0x8
+ };
+ Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
+
+ enum CopyableFlag {
+ CopyableSet,
+ NonCopyableSet,
+ Unknown
+ };
+
+ explicit ComplexTypeEntry(const QString &entryName, Type t, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ bool isComplex() const override;
+
+ TypeFlags typeFlags() const;
+ void setTypeFlags(TypeFlags flags);
+
+ // Override command line options to generate nb_bool from
+ // operator bool or method isNull().
+ TypeSystem::BoolCast operatorBoolMode() const;
+ void setOperatorBoolMode(TypeSystem::BoolCast b);
+ TypeSystem::BoolCast isNullMode() const;
+ void setIsNullMode(TypeSystem::BoolCast b);
+
+ FunctionModificationList functionModifications() const;
+ void setFunctionModifications(const FunctionModificationList &functionModifications);
+ void addFunctionModification(const FunctionModification &functionModification);
+ FunctionModificationList functionModifications(const QString &signature) const;
+
+ AddedFunctionList addedFunctions() const;
+ void setAddedFunctions(const AddedFunctionList &addedFunctions);
+ void addNewFunction(const AddedFunctionPtr &addedFunction);
+
+ // Functions specified in the "generate-functions" attribute
+ const QSet<QString> &generateFunctions() const;
+ void setGenerateFunctions(const QSet<QString> &f);
+
+ void setFieldModifications(const FieldModificationList &mods);
+ FieldModificationList fieldModifications() const;
+
+ const QList<TypeSystemProperty> &properties() const;
+ void addProperty(const TypeSystemProperty &p);
+
+ QString defaultSuperclass() const;
+ void setDefaultSuperclass(const QString &sc);
+
+ QString qualifiedCppName() const override;
+
+ void setIsPolymorphicBase(bool on);
+ bool isPolymorphicBase() const;
+
+ void setPolymorphicIdValue(const QString &value);
+ QString polymorphicIdValue() const;
+
+ QString polymorphicNameFunction() const;
+ void setPolymorphicNameFunction(const QString &n);
+
+ QString targetType() const;
+ void setTargetType(const QString &code);
+
+ bool isGenericClass() const;
+ void setGenericClass(bool isGeneric);
+
+ bool deleteInMainThread() const;
+ void setDeleteInMainThread(bool d);
+
+ CopyableFlag copyable() const;
+ void setCopyable(CopyableFlag flag);
+
+ TypeSystem::QtMetaTypeRegistration qtMetaTypeRegistration() const;
+ void setQtMetaTypeRegistration(TypeSystem::QtMetaTypeRegistration r);
+
+ QString hashFunction() const;
+ void setHashFunction(const QString &hashFunction);
+
+ void setBaseContainerType(const ComplexTypeEntry *baseContainer);
+
+ const ComplexTypeEntry *baseContainerType() const;
+
+ TypeSystem::ExceptionHandling exceptionHandling() const;
+ void setExceptionHandling(TypeSystem::ExceptionHandling e);
+
+ TypeSystem::AllowThread allowThread() const;
+ void setAllowThread(TypeSystem::AllowThread allowThread);
+
+ QString defaultConstructor() const;
+ void setDefaultConstructor(const QString& defaultConstructor);
+ bool hasDefaultConstructor() const;
+
+ TypeEntry *clone() const override;
+
+ void useAsTypedef(const ComplexTypeEntry *source);
+
+ TypeSystem::SnakeCase snakeCase() const;
+ void setSnakeCase(TypeSystem::SnakeCase sc);
+
+ // Determined by AbstractMetaBuilder from the code model.
+ bool isValueTypeWithCopyConstructorOnly() const;
+ void setValueTypeWithCopyConstructorOnly(bool v);
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &debug) const override;
+#endif
+protected:
+ explicit ComplexTypeEntry(ComplexTypeEntryPrivate *d);
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(ComplexTypeEntry::TypeFlags)
+
+#endif // COMPLEXTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/constantvaluetypeentry.h b/sources/shiboken6/ApiExtractor/constantvaluetypeentry.h
new file mode 100644
index 000000000..f3be5d515
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/constantvaluetypeentry.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef CONSTANTVALUETYPEENTRY_H
+#define CONSTANTVALUETYPEENTRY_H
+
+#include "typesystem.h"
+
+// For primitive values, typically to provide a dummy type for
+// example the '2' in non-type template 'Array<2>'.
+class ConstantValueTypeEntry : public TypeEntry
+{
+public:
+ explicit ConstantValueTypeEntry(const QString& name,
+ const TypeEntry *parent);
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit ConstantValueTypeEntry(TypeEntryPrivate *d);
+};
+
+#endif // CONSTANTVALUETYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/containertypeentry.h b/sources/shiboken6/ApiExtractor/containertypeentry.h
new file mode 100644
index 000000000..5ad43a721
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/containertypeentry.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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$
+**
+****************************************************************************/
+
+#ifndef CONTAINERTYPEENTRY_H
+#define CONTAINERTYPEENTRY_H
+
+#include "complextypeentry.h"
+
+class ContainerTypeEntryPrivate;
+
+class ContainerTypeEntry : public ComplexTypeEntry
+{
+public:
+ struct OpaqueContainer // Generate an opaque container for an instantiation under name
+ {
+ QString instantiation;
+ QString name;
+ };
+ using OpaqueContainers = QList<OpaqueContainer>;
+
+ enum ContainerKind {
+ ListContainer,
+ SetContainer,
+ MapContainer,
+ MultiMapContainer,
+ PairContainer,
+ };
+
+ explicit ContainerTypeEntry(const QString &entryName, ContainerKind containerKind,
+ const QVersionNumber &vr, const TypeEntry *parent);
+
+ ContainerKind containerKind() const;
+
+ const OpaqueContainers &opaqueContainers() const;
+ void addOpaqueContainer(OpaqueContainer r);
+ bool generateOpaqueContainer(const QString &instantiation) const;
+ QString opaqueContainerName(const QString &instantiation) const;
+
+ TypeEntry *clone() const override;
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+protected:
+ explicit ContainerTypeEntry(ContainerTypeEntryPrivate *d);
+};
+
+#endif // CONTAINERTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/customconversion.h b/sources/shiboken6/ApiExtractor/customconversion.h
new file mode 100644
index 000000000..ca6a18df4
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/customconversion.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef CUSTOMCONVERSION_H
+#define CUSTOMCONVERSION_H
+
+#include "typesystem_enums.h"
+
+#include <QtCore/QList>
+#include <QtCore/QString>
+
+class TypeEntry;
+
+class CustomConversion
+{
+public:
+ CustomConversion(TypeEntry* ownerType);
+ ~CustomConversion();
+
+ const TypeEntry* ownerType() const;
+ QString nativeToTargetConversion() const;
+ void setNativeToTargetConversion(const QString& nativeToTargetConversion);
+
+ class TargetToNativeConversion
+ {
+ public:
+ TargetToNativeConversion(const QString& sourceTypeName,
+ const QString& sourceTypeCheck,
+ const QString& conversion = QString());
+ ~TargetToNativeConversion();
+
+ const TypeEntry* sourceType() const;
+ void setSourceType(const TypeEntry* sourceType);
+ bool isCustomType() const;
+ QString sourceTypeName() const;
+ QString sourceTypeCheck() const;
+ QString conversion() const;
+ void setConversion(const QString& conversion);
+ private:
+ struct TargetToNativeConversionPrivate;
+ TargetToNativeConversionPrivate* m_d;
+ };
+
+ /**
+ * Returns true if the target to C++ custom conversions should
+ * replace the original existing ones, and false if the custom
+ * conversions should be added to the original.
+ */
+ bool replaceOriginalTargetToNativeConversions() const;
+ void setReplaceOriginalTargetToNativeConversions(bool replaceOriginalTargetToNativeConversions);
+
+ using TargetToNativeConversions = QList<TargetToNativeConversion *>;
+ bool hasTargetToNativeConversions() const;
+ TargetToNativeConversions& targetToNativeConversions();
+ const TargetToNativeConversions& targetToNativeConversions() const;
+ void addTargetToNativeConversion(const QString& sourceTypeName,
+ const QString& sourceTypeCheck,
+ const QString& conversion = QString());
+private:
+ struct CustomConversionPrivate;
+ CustomConversionPrivate* m_d;
+};
+
+#endif // CUSTOMCONVERSION_H
diff --git a/sources/shiboken6/ApiExtractor/customtypenentry.h b/sources/shiboken6/ApiExtractor/customtypenentry.h
new file mode 100644
index 000000000..5a066e690
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/customtypenentry.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef CUSTOMTYPENENTRY_H
+#define CUSTOMTYPENENTRY_H
+
+#include "typesystem.h"
+
+class CustomTypeEntry : public TypeEntry
+{
+public:
+ explicit CustomTypeEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ TypeEntry *clone() const override;
+
+ bool hasCheckFunction() const;
+ QString checkFunction() const;
+ void setCheckFunction(const QString &f);
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+
+protected:
+ explicit CustomTypeEntry(TypeEntryPrivate *d);
+};
+
+
+#endif // CUSTOMTYPENENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/doxygenparser.cpp b/sources/shiboken6/ApiExtractor/doxygenparser.cpp
index a5189f99f..e32e42fef 100644
--- a/sources/shiboken6/ApiExtractor/doxygenparser.cpp
+++ b/sources/shiboken6/ApiExtractor/doxygenparser.cpp
@@ -36,7 +36,7 @@
#include "modifications.h"
#include "propertyspec.h"
#include "reporthandler.h"
-#include "typesystem.h"
+#include "complextypeentry.h"
#include "xmlutils.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/enclosingclassmixin.cpp b/sources/shiboken6/ApiExtractor/enclosingclassmixin.cpp
index 5d6394f11..c7d2519eb 100644
--- a/sources/shiboken6/ApiExtractor/enclosingclassmixin.cpp
+++ b/sources/shiboken6/ApiExtractor/enclosingclassmixin.cpp
@@ -28,7 +28,7 @@
#include "enclosingclassmixin.h"
#include "abstractmetalang.h"
-#include "typesystem.h"
+#include "namespacetypeentry.h"
const AbstractMetaClass *EnclosingClassMixin::targetLangEnclosingClass() const
{
diff --git a/sources/shiboken6/ApiExtractor/enumtypeentry.h b/sources/shiboken6/ApiExtractor/enumtypeentry.h
new file mode 100644
index 000000000..237c4adeb
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/enumtypeentry.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef ENUMTYPEENTRY_H
+#define ENUMTYPEENTRY_H
+
+#include "typesystem.h"
+
+class EnumTypeEntryPrivate;
+class EnumValueTypeEntry;
+class FlagsTypeEntry;
+
+class EnumTypeEntry : public TypeEntry
+{
+public:
+ explicit EnumTypeEntry(const QString &entryName,
+ const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ QString targetLangQualifier() const;
+
+ QString qualifier() const;
+
+ const EnumValueTypeEntry *nullValue() const;
+ void setNullValue(const EnumValueTypeEntry *n);
+
+ void setFlags(FlagsTypeEntry *flags);
+ FlagsTypeEntry *flags() const;
+
+ bool isEnumValueRejected(const QString &name) const;
+ void addEnumValueRejection(const QString &name);
+ QStringList enumValueRejections() const;
+
+ TypeEntry *clone() const override;
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+protected:
+ explicit EnumTypeEntry(EnumTypeEntryPrivate *d);
+};
+
+#endif // ENUMTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/enumvaluetypeentry.h b/sources/shiboken6/ApiExtractor/enumvaluetypeentry.h
new file mode 100644
index 000000000..ab6346eab
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/enumvaluetypeentry.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef ENUMVALUETYPEENTRY_H
+#define ENUMVALUETYPEENTRY_H
+
+#include "typesystem.h"
+
+class EnumTypeEntry;
+class EnumValueTypeEntryPrivate;
+
+// EnumValueTypeEntry is used for resolving integer type templates
+// like array<EnumValue>. Note: Dummy entries for integer values will
+// be created for non-type template parameters, where m_enclosingEnum==nullptr.
+class EnumValueTypeEntry : public TypeEntry
+{
+public:
+ explicit EnumValueTypeEntry(const QString& name, const QString& value,
+ const EnumTypeEntry* enclosingEnum,
+ bool isScopedEnum, const QVersionNumber &vr);
+
+ QString value() const;
+ const EnumTypeEntry* enclosingEnum() const;
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit EnumValueTypeEntry(EnumValueTypeEntryPrivate *d);
+};
+
+#endif // ENUMVALUETYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/flagstypeentry.h b/sources/shiboken6/ApiExtractor/flagstypeentry.h
new file mode 100644
index 000000000..01d455802
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/flagstypeentry.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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$
+**
+****************************************************************************/
+
+#ifndef FLAGSTYPEENTRY_H
+#define FLAGSTYPEENTRY_H
+
+#include "typesystem.h"
+
+class EnumTypeEntry;
+class FlagsTypeEntryPrivate;
+
+class FlagsTypeEntry : public TypeEntry
+{
+public:
+ explicit FlagsTypeEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ QString originalName() const;
+ void setOriginalName(const QString &s);
+
+ QString flagsName() const;
+ void setFlagsName(const QString &name);
+
+ EnumTypeEntry *originator() const;
+ void setOriginator(EnumTypeEntry *e);
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit FlagsTypeEntry(FlagsTypeEntryPrivate *d);
+
+ QString buildTargetLangName() const override;
+};
+
+#endif // FLAGSTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/functiontypeentry.h b/sources/shiboken6/ApiExtractor/functiontypeentry.h
new file mode 100644
index 000000000..8935b1164
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/functiontypeentry.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef FUNCTIONTYPEENTRY_H
+#define FUNCTIONTYPEENTRY_H
+
+#include "typesystem.h"
+
+class FunctionTypeEntryPrivate;
+
+class FunctionTypeEntry : public TypeEntry
+{
+public:
+ explicit FunctionTypeEntry(const QString& name, const QString& signature,
+ const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ const QStringList &signatures() const;
+ bool hasSignature(const QString& signature) const;
+ void addSignature(const QString& signature);
+
+ TypeSystem::SnakeCase snakeCase() const;
+ void setSnakeCase(TypeSystem::SnakeCase sc);
+
+ TypeEntry *clone() const override;
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+
+protected:
+ explicit FunctionTypeEntry(FunctionTypeEntryPrivate *d);
+};
+
+#endif // FUNCTIONTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/messages.cpp b/sources/shiboken6/ApiExtractor/messages.cpp
index 311b6ce4a..d855b332f 100644
--- a/sources/shiboken6/ApiExtractor/messages.cpp
+++ b/sources/shiboken6/ApiExtractor/messages.cpp
@@ -34,7 +34,9 @@
#include "modifications.h"
#include "sourcelocation.h"
#include "typedatabase.h"
-#include "typesystem.h"
+#include "functiontypeentry.h"
+#include "enumtypeentry.h"
+#include "smartpointertypeentry.h"
#include <codemodel.h>
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/namespacetypeentry.h b/sources/shiboken6/ApiExtractor/namespacetypeentry.h
new file mode 100644
index 000000000..84a224d04
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/namespacetypeentry.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef NAMESPACETYPEENTRY_H
+#define NAMESPACETYPEENTRY_H
+
+#include "complextypeentry.h"
+
+class NamespaceTypeEntryPrivate;
+
+class NamespaceTypeEntry : public ComplexTypeEntry
+{
+public:
+ explicit NamespaceTypeEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ TypeEntry *clone() const override;
+
+ const NamespaceTypeEntry *extends() const;
+ void setExtends(const NamespaceTypeEntry *e);
+
+ const QRegularExpression &filePattern() const; // restrict files
+ void setFilePattern(const QRegularExpression &r);
+
+ bool hasPattern() const;
+
+ bool matchesFile(const QString &needle) const;
+
+ bool isVisible() const;
+ void setVisibility(TypeSystem::Visibility v);
+
+ // C++ 11 inline namespace, from code model
+ bool isInlineNamespace() const;
+ void setInlineNamespace(bool i);
+
+ static bool isVisibleScope(const TypeEntry *e);
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+
+ // Whether to generate "using namespace" into wrapper
+ bool generateUsing() const;
+ void setGenerateUsing(bool generateUsing);
+
+protected:
+ explicit NamespaceTypeEntry(NamespaceTypeEntryPrivate *d);
+};
+
+#endif // NAMESPACETYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/objecttypeentry.h b/sources/shiboken6/ApiExtractor/objecttypeentry.h
new file mode 100644
index 000000000..57222bab5
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/objecttypeentry.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef OBJECTTYPEENTRY_H
+#define OBJECTTYPEENTRY_H
+
+#include "complextypeentry.h"
+
+class ObjectTypeEntry : public ComplexTypeEntry
+{
+public:
+ explicit ObjectTypeEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit ObjectTypeEntry(ComplexTypeEntryPrivate *d);
+};
+
+#endif // OBJECTTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/primitivetypeentry.h b/sources/shiboken6/ApiExtractor/primitivetypeentry.h
new file mode 100644
index 000000000..a0fc74c2f
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/primitivetypeentry.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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$
+**
+****************************************************************************/
+
+#ifndef PRIMITIVETYPEENTRY_H
+#define PRIMITIVETYPEENTRY_H
+
+#include "typesystem.h"
+
+class PrimitiveTypeEntryPrivate;
+
+/// A PrimitiveTypeEntry is user-defined type with conversion rules, a C++
+/// primitive type for which a PrimitiveTypeConverter exists in libshiboken
+/// or a typedef to a C++ primitive type as determined by AbstractMetaBuilder.
+class PrimitiveTypeEntry : public TypeEntry
+{
+public:
+ explicit PrimitiveTypeEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ QString defaultConstructor() const;
+ void setDefaultConstructor(const QString& defaultConstructor);
+ bool hasDefaultConstructor() const;
+
+ /**
+ * The PrimitiveTypeEntry pointed by this type entry if it
+ * represents a typedef).
+ * \return the type referenced by the typedef, or a null pointer
+ * if the current object is not an typedef
+ */
+ PrimitiveTypeEntry *referencedTypeEntry() const;
+
+ /**
+ * Defines type referenced by this entry.
+ * \param referencedTypeEntry type referenced by this entry
+ */
+ void setReferencedTypeEntry(PrimitiveTypeEntry* referencedTypeEntry);
+
+ /// Finds the most basic primitive type that the typedef represents,
+ /// i.e. a type that is not an typedef'ed.
+ /// \return the most basic non-typedef'ed primitive type represented
+ /// by this typedef or self in case it is not a reference.
+ const PrimitiveTypeEntry* basicReferencedTypeEntry() const;
+
+ /// Finds the basic primitive type that the typedef represents
+ /// and was explicitly specified in the type system.
+ /// \return the basic primitive type that was explicitly specified in
+ /// the type system.
+ const PrimitiveTypeEntry* basicReferencedNonBuiltinTypeEntry() const;
+
+ /// Returns whether this entry references another entry.
+ bool referencesType() const;
+
+ bool preferredTargetLangType() const;
+ void setPreferredTargetLangType(bool b);
+
+ TypeEntry *clone() const override;
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+
+protected:
+ explicit PrimitiveTypeEntry(PrimitiveTypeEntryPrivate *d);
+};
+
+#endif // PRIMITIVETYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/propertyspec.cpp b/sources/shiboken6/ApiExtractor/propertyspec.cpp
index b28d6ec71..d53206032 100644
--- a/sources/shiboken6/ApiExtractor/propertyspec.cpp
+++ b/sources/shiboken6/ApiExtractor/propertyspec.cpp
@@ -32,7 +32,7 @@
#include "abstractmetatype.h"
#include "codemodel.h"
#include "messages.h"
-#include "typesystem.h"
+#include "complextypeentry.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/pythontypeentry.h b/sources/shiboken6/ApiExtractor/pythontypeentry.h
new file mode 100644
index 000000000..d6de8d63a
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/pythontypeentry.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef PYTHONTYPEENTRY_H
+#define PYTHONTYPEENTRY_H
+
+#include "customtypenentry.h"
+
+class PythonTypeEntry : public CustomTypeEntry
+{
+public:
+ explicit PythonTypeEntry(const QString &entryName,
+ const QString &checkFunction,
+ TypeSystem::CPythonType type);
+
+ TypeEntry *clone() const override;
+
+ TypeSystem::CPythonType cPythonType() const;
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+
+protected:
+ explicit PythonTypeEntry(TypeEntryPrivate *d);
+};
+
+#endif // PYTHONTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/qtdocparser.cpp b/sources/shiboken6/ApiExtractor/qtdocparser.cpp
index 672451e35..0a9660983 100644
--- a/sources/shiboken6/ApiExtractor/qtdocparser.cpp
+++ b/sources/shiboken6/ApiExtractor/qtdocparser.cpp
@@ -37,7 +37,8 @@
#include "messages.h"
#include "propertyspec.h"
#include "reporthandler.h"
-#include "typesystem.h"
+#include "flagstypeentry.h"
+#include "complextypeentry.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/smartpointertypeentry.h b/sources/shiboken6/ApiExtractor/smartpointertypeentry.h
new file mode 100644
index 000000000..124b7ff03
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/smartpointertypeentry.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef SMARTPOINTERTYPEENTRY_H
+#define SMARTPOINTERTYPEENTRY_H
+
+#include "complextypeentry.h"
+
+class SmartPointerTypeEntryPrivate;
+
+class SmartPointerTypeEntry : public ComplexTypeEntry
+{
+public:
+ using Instantiations = QList<const TypeEntry *>;
+
+ explicit SmartPointerTypeEntry(const QString &entryName,
+ const QString &getterName,
+ TypeSystem::SmartPointerType type,
+ const QString &refCountMethodName,
+ const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ TypeSystem::SmartPointerType smartPointerType() const;
+
+ QString getter() const;
+
+ QString refCountMethodName() const;
+
+ QString valueCheckMethod() const;
+ void setValueCheckMethod(const QString &);
+ QString nullCheckMethod() const;
+ void setNullCheckMethod(const QString &);
+ QString resetMethod() const;
+ void setResetMethod(const QString &);
+
+ TypeEntry *clone() const override;
+
+ Instantiations instantiations() const;
+ void setInstantiations(const Instantiations &i);
+ bool matchesInstantiation(const TypeEntry *e) const;
+
+ static QString getTargetFullName(const AbstractMetaType &metaType,
+ bool includePackageName = true);
+ static QString getTargetName(const AbstractMetaType &metaType);
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+protected:
+ SmartPointerTypeEntry(SmartPointerTypeEntryPrivate *d);
+};
+
+#endif // SMARTPOINTERTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/templateargumententry.h b/sources/shiboken6/ApiExtractor/templateargumententry.h
new file mode 100644
index 000000000..0eda2d767
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/templateargumententry.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef TEMPLATEARGUMENTENTRY_H
+#define TEMPLATEARGUMENTENTRY_H
+
+#include "typesystem.h"
+
+class TemplateArgumentEntryPrivate;
+
+class TemplateArgumentEntry : public TypeEntry
+{
+public:
+ explicit TemplateArgumentEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ int ordinal() const;
+ void setOrdinal(int o);
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit TemplateArgumentEntry(TemplateArgumentEntryPrivate *d);
+};
+
+#endif // TEMPLATEARGUMENTENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/tests/testaddfunction.cpp b/sources/shiboken6/ApiExtractor/tests/testaddfunction.cpp
index d23e7b399..f84f8cf96 100644
--- a/sources/shiboken6/ApiExtractor/tests/testaddfunction.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testaddfunction.cpp
@@ -32,7 +32,8 @@
#include <abstractmetalang.h>
#include <modifications.h>
#include <modifications_p.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <primitivetypeentry.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testarrayargument.cpp b/sources/shiboken6/ApiExtractor/tests/testarrayargument.cpp
index a03ec1954..1951a7408 100644
--- a/sources/shiboken6/ApiExtractor/tests/testarrayargument.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testarrayargument.cpp
@@ -31,7 +31,7 @@
#include <abstractmetaenum.h>
#include <abstractmetafunction.h>
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <primitivetypeentry.h>
#include <parser/enumvalue.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testcodeinjection.cpp b/sources/shiboken6/ApiExtractor/tests/testcodeinjection.cpp
index 321299fa0..e6dbe156d 100644
--- a/sources/shiboken6/ApiExtractor/tests/testcodeinjection.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testcodeinjection.cpp
@@ -31,7 +31,7 @@
#include <abstractmetalang.h>
#include <modifications.h>
#include <textstream.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testcontainer.cpp b/sources/shiboken6/ApiExtractor/tests/testcontainer.cpp
index 4027e58bf..b9549e241 100644
--- a/sources/shiboken6/ApiExtractor/tests/testcontainer.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testcontainer.cpp
@@ -31,7 +31,8 @@
#include "testutil.h"
#include <abstractmetalang.h>
#include <abstractmetatype.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <containertypeentry.h>
void TestContainer::testContainerType()
{
diff --git a/sources/shiboken6/ApiExtractor/tests/testconversionruletag.cpp b/sources/shiboken6/ApiExtractor/tests/testconversionruletag.cpp
index 8d1de5940..aa6c636ab 100644
--- a/sources/shiboken6/ApiExtractor/tests/testconversionruletag.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testconversionruletag.cpp
@@ -29,7 +29,9 @@
#include "testconversionruletag.h"
#include "testutil.h"
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <customconversion.h>
+#include <primitivetypeentry.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testenum.cpp b/sources/shiboken6/ApiExtractor/tests/testenum.cpp
index 0370e884d..2cf098933 100644
--- a/sources/shiboken6/ApiExtractor/tests/testenum.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testenum.cpp
@@ -32,7 +32,8 @@
#include <abstractmetafunction.h>
#include <abstractmetalang.h>
#include <abstractmetabuilder_p.h>
-#include <typesystem.h>
+#include <enumtypeentry.h>
+#include <flagstypeentry.h>
#include <parser/enumvalue.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testextrainclude.cpp b/sources/shiboken6/ApiExtractor/tests/testextrainclude.cpp
index bc19384a3..9b312166f 100644
--- a/sources/shiboken6/ApiExtractor/tests/testextrainclude.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testextrainclude.cpp
@@ -30,7 +30,8 @@
#include <QtTest/QTest>
#include "testutil.h"
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <typesystemtypeentry.h>
void TestExtraInclude::testClassExtraInclude()
{
diff --git a/sources/shiboken6/ApiExtractor/tests/testimplicitconversions.cpp b/sources/shiboken6/ApiExtractor/tests/testimplicitconversions.cpp
index 59cba70d2..d2e928ff7 100644
--- a/sources/shiboken6/ApiExtractor/tests/testimplicitconversions.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testimplicitconversions.cpp
@@ -30,7 +30,7 @@
#include "testutil.h"
#include <abstractmetafunction.h>
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
#include <QtTest/QTest>
void TestImplicitConversions::testWithPrivateCtors()
diff --git a/sources/shiboken6/ApiExtractor/tests/testinserttemplate.cpp b/sources/shiboken6/ApiExtractor/tests/testinserttemplate.cpp
index 1d33ee884..26e06070a 100644
--- a/sources/shiboken6/ApiExtractor/tests/testinserttemplate.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testinserttemplate.cpp
@@ -31,7 +31,8 @@
#include "testutil.h"
#include <abstractmetalang.h>
#include <modifications.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <typesystemtypeentry.h>
void TestInsertTemplate::testInsertTemplateOnClassInjectCode()
{
diff --git a/sources/shiboken6/ApiExtractor/tests/testmodifydocumentation.cpp b/sources/shiboken6/ApiExtractor/tests/testmodifydocumentation.cpp
index fcfc506af..6e03ea665 100644
--- a/sources/shiboken6/ApiExtractor/tests/testmodifydocumentation.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testmodifydocumentation.cpp
@@ -31,7 +31,7 @@
#include <abstractmetalang.h>
#include <documentation.h>
#include <modifications.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
#include <qtdocparser.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testnestedtypes.cpp b/sources/shiboken6/ApiExtractor/tests/testnestedtypes.cpp
index 4df8ddaf3..e5f6b547d 100644
--- a/sources/shiboken6/ApiExtractor/tests/testnestedtypes.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testnestedtypes.cpp
@@ -31,7 +31,8 @@
#include <abstractmetafunction.h>
#include <abstractmetalang.h>
#include <modifications.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <primitivetypeentry.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testprimitivetypetag.cpp b/sources/shiboken6/ApiExtractor/tests/testprimitivetypetag.cpp
index 698c2206a..d16ba594d 100644
--- a/sources/shiboken6/ApiExtractor/tests/testprimitivetypetag.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testprimitivetypetag.cpp
@@ -29,7 +29,7 @@
#include "testprimitivetypetag.h"
#include "testutil.h"
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <primitivetypeentry.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testremoveimplconv.cpp b/sources/shiboken6/ApiExtractor/tests/testremoveimplconv.cpp
index 0da6304a3..838c548c1 100644
--- a/sources/shiboken6/ApiExtractor/tests/testremoveimplconv.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testremoveimplconv.cpp
@@ -31,7 +31,7 @@
#include <QtTest/QTest>
#include <abstractmetafunction.h>
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
// When a constructor able to trigger implicity conversions is removed
// it should not appear in the implicity conversion list.
diff --git a/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp b/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp
index f06ae4eb2..ddf9f7920 100644
--- a/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp
@@ -31,7 +31,7 @@
#include <abstractmetafunction.h>
#include <abstractmetalang.h>
#include <abstractmetatype.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp b/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp
index eb0dc2d01..9c5e23503 100644
--- a/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testtemplates.cpp
@@ -31,7 +31,8 @@
#include <abstractmetafield.h>
#include <abstractmetafunction.h>
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <containertypeentry.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testtyperevision.cpp b/sources/shiboken6/ApiExtractor/tests/testtyperevision.cpp
index 2302916ac..604a42a31 100644
--- a/sources/shiboken6/ApiExtractor/tests/testtyperevision.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testtyperevision.cpp
@@ -30,7 +30,9 @@
#include "testutil.h"
#include <abstractmetaenum.h>
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <enumtypeentry.h>
+#include <flagstypeentry.h>
#include <typedatabase.h>
#include <qtcompat.h>
diff --git a/sources/shiboken6/ApiExtractor/tests/testvaluetypedefaultctortag.cpp b/sources/shiboken6/ApiExtractor/tests/testvaluetypedefaultctortag.cpp
index c49f7811b..34be8dccd 100644
--- a/sources/shiboken6/ApiExtractor/tests/testvaluetypedefaultctortag.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testvaluetypedefaultctortag.cpp
@@ -30,7 +30,7 @@
#include <QtTest/QTest>
#include "testutil.h"
#include <abstractmetalang.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
void TestValueTypeDefaultCtorTag::testValueTypeDefaultCtorTagArgument()
{
diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp
index 6b50ace69..2a77a5288 100644
--- a/sources/shiboken6/ApiExtractor/typedatabase.cpp
+++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp
@@ -30,11 +30,32 @@
#include "abstractmetatype.h"
#include "exception.h"
#include "messages.h"
-#include "typesystem.h"
#include "typesystemparser_p.h"
+#include "arraytypeentry.h"
+#include "complextypeentry.h"
+#include "constantvaluetypeentry.h"
+#include "containertypeentry.h"
+#include "customconversion.h"
+#include "customtypenentry.h"
+#include "enumtypeentry.h"
+#include "enumvaluetypeentry.h"
+#include "flagstypeentry.h"
+#include "functiontypeentry.h"
+#include "namespacetypeentry.h"
+#include "objecttypeentry.h"
+#include "primitivetypeentry.h"
+#include "pythontypeentry.h"
+#include "smartpointertypeentry.h"
+#include "templateargumententry.h"
+#include "typedefentry.h"
+#include "typesystemtypeentry.h"
+#include "valuetypeentry.h"
+#include "varargstypeentry.h"
+#include "voidtypeentry.h"
#include "conditionalstreamreader.h"
#include "predefined_templates.h"
#include "clangparser/compilersupport.h"
+#include "modifications.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/ApiExtractor/typedefentry.h b/sources/shiboken6/ApiExtractor/typedefentry.h
new file mode 100644
index 000000000..7c5953a8f
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/typedefentry.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef TYPEDEFENTRY_H
+#define TYPEDEFENTRY_H
+
+#include "complextypeentry.h"
+
+class TypedefEntryPrivate;
+
+class TypedefEntry : public ComplexTypeEntry
+{
+public:
+ explicit TypedefEntry(const QString &entryName,
+ const QString &sourceType,
+ const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ QString sourceType() const;
+ void setSourceType(const QString &s);
+
+ TypeEntry *clone() const override;
+
+ const ComplexTypeEntry *source() const;
+ void setSource(const ComplexTypeEntry *source);
+
+ ComplexTypeEntry *target() const;
+ void setTarget(ComplexTypeEntry *target);
+
+#ifndef QT_NO_DEBUG_STREAM
+ void formatDebug(QDebug &d) const override;
+#endif
+protected:
+ explicit TypedefEntry(TypedefEntryPrivate *d);
+};
+
+#endif // TYPEDEFENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/typesystem.cpp b/sources/shiboken6/ApiExtractor/typesystem.cpp
index cc5f9469e..7f11e0f64 100644
--- a/sources/shiboken6/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystem.cpp
@@ -27,6 +27,27 @@
****************************************************************************/
#include "typesystem.h"
+#include "arraytypeentry.h"
+#include "complextypeentry.h"
+#include "constantvaluetypeentry.h"
+#include "containertypeentry.h"
+#include "customconversion.h"
+#include "customtypenentry.h"
+#include "enumtypeentry.h"
+#include "enumvaluetypeentry.h"
+#include "flagstypeentry.h"
+#include "functiontypeentry.h"
+#include "namespacetypeentry.h"
+#include "objecttypeentry.h"
+#include "primitivetypeentry.h"
+#include "pythontypeentry.h"
+#include "smartpointertypeentry.h"
+#include "templateargumententry.h"
+#include "typedefentry.h"
+#include "typesystemtypeentry.h"
+#include "valuetypeentry.h"
+#include "varargstypeentry.h"
+#include "voidtypeentry.h"
#include "abstractmetatype.h"
#include "typedatabase.h"
#include "modifications.h"
diff --git a/sources/shiboken6/ApiExtractor/typesystem.h b/sources/shiboken6/ApiExtractor/typesystem.h
index 42ca4ac13..951fe7ce2 100644
--- a/sources/shiboken6/ApiExtractor/typesystem.h
+++ b/sources/shiboken6/ApiExtractor/typesystem.h
@@ -33,56 +33,23 @@
#include "typesystem_typedefs.h"
#include "include.h"
-#include <QtCore/QStringList>
+#include <QtCore/QString>
#include <QtCore/QScopedPointer>
-#include <QtCore/QSet>
class AbstractMetaType;
-class CustomFunction;
class CustomConversion;
-class EnumValueTypeEntry;
-class FlagsTypeEntry;
-class SourceLocation;
+class CustomTypeEntry;
class PrimitiveTypeEntry;
+class SourceLocation;
class TypeSystemTypeEntry;
-class CustomTypeEntry;
class TypeEntryPrivate;
-class TemplateArgumentEntryPrivate;
-class ArrayTypeEntryPrivate;
-class PrimitiveTypeEntryPrivate;
-class EnumTypeEntryPrivate;
-class EnumValueTypeEntryPrivate;
-class FlagsTypeEntryPrivate;
-class ComplexTypeEntryPrivate;
-class TypedefEntryPrivate;
-class ContainerTypeEntryPrivate;
-class SmartPointerTypeEntryPrivate;
-class NamespaceTypeEntryPrivate;
-class FunctionTypeEntryPrivate;
-struct TargetToNativeConversionPrivate;
QT_BEGIN_NAMESPACE
class QDebug;
-class QRegularExpression;
-class QTextStream;
class QVersionNumber;
QT_END_NAMESPACE
-struct TypeSystemProperty
-{
- bool isValid() const { return !name.isEmpty() && !read.isEmpty() && !type.isEmpty(); }
-
- QString type;
- QString name;
- QString read;
- QString write;
- QString reset;
- QString designable;
- // Indicates whether actual code is generated instead of relying on libpyside.
- bool generateGetSetDef = false;
-};
-
class TypeEntry
{
Q_GADGET
@@ -293,616 +260,4 @@ private:
QScopedPointer<TypeEntryPrivate> m_d;
};
-class CustomTypeEntry : public TypeEntry
-{
-public:
- explicit CustomTypeEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- TypeEntry *clone() const override;
-
- bool hasCheckFunction() const;
- QString checkFunction() const;
- void setCheckFunction(const QString &f);
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-
-protected:
- explicit CustomTypeEntry(TypeEntryPrivate *d);
-};
-
-class PythonTypeEntry : public CustomTypeEntry
-{
-public:
- explicit PythonTypeEntry(const QString &entryName,
- const QString &checkFunction,
- TypeSystem::CPythonType type);
-
- TypeEntry *clone() const override;
-
- TypeSystem::CPythonType cPythonType() const;
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-
-protected:
- explicit PythonTypeEntry(TypeEntryPrivate *d);
-};
-
-class TypeSystemTypeEntry : public TypeEntry
-{
-public:
- explicit TypeSystemTypeEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- TypeEntry *clone() const override;
-
- TypeSystem::SnakeCase snakeCase() const;
- void setSnakeCase(TypeSystem::SnakeCase sc);
-
-protected:
- explicit TypeSystemTypeEntry(TypeEntryPrivate *d);
-};
-
-class VoidTypeEntry : public TypeEntry
-{
-public:
- VoidTypeEntry();
-
- TypeEntry *clone() const override;
-
-protected:
- explicit VoidTypeEntry(TypeEntryPrivate *d);
-};
-
-class VarargsTypeEntry : public TypeEntry
-{
-public:
- VarargsTypeEntry();
-
- TypeEntry *clone() const override;
-
-protected:
- explicit VarargsTypeEntry(TypeEntryPrivate *d);
-};
-
-class TemplateArgumentEntry : public TypeEntry
-{
-public:
- explicit TemplateArgumentEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- int ordinal() const;
- void setOrdinal(int o);
-
- TypeEntry *clone() const override;
-
-protected:
- explicit TemplateArgumentEntry(TemplateArgumentEntryPrivate *d);
-};
-
-class ArrayTypeEntry : public TypeEntry
-{
-public:
- explicit ArrayTypeEntry(const TypeEntry *nested_type, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- void setNestedTypeEntry(TypeEntry *nested);
- const TypeEntry *nestedTypeEntry() const;
-
- TypeEntry *clone() const override;
-
-protected:
- explicit ArrayTypeEntry(ArrayTypeEntryPrivate *d);
-
- QString buildTargetLangName() const override;
-};
-
-/// A PrimitiveTypeEntry is user-defined type with conversion rules, a C++
-/// primitive type for which a PrimitiveTypeConverter exists in libshiboken
-/// or a typedef to a C++ primitive type as determined by AbstractMetaBuilder.
-class PrimitiveTypeEntry : public TypeEntry
-{
-public:
- explicit PrimitiveTypeEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- QString defaultConstructor() const;
- void setDefaultConstructor(const QString& defaultConstructor);
- bool hasDefaultConstructor() const;
-
- /**
- * The PrimitiveTypeEntry pointed by this type entry if it
- * represents a typedef).
- * \return the type referenced by the typedef, or a null pointer
- * if the current object is not an typedef
- */
- PrimitiveTypeEntry *referencedTypeEntry() const;
-
- /**
- * Defines type referenced by this entry.
- * \param referencedTypeEntry type referenced by this entry
- */
- void setReferencedTypeEntry(PrimitiveTypeEntry* referencedTypeEntry);
-
- /// Finds the most basic primitive type that the typedef represents,
- /// i.e. a type that is not an typedef'ed.
- /// \return the most basic non-typedef'ed primitive type represented
- /// by this typedef or self in case it is not a reference.
- const PrimitiveTypeEntry* basicReferencedTypeEntry() const;
-
- /// Finds the basic primitive type that the typedef represents
- /// and was explicitly specified in the type system.
- /// \return the basic primitive type that was explicitly specified in
- /// the type system.
- const PrimitiveTypeEntry* basicReferencedNonBuiltinTypeEntry() const;
-
- /// Returns whether this entry references another entry.
- bool referencesType() const;
-
- bool preferredTargetLangType() const;
- void setPreferredTargetLangType(bool b);
-
- TypeEntry *clone() const override;
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-
-protected:
- explicit PrimitiveTypeEntry(PrimitiveTypeEntryPrivate *d);
-};
-
-class EnumTypeEntry : public TypeEntry
-{
-public:
- explicit EnumTypeEntry(const QString &entryName,
- const QVersionNumber &vr,
- const TypeEntry *parent);
-
- QString targetLangQualifier() const;
-
- QString qualifier() const;
-
- const EnumValueTypeEntry *nullValue() const;
- void setNullValue(const EnumValueTypeEntry *n);
-
- void setFlags(FlagsTypeEntry *flags);
- FlagsTypeEntry *flags() const;
-
- bool isEnumValueRejected(const QString &name) const;
- void addEnumValueRejection(const QString &name);
- QStringList enumValueRejections() const;
-
- TypeEntry *clone() const override;
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-protected:
- explicit EnumTypeEntry(EnumTypeEntryPrivate *d);
-};
-
-// EnumValueTypeEntry is used for resolving integer type templates
-// like array<EnumValue>. Note: Dummy entries for integer values will
-// be created for non-type template parameters, where m_enclosingEnum==nullptr.
-class EnumValueTypeEntry : public TypeEntry
-{
-public:
- explicit EnumValueTypeEntry(const QString& name, const QString& value,
- const EnumTypeEntry* enclosingEnum,
- bool isScopedEnum, const QVersionNumber &vr);
-
- QString value() const;
- const EnumTypeEntry* enclosingEnum() const;
-
- TypeEntry *clone() const override;
-
-protected:
- explicit EnumValueTypeEntry(EnumValueTypeEntryPrivate *d);
-};
-
-class FlagsTypeEntry : public TypeEntry
-{
-public:
- explicit FlagsTypeEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- QString originalName() const;
- void setOriginalName(const QString &s);
-
- QString flagsName() const;
- void setFlagsName(const QString &name);
-
- EnumTypeEntry *originator() const;
- void setOriginator(EnumTypeEntry *e);
-
- TypeEntry *clone() const override;
-
-protected:
- explicit FlagsTypeEntry(FlagsTypeEntryPrivate *d);
-
- QString buildTargetLangName() const override;
-};
-
-// For primitive values, typically to provide a dummy type for
-// example the '2' in non-type template 'Array<2>'.
-class ConstantValueTypeEntry : public TypeEntry
-{
-public:
- explicit ConstantValueTypeEntry(const QString& name,
- const TypeEntry *parent);
-
- TypeEntry *clone() const override;
-
-protected:
- explicit ConstantValueTypeEntry(TypeEntryPrivate *d);
-};
-
-class ComplexTypeEntry : public TypeEntry
-{
-public:
- enum TypeFlag {
- DisableWrapper = 0x1,
- Deprecated = 0x4,
- ForceAbstract = 0x8
- };
- Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
-
- enum CopyableFlag {
- CopyableSet,
- NonCopyableSet,
- Unknown
- };
-
- explicit ComplexTypeEntry(const QString &entryName, Type t, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- bool isComplex() const override;
-
- TypeFlags typeFlags() const;
- void setTypeFlags(TypeFlags flags);
-
- // Override command line options to generate nb_bool from
- // operator bool or method isNull().
- TypeSystem::BoolCast operatorBoolMode() const;
- void setOperatorBoolMode(TypeSystem::BoolCast b);
- TypeSystem::BoolCast isNullMode() const;
- void setIsNullMode(TypeSystem::BoolCast b);
-
- FunctionModificationList functionModifications() const;
- void setFunctionModifications(const FunctionModificationList &functionModifications);
- void addFunctionModification(const FunctionModification &functionModification);
- FunctionModificationList functionModifications(const QString &signature) const;
-
- AddedFunctionList addedFunctions() const;
- void setAddedFunctions(const AddedFunctionList &addedFunctions);
- void addNewFunction(const AddedFunctionPtr &addedFunction);
-
- // Functions specified in the "generate-functions" attribute
- const QSet<QString> &generateFunctions() const;
- void setGenerateFunctions(const QSet<QString> &f);
-
- void setFieldModifications(const FieldModificationList &mods);
- FieldModificationList fieldModifications() const;
-
- const QList<TypeSystemProperty> &properties() const;
- void addProperty(const TypeSystemProperty &p);
-
- QString defaultSuperclass() const;
- void setDefaultSuperclass(const QString &sc);
-
- QString qualifiedCppName() const override;
-
- void setIsPolymorphicBase(bool on);
- bool isPolymorphicBase() const;
-
- void setPolymorphicIdValue(const QString &value);
- QString polymorphicIdValue() const;
-
- QString polymorphicNameFunction() const;
- void setPolymorphicNameFunction(const QString &n);
-
- QString targetType() const;
- void setTargetType(const QString &code);
-
- bool isGenericClass() const;
- void setGenericClass(bool isGeneric);
-
- bool deleteInMainThread() const;
- void setDeleteInMainThread(bool d);
-
- CopyableFlag copyable() const;
- void setCopyable(CopyableFlag flag);
-
- TypeSystem::QtMetaTypeRegistration qtMetaTypeRegistration() const;
- void setQtMetaTypeRegistration(TypeSystem::QtMetaTypeRegistration r);
-
- QString hashFunction() const;
- void setHashFunction(const QString &hashFunction);
-
- void setBaseContainerType(const ComplexTypeEntry *baseContainer);
-
- const ComplexTypeEntry *baseContainerType() const;
-
- TypeSystem::ExceptionHandling exceptionHandling() const;
- void setExceptionHandling(TypeSystem::ExceptionHandling e);
-
- TypeSystem::AllowThread allowThread() const;
- void setAllowThread(TypeSystem::AllowThread allowThread);
-
- QString defaultConstructor() const;
- void setDefaultConstructor(const QString& defaultConstructor);
- bool hasDefaultConstructor() const;
-
- TypeEntry *clone() const override;
-
- void useAsTypedef(const ComplexTypeEntry *source);
-
- TypeSystem::SnakeCase snakeCase() const;
- void setSnakeCase(TypeSystem::SnakeCase sc);
-
- // Determined by AbstractMetaBuilder from the code model.
- bool isValueTypeWithCopyConstructorOnly() const;
- void setValueTypeWithCopyConstructorOnly(bool v);
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &debug) const override;
-#endif
-protected:
- explicit ComplexTypeEntry(ComplexTypeEntryPrivate *d);
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(ComplexTypeEntry::TypeFlags)
-
-class TypedefEntry : public ComplexTypeEntry
-{
-public:
- explicit TypedefEntry(const QString &entryName,
- const QString &sourceType,
- const QVersionNumber &vr,
- const TypeEntry *parent);
-
- QString sourceType() const;
- void setSourceType(const QString &s);
-
- TypeEntry *clone() const override;
-
- const ComplexTypeEntry *source() const;
- void setSource(const ComplexTypeEntry *source);
-
- ComplexTypeEntry *target() const;
- void setTarget(ComplexTypeEntry *target);
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-protected:
- explicit TypedefEntry(TypedefEntryPrivate *d);
-};
-
-class ContainerTypeEntry : public ComplexTypeEntry
-{
- Q_GADGET
-public:
- struct OpaqueContainer // Generate an opaque container for an instantiation under name
- {
- QString instantiation;
- QString name;
- };
- using OpaqueContainers = QList<OpaqueContainer>;
-
- enum ContainerKind {
- ListContainer,
- SetContainer,
- MapContainer,
- MultiMapContainer,
- PairContainer,
- };
- Q_ENUM(ContainerKind)
-
- explicit ContainerTypeEntry(const QString &entryName, ContainerKind containerKind,
- const QVersionNumber &vr, const TypeEntry *parent);
-
- ContainerKind containerKind() const;
-
- const OpaqueContainers &opaqueContainers() const;
- void addOpaqueContainer(OpaqueContainer r);
- bool generateOpaqueContainer(const QString &instantiation) const;
- QString opaqueContainerName(const QString &instantiation) const;
-
- TypeEntry *clone() const override;
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-protected:
- explicit ContainerTypeEntry(ContainerTypeEntryPrivate *d);
-};
-
-class SmartPointerTypeEntry : public ComplexTypeEntry
-{
-public:
- using Instantiations = QList<const TypeEntry *>;
-
- explicit SmartPointerTypeEntry(const QString &entryName,
- const QString &getterName,
- TypeSystem::SmartPointerType type,
- const QString &refCountMethodName,
- const QVersionNumber &vr,
- const TypeEntry *parent);
-
- TypeSystem::SmartPointerType smartPointerType() const;
-
- QString getter() const;
-
- QString refCountMethodName() const;
-
- QString valueCheckMethod() const;
- void setValueCheckMethod(const QString &);
- QString nullCheckMethod() const;
- void setNullCheckMethod(const QString &);
- QString resetMethod() const;
- void setResetMethod(const QString &);
-
- TypeEntry *clone() const override;
-
- Instantiations instantiations() const;
- void setInstantiations(const Instantiations &i);
- bool matchesInstantiation(const TypeEntry *e) const;
-
- static QString getTargetFullName(const AbstractMetaType &metaType,
- bool includePackageName = true);
- static QString getTargetName(const AbstractMetaType &metaType);
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-protected:
- SmartPointerTypeEntry(SmartPointerTypeEntryPrivate *d);
-};
-
-class NamespaceTypeEntry : public ComplexTypeEntry
-{
-public:
- explicit NamespaceTypeEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- TypeEntry *clone() const override;
-
- const NamespaceTypeEntry *extends() const;
- void setExtends(const NamespaceTypeEntry *e);
-
- const QRegularExpression &filePattern() const; // restrict files
- void setFilePattern(const QRegularExpression &r);
-
- bool hasPattern() const;
-
- bool matchesFile(const QString &needle) const;
-
- bool isVisible() const;
- void setVisibility(TypeSystem::Visibility v);
-
- // C++ 11 inline namespace, from code model
- bool isInlineNamespace() const;
- void setInlineNamespace(bool i);
-
- static bool isVisibleScope(const TypeEntry *e);
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-
- // Whether to generate "using namespace" into wrapper
- bool generateUsing() const;
- void setGenerateUsing(bool generateUsing);
-
-protected:
- explicit NamespaceTypeEntry(NamespaceTypeEntryPrivate *d);
-};
-
-class ValueTypeEntry : public ComplexTypeEntry
-{
-public:
- explicit ValueTypeEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- bool isValue() const override;
-
- TypeEntry *clone() const override;
-
-protected:
- explicit ValueTypeEntry(const QString &entryName, Type t, const QVersionNumber &vr,
- const TypeEntry *parent);
- explicit ValueTypeEntry(ComplexTypeEntryPrivate *d);
-};
-
-class FunctionTypeEntry : public TypeEntry
-{
-public:
- explicit FunctionTypeEntry(const QString& name, const QString& signature,
- const QVersionNumber &vr,
- const TypeEntry *parent);
-
- const QStringList &signatures() const;
- bool hasSignature(const QString& signature) const;
- void addSignature(const QString& signature);
-
- TypeSystem::SnakeCase snakeCase() const;
- void setSnakeCase(TypeSystem::SnakeCase sc);
-
- TypeEntry *clone() const override;
-
-#ifndef QT_NO_DEBUG_STREAM
- void formatDebug(QDebug &d) const override;
-#endif
-
-protected:
- explicit FunctionTypeEntry(FunctionTypeEntryPrivate *d);
-};
-
-class ObjectTypeEntry : public ComplexTypeEntry
-{
-public:
- explicit ObjectTypeEntry(const QString &entryName, const QVersionNumber &vr,
- const TypeEntry *parent);
-
- TypeEntry *clone() const override;
-
-protected:
- explicit ObjectTypeEntry(ComplexTypeEntryPrivate *d);
-};
-
-class CustomConversion
-{
-public:
- CustomConversion(TypeEntry* ownerType);
- ~CustomConversion();
-
- const TypeEntry* ownerType() const;
- QString nativeToTargetConversion() const;
- void setNativeToTargetConversion(const QString& nativeToTargetConversion);
-
- class TargetToNativeConversion
- {
- public:
- TargetToNativeConversion(const QString& sourceTypeName,
- const QString& sourceTypeCheck,
- const QString& conversion = QString());
- ~TargetToNativeConversion();
-
- const TypeEntry* sourceType() const;
- void setSourceType(const TypeEntry* sourceType);
- bool isCustomType() const;
- QString sourceTypeName() const;
- QString sourceTypeCheck() const;
- QString conversion() const;
- void setConversion(const QString& conversion);
- private:
- struct TargetToNativeConversionPrivate;
- TargetToNativeConversionPrivate* m_d;
- };
-
- /**
- * Returns true if the target to C++ custom conversions should
- * replace the original existing ones, and false if the custom
- * conversions should be added to the original.
- */
- bool replaceOriginalTargetToNativeConversions() const;
- void setReplaceOriginalTargetToNativeConversions(bool replaceOriginalTargetToNativeConversions);
-
- using TargetToNativeConversions = QList<TargetToNativeConversion *>;
- bool hasTargetToNativeConversions() const;
- TargetToNativeConversions& targetToNativeConversions();
- const TargetToNativeConversions& targetToNativeConversions() const;
- void addTargetToNativeConversion(const QString& sourceTypeName,
- const QString& sourceTypeCheck,
- const QString& conversion = QString());
-private:
- struct CustomConversionPrivate;
- CustomConversionPrivate* m_d;
-};
-
#endif // TYPESYSTEM_H
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index 46d58217b..ec59b5e86 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -27,6 +27,24 @@
****************************************************************************/
#include "typesystemparser_p.h"
+#include "enumtypeentry.h"
+#include "enumvaluetypeentry.h"
+#include "arraytypeentry.h"
+#include "constantvaluetypeentry.h"
+#include "containertypeentry.h"
+#include "customconversion.h"
+#include "customtypenentry.h"
+#include "enumtypeentry.h"
+#include "flagstypeentry.h"
+#include "functiontypeentry.h"
+#include "namespacetypeentry.h"
+#include "objecttypeentry.h"
+#include "primitivetypeentry.h"
+#include "smartpointertypeentry.h"
+#include "templateargumententry.h"
+#include "typedefentry.h"
+#include "typesystemtypeentry.h"
+#include "valuetypeentry.h"
#include "typedatabase.h"
#include "messages.h"
#include "reporthandler.h"
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser_p.h b/sources/shiboken6/ApiExtractor/typesystemparser_p.h
index 4d6ab2b11..99dcac5cb 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser_p.h
+++ b/sources/shiboken6/ApiExtractor/typesystemparser_p.h
@@ -46,6 +46,12 @@ class ConditionalStreamReader;
class TypeSystemEntityResolver;
class TypeDatabase;
+
+class FlagsTypeEntry;
+class TypeSystemTypeEntry;
+class ValueTypeEntry;
+class EnumTypeEntry;
+
enum class ParserState;
enum class StackElement {
diff --git a/sources/shiboken6/ApiExtractor/typesystemtypeentry.h b/sources/shiboken6/ApiExtractor/typesystemtypeentry.h
new file mode 100644
index 000000000..9c8a12841
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/typesystemtypeentry.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef TYPESYSTEMTYPEENTRY_H
+#define TYPESYSTEMTYPEENTRY_H
+
+#include "typesystem.h"
+
+class TypeSystemTypeEntry : public TypeEntry
+{
+public:
+ explicit TypeSystemTypeEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ TypeEntry *clone() const override;
+
+ TypeSystem::SnakeCase snakeCase() const;
+ void setSnakeCase(TypeSystem::SnakeCase sc);
+
+protected:
+ explicit TypeSystemTypeEntry(TypeEntryPrivate *d);
+};
+
+#endif // TYPESYSTEMTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/valuetypeentry.h b/sources/shiboken6/ApiExtractor/valuetypeentry.h
new file mode 100644
index 000000000..28e8bbe35
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/valuetypeentry.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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$
+**
+****************************************************************************/
+
+#ifndef VALUETYPEENTRY_H
+#define VALUETYPEENTRY_H
+
+#include "complextypeentry.h"
+
+class ValueTypeEntry : public ComplexTypeEntry
+{
+public:
+ explicit ValueTypeEntry(const QString &entryName, const QVersionNumber &vr,
+ const TypeEntry *parent);
+
+ bool isValue() const override;
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit ValueTypeEntry(const QString &entryName, Type t, const QVersionNumber &vr,
+ const TypeEntry *parent);
+ explicit ValueTypeEntry(ComplexTypeEntryPrivate *d);
+};
+
+#endif // VALUETYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/varargstypeentry.h b/sources/shiboken6/ApiExtractor/varargstypeentry.h
new file mode 100644
index 000000000..9621b9457
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/varargstypeentry.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef VARARGSTYPEENTRY_H
+#define VARARGSTYPEENTRY_H
+
+#include "typesystem.h"
+
+class VarargsTypeEntry : public TypeEntry
+{
+public:
+ VarargsTypeEntry();
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit VarargsTypeEntry(TypeEntryPrivate *d);
+};
+
+#endif // VARARGSTYPEENTRY_H
diff --git a/sources/shiboken6/ApiExtractor/voidtypeentry.h b/sources/shiboken6/ApiExtractor/voidtypeentry.h
new file mode 100644
index 000000000..7ddae0189
--- /dev/null
+++ b/sources/shiboken6/ApiExtractor/voidtypeentry.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 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$
+**
+****************************************************************************/
+
+#ifndef VOIDTYPEENTRY_H
+#define VOIDTYPEENTRY_H
+
+#include "typesystem.h"
+
+class VoidTypeEntry : public TypeEntry
+{
+public:
+ VoidTypeEntry();
+
+ TypeEntry *clone() const override;
+
+protected:
+ explicit VoidTypeEntry(TypeEntryPrivate *d);
+};
+
+#endif // VOIDTYPEENTRY_H
diff --git a/sources/shiboken6/generator/generator.cpp b/sources/shiboken6/generator/generator.cpp
index 9e1c251e6..875c2892d 100644
--- a/sources/shiboken6/generator/generator.cpp
+++ b/sources/shiboken6/generator/generator.cpp
@@ -36,7 +36,12 @@
#include "reporthandler.h"
#include "fileout.h"
#include "apiextractor.h"
-#include "typesystem.h"
+#include "arraytypeentry.h"
+#include "enumtypeentry.h"
+#include "enumvaluetypeentry.h"
+#include "namespacetypeentry.h"
+#include "primitivetypeentry.h"
+#include "typesystemtypeentry.h"
#include <typedatabase.h>
#include "qtcompat.h"
diff --git a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp
index e47c51488..ed1c0ee12 100644
--- a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp
@@ -44,7 +44,9 @@
#include <reporthandler.h>
#include <textstream.h>
#include <typedatabase.h>
-#include <typesystem.h>
+#include <functiontypeentry.h>
+#include <enumtypeentry.h>
+#include <complextypeentry.h>
#include <qtdocparser.h>
#include <doxygenparser.h>
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
index 0b3a80f95..6a313349e 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp
@@ -47,6 +47,14 @@
#include <sourcelocation.h>
#include <textstream.h>
#include <typedatabase.h>
+#include <containertypeentry.h>
+#include <enumtypeentry.h>
+#include <flagstypeentry.h>
+#include <functiontypeentry.h>
+#include <namespacetypeentry.h>
+#include <primitivetypeentry.h>
+#include <smartpointertypeentry.h>
+#include <typesystemtypeentry.h>
#include <parser/enumvalue.h>
#include "qtcompat.h"
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.h b/sources/shiboken6/generator/shiboken/cppgenerator.h
index 6b1df070a..d245d9a17 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator.h
+++ b/sources/shiboken6/generator/shiboken/cppgenerator.h
@@ -31,6 +31,7 @@
#include "shibokengenerator.h"
#include "abstractmetalang_enums.h"
+#include "include.h"
#include <QtCore/QFlags>
#include <QtCore/QSharedPointer>
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator_container.cpp b/sources/shiboken6/generator/shiboken/cppgenerator_container.cpp
index 64784afe1..6391fb2fd 100644
--- a/sources/shiboken6/generator/shiboken/cppgenerator_container.cpp
+++ b/sources/shiboken6/generator/shiboken/cppgenerator_container.cpp
@@ -30,6 +30,7 @@
#include <abstractmetalang.h>
#include "apiextractorresult.h"
#include "ctypenames.h"
+#include "containertypeentry.h"
#include "textstream.h"
#include <QtCore/QDebug>
diff --git a/sources/shiboken6/generator/shiboken/headergenerator.cpp b/sources/shiboken6/generator/shiboken/headergenerator.cpp
index 01bb5d578..063388f4f 100644
--- a/sources/shiboken6/generator/shiboken/headergenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/headergenerator.cpp
@@ -38,6 +38,14 @@
#include <reporthandler.h>
#include <textstream.h>
#include <fileout.h>
+#include "containertypeentry.h"
+#include "enumtypeentry.h"
+#include "flagstypeentry.h"
+#include "namespacetypeentry.h"
+#include "primitivetypeentry.h"
+#include "typedefentry.h"
+#include "typesystemtypeentry.h"
+
#include "parser/codemodel.h"
#include "qtcompat.h"
diff --git a/sources/shiboken6/generator/shiboken/headergenerator.h b/sources/shiboken6/generator/shiboken/headergenerator.h
index 3adaa247b..38b1e33a3 100644
--- a/sources/shiboken6/generator/shiboken/headergenerator.h
+++ b/sources/shiboken6/generator/shiboken/headergenerator.h
@@ -30,6 +30,7 @@
#define HEADERGENERATOR_H
#include "shibokengenerator.h"
+#include "include.h"
#include <QtCore/QSet>
diff --git a/sources/shiboken6/generator/shiboken/overloaddata.cpp b/sources/shiboken6/generator/shiboken/overloaddata.cpp
index a8c067df7..232b8b07e 100644
--- a/sources/shiboken6/generator/shiboken/overloaddata.cpp
+++ b/sources/shiboken6/generator/shiboken/overloaddata.cpp
@@ -31,7 +31,9 @@
#include <abstractmetalang.h>
#include <dotview.h>
#include <reporthandler.h>
-#include <typesystem.h>
+#include <complextypeentry.h>
+#include <containertypeentry.h>
+#include <primitivetypeentry.h>
#include <graph.h>
#include "overloaddata.h"
#include "messages.h"
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
index 0b4018292..948b73f92 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.cpp
@@ -46,6 +46,14 @@
#include <textstream.h>
#include <typedatabase.h>
#include <abstractmetabuilder.h>
+#include <containertypeentry.h>
+#include <customtypenentry.h>
+#include <enumtypeentry.h>
+#include <flagstypeentry.h>
+#include <namespacetypeentry.h>
+#include <primitivetypeentry.h>
+#include <pythontypeentry.h>
+
#include <iostream>
#include "qtcompat.h"
diff --git a/sources/shiboken6/generator/shiboken/shibokengenerator.h b/sources/shiboken6/generator/shiboken/shibokengenerator.h
index 14829d08f..e0add1be9 100644
--- a/sources/shiboken6/generator/shiboken/shibokengenerator.h
+++ b/sources/shiboken6/generator/shiboken/shibokengenerator.h
@@ -31,7 +31,8 @@
#include <generator.h>
-#include "typesystem.h"
+#include "customconversion.h"
+#include "modifications.h"
#include <QtCore/QRegularExpression>