X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fdeclarative%2Fqml%2Fqdeclarativecontext_p.h;h=dab00166685df27c0e2c854af1a373a5067188d2;hb=45b14259fc0cf704692df1c00da511527d1fba1d;hp=93b9d3b41eb546480d8b9ce435ff56f81334b3e4;hpb=8bb487e60899382f0890fd675eb272d5cc562882;p=profile%2Fivi%2Fqtdeclarative.git diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h index 93b9d3b..dab0016 100644 --- a/src/declarative/qml/qdeclarativecontext_p.h +++ b/src/declarative/qml/qdeclarativecontext_p.h @@ -1,8 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ ** ** This file is part of the QtDeclarative module of the Qt Toolkit. ** @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -55,31 +55,34 @@ #include "qdeclarativecontext.h" -#include "private/qdeclarativedata_p.h" -#include "private/qdeclarativeintegercache_p.h" -#include "private/qdeclarativetypenamecache_p.h" -#include "private/qdeclarativenotifier_p.h" +#include "qdeclarativedata_p.h" +#include "qdeclarativeintegercache_p.h" +#include "qdeclarativetypenamecache_p.h" +#include "qdeclarativenotifier_p.h" #include "qdeclarativelist.h" -#include "private/qdeclarativeparser_p.h" +#include "qdeclarativescript_p.h" #include -#include +#include #include #include -#include "private/qdeclarativeguard_p.h" +#include +#include #include + QT_BEGIN_NAMESPACE +class QV8Bindings; class QDeclarativeContext; class QDeclarativeExpression; class QDeclarativeEngine; class QDeclarativeExpression; class QDeclarativeExpressionPrivate; class QDeclarativeAbstractExpression; -class QDeclarativeV4Bindings; +class QV4Bindings; class QDeclarativeContextData; class QDeclarativeContextPrivate : public QObjectPrivate @@ -107,9 +110,10 @@ public: static QObject *context_at(QDeclarativeListProperty *, int); }; +class QDeclarativeVME; class QDeclarativeComponentAttached; class QDeclarativeGuardedContextData; -class Q_AUTOTEST_EXPORT QDeclarativeContextData +class Q_DECLARATIVE_EXPORT QDeclarativeContextData { public: QDeclarativeContextData(); @@ -140,9 +144,14 @@ public: quint32 isInternal:1; quint32 ownedByParent:1; // unrelated to isInternal; parent context deletes children if true. quint32 isJSContext:1; - quint32 dummy:29; + quint32 isPragmaLibraryContext:1; + quint32 unresolvedNames:1; // True if expressions in this context failed to resolve a toplevel name + quint32 dummy:28; QDeclarativeContext *publicContext; + // VME data that is constructing this context if any + void *activeVMEData; + // Property name cache QDeclarativeIntegerCache *propertyNames; @@ -177,13 +186,13 @@ public: // id guards struct ContextGuard : public QDeclarativeGuard { - ContextGuard() : context(0) {} - inline ContextGuard &operator=(QObject *obj) - { QDeclarativeGuard::operator=(obj); return *this; } - virtual void objectDestroyed(QObject *) { - if (context->contextObject && !QObjectPrivate::get(context->contextObject)->wasDeleted) bindings.notify(); - } - QDeclarativeContextData *context; + inline ContextGuard(); + inline ContextGuard &operator=(QObject *obj); + inline void objectDestroyed(QObject *); + + inline bool wasSet() const; + + QFlagPointer context; QDeclarativeNotifier bindings; }; ContextGuard *idValues; @@ -191,9 +200,6 @@ public: void setIdProperty(int, QObject *); void setIdPropertyData(QDeclarativeIntegerCache *); - // Optimized binding pointer - QDeclarativeV4Bindings *optimizedBindings; - // Linked contexts. this owns linkedContext. QDeclarativeContextData *linkedContext; @@ -201,6 +207,10 @@ public: // context QDeclarativeComponentAttached *componentAttached; + // Optimized binding objects. Needed for deferred properties. + QV4Bindings *v4bindings; + QV8Bindings *v8bindings; + // Return the outermost id for obj, if any. QString findObjectId(const QObject *obj) const; @@ -209,6 +219,8 @@ public: } private: + void refreshExpressionsRecursive(bool isGlobal); + void refreshExpressionsRecursive(QDeclarativeAbstractExpression *); ~QDeclarativeContextData() {} }; @@ -292,6 +304,30 @@ QDeclarativeGuardedContextData::operator=(QDeclarativeContextData *d) return *this; } +QDeclarativeContextData::ContextGuard::ContextGuard() +: context(0) +{ +} + +QDeclarativeContextData::ContextGuard &QDeclarativeContextData::ContextGuard::operator=(QObject *obj) +{ + QDeclarativeGuard::operator=(obj); + context.setFlag(); + bindings.notify(); // For alias connections + return *this; +} + +void QDeclarativeContextData::ContextGuard::objectDestroyed(QObject *) +{ + if (context->contextObject && !QObjectPrivate::get(context->contextObject)->wasDeleted) + bindings.notify(); +} + +bool QDeclarativeContextData::ContextGuard::wasSet() const +{ + return context.flag(); +} + QT_END_NAMESPACE #endif // QDECLARATIVECONTEXT_P_H