From 9872dce1dcb74216cad30301502d1c77de2356ad Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 24 Feb 2010 18:36:33 +1000 Subject: Make QDeclarativeMetaType and QDeclarativeType private --- src/declarative/qml/qdeclarativeboundsignal.cpp | 2 +- src/declarative/qml/qdeclarativecompiler.cpp | 2 +- src/declarative/qml/qdeclarativecustomparser_p.h | 2 +- src/declarative/qml/qdeclarativeengine.cpp | 5 +- src/declarative/qml/qdeclarativeengine_p.h | 2 +- src/declarative/qml/qdeclarativeenginedebug.cpp | 2 +- src/declarative/qml/qdeclarativeinfo.cpp | 2 +- src/declarative/qml/qdeclarativeintegercache.cpp | 2 +- src/declarative/qml/qdeclarativemetatype.cpp | 2 +- src/declarative/qml/qdeclarativemetatype.h | 144 -------------------- src/declarative/qml/qdeclarativemetatype_p.h | 149 +++++++++++++++++++++ src/declarative/qml/qml.pri | 2 +- src/declarative/util/qdeclarativeanimation.cpp | 2 +- src/declarative/util/qdeclarativelistaccessor.cpp | 4 +- .../qdeclarativedebug/tst_qdeclarativedebug.cpp | 2 +- .../tst_qdeclarativelanguage.cpp | 4 +- .../tst_qdeclarativemetatype.cpp | 3 +- 17 files changed, 169 insertions(+), 162 deletions(-) delete mode 100644 src/declarative/qml/qdeclarativemetatype.h create mode 100644 src/declarative/qml/qdeclarativemetatype_p.h diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index c47df32..ce396fd 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -45,7 +45,7 @@ #include "qdeclarativeengine_p.h" #include "qdeclarativeexpression_p.h" #include "qdeclarativecontext_p.h" -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" #include "qdeclarative.h" #include "qdeclarativecontext.h" #include "qdeclarativeglobal_p.h" diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b6ebd60..9ac65f9 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -51,7 +51,7 @@ #include "qdeclarativeengine_p.h" #include "qdeclarativeengine.h" #include "qdeclarativecontext.h" -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" #include "qdeclarativecustomparser_p_p.h" #include "qdeclarativecontext_p.h" #include "qdeclarativecomponent_p.h" diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h index cef1f3c..99587a8 100644 --- a/src/declarative/qml/qdeclarativecustomparser_p.h +++ b/src/declarative/qml/qdeclarativecustomparser_p.h @@ -53,7 +53,7 @@ // We mean it. // -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" #include "qdeclarativeerror.h" #include "qdeclarativeparser_p.h" diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 39b8a22..3229570 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -68,6 +68,7 @@ #include "qdeclarativedirparser_p.h" #include "qdeclarativeextensioninterface.h" #include "qdeclarativelist_p.h" +#include "qdeclarativetypenamecache_p.h" #include @@ -1503,9 +1504,6 @@ QDeclarativeEnginePrivate::Imports::~Imports() delete d; } -#include "qdeclarativemetatype.h" -#include "qdeclarativetypenamecache_p.h" - static QDeclarativeTypeNameCache *cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeEnginePrivate::ImportedNamespace &set, QDeclarativeTypeNameCache *cache) { if (!cache) @@ -1667,6 +1665,7 @@ QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &dir, const QString const QStringList &suffixes, const QString &prefix) { + qWarning() << baseName; foreach (const QString &suffix, suffixes) { QString pluginFileName = prefix; diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h index 1a858d4..c4a40c5 100644 --- a/src/declarative/qml/qdeclarativeengine_p.h +++ b/src/declarative/qml/qdeclarativeengine_p.h @@ -67,7 +67,7 @@ #include "qdeclarativeobjectscriptclass_p.h" #include "qdeclarativecontextscriptclass_p.h" #include "qdeclarativevaluetypescriptclass_p.h" -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" #include #include diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index e4579a6..6a81e52 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -43,7 +43,7 @@ #include "qdeclarativeboundsignal_p.h" #include "qdeclarativeengine.h" -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" #include "qdeclarativemetaproperty.h" #include "qdeclarativebinding_p.h" #include "qdeclarativecontext_p.h" diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index 41d09c4..7dc61fd 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -43,7 +43,7 @@ #include "qdeclarativedeclarativedata_p.h" #include "qdeclarativecontext.h" -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" #include diff --git a/src/declarative/qml/qdeclarativeintegercache.cpp b/src/declarative/qml/qdeclarativeintegercache.cpp index 7fa4b0c..8fa210f 100644 --- a/src/declarative/qml/qdeclarativeintegercache.cpp +++ b/src/declarative/qml/qdeclarativeintegercache.cpp @@ -42,7 +42,7 @@ #include "qdeclarativeintegercache_p.h" #include "qdeclarativeengine_p.h" -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 7ae5a83..e87f8ba 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qdeclarativemetatype.h" +#include "qdeclarativemetatype_p.h" #include "qdeclarativeproxymetaobject_p.h" #include "qdeclarativecustomparser_p.h" diff --git a/src/declarative/qml/qdeclarativemetatype.h b/src/declarative/qml/qdeclarativemetatype.h deleted file mode 100644 index 4cddf1c..0000000 --- a/src/declarative/qml/qdeclarativemetatype.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QDECLARATIVEMETATYPE_H -#define QDECLARATIVEMETATYPE_H - -#include "qdeclarativeprivate.h" - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QDeclarativeType; -class QDeclarativeCustomParser; -class Q_DECLARATIVE_EXPORT QDeclarativeMetaType -{ -public: - static bool copy(int type, void *data, const void *copy = 0); - - static QList qmlTypeNames(); - static QList qmlTypes(); - - static QDeclarativeType *qmlType(const QByteArray &, int, int); - static QDeclarativeType *qmlType(const QMetaObject *); - static QDeclarativeType *qmlType(int); - - static QMetaProperty defaultProperty(const QMetaObject *); - static QMetaProperty defaultProperty(QObject *); - static QMetaMethod defaultMethod(const QMetaObject *); - static QMetaMethod defaultMethod(QObject *); - - static bool isQObject(int); - static QObject *toQObject(const QVariant &, bool *ok = 0); - - static int listType(int); - static int attachedPropertiesFuncId(const QMetaObject *); - static QDeclarativeAttachedPropertiesFunc attachedPropertiesFuncById(int); - - enum TypeCategory { Unknown, Object, List }; - static TypeCategory typeCategory(int); - - static bool isInterface(int); - static const char *interfaceIId(int); - static bool isList(int); - - typedef QVariant (*StringConverter)(const QString &); - static void registerCustomStringConverter(int, StringConverter); - static StringConverter customStringConverter(int); -}; - -class QDeclarativeTypePrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeType -{ -public: - QByteArray typeName() const; - QByteArray qmlTypeName() const; - - int majorVersion() const; - int minorVersion() const; - bool availableInVersion(int vmajor, int vminor) const; - - QObject *create() const; - - QDeclarativeCustomParser *customParser() const; - - bool isInterface() const; - int typeId() const; - int qListTypeId() const; - - const QMetaObject *metaObject() const; - const QMetaObject *baseMetaObject() const; - - QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction() const; - const QMetaObject *attachedPropertiesType() const; - - int parserStatusCast() const; - QVariant fromObject(QObject *) const; - const char *interfaceIId() const; - int propertyValueSourceCast() const; - int propertyValueInterceptorCast() const; - - int index() const; -private: - friend class QDeclarativeTypePrivate; - friend class QDeclarativeMetaTypeData; - friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &); - friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &); - QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &); - QDeclarativeType(int, const QDeclarativePrivate::RegisterType &); - ~QDeclarativeType(); - - QDeclarativeTypePrivate *d; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QDECLARATIVEMETATYPE_H - diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h new file mode 100644 index 0000000..ec5c045 --- /dev/null +++ b/src/declarative/qml/qdeclarativemetatype_p.h @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDECLARATIVEMETATYPE_P_H +#define QDECLARATIVEMETATYPE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qdeclarative.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QDeclarativeType; +class QDeclarativeCustomParser; +class Q_DECLARATIVE_EXPORT QDeclarativeMetaType +{ +public: + static bool copy(int type, void *data, const void *copy = 0); + + static QList qmlTypeNames(); + static QList qmlTypes(); + + static QDeclarativeType *qmlType(const QByteArray &, int, int); + static QDeclarativeType *qmlType(const QMetaObject *); + static QDeclarativeType *qmlType(int); + + static QMetaProperty defaultProperty(const QMetaObject *); + static QMetaProperty defaultProperty(QObject *); + static QMetaMethod defaultMethod(const QMetaObject *); + static QMetaMethod defaultMethod(QObject *); + + static bool isQObject(int); + static QObject *toQObject(const QVariant &, bool *ok = 0); + + static int listType(int); + static int attachedPropertiesFuncId(const QMetaObject *); + static QDeclarativeAttachedPropertiesFunc attachedPropertiesFuncById(int); + + enum TypeCategory { Unknown, Object, List }; + static TypeCategory typeCategory(int); + + static bool isInterface(int); + static const char *interfaceIId(int); + static bool isList(int); + + typedef QVariant (*StringConverter)(const QString &); + static void registerCustomStringConverter(int, StringConverter); + static StringConverter customStringConverter(int); +}; + +class QDeclarativeTypePrivate; +class Q_DECLARATIVE_EXPORT QDeclarativeType +{ +public: + QByteArray typeName() const; + QByteArray qmlTypeName() const; + + int majorVersion() const; + int minorVersion() const; + bool availableInVersion(int vmajor, int vminor) const; + + QObject *create() const; + + QDeclarativeCustomParser *customParser() const; + + bool isInterface() const; + int typeId() const; + int qListTypeId() const; + + const QMetaObject *metaObject() const; + const QMetaObject *baseMetaObject() const; + + QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction() const; + const QMetaObject *attachedPropertiesType() const; + + int parserStatusCast() const; + QVariant fromObject(QObject *) const; + const char *interfaceIId() const; + int propertyValueSourceCast() const; + int propertyValueInterceptorCast() const; + + int index() const; +private: + friend class QDeclarativeTypePrivate; + friend class QDeclarativeMetaTypeData; + friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &); + friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &); + QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &); + QDeclarativeType(int, const QDeclarativePrivate::RegisterType &); + ~QDeclarativeType(); + + QDeclarativeTypePrivate *d; +}; + +QT_END_NAMESPACE + +#endif // QDECLARATIVEMETATYPE_P_H + diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 8285bb9..8a43cec 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -80,7 +80,7 @@ HEADERS += \ $$PWD/qdeclarativedom_p.h \ $$PWD/qdeclarativedom_p_p.h \ $$PWD/qdeclarativerefcount_p.h \ - $$PWD/qdeclarativemetatype.h \ + $$PWD/qdeclarativemetatype_p.h \ $$PWD/qdeclarativeengine.h \ $$PWD/qdeclarativecontext.h \ $$PWD/qdeclarativeexpression.h \ diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 88b64fd..eb3a376 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/declarative/util/qdeclarativelistaccessor.cpp b/src/declarative/util/qdeclarativelistaccessor.cpp index 346f3e4..4e56909 100644 --- a/src/declarative/util/qdeclarativelistaccessor.cpp +++ b/src/declarative/util/qdeclarativelistaccessor.cpp @@ -41,9 +41,9 @@ #include "qdeclarativelistaccessor_p.h" -#include +#include -#include +#include #include // ### Remove me diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 1c8cbbc..40cd737 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include @@ -58,6 +57,7 @@ #include #include #include +#include #include "../shared/debugutil_p.h" diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 16af0d9..ae07112 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -41,12 +41,14 @@ #include #include #include -#include #include #include #include #include + #include +#include + #include "testtypes.h" #include "../../../shared/util.h" diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp index ca16214..4333e02 100644 --- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp +++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include -#include #include #include #include @@ -53,6 +52,8 @@ #include #include +#include + class tst_qdeclarativemetatype : public QObject { Q_OBJECT -- cgit v0.12