diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-30 08:13:04 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-05 02:39:03 (GMT) |
commit | dff7f0593d86e90eb14c805a96ebbda778f45a82 (patch) | |
tree | e2c8c52170bf2884b4c8d138627492739944966b /src/declarative/qml/qmlengine_p.h | |
parent | 49527e854a9edb0a92e64264d6efac6be46cf0ed (diff) | |
download | Qt-dff7f0593d86e90eb14c805a96ebbda778f45a82.zip Qt-dff7f0593d86e90eb14c805a96ebbda778f45a82.tar.gz Qt-dff7f0593d86e90eb14c805a96ebbda778f45a82.tar.bz2 |
Improve script lookup caching
Diffstat (limited to 'src/declarative/qml/qmlengine_p.h')
-rw-r--r-- | src/declarative/qml/qmlengine_p.h | 62 |
1 files changed, 4 insertions, 58 deletions
diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 68019e2..764cc6c 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -73,6 +73,8 @@ #include <QtScript/qscriptengine.h> #include <private/qmlmetaproperty_p.h> #include <private/qmlpropertycache_p.h> +#include <private/qmlobjectscriptclass_p.h> +#include <private/qmlcontextscriptclass_p.h> QT_BEGIN_NAMESPACE @@ -100,13 +102,9 @@ public: void init(); - QScriptClass::QueryFlags queryContext(const QString &name, uint *id, - QmlContext *); - QScriptValue propertyContext(const QScriptString &propName, uint id); - void setPropertyContext(const QScriptValue &, uint id); QScriptClass::QueryFlags queryObject(const QString &name, uint *id, QObject *); - QScriptValue propertyObject(const QScriptString &propName, QObject *, + QScriptValue propertyObject(const QString &propName, QObject *, uint id = 0); void setPropertyObject(const QScriptValue &, uint id); @@ -151,7 +149,6 @@ public: } resolveData; QmlContextScriptClass *contextClass; QmlObjectScriptClass *objectClass; - QScriptDeclarativeClass *objectClass2; QmlValueTypeScriptClass *valueTypeClass; QmlTypeNameScriptClass *typeNameClass; // Used by DOM Core 3 API @@ -215,6 +212,7 @@ public: // ### Fixme typedef QHash<QPair<const QMetaObject *, QString>, bool> FunctionCache; FunctionCache functionCache; + QHash<const QMetaObject *, QmlPropertyCache *> propertyCache; QmlPropertyCache *cache(QObject *obj) { Q_Q(QmlEngine); @@ -285,19 +283,6 @@ public: class QmlScriptClass : public QScriptClass { public: - enum ClassId - { - InvalidId = -1, - - FunctionId = 0x80000000, - VariantPropertyId = 0x40000000, - PropertyId = 0x00000000, - - ClassIdMask = 0xC0000000, - - ClassIdSelectorMask = 0x3F000000, - }; - QmlScriptClass(QmlEngine *); static QVariant toVariant(QmlEngine *, const QScriptValue &); @@ -305,45 +290,6 @@ protected: QmlEngine *engine; }; -class QmlContextScriptClass : public QmlScriptClass -{ -public: - QmlContextScriptClass(QmlEngine *); - ~QmlContextScriptClass(); - - virtual QueryFlags queryProperty(const QScriptValue &object, - const QScriptString &name, - QueryFlags flags, uint *id); - virtual QScriptValue property(const QScriptValue &object, - const QScriptString &name, - uint id); - virtual void setProperty(QScriptValue &object, - const QScriptString &name, - uint id, - const QScriptValue &value); -}; - -class QmlObjectScriptClass : public QmlScriptClass -{ -public: - QmlObjectScriptClass(QmlEngine *); - ~QmlObjectScriptClass(); - - virtual QScriptValue prototype () const; - QScriptValue prototypeObject; - - virtual QueryFlags queryProperty(const QScriptValue &object, - const QScriptString &name, - QueryFlags flags, uint *id); - virtual QScriptValue property(const QScriptValue &object, - const QScriptString &name, - uint id); - virtual void setProperty(QScriptValue &object, - const QScriptString &name, - uint id, - const QScriptValue &value); -}; - class QmlTypeNameScriptClass : public QmlScriptClass { public: |