summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/parser/parser.pri32
-rw-r--r--src/declarative/qml/parser/qdeclarativejs.g (renamed from src/declarative/qml/parser/qmljs.g)54
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast.cpp (renamed from src/declarative/qml/parser/qmljsast.cpp)8
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast_p.h (renamed from src/declarative/qml/parser/qmljsast_p.h)198
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastfwd_p.h (renamed from src/declarative/qml/parser/qmljsastfwd_p.h)8
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastvisitor.cpp (renamed from src/declarative/qml/parser/qmljsastvisitor.cpp)6
-rw-r--r--src/declarative/qml/parser/qdeclarativejsastvisitor_p.h (renamed from src/declarative/qml/parser/qmljsastvisitor_p.h)14
-rw-r--r--src/declarative/qml/parser/qdeclarativejsengine_p.cpp (renamed from src/declarative/qml/parser/qmljsengine_p.cpp)16
-rw-r--r--src/declarative/qml/parser/qdeclarativejsengine_p.h (renamed from src/declarative/qml/parser/qmljsengine_p.h)28
-rw-r--r--src/declarative/qml/parser/qdeclarativejsglobal_p.h (renamed from src/declarative/qml/parser/qmljsglobal_p.h)10
-rw-r--r--src/declarative/qml/parser/qdeclarativejsgrammar.cpp (renamed from src/declarative/qml/parser/qmljsgrammar.cpp)18
-rw-r--r--src/declarative/qml/parser/qdeclarativejsgrammar_p.h (renamed from src/declarative/qml/parser/qmljsgrammar_p.h)8
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp (renamed from src/declarative/qml/parser/qmljslexer.cpp)288
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer_p.h (renamed from src/declarative/qml/parser/qmljslexer_p.h)10
-rw-r--r--src/declarative/qml/parser/qdeclarativejsmemorypool_p.h (renamed from src/declarative/qml/parser/qmljsmemorypool_p.h)10
-rw-r--r--src/declarative/qml/parser/qdeclarativejsnodepool_p.h (renamed from src/declarative/qml/parser/qmljsnodepool_p.h)12
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser.cpp (renamed from src/declarative/qml/parser/qmljsparser.cpp)32
-rw-r--r--src/declarative/qml/parser/qdeclarativejsparser_p.h (renamed from src/declarative/qml/parser/qmljsparser_p.h)20
-rw-r--r--src/declarative/qml/qdeclarative.h (renamed from src/declarative/qml/qml.h)26
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp (renamed from src/declarative/qml/qmlbinding.cpp)104
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h (renamed from src/declarative/qml/qmlbinding_p.h)68
-rw-r--r--src/declarative/qml/qdeclarativebinding_p_p.h (renamed from src/declarative/qml/qmlbinding_p_p.h)30
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal.cpp (renamed from src/declarative/qml/qmlboundsignal.cpp)90
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal_p.h (renamed from src/declarative/qml/qmlboundsignal_p.h)34
-rw-r--r--src/declarative/qml/qdeclarativeclassfactory.cpp (renamed from src/declarative/qml/qmlclassfactory.cpp)4
-rw-r--r--src/declarative/qml/qdeclarativeclassfactory_p.h (renamed from src/declarative/qml/qmlclassfactory_p.h)16
-rw-r--r--src/declarative/qml/qdeclarativecleanup.cpp (renamed from src/declarative/qml/qmlcleanup.cpp)22
-rw-r--r--src/declarative/qml/qdeclarativecleanup_p.h (renamed from src/declarative/qml/qmlcleanup_p.h)20
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp (renamed from src/declarative/qml/qmlcompiledbindings.cpp)344
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings_p.h (renamed from src/declarative/qml/qmlcompiledbindings_p.h)48
-rw-r--r--src/declarative/qml/qdeclarativecompileddata.cpp (renamed from src/declarative/qml/qmlcompileddata.cpp)48
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp (renamed from src/declarative/qml/qmlcompiler.cpp)840
-rw-r--r--src/declarative/qml/qdeclarativecompiler_p.h337
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp (renamed from src/declarative/qml/qmlcomponent.cpp)322
-rw-r--r--src/declarative/qml/qdeclarativecomponent.h (renamed from src/declarative/qml/qmlcomponent.h)60
-rw-r--r--src/declarative/qml/qdeclarativecomponent_p.h (renamed from src/declarative/qml/qmlcomponent_p.h)76
-rw-r--r--src/declarative/qml/qdeclarativecompositetypedata_p.h (renamed from src/declarative/qml/qmlcompositetypedata_p.h)72
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager.cpp (renamed from src/declarative/qml/qmlcompositetypemanager.cpp)244
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager_p.h (renamed from src/declarative/qml/qmlcompositetypemanager_p.h)68
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp (renamed from src/declarative/qml/qmlcontext.cpp)208
-rw-r--r--src/declarative/qml/qdeclarativecontext.h (renamed from src/declarative/qml/qmlcontext.h)54
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h (renamed from src/declarative/qml/qmlcontext_p.h)90
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass.cpp (renamed from src/declarative/qml/qmlcontextscriptclass.cpp)84
-rw-r--r--src/declarative/qml/qdeclarativecontextscriptclass_p.h (renamed from src/declarative/qml/qmlcontextscriptclass_p.h)32
-rw-r--r--src/declarative/qml/qdeclarativecustomparser.cpp (renamed from src/declarative/qml/qmlcustomparser.cpp)86
-rw-r--r--src/declarative/qml/qdeclarativecustomparser_p.h (renamed from src/declarative/qml/qmlcustomparser_p.h)72
-rw-r--r--src/declarative/qml/qdeclarativecustomparser_p_p.h (renamed from src/declarative/qml/qmlcustomparser_p_p.h)26
-rw-r--r--src/declarative/qml/qdeclarativedeclarativedata_p.h (renamed from src/declarative/qml/qmldeclarativedata_p.h)58
-rw-r--r--src/declarative/qml/qdeclarativedirparser.cpp (renamed from src/declarative/qml/qmldirparser.cpp)32
-rw-r--r--src/declarative/qml/qdeclarativedirparser_p.h (renamed from src/declarative/qml/qmldirparser_p.h)20
-rw-r--r--src/declarative/qml/qdeclarativedom.cpp (renamed from src/declarative/qml/qmldom.cpp)720
-rw-r--r--src/declarative/qml/qdeclarativedom_p.h360
-rw-r--r--src/declarative/qml/qdeclarativedom_p_p.h (renamed from src/declarative/qml/qmldom_p_p.h)86
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp (renamed from src/declarative/qml/qmlengine.cpp)668
-rw-r--r--src/declarative/qml/qdeclarativeengine.h (renamed from src/declarative/qml/qmlengine.h)44
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h (renamed from src/declarative/qml/qmlengine_p.h)174
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp (renamed from src/declarative/qml/qmlenginedebug.cpp)138
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug_p.h (renamed from src/declarative/qml/qmlenginedebug_p.h)44
-rw-r--r--src/declarative/qml/qdeclarativeerror.cpp (renamed from src/declarative/qml/qmlerror.cpp)56
-rw-r--r--src/declarative/qml/qdeclarativeerror.h (renamed from src/declarative/qml/qmlerror.h)22
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp (renamed from src/declarative/qml/qmlexpression.cpp)260
-rw-r--r--src/declarative/qml/qdeclarativeexpression.h (renamed from src/declarative/qml/qmlexpression.h)44
-rw-r--r--src/declarative/qml/qdeclarativeexpression_p.h (renamed from src/declarative/qml/qmlexpression_p.h)94
-rw-r--r--src/declarative/qml/qdeclarativeextensioninterface.h (renamed from src/declarative/qml/qmlextensioninterface.h)16
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.cpp (renamed from src/declarative/qml/qmlextensionplugin.cpp)18
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.h (renamed from src/declarative/qml/qmlextensionplugin.h)20
-rw-r--r--src/declarative/qml/qdeclarativeglobal_p.h (renamed from src/declarative/qml/qmlglobal_p.h)12
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass.cpp (renamed from src/declarative/qml/qmlglobalscriptclass.cpp)12
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass_p.h (renamed from src/declarative/qml/qmlglobalscriptclass_p.h)10
-rw-r--r--src/declarative/qml/qdeclarativeguard_p.h (renamed from src/declarative/qml/qmlguard_p.h)42
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp (renamed from src/declarative/qml/qmlimageprovider.cpp)12
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.h (renamed from src/declarative/qml/qmlimageprovider.h)10
-rw-r--r--src/declarative/qml/qdeclarativeinfo.cpp (renamed from src/declarative/qml/qmlinfo.cpp)22
-rw-r--r--src/declarative/qml/qdeclarativeinfo.h92
-rw-r--r--src/declarative/qml/qdeclarativeinstruction.cpp (renamed from src/declarative/qml/qmlinstruction.cpp)100
-rw-r--r--src/declarative/qml/qdeclarativeinstruction_p.h (renamed from src/declarative/qml/qmlinstruction_p.h)14
-rw-r--r--src/declarative/qml/qdeclarativeintegercache.cpp (renamed from src/declarative/qml/qmlintegercache.cpp)20
-rw-r--r--src/declarative/qml/qdeclarativeintegercache_p.h (renamed from src/declarative/qml/qmlintegercache_p.h)26
-rw-r--r--src/declarative/qml/qdeclarativelist.cpp (renamed from src/declarative/qml/qmllist.cpp)114
-rw-r--r--src/declarative/qml/qdeclarativelist.h (renamed from src/declarative/qml/qmllist.h)56
-rw-r--r--src/declarative/qml/qdeclarativelist_p.h (renamed from src/declarative/qml/qmllist_p.h)22
-rw-r--r--src/declarative/qml/qdeclarativelistscriptclass.cpp (renamed from src/declarative/qml/qmllistscriptclass.cpp)40
-rw-r--r--src/declarative/qml/qdeclarativelistscriptclass_p.h (renamed from src/declarative/qml/qmllistscriptclass_p.h)22
-rw-r--r--src/declarative/qml/qdeclarativemetaproperty.cpp (renamed from src/declarative/qml/qmlmetaproperty.cpp)400
-rw-r--r--src/declarative/qml/qdeclarativemetaproperty.h (renamed from src/declarative/qml/qmlmetaproperty.h)60
-rw-r--r--src/declarative/qml/qdeclarativemetaproperty_p.h (renamed from src/declarative/qml/qmlmetaproperty_p.h)48
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp (renamed from src/declarative/qml/qmlmetatype.cpp)208
-rw-r--r--src/declarative/qml/qdeclarativemetatype.h281
-rw-r--r--src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp (renamed from src/declarative/qml/qmlnetworkaccessmanagerfactory.cpp)12
-rw-r--r--src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h (renamed from src/declarative/qml/qmlnetworkaccessmanagerfactory.h)10
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp (renamed from src/declarative/qml/qmlobjectscriptclass.cpp)168
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass_p.h (renamed from src/declarative/qml/qmlobjectscriptclass_p.h)48
-rw-r--r--src/declarative/qml/qdeclarativeparser.cpp (renamed from src/declarative/qml/qmlparser.cpp)102
-rw-r--r--src/declarative/qml/qdeclarativeparser_p.h (renamed from src/declarative/qml/qmlparser_p.h)54
-rw-r--r--src/declarative/qml/qdeclarativeparserstatus.cpp (renamed from src/declarative/qml/qmlparserstatus.cpp)14
-rw-r--r--src/declarative/qml/qdeclarativeparserstatus.h (renamed from src/declarative/qml/qmlparserstatus.h)24
-rw-r--r--src/declarative/qml/qdeclarativeprivate.cpp (renamed from src/declarative/qml/qmlprivate.cpp)4
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h (renamed from src/declarative/qml/qmlprivate.h)20
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp (renamed from src/declarative/qml/qmlpropertycache.cpp)90
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h (renamed from src/declarative/qml/qmlpropertycache_p.h)58
-rw-r--r--src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp (renamed from src/declarative/qml/qmlpropertyvalueinterceptor.cpp)18
-rw-r--r--src/declarative/qml/qdeclarativepropertyvalueinterceptor.h (renamed from src/declarative/qml/qmlpropertyvalueinterceptor.h)18
-rw-r--r--src/declarative/qml/qdeclarativepropertyvaluesource.cpp (renamed from src/declarative/qml/qmlpropertyvaluesource.cpp)16
-rw-r--r--src/declarative/qml/qdeclarativepropertyvaluesource.h (renamed from src/declarative/qml/qmlpropertyvaluesource.h)18
-rw-r--r--src/declarative/qml/qdeclarativeproxymetaobject.cpp (renamed from src/declarative/qml/qmlproxymetaobject.cpp)14
-rw-r--r--src/declarative/qml/qdeclarativeproxymetaobject_p.h (renamed from src/declarative/qml/qmlproxymetaobject_p.h)14
-rw-r--r--src/declarative/qml/qdeclarativerefcount.cpp (renamed from src/declarative/qml/qmlrefcount.cpp)10
-rw-r--r--src/declarative/qml/qdeclarativerefcount_p.h (renamed from src/declarative/qml/qmlrefcount_p.h)12
-rw-r--r--src/declarative/qml/qdeclarativerewrite.cpp (renamed from src/declarative/qml/qmlrewrite.cpp)8
-rw-r--r--src/declarative/qml/qdeclarativerewrite_p.h (renamed from src/declarative/qml/qmlrewrite_p.h)18
-rw-r--r--src/declarative/qml/qdeclarativescript.cpp (renamed from src/declarative/qml/qmlscript.cpp)2
-rw-r--r--src/declarative/qml/qdeclarativescriptclass_p.h (renamed from src/declarative/qml/qmlscriptclass_p.h)14
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp (renamed from src/declarative/qml/qmlscriptparser.cpp)142
-rw-r--r--src/declarative/qml/qdeclarativescriptparser_p.h (renamed from src/declarative/qml/qmlscriptparser_p.h)34
-rw-r--r--src/declarative/qml/qdeclarativescriptstring.cpp (renamed from src/declarative/qml/qmlscriptstring.cpp)38
-rw-r--r--src/declarative/qml/qdeclarativescriptstring.h (renamed from src/declarative/qml/qmlscriptstring.h)28
-rw-r--r--src/declarative/qml/qdeclarativesqldatabase.cpp (renamed from src/declarative/qml/qmlsqldatabase.cpp)36
-rw-r--r--src/declarative/qml/qdeclarativesqldatabase_p.h (renamed from src/declarative/qml/qmlsqldatabase_p.h)6
-rw-r--r--src/declarative/qml/qdeclarativestringconverters.cpp (renamed from src/declarative/qml/qmlstringconverters.cpp)22
-rw-r--r--src/declarative/qml/qdeclarativestringconverters_p.h (renamed from src/declarative/qml/qmlstringconverters_p.h)8
-rw-r--r--src/declarative/qml/qdeclarativetypenamecache.cpp (renamed from src/declarative/qml/qmltypenamecache.cpp)22
-rw-r--r--src/declarative/qml/qdeclarativetypenamecache_p.h (renamed from src/declarative/qml/qmltypenamecache_p.h)36
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp (renamed from src/declarative/qml/qmltypenamescriptclass.cpp)48
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass_p.h (renamed from src/declarative/qml/qmltypenamescriptclass_p.h)30
-rw-r--r--src/declarative/qml/qdeclarativevaluetype.cpp706
-rw-r--r--src/declarative/qml/qdeclarativevaluetype_p.h (renamed from src/declarative/qml/qmlvaluetype_p.h)82
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass.cpp (renamed from src/declarative/qml/qmlvaluetypescriptclass.cpp)48
-rw-r--r--src/declarative/qml/qdeclarativevaluetypescriptclass_p.h (renamed from src/declarative/qml/qmlvaluetypescriptclass_p.h)22
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp (renamed from src/declarative/qml/qmlvme.cpp)298
-rw-r--r--src/declarative/qml/qdeclarativevme_p.h (renamed from src/declarative/qml/qmlvme_p.h)34
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject.cpp (renamed from src/declarative/qml/qmlvmemetaobject.cpp)76
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject_p.h (renamed from src/declarative/qml/qmlvmemetaobject_p.h)44
-rw-r--r--src/declarative/qml/qdeclarativewatcher.cpp (renamed from src/declarative/qml/qmlwatcher.cpp)72
-rw-r--r--src/declarative/qml/qdeclarativewatcher_p.h (renamed from src/declarative/qml/qmlwatcher_p.h)20
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp (renamed from src/declarative/qml/qmlworkerscript.cpp)194
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript_p.h (renamed from src/declarative/qml/qmlworkerscript_p.h)52
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp (renamed from src/declarative/qml/qmlxmlhttprequest.cpp)146
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest_p.h (renamed from src/declarative/qml/qmlxmlhttprequest_p.h)6
-rw-r--r--src/declarative/qml/qml.pri240
-rw-r--r--src/declarative/qml/qmlcompiler_p.h337
-rw-r--r--src/declarative/qml/qmldom_p.h360
-rw-r--r--src/declarative/qml/qmlinfo.h92
-rw-r--r--src/declarative/qml/qmlmetatype.h281
-rw-r--r--src/declarative/qml/qmlvaluetype.cpp706
-rw-r--r--src/declarative/qml/rewriter/rewriter.cpp8
-rw-r--r--src/declarative/qml/rewriter/rewriter_p.h6
-rw-r--r--src/declarative/qml/rewriter/textwriter.cpp2
-rw-r--r--src/declarative/qml/rewriter/textwriter_p.h6
148 files changed, 6924 insertions, 6924 deletions
diff --git a/src/declarative/qml/parser/parser.pri b/src/declarative/qml/parser/parser.pri
index 4530479..fd4361c 100644
--- a/src/declarative/qml/parser/parser.pri
+++ b/src/declarative/qml/parser/parser.pri
@@ -1,21 +1,21 @@
INCLUDEPATH += $$PWD
HEADERS += \
- $$PWD/qmljsast_p.h \
- $$PWD/qmljsastfwd_p.h \
- $$PWD/qmljsastvisitor_p.h \
- $$PWD/qmljsengine_p.h \
- $$PWD/qmljsgrammar_p.h \
- $$PWD/qmljslexer_p.h \
- $$PWD/qmljsmemorypool_p.h \
- $$PWD/qmljsnodepool_p.h \
- $$PWD/qmljsparser_p.h \
- $$PWD/qmljsglobal_p.h
+ $$PWD/qdeclarativejsast_p.h \
+ $$PWD/qdeclarativejsastfwd_p.h \
+ $$PWD/qdeclarativejsastvisitor_p.h \
+ $$PWD/qdeclarativejsengine_p.h \
+ $$PWD/qdeclarativejsgrammar_p.h \
+ $$PWD/qdeclarativejslexer_p.h \
+ $$PWD/qdeclarativejsmemorypool_p.h \
+ $$PWD/qdeclarativejsnodepool_p.h \
+ $$PWD/qdeclarativejsparser_p.h \
+ $$PWD/qdeclarativejsglobal_p.h
SOURCES += \
- $$PWD/qmljsast.cpp \
- $$PWD/qmljsastvisitor.cpp \
- $$PWD/qmljsengine_p.cpp \
- $$PWD/qmljsgrammar.cpp \
- $$PWD/qmljslexer.cpp \
- $$PWD/qmljsparser.cpp
+ $$PWD/qdeclarativejsast.cpp \
+ $$PWD/qdeclarativejsastvisitor.cpp \
+ $$PWD/qdeclarativejsengine_p.cpp \
+ $$PWD/qdeclarativejsgrammar.cpp \
+ $$PWD/qdeclarativejslexer.cpp \
+ $$PWD/qdeclarativejsparser.cpp
diff --git a/src/declarative/qml/parser/qmljs.g b/src/declarative/qml/parser/qdeclarativejs.g
index 90949d5..e1cb5a5 100644
--- a/src/declarative/qml/parser/qmljs.g
+++ b/src/declarative/qml/parser/qdeclarativejs.g
@@ -21,9 +21,9 @@
--
----------------------------------------------------------------------------
-%parser QmlJSGrammar
-%decl qmljsparser_p.h
-%impl qmljsparser.cpp
+%parser QDeclarativeJSGrammar
+%decl qdeclarativejsparser_p.h
+%impl qdeclarativejsparser.cpp
%expect 2
%expect-rr 2
@@ -126,10 +126,10 @@
#include <string.h>
-#include "qmljsengine_p.h"
-#include "qmljslexer_p.h"
-#include "qmljsast_p.h"
-#include "qmljsnodepool_p.h"
+#include "qdeclarativejsengine_p.h"
+#include "qdeclarativejslexer_p.h"
+#include "qdeclarativejsast_p.h"
+#include "qdeclarativejsnodepool_p.h"
./
@@ -191,20 +191,20 @@
// Changes will be lost.
//
-#ifndef QMLJSPARSER_P_H
-#define QMLJSPARSER_P_H
+#ifndef QDECLARATIVEJSPARSER_P_H
+#define QDECLARATIVEJSPARSER_P_H
-#include "qmljsglobal_p.h"
-#include "qmljsgrammar_p.h"
-#include "qmljsast_p.h"
-#include "qmljsengine_p.h"
+#include "qdeclarativejsglobal_p.h"
+#include "qdeclarativejsgrammar_p.h"
+#include "qdeclarativejsast_p.h"
+#include "qdeclarativejsengine_p.h"
#include <QtCore/QList>
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
class Engine;
class NameId;
@@ -366,7 +366,7 @@ protected:
QList<DiagnosticMessage> diagnostic_messages;
};
-} // end of namespace QmlJS
+} // end of namespace QDeclarativeJS
:/
@@ -374,7 +374,7 @@ protected:
/.
-#include "qmljsparser_p.h"
+#include "qdeclarativejsparser_p.h"
#include <QVarLengthArray>
//
@@ -382,7 +382,7 @@ protected:
// Changes will be lost.
//
-using namespace QmlJS;
+using namespace QDeclarativeJS;
QT_QML_BEGIN_NAMESPACE
@@ -981,7 +981,7 @@ JsIdentifier: T_IDENTIFIER;
JsIdentifier: T_PROPERTY ;
/.
case $rule_number: {
- QString s = QLatin1String(QmlJSGrammar::spell[T_PROPERTY]);
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_PROPERTY]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
@@ -990,7 +990,7 @@ case $rule_number: {
JsIdentifier: T_SIGNAL ;
/.
case $rule_number: {
- QString s = QLatin1String(QmlJSGrammar::spell[T_SIGNAL]);
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_SIGNAL]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
@@ -999,7 +999,7 @@ case $rule_number: {
JsIdentifier: T_READONLY ;
/.
case $rule_number: {
- QString s = QLatin1String(QmlJSGrammar::spell[T_READONLY]);
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_READONLY]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
@@ -2960,7 +2960,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
yylloc.startColumn += yylloc.length;
yylloc.length = 0;
- //const QString msg = qApp->translate("QmlParser", "Missing `;'");
+ //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'");
//diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
first_token = &token_buffer[0];
@@ -2988,9 +2988,9 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
QString msg;
int token = token_buffer[0].token;
if (token < 0 || token >= TERMINAL_COUNT)
- msg = qApp->translate("QmlParser", "Syntax error");
+ msg = qApp->translate("QDeclarativeParser", "Syntax error");
else
- msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
+ msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
action = errorState;
@@ -3018,7 +3018,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
int a = t_action(errorState, *tk);
if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
yytoken = *tk;
@@ -3042,7 +3042,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
int a = t_action(errorState, tk);
if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
yytoken = tk;
@@ -3055,7 +3055,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
}
}
- const QString msg = qApp->translate("QmlParser", "Syntax error");
+ const QString msg = qApp->translate("QDeclarativeParser", "Syntax error");
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
}
@@ -3071,5 +3071,5 @@ QT_QML_END_NAMESPACE
-#endif // QMLJSPARSER_P_H
+#endif // QDECLARATIVEJSPARSER_P_H
:/
diff --git a/src/declarative/qml/parser/qmljsast.cpp b/src/declarative/qml/parser/qdeclarativejsast.cpp
index d3ceba6..3b569a7 100644
--- a/src/declarative/qml/parser/qmljsast.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsast.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
-#include "qmljsast_p.h"
+#include "qdeclarativejsast_p.h"
-#include "qmljsastvisitor_p.h"
+#include "qdeclarativejsastvisitor_p.h"
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS { namespace AST {
+namespace QDeclarativeJS { namespace AST {
void Node::accept(Visitor *visitor)
{
@@ -948,7 +948,7 @@ void UiSourceElement::accept0(Visitor *visitor)
visitor->endVisit(this);
}
-} } // namespace QmlJS::AST
+} } // namespace QDeclarativeJS::AST
QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qmljsast_p.h b/src/declarative/qml/parser/qdeclarativejsast_p.h
index 9de733c..0a83fe2 100644
--- a/src/declarative/qml/parser/qmljsast_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsast_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLJSAST_P_H
-#define QMLJSAST_P_H
+#ifndef QDECLARATIVEJSAST_P_H
+#define QDECLARATIVEJSAST_P_H
//
// W A R N I N G
@@ -53,14 +53,14 @@
// We mean it.
//
-#include "qmljsastvisitor_p.h"
-#include "qmljsglobal_p.h"
+#include "qdeclarativejsastvisitor_p.h"
+#include "qdeclarativejsglobal_p.h"
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
-#define QMLJS_DECLARE_AST_NODE(name) \
+#define QDECLARATIVEJS_DECLARE_AST_NODE(name) \
enum { K = Kind_##name };
namespace QSOperator // ### rename
@@ -106,7 +106,7 @@ enum Op {
} // namespace QSOperator
-namespace QmlJS {
+namespace QDeclarativeJS {
class NameId;
namespace AST {
@@ -270,7 +270,7 @@ public:
class QML_PARSER_EXPORT UiFormal: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiFormal)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiFormal)
UiFormal(NameId *name, NameId *alias = 0)
: name(name), alias(alias)
@@ -295,7 +295,7 @@ public:
class QML_PARSER_EXPORT UiFormalList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiFormalList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiFormalList)
UiFormalList(UiFormal *formal)
: formal(formal), next(this) {}
@@ -330,7 +330,7 @@ public:
class QML_PARSER_EXPORT UiSignature: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiSignature)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiSignature)
UiSignature(UiFormalList *formals = 0)
: formals(formals)
@@ -353,7 +353,7 @@ public:
class QML_PARSER_EXPORT NestedExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(NestedExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(NestedExpression)
NestedExpression(ExpressionNode *expression)
: expression(expression)
@@ -376,7 +376,7 @@ public:
class QML_PARSER_EXPORT ThisExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(ThisExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ThisExpression)
ThisExpression() { kind = K; }
virtual ~ThisExpression() {}
@@ -396,7 +396,7 @@ public:
class QML_PARSER_EXPORT IdentifierExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(IdentifierExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierExpression)
IdentifierExpression(NameId *n):
name (n) { kind = K; }
@@ -419,7 +419,7 @@ public:
class QML_PARSER_EXPORT NullExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(NullExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(NullExpression)
NullExpression() { kind = K; }
virtual ~NullExpression() {}
@@ -439,7 +439,7 @@ public:
class QML_PARSER_EXPORT TrueLiteral: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(TrueLiteral)
+ QDECLARATIVEJS_DECLARE_AST_NODE(TrueLiteral)
TrueLiteral() { kind = K; }
virtual ~TrueLiteral() {}
@@ -459,7 +459,7 @@ public:
class QML_PARSER_EXPORT FalseLiteral: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(FalseLiteral)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FalseLiteral)
FalseLiteral() { kind = K; }
virtual ~FalseLiteral() {}
@@ -479,7 +479,7 @@ public:
class QML_PARSER_EXPORT NumericLiteral: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(NumericLiteral)
+ QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteral)
NumericLiteral(double v):
value(v) { kind = K; }
@@ -501,7 +501,7 @@ public:
class QML_PARSER_EXPORT StringLiteral: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(StringLiteral)
+ QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteral)
StringLiteral(NameId *v):
value (v) { kind = K; }
@@ -524,7 +524,7 @@ public:
class QML_PARSER_EXPORT RegExpLiteral: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(RegExpLiteral)
+ QDECLARATIVEJS_DECLARE_AST_NODE(RegExpLiteral)
RegExpLiteral(NameId *p, int f):
pattern (p), flags (f) { kind = K; }
@@ -548,7 +548,7 @@ public:
class QML_PARSER_EXPORT ArrayLiteral: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(ArrayLiteral)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArrayLiteral)
ArrayLiteral(Elision *e):
elements (0), elision (e)
@@ -583,7 +583,7 @@ public:
class QML_PARSER_EXPORT ObjectLiteral: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(ObjectLiteral)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ObjectLiteral)
ObjectLiteral():
properties (0) { kind = K; }
@@ -610,7 +610,7 @@ public:
class QML_PARSER_EXPORT ElementList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(ElementList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ElementList)
ElementList(Elision *e, ExpressionNode *expr):
elision (e), expression (expr), next (this)
@@ -645,7 +645,7 @@ public:
class QML_PARSER_EXPORT Elision: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(Elision)
+ QDECLARATIVEJS_DECLARE_AST_NODE(Elision)
Elision():
next (this) { kind = K; }
@@ -676,7 +676,7 @@ public:
class QML_PARSER_EXPORT PropertyNameAndValueList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(PropertyNameAndValueList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(PropertyNameAndValueList)
PropertyNameAndValueList(PropertyName *n, ExpressionNode *v):
name (n), value (v), next (this)
@@ -712,7 +712,7 @@ public:
class QML_PARSER_EXPORT PropertyName: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(PropertyName)
+ QDECLARATIVEJS_DECLARE_AST_NODE(PropertyName)
PropertyName() { kind = K; }
virtual ~PropertyName() {}
@@ -724,7 +724,7 @@ public:
class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName
{
public:
- QMLJS_DECLARE_AST_NODE(IdentifierPropertyName)
+ QDECLARATIVEJS_DECLARE_AST_NODE(IdentifierPropertyName)
IdentifierPropertyName(NameId *n):
id (n) { kind = K; }
@@ -740,7 +740,7 @@ public:
class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName
{
public:
- QMLJS_DECLARE_AST_NODE(StringLiteralPropertyName)
+ QDECLARATIVEJS_DECLARE_AST_NODE(StringLiteralPropertyName)
StringLiteralPropertyName(NameId *n):
id (n) { kind = K; }
@@ -755,7 +755,7 @@ public:
class QML_PARSER_EXPORT NumericLiteralPropertyName: public PropertyName
{
public:
- QMLJS_DECLARE_AST_NODE(NumericLiteralPropertyName)
+ QDECLARATIVEJS_DECLARE_AST_NODE(NumericLiteralPropertyName)
NumericLiteralPropertyName(double n):
id (n) { kind = K; }
@@ -770,7 +770,7 @@ public:
class QML_PARSER_EXPORT ArrayMemberExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(ArrayMemberExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArrayMemberExpression)
ArrayMemberExpression(ExpressionNode *b, ExpressionNode *e):
base (b), expression (e)
@@ -796,7 +796,7 @@ public:
class QML_PARSER_EXPORT FieldMemberExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(FieldMemberExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FieldMemberExpression)
FieldMemberExpression(ExpressionNode *b, NameId *n):
base (b), name (n)
@@ -822,7 +822,7 @@ public:
class QML_PARSER_EXPORT NewMemberExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(NewMemberExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(NewMemberExpression)
NewMemberExpression(ExpressionNode *b, ArgumentList *a):
base (b), arguments (a)
@@ -849,7 +849,7 @@ public:
class QML_PARSER_EXPORT NewExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(NewExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(NewExpression)
NewExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -872,7 +872,7 @@ public:
class QML_PARSER_EXPORT CallExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(CallExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(CallExpression)
CallExpression(ExpressionNode *b, ArgumentList *a):
base (b), arguments (a)
@@ -898,7 +898,7 @@ public:
class QML_PARSER_EXPORT ArgumentList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(ArgumentList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ArgumentList)
ArgumentList(ExpressionNode *e):
expression (e), next (this)
@@ -932,7 +932,7 @@ public:
class QML_PARSER_EXPORT PostIncrementExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(PostIncrementExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(PostIncrementExpression)
PostIncrementExpression(ExpressionNode *b):
base (b) { kind = K; }
@@ -955,7 +955,7 @@ public:
class QML_PARSER_EXPORT PostDecrementExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(PostDecrementExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(PostDecrementExpression)
PostDecrementExpression(ExpressionNode *b):
base (b) { kind = K; }
@@ -978,7 +978,7 @@ public:
class QML_PARSER_EXPORT DeleteExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(DeleteExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(DeleteExpression)
DeleteExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1000,7 +1000,7 @@ public:
class QML_PARSER_EXPORT VoidExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(VoidExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(VoidExpression)
VoidExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1023,7 +1023,7 @@ public:
class QML_PARSER_EXPORT TypeOfExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(TypeOfExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(TypeOfExpression)
TypeOfExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1046,7 +1046,7 @@ public:
class QML_PARSER_EXPORT PreIncrementExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(PreIncrementExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(PreIncrementExpression)
PreIncrementExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1069,7 +1069,7 @@ public:
class QML_PARSER_EXPORT PreDecrementExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(PreDecrementExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(PreDecrementExpression)
PreDecrementExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1092,7 +1092,7 @@ public:
class QML_PARSER_EXPORT UnaryPlusExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(UnaryPlusExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UnaryPlusExpression)
UnaryPlusExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1115,7 +1115,7 @@ public:
class QML_PARSER_EXPORT UnaryMinusExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(UnaryMinusExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UnaryMinusExpression)
UnaryMinusExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1138,7 +1138,7 @@ public:
class QML_PARSER_EXPORT TildeExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(TildeExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(TildeExpression)
TildeExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1161,7 +1161,7 @@ public:
class QML_PARSER_EXPORT NotExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(NotExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(NotExpression)
NotExpression(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1184,7 +1184,7 @@ public:
class QML_PARSER_EXPORT BinaryExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(BinaryExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(BinaryExpression)
BinaryExpression(ExpressionNode *l, int o, ExpressionNode *r):
left (l), op (o), right (r)
@@ -1212,7 +1212,7 @@ public:
class QML_PARSER_EXPORT ConditionalExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(ConditionalExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ConditionalExpression)
ConditionalExpression(ExpressionNode *e, ExpressionNode *t, ExpressionNode *f):
expression (e), ok (t), ko (f)
@@ -1239,7 +1239,7 @@ public:
class QML_PARSER_EXPORT Expression: public ExpressionNode // ### rename
{
public:
- QMLJS_DECLARE_AST_NODE(Expression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(Expression)
Expression(ExpressionNode *l, ExpressionNode *r):
left (l), right (r) { kind = K; }
@@ -1263,7 +1263,7 @@ public:
class QML_PARSER_EXPORT Block: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(Block)
+ QDECLARATIVEJS_DECLARE_AST_NODE(Block)
Block(StatementList *slist):
statements (slist) { kind = K; }
@@ -1287,7 +1287,7 @@ public:
class QML_PARSER_EXPORT StatementList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(StatementList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(StatementList)
StatementList(Statement *stmt):
statement (stmt), next (this)
@@ -1320,7 +1320,7 @@ public:
class QML_PARSER_EXPORT VariableStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(VariableStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableStatement)
VariableStatement(VariableDeclarationList *vlist):
declarations (vlist)
@@ -1345,7 +1345,7 @@ public:
class QML_PARSER_EXPORT VariableDeclaration: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(VariableDeclaration)
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclaration)
VariableDeclaration(NameId *n, ExpressionNode *e):
name (n), expression (e), readOnly(false)
@@ -1365,7 +1365,7 @@ public:
class QML_PARSER_EXPORT VariableDeclarationList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(VariableDeclarationList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(VariableDeclarationList)
VariableDeclarationList(VariableDeclaration *decl):
declaration (decl), next (this)
@@ -1404,7 +1404,7 @@ public:
class QML_PARSER_EXPORT EmptyStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(EmptyStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(EmptyStatement)
EmptyStatement() { kind = K; }
virtual ~EmptyStatement() {}
@@ -1424,7 +1424,7 @@ public:
class QML_PARSER_EXPORT ExpressionStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(ExpressionStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ExpressionStatement)
ExpressionStatement(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1447,7 +1447,7 @@ public:
class QML_PARSER_EXPORT IfStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(IfStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(IfStatement)
IfStatement(ExpressionNode *e, Statement *t, Statement *f = 0):
expression (e), ok (t), ko (f)
@@ -1481,7 +1481,7 @@ public:
class QML_PARSER_EXPORT DoWhileStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(DoWhileStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(DoWhileStatement)
DoWhileStatement(Statement *stmt, ExpressionNode *e):
statement (stmt), expression (e)
@@ -1510,7 +1510,7 @@ public:
class QML_PARSER_EXPORT WhileStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(WhileStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(WhileStatement)
WhileStatement(ExpressionNode *e, Statement *stmt):
expression (e), statement (stmt)
@@ -1537,7 +1537,7 @@ public:
class QML_PARSER_EXPORT ForStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(ForStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ForStatement)
ForStatement(ExpressionNode *i, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
initialiser (i), condition (c), expression (e), statement (stmt)
@@ -1568,7 +1568,7 @@ public:
class QML_PARSER_EXPORT LocalForStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(LocalForStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(LocalForStatement)
LocalForStatement(VariableDeclarationList *vlist, ExpressionNode *c, ExpressionNode *e, Statement *stmt):
declarations (vlist), condition (c), expression (e), statement (stmt)
@@ -1600,7 +1600,7 @@ public:
class QML_PARSER_EXPORT ForEachStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(ForEachStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ForEachStatement)
ForEachStatement(ExpressionNode *i, ExpressionNode *e, Statement *stmt):
initialiser (i), expression (e), statement (stmt)
@@ -1629,7 +1629,7 @@ public:
class QML_PARSER_EXPORT LocalForEachStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(LocalForEachStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(LocalForEachStatement)
LocalForEachStatement(VariableDeclaration *v, ExpressionNode *e, Statement *stmt):
declaration (v), expression (e), statement (stmt)
@@ -1659,7 +1659,7 @@ public:
class QML_PARSER_EXPORT ContinueStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(ContinueStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ContinueStatement)
ContinueStatement(NameId *l = 0):
label (l) { kind = K; }
@@ -1684,7 +1684,7 @@ public:
class QML_PARSER_EXPORT BreakStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(BreakStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(BreakStatement)
BreakStatement(NameId *l = 0):
label (l) { kind = K; }
@@ -1709,7 +1709,7 @@ public:
class QML_PARSER_EXPORT ReturnStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(ReturnStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ReturnStatement)
ReturnStatement(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1733,7 +1733,7 @@ public:
class QML_PARSER_EXPORT WithStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(WithStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(WithStatement)
WithStatement(ExpressionNode *e, Statement *stmt):
expression (e), statement (stmt)
@@ -1760,7 +1760,7 @@ public:
class QML_PARSER_EXPORT CaseBlock: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(CaseBlock)
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseBlock)
CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
clauses (c), defaultClause (d), moreClauses (r)
@@ -1781,7 +1781,7 @@ public:
class QML_PARSER_EXPORT SwitchStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(SwitchStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(SwitchStatement)
SwitchStatement(ExpressionNode *e, CaseBlock *b):
expression (e), block (b)
@@ -1808,7 +1808,7 @@ public:
class QML_PARSER_EXPORT CaseClauses: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(CaseClauses)
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseClauses)
CaseClauses(CaseClause *c):
clause (c), next (this)
@@ -1841,7 +1841,7 @@ public:
class QML_PARSER_EXPORT CaseClause: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(CaseClause)
+ QDECLARATIVEJS_DECLARE_AST_NODE(CaseClause)
CaseClause(ExpressionNode *e, StatementList *slist):
expression (e), statements (slist)
@@ -1861,7 +1861,7 @@ public:
class QML_PARSER_EXPORT DefaultClause: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(DefaultClause)
+ QDECLARATIVEJS_DECLARE_AST_NODE(DefaultClause)
DefaultClause(StatementList *slist):
statements (slist)
@@ -1880,7 +1880,7 @@ public:
class QML_PARSER_EXPORT LabelledStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(LabelledStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(LabelledStatement)
LabelledStatement(NameId *l, Statement *stmt):
label (l), statement (stmt)
@@ -1906,7 +1906,7 @@ public:
class QML_PARSER_EXPORT ThrowStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(ThrowStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(ThrowStatement)
ThrowStatement(ExpressionNode *e):
expression (e) { kind = K; }
@@ -1930,7 +1930,7 @@ public:
class QML_PARSER_EXPORT Catch: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(Catch)
+ QDECLARATIVEJS_DECLARE_AST_NODE(Catch)
Catch(NameId *n, Block *stmt):
name (n), statement (stmt)
@@ -1952,7 +1952,7 @@ public:
class QML_PARSER_EXPORT Finally: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(Finally)
+ QDECLARATIVEJS_DECLARE_AST_NODE(Finally)
Finally(Block *stmt):
statement (stmt)
@@ -1970,7 +1970,7 @@ public:
class QML_PARSER_EXPORT TryStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(TryStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(TryStatement)
TryStatement(Statement *stmt, Catch *c, Finally *f):
statement (stmt), catchExpression (c), finallyExpression (f)
@@ -2011,7 +2011,7 @@ public:
class QML_PARSER_EXPORT FunctionExpression: public ExpressionNode
{
public:
- QMLJS_DECLARE_AST_NODE(FunctionExpression)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionExpression)
FunctionExpression(NameId *n, FormalParameterList *f, FunctionBody *b):
name (n), formals (f), body (b)
@@ -2042,7 +2042,7 @@ public:
class QML_PARSER_EXPORT FunctionDeclaration: public FunctionExpression
{
public:
- QMLJS_DECLARE_AST_NODE(FunctionDeclaration)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionDeclaration)
FunctionDeclaration(NameId *n, FormalParameterList *f, FunctionBody *b):
FunctionExpression(n, f, b)
@@ -2056,7 +2056,7 @@ public:
class QML_PARSER_EXPORT FormalParameterList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(FormalParameterList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FormalParameterList)
FormalParameterList(NameId *n):
name (n), next (this)
@@ -2091,7 +2091,7 @@ public:
class QML_PARSER_EXPORT FunctionBody: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(FunctionBody)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionBody)
FunctionBody(SourceElements *elts):
elements (elts)
@@ -2108,7 +2108,7 @@ public:
class QML_PARSER_EXPORT Program: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(Program)
+ QDECLARATIVEJS_DECLARE_AST_NODE(Program)
Program(SourceElements *elts):
elements (elts)
@@ -2125,7 +2125,7 @@ public:
class QML_PARSER_EXPORT SourceElements: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(SourceElements)
+ QDECLARATIVEJS_DECLARE_AST_NODE(SourceElements)
SourceElements(SourceElement *elt):
element (elt), next (this)
@@ -2158,7 +2158,7 @@ public:
class QML_PARSER_EXPORT SourceElement: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(SourceElement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(SourceElement)
inline SourceElement()
{ kind = K; }
@@ -2169,7 +2169,7 @@ public:
class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
{
public:
- QMLJS_DECLARE_AST_NODE(FunctionSourceElement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(FunctionSourceElement)
FunctionSourceElement(FunctionDeclaration *f):
declaration (f)
@@ -2186,7 +2186,7 @@ public:
class QML_PARSER_EXPORT StatementSourceElement: public SourceElement
{
public:
- QMLJS_DECLARE_AST_NODE(StatementSourceElement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(StatementSourceElement)
StatementSourceElement(Statement *stmt):
statement (stmt)
@@ -2203,7 +2203,7 @@ public:
class QML_PARSER_EXPORT DebuggerStatement: public Statement
{
public:
- QMLJS_DECLARE_AST_NODE(DebuggerStatement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(DebuggerStatement)
DebuggerStatement()
{ kind = K; }
@@ -2226,7 +2226,7 @@ public:
class QML_PARSER_EXPORT UiProgram: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiProgram)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiProgram)
UiProgram(UiImportList *imports, UiObjectMemberList *members)
: imports(imports), members(members)
@@ -2242,7 +2242,7 @@ public:
class QML_PARSER_EXPORT UiQualifiedId: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiQualifiedId)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiQualifiedId)
UiQualifiedId(NameId *name)
: next(this), name(name)
@@ -2276,7 +2276,7 @@ public:
class QML_PARSER_EXPORT UiImport: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiImport)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiImport)
UiImport(NameId *fileName)
: fileName(fileName), importUri(0), importId(0)
@@ -2309,7 +2309,7 @@ public:
class QML_PARSER_EXPORT UiImportList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiImportList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiImportList)
UiImportList(UiImport *import)
: import(import),
@@ -2365,7 +2365,7 @@ public:
class QML_PARSER_EXPORT UiObjectMemberList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiObjectMemberList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectMemberList)
UiObjectMemberList(UiObjectMember *member)
: next(this), member(member)
@@ -2396,7 +2396,7 @@ public:
class QML_PARSER_EXPORT UiArrayMemberList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiArrayMemberList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayMemberList)
UiArrayMemberList(UiObjectMember *member)
: next(this), member(member)
@@ -2428,7 +2428,7 @@ public:
class QML_PARSER_EXPORT UiObjectInitializer: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiObjectInitializer)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectInitializer)
UiObjectInitializer(UiObjectMemberList *members)
: members(members)
@@ -2445,7 +2445,7 @@ public:
class QML_PARSER_EXPORT UiParameterList: public Node
{
public:
- QMLJS_DECLARE_AST_NODE(UiParameterList)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiParameterList)
UiParameterList(NameId *t, NameId *n):
type (t), name (n), next (this)
@@ -2481,7 +2481,7 @@ public:
class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember
{
public:
- QMLJS_DECLARE_AST_NODE(UiPublicMember)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiPublicMember)
UiPublicMember(NameId *memberType,
NameId *name)
@@ -2533,7 +2533,7 @@ public:
class QML_PARSER_EXPORT UiObjectDefinition: public UiObjectMember
{
public:
- QMLJS_DECLARE_AST_NODE(UiObjectDefinition)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectDefinition)
UiObjectDefinition(UiQualifiedId *qualifiedTypeNameId,
UiObjectInitializer *initializer)
@@ -2556,7 +2556,7 @@ public:
class QML_PARSER_EXPORT UiSourceElement: public UiObjectMember
{
public:
- QMLJS_DECLARE_AST_NODE(UiSourceElement)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiSourceElement)
UiSourceElement(Node *sourceElement)
: sourceElement(sourceElement)
@@ -2592,7 +2592,7 @@ public:
class QML_PARSER_EXPORT UiObjectBinding: public UiObjectMember
{
public:
- QMLJS_DECLARE_AST_NODE(UiObjectBinding)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiObjectBinding)
UiObjectBinding(UiQualifiedId *qualifiedId,
UiQualifiedId *qualifiedTypeNameId,
@@ -2620,7 +2620,7 @@ public:
class QML_PARSER_EXPORT UiScriptBinding: public UiObjectMember
{
public:
- QMLJS_DECLARE_AST_NODE(UiScriptBinding)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiScriptBinding)
UiScriptBinding(UiQualifiedId *qualifiedId,
Statement *statement)
@@ -2645,7 +2645,7 @@ public:
class QML_PARSER_EXPORT UiArrayBinding: public UiObjectMember
{
public:
- QMLJS_DECLARE_AST_NODE(UiArrayBinding)
+ QDECLARATIVEJS_DECLARE_AST_NODE(UiArrayBinding)
UiArrayBinding(UiQualifiedId *qualifiedId,
UiArrayMemberList *members)
diff --git a/src/declarative/qml/parser/qmljsastfwd_p.h b/src/declarative/qml/parser/qdeclarativejsastfwd_p.h
index 2c42fd9..5a444b7 100644
--- a/src/declarative/qml/parser/qmljsastfwd_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsastfwd_p.h
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#ifndef QMLJSAST_FWD_P_H
-#define QMLJSAST_FWD_P_H
+#ifndef QDECLARATIVEJSAST_FWD_P_H
+#define QDECLARATIVEJSAST_FWD_P_H
-#include "qmljsglobal_p.h"
+#include "qdeclarativejsglobal_p.h"
#include <QtCore/qglobal.h>
@@ -59,7 +59,7 @@
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS { namespace AST {
+namespace QDeclarativeJS { namespace AST {
class SourceLocation
{
diff --git a/src/declarative/qml/parser/qmljsastvisitor.cpp b/src/declarative/qml/parser/qdeclarativejsastvisitor.cpp
index bd7439c..d8002cf 100644
--- a/src/declarative/qml/parser/qmljsastvisitor.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsastvisitor.cpp
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#include "qmljsastvisitor_p.h"
+#include "qdeclarativejsastvisitor_p.h"
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS { namespace AST {
+namespace QDeclarativeJS { namespace AST {
Visitor::Visitor()
{
@@ -53,6 +53,6 @@ Visitor::~Visitor()
{
}
-} } // namespace QmlJS::AST
+} } // namespace QDeclarativeJS::AST
QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qmljsastvisitor_p.h b/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h
index 9007a2c..82abbcf 100644
--- a/src/declarative/qml/parser/qmljsastvisitor_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsastvisitor_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLJSASTVISITOR_P_H
-#define QMLJSASTVISITOR_P_H
+#ifndef QDECLARATIVEJSASTVISITOR_P_H
+#define QDECLARATIVEJSASTVISITOR_P_H
//
// W A R N I N G
@@ -53,12 +53,12 @@
// We mean it.
//
-#include "qmljsastfwd_p.h"
-#include "qmljsglobal_p.h"
+#include "qdeclarativejsastfwd_p.h"
+#include "qdeclarativejsglobal_p.h"
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS { namespace AST {
+namespace QDeclarativeJS { namespace AST {
class QML_PARSER_EXPORT Visitor
{
@@ -104,7 +104,7 @@ public:
virtual void endVisit(UiFormalList *) {}
virtual void endVisit(UiFormal *) {}
- // QmlJS
+ // QDeclarativeJS
virtual bool visit(ThisExpression *) { return true; }
virtual void endVisit(ThisExpression *) {}
@@ -332,4 +332,4 @@ public:
QT_QML_END_NAMESPACE
-#endif // QMLJSASTVISITOR_P_H
+#endif // QDECLARATIVEJSASTVISITOR_P_H
diff --git a/src/declarative/qml/parser/qmljsengine_p.cpp b/src/declarative/qml/parser/qdeclarativejsengine_p.cpp
index 84bb1c5..7d39134 100644
--- a/src/declarative/qml/parser/qmljsengine_p.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsengine_p.cpp
@@ -39,19 +39,19 @@
**
****************************************************************************/
-#include "qmljsengine_p.h"
+#include "qdeclarativejsengine_p.h"
-#include "qmljsglobal_p.h"
-#include "qmljsnodepool_p.h"
+#include "qdeclarativejsglobal_p.h"
+#include "qdeclarativejsnodepool_p.h"
#include <qnumeric.h>
#include <QHash>
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
-uint qHash(const QmlJS::NameId &id)
+uint qHash(const QDeclarativeJS::NameId &id)
{ return qHash(id.asString()); }
QString numberToString(double value)
@@ -182,9 +182,9 @@ QSet<NameId> Engine::literals() const
{ return _literals; }
void Engine::addComment(int pos, int len, int line, int col)
-{ if (len > 0) _comments.append(QmlJS::AST::SourceLocation(pos, len, line, col)); }
+{ if (len > 0) _comments.append(QDeclarativeJS::AST::SourceLocation(pos, len, line, col)); }
-QList<QmlJS::AST::SourceLocation> Engine::comments() const
+QList<QDeclarativeJS::AST::SourceLocation> Engine::comments() const
{ return _comments; }
NameId *Engine::intern(const QChar *u, int s)
@@ -207,6 +207,6 @@ void Engine::setNodePool(NodePool *nodePool)
-} // end of namespace QmlJS
+} // end of namespace QDeclarativeJS
QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qmljsengine_p.h b/src/declarative/qml/parser/qdeclarativejsengine_p.h
index ebfeb1b..61188f7 100644
--- a/src/declarative/qml/parser/qmljsengine_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsengine_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLJSENGINE_P_H
-#define QMLJSENGINE_P_H
+#ifndef QDECLARATIVEJSENGINE_P_H
+#define QDECLARATIVEJSENGINE_P_H
//
// W A R N I N G
@@ -53,15 +53,15 @@
// We mean it.
//
-#include "qmljsglobal_p.h"
-#include "qmljsastfwd_p.h"
+#include "qdeclarativejsglobal_p.h"
+#include "qdeclarativejsastfwd_p.h"
#include <QString>
#include <QSet>
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
class QML_PARSER_EXPORT NameId
{
QString _text;
@@ -84,17 +84,17 @@ public:
{ return _text < other._text; }
};
-uint qHash(const QmlJS::NameId &id);
+uint qHash(const QDeclarativeJS::NameId &id);
-} // end of namespace QmlJS
+} // end of namespace QDeclarativeJS
#if defined(Q_CC_MSVC) && _MSC_VER <= 1300
-//this ensures that code outside QmlJS can use the hash function
+//this ensures that code outside QDeclarativeJS can use the hash function
//it also a workaround for some compilers
-inline uint qHash(const QmlJS::NameId &nameId) { return QmlJS::qHash(nameId); }
+inline uint qHash(const QDeclarativeJS::NameId &nameId) { return QDeclarativeJS::qHash(nameId); }
#endif
-namespace QmlJS {
+namespace QDeclarativeJS {
class Lexer;
class NodePool;
@@ -144,7 +144,7 @@ class QML_PARSER_EXPORT Engine
Lexer *_lexer;
NodePool *_nodePool;
QSet<NameId> _literals;
- QList<QmlJS::AST::SourceLocation> _comments;
+ QList<QDeclarativeJS::AST::SourceLocation> _comments;
public:
Engine();
@@ -153,7 +153,7 @@ public:
QSet<NameId> literals() const;
void addComment(int pos, int len, int line, int col);
- QList<QmlJS::AST::SourceLocation> comments() const;
+ QList<QDeclarativeJS::AST::SourceLocation> comments() const;
NameId *intern(const QChar *u, int s);
@@ -166,8 +166,8 @@ public:
void setNodePool(NodePool *nodePool);
};
-} // end of namespace QmlJS
+} // end of namespace QDeclarativeJS
QT_QML_END_NAMESPACE
-#endif // QMLJSENGINE_P_H
+#endif // QDECLARATIVEJSENGINE_P_H
diff --git a/src/declarative/qml/parser/qmljsglobal_p.h b/src/declarative/qml/parser/qdeclarativejsglobal_p.h
index 4457450..7c901ae 100644
--- a/src/declarative/qml/parser/qmljsglobal_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsglobal_p.h
@@ -38,8 +38,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QMLJSGLOBAL_P_H
-#define QMLJSGLOBAL_P_H
+#ifndef QDECLARATIVEJSGLOBAL_P_H
+#define QDECLARATIVEJSGLOBAL_P_H
#include <QtCore/qglobal.h>
@@ -47,13 +47,13 @@
# define QT_QML_BEGIN_NAMESPACE
# define QT_QML_END_NAMESPACE
-# ifdef QMLJS_BUILD_DIR
+# ifdef QDECLARATIVEJS_BUILD_DIR
# define QML_PARSER_EXPORT Q_DECL_EXPORT
# elif QML_BUILD_STATIC_LIB
# define QML_PARSER_EXPORT
# else
# define QML_PARSER_EXPORT Q_DECL_IMPORT
-# endif // QMLJS_BUILD_DIR
+# endif // QDECLARATIVEJS_BUILD_DIR
#else // !QT_CREATOR
# define QT_QML_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -61,4 +61,4 @@
# define QML_PARSER_EXPORT
#endif // QT_CREATOR
-#endif // QMLJSGLOBAL_P_H
+#endif // QDECLARATIVEJSGLOBAL_P_H
diff --git a/src/declarative/qml/parser/qmljsgrammar.cpp b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
index 12071db..aadb432 100644
--- a/src/declarative/qml/parser/qmljsgrammar.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
@@ -40,11 +40,11 @@
****************************************************************************/
// This file was generated by qlalr - DO NOT EDIT!
-#include "qmljsgrammar_p.h"
+#include "qdeclarativejsgrammar_p.h"
QT_BEGIN_NAMESPACE
-const char *const QmlJSGrammar::spell [] = {
+const char *const QDeclarativeJSGrammar::spell [] = {
"end of file", "&", "&&", "&=", "break", "case", "catch", ":", ";", "continue",
"default", "delete", "/", "/=", "do", ".", "else", "=", "==", "===",
"finally", "for", "function", ">=", ">", ">>", ">>=", ">>>", ">>>=", "identifier",
@@ -56,7 +56,7 @@ const char *const QmlJSGrammar::spell [] = {
"^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", "public",
"import", "as", 0, 0, 0, 0, 0, 0, 0, 0};
-const short QmlJSGrammar::lhs [] = {
+const short QDeclarativeJSGrammar::lhs [] = {
100, 100, 100, 100, 100, 100, 101, 107, 107, 110,
110, 112, 111, 111, 111, 111, 111, 111, 111, 111,
114, 109, 108, 117, 117, 118, 118, 119, 119, 116,
@@ -93,7 +93,7 @@ const short QmlJSGrammar::lhs [] = {
200, 200, 203, 106, 204, 204, 104, 104, 201, 201,
133, 133, 205};
-const short QmlJSGrammar::rhs [] = {
+const short QDeclarativeJSGrammar::rhs [] = {
2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
2, 1, 2, 2, 3, 3, 5, 5, 4, 4,
2, 0, 1, 1, 2, 1, 3, 2, 3, 2,
@@ -130,7 +130,7 @@ const short QmlJSGrammar::rhs [] = {
0, 1, 1, 1, 1, 2, 1, 1, 0, 1,
0, 1, 2};
-const short QmlJSGrammar::action_default [] = {
+const short QDeclarativeJSGrammar::action_default [] = {
0, 0, 0, 0, 0, 0, 22, 0, 170, 237,
201, 209, 205, 149, 221, 197, 3, 134, 68, 150,
213, 217, 138, 167, 148, 153, 133, 187, 174, 0,
@@ -196,7 +196,7 @@ const short QmlJSGrammar::action_default [] = {
13, 0, 14, 0, 19, 20, 0, 15, 16, 0,
17, 18, 11, 23, 7, 343};
-const short QmlJSGrammar::goto_default [] = {
+const short QDeclarativeJSGrammar::goto_default [] = {
7, 616, 206, 195, 204, 506, 494, 615, 634, 610,
614, 612, 617, 22, 613, 18, 505, 607, 598, 560,
507, 190, 194, 196, 200, 523, 549, 548, 199, 231,
@@ -209,7 +209,7 @@ const short QmlJSGrammar::goto_default [] = {
463, 322, 418, 422, 425, 421, 420, 440, 441, 184,
198, 180, 183, 197, 205, 0};
-const short QmlJSGrammar::action_index [] = {
+const short QDeclarativeJSGrammar::action_index [] = {
439, 1109, 2228, 2228, 2132, 814, -74, 18, 147, -100,
31, -17, -49, 232, -100, 318, 85, -100, -100, 554,
33, 94, 331, 215, -100, -100, -100, 448, 231, 1109,
@@ -340,7 +340,7 @@ const short QmlJSGrammar::action_index [] = {
-106, -106, -106, -106, -106, -106, 5, -106, -106, -106,
-106, -106, -106, -106, -106, -106};
-const short QmlJSGrammar::action_info [] = {
+const short QDeclarativeJSGrammar::action_info [] = {
-97, -98, 452, 611, -116, 527, 456, -124, 415, -121,
439, 551, -119, -108, 347, -94, 611, 388, 635, 540,
351, 341, 344, 342, 390, 539, -127, 256, 398, 402,
@@ -638,7 +638,7 @@ const short QmlJSGrammar::action_info [] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0};
-const short QmlJSGrammar::action_check [] = {
+const short QDeclarativeJSGrammar::action_check [] = {
7, 7, 36, 90, 7, 29, 36, 7, 36, 7,
33, 8, 7, 7, 36, 7, 90, 7, 0, 7,
16, 60, 55, 33, 8, 29, 7, 36, 7, 55,
diff --git a/src/declarative/qml/parser/qmljsgrammar_p.h b/src/declarative/qml/parser/qdeclarativejsgrammar_p.h
index 21fddba..d6c3d6b 100644
--- a/src/declarative/qml/parser/qmljsgrammar_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsgrammar_p.h
@@ -51,14 +51,14 @@
//
// This file was generated by qlalr - DO NOT EDIT!
-#ifndef QMLJSGRAMMAR_P_H
-#define QMLJSGRAMMAR_P_H
+#ifndef QDECLARATIVEJSGRAMMAR_P_H
+#define QDECLARATIVEJSGRAMMAR_P_H
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
-class QmlJSGrammar
+class QDeclarativeJSGrammar
{
public:
enum VariousConstants {
@@ -205,5 +205,5 @@ public:
QT_END_NAMESPACE
-#endif // QMLJSGRAMMAR_P_H
+#endif // QDECLARATIVEJSGRAMMAR_P_H
diff --git a/src/declarative/qml/parser/qmljslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index 816542f..384d00c 100644
--- a/src/declarative/qml/parser/qmljslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -43,11 +43,11 @@
#include <config.h>
#endif
-#include "qmljslexer_p.h"
+#include "qdeclarativejslexer_p.h"
-#include "qmljsglobal_p.h"
-#include "qmljsengine_p.h"
-#include "qmljsgrammar_p.h"
+#include "qdeclarativejsglobal_p.h"
+#include "qdeclarativejsengine_p.h"
+#include "qdeclarativejsgrammar_p.h"
#include <QtCore/qcoreapplication.h>
@@ -69,11 +69,11 @@ extern double qstrtod(const char *s00, char const **se, bool *ok);
} \
while (0)
-namespace QmlJS {
+namespace QDeclarativeJS {
extern double integerFromString(const char *buf, int size, int radix);
}
-using namespace QmlJS;
+using namespace QDeclarativeJS;
Lexer::Lexer(Engine *eng, bool tokenizeComments)
: driver(eng),
@@ -159,68 +159,68 @@ int Lexer::findReservedWord(const QChar *c, int size) const
switch (size) {
case 2: {
if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o'))
- return QmlJSGrammar::T_DO;
+ return QDeclarativeJSGrammar::T_DO;
else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('f'))
- return QmlJSGrammar::T_IF;
+ return QDeclarativeJSGrammar::T_IF;
else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n'))
- return QmlJSGrammar::T_IN;
+ return QDeclarativeJSGrammar::T_IN;
else if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('s'))
- return QmlJSGrammar::T_AS;
+ return QDeclarativeJSGrammar::T_AS;
} break;
case 3: {
if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('o') && c[2] == QLatin1Char('r'))
- return QmlJSGrammar::T_FOR;
+ return QDeclarativeJSGrammar::T_FOR;
else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('e') && c[2] == QLatin1Char('w'))
- return QmlJSGrammar::T_NEW;
+ return QDeclarativeJSGrammar::T_NEW;
else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r') && c[2] == QLatin1Char('y'))
- return QmlJSGrammar::T_TRY;
+ return QDeclarativeJSGrammar::T_TRY;
else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('r'))
- return QmlJSGrammar::T_VAR;
+ return QDeclarativeJSGrammar::T_VAR;
else if (check_reserved) {
if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('n') && c[2] == QLatin1Char('t'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
case 4: {
if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
&& c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
- return QmlJSGrammar::T_CASE;
+ return QDeclarativeJSGrammar::T_CASE;
else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('l')
&& c[2] == QLatin1Char('s') && c[3] == QLatin1Char('e'))
- return QmlJSGrammar::T_ELSE;
+ return QDeclarativeJSGrammar::T_ELSE;
else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
&& c[2] == QLatin1Char('i') && c[3] == QLatin1Char('s'))
- return QmlJSGrammar::T_THIS;
+ return QDeclarativeJSGrammar::T_THIS;
else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
&& c[2] == QLatin1Char('i') && c[3] == QLatin1Char('d'))
- return QmlJSGrammar::T_VOID;
+ return QDeclarativeJSGrammar::T_VOID;
else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('i')
&& c[2] == QLatin1Char('t') && c[3] == QLatin1Char('h'))
- return QmlJSGrammar::T_WITH;
+ return QDeclarativeJSGrammar::T_WITH;
else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
&& c[2] == QLatin1Char('u') && c[3] == QLatin1Char('e'))
- return QmlJSGrammar::T_TRUE;
+ return QDeclarativeJSGrammar::T_TRUE;
else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('u')
&& c[2] == QLatin1Char('l') && c[3] == QLatin1Char('l'))
- return QmlJSGrammar::T_NULL;
+ return QDeclarativeJSGrammar::T_NULL;
else if (check_reserved) {
if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('n')
&& c[2] == QLatin1Char('u') && c[3] == QLatin1Char('m'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('y')
&& c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('l') && c[1] == QLatin1Char('o')
&& c[2] == QLatin1Char('n') && c[3] == QLatin1Char('g'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('h')
&& c[2] == QLatin1Char('a') && c[3] == QLatin1Char('r'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('g') && c[1] == QLatin1Char('o')
&& c[2] == QLatin1Char('t') && c[3] == QLatin1Char('o'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -228,48 +228,48 @@ int Lexer::findReservedWord(const QChar *c, int size) const
if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('r')
&& c[2] == QLatin1Char('e') && c[3] == QLatin1Char('a')
&& c[4] == QLatin1Char('k'))
- return QmlJSGrammar::T_BREAK;
+ return QDeclarativeJSGrammar::T_BREAK;
else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('a')
&& c[2] == QLatin1Char('t') && c[3] == QLatin1Char('c')
&& c[4] == QLatin1Char('h'))
- return QmlJSGrammar::T_CATCH;
+ return QDeclarativeJSGrammar::T_CATCH;
else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
&& c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
&& c[4] == QLatin1Char('w'))
- return QmlJSGrammar::T_THROW;
+ return QDeclarativeJSGrammar::T_THROW;
else if (c[0] == QLatin1Char('w') && c[1] == QLatin1Char('h')
&& c[2] == QLatin1Char('i') && c[3] == QLatin1Char('l')
&& c[4] == QLatin1Char('e'))
- return QmlJSGrammar::T_WHILE;
+ return QDeclarativeJSGrammar::T_WHILE;
else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('o')
&& c[2] == QLatin1Char('n') && c[3] == QLatin1Char('s')
&& c[4] == QLatin1Char('t'))
- return QmlJSGrammar::T_CONST;
+ return QDeclarativeJSGrammar::T_CONST;
else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('a')
&& c[2] == QLatin1Char('l') && c[3] == QLatin1Char('s')
&& c[4] == QLatin1Char('e'))
- return QmlJSGrammar::T_FALSE;
+ return QDeclarativeJSGrammar::T_FALSE;
else if (check_reserved) {
if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('h')
&& c[2] == QLatin1Char('o') && c[3] == QLatin1Char('r')
&& c[4] == QLatin1Char('t'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('u')
&& c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
&& c[4] == QLatin1Char('r'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
&& c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
&& c[4] == QLatin1Char('l'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('c') && c[1] == QLatin1Char('l')
&& c[2] == QLatin1Char('a') && c[3] == QLatin1Char('s')
&& c[4] == QLatin1Char('s'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('l')
&& c[2] == QLatin1Char('o') && c[3] == QLatin1Char('a')
&& c[4] == QLatin1Char('t'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -277,56 +277,56 @@ int Lexer::findReservedWord(const QChar *c, int size) const
if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
&& c[2] == QLatin1Char('l') && c[3] == QLatin1Char('e')
&& c[4] == QLatin1Char('t') && c[5] == QLatin1Char('e'))
- return QmlJSGrammar::T_DELETE;
+ return QDeclarativeJSGrammar::T_DELETE;
else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e')
&& c[2] == QLatin1Char('t') && c[3] == QLatin1Char('u')
&& c[4] == QLatin1Char('r') && c[5] == QLatin1Char('n'))
- return QmlJSGrammar::T_RETURN;
+ return QDeclarativeJSGrammar::T_RETURN;
else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('w')
&& c[2] == QLatin1Char('i') && c[3] == QLatin1Char('t')
&& c[4] == QLatin1Char('c') && c[5] == QLatin1Char('h'))
- return QmlJSGrammar::T_SWITCH;
+ return QDeclarativeJSGrammar::T_SWITCH;
else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('y')
&& c[2] == QLatin1Char('p') && c[3] == QLatin1Char('e')
&& c[4] == QLatin1Char('o') && c[5] == QLatin1Char('f'))
- return QmlJSGrammar::T_TYPEOF;
+ return QDeclarativeJSGrammar::T_TYPEOF;
else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
&& c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
&& c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
- return QmlJSGrammar::T_IMPORT;
+ return QDeclarativeJSGrammar::T_IMPORT;
else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('i')
&& c[2] == QLatin1Char('g') && c[3] == QLatin1Char('n')
&& c[4] == QLatin1Char('a') && c[5] == QLatin1Char('l'))
- return QmlJSGrammar::T_SIGNAL;
+ return QDeclarativeJSGrammar::T_SIGNAL;
else if (check_reserved) {
if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
&& c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
&& c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('s') && c[1] == QLatin1Char('t')
&& c[2] == QLatin1Char('a') && c[3] == QLatin1Char('t')
&& c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('o')
&& c[2] == QLatin1Char('u') && c[3] == QLatin1Char('b')
&& c[4] == QLatin1Char('l') && c[5] == QLatin1Char('e'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
&& c[2] == QLatin1Char('p') && c[3] == QLatin1Char('o')
&& c[4] == QLatin1Char('r') && c[5] == QLatin1Char('t'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('u')
&& c[2] == QLatin1Char('b') && c[3] == QLatin1Char('l')
&& c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c'))
- return QmlJSGrammar::T_PUBLIC;
+ return QDeclarativeJSGrammar::T_PUBLIC;
else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('a')
&& c[2] == QLatin1Char('t') && c[3] == QLatin1Char('i')
&& c[4] == QLatin1Char('v') && c[5] == QLatin1Char('e'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('h')
&& c[2] == QLatin1Char('r') && c[3] == QLatin1Char('o')
&& c[4] == QLatin1Char('w') && c[5] == QLatin1Char('s'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -335,33 +335,33 @@ int Lexer::findReservedWord(const QChar *c, int size) const
&& c[2] == QLatin1Char('f') && c[3] == QLatin1Char('a')
&& c[4] == QLatin1Char('u') && c[5] == QLatin1Char('l')
&& c[6] == QLatin1Char('t'))
- return QmlJSGrammar::T_DEFAULT;
+ return QDeclarativeJSGrammar::T_DEFAULT;
else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('i')
&& c[2] == QLatin1Char('n') && c[3] == QLatin1Char('a')
&& c[4] == QLatin1Char('l') && c[5] == QLatin1Char('l')
&& c[6] == QLatin1Char('y'))
- return QmlJSGrammar::T_FINALLY;
+ return QDeclarativeJSGrammar::T_FINALLY;
else if (check_reserved) {
if (c[0] == QLatin1Char('b') && c[1] == QLatin1Char('o')
&& c[2] == QLatin1Char('o') && c[3] == QLatin1Char('l')
&& c[4] == QLatin1Char('e') && c[5] == QLatin1Char('a')
&& c[6] == QLatin1Char('n'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('e') && c[1] == QLatin1Char('x')
&& c[2] == QLatin1Char('t') && c[3] == QLatin1Char('e')
&& c[4] == QLatin1Char('n') && c[5] == QLatin1Char('d')
&& c[6] == QLatin1Char('s'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('a')
&& c[2] == QLatin1Char('c') && c[3] == QLatin1Char('k')
&& c[4] == QLatin1Char('a') && c[5] == QLatin1Char('g')
&& c[6] == QLatin1Char('e'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
&& c[2] == QLatin1Char('i') && c[3] == QLatin1Char('v')
&& c[4] == QLatin1Char('a') && c[5] == QLatin1Char('t')
&& c[6] == QLatin1Char('e'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -370,38 +370,38 @@ int Lexer::findReservedWord(const QChar *c, int size) const
&& c[2] == QLatin1Char('n') && c[3] == QLatin1Char('t')
&& c[4] == QLatin1Char('i') && c[5] == QLatin1Char('n')
&& c[6] == QLatin1Char('u') && c[7] == QLatin1Char('e'))
- return QmlJSGrammar::T_CONTINUE;
+ return QDeclarativeJSGrammar::T_CONTINUE;
else if (c[0] == QLatin1Char('f') && c[1] == QLatin1Char('u')
&& c[2] == QLatin1Char('n') && c[3] == QLatin1Char('c')
&& c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
&& c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n'))
- return QmlJSGrammar::T_FUNCTION;
+ return QDeclarativeJSGrammar::T_FUNCTION;
else if (c[0] == QLatin1Char('d') && c[1] == QLatin1Char('e')
&& c[2] == QLatin1Char('b') && c[3] == QLatin1Char('u')
&& c[4] == QLatin1Char('g') && c[5] == QLatin1Char('g')
&& c[6] == QLatin1Char('e') && c[7] == QLatin1Char('r'))
- return QmlJSGrammar::T_DEBUGGER;
+ return QDeclarativeJSGrammar::T_DEBUGGER;
else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
&& c[2] == QLatin1Char('o') && c[3] == QLatin1Char('p')
&& c[4] == QLatin1Char('e') && c[5] == QLatin1Char('r')
&& c[6] == QLatin1Char('t') && c[7] == QLatin1Char('y'))
- return QmlJSGrammar::T_PROPERTY;
+ return QDeclarativeJSGrammar::T_PROPERTY;
else if (c[0] == QLatin1Char('r') && c[1] == QLatin1Char('e')
&& c[2] == QLatin1Char('a') && c[3] == QLatin1Char('d')
&& c[4] == QLatin1Char('o') && c[5] == QLatin1Char('n')
&& c[6] == QLatin1Char('l') && c[7] == QLatin1Char('y'))
- return QmlJSGrammar::T_READONLY;
+ return QDeclarativeJSGrammar::T_READONLY;
else if (check_reserved) {
if (c[0] == QLatin1Char('a') && c[1] == QLatin1Char('b')
&& c[2] == QLatin1Char('s') && c[3] == QLatin1Char('t')
&& c[4] == QLatin1Char('r') && c[5] == QLatin1Char('a')
&& c[6] == QLatin1Char('c') && c[7] == QLatin1Char('t'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('v') && c[1] == QLatin1Char('o')
&& c[2] == QLatin1Char('l') && c[3] == QLatin1Char('a')
&& c[4] == QLatin1Char('t') && c[5] == QLatin1Char('i')
&& c[6] == QLatin1Char('l') && c[7] == QLatin1Char('e'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -412,19 +412,19 @@ int Lexer::findReservedWord(const QChar *c, int size) const
&& c[4] == QLatin1Char('r') && c[5] == QLatin1Char('f')
&& c[6] == QLatin1Char('a') && c[7] == QLatin1Char('c')
&& c[8] == QLatin1Char('e'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('t') && c[1] == QLatin1Char('r')
&& c[2] == QLatin1Char('a') && c[3] == QLatin1Char('n')
&& c[4] == QLatin1Char('s') && c[5] == QLatin1Char('i')
&& c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
&& c[8] == QLatin1Char('t'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('r')
&& c[2] == QLatin1Char('o') && c[3] == QLatin1Char('t')
&& c[4] == QLatin1Char('e') && c[5] == QLatin1Char('c')
&& c[6] == QLatin1Char('t') && c[7] == QLatin1Char('e')
&& c[8] == QLatin1Char('d'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -434,14 +434,14 @@ int Lexer::findReservedWord(const QChar *c, int size) const
&& c[4] == QLatin1Char('a') && c[5] == QLatin1Char('n')
&& c[6] == QLatin1Char('c') && c[7] == QLatin1Char('e')
&& c[8] == QLatin1Char('o') && c[9] == QLatin1Char('f'))
- return QmlJSGrammar::T_INSTANCEOF;
+ return QDeclarativeJSGrammar::T_INSTANCEOF;
else if (check_reserved) {
if (c[0] == QLatin1Char('i') && c[1] == QLatin1Char('m')
&& c[2] == QLatin1Char('p') && c[3] == QLatin1Char('l')
&& c[4] == QLatin1Char('e') && c[5] == QLatin1Char('m')
&& c[6] == QLatin1Char('e') && c[7] == QLatin1Char('n')
&& c[8] == QLatin1Char('t') && c[9] == QLatin1Char('s'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -453,7 +453,7 @@ int Lexer::findReservedWord(const QChar *c, int size) const
&& c[6] == QLatin1Char('o') && c[7] == QLatin1Char('n')
&& c[8] == QLatin1Char('i') && c[9] == QLatin1Char('z')
&& c[10] == QLatin1Char('e') && c[11] == QLatin1Char('d'))
- return QmlJSGrammar::T_RESERVED_WORD;
+ return QDeclarativeJSGrammar::T_RESERVED_WORD;
}
} break;
@@ -497,7 +497,7 @@ int Lexer::lex()
syncProhibitAutomaticSemicolon();
if (!terminator && !delimited && !prohibitAutomaticSemicolon) {
// automatic semicolon insertion if program incomplete
- token = QmlJSGrammar::T_SEMICOLON;
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
stackToken = 0;
setDone(Other);
} else {
@@ -511,7 +511,7 @@ int Lexer::lex()
terminator = true;
syncProhibitAutomaticSemicolon();
if (restrKeyword) {
- token = QmlJSGrammar::T_SEMICOLON;
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
setDone(Other);
}
} else if (current == '"' || current == '\'') {
@@ -540,18 +540,18 @@ int Lexer::lex()
token = matchPunctuator(current, next1, next2, next3);
if (token != -1) {
if (terminator && !delimited && !prohibitAutomaticSemicolon
- && (token == QmlJSGrammar::T_PLUS_PLUS
- || token == QmlJSGrammar::T_MINUS_MINUS)) {
+ && (token == QDeclarativeJSGrammar::T_PLUS_PLUS
+ || token == QDeclarativeJSGrammar::T_MINUS_MINUS)) {
// automatic semicolon insertion
stackToken = token;
- token = QmlJSGrammar::T_SEMICOLON;
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
}
setDone(Other);
}
else {
setDone(Bad);
err = IllegalCharacter;
- errmsg = QCoreApplication::translate("QmlParser", "Illegal character");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal character");
}
}
break;
@@ -565,7 +565,7 @@ int Lexer::lex()
} else if (current == 0 || isLineTerminator()) {
setDone(Bad);
err = UnclosedStringLiteral;
- errmsg = QCoreApplication::translate("QmlParser", "Unclosed string at end of line");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed string at end of line");
} else if (current == '\\') {
state = InEscapeSequence;
} else {
@@ -591,7 +591,7 @@ int Lexer::lex()
} else {
setDone(Bad);
err = IllegalEscapeSequence;
- errmsg = QCoreApplication::translate("QmlParser", "Illegal escape squence");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal escape squence");
}
} else if (current == 'x')
state = InHexEscape;
@@ -637,7 +637,7 @@ int Lexer::lex()
} else {
setDone(Bad);
err = IllegalUnicodeEscapeSequence;
- errmsg = QCoreApplication::translate("QmlParser", "Illegal unicode escape sequence");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal unicode escape sequence");
}
break;
case InSingleLineComment:
@@ -648,7 +648,7 @@ int Lexer::lex()
terminator = true;
bol = true;
if (restrKeyword) {
- token = QmlJSGrammar::T_SEMICOLON;
+ token = QDeclarativeJSGrammar::T_SEMICOLON;
setDone(Other);
} else
state = Start;
@@ -663,7 +663,7 @@ int Lexer::lex()
if (current == 0) {
setDone(Bad);
err = UnclosedComment;
- errmsg = QCoreApplication::translate("QmlParser", "Unclosed comment at end of file");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unclosed comment at end of file");
driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
} else if (isLineTerminator()) {
shiftWindowsLineBreak();
@@ -750,7 +750,7 @@ int Lexer::lex()
} else {
setDone(Bad);
err = IllegalExponentIndicator;
- errmsg = QCoreApplication::translate("QmlParser", "Illegal syntax for exponential number");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Illegal syntax for exponential number");
}
break;
case InExponent:
@@ -776,7 +776,7 @@ int Lexer::lex()
&& isIdentLetter(current)) {
state = Bad;
err = IllegalIdentifier;
- errmsg = QCoreApplication::translate("QmlParser", "Identifier cannot start with numeric literal");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Identifier cannot start with numeric literal");
}
// terminate string
@@ -800,11 +800,11 @@ int Lexer::lex()
case IgnoreParentheses:
break;
case CountParentheses:
- if (token == QmlJSGrammar::T_RPAREN) {
+ if (token == QDeclarativeJSGrammar::T_RPAREN) {
--parenthesesCount;
if (parenthesesCount == 0)
parenthesesState = BalancedParentheses;
- } else if (token == QmlJSGrammar::T_LPAREN) {
+ } else if (token == QDeclarativeJSGrammar::T_LPAREN) {
++parenthesesCount;
}
break;
@@ -817,7 +817,7 @@ int Lexer::lex()
case Eof:
return 0;
case Other:
- if (token == QmlJSGrammar::T_RBRACE || token == QmlJSGrammar::T_SEMICOLON)
+ if (token == QDeclarativeJSGrammar::T_RBRACE || token == QDeclarativeJSGrammar::T_SEMICOLON)
delimited = true;
return token;
case Identifier:
@@ -827,16 +827,16 @@ int Lexer::lex()
qsyylval.ustr = driver->intern(buffer16, pos16);
else
qsyylval.ustr = 0;
- return QmlJSGrammar::T_IDENTIFIER;
+ return QDeclarativeJSGrammar::T_IDENTIFIER;
}
- if (token == QmlJSGrammar::T_CONTINUE || token == QmlJSGrammar::T_BREAK
- || token == QmlJSGrammar::T_RETURN || token == QmlJSGrammar::T_THROW) {
+ if (token == QDeclarativeJSGrammar::T_CONTINUE || token == QDeclarativeJSGrammar::T_BREAK
+ || token == QDeclarativeJSGrammar::T_RETURN || token == QDeclarativeJSGrammar::T_THROW) {
restrKeyword = true;
- } else if (token == QmlJSGrammar::T_IF || token == QmlJSGrammar::T_FOR
- || token == QmlJSGrammar::T_WHILE || token == QmlJSGrammar::T_WITH) {
+ } else if (token == QDeclarativeJSGrammar::T_IF || token == QDeclarativeJSGrammar::T_FOR
+ || token == QDeclarativeJSGrammar::T_WHILE || token == QDeclarativeJSGrammar::T_WITH) {
parenthesesState = CountParentheses;
parenthesesCount = 0;
- } else if (token == QmlJSGrammar::T_DO) {
+ } else if (token == QDeclarativeJSGrammar::T_DO) {
parenthesesState = BalancedParentheses;
}
return token;
@@ -845,10 +845,10 @@ int Lexer::lex()
qsyylval.ustr = driver->intern(buffer16, pos16);
else
qsyylval.ustr = 0;
- return multiLineString?QmlJSGrammar::T_MULTILINE_STRING_LITERAL:QmlJSGrammar::T_STRING_LITERAL;
+ return multiLineString?QDeclarativeJSGrammar::T_MULTILINE_STRING_LITERAL:QDeclarativeJSGrammar::T_STRING_LITERAL;
case Number:
qsyylval.dval = dval;
- return QmlJSGrammar::T_NUMERIC_LITERAL;
+ return QDeclarativeJSGrammar::T_NUMERIC_LITERAL;
case Bad:
return -1;
default:
@@ -904,103 +904,103 @@ int Lexer::matchPunctuator(ushort c1, ushort c2,
{
if (c1 == '>' && c2 == '>' && c3 == '>' && c4 == '=') {
shift(4);
- return QmlJSGrammar::T_GT_GT_GT_EQ;
+ return QDeclarativeJSGrammar::T_GT_GT_GT_EQ;
} else if (c1 == '=' && c2 == '=' && c3 == '=') {
shift(3);
- return QmlJSGrammar::T_EQ_EQ_EQ;
+ return QDeclarativeJSGrammar::T_EQ_EQ_EQ;
} else if (c1 == '!' && c2 == '=' && c3 == '=') {
shift(3);
- return QmlJSGrammar::T_NOT_EQ_EQ;
+ return QDeclarativeJSGrammar::T_NOT_EQ_EQ;
} else if (c1 == '>' && c2 == '>' && c3 == '>') {
shift(3);
- return QmlJSGrammar::T_GT_GT_GT;
+ return QDeclarativeJSGrammar::T_GT_GT_GT;
} else if (c1 == '<' && c2 == '<' && c3 == '=') {
shift(3);
- return QmlJSGrammar::T_LT_LT_EQ;
+ return QDeclarativeJSGrammar::T_LT_LT_EQ;
} else if (c1 == '>' && c2 == '>' && c3 == '=') {
shift(3);
- return QmlJSGrammar::T_GT_GT_EQ;
+ return QDeclarativeJSGrammar::T_GT_GT_EQ;
} else if (c1 == '<' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_LE;
+ return QDeclarativeJSGrammar::T_LE;
} else if (c1 == '>' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_GE;
+ return QDeclarativeJSGrammar::T_GE;
} else if (c1 == '!' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_NOT_EQ;
+ return QDeclarativeJSGrammar::T_NOT_EQ;
} else if (c1 == '+' && c2 == '+') {
shift(2);
- return QmlJSGrammar::T_PLUS_PLUS;
+ return QDeclarativeJSGrammar::T_PLUS_PLUS;
} else if (c1 == '-' && c2 == '-') {
shift(2);
- return QmlJSGrammar::T_MINUS_MINUS;
+ return QDeclarativeJSGrammar::T_MINUS_MINUS;
} else if (c1 == '=' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_EQ_EQ;
+ return QDeclarativeJSGrammar::T_EQ_EQ;
} else if (c1 == '+' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_PLUS_EQ;
+ return QDeclarativeJSGrammar::T_PLUS_EQ;
} else if (c1 == '-' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_MINUS_EQ;
+ return QDeclarativeJSGrammar::T_MINUS_EQ;
} else if (c1 == '*' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_STAR_EQ;
+ return QDeclarativeJSGrammar::T_STAR_EQ;
} else if (c1 == '/' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_DIVIDE_EQ;
+ return QDeclarativeJSGrammar::T_DIVIDE_EQ;
} else if (c1 == '&' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_AND_EQ;
+ return QDeclarativeJSGrammar::T_AND_EQ;
} else if (c1 == '^' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_XOR_EQ;
+ return QDeclarativeJSGrammar::T_XOR_EQ;
} else if (c1 == '%' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_REMAINDER_EQ;
+ return QDeclarativeJSGrammar::T_REMAINDER_EQ;
} else if (c1 == '|' && c2 == '=') {
shift(2);
- return QmlJSGrammar::T_OR_EQ;
+ return QDeclarativeJSGrammar::T_OR_EQ;
} else if (c1 == '<' && c2 == '<') {
shift(2);
- return QmlJSGrammar::T_LT_LT;
+ return QDeclarativeJSGrammar::T_LT_LT;
} else if (c1 == '>' && c2 == '>') {
shift(2);
- return QmlJSGrammar::T_GT_GT;
+ return QDeclarativeJSGrammar::T_GT_GT;
} else if (c1 == '&' && c2 == '&') {
shift(2);
- return QmlJSGrammar::T_AND_AND;
+ return QDeclarativeJSGrammar::T_AND_AND;
} else if (c1 == '|' && c2 == '|') {
shift(2);
- return QmlJSGrammar::T_OR_OR;
+ return QDeclarativeJSGrammar::T_OR_OR;
}
switch(c1) {
- case '=': shift(1); return QmlJSGrammar::T_EQ;
- case '>': shift(1); return QmlJSGrammar::T_GT;
- case '<': shift(1); return QmlJSGrammar::T_LT;
- case ',': shift(1); return QmlJSGrammar::T_COMMA;
- case '!': shift(1); return QmlJSGrammar::T_NOT;
- case '~': shift(1); return QmlJSGrammar::T_TILDE;
- case '?': shift(1); return QmlJSGrammar::T_QUESTION;
- case ':': shift(1); return QmlJSGrammar::T_COLON;
- case '.': shift(1); return QmlJSGrammar::T_DOT;
- case '+': shift(1); return QmlJSGrammar::T_PLUS;
- case '-': shift(1); return QmlJSGrammar::T_MINUS;
- case '*': shift(1); return QmlJSGrammar::T_STAR;
- case '/': shift(1); return QmlJSGrammar::T_DIVIDE_;
- case '&': shift(1); return QmlJSGrammar::T_AND;
- case '|': shift(1); return QmlJSGrammar::T_OR;
- case '^': shift(1); return QmlJSGrammar::T_XOR;
- case '%': shift(1); return QmlJSGrammar::T_REMAINDER;
- case '(': shift(1); return QmlJSGrammar::T_LPAREN;
- case ')': shift(1); return QmlJSGrammar::T_RPAREN;
- case '{': shift(1); return QmlJSGrammar::T_LBRACE;
- case '}': shift(1); return QmlJSGrammar::T_RBRACE;
- case '[': shift(1); return QmlJSGrammar::T_LBRACKET;
- case ']': shift(1); return QmlJSGrammar::T_RBRACKET;
- case ';': shift(1); return QmlJSGrammar::T_SEMICOLON;
+ case '=': shift(1); return QDeclarativeJSGrammar::T_EQ;
+ case '>': shift(1); return QDeclarativeJSGrammar::T_GT;
+ case '<': shift(1); return QDeclarativeJSGrammar::T_LT;
+ case ',': shift(1); return QDeclarativeJSGrammar::T_COMMA;
+ case '!': shift(1); return QDeclarativeJSGrammar::T_NOT;
+ case '~': shift(1); return QDeclarativeJSGrammar::T_TILDE;
+ case '?': shift(1); return QDeclarativeJSGrammar::T_QUESTION;
+ case ':': shift(1); return QDeclarativeJSGrammar::T_COLON;
+ case '.': shift(1); return QDeclarativeJSGrammar::T_DOT;
+ case '+': shift(1); return QDeclarativeJSGrammar::T_PLUS;
+ case '-': shift(1); return QDeclarativeJSGrammar::T_MINUS;
+ case '*': shift(1); return QDeclarativeJSGrammar::T_STAR;
+ case '/': shift(1); return QDeclarativeJSGrammar::T_DIVIDE_;
+ case '&': shift(1); return QDeclarativeJSGrammar::T_AND;
+ case '|': shift(1); return QDeclarativeJSGrammar::T_OR;
+ case '^': shift(1); return QDeclarativeJSGrammar::T_XOR;
+ case '%': shift(1); return QDeclarativeJSGrammar::T_REMAINDER;
+ case '(': shift(1); return QDeclarativeJSGrammar::T_LPAREN;
+ case ')': shift(1); return QDeclarativeJSGrammar::T_RPAREN;
+ case '{': shift(1); return QDeclarativeJSGrammar::T_LBRACE;
+ case '}': shift(1); return QDeclarativeJSGrammar::T_RBRACE;
+ case '[': shift(1); return QDeclarativeJSGrammar::T_LBRACKET;
+ case ']': shift(1); return QDeclarativeJSGrammar::T_RBRACKET;
+ case ';': shift(1); return QDeclarativeJSGrammar::T_SEMICOLON;
default: return -1;
}
@@ -1107,7 +1107,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
while (1) {
if (isLineTerminator() || current == 0) {
- errmsg = QCoreApplication::translate("QmlParser", "Unterminated regular expression literal");
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Unterminated regular expression literal");
return false;
}
else if (current != '/' || lastWasEscape == true)
@@ -1131,7 +1131,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
while (isIdentLetter(current)) {
int flag = Ecma::RegExp::flagFromChar(current);
if (flag == 0) {
- errmsg = QCoreApplication::translate("QmlParser", "Invalid regular expression flag '%0'")
+ errmsg = QCoreApplication::translate("QDeclarativeParser", "Invalid regular expression flag '%0'")
.arg(QChar(current));
return false;
}
diff --git a/src/declarative/qml/parser/qmljslexer_p.h b/src/declarative/qml/parser/qdeclarativejslexer_p.h
index 8f95a90..71bd08c 100644
--- a/src/declarative/qml/parser/qmljslexer_p.h
+++ b/src/declarative/qml/parser/qdeclarativejslexer_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLJSLEXER_P_H
-#define QMLJSLEXER_P_H
+#ifndef QDECLARATIVEJSLEXER_P_H
+#define QDECLARATIVEJSLEXER_P_H
//
// W A R N I N G
@@ -53,13 +53,13 @@
// We mean it.
//
-#include "qmljsglobal_p.h"
+#include "qdeclarativejsglobal_p.h"
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
class Engine;
class NameId;
@@ -242,7 +242,7 @@ private:
bool tokenizeComments;
};
-} // namespace QmlJS
+} // namespace QDeclarativeJS
QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qmljsmemorypool_p.h b/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h
index 5dffdc8..c8d52d0 100644
--- a/src/declarative/qml/parser/qmljsmemorypool_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsmemorypool_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLJSMEMORYPOOL_P_H
-#define QMLJSMEMORYPOOL_P_H
+#ifndef QDECLARATIVEJSMEMORYPOOL_P_H
+#define QDECLARATIVEJSMEMORYPOOL_P_H
//
// W A R N I N G
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qmljsglobal_p.h"
+#include "qdeclarativejsglobal_p.h"
#include <QtCore/qglobal.h>
#include <QtCore/qshareddata.h>
@@ -62,7 +62,7 @@
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
class QML_PARSER_EXPORT MemoryPool : public QSharedData
{
@@ -126,7 +126,7 @@ private:
Q_DISABLE_COPY(MemoryPool)
};
-} // namespace QmlJS
+} // namespace QDeclarativeJS
QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qmljsnodepool_p.h b/src/declarative/qml/parser/qdeclarativejsnodepool_p.h
index 2055a7e..94637fd 100644
--- a/src/declarative/qml/parser/qmljsnodepool_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsnodepool_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLJSNODEPOOL_P_H
-#define QMLJSNODEPOOL_P_H
+#ifndef QDECLARATIVEJSNODEPOOL_P_H
+#define QDECLARATIVEJSNODEPOOL_P_H
//
// W A R N I N G
@@ -53,15 +53,15 @@
// We mean it.
//
-#include "qmljsglobal_p.h"
-#include "qmljsmemorypool_p.h"
+#include "qdeclarativejsglobal_p.h"
+#include "qdeclarativejsmemorypool_p.h"
#include <QtCore/QHash>
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
namespace AST {
class Node;
@@ -132,7 +132,7 @@ private:
Q_DISABLE_COPY(NodePool)
};
-} // namespace QmlJS
+} // namespace QDeclarativeJS
QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/parser/qmljsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp
index 856d06d..4aa4960 100644
--- a/src/declarative/qml/parser/qmljsparser.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp
@@ -44,14 +44,14 @@
#include <string.h>
-#include "qmljsengine_p.h"
-#include "qmljslexer_p.h"
-#include "qmljsast_p.h"
-#include "qmljsnodepool_p.h"
+#include "qdeclarativejsengine_p.h"
+#include "qdeclarativejslexer_p.h"
+#include "qdeclarativejsast_p.h"
+#include "qdeclarativejsnodepool_p.h"
-#include "qmljsparser_p.h"
+#include "qdeclarativejsparser_p.h"
#include <QVarLengthArray>
//
@@ -59,7 +59,7 @@
// Changes will be lost.
//
-using namespace QmlJS;
+using namespace QDeclarativeJS;
QT_QML_BEGIN_NAMESPACE
@@ -77,7 +77,7 @@ void Parser::reallocateStack()
inline static bool automatic(Engine *driver, int token)
{
- return token == QmlJSGrammar::T_RBRACE
+ return token == QDeclarativeJSGrammar::T_RBRACE
|| token == 0
|| driver->lexer()->prevTerminator();
}
@@ -490,19 +490,19 @@ case 61: {
} break;
case 63: {
- QString s = QLatin1String(QmlJSGrammar::spell[T_PROPERTY]);
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_PROPERTY]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
case 64: {
- QString s = QLatin1String(QmlJSGrammar::spell[T_SIGNAL]);
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_SIGNAL]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
case 65: {
- QString s = QLatin1String(QmlJSGrammar::spell[T_READONLY]);
+ QString s = QLatin1String(QDeclarativeJSGrammar::spell[T_READONLY]);
sym(1).sval = driver->intern(s.constData(), s.length());
break;
}
@@ -1736,7 +1736,7 @@ case 340: {
yylloc.startColumn += yylloc.length;
yylloc.length = 0;
- //const QString msg = qApp->translate("QmlParser", "Missing `;'");
+ //const QString msg = qApp->translate("QDeclarativeParser", "Missing `;'");
//diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg));
first_token = &token_buffer[0];
@@ -1764,9 +1764,9 @@ case 340: {
QString msg;
int token = token_buffer[0].token;
if (token < 0 || token >= TERMINAL_COUNT)
- msg = qApp->translate("QmlParser", "Syntax error");
+ msg = qApp->translate("QDeclarativeParser", "Syntax error");
else
- msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
+ msg = qApp->translate("QDeclarativeParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
action = errorState;
@@ -1794,7 +1794,7 @@ case 340: {
for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) {
int a = t_action(errorState, *tk);
if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QmlParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[*tk]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
yytoken = *tk;
@@ -1818,7 +1818,7 @@ case 340: {
int a = t_action(errorState, tk);
if (a > 0 && t_action(a, yytoken)) {
- const QString msg = qApp->translate("QmlParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
+ const QString msg = qApp->translate("QDeclarativeParser", "Expected token `%1'").arg(QLatin1String(spell[tk]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
yytoken = tk;
@@ -1831,7 +1831,7 @@ case 340: {
}
}
- const QString msg = qApp->translate("QmlParser", "Syntax error");
+ const QString msg = qApp->translate("QDeclarativeParser", "Syntax error");
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
}
diff --git a/src/declarative/qml/parser/qmljsparser_p.h b/src/declarative/qml/parser/qdeclarativejsparser_p.h
index 42fb422..c7e097a 100644
--- a/src/declarative/qml/parser/qmljsparser_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsparser_p.h
@@ -56,25 +56,25 @@
// Changes will be lost.
//
-#ifndef QMLJSPARSER_P_H
-#define QMLJSPARSER_P_H
+#ifndef QDECLARATIVEJSPARSER_P_H
+#define QDECLARATIVEJSPARSER_P_H
-#include "qmljsglobal_p.h"
-#include "qmljsgrammar_p.h"
-#include "qmljsast_p.h"
-#include "qmljsengine_p.h"
+#include "qdeclarativejsglobal_p.h"
+#include "qdeclarativejsgrammar_p.h"
+#include "qdeclarativejsast_p.h"
+#include "qdeclarativejsengine_p.h"
#include <QtCore/QList>
#include <QtCore/QString>
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
class Engine;
class NameId;
-class QML_PARSER_EXPORT Parser: protected QmlJSGrammar
+class QML_PARSER_EXPORT Parser: protected QDeclarativeJSGrammar
{
public:
union Value {
@@ -231,7 +231,7 @@ protected:
QList<DiagnosticMessage> diagnostic_messages;
};
-} // end of namespace QmlJS
+} // end of namespace QDeclarativeJS
@@ -243,4 +243,4 @@ QT_QML_END_NAMESPACE
-#endif // QMLJSPARSER_P_H
+#endif // QDECLARATIVEJSPARSER_P_H
diff --git a/src/declarative/qml/qml.h b/src/declarative/qml/qdeclarative.h
index 7cde731..ee5a27a 100644
--- a/src/declarative/qml/qml.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -42,11 +42,11 @@
#ifndef QML_H
#define QML_H
-#include "qmlmetatype.h"
-#include "qmlmetaproperty.h"
-#include "qmlparserstatus.h"
-#include "qmlpropertyvaluesource.h"
-#include "qmllist.h"
+#include "qdeclarativemetatype.h"
+#include "qdeclarativemetaproperty.h"
+#include "qdeclarativeparserstatus.h"
+#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativelist.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qstringlist.h>
@@ -57,10 +57,10 @@ QT_BEGIN_HEADER
#define QML_DECLARE_TYPE(TYPE) \
Q_DECLARE_METATYPE(TYPE *) \
- Q_DECLARE_METATYPE(QmlListProperty<TYPE>)
+ Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
#define QML_DECLARE_TYPE_HASMETATYPE(TYPE) \
- Q_DECLARE_METATYPE(QmlListProperty<TYPE>)
+ Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
#define QML_DECLARE_INTERFACE(INTERFACE) \
QML_DECLARE_TYPE(INTERFACE)
@@ -75,7 +75,7 @@ enum { /* TYPEINFO flags */
#define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \
QT_BEGIN_NAMESPACE \
template <> \
-class QmlTypeInfo<TYPE > \
+class QDeclarativeTypeInfo<TYPE > \
{ \
public: \
enum { \
@@ -100,11 +100,11 @@ QT_MODULE(Declarative)
#define QML_REGISTER_NOCREATE_TYPE(CLASS) \
qmlRegisterType<CLASS>(#CLASS)
-class QmlContext;
-class QmlEngine;
+class QDeclarativeContext;
+class QDeclarativeEngine;
Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *);
-Q_DECLARATIVE_EXPORT QmlContext *qmlContext(const QObject *);
-Q_DECLARATIVE_EXPORT QmlEngine *qmlEngine(const QObject *);
+Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *);
+Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *);
Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true);
template<typename T>
@@ -114,7 +114,7 @@ QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true)
static int idx = -1;
if (idx == -1)
- idx = QmlMetaType::attachedPropertiesFuncId(&T::staticMetaObject);
+ idx = QDeclarativeMetaType::attachedPropertiesFuncId(&T::staticMetaObject);
if (idx == -1 || !obj)
return 0;
diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index 04801df..5ac5701 100644
--- a/src/declarative/qml/qmlbinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include "qmlbinding_p.h"
-#include "qmlbinding_p_p.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativebinding_p_p.h"
-#include "qml.h"
-#include "qmlcontext.h"
-#include "qmlinfo.h"
-#include "qmlcontext_p.h"
-#include "qmldeclarativedata_p.h"
-#include "qmlstringconverters_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativeinfo.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativedeclarativedata_p.h"
+#include "qdeclarativestringconverters_p.h"
#include <qfxperf_p_p.h>
@@ -56,69 +56,69 @@
QT_BEGIN_NAMESPACE
-QmlBindingData::QmlBindingData()
+QDeclarativeBindingData::QDeclarativeBindingData()
: updating(false), enabled(false)
{
}
-QmlBindingData::~QmlBindingData()
+QDeclarativeBindingData::~QDeclarativeBindingData()
{
removeError();
}
-void QmlBindingData::refresh()
+void QDeclarativeBindingData::refresh()
{
if (enabled && !updating && q) {
- QmlBinding *b = static_cast<QmlBinding *>(QmlExpressionPrivate::get(q));
+ QDeclarativeBinding *b = static_cast<QDeclarativeBinding *>(QDeclarativeExpressionPrivate::get(q));
b->update();
}
}
-QmlBindingPrivate::QmlBindingPrivate()
-: QmlExpressionPrivate(new QmlBindingData)
+QDeclarativeBindingPrivate::QDeclarativeBindingPrivate()
+: QDeclarativeExpressionPrivate(new QDeclarativeBindingData)
{
}
-QmlBinding::QmlBinding(void *data, QmlRefCount *rc, QObject *obj, QmlContext *ctxt, const QString &url, int lineNumber, QObject *parent)
-: QmlExpression(ctxt, data, rc, obj, url, lineNumber, *new QmlBindingPrivate)
+QDeclarativeBinding::QDeclarativeBinding(void *data, QDeclarativeRefCount *rc, QObject *obj, QDeclarativeContext *ctxt, const QString &url, int lineNumber, QObject *parent)
+: QDeclarativeExpression(ctxt, data, rc, obj, url, lineNumber, *new QDeclarativeBindingPrivate)
{
setParent(parent);
setNotifyOnValueChanged(true);
}
-QmlBinding::QmlBinding(const QString &str, QObject *obj, QmlContext *ctxt, QObject *parent)
-: QmlExpression(ctxt, str, obj, *new QmlBindingPrivate)
+QDeclarativeBinding::QDeclarativeBinding(const QString &str, QObject *obj, QDeclarativeContext *ctxt, QObject *parent)
+: QDeclarativeExpression(ctxt, str, obj, *new QDeclarativeBindingPrivate)
{
setParent(parent);
setNotifyOnValueChanged(true);
}
-QmlBinding::~QmlBinding()
+QDeclarativeBinding::~QDeclarativeBinding()
{
}
-void QmlBinding::setTarget(const QmlMetaProperty &prop)
+void QDeclarativeBinding::setTarget(const QDeclarativeMetaProperty &prop)
{
- Q_D(QmlBinding);
+ Q_D(QDeclarativeBinding);
d->bindingData()->property = prop;
update();
}
-QmlMetaProperty QmlBinding::property() const
+QDeclarativeMetaProperty QDeclarativeBinding::property() const
{
- Q_D(const QmlBinding);
+ Q_D(const QDeclarativeBinding);
return d->bindingData()->property;
}
-void QmlBinding::update(QmlMetaProperty::WriteFlags flags)
+void QDeclarativeBinding::update(QDeclarativeMetaProperty::WriteFlags flags)
{
- Q_D(QmlBinding);
+ Q_D(QDeclarativeBinding);
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QmlPerfTimer<QmlPerf::BindableValueUpdate> bu;
+ QDeclarativePerfTimer<QDeclarativePerf::BindableValueUpdate> bu;
#endif
- QmlBindingData *data = d->bindingData();
+ QDeclarativeBindingData *data = d->bindingData();
if (!data->enabled)
return;
@@ -128,13 +128,13 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags)
if (!data->updating) {
data->updating = true;
- if (data->property.propertyCategory() == QmlMetaProperty::Bindable) {
+ if (data->property.propertyCategory() == QDeclarativeMetaProperty::Bindable) {
int idx = data->property.coreIndex();
Q_ASSERT(idx != -1);
- QmlBinding *t = this;
+ QDeclarativeBinding *t = this;
int status = -1;
void *a[] = { &t, 0, &status, &flags };
QMetaObject::metacall(data->property.object(),
@@ -181,8 +181,8 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags)
}
if (data->error.isValid()) {
- QmlEnginePrivate *p = (data->context() && data->context()->engine())?
- QmlEnginePrivate::get(data->context()->engine()):0;
+ QDeclarativeEnginePrivate *p = (data->context() && data->context()->engine())?
+ QDeclarativeEnginePrivate::get(data->context()->engine()):0;
if (!data->addError(p))
qWarning().nospace() << qPrintable(this->error().toString());
} else {
@@ -198,19 +198,19 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags)
data->release();
}
-void QmlBindingPrivate::emitValueChanged()
+void QDeclarativeBindingPrivate::emitValueChanged()
{
- Q_Q(QmlBinding);
+ Q_Q(QDeclarativeBinding);
q->update();
}
-void QmlBinding::setEnabled(bool e, QmlMetaProperty::WriteFlags flags)
+void QDeclarativeBinding::setEnabled(bool e, QDeclarativeMetaProperty::WriteFlags flags)
{
- Q_D(QmlBinding);
+ Q_D(QDeclarativeBinding);
d->bindingData()->enabled = e;
setNotifyOnValueChanged(e);
- QmlAbstractBinding::setEnabled(e, flags);
+ QDeclarativeAbstractBinding::setEnabled(e, flags);
if (e) {
addToObject(d->bindingData()->property.object());
@@ -220,42 +220,42 @@ void QmlBinding::setEnabled(bool e, QmlMetaProperty::WriteFlags flags)
}
}
-int QmlBinding::propertyIndex()
+int QDeclarativeBinding::propertyIndex()
{
- Q_D(QmlBinding);
+ Q_D(QDeclarativeBinding);
return d->bindingData()->property.coreIndex();
}
-bool QmlBinding::enabled() const
+bool QDeclarativeBinding::enabled() const
{
- Q_D(const QmlBinding);
+ Q_D(const QDeclarativeBinding);
return d->bindingData()->enabled;
}
-QString QmlBinding::expression() const
+QString QDeclarativeBinding::expression() const
{
- return QmlExpression::expression();
+ return QDeclarativeExpression::expression();
}
-QmlAbstractBinding::QmlAbstractBinding()
+QDeclarativeAbstractBinding::QDeclarativeAbstractBinding()
: m_object(0), m_mePtr(0), m_prevBinding(0), m_nextBinding(0)
{
}
-QmlAbstractBinding::~QmlAbstractBinding()
+QDeclarativeAbstractBinding::~QDeclarativeAbstractBinding()
{
removeFromObject();
if (m_mePtr)
*m_mePtr = 0;
}
-void QmlAbstractBinding::destroy()
+void QDeclarativeAbstractBinding::destroy()
{
delete this;
}
-void QmlAbstractBinding::addToObject(QObject *object)
+void QDeclarativeAbstractBinding::addToObject(QObject *object)
{
Q_ASSERT(object);
@@ -263,7 +263,7 @@ void QmlAbstractBinding::addToObject(QObject *object)
Q_ASSERT(!m_prevBinding);
- QmlDeclarativeData *data = QmlDeclarativeData::get(object, true);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object, true);
m_nextBinding = data->bindings;
if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding;
m_prevBinding = &data->bindings;
@@ -273,7 +273,7 @@ void QmlAbstractBinding::addToObject(QObject *object)
data->setBindingBit(m_object, propertyIndex());
}
-void QmlAbstractBinding::removeFromObject()
+void QDeclarativeAbstractBinding::removeFromObject()
{
if (m_prevBinding) {
Q_ASSERT(m_object);
@@ -283,24 +283,24 @@ void QmlAbstractBinding::removeFromObject()
m_prevBinding = 0;
m_nextBinding = 0;
- QmlDeclarativeData *data = QmlDeclarativeData::get(m_object, false);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(m_object, false);
if (data) data->clearBindingBit(propertyIndex());
m_object = 0;
}
}
-void QmlAbstractBinding::clear()
+void QDeclarativeAbstractBinding::clear()
{
if (m_mePtr)
*m_mePtr = 0;
}
-QString QmlAbstractBinding::expression() const
+QString QDeclarativeAbstractBinding::expression() const
{
return QLatin1String("<Unknown>");
}
-void QmlAbstractBinding::setEnabled(bool e, QmlMetaProperty::WriteFlags)
+void QDeclarativeAbstractBinding::setEnabled(bool e, QDeclarativeMetaProperty::WriteFlags)
{
if (e) m_mePtr = 0;
}
diff --git a/src/declarative/qml/qmlbinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
index 4594476..432bf22 100644
--- a/src/declarative/qml/qmlbinding_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLBINDING_P_H
-#define QMLBINDING_P_H
+#ifndef QDECLARATIVEBINDING_P_H
+#define QDECLARATIVEBINDING_P_H
//
// W A R N I N G
@@ -53,31 +53,31 @@
// We mean it.
//
-#include "qml.h"
-#include "qmlpropertyvaluesource.h"
-#include "qmlexpression.h"
+#include "qdeclarative.h"
+#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativeexpression.h"
#include <QtCore/QObject>
#include <QtCore/QMetaProperty>
QT_BEGIN_NAMESPACE
-class Q_AUTOTEST_EXPORT QmlAbstractBinding
+class Q_AUTOTEST_EXPORT QDeclarativeAbstractBinding
{
public:
- QmlAbstractBinding();
- virtual ~QmlAbstractBinding();
+ QDeclarativeAbstractBinding();
+ virtual ~QDeclarativeAbstractBinding();
virtual void destroy();
virtual QString expression() const;
- void setEnabled(bool e) { setEnabled(e, QmlMetaProperty::DontRemoveBinding); }
- virtual void setEnabled(bool, QmlMetaProperty::WriteFlags) = 0;
+ void setEnabled(bool e) { setEnabled(e, QDeclarativeMetaProperty::DontRemoveBinding); }
+ virtual void setEnabled(bool, QDeclarativeMetaProperty::WriteFlags) = 0;
virtual int propertyIndex() = 0;
- void update() { update(QmlMetaProperty::DontRemoveBinding); }
- virtual void update(QmlMetaProperty::WriteFlags) = 0;
+ void update() { update(QDeclarativeMetaProperty::DontRemoveBinding); }
+ virtual void update(QDeclarativeMetaProperty::WriteFlags) = 0;
void addToObject(QObject *);
void removeFromObject();
@@ -86,50 +86,50 @@ protected:
void clear();
private:
- friend class QmlDeclarativeData;
- friend class QmlMetaProperty;
- friend class QmlMetaPropertyPrivate;
- friend class QmlVME;
+ friend class QDeclarativeDeclarativeData;
+ friend class QDeclarativeMetaProperty;
+ friend class QDeclarativeMetaPropertyPrivate;
+ friend class QDeclarativeVME;
QObject *m_object;
- QmlAbstractBinding **m_mePtr;
- QmlAbstractBinding **m_prevBinding;
- QmlAbstractBinding *m_nextBinding;
+ QDeclarativeAbstractBinding **m_mePtr;
+ QDeclarativeAbstractBinding **m_prevBinding;
+ QDeclarativeAbstractBinding *m_nextBinding;
};
-class QmlContext;
-class QmlBindingPrivate;
-class Q_AUTOTEST_EXPORT QmlBinding : public QmlExpression, public QmlAbstractBinding
+class QDeclarativeContext;
+class QDeclarativeBindingPrivate;
+class Q_AUTOTEST_EXPORT QDeclarativeBinding : public QDeclarativeExpression, public QDeclarativeAbstractBinding
{
Q_OBJECT
public:
- QmlBinding(const QString &, QObject *, QmlContext *, QObject *parent=0);
- QmlBinding(void *, QmlRefCount *, QObject *, QmlContext *, const QString &, int,
+ QDeclarativeBinding(const QString &, QObject *, QDeclarativeContext *, QObject *parent=0);
+ QDeclarativeBinding(void *, QDeclarativeRefCount *, QObject *, QDeclarativeContext *, const QString &, int,
QObject *parent);
- ~QmlBinding();
+ ~QDeclarativeBinding();
- void setTarget(const QmlMetaProperty &);
- QmlMetaProperty property() const;
+ void setTarget(const QDeclarativeMetaProperty &);
+ QDeclarativeMetaProperty property() const;
bool enabled() const;
- // Inherited from QmlAbstractBinding
- virtual void setEnabled(bool, QmlMetaProperty::WriteFlags flags);
+ // Inherited from QDeclarativeAbstractBinding
+ virtual void setEnabled(bool, QDeclarativeMetaProperty::WriteFlags flags);
virtual int propertyIndex();
- virtual void update(QmlMetaProperty::WriteFlags flags);
+ virtual void update(QDeclarativeMetaProperty::WriteFlags flags);
virtual QString expression() const;
public Q_SLOTS:
- void update() { update(QmlMetaProperty::DontRemoveBinding); }
+ void update() { update(QDeclarativeMetaProperty::DontRemoveBinding); }
protected:
void emitValueChanged();
private:
- Q_DECLARE_PRIVATE(QmlBinding)
+ Q_DECLARE_PRIVATE(QDeclarativeBinding)
};
-Q_DECLARE_METATYPE(QmlBinding*);
+Q_DECLARE_METATYPE(QDeclarativeBinding*);
QT_END_NAMESPACE
-#endif // QMLBINDING_P_H
+#endif // QDECLARATIVEBINDING_P_H
diff --git a/src/declarative/qml/qmlbinding_p_p.h b/src/declarative/qml/qdeclarativebinding_p_p.h
index 131bacc..ac88400 100644
--- a/src/declarative/qml/qmlbinding_p_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLBINDING_P_P_H
-#define QMLBINDING_P_P_H
+#ifndef QDECLARATIVEBINDING_P_P_H
+#define QDECLARATIVEBINDING_P_P_H
//
// W A R N I N G
@@ -53,39 +53,39 @@
// We mean it.
//
-#include "qmlbinding_p.h"
+#include "qdeclarativebinding_p.h"
-#include "qmlmetaproperty.h"
-#include "qmlexpression_p.h"
+#include "qdeclarativemetaproperty.h"
+#include "qdeclarativeexpression_p.h"
QT_BEGIN_NAMESPACE
-class QmlBindingData : public QmlExpressionData
+class QDeclarativeBindingData : public QDeclarativeExpressionData
{
public:
- QmlBindingData();
- virtual ~QmlBindingData();
+ QDeclarativeBindingData();
+ virtual ~QDeclarativeBindingData();
bool updating:1;
bool enabled:1;
- QmlMetaProperty property;
+ QDeclarativeMetaProperty property;
virtual void refresh();
};
-class QmlBindingPrivate : public QmlExpressionPrivate
+class QDeclarativeBindingPrivate : public QDeclarativeExpressionPrivate
{
- Q_DECLARE_PUBLIC(QmlBinding)
+ Q_DECLARE_PUBLIC(QDeclarativeBinding)
public:
- QmlBindingPrivate();
+ QDeclarativeBindingPrivate();
- QmlBindingData *bindingData() { return static_cast<QmlBindingData *>(data); }
- const QmlBindingData *bindingData() const { return static_cast<const QmlBindingData *>(data); }
+ QDeclarativeBindingData *bindingData() { return static_cast<QDeclarativeBindingData *>(data); }
+ const QDeclarativeBindingData *bindingData() const { return static_cast<const QDeclarativeBindingData *>(data); }
virtual void emitValueChanged();
};
QT_END_NAMESPACE
-#endif // QMLBINDING_P_P_H
+#endif // QDECLARATIVEBINDING_P_P_H
diff --git a/src/declarative/qml/qmlboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp
index db5fd61..c47df32 100644
--- a/src/declarative/qml/qmlboundsignal.cpp
+++ b/src/declarative/qml/qdeclarativeboundsignal.cpp
@@ -39,27 +39,27 @@
**
****************************************************************************/
-#include "qmlboundsignal_p.h"
+#include "qdeclarativeboundsignal_p.h"
#include "qmetaobjectbuilder_p.h"
-#include "qmlengine_p.h"
-#include "qmlexpression_p.h"
-#include "qmlcontext_p.h"
-#include "qmlmetatype.h"
-#include "qml.h"
-#include "qmlcontext.h"
-#include "qmlglobal_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeexpression_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativemetatype.h"
+#include "qdeclarative.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativeglobal_p.h"
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
-class QmlBoundSignalParameters : public QObject
+class QDeclarativeBoundSignalParameters : public QObject
{
Q_OBJECT
public:
- QmlBoundSignalParameters(const QMetaMethod &, QObject * = 0);
- ~QmlBoundSignalParameters();
+ QDeclarativeBoundSignalParameters(const QMetaMethod &, QObject * = 0);
+ ~QDeclarativeBoundSignalParameters();
void setValues(void **);
void clearValues();
@@ -68,13 +68,13 @@ private:
friend class MetaObject;
int metaCall(QMetaObject::Call, int _id, void **);
struct MetaObject : public QAbstractDynamicMetaObject {
- MetaObject(QmlBoundSignalParameters *b)
+ MetaObject(QDeclarativeBoundSignalParameters *b)
: parent(b) {}
int metaCall(QMetaObject::Call c, int id, void **a) {
return parent->metaCall(c, id, a);
}
- QmlBoundSignalParameters *parent;
+ QDeclarativeBoundSignalParameters *parent;
};
int *types;
@@ -84,55 +84,55 @@ private:
static int evaluateIdx = -1;
-QmlAbstractBoundSignal::QmlAbstractBoundSignal(QObject *parent)
+QDeclarativeAbstractBoundSignal::QDeclarativeAbstractBoundSignal(QObject *parent)
: QObject(parent)
{
}
-QmlAbstractBoundSignal::~QmlAbstractBoundSignal()
+QDeclarativeAbstractBoundSignal::~QDeclarativeAbstractBoundSignal()
{
}
-QmlBoundSignal::QmlBoundSignal(QObject *scope, const QMetaMethod &signal,
+QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal,
QObject *parent)
: m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0)
{
- // A cached evaluation of the QmlExpression::value() slot index.
+ // A cached evaluation of the QDeclarativeExpression::value() slot index.
//
// This is thread safe. Although it may be updated by two threads, they
// will both set it to the same value - so the worst thing that can happen
// is that they both do the work to figure it out. Boo hoo.
if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount();
- QmlGraphics_setParent_noEvent(this, parent);
+ QDeclarativeGraphics_setParent_noEvent(this, parent);
QMetaObject::connect(scope, m_signal.methodIndex(), this, evaluateIdx);
}
-QmlBoundSignal::QmlBoundSignal(QmlContext *ctxt, const QString &val,
+QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val,
QObject *scope, const QMetaMethod &signal,
QObject *parent)
: m_expression(0), m_signal(signal), m_paramsValid(false), m_params(0)
{
- // A cached evaluation of the QmlExpression::value() slot index.
+ // A cached evaluation of the QDeclarativeExpression::value() slot index.
//
// This is thread safe. Although it may be updated by two threads, they
// will both set it to the same value - so the worst thing that can happen
// is that they both do the work to figure it out. Boo hoo.
if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount();
- QmlGraphics_setParent_noEvent(this, parent);
+ QDeclarativeGraphics_setParent_noEvent(this, parent);
QMetaObject::connect(scope, m_signal.methodIndex(), this, evaluateIdx);
- m_expression = new QmlExpression(ctxt, val, scope);
+ m_expression = new QDeclarativeExpression(ctxt, val, scope);
}
-QmlBoundSignal::~QmlBoundSignal()
+QDeclarativeBoundSignal::~QDeclarativeBoundSignal()
{
delete m_expression;
m_expression = 0;
}
-int QmlBoundSignal::index() const
+int QDeclarativeBoundSignal::index() const
{
return m_signal.methodIndex();
}
@@ -140,7 +140,7 @@ int QmlBoundSignal::index() const
/*!
Returns the signal expression.
*/
-QmlExpression *QmlBoundSignal::expression() const
+QDeclarativeExpression *QDeclarativeBoundSignal::expression() const
{
return m_expression;
}
@@ -149,35 +149,35 @@ QmlExpression *QmlBoundSignal::expression() const
Sets the signal expression to \a e. Returns the current signal expression,
or null if there is no signal expression.
- The QmlBoundSignal instance takes ownership of \a e. The caller is
- assumes ownership of the returned QmlExpression.
+ The QDeclarativeBoundSignal instance takes ownership of \a e. The caller is
+ assumes ownership of the returned QDeclarativeExpression.
*/
-QmlExpression *QmlBoundSignal::setExpression(QmlExpression *e)
+QDeclarativeExpression *QDeclarativeBoundSignal::setExpression(QDeclarativeExpression *e)
{
- QmlExpression *rv = m_expression;
+ QDeclarativeExpression *rv = m_expression;
m_expression = e;
if (m_expression) m_expression->setNotifyOnValueChanged(false);
return rv;
}
-QmlBoundSignal *QmlBoundSignal::cast(QObject *o)
+QDeclarativeBoundSignal *QDeclarativeBoundSignal::cast(QObject *o)
{
- QmlAbstractBoundSignal *s = qobject_cast<QmlAbstractBoundSignal*>(o);
- return static_cast<QmlBoundSignal *>(s);
+ QDeclarativeAbstractBoundSignal *s = qobject_cast<QDeclarativeAbstractBoundSignal*>(o);
+ return static_cast<QDeclarativeBoundSignal *>(s);
}
-int QmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a)
+int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a)
{
if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) {
if (!m_paramsValid) {
if (!m_signal.parameterTypes().isEmpty())
- m_params = new QmlBoundSignalParameters(m_signal, this);
+ m_params = new QDeclarativeBoundSignalParameters(m_signal, this);
m_paramsValid = true;
}
if (m_params) m_params->setValues(a);
if (m_expression) {
- QmlExpressionPrivate::get(m_expression)->value(m_params);
+ QDeclarativeExpressionPrivate::get(m_expression)->value(m_params);
if (m_expression && m_expression->hasError())
qWarning().nospace() << qPrintable(m_expression->error().toString());
}
@@ -188,7 +188,7 @@ int QmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a)
}
}
-QmlBoundSignalParameters::QmlBoundSignalParameters(const QMetaMethod &method,
+QDeclarativeBoundSignalParameters::QDeclarativeBoundSignalParameters(const QMetaMethod &method,
QObject *parent)
: QObject(parent), types(0), values(0)
{
@@ -197,8 +197,8 @@ QmlBoundSignalParameters::QmlBoundSignalParameters(const QMetaMethod &method,
// ### Optimize!
// ### Ensure only supported types are allowed, otherwise it might crash
QMetaObjectBuilder mob;
- mob.setSuperClass(&QmlBoundSignalParameters::staticMetaObject);
- mob.setClassName("QmlBoundSignalParameters");
+ mob.setSuperClass(&QDeclarativeBoundSignalParameters::staticMetaObject);
+ mob.setClassName("QDeclarativeBoundSignalParameters");
QList<QByteArray> paramTypes = method.parameterTypes();
QList<QByteArray> paramNames = method.parameterNames();
@@ -213,7 +213,7 @@ QmlBoundSignalParameters::QmlBoundSignalParameters(const QMetaMethod &method,
}
QVariant::Type t = (QVariant::Type)QMetaType::type(type.constData());
- if (QmlMetaType::isQObject(t)) {
+ if (QDeclarativeMetaType::isQObject(t)) {
types[ii] = QMetaType::QObjectStar;
QMetaPropertyBuilder prop = mob.addProperty(name, "QObject*");
prop.setWritable(false);
@@ -229,29 +229,29 @@ QmlBoundSignalParameters::QmlBoundSignalParameters(const QMetaMethod &method,
d_ptr->metaObject = mo;
}
-QmlBoundSignalParameters::~QmlBoundSignalParameters()
+QDeclarativeBoundSignalParameters::~QDeclarativeBoundSignalParameters()
{
delete [] types;
qFree(myMetaObject);
}
-void QmlBoundSignalParameters::setValues(void **v)
+void QDeclarativeBoundSignalParameters::setValues(void **v)
{
values = v;
}
-void QmlBoundSignalParameters::clearValues()
+void QDeclarativeBoundSignalParameters::clearValues()
{
values = 0;
}
-int QmlBoundSignalParameters::metaCall(QMetaObject::Call c, int id, void **a)
+int QDeclarativeBoundSignalParameters::metaCall(QMetaObject::Call c, int id, void **a)
{
if (!values)
return -1;
if (c == QMetaObject::ReadProperty && id >= 1) {
- QmlMetaType::copy(types[id - 1], a[0], values[id]);
+ QDeclarativeMetaType::copy(types[id - 1], a[0], values[id]);
return -1;
} else {
return qt_metacall(c, id, a);
@@ -260,4 +260,4 @@ int QmlBoundSignalParameters::metaCall(QMetaObject::Call c, int id, void **a)
QT_END_NAMESPACE
-#include <qmlboundsignal.moc>
+#include <qdeclarativeboundsignal.moc>
diff --git a/src/declarative/qml/qmlboundsignal_p.h b/src/declarative/qml/qdeclarativeboundsignal_p.h
index 51d21d7..bba4eec 100644
--- a/src/declarative/qml/qmlboundsignal_p.h
+++ b/src/declarative/qml/qdeclarativeboundsignal_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLBOUNDSIGNAL_P_H
-#define QMLBOUNDSIGNAL_P_H
+#ifndef QDECLARATIVEBOUNDSIGNAL_P_H
+#define QDECLARATIVEBOUNDSIGNAL_P_H
//
// W A R N I N G
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qmlexpression.h"
+#include "qdeclarativeexpression.h"
#include <QtCore/qmetaobject.h>
@@ -61,40 +61,40 @@
QT_BEGIN_NAMESPACE
-class QmlAbstractBoundSignal : public QObject
+class QDeclarativeAbstractBoundSignal : public QObject
{
Q_OBJECT
public:
- QmlAbstractBoundSignal(QObject *parent = 0);
- virtual ~QmlAbstractBoundSignal() = 0;
+ QDeclarativeAbstractBoundSignal(QObject *parent = 0);
+ virtual ~QDeclarativeAbstractBoundSignal() = 0;
};
-class QmlBoundSignalParameters;
-class QmlBoundSignal : public QmlAbstractBoundSignal
+class QDeclarativeBoundSignalParameters;
+class QDeclarativeBoundSignal : public QDeclarativeAbstractBoundSignal
{
public:
- QmlBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent);
- QmlBoundSignal(QmlContext *ctxt, const QString &val, QObject *scope,
+ QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent);
+ QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val, QObject *scope,
const QMetaMethod &signal, QObject *parent);
- virtual ~QmlBoundSignal();
+ virtual ~QDeclarativeBoundSignal();
int index() const;
- QmlExpression *expression() const;
- QmlExpression *setExpression(QmlExpression *);
+ QDeclarativeExpression *expression() const;
+ QDeclarativeExpression *setExpression(QDeclarativeExpression *);
- static QmlBoundSignal *cast(QObject *);
+ static QDeclarativeBoundSignal *cast(QObject *);
protected:
virtual int qt_metacall(QMetaObject::Call c, int id, void **a);
private:
- QmlExpression *m_expression;
+ QDeclarativeExpression *m_expression;
QMetaMethod m_signal;
bool m_paramsValid;
- QmlBoundSignalParameters *m_params;
+ QDeclarativeBoundSignalParameters *m_params;
};
QT_END_NAMESPACE
-#endif // QMLBOUNDSIGNAL_P_H
+#endif // QDECLARATIVEBOUNDSIGNAL_P_H
diff --git a/src/declarative/qml/qmlclassfactory.cpp b/src/declarative/qml/qdeclarativeclassfactory.cpp
index 2adff09..ae4975c 100644
--- a/src/declarative/qml/qmlclassfactory.cpp
+++ b/src/declarative/qml/qdeclarativeclassfactory.cpp
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#include "qmlclassfactory_p.h"
+#include "qdeclarativeclassfactory_p.h"
QT_BEGIN_NAMESPACE
-QmlClassFactory::~QmlClassFactory()
+QDeclarativeClassFactory::~QDeclarativeClassFactory()
{
}
diff --git a/src/declarative/qml/qmlclassfactory_p.h b/src/declarative/qml/qdeclarativeclassfactory_p.h
index 2ddadcf..9f4a3de 100644
--- a/src/declarative/qml/qmlclassfactory_p.h
+++ b/src/declarative/qml/qdeclarativeclassfactory_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCLASSFACTORY_P_H
-#define QMLCLASSFACTORY_P_H
+#ifndef QDECLARATIVECLASSFACTORY_P_H
+#define QDECLARATIVECLASSFACTORY_P_H
//
// W A R N I N G
@@ -57,18 +57,18 @@
QT_BEGIN_NAMESPACE
-class QmlEngine;
+class QDeclarativeEngine;
class QByteArray;
class QUrl;
-class QmlComponent;
+class QDeclarativeComponent;
-class QmlClassFactory
+class QDeclarativeClassFactory
{
public:
- virtual ~QmlClassFactory();
- virtual QmlComponent *create(const QByteArray &, const QUrl& baseUrl, QmlEngine*) = 0;
+ virtual ~QDeclarativeClassFactory();
+ virtual QDeclarativeComponent *create(const QByteArray &, const QUrl& baseUrl, QDeclarativeEngine*) = 0;
};
QT_END_NAMESPACE
-#endif // QMLCLASSFACTORY_P_H
+#endif // QDECLARATIVECLASSFACTORY_P_H
diff --git a/src/declarative/qml/qmlcleanup.cpp b/src/declarative/qml/qdeclarativecleanup.cpp
index 581d4a3..0fa49d1 100644
--- a/src/declarative/qml/qmlcleanup.cpp
+++ b/src/declarative/qml/qdeclarativecleanup.cpp
@@ -39,34 +39,34 @@
**
****************************************************************************/
-#include "qmlcleanup_p.h"
+#include "qdeclarativecleanup_p.h"
-#include "qmlengine_p.h"
+#include "qdeclarativeengine_p.h"
QT_BEGIN_NAMESPACE
/*!
\internal
-\class QmlCleanup
-\brief The QmlCleanup provides a callback when a QmlEngine is deleted.
+\class QDeclarativeCleanup
+\brief The QDeclarativeCleanup provides a callback when a QDeclarativeEngine is deleted.
-Any object that needs cleanup to occur before the QmlEngine's QScriptEngine is
-destroyed should inherit from QmlCleanup. The clear() virtual method will be
-called by QmlEngine just before it deletes the QScriptEngine.
+Any object that needs cleanup to occur before the QDeclarativeEngine's QScriptEngine is
+destroyed should inherit from QDeclarativeCleanup. The clear() virtual method will be
+called by QDeclarativeEngine just before it deletes the QScriptEngine.
*/
/*!
\internal
-Create a QmlCleanup for \a engine
+Create a QDeclarativeCleanup for \a engine
*/
-QmlCleanup::QmlCleanup(QmlEngine *engine)
+QDeclarativeCleanup::QDeclarativeCleanup(QDeclarativeEngine *engine)
: prev(0), next(0)
{
if (!engine)
return;
- QmlEnginePrivate *p = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
if (p->cleanup) next = p->cleanup;
p->cleanup = this;
@@ -77,7 +77,7 @@ QmlCleanup::QmlCleanup(QmlEngine *engine)
/*!
\internal
*/
-QmlCleanup::~QmlCleanup()
+QDeclarativeCleanup::~QDeclarativeCleanup()
{
if (prev) *prev = next;
if (next) next->prev = prev;
diff --git a/src/declarative/qml/qmlcleanup_p.h b/src/declarative/qml/qdeclarativecleanup_p.h
index 50803f3..e9b6b45 100644
--- a/src/declarative/qml/qmlcleanup_p.h
+++ b/src/declarative/qml/qdeclarativecleanup_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCLEANUP_P_H
-#define QMLCLEANUP_P_H
+#ifndef QDECLARATIVECLEANUP_P_H
+#define QDECLARATIVECLEANUP_P_H
#include <QtCore/qglobal.h>
@@ -57,23 +57,23 @@
QT_BEGIN_NAMESPACE
-class QmlEngine;
-class QmlCleanup
+class QDeclarativeEngine;
+class QDeclarativeCleanup
{
public:
- QmlCleanup(QmlEngine *);
- virtual ~QmlCleanup();
+ QDeclarativeCleanup(QDeclarativeEngine *);
+ virtual ~QDeclarativeCleanup();
protected:
virtual void clear() = 0;
private:
- friend class QmlEnginePrivate;
- QmlCleanup **prev;
- QmlCleanup *next;
+ friend class QDeclarativeEnginePrivate;
+ QDeclarativeCleanup **prev;
+ QDeclarativeCleanup *next;
};
QT_END_NAMESPACE
-#endif // QMLCLEANUP_P_H
+#endif // QDECLARATIVECLEANUP_P_H
diff --git a/src/declarative/qml/qmlcompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 7a8cf0e..face22c 100644
--- a/src/declarative/qml/qmlcompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -41,20 +41,20 @@
// #define COMPILEDBINDINGS_DEBUG
-#include "qmlcompiledbindings_p.h"
+#include "qdeclarativecompiledbindings_p.h"
-#include <QtDeclarative/qmlinfo.h>
-#include <private/qmlcontext_p.h>
-#include <private/qmljsast_p.h>
-#include <private/qmljsengine_p.h>
-#include <private/qmlexpression_p.h>
+#include <QtDeclarative/qdeclarativeinfo.h>
+#include <private/qdeclarativecontext_p.h>
+#include <private/qdeclarativejsast_p.h>
+#include <private/qdeclarativejsengine_p.h>
+#include <private/qdeclarativeexpression_p.h>
#include <QtCore/qdebug.h>
#include <QtCore/qnumeric.h>
-#include <private/qmlgraphicsanchors_p_p.h>
+#include <private/qdeclarativeanchors_p_p.h>
QT_BEGIN_NAMESPACE
-using namespace QmlJS;
+using namespace QDeclarativeJS;
namespace {
// Supported types: int, qreal, QString (needs constr/destr), QObject*, bool
@@ -96,22 +96,22 @@ struct Register {
};
}
-class QmlCompiledBindingsPrivate : public QObjectPrivate
+class QDeclarativeCompiledBindingsPrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QmlCompiledBindings)
+ Q_DECLARE_PUBLIC(QDeclarativeCompiledBindings)
public:
- QmlCompiledBindingsPrivate();
- virtual ~QmlCompiledBindingsPrivate();
+ QDeclarativeCompiledBindingsPrivate();
+ virtual ~QDeclarativeCompiledBindingsPrivate();
- struct Binding : public QmlAbstractBinding, public QmlDelayedError {
+ struct Binding : public QDeclarativeAbstractBinding, public QDeclarativeDelayedError {
Binding() : enabled(false), updating(0), property(0),
scope(0), target(0), parent(0) {}
- // Inherited from QmlAbstractBinding
- virtual void setEnabled(bool, QmlMetaProperty::WriteFlags flags);
+ // Inherited from QDeclarativeAbstractBinding
+ virtual void setEnabled(bool, QDeclarativeMetaProperty::WriteFlags flags);
virtual int propertyIndex();
- virtual void update(QmlMetaProperty::WriteFlags flags);
+ virtual void update(QDeclarativeMetaProperty::WriteFlags flags);
virtual void destroy();
int index:30;
@@ -121,12 +121,12 @@ public:
QObject *scope;
QObject *target;
- QmlCompiledBindingsPrivate *parent;
+ QDeclarativeCompiledBindingsPrivate *parent;
};
struct Subscription {
struct Signal {
- QmlGuard<QObject> source;
+ QDeclarativeGuard<QObject> source;
int notifyIndex;
};
@@ -136,10 +136,10 @@ public:
bool isSignal() const { return type == SignalType; }
bool isId() const { return type == IdType; }
inline Signal *signal();
- inline QmlContextPrivate::IdNotifier *id();
+ inline QDeclarativeContextPrivate::IdNotifier *id();
union {
char signalData[sizeof(Signal)];
- char idData[sizeof(QmlContextPrivate::IdNotifier)];
+ char idData[sizeof(QDeclarativeContextPrivate::IdNotifier)];
};
};
Subscription *subscriptions;
@@ -154,84 +154,84 @@ public:
static int methodCount;
void init();
- void run(int instr, QmlContextPrivate *context,
- QmlDelayedError *error, QObject *scope, QObject *output);
+ void run(int instr, QDeclarativeContextPrivate *context,
+ QDeclarativeDelayedError *error, QObject *scope, QObject *output);
inline void unsubscribe(int subIndex);
- inline void subscribeId(QmlContextPrivate *p, int idIndex, int subIndex);
+ inline void subscribeId(QDeclarativeContextPrivate *p, int idIndex, int subIndex);
inline void subscribe(QObject *o, int notifyIndex, int subIndex);
- QmlPropertyCache::Data *findproperty(QObject *obj,
+ QDeclarativePropertyCache::Data *findproperty(QObject *obj,
const QScriptDeclarativeClass::Identifier &name,
- QmlEnginePrivate *enginePriv,
- QmlPropertyCache::Data &local);
+ QDeclarativeEnginePrivate *enginePriv,
+ QDeclarativePropertyCache::Data &local);
bool findproperty(QObject *obj,
Register *output,
- QmlEnginePrivate *enginePriv,
+ QDeclarativeEnginePrivate *enginePriv,
int subIdx,
const QScriptDeclarativeClass::Identifier &name,
bool isTerminal);
void findgeneric(Register *output, // value output
int subIdx, // Subscription index in config
- QmlContextPrivate *context, // Context to search in
+ QDeclarativeContextPrivate *context, // Context to search in
const QScriptDeclarativeClass::Identifier &name,
bool isTerminal);
};
-QmlCompiledBindingsPrivate::QmlCompiledBindingsPrivate()
+QDeclarativeCompiledBindingsPrivate::QDeclarativeCompiledBindingsPrivate()
: subscriptions(0), identifiers(0)
{
}
-QmlCompiledBindingsPrivate::~QmlCompiledBindingsPrivate()
+QDeclarativeCompiledBindingsPrivate::~QDeclarativeCompiledBindingsPrivate()
{
delete [] subscriptions; subscriptions = 0;
delete [] identifiers; identifiers = 0;
}
-QmlCompiledBindingsPrivate::Subscription::Subscription()
+QDeclarativeCompiledBindingsPrivate::Subscription::Subscription()
: type(InvalidType)
{
}
-QmlCompiledBindingsPrivate::Subscription::~Subscription()
+QDeclarativeCompiledBindingsPrivate::Subscription::~Subscription()
{
if (type == SignalType) ((Signal *)signalData)->~Signal();
- else if (type == IdType) ((QmlContextPrivate::IdNotifier *)idData)->~IdNotifier();
+ else if (type == IdType) ((QDeclarativeContextPrivate::IdNotifier *)idData)->~IdNotifier();
}
-int QmlCompiledBindingsPrivate::methodCount = -1;
+int QDeclarativeCompiledBindingsPrivate::methodCount = -1;
-QmlCompiledBindings::QmlCompiledBindings(const char *program, QmlContext *context)
-: QObject(*(new QmlCompiledBindingsPrivate))
+QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, QDeclarativeContext *context)
+: QObject(*(new QDeclarativeCompiledBindingsPrivate))
{
- Q_D(QmlCompiledBindings);
+ Q_D(QDeclarativeCompiledBindings);
if (d->methodCount == -1)
- d->methodCount = QmlCompiledBindings::staticMetaObject.methodCount();
+ d->methodCount = QDeclarativeCompiledBindings::staticMetaObject.methodCount();
d->programData = program;
d->init();
- QmlAbstractExpression::setContext(context);
+ QDeclarativeAbstractExpression::setContext(context);
}
-QmlCompiledBindings::~QmlCompiledBindings()
+QDeclarativeCompiledBindings::~QDeclarativeCompiledBindings()
{
- Q_D(QmlCompiledBindings);
+ Q_D(QDeclarativeCompiledBindings);
delete [] d->m_bindings;
}
-QmlAbstractBinding *QmlCompiledBindings::configBinding(int index, QObject *target,
+QDeclarativeAbstractBinding *QDeclarativeCompiledBindings::configBinding(int index, QObject *target,
QObject *scope, int property)
{
- Q_D(QmlCompiledBindings);
+ Q_D(QDeclarativeCompiledBindings);
- QmlCompiledBindingsPrivate::Binding *rv = d->m_bindings + index;
+ QDeclarativeCompiledBindingsPrivate::Binding *rv = d->m_bindings + index;
rv->index = index;
rv->property = property;
@@ -244,7 +244,7 @@ QmlAbstractBinding *QmlCompiledBindings::configBinding(int index, QObject *targe
return rv;
}
-void QmlCompiledBindingsPrivate::Binding::setEnabled(bool e, QmlMetaProperty::WriteFlags flags)
+void QDeclarativeCompiledBindingsPrivate::Binding::setEnabled(bool e, QDeclarativeMetaProperty::WriteFlags flags)
{
if (e) {
addToObject(target);
@@ -253,7 +253,7 @@ void QmlCompiledBindingsPrivate::Binding::setEnabled(bool e, QmlMetaProperty::Wr
removeFromObject();
}
- QmlAbstractBinding::setEnabled(e, flags);
+ QDeclarativeAbstractBinding::setEnabled(e, flags);
if (enabled != e) {
enabled = e;
@@ -262,17 +262,17 @@ void QmlCompiledBindingsPrivate::Binding::setEnabled(bool e, QmlMetaProperty::Wr
}
}
-int QmlCompiledBindingsPrivate::Binding::propertyIndex()
+int QDeclarativeCompiledBindingsPrivate::Binding::propertyIndex()
{
return property & 0xFFFF;
}
-void QmlCompiledBindingsPrivate::Binding::update(QmlMetaProperty::WriteFlags)
+void QDeclarativeCompiledBindingsPrivate::Binding::update(QDeclarativeMetaProperty::WriteFlags)
{
parent->run(this);
}
-void QmlCompiledBindingsPrivate::Binding::destroy()
+void QDeclarativeCompiledBindingsPrivate::Binding::destroy()
{
enabled = false;
removeFromObject();
@@ -280,9 +280,9 @@ void QmlCompiledBindingsPrivate::Binding::destroy()
clear();
}
-int QmlCompiledBindings::qt_metacall(QMetaObject::Call c, int id, void **)
+int QDeclarativeCompiledBindings::qt_metacall(QMetaObject::Call c, int id, void **)
{
- Q_D(QmlCompiledBindings);
+ Q_D(QDeclarativeCompiledBindings);
if (c == QMetaObject::InvokeMetaMethod && id >= d->methodCount) {
id -= d->methodCount;
@@ -297,26 +297,26 @@ int QmlCompiledBindings::qt_metacall(QMetaObject::Call c, int id, void **)
return -1;
}
-void QmlCompiledBindingsPrivate::run(Binding *binding)
+void QDeclarativeCompiledBindingsPrivate::run(Binding *binding)
{
- Q_Q(QmlCompiledBindings);
+ Q_Q(QDeclarativeCompiledBindings);
if (!binding->enabled)
return;
if (binding->updating)
qWarning("ERROR: Circular binding");
- QmlContext *context = q->QmlAbstractExpression::context();
+ QDeclarativeContext *context = q->QDeclarativeAbstractExpression::context();
if (!context) {
- qWarning("QmlCompiledBindings: Attempted to evaluate an expression in an invalid context");
+ qWarning("QDeclarativeCompiledBindings: Attempted to evaluate an expression in an invalid context");
return;
}
- QmlContextPrivate *cp = QmlContextPrivate::get(context);
+ QDeclarativeContextPrivate *cp = QDeclarativeContextPrivate::get(context);
if (binding->property & 0xFFFF0000) {
- QmlEnginePrivate *ep = QmlEnginePrivate::get(cp->engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(cp->engine);
- QmlValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF];
+ QDeclarativeValueType *vt = ep->valueTypes[(binding->property >> 16) & 0xFF];
Q_ASSERT(vt);
vt->read(binding->target, binding->property & 0xFFFF);
@@ -324,26 +324,26 @@ void QmlCompiledBindingsPrivate::run(Binding *binding)
run(binding->index, cp, binding, binding->scope, target);
vt->write(binding->target, binding->property & 0xFFFF,
- QmlMetaProperty::DontRemoveBinding);
+ QDeclarativeMetaProperty::DontRemoveBinding);
} else {
run(binding->index, cp, binding, binding->scope, binding->target);
}
}
-QmlCompiledBindingsPrivate::Subscription::Signal *QmlCompiledBindingsPrivate::Subscription::signal()
+QDeclarativeCompiledBindingsPrivate::Subscription::Signal *QDeclarativeCompiledBindingsPrivate::Subscription::signal()
{
- if (type == IdType) ((QmlContextPrivate::IdNotifier *)idData)->~IdNotifier();
+ if (type == IdType) ((QDeclarativeContextPrivate::IdNotifier *)idData)->~IdNotifier();
if (type != SignalType) new (signalData) Signal;
type = SignalType;
return (Signal *)signalData;
}
-QmlContextPrivate::IdNotifier *QmlCompiledBindingsPrivate::Subscription::id()
+QDeclarativeContextPrivate::IdNotifier *QDeclarativeCompiledBindingsPrivate::Subscription::id()
{
if (type == SignalType) ((Signal *)signalData)->~Signal();
- if (type != IdType) new (idData) QmlContextPrivate::IdNotifier;
+ if (type != IdType) new (idData) QDeclarativeContextPrivate::IdNotifier;
type = IdType;
- return (QmlContextPrivate::IdNotifier *)idData;
+ return (QDeclarativeContextPrivate::IdNotifier *)idData;
}
namespace {
@@ -547,7 +547,7 @@ struct Program {
};
}
-struct QmlBindingCompilerPrivate
+struct QDeclarativeBindingCompilerPrivate
{
struct Result {
Result() : unknownType(false), metaObject(0), type(-1), reg(-1) {}
@@ -568,46 +568,46 @@ struct QmlBindingCompilerPrivate
QSet<QString> subscriptionSet;
};
- QmlBindingCompilerPrivate() : registers(0) {}
+ QDeclarativeBindingCompilerPrivate() : registers(0) {}
void resetInstanceState();
int commitCompile();
- QmlParser::Object *context;
- QmlParser::Object *component;
- QmlParser::Property *destination;
- QHash<QString, QmlParser::Object *> ids;
- QmlEnginePrivate::Imports imports;
- QmlEnginePrivate *engine;
+ QDeclarativeParser::Object *context;
+ QDeclarativeParser::Object *component;
+ QDeclarativeParser::Property *destination;
+ QHash<QString, QDeclarativeParser::Object *> ids;
+ QDeclarativeEnginePrivate::Imports imports;
+ QDeclarativeEnginePrivate *engine;
QString contextName() const { return QLatin1String("$$$SCOPE_") + QString::number((intptr_t)context, 16); }
- bool compile(QmlJS::AST::Node *);
+ bool compile(QDeclarativeJS::AST::Node *);
- bool parseExpression(QmlJS::AST::Node *, Result &);
+ bool parseExpression(QDeclarativeJS::AST::Node *, Result &);
- bool tryName(QmlJS::AST::Node *);
- bool parseName(QmlJS::AST::Node *, Result &);
+ bool tryName(QDeclarativeJS::AST::Node *);
+ bool parseName(QDeclarativeJS::AST::Node *, Result &);
- bool tryArith(QmlJS::AST::Node *);
- bool parseArith(QmlJS::AST::Node *, Result &);
+ bool tryArith(QDeclarativeJS::AST::Node *);
+ bool parseArith(QDeclarativeJS::AST::Node *, Result &);
bool numberArith(Result &, const Result &, const Result &, QSOperator::Op op);
bool stringArith(Result &, const Result &, const Result &, QSOperator::Op op);
- bool tryLogic(QmlJS::AST::Node *);
- bool parseLogic(QmlJS::AST::Node *, Result &);
+ bool tryLogic(QDeclarativeJS::AST::Node *);
+ bool parseLogic(QDeclarativeJS::AST::Node *, Result &);
- bool tryConditional(QmlJS::AST::Node *);
- bool parseConditional(QmlJS::AST::Node *, Result &);
+ bool tryConditional(QDeclarativeJS::AST::Node *);
+ bool parseConditional(QDeclarativeJS::AST::Node *, Result &);
- bool tryConstant(QmlJS::AST::Node *);
- bool parseConstant(QmlJS::AST::Node *, Result &);
+ bool tryConstant(QDeclarativeJS::AST::Node *);
+ bool parseConstant(QDeclarativeJS::AST::Node *, Result &);
- bool tryMethod(QmlJS::AST::Node *);
- bool parseMethod(QmlJS::AST::Node *, Result &);
+ bool tryMethod(QDeclarativeJS::AST::Node *);
+ bool parseMethod(QDeclarativeJS::AST::Node *, Result &);
- bool buildName(QStringList &, QmlJS::AST::Node *, QList<QmlJS::AST::ExpressionNode *> *nodes = 0);
- bool fetch(Result &type, const QMetaObject *, int reg, int idx, const QStringList &, QmlJS::AST::ExpressionNode *);
+ bool buildName(QStringList &, QDeclarativeJS::AST::Node *, QList<QDeclarativeJS::AST::ExpressionNode *> *nodes = 0);
+ bool fetch(Result &type, const QMetaObject *, int reg, int idx, const QStringList &, QDeclarativeJS::AST::ExpressionNode *);
quint32 registers;
QHash<int, QPair<int, int> > registerCleanups;
@@ -624,7 +624,7 @@ struct QmlBindingCompilerPrivate
int subscriptionIndex(const QStringList &);
bool subscriptionNeutral(const QSet<QString> &base, const QSet<QString> &lhs, const QSet<QString> &rhs);
- quint8 exceptionId(QmlJS::AST::ExpressionNode *);
+ quint8 exceptionId(QDeclarativeJS::AST::ExpressionNode *);
QVector<quint64> exceptions;
QSet<int> usedSubscriptionIds;
@@ -651,13 +651,13 @@ struct QmlBindingCompilerPrivate
QByteArray buildExceptionData() const;
};
-void QmlCompiledBindingsPrivate::unsubscribe(int subIndex)
+void QDeclarativeCompiledBindingsPrivate::unsubscribe(int subIndex)
{
- Q_Q(QmlCompiledBindings);
+ Q_Q(QDeclarativeCompiledBindings);
- QmlCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
+ QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
if (sub->isSignal()) {
- QmlCompiledBindingsPrivate::Subscription::Signal *s = sub->signal();
+ QDeclarativeCompiledBindingsPrivate::Subscription::Signal *s = sub->signal();
if (s->source)
#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
QMetaObject::disconnectOne(s->source, s->notifyIndex,
@@ -672,15 +672,15 @@ void QmlCompiledBindingsPrivate::unsubscribe(int subIndex)
}
}
-void QmlCompiledBindingsPrivate::subscribeId(QmlContextPrivate *p, int idIndex, int subIndex)
+void QDeclarativeCompiledBindingsPrivate::subscribeId(QDeclarativeContextPrivate *p, int idIndex, int subIndex)
{
- Q_Q(QmlCompiledBindings);
+ Q_Q(QDeclarativeCompiledBindings);
unsubscribe(subIndex);
if (p->idValues[idIndex]) {
- QmlCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
- QmlContextPrivate::IdNotifier *i = sub->id();
+ QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
+ QDeclarativeContextPrivate::IdNotifier *i = sub->id();
i->next = p->idValues[idIndex].bindings;
i->prev = &p->idValues[idIndex].bindings;
@@ -692,16 +692,16 @@ void QmlCompiledBindingsPrivate::subscribeId(QmlContextPrivate *p, int idIndex,
}
}
-void QmlCompiledBindingsPrivate::subscribe(QObject *o, int notifyIndex, int subIndex)
+void QDeclarativeCompiledBindingsPrivate::subscribe(QObject *o, int notifyIndex, int subIndex)
{
- Q_Q(QmlCompiledBindings);
+ Q_Q(QDeclarativeCompiledBindings);
- QmlCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
+ QDeclarativeCompiledBindingsPrivate::Subscription *sub = (subscriptions + subIndex);
if (sub->isId())
unsubscribe(subIndex);
- QmlCompiledBindingsPrivate::Subscription::Signal *s = sub->signal();
+ QDeclarativeCompiledBindingsPrivate::Subscription::Signal *s = sub->signal();
if (o != s->source || notifyIndex != s->notifyIndex) {
if (s->source)
#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 2))
@@ -767,7 +767,7 @@ inline static bool toBool(Register *reg, int type, bool *ok = 0)
}
}
-inline static QUrl toUrl(Register *reg, int type, QmlContextPrivate *context, bool *ok = 0)
+inline static QUrl toUrl(Register *reg, int type, QDeclarativeContextPrivate *context, bool *ok = 0)
{
if (ok) *ok = true;
@@ -810,8 +810,8 @@ static QObject *variantToQObject(const QVariant &value, bool *ok)
}
}
-bool QmlCompiledBindingsPrivate::findproperty(QObject *obj, Register *output,
- QmlEnginePrivate *enginePriv,
+bool QDeclarativeCompiledBindingsPrivate::findproperty(QObject *obj, Register *output,
+ QDeclarativeEnginePrivate *enginePriv,
int subIdx, const QScriptDeclarativeClass::Identifier &name,
bool isTerminal)
{
@@ -820,15 +820,15 @@ bool QmlCompiledBindingsPrivate::findproperty(QObject *obj, Register *output,
return false;
}
- QmlPropertyCache::Data local;
- QmlPropertyCache::Data *property =
- QmlPropertyCache::property(QmlEnginePrivate::get(enginePriv), obj, name, local);
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *property =
+ QDeclarativePropertyCache::property(QDeclarativeEnginePrivate::get(enginePriv), obj, name, local);
if (property) {
if (subIdx != -1)
subscribe(obj, property->notifyIndex, subIdx);
- if (property->flags & QmlPropertyCache::Data::IsQObjectDerived) {
+ if (property->flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
void *args[] = { output->typeDataPtr(), 0 };
QMetaObject::metacall(obj, QMetaObject::ReadProperty, property->coreIndex, args);
output->settype(QMetaType::QObjectStar);
@@ -883,13 +883,13 @@ bool QmlCompiledBindingsPrivate::findproperty(QObject *obj, Register *output,
}
}
-void QmlCompiledBindingsPrivate::findgeneric(Register *output,
+void QDeclarativeCompiledBindingsPrivate::findgeneric(Register *output,
int subIdx,
- QmlContextPrivate *context,
+ QDeclarativeContextPrivate *context,
const QScriptDeclarativeClass::Identifier &name,
bool isTerminal)
{
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(context->engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(context->engine);
while (context) {
@@ -899,7 +899,7 @@ void QmlCompiledBindingsPrivate::findgeneric(Register *output,
if (contextPropertyIndex != -1) {
if (subIdx != -1)
- subscribe(QmlContextPrivate::get(context), contextPropertyIndex + context->notifyIndex, subIdx);
+ subscribe(QDeclarativeContextPrivate::get(context), contextPropertyIndex + context->notifyIndex, subIdx);
if (contextPropertyIndex < context->idValueCount) {
output->setQObject(context->idValues[contextPropertyIndex]);
@@ -936,7 +936,7 @@ void QmlCompiledBindingsPrivate::findgeneric(Register *output,
}
if (context->parent) {
- context = QmlContextPrivate::get(context->parent);
+ context = QDeclarativeContextPrivate::get(context->parent);
} else {
context = 0;
}
@@ -945,20 +945,20 @@ void QmlCompiledBindingsPrivate::findgeneric(Register *output,
output->setUndefined();
}
-void QmlCompiledBindingsPrivate::init()
+void QDeclarativeCompiledBindingsPrivate::init()
{
Program *program = (Program *)programData;
if (program->subscriptions)
- subscriptions = new QmlCompiledBindingsPrivate::Subscription[program->subscriptions];
+ subscriptions = new QDeclarativeCompiledBindingsPrivate::Subscription[program->subscriptions];
if (program->identifiers)
identifiers = new QScriptDeclarativeClass::PersistentIdentifier[program->identifiers];
m_signalTable = (quint32 *)(program->data() + program->signalTableOffset);
- m_bindings = new QmlCompiledBindingsPrivate::Binding[program->bindings];
+ m_bindings = new QDeclarativeCompiledBindingsPrivate::Binding[program->bindings];
}
-static void throwException(int id, QmlDelayedError *error,
- Program *program, QmlContextPrivate *context,
+static void throwException(int id, QDeclarativeDelayedError *error,
+ Program *program, QDeclarativeContextPrivate *context,
const QString &description = QString())
{
error->error.setUrl(context->url);
@@ -974,7 +974,7 @@ static void throwException(int id, QmlDelayedError *error,
error->error.setLine(-1);
error->error.setColumn(-1);
}
- if (!context->engine || !error->addError(QmlEnginePrivate::get(context->engine)))
+ if (!context->engine || !error->addError(QDeclarativeEnginePrivate::get(context->engine)))
qWarning() << error->error;
}
@@ -1119,8 +1119,8 @@ static void dumpInstruction(const Instr *instr)
}
}
-void QmlCompiledBindingsPrivate::run(int instrIndex,
- QmlContextPrivate *context, QmlDelayedError *error,
+void QDeclarativeCompiledBindingsPrivate::run(int instrIndex,
+ QDeclarativeContextPrivate *context, QDeclarativeDelayedError *error,
QObject *scope, QObject *output)
{
error->removeError();
@@ -1128,7 +1128,7 @@ void QmlCompiledBindingsPrivate::run(int instrIndex,
Register registers[32];
int storeFlags = 0;
- QmlEnginePrivate *engine = QmlEnginePrivate::get(context->engine);
+ QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(context->engine);
Program *program = (Program *)programData;
const Instr *instr = program->instructions();
instr += instrIndex;
@@ -1455,7 +1455,7 @@ void QmlCompiledBindingsPrivate::run(int instrIndex,
// name is not present in the current context or it would have been
// found during the static compile
findgeneric(registers + instr->find.reg, instr->find.subscribeIndex,
- QmlContextPrivate::get(context->parent),
+ QDeclarativeContextPrivate::get(context->parent),
identifiers[instr->find.name].identifier,
instr->common.type == Instr::FindGenericTerminal);
break;
@@ -1470,7 +1470,7 @@ void QmlCompiledBindingsPrivate::run(int instrIndex,
}
findproperty(object.getQObject(), registers + instr->find.reg,
- QmlEnginePrivate::get(context->engine),
+ QDeclarativeEnginePrivate::get(context->engine),
instr->find.subscribeIndex, identifiers[instr->find.name].identifier,
instr->common.type == Instr::FindPropertyTerminal);
}
@@ -1540,7 +1540,7 @@ void QmlCompiledBindingsPrivate::run(int instrIndex,
}
}
-void QmlBindingCompiler::dump(const QByteArray &programData)
+void QDeclarativeBindingCompiler::dump(const QByteArray &programData)
{
const Program *program = (const Program *)programData.constData();
@@ -1563,7 +1563,7 @@ void QmlBindingCompiler::dump(const QByteArray &programData)
Clear the state associated with attempting to compile a specific binding.
This does not clear the global "commited binding" states.
*/
-void QmlBindingCompilerPrivate::resetInstanceState()
+void QDeclarativeBindingCompilerPrivate::resetInstanceState()
{
registers = 0;
registerCleanups.clear();
@@ -1582,7 +1582,7 @@ section.
Returns the index for the committed binding.
*/
-int QmlBindingCompilerPrivate::commitCompile()
+int QDeclarativeBindingCompilerPrivate::commitCompile()
{
int rv = committed.count();
committed.offsets << committed.bytecode.count();
@@ -1595,7 +1595,7 @@ int QmlBindingCompilerPrivate::commitCompile()
return rv;
}
-bool QmlBindingCompilerPrivate::compile(QmlJS::AST::Node *node)
+bool QDeclarativeBindingCompilerPrivate::compile(QDeclarativeJS::AST::Node *node)
{
resetInstanceState();
@@ -1701,7 +1701,7 @@ bool QmlBindingCompilerPrivate::compile(QmlJS::AST::Node *node)
const QMetaObject *from = type.metaObject;
const QMetaObject *to = engine->rawMetaObjectForType(destination->type);
- if (QmlMetaPropertyPrivate::canConvert(from, to))
+ if (QDeclarativeMetaPropertyPrivate::canConvert(from, to))
type.type = destination->type;
}
@@ -1727,7 +1727,7 @@ bool QmlBindingCompilerPrivate::compile(QmlJS::AST::Node *node)
}
}
-bool QmlBindingCompilerPrivate::parseExpression(QmlJS::AST::Node *node, Result &type)
+bool QDeclarativeBindingCompilerPrivate::parseExpression(QDeclarativeJS::AST::Node *node, Result &type)
{
while (node->kind == AST::Node::Kind_NestedExpression)
node = static_cast<AST::NestedExpression *>(node)->expression;
@@ -1750,13 +1750,13 @@ bool QmlBindingCompilerPrivate::parseExpression(QmlJS::AST::Node *node, Result &
return true;
}
-bool QmlBindingCompilerPrivate::tryName(QmlJS::AST::Node *node)
+bool QDeclarativeBindingCompilerPrivate::tryName(QDeclarativeJS::AST::Node *node)
{
return node->kind == AST::Node::Kind_IdentifierExpression ||
node->kind == AST::Node::Kind_FieldMemberExpression;
}
-bool QmlBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
+bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
{
QStringList nameParts;
QList<AST::ExpressionNode *> nameNodes;
@@ -1768,7 +1768,7 @@ bool QmlBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
return false;
type.reg = reg;
- QmlParser::Object *absType = 0;
+ QDeclarativeParser::Object *absType = 0;
QStringList subscribeName;
@@ -1782,7 +1782,7 @@ bool QmlBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
name.at(2).isUpper())
return false;
- QmlType *attachType = 0;
+ QDeclarativeType *attachType = 0;
if (name.at(0).isUpper()) {
// Could be an attached property
if (ii == nameParts.count() - 1)
@@ -1790,7 +1790,7 @@ bool QmlBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
if (nameParts.at(ii + 1).at(0).isUpper())
return false;
- QmlEnginePrivate::ImportedNamespace *ns = 0;
+ QDeclarativeEnginePrivate::ImportedNamespace *ns = 0;
if (!engine->resolveType(imports, name.toUtf8(), &attachType, 0, 0, 0, &ns))
return false;
if (ns || !attachType || !attachType->attachedPropertiesType())
@@ -1824,7 +1824,7 @@ bool QmlBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
continue;
} else if (ids.contains(name)) {
- QmlParser::Object *idObject = ids.value(name);
+ QDeclarativeParser::Object *idObject = ids.value(name);
absType = idObject;
type.metaObject = absType->metaObject();
@@ -1988,7 +1988,7 @@ bool QmlBindingCompilerPrivate::parseName(AST::Node *node, Result &type)
return true;
}
-bool QmlBindingCompilerPrivate::tryArith(QmlJS::AST::Node *node)
+bool QDeclarativeBindingCompilerPrivate::tryArith(QDeclarativeJS::AST::Node *node)
{
if (node->kind != AST::Node::Kind_BinaryExpression)
return false;
@@ -2001,7 +2001,7 @@ bool QmlBindingCompilerPrivate::tryArith(QmlJS::AST::Node *node)
return false;
}
-bool QmlBindingCompilerPrivate::parseArith(QmlJS::AST::Node *node, Result &type)
+bool QDeclarativeBindingCompilerPrivate::parseArith(QDeclarativeJS::AST::Node *node, Result &type)
{
AST::BinaryExpression *expression = static_cast<AST::BinaryExpression *>(node);
@@ -2026,7 +2026,7 @@ bool QmlBindingCompilerPrivate::parseArith(QmlJS::AST::Node *node, Result &type)
return false;
}
-bool QmlBindingCompilerPrivate::numberArith(Result &type, const Result &lhs, const Result &rhs, QSOperator::Op op)
+bool QDeclarativeBindingCompilerPrivate::numberArith(Result &type, const Result &lhs, const Result &rhs, QSOperator::Op op)
{
bool nativeReal = rhs.type == QMetaType::QReal ||
lhs.type == QMetaType::QReal ||
@@ -2098,7 +2098,7 @@ bool QmlBindingCompilerPrivate::numberArith(Result &type, const Result &lhs, con
return true;
}
-bool QmlBindingCompilerPrivate::stringArith(Result &type, const Result &lhs, const Result &rhs, QSOperator::Op op)
+bool QDeclarativeBindingCompilerPrivate::stringArith(Result &type, const Result &lhs, const Result &rhs, QSOperator::Op op)
{
if (op != QSOperator::Add)
return false;
@@ -2142,7 +2142,7 @@ bool QmlBindingCompilerPrivate::stringArith(Result &type, const Result &lhs, con
return true;
}
-bool QmlBindingCompilerPrivate::tryLogic(QmlJS::AST::Node *node)
+bool QDeclarativeBindingCompilerPrivate::tryLogic(QDeclarativeJS::AST::Node *node)
{
if (node->kind != AST::Node::Kind_BinaryExpression)
return false;
@@ -2156,7 +2156,7 @@ bool QmlBindingCompilerPrivate::tryLogic(QmlJS::AST::Node *node)
return false;
}
-bool QmlBindingCompilerPrivate::parseLogic(QmlJS::AST::Node *node, Result &type)
+bool QDeclarativeBindingCompilerPrivate::parseLogic(QDeclarativeJS::AST::Node *node, Result &type)
{
AST::BinaryExpression *expression = static_cast<AST::BinaryExpression *>(node);
@@ -2211,12 +2211,12 @@ bool QmlBindingCompilerPrivate::parseLogic(QmlJS::AST::Node *node, Result &type)
return true;
}
-bool QmlBindingCompilerPrivate::tryConditional(QmlJS::AST::Node *node)
+bool QDeclarativeBindingCompilerPrivate::tryConditional(QDeclarativeJS::AST::Node *node)
{
return (node->kind == AST::Node::Kind_ConditionalExpression);
}
-bool QmlBindingCompilerPrivate::parseConditional(QmlJS::AST::Node *node, Result &type)
+bool QDeclarativeBindingCompilerPrivate::parseConditional(QDeclarativeJS::AST::Node *node, Result &type)
{
AST::ConditionalExpression *expression = static_cast<AST::ConditionalExpression *>(node);
@@ -2279,7 +2279,7 @@ bool QmlBindingCompilerPrivate::parseConditional(QmlJS::AST::Node *node, Result
return true;
}
-bool QmlBindingCompilerPrivate::tryConstant(QmlJS::AST::Node *node)
+bool QDeclarativeBindingCompilerPrivate::tryConstant(QDeclarativeJS::AST::Node *node)
{
return node->kind == AST::Node::Kind_TrueLiteral ||
node->kind == AST::Node::Kind_FalseLiteral ||
@@ -2287,7 +2287,7 @@ bool QmlBindingCompilerPrivate::tryConstant(QmlJS::AST::Node *node)
node->kind == AST::Node::Kind_StringLiteral;
}
-bool QmlBindingCompilerPrivate::parseConstant(QmlJS::AST::Node *node, Result &type)
+bool QDeclarativeBindingCompilerPrivate::parseConstant(QDeclarativeJS::AST::Node *node, Result &type)
{
type.metaObject = 0;
type.type = -1;
@@ -2332,12 +2332,12 @@ bool QmlBindingCompilerPrivate::parseConstant(QmlJS::AST::Node *node, Result &ty
}
}
-bool QmlBindingCompilerPrivate::tryMethod(QmlJS::AST::Node *node)
+bool QDeclarativeBindingCompilerPrivate::tryMethod(QDeclarativeJS::AST::Node *node)
{
return node->kind == AST::Node::Kind_CallExpression;
}
-bool QmlBindingCompilerPrivate::parseMethod(QmlJS::AST::Node *node, Result &result)
+bool QDeclarativeBindingCompilerPrivate::parseMethod(QDeclarativeJS::AST::Node *node, Result &result)
{
AST::CallExpression *expr = static_cast<AST::CallExpression *>(node);
@@ -2390,9 +2390,9 @@ bool QmlBindingCompilerPrivate::parseMethod(QmlJS::AST::Node *node, Result &resu
return true;
}
-bool QmlBindingCompilerPrivate::buildName(QStringList &name,
- QmlJS::AST::Node *node,
- QList<QmlJS::AST::ExpressionNode *> *nodes)
+bool QDeclarativeBindingCompilerPrivate::buildName(QStringList &name,
+ QDeclarativeJS::AST::Node *node,
+ QList<QDeclarativeJS::AST::ExpressionNode *> *nodes)
{
if (node->kind == AST::Node::Kind_IdentifierExpression) {
name << static_cast<AST::IdentifierExpression*>(node)->name->asString();
@@ -2414,8 +2414,8 @@ bool QmlBindingCompilerPrivate::buildName(QStringList &name,
}
-bool QmlBindingCompilerPrivate::fetch(Result &rv, const QMetaObject *mo, int reg,
- int idx, const QStringList &subName, QmlJS::AST::ExpressionNode *node)
+bool QDeclarativeBindingCompilerPrivate::fetch(Result &rv, const QMetaObject *mo, int reg,
+ int idx, const QStringList &subName, QDeclarativeJS::AST::ExpressionNode *node)
{
QMetaProperty prop = mo->property(idx);
rv.metaObject = 0;
@@ -2464,7 +2464,7 @@ bool QmlBindingCompilerPrivate::fetch(Result &rv, const QMetaObject *mo, int reg
rv.type != QMetaType::QReal &&
rv.type != QMetaType::Int &&
rv.type != QMetaType::Bool &&
- rv.type != qMetaTypeId<QmlGraphicsAnchorLine>() &&
+ rv.type != qMetaTypeId<QDeclarativeAnchorLine>() &&
rv.type != QMetaType::QString) {
rv.metaObject = 0;
rv.type = 0;
@@ -2474,12 +2474,12 @@ bool QmlBindingCompilerPrivate::fetch(Result &rv, const QMetaObject *mo, int reg
return true;
}
-void QmlBindingCompilerPrivate::registerCleanup(int reg, int cleanup, int cleanupType)
+void QDeclarativeBindingCompilerPrivate::registerCleanup(int reg, int cleanup, int cleanupType)
{
registerCleanups.insert(reg, qMakePair(cleanup, cleanupType));
}
-int QmlBindingCompilerPrivate::acquireReg(int cleanup, int cleanupType)
+int QDeclarativeBindingCompilerPrivate::acquireReg(int cleanup, int cleanupType)
{
for (int ii = 0; ii < 32; ++ii) {
if (!(registers & (1 << ii))) {
@@ -2494,7 +2494,7 @@ int QmlBindingCompilerPrivate::acquireReg(int cleanup, int cleanupType)
return -1;
}
-void QmlBindingCompilerPrivate::releaseReg(int reg)
+void QDeclarativeBindingCompilerPrivate::releaseReg(int reg)
{
Q_ASSERT(reg >= 0 && reg <= 31);
@@ -2512,7 +2512,7 @@ void QmlBindingCompilerPrivate::releaseReg(int reg)
}
// Returns a reg
-int QmlBindingCompilerPrivate::registerLiteralString(const QString &str)
+int QDeclarativeBindingCompilerPrivate::registerLiteralString(const QString &str)
{
QByteArray strdata((const char *)str.constData(), str.length() * sizeof(QChar));
int offset = data.count();
@@ -2531,7 +2531,7 @@ int QmlBindingCompilerPrivate::registerLiteralString(const QString &str)
}
// Returns an identifier offset
-int QmlBindingCompilerPrivate::registerString(const QString &string)
+int QDeclarativeBindingCompilerPrivate::registerString(const QString &string)
{
Q_ASSERT(!string.isEmpty());
@@ -2556,7 +2556,7 @@ int QmlBindingCompilerPrivate::registerString(const QString &string)
return reg.initstring.offset;
}
-bool QmlBindingCompilerPrivate::subscription(const QStringList &sub, Result *result)
+bool QDeclarativeBindingCompilerPrivate::subscription(const QStringList &sub, Result *result)
{
QString str = sub.join(QLatin1String("."));
result->subscriptionSet.insert(str);
@@ -2569,7 +2569,7 @@ bool QmlBindingCompilerPrivate::subscription(const QStringList &sub, Result *res
}
}
-int QmlBindingCompilerPrivate::subscriptionIndex(const QStringList &sub)
+int QDeclarativeBindingCompilerPrivate::subscriptionIndex(const QStringList &sub)
{
QString str = sub.join(QLatin1String("."));
QHash<QString, int>::ConstIterator iter = subscriptionIds.find(str);
@@ -2583,7 +2583,7 @@ int QmlBindingCompilerPrivate::subscriptionIndex(const QStringList &sub)
Returns true if lhs contains no subscriptions that aren't also in base or rhs AND
rhs contains no subscriptions that aren't also in base or lhs.
*/
-bool QmlBindingCompilerPrivate::subscriptionNeutral(const QSet<QString> &base,
+bool QDeclarativeBindingCompilerPrivate::subscriptionNeutral(const QSet<QString> &base,
const QSet<QString> &lhs,
const QSet<QString> &rhs)
{
@@ -2598,12 +2598,12 @@ bool QmlBindingCompilerPrivate::subscriptionNeutral(const QSet<QString> &base,
return difflhs.isEmpty();
}
-quint8 QmlBindingCompilerPrivate::exceptionId(QmlJS::AST::ExpressionNode *n)
+quint8 QDeclarativeBindingCompilerPrivate::exceptionId(QDeclarativeJS::AST::ExpressionNode *n)
{
quint8 rv = 0xFF;
if (n && exceptions.count() < 0xFF) {
rv = (quint8)exceptions.count();
- QmlJS::AST::SourceLocation l = n->firstSourceLocation();
+ QDeclarativeJS::AST::SourceLocation l = n->firstSourceLocation();
quint64 e = l.startLine;
e <<= 32;
e |= l.startColumn;
@@ -2612,12 +2612,12 @@ quint8 QmlBindingCompilerPrivate::exceptionId(QmlJS::AST::ExpressionNode *n)
return rv;
}
-QmlBindingCompiler::QmlBindingCompiler()
-: d(new QmlBindingCompilerPrivate)
+QDeclarativeBindingCompiler::QDeclarativeBindingCompiler()
+: d(new QDeclarativeBindingCompilerPrivate)
{
}
-QmlBindingCompiler::~QmlBindingCompiler()
+QDeclarativeBindingCompiler::~QDeclarativeBindingCompiler()
{
delete d; d = 0;
}
@@ -2625,7 +2625,7 @@ QmlBindingCompiler::~QmlBindingCompiler()
/*
Returns true if any bindings were compiled.
*/
-bool QmlBindingCompiler::isValid() const
+bool QDeclarativeBindingCompiler::isValid() const
{
return !d->committed.bytecode.isEmpty();
}
@@ -2633,7 +2633,7 @@ bool QmlBindingCompiler::isValid() const
/*
-1 on failure, otherwise the binding index to use.
*/
-int QmlBindingCompiler::compile(const Expression &expression, QmlEnginePrivate *engine)
+int QDeclarativeBindingCompiler::compile(const Expression &expression, QDeclarativeEnginePrivate *engine)
{
if (!expression.expression.asAST()) return false;
@@ -2652,7 +2652,7 @@ int QmlBindingCompiler::compile(const Expression &expression, QmlEnginePrivate *
}
-QByteArray QmlBindingCompilerPrivate::buildSignalTable() const
+QByteArray QDeclarativeBindingCompilerPrivate::buildSignalTable() const
{
QHash<int, QList<int> > table;
@@ -2676,7 +2676,7 @@ QByteArray QmlBindingCompilerPrivate::buildSignalTable() const
return QByteArray((const char *)header.constData(), header.count() * sizeof(quint32));
}
-QByteArray QmlBindingCompilerPrivate::buildExceptionData() const
+QByteArray QDeclarativeBindingCompilerPrivate::buildExceptionData() const
{
QByteArray rv;
rv.resize(committed.exceptions.count() * sizeof(quint64));
@@ -2687,7 +2687,7 @@ QByteArray QmlBindingCompilerPrivate::buildExceptionData() const
/*
Returns the compiled program.
*/
-QByteArray QmlBindingCompiler::program() const
+QByteArray QDeclarativeBindingCompiler::program() const
{
QByteArray programData;
diff --git a/src/declarative/qml/qmlcompiledbindings_p.h b/src/declarative/qml/qdeclarativecompiledbindings_p.h
index 056cc21..2e24371 100644
--- a/src/declarative/qml/qmlcompiledbindings_p.h
+++ b/src/declarative/qml/qdeclarativecompiledbindings_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLBINDINGOPTIMIZATIONS_P_H
-#define QMLBINDINGOPTIMIZATIONS_P_H
+#ifndef QDECLARATIVEBINDINGOPTIMIZATIONS_P_H
+#define QDECLARATIVEBINDINGOPTIMIZATIONS_P_H
//
// W A R N I N G
@@ -53,64 +53,64 @@
// We mean it.
//
-#include "qmlexpression_p.h"
-#include "qmlbinding_p.h"
+#include "qdeclarativeexpression_p.h"
+#include "qdeclarativebinding_p.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QmlBindingCompilerPrivate;
-class QmlBindingCompiler
+class QDeclarativeBindingCompilerPrivate;
+class QDeclarativeBindingCompiler
{
public:
- QmlBindingCompiler();
- ~QmlBindingCompiler();
+ QDeclarativeBindingCompiler();
+ ~QDeclarativeBindingCompiler();
// Returns true if bindings were compiled
bool isValid() const;
struct Expression
{
- QmlParser::Object *component;
- QmlParser::Object *context;
- QmlParser::Property *property;
- QmlParser::Variant expression;
- QHash<QString, QmlParser::Object *> ids;
- QmlEnginePrivate::Imports imports;
+ QDeclarativeParser::Object *component;
+ QDeclarativeParser::Object *context;
+ QDeclarativeParser::Property *property;
+ QDeclarativeParser::Variant expression;
+ QHash<QString, QDeclarativeParser::Object *> ids;
+ QDeclarativeEnginePrivate::Imports imports;
};
// -1 on failure, otherwise the binding index to use
- int compile(const Expression &, QmlEnginePrivate *);
+ int compile(const Expression &, QDeclarativeEnginePrivate *);
// Returns the compiled program
QByteArray program() const;
static void dump(const QByteArray &);
private:
- QmlBindingCompilerPrivate *d;
+ QDeclarativeBindingCompilerPrivate *d;
};
-class QmlCompiledBindingsPrivate;
-class QmlCompiledBindings : public QObject, public QmlAbstractExpression, public QmlRefCount
+class QDeclarativeCompiledBindingsPrivate;
+class QDeclarativeCompiledBindings : public QObject, public QDeclarativeAbstractExpression, public QDeclarativeRefCount
{
public:
- QmlCompiledBindings(const char *program, QmlContext *context);
- virtual ~QmlCompiledBindings();
+ QDeclarativeCompiledBindings(const char *program, QDeclarativeContext *context);
+ virtual ~QDeclarativeCompiledBindings();
- QmlAbstractBinding *configBinding(int index, QObject *target, QObject *scope, int property);
+ QDeclarativeAbstractBinding *configBinding(int index, QObject *target, QObject *scope, int property);
protected:
int qt_metacall(QMetaObject::Call, int, void **);
private:
- Q_DISABLE_COPY(QmlCompiledBindings);
- Q_DECLARE_PRIVATE(QmlCompiledBindings);
+ Q_DISABLE_COPY(QDeclarativeCompiledBindings);
+ Q_DECLARE_PRIVATE(QDeclarativeCompiledBindings);
};
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLBINDINGOPTIMIZATIONS_P_H
+#endif // QDECLARATIVEBINDINGOPTIMIZATIONS_P_H
diff --git a/src/declarative/qml/qmlcompileddata.cpp b/src/declarative/qml/qdeclarativecompileddata.cpp
index 0120f56..bdf16a3 100644
--- a/src/declarative/qml/qmlcompileddata.cpp
+++ b/src/declarative/qml/qdeclarativecompileddata.cpp
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#include "qmlcompiler_p.h"
-#include "qmlengine.h"
-#include "qmlcomponent.h"
-#include "qmlcomponent_p.h"
-#include "qmlcontext.h"
-#include "qmlcontext_p.h"
+#include "qdeclarativecompiler_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativecomponent.h"
+#include "qdeclarativecomponent_p.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativecontext_p.h"
#include <QtCore/qdebug.h>
@@ -52,7 +52,7 @@
QT_BEGIN_NAMESPACE
-int QmlCompiledData::pack(const char *data, size_t size)
+int QDeclarativeCompiledData::pack(const char *data, size_t size)
{
const char *p = packData.constData();
unsigned int ps = packData.size();
@@ -67,7 +67,7 @@ int QmlCompiledData::pack(const char *data, size_t size)
return rv;
}
-int QmlCompiledData::indexForString(const QString &data)
+int QDeclarativeCompiledData::indexForString(const QString &data)
{
int idx = primitives.indexOf(data);
if (idx == -1) {
@@ -77,7 +77,7 @@ int QmlCompiledData::indexForString(const QString &data)
return idx;
}
-int QmlCompiledData::indexForByteArray(const QByteArray &data)
+int QDeclarativeCompiledData::indexForByteArray(const QByteArray &data)
{
int idx = datas.indexOf(data);
if (idx == -1) {
@@ -87,7 +87,7 @@ int QmlCompiledData::indexForByteArray(const QByteArray &data)
return idx;
}
-int QmlCompiledData::indexForUrl(const QUrl &data)
+int QDeclarativeCompiledData::indexForUrl(const QUrl &data)
{
int idx = urls.indexOf(data);
if (idx == -1) {
@@ -97,7 +97,7 @@ int QmlCompiledData::indexForUrl(const QUrl &data)
return idx;
}
-int QmlCompiledData::indexForFloat(float *data, int count)
+int QDeclarativeCompiledData::indexForFloat(float *data, int count)
{
Q_ASSERT(count > 0);
@@ -121,7 +121,7 @@ int QmlCompiledData::indexForFloat(float *data, int count)
return idx;
}
-int QmlCompiledData::indexForInt(int *data, int count)
+int QDeclarativeCompiledData::indexForInt(int *data, int count)
{
Q_ASSERT(count > 0);
@@ -145,7 +145,7 @@ int QmlCompiledData::indexForInt(int *data, int count)
return idx;
}
-int QmlCompiledData::indexForLocation(const QmlParser::Location &l)
+int QDeclarativeCompiledData::indexForLocation(const QDeclarativeParser::Location &l)
{
// ### FIXME
int rv = locations.count();
@@ -153,7 +153,7 @@ int QmlCompiledData::indexForLocation(const QmlParser::Location &l)
return rv;
}
-int QmlCompiledData::indexForLocation(const QmlParser::LocationSpan &l)
+int QDeclarativeCompiledData::indexForLocation(const QDeclarativeParser::LocationSpan &l)
{
// ### FIXME
int rv = locations.count();
@@ -161,12 +161,12 @@ int QmlCompiledData::indexForLocation(const QmlParser::LocationSpan &l)
return rv;
}
-QmlCompiledData::QmlCompiledData(QmlEngine *engine)
-: QmlCleanup(engine), importCache(0), root(0), rootPropertyCache(0)
+QDeclarativeCompiledData::QDeclarativeCompiledData(QDeclarativeEngine *engine)
+: QDeclarativeCleanup(engine), importCache(0), root(0), rootPropertyCache(0)
{
}
-QmlCompiledData::~QmlCompiledData()
+QDeclarativeCompiledData::~QDeclarativeCompiledData()
{
for (int ii = 0; ii < types.count(); ++ii) {
if (types.at(ii).ref)
@@ -189,7 +189,7 @@ QmlCompiledData::~QmlCompiledData()
qDeleteAll(cachedClosures);
}
-void QmlCompiledData::clear()
+void QDeclarativeCompiledData::clear()
{
qDeleteAll(cachedPrograms);
qDeleteAll(cachedClosures);
@@ -200,30 +200,30 @@ void QmlCompiledData::clear()
}
-QObject *QmlCompiledData::TypeReference::createInstance(QmlContext *ctxt, const QBitField &bindings) const
+QObject *QDeclarativeCompiledData::TypeReference::createInstance(QDeclarativeContext *ctxt, const QBitField &bindings) const
{
if (type) {
QObject *rv = type->create();
if (rv)
- QmlEngine::setContextForObject(rv, ctxt);
+ QDeclarativeEngine::setContextForObject(rv, ctxt);
return rv;
} else {
Q_ASSERT(component);
- return QmlComponentPrivate::get(component)->create(ctxt, bindings);
+ return QDeclarativeComponentPrivate::get(component)->create(ctxt, bindings);
}
}
-const QMetaObject *QmlCompiledData::TypeReference::metaObject() const
+const QMetaObject *QDeclarativeCompiledData::TypeReference::metaObject() const
{
if (type) {
return type->metaObject();
} else {
Q_ASSERT(component);
- return static_cast<QmlComponentPrivate *>(QObjectPrivate::get(component))->cc->root;
+ return static_cast<QDeclarativeComponentPrivate *>(QObjectPrivate::get(component))->cc->root;
}
}
-void QmlCompiledData::dumpInstructions()
+void QDeclarativeCompiledData::dumpInstructions()
{
if (!name.isEmpty())
qWarning() << name;
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 3702d0b..0593a5d 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -39,32 +39,32 @@
**
****************************************************************************/
-#include "qmlcompiler_p.h"
+#include "qdeclarativecompiler_p.h"
-#include "qmlcompositetypedata_p.h"
-#include "qmlparser_p.h"
-#include "qmlscriptparser_p.h"
-#include "qmlpropertyvaluesource.h"
-#include "qmlcomponent.h"
+#include "qdeclarativecompositetypedata_p.h"
+#include "qdeclarativeparser_p.h"
+#include "qdeclarativescriptparser_p.h"
+#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativecomponent.h"
#include "qmetaobjectbuilder_p.h"
-#include "qmlstringconverters_p.h"
-#include "qmlengine_p.h"
-#include "qmlengine.h"
-#include "qmlcontext.h"
-#include "qmlmetatype.h"
-#include "qmlcustomparser_p_p.h"
-#include "qmlcontext_p.h"
-#include "qmlcomponent_p.h"
-#include "parser/qmljsast_p.h"
-#include "qmlvmemetaobject_p.h"
-#include "qmlexpression_p.h"
-#include "qmlmetaproperty_p.h"
-#include "qmlrewrite_p.h"
-#include "qmlscriptstring.h"
-#include "qmlglobal_p.h"
-#include "qmlscriptparser_p.h"
-#include "qmlbinding_p.h"
-#include "qmlcompiledbindings_p.h"
+#include "qdeclarativestringconverters_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativemetatype.h"
+#include "qdeclarativecustomparser_p_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativecomponent_p.h"
+#include "parser/qdeclarativejsast_p.h"
+#include "qdeclarativevmemetaobject_p.h"
+#include "qdeclarativeexpression_p.h"
+#include "qdeclarativemetaproperty_p.h"
+#include "qdeclarativerewrite_p.h"
+#include "qdeclarativescriptstring.h"
+#include "qdeclarativeglobal_p.h"
+#include "qdeclarativescriptparser_p.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativecompiledbindings_p.h"
#include <qfxperf_p_p.h>
@@ -83,12 +83,12 @@ DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP);
DEFINE_BOOL_CONFIG_OPTION(compilerStatDump, QML_COMPILER_STATISTICS_DUMP);
DEFINE_BOOL_CONFIG_OPTION(qmlExperimental, QML_EXPERIMENTAL);
-using namespace QmlParser;
+using namespace QDeclarativeParser;
/*!
- Instantiate a new QmlCompiler.
+ Instantiate a new QDeclarativeCompiler.
*/
-QmlCompiler::QmlCompiler()
+QDeclarativeCompiler::QDeclarativeCompiler()
: output(0), engine(0), unitRoot(0), unit(0)
{
}
@@ -98,7 +98,7 @@ QmlCompiler::QmlCompiler()
\sa errors()
*/
-bool QmlCompiler::isError() const
+bool QDeclarativeCompiler::isError() const
{
return !exceptions.isEmpty();
}
@@ -107,7 +107,7 @@ bool QmlCompiler::isError() const
Return the list of errors from the last call to compile(), or an empty list
if there were no errors.
*/
-QList<QmlError> QmlCompiler::errors() const
+QList<QDeclarativeError> QDeclarativeCompiler::errors() const
{
return exceptions;
}
@@ -118,7 +118,7 @@ QList<QmlError> QmlCompiler::errors() const
Legal ids must start with a lower-case letter or underscore, and contain only
letters, numbers and underscores.
*/
-bool QmlCompiler::isValidId(const QString &val)
+bool QDeclarativeCompiler::isValidId(const QString &val)
{
if (val.isEmpty())
return false;
@@ -143,7 +143,7 @@ bool QmlCompiler::isValidId(const QString &val)
Attached property names are those that start with a capital letter.
*/
-bool QmlCompiler::isAttachedPropertyName(const QByteArray &name)
+bool QDeclarativeCompiler::isAttachedPropertyName(const QByteArray &name)
{
return !name.isEmpty() && name.at(0) >= 'A' && name.at(0) <= 'Z';
}
@@ -154,7 +154,7 @@ bool QmlCompiler::isAttachedPropertyName(const QByteArray &name)
Signal property names are those that start with "on", followed by a capital
letter.
*/
-bool QmlCompiler::isSignalPropertyName(const QByteArray &name)
+bool QDeclarativeCompiler::isSignalPropertyName(const QByteArray &name)
{
return name.length() >= 3 && name.startsWith("on") &&
'A' <= name.at(2) && 'Z' >= name.at(2);
@@ -163,7 +163,7 @@ bool QmlCompiler::isSignalPropertyName(const QByteArray &name)
/*!
\macro COMPILE_EXCEPTION
\internal
- Inserts an error into the QmlCompiler error list, and returns false
+ Inserts an error into the QDeclarativeCompiler error list, and returns false
(failure).
\a token is used to source the error line and column, and \a desc is the
@@ -172,13 +172,13 @@ bool QmlCompiler::isSignalPropertyName(const QByteArray &name)
For example:
\code
- COMPILE_EXCEPTION(property, QCoreApplication::translate("QmlCompiler","Error for property \"%1\"").arg(QString::fromUtf8(property->name)));
+ COMPILE_EXCEPTION(property, QCoreApplication::translate("QDeclarativeCompiler","Error for property \"%1\"").arg(QString::fromUtf8(property->name)));
\endcode
*/
#define COMPILE_EXCEPTION(token, desc) \
{ \
QString exceptionDescription; \
- QmlError error; \
+ QDeclarativeError error; \
error.setUrl(output->url); \
error.setLine((token)->location.start.line); \
error.setColumn((token)->location.start.column); \
@@ -204,13 +204,13 @@ bool QmlCompiler::isSignalPropertyName(const QByteArray &name)
This test corresponds to action taken by genLiteralAssignment(). Any change
made here, must have a corresponding action in genLiteralAssigment().
*/
-bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
- QmlParser::Value *v)
+bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *v)
{
QString string = v->value.asScript();
if (!prop.isWritable())
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop.name())));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop.name())));
if (prop.isEnumType()) {
int value;
@@ -219,7 +219,7 @@ bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
} else
value = prop.enumerator().keyToValue(string.toUtf8().constData());
if (value == -1)
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: unknown enumeration"));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: unknown enumeration"));
return true;
}
int type = prop.userType();
@@ -227,110 +227,110 @@ bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
case -1:
break;
case QVariant::String:
- if (!v->value.isString()) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: string expected"));
+ if (!v->value.isString()) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: string expected"));
break;
case QVariant::Url:
- if (!v->value.isString()) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: url expected"));
+ if (!v->value.isString()) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: url expected"));
break;
case QVariant::UInt:
{
bool ok;
string.toUInt(&ok);
- if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: unsigned int expected"));
+ if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: unsigned int expected"));
}
break;
case QVariant::Int:
{
bool ok;
string.toInt(&ok);
- if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: int expected"));
+ if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: int expected"));
}
break;
case QMetaType::Float:
{
bool ok;
string.toFloat(&ok);
- if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: float expected"));
+ if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: float expected"));
}
break;
case QVariant::Double:
{
bool ok;
string.toDouble(&ok);
- if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: double expected"));
+ if (!v->value.isNumber() || !ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: double expected"));
}
break;
case QVariant::Color:
{
bool ok;
- QmlStringConverters::colorFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: color expected"));
+ QDeclarativeStringConverters::colorFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: color expected"));
}
break;
case QVariant::Date:
{
bool ok;
- QmlStringConverters::dateFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: date expected"));
+ QDeclarativeStringConverters::dateFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: date expected"));
}
break;
case QVariant::Time:
{
bool ok;
- QmlStringConverters::timeFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: time expected"));
+ QDeclarativeStringConverters::timeFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: time expected"));
}
break;
case QVariant::DateTime:
{
bool ok;
- QmlStringConverters::dateTimeFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: datetime expected"));
+ QDeclarativeStringConverters::dateTimeFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: datetime expected"));
}
break;
case QVariant::Point:
case QVariant::PointF:
{
bool ok;
- QPointF point = QmlStringConverters::pointFFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: point expected"));
+ QPointF point = QDeclarativeStringConverters::pointFFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: point expected"));
}
break;
case QVariant::Size:
case QVariant::SizeF:
{
bool ok;
- QSizeF size = QmlStringConverters::sizeFFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: size expected"));
+ QSizeF size = QDeclarativeStringConverters::sizeFFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: size expected"));
}
break;
case QVariant::Rect:
case QVariant::RectF:
{
bool ok;
- QRectF rect = QmlStringConverters::rectFFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: rect expected"));
+ QRectF rect = QDeclarativeStringConverters::rectFFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: rect expected"));
}
break;
case QVariant::Bool:
{
- if (!v->value.isBoolean()) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: boolean expected"));
+ if (!v->value.isBoolean()) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: boolean expected"));
}
break;
case QVariant::Vector3D:
{
bool ok;
- QmlStringConverters::vector3DFromString(string, &ok);
- if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: 3D vector expected"));
+ QDeclarativeStringConverters::vector3DFromString(string, &ok);
+ if (!ok) COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: 3D vector expected"));
}
break;
default:
{
int t = prop.userType();
- QmlMetaType::StringConverter converter =
- QmlMetaType::customStringConverter(t);
+ QDeclarativeMetaType::StringConverter converter =
+ QDeclarativeMetaType::customStringConverter(t);
if (!converter)
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: unsupported type \"%1\"").arg(QString::fromLatin1(QVariant::typeToName(prop.type()))));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: unsupported type \"%1\"").arg(QString::fromLatin1(QVariant::typeToName(prop.type()))));
}
break;
}
@@ -343,12 +343,12 @@ bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
Any literal assignment that is approved in testLiteralAssignment() must have
a corresponding action in this method.
*/
-void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
- QmlParser::Value *v)
+void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *v)
{
QString string = v->value.asScript();
- QmlInstruction instr;
+ QDeclarativeInstruction instr;
instr.line = v->location.start.line;
if (prop.isEnumType()) {
int value;
@@ -357,7 +357,7 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
} else
value = prop.enumerator().keyToValue(string.toUtf8().constData());
- instr.type = QmlInstruction::StoreInteger;
+ instr.type = QDeclarativeInstruction::StoreInteger;
instr.storeInteger.propertyIndex = prop.propertyIndex();
instr.storeInteger.value = value;
output->bytecode << instr;
@@ -368,21 +368,21 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
switch(type) {
case -1:
{
- instr.type = QmlInstruction::StoreVariant;
+ instr.type = QDeclarativeInstruction::StoreVariant;
instr.storeString.propertyIndex = prop.propertyIndex();
instr.storeString.value = output->indexForString(string);
}
break;
case QVariant::String:
{
- instr.type = QmlInstruction::StoreString;
+ instr.type = QDeclarativeInstruction::StoreString;
instr.storeString.propertyIndex = prop.propertyIndex();
instr.storeString.value = output->indexForString(string);
}
break;
case QVariant::Url:
{
- instr.type = QmlInstruction::StoreUrl;
+ instr.type = QDeclarativeInstruction::StoreUrl;
QUrl u = string.isEmpty() ? QUrl() : output->url.resolved(QUrl(string));
instr.storeUrl.propertyIndex = prop.propertyIndex();
instr.storeUrl.value = output->indexForUrl(u);
@@ -390,69 +390,69 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
break;
case QVariant::UInt:
{
- instr.type = QmlInstruction::StoreInteger;
+ instr.type = QDeclarativeInstruction::StoreInteger;
instr.storeInteger.propertyIndex = prop.propertyIndex();
instr.storeInteger.value = string.toUInt();
}
break;
case QVariant::Int:
{
- instr.type = QmlInstruction::StoreInteger;
+ instr.type = QDeclarativeInstruction::StoreInteger;
instr.storeInteger.propertyIndex = prop.propertyIndex();
instr.storeInteger.value = string.toInt();
}
break;
case QMetaType::Float:
{
- instr.type = QmlInstruction::StoreFloat;
+ instr.type = QDeclarativeInstruction::StoreFloat;
instr.storeFloat.propertyIndex = prop.propertyIndex();
instr.storeFloat.value = string.toFloat();
}
break;
case QVariant::Double:
{
- instr.type = QmlInstruction::StoreDouble;
+ instr.type = QDeclarativeInstruction::StoreDouble;
instr.storeDouble.propertyIndex = prop.propertyIndex();
instr.storeDouble.value = string.toDouble();
}
break;
case QVariant::Color:
{
- QColor c = QmlStringConverters::colorFromString(string);
- instr.type = QmlInstruction::StoreColor;
+ QColor c = QDeclarativeStringConverters::colorFromString(string);
+ instr.type = QDeclarativeInstruction::StoreColor;
instr.storeColor.propertyIndex = prop.propertyIndex();
instr.storeColor.value = c.rgba();
}
break;
case QVariant::Date:
{
- QDate d = QmlStringConverters::dateFromString(string);
- instr.type = QmlInstruction::StoreDate;
+ QDate d = QDeclarativeStringConverters::dateFromString(string);
+ instr.type = QDeclarativeInstruction::StoreDate;
instr.storeDate.propertyIndex = prop.propertyIndex();
instr.storeDate.value = d.toJulianDay();
}
break;
case QVariant::Time:
{
- QTime time = QmlStringConverters::timeFromString(string);
+ QTime time = QDeclarativeStringConverters::timeFromString(string);
int data[] = { time.hour(), time.minute(),
time.second(), time.msec() };
int index = output->indexForInt(data, 4);
- instr.type = QmlInstruction::StoreTime;
+ instr.type = QDeclarativeInstruction::StoreTime;
instr.storeTime.propertyIndex = prop.propertyIndex();
instr.storeTime.valueIndex = index;
}
break;
case QVariant::DateTime:
{
- QDateTime dateTime = QmlStringConverters::dateTimeFromString(string);
+ QDateTime dateTime = QDeclarativeStringConverters::dateTimeFromString(string);
int data[] = { dateTime.date().toJulianDay(),
dateTime.time().hour(),
dateTime.time().minute(),
dateTime.time().second(),
dateTime.time().msec() };
int index = output->indexForInt(data, 5);
- instr.type = QmlInstruction::StoreDateTime;
+ instr.type = QDeclarativeInstruction::StoreDateTime;
instr.storeDateTime.propertyIndex = prop.propertyIndex();
instr.storeDateTime.valueIndex = index;
}
@@ -462,13 +462,13 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
{
bool ok;
QPointF point =
- QmlStringConverters::pointFFromString(string, &ok);
+ QDeclarativeStringConverters::pointFFromString(string, &ok);
float data[] = { point.x(), point.y() };
int index = output->indexForFloat(data, 2);
if (type == QVariant::PointF)
- instr.type = QmlInstruction::StorePointF;
+ instr.type = QDeclarativeInstruction::StorePointF;
else
- instr.type = QmlInstruction::StorePoint;
+ instr.type = QDeclarativeInstruction::StorePoint;
instr.storeRealPair.propertyIndex = prop.propertyIndex();
instr.storeRealPair.valueIndex = index;
}
@@ -477,13 +477,13 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
case QVariant::SizeF:
{
bool ok;
- QSizeF size = QmlStringConverters::sizeFFromString(string, &ok);
+ QSizeF size = QDeclarativeStringConverters::sizeFFromString(string, &ok);
float data[] = { size.width(), size.height() };
int index = output->indexForFloat(data, 2);
if (type == QVariant::SizeF)
- instr.type = QmlInstruction::StoreSizeF;
+ instr.type = QDeclarativeInstruction::StoreSizeF;
else
- instr.type = QmlInstruction::StoreSize;
+ instr.type = QDeclarativeInstruction::StoreSize;
instr.storeRealPair.propertyIndex = prop.propertyIndex();
instr.storeRealPair.valueIndex = index;
}
@@ -492,14 +492,14 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
case QVariant::RectF:
{
bool ok;
- QRectF rect = QmlStringConverters::rectFFromString(string, &ok);
+ QRectF rect = QDeclarativeStringConverters::rectFFromString(string, &ok);
float data[] = { rect.x(), rect.y(),
rect.width(), rect.height() };
int index = output->indexForFloat(data, 4);
if (type == QVariant::RectF)
- instr.type = QmlInstruction::StoreRectF;
+ instr.type = QDeclarativeInstruction::StoreRectF;
else
- instr.type = QmlInstruction::StoreRect;
+ instr.type = QDeclarativeInstruction::StoreRect;
instr.storeRect.propertyIndex = prop.propertyIndex();
instr.storeRect.valueIndex = index;
}
@@ -507,7 +507,7 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
case QVariant::Bool:
{
bool b = v->value.asBoolean();
- instr.type = QmlInstruction::StoreBool;
+ instr.type = QDeclarativeInstruction::StoreBool;
instr.storeBool.propertyIndex = prop.propertyIndex();
instr.storeBool.value = b;
}
@@ -516,10 +516,10 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
{
bool ok;
QVector3D vector =
- QmlStringConverters::vector3DFromString(string, &ok);
+ QDeclarativeStringConverters::vector3DFromString(string, &ok);
float data[] = { vector.x(), vector.y(), vector.z() };
int index = output->indexForFloat(data, 3);
- instr.type = QmlInstruction::StoreVector3D;
+ instr.type = QDeclarativeInstruction::StoreVector3D;
instr.storeRealPair.propertyIndex = prop.propertyIndex();
instr.storeRealPair.valueIndex = index;
}
@@ -528,11 +528,11 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
{
int t = prop.userType();
int index = output->customTypeData.count();
- instr.type = QmlInstruction::AssignCustomType;
+ instr.type = QDeclarativeInstruction::AssignCustomType;
instr.assignCustomType.propertyIndex = prop.propertyIndex();
instr.assignCustomType.valueIndex = index;
- QmlCompiledData::CustomTypeData data;
+ QDeclarativeCompiledData::CustomTypeData data;
data.index = output->indexForString(string);
data.type = t;
output->customTypeData << data;
@@ -543,9 +543,9 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
}
/*!
- Resets data by clearing the lists that the QmlCompiler modifies.
+ Resets data by clearing the lists that the QDeclarativeCompiler modifies.
*/
-void QmlCompiler::reset(QmlCompiledData *data)
+void QDeclarativeCompiler::reset(QDeclarativeCompiledData *data)
{
data->types.clear();
data->primitives.clear();
@@ -557,8 +557,8 @@ void QmlCompiler::reset(QmlCompiledData *data)
}
/*!
- Compile \a unit, and store the output in \a out. \a engine is the QmlEngine
- with which the QmlCompiledData will be associated.
+ Compile \a unit, and store the output in \a out. \a engine is the QDeclarativeEngine
+ with which the QDeclarativeCompiledData will be associated.
Returns true on success, false on failure. On failure, the compile errors
are available from errors().
@@ -567,12 +567,12 @@ void QmlCompiler::reset(QmlCompiledData *data)
(eg. QML_COMPILER_DUMP=1) the compiled instructions will be dumped to stderr
on a successful compiler.
*/
-bool QmlCompiler::compile(QmlEngine *engine,
- QmlCompositeTypeData *unit,
- QmlCompiledData *out)
+bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
+ QDeclarativeCompositeTypeData *unit,
+ QDeclarativeCompiledData *out)
{
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QmlPerfTimer<QmlPerf::Compilation> pc;
+ QDeclarativePerfTimer<QDeclarativePerf::Compilation> pc;
#endif
exceptions.clear();
@@ -583,21 +583,21 @@ bool QmlCompiler::compile(QmlEngine *engine,
// Compile types
for (int ii = 0; ii < unit->types.count(); ++ii) {
- QmlCompositeTypeData::TypeReference &tref = unit->types[ii];
- QmlCompiledData::TypeReference ref;
- QmlScriptParser::TypeReference *parserRef = unit->data.referencedTypes().at(ii);
+ QDeclarativeCompositeTypeData::TypeReference &tref = unit->types[ii];
+ QDeclarativeCompiledData::TypeReference ref;
+ QDeclarativeScriptParser::TypeReference *parserRef = unit->data.referencedTypes().at(ii);
if (tref.type)
ref.type = tref.type;
else if (tref.unit) {
ref.component = tref.unit->toComponent(engine);
if (ref.component->isError()) {
- QmlError error;
+ QDeclarativeError error;
error.setUrl(output->url);
error.setDescription(QLatin1String("Unable to create type ") +
parserRef->name);
if (!parserRef->refObjects.isEmpty()) {
- QmlParser::Object *parserObject = parserRef->refObjects.first();
+ QDeclarativeParser::Object *parserObject = parserRef->refObjects.first();
error.setLine(parserObject->location.start.line);
error.setColumn(parserObject->location.start.column);
}
@@ -641,15 +641,15 @@ bool QmlCompiler::compile(QmlEngine *engine,
return !isError();
}
-void QmlCompiler::compileTree(Object *tree)
+void QDeclarativeCompiler::compileTree(Object *tree)
{
compileState.root = tree;
if (!buildObject(tree, BindingContext()) || !completeComponentBuild())
return;
- QmlInstruction init;
- init.type = QmlInstruction::Init;
+ QDeclarativeInstruction init;
+ init.type = QDeclarativeInstruction::Init;
init.line = 0;
init.init.bindingsSize = compileState.bindings.count();
init.init.parserStatusSize = compileState.parserStatusCount;
@@ -662,9 +662,9 @@ void QmlCompiler::compileTree(Object *tree)
genObject(tree);
- QmlInstruction def;
+ QDeclarativeInstruction def;
init.line = 0;
- def.type = QmlInstruction::SetDefault;
+ def.type = QDeclarativeInstruction::SetDefault;
output->bytecode << def;
output->imports = unit->imports;
@@ -679,7 +679,7 @@ void QmlCompiler::compileTree(Object *tree)
output->root = &output->rootData;
}
if (!tree->metadata.isEmpty())
- QmlEnginePrivate::get(engine)->registerCompositeType(output);
+ QDeclarativeEnginePrivate::get(engine)->registerCompositeType(output);
}
static bool ValuePtrLessThan(const Value *t1, const Value *t2)
@@ -689,12 +689,12 @@ static bool ValuePtrLessThan(const Value *t1, const Value *t2)
t1->location.start.column < t2->location.start.column);
}
-bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
+bool QDeclarativeCompiler::buildObject(Object *obj, const BindingContext &ctxt)
{
componentStat.objects++;
Q_ASSERT (obj->type != -1);
- const QmlCompiledData::TypeReference &tr =
+ const QDeclarativeCompiledData::TypeReference &tr =
output->types.at(obj->type);
obj->metatype = tr.metaObject();
@@ -705,7 +705,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
obj->className = tr.className;
// This object is a "Component" element
- if (tr.type && obj->metatype == &QmlComponent::staticMetaObject) {
+ if (tr.type && obj->metatype == &QDeclarativeComponent::staticMetaObject) {
COMPILE_CHECK(buildComponent(obj, ctxt));
return true;
}
@@ -721,8 +721,8 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
COMPILE_CHECK(mergeDynamicMetaProperties(obj));
COMPILE_CHECK(buildDynamicMeta(obj, IgnoreAliases));
- // Find the native type and check for the QmlParserStatus interface
- QmlType *type = toQmlType(obj);
+ // Find the native type and check for the QDeclarativeParserStatus interface
+ QDeclarativeType *type = toQmlType(obj);
Q_ASSERT(type);
obj->parserStatusCast = type->parserStatusCast();
if (obj->parserStatusCast != -1)
@@ -733,7 +733,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
// compiled by the type.
bool isCustomParser = output->types.at(obj->type).type &&
output->types.at(obj->type).type->customParser() != 0;
- QList<QmlCustomParserProperty> customProps;
+ QList<QDeclarativeCustomParserProperty> customProps;
// Fetch the list of deferred properties
QStringList deferredList = deferredProperties(obj);
@@ -754,7 +754,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
if (obj->defaultProperty) {
const QMetaObject *metaObject = obj->metaObject();
Q_ASSERT(metaObject);
- QMetaProperty p = QmlMetaType::defaultProperty(metaObject);
+ QMetaProperty p = QDeclarativeMetaType::defaultProperty(metaObject);
if (p.name()) {
Property *explicitProperty = obj->getProperty(p.name(), false);
if (explicitProperty && !explicitProperty->value) {
@@ -798,7 +798,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
canDefer = ids == compileState.ids.count();
} else {
- customProps << QmlCustomParserNodePrivate::fromProperty(prop);
+ customProps << QDeclarativeCustomParserNodePrivate::fromProperty(prop);
}
} else {
if (isSignalPropertyName(prop->name)) {
@@ -827,7 +827,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
COMPILE_CHECK(buildProperty(prop, obj, objCtxt));
canDefer = ids == compileState.ids.count();
} else {
- customProps << QmlCustomParserNodePrivate::fromProperty(prop);
+ customProps << QDeclarativeCustomParserNodePrivate::fromProperty(prop);
}
} else {
int ids = compileState.ids.count();
@@ -845,10 +845,10 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
// Compile custom parser parts
if (isCustomParser && !customProps.isEmpty()) {
- QmlCustomParser *cp = output->types.at(obj->type).type->customParser();
+ QDeclarativeCustomParser *cp = output->types.at(obj->type).type->customParser();
cp->clearErrors();
obj->custom = cp->compile(customProps);
- foreach (QmlError err, cp->errors()) {
+ foreach (QDeclarativeError err, cp->errors()) {
err.setUrl(output->url);
exceptions << err;
}
@@ -857,18 +857,18 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
return true;
}
-void QmlCompiler::genObject(QmlParser::Object *obj)
+void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj)
{
- const QmlCompiledData::TypeReference &tr =
+ const QDeclarativeCompiledData::TypeReference &tr =
output->types.at(obj->type);
- if (tr.type && obj->metatype == &QmlComponent::staticMetaObject) {
+ if (tr.type && obj->metatype == &QDeclarativeComponent::staticMetaObject) {
genComponent(obj);
return;
}
// Create the object
- QmlInstruction create;
- create.type = QmlInstruction::CreateObject;
+ QDeclarativeInstruction create;
+ create.type = QDeclarativeInstruction::CreateObject;
create.line = obj->location.start.line;
create.create.column = obj->location.start.column;
create.create.data = -1;
@@ -887,21 +887,21 @@ void QmlCompiler::genObject(QmlParser::Object *obj)
// Setup the synthesized meta object if necessary
if (!obj->metadata.isEmpty()) {
- QmlInstruction meta;
- meta.type = QmlInstruction::StoreMetaObject;
+ QDeclarativeInstruction meta;
+ meta.type = QDeclarativeInstruction::StoreMetaObject;
meta.line = 0;
meta.storeMeta.data = output->indexForByteArray(obj->metadata);
meta.storeMeta.aliasData = output->indexForByteArray(obj->synthdata);
meta.storeMeta.propertyCache = output->propertyCaches.count();
// ### Surely the creation of this property cache could be more efficient
- QmlPropertyCache *propertyCache = 0;
- if (tr.component && QmlComponentPrivate::get(tr.component)->cc->rootPropertyCache) {
- propertyCache = QmlComponentPrivate::get(tr.component)->cc->rootPropertyCache->copy();
+ QDeclarativePropertyCache *propertyCache = 0;
+ if (tr.component && QDeclarativeComponentPrivate::get(tr.component)->cc->rootPropertyCache) {
+ propertyCache = QDeclarativeComponentPrivate::get(tr.component)->cc->rootPropertyCache->copy();
} else {
- propertyCache = QmlPropertyCache::create(engine, obj->metaObject()->superClass());
+ propertyCache = QDeclarativePropertyCache::create(engine, obj->metaObject()->superClass());
}
- propertyCache->append(engine, obj->metaObject(), QmlPropertyCache::Data::NoFlags,
- QmlPropertyCache::Data::IsVMEFunction);
+ propertyCache->append(engine, obj->metaObject(), QDeclarativePropertyCache::Data::NoFlags,
+ QDeclarativePropertyCache::Data::IsVMEFunction);
if (obj == unitRoot) {
propertyCache->addref();
output->rootPropertyCache = propertyCache;
@@ -912,8 +912,8 @@ void QmlCompiler::genObject(QmlParser::Object *obj)
// Set the object id
if (!obj->id.isEmpty()) {
- QmlInstruction id;
- id.type = QmlInstruction::SetId;
+ QDeclarativeInstruction id;
+ id.type = QDeclarativeInstruction::SetId;
id.line = 0;
id.setId.value = output->indexForString(obj->id);
id.setId.index = obj->idIndex;
@@ -922,8 +922,8 @@ void QmlCompiler::genObject(QmlParser::Object *obj)
// Set any script blocks
for (int ii = 0; ii < obj->scripts.count(); ++ii) {
- QmlInstruction script;
- script.type = QmlInstruction::StoreScript;
+ QDeclarativeInstruction script;
+ script.type = QDeclarativeInstruction::StoreScript;
script.line = 0; // ###
int idx = output->scripts.count();
output->scripts << obj->scripts.at(ii);
@@ -933,8 +933,8 @@ void QmlCompiler::genObject(QmlParser::Object *obj)
// Begin the class
if (obj->parserStatusCast != -1) {
- QmlInstruction begin;
- begin.type = QmlInstruction::BeginObject;
+ QDeclarativeInstruction begin;
+ begin.type = QDeclarativeInstruction::BeginObject;
begin.begin.castValue = obj->parserStatusCast;
begin.line = obj->location.start.line;
output->bytecode << begin;
@@ -943,12 +943,12 @@ void QmlCompiler::genObject(QmlParser::Object *obj)
genObjectBody(obj);
}
-void QmlCompiler::genObjectBody(QmlParser::Object *obj)
+void QDeclarativeCompiler::genObjectBody(QDeclarativeParser::Object *obj)
{
typedef QPair<Property *, int> PropPair;
foreach(const PropPair &prop, obj->scriptStringProperties) {
- QmlInstruction ss;
- ss.type = QmlInstruction::StoreScriptString;
+ QDeclarativeInstruction ss;
+ ss.type = QDeclarativeInstruction::StoreScriptString;
ss.storeScriptString.propertyIndex = prop.first->index;
ss.storeScriptString.value =
output->indexForString(prop.first->values.at(0)->value.asScript());
@@ -965,15 +965,15 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
genValueProperty(prop, obj);
}
if (seenDefer) {
- QmlInstruction defer;
- defer.type = QmlInstruction::Defer;
+ QDeclarativeInstruction defer;
+ defer.type = QDeclarativeInstruction::Defer;
defer.line = 0;
defer.defer.deferCount = 0;
int deferIdx = output->bytecode.count();
output->bytecode << defer;
- QmlInstruction init;
- init.type = QmlInstruction::Init;
+ QDeclarativeInstruction init;
+ init.type = QDeclarativeInstruction::Init;
init.init.bindingsSize = compileState.bindings.count(); // XXX - bigger than necessary
init.init.parserStatusSize = compileState.parserStatusCount; // XXX - bigger than necessary
init.init.contextCache = -1;
@@ -992,14 +992,14 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
foreach(Property *prop, obj->signalProperties) {
- QmlParser::Value *v = prop->values.at(0);
+ QDeclarativeParser::Value *v = prop->values.at(0);
if (v->type == Value::SignalObject) {
genObject(v->object);
- QmlInstruction assign;
- assign.type = QmlInstruction::AssignSignalObject;
+ QDeclarativeInstruction assign;
+ assign.type = QDeclarativeInstruction::AssignSignalObject;
assign.line = v->location.start.line;
assign.assignSignalObject.signal =
output->indexForByteArray(prop->name);
@@ -1007,8 +1007,8 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
} else if (v->type == Value::SignalExpression) {
- QmlInstruction store;
- store.type = QmlInstruction::StoreSignal;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreSignal;
store.line = v->location.start.line;
store.storeSignal.signalIndex = prop->index;
store.storeSignal.value =
@@ -1020,38 +1020,38 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
}
foreach(Property *prop, obj->attachedProperties) {
- QmlInstruction fetch;
- fetch.type = QmlInstruction::FetchAttached;
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchAttached;
fetch.line = prop->location.start.line;
fetch.fetchAttached.id = prop->index;
output->bytecode << fetch;
genObjectBody(prop->value);
- QmlInstruction pop;
- pop.type = QmlInstruction::PopFetchedObject;
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopFetchedObject;
pop.line = prop->location.start.line;
output->bytecode << pop;
}
foreach(Property *prop, obj->groupedProperties) {
- QmlInstruction fetch;
- fetch.type = QmlInstruction::FetchObject;
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchObject;
fetch.fetch.property = prop->index;
fetch.line = prop->location.start.line;
output->bytecode << fetch;
genObjectBody(prop->value);
- QmlInstruction pop;
- pop.type = QmlInstruction::PopFetchedObject;
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopFetchedObject;
pop.line = prop->location.start.line;
output->bytecode << pop;
}
foreach(Property *prop, obj->valueTypeProperties) {
- QmlInstruction fetch;
- fetch.type = QmlInstruction::FetchValueType;
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchValueType;
fetch.fetchValue.property = prop->index;
fetch.fetchValue.type = prop->type;
fetch.line = prop->location.start.line;
@@ -1062,8 +1062,8 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
genPropertyAssignment(vprop, prop->value, prop);
}
- QmlInstruction pop;
- pop.type = QmlInstruction::PopValueType;
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopValueType;
pop.fetchValue.property = prop->index;
pop.fetchValue.type = prop->type;
pop.line = prop->location.start.line;
@@ -1071,13 +1071,13 @@ void QmlCompiler::genObjectBody(QmlParser::Object *obj)
}
}
-void QmlCompiler::genComponent(QmlParser::Object *obj)
+void QDeclarativeCompiler::genComponent(QDeclarativeParser::Object *obj)
{
- QmlParser::Object *root = obj->defaultProperty->values.at(0)->object;
+ QDeclarativeParser::Object *root = obj->defaultProperty->values.at(0)->object;
Q_ASSERT(root);
- QmlInstruction create;
- create.type = QmlInstruction::CreateComponent;
+ QDeclarativeInstruction create;
+ create.type = QDeclarativeInstruction::CreateComponent;
create.line = root->location.start.line;
create.createComponent.column = root->location.start.column;
create.createComponent.endLine = root->location.end.line;
@@ -1087,8 +1087,8 @@ void QmlCompiler::genComponent(QmlParser::Object *obj)
ComponentCompileState oldCompileState = compileState;
compileState = componentState(root);
- QmlInstruction init;
- init.type = QmlInstruction::Init;
+ QDeclarativeInstruction init;
+ init.type = QDeclarativeInstruction::Init;
init.init.bindingsSize = compileState.bindings.count();
init.init.parserStatusSize = compileState.parserStatusCount;
init.init.contextCache = genContextCache();
@@ -1101,9 +1101,9 @@ void QmlCompiler::genComponent(QmlParser::Object *obj)
genObject(root);
- QmlInstruction def;
+ QDeclarativeInstruction def;
init.line = 0;
- def.type = QmlInstruction::SetDefault;
+ def.type = QDeclarativeInstruction::SetDefault;
output->bytecode << def;
output->bytecode[count - 1].createComponent.count =
@@ -1112,8 +1112,8 @@ void QmlCompiler::genComponent(QmlParser::Object *obj)
compileState = oldCompileState;
if (!obj->id.isEmpty()) {
- QmlInstruction id;
- id.type = QmlInstruction::SetId;
+ QDeclarativeInstruction id;
+ id.type = QDeclarativeInstruction::SetId;
id.line = 0;
id.setId.value = output->indexForString(obj->id);
id.setId.index = obj->idIndex;
@@ -1121,7 +1121,7 @@ void QmlCompiler::genComponent(QmlParser::Object *obj)
}
}
-bool QmlCompiler::buildComponent(QmlParser::Object *obj,
+bool QDeclarativeCompiler::buildComponent(QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
// The special "Component" element can only have the id property and a
@@ -1131,22 +1131,22 @@ bool QmlCompiler::buildComponent(QmlParser::Object *obj,
Property *idProp = 0;
if (obj->properties.count() > 1 ||
(obj->properties.count() == 1 && obj->properties.begin().key() != "id"))
- COMPILE_EXCEPTION(*obj->properties.begin(), QCoreApplication::translate("QmlCompiler","Component elements may not contain properties other than id"));
+ COMPILE_EXCEPTION(*obj->properties.begin(), QCoreApplication::translate("QDeclarativeCompiler","Component elements may not contain properties other than id"));
if (!obj->scriptBlockObjects.isEmpty())
- COMPILE_EXCEPTION(obj->scriptBlockObjects.first(), QCoreApplication::translate("QmlCompiler","Component elements may not contain script blocks"));
+ COMPILE_EXCEPTION(obj->scriptBlockObjects.first(), QCoreApplication::translate("QDeclarativeCompiler","Component elements may not contain script blocks"));
if (obj->properties.count())
idProp = *obj->properties.begin();
if (idProp && (idProp->value || idProp->values.count() > 1 || !isValidId(idProp->values.first()->primitive())))
- COMPILE_EXCEPTION(idProp, QCoreApplication::translate("QmlCompiler","Invalid component id specification"));
+ COMPILE_EXCEPTION(idProp, QCoreApplication::translate("QDeclarativeCompiler","Invalid component id specification"));
if (idProp) {
QString idVal = idProp->values.first()->primitive();
if (compileState.ids.contains(idVal))
- COMPILE_EXCEPTION(idProp, QCoreApplication::translate("QmlCompiler","id is not unique"));
+ COMPILE_EXCEPTION(idProp, QCoreApplication::translate("QDeclarativeCompiler","id is not unique"));
obj->id = idVal;
addId(idVal, obj);
@@ -1156,14 +1156,14 @@ bool QmlCompiler::buildComponent(QmlParser::Object *obj,
if (obj->defaultProperty &&
(obj->defaultProperty->value || obj->defaultProperty->values.count() > 1 ||
(obj->defaultProperty->values.count() == 1 && !obj->defaultProperty->values.first()->object)))
- COMPILE_EXCEPTION(obj, QCoreApplication::translate("QmlCompiler","Invalid component body specification"));
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Invalid component body specification"));
Object *root = 0;
if (obj->defaultProperty && obj->defaultProperty->values.count())
root = obj->defaultProperty->values.first()->object;
if (!root)
- COMPILE_EXCEPTION(obj, QCoreApplication::translate("QmlCompiler","Cannot create empty component specification"));
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Cannot create empty component specification"));
// Build the component tree
COMPILE_CHECK(buildComponentFromRoot(root, ctxt));
@@ -1171,7 +1171,7 @@ bool QmlCompiler::buildComponent(QmlParser::Object *obj,
return true;
}
-bool QmlCompiler::buildScript(QmlParser::Object *obj, QmlParser::Object *script)
+bool QDeclarativeCompiler::buildScript(QDeclarativeParser::Object *obj, QDeclarativeParser::Object *script)
{
Object::ScriptBlock scriptBlock;
@@ -1180,11 +1180,11 @@ bool QmlCompiler::buildScript(QmlParser::Object *obj, QmlParser::Object *script)
Property *source = *script->properties.begin();
if (script->defaultProperty)
- COMPILE_EXCEPTION(source, QCoreApplication::translate("QmlCompiler","Invalid Script block. Specify either the source property or inline script"));
+ COMPILE_EXCEPTION(source, QCoreApplication::translate("QDeclarativeCompiler","Invalid Script block. Specify either the source property or inline script"));
if (source->value || source->values.count() != 1 ||
source->values.at(0)->object || !source->values.at(0)->value.isStringList())
- COMPILE_EXCEPTION(source, QCoreApplication::translate("QmlCompiler","Invalid Script source value"));
+ COMPILE_EXCEPTION(source, QCoreApplication::translate("QDeclarativeCompiler","Invalid Script source value"));
QStringList sources = source->values.at(0)->value.asStringList();
@@ -1208,21 +1208,21 @@ bool QmlCompiler::buildScript(QmlParser::Object *obj, QmlParser::Object *script)
}
} else if (!script->properties.isEmpty()) {
- COMPILE_EXCEPTION(*script->properties.begin(), QCoreApplication::translate("QmlCompiler","Properties cannot be set on Script block"));
+ COMPILE_EXCEPTION(*script->properties.begin(), QCoreApplication::translate("QDeclarativeCompiler","Properties cannot be set on Script block"));
} else if (script->defaultProperty) {
QString scriptCode;
int lineNumber = 1;
QString sourceUrl = output->url.toString();
- QmlParser::Location currentLocation;
+ QDeclarativeParser::Location currentLocation;
for (int ii = 0; ii < script->defaultProperty->values.count(); ++ii) {
Value *v = script->defaultProperty->values.at(ii);
if (lineNumber == 1)
lineNumber = v->location.start.line;
if (v->object || !v->value.isString())
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid Script block"));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid Script block"));
if (ii == 0) {
currentLocation = v->location.start;
@@ -1255,7 +1255,7 @@ bool QmlCompiler::buildScript(QmlParser::Object *obj, QmlParser::Object *script)
return true;
}
-bool QmlCompiler::buildComponentFromRoot(QmlParser::Object *obj,
+bool QDeclarativeCompiler::buildComponentFromRoot(QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
ComponentCompileState oldComponentCompileState = compileState;
@@ -1282,7 +1282,7 @@ bool QmlCompiler::buildComponentFromRoot(QmlParser::Object *obj,
// Build a sub-object. A sub-object is one that was not created directly by
// QML - such as a grouped property object, or an attached object. Sub-object's
// can't have an id, involve a custom parser, have attached properties etc.
-bool QmlCompiler::buildSubObject(Object *obj, const BindingContext &ctxt)
+bool QDeclarativeCompiler::buildSubObject(Object *obj, const BindingContext &ctxt)
{
Q_ASSERT(obj->metatype);
Q_ASSERT(!obj->defaultProperty);
@@ -1300,21 +1300,21 @@ bool QmlCompiler::buildSubObject(Object *obj, const BindingContext &ctxt)
return true;
}
-int QmlCompiler::componentTypeRef()
+int QDeclarativeCompiler::componentTypeRef()
{
- QmlType *t = QmlMetaType::qmlType("Qt/Component",4,6);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/Component",4,6);
for (int ii = output->types.count() - 1; ii >= 0; --ii) {
if (output->types.at(ii).type == t)
return ii;
}
- QmlCompiledData::TypeReference ref;
+ QDeclarativeCompiledData::TypeReference ref;
ref.className = "Component";
ref.type = t;
output->types << ref;
return output->types.count() - 1;
}
-int QmlCompiler::findSignalByName(const QMetaObject *mo, const QByteArray &name)
+int QDeclarativeCompiler::findSignalByName(const QMetaObject *mo, const QByteArray &name)
{
int methods = mo->methodCount();
for (int ii = methods - 1; ii >= 0; --ii) {
@@ -1329,7 +1329,7 @@ int QmlCompiler::findSignalByName(const QMetaObject *mo, const QByteArray &name)
return -1;
}
-bool QmlCompiler::buildSignal(QmlParser::Property *prop, QmlParser::Object *obj,
+bool QDeclarativeCompiler::buildSignal(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
Q_ASSERT(obj->metaObject());
@@ -1352,7 +1352,7 @@ bool QmlCompiler::buildSignal(QmlParser::Property *prop, QmlParser::Object *obj,
} else {
if (prop->value || prop->values.count() > 1)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Incorrectly specified signal"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Incorrectly specified signal"));
prop->index = sigIdx;
obj->addSignalProperty(prop);
@@ -1365,7 +1365,7 @@ bool QmlCompiler::buildSignal(QmlParser::Property *prop, QmlParser::Object *obj,
QString script = prop->values.at(0)->value.asScript().trimmed();
if (script.isEmpty())
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Empty signal assignment"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Empty signal assignment"));
}
}
@@ -1376,8 +1376,8 @@ bool QmlCompiler::buildSignal(QmlParser::Property *prop, QmlParser::Object *obj,
/*!
Returns true if (value) property \a prop exists on obj, false otherwise.
*/
-bool QmlCompiler::doesPropertyExist(QmlParser::Property *prop,
- QmlParser::Object *obj)
+bool QDeclarativeCompiler::doesPropertyExist(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
{
if(isAttachedPropertyName(prop->name) || prop->name == "id")
return true;
@@ -1385,7 +1385,7 @@ bool QmlCompiler::doesPropertyExist(QmlParser::Property *prop,
const QMetaObject *mo = obj->metaObject();
if (mo) {
if (prop->isDefault) {
- QMetaProperty p = QmlMetaType::defaultProperty(mo);
+ QMetaProperty p = QDeclarativeMetaType::defaultProperty(mo);
return p.name() != 0;
} else {
int idx = mo->indexOfProperty(prop->name.constData());
@@ -1396,12 +1396,12 @@ bool QmlCompiler::doesPropertyExist(QmlParser::Property *prop,
return false;
}
-bool QmlCompiler::buildProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
+bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
if (prop->isEmpty())
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Empty property assignment"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Empty property assignment"));
const QMetaObject *metaObject = obj->metaObject();
Q_ASSERT(metaObject);
@@ -1413,12 +1413,12 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
// Attached properties cannot be used on sub-objects. Sub-objects
// always exist in a binding sub-context, which is what we test
// for here.
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Attached properties cannot be used here"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Attached properties cannot be used here"));
}
- QmlType *type = 0;
- QmlEnginePrivate::ImportedNamespace *typeNamespace = 0;
- QmlEnginePrivate::get(engine)->resolveType(unit->imports, prop->name,
+ QDeclarativeType *type = 0;
+ QDeclarativeEnginePrivate::ImportedNamespace *typeNamespace = 0;
+ QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, prop->name,
&type, 0, 0, 0, &typeNamespace);
if (typeNamespace) {
@@ -1428,11 +1428,11 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
ctxt));
return true;
} else if (!type || !type->attachedPropertiesType()) {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existent attached object"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Non-existent attached object"));
}
if (!prop->value)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid attached object assignment"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Invalid attached object assignment"));
Q_ASSERT(type->attachedPropertiesFunction());
prop->index = type->index();
@@ -1442,7 +1442,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
QMetaProperty p;
if (prop->isDefault) {
- p = QmlMetaType::defaultProperty(metaObject);
+ p = QDeclarativeMetaType::defaultProperty(metaObject);
if (p.name()) {
prop->index = p.propertyIndex();
@@ -1485,20 +1485,20 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
} else if (prop->index == -1) {
if (prop->isDefault) {
- COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent default property"));
+ COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QDeclarativeCompiler","Cannot assign to non-existent default property"));
} else {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
}
} else if (prop->value) {
COMPILE_CHECK(buildGroupedProperty(prop, obj, ctxt));
- } else if (QmlEnginePrivate::get(engine)->isList(prop->type)) {
+ } else if (QDeclarativeEnginePrivate::get(engine)->isList(prop->type)) {
COMPILE_CHECK(buildListProperty(prop, obj, ctxt));
- } else if (prop->type == qMetaTypeId<QmlScriptString>()) {
+ } else if (prop->type == qMetaTypeId<QDeclarativeScriptString>()) {
COMPILE_CHECK(buildScriptStringProperty(prop, obj, ctxt));
@@ -1512,30 +1512,30 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
}
bool
-QmlCompiler::buildPropertyInNamespace(QmlEnginePrivate::ImportedNamespace *ns,
- QmlParser::Property *nsProp,
- QmlParser::Object *obj,
+QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeEnginePrivate::ImportedNamespace *ns,
+ QDeclarativeParser::Property *nsProp,
+ QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
if (!nsProp->value)
- COMPILE_EXCEPTION(nsProp, QCoreApplication::translate("QmlCompiler","Invalid use of namespace"));
+ COMPILE_EXCEPTION(nsProp, QCoreApplication::translate("QDeclarativeCompiler","Invalid use of namespace"));
foreach (Property *prop, nsProp->value->properties) {
if (!isAttachedPropertyName(prop->name))
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Not an attached property name"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Not an attached property name"));
// Setup attached property data
- QmlType *type = 0;
- QmlEnginePrivate::get(engine)->resolveTypeInNamespace(ns, prop->name,
+ QDeclarativeType *type = 0;
+ QDeclarativeEnginePrivate::get(engine)->resolveTypeInNamespace(ns, prop->name,
&type, 0, 0, 0);
if (!type || !type->attachedPropertiesType())
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existent attached object"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Non-existent attached object"));
if (!prop->value)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid attached object assignment"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Invalid attached object assignment"));
Q_ASSERT(type->attachedPropertiesFunction());
prop->index = type->index();
@@ -1547,26 +1547,26 @@ QmlCompiler::buildPropertyInNamespace(QmlEnginePrivate::ImportedNamespace *ns,
return true;
}
-void QmlCompiler::genValueProperty(QmlParser::Property *prop,
- QmlParser::Object *obj)
+void QDeclarativeCompiler::genValueProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
{
- if (QmlEnginePrivate::get(engine)->isList(prop->type)) {
+ if (QDeclarativeEnginePrivate::get(engine)->isList(prop->type)) {
genListProperty(prop, obj);
} else {
genPropertyAssignment(prop, obj);
}
}
-void QmlCompiler::genListProperty(QmlParser::Property *prop,
- QmlParser::Object *obj)
+void QDeclarativeCompiler::genListProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
{
- int listType = QmlEnginePrivate::get(engine)->listType(prop->type);
+ int listType = QDeclarativeEnginePrivate::get(engine)->listType(prop->type);
- QmlInstruction fetch;
- fetch.type = QmlInstruction::FetchQList;
+ QDeclarativeInstruction fetch;
+ fetch.type = QDeclarativeInstruction::FetchQList;
fetch.line = prop->location.start.line;
fetch.fetchQmlList.property = prop->index;
- bool listTypeIsInterface = QmlMetaType::isInterface(listType);
+ bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType);
fetch.fetchQmlList.type = listType;
output->bytecode << fetch;
@@ -1577,13 +1577,13 @@ void QmlCompiler::genListProperty(QmlParser::Property *prop,
genObject(v->object);
if (listTypeIsInterface) {
- QmlInstruction assign;
- assign.type = QmlInstruction::AssignObjectList;
+ QDeclarativeInstruction assign;
+ assign.type = QDeclarativeInstruction::AssignObjectList;
assign.line = prop->location.start.line;
output->bytecode << assign;
} else {
- QmlInstruction store;
- store.type = QmlInstruction::StoreObjectQList;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreObjectQList;
store.line = prop->location.start.line;
output->bytecode << store;
}
@@ -1596,43 +1596,43 @@ void QmlCompiler::genListProperty(QmlParser::Property *prop,
}
- QmlInstruction pop;
- pop.type = QmlInstruction::PopQList;
+ QDeclarativeInstruction pop;
+ pop.type = QDeclarativeInstruction::PopQList;
pop.line = prop->location.start.line;
output->bytecode << pop;
}
-void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Property *valueTypeProperty)
+void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty)
{
for (int ii = 0; ii < prop->values.count(); ++ii) {
- QmlParser::Value *v = prop->values.at(ii);
+ QDeclarativeParser::Value *v = prop->values.at(ii);
if (v->type == Value::CreatedObject) {
genObject(v->object);
- if (QmlMetaType::isInterface(prop->type)) {
+ if (QDeclarativeMetaType::isInterface(prop->type)) {
- QmlInstruction store;
- store.type = QmlInstruction::StoreInterface;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreInterface;
store.line = v->object->location.start.line;
store.storeObject.propertyIndex = prop->index;
output->bytecode << store;
} else if (prop->type == -1) {
- QmlInstruction store;
- store.type = QmlInstruction::StoreVariantObject;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreVariantObject;
store.line = v->object->location.start.line;
store.storeObject.propertyIndex = prop->index;
output->bytecode << store;
} else {
- QmlInstruction store;
- store.type = QmlInstruction::StoreObject;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreObject;
store.line = v->object->location.start.line;
store.storeObject.propertyIndex = prop->index;
output->bytecode << store;
@@ -1641,8 +1641,8 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
} else if (v->type == Value::ValueSource) {
genObject(v->object);
- QmlInstruction store;
- store.type = QmlInstruction::StoreValueSource;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreValueSource;
store.line = v->object->location.start.line;
if (valueTypeProperty) {
store.assignValueSource.property = genValueTypeData(prop, valueTypeProperty);
@@ -1651,15 +1651,15 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
store.assignValueSource.property = genPropertyData(prop);
store.assignValueSource.owner = 0;
}
- QmlType *valueType = toQmlType(v->object);
+ QDeclarativeType *valueType = toQmlType(v->object);
store.assignValueSource.castValue = valueType->propertyValueSourceCast();
output->bytecode << store;
} else if (v->type == Value::ValueInterceptor) {
genObject(v->object);
- QmlInstruction store;
- store.type = QmlInstruction::StoreValueInterceptor;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreValueInterceptor;
store.line = v->object->location.start.line;
if (valueTypeProperty) {
store.assignValueInterceptor.property = genValueTypeData(prop, valueTypeProperty);
@@ -1668,7 +1668,7 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
store.assignValueInterceptor.property = genPropertyData(prop);
store.assignValueInterceptor.owner = 0;
}
- QmlType *valueType = toQmlType(v->object);
+ QDeclarativeType *valueType = toQmlType(v->object);
store.assignValueInterceptor.castValue = valueType->propertyValueInterceptorCast();
output->bytecode << store;
@@ -1686,32 +1686,32 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop,
}
}
-bool QmlCompiler::buildIdProperty(QmlParser::Property *prop,
- QmlParser::Object *obj)
+bool QDeclarativeCompiler::buildIdProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj)
{
if (prop->value ||
prop->values.count() > 1 ||
prop->values.at(0)->object)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid use of id property"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Invalid use of id property"));
- QmlParser::Value *idValue = prop->values.at(0);
+ QDeclarativeParser::Value *idValue = prop->values.at(0);
QString val = idValue->primitive();
if (!isValidId(val))
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","\"%1\" is not a valid object id").arg(val));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","\"%1\" is not a valid object id").arg(val));
// We disallow id's that conflict with import prefixes and types
- QmlEnginePrivate::ImportedNamespace *ns = 0;
- QmlType *type = 0;
- QmlEnginePrivate::get(engine)->resolveType(unit->imports, val.toUtf8(),
+ QDeclarativeEnginePrivate::ImportedNamespace *ns = 0;
+ QDeclarativeType *type = 0;
+ QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, val.toUtf8(),
&type, 0, 0, 0, &ns);
if (type)
- COMPILE_EXCEPTION(idValue, QCoreApplication::translate("QmlCompiler","id conflicts with type name"));
+ COMPILE_EXCEPTION(idValue, QCoreApplication::translate("QDeclarativeCompiler","id conflicts with type name"));
if (ns)
- COMPILE_EXCEPTION(idValue, QCoreApplication::translate("QmlCompiler","id conflicts with namespace prefix"));
+ COMPILE_EXCEPTION(idValue, QCoreApplication::translate("QDeclarativeCompiler","id conflicts with namespace prefix"));
if (compileState.ids.contains(val))
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","id is not unique"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","id is not unique"));
prop->values.at(0)->type = Value::Id;
@@ -1721,7 +1721,7 @@ bool QmlCompiler::buildIdProperty(QmlParser::Property *prop,
return true;
}
-void QmlCompiler::addId(const QString &id, QmlParser::Object *obj)
+void QDeclarativeCompiler::addId(const QString &id, QDeclarativeParser::Object *obj)
{
Q_ASSERT(!compileState.ids.contains(id));
Q_ASSERT(obj->id == id);
@@ -1730,13 +1730,13 @@ void QmlCompiler::addId(const QString &id, QmlParser::Object *obj)
compileState.idIndexes.insert(obj->idIndex, obj);
}
-void QmlCompiler::addBindingReference(const BindingReference &ref)
+void QDeclarativeCompiler::addBindingReference(const BindingReference &ref)
{
Q_ASSERT(ref.value && !compileState.bindings.contains(ref.value));
compileState.bindings.insert(ref.value, ref);
}
-void QmlCompiler::saveComponentState()
+void QDeclarativeCompiler::saveComponentState()
{
Q_ASSERT(compileState.root);
Q_ASSERT(!savedCompileStates.contains(compileState.root));
@@ -1745,8 +1745,8 @@ void QmlCompiler::saveComponentState()
savedComponentStats.append(componentStat);
}
-QmlCompiler::ComponentCompileState
-QmlCompiler::componentState(QmlParser::Object *obj)
+QDeclarativeCompiler::ComponentCompileState
+QDeclarativeCompiler::componentState(QDeclarativeParser::Object *obj)
{
Q_ASSERT(savedCompileStates.contains(obj));
return savedCompileStates.value(obj);
@@ -1757,8 +1757,8 @@ QmlCompiler::componentState(QmlParser::Object *obj)
// GridView.row: 10
// }
// GridView is an attached property object.
-bool QmlCompiler::buildAttachedProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
+bool QDeclarativeCompiler::buildAttachedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
Q_ASSERT(prop->value);
@@ -1778,33 +1778,33 @@ bool QmlCompiler::buildAttachedProperty(QmlParser::Property *prop,
// font.family: "Helvetica"
// }
// font is a nested property. pointSize and family are not.
-bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
+bool QDeclarativeCompiler::buildGroupedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
Q_ASSERT(prop->type != 0);
Q_ASSERT(prop->index != -1);
if (prop->values.count())
- COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QmlCompiler", "Invalid value in grouped property"));
+ COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QDeclarativeCompiler", "Invalid value in grouped property"));
if (prop->type < (int)QVariant::UserType) {
- QmlEnginePrivate *ep =
- static_cast<QmlEnginePrivate *>(QObjectPrivate::get(engine));
+ QDeclarativeEnginePrivate *ep =
+ static_cast<QDeclarativeEnginePrivate *>(QObjectPrivate::get(engine));
if (prop->type >= 0 /* QVariant == -1 */ && ep->valueTypes[prop->type]) {
COMPILE_CHECK(buildValueTypeProperty(ep->valueTypes[prop->type],
prop->value, obj, ctxt.incr()));
obj->addValueTypeProperty(prop);
} else {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid grouped property access"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Invalid grouped property access"));
}
} else {
// Load the nested property's meta type
prop->value->metatype =
- QmlEnginePrivate::get(engine)->metaObjectForType(prop->type);
+ QDeclarativeEnginePrivate::get(engine)->metaObjectForType(prop->type);
if (!prop->value->metatype)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid grouped property access"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Invalid grouped property access"));
obj->addGroupedProperty(prop);
@@ -1814,28 +1814,28 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop,
return true;
}
-bool QmlCompiler::buildValueTypeProperty(QObject *type,
- QmlParser::Object *obj,
- QmlParser::Object *baseObj,
+bool QDeclarativeCompiler::buildValueTypeProperty(QObject *type,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Object *baseObj,
const BindingContext &ctxt)
{
if (obj->defaultProperty)
- COMPILE_EXCEPTION(obj, QCoreApplication::translate("QmlCompiler","Invalid property use"));
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Invalid property use"));
obj->metatype = type->metaObject();
foreach (Property *prop, obj->properties) {
int idx = type->metaObject()->indexOfProperty(prop->name.constData());
if (idx == -1)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
QMetaProperty p = type->metaObject()->property(idx);
prop->index = idx;
prop->type = p.userType();
if (prop->value)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Property assignment expected"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Property assignment expected"));
if (prop->values.count() != 1)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Single property assignment expected"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Single property assignment expected"));
Value *value = prop->values.at(0);
@@ -1843,7 +1843,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
bool isPropertyValue = output->types.at(value->object->type).type->propertyValueSourceCast() != -1;
bool isPropertyInterceptor = output->types.at(value->object->type).type->propertyValueInterceptorCast() != -1;
if (!isPropertyValue && !isPropertyInterceptor) {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Unexpected object assignment"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Unexpected object assignment"));
} else {
COMPILE_CHECK(buildObject(value->object, ctxt));
@@ -1872,22 +1872,22 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
}
// Build assignments to QML lists. QML lists are properties of type
-// QList<T *> * and QmlList<T *> *.
+// QList<T *> * and QDeclarativeList<T *> *.
//
// QList<T *> * types can accept a list of objects, or a single binding
-// QmlList<T *> * types can accept a list of objects
-bool QmlCompiler::buildListProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
+// QDeclarativeList<T *> * types can accept a list of objects
+bool QDeclarativeCompiler::buildListProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
- Q_ASSERT(QmlEnginePrivate::get(engine)->isList(prop->type));
+ Q_ASSERT(QDeclarativeEnginePrivate::get(engine)->isList(prop->type));
int t = prop->type;
obj->addValueProperty(prop);
- int listType = QmlEnginePrivate::get(engine)->listType(t);
- bool listTypeIsInterface = QmlMetaType::isInterface(listType);
+ int listType = QDeclarativeEnginePrivate::get(engine)->listType(t);
+ bool listTypeIsInterface = QDeclarativeMetaType::isInterface(listType);
bool assignedBinding = false;
for (int ii = 0; ii < prop->values.count(); ++ii) {
@@ -1900,35 +1900,35 @@ bool QmlCompiler::buildListProperty(QmlParser::Property *prop,
// at runtime.
if (!listTypeIsInterface) {
if (!canCoerce(listType, v->object)) {
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign object to list"));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Cannot assign object to list"));
}
}
} else if (v->value.isScript()) {
if (assignedBinding)
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Can only assign one binding to lists"));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Can only assign one binding to lists"));
assignedBinding = true;
COMPILE_CHECK(buildBinding(v, prop, ctxt));
v->type = Value::PropertyBinding;
} else {
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Cannot assign primitives to lists"));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Cannot assign primitives to lists"));
}
}
return true;
}
-// Compiles an assignment to a QmlScriptString property
-bool QmlCompiler::buildScriptStringProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
+// Compiles an assignment to a QDeclarativeScriptString property
+bool QDeclarativeCompiler::buildScriptStringProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
if (prop->values.count() > 1)
- COMPILE_EXCEPTION(prop->values.at(1), QCoreApplication::translate("QmlCompiler", "Cannot assign multiple values to a script property"));
+ COMPILE_EXCEPTION(prop->values.at(1), QCoreApplication::translate("QDeclarativeCompiler", "Cannot assign multiple values to a script property"));
if (prop->values.at(0)->object || !prop->values.at(0)->value.isScript())
- COMPILE_EXCEPTION(prop->values.at(0), QCoreApplication::translate("QmlCompiler", "Invalid property assignment: script expected"));
+ COMPILE_EXCEPTION(prop->values.at(0), QCoreApplication::translate("QDeclarativeCompiler", "Invalid property assignment: script expected"));
obj->addScriptStringProperty(prop, ctxt.stack);
@@ -1950,8 +1950,8 @@ bool QmlCompiler::buildScriptStringProperty(QmlParser::Property *prop,
// }
//
// We allow assignming multiple values to single value properties
-bool QmlCompiler::buildPropertyAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
+bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
const BindingContext &ctxt)
{
obj->addValueProperty(prop);
@@ -1973,18 +1973,18 @@ bool QmlCompiler::buildPropertyAssignment(QmlParser::Property *prop,
}
// Compile assigning a single object instance to a regular property
-bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Value *v,
+bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *v,
const BindingContext &ctxt)
{
Q_ASSERT(prop->index != -1);
Q_ASSERT(v->object->type != -1);
if (!obj->metaObject()->property(prop->index).isWritable())
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
- if (QmlMetaType::isInterface(prop->type)) {
+ if (QDeclarativeMetaType::isInterface(prop->type)) {
// Assigning an object to an interface ptr property
COMPILE_CHECK(buildObject(v->object, ctxt));
@@ -2005,11 +2005,11 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
v->object->metatype = output->types.at(v->object->type).metaObject();
Q_ASSERT(v->object->metaObject());
- // Will be true if the assigned type inherits QmlPropertyValueSource
+ // Will be true if the assigned type inherits QDeclarativePropertyValueSource
bool isPropertyValue = false;
- // Will be true if the assigned type inherits QmlPropertyValueInterceptor
+ // Will be true if the assigned type inherits QDeclarativePropertyValueInterceptor
bool isPropertyInterceptor = false;
- if (QmlType *valueType = toQmlType(v->object)) {
+ if (QDeclarativeType *valueType = toQmlType(v->object)) {
isPropertyValue = valueType->propertyValueSourceCast() != -1;
isPropertyInterceptor = valueType->propertyValueInterceptorCast() != -1;
}
@@ -2018,7 +2018,7 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
// actual property type before we applied any extensions that might
// effect the properties on the type, but don't effect assignability
const QMetaObject *propertyMetaObject =
- QmlEnginePrivate::get(engine)->rawMetaObjectForType(prop->type);
+ QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(prop->type);
// Will be true if the assgned type inherits propertyMetaObject
bool isAssignable = false;
@@ -2026,7 +2026,7 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
if (propertyMetaObject) {
const QMetaObject *c = v->object->metatype;
while(c) {
- isAssignable |= (QmlMetaPropertyPrivate::equal(c, propertyMetaObject));
+ isAssignable |= (QDeclarativeMetaPropertyPrivate::equal(c, propertyMetaObject));
c = c->superClass();
}
}
@@ -2036,15 +2036,15 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
COMPILE_CHECK(buildObject(v->object, ctxt));
v->type = Value::CreatedObject;
- } else if (propertyMetaObject == &QmlComponent::staticMetaObject) {
+ } else if (propertyMetaObject == &QDeclarativeComponent::staticMetaObject) {
// Automatic "Component" insertion
- QmlParser::Object *root = v->object;
- QmlParser::Object *component = new QmlParser::Object;
+ QDeclarativeParser::Object *root = v->object;
+ QDeclarativeParser::Object *component = new QDeclarativeParser::Object;
component->type = componentTypeRef();
component->typeName = "Qt/Component";
- component->metatype = &QmlComponent::staticMetaObject;
+ component->metatype = &QDeclarativeComponent::staticMetaObject;
component->location = root->location;
- QmlParser::Value *componentValue = new QmlParser::Value;
+ QDeclarativeParser::Value *componentValue = new QDeclarativeParser::Value;
componentValue->object = root;
component->getDefaultProperty()->addValue(componentValue);
v->object = component;
@@ -2057,7 +2057,7 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
buildDynamicMeta(prop->parent, ForceCreation);
v->type = isPropertyValue ? Value::ValueSource : Value::ValueInterceptor;
} else {
- COMPILE_EXCEPTION(v->object, QCoreApplication::translate("QmlCompiler","Cannot assign object to property"));
+ COMPILE_EXCEPTION(v->object, QCoreApplication::translate("QDeclarativeCompiler","Cannot assign object to property"));
}
}
@@ -2065,9 +2065,9 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop,
}
// Compile assigning a literal or binding to a regular property
-bool QmlCompiler::buildPropertyLiteralAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Value *v,
+bool QDeclarativeCompiler::buildPropertyLiteralAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *v,
const BindingContext &ctxt)
{
Q_ASSERT(prop->index != -1);
@@ -2096,9 +2096,9 @@ bool QmlCompiler::buildPropertyLiteralAssignment(QmlParser::Property *prop,
return true;
}
-bool QmlCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop,
- QmlParser::Object *obj,
- QmlParser::Value *v,
+bool QDeclarativeCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *v,
bool *isAssignment)
{
*isAssignment = false;
@@ -2106,7 +2106,7 @@ bool QmlCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop,
return true;
if (!prop.isWritable())
- COMPILE_EXCEPTION(v, QCoreApplication::translate("QmlCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop.name())));
+ COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop.name())));
QString string = v->value.asString();
if (!string.at(0).isUpper())
@@ -2117,8 +2117,8 @@ bool QmlCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop,
return true;
QString typeName = parts.at(0);
- QmlType *type = 0;
- QmlEnginePrivate::get(engine)->resolveType(unit->imports, typeName.toUtf8(),
+ QDeclarativeType *type = 0;
+ QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, typeName.toUtf8(),
&type, 0, 0, 0, 0);
if (!type || obj->typeName != type->qmlTypeName())
@@ -2134,14 +2134,14 @@ bool QmlCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop,
return true;
v->type = Value::Literal;
- v->value = QmlParser::Variant(enumValue);
+ v->value = QDeclarativeParser::Variant(enumValue);
*isAssignment = true;
return true;
}
// Ensures that the dynamic meta specification on obj is valid
-bool QmlCompiler::checkDynamicMeta(QmlParser::Object *obj)
+bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
{
QSet<QByteArray> propNames;
QSet<QByteArray> methodNames;
@@ -2149,17 +2149,17 @@ bool QmlCompiler::checkDynamicMeta(QmlParser::Object *obj)
// Check properties
for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
- const QmlParser::Object::DynamicProperty &prop =
+ const QDeclarativeParser::Object::DynamicProperty &prop =
obj->dynamicProperties.at(ii);
if (prop.isDefaultProperty) {
if (seenDefaultProperty)
- COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QmlCompiler","Duplicate default property"));
+ COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QDeclarativeCompiler","Duplicate default property"));
seenDefaultProperty = true;
}
if (propNames.contains(prop.name))
- COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QmlCompiler","Duplicate property name"));
+ COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QDeclarativeCompiler","Duplicate property name"));
propNames.insert(prop.name);
}
@@ -2167,20 +2167,20 @@ bool QmlCompiler::checkDynamicMeta(QmlParser::Object *obj)
for (int ii = 0; ii < obj->dynamicSignals.count(); ++ii) {
QByteArray name = obj->dynamicSignals.at(ii).name;
if (methodNames.contains(name))
- COMPILE_EXCEPTION(obj, QCoreApplication::translate("QmlCompiler","Duplicate signal name"));
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Duplicate signal name"));
methodNames.insert(name);
}
for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
QByteArray name = obj->dynamicSlots.at(ii).name;
if (methodNames.contains(name))
- COMPILE_EXCEPTION(obj, QCoreApplication::translate("QmlCompiler","Duplicate method name"));
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Duplicate method name"));
methodNames.insert(name);
}
return true;
}
-bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj)
+bool QDeclarativeCompiler::mergeDynamicMetaProperties(QDeclarativeParser::Object *obj)
{
for (int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
const Object::DynamicProperty &p = obj->dynamicProperties.at(ii);
@@ -2195,7 +2195,7 @@ bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj)
property = obj->getProperty(p.name);
if (property->value)
- COMPILE_EXCEPTION(property, QCoreApplication::translate("QmlCompiler","Invalid property nesting"));
+ COMPILE_EXCEPTION(property, QCoreApplication::translate("QDeclarativeCompiler","Invalid property nesting"));
for (int ii = 0; ii < p.defaultValue->values.count(); ++ii) {
Value *v = p.defaultValue->values.at(ii);
@@ -2208,7 +2208,7 @@ bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj)
Q_GLOBAL_STATIC(QAtomicInt, classIndexCounter)
-bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
+bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeParser::Object *obj, DynamicMetaMode mode)
{
Q_ASSERT(obj);
Q_ASSERT(obj->metatype);
@@ -2221,7 +2221,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
COMPILE_CHECK(checkDynamicMeta(obj));
- QByteArray dynamicData(sizeof(QmlVMEMetaData), (char)0);
+ QByteArray dynamicData(sizeof(QDeclarativeVMEMetaData), (char)0);
QByteArray newClassName = obj->metatype->className();
newClassName.append("_QML_");
@@ -2250,7 +2250,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
if (-1 != propIdx) {
QMetaProperty prop = obj->metaObject()->property(propIdx);
if (prop.isFinal())
- COMPILE_EXCEPTION(&p, QCoreApplication::translate("QmlCompiler","Cannot override FINAL property"));
+ COMPILE_EXCEPTION(&p, QCoreApplication::translate("QDeclarativeCompiler","Cannot override FINAL property"));
}
if (p.isDefaultProperty &&
@@ -2270,19 +2270,19 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
case Object::DynamicProperty::Custom:
{
QByteArray customTypeName;
- QmlType *qmltype = 0;
+ QDeclarativeType *qmltype = 0;
QUrl url;
- QmlEnginePrivate *priv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(engine);
if (!priv->resolveType(unit->imports, p.customType, &qmltype,
&url, 0, 0, 0))
- COMPILE_EXCEPTION(&p, QCoreApplication::translate("QmlCompiler","Invalid property type"));
+ COMPILE_EXCEPTION(&p, QCoreApplication::translate("QDeclarativeCompiler","Invalid property type"));
if (!qmltype) {
- QmlCompositeTypeData *tdata = priv->typeManager.get(url);
+ QDeclarativeCompositeTypeData *tdata = priv->typeManager.get(url);
Q_ASSERT(tdata);
- Q_ASSERT(tdata->status == QmlCompositeTypeData::Complete);
+ Q_ASSERT(tdata->status == QDeclarativeCompositeTypeData::Complete);
- QmlCompiledData *data = tdata->toCompiledComponent(engine);
+ QDeclarativeCompiledData *data = tdata->toCompiledComponent(engine);
customTypeName = data->root->className();
} else {
customTypeName = qmltype->typeName();
@@ -2293,10 +2293,10 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
propertyType = QMetaType::QObjectStar;
} else {
readonly = true;
- type = "QmlListProperty<";
+ type = "QDeclarativeListProperty<";
type.append(customTypeName);
type.append(">");
- propertyType = qMetaTypeId<QmlListProperty<QObject> >();
+ propertyType = qMetaTypeId<QDeclarativeListProperty<QObject> >();
}
}
break;
@@ -2334,8 +2334,8 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
break;
}
- ((QmlVMEMetaData *)dynamicData.data())->propertyCount++;
- QmlVMEMetaData::PropertyData propertyData = { propertyType };
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->propertyCount++;
+ QDeclarativeVMEMetaData::PropertyData propertyData = { propertyType };
dynamicData.append((char *)&propertyData, sizeof(propertyData));
builder.addSignal(p.name + "Changed()");
@@ -2350,7 +2350,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
const Object::DynamicProperty &p = obj->dynamicProperties.at(ii);
if (p.type == Object::DynamicProperty::Alias) {
- ((QmlVMEMetaData *)dynamicData.data())->aliasCount++;
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->aliasCount++;
compileAlias(builder, dynamicData, obj, p);
}
}
@@ -2366,7 +2366,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
sig.append(')');
QMetaMethodBuilder b = builder.addSignal(sig);
b.setParameterNames(s.parameterNames);
- ((QmlVMEMetaData *)dynamicData.data())->signalCount++;
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->signalCount++;
}
QStringList funcScripts;
@@ -2394,8 +2394,8 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
b.setReturnType("QVariant");
b.setParameterNames(s.parameterNames);
- ((QmlVMEMetaData *)dynamicData.data())->methodCount++;
- QmlVMEMetaData::MethodData methodData =
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->methodCount++;
+ QDeclarativeVMEMetaData::MethodData methodData =
{ s.parameterNames.count(), 0, funcScript.length(), 0 };
dynamicData.append((char *)&methodData, sizeof(methodData));
@@ -2403,8 +2403,8 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
const QString &funcScript = funcScripts.at(ii);
- QmlVMEMetaData::MethodData *data =
- ((QmlVMEMetaData *)dynamicData.data())->methodData() + ii;
+ QDeclarativeVMEMetaData::MethodData *data =
+ ((QDeclarativeVMEMetaData *)dynamicData.data())->methodData() + ii;
data->bodyOffset = dynamicData.size();
@@ -2423,16 +2423,16 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
return true;
}
-#include <qmljsparser_p.h>
+#include <qdeclarativejsparser_p.h>
-static QStringList astNodeToStringList(QmlJS::AST::Node *node)
+static QStringList astNodeToStringList(QDeclarativeJS::AST::Node *node)
{
- if (node->kind == QmlJS::AST::Node::Kind_IdentifierExpression) {
+ if (node->kind == QDeclarativeJS::AST::Node::Kind_IdentifierExpression) {
QString name =
- static_cast<QmlJS::AST::IdentifierExpression *>(node)->name->asString();
+ static_cast<QDeclarativeJS::AST::IdentifierExpression *>(node)->name->asString();
return QStringList() << name;
- } else if (node->kind == QmlJS::AST::Node::Kind_FieldMemberExpression) {
- QmlJS::AST::FieldMemberExpression *expr = static_cast<QmlJS::AST::FieldMemberExpression *>(node);
+ } else if (node->kind == QDeclarativeJS::AST::Node::Kind_FieldMemberExpression) {
+ QDeclarativeJS::AST::FieldMemberExpression *expr = static_cast<QDeclarativeJS::AST::FieldMemberExpression *>(node);
QStringList rv = astNodeToStringList(expr->base);
if (rv.isEmpty())
@@ -2443,30 +2443,30 @@ static QStringList astNodeToStringList(QmlJS::AST::Node *node)
return QStringList();
}
-bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder,
+bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder,
QByteArray &data,
Object *obj,
const Object::DynamicProperty &prop)
{
if (!prop.defaultValue)
- COMPILE_EXCEPTION(obj, QCoreApplication::translate("QmlCompiler","No property alias location"));
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","No property alias location"));
if (prop.defaultValue->values.count() != 1 ||
prop.defaultValue->values.at(0)->object ||
!prop.defaultValue->values.at(0)->value.isScript())
- COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QmlCompiler","Invalid alias location"));
+ COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QDeclarativeCompiler","Invalid alias location"));
- QmlJS::AST::Node *node = prop.defaultValue->values.at(0)->value.asAST();
+ QDeclarativeJS::AST::Node *node = prop.defaultValue->values.at(0)->value.asAST();
if (!node)
- COMPILE_EXCEPTION(obj, QCoreApplication::translate("QmlCompiler","No property alias location")); // ### Can this happen?
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","No property alias location")); // ### Can this happen?
QStringList alias = astNodeToStringList(node);
if (alias.count() != 1 && alias.count() != 2)
- COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QmlCompiler","Invalid alias reference. An alias reference must be specified as <id> or <id>.<property>"));
+ COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QDeclarativeCompiler","Invalid alias reference. An alias reference must be specified as <id> or <id>.<property>"));
if (!compileState.ids.contains(alias.at(0)))
- COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QmlCompiler","Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0)));
+ COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QDeclarativeCompiler","Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0)));
Object *idObject = compileState.ids[alias.at(0)];
@@ -2479,7 +2479,7 @@ bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder,
propIdx = idObject->metaObject()->indexOfProperty(alias.at(1).toUtf8().constData());
if (-1 == propIdx)
- COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QmlCompiler","Invalid alias location"));
+ COMPILE_EXCEPTION(prop.defaultValue, QCoreApplication::translate("QDeclarativeCompiler","Invalid alias location"));
QMetaProperty aliasProperty = idObject->metaObject()->property(propIdx);
writable = aliasProperty.isWritable();
@@ -2523,8 +2523,8 @@ bool QmlCompiler::compileAlias(QMetaObjectBuilder &builder,
return true;
}
-bool QmlCompiler::buildBinding(QmlParser::Value *value,
- QmlParser::Property *prop,
+bool QDeclarativeCompiler::buildBinding(QDeclarativeParser::Value *value,
+ QDeclarativeParser::Property *prop,
const BindingContext &ctxt)
{
Q_ASSERT(prop->index != -1);
@@ -2532,8 +2532,8 @@ bool QmlCompiler::buildBinding(QmlParser::Value *value,
Q_ASSERT(prop->parent->metaObject());
QMetaProperty mp = prop->parent->metaObject()->property(prop->index);
- if (!mp.isWritable() && !QmlMetaType::isList(prop->type))
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
+ if (!mp.isWritable() && !QDeclarativeMetaType::isList(prop->type))
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QDeclarativeCompiler","Invalid property assignment: \"%1\" is a read-only property").arg(QString::fromUtf8(prop->name)));
BindingReference reference;
reference.expression = value->value;
@@ -2545,18 +2545,18 @@ bool QmlCompiler::buildBinding(QmlParser::Value *value,
return true;
}
-void QmlCompiler::genBindingAssignment(QmlParser::Value *binding,
- QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Property *valueTypeProperty)
+void QDeclarativeCompiler::genBindingAssignment(QDeclarativeParser::Value *binding,
+ QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty)
{
Q_UNUSED(obj);
Q_ASSERT(compileState.bindings.contains(binding));
const BindingReference &ref = compileState.bindings.value(binding);
if (ref.dataType == BindingReference::Experimental) {
- QmlInstruction store;
- store.type = QmlInstruction::StoreCompiledBinding;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreCompiledBinding;
store.assignBinding.value = ref.compiledIndex;
store.assignBinding.context = ref.bindingContext.stack;
store.assignBinding.owner = ref.bindingContext.owner;
@@ -2571,8 +2571,8 @@ void QmlCompiler::genBindingAssignment(QmlParser::Value *binding,
return;
}
- QmlInstruction store;
- store.type = QmlInstruction::StoreBinding;
+ QDeclarativeInstruction store;
+ store.type = QDeclarativeInstruction::StoreBinding;
store.assignBinding.value = output->indexForByteArray(ref.compiledData);
store.assignBinding.context = ref.bindingContext.stack;
store.assignBinding.owner = ref.bindingContext.owner;
@@ -2589,14 +2589,14 @@ void QmlCompiler::genBindingAssignment(QmlParser::Value *binding,
output->bytecode << store;
}
-int QmlCompiler::genContextCache()
+int QDeclarativeCompiler::genContextCache()
{
if (compileState.ids.count() == 0)
return -1;
- QmlIntegerCache *cache = new QmlIntegerCache(engine);
+ QDeclarativeIntegerCache *cache = new QDeclarativeIntegerCache(engine);
- for (QHash<QString, QmlParser::Object *>::ConstIterator iter = compileState.ids.begin();
+ for (QHash<QString, QDeclarativeParser::Object *>::ConstIterator iter = compileState.ids.begin();
iter != compileState.ids.end();
++iter)
cache->add(iter.key(), (*iter)->idIndex);
@@ -2605,24 +2605,24 @@ int QmlCompiler::genContextCache()
return output->contextCaches.count() - 1;
}
-int QmlCompiler::genValueTypeData(QmlParser::Property *valueTypeProp,
- QmlParser::Property *prop)
+int QDeclarativeCompiler::genValueTypeData(QDeclarativeParser::Property *valueTypeProp,
+ QDeclarativeParser::Property *prop)
{
QByteArray data =
- QmlMetaPropertyPrivate::saveValueType(prop->parent->metaObject(), prop->index,
- QmlEnginePrivate::get(engine)->valueTypes[prop->type]->metaObject(),
+ QDeclarativeMetaPropertyPrivate::saveValueType(prop->parent->metaObject(), prop->index,
+ QDeclarativeEnginePrivate::get(engine)->valueTypes[prop->type]->metaObject(),
valueTypeProp->index);
// valueTypeProp->index, valueTypeProp->type);
return output->indexForByteArray(data);
}
-int QmlCompiler::genPropertyData(QmlParser::Property *prop)
+int QDeclarativeCompiler::genPropertyData(QDeclarativeParser::Property *prop)
{
- return output->indexForByteArray(QmlMetaPropertyPrivate::saveProperty(prop->parent->metaObject(), prop->index));
+ return output->indexForByteArray(QDeclarativeMetaPropertyPrivate::saveProperty(prop->parent->metaObject(), prop->index));
}
-bool QmlCompiler::completeComponentBuild()
+bool QDeclarativeCompiler::completeComponentBuild()
{
componentStat.ids = compileState.ids.count();
@@ -2631,13 +2631,13 @@ bool QmlCompiler::completeComponentBuild()
COMPILE_CHECK(buildDynamicMeta(aliasObject, ResolveAliases));
}
- QmlBindingCompiler::Expression expr;
+ QDeclarativeBindingCompiler::Expression expr;
expr.component = compileState.root;
expr.ids = compileState.ids;
- QmlBindingCompiler bindingCompiler;
+ QDeclarativeBindingCompiler bindingCompiler;
- for (QHash<QmlParser::Value*,BindingReference>::Iterator iter = compileState.bindings.begin(); iter != compileState.bindings.end(); ++iter) {
+ for (QHash<QDeclarativeParser::Value*,BindingReference>::Iterator iter = compileState.bindings.begin(); iter != compileState.bindings.end(); ++iter) {
BindingReference &binding = *iter;
expr.context = binding.bindingContext.object;
@@ -2646,7 +2646,7 @@ bool QmlCompiler::completeComponentBuild()
expr.imports = unit->imports;
if (qmlExperimental()) {
- int index = bindingCompiler.compile(expr, QmlEnginePrivate::get(engine));
+ int index = bindingCompiler.compile(expr, QDeclarativeEnginePrivate::get(engine));
if (index != -1) {
qWarning() << "Accepted for optimization:" << qPrintable(expr.expression.asScript());
binding.dataType = BindingReference::Experimental;
@@ -2664,10 +2664,10 @@ bool QmlCompiler::completeComponentBuild()
QString expression = binding.expression.asScript();
// ### Optimize
- QmlRewrite::SharedBindingTester sharableTest;
+ QDeclarativeRewrite::SharedBindingTester sharableTest;
bool isSharable = sharableTest.isSharable(expression);
- QmlRewrite::RewriteBinding rewriteBinding;
+ QDeclarativeRewrite::RewriteBinding rewriteBinding;
expression = rewriteBinding(expression);
quint32 length = expression.length();
@@ -2693,7 +2693,7 @@ bool QmlCompiler::completeComponentBuild()
if (bindingCompiler.isValid()) {
compileState.compiledBindingData = bindingCompiler.program();
- QmlBindingCompiler::dump(compileState.compiledBindingData);
+ QDeclarativeBindingCompiler::dump(compileState.compiledBindingData);
}
saveComponentState();
@@ -2701,7 +2701,7 @@ bool QmlCompiler::completeComponentBuild()
return true;
}
-void QmlCompiler::dumpStats()
+void QDeclarativeCompiler::dumpStats()
{
qWarning().nospace() << "QML Document: " << output->url.toString();
for (int ii = 0; ii < savedComponentStats.count(); ++ii) {
@@ -2718,14 +2718,14 @@ void QmlCompiler::dumpStats()
Returns true if from can be assigned to a (QObject) property of type
to.
*/
-bool QmlCompiler::canCoerce(int to, QmlParser::Object *from)
+bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeParser::Object *from)
{
const QMetaObject *toMo =
- QmlEnginePrivate::get(engine)->rawMetaObjectForType(to);
+ QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(to);
const QMetaObject *fromMo = from->metaObject();
while (fromMo) {
- if (QmlMetaPropertyPrivate::equal(fromMo, toMo))
+ if (QDeclarativeMetaPropertyPrivate::equal(fromMo, toMo))
return true;
fromMo = fromMo->superClass();
}
@@ -2736,34 +2736,34 @@ bool QmlCompiler::canCoerce(int to, QmlParser::Object *from)
Returns true if from can be assigned to a (QObject) property of type
to.
*/
-bool QmlCompiler::canCoerce(int to, int from)
+bool QDeclarativeCompiler::canCoerce(int to, int from)
{
const QMetaObject *toMo =
- QmlEnginePrivate::get(engine)->rawMetaObjectForType(to);
+ QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(to);
const QMetaObject *fromMo =
- QmlEnginePrivate::get(engine)->rawMetaObjectForType(from);
+ QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(from);
while (fromMo) {
- if (QmlMetaPropertyPrivate::equal(fromMo, toMo))
+ if (QDeclarativeMetaPropertyPrivate::equal(fromMo, toMo))
return true;
fromMo = fromMo->superClass();
}
return false;
}
-QmlType *QmlCompiler::toQmlType(QmlParser::Object *from)
+QDeclarativeType *QDeclarativeCompiler::toQmlType(QDeclarativeParser::Object *from)
{
// ### Optimize
const QMetaObject *mo = from->metatype;
- QmlType *type = 0;
+ QDeclarativeType *type = 0;
while (!type && mo) {
- type = QmlMetaType::qmlType(mo);
+ type = QDeclarativeMetaType::qmlType(mo);
mo = mo->superClass();
}
return type;
}
-QStringList QmlCompiler::deferredProperties(QmlParser::Object *obj)
+QStringList QDeclarativeCompiler::deferredProperties(QDeclarativeParser::Object *obj)
{
const QMetaObject *mo = obj->metatype;
diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h
new file mode 100644
index 0000000..627490d
--- /dev/null
+++ b/src/declarative/qml/qdeclarativecompiler_p.h
@@ -0,0 +1,337 @@
+/****************************************************************************
+**
+** 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 QDECLARATIVECOMPILER_P_H
+#define QDECLARATIVECOMPILER_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 "qdeclarativeerror.h"
+#include "qdeclarativeinstruction_p.h"
+#include "qdeclarativecompositetypemanager_p.h"
+#include "qdeclarativeparser_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qbitfield_p.h"
+#include "qdeclarativepropertycache_p.h"
+#include "qdeclarativeintegercache_p.h"
+#include "qdeclarativetypenamecache_p.h"
+
+#include <QtCore/qbytearray.h>
+#include <QtCore/qset.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeEngine;
+class QDeclarativeComponent;
+class QDeclarativeContext;
+
+class QScriptProgram;
+class Q_AUTOTEST_EXPORT QDeclarativeCompiledData : public QDeclarativeRefCount, public QDeclarativeCleanup
+{
+public:
+ QDeclarativeCompiledData(QDeclarativeEngine *engine);
+ virtual ~QDeclarativeCompiledData();
+
+ QString name;
+ QUrl url;
+ QDeclarativeEnginePrivate::Imports imports;
+ QDeclarativeTypeNameCache *importCache;
+
+ struct TypeReference
+ {
+ TypeReference()
+ : type(0), component(0), ref(0) {}
+
+ QByteArray className;
+ QDeclarativeType *type;
+ QDeclarativeComponent *component;
+
+ QDeclarativeRefCount *ref;
+ QObject *createInstance(QDeclarativeContext *, const QBitField &) const;
+ const QMetaObject *metaObject() const;
+ };
+ QList<TypeReference> types;
+ struct CustomTypeData
+ {
+ int index;
+ int type;
+ };
+
+ const QMetaObject *root;
+ QAbstractDynamicMetaObject rootData;
+ QDeclarativePropertyCache *rootPropertyCache;
+ QList<QString> primitives;
+ QList<float> floatData;
+ QList<int> intData;
+ QList<CustomTypeData> customTypeData;
+ QList<QByteArray> datas;
+ QList<QDeclarativeParser::Location> locations;
+ QList<QDeclarativeInstruction> bytecode;
+ QList<QScriptProgram *> cachedPrograms;
+ QList<QScriptValue *> cachedClosures;
+ QList<QDeclarativePropertyCache *> propertyCaches;
+ QList<QDeclarativeIntegerCache *> contextCaches;
+ QList<QDeclarativeParser::Object::ScriptBlock> scripts;
+ QList<QUrl> urls;
+
+ void dumpInstructions();
+
+protected:
+ virtual void clear(); // From QDeclarativeCleanup
+
+private:
+ void dump(QDeclarativeInstruction *, int idx = -1);
+ QDeclarativeCompiledData(const QDeclarativeCompiledData &other);
+ QDeclarativeCompiledData &operator=(const QDeclarativeCompiledData &other);
+ QByteArray packData;
+ friend class QDeclarativeCompiler;
+ int pack(const char *, size_t);
+
+ int indexForString(const QString &);
+ int indexForByteArray(const QByteArray &);
+ int indexForFloat(float *, int);
+ int indexForInt(int *, int);
+ int indexForLocation(const QDeclarativeParser::Location &);
+ int indexForLocation(const QDeclarativeParser::LocationSpan &);
+ int indexForUrl(const QUrl &);
+};
+
+class QMetaObjectBuilder;
+class Q_DECLARATIVE_EXPORT QDeclarativeCompiler
+{
+public:
+ QDeclarativeCompiler();
+
+ bool compile(QDeclarativeEngine *, QDeclarativeCompositeTypeData *, QDeclarativeCompiledData *);
+
+ bool isError() const;
+ QList<QDeclarativeError> errors() const;
+
+ static bool isValidId(const QString &);
+ static bool isAttachedPropertyName(const QByteArray &);
+ static bool isSignalPropertyName(const QByteArray &);
+
+private:
+ static void reset(QDeclarativeCompiledData *);
+
+ struct BindingContext {
+ BindingContext()
+ : stack(0), owner(0), object(0) {}
+ BindingContext(QDeclarativeParser::Object *o)
+ : stack(0), owner(0), object(o) {}
+ BindingContext incr() const {
+ BindingContext rv(object);
+ rv.stack = stack + 1;
+ return rv;
+ }
+ bool isSubContext() const { return stack != 0; }
+ int stack;
+ int owner;
+ QDeclarativeParser::Object *object;
+ };
+
+ void compileTree(QDeclarativeParser::Object *tree);
+
+
+ bool buildObject(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool buildScript(QDeclarativeParser::Object *obj, QDeclarativeParser::Object *script);
+ bool buildComponent(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool buildSubObject(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool buildSignal(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
+ const BindingContext &);
+ bool buildProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj,
+ const BindingContext &);
+ bool buildPropertyInNamespace(QDeclarativeEnginePrivate::ImportedNamespace *ns,
+ QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &);
+ bool buildIdProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ bool buildAttachedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildGroupedProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildValueTypeProperty(QObject *type,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Object *baseObj,
+ const BindingContext &ctxt);
+ bool buildListProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildScriptStringProperty(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ const BindingContext &ctxt);
+ bool buildPropertyObjectAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *value,
+ const BindingContext &ctxt);
+ bool buildPropertyLiteralAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *value,
+ const BindingContext &ctxt);
+ bool doesPropertyExist(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ bool testLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *value);
+ bool testQualifiedEnumAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Value *value,
+ bool *isAssignment);
+ enum DynamicMetaMode { IgnoreAliases, ResolveAliases, ForceCreation };
+ bool mergeDynamicMetaProperties(QDeclarativeParser::Object *obj);
+ bool buildDynamicMeta(QDeclarativeParser::Object *obj, DynamicMetaMode mode);
+ bool checkDynamicMeta(QDeclarativeParser::Object *obj);
+ bool buildBinding(QDeclarativeParser::Value *, QDeclarativeParser::Property *prop,
+ const BindingContext &ctxt);
+ bool buildComponentFromRoot(QDeclarativeParser::Object *obj, const BindingContext &);
+ bool compileAlias(QMetaObjectBuilder &,
+ QByteArray &data,
+ QDeclarativeParser::Object *obj,
+ const QDeclarativeParser::Object::DynamicProperty &);
+ bool completeComponentBuild();
+
+
+ void genObject(QDeclarativeParser::Object *obj);
+ void genObjectBody(QDeclarativeParser::Object *obj);
+ void genComponent(QDeclarativeParser::Object *obj);
+ void genValueProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ void genListProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj);
+ void genPropertyAssignment(QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty = 0);
+ void genLiteralAssignment(const QMetaProperty &prop,
+ QDeclarativeParser::Value *value);
+ void genBindingAssignment(QDeclarativeParser::Value *binding,
+ QDeclarativeParser::Property *prop,
+ QDeclarativeParser::Object *obj,
+ QDeclarativeParser::Property *valueTypeProperty = 0);
+ int genContextCache();
+
+ int genValueTypeData(QDeclarativeParser::Property *prop, QDeclarativeParser::Property *valueTypeProp);
+ int genPropertyData(QDeclarativeParser::Property *prop);
+
+ int componentTypeRef();
+
+ static int findSignalByName(const QMetaObject *, const QByteArray &name);
+ static QDeclarativeType *toQmlType(QDeclarativeParser::Object *from);
+ bool canCoerce(int to, QDeclarativeParser::Object *from);
+ bool canCoerce(int to, int from);
+
+ QStringList deferredProperties(QDeclarativeParser::Object *);
+
+ void addId(const QString &, QDeclarativeParser::Object *);
+
+ void dumpStats();
+
+ struct BindingReference {
+ QDeclarativeParser::Variant expression;
+ QDeclarativeParser::Property *property;
+ QDeclarativeParser::Value *value;
+
+ enum DataType { QtScript, Experimental };
+ DataType dataType;
+
+ int compiledIndex;
+
+ QByteArray compiledData;
+ BindingContext bindingContext;
+ };
+ void addBindingReference(const BindingReference &);
+
+ struct ComponentCompileState
+ {
+ ComponentCompileState()
+ : parserStatusCount(0), pushedProperties(0), root(0) {}
+ QHash<QString, QDeclarativeParser::Object *> ids;
+ QHash<int, QDeclarativeParser::Object *> idIndexes;
+ int parserStatusCount;
+ int pushedProperties;
+
+ QByteArray compiledBindingData;
+
+ QHash<QDeclarativeParser::Value *, BindingReference> bindings;
+ QList<QDeclarativeParser::Object *> aliasingObjects;
+ QDeclarativeParser::Object *root;
+ };
+ ComponentCompileState compileState;
+
+ struct ComponentStat
+ {
+ ComponentStat()
+ : ids(0), scriptBindings(0), optimizedBindings(0), objects(0) {}
+
+ int lineNumber;
+
+ int ids;
+ int scriptBindings;
+ int optimizedBindings;
+ int objects;
+ };
+ ComponentStat componentStat;
+
+ void saveComponentState();
+
+ ComponentCompileState componentState(QDeclarativeParser::Object *);
+ QHash<QDeclarativeParser::Object *, ComponentCompileState> savedCompileStates;
+ QList<ComponentStat> savedComponentStats;
+
+ QList<QDeclarativeError> exceptions;
+ QDeclarativeCompiledData *output;
+ QDeclarativeEngine *engine;
+ QDeclarativeParser::Object *unitRoot;
+ QDeclarativeCompositeTypeData *unit;
+};
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVECOMPILER_P_H
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index cda281f..beaba4a 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -39,20 +39,20 @@
**
****************************************************************************/
-#include "qmlcomponent.h"
-#include "qmlcomponent_p.h"
-
-#include "qmlcompiler_p.h"
-#include "qmlcontext_p.h"
-#include "qmlcompositetypedata_p.h"
-#include "qmlengine_p.h"
-#include "qmlvme_p.h"
-#include "qml.h"
-#include "qmlengine.h"
-#include "qmlbinding_p.h"
-#include "qmlbinding_p_p.h"
-#include "qmlglobal_p.h"
-#include "qmlscriptparser_p.h"
+#include "qdeclarativecomponent.h"
+#include "qdeclarativecomponent_p.h"
+
+#include "qdeclarativecompiler_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativecompositetypedata_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativevme_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativebinding_p_p.h"
+#include "qdeclarativeglobal_p.h"
+#include "qdeclarativescriptparser_p.h"
#include <qfxperf_p_p.h>
@@ -65,22 +65,22 @@
QT_BEGIN_NAMESPACE
class QByteArray;
-int statusId = qRegisterMetaType<QmlComponent::Status>("QmlComponent::Status");
+int statusId = qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeComponent::Status");
/*!
- \class QmlComponent
+ \class QDeclarativeComponent
\since 4.7
- \brief The QmlComponent class encapsulates a QML component description.
+ \brief The QDeclarativeComponent class encapsulates a QML component description.
\mainclass
*/
/*!
- \qmlclass Component QmlComponent
+ \qmlclass Component QDeclarativeComponent
\since 4.7
\brief The Component element encapsulates a QML component description.
Components are reusable, encapsulated Qml element with a well-defined interface.
- They are often defined in \l {qmldocuments.html}{Component Files}.
+ They are often defined in \l {qdeclarativedocuments.html}{Component Files}.
The \e Component element allows defining components within a QML file.
This can be useful for reusing a small component within a single QML
@@ -125,19 +125,19 @@ Item {
*/
/*!
- \enum QmlComponent::Status
+ \enum QDeclarativeComponent::Status
- Specifies the loading status of the QmlComponent.
+ Specifies the loading status of the QDeclarativeComponent.
- \value Null This QmlComponent has no data. Call loadUrl() or setData() to add QML content.
- \value Ready This QmlComponent is ready and create() may be called.
- \value Loading This QmlComponent is loading network data.
+ \value Null This QDeclarativeComponent has no data. Call loadUrl() or setData() to add QML content.
+ \value Ready This QDeclarativeComponent is ready and create() may be called.
+ \value Loading This QDeclarativeComponent is loading network data.
\value Error An error has occured. Calling errorDescription() to retrieve a description.
*/
-void QmlComponentPrivate::typeDataReady()
+void QDeclarativeComponentPrivate::typeDataReady()
{
- Q_Q(QmlComponent);
+ Q_Q(QDeclarativeComponent);
Q_ASSERT(typeData);
@@ -147,21 +147,21 @@ void QmlComponentPrivate::typeDataReady()
emit q->statusChanged(q->status());
}
-void QmlComponentPrivate::updateProgress(qreal p)
+void QDeclarativeComponentPrivate::updateProgress(qreal p)
{
- Q_Q(QmlComponent);
+ Q_Q(QDeclarativeComponent);
progress = p;
emit q->progressChanged(p);
}
-void QmlComponentPrivate::fromTypeData(QmlCompositeTypeData *data)
+void QDeclarativeComponentPrivate::fromTypeData(QDeclarativeCompositeTypeData *data)
{
url = data->imports.baseUrl();
- QmlCompiledData *c = data->toCompiledComponent(engine);
+ QDeclarativeCompiledData *c = data->toCompiledComponent(engine);
if (!c) {
- Q_ASSERT(data->status == QmlCompositeTypeData::Error);
+ Q_ASSERT(data->status == QDeclarativeCompositeTypeData::Error);
state.errors = data->errors;
@@ -174,7 +174,7 @@ void QmlComponentPrivate::fromTypeData(QmlCompositeTypeData *data)
data->release();
}
-void QmlComponentPrivate::clear()
+void QDeclarativeComponentPrivate::clear()
{
if (typeData) {
typeData->remWaiter(this);
@@ -191,20 +191,20 @@ void QmlComponentPrivate::clear()
/*!
\internal
*/
-QmlComponent::QmlComponent(QObject *parent)
- : QObject(*(new QmlComponentPrivate), parent)
+QDeclarativeComponent::QDeclarativeComponent(QObject *parent)
+ : QObject(*(new QDeclarativeComponentPrivate), parent)
{
}
/*!
- Destruct the QmlComponent.
+ Destruct the QDeclarativeComponent.
*/
-QmlComponent::~QmlComponent()
+QDeclarativeComponent::~QDeclarativeComponent()
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
if (d->state.completePending) {
- qWarning("QmlComponent: Component destroyed while completion pending");
+ qWarning("QDeclarativeComponent: Component destroyed while completion pending");
d->completeCreate();
}
@@ -217,12 +217,12 @@ QmlComponent::~QmlComponent()
}
/*!
- \property QmlComponent::status
- The component's current \l{QmlComponent::Status} {status}.
+ \property QDeclarativeComponent::status
+ The component's current \l{QDeclarativeComponent::Status} {status}.
*/
-QmlComponent::Status QmlComponent::status() const
+QDeclarativeComponent::Status QDeclarativeComponent::status() const
{
- Q_D(const QmlComponent);
+ Q_D(const QDeclarativeComponent);
if (d->typeData)
return Loading;
@@ -235,114 +235,114 @@ QmlComponent::Status QmlComponent::status() const
}
/*!
- \property QmlComponent::isNull
+ \property QDeclarativeComponent::isNull
Is true if the component is in the Null state, false otherwise.
- Equivalent to status() == QmlComponent::Null.
+ Equivalent to status() == QDeclarativeComponent::Null.
*/
-bool QmlComponent::isNull() const
+bool QDeclarativeComponent::isNull() const
{
return status() == Null;
}
/*!
- \property QmlComponent::isReady
+ \property QDeclarativeComponent::isReady
Is true if the component is in the Ready state, false otherwise.
- Equivalent to status() == QmlComponent::Ready.
+ Equivalent to status() == QDeclarativeComponent::Ready.
*/
-bool QmlComponent::isReady() const
+bool QDeclarativeComponent::isReady() const
{
return status() == Ready;
}
/*!
- \property QmlComponent::isError
+ \property QDeclarativeComponent::isError
Is true if the component is in the Error state, false otherwise.
- Equivalent to status() == QmlComponent::Error.
+ Equivalent to status() == QDeclarativeComponent::Error.
*/
-bool QmlComponent::isError() const
+bool QDeclarativeComponent::isError() const
{
return status() == Error;
}
/*!
- \property QmlComponent::isLoading
+ \property QDeclarativeComponent::isLoading
Is true if the component is in the Loading state, false otherwise.
- Equivalent to status() == QmlComponent::Loading.
+ Equivalent to status() == QDeclarativeComponent::Loading.
*/
-bool QmlComponent::isLoading() const
+bool QDeclarativeComponent::isLoading() const
{
return status() == Loading;
}
/*!
- \property QmlComponent::progress
+ \property QDeclarativeComponent::progress
The progress of loading the component, from 0.0 (nothing loaded)
to 1.0 (finished).
*/
-qreal QmlComponent::progress() const
+qreal QDeclarativeComponent::progress() const
{
- Q_D(const QmlComponent);
+ Q_D(const QDeclarativeComponent);
return d->progress;
}
/*!
- \fn void QmlComponent::progressChanged(qreal progress)
+ \fn void QDeclarativeComponent::progressChanged(qreal progress)
Emitted whenever the component's loading progress changes. \a progress will be the
current progress between 0.0 (nothing loaded) and 1.0 (finished).
*/
/*!
- \fn void QmlComponent::statusChanged(QmlComponent::Status status)
+ \fn void QDeclarativeComponent::statusChanged(QDeclarativeComponent::Status status)
Emitted whenever the component's status changes. \a status will be the
new status.
*/
/*!
- Create a QmlComponent with no data and give it the specified
+ Create a QDeclarativeComponent with no data and give it the specified
\a engine and \a parent. Set the data with setData().
*/
-QmlComponent::QmlComponent(QmlEngine *engine, QObject *parent)
- : QObject(*(new QmlComponentPrivate), parent)
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QObject *parent)
+ : QObject(*(new QDeclarativeComponentPrivate), parent)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->engine = engine;
}
/*!
- Create a QmlComponent from the given \a url and give it the
+ Create a QDeclarativeComponent from the given \a url and give it the
specified \a parent and \a engine.
\sa loadUrl()
*/
-QmlComponent::QmlComponent(QmlEngine *engine, const QUrl &url, QObject *parent)
-: QObject(*(new QmlComponentPrivate), parent)
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const QUrl &url, QObject *parent)
+: QObject(*(new QDeclarativeComponentPrivate), parent)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->engine = engine;
loadUrl(url);
}
/*!
- Create a QmlComponent from the given \a fileName and give it the specified
+ Create a QDeclarativeComponent from the given \a fileName and give it the specified
\a parent and \a engine.
\sa loadUrl()
*/
-QmlComponent::QmlComponent(QmlEngine *engine, const QString &fileName,
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, const QString &fileName,
QObject *parent)
-: QObject(*(new QmlComponentPrivate), parent)
+: QObject(*(new QDeclarativeComponentPrivate), parent)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->engine = engine;
loadUrl(QUrl::fromLocalFile(fileName));
}
@@ -350,10 +350,10 @@ QmlComponent::QmlComponent(QmlEngine *engine, const QString &fileName,
/*!
\internal
*/
-QmlComponent::QmlComponent(QmlEngine *engine, QmlCompiledData *cc, int start, int count, QObject *parent)
- : QObject(*(new QmlComponentPrivate), parent)
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeEngine *engine, QDeclarativeCompiledData *cc, int start, int count, QObject *parent)
+ : QObject(*(new QDeclarativeComponentPrivate), parent)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->engine = engine;
d->cc = cc;
cc->addref();
@@ -364,23 +364,23 @@ QmlComponent::QmlComponent(QmlEngine *engine, QmlCompiledData *cc, int start, in
}
/*!
- Sets the QmlComponent to use the given QML \a data. If \a url
+ Sets the QDeclarativeComponent to use the given QML \a data. If \a url
is provided, it is used to set the component name and to provide
a base path for items resolved by this component.
*/
-void QmlComponent::setData(const QByteArray &data, const QUrl &url)
+void QDeclarativeComponent::setData(const QByteArray &data, const QUrl &url)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->clear();
d->url = url;
- QmlCompositeTypeData *typeData =
- QmlEnginePrivate::get(d->engine)->typeManager.getImmediate(data, url);
+ QDeclarativeCompositeTypeData *typeData =
+ QDeclarativeEnginePrivate::get(d->engine)->typeManager.getImmediate(data, url);
- if (typeData->status == QmlCompositeTypeData::Waiting
- || typeData->status == QmlCompositeTypeData::WaitingResources)
+ if (typeData->status == QDeclarativeCompositeTypeData::Waiting
+ || typeData->status == QDeclarativeCompositeTypeData::WaitingResources)
{
d->typeData = typeData;
d->typeData->addWaiter(d);
@@ -397,15 +397,15 @@ void QmlComponent::setData(const QByteArray &data, const QUrl &url)
}
/*!
-Returns the QmlContext the component was created in. This is only
+Returns the QDeclarativeContext the component was created in. This is only
valid for components created directly from QML.
*/
-QmlContext *QmlComponent::creationContext() const
+QDeclarativeContext *QDeclarativeComponent::creationContext() const
{
- Q_D(const QmlComponent);
+ Q_D(const QDeclarativeComponent);
if(d->creationContext)
return d->creationContext;
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(this);
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(this);
if (ddata)
return ddata->context;
else
@@ -414,21 +414,21 @@ QmlContext *QmlComponent::creationContext() const
/*!
\internal
- Sets the QmlContext the component was created in. This is only
+ Sets the QDeclarativeContext the component was created in. This is only
desirable for components created in QML script.
*/
-void QmlComponent::setCreationContext(QmlContext* c)
+void QDeclarativeComponent::setCreationContext(QDeclarativeContext* c)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->creationContext = c;
}
/*!
- Load the QmlComponent from the provided \a url.
+ Load the QDeclarativeComponent from the provided \a url.
*/
-void QmlComponent::loadUrl(const QUrl &url)
+void QDeclarativeComponent::loadUrl(const QUrl &url)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->clear();
@@ -437,11 +437,11 @@ void QmlComponent::loadUrl(const QUrl &url)
else
d->url = url;
- QmlCompositeTypeData *data =
- QmlEnginePrivate::get(d->engine)->typeManager.get(d->url);
+ QDeclarativeCompositeTypeData *data =
+ QDeclarativeEnginePrivate::get(d->engine)->typeManager.get(d->url);
- if (data->status == QmlCompositeTypeData::Waiting
- || data->status == QmlCompositeTypeData::WaitingResources)
+ if (data->status == QDeclarativeCompositeTypeData::Waiting
+ || data->status == QDeclarativeCompositeTypeData::WaitingResources)
{
d->typeData = data;
d->typeData->addWaiter(d);
@@ -459,26 +459,26 @@ void QmlComponent::loadUrl(const QUrl &url)
Return the list of errors that occured during the last compile or create
operation. An empty list is returned if isError() is not set.
*/
-QList<QmlError> QmlComponent::errors() const
+QList<QDeclarativeError> QDeclarativeComponent::errors() const
{
- Q_D(const QmlComponent);
+ Q_D(const QDeclarativeComponent);
if (isError())
return d->state.errors;
else
- return QList<QmlError>();
+ return QList<QDeclarativeError>();
}
/*!
\internal
errorsString is only meant as a way to get the errors in script
*/
-QString QmlComponent::errorsString() const
+QString QDeclarativeComponent::errorsString() const
{
- Q_D(const QmlComponent);
+ Q_D(const QDeclarativeComponent);
QString ret;
if(!isError())
return ret;
- foreach(const QmlError &e, d->state.errors) {
+ foreach(const QDeclarativeError &e, d->state.errors) {
ret += e.url().toString() + QLatin1Char(':') +
QString::number(e.line()) + QLatin1Char(' ') +
e.description() + QLatin1Char('\n');
@@ -487,20 +487,20 @@ QString QmlComponent::errorsString() const
}
/*!
- \property QmlComponent::url
+ \property QDeclarativeComponent::url
The component URL. This is the URL passed to either the constructor,
or the loadUrl() or setData() methods.
*/
-QUrl QmlComponent::url() const
+QUrl QDeclarativeComponent::url() const
{
- Q_D(const QmlComponent);
+ Q_D(const QDeclarativeComponent);
return d->url;
}
/*!
\internal
*/
-QmlComponent::QmlComponent(QmlComponentPrivate &dd, QObject *parent)
+QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject *parent)
: QObject(dd, parent)
{
}
@@ -510,16 +510,16 @@ QmlComponent::QmlComponent(QmlComponentPrivate &dd, QObject *parent)
\internal
A version of create which returns a scriptObject, for use in script
*/
-QScriptValue QmlComponent::createObject()
+QScriptValue QDeclarativeComponent::createObject()
{
- Q_D(QmlComponent);
- QmlContext* ctxt = creationContext();
+ Q_D(QDeclarativeComponent);
+ QDeclarativeContext* ctxt = creationContext();
if(!ctxt){
qWarning() << QLatin1String("createObject can only be used in QML");
return QScriptValue();
}
QObject* ret = create(ctxt);
- return QmlEnginePrivate::qmlScriptObject(ret, d->engine);
+ return QDeclarativeEnginePrivate::qmlScriptObject(ret, d->engine);
}
/*!
@@ -528,23 +528,23 @@ QScriptValue QmlComponent::createObject()
instance.
If \a context is 0 (the default), it will create the instance in the
- engine' s \l {QmlEngine::rootContext()}{root context}.
+ engine' s \l {QDeclarativeEngine::rootContext()}{root context}.
*/
-QObject *QmlComponent::create(QmlContext *context)
+QObject *QDeclarativeComponent::create(QDeclarativeContext *context)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
return d->create(context, QBitField());
}
-QObject *QmlComponentPrivate::create(QmlContext *context,
+QObject *QDeclarativeComponentPrivate::create(QDeclarativeContext *context,
const QBitField &bindings)
{
if (!context)
context = engine->rootContext();
if (context->engine() != engine) {
- qWarning("QmlComponent::create(): Must create component in context from the same QmlEngine");
+ qWarning("QDeclarativeComponent::create(): Must create component in context from the same QDeclarativeEngine");
return 0;
}
@@ -555,70 +555,70 @@ QObject *QmlComponentPrivate::create(QmlContext *context,
/*!
This method provides more advanced control over component instance creation.
- In general, programmers should use QmlComponent::create() to create a
+ In general, programmers should use QDeclarativeComponent::create() to create a
component.
Create an object instance from this component. Returns 0 if creation
failed. \a context specifies the context within which to create the object
instance.
- When QmlComponent constructs an instance, it occurs in three steps:
+ When QDeclarativeComponent constructs an instance, it occurs in three steps:
\list 1
\i The object hierarchy is created, and constant values are assigned.
\i Property bindings are evaluated for the the first time.
- \i If applicable, QmlParserStatus::componentComplete() is called on objects.
+ \i If applicable, QDeclarativeParserStatus::componentComplete() is called on objects.
\endlist
- QmlComponent::beginCreate() differs from QmlComponent::create() in that it
- only performs step 1. QmlComponent::completeCreate() must be called to
+ QDeclarativeComponent::beginCreate() differs from QDeclarativeComponent::create() in that it
+ only performs step 1. QDeclarativeComponent::completeCreate() must be called to
complete steps 2 and 3.
This breaking point is sometimes useful when using attached properties to
communicate information to an instantiated component, as it allows their
initial values to be configured before property bindings take effect.
*/
-QObject *QmlComponent::beginCreate(QmlContext *context)
+QObject *QDeclarativeComponent::beginCreate(QDeclarativeContext *context)
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
return d->beginCreate(context, QBitField());
}
QObject *
-QmlComponentPrivate::beginCreate(QmlContext *context, const QBitField &bindings)
+QDeclarativeComponentPrivate::beginCreate(QDeclarativeContext *context, const QBitField &bindings)
{
- Q_Q(QmlComponent);
+ Q_Q(QDeclarativeComponent);
if (!context) {
- qWarning("QmlComponent::beginCreate(): Cannot create a component in a null context");
+ qWarning("QDeclarativeComponent::beginCreate(): Cannot create a component in a null context");
return 0;
}
if (context->engine() != engine) {
- qWarning("QmlComponent::beginCreate(): Must create component in context from the same QmlEngine");
+ qWarning("QDeclarativeComponent::beginCreate(): Must create component in context from the same QDeclarativeEngine");
return 0;
}
if (state.completePending) {
- qWarning("QmlComponent: Cannot create new component instance before completing the previous");
+ qWarning("QDeclarativeComponent: Cannot create new component instance before completing the previous");
return 0;
}
if (!q->isReady()) {
- qWarning("QmlComponent: Component is not ready");
+ qWarning("QDeclarativeComponent: Component is not ready");
return 0;
}
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
- QmlContextPrivate *contextPriv =
- static_cast<QmlContextPrivate *>(QObjectPrivate::get(context));
- QmlContext *ctxt = new QmlContext(context, 0, true);
- static_cast<QmlContextPrivate*>(ctxt->d_func())->url = cc->url;
- static_cast<QmlContextPrivate*>(ctxt->d_func())->imports = cc->importCache;
+ QDeclarativeContextPrivate *contextPriv =
+ static_cast<QDeclarativeContextPrivate *>(QObjectPrivate::get(context));
+ QDeclarativeContext *ctxt = new QDeclarativeContext(context, 0, true);
+ static_cast<QDeclarativeContextPrivate*>(ctxt->d_func())->url = cc->url;
+ static_cast<QDeclarativeContextPrivate*>(ctxt->d_func())->imports = cc->importCache;
cc->importCache->addref();
QObject *rv = begin(ctxt, ep, cc, start, count, &state, bindings);
if (rv) {
- QmlGraphics_setParent_noEvent(ctxt, rv);
+ QDeclarativeGraphics_setParent_noEvent(ctxt, rv);
} else {
delete ctxt;
}
@@ -628,14 +628,14 @@ QmlComponentPrivate::beginCreate(QmlContext *context, const QBitField &bindings)
return rv;
}
-QObject * QmlComponentPrivate::begin(QmlContext *ctxt, QmlEnginePrivate *enginePriv,
- QmlCompiledData *component, int start, int count,
+QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContext *ctxt, QDeclarativeEnginePrivate *enginePriv,
+ QDeclarativeCompiledData *component, int start, int count,
ConstructionState *state, const QBitField &bindings)
{
bool isRoot = !enginePriv->inBeginCreate;
enginePriv->inBeginCreate = true;
- QmlVME vme;
+ QDeclarativeVME vme;
QObject *rv = vme.run(ctxt, component, start, count, bindings);
if (vme.isError())
@@ -660,13 +660,13 @@ QObject * QmlComponentPrivate::begin(QmlContext *ctxt, QmlEnginePrivate *engineP
return rv;
}
-void QmlComponentPrivate::beginDeferred(QmlContext *, QmlEnginePrivate *enginePriv,
+void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeContext *, QDeclarativeEnginePrivate *enginePriv,
QObject *object, ConstructionState *state)
{
bool isRoot = !enginePriv->inBeginCreate;
enginePriv->inBeginCreate = true;
- QmlVME vme;
+ QDeclarativeVME vme;
vme.runDeferred(object);
if (vme.isError())
@@ -689,37 +689,37 @@ void QmlComponentPrivate::beginDeferred(QmlContext *, QmlEnginePrivate *enginePr
}
}
-void QmlComponentPrivate::complete(QmlEnginePrivate *enginePriv, ConstructionState *state)
+void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state)
{
if (state->completePending) {
for (int ii = 0; ii < state->bindValues.count(); ++ii) {
- QmlEnginePrivate::SimpleList<QmlAbstractBinding> bv =
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> bv =
state->bindValues.at(ii);
for (int jj = 0; jj < bv.count; ++jj) {
if(bv.at(jj))
- bv.at(jj)->setEnabled(true, QmlMetaProperty::BypassInterceptor |
- QmlMetaProperty::DontRemoveBinding);
+ bv.at(jj)->setEnabled(true, QDeclarativeMetaProperty::BypassInterceptor |
+ QDeclarativeMetaProperty::DontRemoveBinding);
}
- QmlEnginePrivate::clear(bv);
+ QDeclarativeEnginePrivate::clear(bv);
}
for (int ii = 0; ii < state->parserStatus.count(); ++ii) {
- QmlEnginePrivate::SimpleList<QmlParserStatus> ps =
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> ps =
state->parserStatus.at(ii);
for (int jj = ps.count - 1; jj >= 0; --jj) {
- QmlParserStatus *status = ps.at(jj);
+ QDeclarativeParserStatus *status = ps.at(jj);
if (status && status->d) {
status->d = 0;
status->componentComplete();
}
}
- QmlEnginePrivate::clear(ps);
+ QDeclarativeEnginePrivate::clear(ps);
}
while (state->componentAttacheds) {
- QmlComponentAttached *a = state->componentAttacheds;
+ QDeclarativeComponentAttached *a = state->componentAttacheds;
if (a->next) a->next->prev = &state->componentAttacheds;
state->componentAttacheds = a->next;
a->prev = 0; a->next = 0;
@@ -742,31 +742,31 @@ void QmlComponentPrivate::complete(QmlEnginePrivate *enginePriv, ConstructionSta
/*!
This method provides more advanced control over component instance creation.
- In general, programmers should use QmlComponent::create() to create a
+ In general, programmers should use QDeclarativeComponent::create() to create a
component.
- Complete a component creation begin with QmlComponent::beginCreate().
+ Complete a component creation begin with QDeclarativeComponent::beginCreate().
*/
-void QmlComponent::completeCreate()
+void QDeclarativeComponent::completeCreate()
{
- Q_D(QmlComponent);
+ Q_D(QDeclarativeComponent);
d->completeCreate();
}
-void QmlComponentPrivate::completeCreate()
+void QDeclarativeComponentPrivate::completeCreate()
{
if (state.completePending) {
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
complete(ep, &state);
}
}
-QmlComponentAttached::QmlComponentAttached(QObject *parent)
+QDeclarativeComponentAttached::QDeclarativeComponentAttached(QObject *parent)
: QObject(parent), prev(0), next(0)
{
}
-QmlComponentAttached::~QmlComponentAttached()
+QDeclarativeComponentAttached::~QDeclarativeComponentAttached()
{
if (prev) *prev = next;
if (next) next->prev = prev;
@@ -777,15 +777,15 @@ QmlComponentAttached::~QmlComponentAttached()
/*!
\internal
*/
-QmlComponentAttached *QmlComponent::qmlAttachedProperties(QObject *obj)
+QDeclarativeComponentAttached *QDeclarativeComponent::qmlAttachedProperties(QObject *obj)
{
- QmlComponentAttached *a = new QmlComponentAttached(obj);
+ QDeclarativeComponentAttached *a = new QDeclarativeComponentAttached(obj);
- QmlEngine *engine = qmlEngine(obj);
- if (!engine || !QmlEnginePrivate::get(engine)->inBeginCreate)
+ QDeclarativeEngine *engine = qmlEngine(obj);
+ if (!engine || !QDeclarativeEnginePrivate::get(engine)->inBeginCreate)
return a;
- QmlEnginePrivate *p = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *p = QDeclarativeEnginePrivate::get(engine);
a->next = p->componentAttacheds;
a->prev = &p->componentAttacheds;
diff --git a/src/declarative/qml/qmlcomponent.h b/src/declarative/qml/qdeclarativecomponent.h
index 8996481..aec0480 100644
--- a/src/declarative/qml/qmlcomponent.h
+++ b/src/declarative/qml/qdeclarativecomponent.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#ifndef QMLCOMPONENT_H
-#define QMLCOMPONENT_H
+#ifndef QDECLARATIVECOMPONENT_H
+#define QDECLARATIVECOMPONENT_H
-#include "qml.h"
-#include "qmlerror.h"
+#include "qdeclarative.h"
+#include "qdeclarativeerror.h"
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
@@ -55,15 +55,15 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlCompiledData;
+class QDeclarativeCompiledData;
class QByteArray;
-class QmlComponentPrivate;
-class QmlEngine;
-class QmlComponentAttached;
-class Q_DECLARATIVE_EXPORT QmlComponent : public QObject
+class QDeclarativeComponentPrivate;
+class QDeclarativeEngine;
+class QDeclarativeComponentAttached;
+class Q_DECLARATIVE_EXPORT QDeclarativeComponent : public QObject
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QmlComponent)
+ Q_DECLARE_PRIVATE(QDeclarativeComponent)
Q_PROPERTY(bool isNull READ isNull NOTIFY statusChanged)
Q_PROPERTY(bool isReady READ isReady NOTIFY statusChanged)
Q_PROPERTY(bool isError READ isError NOTIFY statusChanged)
@@ -73,11 +73,11 @@ class Q_DECLARATIVE_EXPORT QmlComponent : public QObject
Q_PROPERTY(QUrl url READ url CONSTANT)
public:
- QmlComponent(QObject *parent = 0);
- QmlComponent(QmlEngine *, QObject *parent=0);
- QmlComponent(QmlEngine *, const QString &fileName, QObject *parent = 0);
- QmlComponent(QmlEngine *, const QUrl &url, QObject *parent = 0);
- virtual ~QmlComponent();
+ QDeclarativeComponent(QObject *parent = 0);
+ QDeclarativeComponent(QDeclarativeEngine *, QObject *parent=0);
+ QDeclarativeComponent(QDeclarativeEngine *, const QString &fileName, QObject *parent = 0);
+ QDeclarativeComponent(QDeclarativeEngine *, const QUrl &url, QObject *parent = 0);
+ virtual ~QDeclarativeComponent();
Q_ENUMS(Status)
enum Status { Null, Ready, Loading, Error };
@@ -88,15 +88,15 @@ public:
bool isError() const;
bool isLoading() const;
- QList<QmlError> errors() const;
+ QList<QDeclarativeError> errors() const;
Q_INVOKABLE QString errorsString() const;
qreal progress() const;
QUrl url() const;
- virtual QObject *create(QmlContext *context = 0);
- virtual QObject *beginCreate(QmlContext *);
+ virtual QObject *create(QDeclarativeContext *context = 0);
+ virtual QObject *beginCreate(QDeclarativeContext *);
virtual void completeCreate();
Q_INVOKABLE QScriptValue createObject();
@@ -104,31 +104,31 @@ public:
void loadUrl(const QUrl &url);
void setData(const QByteArray &, const QUrl &baseUrl);
- void setCreationContext(QmlContext*);
- QmlContext *creationContext() const;
+ void setCreationContext(QDeclarativeContext*);
+ QDeclarativeContext *creationContext() const;
- static QmlComponentAttached *qmlAttachedProperties(QObject *);
+ static QDeclarativeComponentAttached *qmlAttachedProperties(QObject *);
Q_SIGNALS:
- void statusChanged(QmlComponent::Status);
+ void statusChanged(QDeclarativeComponent::Status);
void progressChanged(qreal);
protected:
- QmlComponent(QmlComponentPrivate &dd, QObject* parent);
+ QDeclarativeComponent(QDeclarativeComponentPrivate &dd, QObject* parent);
private:
- QmlComponent(QmlEngine *, QmlCompiledData *, int, int, QObject *parent);
+ QDeclarativeComponent(QDeclarativeEngine *, QDeclarativeCompiledData *, int, int, QObject *parent);
- friend class QmlVME;
- friend class QmlCompositeTypeData;
+ friend class QDeclarativeVME;
+ friend class QDeclarativeCompositeTypeData;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QmlComponent::Status)
-QML_DECLARE_TYPE(QmlComponent)
-QML_DECLARE_TYPEINFO(QmlComponent, QML_HAS_ATTACHED_PROPERTIES)
+Q_DECLARE_METATYPE(QDeclarativeComponent::Status)
+QML_DECLARE_TYPE(QDeclarativeComponent)
+QML_DECLARE_TYPEINFO(QDeclarativeComponent, QML_HAS_ATTACHED_PROPERTIES)
QT_END_HEADER
-#endif // QMLCOMPONENT_H
+#endif // QDECLARATIVECOMPONENT_H
diff --git a/src/declarative/qml/qmlcomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h
index b7a3038..3155813 100644
--- a/src/declarative/qml/qmlcomponent_p.h
+++ b/src/declarative/qml/qdeclarativecomponent_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCOMPONENT_P_H
-#define QMLCOMPONENT_P_H
+#ifndef QDECLARATIVECOMPONENT_P_H
+#define QDECLARATIVECOMPONENT_P_H
//
// W A R N I N G
@@ -53,13 +53,13 @@
// We mean it.
//
-#include "qmlcomponent.h"
+#include "qdeclarativecomponent.h"
-#include "qmlengine_p.h"
-#include "qmlcompositetypemanager_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativecompositetypemanager_p.h"
#include "qbitfield_p.h"
-#include "qmlerror.h"
-#include "qml.h"
+#include "qdeclarativeerror.h"
+#include "qdeclarative.h"
#include <QtCore/QString>
#include <QtCore/QStringList>
@@ -69,79 +69,79 @@
QT_BEGIN_NAMESPACE
-class QmlComponent;
-class QmlEngine;
-class QmlCompiledData;
+class QDeclarativeComponent;
+class QDeclarativeEngine;
+class QDeclarativeCompiledData;
-class QmlComponentAttached;
-class QmlComponentPrivate : public QObjectPrivate
+class QDeclarativeComponentAttached;
+class QDeclarativeComponentPrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QmlComponent)
+ Q_DECLARE_PUBLIC(QDeclarativeComponent)
public:
- QmlComponentPrivate() : typeData(0), progress(0.), start(-1), count(-1), cc(0), engine(0), creationContext(0) {}
+ QDeclarativeComponentPrivate() : typeData(0), progress(0.), start(-1), count(-1), cc(0), engine(0), creationContext(0) {}
- QObject *create(QmlContext *context, const QBitField &);
- QObject *beginCreate(QmlContext *, const QBitField &);
+ QObject *create(QDeclarativeContext *context, const QBitField &);
+ QObject *beginCreate(QDeclarativeContext *, const QBitField &);
void completeCreate();
- QmlCompositeTypeData *typeData;
+ QDeclarativeCompositeTypeData *typeData;
void typeDataReady();
void updateProgress(qreal);
- void fromTypeData(QmlCompositeTypeData *data);
+ void fromTypeData(QDeclarativeCompositeTypeData *data);
QUrl url;
qreal progress;
int start;
int count;
- QmlCompiledData *cc;
+ QDeclarativeCompiledData *cc;
struct ConstructionState {
ConstructionState() : componentAttacheds(0), completePending(false) {}
- QList<QmlEnginePrivate::SimpleList<QmlAbstractBinding> > bindValues;
- QList<QmlEnginePrivate::SimpleList<QmlParserStatus> > parserStatus;
- QmlComponentAttached *componentAttacheds;
- QList<QmlError> errors;
+ QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> > bindValues;
+ QList<QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> > parserStatus;
+ QDeclarativeComponentAttached *componentAttacheds;
+ QList<QDeclarativeError> errors;
bool completePending;
};
ConstructionState state;
- static QObject *begin(QmlContext *ctxt, QmlEnginePrivate *enginePriv,
- QmlCompiledData *component, int start, int count,
+ static QObject *begin(QDeclarativeContext *ctxt, QDeclarativeEnginePrivate *enginePriv,
+ QDeclarativeCompiledData *component, int start, int count,
ConstructionState *state, const QBitField &bindings = QBitField());
- static void beginDeferred(QmlContext *ctxt, QmlEnginePrivate *enginePriv,
+ static void beginDeferred(QDeclarativeContext *ctxt, QDeclarativeEnginePrivate *enginePriv,
QObject *object, ConstructionState *state);
- static void complete(QmlEnginePrivate *enginePriv, ConstructionState *state);
+ static void complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state);
- QmlEngine *engine;
- QmlContext *creationContext;
+ QDeclarativeEngine *engine;
+ QDeclarativeContext *creationContext;
void clear();
- static QmlComponentPrivate *get(QmlComponent *c) {
- return static_cast<QmlComponentPrivate *>(QObjectPrivate::get(c));
+ static QDeclarativeComponentPrivate *get(QDeclarativeComponent *c) {
+ return static_cast<QDeclarativeComponentPrivate *>(QObjectPrivate::get(c));
}
};
-class QmlComponentAttached : public QObject
+class QDeclarativeComponentAttached : public QObject
{
Q_OBJECT
public:
- QmlComponentAttached(QObject *parent = 0);
- ~QmlComponentAttached();
+ QDeclarativeComponentAttached(QObject *parent = 0);
+ ~QDeclarativeComponentAttached();
- QmlComponentAttached **prev;
- QmlComponentAttached *next;
+ QDeclarativeComponentAttached **prev;
+ QDeclarativeComponentAttached *next;
Q_SIGNALS:
void completed();
private:
- friend class QmlComponentPrivate;
+ friend class QDeclarativeComponentPrivate;
};
QT_END_NAMESPACE
-#endif // QMLCOMPONENT_P_H
+#endif // QDECLARATIVECOMPONENT_P_H
diff --git a/src/declarative/qml/qmlcompositetypedata_p.h b/src/declarative/qml/qdeclarativecompositetypedata_p.h
index 342c88a..fb26af9 100644
--- a/src/declarative/qml/qmlcompositetypedata_p.h
+++ b/src/declarative/qml/qdeclarativecompositetypedata_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCOMPOSITETYPEDATA_P_H
-#define QMLCOMPOSITETYPEDATA_P_H
+#ifndef QDECLARATIVECOMPOSITETYPEDATA_P_H
+#define QDECLARATIVECOMPOSITETYPEDATA_P_H
//
// W A R N I N G
@@ -53,18 +53,18 @@
// We mean it.
//
-#include "qmlengine_p.h"
+#include "qdeclarativeengine_p.h"
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
-class QmlCompositeTypeResource;
-class QmlCompositeTypeData : public QmlRefCount
+class QDeclarativeCompositeTypeResource;
+class QDeclarativeCompositeTypeData : public QDeclarativeRefCount
{
public:
- QmlCompositeTypeData();
- virtual ~QmlCompositeTypeData();
+ QDeclarativeCompositeTypeData();
+ virtual ~QDeclarativeCompositeTypeData();
enum Status {
Invalid,
@@ -81,56 +81,56 @@ public:
};
ErrorType errorType;
- QList<QmlError> errors;
+ QList<QDeclarativeError> errors;
- QmlEnginePrivate::Imports imports;
+ QDeclarativeEnginePrivate::Imports imports;
- QList<QmlCompositeTypeData *> dependants;
+ QList<QDeclarativeCompositeTypeData *> dependants;
- // Return a QmlComponent if the QmlCompositeTypeData is not in the Waiting
- // state. The QmlComponent is owned by the QmlCompositeTypeData, so a
- // reference should be kept to keep the QmlComponent alive.
- QmlComponent *toComponent(QmlEngine *);
- // Return a QmlCompiledData if possible, or 0 if an error
+ // Return a QDeclarativeComponent if the QDeclarativeCompositeTypeData is not in the Waiting
+ // state. The QDeclarativeComponent is owned by the QDeclarativeCompositeTypeData, so a
+ // reference should be kept to keep the QDeclarativeComponent alive.
+ QDeclarativeComponent *toComponent(QDeclarativeEngine *);
+ // Return a QDeclarativeCompiledData if possible, or 0 if an error
// occurs
- QmlCompiledData *toCompiledComponent(QmlEngine *);
+ QDeclarativeCompiledData *toCompiledComponent(QDeclarativeEngine *);
struct TypeReference
{
TypeReference();
- QmlType *type;
- QmlCompositeTypeData *unit;
+ QDeclarativeType *type;
+ QDeclarativeCompositeTypeData *unit;
};
QList<TypeReference> types;
- QList<QmlCompositeTypeResource *> resources;
+ QList<QDeclarativeCompositeTypeResource *> resources;
- // Add or remove p as a waiter. When the QmlCompositeTypeData becomes
- // ready, the QmlComponentPrivate::typeDataReady() method will be invoked on
+ // Add or remove p as a waiter. When the QDeclarativeCompositeTypeData becomes
+ // ready, the QDeclarativeComponentPrivate::typeDataReady() method will be invoked on
// p. The waiter is automatically removed when the typeDataReady() method
// is invoked, so there is no need to call remWaiter() in this case.
- void addWaiter(QmlComponentPrivate *p);
- void remWaiter(QmlComponentPrivate *p);
+ void addWaiter(QDeclarativeComponentPrivate *p);
+ void remWaiter(QDeclarativeComponentPrivate *p);
qreal progress;
private:
- friend class QmlCompositeTypeManager;
- friend class QmlCompiler;
- friend class QmlDomDocument;
-
- QmlScriptParser data;
- QList<QmlComponentPrivate *> waiters;
- QmlComponent *component;
- QmlCompiledData *compiledComponent;
+ friend class QDeclarativeCompositeTypeManager;
+ friend class QDeclarativeCompiler;
+ friend class QDeclarativeDomDocument;
+
+ QDeclarativeScriptParser data;
+ QList<QDeclarativeComponentPrivate *> waiters;
+ QDeclarativeComponent *component;
+ QDeclarativeCompiledData *compiledComponent;
};
-class QmlCompositeTypeResource : public QmlRefCount
+class QDeclarativeCompositeTypeResource : public QDeclarativeRefCount
{
public:
- QmlCompositeTypeResource();
- virtual ~QmlCompositeTypeResource();
+ QDeclarativeCompositeTypeResource();
+ virtual ~QDeclarativeCompositeTypeResource();
enum Status {
Invalid,
@@ -140,7 +140,7 @@ public:
};
Status status;
- QList<QmlCompositeTypeData *> dependants;
+ QList<QDeclarativeCompositeTypeData *> dependants;
QString url;
QByteArray data;
@@ -148,5 +148,5 @@ public:
QT_END_NAMESPACE
-#endif // QMLCOMPOSITETYPEDATA_P_H
+#endif // QDECLARATIVECOMPOSITETYPEDATA_P_H
diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
index 71d6f16..b90a598 100644
--- a/src/declarative/qml/qmlcompositetypemanager.cpp
+++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include "qmlcompositetypemanager_p.h"
+#include "qdeclarativecompositetypemanager_p.h"
-#include "qmlcompositetypedata_p.h"
-#include "qmlscriptparser_p.h"
-#include "qmlengine.h"
-#include "qmlengine_p.h"
-#include "qmlcomponent.h"
-#include "qmlcomponent_p.h"
-#include "qmlcompiler_p.h"
+#include "qdeclarativecompositetypedata_p.h"
+#include "qdeclarativescriptparser_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativecomponent.h"
+#include "qdeclarativecomponent_p.h"
+#include "qdeclarativecompiler_p.h"
#include <QtNetwork/qnetworkreply.h>
#include <QtCore/qdebug.h>
@@ -62,12 +62,12 @@ inline uint qHash(const QUrl &uri)
}
#endif
-QmlCompositeTypeData::QmlCompositeTypeData()
+QDeclarativeCompositeTypeData::QDeclarativeCompositeTypeData()
: status(Invalid), errorType(NoError), component(0), compiledComponent(0)
{
}
-QmlCompositeTypeData::~QmlCompositeTypeData()
+QDeclarativeCompositeTypeData::~QDeclarativeCompositeTypeData()
{
for (int ii = 0; ii < dependants.count(); ++ii)
dependants.at(ii)->release();
@@ -82,36 +82,36 @@ QmlCompositeTypeData::~QmlCompositeTypeData()
delete component;
}
-QmlCompositeTypeResource::QmlCompositeTypeResource()
+QDeclarativeCompositeTypeResource::QDeclarativeCompositeTypeResource()
{
}
-QmlCompositeTypeResource::~QmlCompositeTypeResource()
+QDeclarativeCompositeTypeResource::~QDeclarativeCompositeTypeResource()
{
for (int ii = 0; ii < dependants.count(); ++ii)
dependants.at(ii)->release();
}
-void QmlCompositeTypeData::addWaiter(QmlComponentPrivate *p)
+void QDeclarativeCompositeTypeData::addWaiter(QDeclarativeComponentPrivate *p)
{
waiters << p;
}
-void QmlCompositeTypeData::remWaiter(QmlComponentPrivate *p)
+void QDeclarativeCompositeTypeData::remWaiter(QDeclarativeComponentPrivate *p)
{
waiters.removeAll(p);
}
-QmlComponent *QmlCompositeTypeData::toComponent(QmlEngine *engine)
+QDeclarativeComponent *QDeclarativeCompositeTypeData::toComponent(QDeclarativeEngine *engine)
{
if (!component) {
- QmlCompiledData *cc = toCompiledComponent(engine);
+ QDeclarativeCompiledData *cc = toCompiledComponent(engine);
if (cc) {
- component = new QmlComponent(engine, cc, -1, -1, 0);
+ component = new QDeclarativeComponent(engine, cc, -1, -1, 0);
cc->release();
} else {
- component = new QmlComponent(engine, 0);
+ component = new QDeclarativeComponent(engine, 0);
component->d_func()->url = imports.baseUrl();
component->d_func()->state.errors = errors;
}
@@ -121,16 +121,16 @@ QmlComponent *QmlCompositeTypeData::toComponent(QmlEngine *engine)
return component;
}
-QmlCompiledData *
-QmlCompositeTypeData::toCompiledComponent(QmlEngine *engine)
+QDeclarativeCompiledData *
+QDeclarativeCompositeTypeData::toCompiledComponent(QDeclarativeEngine *engine)
{
if (status == Complete && !compiledComponent) {
- compiledComponent = new QmlCompiledData(engine);
+ compiledComponent = new QDeclarativeCompiledData(engine);
compiledComponent->url = imports.baseUrl();
compiledComponent->name = compiledComponent->url.toString();
- QmlCompiler compiler;
+ QDeclarativeCompiler compiler;
if (!compiler.compile(engine, this, compiledComponent)) {
status = Error;
errors = compiler.errors();
@@ -148,17 +148,17 @@ QmlCompositeTypeData::toCompiledComponent(QmlEngine *engine)
return compiledComponent;
}
-QmlCompositeTypeData::TypeReference::TypeReference()
+QDeclarativeCompositeTypeData::TypeReference::TypeReference()
: type(0), unit(0)
{
}
-QmlCompositeTypeManager::QmlCompositeTypeManager(QmlEngine *e)
+QDeclarativeCompositeTypeManager::QDeclarativeCompositeTypeManager(QDeclarativeEngine *e)
: engine(e)
{
}
-QmlCompositeTypeManager::~QmlCompositeTypeManager()
+QDeclarativeCompositeTypeManager::~QDeclarativeCompositeTypeManager()
{
for (Components::Iterator iter = components.begin(); iter != components.end();) {
(*iter)->release();
@@ -170,13 +170,13 @@ QmlCompositeTypeManager::~QmlCompositeTypeManager()
}
}
-QmlCompositeTypeData *QmlCompositeTypeManager::get(const QUrl &url)
+QDeclarativeCompositeTypeData *QDeclarativeCompositeTypeManager::get(const QUrl &url)
{
- QmlCompositeTypeData *unit = components.value(url);
+ QDeclarativeCompositeTypeData *unit = components.value(url);
if (!unit) {
- unit = new QmlCompositeTypeData;
- unit->status = QmlCompositeTypeData::Waiting;
+ unit = new QDeclarativeCompositeTypeData;
+ unit->status = QDeclarativeCompositeTypeData::Waiting;
unit->progress = 0.0;
unit->imports.setBaseUrl(url);
components.insert(url, unit);
@@ -188,20 +188,20 @@ QmlCompositeTypeData *QmlCompositeTypeManager::get(const QUrl &url)
return unit;
}
-QmlCompositeTypeData *
-QmlCompositeTypeManager::getImmediate(const QByteArray &data, const QUrl &url)
+QDeclarativeCompositeTypeData *
+QDeclarativeCompositeTypeManager::getImmediate(const QByteArray &data, const QUrl &url)
{
- QmlCompositeTypeData *unit = new QmlCompositeTypeData;
- unit->status = QmlCompositeTypeData::Waiting;
+ QDeclarativeCompositeTypeData *unit = new QDeclarativeCompositeTypeData;
+ unit->status = QDeclarativeCompositeTypeData::Waiting;
unit->imports.setBaseUrl(url);
setData(unit, data, url);
return unit;
}
-void QmlCompositeTypeManager::clearCache()
+void QDeclarativeCompositeTypeManager::clearCache()
{
for (Components::Iterator iter = components.begin(); iter != components.end();) {
- if ((*iter)->status != QmlCompositeTypeData::Waiting) {
+ if ((*iter)->status != QDeclarativeCompositeTypeData::Waiting) {
(*iter)->release();
iter = components.erase(iter);
} else {
@@ -210,7 +210,7 @@ void QmlCompositeTypeManager::clearCache()
}
for (Resources::Iterator iter = resources.begin(); iter != resources.end();) {
- if ((*iter)->status != QmlCompositeTypeResource::Waiting) {
+ if ((*iter)->status != QDeclarativeCompositeTypeResource::Waiting) {
(*iter)->release();
iter = resources.erase(iter);
} else {
@@ -219,11 +219,11 @@ void QmlCompositeTypeManager::clearCache()
}
}
-void QmlCompositeTypeManager::replyFinished()
+void QDeclarativeCompositeTypeManager::replyFinished()
{
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
- QmlCompositeTypeData *unit = components.value(reply->url());
+ QDeclarativeCompositeTypeData *unit = components.value(reply->url());
Q_ASSERT(unit);
if (reply->error() != QNetworkReply::NoError) {
@@ -232,11 +232,11 @@ void QmlCompositeTypeManager::replyFinished()
errorDescription = QLatin1String("Network error for URL ") +
reply->url().toString();
- unit->status = QmlCompositeTypeData::Error;
+ unit->status = QDeclarativeCompositeTypeData::Error;
// ### FIXME
- QmlError error;
+ QDeclarativeError error;
error.setDescription(errorDescription);
- unit->errorType = QmlCompositeTypeData::AccessError;
+ unit->errorType = QDeclarativeCompositeTypeData::AccessError;
unit->errors << error;
doComplete(unit);
@@ -249,20 +249,20 @@ void QmlCompositeTypeManager::replyFinished()
reply->deleteLater();
}
-void QmlCompositeTypeManager::resourceReplyFinished()
+void QDeclarativeCompositeTypeManager::resourceReplyFinished()
{
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
- QmlCompositeTypeResource *resource = resources.value(reply->url());
+ QDeclarativeCompositeTypeResource *resource = resources.value(reply->url());
Q_ASSERT(resource);
if (reply->error() != QNetworkReply::NoError) {
- resource->status = QmlCompositeTypeResource::Error;
+ resource->status = QDeclarativeCompositeTypeResource::Error;
} else {
- resource->status = QmlCompositeTypeResource::Complete;
+ resource->status = QDeclarativeCompositeTypeResource::Complete;
resource->data = reply->readAll();
}
@@ -279,7 +279,7 @@ static QString toLocalFileOrQrc(const QUrl& url)
return r;
}
-void QmlCompositeTypeManager::loadResource(QmlCompositeTypeResource *resource)
+void QDeclarativeCompositeTypeManager::loadResource(QDeclarativeCompositeTypeResource *resource)
{
QUrl url(resource->url);
@@ -289,9 +289,9 @@ void QmlCompositeTypeManager::loadResource(QmlCompositeTypeResource *resource)
QFile file(lf);
if (file.open(QFile::ReadOnly)) {
resource->data = file.readAll();
- resource->status = QmlCompositeTypeResource::Complete;
+ resource->status = QDeclarativeCompositeTypeResource::Complete;
} else {
- resource->status = QmlCompositeTypeResource::Error;
+ resource->status = QDeclarativeCompositeTypeResource::Error;
}
} else {
@@ -304,7 +304,7 @@ void QmlCompositeTypeManager::loadResource(QmlCompositeTypeResource *resource)
}
}
-void QmlCompositeTypeManager::loadSource(QmlCompositeTypeData *unit)
+void QDeclarativeCompositeTypeManager::loadSource(QDeclarativeCompositeTypeData *unit)
{
QUrl url(unit->imports.baseUrl());
@@ -319,11 +319,11 @@ void QmlCompositeTypeManager::loadSource(QmlCompositeTypeData *unit)
QString errorDescription;
// ### - Fill in error
errorDescription = QLatin1String("File error for URL ") + url.toString();
- unit->status = QmlCompositeTypeData::Error;
+ unit->status = QDeclarativeCompositeTypeData::Error;
// ### FIXME
- QmlError error;
+ QDeclarativeError error;
error.setDescription(errorDescription);
- unit->errorType = QmlCompositeTypeData::AccessError;
+ unit->errorType = QDeclarativeCompositeTypeData::AccessError;
unit->errors << error;
doComplete(unit);
}
@@ -338,22 +338,22 @@ void QmlCompositeTypeManager::loadSource(QmlCompositeTypeData *unit)
}
}
-void QmlCompositeTypeManager::requestProgress(qint64 received, qint64 total)
+void QDeclarativeCompositeTypeManager::requestProgress(qint64 received, qint64 total)
{
if (total <= 0)
return;
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
- QmlCompositeTypeData *unit = components.value(reply->url());
+ QDeclarativeCompositeTypeData *unit = components.value(reply->url());
Q_ASSERT(unit);
unit->progress = qreal(received)/total;
- foreach (QmlComponentPrivate *comp, unit->waiters)
+ foreach (QDeclarativeComponentPrivate *comp, unit->waiters)
comp->updateProgress(unit->progress);
}
-void QmlCompositeTypeManager::setData(QmlCompositeTypeData *unit,
+void QDeclarativeCompositeTypeManager::setData(QDeclarativeCompositeTypeData *unit,
const QByteArray &data,
const QUrl &url)
{
@@ -366,13 +366,13 @@ void QmlCompositeTypeManager::setData(QmlCompositeTypeData *unit,
if (ok) {
compile(unit);
} else {
- unit->status = QmlCompositeTypeData::Error;
- unit->errorType = QmlCompositeTypeData::GeneralError;
+ unit->status = QDeclarativeCompositeTypeData::Error;
+ unit->errorType = QDeclarativeCompositeTypeData::GeneralError;
doComplete(unit);
}
}
-void QmlCompositeTypeManager::doComplete(QmlCompositeTypeData *unit)
+void QDeclarativeCompositeTypeManager::doComplete(QDeclarativeCompositeTypeData *unit)
{
for (int ii = 0; ii < unit->dependants.count(); ++ii) {
checkComplete(unit->dependants.at(ii));
@@ -381,12 +381,12 @@ void QmlCompositeTypeManager::doComplete(QmlCompositeTypeData *unit)
unit->dependants.clear();
while(!unit->waiters.isEmpty()) {
- QmlComponentPrivate *p = unit->waiters.takeFirst();
+ QDeclarativeComponentPrivate *p = unit->waiters.takeFirst();
p->typeDataReady();
}
}
-void QmlCompositeTypeManager::doComplete(QmlCompositeTypeResource *resource)
+void QDeclarativeCompositeTypeManager::doComplete(QDeclarativeCompositeTypeResource *resource)
{
for (int ii = 0; ii < resource->dependants.count(); ++ii) {
checkComplete(resource->dependants.at(ii));
@@ -395,54 +395,54 @@ void QmlCompositeTypeManager::doComplete(QmlCompositeTypeResource *resource)
resource->dependants.clear();
}
-void QmlCompositeTypeManager::checkComplete(QmlCompositeTypeData *unit)
+void QDeclarativeCompositeTypeManager::checkComplete(QDeclarativeCompositeTypeData *unit)
{
- if (unit->status != QmlCompositeTypeData::Waiting
- && unit->status != QmlCompositeTypeData::WaitingResources)
+ if (unit->status != QDeclarativeCompositeTypeData::Waiting
+ && unit->status != QDeclarativeCompositeTypeData::WaitingResources)
return;
int waiting = 0;
for (int ii = 0; ii < unit->resources.count(); ++ii) {
- QmlCompositeTypeResource *r = unit->resources.at(ii);
+ QDeclarativeCompositeTypeResource *r = unit->resources.at(ii);
if (!r)
continue;
- if (r->status == QmlCompositeTypeResource::Error) {
- unit->status = QmlCompositeTypeData::Error;
- QmlError error;
+ if (r->status == QDeclarativeCompositeTypeResource::Error) {
+ unit->status = QDeclarativeCompositeTypeData::Error;
+ QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
error.setDescription(tr("Resource %1 unavailable").arg(r->url));
unit->errors << error;
doComplete(unit);
return;
- } else if (r->status == QmlCompositeTypeResource::Waiting) {
+ } else if (r->status == QDeclarativeCompositeTypeResource::Waiting) {
waiting++;
}
}
if (waiting == 0) {
- if (unit->status == QmlCompositeTypeData::WaitingResources) {
+ if (unit->status == QDeclarativeCompositeTypeData::WaitingResources) {
waiting += resolveTypes(unit);
- if (unit->status != QmlCompositeTypeData::Error) {
+ if (unit->status != QDeclarativeCompositeTypeData::Error) {
if (waiting)
- unit->status = QmlCompositeTypeData::Waiting;
+ unit->status = QDeclarativeCompositeTypeData::Waiting;
} else {
return;
}
} else {
for (int ii = 0; ii < unit->types.count(); ++ii) {
- QmlCompositeTypeData *u = unit->types.at(ii).unit;
+ QDeclarativeCompositeTypeData *u = unit->types.at(ii).unit;
if (!u)
continue;
- if (u->status == QmlCompositeTypeData::Error) {
- unit->status = QmlCompositeTypeData::Error;
+ if (u->status == QDeclarativeCompositeTypeData::Error) {
+ unit->status = QDeclarativeCompositeTypeData::Error;
unit->errors = u->errors;
doComplete(unit);
return;
- } else if (u->status == QmlCompositeTypeData::Waiting) {
+ } else if (u->status == QDeclarativeCompositeTypeData::Waiting) {
waiting++;
}
}
@@ -450,20 +450,20 @@ void QmlCompositeTypeManager::checkComplete(QmlCompositeTypeData *unit)
}
if (!waiting) {
- unit->status = QmlCompositeTypeData::Complete;
+ unit->status = QDeclarativeCompositeTypeData::Complete;
doComplete(unit);
}
}
-int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit)
+int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData *unit)
{
// not called until all resources are loaded (they include import URLs)
int waiting = 0;
- foreach (QmlScriptParser::Import imp, unit->data.imports()) {
+ foreach (QDeclarativeScriptParser::Import imp, unit->data.imports()) {
QString qmldir;
- if (imp.type == QmlScriptParser::Import::File && imp.qualifier.isEmpty()) {
+ if (imp.type == QDeclarativeScriptParser::Import::File && imp.qualifier.isEmpty()) {
QString importUrl = unit->imports.baseUrl().resolved(QUrl(imp.uri + QLatin1String("/qmldir"))).toString();
for (int ii = 0; ii < unit->resources.count(); ++ii) {
if (unit->resources.at(ii)->url == importUrl) {
@@ -486,58 +486,58 @@ int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit)
}
}
- if (!QmlEnginePrivate::get(engine)->
+ if (!QDeclarativeEnginePrivate::get(engine)->
addToImport(&unit->imports, qmldir, imp.uri, imp.qualifier, vmaj, vmin, imp.type))
{
- QmlError error;
+ QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
error.setDescription(tr("Import %1 unavailable").arg(imp.uri));
- unit->status = QmlCompositeTypeData::Error;
- unit->errorType = QmlCompositeTypeData::GeneralError;
+ unit->status = QDeclarativeCompositeTypeData::Error;
+ unit->errorType = QDeclarativeCompositeTypeData::GeneralError;
unit->errors << error;
doComplete(unit);
return 0;
}
}
- QList<QmlScriptParser::TypeReference*> types = unit->data.referencedTypes();
+ QList<QDeclarativeScriptParser::TypeReference*> types = unit->data.referencedTypes();
for (int ii = 0; ii < types.count(); ++ii) {
- QmlScriptParser::TypeReference *parserRef = types.at(ii);
+ QDeclarativeScriptParser::TypeReference *parserRef = types.at(ii);
QByteArray typeName = parserRef->name.toUtf8();
- QmlCompositeTypeData::TypeReference ref;
+ QDeclarativeCompositeTypeData::TypeReference ref;
QUrl url;
int majorVersion;
int minorVersion;
- QmlEnginePrivate::ImportedNamespace *typeNamespace = 0;
- if (!QmlEnginePrivate::get(engine)->resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion, &typeNamespace)
+ QDeclarativeEnginePrivate::ImportedNamespace *typeNamespace = 0;
+ if (!QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion, &typeNamespace)
|| typeNamespace)
{
// Known to not be a type:
// - known to be a namespace (Namespace {})
// - type with unknown namespace (UnknownNamespace.SomeType {})
- QmlError error;
+ QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
if (typeNamespace)
error.setDescription(tr("Namespace %1 cannot be used as a type").arg(QString::fromUtf8(typeName)));
else
error.setDescription(tr("%1 is not a type").arg(QString::fromUtf8(typeName)));
if (!parserRef->refObjects.isEmpty()) {
- QmlParser::Object *obj = parserRef->refObjects.first();
+ QDeclarativeParser::Object *obj = parserRef->refObjects.first();
error.setLine(obj->location.start.line);
error.setColumn(obj->location.start.column);
}
- unit->status = QmlCompositeTypeData::Error;
- unit->errorType = QmlCompositeTypeData::GeneralError;
+ unit->status = QDeclarativeCompositeTypeData::Error;
+ unit->errorType = QDeclarativeCompositeTypeData::GeneralError;
unit->errors << error;
doComplete(unit);
return 0;
}
if (ref.type) {
- foreach (QmlParser::Object *obj, parserRef->refObjects) {
+ foreach (QDeclarativeParser::Object *obj, parserRef->refObjects) {
// store namespace for DOM
obj->majorVersion = majorVersion;
obj->minorVersion = minorVersion;
@@ -546,11 +546,11 @@ int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit)
continue;
}
- QmlCompositeTypeData *urlUnit = components.value(url);
+ QDeclarativeCompositeTypeData *urlUnit = components.value(url);
if (!urlUnit) {
- urlUnit = new QmlCompositeTypeData;
- urlUnit->status = QmlCompositeTypeData::Waiting;
+ urlUnit = new QDeclarativeCompositeTypeData;
+ urlUnit->status = QDeclarativeCompositeTypeData::Waiting;
urlUnit->imports.setBaseUrl(url);
components.insert(url, urlUnit);
@@ -559,30 +559,30 @@ int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit)
ref.unit = urlUnit;
switch(urlUnit->status) {
- case QmlCompositeTypeData::Invalid:
- case QmlCompositeTypeData::Error:
- unit->status = QmlCompositeTypeData::Error;
+ case QDeclarativeCompositeTypeData::Invalid:
+ case QDeclarativeCompositeTypeData::Error:
+ unit->status = QDeclarativeCompositeTypeData::Error;
{
- QmlError error;
+ QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
error.setDescription(tr("Type %1 unavailable").arg(QString::fromUtf8(typeName)));
if (!parserRef->refObjects.isEmpty()) {
- QmlParser::Object *obj = parserRef->refObjects.first();
+ QDeclarativeParser::Object *obj = parserRef->refObjects.first();
error.setLine(obj->location.start.line);
error.setColumn(obj->location.start.column);
}
unit->errors << error;
}
- if (urlUnit->errorType != QmlCompositeTypeData::AccessError)
+ if (urlUnit->errorType != QDeclarativeCompositeTypeData::AccessError)
unit->errors << urlUnit->errors;
doComplete(unit);
return 0;
- case QmlCompositeTypeData::Complete:
+ case QDeclarativeCompositeTypeData::Complete:
break;
- case QmlCompositeTypeData::Waiting:
- case QmlCompositeTypeData::WaitingResources:
+ case QDeclarativeCompositeTypeData::Waiting:
+ case QDeclarativeCompositeTypeData::WaitingResources:
unit->addref();
ref.unit->dependants << unit;
waiting++;
@@ -595,14 +595,14 @@ int QmlCompositeTypeManager::resolveTypes(QmlCompositeTypeData *unit)
}
// ### Check ref counting in here
-void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit)
+void QDeclarativeCompositeTypeManager::compile(QDeclarativeCompositeTypeData *unit)
{
int waiting = 0;
QList<QUrl> resourceList = unit->data.referencedResources();
- foreach (QmlScriptParser::Import imp, unit->data.imports()) {
- if (imp.type == QmlScriptParser::Import::File && imp.qualifier.isEmpty()) {
+ foreach (QDeclarativeScriptParser::Import imp, unit->data.imports()) {
+ if (imp.type == QDeclarativeScriptParser::Import::File && imp.qualifier.isEmpty()) {
QUrl importUrl = unit->imports.baseUrl().resolved(QUrl(imp.uri + QLatin1String("/qmldir")));
if (toLocalFileOrQrc(importUrl).isEmpty()) {
// Import requires remote qmldir
@@ -614,11 +614,11 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit)
for (int ii = 0; ii < resourceList.count(); ++ii) {
QUrl url = unit->imports.baseUrl().resolved(resourceList.at(ii));
- QmlCompositeTypeResource *resource = resources.value(url);
+ QDeclarativeCompositeTypeResource *resource = resources.value(url);
if (!resource) {
- resource = new QmlCompositeTypeResource;
- resource->status = QmlCompositeTypeResource::Waiting;
+ resource = new QDeclarativeCompositeTypeResource;
+ resource->status = QDeclarativeCompositeTypeResource::Waiting;
resource->url = url.toString();
resources.insert(url, resource);
@@ -626,11 +626,11 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit)
}
switch(resource->status) {
- case QmlCompositeTypeResource::Invalid:
- case QmlCompositeTypeResource::Error:
- unit->status = QmlCompositeTypeData::Error;
+ case QDeclarativeCompositeTypeResource::Invalid:
+ case QDeclarativeCompositeTypeResource::Error:
+ unit->status = QDeclarativeCompositeTypeData::Error;
{
- QmlError error;
+ QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
error.setDescription(tr("Resource %1 unavailable").arg(resource->url));
unit->errors << error;
@@ -638,10 +638,10 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit)
doComplete(unit);
return;
- case QmlCompositeTypeData::Complete:
+ case QDeclarativeCompositeTypeData::Complete:
break;
- case QmlCompositeTypeData::Waiting:
+ case QDeclarativeCompositeTypeData::Waiting:
unit->addref();
resource->dependants << unit;
waiting++;
@@ -654,16 +654,16 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit)
if (waiting == 0) {
waiting += resolveTypes(unit);
- if (unit->status != QmlCompositeTypeData::Error) {
+ if (unit->status != QDeclarativeCompositeTypeData::Error) {
if (!waiting) {
- unit->status = QmlCompositeTypeData::Complete;
+ unit->status = QDeclarativeCompositeTypeData::Complete;
doComplete(unit);
} else {
- unit->status = QmlCompositeTypeData::Waiting;
+ unit->status = QDeclarativeCompositeTypeData::Waiting;
}
}
} else {
- unit->status = QmlCompositeTypeData::WaitingResources;
+ unit->status = QDeclarativeCompositeTypeData::WaitingResources;
}
}
diff --git a/src/declarative/qml/qmlcompositetypemanager_p.h b/src/declarative/qml/qdeclarativecompositetypemanager_p.h
index 2da5d34..03d16b8 100644
--- a/src/declarative/qml/qmlcompositetypemanager_p.h
+++ b/src/declarative/qml/qdeclarativecompositetypemanager_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCOMPOSITETYPEMANAGER_P_H
-#define QMLCOMPOSITETYPEMANAGER_P_H
+#ifndef QDECLARATIVECOMPOSITETYPEMANAGER_P_H
+#define QDECLARATIVECOMPOSITETYPEMANAGER_P_H
//
// W A R N I N G
@@ -53,36 +53,36 @@
// We mean it.
//
-#include "qmlscriptparser_p.h"
-#include "qmlrefcount_p.h"
-#include "qmlerror.h"
-#include "qmlengine.h"
+#include "qdeclarativescriptparser_p.h"
+#include "qdeclarativerefcount_p.h"
+#include "qdeclarativeerror.h"
+#include "qdeclarativeengine.h"
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
-class QmlCompiledData;
-class QmlComponentPrivate;
-class QmlComponent;
-class QmlDomDocument;
+class QDeclarativeCompiledData;
+class QDeclarativeComponentPrivate;
+class QDeclarativeComponent;
+class QDeclarativeDomDocument;
-class QmlCompositeTypeData;
-class QmlCompositeTypeResource;
+class QDeclarativeCompositeTypeData;
+class QDeclarativeCompositeTypeResource;
-class QmlCompositeTypeManager : public QObject
+class QDeclarativeCompositeTypeManager : public QObject
{
Q_OBJECT
public:
- QmlCompositeTypeManager(QmlEngine *);
- ~QmlCompositeTypeManager();
+ QDeclarativeCompositeTypeManager(QDeclarativeEngine *);
+ ~QDeclarativeCompositeTypeManager();
- // Return a QmlCompositeTypeData for url. The QmlCompositeTypeData may be
+ // Return a QDeclarativeCompositeTypeData for url. The QDeclarativeCompositeTypeData may be
// cached.
- QmlCompositeTypeData *get(const QUrl &url);
- // Return a QmlCompositeTypeData for data, with the provided base url. The
- // QmlCompositeTypeData will not be cached.
- QmlCompositeTypeData *getImmediate(const QByteArray &data, const QUrl &url);
+ QDeclarativeCompositeTypeData *get(const QUrl &url);
+ // Return a QDeclarativeCompositeTypeData for data, with the provided base url. The
+ // QDeclarativeCompositeTypeData will not be cached.
+ QDeclarativeCompositeTypeData *getImmediate(const QByteArray &data, const QUrl &url);
// Clear cached types. Only types that aren't in the Waiting state will
// be cleared.
@@ -94,24 +94,24 @@ private Q_SLOTS:
void requestProgress(qint64 received, qint64 total);
private:
- void loadSource(QmlCompositeTypeData *);
- void loadResource(QmlCompositeTypeResource *);
- void compile(QmlCompositeTypeData *);
- void setData(QmlCompositeTypeData *, const QByteArray &, const QUrl &);
-
- void doComplete(QmlCompositeTypeData *);
- void doComplete(QmlCompositeTypeResource *);
- void checkComplete(QmlCompositeTypeData *);
- int resolveTypes(QmlCompositeTypeData *);
-
- QmlEngine *engine;
- typedef QHash<QUrl, QmlCompositeTypeData *> Components;
+ void loadSource(QDeclarativeCompositeTypeData *);
+ void loadResource(QDeclarativeCompositeTypeResource *);
+ void compile(QDeclarativeCompositeTypeData *);
+ void setData(QDeclarativeCompositeTypeData *, const QByteArray &, const QUrl &);
+
+ void doComplete(QDeclarativeCompositeTypeData *);
+ void doComplete(QDeclarativeCompositeTypeResource *);
+ void checkComplete(QDeclarativeCompositeTypeData *);
+ int resolveTypes(QDeclarativeCompositeTypeData *);
+
+ QDeclarativeEngine *engine;
+ typedef QHash<QUrl, QDeclarativeCompositeTypeData *> Components;
Components components;
- typedef QHash<QUrl, QmlCompositeTypeResource *> Resources;
+ typedef QHash<QUrl, QDeclarativeCompositeTypeResource *> Resources;
Resources resources;
};
QT_END_NAMESPACE
-#endif // QMLCOMPOSITETYPEMANAGER_P_H
+#endif // QDECLARATIVECOMPOSITETYPEMANAGER_P_H
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index 1718387..b244cd8 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -39,14 +39,14 @@
**
****************************************************************************/
-#include "qmlcontext.h"
-#include "qmlcontext_p.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativecontext_p.h"
-#include "qmlexpression_p.h"
-#include "qmlengine_p.h"
-#include "qmlengine.h"
-#include "qmlcompiledbindings_p.h"
-#include "qmlinfo.h"
+#include "qdeclarativeexpression_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativecompiledbindings_p.h"
+#include "qdeclarativeinfo.h"
#include <qscriptengine.h>
#include <QtCore/qvarlengtharray.h>
@@ -56,22 +56,22 @@
QT_BEGIN_NAMESPACE
-QmlContextPrivate::QmlContextPrivate()
+QDeclarativeContextPrivate::QDeclarativeContextPrivate()
: parent(0), engine(0), isInternal(false), propertyNames(0),
notifyIndex(-1), highPriorityCount(0), imports(0), expressions(0), contextObjects(0),
idValues(0), idValueCount(0), optimizedBindings(0)
{
}
-void QmlContextPrivate::addScript(const QmlParser::Object::ScriptBlock &script, QObject *scopeObject)
+void QDeclarativeContextPrivate::addScript(const QDeclarativeParser::Object::ScriptBlock &script, QObject *scopeObject)
{
- Q_Q(QmlContext);
+ Q_Q(QDeclarativeContext);
if (!engine)
return;
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(enginePriv->contextClass->newContext(q, scopeObject));
@@ -83,8 +83,8 @@ void QmlContextPrivate::addScript(const QmlParser::Object::ScriptBlock &script,
scriptEngine->evaluate(script.codes.at(ii), script.files.at(ii), script.lineNumbers.at(ii));
if (scriptEngine->hasUncaughtException()) {
- QmlError error;
- QmlExpressionPrivate::exceptionToError(scriptEngine, error);
+ QDeclarativeError error;
+ QDeclarativeExpressionPrivate::exceptionToError(scriptEngine, error);
qWarning().nospace() << qPrintable(error.toString());
}
}
@@ -94,9 +94,9 @@ void QmlContextPrivate::addScript(const QmlParser::Object::ScriptBlock &script,
scripts.append(scope);
}
-void QmlContextPrivate::destroyed(ContextGuard *guard)
+void QDeclarativeContextPrivate::destroyed(ContextGuard *guard)
{
- Q_Q(QmlContext);
+ Q_Q(QDeclarativeContext);
// process of being deleted (which is *probably* why obj has been destroyed
// anyway), as we're about to get deleted which will invalidate all the
@@ -120,43 +120,43 @@ void QmlContextPrivate::destroyed(ContextGuard *guard)
}
}
-void QmlContextPrivate::init()
+void QDeclarativeContextPrivate::init()
{
- Q_Q(QmlContext);
+ Q_Q(QDeclarativeContext);
if (parent)
parent->d_func()->childContexts.insert(q);
}
/*!
- \class QmlContext
+ \class QDeclarativeContext
\since 4.7
- \brief The QmlContext class defines a context within a QML engine.
+ \brief The QDeclarativeContext class defines a context within a QML engine.
\mainclass
Contexts allow data to be exposed to the QML components instantiated by the
QML engine.
- Each QmlContext contains a set of properties, distinct from
+ Each QDeclarativeContext contains a set of properties, distinct from
its QObject properties, that allow data to be
explicitly bound to a context by name. The context properties are defined or
- updated by calling QmlContext::setContextProperty(). The following example shows
+ updated by calling QDeclarativeContext::setContextProperty(). The following example shows
a Qt model being bound to a context and then accessed from a QML file.
\code
- QmlEngine engine;
- QmlContext context(engine.rootContext());
+ QDeclarativeEngine engine;
+ QDeclarativeContext context(engine.rootContext());
context.setContextProperty("myModel", modelData);
- QmlComponent component(&engine, "ListView { model=myModel }");
+ QDeclarativeComponent component(&engine, "ListView { model=myModel }");
component.create(&context);
\endcode
To simplify binding and maintaining larger data sets, QObject's can be
- added to a QmlContext. These objects are known as the context's default
+ added to a QDeclarativeContext. These objects are known as the context's default
objects. In this case all the properties of the QObject are
made available by name in the context, as though they were all individually
- added by calling QmlContext::setContextProperty(). Changes to the property's
+ added by calling QDeclarativeContext::setContextProperty(). Changes to the property's
values are detected through the property's notify signal. This method is
also slightly more faster than manually adding property values.
@@ -171,33 +171,33 @@ void QmlContextPrivate::init()
};
MyDataSet myDataSet;
- QmlEngine engine;
- QmlContext context(engine.rootContext());
+ QDeclarativeEngine engine;
+ QDeclarativeContext context(engine.rootContext());
context.addDefaultObject(&myDataSet);
- QmlComponent component(&engine, "ListView { model=myModel }");
+ QDeclarativeComponent component(&engine, "ListView { model=myModel }");
component.create(&context);
\endcode
Default objects added first take precedence over those added later. All properties
- added explicitly by QmlContext::setContextProperty() take precedence over default
+ added explicitly by QDeclarativeContext::setContextProperty() take precedence over default
object properties.
- Contexts are hierarchal, with the \l {QmlEngine::rootContext()}{root context}
- being created by the QmlEngine. A component instantiated in a given context
+ Contexts are hierarchal, with the \l {QDeclarativeEngine::rootContext()}{root context}
+ being created by the QDeclarativeEngine. A component instantiated in a given context
has access to that context's data, as well as the data defined by its
ancestor contexts. Data values (including those added implicitly by the
default objects) in a context override those in ancestor contexts. Data
- that should be available to all components instantiated by the QmlEngine
- should be added to the \l {QmlEngine::rootContext()}{root context}.
+ that should be available to all components instantiated by the QDeclarativeEngine
+ should be added to the \l {QDeclarativeEngine::rootContext()}{root context}.
In the following example,
\code
- QmlEngine engine;
- QmlContext context1(engine.rootContext());
- QmlContext context2(&context1);
- QmlContext context3(&context2);
+ QDeclarativeEngine engine;
+ QDeclarativeContext context1(engine.rootContext());
+ QDeclarativeContext context2(&context1);
+ QDeclarativeContext context3(&context2);
context1.setContextProperty("a", 12);
context2.setContextProperty("b", 13);
@@ -213,36 +213,36 @@ void QmlContextPrivate::init()
*/
/*! \internal */
-QmlContext::QmlContext(QmlEngine *e, bool)
-: QObject(*(new QmlContextPrivate))
+QDeclarativeContext::QDeclarativeContext(QDeclarativeEngine *e, bool)
+: QObject(*(new QDeclarativeContextPrivate))
{
- Q_D(QmlContext);
+ Q_D(QDeclarativeContext);
d->engine = e;
d->init();
}
/*!
- Create a new QmlContext as a child of \a engine's root context, and the
+ Create a new QDeclarativeContext as a child of \a engine's root context, and the
QObject \a parent.
*/
-QmlContext::QmlContext(QmlEngine *engine, QObject *parent)
-: QObject(*(new QmlContextPrivate), parent)
+QDeclarativeContext::QDeclarativeContext(QDeclarativeEngine *engine, QObject *parent)
+: QObject(*(new QDeclarativeContextPrivate), parent)
{
- Q_D(QmlContext);
- QmlContext *parentContext = engine?engine->rootContext():0;
+ Q_D(QDeclarativeContext);
+ QDeclarativeContext *parentContext = engine?engine->rootContext():0;
d->parent = parentContext;
d->engine = parentContext->engine();
d->init();
}
/*!
- Create a new QmlContext with the given \a parentContext, and the
+ Create a new QDeclarativeContext with the given \a parentContext, and the
QObject \a parent.
*/
-QmlContext::QmlContext(QmlContext *parentContext, QObject *parent)
-: QObject(*(new QmlContextPrivate), parent)
+QDeclarativeContext::QDeclarativeContext(QDeclarativeContext *parentContext, QObject *parent)
+: QObject(*(new QDeclarativeContextPrivate), parent)
{
- Q_D(QmlContext);
+ Q_D(QDeclarativeContext);
d->parent = parentContext;
d->engine = parentContext->engine();
d->init();
@@ -251,10 +251,10 @@ QmlContext::QmlContext(QmlContext *parentContext, QObject *parent)
/*!
\internal
*/
-QmlContext::QmlContext(QmlContext *parentContext, QObject *parent, bool)
-: QObject(*(new QmlContextPrivate), parent)
+QDeclarativeContext::QDeclarativeContext(QDeclarativeContext *parentContext, QObject *parent, bool)
+: QObject(*(new QDeclarativeContextPrivate), parent)
{
- Q_D(QmlContext);
+ Q_D(QDeclarativeContext);
d->parent = parentContext;
d->engine = parentContext->engine();
d->isInternal = true;
@@ -262,28 +262,28 @@ QmlContext::QmlContext(QmlContext *parentContext, QObject *parent, bool)
}
/*!
- Destroys the QmlContext.
+ Destroys the QDeclarativeContext.
Any expressions, or sub-contexts dependent on this context will be
- invalidated, but not destroyed (unless they are parented to the QmlContext
+ invalidated, but not destroyed (unless they are parented to the QDeclarativeContext
object).
*/
-QmlContext::~QmlContext()
+QDeclarativeContext::~QDeclarativeContext()
{
- Q_D(QmlContext);
+ Q_D(QDeclarativeContext);
if (d->parent)
d->parent->d_func()->childContexts.remove(this);
- for (QSet<QmlContext *>::ConstIterator iter = d->childContexts.begin();
+ for (QSet<QDeclarativeContext *>::ConstIterator iter = d->childContexts.begin();
iter != d->childContexts.end();
++iter) {
(*iter)->d_func()->invalidateEngines();
(*iter)->d_func()->parent = 0;
}
- QmlAbstractExpression *expression = d->expressions;
+ QDeclarativeAbstractExpression *expression = d->expressions;
while (expression) {
- QmlAbstractExpression *nextExpression = expression->m_nextExpression;
+ QDeclarativeAbstractExpression *nextExpression = expression->m_nextExpression;
expression->m_context = 0;
expression->m_prevExpression = 0;
@@ -293,7 +293,7 @@ QmlContext::~QmlContext()
}
while (d->contextObjects) {
- QmlDeclarativeData *co = d->contextObjects;
+ QDeclarativeDeclarativeData *co = d->contextObjects;
d->contextObjects = d->contextObjects->nextContextObject;
co->context = 0;
@@ -313,12 +313,12 @@ QmlContext::~QmlContext()
delete [] d->idValues;
}
-void QmlContextPrivate::invalidateEngines()
+void QDeclarativeContextPrivate::invalidateEngines()
{
if (!engine)
return;
engine = 0;
- for (QSet<QmlContext *>::ConstIterator iter = childContexts.begin();
+ for (QSet<QDeclarativeContext *>::ConstIterator iter = childContexts.begin();
iter != childContexts.end();
++iter) {
(*iter)->d_func()->invalidateEngines();
@@ -330,15 +330,15 @@ Refreshes all expressions that could possibly depend on this context.
Refreshing flushes all context-tree dependent caches in the expressions, and should occur every
time the context tree *structure* (not values) changes.
*/
-void QmlContextPrivate::refreshExpressions()
+void QDeclarativeContextPrivate::refreshExpressions()
{
- for (QSet<QmlContext *>::ConstIterator iter = childContexts.begin();
+ for (QSet<QDeclarativeContext *>::ConstIterator iter = childContexts.begin();
iter != childContexts.end();
++iter) {
(*iter)->d_func()->refreshExpressions();
}
- QmlAbstractExpression *expression = expressions;
+ QDeclarativeAbstractExpression *expression = expressions;
while (expression) {
expression->refresh();
expression = expression->m_nextExpression;
@@ -346,22 +346,22 @@ void QmlContextPrivate::refreshExpressions()
}
/*!
- Return the context's QmlEngine, or 0 if the context has no QmlEngine or the
- QmlEngine was destroyed.
+ Return the context's QDeclarativeEngine, or 0 if the context has no QDeclarativeEngine or the
+ QDeclarativeEngine was destroyed.
*/
-QmlEngine *QmlContext::engine() const
+QDeclarativeEngine *QDeclarativeContext::engine() const
{
- Q_D(const QmlContext);
+ Q_D(const QDeclarativeContext);
return d->engine;
}
/*!
- Return the context's parent QmlContext, or 0 if this context has no
+ Return the context's parent QDeclarativeContext, or 0 if this context has no
parent or if the parent has been destroyed.
*/
-QmlContext *QmlContext::parentContext() const
+QDeclarativeContext *QDeclarativeContext::parentContext() const
{
- Q_D(const QmlContext);
+ Q_D(const QDeclarativeContext);
return d->parent;
}
@@ -369,31 +369,31 @@ QmlContext *QmlContext::parentContext() const
Add \a defaultObject to this context. The object will be added after
any existing default objects.
*/
-void QmlContext::addDefaultObject(QObject *defaultObject)
+void QDeclarativeContext::addDefaultObject(QObject *defaultObject)
{
- Q_D(QmlContext);
+ Q_D(QDeclarativeContext);
d->defaultObjects.prepend(defaultObject);
}
/*!
Set a the \a value of the \a name property on this context.
*/
-void QmlContext::setContextProperty(const QString &name, const QVariant &value)
+void QDeclarativeContext::setContextProperty(const QString &name, const QVariant &value)
{
- Q_D(QmlContext);
+ Q_D(QDeclarativeContext);
if (d->notifyIndex == -1)
d->notifyIndex = this->metaObject()->methodCount();
if (d->engine) {
bool ok;
- QObject *o = QmlEnginePrivate::get(d->engine)->toQObject(value, &ok);
+ QObject *o = QDeclarativeEnginePrivate::get(d->engine)->toQObject(value, &ok);
if (ok) {
setContextProperty(name, o);
return;
}
}
- if (!d->propertyNames) d->propertyNames = new QmlIntegerCache(d->engine);
+ if (!d->propertyNames) d->propertyNames = new QDeclarativeIntegerCache(d->engine);
int idx = d->propertyNames->value(name);
if (idx == -1) {
@@ -407,10 +407,10 @@ void QmlContext::setContextProperty(const QString &name, const QVariant &value)
}
}
-void QmlContextPrivate::setIdProperty(int idx, QObject *obj)
+void QDeclarativeContextPrivate::setIdProperty(int idx, QObject *obj)
{
if (notifyIndex == -1) {
- Q_Q(QmlContext);
+ Q_Q(QDeclarativeContext);
notifyIndex = q->metaObject()->methodCount();
}
@@ -418,7 +418,7 @@ void QmlContextPrivate::setIdProperty(int idx, QObject *obj)
idValues[idx] = obj;
}
-void QmlContextPrivate::setIdPropertyData(QmlIntegerCache *data)
+void QDeclarativeContextPrivate::setIdPropertyData(QDeclarativeIntegerCache *data)
{
Q_ASSERT(!propertyNames);
propertyNames = data;
@@ -431,15 +431,15 @@ void QmlContextPrivate::setIdPropertyData(QmlIntegerCache *data)
/*!
Set the \a value of the \a name property on this context.
- QmlContext does \bold not take ownership of \a value.
+ QDeclarativeContext does \bold not take ownership of \a value.
*/
-void QmlContext::setContextProperty(const QString &name, QObject *value)
+void QDeclarativeContext::setContextProperty(const QString &name, QObject *value)
{
- Q_D(QmlContext);
+ Q_D(QDeclarativeContext);
if (d->notifyIndex == -1)
d->notifyIndex = this->metaObject()->methodCount();
- if (!d->propertyNames) d->propertyNames = new QmlIntegerCache(d->engine);
+ if (!d->propertyNames) d->propertyNames = new QDeclarativeIntegerCache(d->engine);
int idx = d->propertyNames->value(name);
if (idx == -1) {
@@ -457,9 +457,9 @@ void QmlContext::setContextProperty(const QString &name, QObject *value)
Returns the value of the \a name property for this context
as a QVariant.
*/
-QVariant QmlContext::contextProperty(const QString &name) const
+QVariant QDeclarativeContext::contextProperty(const QString &name) const
{
- Q_D(const QmlContext);
+ Q_D(const QDeclarativeContext);
QVariant value;
int idx = -1;
if (d->propertyNames)
@@ -469,8 +469,8 @@ QVariant QmlContext::contextProperty(const QString &name) const
QByteArray utf8Name = name.toUtf8();
for (int ii = d->defaultObjects.count() - 1; ii >= 0; --ii) {
QObject *obj = d->defaultObjects.at(ii);
- QmlPropertyCache::Data local;
- QmlPropertyCache::Data *property = QmlPropertyCache::property(d->engine, obj, name, local);
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *property = QDeclarativePropertyCache::property(d->engine, obj, name, local);
if (property) {
value = obj->metaObject()->property(property->coreIndex).read(obj);
@@ -490,12 +490,12 @@ QVariant QmlContext::contextProperty(const QString &name) const
Resolves the URL \a src relative to the URL of the
containing component.
- \sa QmlEngine::baseUrl(), setBaseUrl()
+ \sa QDeclarativeEngine::baseUrl(), setBaseUrl()
*/
-QUrl QmlContext::resolvedUrl(const QUrl &src)
+QUrl QDeclarativeContext::resolvedUrl(const QUrl &src)
{
- Q_D(QmlContext);
- QmlContext *ctxt = this;
+ Q_D(QDeclarativeContext);
+ QDeclarativeContext *ctxt = this;
if (src.isRelative() && !src.isEmpty()) {
if (ctxt) {
while(ctxt) {
@@ -524,7 +524,7 @@ QUrl QmlContext::resolvedUrl(const QUrl &src)
\sa resolvedUrl()
*/
-void QmlContext::setBaseUrl(const QUrl &baseUrl)
+void QDeclarativeContext::setBaseUrl(const QUrl &baseUrl)
{
d_func()->url = baseUrl;
}
@@ -533,9 +533,9 @@ void QmlContext::setBaseUrl(const QUrl &baseUrl)
Returns the base url of the component, or the containing component
if none is set.
*/
-QUrl QmlContext::baseUrl() const
+QUrl QDeclarativeContext::baseUrl() const
{
- const QmlContext* p = this;
+ const QDeclarativeContext* p = this;
while (p && p->d_func()->url.isEmpty()) {
p = p->parentContext();
}
@@ -545,10 +545,10 @@ QUrl QmlContext::baseUrl() const
return QUrl();
}
-int QmlContextPrivate::context_count(QmlListProperty<QObject> *prop)
+int QDeclarativeContextPrivate::context_count(QDeclarativeListProperty<QObject> *prop)
{
- QmlContext *context = static_cast<QmlContext*>(prop->object);
- QmlContextPrivate *d = QmlContextPrivate::get(context);
+ QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object);
+ QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context);
int contextProperty = (int)(intptr_t)prop->data;
if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) {
@@ -558,10 +558,10 @@ int QmlContextPrivate::context_count(QmlListProperty<QObject> *prop)
}
}
-QObject *QmlContextPrivate::context_at(QmlListProperty<QObject> *prop, int index)
+QObject *QDeclarativeContextPrivate::context_at(QDeclarativeListProperty<QObject> *prop, int index)
{
- QmlContext *context = static_cast<QmlContext*>(prop->object);
- QmlContextPrivate *d = QmlContextPrivate::get(context);
+ QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object);
+ QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context);
int contextProperty = (int)(intptr_t)prop->data;
if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) {
diff --git a/src/declarative/qml/qmlcontext.h b/src/declarative/qml/qdeclarativecontext.h
index e96ed84..0fb9bee 100644
--- a/src/declarative/qml/qmlcontext.h
+++ b/src/declarative/qml/qdeclarativecontext.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCONTEXT_H
-#define QMLCONTEXT_H
+#ifndef QDECLARATIVECONTEXT_H
+#define QDECLARATIVECONTEXT_H
#include <QtCore/qurl.h>
#include <QtCore/qobject.h>
@@ -54,23 +54,23 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QString;
-class QmlEngine;
-class QmlRefCount;
-class QmlContextPrivate;
-class QmlCompositeTypeData;
+class QDeclarativeEngine;
+class QDeclarativeRefCount;
+class QDeclarativeContextPrivate;
+class QDeclarativeCompositeTypeData;
-class Q_DECLARATIVE_EXPORT QmlContext : public QObject
+class Q_DECLARATIVE_EXPORT QDeclarativeContext : public QObject
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QmlContext)
+ Q_DECLARE_PRIVATE(QDeclarativeContext)
public:
- QmlContext(QmlEngine *parent, QObject *objParent=0);
- QmlContext(QmlContext *parent, QObject *objParent=0);
- virtual ~QmlContext();
+ QDeclarativeContext(QDeclarativeEngine *parent, QObject *objParent=0);
+ QDeclarativeContext(QDeclarativeContext *parent, QObject *objParent=0);
+ virtual ~QDeclarativeContext();
- QmlEngine *engine() const;
- QmlContext *parentContext() const;
+ QDeclarativeEngine *engine() const;
+ QDeclarativeContext *parentContext() const;
void addDefaultObject(QObject *);
void setContextProperty(const QString &, QObject *);
@@ -84,19 +84,19 @@ public:
QUrl baseUrl() const;
private:
- friend class QmlVME;
- friend class QmlEngine;
- friend class QmlEnginePrivate;
- friend class QmlExpression;
- friend class QmlExpressionPrivate;
- friend class QmlContextScriptClass;
- friend class QmlObjectScriptClass;
- friend class QmlComponent;
- friend class QmlComponentPrivate;
- friend class QmlScriptPrivate;
- friend class QmlBoundSignalProxy;
- QmlContext(QmlContext *parent, QObject *objParent, bool);
- QmlContext(QmlEngine *, bool);
+ friend class QDeclarativeVME;
+ friend class QDeclarativeEngine;
+ friend class QDeclarativeEnginePrivate;
+ friend class QDeclarativeExpression;
+ friend class QDeclarativeExpressionPrivate;
+ friend class QDeclarativeContextScriptClass;
+ friend class QDeclarativeObjectScriptClass;
+ friend class QDeclarativeComponent;
+ friend class QDeclarativeComponentPrivate;
+ friend class QDeclarativeScriptPrivate;
+ friend class QDeclarativeBoundSignalProxy;
+ QDeclarativeContext(QDeclarativeContext *parent, QObject *objParent, bool);
+ QDeclarativeContext(QDeclarativeEngine *, bool);
};
QT_END_NAMESPACE
@@ -104,4 +104,4 @@ Q_DECLARE_METATYPE(QList<QObject*>);
QT_END_HEADER
-#endif // QMLCONTEXT_H
+#endif // QDECLARATIVECONTEXT_H
diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index 965eeed..8297280 100644
--- a/src/declarative/qml/qmlcontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCONTEXT_P_H
-#define QMLCONTEXT_P_H
+#ifndef QDECLARATIVECONTEXT_P_H
+#define QDECLARATIVECONTEXT_P_H
//
// W A R N I N G
@@ -53,43 +53,43 @@
// We mean it.
//
-#include "qmlcontext.h"
+#include "qdeclarativecontext.h"
-#include "qmldeclarativedata_p.h"
-#include "qmlengine_p.h"
-#include "qmlintegercache_p.h"
-#include "qmltypenamecache_p.h"
+#include "qdeclarativedeclarativedata_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeintegercache_p.h"
+#include "qdeclarativetypenamecache_p.h"
#include <QtCore/qhash.h>
#include <QtScript/qscriptvalue.h>
#include <QtCore/qset.h>
#include <private/qobject_p.h>
-#include "qmlguard_p.h"
+#include "qdeclarativeguard_p.h"
QT_BEGIN_NAMESPACE
-class QmlContext;
-class QmlExpression;
-class QmlEngine;
-class QmlExpression;
-class QmlExpressionPrivate;
-class QmlAbstractExpression;
-class QmlBinding_Id;
-class QmlCompiledBindings;
+class QDeclarativeContext;
+class QDeclarativeExpression;
+class QDeclarativeEngine;
+class QDeclarativeExpression;
+class QDeclarativeExpressionPrivate;
+class QDeclarativeAbstractExpression;
+class QDeclarativeBinding_Id;
+class QDeclarativeCompiledBindings;
-class Q_DECLARATIVE_EXPORT QmlContextPrivate : public QObjectPrivate
+class Q_DECLARATIVE_EXPORT QDeclarativeContextPrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QmlContext)
+ Q_DECLARE_PUBLIC(QDeclarativeContext)
public:
- QmlContextPrivate();
+ QDeclarativeContextPrivate();
- QmlContext *parent;
- QmlEngine *engine;
+ QDeclarativeContext *parent;
+ QDeclarativeEngine *engine;
bool isInternal;
- QmlIntegerCache *propertyNames;
+ QDeclarativeIntegerCache *propertyNames;
QList<QVariant> propertyValues;
int notifyIndex;
@@ -97,21 +97,21 @@ public:
int highPriorityCount;
QList<QScriptValue> scripts;
- void addScript(const QmlParser::Object::ScriptBlock &, QObject *);
+ void addScript(const QDeclarativeParser::Object::ScriptBlock &, QObject *);
QUrl url;
- QmlTypeNameCache *imports;
+ QDeclarativeTypeNameCache *imports;
void init();
void invalidateEngines();
void refreshExpressions();
- QSet<QmlContext *> childContexts;
+ QSet<QDeclarativeContext *> childContexts;
- QmlAbstractExpression *expressions;
+ QDeclarativeAbstractExpression *expressions;
- QmlDeclarativeData *contextObjects;
+ QDeclarativeDeclarativeData *contextObjects;
struct IdNotifier
{
@@ -126,48 +126,48 @@ public:
int methodIndex;
};
- struct ContextGuard : public QmlGuard<QObject>
+ struct ContextGuard : public QDeclarativeGuard<QObject>
{
inline ContextGuard();
inline ContextGuard &operator=(QObject *obj);
inline virtual void objectDestroyed(QObject *);
- QmlContextPrivate *priv;
+ QDeclarativeContextPrivate *priv;
IdNotifier *bindings;
};
ContextGuard *idValues;
int idValueCount;
void setIdProperty(int, QObject *);
- void setIdPropertyData(QmlIntegerCache *);
+ void setIdPropertyData(QDeclarativeIntegerCache *);
void destroyed(ContextGuard *);
- static QmlContextPrivate *get(QmlContext *context) {
- return static_cast<QmlContextPrivate *>(QObjectPrivate::get(context));
+ static QDeclarativeContextPrivate *get(QDeclarativeContext *context) {
+ return static_cast<QDeclarativeContextPrivate *>(QObjectPrivate::get(context));
}
- static QmlContext *get(QmlContextPrivate *context) {
- return static_cast<QmlContext *>(context->q_func());
+ static QDeclarativeContext *get(QDeclarativeContextPrivate *context) {
+ return static_cast<QDeclarativeContext *>(context->q_func());
}
- QmlCompiledBindings *optimizedBindings;
+ QDeclarativeCompiledBindings *optimizedBindings;
// Only used for debugging
QList<QPointer<QObject> > instances;
- static int context_count(QmlListProperty<QObject> *);
- static QObject *context_at(QmlListProperty<QObject> *, int);
+ static int context_count(QDeclarativeListProperty<QObject> *);
+ static QObject *context_at(QDeclarativeListProperty<QObject> *, int);
};
-QmlContextPrivate::IdNotifier::IdNotifier()
+QDeclarativeContextPrivate::IdNotifier::IdNotifier()
: next(0), prev(0), target(0), methodIndex(-1)
{
}
-QmlContextPrivate::IdNotifier::~IdNotifier()
+QDeclarativeContextPrivate::IdNotifier::~IdNotifier()
{
clear();
}
-void QmlContextPrivate::IdNotifier::clear()
+void QDeclarativeContextPrivate::IdNotifier::clear()
{
if (next) next->prev = prev;
if (prev) *prev = next;
@@ -175,21 +175,21 @@ void QmlContextPrivate::IdNotifier::clear()
methodIndex = -1;
}
-QmlContextPrivate::ContextGuard::ContextGuard()
+QDeclarativeContextPrivate::ContextGuard::ContextGuard()
: priv(0), bindings(0)
{
}
-QmlContextPrivate::ContextGuard &QmlContextPrivate::ContextGuard::operator=(QObject *obj)
+QDeclarativeContextPrivate::ContextGuard &QDeclarativeContextPrivate::ContextGuard::operator=(QObject *obj)
{
- (QmlGuard<QObject>&)*this = obj; return *this;
+ (QDeclarativeGuard<QObject>&)*this = obj; return *this;
}
-void QmlContextPrivate::ContextGuard::objectDestroyed(QObject *)
+void QDeclarativeContextPrivate::ContextGuard::objectDestroyed(QObject *)
{
priv->destroyed(this);
}
QT_END_NAMESPACE
-#endif // QMLCONTEXT_P_H
+#endif // QDECLARATIVECONTEXT_P_H
diff --git a/src/declarative/qml/qmlcontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
index 4c71903..7deed0b 100644
--- a/src/declarative/qml/qmlcontextscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp
@@ -39,34 +39,34 @@
**
****************************************************************************/
-#include "qmlcontextscriptclass_p.h"
+#include "qdeclarativecontextscriptclass_p.h"
-#include "qmlengine_p.h"
-#include "qmlcontext_p.h"
-#include "qmltypenamescriptclass_p.h"
-#include "qmllistscriptclass_p.h"
-#include "qmlguard_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativetypenamescriptclass_p.h"
+#include "qdeclarativelistscriptclass_p.h"
+#include "qdeclarativeguard_p.h"
QT_BEGIN_NAMESPACE
struct ContextData : public QScriptDeclarativeClass::Object {
ContextData() : isSharedContext(true) {}
- ContextData(QmlContext *c, QObject *o) : context(c), scopeObject(o), isSharedContext(false) {}
- QmlGuard<QmlContext> context;
- QmlGuard<QObject> scopeObject;
+ ContextData(QDeclarativeContext *c, QObject *o) : context(c), scopeObject(o), isSharedContext(false) {}
+ QDeclarativeGuard<QDeclarativeContext> context;
+ QDeclarativeGuard<QObject> scopeObject;
bool isSharedContext;
- QmlContext *getContext(QmlEngine *engine) {
+ QDeclarativeContext *getContext(QDeclarativeEngine *engine) {
if (isSharedContext) {
- return QmlEnginePrivate::get(engine)->sharedContext;
+ return QDeclarativeEnginePrivate::get(engine)->sharedContext;
} else {
return context.data();
}
}
- QObject *getScope(QmlEngine *engine) {
+ QObject *getScope(QDeclarativeEngine *engine) {
if (isSharedContext) {
- return QmlEnginePrivate::get(engine)->sharedScope;
+ return QDeclarativeEnginePrivate::get(engine)->sharedScope;
} else {
return scopeObject.data();
}
@@ -74,34 +74,34 @@ struct ContextData : public QScriptDeclarativeClass::Object {
};
/*
- The QmlContextScriptClass handles property access for a QmlContext
+ The QDeclarativeContextScriptClass handles property access for a QDeclarativeContext
via QtScript.
*/
-QmlContextScriptClass::QmlContextScriptClass(QmlEngine *bindEngine)
-: QmlScriptClass(QmlEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine),
+QDeclarativeContextScriptClass::QDeclarativeContextScriptClass(QDeclarativeEngine *bindEngine)
+: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine),
lastScopeObject(0), lastContext(0), lastData(0), lastPropertyIndex(-1), lastDefaultObject(-1)
{
}
-QmlContextScriptClass::~QmlContextScriptClass()
+QDeclarativeContextScriptClass::~QDeclarativeContextScriptClass()
{
}
-QScriptValue QmlContextScriptClass::newContext(QmlContext *context, QObject *scopeObject)
+QScriptValue QDeclarativeContextScriptClass::newContext(QDeclarativeContext *context, QObject *scopeObject)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
return newObject(scriptEngine, this, new ContextData(context, scopeObject));
}
-QScriptValue QmlContextScriptClass::newSharedContext()
+QScriptValue QDeclarativeContextScriptClass::newSharedContext()
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
return newObject(scriptEngine, this, new ContextData());
}
-QmlContext *QmlContextScriptClass::contextFromValue(const QScriptValue &v)
+QDeclarativeContext *QDeclarativeContextScriptClass::contextFromValue(const QScriptValue &v)
{
if (scriptClass(v) != this)
return 0;
@@ -111,7 +111,7 @@ QmlContext *QmlContextScriptClass::contextFromValue(const QScriptValue &v)
}
QScriptClass::QueryFlags
-QmlContextScriptClass::queryProperty(Object *object, const Identifier &name,
+QDeclarativeContextScriptClass::queryProperty(Object *object, const Identifier &name,
QScriptClass::QueryFlags flags)
{
Q_UNUSED(flags);
@@ -122,7 +122,7 @@ QmlContextScriptClass::queryProperty(Object *object, const Identifier &name,
lastPropertyIndex = -1;
lastDefaultObject = -1;
- QmlContext *bindContext = ((ContextData *)object)->getContext(engine);
+ QDeclarativeContext *bindContext = ((ContextData *)object)->getContext(engine);
QObject *scopeObject = ((ContextData *)object)->getScope(engine);
if (!bindContext)
return 0;
@@ -141,13 +141,13 @@ QmlContextScriptClass::queryProperty(Object *object, const Identifier &name,
}
QScriptClass::QueryFlags
-QmlContextScriptClass::queryProperty(QmlContext *bindContext, QObject *scopeObject,
+QDeclarativeContextScriptClass::queryProperty(QDeclarativeContext *bindContext, QObject *scopeObject,
const Identifier &name,
QScriptClass::QueryFlags flags,
bool includeTypes)
{
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
- QmlContextPrivate *cp = QmlContextPrivate::get(bindContext);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QDeclarativeContextPrivate *cp = QDeclarativeContextPrivate::get(bindContext);
lastPropertyIndex = cp->propertyNames?cp->propertyNames->value(name):-1;
if (lastPropertyIndex != -1) {
@@ -156,7 +156,7 @@ QmlContextScriptClass::queryProperty(QmlContext *bindContext, QObject *scopeObje
}
if (includeTypes && cp->imports) {
- QmlTypeNameCache::Data *data = cp->imports->data(name);
+ QDeclarativeTypeNameCache::Data *data = cp->imports->data(name);
if (data) {
lastData = data;
@@ -176,7 +176,7 @@ QmlContextScriptClass::queryProperty(QmlContext *bindContext, QObject *scopeObje
if (scopeObject) {
QScriptClass::QueryFlags rv =
ep->objectClass->queryProperty(scopeObject, name, flags, bindContext,
- QmlObjectScriptClass::ImplicitObject | QmlObjectScriptClass::SkipAttachedProperties);
+ QDeclarativeObjectScriptClass::ImplicitObject | QDeclarativeObjectScriptClass::SkipAttachedProperties);
if (rv) {
lastScopeObject = scopeObject;
lastContext = bindContext;
@@ -187,7 +187,7 @@ QmlContextScriptClass::queryProperty(QmlContext *bindContext, QObject *scopeObje
for (int ii = cp->defaultObjects.count() - 1; ii >= 0; --ii) {
QScriptClass::QueryFlags rv =
ep->objectClass->queryProperty(cp->defaultObjects.at(ii), name, flags, bindContext,
- QmlObjectScriptClass::ImplicitObject | QmlObjectScriptClass::SkipAttachedProperties);
+ QDeclarativeObjectScriptClass::ImplicitObject | QDeclarativeObjectScriptClass::SkipAttachedProperties);
if (rv) {
lastDefaultObject = ii;
@@ -199,17 +199,17 @@ QmlContextScriptClass::queryProperty(QmlContext *bindContext, QObject *scopeObje
return 0;
}
-QmlContextScriptClass::ScriptValue
-QmlContextScriptClass::property(Object *object, const Identifier &name)
+QDeclarativeContextScriptClass::ScriptValue
+QDeclarativeContextScriptClass::property(Object *object, const Identifier &name)
{
Q_UNUSED(object);
- QmlContext *bindContext = lastContext;
+ QDeclarativeContext *bindContext = lastContext;
Q_ASSERT(bindContext);
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
- QmlContextPrivate *cp = QmlContextPrivate::get(bindContext);
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QDeclarativeContextPrivate *cp = QDeclarativeContextPrivate::get(bindContext);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (lastScopeObject) {
@@ -230,14 +230,14 @@ QmlContextScriptClass::property(Object *object, const Identifier &name)
} else {
const QVariant &value = cp->propertyValues.at(lastPropertyIndex);
if (value.userType() == qMetaTypeId<QList<QObject*> >()) {
- rv = ep->listClass->newList(QmlListProperty<QObject>(bindContext, (void*)lastPropertyIndex, 0, QmlContextPrivate::context_count, QmlContextPrivate::context_at), qMetaTypeId<QmlListProperty<QObject> >());
+ rv = ep->listClass->newList(QDeclarativeListProperty<QObject>(bindContext, (void*)lastPropertyIndex, 0, QDeclarativeContextPrivate::context_count, QDeclarativeContextPrivate::context_at), qMetaTypeId<QDeclarativeListProperty<QObject> >());
} else {
rv = ep->scriptValueFromVariant(value);
}
}
ep->capturedProperties <<
- QmlEnginePrivate::CapturedProperty(bindContext, -1, lastPropertyIndex + cp->notifyIndex);
+ QDeclarativeEnginePrivate::CapturedProperty(bindContext, -1, lastPropertyIndex + cp->notifyIndex);
return Value(scriptEngine, rv);
} else if(lastDefaultObject != -1) {
@@ -252,17 +252,17 @@ QmlContextScriptClass::property(Object *object, const Identifier &name)
}
}
-void QmlContextScriptClass::setProperty(Object *object, const Identifier &name,
+void QDeclarativeContextScriptClass::setProperty(Object *object, const Identifier &name,
const QScriptValue &value)
{
Q_UNUSED(object);
Q_ASSERT(lastScopeObject || lastDefaultObject != -1);
- QmlContext *bindContext = lastContext;
+ QDeclarativeContext *bindContext = lastContext;
Q_ASSERT(bindContext);
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
- QmlContextPrivate *cp = QmlContextPrivate::get(bindContext);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QDeclarativeContextPrivate *cp = QDeclarativeContextPrivate::get(bindContext);
if (lastScopeObject) {
ep->objectClass->setProperty(lastScopeObject, name, value, bindContext);
diff --git a/src/declarative/qml/qmlcontextscriptclass_p.h b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
index c878f3c..26086ec 100644
--- a/src/declarative/qml/qmlcontextscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativecontextscriptclass_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCONTEXTSCRIPTCLASS_P_H
-#define QMLCONTEXTSCRIPTCLASS_P_H
+#ifndef QDECLARATIVECONTEXTSCRIPTCLASS_P_H
+#define QDECLARATIVECONTEXTSCRIPTCLASS_P_H
//
// W A R N I N G
@@ -53,23 +53,23 @@
// We mean it.
//
-#include "qmltypenamecache_p.h"
-#include "qmlscriptclass_p.h"
+#include "qdeclarativetypenamecache_p.h"
+#include "qdeclarativescriptclass_p.h"
QT_BEGIN_NAMESPACE
-class QmlEngine;
-class QmlContext;
-class QmlContextScriptClass : public QmlScriptClass
+class QDeclarativeEngine;
+class QDeclarativeContext;
+class QDeclarativeContextScriptClass : public QDeclarativeScriptClass
{
public:
- QmlContextScriptClass(QmlEngine *);
- ~QmlContextScriptClass();
+ QDeclarativeContextScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeContextScriptClass();
- QScriptValue newContext(QmlContext *, QObject * = 0);
+ QScriptValue newContext(QDeclarativeContext *, QObject * = 0);
QScriptValue newSharedContext();
- QmlContext *contextFromValue(const QScriptValue &);
+ QDeclarativeContext *contextFromValue(const QScriptValue &);
protected:
virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
@@ -78,16 +78,16 @@ protected:
virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
private:
- QScriptClass::QueryFlags queryProperty(QmlContext *, QObject *scopeObject,
+ QScriptClass::QueryFlags queryProperty(QDeclarativeContext *, QObject *scopeObject,
const Identifier &,
QScriptClass::QueryFlags flags,
bool includeTypes);
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
QObject *lastScopeObject;
- QmlContext *lastContext;
- QmlTypeNameCache::Data *lastData;
+ QDeclarativeContext *lastContext;
+ QDeclarativeTypeNameCache::Data *lastData;
int lastPropertyIndex;
int lastDefaultObject;
QScriptValue lastFunction;
@@ -97,5 +97,5 @@ private:
QT_END_NAMESPACE
-#endif // QMLCONTEXTSCRIPTCLASS_P_H
+#endif // QDECLARATIVECONTEXTSCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qmlcustomparser.cpp b/src/declarative/qml/qdeclarativecustomparser.cpp
index 8e52b72..67f0963 100644
--- a/src/declarative/qml/qmlcustomparser.cpp
+++ b/src/declarative/qml/qdeclarativecustomparser.cpp
@@ -39,23 +39,23 @@
**
****************************************************************************/
-#include "qmlcustomparser_p.h"
-#include "qmlcustomparser_p_p.h"
+#include "qdeclarativecustomparser_p.h"
+#include "qdeclarativecustomparser_p_p.h"
-#include "qmlparser_p.h"
+#include "qdeclarativeparser_p.h"
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
-using namespace QmlParser;
+using namespace QDeclarativeParser;
/*!
- \class QmlCustomParser
- \brief The QmlCustomParser class allows you to add new arbitrary types to QML.
+ \class QDeclarativeCustomParser
+ \brief The QDeclarativeCustomParser class allows you to add new arbitrary types to QML.
\internal
- By subclassing QmlCustomParser, you can add a parser for
+ By subclassing QDeclarativeCustomParser, you can add a parser for
building a particular type.
The subclass must implement compile() and setCustomData(), and register
@@ -67,7 +67,7 @@ using namespace QmlParser;
*/
/*
- \fn QByteArray QmlCustomParser::compile(const QList<QmlCustomParserProperty> & properties)
+ \fn QByteArray QDeclarativeCustomParser::compile(const QList<QDeclarativeCustomParserProperty> & properties)
The custom parser processes \a properties, and returns
a QByteArray containing data meaningful only to the
@@ -82,7 +82,7 @@ using namespace QmlParser;
*/
/*
- \fn void QmlCustomParser::setCustomData(QObject *object, const QByteArray &data)
+ \fn void QDeclarativeCustomParser::setCustomData(QObject *object, const QByteArray &data)
This function sets \a object to have the properties defined
by \a data, which is a block of data previously returned by a call
@@ -91,10 +91,10 @@ using namespace QmlParser;
The \a object will be an instance of the TypeClass specified by QML_REGISTER_CUSTOM_TYPE.
*/
-QmlCustomParserNode
-QmlCustomParserNodePrivate::fromObject(QmlParser::Object *root)
+QDeclarativeCustomParserNode
+QDeclarativeCustomParserNodePrivate::fromObject(QDeclarativeParser::Object *root)
{
- QmlCustomParserNode rootNode;
+ QDeclarativeCustomParserNode rootNode;
rootNode.d->name = root->typeName;
rootNode.d->location = root->location.start;
@@ -110,26 +110,26 @@ QmlCustomParserNodePrivate::fromObject(QmlParser::Object *root)
return rootNode;
}
-QmlCustomParserProperty
-QmlCustomParserNodePrivate::fromProperty(QmlParser::Property *p)
+QDeclarativeCustomParserProperty
+QDeclarativeCustomParserNodePrivate::fromProperty(QDeclarativeParser::Property *p)
{
- QmlCustomParserProperty prop;
+ QDeclarativeCustomParserProperty prop;
prop.d->name = p->name;
prop.d->isList = (p->values.count() > 1);
prop.d->location = p->location.start;
if (p->value) {
- QmlCustomParserNode node = fromObject(p->value);
- QList<QmlCustomParserProperty> props = node.properties();
+ QDeclarativeCustomParserNode node = fromObject(p->value);
+ QList<QDeclarativeCustomParserProperty> props = node.properties();
for (int ii = 0; ii < props.count(); ++ii)
prop.d->values << QVariant::fromValue(props.at(ii));
} else {
for(int ii = 0; ii < p->values.count(); ++ii) {
Value *v = p->values.at(ii);
- v->type = QmlParser::Value::Literal;
+ v->type = QDeclarativeParser::Value::Literal;
if(v->object) {
- QmlCustomParserNode node = fromObject(v->object);
+ QDeclarativeCustomParserNode node = fromObject(v->object);
prop.d->values << QVariant::fromValue(node);
} else {
prop.d->values << QVariant::fromValue(v->value);
@@ -141,18 +141,18 @@ QmlCustomParserNodePrivate::fromProperty(QmlParser::Property *p)
return prop;
}
-QmlCustomParserNode::QmlCustomParserNode()
-: d(new QmlCustomParserNodePrivate)
+QDeclarativeCustomParserNode::QDeclarativeCustomParserNode()
+: d(new QDeclarativeCustomParserNodePrivate)
{
}
-QmlCustomParserNode::QmlCustomParserNode(const QmlCustomParserNode &other)
-: d(new QmlCustomParserNodePrivate)
+QDeclarativeCustomParserNode::QDeclarativeCustomParserNode(const QDeclarativeCustomParserNode &other)
+: d(new QDeclarativeCustomParserNodePrivate)
{
*this = other;
}
-QmlCustomParserNode &QmlCustomParserNode::operator=(const QmlCustomParserNode &other)
+QDeclarativeCustomParserNode &QDeclarativeCustomParserNode::operator=(const QDeclarativeCustomParserNode &other)
{
d->name = other.d->name;
d->properties = other.d->properties;
@@ -160,38 +160,38 @@ QmlCustomParserNode &QmlCustomParserNode::operator=(const QmlCustomParserNode &o
return *this;
}
-QmlCustomParserNode::~QmlCustomParserNode()
+QDeclarativeCustomParserNode::~QDeclarativeCustomParserNode()
{
delete d; d = 0;
}
-QByteArray QmlCustomParserNode::name() const
+QByteArray QDeclarativeCustomParserNode::name() const
{
return d->name;
}
-QList<QmlCustomParserProperty> QmlCustomParserNode::properties() const
+QList<QDeclarativeCustomParserProperty> QDeclarativeCustomParserNode::properties() const
{
return d->properties;
}
-QmlParser::Location QmlCustomParserNode::location() const
+QDeclarativeParser::Location QDeclarativeCustomParserNode::location() const
{
return d->location;
}
-QmlCustomParserProperty::QmlCustomParserProperty()
-: d(new QmlCustomParserPropertyPrivate)
+QDeclarativeCustomParserProperty::QDeclarativeCustomParserProperty()
+: d(new QDeclarativeCustomParserPropertyPrivate)
{
}
-QmlCustomParserProperty::QmlCustomParserProperty(const QmlCustomParserProperty &other)
-: d(new QmlCustomParserPropertyPrivate)
+QDeclarativeCustomParserProperty::QDeclarativeCustomParserProperty(const QDeclarativeCustomParserProperty &other)
+: d(new QDeclarativeCustomParserPropertyPrivate)
{
*this = other;
}
-QmlCustomParserProperty &QmlCustomParserProperty::operator=(const QmlCustomParserProperty &other)
+QDeclarativeCustomParserProperty &QDeclarativeCustomParserProperty::operator=(const QDeclarativeCustomParserProperty &other)
{
d->name = other.d->name;
d->isList = other.d->isList;
@@ -200,32 +200,32 @@ QmlCustomParserProperty &QmlCustomParserProperty::operator=(const QmlCustomParse
return *this;
}
-QmlCustomParserProperty::~QmlCustomParserProperty()
+QDeclarativeCustomParserProperty::~QDeclarativeCustomParserProperty()
{
delete d; d = 0;
}
-QByteArray QmlCustomParserProperty::name() const
+QByteArray QDeclarativeCustomParserProperty::name() const
{
return d->name;
}
-bool QmlCustomParserProperty::isList() const
+bool QDeclarativeCustomParserProperty::isList() const
{
return d->isList;
}
-QmlParser::Location QmlCustomParserProperty::location() const
+QDeclarativeParser::Location QDeclarativeCustomParserProperty::location() const
{
return d->location;
}
-QList<QVariant> QmlCustomParserProperty::assignedValues() const
+QList<QVariant> QDeclarativeCustomParserProperty::assignedValues() const
{
return d->values;
}
-void QmlCustomParser::clearErrors()
+void QDeclarativeCustomParser::clearErrors()
{
exceptions.clear();
}
@@ -235,9 +235,9 @@ void QmlCustomParser::clearErrors()
An error is generated referring to the position of \a node in the source file.
*/
-void QmlCustomParser::error(const QmlCustomParserProperty& prop, const QString& description)
+void QDeclarativeCustomParser::error(const QDeclarativeCustomParserProperty& prop, const QString& description)
{
- QmlError error;
+ QDeclarativeError error;
QString exceptionDescription;
error.setLine(prop.location().line);
error.setColumn(prop.location().column);
@@ -250,9 +250,9 @@ void QmlCustomParser::error(const QmlCustomParserProperty& prop, const QString&
An error is generated referring to the position of \a node in the source file.
*/
-void QmlCustomParser::error(const QmlCustomParserNode& node, const QString& description)
+void QDeclarativeCustomParser::error(const QDeclarativeCustomParserNode& node, const QString& description)
{
- QmlError error;
+ QDeclarativeError error;
QString exceptionDescription;
error.setLine(node.location().line);
error.setColumn(node.location().column);
diff --git a/src/declarative/qml/qmlcustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h
index e198712..cef1f3c 100644
--- a/src/declarative/qml/qmlcustomparser_p.h
+++ b/src/declarative/qml/qdeclarativecustomparser_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCUSTOMPARSER_H
-#define QMLCUSTOMPARSER_H
+#ifndef QDECLARATIVECUSTOMPARSER_H
+#define QDECLARATIVECUSTOMPARSER_H
//
// W A R N I N G
@@ -53,9 +53,9 @@
// We mean it.
//
-#include "qmlmetatype.h"
-#include "qmlerror.h"
-#include "qmlparser_p.h"
+#include "qdeclarativemetatype.h"
+#include "qdeclarativeerror.h"
+#include "qdeclarativeparser_p.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qxmlstream.h>
@@ -66,66 +66,66 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlCustomParserPropertyPrivate;
-class Q_DECLARATIVE_EXPORT QmlCustomParserProperty
+class QDeclarativeCustomParserPropertyPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserProperty
{
public:
- QmlCustomParserProperty();
- QmlCustomParserProperty(const QmlCustomParserProperty &);
- QmlCustomParserProperty &operator=(const QmlCustomParserProperty &);
- ~QmlCustomParserProperty();
+ QDeclarativeCustomParserProperty();
+ QDeclarativeCustomParserProperty(const QDeclarativeCustomParserProperty &);
+ QDeclarativeCustomParserProperty &operator=(const QDeclarativeCustomParserProperty &);
+ ~QDeclarativeCustomParserProperty();
QByteArray name() const;
- QmlParser::Location location() const;
+ QDeclarativeParser::Location location() const;
bool isList() const;
- // Will be one of QmlParser::Variant, QmlCustomParserProperty or
- // QmlCustomParserNode
+ // Will be one of QDeclarativeParser::Variant, QDeclarativeCustomParserProperty or
+ // QDeclarativeCustomParserNode
QList<QVariant> assignedValues() const;
private:
- friend class QmlCustomParserNodePrivate;
- friend class QmlCustomParserPropertyPrivate;
- QmlCustomParserPropertyPrivate *d;
+ friend class QDeclarativeCustomParserNodePrivate;
+ friend class QDeclarativeCustomParserPropertyPrivate;
+ QDeclarativeCustomParserPropertyPrivate *d;
};
-class QmlCustomParserNodePrivate;
-class Q_DECLARATIVE_EXPORT QmlCustomParserNode
+class QDeclarativeCustomParserNodePrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeCustomParserNode
{
public:
- QmlCustomParserNode();
- QmlCustomParserNode(const QmlCustomParserNode &);
- QmlCustomParserNode &operator=(const QmlCustomParserNode &);
- ~QmlCustomParserNode();
+ QDeclarativeCustomParserNode();
+ QDeclarativeCustomParserNode(const QDeclarativeCustomParserNode &);
+ QDeclarativeCustomParserNode &operator=(const QDeclarativeCustomParserNode &);
+ ~QDeclarativeCustomParserNode();
QByteArray name() const;
- QmlParser::Location location() const;
+ QDeclarativeParser::Location location() const;
- QList<QmlCustomParserProperty> properties() const;
+ QList<QDeclarativeCustomParserProperty> properties() const;
private:
- friend class QmlCustomParserNodePrivate;
- QmlCustomParserNodePrivate *d;
+ friend class QDeclarativeCustomParserNodePrivate;
+ QDeclarativeCustomParserNodePrivate *d;
};
-class Q_DECLARATIVE_EXPORT QmlCustomParser
+class Q_DECLARATIVE_EXPORT QDeclarativeCustomParser
{
public:
- virtual ~QmlCustomParser() {}
+ virtual ~QDeclarativeCustomParser() {}
void clearErrors();
- virtual QByteArray compile(const QList<QmlCustomParserProperty> &)=0;
+ virtual QByteArray compile(const QList<QDeclarativeCustomParserProperty> &)=0;
virtual void setCustomData(QObject *, const QByteArray &)=0;
- QList<QmlError> errors() const { return exceptions; }
+ QList<QDeclarativeError> errors() const { return exceptions; }
protected:
- void error(const QmlCustomParserProperty&, const QString& description);
- void error(const QmlCustomParserNode&, const QString& description);
+ void error(const QDeclarativeCustomParserProperty&, const QString& description);
+ void error(const QDeclarativeCustomParserNode&, const QString& description);
private:
- QList<QmlError> exceptions;
+ QList<QDeclarativeError> exceptions;
};
#define QML_REGISTER_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN, NAME, TYPE, CUSTOMTYPE) \
@@ -134,8 +134,8 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QmlCustomParserProperty)
-Q_DECLARE_METATYPE(QmlCustomParserNode)
+Q_DECLARE_METATYPE(QDeclarativeCustomParserProperty)
+Q_DECLARE_METATYPE(QDeclarativeCustomParserNode)
QT_END_HEADER
diff --git a/src/declarative/qml/qmlcustomparser_p_p.h b/src/declarative/qml/qdeclarativecustomparser_p_p.h
index 52e7b4f..b580db6 100644
--- a/src/declarative/qml/qmlcustomparser_p_p.h
+++ b/src/declarative/qml/qdeclarativecustomparser_p_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLCUSTOMPARSER_P_H
-#define QMLCUSTOMPARSER_P_H
+#ifndef QDECLARATIVECUSTOMPARSER_P_H
+#define QDECLARATIVECUSTOMPARSER_P_H
//
// W A R N I N G
@@ -53,37 +53,37 @@
// We mean it.
//
-#include "qmlcustomparser_p.h"
+#include "qdeclarativecustomparser_p.h"
-#include "qmlparser_p.h"
+#include "qdeclarativeparser_p.h"
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
-class QmlCustomParserNodePrivate
+class QDeclarativeCustomParserNodePrivate
{
public:
QByteArray name;
- QList<QmlCustomParserProperty> properties;
- QmlParser::Location location;
+ QList<QDeclarativeCustomParserProperty> properties;
+ QDeclarativeParser::Location location;
- static QmlCustomParserNode fromObject(QmlParser::Object *);
- static QmlCustomParserProperty fromProperty(QmlParser::Property *);
+ static QDeclarativeCustomParserNode fromObject(QDeclarativeParser::Object *);
+ static QDeclarativeCustomParserProperty fromProperty(QDeclarativeParser::Property *);
};
-class QmlCustomParserPropertyPrivate
+class QDeclarativeCustomParserPropertyPrivate
{
public:
- QmlCustomParserPropertyPrivate()
+ QDeclarativeCustomParserPropertyPrivate()
: isList(false) {}
QByteArray name;
bool isList;
- QmlParser::Location location;
+ QDeclarativeParser::Location location;
QList<QVariant> values;
};
QT_END_NAMESPACE
-#endif // QMLCUSTOMPARSER_P_H
+#endif // QDECLARATIVECUSTOMPARSER_P_H
diff --git a/src/declarative/qml/qmldeclarativedata_p.h b/src/declarative/qml/qdeclarativedeclarativedata_p.h
index efdc5fd..2c92419 100644
--- a/src/declarative/qml/qmldeclarativedata_p.h
+++ b/src/declarative/qml/qdeclarativedeclarativedata_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLDECLARATIVEDATA_P_H
-#define QMLDECLARATIVEDATA_P_H
+#ifndef QDECLARATIVEDECLARATIVEDATA_P_H
+#define QDECLARATIVEDECLARATIVEDATA_P_H
//
// W A R N I N G
@@ -55,18 +55,18 @@
#include <QtScript/qscriptvalue.h>
#include <private/qobject_p.h>
-#include "qmlguard_p.h"
+#include "qdeclarativeguard_p.h"
QT_BEGIN_NAMESPACE
-class QmlCompiledData;
-class QmlAbstractBinding;
-class QmlContext;
-class QmlPropertyCache;
-class Q_AUTOTEST_EXPORT QmlDeclarativeData : public QDeclarativeData
+class QDeclarativeCompiledData;
+class QDeclarativeAbstractBinding;
+class QDeclarativeContext;
+class QDeclarativePropertyCache;
+class Q_AUTOTEST_EXPORT QDeclarativeDeclarativeData : public QDeclarativeData
{
public:
- QmlDeclarativeData(QmlContext *ctxt = 0)
+ QDeclarativeDeclarativeData(QDeclarativeContext *ctxt = 0)
: context(ctxt), bindings(0), nextContextObject(0), prevContextObject(0),
bindingBitsSize(0), bindingBits(0), outerContext(0), lineNumber(0),
columnNumber(0), deferredComponent(0), deferredIdx(0), attachedProperties(0),
@@ -74,12 +74,12 @@ public:
virtual void destroyed(QObject *);
- QmlContext *context;
- QmlAbstractBinding *bindings;
+ QDeclarativeContext *context;
+ QDeclarativeAbstractBinding *bindings;
- // Linked list for QmlContext::contextObjects
- QmlDeclarativeData *nextContextObject;
- QmlDeclarativeData**prevContextObject;
+ // Linked list for QDeclarativeContext::contextObjects
+ QDeclarativeDeclarativeData *nextContextObject;
+ QDeclarativeDeclarativeData**prevContextObject;
int bindingBitsSize;
quint32 *bindingBits;
@@ -87,27 +87,27 @@ public:
void clearBindingBit(int);
void setBindingBit(QObject *obj, int);
- QmlContext *outerContext; // Can't this be found from context?
+ QDeclarativeContext *outerContext; // Can't this be found from context?
ushort lineNumber;
ushort columnNumber;
- QmlCompiledData *deferredComponent; // Can't this be found from the context?
+ QDeclarativeCompiledData *deferredComponent; // Can't this be found from the context?
unsigned int deferredIdx;
QHash<int, QObject *> *attachedProperties;
QScriptValue scriptValue;
- QmlPropertyCache *propertyCache;
+ QDeclarativePropertyCache *propertyCache;
- QmlGuard<QObject> *guards;
+ QDeclarativeGuard<QObject> *guards;
- static QmlDeclarativeData *get(const QObject *object, bool create = false) {
+ static QDeclarativeDeclarativeData *get(const QObject *object, bool create = false) {
QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
if (priv->declarativeData) {
- return static_cast<QmlDeclarativeData *>(priv->declarativeData);
+ return static_cast<QDeclarativeDeclarativeData *>(priv->declarativeData);
} else if (create) {
- priv->declarativeData = new QmlDeclarativeData;
- return static_cast<QmlDeclarativeData *>(priv->declarativeData);
+ priv->declarativeData = new QDeclarativeDeclarativeData;
+ return static_cast<QDeclarativeDeclarativeData *>(priv->declarativeData);
} else {
return 0;
}
@@ -115,19 +115,19 @@ public:
};
template<class T>
-void QmlGuard<T>::addGuard()
+void QDeclarativeGuard<T>::addGuard()
{
- QmlDeclarativeData *data = QmlDeclarativeData::get(o, true);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(o, true);
next = data->guards;
- if (next) reinterpret_cast<QmlGuard<T> *>(next)->prev = &next;
- data->guards = reinterpret_cast<QmlGuard<QObject> *>(this);
+ if (next) reinterpret_cast<QDeclarativeGuard<T> *>(next)->prev = &next;
+ data->guards = reinterpret_cast<QDeclarativeGuard<QObject> *>(this);
prev = &data->guards;
}
template<class T>
-void QmlGuard<T>::remGuard()
+void QDeclarativeGuard<T>::remGuard()
{
- if (next) reinterpret_cast<QmlGuard<T> *>(next)->prev = prev;
+ if (next) reinterpret_cast<QDeclarativeGuard<T> *>(next)->prev = prev;
*prev = next;
next = 0;
prev = 0;
@@ -135,4 +135,4 @@ void QmlGuard<T>::remGuard()
QT_END_NAMESPACE
-#endif // QMLDECLARATIVEDATA_P_H
+#endif // QDECLARATIVEDECLARATIVEDATA_P_H
diff --git a/src/declarative/qml/qmldirparser.cpp b/src/declarative/qml/qdeclarativedirparser.cpp
index 60beb72..e730b92 100644
--- a/src/declarative/qml/qmldirparser.cpp
+++ b/src/declarative/qml/qdeclarativedirparser.cpp
@@ -39,50 +39,50 @@
**
****************************************************************************/
-#include "qmldirparser_p.h"
-#include "qmlerror.h"
+#include "qdeclarativedirparser_p.h"
+#include "qdeclarativeerror.h"
#include <QtCore/QTextStream>
#include <QtCore/QtDebug>
QT_BEGIN_NAMESPACE
-QmlDirParser::QmlDirParser()
+QDeclarativeDirParser::QDeclarativeDirParser()
: _isParsed(false)
{
}
-QmlDirParser::~QmlDirParser()
+QDeclarativeDirParser::~QDeclarativeDirParser()
{
}
-QUrl QmlDirParser::url() const
+QUrl QDeclarativeDirParser::url() const
{
return _url;
}
-void QmlDirParser::setUrl(const QUrl &url)
+void QDeclarativeDirParser::setUrl(const QUrl &url)
{
_url = url;
}
-QString QmlDirParser::source() const
+QString QDeclarativeDirParser::source() const
{
return _source;
}
-void QmlDirParser::setSource(const QString &source)
+void QDeclarativeDirParser::setSource(const QString &source)
{
_isParsed = false;
_source = source;
}
-bool QmlDirParser::isParsed() const
+bool QDeclarativeDirParser::isParsed() const
{
return _isParsed;
}
-bool QmlDirParser::parse()
+bool QDeclarativeDirParser::parse()
{
if (_isParsed)
return true;
@@ -184,9 +184,9 @@ bool QmlDirParser::parse()
return hasError();
}
-void QmlDirParser::reportError(int line, int column, const QString &description)
+void QDeclarativeDirParser::reportError(int line, int column, const QString &description)
{
- QmlError error;
+ QDeclarativeError error;
error.setUrl(_url);
error.setLine(line);
error.setColumn(column);
@@ -194,7 +194,7 @@ void QmlDirParser::reportError(int line, int column, const QString &description)
_errors.append(error);
}
-bool QmlDirParser::hasError() const
+bool QDeclarativeDirParser::hasError() const
{
if (! _errors.isEmpty())
return true;
@@ -202,17 +202,17 @@ bool QmlDirParser::hasError() const
return false;
}
-QList<QmlError> QmlDirParser::errors() const
+QList<QDeclarativeError> QDeclarativeDirParser::errors() const
{
return _errors;
}
-QList<QmlDirParser::Plugin> QmlDirParser::plugins() const
+QList<QDeclarativeDirParser::Plugin> QDeclarativeDirParser::plugins() const
{
return _plugins;
}
-QList<QmlDirParser::Component> QmlDirParser::components() const
+QList<QDeclarativeDirParser::Component> QDeclarativeDirParser::components() const
{
return _components;
}
diff --git a/src/declarative/qml/qmldirparser_p.h b/src/declarative/qml/qdeclarativedirparser_p.h
index c58c03f..5df7117 100644
--- a/src/declarative/qml/qmldirparser_p.h
+++ b/src/declarative/qml/qdeclarativedirparser_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLDIRPARSER_P_H
-#define QMLDIRPARSER_P_H
+#ifndef QDECLARATIVEDIRPARSER_P_H
+#define QDECLARATIVEDIRPARSER_P_H
//
// W A R N I N G
@@ -58,15 +58,15 @@
QT_BEGIN_NAMESPACE
-class QmlError;
+class QDeclarativeError;
-class QmlDirParser
+class QDeclarativeDirParser
{
- Q_DISABLE_COPY(QmlDirParser)
+ Q_DISABLE_COPY(QDeclarativeDirParser)
public:
- QmlDirParser();
- ~QmlDirParser();
+ QDeclarativeDirParser();
+ ~QDeclarativeDirParser();
QUrl url() const;
void setUrl(const QUrl &url);
@@ -78,7 +78,7 @@ public:
bool parse();
bool hasError() const;
- QList<QmlError> errors() const;
+ QList<QDeclarativeError> errors() const;
struct Plugin
{
@@ -112,7 +112,7 @@ private:
void reportError(int line, int column, const QString &message);
private:
- QList<QmlError> _errors;
+ QList<QDeclarativeError> _errors;
QUrl _url;
QString _source;
QList<Component> _components;
@@ -122,4 +122,4 @@ private:
QT_END_NAMESPACE
-#endif // QMLDIRPARSER_P_H
+#endif // QDECLARATIVEDIRPARSER_P_H
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qdeclarativedom.cpp
index c75a299..6c81f34 100644
--- a/src/declarative/qml/qmldom.cpp
+++ b/src/declarative/qml/qdeclarativedom.cpp
@@ -39,14 +39,14 @@
**
****************************************************************************/
-#include "qmldom_p.h"
-#include "qmldom_p_p.h"
+#include "qdeclarativedom_p.h"
+#include "qdeclarativedom_p_p.h"
-#include "qmlcompositetypedata_p.h"
-#include "qmlcompiler_p.h"
-#include "qmlengine_p.h"
-#include "qmlscriptparser_p.h"
-#include "qmlglobal_p.h"
+#include "qdeclarativecompositetypedata_p.h"
+#include "qdeclarativecompiler_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativescriptparser_p.h"
+#include "qdeclarativeglobal_p.h"
#include <QtCore/QByteArray>
#include <QtCore/QDebug>
@@ -54,27 +54,27 @@
QT_BEGIN_NAMESPACE
-QmlDomDocumentPrivate::QmlDomDocumentPrivate()
+QDeclarativeDomDocumentPrivate::QDeclarativeDomDocumentPrivate()
: root(0)
{
}
-QmlDomDocumentPrivate::~QmlDomDocumentPrivate()
+QDeclarativeDomDocumentPrivate::~QDeclarativeDomDocumentPrivate()
{
if (root) root->release();
}
/*!
- \class QmlDomDocument
+ \class QDeclarativeDomDocument
\internal
- \brief The QmlDomDocument class represents the root of a QML document
+ \brief The QDeclarativeDomDocument class represents the root of a QML document
A QML document is a self-contained snippet of QML, usually contained in a
single file. Each document has a root object, accessible through
- QmlDomDocument::rootObject().
+ QDeclarativeDomDocument::rootObject().
- The QmlDomDocument class allows the programmer to inspect a QML document by
- calling QmlDomDocument::load().
+ The QDeclarativeDomDocument class allows the programmer to inspect a QML document by
+ calling QDeclarativeDomDocument::load().
The following example loads a QML file from disk, and prints out its root
object type and the properties assigned in the root object.
@@ -83,43 +83,43 @@ QmlDomDocumentPrivate::~QmlDomDocumentPrivate()
file.open(QIODevice::ReadOnly);
QByteArray xmlData = file.readAll();
- QmlDomDocument document;
+ QDeclarativeDomDocument document;
document.load(qmlengine, xmlData);
- QmlDomObject rootObject = document.rootObject();
+ QDeclarativeDomObject rootObject = document.rootObject();
qDebug() << rootObject.objectType();
- foreach(QmlDomProperty property, rootObject.properties())
+ foreach(QDeclarativeDomProperty property, rootObject.properties())
qDebug() << property.propertyName();
\endcode
*/
/*!
- Construct an empty QmlDomDocument.
+ Construct an empty QDeclarativeDomDocument.
*/
-QmlDomDocument::QmlDomDocument()
-: d(new QmlDomDocumentPrivate)
+QDeclarativeDomDocument::QDeclarativeDomDocument()
+: d(new QDeclarativeDomDocumentPrivate)
{
}
/*!
- Create a copy of \a other QmlDomDocument.
+ Create a copy of \a other QDeclarativeDomDocument.
*/
-QmlDomDocument::QmlDomDocument(const QmlDomDocument &other)
+QDeclarativeDomDocument::QDeclarativeDomDocument(const QDeclarativeDomDocument &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomDocument
+ Destroy the QDeclarativeDomDocument
*/
-QmlDomDocument::~QmlDomDocument()
+QDeclarativeDomDocument::~QDeclarativeDomDocument()
{
}
/*!
- Assign \a other to this QmlDomDocument.
+ Assign \a other to this QDeclarativeDomDocument.
*/
-QmlDomDocument &QmlDomDocument::operator=(const QmlDomDocument &other)
+QDeclarativeDomDocument &QDeclarativeDomDocument::operator=(const QDeclarativeDomDocument &other)
{
d = other.d;
return *this;
@@ -128,37 +128,37 @@ QmlDomDocument &QmlDomDocument::operator=(const QmlDomDocument &other)
/*!
Returns all import statements in qml.
*/
-QList<QmlDomImport> QmlDomDocument::imports() const
+QList<QDeclarativeDomImport> QDeclarativeDomDocument::imports() const
{
return d->imports;
}
/*!
- Loads a QmlDomDocument from \a data. \a data should be valid QML
+ Loads a QDeclarativeDomDocument from \a data. \a data should be valid QML
data. On success, true is returned. If the \a data is malformed, false
- is returned and QmlDomDocument::errors() contains an error description.
+ is returned and QDeclarativeDomDocument::errors() contains an error description.
- \sa QmlDomDocument::loadError()
+ \sa QDeclarativeDomDocument::loadError()
*/
-bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl &url)
+bool QDeclarativeDomDocument::load(QDeclarativeEngine *engine, const QByteArray &data, const QUrl &url)
{
d->errors.clear();
d->imports.clear();
- QmlCompiledData *component = new QmlCompiledData(engine);
- QmlCompiler compiler;
+ QDeclarativeCompiledData *component = new QDeclarativeCompiledData(engine);
+ QDeclarativeCompiler compiler;
- QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, url);
+ QDeclarativeCompositeTypeData *td = ((QDeclarativeEnginePrivate *)QDeclarativeEnginePrivate::get(engine))->typeManager.getImmediate(data, url);
- if(td->status == QmlCompositeTypeData::Error) {
+ if(td->status == QDeclarativeCompositeTypeData::Error) {
d->errors = td->errors;
td->release();
component->release();
return false;
- } else if(td->status == QmlCompositeTypeData::Waiting ||
- td->status == QmlCompositeTypeData::WaitingResources) {
- QmlError error;
- error.setDescription(QLatin1String("QmlDomDocument supports local types only"));
+ } else if(td->status == QDeclarativeCompositeTypeData::Waiting ||
+ td->status == QDeclarativeCompositeTypeData::WaitingResources) {
+ QDeclarativeError error;
+ error.setDescription(QLatin1String("QDeclarativeDomDocument supports local types only"));
d->errors << error;
td->release();
component->release();
@@ -175,9 +175,9 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl
}
for (int i = 0; i < td->data.imports().size(); ++i) {
- QmlScriptParser::Import parserImport = td->data.imports().at(i);
- QmlDomImport domImport;
- domImport.d->type = static_cast<QmlDomImportPrivate::Type>(parserImport.type);
+ QDeclarativeScriptParser::Import parserImport = td->data.imports().at(i);
+ QDeclarativeDomImport domImport;
+ domImport.d->type = static_cast<QDeclarativeDomImportPrivate::Type>(parserImport.type);
domImport.d->uri = parserImport.uri;
domImport.d->qualifier = parserImport.qualifier;
domImport.d->version = parserImport.version;
@@ -199,16 +199,16 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl
\sa load()
*/
-QList<QmlError> QmlDomDocument::errors() const
+QList<QDeclarativeError> QDeclarativeDomDocument::errors() const
{
return d->errors;
}
/*!
- Returns the document's root object, or an invalid QmlDomObject if the
+ Returns the document's root object, or an invalid QDeclarativeDomObject if the
document has no root.
- In the sample QML below, the root object will be the QmlGraphicsItem type.
+ In the sample QML below, the root object will be the QDeclarativeItem type.
\qml
Item {
Text {
@@ -217,81 +217,81 @@ Item {
}
\endqml
*/
-QmlDomObject QmlDomDocument::rootObject() const
+QDeclarativeDomObject QDeclarativeDomDocument::rootObject() const
{
- QmlDomObject rv;
+ QDeclarativeDomObject rv;
rv.d->object = d->root;
if (rv.d->object) rv.d->object->addref();
return rv;
}
-QmlDomPropertyPrivate::QmlDomPropertyPrivate()
+QDeclarativeDomPropertyPrivate::QDeclarativeDomPropertyPrivate()
: property(0)
{
}
-QmlDomPropertyPrivate::~QmlDomPropertyPrivate()
+QDeclarativeDomPropertyPrivate::~QDeclarativeDomPropertyPrivate()
{
if (property) property->release();
}
-QmlDomDynamicPropertyPrivate::QmlDomDynamicPropertyPrivate():
+QDeclarativeDomDynamicPropertyPrivate::QDeclarativeDomDynamicPropertyPrivate():
valid(false)
{
}
-QmlDomDynamicPropertyPrivate::~QmlDomDynamicPropertyPrivate()
+QDeclarativeDomDynamicPropertyPrivate::~QDeclarativeDomDynamicPropertyPrivate()
{
if (valid && property.defaultValue) property.defaultValue->release();
}
/*!
- \class QmlDomProperty
+ \class QDeclarativeDomProperty
\internal
- \brief The QmlDomProperty class represents one property assignment in the
+ \brief The QDeclarativeDomProperty class represents one property assignment in the
QML DOM tree
- Properties in QML can be assigned QML \l {QmlDomValue}{values}.
+ Properties in QML can be assigned QML \l {QDeclarativeDomValue}{values}.
- \sa QmlDomObject
+ \sa QDeclarativeDomObject
*/
/*!
- Construct an invalid QmlDomProperty.
+ Construct an invalid QDeclarativeDomProperty.
*/
-QmlDomProperty::QmlDomProperty()
-: d(new QmlDomPropertyPrivate)
+QDeclarativeDomProperty::QDeclarativeDomProperty()
+: d(new QDeclarativeDomPropertyPrivate)
{
}
/*!
- Create a copy of \a other QmlDomProperty.
+ Create a copy of \a other QDeclarativeDomProperty.
*/
-QmlDomProperty::QmlDomProperty(const QmlDomProperty &other)
+QDeclarativeDomProperty::QDeclarativeDomProperty(const QDeclarativeDomProperty &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomProperty.
+ Destroy the QDeclarativeDomProperty.
*/
-QmlDomProperty::~QmlDomProperty()
+QDeclarativeDomProperty::~QDeclarativeDomProperty()
{
}
/*!
- Assign \a other to this QmlDomProperty.
+ Assign \a other to this QDeclarativeDomProperty.
*/
-QmlDomProperty &QmlDomProperty::operator=(const QmlDomProperty &other)
+QDeclarativeDomProperty &QDeclarativeDomProperty::operator=(const QDeclarativeDomProperty &other)
{
d = other.d;
return *this;
}
/*!
- Returns true if this is a valid QmlDomProperty, false otherwise.
+ Returns true if this is a valid QDeclarativeDomProperty, false otherwise.
*/
-bool QmlDomProperty::isValid() const
+bool QDeclarativeDomProperty::isValid() const
{
return d->property != 0;
}
@@ -313,11 +313,11 @@ Text {
the full name is returned ("x", "y" and "font.bold") by this method.
For dot properties, a split version of the name can be accessed by calling
- QmlDomProperty::propertyNameParts().
+ QDeclarativeDomProperty::propertyNameParts().
- \sa QmlDomProperty::propertyNameParts()
+ \sa QDeclarativeDomProperty::propertyNameParts()
*/
-QByteArray QmlDomProperty::propertyName() const
+QByteArray QDeclarativeDomProperty::propertyName() const
{
return d->propertyName;
}
@@ -337,9 +337,9 @@ Text {
For each of the properties shown above, this method would return ("x"),
("y") and ("font", "bold").
- \sa QmlDomProperty::propertyName()
+ \sa QDeclarativeDomProperty::propertyName()
*/
-QList<QByteArray> QmlDomProperty::propertyNameParts() const
+QList<QByteArray> QDeclarativeDomProperty::propertyNameParts() const
{
if (d->propertyName.isEmpty()) return QList<QByteArray>();
else return d->propertyName.split('.');
@@ -360,18 +360,18 @@ QList<QByteArray> QmlDomProperty::propertyNameParts() const
property is used, and not only by whether the property is the types default
property.
*/
-bool QmlDomProperty::isDefaultProperty() const
+bool QDeclarativeDomProperty::isDefaultProperty() const
{
return d->property && d->property->isDefault;
}
/*!
- Returns the QmlDomValue that is assigned to this property, or an invalid
- QmlDomValue if no value is assigned.
+ Returns the QDeclarativeDomValue that is assigned to this property, or an invalid
+ QDeclarativeDomValue if no value is assigned.
*/
-QmlDomValue QmlDomProperty::value() const
+QDeclarativeDomValue QDeclarativeDomProperty::value() const
{
- QmlDomValue rv;
+ QDeclarativeDomValue rv;
if (d->property) {
rv.d->property = d->property;
rv.d->value = d->property->values.at(0);
@@ -385,7 +385,7 @@ QmlDomValue QmlDomProperty::value() const
Returns the position in the input data where the property ID startd, or -1 if
the property is invalid.
*/
-int QmlDomProperty::position() const
+int QDeclarativeDomProperty::position() const
{
if (d && d->property) {
return d->property->location.range.offset;
@@ -397,7 +397,7 @@ int QmlDomProperty::position() const
Returns the length in the input data from where the property ID started upto
the end of it, or -1 if the property is invalid.
*/
-int QmlDomProperty::length() const
+int QDeclarativeDomProperty::length() const
{
if (d && d->property)
return d->property->location.range.length;
@@ -406,38 +406,38 @@ int QmlDomProperty::length() const
}
/*!
- Construct an invalid QmlDomDynamicProperty.
+ Construct an invalid QDeclarativeDomDynamicProperty.
*/
-QmlDomDynamicProperty::QmlDomDynamicProperty():
- d(new QmlDomDynamicPropertyPrivate)
+QDeclarativeDomDynamicProperty::QDeclarativeDomDynamicProperty():
+ d(new QDeclarativeDomDynamicPropertyPrivate)
{
}
/*!
- Create a copy of \a other QmlDomDynamicProperty.
+ Create a copy of \a other QDeclarativeDomDynamicProperty.
*/
-QmlDomDynamicProperty::QmlDomDynamicProperty(const QmlDomDynamicProperty &other):
+QDeclarativeDomDynamicProperty::QDeclarativeDomDynamicProperty(const QDeclarativeDomDynamicProperty &other):
d(other.d)
{
}
/*!
- Destroy the QmlDomDynamicProperty.
+ Destroy the QDeclarativeDomDynamicProperty.
*/
-QmlDomDynamicProperty::~QmlDomDynamicProperty()
+QDeclarativeDomDynamicProperty::~QDeclarativeDomDynamicProperty()
{
}
/*!
- Assign \a other to this QmlDomDynamicProperty.
+ Assign \a other to this QDeclarativeDomDynamicProperty.
*/
-QmlDomDynamicProperty &QmlDomDynamicProperty::operator=(const QmlDomDynamicProperty &other)
+QDeclarativeDomDynamicProperty &QDeclarativeDomDynamicProperty::operator=(const QDeclarativeDomDynamicProperty &other)
{
d = other.d;
return *this;
}
-bool QmlDomDynamicProperty::isValid() const
+bool QDeclarativeDomDynamicProperty::isValid() const
{
return d && d->valid;
}
@@ -454,7 +454,7 @@ Item {
As illustrated above, a dynamic property name can have a name and a
default value ("10").
*/
-QByteArray QmlDomDynamicProperty::propertyName() const
+QByteArray QDeclarativeDomDynamicProperty::propertyName() const
{
if (isValid())
return d->property.name;
@@ -464,35 +464,35 @@ QByteArray QmlDomDynamicProperty::propertyName() const
/*!
Returns the type of the dynamic property. Note that when the property is an
- alias property, this will return -1. Use QmlDomProperty::isAlias() to check
+ alias property, this will return -1. Use QDeclarativeDomProperty::isAlias() to check
if the property is an alias.
*/
-int QmlDomDynamicProperty::propertyType() const
+int QDeclarativeDomDynamicProperty::propertyType() const
{
if (isValid()) {
switch (d->property.type) {
- case QmlParser::Object::DynamicProperty::Bool:
+ case QDeclarativeParser::Object::DynamicProperty::Bool:
return QMetaType::type("bool");
- case QmlParser::Object::DynamicProperty::Color:
+ case QDeclarativeParser::Object::DynamicProperty::Color:
return QMetaType::type("QColor");
- case QmlParser::Object::DynamicProperty::Date:
+ case QDeclarativeParser::Object::DynamicProperty::Date:
return QMetaType::type("QDate");
- case QmlParser::Object::DynamicProperty::Int:
+ case QDeclarativeParser::Object::DynamicProperty::Int:
return QMetaType::type("int");
- case QmlParser::Object::DynamicProperty::Real:
+ case QDeclarativeParser::Object::DynamicProperty::Real:
return QMetaType::type("double");
- case QmlParser::Object::DynamicProperty::String:
+ case QDeclarativeParser::Object::DynamicProperty::String:
return QMetaType::type("QString");
- case QmlParser::Object::DynamicProperty::Url:
+ case QDeclarativeParser::Object::DynamicProperty::Url:
return QMetaType::type("QUrl");
- case QmlParser::Object::DynamicProperty::Variant:
+ case QDeclarativeParser::Object::DynamicProperty::Variant:
return QMetaType::type("QVariant");
default:
@@ -503,7 +503,7 @@ int QmlDomDynamicProperty::propertyType() const
return -1;
}
-QByteArray QmlDomDynamicProperty::propertyTypeName() const
+QByteArray QDeclarativeDomDynamicProperty::propertyTypeName() const
{
if (isValid())
return d->property.customType;
@@ -526,7 +526,7 @@ QByteArray QmlDomDynamicProperty::propertyTypeName() const
property is used, and not only by whether the property is the types default
property.
*/
-bool QmlDomDynamicProperty::isDefaultProperty() const
+bool QDeclarativeDomDynamicProperty::isDefaultProperty() const
{
if (isValid())
return d->property.isDefaultProperty;
@@ -535,11 +535,11 @@ bool QmlDomDynamicProperty::isDefaultProperty() const
}
/*!
- Returns the default value as a QmlDomProperty.
+ Returns the default value as a QDeclarativeDomProperty.
*/
-QmlDomProperty QmlDomDynamicProperty::defaultValue() const
+QDeclarativeDomProperty QDeclarativeDomDynamicProperty::defaultValue() const
{
- QmlDomProperty rp;
+ QDeclarativeDomProperty rp;
if (isValid() && d->property.defaultValue) {
rp.d->property = d->property.defaultValue;
@@ -554,10 +554,10 @@ QmlDomProperty QmlDomDynamicProperty::defaultValue() const
Returns true if this dynamic property is an alias for another property,
false otherwise.
*/
-bool QmlDomDynamicProperty::isAlias() const
+bool QDeclarativeDomDynamicProperty::isAlias() const
{
if (isValid())
- return d->property.type == QmlParser::Object::DynamicProperty::Alias;
+ return d->property.type == QDeclarativeParser::Object::DynamicProperty::Alias;
else
return false;
}
@@ -566,7 +566,7 @@ bool QmlDomDynamicProperty::isAlias() const
Returns the position in the input data where the property ID startd, or 0 if
the property is invalid.
*/
-int QmlDomDynamicProperty::position() const
+int QDeclarativeDomDynamicProperty::position() const
{
if (isValid()) {
return d->property.location.range.offset;
@@ -578,7 +578,7 @@ int QmlDomDynamicProperty::position() const
Returns the length in the input data from where the property ID started upto
the end of it, or 0 if the property is invalid.
*/
-int QmlDomDynamicProperty::length() const
+int QDeclarativeDomDynamicProperty::length() const
{
if (isValid())
return d->property.location.range.length;
@@ -586,22 +586,22 @@ int QmlDomDynamicProperty::length() const
return -1;
}
-QmlDomObjectPrivate::QmlDomObjectPrivate()
+QDeclarativeDomObjectPrivate::QDeclarativeDomObjectPrivate()
: object(0)
{
}
-QmlDomObjectPrivate::~QmlDomObjectPrivate()
+QDeclarativeDomObjectPrivate::~QDeclarativeDomObjectPrivate()
{
if (object) object->release();
}
-QmlDomObjectPrivate::Properties
-QmlDomObjectPrivate::properties() const
+QDeclarativeDomObjectPrivate::Properties
+QDeclarativeDomObjectPrivate::properties() const
{
Properties rv;
- for (QHash<QByteArray, QmlParser::Property *>::ConstIterator iter =
+ for (QHash<QByteArray, QDeclarativeParser::Property *>::ConstIterator iter =
object->properties.begin();
iter != object->properties.end();
++iter) {
@@ -612,14 +612,14 @@ QmlDomObjectPrivate::properties() const
return rv;
}
-QmlDomObjectPrivate::Properties
-QmlDomObjectPrivate::properties(QmlParser::Property *property) const
+QDeclarativeDomObjectPrivate::Properties
+QDeclarativeDomObjectPrivate::properties(QDeclarativeParser::Property *property) const
{
Properties rv;
if (property->value) {
- for (QHash<QByteArray, QmlParser::Property *>::ConstIterator iter =
+ for (QHash<QByteArray, QDeclarativeParser::Property *>::ConstIterator iter =
property->value->properties.begin();
iter != property->value->properties.end();
++iter) {
@@ -640,16 +640,16 @@ QmlDomObjectPrivate::properties(QmlParser::Property *property) const
}
/*!
- \class QmlDomObject
+ \class QDeclarativeDomObject
\internal
- \brief The QmlDomObject class represents an object instantiation.
+ \brief The QDeclarativeDomObject class represents an object instantiation.
- Each object instantiated in a QML file has a corresponding QmlDomObject
+ Each object instantiated in a QML file has a corresponding QDeclarativeDomObject
node in the QML DOM.
In addition to the type information that determines the object to
- instantiate, QmlDomObject's also have a set of associated QmlDomProperty's.
- Each QmlDomProperty represents a QML property assignment on the instantiated
+ instantiate, QDeclarativeDomObject's also have a set of associated QDeclarativeDomProperty's.
+ Each QDeclarativeDomProperty represents a QML property assignment on the instantiated
object. For example,
\qml
@@ -659,48 +659,48 @@ QGraphicsWidget {
}
\endqml
- describes a single QmlDomObject - "QGraphicsWidget" - with two properties,
+ describes a single QDeclarativeDomObject - "QGraphicsWidget" - with two properties,
"opacity" and "size". Obviously QGraphicsWidget has many more properties than just
these two, but the QML DOM representation only contains those assigned
values (or bindings) in the QML file.
*/
/*!
- Construct an invalid QmlDomObject.
+ Construct an invalid QDeclarativeDomObject.
*/
-QmlDomObject::QmlDomObject()
-: d(new QmlDomObjectPrivate)
+QDeclarativeDomObject::QDeclarativeDomObject()
+: d(new QDeclarativeDomObjectPrivate)
{
}
/*!
- Create a copy of \a other QmlDomObject.
+ Create a copy of \a other QDeclarativeDomObject.
*/
-QmlDomObject::QmlDomObject(const QmlDomObject &other)
+QDeclarativeDomObject::QDeclarativeDomObject(const QDeclarativeDomObject &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomObject.
+ Destroy the QDeclarativeDomObject.
*/
-QmlDomObject::~QmlDomObject()
+QDeclarativeDomObject::~QDeclarativeDomObject()
{
}
/*!
- Assign \a other to this QmlDomObject.
+ Assign \a other to this QDeclarativeDomObject.
*/
-QmlDomObject &QmlDomObject::operator=(const QmlDomObject &other)
+QDeclarativeDomObject &QDeclarativeDomObject::operator=(const QDeclarativeDomObject &other)
{
d = other.d;
return *this;
}
/*!
- Returns true if this is a valid QmlDomObject, false otherwise.
+ Returns true if this is a valid QDeclarativeDomObject, false otherwise.
*/
-bool QmlDomObject::isValid() const
+bool QDeclarativeDomObject::isValid() const
{
return d->object != 0;
}
@@ -713,7 +713,7 @@ bool QmlDomObject::isValid() const
Rectangle { }
\endqml
*/
-QByteArray QmlDomObject::objectType() const
+QByteArray QDeclarativeDomObject::objectType() const
{
if (d->object) return d->object->typeName;
else return QByteArray();
@@ -727,7 +727,7 @@ QByteArray QmlDomObject::objectType() const
Rectangle { }
\endqml
*/
-QByteArray QmlDomObject::objectClassName() const
+QByteArray QDeclarativeDomObject::objectClassName() const
{
if (d->object)
return d->object->className;
@@ -735,7 +735,7 @@ QByteArray QmlDomObject::objectClassName() const
return QByteArray();
}
-int QmlDomObject::objectTypeMajorVersion() const
+int QDeclarativeDomObject::objectTypeMajorVersion() const
{
if (d->object)
return d->object->majorVersion;
@@ -743,7 +743,7 @@ int QmlDomObject::objectTypeMajorVersion() const
return -1;
}
-int QmlDomObject::objectTypeMinorVersion() const
+int QDeclarativeDomObject::objectTypeMinorVersion() const
{
if (d->object)
return d->object->minorVersion;
@@ -760,7 +760,7 @@ int QmlDomObject::objectTypeMinorVersion() const
Text { id: myText }
\endqml
*/
-QString QmlDomObject::objectId() const
+QString QDeclarativeDomObject::objectId() const
{
if (d->object) {
return d->object->id;
@@ -780,17 +780,17 @@ Text {
}
\endqml
*/
-QList<QmlDomProperty> QmlDomObject::properties() const
+QList<QDeclarativeDomProperty> QDeclarativeDomObject::properties() const
{
- QList<QmlDomProperty> rv;
+ QList<QDeclarativeDomProperty> rv;
if (!d->object || isComponent())
return rv;
- QmlDomObjectPrivate::Properties properties = d->properties();
+ QDeclarativeDomObjectPrivate::Properties properties = d->properties();
for (int ii = 0; ii < properties.count(); ++ii) {
- QmlDomProperty domProperty;
+ QDeclarativeDomProperty domProperty;
domProperty.d->property = properties.at(ii).first;
domProperty.d->property->addref();
domProperty.d->propertyName = properties.at(ii).second;
@@ -799,7 +799,7 @@ QList<QmlDomProperty> QmlDomObject::properties() const
}
if (d->object->defaultProperty) {
- QmlDomProperty domProperty;
+ QDeclarativeDomProperty domProperty;
domProperty.d->property = d->object->defaultProperty;
domProperty.d->property->addref();
domProperty.d->propertyName = d->object->defaultProperty->name;
@@ -811,31 +811,31 @@ QList<QmlDomProperty> QmlDomObject::properties() const
/*!
Returns the object's \a name property if a value has been assigned to
- it, or an invalid QmlDomProperty otherwise.
+ it, or an invalid QDeclarativeDomProperty otherwise.
In the example below, \c {object.property("source")} would return a valid
- QmlDomProperty, and \c {object.property("tile")} an invalid QmlDomProperty.
+ QDeclarativeDomProperty, and \c {object.property("tile")} an invalid QDeclarativeDomProperty.
\qml
Image { source: "sample.jpg" }
\endqml
*/
-QmlDomProperty QmlDomObject::property(const QByteArray &name) const
+QDeclarativeDomProperty QDeclarativeDomObject::property(const QByteArray &name) const
{
- QList<QmlDomProperty> props = properties();
+ QList<QDeclarativeDomProperty> props = properties();
for (int ii = 0; ii < props.count(); ++ii)
if (props.at(ii).propertyName() == name)
return props.at(ii);
- return QmlDomProperty();
+ return QDeclarativeDomProperty();
}
-QList<QmlDomDynamicProperty> QmlDomObject::dynamicProperties() const
+QList<QDeclarativeDomDynamicProperty> QDeclarativeDomObject::dynamicProperties() const
{
- QList<QmlDomDynamicProperty> properties;
+ QList<QDeclarativeDomDynamicProperty> properties;
for (int i = 0; i < d->object->dynamicProperties.size(); ++i) {
- QmlDomDynamicProperty p;
- p.d = new QmlDomDynamicPropertyPrivate;
+ QDeclarativeDomDynamicProperty p;
+ p.d = new QDeclarativeDomDynamicPropertyPrivate;
p.d->property = d->object->dynamicProperties.at(i);
p.d->valid = true;
@@ -848,16 +848,16 @@ QList<QmlDomDynamicProperty> QmlDomObject::dynamicProperties() const
return properties;
}
-QmlDomDynamicProperty QmlDomObject::dynamicProperty(const QByteArray &name) const
+QDeclarativeDomDynamicProperty QDeclarativeDomObject::dynamicProperty(const QByteArray &name) const
{
- QmlDomDynamicProperty p;
+ QDeclarativeDomDynamicProperty p;
if (!isValid())
return p;
for (int i = 0; i < d->object->dynamicProperties.size(); ++i) {
if (d->object->dynamicProperties.at(i).name == name) {
- p.d = new QmlDomDynamicPropertyPrivate;
+ p.d = new QDeclarativeDomDynamicPropertyPrivate;
p.d->property = d->object->dynamicProperties.at(i);
if (p.d->property.defaultValue) p.d->property.defaultValue->addref();
p.d->valid = true;
@@ -875,9 +875,9 @@ QmlDomDynamicProperty QmlDomObject::dynamicProperty(const QByteArray &name) cons
\note Currently this method will always return false, and is a placekeeper
for future functionality.
- \sa QmlDomObject::customTypeData()
+ \sa QDeclarativeDomObject::customTypeData()
*/
-bool QmlDomObject::isCustomType() const
+bool QDeclarativeDomObject::isCustomType() const
{
return false;
}
@@ -885,36 +885,36 @@ bool QmlDomObject::isCustomType() const
/*!
If this object represents a custom type, returns the data associated with
the custom type, otherwise returns an empty QByteArray().
- QmlDomObject::isCustomType() can be used to check if this object represents
+ QDeclarativeDomObject::isCustomType() can be used to check if this object represents
a custom type.
*/
-QByteArray QmlDomObject::customTypeData() const
+QByteArray QDeclarativeDomObject::customTypeData() const
{
return QByteArray();
}
/*!
Returns true if this object is a sub-component object. Sub-component
- objects can be converted into QmlDomComponent instances by calling
- QmlDomObject::toComponent().
+ objects can be converted into QDeclarativeDomComponent instances by calling
+ QDeclarativeDomObject::toComponent().
- \sa QmlDomObject::toComponent()
+ \sa QDeclarativeDomObject::toComponent()
*/
-bool QmlDomObject::isComponent() const
+bool QDeclarativeDomObject::isComponent() const
{
return (d->object && d->object->typeName == "Qt/Component");
}
/*!
- Returns a QmlDomComponent for this object if it is a sub-component, or
- an invalid QmlDomComponent if not. QmlDomObject::isComponent() can be used
+ Returns a QDeclarativeDomComponent for this object if it is a sub-component, or
+ an invalid QDeclarativeDomComponent if not. QDeclarativeDomObject::isComponent() can be used
to check if this object represents a sub-component.
- \sa QmlDomObject::isComponent()
+ \sa QDeclarativeDomObject::isComponent()
*/
-QmlDomComponent QmlDomObject::toComponent() const
+QDeclarativeDomComponent QDeclarativeDomObject::toComponent() const
{
- QmlDomComponent rv;
+ QDeclarativeDomComponent rv;
if (isComponent())
rv.d = d;
return rv;
@@ -924,7 +924,7 @@ QmlDomComponent QmlDomObject::toComponent() const
Returns the position in the input data where the property assignment started
, or -1 if the property is invalid.
*/
-int QmlDomObject::position() const
+int QDeclarativeDomObject::position() const
{
if (d && d->object)
return d->object->location.range.offset;
@@ -936,7 +936,7 @@ int QmlDomObject::position() const
Returns the length in the input data from where the property assignment star
ted upto the end of it, or -1 if the property is invalid.
*/
-int QmlDomObject::length() const
+int QDeclarativeDomObject::length() const
{
if (d && d->object)
return d->object->location.range.length;
@@ -946,7 +946,7 @@ int QmlDomObject::length() const
// Returns the URL of the type, if it is an external type, or an empty URL if
// not
-QUrl QmlDomObject::url() const
+QUrl QDeclarativeDomObject::url() const
{
if (d && d->object)
return d->object->url;
@@ -954,20 +954,20 @@ QUrl QmlDomObject::url() const
return QUrl();
}
-QmlDomBasicValuePrivate::QmlDomBasicValuePrivate()
+QDeclarativeDomBasicValuePrivate::QDeclarativeDomBasicValuePrivate()
: value(0)
{
}
-QmlDomBasicValuePrivate::~QmlDomBasicValuePrivate()
+QDeclarativeDomBasicValuePrivate::~QDeclarativeDomBasicValuePrivate()
{
if (value) value->release();
}
/*!
- \class QmlDomValueLiteral
+ \class QDeclarativeDomValueLiteral
\internal
- \brief The QmlDomValueLiteral class represents a literal value.
+ \brief The QDeclarativeDomValueLiteral class represents a literal value.
A literal value is a simple value, written inline with the QML. In the
example below, the "x", "y" and "color" properties are being assigned
@@ -983,32 +983,32 @@ Rectangle {
*/
/*!
- Construct an empty QmlDomValueLiteral.
+ Construct an empty QDeclarativeDomValueLiteral.
*/
-QmlDomValueLiteral::QmlDomValueLiteral():
- d(new QmlDomBasicValuePrivate)
+QDeclarativeDomValueLiteral::QDeclarativeDomValueLiteral():
+ d(new QDeclarativeDomBasicValuePrivate)
{
}
/*!
- Create a copy of \a other QmlDomValueLiteral.
+ Create a copy of \a other QDeclarativeDomValueLiteral.
*/
-QmlDomValueLiteral::QmlDomValueLiteral(const QmlDomValueLiteral &other)
+QDeclarativeDomValueLiteral::QDeclarativeDomValueLiteral(const QDeclarativeDomValueLiteral &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomValueLiteral.
+ Destroy the QDeclarativeDomValueLiteral.
*/
-QmlDomValueLiteral::~QmlDomValueLiteral()
+QDeclarativeDomValueLiteral::~QDeclarativeDomValueLiteral()
{
}
/*!
- Assign \a other to this QmlDomValueLiteral.
+ Assign \a other to this QDeclarativeDomValueLiteral.
*/
-QmlDomValueLiteral &QmlDomValueLiteral::operator=(const QmlDomValueLiteral &other)
+QDeclarativeDomValueLiteral &QDeclarativeDomValueLiteral::operator=(const QDeclarativeDomValueLiteral &other)
{
d = other.d;
return *this;
@@ -1022,16 +1022,16 @@ QmlDomValueLiteral &QmlDomValueLiteral::operator=(const QmlDomValueLiteral &othe
Rectangle { x: 10 }
\endqml
*/
-QString QmlDomValueLiteral::literal() const
+QString QDeclarativeDomValueLiteral::literal() const
{
if (d->value) return d->value->primitive();
else return QString();
}
/*!
- \class QmlDomValueBinding
+ \class QDeclarativeDomValueBinding
\internal
- \brief The QmlDomValueBinding class represents a property binding.
+ \brief The QDeclarativeDomValueBinding class represents a property binding.
A property binding is an ECMAScript expression assigned to a property. In
the example below, the "x" property is being assigned a property binding.
@@ -1042,32 +1042,32 @@ Rectangle { x: Other.x }
*/
/*!
- Construct an empty QmlDomValueBinding.
+ Construct an empty QDeclarativeDomValueBinding.
*/
-QmlDomValueBinding::QmlDomValueBinding():
- d(new QmlDomBasicValuePrivate)
+QDeclarativeDomValueBinding::QDeclarativeDomValueBinding():
+ d(new QDeclarativeDomBasicValuePrivate)
{
}
/*!
- Create a copy of \a other QmlDomValueBinding.
+ Create a copy of \a other QDeclarativeDomValueBinding.
*/
-QmlDomValueBinding::QmlDomValueBinding(const QmlDomValueBinding &other)
+QDeclarativeDomValueBinding::QDeclarativeDomValueBinding(const QDeclarativeDomValueBinding &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomValueBinding.
+ Destroy the QDeclarativeDomValueBinding.
*/
-QmlDomValueBinding::~QmlDomValueBinding()
+QDeclarativeDomValueBinding::~QDeclarativeDomValueBinding()
{
}
/*!
- Assign \a other to this QmlDomValueBinding.
+ Assign \a other to this QDeclarativeDomValueBinding.
*/
-QmlDomValueBinding &QmlDomValueBinding::operator=(const QmlDomValueBinding &other)
+QDeclarativeDomValueBinding &QDeclarativeDomValueBinding::operator=(const QDeclarativeDomValueBinding &other)
{
d = other.d;
return *this;
@@ -1081,7 +1081,7 @@ QmlDomValueBinding &QmlDomValueBinding::operator=(const QmlDomValueBinding &othe
Rectangle { x: Other.x }
\endqml
*/
-QString QmlDomValueBinding::binding() const
+QString QDeclarativeDomValueBinding::binding() const
{
if (d->value)
return d->value->value.asScript();
@@ -1090,12 +1090,12 @@ QString QmlDomValueBinding::binding() const
}
/*!
- \class QmlDomValueValueSource
+ \class QDeclarativeDomValueValueSource
\internal
- \brief The QmlDomValueValueSource class represents a value source assignment value.
+ \brief The QDeclarativeDomValueValueSource class represents a value source assignment value.
In QML, value sources are special value generating types that may be
- assigned to properties. Value sources inherit the QmlPropertyValueSource
+ assigned to properties. Value sources inherit the QDeclarativePropertyValueSource
class. In the example below, the "x" property is being assigned the
NumberAnimation value source.
@@ -1112,32 +1112,32 @@ Rectangle {
*/
/*!
- Construct an empty QmlDomValueValueSource.
+ Construct an empty QDeclarativeDomValueValueSource.
*/
-QmlDomValueValueSource::QmlDomValueValueSource():
- d(new QmlDomBasicValuePrivate)
+QDeclarativeDomValueValueSource::QDeclarativeDomValueValueSource():
+ d(new QDeclarativeDomBasicValuePrivate)
{
}
/*!
- Create a copy of \a other QmlDomValueValueSource.
+ Create a copy of \a other QDeclarativeDomValueValueSource.
*/
-QmlDomValueValueSource::QmlDomValueValueSource(const QmlDomValueValueSource &other)
+QDeclarativeDomValueValueSource::QDeclarativeDomValueValueSource(const QDeclarativeDomValueValueSource &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomValueValueSource.
+ Destroy the QDeclarativeDomValueValueSource.
*/
-QmlDomValueValueSource::~QmlDomValueValueSource()
+QDeclarativeDomValueValueSource::~QDeclarativeDomValueValueSource()
{
}
/*!
- Assign \a other to this QmlDomValueValueSource.
+ Assign \a other to this QDeclarativeDomValueValueSource.
*/
-QmlDomValueValueSource &QmlDomValueValueSource::operator=(const QmlDomValueValueSource &other)
+QDeclarativeDomValueValueSource &QDeclarativeDomValueValueSource::operator=(const QDeclarativeDomValueValueSource &other)
{
d = other.d;
return *this;
@@ -1159,9 +1159,9 @@ Rectangle {
}
\endqml
*/
-QmlDomObject QmlDomValueValueSource::object() const
+QDeclarativeDomObject QDeclarativeDomValueValueSource::object() const
{
- QmlDomObject rv;
+ QDeclarativeDomObject rv;
if (d->value) {
rv.d->object = d->value->object;
rv.d->object->addref();
@@ -1170,12 +1170,12 @@ QmlDomObject QmlDomValueValueSource::object() const
}
/*!
- \class QmlDomValueValueInterceptor
+ \class QDeclarativeDomValueValueInterceptor
\internal
- \brief The QmlDomValueValueInterceptor class represents a value interceptor assignment value.
+ \brief The QDeclarativeDomValueValueInterceptor class represents a value interceptor assignment value.
In QML, value interceptor are special write-intercepting types that may be
- assigned to properties. Value interceptor inherit the QmlPropertyValueInterceptor
+ assigned to properties. Value interceptor inherit the QDeclarativePropertyValueInterceptor
class. In the example below, the "x" property is being assigned the
Behavior value interceptor.
@@ -1187,32 +1187,32 @@ Rectangle {
*/
/*!
- Construct an empty QmlDomValueValueInterceptor.
+ Construct an empty QDeclarativeDomValueValueInterceptor.
*/
-QmlDomValueValueInterceptor::QmlDomValueValueInterceptor():
- d(new QmlDomBasicValuePrivate)
+QDeclarativeDomValueValueInterceptor::QDeclarativeDomValueValueInterceptor():
+ d(new QDeclarativeDomBasicValuePrivate)
{
}
/*!
- Create a copy of \a other QmlDomValueValueInterceptor.
+ Create a copy of \a other QDeclarativeDomValueValueInterceptor.
*/
-QmlDomValueValueInterceptor::QmlDomValueValueInterceptor(const QmlDomValueValueInterceptor &other)
+QDeclarativeDomValueValueInterceptor::QDeclarativeDomValueValueInterceptor(const QDeclarativeDomValueValueInterceptor &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomValueValueInterceptor.
+ Destroy the QDeclarativeDomValueValueInterceptor.
*/
-QmlDomValueValueInterceptor::~QmlDomValueValueInterceptor()
+QDeclarativeDomValueValueInterceptor::~QDeclarativeDomValueValueInterceptor()
{
}
/*!
- Assign \a other to this QmlDomValueValueInterceptor.
+ Assign \a other to this QDeclarativeDomValueValueInterceptor.
*/
-QmlDomValueValueInterceptor &QmlDomValueValueInterceptor::operator=(const QmlDomValueValueInterceptor &other)
+QDeclarativeDomValueValueInterceptor &QDeclarativeDomValueValueInterceptor::operator=(const QDeclarativeDomValueValueInterceptor &other)
{
d = other.d;
return *this;
@@ -1229,9 +1229,9 @@ Rectangle {
}
\endqml
*/
-QmlDomObject QmlDomValueValueInterceptor::object() const
+QDeclarativeDomObject QDeclarativeDomValueValueInterceptor::object() const
{
- QmlDomObject rv;
+ QDeclarativeDomObject rv;
if (d->value) {
rv.d->object = d->value->object;
rv.d->object->addref();
@@ -1239,26 +1239,26 @@ QmlDomObject QmlDomValueValueInterceptor::object() const
return rv;
}
-QmlDomValuePrivate::QmlDomValuePrivate()
+QDeclarativeDomValuePrivate::QDeclarativeDomValuePrivate()
: property(0), value(0)
{
}
-QmlDomValuePrivate::~QmlDomValuePrivate()
+QDeclarativeDomValuePrivate::~QDeclarativeDomValuePrivate()
{
if (property) property->release();
if (value) value->release();
}
/*!
- \class QmlDomValue
+ \class QDeclarativeDomValue
\internal
- \brief The QmlDomValue class represents a generic Qml value.
+ \brief The QDeclarativeDomValue class represents a generic Qml value.
- QmlDomValue's can be assigned to QML \l {QmlDomProperty}{properties}. In
+ QDeclarativeDomValue's can be assigned to QML \l {QDeclarativeDomProperty}{properties}. In
QML, properties can be assigned various different values, including basic
literals, property bindings, property value sources, objects and lists of
- values. The QmlDomValue class allows a programmer to determine the specific
+ values. The QDeclarativeDomValue class allows a programmer to determine the specific
value type being assigned and access more detailed information through a
corresponding value type class.
@@ -1276,101 +1276,101 @@ Text {
above example from C++,
\code
- QmlDomDocument document;
- QmlDomObject root = document.rootObject();
+ QDeclarativeDomDocument document;
+ QDeclarativeDomObject root = document.rootObject();
- QmlDomProperty text = root.property("text");
+ QDeclarativeDomProperty text = root.property("text");
if (text.value().isLiteral()) {
- QmlDomValueLiteral literal = text.value().toLiteral();
+ QDeclarativeDomValueLiteral literal = text.value().toLiteral();
qDebug() << literal.literal();
}
- QmlDomProperty y = root.property("y");
+ QDeclarativeDomProperty y = root.property("y");
if (y.value().isBinding()) {
- QmlDomValueBinding binding = y.value().toBinding();
+ QDeclarativeDomValueBinding binding = y.value().toBinding();
qDebug() << binding.binding();
}
\endcode
*/
/*!
- Construct an invalid QmlDomValue.
+ Construct an invalid QDeclarativeDomValue.
*/
-QmlDomValue::QmlDomValue()
-: d(new QmlDomValuePrivate)
+QDeclarativeDomValue::QDeclarativeDomValue()
+: d(new QDeclarativeDomValuePrivate)
{
}
/*!
- Create a copy of \a other QmlDomValue.
+ Create a copy of \a other QDeclarativeDomValue.
*/
-QmlDomValue::QmlDomValue(const QmlDomValue &other)
+QDeclarativeDomValue::QDeclarativeDomValue(const QDeclarativeDomValue &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomValue
+ Destroy the QDeclarativeDomValue
*/
-QmlDomValue::~QmlDomValue()
+QDeclarativeDomValue::~QDeclarativeDomValue()
{
}
/*!
- Assign \a other to this QmlDomValue.
+ Assign \a other to this QDeclarativeDomValue.
*/
-QmlDomValue &QmlDomValue::operator=(const QmlDomValue &other)
+QDeclarativeDomValue &QDeclarativeDomValue::operator=(const QDeclarativeDomValue &other)
{
d = other.d;
return *this;
}
/*!
- \enum QmlDomValue::Type
+ \enum QDeclarativeDomValue::Type
- The type of the QmlDomValue node.
+ The type of the QDeclarativeDomValue node.
- \value Invalid The QmlDomValue is invalid.
- \value Literal The QmlDomValue is a literal value assignment. Use QmlDomValue::toLiteral() to access the type instance.
- \value PropertyBinding The QmlDomValue is a property binding. Use QmlDomValue::toBinding() to access the type instance.
- \value ValueSource The QmlDomValue is a property value source. Use QmlDomValue::toValueSource() to access the type instance.
- \value ValueInterceptor The QmlDomValue is a property value interceptor. Use QmlDomValue::toValueInterceptor() to access the type instance.
- \value Object The QmlDomValue is an object assignment. Use QmlDomValue::toObject() to access the type instnace.
- \value List The QmlDomValue is a list of other values. Use QmlDomValue::toList() to access the type instance.
+ \value Invalid The QDeclarativeDomValue is invalid.
+ \value Literal The QDeclarativeDomValue is a literal value assignment. Use QDeclarativeDomValue::toLiteral() to access the type instance.
+ \value PropertyBinding The QDeclarativeDomValue is a property binding. Use QDeclarativeDomValue::toBinding() to access the type instance.
+ \value ValueSource The QDeclarativeDomValue is a property value source. Use QDeclarativeDomValue::toValueSource() to access the type instance.
+ \value ValueInterceptor The QDeclarativeDomValue is a property value interceptor. Use QDeclarativeDomValue::toValueInterceptor() to access the type instance.
+ \value Object The QDeclarativeDomValue is an object assignment. Use QDeclarativeDomValue::toObject() to access the type instnace.
+ \value List The QDeclarativeDomValue is a list of other values. Use QDeclarativeDomValue::toList() to access the type instance.
*/
/*!
- Returns the type of this QmlDomValue.
+ Returns the type of this QDeclarativeDomValue.
*/
-QmlDomValue::Type QmlDomValue::type() const
+QDeclarativeDomValue::Type QDeclarativeDomValue::type() const
{
if (d->property)
- if (QmlMetaType::isList(d->property->type) ||
+ if (QDeclarativeMetaType::isList(d->property->type) ||
(d->property && d->property->values.count() > 1))
return List;
- QmlParser::Value *value = d->value;
+ QDeclarativeParser::Value *value = d->value;
if (!value && !d->property)
return Invalid;
switch(value->type) {
- case QmlParser::Value::Unknown:
+ case QDeclarativeParser::Value::Unknown:
return Invalid;
- case QmlParser::Value::Literal:
+ case QDeclarativeParser::Value::Literal:
return Literal;
- case QmlParser::Value::PropertyBinding:
+ case QDeclarativeParser::Value::PropertyBinding:
return PropertyBinding;
- case QmlParser::Value::ValueSource:
+ case QDeclarativeParser::Value::ValueSource:
return ValueSource;
- case QmlParser::Value::ValueInterceptor:
+ case QDeclarativeParser::Value::ValueInterceptor:
return ValueInterceptor;
- case QmlParser::Value::CreatedObject:
+ case QDeclarativeParser::Value::CreatedObject:
return Object;
- case QmlParser::Value::SignalObject:
+ case QDeclarativeParser::Value::SignalObject:
return Invalid;
- case QmlParser::Value::SignalExpression:
+ case QDeclarativeParser::Value::SignalExpression:
return Literal;
- case QmlParser::Value::Id:
+ case QDeclarativeParser::Value::Id:
return Literal;
}
return Invalid;
@@ -1379,7 +1379,7 @@ QmlDomValue::Type QmlDomValue::type() const
/*!
Returns true if this is an invalid value, otherwise false.
*/
-bool QmlDomValue::isInvalid() const
+bool QDeclarativeDomValue::isInvalid() const
{
return type() == Invalid;
}
@@ -1387,7 +1387,7 @@ bool QmlDomValue::isInvalid() const
/*!
Returns true if this is a literal value, otherwise false.
*/
-bool QmlDomValue::isLiteral() const
+bool QDeclarativeDomValue::isLiteral() const
{
return type() == Literal;
}
@@ -1395,7 +1395,7 @@ bool QmlDomValue::isLiteral() const
/*!
Returns true if this is a property binding value, otherwise false.
*/
-bool QmlDomValue::isBinding() const
+bool QDeclarativeDomValue::isBinding() const
{
return type() == PropertyBinding;
}
@@ -1403,7 +1403,7 @@ bool QmlDomValue::isBinding() const
/*!
Returns true if this is a value source value, otherwise false.
*/
-bool QmlDomValue::isValueSource() const
+bool QDeclarativeDomValue::isValueSource() const
{
return type() == ValueSource;
}
@@ -1411,7 +1411,7 @@ bool QmlDomValue::isValueSource() const
/*!
Returns true if this is a value interceptor value, otherwise false.
*/
-bool QmlDomValue::isValueInterceptor() const
+bool QDeclarativeDomValue::isValueInterceptor() const
{
return type() == ValueInterceptor;
}
@@ -1419,7 +1419,7 @@ bool QmlDomValue::isValueInterceptor() const
/*!
Returns true if this is an object value, otherwise false.
*/
-bool QmlDomValue::isObject() const
+bool QDeclarativeDomValue::isObject() const
{
return type() == Object;
}
@@ -1427,20 +1427,20 @@ bool QmlDomValue::isObject() const
/*!
Returns true if this is a list value, otherwise false.
*/
-bool QmlDomValue::isList() const
+bool QDeclarativeDomValue::isList() const
{
return type() == List;
}
/*!
- Returns a QmlDomValueLiteral if this value is a literal type, otherwise
- returns an invalid QmlDomValueLiteral.
+ Returns a QDeclarativeDomValueLiteral if this value is a literal type, otherwise
+ returns an invalid QDeclarativeDomValueLiteral.
- \sa QmlDomValue::type()
+ \sa QDeclarativeDomValue::type()
*/
-QmlDomValueLiteral QmlDomValue::toLiteral() const
+QDeclarativeDomValueLiteral QDeclarativeDomValue::toLiteral() const
{
- QmlDomValueLiteral rv;
+ QDeclarativeDomValueLiteral rv;
if (type() == Literal) {
rv.d->value = d->value;
rv.d->value->addref();
@@ -1449,14 +1449,14 @@ QmlDomValueLiteral QmlDomValue::toLiteral() const
}
/*!
- Returns a QmlDomValueBinding if this value is a property binding type,
- otherwise returns an invalid QmlDomValueBinding.
+ Returns a QDeclarativeDomValueBinding if this value is a property binding type,
+ otherwise returns an invalid QDeclarativeDomValueBinding.
- \sa QmlDomValue::type()
+ \sa QDeclarativeDomValue::type()
*/
-QmlDomValueBinding QmlDomValue::toBinding() const
+QDeclarativeDomValueBinding QDeclarativeDomValue::toBinding() const
{
- QmlDomValueBinding rv;
+ QDeclarativeDomValueBinding rv;
if (type() == PropertyBinding) {
rv.d->value = d->value;
rv.d->value->addref();
@@ -1465,14 +1465,14 @@ QmlDomValueBinding QmlDomValue::toBinding() const
}
/*!
- Returns a QmlDomValueValueSource if this value is a property value source
- type, otherwise returns an invalid QmlDomValueValueSource.
+ Returns a QDeclarativeDomValueValueSource if this value is a property value source
+ type, otherwise returns an invalid QDeclarativeDomValueValueSource.
- \sa QmlDomValue::type()
+ \sa QDeclarativeDomValue::type()
*/
-QmlDomValueValueSource QmlDomValue::toValueSource() const
+QDeclarativeDomValueValueSource QDeclarativeDomValue::toValueSource() const
{
- QmlDomValueValueSource rv;
+ QDeclarativeDomValueValueSource rv;
if (type() == ValueSource) {
rv.d->value = d->value;
rv.d->value->addref();
@@ -1481,14 +1481,14 @@ QmlDomValueValueSource QmlDomValue::toValueSource() const
}
/*!
- Returns a QmlDomValueValueInterceptor if this value is a property value interceptor
- type, otherwise returns an invalid QmlDomValueValueInterceptor.
+ Returns a QDeclarativeDomValueValueInterceptor if this value is a property value interceptor
+ type, otherwise returns an invalid QDeclarativeDomValueValueInterceptor.
- \sa QmlDomValue::type()
+ \sa QDeclarativeDomValue::type()
*/
-QmlDomValueValueInterceptor QmlDomValue::toValueInterceptor() const
+QDeclarativeDomValueValueInterceptor QDeclarativeDomValue::toValueInterceptor() const
{
- QmlDomValueValueInterceptor rv;
+ QDeclarativeDomValueValueInterceptor rv;
if (type() == ValueInterceptor) {
rv.d->value = d->value;
rv.d->value->addref();
@@ -1497,14 +1497,14 @@ QmlDomValueValueInterceptor QmlDomValue::toValueInterceptor() const
}
/*!
- Returns a QmlDomObject if this value is an object assignment type, otherwise
- returns an invalid QmlDomObject.
+ Returns a QDeclarativeDomObject if this value is an object assignment type, otherwise
+ returns an invalid QDeclarativeDomObject.
- \sa QmlDomValue::type()
+ \sa QDeclarativeDomValue::type()
*/
-QmlDomObject QmlDomValue::toObject() const
+QDeclarativeDomObject QDeclarativeDomValue::toObject() const
{
- QmlDomObject rv;
+ QDeclarativeDomObject rv;
if (type() == Object) {
rv.d->object = d->value->object;
rv.d->object->addref();
@@ -1513,14 +1513,14 @@ QmlDomObject QmlDomValue::toObject() const
}
/*!
- Returns a QmlDomList if this value is a list type, otherwise returns an
- invalid QmlDomList.
+ Returns a QDeclarativeDomList if this value is a list type, otherwise returns an
+ invalid QDeclarativeDomList.
- \sa QmlDomValue::type()
+ \sa QDeclarativeDomValue::type()
*/
-QmlDomList QmlDomValue::toList() const
+QDeclarativeDomList QDeclarativeDomValue::toList() const
{
- QmlDomList rv;
+ QDeclarativeDomList rv;
if (type() == List) {
rv.d = d;
}
@@ -1531,7 +1531,7 @@ QmlDomList QmlDomValue::toList() const
Returns the position in the input data where the property value startd, or -1
if the value is invalid.
*/
-int QmlDomValue::position() const
+int QDeclarativeDomValue::position() const
{
if (type() == Invalid)
return -1;
@@ -1543,7 +1543,7 @@ int QmlDomValue::position() const
Returns the length in the input data from where the property value started u
pto the end of it, or -1 if the value is invalid.
*/
-int QmlDomValue::length() const
+int QDeclarativeDomValue::length() const
{
if (type() == Invalid)
return -1;
@@ -1552,9 +1552,9 @@ int QmlDomValue::length() const
}
/*!
- \class QmlDomList
+ \class QDeclarativeDomList
\internal
- \brief The QmlDomList class represents a list of values assigned to a QML property.
+ \brief The QDeclarativeDomList class represents a list of values assigned to a QML property.
Lists of values can be assigned to properties. For example, the following
example assigns multiple objects to Item's "children" property
@@ -1568,7 +1568,7 @@ Item {
\endqml
Lists can also be implicitly created by assigning multiple
- \l {QmlDomValueValueSource}{value sources} or constants to a property.
+ \l {QDeclarativeDomValueValueSource}{value sources} or constants to a property.
\qml
Item {
x: 10
@@ -1582,47 +1582,47 @@ Item {
*/
/*!
- Construct an empty QmlDomList.
+ Construct an empty QDeclarativeDomList.
*/
-QmlDomList::QmlDomList()
+QDeclarativeDomList::QDeclarativeDomList()
{
}
/*!
- Create a copy of \a other QmlDomList.
+ Create a copy of \a other QDeclarativeDomList.
*/
-QmlDomList::QmlDomList(const QmlDomList &other)
+QDeclarativeDomList::QDeclarativeDomList(const QDeclarativeDomList &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomList.
+ Destroy the QDeclarativeDomList.
*/
-QmlDomList::~QmlDomList()
+QDeclarativeDomList::~QDeclarativeDomList()
{
}
/*!
- Assign \a other to this QmlDomList.
+ Assign \a other to this QDeclarativeDomList.
*/
-QmlDomList &QmlDomList::operator=(const QmlDomList &other)
+QDeclarativeDomList &QDeclarativeDomList::operator=(const QDeclarativeDomList &other)
{
d = other.d;
return *this;
}
/*!
- Returns the list of QmlDomValue's.
+ Returns the list of QDeclarativeDomValue's.
*/
-QList<QmlDomValue> QmlDomList::values() const
+QList<QDeclarativeDomValue> QDeclarativeDomList::values() const
{
- QList<QmlDomValue> rv;
+ QList<QDeclarativeDomValue> rv;
if (!d->property)
return rv;
for (int ii = 0; ii < d->property->values.count(); ++ii) {
- QmlDomValue v;
+ QDeclarativeDomValue v;
v.d->value = d->property->values.at(ii);
v.d->value->addref();
rv << v;
@@ -1635,7 +1635,7 @@ QList<QmlDomValue> QmlDomList::values() const
Returns the position in the input data where the list started, or -1 if
the property is invalid.
*/
-int QmlDomList::position() const
+int QDeclarativeDomList::position() const
{
if (d && d->property) {
return d->property->listValueRange.offset;
@@ -1647,7 +1647,7 @@ int QmlDomList::position() const
Returns the length in the input data from where the list started upto
the end of it, or 0 if the property is invalid.
*/
-int QmlDomList::length() const
+int QDeclarativeDomList::length() const
{
if (d && d->property)
return d->property->listValueRange.length;
@@ -1658,7 +1658,7 @@ int QmlDomList::length() const
/*!
Returns a list of positions of the commas in the QML file.
*/
-QList<int> QmlDomList:: commaPositions() const
+QList<int> QDeclarativeDomList:: commaPositions() const
{
if (d && d->property)
return d->property->listCommaPositions;
@@ -1667,11 +1667,11 @@ QList<int> QmlDomList:: commaPositions() const
}
/*!
- \class QmlDomComponent
+ \class QDeclarativeDomComponent
\internal
- \brief The QmlDomComponent class represents sub-component within a QML document.
+ \brief The QDeclarativeDomComponent class represents sub-component within a QML document.
- Sub-components are QmlComponents defined within a QML document. The
+ Sub-components are QDeclarativeComponents defined within a QML document. The
following example shows the definition of a sub-component with the id
"listDelegate".
@@ -1686,37 +1686,37 @@ Item {
}
\endqml
- Like QmlDomDocument's, components contain a single root object.
+ Like QDeclarativeDomDocument's, components contain a single root object.
*/
/*!
- Construct an empty QmlDomComponent.
+ Construct an empty QDeclarativeDomComponent.
*/
-QmlDomComponent::QmlDomComponent()
+QDeclarativeDomComponent::QDeclarativeDomComponent()
{
}
/*!
- Create a copy of \a other QmlDomComponent.
+ Create a copy of \a other QDeclarativeDomComponent.
*/
-QmlDomComponent::QmlDomComponent(const QmlDomComponent &other)
-: QmlDomObject(other)
+QDeclarativeDomComponent::QDeclarativeDomComponent(const QDeclarativeDomComponent &other)
+: QDeclarativeDomObject(other)
{
}
/*!
- Destroy the QmlDomComponent.
+ Destroy the QDeclarativeDomComponent.
*/
-QmlDomComponent::~QmlDomComponent()
+QDeclarativeDomComponent::~QDeclarativeDomComponent()
{
}
/*!
- Assign \a other to this QmlDomComponent.
+ Assign \a other to this QDeclarativeDomComponent.
*/
-QmlDomComponent &QmlDomComponent::operator=(const QmlDomComponent &other)
+QDeclarativeDomComponent &QDeclarativeDomComponent::operator=(const QDeclarativeDomComponent &other)
{
- static_cast<QmlDomObject &>(*this) = other;
+ static_cast<QDeclarativeDomObject &>(*this) = other;
return *this;
}
@@ -1735,11 +1735,11 @@ Item {
}
\endqml
*/
-QmlDomObject QmlDomComponent::componentRoot() const
+QDeclarativeDomObject QDeclarativeDomComponent::componentRoot() const
{
- QmlDomObject rv;
+ QDeclarativeDomObject rv;
if (d->object) {
- QmlParser::Object *obj = 0;
+ QDeclarativeParser::Object *obj = 0;
if (d->object->defaultProperty &&
d->object->defaultProperty->values.count() == 1 &&
d->object->defaultProperty->values.at(0)->object)
@@ -1754,48 +1754,48 @@ QmlDomObject QmlDomComponent::componentRoot() const
return rv;
}
-QmlDomImportPrivate::QmlDomImportPrivate()
+QDeclarativeDomImportPrivate::QDeclarativeDomImportPrivate()
: type(File)
{
}
-QmlDomImportPrivate::~QmlDomImportPrivate()
+QDeclarativeDomImportPrivate::~QDeclarativeDomImportPrivate()
{
}
/*!
- \class QmlDomImport
+ \class QDeclarativeDomImport
\internal
- \brief The QmlDomImport class represents an import statement.
+ \brief The QDeclarativeDomImport class represents an import statement.
*/
/*!
- Construct an empty QmlDomImport.
+ Construct an empty QDeclarativeDomImport.
*/
-QmlDomImport::QmlDomImport()
-: d(new QmlDomImportPrivate)
+QDeclarativeDomImport::QDeclarativeDomImport()
+: d(new QDeclarativeDomImportPrivate)
{
}
/*!
- Create a copy of \a other QmlDomImport.
+ Create a copy of \a other QDeclarativeDomImport.
*/
-QmlDomImport::QmlDomImport(const QmlDomImport &other)
+QDeclarativeDomImport::QDeclarativeDomImport(const QDeclarativeDomImport &other)
: d(other.d)
{
}
/*!
- Destroy the QmlDomImport.
+ Destroy the QDeclarativeDomImport.
*/
-QmlDomImport::~QmlDomImport()
+QDeclarativeDomImport::~QDeclarativeDomImport()
{
}
/*!
- Assign \a other to this QmlDomImport.
+ Assign \a other to this QDeclarativeDomImport.
*/
-QmlDomImport &QmlDomImport::operator=(const QmlDomImport &other)
+QDeclarativeDomImport &QDeclarativeDomImport::operator=(const QDeclarativeDomImport &other)
{
d = other.d;
return *this;
@@ -1804,15 +1804,15 @@ QmlDomImport &QmlDomImport::operator=(const QmlDomImport &other)
/*!
Returns the type of the import.
*/
-QmlDomImport::Type QmlDomImport::type() const
+QDeclarativeDomImport::Type QDeclarativeDomImport::type() const
{
- return static_cast<QmlDomImport::Type>(d->type);
+ return static_cast<QDeclarativeDomImport::Type>(d->type);
}
/*!
Returns the URI of the import (e.g. 'subdir' or 'com.nokia.Qt')
*/
-QString QmlDomImport::uri() const
+QString QDeclarativeDomImport::uri() const
{
return d->uri;
}
@@ -1820,7 +1820,7 @@ QString QmlDomImport::uri() const
/*!
Returns the version specified by the import. An empty string if no version was specified.
*/
-QString QmlDomImport::version() const
+QString QDeclarativeDomImport::version() const
{
return d->version;
}
@@ -1828,7 +1828,7 @@ QString QmlDomImport::version() const
/*!
Returns the (optional) qualifier string (the token following the 'as' keyword) of the import.
*/
-QString QmlDomImport::qualifier() const
+QString QDeclarativeDomImport::qualifier() const
{
return d->qualifier;
}
diff --git a/src/declarative/qml/qdeclarativedom_p.h b/src/declarative/qml/qdeclarativedom_p.h
new file mode 100644
index 0000000..6043ead
--- /dev/null
+++ b/src/declarative/qml/qdeclarativedom_p.h
@@ -0,0 +1,360 @@
+/****************************************************************************
+**
+** 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 QDECLARATIVEDOM_P_H
+#define QDECLARATIVEDOM_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 "qdeclarativeerror.h"
+
+#include <QtCore/qlist.h>
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QString;
+class QByteArray;
+class QDeclarativeDomObject;
+class QDeclarativeDomList;
+class QDeclarativeDomValue;
+class QDeclarativeEngine;
+class QDeclarativeDomComponent;
+class QDeclarativeDomImport;
+class QIODevice;
+
+class QDeclarativeDomDocumentPrivate;
+
+class Q_DECLARATIVE_EXPORT QDeclarativeDomDocument
+{
+public:
+ QDeclarativeDomDocument();
+ QDeclarativeDomDocument(const QDeclarativeDomDocument &);
+ ~QDeclarativeDomDocument();
+ QDeclarativeDomDocument &operator=(const QDeclarativeDomDocument &);
+
+ QList<QDeclarativeDomImport> imports() const;
+
+ QList<QDeclarativeError> errors() const;
+ bool load(QDeclarativeEngine *, const QByteArray &, const QUrl & = QUrl());
+
+ QDeclarativeDomObject rootObject() const;
+
+private:
+ QSharedDataPointer<QDeclarativeDomDocumentPrivate> d;
+};
+
+class QDeclarativeDomPropertyPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeDomProperty
+{
+public:
+ QDeclarativeDomProperty();
+ QDeclarativeDomProperty(const QDeclarativeDomProperty &);
+ ~QDeclarativeDomProperty();
+ QDeclarativeDomProperty &operator=(const QDeclarativeDomProperty &);
+
+ bool isValid() const;
+
+ QByteArray propertyName() const;
+ QList<QByteArray> propertyNameParts() const;
+
+ bool isDefaultProperty() const;
+
+ QDeclarativeDomValue value() const;
+
+ int position() const;
+ int length() const;
+
+private:
+ friend class QDeclarativeDomObject;
+ friend class QDeclarativeDomDynamicProperty;
+ QSharedDataPointer<QDeclarativeDomPropertyPrivate> d;
+};
+
+class QDeclarativeDomDynamicPropertyPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeDomDynamicProperty
+{
+public:
+ QDeclarativeDomDynamicProperty();
+ QDeclarativeDomDynamicProperty(const QDeclarativeDomDynamicProperty &);
+ ~QDeclarativeDomDynamicProperty();
+ QDeclarativeDomDynamicProperty &operator=(const QDeclarativeDomDynamicProperty &);
+
+ bool isValid() const;
+
+ QByteArray propertyName() const;
+ int propertyType() const;
+ QByteArray propertyTypeName() const;
+
+ bool isDefaultProperty() const;
+ QDeclarativeDomProperty defaultValue() const;
+
+ bool isAlias() const;
+
+ int position() const;
+ int length() const;
+
+private:
+ friend class QDeclarativeDomObject;
+ QSharedDataPointer<QDeclarativeDomDynamicPropertyPrivate> d;
+};
+
+class QDeclarativeDomObjectPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeDomObject
+{
+public:
+ QDeclarativeDomObject();
+ QDeclarativeDomObject(const QDeclarativeDomObject &);
+ ~QDeclarativeDomObject();
+ QDeclarativeDomObject &operator=(const QDeclarativeDomObject &);
+
+ bool isValid() const;
+
+ QByteArray objectType() const;
+ QByteArray objectClassName() const;
+
+ int objectTypeMajorVersion() const;
+ int objectTypeMinorVersion() const;
+
+ QString objectId() const;
+
+ QList<QDeclarativeDomProperty> properties() const;
+ QDeclarativeDomProperty property(const QByteArray &) const;
+
+ QList<QDeclarativeDomDynamicProperty> dynamicProperties() const;
+ QDeclarativeDomDynamicProperty dynamicProperty(const QByteArray &) const;
+
+ bool isCustomType() const;
+ QByteArray customTypeData() const;
+
+ bool isComponent() const;
+ QDeclarativeDomComponent toComponent() const;
+
+ int position() const;
+ int length() const;
+
+ QUrl url() const;
+private:
+ friend class QDeclarativeDomDocument;
+ friend class QDeclarativeDomComponent;
+ friend class QDeclarativeDomValue;
+ friend class QDeclarativeDomValueValueSource;
+ friend class QDeclarativeDomValueValueInterceptor;
+ QSharedDataPointer<QDeclarativeDomObjectPrivate> d;
+};
+
+class QDeclarativeDomValuePrivate;
+class QDeclarativeDomBasicValuePrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeDomValueLiteral
+{
+public:
+ QDeclarativeDomValueLiteral();
+ QDeclarativeDomValueLiteral(const QDeclarativeDomValueLiteral &);
+ ~QDeclarativeDomValueLiteral();
+ QDeclarativeDomValueLiteral &operator=(const QDeclarativeDomValueLiteral &);
+
+ QString literal() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+class Q_DECLARATIVE_EXPORT QDeclarativeDomValueBinding
+{
+public:
+ QDeclarativeDomValueBinding();
+ QDeclarativeDomValueBinding(const QDeclarativeDomValueBinding &);
+ ~QDeclarativeDomValueBinding();
+ QDeclarativeDomValueBinding &operator=(const QDeclarativeDomValueBinding &);
+
+ QString binding() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+class Q_DECLARATIVE_EXPORT QDeclarativeDomValueValueSource
+{
+public:
+ QDeclarativeDomValueValueSource();
+ QDeclarativeDomValueValueSource(const QDeclarativeDomValueValueSource &);
+ ~QDeclarativeDomValueValueSource();
+ QDeclarativeDomValueValueSource &operator=(const QDeclarativeDomValueValueSource &);
+
+ QDeclarativeDomObject object() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+class Q_DECLARATIVE_EXPORT QDeclarativeDomValueValueInterceptor
+{
+public:
+ QDeclarativeDomValueValueInterceptor();
+ QDeclarativeDomValueValueInterceptor(const QDeclarativeDomValueValueInterceptor &);
+ ~QDeclarativeDomValueValueInterceptor();
+ QDeclarativeDomValueValueInterceptor &operator=(const QDeclarativeDomValueValueInterceptor &);
+
+ QDeclarativeDomObject object() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
+};
+
+
+class Q_DECLARATIVE_EXPORT QDeclarativeDomComponent : public QDeclarativeDomObject
+{
+public:
+ QDeclarativeDomComponent();
+ QDeclarativeDomComponent(const QDeclarativeDomComponent &);
+ ~QDeclarativeDomComponent();
+ QDeclarativeDomComponent &operator=(const QDeclarativeDomComponent &);
+
+ QDeclarativeDomObject componentRoot() const;
+};
+
+class Q_DECLARATIVE_EXPORT QDeclarativeDomValue
+{
+public:
+ enum Type {
+ Invalid,
+ Literal,
+ PropertyBinding,
+ ValueSource,
+ ValueInterceptor,
+ Object,
+ List
+ };
+
+ QDeclarativeDomValue();
+ QDeclarativeDomValue(const QDeclarativeDomValue &);
+ ~QDeclarativeDomValue();
+ QDeclarativeDomValue &operator=(const QDeclarativeDomValue &);
+
+ Type type() const;
+
+ bool isInvalid() const;
+ bool isLiteral() const;
+ bool isBinding() const;
+ bool isValueSource() const;
+ bool isValueInterceptor() const;
+ bool isObject() const;
+ bool isList() const;
+
+ QDeclarativeDomValueLiteral toLiteral() const;
+ QDeclarativeDomValueBinding toBinding() const;
+ QDeclarativeDomValueValueSource toValueSource() const;
+ QDeclarativeDomValueValueInterceptor toValueInterceptor() const;
+ QDeclarativeDomObject toObject() const;
+ QDeclarativeDomList toList() const;
+
+ int position() const;
+ int length() const;
+
+private:
+ friend class QDeclarativeDomProperty;
+ friend class QDeclarativeDomList;
+ QSharedDataPointer<QDeclarativeDomValuePrivate> d;
+};
+
+class Q_DECLARATIVE_EXPORT QDeclarativeDomList
+{
+public:
+ QDeclarativeDomList();
+ QDeclarativeDomList(const QDeclarativeDomList &);
+ ~QDeclarativeDomList();
+ QDeclarativeDomList &operator=(const QDeclarativeDomList &);
+
+ QList<QDeclarativeDomValue> values() const;
+
+ int position() const;
+ int length() const;
+
+ QList<int> commaPositions() const;
+
+private:
+ friend class QDeclarativeDomValue;
+ QSharedDataPointer<QDeclarativeDomValuePrivate> d;
+};
+
+class QDeclarativeDomImportPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeDomImport
+{
+public:
+ enum Type { Library, File };
+
+ QDeclarativeDomImport();
+ QDeclarativeDomImport(const QDeclarativeDomImport &);
+ ~QDeclarativeDomImport();
+ QDeclarativeDomImport &operator=(const QDeclarativeDomImport &);
+
+ Type type() const;
+ QString uri() const;
+ QString version() const;
+ QString qualifier() const;
+
+private:
+ friend class QDeclarativeDomDocument;
+ QSharedDataPointer<QDeclarativeDomImportPrivate> d;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDOM_P_H
diff --git a/src/declarative/qml/qmldom_p_p.h b/src/declarative/qml/qdeclarativedom_p_p.h
index 9d955b0..a065282 100644
--- a/src/declarative/qml/qmldom_p_p.h
+++ b/src/declarative/qml/qdeclarativedom_p_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLDOM_P_P_H
-#define QMLDOM_P_P_H
+#ifndef QDECLARATIVEDOM_P_P_H
+#define QDECLARATIVEDOM_P_P_H
//
// W A R N I N G
@@ -53,95 +53,95 @@
// We mean it.
//
-#include "qmlparser_p.h"
+#include "qdeclarativeparser_p.h"
#include <QtCore/QtGlobal>
QT_BEGIN_NAMESPACE
-class QmlDomDocumentPrivate : public QSharedData
+class QDeclarativeDomDocumentPrivate : public QSharedData
{
public:
- QmlDomDocumentPrivate();
- QmlDomDocumentPrivate(const QmlDomDocumentPrivate &o)
+ QDeclarativeDomDocumentPrivate();
+ QDeclarativeDomDocumentPrivate(const QDeclarativeDomDocumentPrivate &o)
: QSharedData(o) { qFatal("Not impl"); }
- ~QmlDomDocumentPrivate();
+ ~QDeclarativeDomDocumentPrivate();
- QList<QmlError> errors;
- QList<QmlDomImport> imports;
- QmlParser::Object *root;
+ QList<QDeclarativeError> errors;
+ QList<QDeclarativeDomImport> imports;
+ QDeclarativeParser::Object *root;
QList<int> automaticSemicolonOffsets;
};
-class QmlDomObjectPrivate : public QSharedData
+class QDeclarativeDomObjectPrivate : public QSharedData
{
public:
- QmlDomObjectPrivate();
- QmlDomObjectPrivate(const QmlDomObjectPrivate &o)
+ QDeclarativeDomObjectPrivate();
+ QDeclarativeDomObjectPrivate(const QDeclarativeDomObjectPrivate &o)
: QSharedData(o) { qFatal("Not impl"); }
- ~QmlDomObjectPrivate();
+ ~QDeclarativeDomObjectPrivate();
- typedef QList<QPair<QmlParser::Property *, QByteArray> > Properties;
+ typedef QList<QPair<QDeclarativeParser::Property *, QByteArray> > Properties;
Properties properties() const;
- Properties properties(QmlParser::Property *) const;
+ Properties properties(QDeclarativeParser::Property *) const;
- QmlParser::Object *object;
+ QDeclarativeParser::Object *object;
};
-class QmlDomPropertyPrivate : public QSharedData
+class QDeclarativeDomPropertyPrivate : public QSharedData
{
public:
- QmlDomPropertyPrivate();
- QmlDomPropertyPrivate(const QmlDomPropertyPrivate &o)
+ QDeclarativeDomPropertyPrivate();
+ QDeclarativeDomPropertyPrivate(const QDeclarativeDomPropertyPrivate &o)
: QSharedData(o) { qFatal("Not impl"); }
- ~QmlDomPropertyPrivate();
+ ~QDeclarativeDomPropertyPrivate();
QByteArray propertyName;
- QmlParser::Property *property;
+ QDeclarativeParser::Property *property;
};
-class QmlDomDynamicPropertyPrivate : public QSharedData
+class QDeclarativeDomDynamicPropertyPrivate : public QSharedData
{
public:
- QmlDomDynamicPropertyPrivate();
- QmlDomDynamicPropertyPrivate(const QmlDomDynamicPropertyPrivate &o)
+ QDeclarativeDomDynamicPropertyPrivate();
+ QDeclarativeDomDynamicPropertyPrivate(const QDeclarativeDomDynamicPropertyPrivate &o)
: QSharedData(o) { qFatal("Not impl"); }
- ~QmlDomDynamicPropertyPrivate();
+ ~QDeclarativeDomDynamicPropertyPrivate();
bool valid;
- QmlParser::Object::DynamicProperty property;
+ QDeclarativeParser::Object::DynamicProperty property;
};
-class QmlDomValuePrivate : public QSharedData
+class QDeclarativeDomValuePrivate : public QSharedData
{
public:
- QmlDomValuePrivate();
- QmlDomValuePrivate(const QmlDomValuePrivate &o)
+ QDeclarativeDomValuePrivate();
+ QDeclarativeDomValuePrivate(const QDeclarativeDomValuePrivate &o)
: QSharedData(o) { qFatal("Not impl"); }
- ~QmlDomValuePrivate();
+ ~QDeclarativeDomValuePrivate();
- QmlParser::Property *property;
- QmlParser::Value *value;
+ QDeclarativeParser::Property *property;
+ QDeclarativeParser::Value *value;
};
-class QmlDomBasicValuePrivate : public QSharedData
+class QDeclarativeDomBasicValuePrivate : public QSharedData
{
public:
- QmlDomBasicValuePrivate();
- QmlDomBasicValuePrivate(const QmlDomBasicValuePrivate &o)
+ QDeclarativeDomBasicValuePrivate();
+ QDeclarativeDomBasicValuePrivate(const QDeclarativeDomBasicValuePrivate &o)
: QSharedData(o) { qFatal("Not impl"); }
- ~QmlDomBasicValuePrivate();
+ ~QDeclarativeDomBasicValuePrivate();
- QmlParser::Value *value;
+ QDeclarativeParser::Value *value;
};
-class QmlDomImportPrivate : public QSharedData
+class QDeclarativeDomImportPrivate : public QSharedData
{
public:
- QmlDomImportPrivate();
- QmlDomImportPrivate(const QmlDomImportPrivate &o)
+ QDeclarativeDomImportPrivate();
+ QDeclarativeDomImportPrivate(const QDeclarativeDomImportPrivate &o)
: QSharedData(o) { qFatal("Not impl"); }
- ~QmlDomImportPrivate();
+ ~QDeclarativeDomImportPrivate();
enum Type { Library, File };
@@ -153,5 +153,5 @@ public:
QT_END_NAMESPACE
-#endif // QMLDOM_P_P_H
+#endif // QDECLARATIVEDOM_P_P_H
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 2d904d1..4575536 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -39,35 +39,35 @@
**
****************************************************************************/
-#include "qmlengine_p.h"
-#include "qmlengine.h"
-
-#include "qmlcontext_p.h"
-#include "qmlcompiler_p.h"
-#include "qmlglobalscriptclass_p.h"
-#include "qml.h"
-#include "qmlcontext.h"
-#include "qmlexpression.h"
-#include "qmlcomponent.h"
-#include "qmlmetaproperty_p.h"
-#include "qmlbinding_p_p.h"
-#include "qmlvme_p.h"
-#include "qmlenginedebug_p.h"
-#include "qmlstringconverters_p.h"
-#include "qmlxmlhttprequest_p.h"
-#include "qmlsqldatabase_p.h"
-#include "qmltypenamescriptclass_p.h"
-#include "qmllistscriptclass_p.h"
-#include "qmlscriptstring.h"
-#include "qmlglobal_p.h"
-#include "qmlworkerscript_p.h"
-#include "qmlcomponent_p.h"
-#include "qmlscriptclass_p.h"
-#include "qmlnetworkaccessmanagerfactory.h"
-#include "qmlimageprovider.h"
-#include "qmldirparser_p.h"
-#include "qmlextensioninterface.h"
-#include "qmllist_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeengine.h"
+
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativecompiler_p.h"
+#include "qdeclarativeglobalscriptclass_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativecomponent.h"
+#include "qdeclarativemetaproperty_p.h"
+#include "qdeclarativebinding_p_p.h"
+#include "qdeclarativevme_p.h"
+#include "qdeclarativeenginedebug_p.h"
+#include "qdeclarativestringconverters_p.h"
+#include "qdeclarativexmlhttprequest_p.h"
+#include "qdeclarativesqldatabase_p.h"
+#include "qdeclarativetypenamescriptclass_p.h"
+#include "qdeclarativelistscriptclass_p.h"
+#include "qdeclarativescriptstring.h"
+#include "qdeclarativeglobal_p.h"
+#include "qdeclarativeworkerscript_p.h"
+#include "qdeclarativecomponent_p.h"
+#include "qdeclarativescriptclass_p.h"
+#include "qdeclarativenetworkaccessmanagerfactory.h"
+#include "qdeclarativeimageprovider.h"
+#include "qdeclarativedirparser_p.h"
+#include "qdeclarativeextensioninterface.h"
+#include "qdeclarativelist_p.h"
#include <qfxperf_p_p.h>
@@ -99,8 +99,8 @@
#include <private/qobject_p.h>
#include <private/qscriptdeclarativeclass_p.h>
-#include <private/qmlgraphicsitemsmodule_p.h>
-#include <private/qmlgraphicsutilmodule_p.h>
+#include <private/qdeclarativeitemsmodule_p.h>
+#include <private/qdeclarativeutilmodule_p.h>
#ifdef Q_OS_WIN // for %APPDATA%
#include <qt_windows.h>
@@ -109,7 +109,7 @@
#define CSIDL_APPDATA 0x001a // <username>\Application Data
#endif
-Q_DECLARE_METATYPE(QmlMetaProperty)
+Q_DECLARE_METATYPE(QDeclarativeMetaProperty)
QT_BEGIN_NAMESPACE
@@ -144,17 +144,17 @@ struct StaticQtMetaObject : public QObject
static bool qt_QmlQtModule_registered = false;
-void QmlEnginePrivate::defineModule()
+void QDeclarativeEnginePrivate::defineModule()
{
- QML_REGISTER_TYPE(Qt,4,6,Component,QmlComponent);
+ QML_REGISTER_TYPE(Qt,4,6,Component,QDeclarativeComponent);
QML_REGISTER_TYPE(Qt,4,6,QtObject,QObject);
- QML_REGISTER_TYPE(Qt,4,6,WorkerScript,QmlWorkerScript);
- QML_REGISTER_TYPE(Qt,4,6,WorkerListModel,QmlWorkerListModel);
+ QML_REGISTER_TYPE(Qt,4,6,WorkerScript,QDeclarativeWorkerScript);
+ QML_REGISTER_TYPE(Qt,4,6,WorkerListModel,QDeclarativeWorkerListModel);
- QML_REGISTER_NOCREATE_TYPE(QmlBinding);
+ QML_REGISTER_NOCREATE_TYPE(QDeclarativeBinding);
}
-QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e)
+QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
: captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false),
contextClass(0), sharedContext(0), sharedScope(0), objectClass(0), valueTypeClass(0),
globalClass(0), cleanup(0), erroredBindings(0), inProgressCreations(0),
@@ -164,11 +164,11 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e)
{
if (!qt_QmlQtModule_registered) {
qt_QmlQtModule_registered = true;
- QmlGraphicsItemModule::defineModule();
- QmlGraphicsUtilModule::defineModule();
- QmlEnginePrivate::defineModule();
+ QDeclarativeItemModule::defineModule();
+ QDeclarativeUtilModule::defineModule();
+ QDeclarativeEnginePrivate::defineModule();
}
- globalClass = new QmlGlobalScriptClass(&scriptEngine);
+ globalClass = new QDeclarativeGlobalScriptClass(&scriptEngine);
fileImportPath.append(QLibraryInfo::location(QLibraryInfo::DataPath)+QDir::separator()+QLatin1String("qml"));
// env import paths
@@ -187,17 +187,17 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e)
}
}
-QUrl QmlScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
+QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
{
if (p) {
- QmlContext *ctxt = QmlEnginePrivate::get(this)->getContext(context);
+ QDeclarativeContext *ctxt = QDeclarativeEnginePrivate::get(this)->getContext(context);
Q_ASSERT(ctxt);
return ctxt->resolvedUrl(url);
}
return baseUrl.resolved(url);
}
-QmlScriptEngine::QmlScriptEngine(QmlEnginePrivate *priv)
+QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *priv)
: p(priv), sqlQueryClass(0), namedNodeMapClass(0), nodeListClass(0)
{
// Note that all documentation for stuff put on the global object goes in
@@ -223,41 +223,41 @@ QmlScriptEngine::QmlScriptEngine(QmlEnginePrivate *priv)
//types
- qtObject.setProperty(QLatin1String("rgba"), newFunction(QmlEnginePrivate::rgba, 4));
- qtObject.setProperty(QLatin1String("hsla"), newFunction(QmlEnginePrivate::hsla, 4));
- qtObject.setProperty(QLatin1String("rect"), newFunction(QmlEnginePrivate::rect, 4));
- qtObject.setProperty(QLatin1String("point"), newFunction(QmlEnginePrivate::point, 2));
- qtObject.setProperty(QLatin1String("size"), newFunction(QmlEnginePrivate::size, 2));
- qtObject.setProperty(QLatin1String("vector3d"), newFunction(QmlEnginePrivate::vector, 3));
+ qtObject.setProperty(QLatin1String("rgba"), newFunction(QDeclarativeEnginePrivate::rgba, 4));
+ qtObject.setProperty(QLatin1String("hsla"), newFunction(QDeclarativeEnginePrivate::hsla, 4));
+ qtObject.setProperty(QLatin1String("rect"), newFunction(QDeclarativeEnginePrivate::rect, 4));
+ qtObject.setProperty(QLatin1String("point"), newFunction(QDeclarativeEnginePrivate::point, 2));
+ qtObject.setProperty(QLatin1String("size"), newFunction(QDeclarativeEnginePrivate::size, 2));
+ qtObject.setProperty(QLatin1String("vector3d"), newFunction(QDeclarativeEnginePrivate::vector, 3));
if (mainthread) {
//color helpers
- qtObject.setProperty(QLatin1String("lighter"), newFunction(QmlEnginePrivate::lighter, 1));
- qtObject.setProperty(QLatin1String("darker"), newFunction(QmlEnginePrivate::darker, 1));
- qtObject.setProperty(QLatin1String("tint"), newFunction(QmlEnginePrivate::tint, 2));
+ qtObject.setProperty(QLatin1String("lighter"), newFunction(QDeclarativeEnginePrivate::lighter, 1));
+ qtObject.setProperty(QLatin1String("darker"), newFunction(QDeclarativeEnginePrivate::darker, 1));
+ qtObject.setProperty(QLatin1String("tint"), newFunction(QDeclarativeEnginePrivate::tint, 2));
}
//misc methods
- qtObject.setProperty(QLatin1String("closestAngle"), newFunction(QmlEnginePrivate::closestAngle, 2));
- qtObject.setProperty(QLatin1String("playSound"), newFunction(QmlEnginePrivate::playSound, 1));
- qtObject.setProperty(QLatin1String("openUrlExternally"),newFunction(QmlEnginePrivate::desktopOpenUrl, 1));
- qtObject.setProperty(QLatin1String("md5"),newFunction(QmlEnginePrivate::md5, 1));
- qtObject.setProperty(QLatin1String("btoa"),newFunction(QmlEnginePrivate::btoa, 1));
- qtObject.setProperty(QLatin1String("atob"),newFunction(QmlEnginePrivate::atob, 1));
- qtObject.setProperty(QLatin1String("quit"), newFunction(QmlEnginePrivate::quit, 0));
- qtObject.setProperty(QLatin1String("resolvedUrl"),newFunction(QmlScriptEngine::resolvedUrl, 1));
+ qtObject.setProperty(QLatin1String("closestAngle"), newFunction(QDeclarativeEnginePrivate::closestAngle, 2));
+ qtObject.setProperty(QLatin1String("playSound"), newFunction(QDeclarativeEnginePrivate::playSound, 1));
+ qtObject.setProperty(QLatin1String("openUrlExternally"),newFunction(QDeclarativeEnginePrivate::desktopOpenUrl, 1));
+ qtObject.setProperty(QLatin1String("md5"),newFunction(QDeclarativeEnginePrivate::md5, 1));
+ qtObject.setProperty(QLatin1String("btoa"),newFunction(QDeclarativeEnginePrivate::btoa, 1));
+ qtObject.setProperty(QLatin1String("atob"),newFunction(QDeclarativeEnginePrivate::atob, 1));
+ qtObject.setProperty(QLatin1String("quit"), newFunction(QDeclarativeEnginePrivate::quit, 0));
+ qtObject.setProperty(QLatin1String("resolvedUrl"),newFunction(QDeclarativeScriptEngine::resolvedUrl, 1));
//firebug/webkit compat
QScriptValue consoleObject = newObject();
- consoleObject.setProperty(QLatin1String("log"),newFunction(QmlEnginePrivate::consoleLog, 1));
- consoleObject.setProperty(QLatin1String("debug"),newFunction(QmlEnginePrivate::consoleLog, 1));
+ consoleObject.setProperty(QLatin1String("log"),newFunction(QDeclarativeEnginePrivate::consoleLog, 1));
+ consoleObject.setProperty(QLatin1String("debug"),newFunction(QDeclarativeEnginePrivate::consoleLog, 1));
globalObject().setProperty(QLatin1String("console"), consoleObject);
if (mainthread) {
globalObject().setProperty(QLatin1String("createQmlObject"),
- newFunction(QmlEnginePrivate::createQmlObject, 1));
+ newFunction(QDeclarativeEnginePrivate::createQmlObject, 1));
globalObject().setProperty(QLatin1String("createComponent"),
- newFunction(QmlEnginePrivate::createComponent, 1));
+ newFunction(QDeclarativeEnginePrivate::createComponent, 1));
}
// translation functions need to be installed
@@ -265,29 +265,29 @@ QmlScriptEngine::QmlScriptEngine(QmlEnginePrivate *priv)
installTranslatorFunctions();
}
-QmlScriptEngine::~QmlScriptEngine()
+QDeclarativeScriptEngine::~QDeclarativeScriptEngine()
{
delete sqlQueryClass;
delete nodeListClass;
delete namedNodeMapClass;
}
-QScriptValue QmlScriptEngine::resolvedUrl(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeScriptEngine::resolvedUrl(QScriptContext *ctxt, QScriptEngine *engine)
{
QString arg = ctxt->argument(0).toString();
- QUrl r = QmlScriptEngine::get(engine)->resolvedUrl(ctxt,QUrl(arg));
+ QUrl r = QDeclarativeScriptEngine::get(engine)->resolvedUrl(ctxt,QUrl(arg));
return QScriptValue(r.toString());
}
-QNetworkAccessManager *QmlScriptEngine::networkAccessManager()
+QNetworkAccessManager *QDeclarativeScriptEngine::networkAccessManager()
{
return p->getNetworkAccessManager();
}
-QmlEnginePrivate::~QmlEnginePrivate()
+QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate()
{
while (cleanup) {
- QmlCleanup *c = cleanup;
+ QDeclarativeCleanup *c = cleanup;
cleanup = c->next;
if (cleanup) cleanup->prev = &cleanup;
c->next = 0;
@@ -314,144 +314,144 @@ QmlEnginePrivate::~QmlEnginePrivate()
clear(bindValues[ii]);
for(int ii = 0; ii < parserStatus.count(); ++ii)
clear(parserStatus[ii]);
- for(QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter)
+ for(QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter)
(*iter)->release();
- for(QHash<const QMetaObject *, QmlPropertyCache *>::Iterator iter = propertyCache.begin(); iter != propertyCache.end(); ++iter)
+ for(QHash<const QMetaObject *, QDeclarativePropertyCache *>::Iterator iter = propertyCache.begin(); iter != propertyCache.end(); ++iter)
(*iter)->release();
}
-void QmlEnginePrivate::clear(SimpleList<QmlAbstractBinding> &bvs)
+void QDeclarativeEnginePrivate::clear(SimpleList<QDeclarativeAbstractBinding> &bvs)
{
bvs.clear();
}
-void QmlEnginePrivate::clear(SimpleList<QmlParserStatus> &pss)
+void QDeclarativeEnginePrivate::clear(SimpleList<QDeclarativeParserStatus> &pss)
{
for (int ii = 0; ii < pss.count; ++ii) {
- QmlParserStatus *ps = pss.at(ii);
+ QDeclarativeParserStatus *ps = pss.at(ii);
if(ps)
ps->d = 0;
}
pss.clear();
}
-Q_GLOBAL_STATIC(QmlEngineDebugServer, qmlEngineDebugServer);
+Q_GLOBAL_STATIC(QDeclarativeEngineDebugServer, qmlEngineDebugServer);
-void QmlEnginePrivate::init()
+void QDeclarativeEnginePrivate::init()
{
- Q_Q(QmlEngine);
+ Q_Q(QDeclarativeEngine);
qRegisterMetaType<QVariant>("QVariant");
- qRegisterMetaType<QmlScriptString>("QmlScriptString");
+ qRegisterMetaType<QDeclarativeScriptString>("QDeclarativeScriptString");
qRegisterMetaType<QScriptValue>("QScriptValue");
- contextClass = new QmlContextScriptClass(q);
- objectClass = new QmlObjectScriptClass(q);
- valueTypeClass = new QmlValueTypeScriptClass(q);
- typeNameClass = new QmlTypeNameScriptClass(q);
- listClass = new QmlListScriptClass(q);
- rootContext = new QmlContext(q,true);
+ contextClass = new QDeclarativeContextScriptClass(q);
+ objectClass = new QDeclarativeObjectScriptClass(q);
+ valueTypeClass = new QDeclarativeValueTypeScriptClass(q);
+ typeNameClass = new QDeclarativeTypeNameScriptClass(q);
+ listClass = new QDeclarativeListScriptClass(q);
+ rootContext = new QDeclarativeContext(q,true);
if (QCoreApplication::instance()->thread() == q->thread() &&
- QmlEngineDebugServer::isDebuggingEnabled()) {
+ QDeclarativeEngineDebugServer::isDebuggingEnabled()) {
qmlEngineDebugServer();
isDebugging = true;
- QmlEngineDebugServer::addEngine(q);
+ QDeclarativeEngineDebugServer::addEngine(q);
qmlEngineDebugServer()->waitForClients();
}
}
-QmlWorkerScriptEngine *QmlEnginePrivate::getWorkerScriptEngine()
+QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine()
{
- Q_Q(QmlEngine);
+ Q_Q(QDeclarativeEngine);
if (!workerScriptEngine)
- workerScriptEngine = new QmlWorkerScriptEngine(q);
+ workerScriptEngine = new QDeclarativeWorkerScriptEngine(q);
return workerScriptEngine;
}
/*!
- \class QmlEngine
+ \class QDeclarativeEngine
\since 4.7
- \brief The QmlEngine class provides an environment for instantiating QML components.
+ \brief The QDeclarativeEngine class provides an environment for instantiating QML components.
\mainclass
- Each QML component is instantiated in a QmlContext. QmlContext's are
+ Each QML component is instantiated in a QDeclarativeContext. QDeclarativeContext's are
essential for passing data to QML components. In QML, contexts are arranged
- hierarchically and this hierarchy is managed by the QmlEngine.
+ hierarchically and this hierarchy is managed by the QDeclarativeEngine.
Prior to creating any QML components, an application must have created a
- QmlEngine to gain access to a QML context. The following example shows how
+ QDeclarativeEngine to gain access to a QML context. The following example shows how
to create a simple Text item.
\code
- QmlEngine engine;
- QmlComponent component(&engine);
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine);
component.setData("import Qt 4.6\nText { text: \"Hello world!\" }", QUrl());
- QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem *>(component.create());
+ QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
//add item to view, etc
...
\endcode
In this case, the Text item will be created in the engine's
- \l {QmlEngine::rootContext()}{root context}.
+ \l {QDeclarativeEngine::rootContext()}{root context}.
- \sa QmlComponent QmlContext
+ \sa QDeclarativeComponent QDeclarativeContext
*/
/*!
- Create a new QmlEngine with the given \a parent.
+ Create a new QDeclarativeEngine with the given \a parent.
*/
-QmlEngine::QmlEngine(QObject *parent)
-: QObject(*new QmlEnginePrivate(this), parent)
+QDeclarativeEngine::QDeclarativeEngine(QObject *parent)
+: QObject(*new QDeclarativeEnginePrivate(this), parent)
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
d->init();
}
/*!
- Destroys the QmlEngine.
+ Destroys the QDeclarativeEngine.
- Any QmlContext's created on this engine will be invalidated, but not
- destroyed (unless they are parented to the QmlEngine object).
+ Any QDeclarativeContext's created on this engine will be invalidated, but not
+ destroyed (unless they are parented to the QDeclarativeEngine object).
*/
-QmlEngine::~QmlEngine()
+QDeclarativeEngine::~QDeclarativeEngine()
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
if (d->isDebugging)
- QmlEngineDebugServer::remEngine(this);
+ QDeclarativeEngineDebugServer::remEngine(this);
}
-/*! \fn void QmlEngine::quit()
- This signal is emitted when the QmlEngine quits.
+/*! \fn void QDeclarativeEngine::quit()
+ This signal is emitted when the QDeclarativeEngine quits.
*/
/*!
Clears the engine's internal component cache.
- Normally the QmlEngine caches components loaded from qml files. This method
+ Normally the QDeclarativeEngine caches components loaded from qml files. This method
clears this cache and forces the component to be reloaded.
*/
-void QmlEngine::clearComponentCache()
+void QDeclarativeEngine::clearComponentCache()
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
d->typeManager.clearCache();
}
/*!
Returns the engine's root context.
- The root context is automatically created by the QmlEngine. Data that
+ The root context is automatically created by the QDeclarativeEngine. Data that
should be available to all QML component instances instantiated by the
engine should be put in the root context.
Additional data that should only be available to a subset of component
instances should be added to sub-contexts parented to the root context.
*/
-QmlContext *QmlEngine::rootContext()
+QDeclarativeContext *QDeclarativeEngine::rootContext()
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
return d->rootContext;
}
@@ -465,25 +465,25 @@ QmlContext *QmlEngine::rootContext()
The factory must be set before exceuting the engine.
*/
-void QmlEngine::setNetworkAccessManagerFactory(QmlNetworkAccessManagerFactory *factory)
+void QDeclarativeEngine::setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *factory)
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
QMutexLocker locker(&d->mutex);
d->networkAccessManagerFactory = factory;
}
/*!
- Returns the current QmlNetworkAccessManagerFactory.
+ Returns the current QDeclarativeNetworkAccessManagerFactory.
\sa setNetworkAccessManagerFactory()
*/
-QmlNetworkAccessManagerFactory *QmlEngine::networkAccessManagerFactory() const
+QDeclarativeNetworkAccessManagerFactory *QDeclarativeEngine::networkAccessManagerFactory() const
{
- Q_D(const QmlEngine);
+ Q_D(const QDeclarativeEngine);
return d->networkAccessManagerFactory;
}
-QNetworkAccessManager *QmlEnginePrivate::createNetworkAccessManager(QObject *parent) const
+QNetworkAccessManager *QDeclarativeEnginePrivate::createNetworkAccessManager(QObject *parent) const
{
QMutexLocker locker(&mutex);
QNetworkAccessManager *nam;
@@ -496,11 +496,11 @@ QNetworkAccessManager *QmlEnginePrivate::createNetworkAccessManager(QObject *par
return nam;
}
-QNetworkAccessManager *QmlEnginePrivate::getNetworkAccessManager() const
+QNetworkAccessManager *QDeclarativeEnginePrivate::getNetworkAccessManager() const
{
- Q_Q(const QmlEngine);
+ Q_Q(const QDeclarativeEngine);
if (!networkAccessManager)
- networkAccessManager = createNetworkAccessManager(const_cast<QmlEngine*>(q));
+ networkAccessManager = createNetworkAccessManager(const_cast<QDeclarativeEngine*>(q));
return networkAccessManager;
}
@@ -508,16 +508,16 @@ QNetworkAccessManager *QmlEnginePrivate::getNetworkAccessManager() const
Returns a common QNetworkAccessManager which can be used by any QML element
instantiated by this engine.
- If a QmlNetworkAccessManagerFactory has been set and a QNetworkAccessManager
- has not yet been created, the QmlNetworkAccessManagerFactory will be used
+ If a QDeclarativeNetworkAccessManagerFactory has been set and a QNetworkAccessManager
+ has not yet been created, the QDeclarativeNetworkAccessManagerFactory will be used
to create the QNetworkAccessManager; otherwise the returned QNetworkAccessManager
will have no proxy or cache set.
\sa setNetworkAccessManagerFactory()
*/
-QNetworkAccessManager *QmlEngine::networkAccessManager() const
+QNetworkAccessManager *QDeclarativeEngine::networkAccessManager() const
{
- Q_D(const QmlEngine);
+ Q_D(const QDeclarativeEngine);
return d->getNetworkAccessManager();
}
@@ -525,15 +525,15 @@ QNetworkAccessManager *QmlEngine::networkAccessManager() const
Sets the \a provider to use for images requested via the \e image: url
scheme, with host \a providerId.
- QmlImageProvider allows images to be provided to QML asynchronously.
+ QDeclarativeImageProvider allows images to be provided to QML asynchronously.
The image request will be run in a low priority thread. This allows
potentially costly image loading to be done in the background, without
affecting the performance of the UI.
- Note that images loaded from a QmlImageProvider are cached by
+ Note that images loaded from a QDeclarativeImageProvider are cached by
QPixmapCache, similar to any image loaded by QML.
- The QmlEngine assumes ownership of the provider.
+ The QDeclarativeEngine assumes ownership of the provider.
This example creates a provider with id \e colors:
@@ -543,42 +543,42 @@ QNetworkAccessManager *QmlEngine::networkAccessManager() const
\sa removeImageProvider()
*/
-void QmlEngine::addImageProvider(const QString &providerId, QmlImageProvider *provider)
+void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativeImageProvider *provider)
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
QMutexLocker locker(&d->mutex);
d->imageProviders.insert(providerId, provider);
}
/*!
- Returns the QmlImageProvider set for \a providerId.
+ Returns the QDeclarativeImageProvider set for \a providerId.
*/
-QmlImageProvider *QmlEngine::imageProvider(const QString &providerId) const
+QDeclarativeImageProvider *QDeclarativeEngine::imageProvider(const QString &providerId) const
{
- Q_D(const QmlEngine);
+ Q_D(const QDeclarativeEngine);
QMutexLocker locker(&d->mutex);
return d->imageProviders.value(providerId);
}
/*!
- Removes the QmlImageProvider for \a providerId.
+ Removes the QDeclarativeImageProvider for \a providerId.
Returns the provider if it was found; otherwise returns 0.
\sa addImageProvider()
*/
-void QmlEngine::removeImageProvider(const QString &providerId)
+void QDeclarativeEngine::removeImageProvider(const QString &providerId)
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
QMutexLocker locker(&d->mutex);
delete d->imageProviders.take(providerId);
}
-QImage QmlEnginePrivate::getImageFromProvider(const QUrl &url)
+QImage QDeclarativeEnginePrivate::getImageFromProvider(const QUrl &url)
{
QMutexLocker locker(&mutex);
QImage image;
- QmlImageProvider *provider = imageProviders.value(url.host());
+ QDeclarativeImageProvider *provider = imageProviders.value(url.host());
if (provider)
image = provider->request(url.path().mid(1));
return image;
@@ -586,16 +586,16 @@ QImage QmlEnginePrivate::getImageFromProvider(const QUrl &url)
/*!
Return the base URL for this engine. The base URL is only used to resolve
- components when a relative URL is passed to the QmlComponent constructor.
+ components when a relative URL is passed to the QDeclarativeComponent constructor.
If a base URL has not been explicitly set, this method returns the
application's current working directory.
\sa setBaseUrl()
*/
-QUrl QmlEngine::baseUrl() const
+QUrl QDeclarativeEngine::baseUrl() const
{
- Q_D(const QmlEngine);
+ Q_D(const QDeclarativeEngine);
if (d->baseUrl.isEmpty()) {
return QUrl::fromLocalFile(QDir::currentPath() + QDir::separator());
} else {
@@ -608,26 +608,26 @@ QUrl QmlEngine::baseUrl() const
\sa baseUrl()
*/
-void QmlEngine::setBaseUrl(const QUrl &url)
+void QDeclarativeEngine::setBaseUrl(const QUrl &url)
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
d->baseUrl = url;
}
/*!
- Returns the QmlContext for the \a object, or 0 if no context has been set.
+ Returns the QDeclarativeContext for the \a object, or 0 if no context has been set.
- When the QmlEngine instantiates a QObject, the context is set automatically.
+ When the QDeclarativeEngine instantiates a QObject, the context is set automatically.
*/
-QmlContext *QmlEngine::contextForObject(const QObject *object)
+QDeclarativeContext *QDeclarativeEngine::contextForObject(const QObject *object)
{
if(!object)
return 0;
QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
- QmlDeclarativeData *data =
- static_cast<QmlDeclarativeData *>(priv->declarativeData);
+ QDeclarativeDeclarativeData *data =
+ static_cast<QDeclarativeDeclarativeData *>(priv->declarativeData);
if (!data)
return 0;
@@ -638,20 +638,20 @@ QmlContext *QmlEngine::contextForObject(const QObject *object)
}
/*!
- Sets the QmlContext for the \a object to \a context.
+ Sets the QDeclarativeContext for the \a object to \a context.
If the \a object already has a context, a warning is
output, but the context is not changed.
- When the QmlEngine instantiates a QObject, the context is set automatically.
+ When the QDeclarativeEngine instantiates a QObject, the context is set automatically.
*/
-void QmlEngine::setContextForObject(QObject *object, QmlContext *context)
+void QDeclarativeEngine::setContextForObject(QObject *object, QDeclarativeContext *context)
{
if (!object || !context)
return;
- QmlDeclarativeData *data = QmlDeclarativeData::get(object, true);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object, true);
if (data->context) {
- qWarning("QmlEngine::setContextForObject(): Object already has a QmlContext");
+ qWarning("QDeclarativeEngine::setContextForObject(): Object already has a QDeclarativeContext");
return;
}
@@ -665,19 +665,19 @@ void QmlEngine::setContextForObject(QObject *object, QmlContext *context)
void qmlExecuteDeferred(QObject *object)
{
- QmlDeclarativeData *data = QmlDeclarativeData::get(object);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object);
if (data && data->deferredComponent) {
- QmlEnginePrivate *ep = QmlEnginePrivate::get(data->context->engine());
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(data->context->engine());
- QmlComponentPrivate::ConstructionState state;
- QmlComponentPrivate::beginDeferred(data->context, ep, object, &state);
+ QDeclarativeComponentPrivate::ConstructionState state;
+ QDeclarativeComponentPrivate::beginDeferred(data->context, ep, object, &state);
data->deferredComponent->release();
data->deferredComponent = 0;
- QmlComponentPrivate::complete(ep, &state);
+ QDeclarativeComponentPrivate::complete(ep, &state);
if (!state.errors.isEmpty())
qWarning() << state.errors;
@@ -685,20 +685,20 @@ void qmlExecuteDeferred(QObject *object)
}
}
-QmlContext *qmlContext(const QObject *obj)
+QDeclarativeContext *qmlContext(const QObject *obj)
{
- return QmlEngine::contextForObject(obj);
+ return QDeclarativeEngine::contextForObject(obj);
}
-QmlEngine *qmlEngine(const QObject *obj)
+QDeclarativeEngine *qmlEngine(const QObject *obj)
{
- QmlContext *context = QmlEngine::contextForObject(obj);
+ QDeclarativeContext *context = QDeclarativeEngine::contextForObject(obj);
return context?context->engine():0;
}
QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create)
{
- QmlDeclarativeData *data = QmlDeclarativeData::get(object);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object);
if (!data)
return 0; // Attached properties are only on objects created by QML
@@ -706,7 +706,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
if (rv || !create)
return rv;
- QmlAttachedPropertiesFunc pf = QmlMetaType::attachedPropertiesFuncById(id);
+ QDeclarativeAttachedPropertiesFunc pf = QDeclarativeMetaType::attachedPropertiesFuncById(id);
if (!pf)
return 0;
@@ -721,7 +721,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
return rv;
}
-void QmlDeclarativeData::destroyed(QObject *object)
+void QDeclarativeDeclarativeData::destroyed(QObject *object)
{
if (deferredComponent)
deferredComponent->release();
@@ -733,9 +733,9 @@ void QmlDeclarativeData::destroyed(QObject *object)
if (prevContextObject)
*prevContextObject = nextContextObject;
- QmlAbstractBinding *binding = bindings;
+ QDeclarativeAbstractBinding *binding = bindings;
while (binding) {
- QmlAbstractBinding *next = binding->m_nextBinding;
+ QDeclarativeAbstractBinding *next = binding->m_nextBinding;
binding->m_prevBinding = 0;
binding->m_nextBinding = 0;
binding->destroy();
@@ -748,9 +748,9 @@ void QmlDeclarativeData::destroyed(QObject *object)
if (propertyCache)
propertyCache->release();
- QmlGuard<QObject> *guard = guards;
+ QDeclarativeGuard<QObject> *guard = guards;
while (guard) {
- QmlGuard<QObject> *g = guard;
+ QDeclarativeGuard<QObject> *g = guard;
guard = guard->next;
g->o = 0;
g->prev = 0;
@@ -761,7 +761,7 @@ void QmlDeclarativeData::destroyed(QObject *object)
delete this;
}
-bool QmlDeclarativeData::hasBindingBit(int bit) const
+bool QDeclarativeDeclarativeData::hasBindingBit(int bit) const
{
if (bindingBitsSize > bit)
return bindingBits[bit / 32] & (1 << (bit % 32));
@@ -769,13 +769,13 @@ bool QmlDeclarativeData::hasBindingBit(int bit) const
return false;
}
-void QmlDeclarativeData::clearBindingBit(int bit)
+void QDeclarativeDeclarativeData::clearBindingBit(int bit)
{
if (bindingBitsSize > bit)
bindingBits[bit / 32] &= ~(1 << (bit % 32));
}
-void QmlDeclarativeData::setBindingBit(QObject *obj, int bit)
+void QDeclarativeDeclarativeData::setBindingBit(QObject *obj, int bit)
{
if (bindingBitsSize <= bit) {
int props = obj->metaObject()->propertyCount();
@@ -799,23 +799,23 @@ void QmlDeclarativeData::setBindingBit(QObject *obj, int bit)
/*!
Creates a QScriptValue allowing you to use \a object in QML script.
- \a engine is the QmlEngine it is to be created in.
+ \a engine is the QDeclarativeEngine it is to be created in.
The QScriptValue returned is a QtScript Object, not a QtScript QObject, due
to the special needs of QML requiring more functionality than a standard
QtScript QObject.
*/
-QScriptValue QmlEnginePrivate::qmlScriptObject(QObject* object,
- QmlEngine* engine)
+QScriptValue QDeclarativeEnginePrivate::qmlScriptObject(QObject* object,
+ QDeclarativeEngine* engine)
{
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
return enginePriv->objectClass->newQObject(object);
}
/*!
- Returns the QmlContext for the executing QScript \a ctxt.
+ Returns the QDeclarativeContext for the executing QScript \a ctxt.
*/
-QmlContext *QmlEnginePrivate::getContext(QScriptContext *ctxt)
+QDeclarativeContext *QDeclarativeEnginePrivate::getContext(QScriptContext *ctxt)
{
QScriptValue scopeNode = QScriptDeclarativeClass::scopeChainValue(ctxt, -3);
Q_ASSERT(scopeNode.isValid());
@@ -823,14 +823,14 @@ QmlContext *QmlEnginePrivate::getContext(QScriptContext *ctxt)
return contextClass->contextFromValue(scopeNode);
}
-QScriptValue QmlEnginePrivate::createComponent(QScriptContext *ctxt,
+QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt,
QScriptEngine *engine)
{
- QmlEnginePrivate *activeEnginePriv =
- static_cast<QmlScriptEngine*>(engine)->p;
- QmlEngine* activeEngine = activeEnginePriv->q_func();
+ QDeclarativeEnginePrivate *activeEnginePriv =
+ static_cast<QDeclarativeScriptEngine*>(engine)->p;
+ QDeclarativeEngine* activeEngine = activeEnginePriv->q_func();
- QmlContext* context = activeEnginePriv->getContext(ctxt);
+ QDeclarativeContext* context = activeEnginePriv->getContext(ctxt);
Q_ASSERT(context);
if(ctxt->argumentCount() != 1) {
return engine->nullValue();
@@ -839,22 +839,22 @@ QScriptValue QmlEnginePrivate::createComponent(QScriptContext *ctxt,
if (arg.isEmpty())
return engine->nullValue();
QUrl url = QUrl(context->resolvedUrl(QUrl(arg)));
- QmlComponent *c = new QmlComponent(activeEngine, url, activeEngine);
+ QDeclarativeComponent *c = new QDeclarativeComponent(activeEngine, url, activeEngine);
c->setCreationContext(context);
- return activeEnginePriv->objectClass->newQObject(c, qMetaTypeId<QmlComponent*>());
+ return activeEnginePriv->objectClass->newQObject(c, qMetaTypeId<QDeclarativeComponent*>());
}
}
-QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
{
- QmlEnginePrivate *activeEnginePriv =
- static_cast<QmlScriptEngine*>(engine)->p;
- QmlEngine* activeEngine = activeEnginePriv->q_func();
+ QDeclarativeEnginePrivate *activeEnginePriv =
+ static_cast<QDeclarativeScriptEngine*>(engine)->p;
+ QDeclarativeEngine* activeEngine = activeEnginePriv->q_func();
if(ctxt->argumentCount() < 2 || ctxt->argumentCount() > 3)
return engine->nullValue();
- QmlContext* context = activeEnginePriv->getContext(ctxt);
+ QDeclarativeContext* context = activeEnginePriv->getContext(ctxt);
Q_ASSERT(context);
QString qml = ctxt->argument(0).toString();
@@ -874,20 +874,20 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
if(!parentArg)
return engine->nullValue();
- QmlComponent component(activeEngine);
+ QDeclarativeComponent component(activeEngine);
component.setData(qml.toUtf8(), url);
if(component.isError()) {
- QList<QmlError> errors = component.errors();
- qWarning().nospace() << "QmlEngine::createQmlObject():";
- foreach (const QmlError &error, errors)
+ QList<QDeclarativeError> errors = component.errors();
+ qWarning().nospace() << "QDeclarativeEngine::createQmlObject():";
+ foreach (const QDeclarativeError &error, errors)
qWarning().nospace() << " " << error;
return engine->nullValue();
}
if (!component.isReady()) {
- qWarning().nospace() << "QmlEngine::createQmlObject(): Component is not ready";
+ qWarning().nospace() << "QDeclarativeEngine::createQmlObject(): Component is not ready";
return engine->nullValue();
}
@@ -895,9 +895,9 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
QObject *obj = component.create(context);
if(component.isError()) {
- QList<QmlError> errors = component.errors();
- qWarning().nospace() << "QmlEngine::createQmlObject():";
- foreach (const QmlError &error, errors)
+ QList<QDeclarativeError> errors = component.errors();
+ qWarning().nospace() << "QDeclarativeEngine::createQmlObject():";
+ foreach (const QDeclarativeError &error, errors)
qWarning().nospace() << " " << error;
return engine->nullValue();
@@ -914,7 +914,7 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi
return qmlScriptObject(obj, activeEngine);
}
-QScriptValue QmlEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 3)
return engine->nullValue();
@@ -924,7 +924,7 @@ QScriptValue QmlEnginePrivate::vector(QScriptContext *ctxt, QScriptEngine *engin
return engine->newVariant(qVariantFromValue(QVector3D(x, y, z)));
}
-QScriptValue QmlEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine *engine)
{
int argCount = ctxt->argumentCount();
if(argCount < 3 || argCount > 4)
@@ -940,7 +940,7 @@ QScriptValue QmlEnginePrivate::rgba(QScriptContext *ctxt, QScriptEngine *engine)
return qScriptValueFromValue(engine, qVariantFromValue(QColor::fromRgbF(r, g, b, a)));
}
-QScriptValue QmlEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine *engine)
{
int argCount = ctxt->argumentCount();
if(argCount < 3 || argCount > 4)
@@ -956,7 +956,7 @@ QScriptValue QmlEnginePrivate::hsla(QScriptContext *ctxt, QScriptEngine *engine)
return qScriptValueFromValue(engine, qVariantFromValue(QColor::fromHslF(h, s, l, a)));
}
-QScriptValue QmlEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 4)
return engine->nullValue();
@@ -972,7 +972,7 @@ QScriptValue QmlEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine *engine)
return qScriptValueFromValue(engine, qVariantFromValue(QRectF(x, y, w, h)));
}
-QScriptValue QmlEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 2)
return engine->nullValue();
@@ -981,7 +981,7 @@ QScriptValue QmlEnginePrivate::point(QScriptContext *ctxt, QScriptEngine *engine
return qScriptValueFromValue(engine, qVariantFromValue(QPointF(x, y)));
}
-QScriptValue QmlEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 2)
return engine->nullValue();
@@ -990,7 +990,7 @@ QScriptValue QmlEnginePrivate::size(QScriptContext *ctxt, QScriptEngine *engine)
return qScriptValueFromValue(engine, qVariantFromValue(QSizeF(w, h)));
}
-QScriptValue QmlEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 1)
return engine->nullValue();
@@ -1000,7 +1000,7 @@ QScriptValue QmlEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engi
color = v.value<QColor>();
else if (v.userType() == QVariant::String) {
bool ok;
- color = QmlStringConverters::colorFromString(v.toString(), &ok);
+ color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
if (!ok)
return engine->nullValue();
} else
@@ -1009,7 +1009,7 @@ QScriptValue QmlEnginePrivate::lighter(QScriptContext *ctxt, QScriptEngine *engi
return qScriptValueFromValue(engine, qVariantFromValue(color));
}
-QScriptValue QmlEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 1)
return engine->nullValue();
@@ -1019,7 +1019,7 @@ QScriptValue QmlEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engin
color = v.value<QColor>();
else if (v.userType() == QVariant::String) {
bool ok;
- color = QmlStringConverters::colorFromString(v.toString(), &ok);
+ color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
if (!ok)
return engine->nullValue();
} else
@@ -1028,16 +1028,16 @@ QScriptValue QmlEnginePrivate::darker(QScriptContext *ctxt, QScriptEngine *engin
return qScriptValueFromValue(engine, qVariantFromValue(color));
}
-QScriptValue QmlEnginePrivate::playSound(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::playSound(QScriptContext *ctxt, QScriptEngine *engine)
{
if (ctxt->argumentCount() != 1)
return engine->undefinedValue();
QUrl url(ctxt->argument(0).toString());
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
if (url.isRelative()) {
- QmlContext *context = enginePriv->getContext(ctxt);
+ QDeclarativeContext *context = enginePriv->getContext(ctxt);
if (!context)
return engine->undefinedValue();
@@ -1052,7 +1052,7 @@ QScriptValue QmlEnginePrivate::playSound(QScriptContext *ctxt, QScriptEngine *en
return engine->undefinedValue();
}
-QScriptValue QmlEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QScriptEngine *e)
+QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QScriptEngine *e)
{
if(ctxt->argumentCount() < 1)
return e->newVariant(QVariant(false));
@@ -1060,7 +1060,7 @@ QScriptValue QmlEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QScriptEngin
return e->newVariant(QVariant(ret));
}
-QScriptValue QmlEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *)
+QScriptValue QDeclarativeEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *)
{
QByteArray data;
@@ -1072,7 +1072,7 @@ QScriptValue QmlEnginePrivate::md5(QScriptContext *ctxt, QScriptEngine *)
return QScriptValue(QLatin1String(result.toHex()));
}
-QScriptValue QmlEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine *)
+QScriptValue QDeclarativeEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine *)
{
QByteArray data;
@@ -1082,7 +1082,7 @@ QScriptValue QmlEnginePrivate::btoa(QScriptContext *ctxt, QScriptEngine *)
return QScriptValue(QLatin1String(data.toBase64()));
}
-QScriptValue QmlEnginePrivate::atob(QScriptContext *ctxt, QScriptEngine *)
+QScriptValue QDeclarativeEnginePrivate::atob(QScriptContext *ctxt, QScriptEngine *)
{
QByteArray data;
@@ -1092,7 +1092,7 @@ QScriptValue QmlEnginePrivate::atob(QScriptContext *ctxt, QScriptEngine *)
return QScriptValue(QLatin1String(QByteArray::fromBase64(data)));
}
-QScriptValue QmlEnginePrivate::consoleLog(QScriptContext *ctxt, QScriptEngine *e)
+QScriptValue QDeclarativeEnginePrivate::consoleLog(QScriptContext *ctxt, QScriptEngine *e)
{
if(ctxt->argumentCount() < 1)
return e->newVariant(QVariant(false));
@@ -1111,20 +1111,20 @@ QScriptValue QmlEnginePrivate::consoleLog(QScriptContext *ctxt, QScriptEngine *e
return e->newVariant(QVariant(true));
}
-void QmlEnginePrivate::sendQuit ()
+void QDeclarativeEnginePrivate::sendQuit ()
{
- Q_Q(QmlEngine);
+ Q_Q(QDeclarativeEngine);
emit q->quit();
}
-QScriptValue QmlEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptEngine *e)
+QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptEngine *e)
{
- QmlEnginePrivate *qe = get (e);
+ QDeclarativeEnginePrivate *qe = get (e);
qe->sendQuit ();
return QScriptValue();
}
-QScriptValue QmlEnginePrivate::closestAngle(QScriptContext *ctxt, QScriptEngine *e)
+QScriptValue QDeclarativeEnginePrivate::closestAngle(QScriptContext *ctxt, QScriptEngine *e)
{
if(ctxt->argumentCount() < 2)
return e->newVariant(QVariant(0.0));
@@ -1143,7 +1143,7 @@ QScriptValue QmlEnginePrivate::closestAngle(QScriptContext *ctxt, QScriptEngine
return e->newVariant(QVariant(ret));
}
-QScriptValue QmlEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
{
if(ctxt->argumentCount() != 2)
return engine->nullValue();
@@ -1154,7 +1154,7 @@ QScriptValue QmlEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
color = v.value<QColor>();
else if (v.userType() == QVariant::String) {
bool ok;
- color = QmlStringConverters::colorFromString(v.toString(), &ok);
+ color = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
if (!ok)
return engine->nullValue();
} else
@@ -1167,7 +1167,7 @@ QScriptValue QmlEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
tintColor = v.value<QColor>();
else if (v.userType() == QVariant::String) {
bool ok;
- tintColor = QmlStringConverters::colorFromString(v.toString(), &ok);
+ tintColor = QDeclarativeStringConverters::colorFromString(v.toString(), &ok);
if (!ok)
return engine->nullValue();
} else
@@ -1198,10 +1198,10 @@ QScriptValue QmlEnginePrivate::tint(QScriptContext *ctxt, QScriptEngine *engine)
}
-QScriptValue QmlEnginePrivate::scriptValueFromVariant(const QVariant &val)
+QScriptValue QDeclarativeEnginePrivate::scriptValueFromVariant(const QVariant &val)
{
- if (val.userType() == qMetaTypeId<QmlListReference>()) {
- QmlListReferencePrivate *p = QmlListReferencePrivate::get((QmlListReference*)val.constData());
+ if (val.userType() == qMetaTypeId<QDeclarativeListReference>()) {
+ QDeclarativeListReferencePrivate *p = QDeclarativeListReferencePrivate::get((QDeclarativeListReference*)val.constData());
if (p->object) {
return listClass->newList(p->property, p->propertyType);
} else {
@@ -1210,7 +1210,7 @@ QScriptValue QmlEnginePrivate::scriptValueFromVariant(const QVariant &val)
}
bool objOk;
- QObject *obj = QmlMetaType::toQObject(val, &objOk);
+ QObject *obj = QDeclarativeMetaType::toQObject(val, &objOk);
if (objOk) {
return objectClass->newQObject(obj);
} else {
@@ -1218,7 +1218,7 @@ QScriptValue QmlEnginePrivate::scriptValueFromVariant(const QVariant &val)
}
}
-QVariant QmlEnginePrivate::scriptValueToVariant(const QScriptValue &val)
+QVariant QDeclarativeEnginePrivate::scriptValueToVariant(const QScriptValue &val)
{
QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(val);
if (dc == objectClass)
@@ -1236,15 +1236,15 @@ QVariant QmlEnginePrivate::scriptValueToVariant(const QScriptValue &val)
}
}
-QmlScriptClass::QmlScriptClass(QScriptEngine *engine)
+QDeclarativeScriptClass::QDeclarativeScriptClass(QScriptEngine *engine)
: QScriptDeclarativeClass(engine)
{
}
-QVariant QmlScriptClass::toVariant(QmlEngine *engine, const QScriptValue &val)
+QVariant QDeclarativeScriptClass::toVariant(QDeclarativeEngine *engine, const QScriptValue &val)
{
- QmlEnginePrivate *ep =
- static_cast<QmlEnginePrivate *>(QObjectPrivate::get(engine));
+ QDeclarativeEnginePrivate *ep =
+ static_cast<QDeclarativeEnginePrivate *>(QObjectPrivate::get(engine));
return ep->scriptValueToVariant(val);
}
@@ -1259,7 +1259,7 @@ static QString toLocalFileOrQrc(const QUrl& url)
}
/////////////////////////////////////////////////////////////
-struct QmlEnginePrivate::ImportedNamespace {
+struct QDeclarativeEnginePrivate::ImportedNamespace {
QStringList uris;
QStringList urls;
QList<int> majversions;
@@ -1267,7 +1267,7 @@ struct QmlEnginePrivate::ImportedNamespace {
QList<bool> isLibrary;
QList<QString> qmlDirContent;
- bool find(const QByteArray& type, int *vmajor, int *vminor, QmlType** type_return, QUrl* url_return) const
+ bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return, QUrl* url_return) const
{
for (int i=0; i<urls.count(); ++i) {
int vmaj = majversions.at(i);
@@ -1279,7 +1279,7 @@ struct QmlEnginePrivate::ImportedNamespace {
if (qmlImportTrace())
qDebug() << "Look in" << qt;
- QmlType *t = QmlMetaType::qmlType(qt,vmaj,vmin);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
if (t) {
if (vmajor) *vmajor = vmaj;
if (vminor) *vminor = vmin;
@@ -1293,7 +1293,7 @@ struct QmlEnginePrivate::ImportedNamespace {
QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
QString qmldircontent = qmlDirContent.at(i);
if (vmaj>=0 || !qmldircontent.isEmpty()) {
- // Check version file - XXX cache these in QmlEngine!
+ // Check version file - XXX cache these in QDeclarativeEngine!
if (qmldircontent.isEmpty()) {
QFile qmldir(toLocalFileOrQrc(QUrl(urls.at(i)+QLatin1String("/qmldir"))));
if (qmldir.open(QIODevice::ReadOnly)) {
@@ -1303,12 +1303,12 @@ struct QmlEnginePrivate::ImportedNamespace {
const QString typeName = QString::fromUtf8(type);
- QmlDirParser qmldirParser;
+ QDeclarativeDirParser qmldirParser;
qmldirParser.setUrl(url);
qmldirParser.setSource(qmldircontent);
qmldirParser.parse();
- foreach (const QmlDirParser::Component &c, qmldirParser.components()) { // ### TODO: cache the components
+ foreach (const QDeclarativeDirParser::Component &c, qmldirParser.components()) { // ### TODO: cache the components
if (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion)) {
if (c.typeName == typeName) {
if (url_return)
@@ -1333,32 +1333,32 @@ struct QmlEnginePrivate::ImportedNamespace {
}
};
-class QmlImportsPrivate {
+class QDeclarativeImportsPrivate {
public:
- QmlImportsPrivate() : ref(1)
+ QDeclarativeImportsPrivate() : ref(1)
{
}
- ~QmlImportsPrivate()
+ ~QDeclarativeImportsPrivate()
{
- foreach (QmlEnginePrivate::ImportedNamespace* s, set.values())
+ foreach (QDeclarativeEnginePrivate::ImportedNamespace* s, set.values())
delete s;
}
QSet<QString> qmlDirFilesForWhichPluginsHaveBeenLoaded;
- bool add(const QUrl& base, const QString& qmldircontent, const QString& uri, const QString& prefix, int vmaj, int vmin, QmlScriptParser::Import::Type importType, const QStringList& importPath, QmlEngine *engine)
+ bool add(const QUrl& base, const QString& qmldircontent, const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType, const QStringList& importPath, QDeclarativeEngine *engine)
{
- QmlEnginePrivate::ImportedNamespace *s;
+ QDeclarativeEnginePrivate::ImportedNamespace *s;
if (prefix.isEmpty()) {
s = &unqualifiedset;
} else {
s = set.value(prefix);
if (!s)
- set.insert(prefix,(s=new QmlEnginePrivate::ImportedNamespace));
+ set.insert(prefix,(s=new QDeclarativeEnginePrivate::ImportedNamespace));
}
QString url = uri;
- if (importType == QmlScriptParser::Import::Library) {
+ if (importType == QDeclarativeScriptParser::Import::Library) {
url.replace(QLatin1Char('.'), QLatin1Char('/'));
bool found = false;
QString content;
@@ -1370,7 +1370,7 @@ public:
// base..
paths += QFileInfo(base.toLocalFile()).path();
paths += importPath;
- paths += QmlEnginePrivate::get(engine)->environmentImportPath;
+ paths += QDeclarativeEnginePrivate::get(engine)->environmentImportPath;
foreach (const QString &p, paths) {
dir = p+QLatin1Char('/')+url;
@@ -1389,12 +1389,12 @@ public:
if (! qmlDirFilesForWhichPluginsHaveBeenLoaded.contains(absoluteFilePath)) {
qmlDirFilesForWhichPluginsHaveBeenLoaded.insert(absoluteFilePath);
- QmlDirParser qmldirParser;
+ QDeclarativeDirParser qmldirParser;
qmldirParser.setSource(content);
qmldirParser.parse();
- foreach (const QmlDirParser::Plugin &plugin, qmldirParser.plugins()) {
- QString resolvedFilePath = QmlEnginePrivate::get(engine)->resolvePlugin(dir + QDir::separator() + plugin.path,
+ foreach (const QDeclarativeDirParser::Plugin &plugin, qmldirParser.plugins()) {
+ QString resolvedFilePath = QDeclarativeEnginePrivate::get(engine)->resolvePlugin(dir + QDir::separator() + plugin.path,
plugin.name);
if (!resolvedFilePath.isEmpty())
@@ -1414,14 +1414,14 @@ public:
s->urls.prepend(url);
s->majversions.prepend(vmaj);
s->minversions.prepend(vmin);
- s->isLibrary.prepend(importType == QmlScriptParser::Import::Library);
+ s->isLibrary.prepend(importType == QDeclarativeScriptParser::Import::Library);
s->qmlDirContent.prepend(qmldircontent);
return true;
}
- bool find(const QByteArray& type, int *vmajor, int *vminor, QmlType** type_return, QUrl* url_return)
+ bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return, QUrl* url_return)
{
- QmlEnginePrivate::ImportedNamespace *s = 0;
+ QDeclarativeEnginePrivate::ImportedNamespace *s = 0;
int slash = type.indexOf('/');
if (slash >= 0) {
s = set.value(QString::fromUtf8(type.left(slash)));
@@ -1451,7 +1451,7 @@ public:
}
}
- QmlEnginePrivate::ImportedNamespace *findNamespace(const QString& type)
+ QDeclarativeEnginePrivate::ImportedNamespace *findNamespace(const QString& type)
{
return set.value(type);
}
@@ -1460,18 +1460,18 @@ public:
int ref;
private:
- friend struct QmlEnginePrivate::Imports;
- QmlEnginePrivate::ImportedNamespace unqualifiedset;
- QHash<QString,QmlEnginePrivate::ImportedNamespace* > set;
+ friend struct QDeclarativeEnginePrivate::Imports;
+ QDeclarativeEnginePrivate::ImportedNamespace unqualifiedset;
+ QHash<QString,QDeclarativeEnginePrivate::ImportedNamespace* > set;
};
-QmlEnginePrivate::Imports::Imports(const Imports &copy) :
+QDeclarativeEnginePrivate::Imports::Imports(const Imports &copy) :
d(copy.d)
{
++d->ref;
}
-QmlEnginePrivate::Imports &QmlEnginePrivate::Imports::operator =(const Imports &copy)
+QDeclarativeEnginePrivate::Imports &QDeclarativeEnginePrivate::Imports::operator =(const Imports &copy)
{
++copy.d->ref;
if (--d->ref == 0)
@@ -1480,33 +1480,33 @@ QmlEnginePrivate::Imports &QmlEnginePrivate::Imports::operator =(const Imports &
return *this;
}
-QmlEnginePrivate::Imports::Imports() :
- d(new QmlImportsPrivate)
+QDeclarativeEnginePrivate::Imports::Imports() :
+ d(new QDeclarativeImportsPrivate)
{
}
-QmlEnginePrivate::Imports::~Imports()
+QDeclarativeEnginePrivate::Imports::~Imports()
{
if (--d->ref == 0)
delete d;
}
-#include "qmlmetatype.h"
-#include "qmltypenamecache_p.h"
+#include "qdeclarativemetatype.h"
+#include "qdeclarativetypenamecache_p.h"
-static QmlTypeNameCache *cacheForNamespace(QmlEngine *engine, const QmlEnginePrivate::ImportedNamespace &set, QmlTypeNameCache *cache)
+static QDeclarativeTypeNameCache *cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeEnginePrivate::ImportedNamespace &set, QDeclarativeTypeNameCache *cache)
{
if (!cache)
- cache = new QmlTypeNameCache(engine);
+ cache = new QDeclarativeTypeNameCache(engine);
- QList<QmlType *> types = QmlMetaType::qmlTypes();
+ QList<QDeclarativeType *> types = QDeclarativeMetaType::qmlTypes();
for (int ii = 0; ii < set.uris.count(); ++ii) {
QByteArray base = set.uris.at(ii).toUtf8() + '/';
int major = set.majversions.at(ii);
int minor = set.minversions.at(ii);
- foreach (QmlType *type, types) {
+ foreach (QDeclarativeType *type, types) {
if (type->qmlTypeName().startsWith(base) &&
type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) &&
type->availableInVersion(major,minor))
@@ -1521,21 +1521,21 @@ static QmlTypeNameCache *cacheForNamespace(QmlEngine *engine, const QmlEnginePri
return cache;
}
-QmlTypeNameCache *QmlEnginePrivate::Imports::cache(QmlEngine *engine) const
+QDeclarativeTypeNameCache *QDeclarativeEnginePrivate::Imports::cache(QDeclarativeEngine *engine) const
{
- const QmlEnginePrivate::ImportedNamespace &set = d->unqualifiedset;
+ const QDeclarativeEnginePrivate::ImportedNamespace &set = d->unqualifiedset;
- QmlTypeNameCache *cache = new QmlTypeNameCache(engine);
+ QDeclarativeTypeNameCache *cache = new QDeclarativeTypeNameCache(engine);
- for (QHash<QString,QmlEnginePrivate::ImportedNamespace* >::ConstIterator iter = d->set.begin();
+ for (QHash<QString,QDeclarativeEnginePrivate::ImportedNamespace* >::ConstIterator iter = d->set.begin();
iter != d->set.end(); ++iter) {
- QmlTypeNameCache::Data *d = cache->data(iter.key());
+ QDeclarativeTypeNameCache::Data *d = cache->data(iter.key());
if (d) {
if (!d->typeNamespace)
cacheForNamespace(engine, *(*iter), d->typeNamespace);
} else {
- QmlTypeNameCache *nc = cacheForNamespace(engine, *(*iter), 0);
+ QDeclarativeTypeNameCache *nc = cacheForNamespace(engine, *(*iter), 0);
cache->add(iter.key(), nc);
nc->release();
}
@@ -1547,11 +1547,11 @@ QmlTypeNameCache *QmlEnginePrivate::Imports::cache(QmlEngine *engine) const
}
/*
-QStringList QmlEnginePrivate::Imports::unqualifiedSet() const
+QStringList QDeclarativeEnginePrivate::Imports::unqualifiedSet() const
{
QStringList rv;
- const QmlEnginePrivate::ImportedNamespace &set = d->unqualifiedset;
+ const QDeclarativeEnginePrivate::ImportedNamespace &set = d->unqualifiedset;
for (int ii = 0; ii < set.urls.count(); ++ii) {
if (set.isBuiltin.at(ii))
@@ -1565,7 +1565,7 @@ QStringList QmlEnginePrivate::Imports::unqualifiedSet() const
/*!
Sets the base URL to be used for all relative file imports added.
*/
-void QmlEnginePrivate::Imports::setBaseUrl(const QUrl& url)
+void QDeclarativeEnginePrivate::Imports::setBaseUrl(const QUrl& url)
{
d->base = url;
}
@@ -1573,7 +1573,7 @@ void QmlEnginePrivate::Imports::setBaseUrl(const QUrl& url)
/*!
Returns the base URL to be used for all relative file imports added.
*/
-QUrl QmlEnginePrivate::Imports::baseUrl() const
+QUrl QDeclarativeEnginePrivate::Imports::baseUrl() const
{
return d->base;
}
@@ -1583,7 +1583,7 @@ QUrl QmlEnginePrivate::Imports::baseUrl() const
defined in a URL-based directory structure.
For example, if you add \c /opt/MyApp/lib/qml and then load QML
- that imports \c com.mycompany.Feature, then QmlEngine will look
+ that imports \c com.mycompany.Feature, then QDeclarativeEngine will look
in \c /opt/MyApp/lib/qml/com/mycompany/Feature/ for the components
provided by that module (and in the case of versioned imports,
for the \c qmldir file definiting the type version mapping.
@@ -1591,25 +1591,25 @@ QUrl QmlEnginePrivate::Imports::baseUrl() const
By default, only the "qml" subdirectory of QLibraryInfo::location(QLibraryInfo::DataPath)
is included on the import path.
*/
-void QmlEngine::addImportPath(const QString& path)
+void QDeclarativeEngine::addImportPath(const QString& path)
{
if (qmlImportTrace())
- qDebug() << "QmlEngine::addImportPath" << path;
- Q_D(QmlEngine);
+ qDebug() << "QDeclarativeEngine::addImportPath" << path;
+ Q_D(QDeclarativeEngine);
d->fileImportPath.prepend(path);
}
/*!
- Imports the given \a extension into this QmlEngine. Returns
+ Imports the given \a extension into this QDeclarativeEngine. Returns
true if the extension was successfully imported.
- \sa QmlExtensionInterface
+ \sa QDeclarativeExtensionInterface
*/
-bool QmlEngine::importExtension(const QString &fileName, const QString &uri)
+bool QDeclarativeEngine::importExtension(const QString &fileName, const QString &uri)
{
QPluginLoader loader(fileName);
- if (QmlExtensionInterface *iface = qobject_cast<QmlExtensionInterface *>(loader.instance())) {
+ if (QDeclarativeExtensionInterface *iface = qobject_cast<QDeclarativeExtensionInterface *>(loader.instance())) {
iface->initialize(this, uri.toUtf8().constData());
return true;
}
@@ -1618,13 +1618,13 @@ bool QmlEngine::importExtension(const QString &fileName, const QString &uri)
}
/*!
- \property QmlEngine::offlineStoragePath
+ \property QDeclarativeEngine::offlineStoragePath
\brief the directory for storing offline user data
Returns the directory where SQL and other offline
storage is placed.
- QmlGraphicsWebView and the SQL databases created with openDatabase()
+ QDeclarativeWebView and the SQL databases created with openDatabase()
are stored here.
The default is QML/OfflineStorage in the platform-standard
@@ -1634,15 +1634,15 @@ bool QmlEngine::importExtension(const QString &fileName, const QString &uri)
callers wanting to \e create new files at this location should create
it first - see QDir::mkpath().
*/
-void QmlEngine::setOfflineStoragePath(const QString& dir)
+void QDeclarativeEngine::setOfflineStoragePath(const QString& dir)
{
- Q_D(QmlEngine);
+ Q_D(QDeclarativeEngine);
d->scriptEngine.offlineStoragePath = dir;
}
-QString QmlEngine::offlineStoragePath() const
+QString QDeclarativeEngine::offlineStoragePath() const
{
- Q_D(const QmlEngine);
+ Q_D(const QDeclarativeEngine);
return d->scriptEngine.offlineStoragePath;
}
@@ -1651,7 +1651,7 @@ QString QmlEngine::offlineStoragePath() const
Returns the result of the merge of \a baseName with \a dir, \a suffixes, and \a prefix.
*/
-QString QmlEnginePrivate::resolvePlugin(const QDir &dir, const QString &baseName,
+QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &dir, const QString &baseName,
const QStringList &suffixes,
const QString &prefix)
{
@@ -1688,7 +1688,7 @@ QString QmlEnginePrivate::resolvePlugin(const QDir &dir, const QString &baseName
Version number on unix are ignored.
*/
-QString QmlEnginePrivate::resolvePlugin(const QDir &dir, const QString &baseName)
+QString QDeclarativeEnginePrivate::resolvePlugin(const QDir &dir, const QString &baseName)
{
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
return resolvePlugin(dir, baseName, QStringList(QLatin1String("dll")));
@@ -1742,12 +1742,12 @@ QString QmlEnginePrivate::resolvePlugin(const QDir &dir, const QString &baseName
The base URL must already have been set with Import::setBaseUrl().
*/
-bool QmlEnginePrivate::addToImport(Imports* imports, const QString& qmldircontent, const QString& uri, const QString& prefix, int vmaj, int vmin, QmlScriptParser::Import::Type importType) const
+bool QDeclarativeEnginePrivate::addToImport(Imports* imports, const QString& qmldircontent, const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType) const
{
- QmlEngine *engine = QmlEnginePrivate::get(const_cast<QmlEnginePrivate *>(this));
+ QDeclarativeEngine *engine = QDeclarativeEnginePrivate::get(const_cast<QDeclarativeEnginePrivate *>(this));
bool ok = imports->d->add(imports->d->base,qmldircontent,uri,prefix,vmaj,vmin,importType,fileImportPath, engine);
if (qmlImportTrace())
- qDebug() << "QmlEngine::addToImport(" << imports << uri << prefix << vmaj << '.' << vmin << (importType==QmlScriptParser::Import::Library? "Library" : "File") << ": " << ok;
+ qDebug() << "QDeclarativeEngine::addToImport(" << imports << uri << prefix << vmaj << '.' << vmin << (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File") << ": " << ok;
return ok;
}
@@ -1756,19 +1756,19 @@ bool QmlEnginePrivate::addToImport(Imports* imports, const QString& qmldirconten
Using the given \a imports, the given (namespace qualified) \a type is resolved to either
an ImportedNamespace stored at \a ns_return,
- a QmlType stored at \a type_return, or
+ a QDeclarativeType stored at \a type_return, or
a component located at \a url_return.
If any return pointer is 0, the corresponding search is not done.
\sa addToImport()
*/
-bool QmlEnginePrivate::resolveType(const Imports& imports, const QByteArray& type, QmlType** type_return, QUrl* url_return, int *vmaj, int *vmin, ImportedNamespace** ns_return) const
+bool QDeclarativeEnginePrivate::resolveType(const Imports& imports, const QByteArray& type, QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin, ImportedNamespace** ns_return) const
{
ImportedNamespace* ns = imports.d->findNamespace(QString::fromUtf8(type));
if (ns) {
if (qmlImportTrace())
- qDebug() << "QmlEngine::resolveType" << type << "is namespace for" << ns->urls;
+ qDebug() << "QDeclarativeEngine::resolveType" << type << "is namespace for" << ns->urls;
if (ns_return)
*ns_return = ns;
return true;
@@ -1777,14 +1777,14 @@ bool QmlEnginePrivate::resolveType(const Imports& imports, const QByteArray& typ
if (imports.d->find(type,vmaj,vmin,type_return,url_return)) {
if (qmlImportTrace()) {
if (type_return && *type_return)
- qDebug() << "QmlEngine::resolveType" << type << '=' << (*type_return)->typeName();
+ qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << (*type_return)->typeName();
if (url_return)
- qDebug() << "QmlEngine::resolveType" << type << '=' << *url_return;
+ qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << *url_return;
}
return true;
}
if (qmlImportTrace())
- qDebug() << "QmlEngine::resolveType" << type << "not found";
+ qDebug() << "QDeclarativeEngine::resolveType" << type << "not found";
}
return false;
}
@@ -1794,12 +1794,12 @@ bool QmlEnginePrivate::resolveType(const Imports& imports, const QByteArray& typ
Searching \e only in the namespace \a ns (previously returned in a call to
resolveType(), \a type is found and returned to either
- a QmlType stored at \a type_return, or
+ a QDeclarativeType stored at \a type_return, or
a component located at \a url_return.
If either return pointer is 0, the corresponding search is not done.
*/
-void QmlEnginePrivate::resolveTypeInNamespace(ImportedNamespace* ns, const QByteArray& type, QmlType** type_return, QUrl* url_return, int *vmaj, int *vmin ) const
+void QDeclarativeEnginePrivate::resolveTypeInNamespace(ImportedNamespace* ns, const QByteArray& type, QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin ) const
{
ns->find(type,vmaj,vmin,type_return,url_return);
}
@@ -1819,12 +1819,12 @@ static void *voidptr_constructor(const void *v)
}
}
-void QmlEnginePrivate::registerCompositeType(QmlCompiledData *data)
+void QDeclarativeEnginePrivate::registerCompositeType(QDeclarativeCompiledData *data)
{
QByteArray name = data->root->className();
QByteArray ptr = name + '*';
- QByteArray lst = "QmlListProperty<" + name + ">";
+ QByteArray lst = "QDeclarativeListProperty<" + name + ">";
int ptr_type = QMetaType::registerType(ptr.constData(), voidptr_destructor,
voidptr_constructor);
@@ -1836,64 +1836,64 @@ void QmlEnginePrivate::registerCompositeType(QmlCompiledData *data)
data->addref();
}
-bool QmlEnginePrivate::isList(int t) const
+bool QDeclarativeEnginePrivate::isList(int t) const
{
- return m_qmlLists.contains(t) || QmlMetaType::isList(t);
+ return m_qmlLists.contains(t) || QDeclarativeMetaType::isList(t);
}
-int QmlEnginePrivate::listType(int t) const
+int QDeclarativeEnginePrivate::listType(int t) const
{
QHash<int, int>::ConstIterator iter = m_qmlLists.find(t);
if (iter != m_qmlLists.end())
return *iter;
else
- return QmlMetaType::listType(t);
+ return QDeclarativeMetaType::listType(t);
}
-bool QmlEnginePrivate::isQObject(int t)
+bool QDeclarativeEnginePrivate::isQObject(int t)
{
- return m_compositeTypes.contains(t) || QmlMetaType::isQObject(t);
+ return m_compositeTypes.contains(t) || QDeclarativeMetaType::isQObject(t);
}
-QObject *QmlEnginePrivate::toQObject(const QVariant &v, bool *ok) const
+QObject *QDeclarativeEnginePrivate::toQObject(const QVariant &v, bool *ok) const
{
int t = v.userType();
if (m_compositeTypes.contains(t)) {
if (ok) *ok = true;
return *(QObject **)(v.constData());
} else {
- return QmlMetaType::toQObject(v, ok);
+ return QDeclarativeMetaType::toQObject(v, ok);
}
}
-QmlMetaType::TypeCategory QmlEnginePrivate::typeCategory(int t) const
+QDeclarativeMetaType::TypeCategory QDeclarativeEnginePrivate::typeCategory(int t) const
{
if (m_compositeTypes.contains(t))
- return QmlMetaType::Object;
+ return QDeclarativeMetaType::Object;
else if (m_qmlLists.contains(t))
- return QmlMetaType::List;
+ return QDeclarativeMetaType::List;
else
- return QmlMetaType::typeCategory(t);
+ return QDeclarativeMetaType::typeCategory(t);
}
-const QMetaObject *QmlEnginePrivate::rawMetaObjectForType(int t) const
+const QMetaObject *QDeclarativeEnginePrivate::rawMetaObjectForType(int t) const
{
- QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.find(t);
+ QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.find(t);
if (iter != m_compositeTypes.end()) {
return (*iter)->root;
} else {
- QmlType *type = QmlMetaType::qmlType(t);
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(t);
return type?type->baseMetaObject():0;
}
}
-const QMetaObject *QmlEnginePrivate::metaObjectForType(int t) const
+const QMetaObject *QDeclarativeEnginePrivate::metaObjectForType(int t) const
{
- QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.find(t);
+ QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.find(t);
if (iter != m_compositeTypes.end()) {
return (*iter)->root;
} else {
- QmlType *type = QmlMetaType::qmlType(t);
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(t);
return type?type->metaObject():0;
}
}
diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qdeclarativeengine.h
index dd2012a..fd66358 100644
--- a/src/declarative/qml/qmlengine.h
+++ b/src/declarative/qml/qdeclarativeengine.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLENGINE_H
-#define QMLENGINE_H
+#ifndef QDECLARATIVEENGINE_H
+#define QDECLARATIVEENGINE_H
#include <QtCore/qurl.h>
#include <QtCore/qobject.h>
@@ -53,40 +53,40 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlComponent;
-class QmlEnginePrivate;
-class QmlImportsPrivate;
-class QmlExpression;
-class QmlContext;
-class QmlType;
+class QDeclarativeComponent;
+class QDeclarativeEnginePrivate;
+class QDeclarativeImportsPrivate;
+class QDeclarativeExpression;
+class QDeclarativeContext;
+class QDeclarativeType;
class QUrl;
class QScriptEngine;
class QScriptContext;
-class QmlImageProvider;
+class QDeclarativeImageProvider;
class QNetworkAccessManager;
-class QmlNetworkAccessManagerFactory;
-class Q_DECLARATIVE_EXPORT QmlEngine : public QObject
+class QDeclarativeNetworkAccessManagerFactory;
+class Q_DECLARATIVE_EXPORT QDeclarativeEngine : public QObject
{
Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath)
Q_OBJECT
public:
- QmlEngine(QObject *p = 0);
- virtual ~QmlEngine();
+ QDeclarativeEngine(QObject *p = 0);
+ virtual ~QDeclarativeEngine();
- QmlContext *rootContext();
+ QDeclarativeContext *rootContext();
void clearComponentCache();
void addImportPath(const QString& dir);
bool importExtension(const QString &fileName, const QString &uri);
- void setNetworkAccessManagerFactory(QmlNetworkAccessManagerFactory *);
- QmlNetworkAccessManagerFactory *networkAccessManagerFactory() const;
+ void setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory *);
+ QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory() const;
QNetworkAccessManager *networkAccessManager() const;
- void addImageProvider(const QString &id, QmlImageProvider *);
- QmlImageProvider *imageProvider(const QString &id) const;
+ void addImageProvider(const QString &id, QDeclarativeImageProvider *);
+ QDeclarativeImageProvider *imageProvider(const QString &id) const;
void removeImageProvider(const QString &id);
void setOfflineStoragePath(const QString& dir);
@@ -95,18 +95,18 @@ public:
QUrl baseUrl() const;
void setBaseUrl(const QUrl &);
- static QmlContext *contextForObject(const QObject *);
- static void setContextForObject(QObject *, QmlContext *);
+ static QDeclarativeContext *contextForObject(const QObject *);
+ static void setContextForObject(QObject *, QDeclarativeContext *);
Q_SIGNALS:
void quit ();
private:
- Q_DECLARE_PRIVATE(QmlEngine)
+ Q_DECLARE_PRIVATE(QDeclarativeEngine)
};
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLENGINE_H
+#endif // QDECLARATIVEENGINE_H
diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index b18ab24..7c9d833 100644
--- a/src/declarative/qml/qmlengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLENGINE_P_H
-#define QMLENGINE_P_H
+#ifndef QDECLARATIVEENGINE_P_H
+#define QDECLARATIVEENGINE_P_H
//
// W A R N I N G
@@ -53,20 +53,20 @@
// We mean it.
//
-#include "qmlengine.h"
+#include "qdeclarativeengine.h"
-#include "qmlclassfactory_p.h"
-#include "qmlcompositetypemanager_p.h"
+#include "qdeclarativeclassfactory_p.h"
+#include "qdeclarativecompositetypemanager_p.h"
#include "qpodvector_p.h"
-#include "qml.h"
-#include "qmlvaluetype_p.h"
-#include "qmlcontext.h"
-#include "qmlexpression.h"
-#include "qmlmetaproperty_p.h"
-#include "qmlpropertycache_p.h"
-#include "qmlobjectscriptclass_p.h"
-#include "qmlcontextscriptclass_p.h"
-#include "qmlvaluetypescriptclass_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativevaluetype_p.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativemetaproperty_p.h"
+#include "qdeclarativepropertycache_p.h"
+#include "qdeclarativeobjectscriptclass_p.h"
+#include "qdeclarativecontextscriptclass_p.h"
+#include "qdeclarativevaluetypescriptclass_p.h"
#include <QtScript/QScriptClass>
#include <QtScript/QScriptValue>
@@ -82,42 +82,42 @@
QT_BEGIN_NAMESPACE
-class QmlContext;
-class QmlEngine;
-class QmlContextPrivate;
-class QmlExpression;
-class QmlContextScriptClass;
-class QmlObjectScriptClass;
-class QmlTypeNameScriptClass;
-class QmlValueTypeScriptClass;
+class QDeclarativeContext;
+class QDeclarativeEngine;
+class QDeclarativeContextPrivate;
+class QDeclarativeExpression;
+class QDeclarativeContextScriptClass;
+class QDeclarativeObjectScriptClass;
+class QDeclarativeTypeNameScriptClass;
+class QDeclarativeValueTypeScriptClass;
class QScriptEngineDebugger;
class QNetworkReply;
class QNetworkAccessManager;
-class QmlNetworkAccessManagerFactory;
-class QmlAbstractBinding;
+class QDeclarativeNetworkAccessManagerFactory;
+class QDeclarativeAbstractBinding;
class QScriptDeclarativeClass;
-class QmlTypeNameScriptClass;
-class QmlTypeNameCache;
-class QmlComponentAttached;
-class QmlListScriptClass;
-class QmlCleanup;
-class QmlDelayedError;
-class QmlWorkerScriptEngine;
-class QmlGlobalScriptClass;
+class QDeclarativeTypeNameScriptClass;
+class QDeclarativeTypeNameCache;
+class QDeclarativeComponentAttached;
+class QDeclarativeListScriptClass;
+class QDeclarativeCleanup;
+class QDeclarativeDelayedError;
+class QDeclarativeWorkerScriptEngine;
+class QDeclarativeGlobalScriptClass;
class QDir;
-class QmlScriptEngine : public QScriptEngine
+class QDeclarativeScriptEngine : public QScriptEngine
{
public:
- QmlScriptEngine(QmlEnginePrivate *priv);
- virtual ~QmlScriptEngine();
+ QDeclarativeScriptEngine(QDeclarativeEnginePrivate *priv);
+ virtual ~QDeclarativeScriptEngine();
QUrl resolvedUrl(QScriptContext *context, const QUrl& url); // resolved against p's context, or baseUrl if no p
static QScriptValue resolvedUrl(QScriptContext *ctxt, QScriptEngine *engine);
- static QmlScriptEngine *get(QScriptEngine* e) { return static_cast<QmlScriptEngine*>(e); }
+ static QDeclarativeScriptEngine *get(QScriptEngine* e) { return static_cast<QDeclarativeScriptEngine*>(e); }
- QmlEnginePrivate *p;
+ QDeclarativeEnginePrivate *p;
// User by SQL API
QScriptClass *sqlQueryClass;
@@ -132,12 +132,12 @@ public:
virtual QNetworkAccessManager *networkAccessManager();
};
-class Q_AUTOTEST_EXPORT QmlEnginePrivate : public QObjectPrivate
+class Q_AUTOTEST_EXPORT QDeclarativeEnginePrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QmlEngine)
+ Q_DECLARE_PUBLIC(QDeclarativeEngine)
public:
- QmlEnginePrivate(QmlEngine *);
- ~QmlEnginePrivate();
+ QDeclarativeEnginePrivate(QDeclarativeEngine *);
+ ~QDeclarativeEnginePrivate();
void init();
@@ -152,32 +152,32 @@ public:
bool captureProperties;
QPODVector<CapturedProperty> capturedProperties;
- QmlContext *rootContext;
- QmlExpression *currentExpression;
+ QDeclarativeContext *rootContext;
+ QDeclarativeExpression *currentExpression;
bool isDebugging;
struct ImportedNamespace;
- QmlContextScriptClass *contextClass;
- QmlContext *sharedContext;
+ QDeclarativeContextScriptClass *contextClass;
+ QDeclarativeContext *sharedContext;
QObject *sharedScope;
- QmlObjectScriptClass *objectClass;
- QmlValueTypeScriptClass *valueTypeClass;
- QmlTypeNameScriptClass *typeNameClass;
- QmlListScriptClass *listClass;
+ QDeclarativeObjectScriptClass *objectClass;
+ QDeclarativeValueTypeScriptClass *valueTypeClass;
+ QDeclarativeTypeNameScriptClass *typeNameClass;
+ QDeclarativeListScriptClass *listClass;
// Global script class
- QmlGlobalScriptClass *globalClass;
+ QDeclarativeGlobalScriptClass *globalClass;
// Registered cleanup handlers
- QmlCleanup *cleanup;
+ QDeclarativeCleanup *cleanup;
// Bindings that have had errors during startup
- QmlDelayedError *erroredBindings;
+ QDeclarativeDelayedError *erroredBindings;
int inProgressCreations;
- QmlScriptEngine scriptEngine;
+ QDeclarativeScriptEngine scriptEngine;
- QmlWorkerScriptEngine *getWorkerScriptEngine();
- QmlWorkerScriptEngine *workerScriptEngine;
+ QDeclarativeWorkerScriptEngine *getWorkerScriptEngine();
+ QDeclarativeWorkerScriptEngine *workerScriptEngine;
QUrl baseUrl;
@@ -204,26 +204,26 @@ public:
}
};
- static void clear(SimpleList<QmlAbstractBinding> &);
- static void clear(SimpleList<QmlParserStatus> &);
+ static void clear(SimpleList<QDeclarativeAbstractBinding> &);
+ static void clear(SimpleList<QDeclarativeParserStatus> &);
- QList<SimpleList<QmlAbstractBinding> > bindValues;
- QList<SimpleList<QmlParserStatus> > parserStatus;
- QmlComponentAttached *componentAttacheds;
+ QList<SimpleList<QDeclarativeAbstractBinding> > bindValues;
+ QList<SimpleList<QDeclarativeParserStatus> > parserStatus;
+ QDeclarativeComponentAttached *componentAttacheds;
bool inBeginCreate;
QNetworkAccessManager *createNetworkAccessManager(QObject *parent) const;
QNetworkAccessManager *getNetworkAccessManager() const;
mutable QNetworkAccessManager *networkAccessManager;
- mutable QmlNetworkAccessManagerFactory *networkAccessManagerFactory;
+ mutable QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory;
- QHash<QString,QmlImageProvider*> imageProviders;
+ QHash<QString,QDeclarativeImageProvider*> imageProviders;
QImage getImageFromProvider(const QUrl &url);
mutable QMutex mutex;
- QmlCompositeTypeManager typeManager;
+ QDeclarativeCompositeTypeManager typeManager;
QStringList fileImportPath;
QString offlineStoragePath;
@@ -232,16 +232,16 @@ public:
return uniqueId++;
}
- QmlValueTypeFactory valueTypes;
+ QDeclarativeValueTypeFactory valueTypes;
- QHash<const QMetaObject *, QmlPropertyCache *> propertyCache;
- QmlPropertyCache *cache(QObject *obj) {
- Q_Q(QmlEngine);
+ QHash<const QMetaObject *, QDeclarativePropertyCache *> propertyCache;
+ QDeclarativePropertyCache *cache(QObject *obj) {
+ Q_Q(QDeclarativeEngine);
if (!obj || QObjectPrivate::get(obj)->metaObject) return 0;
const QMetaObject *mo = obj->metaObject();
- QmlPropertyCache *rv = propertyCache.value(mo);
+ QDeclarativePropertyCache *rv = propertyCache.value(mo);
if (!rv) {
- rv = QmlPropertyCache::create(q, mo);
+ rv = QDeclarativePropertyCache::create(q, mo);
propertyCache.insert(mo, rv);
}
return rv;
@@ -257,11 +257,11 @@ public:
void setBaseUrl(const QUrl& url);
QUrl baseUrl() const;
- QmlTypeNameCache *cache(QmlEngine *) const;
+ QDeclarativeTypeNameCache *cache(QDeclarativeEngine *) const;
private:
- friend class QmlEnginePrivate;
- QmlImportsPrivate *d;
+ friend class QDeclarativeEnginePrivate;
+ QDeclarativeImportsPrivate *d;
};
@@ -273,34 +273,34 @@ public:
QString resolvePlugin(const QDir &dir, const QString &baseName);
- bool addToImport(Imports*, const QString& qmlDirContent,const QString& uri, const QString& prefix, int vmaj, int vmin, QmlScriptParser::Import::Type importType) const;
+ bool addToImport(Imports*, const QString& qmlDirContent,const QString& uri, const QString& prefix, int vmaj, int vmin, QDeclarativeScriptParser::Import::Type importType) const;
bool resolveType(const Imports&, const QByteArray& type,
- QmlType** type_return, QUrl* url_return,
+ QDeclarativeType** type_return, QUrl* url_return,
int *version_major, int *version_minor,
ImportedNamespace** ns_return) const;
void resolveTypeInNamespace(ImportedNamespace*, const QByteArray& type,
- QmlType** type_return, QUrl* url_return,
+ QDeclarativeType** type_return, QUrl* url_return,
int *version_major, int *version_minor ) const;
- void registerCompositeType(QmlCompiledData *);
+ void registerCompositeType(QDeclarativeCompiledData *);
bool isQObject(int);
QObject *toQObject(const QVariant &, bool *ok = 0) const;
- QmlMetaType::TypeCategory typeCategory(int) const;
+ QDeclarativeMetaType::TypeCategory typeCategory(int) const;
bool isList(int) const;
int listType(int) const;
const QMetaObject *rawMetaObjectForType(int) const;
const QMetaObject *metaObjectForType(int) const;
QHash<int, int> m_qmlLists;
- QHash<int, QmlCompiledData *> m_compositeTypes;
+ QHash<int, QDeclarativeCompiledData *> m_compositeTypes;
QScriptValue scriptValueFromVariant(const QVariant &);
QVariant scriptValueToVariant(const QScriptValue &);
void sendQuit ();
- static QScriptValue qmlScriptObject(QObject*, QmlEngine*);
+ static QScriptValue qmlScriptObject(QObject*, QDeclarativeEngine*);
static QScriptValue createComponent(QScriptContext*, QScriptEngine*);
static QScriptValue createQmlObject(QScriptContext*, QScriptEngine*);
@@ -324,17 +324,17 @@ public:
static QScriptValue consoleLog(QScriptContext*, QScriptEngine*);
static QScriptValue quit(QScriptContext*, QScriptEngine*);
- static QScriptEngine *getScriptEngine(QmlEngine *e) { return &e->d_func()->scriptEngine; }
- static QmlEngine *getEngine(QScriptEngine *e) { return static_cast<QmlScriptEngine*>(e)->p->q_func(); }
- static QmlEnginePrivate *get(QmlEngine *e) { return e->d_func(); }
- static QmlEnginePrivate *get(QmlContext *c) { return (c && c->engine()) ? QmlEnginePrivate::get(c->engine()) : 0; }
- static QmlEnginePrivate *get(QScriptEngine *e) { return static_cast<QmlScriptEngine*>(e)->p; }
- static QmlEngine *get(QmlEnginePrivate *p) { return p->q_func(); }
- QmlContext *getContext(QScriptContext *);
+ static QScriptEngine *getScriptEngine(QDeclarativeEngine *e) { return &e->d_func()->scriptEngine; }
+ static QDeclarativeEngine *getEngine(QScriptEngine *e) { return static_cast<QDeclarativeScriptEngine*>(e)->p->q_func(); }
+ static QDeclarativeEnginePrivate *get(QDeclarativeEngine *e) { return e->d_func(); }
+ static QDeclarativeEnginePrivate *get(QDeclarativeContext *c) { return (c && c->engine()) ? QDeclarativeEnginePrivate::get(c->engine()) : 0; }
+ static QDeclarativeEnginePrivate *get(QScriptEngine *e) { return static_cast<QDeclarativeScriptEngine*>(e)->p; }
+ static QDeclarativeEngine *get(QDeclarativeEnginePrivate *p) { return p->q_func(); }
+ QDeclarativeContext *getContext(QScriptContext *);
static void defineModule();
};
QT_END_NAMESPACE
-#endif // QMLENGINE_P_H
+#endif // QDECLARATIVEENGINE_P_H
diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 973e5e5..e4579a6 100644
--- a/src/declarative/qml/qmlenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -39,32 +39,32 @@
**
****************************************************************************/
-#include "qmlenginedebug_p.h"
+#include "qdeclarativeenginedebug_p.h"
-#include "qmlboundsignal_p.h"
-#include "qmlengine.h"
-#include "qmlmetatype.h"
-#include "qmlmetaproperty.h"
-#include "qmlbinding_p.h"
-#include "qmlcontext_p.h"
-#include "qmlwatcher_p.h"
+#include "qdeclarativeboundsignal_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativemetatype.h"
+#include "qdeclarativemetaproperty.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativewatcher_p.h"
#include <QtCore/qdebug.h>
#include <QtCore/qmetaobject.h>
QT_BEGIN_NAMESPACE
-QList<QmlEngine *> QmlEngineDebugServer::m_engines;
-QmlEngineDebugServer::QmlEngineDebugServer(QObject *parent)
-: QmlDebugService(QLatin1String("QmlEngine"), parent),
- m_watch(new QmlWatcher(this))
+QList<QDeclarativeEngine *> QDeclarativeEngineDebugServer::m_engines;
+QDeclarativeEngineDebugServer::QDeclarativeEngineDebugServer(QObject *parent)
+: QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent),
+ m_watch(new QDeclarativeWatcher(this))
{
QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)),
this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant)));
}
QDataStream &operator<<(QDataStream &ds,
- const QmlEngineDebugServer::QmlObjectData &data)
+ const QDeclarativeEngineDebugServer::QDeclarativeObjectData &data)
{
ds << data.url << data.lineNumber << data.columnNumber << data.objectName
<< data.objectType << data.objectId << data.contextId;
@@ -72,7 +72,7 @@ QDataStream &operator<<(QDataStream &ds,
}
QDataStream &operator>>(QDataStream &ds,
- QmlEngineDebugServer::QmlObjectData &data)
+ QDeclarativeEngineDebugServer::QDeclarativeObjectData &data)
{
ds >> data.url >> data.lineNumber >> data.columnNumber >> data.objectName
>> data.objectType >> data.objectId >> data.contextId;
@@ -80,7 +80,7 @@ QDataStream &operator>>(QDataStream &ds,
}
QDataStream &operator<<(QDataStream &ds,
- const QmlEngineDebugServer::QmlObjectProperty &data)
+ const QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &data)
{
ds << (int)data.type << data.name << data.value << data.valueTypeName
<< data.binding << data.hasNotifySignal;
@@ -88,27 +88,27 @@ QDataStream &operator<<(QDataStream &ds,
}
QDataStream &operator>>(QDataStream &ds,
- QmlEngineDebugServer::QmlObjectProperty &data)
+ QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &data)
{
int type;
ds >> type >> data.name >> data.value >> data.valueTypeName
>> data.binding >> data.hasNotifySignal;
- data.type = (QmlEngineDebugServer::QmlObjectProperty::Type)type;
+ data.type = (QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Type)type;
return ds;
}
-QmlEngineDebugServer::QmlObjectProperty
-QmlEngineDebugServer::propertyData(QObject *obj, int propIdx)
+QDeclarativeEngineDebugServer::QDeclarativeObjectProperty
+QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
{
- QmlObjectProperty rv;
+ QDeclarativeObjectProperty rv;
QMetaProperty prop = obj->metaObject()->property(propIdx);
- rv.type = QmlObjectProperty::Unknown;
+ rv.type = QDeclarativeObjectProperty::Unknown;
rv.valueTypeName = QString::fromUtf8(prop.typeName());
rv.name = QString::fromUtf8(prop.name());
rv.hasNotifySignal = prop.hasNotifySignal();
- QmlAbstractBinding *binding = QmlMetaProperty(obj, rv.name).binding();
+ QDeclarativeAbstractBinding *binding = QDeclarativeMetaProperty(obj, rv.name).binding();
if (binding)
rv.binding = binding->expression();
@@ -116,32 +116,32 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx)
rv.value = valueContents(value);
if (QVariant::Type(prop.userType()) < QVariant::UserType) {
- rv.type = QmlObjectProperty::Basic;
- } else if (QmlMetaType::isQObject(prop.userType())) {
- rv.type = QmlObjectProperty::Object;
- } else if (QmlMetaType::isList(prop.userType())) {
- rv.type = QmlObjectProperty::List;
+ rv.type = QDeclarativeObjectProperty::Basic;
+ } else if (QDeclarativeMetaType::isQObject(prop.userType())) {
+ rv.type = QDeclarativeObjectProperty::Object;
+ } else if (QDeclarativeMetaType::isList(prop.userType())) {
+ rv.type = QDeclarativeObjectProperty::List;
}
return rv;
}
-QVariant QmlEngineDebugServer::valueContents(const QVariant &value) const
+QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) const
{
int userType = value.userType();
if (QVariant::Type(userType) < QVariant::UserType)
return value;
/*
- if (QmlMetaType::isList(userType)) {
- int count = QmlMetaType::listCount(value);
+ if (QDeclarativeMetaType::isList(userType)) {
+ int count = QDeclarativeMetaType::listCount(value);
QVariantList contents;
for (int i=0; i<count; i++)
- contents << valueContents(QmlMetaType::listAt(value, i));
+ contents << valueContents(QDeclarativeMetaType::listAt(value, i));
return contents;
} else */
- if (QmlMetaType::isQObject(userType)) {
- QObject *o = QmlMetaType::toQObject(value);
+ if (QDeclarativeMetaType::isQObject(userType)) {
+ QObject *o = QDeclarativeMetaType::toQObject(value);
if (o) {
QString name = o->objectName();
if (name.isEmpty())
@@ -153,7 +153,7 @@ QVariant QmlEngineDebugServer::valueContents(const QVariant &value) const
return QLatin1String("<unknown value>");
}
-void QmlEngineDebugServer::buildObjectDump(QDataStream &message,
+void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
QObject *object, bool recur)
{
message << objectData(object);
@@ -167,24 +167,24 @@ void QmlEngineDebugServer::buildObjectDump(QDataStream &message,
int childrenCount = children.count();
for (int ii = 0; ii < children.count(); ++ii) {
- if (qobject_cast<QmlContext*>(children[ii]) || QmlBoundSignal::cast(children[ii]))
+ if (qobject_cast<QDeclarativeContext*>(children[ii]) || QDeclarativeBoundSignal::cast(children[ii]))
--childrenCount;
}
message << childrenCount << recur;
- QList<QmlObjectProperty> fakeProperties;
+ QList<QDeclarativeObjectProperty> fakeProperties;
for (int ii = 0; ii < children.count(); ++ii) {
QObject *child = children.at(ii);
- if (qobject_cast<QmlContext*>(child))
+ if (qobject_cast<QDeclarativeContext*>(child))
continue;
- QmlBoundSignal *signal = QmlBoundSignal::cast(child);
+ QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
if (signal) {
- QmlObjectProperty prop;
- prop.type = QmlObjectProperty::SignalProperty;
+ QDeclarativeObjectProperty prop;
+ prop.type = QDeclarativeObjectProperty::SignalProperty;
prop.hasNotifySignal = false;
- QmlExpression *expr = signal->expression();
+ QDeclarativeExpression *expr = signal->expression();
if (expr) {
prop.value = expr->expression();
QObject *scope = expr->scopeObject();
@@ -216,21 +216,21 @@ void QmlEngineDebugServer::buildObjectDump(QDataStream &message,
message << fakeProperties[ii];
}
-void QmlEngineDebugServer::buildObjectList(QDataStream &message,
- QmlContext *ctxt)
+void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message,
+ QDeclarativeContext *ctxt)
{
- QmlContextPrivate *p = (QmlContextPrivate *)QObjectPrivate::get(ctxt);
+ QDeclarativeContextPrivate *p = (QDeclarativeContextPrivate *)QObjectPrivate::get(ctxt);
QString ctxtName = ctxt->objectName();
- int ctxtId = QmlDebugService::idForObject(ctxt);
+ int ctxtId = QDeclarativeDebugService::idForObject(ctxt);
message << ctxtName << ctxtId;
int count = 0;
- for (QSet<QmlContext *>::ConstIterator iter = p->childContexts.begin();
+ for (QSet<QDeclarativeContext *>::ConstIterator iter = p->childContexts.begin();
iter != p->childContexts.end(); ++iter) {
- QmlContextPrivate *p = (QmlContextPrivate *)QObjectPrivate::get(*iter);
+ QDeclarativeContextPrivate *p = (QDeclarativeContextPrivate *)QObjectPrivate::get(*iter);
if (p->isInternal)
continue;
++count;
@@ -238,9 +238,9 @@ void QmlEngineDebugServer::buildObjectList(QDataStream &message,
message << count;
- for (QSet<QmlContext *>::ConstIterator iter = p->childContexts.begin();
+ for (QSet<QDeclarativeContext *>::ConstIterator iter = p->childContexts.begin();
iter != p->childContexts.end(); ++iter) {
- QmlContextPrivate *p = (QmlContextPrivate *)QObjectPrivate::get(*iter);
+ QDeclarativeContextPrivate *p = (QDeclarativeContextPrivate *)QObjectPrivate::get(*iter);
if (p->isInternal)
continue;
buildObjectList(message, *iter);
@@ -260,11 +260,11 @@ void QmlEngineDebugServer::buildObjectList(QDataStream &message,
}
}
-QmlEngineDebugServer::QmlObjectData
-QmlEngineDebugServer::objectData(QObject *object)
+QDeclarativeEngineDebugServer::QDeclarativeObjectData
+QDeclarativeEngineDebugServer::objectData(QObject *object)
{
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(object);
- QmlObjectData rv;
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object);
+ QDeclarativeObjectData rv;
if (ddata) {
rv.url = ddata->outerContext->baseUrl();
rv.lineNumber = ddata->lineNumber;
@@ -275,10 +275,10 @@ QmlEngineDebugServer::objectData(QObject *object)
}
rv.objectName = object->objectName();
- rv.objectId = QmlDebugService::idForObject(object);
- rv.contextId = QmlDebugService::idForObject(qmlContext(object));
+ rv.objectId = QDeclarativeDebugService::idForObject(object);
+ rv.contextId = QDeclarativeDebugService::idForObject(qmlContext(object));
- QmlType *type = QmlMetaType::qmlType(object->metaObject());
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject());
if (type) {
QString typeName = QLatin1String(type->qmlTypeName());
int lastSlash = typeName.lastIndexOf(QLatin1Char('/'));
@@ -293,14 +293,14 @@ QmlEngineDebugServer::objectData(QObject *object)
return rv;
}
-void QmlEngineDebugServer::messageReceived(const QByteArray &message)
+void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
{
QDataStream ds(message);
QByteArray type;
ds >> type;
- //qDebug() << "QmlEngineDebugServer::messageReceived()" << type;
+ //qDebug() << "QDeclarativeEngineDebugServer::messageReceived()" << type;
if (type == "LIST_ENGINES") {
int queryId;
@@ -312,10 +312,10 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message)
rs << queryId << m_engines.count();
for (int ii = 0; ii < m_engines.count(); ++ii) {
- QmlEngine *engine = m_engines.at(ii);
+ QDeclarativeEngine *engine = m_engines.at(ii);
QString engineName = engine->objectName();
- int engineId = QmlDebugService::idForObject(engine);
+ int engineId = QDeclarativeDebugService::idForObject(engine);
rs << engineName << engineId;
}
@@ -326,8 +326,8 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message)
int engineId = -1;
ds >> queryId >> engineId;
- QmlEngine *engine =
- qobject_cast<QmlEngine *>(QmlDebugService::objectForId(engineId));
+ QDeclarativeEngine *engine =
+ qobject_cast<QDeclarativeEngine *>(QDeclarativeDebugService::objectForId(engineId));
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
@@ -344,7 +344,7 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message)
ds >> queryId >> objectId >> recurse;
- QObject *object = QmlDebugService::objectForId(objectId);
+ QObject *object = QDeclarativeDebugService::objectForId(objectId);
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
@@ -404,11 +404,11 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message)
ds >> queryId >> objectId >> expr;
- QObject *object = QmlDebugService::objectForId(objectId);
- QmlContext *context = qmlContext(object);
+ QObject *object = QDeclarativeDebugService::objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
QVariant result;
if (object && context) {
- QmlExpression exprObj(context, expr, object);
+ QDeclarativeExpression exprObj(context, expr, object);
bool undefined = false;
QVariant value = exprObj.value(&undefined);
if (undefined)
@@ -427,7 +427,7 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message)
}
}
-void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value)
+void QDeclarativeEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value)
{
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
@@ -437,7 +437,7 @@ void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProp
sendMessage(reply);
}
-void QmlEngineDebugServer::addEngine(QmlEngine *engine)
+void QDeclarativeEngineDebugServer::addEngine(QDeclarativeEngine *engine)
{
Q_ASSERT(engine);
Q_ASSERT(!m_engines.contains(engine));
@@ -445,7 +445,7 @@ void QmlEngineDebugServer::addEngine(QmlEngine *engine)
m_engines.append(engine);
}
-void QmlEngineDebugServer::remEngine(QmlEngine *engine)
+void QDeclarativeEngineDebugServer::remEngine(QDeclarativeEngine *engine)
{
Q_ASSERT(engine);
Q_ASSERT(m_engines.contains(engine));
diff --git a/src/declarative/qml/qmlenginedebug_p.h b/src/declarative/qml/qdeclarativeenginedebug_p.h
index a6f296a..89da399 100644
--- a/src/declarative/qml/qmlenginedebug_p.h
+++ b/src/declarative/qml/qdeclarativeenginedebug_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLENGINEDEBUG_P_H
-#define QMLENGINEDEBUG_P_H
+#ifndef QDECLARATIVEENGINEDEBUG_P_H
+#define QDECLARATIVEENGINEDEBUG_P_H
//
// W A R N I N G
@@ -53,25 +53,25 @@
// We mean it.
//
-#include "../debugger/qmldebugservice_p.h"
+#include "../debugger/qdeclarativedebugservice_p.h"
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
QT_BEGIN_NAMESPACE
-class QmlEngine;
-class QmlContext;
-class QmlWatcher;
+class QDeclarativeEngine;
+class QDeclarativeContext;
+class QDeclarativeWatcher;
class QDataStream;
-class QmlEngineDebugServer : public QmlDebugService
+class QDeclarativeEngineDebugServer : public QDeclarativeDebugService
{
Q_OBJECT
public:
- QmlEngineDebugServer(QObject * = 0);
+ QDeclarativeEngineDebugServer(QObject * = 0);
- struct QmlObjectData {
+ struct QDeclarativeObjectData {
QUrl url;
int lineNumber;
int columnNumber;
@@ -81,7 +81,7 @@ public:
int contextId;
};
- struct QmlObjectProperty {
+ struct QDeclarativeObjectProperty {
enum Type { Unknown, Basic, Object, List, SignalProperty };
Type type;
QString name;
@@ -91,8 +91,8 @@ public:
bool hasNotifySignal;
};
- static void addEngine(QmlEngine *);
- static void remEngine(QmlEngine *);
+ static void addEngine(QDeclarativeEngine *);
+ static void remEngine(QDeclarativeEngine *);
protected:
virtual void messageReceived(const QByteArray &);
@@ -101,21 +101,21 @@ private Q_SLOTS:
void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value);
private:
- void buildObjectList(QDataStream &, QmlContext *);
+ void buildObjectList(QDataStream &, QDeclarativeContext *);
void buildObjectDump(QDataStream &, QObject *, bool);
- QmlObjectData objectData(QObject *);
- QmlObjectProperty propertyData(QObject *, int);
+ QDeclarativeObjectData objectData(QObject *);
+ QDeclarativeObjectProperty propertyData(QObject *, int);
QVariant valueContents(const QVariant &defaultValue) const;
- static QList<QmlEngine *> m_engines;
- QmlWatcher *m_watch;
+ static QList<QDeclarativeEngine *> m_engines;
+ QDeclarativeWatcher *m_watch;
};
-Q_DECLARATIVE_EXPORT QDataStream &operator<<(QDataStream &, const QmlEngineDebugServer::QmlObjectData &);
-Q_DECLARATIVE_EXPORT QDataStream &operator>>(QDataStream &, QmlEngineDebugServer::QmlObjectData &);
-Q_DECLARATIVE_EXPORT QDataStream &operator<<(QDataStream &, const QmlEngineDebugServer::QmlObjectProperty &);
-Q_DECLARATIVE_EXPORT QDataStream &operator>>(QDataStream &, QmlEngineDebugServer::QmlObjectProperty &);
+Q_DECLARATIVE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectData &);
+Q_DECLARATIVE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugServer::QDeclarativeObjectData &);
+Q_DECLARATIVE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &);
+Q_DECLARATIVE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &);
QT_END_NAMESPACE
-#endif // QMLENGINEDEBUG_P_H
+#endif // QDECLARATIVEENGINEDEBUG_P_H
diff --git a/src/declarative/qml/qmlerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp
index fc4bcd5..7e8aac0 100644
--- a/src/declarative/qml/qmlerror.cpp
+++ b/src/declarative/qml/qdeclarativeerror.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qmlerror.h"
+#include "qdeclarativeerror.h"
#include <QtCore/qdebug.h>
#include <QtCore/qfile.h>
@@ -48,14 +48,14 @@
QT_BEGIN_NAMESPACE
/*!
- \class QmlError
+ \class QDeclarativeError
\since 4.7
- \brief The QmlError class encapsulates a QML error
+ \brief The QDeclarativeError class encapsulates a QML error
*/
-class QmlErrorPrivate
+class QDeclarativeErrorPrivate
{
public:
- QmlErrorPrivate();
+ QDeclarativeErrorPrivate();
QUrl url;
QString description;
@@ -63,7 +63,7 @@ public:
int column;
};
-QmlErrorPrivate::QmlErrorPrivate()
+QDeclarativeErrorPrivate::QDeclarativeErrorPrivate()
: line(-1), column(-1)
{
}
@@ -71,7 +71,7 @@ QmlErrorPrivate::QmlErrorPrivate()
/*!
Create an empty error object.
*/
-QmlError::QmlError()
+QDeclarativeError::QDeclarativeError()
: d(0)
{
}
@@ -79,7 +79,7 @@ QmlError::QmlError()
/*!
Create a copy of \a other.
*/
-QmlError::QmlError(const QmlError &other)
+QDeclarativeError::QDeclarativeError(const QDeclarativeError &other)
: d(0)
{
*this = other;
@@ -88,13 +88,13 @@ QmlError::QmlError(const QmlError &other)
/*!
Assign \a other to this error object.
*/
-QmlError &QmlError::operator=(const QmlError &other)
+QDeclarativeError &QDeclarativeError::operator=(const QDeclarativeError &other)
{
if (!other.d) {
delete d;
d = 0;
} else {
- if (!d) d = new QmlErrorPrivate;
+ if (!d) d = new QDeclarativeErrorPrivate;
d->url = other.d->url;
d->description = other.d->description;
d->line = other.d->line;
@@ -106,7 +106,7 @@ QmlError &QmlError::operator=(const QmlError &other)
/*!
\internal
*/
-QmlError::~QmlError()
+QDeclarativeError::~QDeclarativeError()
{
delete d; d = 0;
}
@@ -114,7 +114,7 @@ QmlError::~QmlError()
/*!
Return true if this error is valid, otherwise false.
*/
-bool QmlError::isValid() const
+bool QDeclarativeError::isValid() const
{
return d != 0;
}
@@ -122,7 +122,7 @@ bool QmlError::isValid() const
/*!
Return the url for the file that caused this error.
*/
-QUrl QmlError::url() const
+QUrl QDeclarativeError::url() const
{
if (d) return d->url;
else return QUrl();
@@ -131,16 +131,16 @@ QUrl QmlError::url() const
/*!
Set the \a url for the file that caused this error.
*/
-void QmlError::setUrl(const QUrl &url)
+void QDeclarativeError::setUrl(const QUrl &url)
{
- if (!d) d = new QmlErrorPrivate;
+ if (!d) d = new QDeclarativeErrorPrivate;
d->url = url;
}
/*!
Return the error description.
*/
-QString QmlError::description() const
+QString QDeclarativeError::description() const
{
if (d) return d->description;
else return QString();
@@ -149,16 +149,16 @@ QString QmlError::description() const
/*!
Set the error \a description.
*/
-void QmlError::setDescription(const QString &description)
+void QDeclarativeError::setDescription(const QString &description)
{
- if (!d) d = new QmlErrorPrivate;
+ if (!d) d = new QDeclarativeErrorPrivate;
d->description = description;
}
/*!
Return the error line number.
*/
-int QmlError::line() const
+int QDeclarativeError::line() const
{
if (d) return d->line;
else return -1;
@@ -167,16 +167,16 @@ int QmlError::line() const
/*!
Set the error \a line number.
*/
-void QmlError::setLine(int line)
+void QDeclarativeError::setLine(int line)
{
- if (!d) d = new QmlErrorPrivate;
+ if (!d) d = new QDeclarativeErrorPrivate;
d->line = line;
}
/*!
Return the error column number.
*/
-int QmlError::column() const
+int QDeclarativeError::column() const
{
if (d) return d->column;
else return -1;
@@ -185,16 +185,16 @@ int QmlError::column() const
/*!
Set the error \a column number.
*/
-void QmlError::setColumn(int column)
+void QDeclarativeError::setColumn(int column)
{
- if (!d) d = new QmlErrorPrivate;
+ if (!d) d = new QDeclarativeErrorPrivate;
d->column = column;
}
/*!
Return the error as a human readable string.
*/
-QString QmlError::toString() const
+QString QDeclarativeError::toString() const
{
QString rv;
rv = url().toString() + QLatin1Char(':') + QString::number(line());
@@ -207,13 +207,13 @@ QString QmlError::toString() const
}
/*!
- \relates QmlError
- \fn QDebug operator<<(QDebug debug, const QmlError &error)
+ \relates QDeclarativeError
+ \fn QDebug operator<<(QDebug debug, const QDeclarativeError &error)
Output a human readable version of \a error to \a debug.
*/
-QDebug operator<<(QDebug debug, const QmlError &error)
+QDebug operator<<(QDebug debug, const QDeclarativeError &error)
{
debug << qPrintable(error.toString());
diff --git a/src/declarative/qml/qmlerror.h b/src/declarative/qml/qdeclarativeerror.h
index 8c4d785..04d5ff2 100644
--- a/src/declarative/qml/qmlerror.h
+++ b/src/declarative/qml/qdeclarativeerror.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLERROR_H
-#define QMLERROR_H
+#ifndef QDECLARATIVEERROR_H
+#define QDECLARATIVEERROR_H
#include <QtCore/qurl.h>
#include <QtCore/qstring.h>
@@ -52,14 +52,14 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDebug;
-class QmlErrorPrivate;
-class Q_DECLARATIVE_EXPORT QmlError
+class QDeclarativeErrorPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeError
{
public:
- QmlError();
- QmlError(const QmlError &);
- QmlError &operator=(const QmlError &);
- ~QmlError();
+ QDeclarativeError();
+ QDeclarativeError(const QDeclarativeError &);
+ QDeclarativeError &operator=(const QDeclarativeError &);
+ ~QDeclarativeError();
bool isValid() const;
@@ -74,13 +74,13 @@ public:
QString toString() const;
private:
- QmlErrorPrivate *d;
+ QDeclarativeErrorPrivate *d;
};
-QDebug Q_DECLARATIVE_EXPORT operator<<(QDebug debug, const QmlError &error);
+QDebug Q_DECLARATIVE_EXPORT operator<<(QDebug debug, const QDeclarativeError &error);
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLERROR_H
+#endif // QDECLARATIVEERROR_H
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index 217f002..ae1e790 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
-#include "qmlexpression.h"
-#include "qmlexpression_p.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativeexpression_p.h"
-#include "qmlengine_p.h"
-#include "qmlcontext_p.h"
-#include "qmlrewrite_p.h"
-#include "qmlcompiler_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativerewrite_p.h"
+#include "qdeclarativecompiler_p.h"
#include <QtCore/qdebug.h>
#include <QtScript/qscriptprogram.h>
@@ -54,7 +54,7 @@
QT_BEGIN_NAMESPACE
-bool QmlDelayedError::addError(QmlEnginePrivate *e)
+bool QDeclarativeDelayedError::addError(QDeclarativeEnginePrivate *e)
{
if (!e || prevError) return false;
@@ -68,45 +68,45 @@ bool QmlDelayedError::addError(QmlEnginePrivate *e)
return true;
}
-QmlExpressionData::QmlExpressionData()
+QDeclarativeExpressionData::QDeclarativeExpressionData()
: q(0), dataRef(0), expressionFunctionValid(false), expressionRewritten(false), me(0),
trackChange(false), isShared(false), line(-1), guardList(0), guardListLength(0)
{
}
-QmlExpressionData::~QmlExpressionData()
+QDeclarativeExpressionData::~QDeclarativeExpressionData()
{
if (guardList) { delete [] guardList; guardList = 0; }
if (dataRef) dataRef->release();
}
-QmlExpressionPrivate::QmlExpressionPrivate()
-: data(new QmlExpressionData)
+QDeclarativeExpressionPrivate::QDeclarativeExpressionPrivate()
+: data(new QDeclarativeExpressionData)
{
data->q = this;
}
-QmlExpressionPrivate::QmlExpressionPrivate(QmlExpressionData *d)
+QDeclarativeExpressionPrivate::QDeclarativeExpressionPrivate(QDeclarativeExpressionData *d)
: data(d)
{
data->q = this;
}
-QmlExpressionPrivate::~QmlExpressionPrivate()
+QDeclarativeExpressionPrivate::~QDeclarativeExpressionPrivate()
{
if (data) { data->q = 0; data->release(); data = 0; }
}
-void QmlExpressionPrivate::init(QmlContext *ctxt, const QString &expr,
+void QDeclarativeExpressionPrivate::init(QDeclarativeContext *ctxt, const QString &expr,
QObject *me)
{
data->expression = expr;
- data->QmlAbstractExpression::setContext(ctxt);
+ data->QDeclarativeAbstractExpression::setContext(ctxt);
data->me = me;
}
-void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
+void QDeclarativeExpressionPrivate::init(QDeclarativeContext *ctxt, void *expr, QDeclarativeRefCount *rc,
QObject *me, const QString &url, int lineNumber)
{
data->url = url;
@@ -117,7 +117,7 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
if (data->dataRef) data->dataRef->addref();
quint32 *exprData = (quint32 *)expr;
- QmlCompiledData *dd = (QmlCompiledData *)rc;
+ QDeclarativeCompiledData *dd = (QDeclarativeCompiledData *)rc;
data->expressionRewritten = true;
data->expression = QString::fromRawData((QChar *)(exprData + 2), exprData[1]);
@@ -126,9 +126,9 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
bool isShared = progIdx & 0x80000000;
progIdx &= 0x7FFFFFFF;
- QmlEngine *engine = ctxt->engine();
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QDeclarativeEngine *engine = ctxt->engine();
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (isShared) {
@@ -159,14 +159,14 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
data->expressionFunctionValid = true;
}
- data->QmlAbstractExpression::setContext(ctxt);
+ data->QDeclarativeAbstractExpression::setContext(ctxt);
data->me = me;
}
-QScriptValue QmlExpressionPrivate::evalInObjectScope(QmlContext *context, QObject *object,
+QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContext *context, QObject *object,
const QString &program)
{
- QmlEnginePrivate *ep = QmlEnginePrivate::get(context->engine());
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine());
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(&ep->scriptEngine);
scriptContext->pushScope(ep->contextClass->newContext(context, object));
QScriptValue rv = ep->scriptEngine.evaluate(program);
@@ -174,10 +174,10 @@ QScriptValue QmlExpressionPrivate::evalInObjectScope(QmlContext *context, QObjec
return rv;
}
-QScriptValue QmlExpressionPrivate::evalInObjectScope(QmlContext *context, QObject *object,
+QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContext *context, QObject *object,
const QScriptProgram &program)
{
- QmlEnginePrivate *ep = QmlEnginePrivate::get(context->engine());
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context->engine());
QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(&ep->scriptEngine);
scriptContext->pushScope(ep->contextClass->newContext(context, object));
QScriptValue rv = ep->scriptEngine.evaluate(program);
@@ -186,99 +186,99 @@ QScriptValue QmlExpressionPrivate::evalInObjectScope(QmlContext *context, QObjec
}
/*!
- \class QmlExpression
+ \class QDeclarativeExpression
\since 4.7
- \brief The QmlExpression class evaluates JavaScript in a QML context.
+ \brief The QDeclarativeExpression class evaluates JavaScript in a QML context.
*/
/*!
- Create an invalid QmlExpression.
+ Create an invalid QDeclarativeExpression.
- As the expression will not have an associated QmlContext, this will be a
+ As the expression will not have an associated QDeclarativeContext, this will be a
null expression object and its value will always be an invalid QVariant.
*/
-QmlExpression::QmlExpression()
-: QObject(*new QmlExpressionPrivate, 0)
+QDeclarativeExpression::QDeclarativeExpression()
+: QObject(*new QDeclarativeExpressionPrivate, 0)
{
}
/*! \internal */
-QmlExpression::QmlExpression(QmlContext *ctxt, void *expr,
- QmlRefCount *rc, QObject *me,
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContext *ctxt, void *expr,
+ QDeclarativeRefCount *rc, QObject *me,
const QString &url, int lineNumber,
- QmlExpressionPrivate &dd)
+ QDeclarativeExpressionPrivate &dd)
: QObject(dd, 0)
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
d->init(ctxt, expr, rc, me, url, lineNumber);
}
/*!
- Create a QmlExpression object.
+ Create a QDeclarativeExpression object.
- The \a expression JavaScript will be executed in the \a ctxt QmlContext.
+ The \a expression JavaScript will be executed in the \a ctxt QDeclarativeContext.
If specified, the \a scope object's properties will also be in scope during
the expression's execution.
*/
-QmlExpression::QmlExpression(QmlContext *ctxt, const QString &expression,
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContext *ctxt, const QString &expression,
QObject *scope)
-: QObject(*new QmlExpressionPrivate, 0)
+: QObject(*new QDeclarativeExpressionPrivate, 0)
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
d->init(ctxt, expression, scope);
}
/*! \internal */
-QmlExpression::QmlExpression(QmlContext *ctxt, const QString &expression,
- QObject *scope, QmlExpressionPrivate &dd)
+QDeclarativeExpression::QDeclarativeExpression(QDeclarativeContext *ctxt, const QString &expression,
+ QObject *scope, QDeclarativeExpressionPrivate &dd)
: QObject(dd, 0)
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
d->init(ctxt, expression, scope);
}
/*!
- Destroy the QmlExpression instance.
+ Destroy the QDeclarativeExpression instance.
*/
-QmlExpression::~QmlExpression()
+QDeclarativeExpression::~QDeclarativeExpression()
{
}
/*!
- Returns the QmlEngine this expression is associated with, or 0 if there
- is no association or the QmlEngine has been destroyed.
+ Returns the QDeclarativeEngine this expression is associated with, or 0 if there
+ is no association or the QDeclarativeEngine has been destroyed.
*/
-QmlEngine *QmlExpression::engine() const
+QDeclarativeEngine *QDeclarativeExpression::engine() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->context()?d->data->context()->engine():0;
}
/*!
- Returns the QmlContext this expression is associated with, or 0 if there
- is no association or the QmlContext has been destroyed.
+ Returns the QDeclarativeContext this expression is associated with, or 0 if there
+ is no association or the QDeclarativeContext has been destroyed.
*/
-QmlContext *QmlExpression::context() const
+QDeclarativeContext *QDeclarativeExpression::context() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->context();
}
/*!
Returns the expression string.
*/
-QString QmlExpression::expression() const
+QString QDeclarativeExpression::expression() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->expression;
}
/*!
Set the expression to \a expression.
*/
-void QmlExpression::setExpression(const QString &expression)
+void QDeclarativeExpression::setExpression(const QString &expression)
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
d->clearGuards();
@@ -288,8 +288,8 @@ void QmlExpression::setExpression(const QString &expression)
d->data->expressionFunction = QScriptValue();
}
-void QmlExpressionPrivate::exceptionToError(QScriptEngine *scriptEngine,
- QmlError &error)
+void QDeclarativeExpressionPrivate::exceptionToError(QScriptEngine *scriptEngine,
+ QDeclarativeError &error)
{
if (scriptEngine->hasUncaughtException() &&
scriptEngine->uncaughtException().isError()) {
@@ -311,25 +311,25 @@ void QmlExpressionPrivate::exceptionToError(QScriptEngine *scriptEngine,
error.setColumn(-1);
error.setDescription(exception.toString());
} else {
- error = QmlError();
+ error = QDeclarativeError();
}
}
-QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUndefined)
+QVariant QDeclarativeExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUndefined)
{
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QmlPerfTimer<QmlPerf::BindValueQt> perfqt;
+ QDeclarativePerfTimer<QDeclarativePerf::BindValueQt> perfqt;
#endif
- QmlExpressionData *data = this->data;
- QmlContextPrivate *ctxtPriv = data->context()->d_func();
- QmlEngine *engine = data->context()->engine();
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
+ QDeclarativeExpressionData *data = this->data;
+ QDeclarativeContextPrivate *ctxtPriv = data->context()->d_func();
+ QDeclarativeEngine *engine = data->context()->engine();
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
if (secondaryScope)
ctxtPriv->defaultObjects.append(secondaryScope);
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (!data->expressionFunctionValid) {
@@ -340,7 +340,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
data->expressionFunction = scriptEngine->evaluate(data->expression,
data->url, data->line);
} else {
- QmlRewrite::RewriteBinding rewriteBinding;
+ QDeclarativeRewrite::RewriteBinding rewriteBinding;
bool ok = true;
const QString code = rewriteBinding(data->expression, &ok);
@@ -355,7 +355,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
data->expressionFunctionValid = true;
}
- QmlContext *oldSharedContext = 0;
+ QDeclarativeContext *oldSharedContext = 0;
QObject *oldSharedScope = 0;
if (data->isShared) {
oldSharedContext = ep->sharedContext;
@@ -380,7 +380,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
scriptEngine->clearExceptions();
return QVariant();
} else {
- data->error = QmlError();
+ data->error = QDeclarativeError();
}
if (secondaryScope) {
@@ -420,13 +420,13 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
return rv;
}
-QVariant QmlExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined)
+QVariant QDeclarativeExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined)
{
- Q_Q(QmlExpression);
+ Q_Q(QDeclarativeExpression);
QVariant rv;
if (!q->engine()) {
- qWarning("QmlExpression: Attempted to evaluate an expression in an invalid context");
+ qWarning("QDeclarativeExpression: Attempted to evaluate an expression in an invalid context");
return rv;
}
@@ -434,21 +434,21 @@ QVariant QmlExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined)
return rv;
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QmlPerfTimer<QmlPerf::BindValue> perf;
+ QDeclarativePerfTimer<QDeclarativePerf::BindValue> perf;
#endif
- QmlEnginePrivate *ep = QmlEnginePrivate::get(q->engine());
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(q->engine());
- QmlExpression *lastCurrentExpression = ep->currentExpression;
+ QDeclarativeExpression *lastCurrentExpression = ep->currentExpression;
bool lastCaptureProperties = ep->captureProperties;
- QPODVector<QmlEnginePrivate::CapturedProperty> lastCapturedProperties;
+ QPODVector<QDeclarativeEnginePrivate::CapturedProperty> lastCapturedProperties;
ep->capturedProperties.copyAndClear(lastCapturedProperties);
ep->currentExpression = q;
ep->captureProperties = data->trackChange;
// This object might be deleted during the eval
- QmlExpressionData *localData = data;
+ QDeclarativeExpressionData *localData = data;
localData->addref();
rv = evalQtScript(secondaryScope, isUndefined);
@@ -481,9 +481,9 @@ QVariant QmlExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined)
\sa hasError(), error()
*/
-QVariant QmlExpression::value(bool *isUndefined)
+QVariant QDeclarativeExpression::value(bool *isUndefined)
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
return d->value(0, isUndefined);
}
@@ -491,9 +491,9 @@ QVariant QmlExpression::value(bool *isUndefined)
Returns true if the valueChanged() signal is emitted when the expression's evaluated
value changes.
*/
-bool QmlExpression::notifyOnValueChanged() const
+bool QDeclarativeExpression::notifyOnValueChanged() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->trackChange;
}
@@ -501,20 +501,20 @@ bool QmlExpression::notifyOnValueChanged() const
Sets whether the valueChanged() signal is emitted when the expression's evaluated
value changes.
-If true, the QmlExpression will monitor properties involved in the expression's
-evaluation, and emit QmlExpression::valueChanged() if they have changed. This allows
+If true, the QDeclarativeExpression will monitor properties involved in the expression's
+evaluation, and emit QDeclarativeExpression::valueChanged() if they have changed. This allows
an application to ensure that any value associated with the result of the expression
remains up to date.
-If false, the QmlExpression will not montitor properties involved in the expression's
-evaluation, and QmlExpression::valueChanged() will never be emitted. This is more efficient
+If false, the QDeclarativeExpression will not montitor properties involved in the expression's
+evaluation, and QDeclarativeExpression::valueChanged() will never be emitted. This is more efficient
if an application wants a "one off" evaluation of the expression.
By default, notifyOnChange is false.
*/
-void QmlExpression::setNotifyOnValueChanged(bool notifyOnChange)
+void QDeclarativeExpression::setNotifyOnValueChanged(bool notifyOnChange)
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
d->data->trackChange = notifyOnChange;
}
@@ -522,9 +522,9 @@ void QmlExpression::setNotifyOnValueChanged(bool notifyOnChange)
Returns the source file URL for this expression. The source location must
have been previously set by calling setSourceLocation().
*/
-QString QmlExpression::sourceFile() const
+QString QDeclarativeExpression::sourceFile() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->url;
}
@@ -532,9 +532,9 @@ QString QmlExpression::sourceFile() const
Returns the source file line number for this expression. The source location
must have been previously set by calling setSourceLocation().
*/
-int QmlExpression::lineNumber() const
+int QDeclarativeExpression::lineNumber() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->line;
}
@@ -542,9 +542,9 @@ int QmlExpression::lineNumber() const
Set the location of this expression to \a line of \a url. This information
is used by the script engine.
*/
-void QmlExpression::setSourceLocation(const QString &url, int line)
+void QDeclarativeExpression::setSourceLocation(const QString &url, int line)
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
d->data->url = url;
d->data->line = line;
}
@@ -552,12 +552,12 @@ void QmlExpression::setSourceLocation(const QString &url, int line)
/*!
Returns the expression's scope object, if provided, otherwise 0.
- In addition to data provided by the expression's QmlContext, the scope
+ In addition to data provided by the expression's QDeclarativeContext, the scope
object's properties are also in scope during the expression's evaluation.
*/
-QObject *QmlExpression::scopeObject() const
+QObject *QDeclarativeExpression::scopeObject() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->me;
}
@@ -567,9 +567,9 @@ QObject *QmlExpression::scopeObject() const
\sa error(), clearError()
*/
-bool QmlExpression::hasError() const
+bool QDeclarativeExpression::hasError() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->error.isValid();
}
@@ -579,40 +579,40 @@ bool QmlExpression::hasError() const
\sa hasError(), error()
*/
-void QmlExpression::clearError()
+void QDeclarativeExpression::clearError()
{
- Q_D(QmlExpression);
- d->data->error = QmlError();
+ Q_D(QDeclarativeExpression);
+ d->data->error = QDeclarativeError();
}
/*!
Return any error from the last call to value(). If there was no error,
- this returns an invalid QmlError instance.
+ this returns an invalid QDeclarativeError instance.
\sa hasError(), clearError()
*/
-QmlError QmlExpression::error() const
+QDeclarativeError QDeclarativeExpression::error() const
{
- Q_D(const QmlExpression);
+ Q_D(const QDeclarativeExpression);
return d->data->error;
}
/*! \internal */
-void QmlExpression::__q_notify()
+void QDeclarativeExpression::__q_notify()
{
- Q_D(QmlExpression);
+ Q_D(QDeclarativeExpression);
d->emitValueChanged();
}
-void QmlExpressionPrivate::clearGuards()
+void QDeclarativeExpressionPrivate::clearGuards()
{
- Q_Q(QmlExpression);
+ Q_Q(QDeclarativeExpression);
static int notifyIdx = -1;
if (notifyIdx == -1)
notifyIdx =
- QmlExpression::staticMetaObject.indexOfMethod("__q_notify()");
+ QDeclarativeExpression::staticMetaObject.indexOfMethod("__q_notify()");
for (int ii = 0; ii < data->guardListLength; ++ii) {
if (data->guardList[ii].data()) {
@@ -633,25 +633,25 @@ void QmlExpressionPrivate::clearGuards()
data->guardListLength = 0;
}
-void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::CapturedProperty> &properties)
+void QDeclarativeExpressionPrivate::updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties)
{
//clearGuards();
- Q_Q(QmlExpression);
+ Q_Q(QDeclarativeExpression);
static int notifyIdx = -1;
if (notifyIdx == -1)
notifyIdx =
- QmlExpression::staticMetaObject.indexOfMethod("__q_notify()");
+ QDeclarativeExpression::staticMetaObject.indexOfMethod("__q_notify()");
- QmlExpressionData::SignalGuard *newGuardList = 0;
+ QDeclarativeExpressionData::SignalGuard *newGuardList = 0;
if (properties.count() != data->guardListLength)
- newGuardList = new QmlExpressionData::SignalGuard[properties.count()];
+ newGuardList = new QDeclarativeExpressionData::SignalGuard[properties.count()];
bool outputWarningHeader = false;
int hit = 0;
for (int ii = 0; ii < properties.count(); ++ii) {
- const QmlEnginePrivate::CapturedProperty &property = properties.at(ii);
+ const QDeclarativeEnginePrivate::CapturedProperty &property = properties.at(ii);
bool needGuard = true;
if (ii >= data->guardListLength) {
@@ -683,7 +683,7 @@ void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::Captu
if (needGuard) {
if (!newGuardList) {
- newGuardList = new QmlExpressionData::SignalGuard[properties.count()];
+ newGuardList = new QDeclarativeExpressionData::SignalGuard[properties.count()];
for (int jj = 0; jj < ii; ++jj)
newGuardList[jj] = data->guardList[jj];
}
@@ -704,7 +704,7 @@ void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::Captu
} else {
if (!outputWarningHeader) {
outputWarningHeader = true;
- qWarning() << "QmlExpression: Expression" << q->expression()
+ qWarning() << "QDeclarativeExpression: Expression" << q->expression()
<< "depends on non-NOTIFYable properties:";
}
@@ -742,25 +742,25 @@ void QmlExpressionPrivate::updateGuards(const QPODVector<QmlEnginePrivate::Captu
}
/*!
- \fn void QmlExpression::valueChanged()
+ \fn void QDeclarativeExpression::valueChanged()
Emitted each time the expression value changes from the last time it was
evaluated. The expression must have been evaluated at least once (by
- calling QmlExpression::value()) before this signal will be emitted.
+ calling QDeclarativeExpression::value()) before this signal will be emitted.
*/
-void QmlExpressionPrivate::emitValueChanged()
+void QDeclarativeExpressionPrivate::emitValueChanged()
{
- Q_Q(QmlExpression);
+ Q_Q(QDeclarativeExpression);
emit q->valueChanged();
}
-QmlAbstractExpression::QmlAbstractExpression()
+QDeclarativeAbstractExpression::QDeclarativeAbstractExpression()
: m_context(0), m_prevExpression(0), m_nextExpression(0)
{
}
-QmlAbstractExpression::~QmlAbstractExpression()
+QDeclarativeAbstractExpression::~QDeclarativeAbstractExpression()
{
if (m_prevExpression) {
*m_prevExpression = m_nextExpression;
@@ -769,12 +769,12 @@ QmlAbstractExpression::~QmlAbstractExpression()
}
}
-QmlContext *QmlAbstractExpression::context() const
+QDeclarativeContext *QDeclarativeAbstractExpression::context() const
{
return m_context;
}
-void QmlAbstractExpression::setContext(QmlContext *context)
+void QDeclarativeAbstractExpression::setContext(QDeclarativeContext *context)
{
if (m_prevExpression) {
*m_prevExpression = m_nextExpression;
@@ -787,8 +787,8 @@ void QmlAbstractExpression::setContext(QmlContext *context)
m_context = context;
if (m_context) {
- QmlContextPrivate *cp =
- static_cast<QmlContextPrivate *>(QObjectPrivate::get(m_context));
+ QDeclarativeContextPrivate *cp =
+ static_cast<QDeclarativeContextPrivate *>(QObjectPrivate::get(m_context));
m_nextExpression = cp->expressions;
if (m_nextExpression)
m_nextExpression->m_prevExpression = &m_nextExpression;
@@ -797,11 +797,11 @@ void QmlAbstractExpression::setContext(QmlContext *context)
}
}
-void QmlAbstractExpression::refresh()
+void QDeclarativeAbstractExpression::refresh()
{
}
-bool QmlAbstractExpression::isValid() const
+bool QDeclarativeAbstractExpression::isValid() const
{
return m_context != 0;
}
diff --git a/src/declarative/qml/qmlexpression.h b/src/declarative/qml/qdeclarativeexpression.h
index 61374f2..911d328 100644
--- a/src/declarative/qml/qmlexpression.h
+++ b/src/declarative/qml/qdeclarativeexpression.h
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#ifndef QMLEXPRESSION_H
-#define QMLEXPRESSION_H
+#ifndef QDECLARATIVEEXPRESSION_H
+#define QDECLARATIVEEXPRESSION_H
-#include "qmlerror.h"
+#include "qdeclarativeerror.h"
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
@@ -54,20 +54,20 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QString;
-class QmlRefCount;
-class QmlEngine;
-class QmlContext;
-class QmlExpressionPrivate;
-class Q_DECLARATIVE_EXPORT QmlExpression : public QObject
+class QDeclarativeRefCount;
+class QDeclarativeEngine;
+class QDeclarativeContext;
+class QDeclarativeExpressionPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeExpression : public QObject
{
Q_OBJECT
public:
- QmlExpression();
- QmlExpression(QmlContext *, const QString &, QObject *);
- virtual ~QmlExpression();
+ QDeclarativeExpression();
+ QDeclarativeExpression(QDeclarativeContext *, const QString &, QObject *);
+ virtual ~QDeclarativeExpression();
- QmlEngine *engine() const;
- QmlContext *context() const;
+ QDeclarativeEngine *engine() const;
+ QDeclarativeContext *context() const;
QString expression() const;
void setExpression(const QString &);
@@ -83,7 +83,7 @@ public:
bool hasError() const;
void clearError();
- QmlError error() const;
+ QDeclarativeError error() const;
QVariant value(bool *isUndefined = 0);
@@ -91,23 +91,23 @@ Q_SIGNALS:
void valueChanged();
protected:
- QmlExpression(QmlContext *, const QString &, QObject *,
- QmlExpressionPrivate &dd);
- QmlExpression(QmlContext *, void *, QmlRefCount *rc, QObject *me, const QString &,
- int, QmlExpressionPrivate &dd);
+ QDeclarativeExpression(QDeclarativeContext *, const QString &, QObject *,
+ QDeclarativeExpressionPrivate &dd);
+ QDeclarativeExpression(QDeclarativeContext *, void *, QDeclarativeRefCount *rc, QObject *me, const QString &,
+ int, QDeclarativeExpressionPrivate &dd);
private Q_SLOTS:
void __q_notify();
private:
- Q_DECLARE_PRIVATE(QmlExpression)
- friend class QmlDebugger;
- friend class QmlContext;
+ Q_DECLARE_PRIVATE(QDeclarativeExpression)
+ friend class QDeclarativeDebugger;
+ friend class QDeclarativeContext;
};
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLEXPRESSION_H
+#endif // QDECLARATIVEEXPRESSION_H
diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qdeclarativeexpression_p.h
index e4bed05..91ac4c0 100644
--- a/src/declarative/qml/qmlexpression_p.h
+++ b/src/declarative/qml/qdeclarativeexpression_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLEXPRESSION_P_H
-#define QMLEXPRESSION_P_H
+#ifndef QDECLARATIVEEXPRESSION_P_H
+#define QDECLARATIVEEXPRESSION_P_H
//
// W A R N I N G
@@ -53,45 +53,45 @@
// We mean it.
//
-#include "qmlexpression.h"
+#include "qdeclarativeexpression.h"
-#include "qmlengine_p.h"
-#include "qmlguard_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeguard_p.h"
#include <QtScript/qscriptvalue.h>
QT_BEGIN_NAMESPACE
-class QmlAbstractExpression
+class QDeclarativeAbstractExpression
{
public:
- QmlAbstractExpression();
- virtual ~QmlAbstractExpression();
+ QDeclarativeAbstractExpression();
+ virtual ~QDeclarativeAbstractExpression();
bool isValid() const;
- QmlContext *context() const;
- void setContext(QmlContext *);
+ QDeclarativeContext *context() const;
+ void setContext(QDeclarativeContext *);
virtual void refresh();
private:
- friend class QmlContext;
- friend class QmlContextPrivate;
- QmlContext *m_context;
- QmlAbstractExpression **m_prevExpression;
- QmlAbstractExpression *m_nextExpression;
+ friend class QDeclarativeContext;
+ friend class QDeclarativeContextPrivate;
+ QDeclarativeContext *m_context;
+ QDeclarativeAbstractExpression **m_prevExpression;
+ QDeclarativeAbstractExpression *m_nextExpression;
};
-class QmlDelayedError
+class QDeclarativeDelayedError
{
public:
- inline QmlDelayedError() : nextError(0), prevError(0) {}
- inline ~QmlDelayedError() { removeError(); }
+ inline QDeclarativeDelayedError() : nextError(0), prevError(0) {}
+ inline ~QDeclarativeDelayedError() { removeError(); }
- QmlError error;
+ QDeclarativeError error;
- bool addError(QmlEnginePrivate *);
+ bool addError(QDeclarativeEnginePrivate *);
inline void removeError() {
if (!prevError) return;
@@ -102,19 +102,19 @@ public:
}
private:
- QmlDelayedError *nextError;
- QmlDelayedError **prevError;
+ QDeclarativeDelayedError *nextError;
+ QDeclarativeDelayedError **prevError;
};
-class QmlExpressionData : public QmlAbstractExpression, public QmlDelayedError, public QmlRefCount
+class QDeclarativeExpressionData : public QDeclarativeAbstractExpression, public QDeclarativeDelayedError, public QDeclarativeRefCount
{
public:
- QmlExpressionData();
- virtual ~QmlExpressionData();
+ QDeclarativeExpressionData();
+ virtual ~QDeclarativeExpressionData();
- QmlExpressionPrivate *q;
+ QDeclarativeExpressionPrivate *q;
- QmlRefCount *dataRef;
+ QDeclarativeRefCount *dataRef;
QString expression;
bool expressionFunctionValid:1;
bool expressionRewritten:1;
@@ -128,15 +128,15 @@ public:
QString url; // This is a QString for a reason. QUrls are slooooooow...
int line;
- struct SignalGuard : public QmlGuard<QObject> {
+ struct SignalGuard : public QDeclarativeGuard<QObject> {
SignalGuard() : isDuplicate(false), notifyIndex(-1) {}
SignalGuard &operator=(QObject *obj) {
- QmlGuard<QObject>::operator=(obj);
+ QDeclarativeGuard<QObject>::operator=(obj);
return *this;
}
SignalGuard &operator=(const SignalGuard &o) {
- QmlGuard<QObject>::operator=(o);
+ QDeclarativeGuard<QObject>::operator=(o);
isDuplicate = o.isDuplicate;
notifyIndex = o.notifyIndex;
return *this;
@@ -149,41 +149,41 @@ public:
int guardListLength;
};
-class QmlExpression;
+class QDeclarativeExpression;
class QString;
-class QmlExpressionPrivate : public QObjectPrivate
+class QDeclarativeExpressionPrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QmlExpression)
+ Q_DECLARE_PUBLIC(QDeclarativeExpression)
public:
- QmlExpressionPrivate();
- QmlExpressionPrivate(QmlExpressionData *);
- ~QmlExpressionPrivate();
+ QDeclarativeExpressionPrivate();
+ QDeclarativeExpressionPrivate(QDeclarativeExpressionData *);
+ ~QDeclarativeExpressionPrivate();
- void init(QmlContext *, const QString &, QObject *);
- void init(QmlContext *, void *, QmlRefCount *, QObject *, const QString &, int);
+ void init(QDeclarativeContext *, const QString &, QObject *);
+ void init(QDeclarativeContext *, void *, QDeclarativeRefCount *, QObject *, const QString &, int);
- QmlExpressionData *data;
+ QDeclarativeExpressionData *data;
QVariant value(QObject *secondaryScope = 0, bool *isUndefined = 0);
QVariant evalQtScript(QObject *secondaryScope, bool *isUndefined = 0);
- void updateGuards(const QPODVector<QmlEnginePrivate::CapturedProperty> &properties);
+ void updateGuards(const QPODVector<QDeclarativeEnginePrivate::CapturedProperty> &properties);
void clearGuards();
- static QmlExpressionPrivate *get(QmlExpression *expr) {
- return static_cast<QmlExpressionPrivate *>(QObjectPrivate::get(expr));
+ static QDeclarativeExpressionPrivate *get(QDeclarativeExpression *expr) {
+ return static_cast<QDeclarativeExpressionPrivate *>(QObjectPrivate::get(expr));
}
- static QmlExpression *get(QmlExpressionPrivate *expr) {
+ static QDeclarativeExpression *get(QDeclarativeExpressionPrivate *expr) {
return expr->q_func();
}
virtual void emitValueChanged();
- static void exceptionToError(QScriptEngine *, QmlError &);
- static QScriptValue evalInObjectScope(QmlContext *, QObject *, const QString &);
- static QScriptValue evalInObjectScope(QmlContext *, QObject *, const QScriptProgram &);
+ static void exceptionToError(QScriptEngine *, QDeclarativeError &);
+ static QScriptValue evalInObjectScope(QDeclarativeContext *, QObject *, const QString &);
+ static QScriptValue evalInObjectScope(QDeclarativeContext *, QObject *, const QScriptProgram &);
};
QT_END_NAMESPACE
-#endif // QMLEXPRESSION_P_H
+#endif // QDECLARATIVEEXPRESSION_P_H
diff --git a/src/declarative/qml/qmlextensioninterface.h b/src/declarative/qml/qdeclarativeextensioninterface.h
index 644ef1e..a8ae064 100644
--- a/src/declarative/qml/qmlextensioninterface.h
+++ b/src/declarative/qml/qdeclarativeextensioninterface.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLEXTENSIONINTERFACE_H
-#define QMLEXTENSIONINTERFACE_H
+#ifndef QDECLARATIVEEXTENSIONINTERFACE_H
+#define QDECLARATIVEEXTENSIONINTERFACE_H
#include <QtCore/qobject.h>
@@ -50,18 +50,18 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlEngine;
+class QDeclarativeEngine;
-struct Q_DECLARATIVE_EXPORT QmlExtensionInterface
+struct Q_DECLARATIVE_EXPORT QDeclarativeExtensionInterface
{
- virtual ~QmlExtensionInterface() {}
- virtual void initialize(QmlEngine *engine, const char *uri) = 0;
+ virtual ~QDeclarativeExtensionInterface() {}
+ virtual void initialize(QDeclarativeEngine *engine, const char *uri) = 0;
};
-Q_DECLARE_INTERFACE(QmlExtensionInterface, "com.trolltech.Qt.QmlExtensionInterface/1.0")
+Q_DECLARE_INTERFACE(QDeclarativeExtensionInterface, "com.trolltech.Qt.QDeclarativeExtensionInterface/1.0")
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLEXTENSIONINTERFACE_H
+#endif // QDECLARATIVEEXTENSIONINTERFACE_H
diff --git a/src/declarative/qml/qmlextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp
index c1195d2..6af3a6d 100644
--- a/src/declarative/qml/qmlextensionplugin.cpp
+++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp
@@ -39,31 +39,31 @@
**
****************************************************************************/
-#include "qmlextensionplugin.h"
+#include "qdeclarativeextensionplugin.h"
QT_BEGIN_NAMESPACE
/*!
\since 4.7
- \class QmlExtensionPlugin
- \brief The QmlExtensionPlugin class provides an abstract base for custom QML extension plugins.
+ \class QDeclarativeExtensionPlugin
+ \brief The QDeclarativeExtensionPlugin class provides an abstract base for custom QML extension plugins.
\ingroup plugins
- QmlExtensionPlugin is a plugin interface that makes it
+ QDeclarativeExtensionPlugin is a plugin interface that makes it
possible to offer extensions that can be loaded dynamically into
- applications using the QmlEngine class.
+ applications using the QDeclarativeEngine class.
Writing a QML extension plugin is achieved by subclassing this
base class, reimplementing the pure virtual initialize()
function, and exporting the class using the Q_EXPORT_PLUGIN2()
macro. See \l {How to Create Qt Plugins} for details.
- \sa QmlEngine::importExtension()
+ \sa QDeclarativeEngine::importExtension()
*/
/*!
- \fn void QmlExtensionPlugin::initialize(QmlEngine *engine)
+ \fn void QDeclarativeExtensionPlugin::initialize(QDeclarativeEngine *engine)
Initializes the extension specified in the given \a engine.
*/
@@ -75,12 +75,12 @@ QT_BEGIN_NAMESPACE
Q_EXPORT_PLUGIN2() macro, so there is no need for calling it
explicitly.
*/
-QmlExtensionPlugin::QmlExtensionPlugin(QObject *parent)
+QDeclarativeExtensionPlugin::QDeclarativeExtensionPlugin(QObject *parent)
: QObject(parent)
{
}
-QmlExtensionPlugin::~QmlExtensionPlugin()
+QDeclarativeExtensionPlugin::~QDeclarativeExtensionPlugin()
{
}
diff --git a/src/declarative/qml/qmlextensionplugin.h b/src/declarative/qml/qdeclarativeextensionplugin.h
index 8cc64ad..79df52b 100644
--- a/src/declarative/qml/qmlextensionplugin.h
+++ b/src/declarative/qml/qdeclarativeextensionplugin.h
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#ifndef QMLEXTENSIONPLUGIN_H
-#define QMLEXTENSIONPLUGIN_H
+#ifndef QDECLARATIVEEXTENSIONPLUGIN_H
+#define QDECLARATIVEEXTENSIONPLUGIN_H
#include <QtCore/qplugin.h>
-#include "qmlextensioninterface.h"
+#include "qdeclarativeextensioninterface.h"
QT_BEGIN_HEADER
@@ -52,21 +52,21 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlEngine;
+class QDeclarativeEngine;
-class Q_DECLARATIVE_EXPORT QmlExtensionPlugin : public QObject, public QmlExtensionInterface
+class Q_DECLARATIVE_EXPORT QDeclarativeExtensionPlugin : public QObject, public QDeclarativeExtensionInterface
{
Q_OBJECT
- Q_INTERFACES(QmlExtensionInterface)
+ Q_INTERFACES(QDeclarativeExtensionInterface)
public:
- explicit QmlExtensionPlugin(QObject *parent = 0);
- ~QmlExtensionPlugin();
+ explicit QDeclarativeExtensionPlugin(QObject *parent = 0);
+ ~QDeclarativeExtensionPlugin();
- virtual void initialize(QmlEngine *engine, const char *uri) = 0;
+ virtual void initialize(QDeclarativeEngine *engine, const char *uri) = 0;
};
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLEXTENSIONPLUGIN_H
+#endif // QDECLARATIVEEXTENSIONPLUGIN_H
diff --git a/src/declarative/qml/qmlglobal_p.h b/src/declarative/qml/qdeclarativeglobal_p.h
index 06ae6e6..bbdc91c 100644
--- a/src/declarative/qml/qmlglobal_p.h
+++ b/src/declarative/qml/qdeclarativeglobal_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLGLOBAL_H
-#define QMLGLOBAL_H
+#ifndef QDECLARATIVEGLOBAL_H
+#define QDECLARATIVEGLOBAL_H
#include <QtCore/qglobal.h>
#include <QtCore/QObject>
@@ -64,7 +64,7 @@ QT_MODULE(Declarative)
return status == Yes; \
}
-struct QmlGraphics_DerivedObject : public QObject
+struct QDeclarativeGraphics_DerivedObject : public QObject
{
void setParent_noEvent(QObject *parent) {
bool sce = d_ptr->sendChildEvents;
@@ -79,13 +79,13 @@ struct QmlGraphics_DerivedObject : public QObject
neither \a parent nor the object's previous parent (if it had one) will
receive ChildRemoved or ChildAdded events.
*/
-inline void QmlGraphics_setParent_noEvent(QObject *object, QObject *parent)
+inline void QDeclarativeGraphics_setParent_noEvent(QObject *object, QObject *parent)
{
- static_cast<QmlGraphics_DerivedObject *>(object)->setParent_noEvent(parent);
+ static_cast<QDeclarativeGraphics_DerivedObject *>(object)->setParent_noEvent(parent);
}
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLGLOBAL_H
+#endif // QDECLARATIVEGLOBAL_H
diff --git a/src/declarative/qml/qmlglobalscriptclass.cpp b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
index d2198b6..5b06b42 100644
--- a/src/declarative/qml/qmlglobalscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qmlglobalscriptclass_p.h"
+#include "qdeclarativeglobalscriptclass_p.h"
#include <QtScript/qscriptstring.h>
#include <QtScript/qscriptengine.h>
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
/*
Used to prevent any writes to the global object.
*/
-QmlGlobalScriptClass::QmlGlobalScriptClass(QScriptEngine *engine)
+QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engine)
: QScriptClass(engine)
{
QScriptValue v = engine->newObject();
@@ -67,7 +67,7 @@ QmlGlobalScriptClass::QmlGlobalScriptClass(QScriptEngine *engine)
}
QScriptClass::QueryFlags
-QmlGlobalScriptClass::queryProperty(const QScriptValue &object,
+QDeclarativeGlobalScriptClass::queryProperty(const QScriptValue &object,
const QScriptString &name,
QueryFlags flags, uint *id)
{
@@ -79,7 +79,7 @@ QmlGlobalScriptClass::queryProperty(const QScriptValue &object,
}
QScriptValue
-QmlGlobalScriptClass::property(const QScriptValue &object,
+QDeclarativeGlobalScriptClass::property(const QScriptValue &object,
const QScriptString &name,
uint id)
{
@@ -89,7 +89,7 @@ QmlGlobalScriptClass::property(const QScriptValue &object,
return engine()->undefinedValue();
}
-void QmlGlobalScriptClass::setProperty(QScriptValue &object,
+void QDeclarativeGlobalScriptClass::setProperty(QScriptValue &object,
const QScriptString &name,
uint id, const QScriptValue &value)
{
@@ -101,7 +101,7 @@ void QmlGlobalScriptClass::setProperty(QScriptValue &object,
engine()->currentContext()->throwError(error);
}
-void QmlGlobalScriptClass::explicitSetProperty(const QString &name, const QScriptValue &value)
+void QDeclarativeGlobalScriptClass::explicitSetProperty(const QString &name, const QScriptValue &value)
{
QScriptValue v = engine()->newObject();
globalObject = engine()->globalObject();
diff --git a/src/declarative/qml/qmlglobalscriptclass_p.h b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
index d002da6..a33cf5e 100644
--- a/src/declarative/qml/qmlglobalscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLGLOBALSCRIPTCLASS_P_H
-#define QMLGLOBALSCRIPTCLASS_P_H
+#ifndef QDECLARATIVEGLOBALSCRIPTCLASS_P_H
+#define QDECLARATIVEGLOBALSCRIPTCLASS_P_H
//
// W A R N I N G
@@ -57,10 +57,10 @@
QT_BEGIN_NAMESPACE
-class Q_AUTOTEST_EXPORT QmlGlobalScriptClass : public QScriptClass
+class Q_AUTOTEST_EXPORT QDeclarativeGlobalScriptClass : public QScriptClass
{
public:
- QmlGlobalScriptClass(QScriptEngine *);
+ QDeclarativeGlobalScriptClass(QScriptEngine *);
virtual QueryFlags queryProperty(const QScriptValue &object,
const QScriptString &name,
@@ -80,4 +80,4 @@ private:
QT_END_NAMESPACE
-#endif // QMLGLOBALSCRIPTCLASS_P_H
+#endif // QDECLARATIVEGLOBALSCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qmlguard_p.h b/src/declarative/qml/qdeclarativeguard_p.h
index 0e90f79..9d82d01 100644
--- a/src/declarative/qml/qmlguard_p.h
+++ b/src/declarative/qml/qdeclarativeguard_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLGUARD_P_H
-#define QMLGUARD_P_H
+#ifndef QDECLARATIVEGUARD_P_H
+#define QDECLARATIVEGUARD_P_H
//
// W A R N I N G
@@ -59,20 +59,20 @@ QT_BEGIN_NAMESPACE
class QObject;
template<class T>
-class QmlGuard
+class QDeclarativeGuard
{
QObject *o;
- QmlGuard<QObject> *next;
- QmlGuard<QObject> **prev;
- friend class QmlDeclarativeData;
+ QDeclarativeGuard<QObject> *next;
+ QDeclarativeGuard<QObject> **prev;
+ friend class QDeclarativeDeclarativeData;
public:
- inline QmlGuard();
- inline QmlGuard(T *);
- inline QmlGuard(const QmlGuard<T> &);
- inline virtual ~QmlGuard();
+ inline QDeclarativeGuard();
+ inline QDeclarativeGuard(T *);
+ inline QDeclarativeGuard(const QDeclarativeGuard<T> &);
+ inline virtual ~QDeclarativeGuard();
- inline QmlGuard<T> &operator=(const QmlGuard<T> &o);
- inline QmlGuard<T> &operator=(T *);
+ inline QDeclarativeGuard<T> &operator=(const QDeclarativeGuard<T> &o);
+ inline QDeclarativeGuard<T> &operator=(T *);
inline bool isNull() const
{ return !o; }
@@ -96,41 +96,41 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QmlGuard<QObject>);
+Q_DECLARE_METATYPE(QDeclarativeGuard<QObject>);
-#include "qmldeclarativedata_p.h"
+#include "qdeclarativedeclarativedata_p.h"
QT_BEGIN_NAMESPACE
template<class T>
-QmlGuard<T>::QmlGuard()
+QDeclarativeGuard<T>::QDeclarativeGuard()
: o(0), next(0), prev(0)
{
}
template<class T>
-QmlGuard<T>::QmlGuard(T *g)
+QDeclarativeGuard<T>::QDeclarativeGuard(T *g)
: o(g), next(0), prev(0)
{
if (o) addGuard();
}
template<class T>
-QmlGuard<T>::QmlGuard(const QmlGuard<T> &g)
+QDeclarativeGuard<T>::QDeclarativeGuard(const QDeclarativeGuard<T> &g)
: o(g.o), next(0), prev(0)
{
if (o) addGuard();
}
template<class T>
-QmlGuard<T>::~QmlGuard()
+QDeclarativeGuard<T>::~QDeclarativeGuard()
{
if (prev) remGuard();
o = 0;
}
template<class T>
-QmlGuard<T> &QmlGuard<T>::operator=(const QmlGuard<T> &g)
+QDeclarativeGuard<T> &QDeclarativeGuard<T>::operator=(const QDeclarativeGuard<T> &g)
{
if (g.o != o) {
if (prev) remGuard();
@@ -141,7 +141,7 @@ QmlGuard<T> &QmlGuard<T>::operator=(const QmlGuard<T> &g)
}
template<class T>
-QmlGuard<T> &QmlGuard<T>::operator=(T *g)
+QDeclarativeGuard<T> &QDeclarativeGuard<T>::operator=(T *g)
{
if (g != o) {
if (prev) remGuard();
@@ -153,4 +153,4 @@ QmlGuard<T> &QmlGuard<T>::operator=(T *g)
QT_END_NAMESPACE
-#endif // QMLGUARD_P_H
+#endif // QDECLARATIVEGUARD_P_H
diff --git a/src/declarative/qml/qmlimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index 7f15d08..daa2e87 100644
--- a/src/declarative/qml/qmlimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -39,25 +39,25 @@
**
****************************************************************************/
-#include "qmlimageprovider.h"
+#include "qdeclarativeimageprovider.h"
QT_BEGIN_NAMESPACE
/*!
- \class QmlImageProvider
- \brief The QmlImageProvider class provides an interface for threaded image requests.
+ \class QDeclarativeImageProvider
+ \brief The QDeclarativeImageProvider class provides an interface for threaded image requests.
Note: the request() method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
- \sa QmlEngine::addImageProvider()
+ \sa QDeclarativeEngine::addImageProvider()
*/
-QmlImageProvider::~QmlImageProvider()
+QDeclarativeImageProvider::~QDeclarativeImageProvider()
{
}
/*!
- \fn QImage QmlImageProvider::request(const QString &id)
+ \fn QImage QDeclarativeImageProvider::request(const QString &id)
Implement this method to return the image with \a id.
diff --git a/src/declarative/qml/qmlimageprovider.h b/src/declarative/qml/qdeclarativeimageprovider.h
index 52fe066..6ee7bcf 100644
--- a/src/declarative/qml/qmlimageprovider.h
+++ b/src/declarative/qml/qdeclarativeimageprovider.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLIMAGEPROVIDER_H
-#define QMLIMAGEPROVIDER_H
+#ifndef QDECLARATIVEIMAGEPROVIDER_H
+#define QDECLARATIVEIMAGEPROVIDER_H
#include <QtGui/qimage.h>
@@ -50,10 +50,10 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class Q_DECLARATIVE_EXPORT QmlImageProvider
+class Q_DECLARATIVE_EXPORT QDeclarativeImageProvider
{
public:
- virtual ~QmlImageProvider();
+ virtual ~QDeclarativeImageProvider();
virtual QImage request(const QString &id) = 0;
};
@@ -61,4 +61,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLIMAGEPROVIDER
+#endif // QDECLARATIVEIMAGEPROVIDER
diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp
index 1f3d434..41d09c4 100644
--- a/src/declarative/qml/qmlinfo.cpp
+++ b/src/declarative/qml/qdeclarativeinfo.cpp
@@ -39,18 +39,18 @@
**
****************************************************************************/
-#include "qmlinfo.h"
+#include "qdeclarativeinfo.h"
-#include "qmldeclarativedata_p.h"
-#include "qmlcontext.h"
-#include "qmlmetatype.h"
+#include "qdeclarativedeclarativedata_p.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativemetatype.h"
#include <QCoreApplication>
QT_BEGIN_NAMESPACE
/*!
- \fn QmlInfo qmlInfo(const QObject *object)
+ \fn QDeclarativeInfo qmlInfo(const QObject *object)
\brief Prints warnings messages that include the file and line number for QML types.
@@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE
\endcode
*/
-QmlInfo::QmlInfo(const QObject *object)
+QDeclarativeInfo::QDeclarativeInfo(const QObject *object)
: QDebug(QtWarningMsg)
{
QString pos = QLatin1String("QML");
@@ -84,7 +84,7 @@ QmlInfo::QmlInfo(const QObject *object)
pos += QLatin1Char(' ');
QString typeName;
- QmlType *type = QmlMetaType::qmlType(object->metaObject());
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject());
if (type) {
typeName = QLatin1String(type->qmlTypeName());
int lastSlash = typeName.lastIndexOf(QLatin1Char('/'));
@@ -99,7 +99,7 @@ QmlInfo::QmlInfo(const QObject *object)
pos += typeName;
}
- QmlDeclarativeData *ddata = object?QmlDeclarativeData::get(object):0;
+ QDeclarativeDeclarativeData *ddata = object?QDeclarativeDeclarativeData::get(object):0;
pos += QLatin1String(" (");
if (ddata) {
if (ddata->outerContext) {
@@ -109,17 +109,17 @@ QmlInfo::QmlInfo(const QObject *object)
pos += QLatin1Char(':');
pos += QString::number(ddata->columnNumber);
} else {
- pos += QCoreApplication::translate("QmlInfo","unknown location");
+ pos += QCoreApplication::translate("QDeclarativeInfo","unknown location");
}
} else {
- pos += QCoreApplication::translate("QmlInfo","unknown location");
+ pos += QCoreApplication::translate("QDeclarativeInfo","unknown location");
}
pos += QLatin1Char(')');
*this << pos;
nospace();
}
-QmlInfo::~QmlInfo()
+QDeclarativeInfo::~QDeclarativeInfo()
{
}
diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h
new file mode 100644
index 0000000..8f69f73
--- /dev/null
+++ b/src/declarative/qml/qdeclarativeinfo.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** 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 QDECLARATIVEINFO_H
+#define QDECLARATIVEINFO_H
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class Q_DECLARATIVE_EXPORT QDeclarativeInfo : public QDebug
+{
+public:
+ QDeclarativeInfo(const QObject *);
+ ~QDeclarativeInfo();
+
+ inline QDeclarativeInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(QBool t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(bool t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(char t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(signed short t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(unsigned short t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(signed int t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(unsigned int t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(signed long t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(unsigned long t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(qint64 t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(quint64 t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(float t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(double t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(const char* t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(const QString & t) { QDebug::operator<<(t.toLocal8Bit().constData()); return *this; }
+ inline QDeclarativeInfo &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
+ inline QDeclarativeInfo &operator<<(const QLatin1String &t) { QDebug::operator<<(t.latin1()); return *this; }
+ inline QDeclarativeInfo &operator<<(const QByteArray & t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; }
+ inline QDeclarativeInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; }
+ inline QDeclarativeInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; }
+};
+
+Q_DECLARATIVE_EXPORT inline QDeclarativeInfo qmlInfo(const QObject *me)
+{
+ return QDeclarativeInfo(me);
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEINFO_H
diff --git a/src/declarative/qml/qmlinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp
index e37ade7..cf485fe 100644
--- a/src/declarative/qml/qmlinstruction.cpp
+++ b/src/declarative/qml/qdeclarativeinstruction.cpp
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include "qmlinstruction_p.h"
+#include "qdeclarativeinstruction_p.h"
-#include "qmlcompiler_p.h"
+#include "qdeclarativecompiler_p.h"
#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
-void QmlCompiledData::dump(QmlInstruction *instr, int idx)
+void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx)
{
QByteArray lineNumber = QByteArray::number(instr->line);
if (instr->line == (unsigned short)-1)
@@ -55,150 +55,150 @@ void QmlCompiledData::dump(QmlInstruction *instr, int idx)
const char *line = lineNumber.constData();
switch(instr->type) {
- case QmlInstruction::Init:
+ case QDeclarativeInstruction::Init:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "INIT\t\t\t" << instr->init.bindingsSize << "\t" << instr->init.parserStatusSize << "\t" << instr->init.contextCache << "\t" << instr->init.compiledBinding;
break;
- case QmlInstruction::CreateObject:
+ case QDeclarativeInstruction::CreateObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE\t\t\t" << instr->create.type << "\t\t\t" << types.at(instr->create.type).className;
break;
- case QmlInstruction::SetId:
+ case QDeclarativeInstruction::SetId:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "SETID\t\t\t" << instr->setId.value << "\t\t\t" << primitives.at(instr->setId.value);
break;
- case QmlInstruction::SetDefault:
+ case QDeclarativeInstruction::SetDefault:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "SET_DEFAULT";
break;
- case QmlInstruction::CreateComponent:
+ case QDeclarativeInstruction::CreateComponent:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "CREATE_COMPONENT\t" << instr->createComponent.count;
break;
- case QmlInstruction::StoreMetaObject:
+ case QDeclarativeInstruction::StoreMetaObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_META\t\t" << instr->storeMeta.data;
break;
- case QmlInstruction::StoreFloat:
+ case QDeclarativeInstruction::StoreFloat:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_FLOAT\t\t" << instr->storeFloat.propertyIndex << "\t" << instr->storeFloat.value;
break;
- case QmlInstruction::StoreDouble:
+ case QDeclarativeInstruction::StoreDouble:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value;
break;
- case QmlInstruction::StoreInteger:
+ case QDeclarativeInstruction::StoreInteger:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value;
break;
- case QmlInstruction::StoreBool:
+ case QDeclarativeInstruction::StoreBool:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value;
break;
- case QmlInstruction::StoreString:
+ case QDeclarativeInstruction::StoreString:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
break;
- case QmlInstruction::StoreUrl:
+ case QDeclarativeInstruction::StoreUrl:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << primitives.at(instr->storeUrl.value);
break;
- case QmlInstruction::StoreColor:
+ case QDeclarativeInstruction::StoreColor:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16);
break;
- case QmlInstruction::StoreDate:
+ case QDeclarativeInstruction::StoreDate:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATE\t\t" << instr->storeDate.propertyIndex << "\t" << instr->storeDate.value;
break;
- case QmlInstruction::StoreTime:
+ case QDeclarativeInstruction::StoreTime:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_TIME\t\t" << instr->storeTime.propertyIndex << "\t" << instr->storeTime.valueIndex;
break;
- case QmlInstruction::StoreDateTime:
+ case QDeclarativeInstruction::StoreDateTime:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_DATETIME\t\t" << instr->storeDateTime.propertyIndex << "\t" << instr->storeDateTime.valueIndex;
break;
- case QmlInstruction::StorePoint:
+ case QDeclarativeInstruction::StorePoint:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINT\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
- case QmlInstruction::StorePointF:
+ case QDeclarativeInstruction::StorePointF:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_POINTF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
- case QmlInstruction::StoreSize:
+ case QDeclarativeInstruction::StoreSize:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZE\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
- case QmlInstruction::StoreSizeF:
+ case QDeclarativeInstruction::StoreSizeF:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIZEF\t\t" << instr->storeRealPair.propertyIndex << "\t" << instr->storeRealPair.valueIndex;
break;
- case QmlInstruction::StoreRect:
+ case QDeclarativeInstruction::StoreRect:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECT\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
break;
- case QmlInstruction::StoreRectF:
+ case QDeclarativeInstruction::StoreRectF:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_RECTF\t\t" << instr->storeRect.propertyIndex << "\t" << instr->storeRect.valueIndex;
break;
- case QmlInstruction::StoreVector3D:
+ case QDeclarativeInstruction::StoreVector3D:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VECTOR3D\t\t" << instr->storeVector3D.propertyIndex << "\t" << instr->storeVector3D.valueIndex;
break;
- case QmlInstruction::StoreVariant:
+ case QDeclarativeInstruction::StoreVariant:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value);
break;
- case QmlInstruction::StoreObject:
+ case QDeclarativeInstruction::StoreObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT\t\t" << instr->storeObject.propertyIndex;
break;
- case QmlInstruction::StoreVariantObject:
+ case QDeclarativeInstruction::StoreVariantObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VARIANT_OBJECT\t" << instr->storeObject.propertyIndex;
break;
- case QmlInstruction::StoreInterface:
+ case QDeclarativeInstruction::StoreInterface:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_INTERFACE\t\t" << instr->storeObject.propertyIndex;
break;
- case QmlInstruction::StoreSignal:
+ case QDeclarativeInstruction::StoreSignal:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SIGNAL\t\t" << instr->storeSignal.signalIndex << "\t" << instr->storeSignal.value << "\t\t" << primitives.at(instr->storeSignal.value);
break;
- case QmlInstruction::StoreScript:
+ case QDeclarativeInstruction::StoreScript:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SCRIPT\t\t" << instr->storeScript.value;
break;
- case QmlInstruction::StoreScriptString:
+ case QDeclarativeInstruction::StoreScriptString:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_SCRIPT_STRING\t" << instr->storeScriptString.propertyIndex << "\t" << instr->storeScriptString.value << "\t" << instr->storeScriptString.scope;
break;
- case QmlInstruction::AssignSignalObject:
+ case QDeclarativeInstruction::AssignSignalObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_SIGNAL_OBJECT\t" << instr->assignSignalObject.signal << "\t\t\t" << datas.at(instr->assignSignalObject.signal);
break;
- case QmlInstruction::AssignCustomType:
+ case QDeclarativeInstruction::AssignCustomType:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_CUSTOMTYPE\t" << instr->assignCustomType.propertyIndex << "\t" << instr->assignCustomType.valueIndex;
break;
- case QmlInstruction::StoreBinding:
+ case QDeclarativeInstruction::StoreBinding:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
break;
- case QmlInstruction::StoreCompiledBinding:
+ case QDeclarativeInstruction::StoreCompiledBinding:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_COMPILED_BINDING\t" << instr->assignBinding.property << "\t" << instr->assignBinding.value << "\t" << instr->assignBinding.context;
break;
- case QmlInstruction::StoreValueSource:
+ case QDeclarativeInstruction::StoreValueSource:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_SOURCE\t" << instr->assignValueSource.property << "\t" << instr->assignValueSource.castValue;
break;
- case QmlInstruction::StoreValueInterceptor:
+ case QDeclarativeInstruction::StoreValueInterceptor:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_VALUE_INTERCEPTOR\t" << instr->assignValueInterceptor.property << "\t" << instr->assignValueInterceptor.castValue;
break;
- case QmlInstruction::BeginObject:
+ case QDeclarativeInstruction::BeginObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "BEGIN\t\t\t" << instr->begin.castValue;
break;
- case QmlInstruction::StoreObjectQList:
+ case QDeclarativeInstruction::StoreObjectQList:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "STORE_OBJECT_QLIST";
break;
- case QmlInstruction::AssignObjectList:
+ case QDeclarativeInstruction::AssignObjectList:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "ASSIGN_OBJECT_LIST";
break;
- case QmlInstruction::FetchAttached:
+ case QDeclarativeInstruction::FetchAttached:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_ATTACHED\t\t" << instr->fetchAttached.id;
break;
- case QmlInstruction::FetchQList:
+ case QDeclarativeInstruction::FetchQList:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_QLIST\t\t" << instr->fetch.property;
break;
- case QmlInstruction::FetchObject:
+ case QDeclarativeInstruction::FetchObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH\t\t\t" << instr->fetch.property;
break;
- case QmlInstruction::FetchValueType:
+ case QDeclarativeInstruction::FetchValueType:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "FETCH_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type;
break;
- case QmlInstruction::PopFetchedObject:
+ case QDeclarativeInstruction::PopFetchedObject:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP";
break;
- case QmlInstruction::PopQList:
+ case QDeclarativeInstruction::PopQList:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_QLIST";
break;
- case QmlInstruction::PopValueType:
+ case QDeclarativeInstruction::PopValueType:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "POP_VALUE\t\t" << instr->fetchValue.property << "\t" << instr->fetchValue.type;
break;
- case QmlInstruction::Defer:
+ case QDeclarativeInstruction::Defer:
qWarning().nospace() << idx << "\t\t" << line << "\t" << "DEFER" << "\t\t\t" << instr->defer.deferCount;
break;
default:
diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h
index ea785b6..d8af6a7 100644
--- a/src/declarative/qml/qmlinstruction_p.h
+++ b/src/declarative/qml/qdeclarativeinstruction_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLINSTRUCTION_P_H
-#define QMLINSTRUCTION_P_H
+#ifndef QDECLARATIVEINSTRUCTION_P_H
+#define QDECLARATIVEINSTRUCTION_P_H
//
// W A R N I N G
@@ -57,8 +57,8 @@
QT_BEGIN_NAMESPACE
-class QmlCompiledData;
-class Q_DECLARATIVE_EXPORT QmlInstruction
+class QDeclarativeCompiledData;
+class Q_DECLARATIVE_EXPORT QDeclarativeInstruction
{
public:
enum Type {
@@ -156,7 +156,7 @@ public:
//
Defer, /* defer */
};
- QmlInstruction()
+ QDeclarativeInstruction()
: line(0) {}
Type type;
@@ -311,9 +311,9 @@ public:
} defer;
};
- void dump(QmlCompiledData *);
+ void dump(QDeclarativeCompiledData *);
};
QT_END_NAMESPACE
-#endif // QMLINSTRUCTION_P_H
+#endif // QDECLARATIVEINSTRUCTION_P_H
diff --git a/src/declarative/qml/qmlintegercache.cpp b/src/declarative/qml/qdeclarativeintegercache.cpp
index 2c2d494..7fa4b0c 100644
--- a/src/declarative/qml/qmlintegercache.cpp
+++ b/src/declarative/qml/qdeclarativeintegercache.cpp
@@ -39,24 +39,24 @@
**
****************************************************************************/
-#include "qmlintegercache_p.h"
+#include "qdeclarativeintegercache_p.h"
-#include "qmlengine_p.h"
-#include "qmlmetatype.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativemetatype.h"
QT_BEGIN_NAMESPACE
-QmlIntegerCache::QmlIntegerCache(QmlEngine *e)
-: QmlCleanup(e), engine(e)
+QDeclarativeIntegerCache::QDeclarativeIntegerCache(QDeclarativeEngine *e)
+: QDeclarativeCleanup(e), engine(e)
{
}
-QmlIntegerCache::~QmlIntegerCache()
+QDeclarativeIntegerCache::~QDeclarativeIntegerCache()
{
clear();
}
-void QmlIntegerCache::clear()
+void QDeclarativeIntegerCache::clear()
{
qDeleteAll(stringCache);
stringCache.clear();
@@ -64,11 +64,11 @@ void QmlIntegerCache::clear()
engine = 0;
}
-void QmlIntegerCache::add(const QString &id, int value)
+void QDeclarativeIntegerCache::add(const QString &id, int value)
{
Q_ASSERT(!stringCache.contains(id));
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
// ### use contextClass
Data *d = new Data(enginePriv->objectClass->createPersistentIdentifier(id), value);
@@ -77,7 +77,7 @@ void QmlIntegerCache::add(const QString &id, int value)
identifierCache.insert(d->identifier, d);
}
-int QmlIntegerCache::value(const QString &id)
+int QDeclarativeIntegerCache::value(const QString &id)
{
Data *d = stringCache.value(id);
return d?d->value:-1;
diff --git a/src/declarative/qml/qmlintegercache_p.h b/src/declarative/qml/qdeclarativeintegercache_p.h
index f38138f..b57565e 100644
--- a/src/declarative/qml/qmlintegercache_p.h
+++ b/src/declarative/qml/qdeclarativeintegercache_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLINTEGERCACHE_P_H
-#define QMLINTEGERCACHE_P_H
+#ifndef QDECLARATIVEINTEGERCACHE_P_H
+#define QDECLARATIVEINTEGERCACHE_P_H
//
// W A R N I N G
@@ -53,8 +53,8 @@
// We mean it.
//
-#include "qmlrefcount_p.h"
-#include "qmlcleanup_p.h"
+#include "qdeclarativerefcount_p.h"
+#include "qdeclarativecleanup_p.h"
#include <QtCore/qhash.h>
@@ -62,13 +62,13 @@
QT_BEGIN_NAMESPACE
-class QmlType;
-class QmlEngine;
-class QmlIntegerCache : public QmlRefCount, public QmlCleanup
+class QDeclarativeType;
+class QDeclarativeEngine;
+class QDeclarativeIntegerCache : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
- QmlIntegerCache(QmlEngine *);
- virtual ~QmlIntegerCache();
+ QDeclarativeIntegerCache(QDeclarativeEngine *);
+ virtual ~QDeclarativeIntegerCache();
inline int count() const;
void add(const QString &, int);
@@ -91,21 +91,21 @@ private:
StringCache stringCache;
IdentifierCache identifierCache;
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
};
-int QmlIntegerCache::value(const QScriptDeclarativeClass::Identifier &id) const
+int QDeclarativeIntegerCache::value(const QScriptDeclarativeClass::Identifier &id) const
{
Data *d = identifierCache.value(id);
return d?d->value:-1;
}
-int QmlIntegerCache::count() const
+int QDeclarativeIntegerCache::count() const
{
return stringCache.count();
}
QT_END_NAMESPACE
-#endif // QMLINTEGERCACHE_P_H
+#endif // QDECLARATIVEINTEGERCACHE_P_H
diff --git a/src/declarative/qml/qmllist.cpp b/src/declarative/qml/qdeclarativelist.cpp
index 4cd2120..4c9586c 100644
--- a/src/declarative/qml/qmllist.cpp
+++ b/src/declarative/qml/qdeclarativelist.cpp
@@ -39,45 +39,45 @@
**
****************************************************************************/
-#include "qmllist.h"
-#include "qmllist_p.h"
-#include "qmlengine_p.h"
-#include "qmlmetaproperty_p.h"
+#include "qdeclarativelist.h"
+#include "qdeclarativelist_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativemetaproperty_p.h"
QT_BEGIN_NAMESPACE
-QmlListReferencePrivate::QmlListReferencePrivate()
+QDeclarativeListReferencePrivate::QDeclarativeListReferencePrivate()
: propertyType(-1), refCount(1)
{
}
-QmlListReference QmlListReferencePrivate::init(const QmlListProperty<QObject> &prop, int propType, QmlEngine *engine)
+QDeclarativeListReference QDeclarativeListReferencePrivate::init(const QDeclarativeListProperty<QObject> &prop, int propType, QDeclarativeEngine *engine)
{
- QmlListReference rv;
+ QDeclarativeListReference rv;
if (!prop.object) return rv;
- QmlEnginePrivate *p = engine?QmlEnginePrivate::get(engine):0;
+ QDeclarativeEnginePrivate *p = engine?QDeclarativeEnginePrivate::get(engine):0;
- int listType = p?p->listType(propType):QmlMetaType::listType(propType);
+ int listType = p?p->listType(propType):QDeclarativeMetaType::listType(propType);
if (listType == -1) return rv;
- rv.d = new QmlListReferencePrivate;
+ rv.d = new QDeclarativeListReferencePrivate;
rv.d->object = prop.object;
- rv.d->elementType = p?p->rawMetaObjectForType(listType):QmlMetaType::qmlType(listType)->baseMetaObject();
+ rv.d->elementType = p?p->rawMetaObjectForType(listType):QDeclarativeMetaType::qmlType(listType)->baseMetaObject();
rv.d->property = prop;
rv.d->propertyType = propType;
return rv;
}
-void QmlListReferencePrivate::addref()
+void QDeclarativeListReferencePrivate::addref()
{
Q_ASSERT(refCount > 0);
++refCount;
}
-void QmlListReferencePrivate::release()
+void QDeclarativeListReferencePrivate::release()
{
Q_ASSERT(refCount > 0);
--refCount;
@@ -85,42 +85,42 @@ void QmlListReferencePrivate::release()
delete this;
}
-QmlListReference::QmlListReference()
+QDeclarativeListReference::QDeclarativeListReference()
: d(0)
{
}
-QmlListReference::QmlListReference(QObject *o, const char *property, QmlEngine *engine)
+QDeclarativeListReference::QDeclarativeListReference(QObject *o, const char *property, QDeclarativeEngine *engine)
: d(0)
{
if (!o || !property) return;
- QmlPropertyCache::Data local;
- QmlPropertyCache::Data *data = QmlPropertyCache::property(engine, o, QLatin1String(property), local);
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *data = QDeclarativePropertyCache::property(engine, o, QLatin1String(property), local);
- if (!data || !(data->flags & QmlPropertyCache::Data::IsQList)) return;
+ if (!data || !(data->flags & QDeclarativePropertyCache::Data::IsQList)) return;
- QmlEnginePrivate *p = engine?QmlEnginePrivate::get(engine):0;
+ QDeclarativeEnginePrivate *p = engine?QDeclarativeEnginePrivate::get(engine):0;
- int listType = p?p->listType(data->propType):QmlMetaType::listType(data->propType);
+ int listType = p?p->listType(data->propType):QDeclarativeMetaType::listType(data->propType);
if (listType == -1) return;
- d = new QmlListReferencePrivate;
+ d = new QDeclarativeListReferencePrivate;
d->object = o;
- d->elementType = p?p->rawMetaObjectForType(listType):QmlMetaType::qmlType(listType)->baseMetaObject();
+ d->elementType = p?p->rawMetaObjectForType(listType):QDeclarativeMetaType::qmlType(listType)->baseMetaObject();
d->propertyType = data->propType;
void *args[] = { &d->property, 0 };
QMetaObject::metacall(o, QMetaObject::ReadProperty, data->coreIndex, args);
}
-QmlListReference::QmlListReference(const QmlListReference &o)
+QDeclarativeListReference::QDeclarativeListReference(const QDeclarativeListReference &o)
: d(o.d)
{
if (d) d->addref();
}
-QmlListReference &QmlListReference::operator=(const QmlListReference &o)
+QDeclarativeListReference &QDeclarativeListReference::operator=(const QDeclarativeListReference &o)
{
if (o.d) o.d->addref();
if (d) d->release();
@@ -128,53 +128,53 @@ QmlListReference &QmlListReference::operator=(const QmlListReference &o)
return *this;
}
-QmlListReference::~QmlListReference()
+QDeclarativeListReference::~QDeclarativeListReference()
{
if (d) d->release();
}
-bool QmlListReference::isValid() const
+bool QDeclarativeListReference::isValid() const
{
return d && d->object;
}
-QObject *QmlListReference::object() const
+QObject *QDeclarativeListReference::object() const
{
if (isValid()) return d->object;
else return 0;
}
-const QMetaObject *QmlListReference::listElementType() const
+const QMetaObject *QDeclarativeListReference::listElementType() const
{
if (isValid()) return d->elementType;
else return 0;
}
-bool QmlListReference::canAppend() const
+bool QDeclarativeListReference::canAppend() const
{
return (isValid() && d->property.append);
}
-bool QmlListReference::canAt() const
+bool QDeclarativeListReference::canAt() const
{
return (isValid() && d->property.at);
}
-bool QmlListReference::canClear() const
+bool QDeclarativeListReference::canClear() const
{
return (isValid() && d->property.clear);
}
-bool QmlListReference::canCount() const
+bool QDeclarativeListReference::canCount() const
{
return (isValid() && d->property.count);
}
-bool QmlListReference::append(QObject *o) const
+bool QDeclarativeListReference::append(QObject *o) const
{
if (!canAppend()) return false;
- if (o && !QmlMetaPropertyPrivate::canConvert(o->metaObject(), d->elementType))
+ if (o && !QDeclarativeMetaPropertyPrivate::canConvert(o->metaObject(), d->elementType))
return false;
d->property.append(&d->property, o);
@@ -182,14 +182,14 @@ bool QmlListReference::append(QObject *o) const
return true;
}
-QObject *QmlListReference::at(int index) const
+QObject *QDeclarativeListReference::at(int index) const
{
if (!canAt()) return 0;
return d->property.at(&d->property, index);
}
-bool QmlListReference::clear() const
+bool QDeclarativeListReference::clear() const
{
if (!canClear()) return false;
@@ -198,7 +198,7 @@ bool QmlListReference::clear() const
return true;
}
-int QmlListReference::count() const
+int QDeclarativeListReference::count() const
{
if (!canCount()) return 0;
@@ -206,8 +206,8 @@ int QmlListReference::count() const
}
/*!
-\class QmlListProperty
-\brief The QmlListProperty class allows applications to explose list-like
+\class QDeclarativeListProperty
+\brief The QDeclarativeListProperty class allows applications to explose list-like
properties to QML.
QML has many list properties, where more than one object value can be assigned.
@@ -223,18 +223,18 @@ FruitBasket {
}
\endcode
-The QmlListProperty encapsulates a group of function pointers that represet the
+The QDeclarativeListProperty encapsulates a group of function pointers that represet the
set of actions QML can perform on the list - adding items, retrieving items and
clearing the list. In the future, additional operations may be supported. All
list properties must implement the append operation, but the rest are optional.
To provide a list property, a C++ class must implement the operation callbacks,
-and then return an appropriate QmlListProperty value from the property getter.
+and then return an appropriate QDeclarativeListProperty value from the property getter.
List properties should have no setter. In the example above, the Q_PROPERTY()
declarative will look like this:
\code
-Q_PROPERTY(QmlListProperty<Fruit> fruit READ fruit);
+Q_PROPERTY(QDeclarativeListProperty<Fruit> fruit READ fruit);
\endcode
QML list properties are typesafe - in this case \c {Fruit} is a QObject type that
@@ -242,14 +242,14 @@ QML list properties are typesafe - in this case \c {Fruit} is a QObject type tha
*/
/*!
-\fn QmlListProperty::QmlListProperty()
+\fn QDeclarativeListProperty::QDeclarativeListProperty()
\internal
*/
/*!
-\fn QmlListProperty::QmlListProperty(QObject *object, QList<T *> &list)
+\fn QDeclarativeListProperty::QDeclarativeListProperty(QObject *object, QList<T *> &list)
-Convenience constructor for making a QmlListProperty value from an existing
+Convenience constructor for making a QDeclarativeListProperty value from an existing
QList \a list. The \a list reference must remain valid for as long as \a object
exists. \a object must be provided.
@@ -259,11 +259,11 @@ can very useful while prototyping.
*/
/*!
-\fn QmlListProperty::QmlListProperty(QObject *object, void *data, AppendFunction append,
+\fn QDeclarativeListProperty::QDeclarativeListProperty(QObject *object, void *data, AppendFunction append,
CountFunction count = 0, AtFunction at = 0,
ClearFunction clear = 0)
-Construct a QmlListProperty from a set of operation functions. An opaque \a data handle
+Construct a QDeclarativeListProperty from a set of operation functions. An opaque \a data handle
may be passed which can be accessed from within the operation functions. The list property
remains valid while \a object exists.
@@ -272,39 +272,39 @@ The \a append operation is compulsory and must be provided, while the \a count,
*/
/*!
-\typedef QmlListProperty::AppendFunction
+\typedef QDeclarativeListProperty::AppendFunction
-Synonym for \c {void (*)(QmlListProperty<T> *property, T *value)}.
+Synonym for \c {void (*)(QDeclarativeListProperty<T> *property, T *value)}.
Append the \a value to the list \a property.
*/
/*!
-\typedef QmlListProperty::CountFunction
+\typedef QDeclarativeListProperty::CountFunction
-Synonym for \c {int (*)(QmlListProperty<T> *property)}.
+Synonym for \c {int (*)(QDeclarativeListProperty<T> *property)}.
Return the number of elements in the list \a property.
*/
/*!
-\fn bool QmlListProperty::operator==(const QmlListProperty &other) const
+\fn bool QDeclarativeListProperty::operator==(const QDeclarativeListProperty &other) const
-Returns true if this QmlListProperty is equal to \a other, otherwise false.
+Returns true if this QDeclarativeListProperty is equal to \a other, otherwise false.
*/
/*!
-\typedef QmlListProperty::AtFunction
+\typedef QDeclarativeListProperty::AtFunction
-Synonym for \c {T *(*)(QmlListProperty<T> *property, int index)}.
+Synonym for \c {T *(*)(QDeclarativeListProperty<T> *property, int index)}.
Return the element at position \a index in the list \a property.
*/
/*!
-\typedef QmlListProperty::ClearFunction
+\typedef QDeclarativeListProperty::ClearFunction
-Synonym for \c {void (*)(QmlListProperty<T> *property)}.
+Synonym for \c {void (*)(QDeclarativeListProperty<T> *property)}.
Clear the list \a property.
*/
diff --git a/src/declarative/qml/qmllist.h b/src/declarative/qml/qdeclarativelist.h
index 5528d8d..fb877b4 100644
--- a/src/declarative/qml/qmllist.h
+++ b/src/declarative/qml/qdeclarativelist.h
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#ifndef QMLLIST_H
-#define QMLLIST_H
+#ifndef QDECLARATIVELIST_H
+#define QDECLARATIVELIST_H
-#include "qmlprivate.h"
+#include "qdeclarativeprivate.h"
QT_BEGIN_HEADER
@@ -51,22 +51,22 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
template<typename T>
-struct QmlListProperty {
- typedef void (*AppendFunction)(QmlListProperty<T> *, T*);
- typedef int (*CountFunction)(QmlListProperty<T> *);
- typedef T *(*AtFunction)(QmlListProperty<T> *, int);
- typedef void (*ClearFunction)(QmlListProperty<T> *);
+struct QDeclarativeListProperty {
+ typedef void (*AppendFunction)(QDeclarativeListProperty<T> *, T*);
+ typedef int (*CountFunction)(QDeclarativeListProperty<T> *);
+ typedef T *(*AtFunction)(QDeclarativeListProperty<T> *, int);
+ typedef void (*ClearFunction)(QDeclarativeListProperty<T> *);
- QmlListProperty()
+ QDeclarativeListProperty()
: object(0), data(0), append(0), count(0), at(0), clear(0), dummy1(0), dummy2(0) {}
- QmlListProperty(QObject *o, QList<T *> &list)
+ QDeclarativeListProperty(QObject *o, QList<T *> &list)
: object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at),
clear(qlist_clear), dummy1(0), dummy2(0) {}
- QmlListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0,
+ QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0,
ClearFunction r = 0)
: object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {}
- bool operator==(const QmlListProperty &o) const {
+ bool operator==(const QDeclarativeListProperty &o) const {
return object == o.object &&
data == o.data &&
append == o.append &&
@@ -89,30 +89,30 @@ struct QmlListProperty {
void *dummy2;
private:
- static void qlist_append(QmlListProperty *p, T *v) {
+ static void qlist_append(QDeclarativeListProperty *p, T *v) {
((QList<T *> *)p->data)->append(v);
}
- static int qlist_count(QmlListProperty *p) {
+ static int qlist_count(QDeclarativeListProperty *p) {
return ((QList<T *> *)p->data)->count();
}
- static T *qlist_at(QmlListProperty *p, int idx) {
+ static T *qlist_at(QDeclarativeListProperty *p, int idx) {
return ((QList<T *> *)p->data)->at(idx);
}
- static void qlist_clear(QmlListProperty *p) {
+ static void qlist_clear(QDeclarativeListProperty *p) {
return ((QList<T *> *)p->data)->clear();
}
};
-class QmlEngine;
-class QmlListReferencePrivate;
-class Q_DECLARATIVE_EXPORT QmlListReference
+class QDeclarativeEngine;
+class QDeclarativeListReferencePrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeListReference
{
public:
- QmlListReference();
- QmlListReference(QObject *, const char *property, QmlEngine * = 0);
- QmlListReference(const QmlListReference &);
- QmlListReference &operator=(const QmlListReference &);
- ~QmlListReference();
+ QDeclarativeListReference();
+ QDeclarativeListReference(QObject *, const char *property, QDeclarativeEngine * = 0);
+ QDeclarativeListReference(const QDeclarativeListReference &);
+ QDeclarativeListReference &operator=(const QDeclarativeListReference &);
+ ~QDeclarativeListReference();
bool isValid() const;
@@ -130,14 +130,14 @@ public:
int count() const;
private:
- friend class QmlListReferencePrivate;
- QmlListReferencePrivate* d;
+ friend class QDeclarativeListReferencePrivate;
+ QDeclarativeListReferencePrivate* d;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QmlListReference);
+Q_DECLARE_METATYPE(QDeclarativeListReference);
QT_END_HEADER
-#endif // QMLLIST_H
+#endif // QDECLARATIVELIST_H
diff --git a/src/declarative/qml/qmllist_p.h b/src/declarative/qml/qdeclarativelist_p.h
index 4660e47..45a805a 100644
--- a/src/declarative/qml/qmllist_p.h
+++ b/src/declarative/qml/qdeclarativelist_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLLIST_P_H
-#define QMLLIST_P_H
+#ifndef QDECLARATIVELIST_P_H
+#define QDECLARATIVELIST_P_H
//
// W A R N I N G
@@ -53,28 +53,28 @@
// We mean it.
//
-#include "qmllist.h"
-#include "qmlguard_p.h"
+#include "qdeclarativelist.h"
+#include "qdeclarativeguard_p.h"
QT_BEGIN_NAMESPACE
-class QmlListReferencePrivate
+class QDeclarativeListReferencePrivate
{
public:
- QmlListReferencePrivate();
+ QDeclarativeListReferencePrivate();
- static QmlListReference init(const QmlListProperty<QObject> &, int, QmlEngine *);
+ static QDeclarativeListReference init(const QDeclarativeListProperty<QObject> &, int, QDeclarativeEngine *);
- QmlGuard<QObject> object;
+ QDeclarativeGuard<QObject> object;
const QMetaObject *elementType;
- QmlListProperty<QObject> property;
+ QDeclarativeListProperty<QObject> property;
int propertyType;
void addref();
void release();
int refCount;
- static inline QmlListReferencePrivate *get(QmlListReference *ref) {
+ static inline QDeclarativeListReferencePrivate *get(QDeclarativeListReference *ref) {
return ref->d;
}
};
@@ -82,4 +82,4 @@ public:
QT_END_NAMESPACE
-#endif // QMLLIST_P_H
+#endif // QDECLARATIVELIST_P_H
diff --git a/src/declarative/qml/qmllistscriptclass.cpp b/src/declarative/qml/qdeclarativelistscriptclass.cpp
index bb29763..ea04ad9 100644
--- a/src/declarative/qml/qmllistscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativelistscriptclass.cpp
@@ -39,36 +39,36 @@
**
****************************************************************************/
-#include "qmllistscriptclass_p.h"
+#include "qdeclarativelistscriptclass_p.h"
-#include "qmlengine_p.h"
-#include "qmlguard_p.h"
-#include "qmllist_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeguard_p.h"
+#include "qdeclarativelist_p.h"
QT_BEGIN_NAMESPACE
struct ListData : public QScriptDeclarativeClass::Object {
- QmlGuard<QObject> object;
- QmlListProperty<QObject> property;
+ QDeclarativeGuard<QObject> object;
+ QDeclarativeListProperty<QObject> property;
int propertyType;
};
-QmlListScriptClass::QmlListScriptClass(QmlEngine *e)
-: QmlScriptClass(QmlEnginePrivate::getScriptEngine(e)), engine(e)
+QDeclarativeListScriptClass::QDeclarativeListScriptClass(QDeclarativeEngine *e)
+: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(e)), engine(e)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
Q_UNUSED(scriptEngine);
m_lengthId = createPersistentIdentifier(QLatin1String("length"));
}
-QmlListScriptClass::~QmlListScriptClass()
+QDeclarativeListScriptClass::~QDeclarativeListScriptClass()
{
}
-QScriptValue QmlListScriptClass::newList(QObject *object, int propId, int propType)
+QScriptValue QDeclarativeListScriptClass::newList(QObject *object, int propId, int propType)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (!object || propId == -1)
return scriptEngine->nullValue();
@@ -82,9 +82,9 @@ QScriptValue QmlListScriptClass::newList(QObject *object, int propId, int propTy
return newObject(scriptEngine, this, data);
}
-QScriptValue QmlListScriptClass::newList(const QmlListProperty<QObject> &prop, int propType)
+QScriptValue QDeclarativeListScriptClass::newList(const QDeclarativeListProperty<QObject> &prop, int propType)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
ListData *data = new ListData;
data->object = prop.object;
@@ -95,7 +95,7 @@ QScriptValue QmlListScriptClass::newList(const QmlListProperty<QObject> &prop, i
}
QScriptClass::QueryFlags
-QmlListScriptClass::queryProperty(Object *object, const Identifier &name,
+QDeclarativeListScriptClass::queryProperty(Object *object, const Identifier &name,
QScriptClass::QueryFlags flags)
{
Q_UNUSED(object);
@@ -114,10 +114,10 @@ QmlListScriptClass::queryProperty(Object *object, const Identifier &name,
}
}
-QmlListScriptClass::ScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name)
+QDeclarativeListScriptClass::ScriptValue QDeclarativeListScriptClass::property(Object *obj, const Identifier &name)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
ListData *data = (ListData *)obj;
if (!data->object)
@@ -133,7 +133,7 @@ QmlListScriptClass::ScriptValue QmlListScriptClass::property(Object *obj, const
return Value();
}
-QVariant QmlListScriptClass::toVariant(Object *obj, bool *ok)
+QVariant QDeclarativeListScriptClass::toVariant(Object *obj, bool *ok)
{
ListData *data = (ListData *)obj;
@@ -142,7 +142,7 @@ QVariant QmlListScriptClass::toVariant(Object *obj, bool *ok)
return QVariant();
}
- return QVariant::fromValue(QmlListReferencePrivate::init(data->property, data->propertyType, engine));
+ return QVariant::fromValue(QDeclarativeListReferencePrivate::init(data->property, data->propertyType, engine));
}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmllistscriptclass_p.h b/src/declarative/qml/qdeclarativelistscriptclass_p.h
index 07b09c3..68c680d 100644
--- a/src/declarative/qml/qmllistscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativelistscriptclass_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLLISTSCRIPTCLASS_P_H
-#define QMLLISTSCRIPTCLASS_P_H
+#ifndef QDECLARATIVELISTSCRIPTCLASS_P_H
+#define QDECLARATIVELISTSCRIPTCLASS_P_H
//
// W A R N I N G
@@ -53,20 +53,20 @@
// We mean it.
//
-#include <private/qmlscriptclass_p.h>
-#include "qmllist.h"
+#include <private/qdeclarativescriptclass_p.h>
+#include "qdeclarativelist.h"
QT_BEGIN_NAMESPACE
-class QmlEngine;
-class QmlListScriptClass : public QmlScriptClass
+class QDeclarativeEngine;
+class QDeclarativeListScriptClass : public QDeclarativeScriptClass
{
public:
- QmlListScriptClass(QmlEngine *);
- ~QmlListScriptClass();
+ QDeclarativeListScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeListScriptClass();
QScriptValue newList(QObject *, int, int);
- QScriptValue newList(const QmlListProperty<QObject> &, int);
+ QScriptValue newList(const QDeclarativeListProperty<QObject> &, int);
protected:
virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
@@ -76,12 +76,12 @@ protected:
private:
PersistentIdentifier m_lengthId;
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
quint32 lastIndex;
};
QT_END_NAMESPACE
-#endif // QMLLISTSCRIPTCLASS_P_H
+#endif // QDECLARATIVELISTSCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qdeclarativemetaproperty.cpp
index d731393..e94ce8c 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qdeclarativemetaproperty.cpp
@@ -39,20 +39,20 @@
**
****************************************************************************/
-#include "qmlmetaproperty.h"
-#include "qmlmetaproperty_p.h"
-
-#include "qmlcompositetypedata_p.h"
-#include "qml.h"
-#include "qmlbinding_p.h"
-#include "qmlcontext.h"
-#include "qmlcontext_p.h"
-#include "qmlboundsignal_p.h"
-#include "qmlengine.h"
-#include "qmlengine_p.h"
-#include "qmldeclarativedata_p.h"
-#include "qmlstringconverters_p.h"
-#include "qmllist_p.h"
+#include "qdeclarativemetaproperty.h"
+#include "qdeclarativemetaproperty_p.h"
+
+#include "qdeclarativecompositetypedata_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativeboundsignal_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativedeclarativedata_p.h"
+#include "qdeclarativestringconverters_p.h"
+#include "qdeclarativelist_p.h"
#include <QStringList>
#include <QtCore/qdebug.h>
@@ -62,32 +62,32 @@
QT_BEGIN_NAMESPACE
/*!
- \class QmlMetaProperty
- \brief The QmlMetaProperty class abstracts accessing QML properties.
+ \class QDeclarativeMetaProperty
+ \brief The QDeclarativeMetaProperty class abstracts accessing QML properties.
\internal
*/
/*!
- Create an invalid QmlMetaProperty.
+ Create an invalid QDeclarativeMetaProperty.
*/
-QmlMetaProperty::QmlMetaProperty()
-: d(new QmlMetaPropertyPrivate)
+QDeclarativeMetaProperty::QDeclarativeMetaProperty()
+: d(new QDeclarativeMetaPropertyPrivate)
{
d->q = this;
}
/*! \internal */
-QmlMetaProperty::~QmlMetaProperty()
+QDeclarativeMetaProperty::~QDeclarativeMetaProperty()
{
delete d; d = 0;
}
/*!
- Creates a QmlMetaProperty for the default property of \a obj. If there is no
- default property, an invalid QmlMetaProperty will be created.
+ Creates a QDeclarativeMetaProperty for the default property of \a obj. If there is no
+ default property, an invalid QDeclarativeMetaProperty will be created.
*/
-QmlMetaProperty::QmlMetaProperty(QObject *obj)
-: d(new QmlMetaPropertyPrivate)
+QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj)
+: d(new QDeclarativeMetaPropertyPrivate)
{
d->q = this;
d->initDefault(obj);
@@ -95,11 +95,11 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj)
/*!
\internal
- Creates a QmlMetaProperty for the default property of \a obj. If there is no
- default property, an invalid QmlMetaProperty will be created.
+ Creates a QDeclarativeMetaProperty for the default property of \a obj. If there is no
+ default property, an invalid QDeclarativeMetaProperty will be created.
*/
-QmlMetaProperty::QmlMetaProperty(QObject *obj, QmlContext *ctxt)
-: d(new QmlMetaPropertyPrivate)
+QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, QDeclarativeContext *ctxt)
+: d(new QDeclarativeMetaPropertyPrivate)
{
d->q = this;
d->context = ctxt;
@@ -109,12 +109,12 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, QmlContext *ctxt)
/*!
Initialize from the default property of \a obj
*/
-void QmlMetaPropertyPrivate::initDefault(QObject *obj)
+void QDeclarativeMetaPropertyPrivate::initDefault(QObject *obj)
{
if (!obj)
return;
- QMetaProperty p = QmlMetaType::defaultProperty(obj);
+ QMetaProperty p = QDeclarativeMetaType::defaultProperty(obj);
core.load(p);
if (core.isValid()) {
isDefaultProperty = true;
@@ -123,10 +123,10 @@ void QmlMetaPropertyPrivate::initDefault(QObject *obj)
}
/*!
- Creates a QmlMetaProperty for the property \a name of \a obj.
+ Creates a QDeclarativeMetaProperty for the property \a name of \a obj.
*/
-QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name)
-: d(new QmlMetaPropertyPrivate)
+QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, const QString &name)
+: d(new QDeclarativeMetaPropertyPrivate)
{
d->q = this;
d->initProperty(obj, name);
@@ -135,10 +135,10 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name)
/*!
\internal
- Creates a QmlMetaProperty for the property \a name of \a obj.
+ Creates a QDeclarativeMetaProperty for the property \a name of \a obj.
*/
-QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name, QmlContext *ctxt)
-: d(new QmlMetaPropertyPrivate)
+QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt)
+: d(new QDeclarativeMetaPropertyPrivate)
{
d->q = this;
d->context = ctxt;
@@ -146,11 +146,11 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name, QmlContext *
if (!isValid()) { d->object = 0; d->context = 0; }
}
-void QmlMetaPropertyPrivate::initProperty(QObject *obj, const QString &name)
+void QDeclarativeMetaPropertyPrivate::initProperty(QObject *obj, const QString &name)
{
- QmlEnginePrivate *enginePrivate = 0;
+ QDeclarativeEnginePrivate *enginePrivate = 0;
if (context && context->engine())
- enginePrivate = QmlEnginePrivate::get(context->engine());
+ enginePrivate = QDeclarativeEnginePrivate::get(context->engine());
object = obj;
@@ -160,9 +160,9 @@ void QmlMetaPropertyPrivate::initProperty(QObject *obj, const QString &name)
if (enginePrivate && name.at(0).isUpper()) {
// Attached property
// ### What about qualified types?
- QmlTypeNameCache *tnCache = QmlContextPrivate::get(context)->imports;
+ QDeclarativeTypeNameCache *tnCache = QDeclarativeContextPrivate::get(context)->imports;
if (tnCache) {
- QmlTypeNameCache::Data *d = tnCache->data(name);
+ QDeclarativeTypeNameCache::Data *d = tnCache->data(name);
if (d && d->type && d->type->attachedPropertiesFunction()) {
attachedFunc = d->type->index();
}
@@ -185,37 +185,37 @@ void QmlMetaPropertyPrivate::initProperty(QObject *obj, const QString &name)
}
// Property
- QmlPropertyCache::Data local;
- QmlPropertyCache::Data *property =
- QmlPropertyCache::property(context?context->engine():0, obj, name, local);
- if (property && !(property->flags & QmlPropertyCache::Data::IsFunction))
+ QDeclarativePropertyCache::Data local;
+ QDeclarativePropertyCache::Data *property =
+ QDeclarativePropertyCache::property(context?context->engine():0, obj, name, local);
+ if (property && !(property->flags & QDeclarativePropertyCache::Data::IsFunction))
core = *property;
}
/*!
Create a copy of \a other.
*/
-QmlMetaProperty::QmlMetaProperty(const QmlMetaProperty &other)
-: d(new QmlMetaPropertyPrivate(*other.d))
+QDeclarativeMetaProperty::QDeclarativeMetaProperty(const QDeclarativeMetaProperty &other)
+: d(new QDeclarativeMetaPropertyPrivate(*other.d))
{
d->q = this;
}
/*!
- \enum QmlMetaProperty::PropertyCategory
+ \enum QDeclarativeMetaProperty::PropertyCategory
This enum specifies a category of QML property.
\value Unknown The category is unknown. This will never be returned from propertyCategory()
\value InvalidProperty The property is invalid.
- \value Bindable The property is a QmlBinding.
+ \value Bindable The property is a QDeclarativeBinding.
\value List The property is a QList pointer
\value Object The property is a QObject derived type pointer
\value Normal The property is none of the above.
*/
/*!
- \enum QmlMetaProperty::Type
+ \enum QDeclarativeMetaProperty::Type
This enum specifies a type of QML property.
@@ -229,36 +229,36 @@ QmlMetaProperty::QmlMetaProperty(const QmlMetaProperty &other)
/*!
Returns the property category.
*/
-QmlMetaProperty::PropertyCategory QmlMetaProperty::propertyCategory() const
+QDeclarativeMetaProperty::PropertyCategory QDeclarativeMetaProperty::propertyCategory() const
{
return d->propertyCategory();
}
-QmlMetaProperty::PropertyCategory
-QmlMetaPropertyPrivate::propertyCategory() const
+QDeclarativeMetaProperty::PropertyCategory
+QDeclarativeMetaPropertyPrivate::propertyCategory() const
{
uint type = q->type();
- if (type & QmlMetaProperty::ValueTypeProperty) {
- return QmlMetaProperty::Normal;
- } else if (type & QmlMetaProperty::Attached) {
- return QmlMetaProperty::Object;
- } else if (type & QmlMetaProperty::Property) {
+ if (type & QDeclarativeMetaProperty::ValueTypeProperty) {
+ return QDeclarativeMetaProperty::Normal;
+ } else if (type & QDeclarativeMetaProperty::Attached) {
+ return QDeclarativeMetaProperty::Object;
+ } else if (type & QDeclarativeMetaProperty::Property) {
int type = propertyType();
if (type == QVariant::Invalid)
- return QmlMetaProperty::InvalidProperty;
+ return QDeclarativeMetaProperty::InvalidProperty;
else if ((uint)type < QVariant::UserType)
- return QmlMetaProperty::Normal;
- else if (type == qMetaTypeId<QmlBinding *>())
- return QmlMetaProperty::Bindable;
- else if (core.flags & QmlPropertyCache::Data::IsQObjectDerived)
- return QmlMetaProperty::Object;
- else if (core.flags & QmlPropertyCache::Data::IsQList)
- return QmlMetaProperty::List;
+ return QDeclarativeMetaProperty::Normal;
+ else if (type == qMetaTypeId<QDeclarativeBinding *>())
+ return QDeclarativeMetaProperty::Bindable;
+ else if (core.flags & QDeclarativePropertyCache::Data::IsQObjectDerived)
+ return QDeclarativeMetaProperty::Object;
+ else if (core.flags & QDeclarativePropertyCache::Data::IsQList)
+ return QDeclarativeMetaProperty::List;
else
- return QmlMetaProperty::Normal;
+ return QDeclarativeMetaProperty::Normal;
} else {
- return QmlMetaProperty::InvalidProperty;
+ return QDeclarativeMetaProperty::InvalidProperty;
}
}
@@ -266,14 +266,14 @@ QmlMetaPropertyPrivate::propertyCategory() const
Returns the type name of the property, or 0 if the property has no type
name.
*/
-const char *QmlMetaProperty::propertyTypeName() const
+const char *QDeclarativeMetaProperty::propertyTypeName() const
{
if (type() & ValueTypeProperty) {
- QmlEnginePrivate *ep = QmlEnginePrivate::get(d->context);
- QmlValueType *valueType = 0;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(d->context);
+ QDeclarativeValueType *valueType = 0;
if (ep) valueType = ep->valueTypes[d->core.propType];
- else valueType = QmlValueTypeFactory::valueType(d->core.propType);
+ else valueType = QDeclarativeValueTypeFactory::valueType(d->core.propType);
Q_ASSERT(valueType);
const char *rv = valueType->metaObject()->property(d->valueType.valueTypeCoreIdx).typeName();
@@ -289,10 +289,10 @@ const char *QmlMetaProperty::propertyTypeName() const
}
/*!
- Returns true if \a other and this QmlMetaProperty represent the same
+ Returns true if \a other and this QDeclarativeMetaProperty represent the same
property.
*/
-bool QmlMetaProperty::operator==(const QmlMetaProperty &other) const
+bool QDeclarativeMetaProperty::operator==(const QDeclarativeMetaProperty &other) const
{
// category is intentially omitted here as it is generated
// from the other members
@@ -306,19 +306,19 @@ bool QmlMetaProperty::operator==(const QmlMetaProperty &other) const
Returns the QVariant type of the property, or QVariant::Invalid if the
property has no QVariant type.
*/
-int QmlMetaProperty::propertyType() const
+int QDeclarativeMetaProperty::propertyType() const
{
return d->propertyType();
}
-int QmlMetaPropertyPrivate::propertyType() const
+int QDeclarativeMetaPropertyPrivate::propertyType() const
{
uint type = q->type();
- if (type & QmlMetaProperty::ValueTypeProperty) {
+ if (type & QDeclarativeMetaProperty::ValueTypeProperty) {
return valueType.valueTypePropType;
- } else if (type & QmlMetaProperty::Attached) {
+ } else if (type & QDeclarativeMetaProperty::Attached) {
return qMetaTypeId<QObject *>();
- } else if (type & QmlMetaProperty::Property) {
+ } else if (type & QDeclarativeMetaProperty::Property) {
if (core.propType == (int)QVariant::LastType)
return qMetaTypeId<QVariant>();
else
@@ -331,9 +331,9 @@ int QmlMetaPropertyPrivate::propertyType() const
/*!
Returns the type of the property.
*/
-QmlMetaProperty::Type QmlMetaProperty::type() const
+QDeclarativeMetaProperty::Type QDeclarativeMetaProperty::type() const
{
- if (d->core.flags & QmlPropertyCache::Data::IsFunction)
+ if (d->core.flags & QDeclarativePropertyCache::Data::IsFunction)
return SignalProperty;
else if (d->attachedFunc != -1)
return Attached;
@@ -346,33 +346,33 @@ QmlMetaProperty::Type QmlMetaProperty::type() const
}
/*!
- Returns true if this QmlMetaProperty represents a regular Qt property.
+ Returns true if this QDeclarativeMetaProperty represents a regular Qt property.
*/
-bool QmlMetaProperty::isProperty() const
+bool QDeclarativeMetaProperty::isProperty() const
{
return type() & Property;
}
/*!
- Returns true if this QmlMetaProperty represents a default property.
+ Returns true if this QDeclarativeMetaProperty represents a default property.
*/
-bool QmlMetaProperty::isDefault() const
+bool QDeclarativeMetaProperty::isDefault() const
{
return type() & Default;
}
/*!
- Returns the QmlMetaProperty's QObject.
+ Returns the QDeclarativeMetaProperty's QObject.
*/
-QObject *QmlMetaProperty::object() const
+QObject *QDeclarativeMetaProperty::object() const
{
return d->object;
}
/*!
- Assign \a other to this QmlMetaProperty.
+ Assign \a other to this QDeclarativeMetaProperty.
*/
-QmlMetaProperty &QmlMetaProperty::operator=(const QmlMetaProperty &other)
+QDeclarativeMetaProperty &QDeclarativeMetaProperty::operator=(const QDeclarativeMetaProperty &other)
{
d->context = other.d->context;
d->object = other.d->object;
@@ -391,9 +391,9 @@ QmlMetaProperty &QmlMetaProperty::operator=(const QmlMetaProperty &other)
/*!
Returns true if the property is writable, otherwise false.
*/
-bool QmlMetaProperty::isWritable() const
+bool QDeclarativeMetaProperty::isWritable() const
{
- QmlMetaProperty::PropertyCategory category = propertyCategory();
+ QDeclarativeMetaProperty::PropertyCategory category = propertyCategory();
if (!d->object)
return false;
@@ -402,7 +402,7 @@ bool QmlMetaProperty::isWritable() const
else if (type() & SignalProperty)
return false;
else if (d->core.isValid() && d->object)
- return d->core.flags & QmlPropertyCache::Data::IsWritable;
+ return d->core.flags & QDeclarativePropertyCache::Data::IsWritable;
else
return false;
}
@@ -410,7 +410,7 @@ bool QmlMetaProperty::isWritable() const
/*!
Returns true if the property is designable, otherwise false.
*/
-bool QmlMetaProperty::isDesignable() const
+bool QDeclarativeMetaProperty::isDesignable() const
{
if (type() & Property && d->core.isValid() && d->object)
return d->object->metaObject()->property(d->core.coreIndex).isDesignable();
@@ -421,19 +421,19 @@ bool QmlMetaProperty::isDesignable() const
/*!
Returns true if the property is resettable, otherwise false.
*/
-bool QmlMetaProperty::isResettable() const
+bool QDeclarativeMetaProperty::isResettable() const
{
if (type() & Property && d->core.isValid() && d->object)
- return d->core.flags & QmlPropertyCache::Data::IsResettable;
+ return d->core.flags & QDeclarativePropertyCache::Data::IsResettable;
else
return false;
}
/*!
- Returns true if the QmlMetaProperty refers to a valid property, otherwise
+ Returns true if the QDeclarativeMetaProperty refers to a valid property, otherwise
false.
*/
-bool QmlMetaProperty::isValid() const
+bool QDeclarativeMetaProperty::isValid() const
{
return type() != Invalid;
}
@@ -441,7 +441,7 @@ bool QmlMetaProperty::isValid() const
/*!
Return the name of this QML property.
*/
-QString QmlMetaProperty::name() const
+QString QDeclarativeMetaProperty::name() const
{
if (!d->isNameCached) {
// ###
@@ -449,10 +449,10 @@ QString QmlMetaProperty::name() const
} else if (type() & ValueTypeProperty) {
QString rv = d->core.name(d->object) + QLatin1Char('.');
- QmlEnginePrivate *ep = d->context?QmlEnginePrivate::get(d->context->engine()):0;
- QmlValueType *valueType = 0;
+ QDeclarativeEnginePrivate *ep = d->context?QDeclarativeEnginePrivate::get(d->context->engine()):0;
+ QDeclarativeValueType *valueType = 0;
if (ep) valueType = ep->valueTypes[d->core.propType];
- else valueType = QmlValueTypeFactory::valueType(d->core.propType);
+ else valueType = QDeclarativeValueTypeFactory::valueType(d->core.propType);
Q_ASSERT(valueType);
rv += QString::fromUtf8(valueType->metaObject()->property(d->valueType.valueTypeCoreIdx).name());
@@ -477,7 +477,7 @@ QString QmlMetaProperty::name() const
Returns the \l{QMetaProperty} {Qt property} associated with
this QML property.
*/
-QMetaProperty QmlMetaProperty::property() const
+QMetaProperty QDeclarativeMetaProperty::property() const
{
if (type() & Property && d->core.isValid() && d->object)
return d->object->metaObject()->property(d->core.coreIndex);
@@ -489,7 +489,7 @@ QMetaProperty QmlMetaProperty::property() const
Return the QMetaMethod for this property if it is a SignalProperty,
otherwise returns an invalid QMetaMethod.
*/
-QMetaMethod QmlMetaProperty::method() const
+QMetaMethod QDeclarativeMetaProperty::method() const
{
if (type() & SignalProperty && d->object)
return d->object->metaObject()->method(d->core.coreIndex);
@@ -502,19 +502,19 @@ QMetaMethod QmlMetaProperty::method() const
Returns the binding associated with this property, or 0 if no binding
exists.
*/
-QmlAbstractBinding *QmlMetaProperty::binding() const
+QDeclarativeAbstractBinding *QDeclarativeMetaProperty::binding() const
{
if (!isProperty() || (type() & Attached) || !d->object)
return 0;
- QmlDeclarativeData *data = QmlDeclarativeData::get(d->object);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(d->object);
if (!data)
return 0;
if (!data->hasBindingBit(d->core.coreIndex))
return 0;
- QmlAbstractBinding *binding = data->bindings;
+ QDeclarativeAbstractBinding *binding = data->bindings;
while (binding) {
// ### This wont work for value types
if (binding->propertyIndex() == d->core.coreIndex)
@@ -537,8 +537,8 @@ QmlAbstractBinding *QmlMetaProperty::binding() const
\a flags is passed through to the binding and is used for the initial update (when
the binding sets the intial value, it will use these flags for the write).
*/
-QmlAbstractBinding *
-QmlMetaProperty::setBinding(QmlAbstractBinding *newBinding, QmlMetaProperty::WriteFlags flags) const
+QDeclarativeAbstractBinding *
+QDeclarativeMetaProperty::setBinding(QDeclarativeAbstractBinding *newBinding, QDeclarativeMetaProperty::WriteFlags flags) const
{
if (!isProperty() || (type() & Attached) || !d->object) {
if (newBinding)
@@ -549,14 +549,14 @@ QmlMetaProperty::setBinding(QmlAbstractBinding *newBinding, QmlMetaProperty::Wri
return d->setBinding(d->object, d->core, newBinding, flags);
}
-QmlAbstractBinding *
-QmlMetaPropertyPrivate::setBinding(QObject *object, const QmlPropertyCache::Data &core,
- QmlAbstractBinding *newBinding, QmlMetaProperty::WriteFlags flags)
+QDeclarativeAbstractBinding *
+QDeclarativeMetaPropertyPrivate::setBinding(QObject *object, const QDeclarativePropertyCache::Data &core,
+ QDeclarativeAbstractBinding *newBinding, QDeclarativeMetaProperty::WriteFlags flags)
{
- QmlDeclarativeData *data = QmlDeclarativeData::get(object, 0 != newBinding);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object, 0 != newBinding);
if (data && data->hasBindingBit(core.coreIndex)) {
- QmlAbstractBinding *binding = data->bindings;
+ QDeclarativeAbstractBinding *binding = data->bindings;
while (binding) {
// ### This wont work for value types
if (binding->propertyIndex() == core.coreIndex) {
@@ -565,7 +565,7 @@ QmlMetaPropertyPrivate::setBinding(QObject *object, const QmlPropertyCache::Data
if (newBinding)
newBinding->setEnabled(true, flags);
- return binding; // ### QmlAbstractBinding;
+ return binding; // ### QDeclarativeAbstractBinding;
}
binding = binding->m_nextBinding;
@@ -581,7 +581,7 @@ QmlMetaPropertyPrivate::setBinding(QObject *object, const QmlPropertyCache::Data
Returns the expression associated with this signal property, or 0 if no
signal expression exists.
*/
-QmlExpression *QmlMetaProperty::signalExpression() const
+QDeclarativeExpression *QDeclarativeMetaProperty::signalExpression() const
{
if (!(type() & SignalProperty))
return 0;
@@ -591,7 +591,7 @@ QmlExpression *QmlMetaProperty::signalExpression() const
for (int ii = 0; ii < children.count(); ++ii) {
QObject *child = children.at(ii);
- QmlBoundSignal *signal = QmlBoundSignal::cast(child);
+ QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
if (signal && signal->index() == coreIndex())
return signal->expression();
}
@@ -606,7 +606,7 @@ QmlExpression *QmlMetaProperty::signalExpression() const
Ownership of \a expr transfers to QML. Ownership of the return value is
assumed by the caller.
*/
-QmlExpression *QmlMetaProperty::setSignalExpression(QmlExpression *expr) const
+QDeclarativeExpression *QDeclarativeMetaProperty::setSignalExpression(QDeclarativeExpression *expr) const
{
if (!(type() & SignalProperty)) {
delete expr;
@@ -618,20 +618,20 @@ QmlExpression *QmlMetaProperty::setSignalExpression(QmlExpression *expr) const
for (int ii = 0; ii < children.count(); ++ii) {
QObject *child = children.at(ii);
- QmlBoundSignal *signal = QmlBoundSignal::cast(child);
+ QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
if (signal && signal->index() == coreIndex())
return signal->setExpression(expr);
}
if (expr) {
- QmlBoundSignal *signal = new QmlBoundSignal(d->object, method(), d->object);
+ QDeclarativeBoundSignal *signal = new QDeclarativeBoundSignal(d->object, method(), d->object);
return signal->setExpression(expr);
} else {
return 0;
}
}
-QMetaMethod QmlMetaPropertyPrivate::findSignal(QObject *obj, const QString &name)
+QMetaMethod QDeclarativeMetaPropertyPrivate::findSignal(QObject *obj, const QString &name)
{
const QMetaObject *mo = obj->metaObject();
@@ -648,7 +648,7 @@ QMetaMethod QmlMetaPropertyPrivate::findSignal(QObject *obj, const QString &name
return QMetaMethod();
}
-QObject *QmlMetaPropertyPrivate::attachedObject() const
+QObject *QDeclarativeMetaPropertyPrivate::attachedObject() const
{
if (attachedFunc == -1)
return 0;
@@ -659,7 +659,7 @@ QObject *QmlMetaPropertyPrivate::attachedObject() const
/*!
Returns the property value.
*/
-QVariant QmlMetaProperty::read() const
+QVariant QDeclarativeMetaProperty::read() const
{
if (!d->object)
return QVariant();
@@ -676,19 +676,19 @@ QVariant QmlMetaProperty::read() const
return QVariant();
}
-QVariant QmlMetaPropertyPrivate::readValueProperty()
+QVariant QDeclarativeMetaPropertyPrivate::readValueProperty()
{
uint type = q->type();
- if (type & QmlMetaProperty::Attached) {
+ if (type & QDeclarativeMetaProperty::Attached) {
return QVariant::fromValue(attachedObject());
- } else if(type & QmlMetaProperty::ValueTypeProperty) {
+ } else if(type & QDeclarativeMetaProperty::ValueTypeProperty) {
- QmlEnginePrivate *ep = QmlEnginePrivate::get(context);
- QmlValueType *valueType = 0;
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context);
+ QDeclarativeValueType *valueType = 0;
if (ep) valueType = ep->valueTypes[core.propType];
- else valueType = QmlValueTypeFactory::valueType(core.propType);
+ else valueType = QDeclarativeValueTypeFactory::valueType(core.propType);
Q_ASSERT(valueType);
valueType->read(object, core.coreIndex);
@@ -699,12 +699,12 @@ QVariant QmlMetaPropertyPrivate::readValueProperty()
if (!ep) delete valueType;
return rv;
- } else if(core.flags & QmlPropertyCache::Data::IsQList) {
+ } else if(core.flags & QDeclarativePropertyCache::Data::IsQList) {
- QmlListProperty<QObject> prop;
+ QDeclarativeListProperty<QObject> prop;
void *args[] = { &prop, 0 };
QMetaObject::metacall(object, QMetaObject::ReadProperty, core.coreIndex, args);
- return QVariant::fromValue(QmlListReferencePrivate::init(prop, core.propType, context?context->engine():0));
+ return QVariant::fromValue(QDeclarativeListReferencePrivate::init(prop, core.propType, context?context->engine():0));
} else {
@@ -716,7 +716,7 @@ QVariant QmlMetaPropertyPrivate::readValueProperty()
//###
//writeEnumProperty MIRRORS the relelvant bit of QMetaProperty::write AND MUST BE KEPT IN SYNC!
//###
-bool QmlMetaPropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags)
+bool QDeclarativeMetaPropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags)
{
if (!object || !prop.isWritable())
return false;
@@ -753,30 +753,30 @@ bool QmlMetaPropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int id
return status;
}
-bool QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value,
- QmlMetaProperty::WriteFlags flags)
+bool QDeclarativeMetaPropertyPrivate::writeValueProperty(const QVariant &value,
+ QDeclarativeMetaProperty::WriteFlags flags)
{
// Remove any existing bindings on this property
- if (!(flags & QmlMetaProperty::DontRemoveBinding)) {
- QmlAbstractBinding *binding = q->setBinding(0);
+ if (!(flags & QDeclarativeMetaProperty::DontRemoveBinding)) {
+ QDeclarativeAbstractBinding *binding = q->setBinding(0);
if (binding) binding->destroy();
}
bool rv = false;
uint type = q->type();
- if (type & QmlMetaProperty::ValueTypeProperty) {
- QmlEnginePrivate *ep = QmlEnginePrivate::get(context);
+ if (type & QDeclarativeMetaProperty::ValueTypeProperty) {
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context);
- QmlValueType *writeBack = 0;
+ QDeclarativeValueType *writeBack = 0;
if (ep) {
writeBack = ep->valueTypes[core.propType];
} else {
- writeBack = QmlValueTypeFactory::valueType(core.propType);
+ writeBack = QDeclarativeValueTypeFactory::valueType(core.propType);
}
writeBack->read(object, core.coreIndex);
- QmlPropertyCache::Data data = core;
+ QDeclarativePropertyCache::Data data = core;
data.flags = valueType.flags;
data.coreIndex = valueType.valueTypeCoreIdx;
data.propType = valueType.valueTypePropType;
@@ -794,14 +794,14 @@ bool QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value,
return rv;
}
-bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data &property,
- const QVariant &value, QmlContext *context,
- QmlMetaProperty::WriteFlags flags)
+bool QDeclarativeMetaPropertyPrivate::write(QObject *object, const QDeclarativePropertyCache::Data &property,
+ const QVariant &value, QDeclarativeContext *context,
+ QDeclarativeMetaProperty::WriteFlags flags)
{
int coreIdx = property.coreIndex;
int status = -1; //for dbus
- if (property.flags & QmlPropertyCache::Data::IsEnumType) {
+ if (property.flags & QDeclarativePropertyCache::Data::IsEnumType) {
QMetaProperty prop = object->metaObject()->property(property.coreIndex);
QVariant v = value;
// Enum values come through the script engine as doubles
@@ -817,7 +817,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
int propertyType = property.propType;
int variantType = value.userType();
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(context);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(context);
if (propertyType == QVariant::Url) {
@@ -853,7 +853,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
void *a[] = { (void *)&value, 0, &status, &flags };
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
- } else if (property.flags & QmlPropertyCache::Data::IsQObjectDerived) {
+ } else if (property.flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
const QMetaObject *valMo = rawMetaObjectForType(enginePriv, value.userType());
@@ -880,19 +880,19 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
return false;
}
- } else if (property.flags & QmlPropertyCache::Data::IsQList) {
+ } else if (property.flags & QDeclarativePropertyCache::Data::IsQList) {
const QMetaObject *listType = 0;
if (enginePriv) {
listType = enginePriv->rawMetaObjectForType(enginePriv->listType(property.propType));
} else {
- QmlType *type = QmlMetaType::qmlType(QmlMetaType::listType(property.propType));
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(QDeclarativeMetaType::listType(property.propType));
if (!type) return false;
listType = type->baseMetaObject();
}
if (!listType) return false;
- QmlListProperty<void> prop;
+ QDeclarativeListProperty<void> prop;
void *args[] = { &prop, 0 };
QMetaObject::metacall(object, QMetaObject::ReadProperty, coreIdx, args);
@@ -910,7 +910,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
prop.append(&prop, (void *)o);
}
} else {
- QObject *o = enginePriv?enginePriv->toQObject(value):QmlMetaType::toQObject(value);
+ QObject *o = enginePriv?enginePriv->toQObject(value):QDeclarativeMetaType::toQObject(value);
if (!canConvert(o->metaObject(), listType))
o = 0;
prop.append(&prop, (void *)o);
@@ -924,7 +924,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
void *a[] = { (void *)v.constData(), 0, &status, &flags};
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
} else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) {
- QmlMetaType::StringConverter con = QmlMetaType::customStringConverter(propertyType);
+ QDeclarativeMetaType::StringConverter con = QDeclarativeMetaType::customStringConverter(propertyType);
if (!con)
return false;
@@ -935,7 +935,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
}
} else if (variantType == QVariant::String) {
bool ok = false;
- QVariant v = QmlStringConverters::variantFromString(value.toString(), propertyType, &ok);
+ QVariant v = QDeclarativeStringConverters::variantFromString(value.toString(), propertyType, &ok);
if (!ok)
return false;
@@ -949,12 +949,12 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
return true;
}
-const QMetaObject *QmlMetaPropertyPrivate::rawMetaObjectForType(QmlEnginePrivate *engine, int userType)
+const QMetaObject *QDeclarativeMetaPropertyPrivate::rawMetaObjectForType(QDeclarativeEnginePrivate *engine, int userType)
{
if (engine) {
return engine->rawMetaObjectForType(userType);
} else {
- QmlType *type = QmlMetaType::qmlType(userType);
+ QDeclarativeType *type = QDeclarativeMetaType::qmlType(userType);
return type?type->baseMetaObject():0;
}
}
@@ -962,7 +962,7 @@ const QMetaObject *QmlMetaPropertyPrivate::rawMetaObjectForType(QmlEnginePrivate
/*!
Set the property value to \a value.
*/
-bool QmlMetaProperty::write(const QVariant &value) const
+bool QDeclarativeMetaProperty::write(const QVariant &value) const
{
return write(value, 0);
}
@@ -970,7 +970,7 @@ bool QmlMetaProperty::write(const QVariant &value) const
/*!
Resets the property value.
*/
-bool QmlMetaProperty::reset() const
+bool QDeclarativeMetaProperty::reset() const
{
if (isResettable()) {
void *args[] = { 0 };
@@ -981,7 +981,7 @@ bool QmlMetaProperty::reset() const
}
}
-bool QmlMetaProperty::write(const QVariant &value, QmlMetaProperty::WriteFlags flags) const
+bool QDeclarativeMetaProperty::write(const QVariant &value, QDeclarativeMetaProperty::WriteFlags flags) const
{
if (d->object && type() & Property && d->core.isValid() && isWritable())
return d->writeValueProperty(value, flags);
@@ -992,7 +992,7 @@ bool QmlMetaProperty::write(const QVariant &value, QmlMetaProperty::WriteFlags f
/*!
Returns true if the property has a change notifier signal, otherwise false.
*/
-bool QmlMetaProperty::hasChangedNotifier() const
+bool QDeclarativeMetaProperty::hasChangedNotifier() const
{
if (type() & Property && !(type() & Attached) && d->object) {
return d->object->metaObject()->property(d->core.coreIndex).hasNotifySignal();
@@ -1007,7 +1007,7 @@ bool QmlMetaProperty::hasChangedNotifier() const
Some properties, such as attached properties or those whose value never
changes, do not require a change notifier.
*/
-bool QmlMetaProperty::needsChangedNotifier() const
+bool QDeclarativeMetaProperty::needsChangedNotifier() const
{
return type() & Property && !(type() & Attached) &&
!property().isConstant();
@@ -1021,7 +1021,7 @@ bool QmlMetaProperty::needsChangedNotifier() const
change notifier signal, or if the \a dest object does
not have the specified \a method.
*/
-bool QmlMetaProperty::connectNotifier(QObject *dest, int method) const
+bool QDeclarativeMetaProperty::connectNotifier(QObject *dest, int method) const
{
if (!(type() & Property) || (type() & Attached) || !d->object)
return false;
@@ -1042,7 +1042,7 @@ bool QmlMetaProperty::connectNotifier(QObject *dest, int method) const
change notifier signal, or if the \a dest object does
not have the specified \a slot.
*/
-bool QmlMetaProperty::connectNotifier(QObject *dest, const char *slot) const
+bool QDeclarativeMetaProperty::connectNotifier(QObject *dest, const char *slot) const
{
if (!(type() & Property) || (type() & Attached) || !d->object)
return false;
@@ -1059,39 +1059,39 @@ bool QmlMetaProperty::connectNotifier(QObject *dest, const char *slot) const
/*!
Return the Qt metaobject index of the property.
*/
-int QmlMetaProperty::coreIndex() const
+int QDeclarativeMetaProperty::coreIndex() const
{
return d->core.coreIndex;
}
/*! \internal */
-int QmlMetaProperty::valueTypeCoreIndex() const
+int QDeclarativeMetaProperty::valueTypeCoreIndex() const
{
return d->valueType.valueTypeCoreIdx;
}
-Q_GLOBAL_STATIC(QmlValueTypeFactory, qmlValueTypes);
+Q_GLOBAL_STATIC(QDeclarativeValueTypeFactory, qmlValueTypes);
struct SerializedData {
- QmlMetaProperty::Type type;
- QmlPropertyCache::Data core;
+ QDeclarativeMetaProperty::Type type;
+ QDeclarativePropertyCache::Data core;
};
struct ValueTypeSerializedData : public SerializedData {
- QmlPropertyCache::ValueTypeData valueType;
+ QDeclarativePropertyCache::ValueTypeData valueType;
};
-QByteArray QmlMetaPropertyPrivate::saveValueType(const QMetaObject *metaObject, int index,
+QByteArray QDeclarativeMetaPropertyPrivate::saveValueType(const QMetaObject *metaObject, int index,
const QMetaObject *subObject, int subIndex)
{
QMetaProperty prop = metaObject->property(index);
QMetaProperty subProp = subObject->property(subIndex);
ValueTypeSerializedData sd;
- sd.type = QmlMetaProperty::ValueTypeProperty;
+ sd.type = QDeclarativeMetaProperty::ValueTypeProperty;
sd.core.load(metaObject->property(index));
- sd.valueType.flags = QmlPropertyCache::Data::flagsForProperty(subProp);
+ sd.valueType.flags = QDeclarativePropertyCache::Data::flagsForProperty(subProp);
sd.valueType.valueTypeCoreIdx = subIndex;
sd.valueType.valueTypePropType = subProp.userType();
@@ -1100,20 +1100,20 @@ QByteArray QmlMetaPropertyPrivate::saveValueType(const QMetaObject *metaObject,
return rv;
}
-QByteArray QmlMetaPropertyPrivate::saveProperty(const QMetaObject *metaObject, int index)
+QByteArray QDeclarativeMetaPropertyPrivate::saveProperty(const QMetaObject *metaObject, int index)
{
SerializedData sd;
- sd.type = QmlMetaProperty::Property;
+ sd.type = QDeclarativeMetaProperty::Property;
sd.core.load(metaObject->property(index));
QByteArray rv((const char *)&sd, sizeof(sd));
return rv;
}
-QmlMetaProperty
-QmlMetaPropertyPrivate::restore(const QByteArray &data, QObject *object, QmlContext *ctxt)
+QDeclarativeMetaProperty
+QDeclarativeMetaPropertyPrivate::restore(const QByteArray &data, QObject *object, QDeclarativeContext *ctxt)
{
- QmlMetaProperty prop;
+ QDeclarativeMetaProperty prop;
if (data.isEmpty())
return prop;
@@ -1122,9 +1122,9 @@ QmlMetaPropertyPrivate::restore(const QByteArray &data, QObject *object, QmlCont
prop.d->context = ctxt;
const SerializedData *sd = (const SerializedData *)data.constData();
- if (sd->type == QmlMetaProperty::Property) {
+ if (sd->type == QDeclarativeMetaProperty::Property) {
prop.d->core = sd->core;
- } else if(sd->type == QmlMetaProperty::ValueTypeProperty) {
+ } else if(sd->type == QDeclarativeMetaProperty::ValueTypeProperty) {
const ValueTypeSerializedData *vt = (const ValueTypeSerializedData *)sd;
prop.d->core = vt->core;
prop.d->valueType = vt->valueType;
@@ -1136,15 +1136,15 @@ QmlMetaPropertyPrivate::restore(const QByteArray &data, QObject *object, QmlCont
/*!
\internal
- Creates a QmlMetaProperty for the property \a name of \a obj. Unlike
- the QmlMetaProperty(QObject*, QString, QmlContext*) constructor, this static function
+ Creates a QDeclarativeMetaProperty for the property \a name of \a obj. Unlike
+ the QDeclarativeMetaProperty(QObject*, QString, QDeclarativeContext*) constructor, this static function
will correctly handle dot properties, including value types and attached properties.
*/
-QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
+QDeclarativeMetaProperty QDeclarativeMetaProperty::createProperty(QObject *obj,
const QString &name,
- QmlContext *context)
+ QDeclarativeContext *context)
{
- QmlTypeNameCache *typeNameCache = context?QmlContextPrivate::get(context)->imports:0;
+ QDeclarativeTypeNameCache *typeNameCache = context?QDeclarativeContextPrivate::get(context)->imports:0;
QStringList path = name.split(QLatin1Char('.'));
QObject *object = obj;
@@ -1152,32 +1152,32 @@ QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
for (int jj = 0; jj < path.count() - 1; ++jj) {
const QString &pathName = path.at(jj);
- if (QmlTypeNameCache::Data *data = typeNameCache?typeNameCache->data(pathName):0) {
+ if (QDeclarativeTypeNameCache::Data *data = typeNameCache?typeNameCache->data(pathName):0) {
if (data->type) {
- QmlAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
+ QDeclarativeAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
if (!func)
- return QmlMetaProperty();
+ return QDeclarativeMetaProperty();
object = qmlAttachedPropertiesObjectById(data->type->index(), object);
if (!object)
- return QmlMetaProperty();
+ return QDeclarativeMetaProperty();
continue;
} else {
Q_ASSERT(data->typeNamespace);
++jj;
data = data->typeNamespace->data(path.at(jj));
if (!data || !data->type)
- return QmlMetaProperty();
- QmlAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
+ return QDeclarativeMetaProperty();
+ QDeclarativeAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
if (!func)
- return QmlMetaProperty();
+ return QDeclarativeMetaProperty();
object = qmlAttachedPropertiesObjectById(data->type->index(), object);
if (!object)
- return QmlMetaProperty();
+ return QDeclarativeMetaProperty();
continue;
}
}
- QmlMetaProperty prop(object, pathName, context);
+ QDeclarativeMetaProperty prop(object, pathName, context);
if (jj == path.count() - 2 && prop.propertyType() < (int)QVariant::UserType &&
qmlValueTypes()->valueTypes[prop.propertyType()]) {
@@ -1187,25 +1187,25 @@ QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
qmlValueTypes()->valueTypes[prop.propertyType()];
int idx = typeObject->metaObject()->indexOfProperty(path.last().toUtf8().constData());
if (idx == -1)
- return QmlMetaProperty();
+ return QDeclarativeMetaProperty();
QMetaProperty vtProp = typeObject->metaObject()->property(idx);
- QmlMetaProperty p = prop;
+ QDeclarativeMetaProperty p = prop;
p.d->valueType.valueTypeCoreIdx = idx;
p.d->valueType.valueTypePropType = vtProp.userType();
return p;
}
- QObject *objVal = QmlMetaType::toQObject(prop.read());
+ QObject *objVal = QDeclarativeMetaType::toQObject(prop.read());
if (!objVal)
- return QmlMetaProperty();
+ return QDeclarativeMetaProperty();
object = objVal;
}
const QString &propName = path.last();
- QmlMetaProperty prop(object, propName, context);
+ QDeclarativeMetaProperty prop(object, propName, context);
if (!prop.isValid())
- return QmlMetaProperty();
+ return QDeclarativeMetaProperty();
else
return prop;
}
@@ -1213,7 +1213,7 @@ QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
/*!
Returns true if lhs and rhs refer to the same metaobject data
*/
-bool QmlMetaPropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs)
+bool QDeclarativeMetaPropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs)
{
return lhs == rhs || (1 && lhs && rhs && lhs->d.stringdata == rhs->d.stringdata);
}
@@ -1221,7 +1221,7 @@ bool QmlMetaPropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rh
/*!
Returns true if from inherits to.
*/
-bool QmlMetaPropertyPrivate::canConvert(const QMetaObject *from, const QMetaObject *to)
+bool QDeclarativeMetaPropertyPrivate::canConvert(const QMetaObject *from, const QMetaObject *to)
{
if (from && to == &QObject::staticMetaObject)
return true;
diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qdeclarativemetaproperty.h
index 82266c8..4dd6668 100644
--- a/src/declarative/qml/qmlmetaproperty.h
+++ b/src/declarative/qml/qdeclarativemetaproperty.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLMETAPROPERTY_H
-#define QMLMETAPROPERTY_H
+#ifndef QDECLARATIVEMETAPROPERTY_H
+#define QDECLARATIVEMETAPROPERTY_H
#include <QtCore/qmetaobject.h>
@@ -51,16 +51,16 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QObject;
-class QmlAbstractBinding;
-class QmlExpression;
+class QDeclarativeAbstractBinding;
+class QDeclarativeExpression;
class QStringList;
class QVariant;
struct QMetaObject;
-class QmlContext;
-class QmlEngine;
+class QDeclarativeContext;
+class QDeclarativeEngine;
-class QmlMetaPropertyPrivate;
-class Q_DECLARATIVE_EXPORT QmlMetaProperty
+class QDeclarativeMetaPropertyPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeMetaProperty
{
public:
enum PropertyCategory {
@@ -71,14 +71,14 @@ public:
Object,
Normal
};
- QmlMetaProperty();
- QmlMetaProperty(QObject *);
- QmlMetaProperty(QObject *, const QString &);
- QmlMetaProperty(QObject *, QmlContext *);
- QmlMetaProperty(QObject *, const QString &, QmlContext *);
- QmlMetaProperty(const QmlMetaProperty &);
- QmlMetaProperty &operator=(const QmlMetaProperty &);
- ~QmlMetaProperty();
+ QDeclarativeMetaProperty();
+ QDeclarativeMetaProperty(QObject *);
+ QDeclarativeMetaProperty(QObject *, const QString &);
+ QDeclarativeMetaProperty(QObject *, QDeclarativeContext *);
+ QDeclarativeMetaProperty(QObject *, const QString &, QDeclarativeContext *);
+ QDeclarativeMetaProperty(const QDeclarativeMetaProperty &);
+ QDeclarativeMetaProperty &operator=(const QDeclarativeMetaProperty &);
+ ~QDeclarativeMetaProperty();
QString name() const;
@@ -86,7 +86,7 @@ public:
bool write(const QVariant &) const;
enum WriteFlag { BypassInterceptor = 0x01, DontRemoveBinding = 0x02 };
Q_DECLARE_FLAGS(WriteFlags, WriteFlag)
- bool write(const QVariant &, QmlMetaProperty::WriteFlags) const;
+ bool write(const QVariant &, QDeclarativeMetaProperty::WriteFlags) const;
bool reset() const;
bool hasChangedNotifier() const;
@@ -117,31 +117,31 @@ public:
int propertyType() const;
const char *propertyTypeName() const;
- bool operator==(const QmlMetaProperty &) const;
+ bool operator==(const QDeclarativeMetaProperty &) const;
QMetaProperty property() const;
- QmlAbstractBinding *binding() const;
- QmlAbstractBinding *setBinding(QmlAbstractBinding *,
- QmlMetaProperty::WriteFlags flags = QmlMetaProperty::DontRemoveBinding) const;
+ QDeclarativeAbstractBinding *binding() const;
+ QDeclarativeAbstractBinding *setBinding(QDeclarativeAbstractBinding *,
+ QDeclarativeMetaProperty::WriteFlags flags = QDeclarativeMetaProperty::DontRemoveBinding) const;
- QmlExpression *signalExpression() const;
- QmlExpression *setSignalExpression(QmlExpression *) const;
+ QDeclarativeExpression *signalExpression() const;
+ QDeclarativeExpression *setSignalExpression(QDeclarativeExpression *) const;
- static QmlMetaProperty createProperty(QObject *, const QString &, QmlContext *context=0);
+ static QDeclarativeMetaProperty createProperty(QObject *, const QString &, QDeclarativeContext *context=0);
int coreIndex() const;
int valueTypeCoreIndex() const;
private:
- friend class QmlEnginePrivate;
- friend class QmlMetaPropertyPrivate;
- QmlMetaPropertyPrivate *d;
+ friend class QDeclarativeEnginePrivate;
+ friend class QDeclarativeMetaPropertyPrivate;
+ QDeclarativeMetaPropertyPrivate *d;
};
-typedef QList<QmlMetaProperty> QmlMetaProperties;
- Q_DECLARE_OPERATORS_FOR_FLAGS(QmlMetaProperty::WriteFlags)
+typedef QList<QDeclarativeMetaProperty> QDeclarativeMetaProperties;
+ Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeMetaProperty::WriteFlags)
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLMETAPROPERTY_H
+#endif // QDECLARATIVEMETAPROPERTY_H
diff --git a/src/declarative/qml/qmlmetaproperty_p.h b/src/declarative/qml/qdeclarativemetaproperty_p.h
index 9236bd3..9fd5ed2 100644
--- a/src/declarative/qml/qmlmetaproperty_p.h
+++ b/src/declarative/qml/qdeclarativemetaproperty_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLMETAPROPERTY_P_H
-#define QMLMETAPROPERTY_P_H
+#ifndef QDECLARATIVEMETAPROPERTY_P_H
+#define QDECLARATIVEMETAPROPERTY_P_H
//
// W A R N I N G
@@ -53,41 +53,41 @@
// We mean it.
//
-#include "qmlmetaproperty.h"
+#include "qdeclarativemetaproperty.h"
-#include "qmlpropertycache_p.h"
-#include "qmlguard_p.h"
+#include "qdeclarativepropertycache_p.h"
+#include "qdeclarativeguard_p.h"
#include <private/qobject_p.h>
QT_BEGIN_NAMESPACE
-class QmlContext;
-class QmlEnginePrivate;
-class QmlMetaPropertyPrivate
+class QDeclarativeContext;
+class QDeclarativeEnginePrivate;
+class QDeclarativeMetaPropertyPrivate
{
public:
- QmlMetaPropertyPrivate()
+ QDeclarativeMetaPropertyPrivate()
: q(0), context(0), object(0), isDefaultProperty(false), isNameCached(false),
attachedFunc(-1) {}
- QmlMetaPropertyPrivate(const QmlMetaPropertyPrivate &other)
+ QDeclarativeMetaPropertyPrivate(const QDeclarativeMetaPropertyPrivate &other)
: q(0), context(other.context), object(other.object),
isDefaultProperty(other.isDefaultProperty), isNameCached(other.isNameCached),
core(other.core), nameCache(other.nameCache),
valueType(other.valueType), attachedFunc(other.attachedFunc) {}
- QmlMetaProperty *q;
- QmlContext *context;
- QmlGuard<QObject> object;
+ QDeclarativeMetaProperty *q;
+ QDeclarativeContext *context;
+ QDeclarativeGuard<QObject> object;
bool isDefaultProperty:1;
bool isNameCached:1;
- QmlPropertyCache::Data core;
+ QDeclarativePropertyCache::Data core;
QString nameCache;
// Describes the "virtual" value-type sub-property.
- QmlPropertyCache::ValueTypeData valueType;
+ QDeclarativePropertyCache::ValueTypeData valueType;
// The attached property accessor
int attachedFunc;
@@ -99,22 +99,22 @@ public:
QMetaMethod findSignal(QObject *, const QString &);
int propertyType() const;
- QmlMetaProperty::PropertyCategory propertyCategory() const;
+ QDeclarativeMetaProperty::PropertyCategory propertyCategory() const;
QVariant readValueProperty();
- bool writeValueProperty(const QVariant &, QmlMetaProperty::WriteFlags);
+ bool writeValueProperty(const QVariant &, QDeclarativeMetaProperty::WriteFlags);
- static const QMetaObject *rawMetaObjectForType(QmlEnginePrivate *, int);
+ static const QMetaObject *rawMetaObjectForType(QDeclarativeEnginePrivate *, int);
static bool writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags);
- static bool write(QObject *, const QmlPropertyCache::Data &, const QVariant &, QmlContext *,
- QmlMetaProperty::WriteFlags flags = 0);
- static QmlAbstractBinding *setBinding(QObject *, const QmlPropertyCache::Data &, QmlAbstractBinding *,
- QmlMetaProperty::WriteFlags flags = QmlMetaProperty::DontRemoveBinding);
+ static bool write(QObject *, const QDeclarativePropertyCache::Data &, const QVariant &, QDeclarativeContext *,
+ QDeclarativeMetaProperty::WriteFlags flags = 0);
+ static QDeclarativeAbstractBinding *setBinding(QObject *, const QDeclarativePropertyCache::Data &, QDeclarativeAbstractBinding *,
+ QDeclarativeMetaProperty::WriteFlags flags = QDeclarativeMetaProperty::DontRemoveBinding);
static QByteArray saveValueType(const QMetaObject *, int,
const QMetaObject *, int);
static QByteArray saveProperty(const QMetaObject *, int);
- static QmlMetaProperty restore(const QByteArray &, QObject *, QmlContext * = 0);
+ static QDeclarativeMetaProperty restore(const QByteArray &, QObject *, QDeclarativeContext * = 0);
static bool equal(const QMetaObject *, const QMetaObject *);
static bool canConvert(const QMetaObject *from, const QMetaObject *to);
@@ -122,4 +122,4 @@ public:
QT_END_NAMESPACE
-#endif // QMLMETAPROPERTY_P_H
+#endif // QDECLARATIVEMETAPROPERTY_P_H
diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 6db70d4..8f78843 100644
--- a/src/declarative/qml/qmlmetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#include "qmlmetatype.h"
+#include "qdeclarativemetatype.h"
-#include "qmlproxymetaobject_p.h"
-#include "qmlcustomparser_p.h"
-#include "qmlguard_p.h"
+#include "qdeclarativeproxymetaobject_p.h"
+#include "qdeclarativecustomparser_p.h"
+#include "qdeclarativeguard_p.h"
#include <QtCore/qdebug.h>
#include <QtCore/qstringlist.h>
@@ -85,36 +85,36 @@
QT_BEGIN_NAMESPACE
-struct QmlMetaTypeData
+struct QDeclarativeMetaTypeData
{
- ~QmlMetaTypeData();
- QList<QmlType *> types;
- typedef QHash<int, QmlType *> Ids;
+ ~QDeclarativeMetaTypeData();
+ QList<QDeclarativeType *> types;
+ typedef QHash<int, QDeclarativeType *> Ids;
Ids idToType;
- typedef QHash<QByteArray, QmlType *> Names;
+ typedef QHash<QByteArray, QDeclarativeType *> Names;
Names nameToType;
- typedef QHash<const QMetaObject *, QmlType *> MetaObjects;
+ typedef QHash<const QMetaObject *, QDeclarativeType *> MetaObjects;
MetaObjects metaObjectToType;
- typedef QHash<int, QmlMetaType::StringConverter> StringConverters;
+ typedef QHash<int, QDeclarativeMetaType::StringConverter> StringConverters;
StringConverters stringConverters;
QBitArray objects;
QBitArray interfaces;
QBitArray lists;
};
-Q_GLOBAL_STATIC(QmlMetaTypeData, metaTypeData)
+Q_GLOBAL_STATIC(QDeclarativeMetaTypeData, metaTypeData)
Q_GLOBAL_STATIC(QReadWriteLock, metaTypeDataLock)
-QmlMetaTypeData::~QmlMetaTypeData()
+QDeclarativeMetaTypeData::~QDeclarativeMetaTypeData()
{
for (int i = 0; i < types.count(); ++i)
delete types.at(i);
}
-class QmlTypePrivate
+class QDeclarativeTypePrivate
{
public:
- QmlTypePrivate();
+ QDeclarativeTypePrivate();
void init() const;
@@ -126,20 +126,20 @@ public:
int m_typeId; int m_listId;
QObject *(*m_newFunc)();
const QMetaObject *m_baseMetaObject;
- QmlAttachedPropertiesFunc m_attachedPropertiesFunc;
+ QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc;
const QMetaObject *m_attachedPropertiesType;
int m_parserStatusCast;
int m_propertyValueSourceCast;
int m_propertyValueInterceptorCast;
- QmlPrivate::CreateFunc m_extFunc;
+ QDeclarativePrivate::CreateFunc m_extFunc;
const QMetaObject *m_extMetaObject;
int m_index;
- QmlCustomParser *m_customParser;
+ QDeclarativeCustomParser *m_customParser;
mutable volatile bool m_isSetup:1;
- mutable QList<QmlProxyMetaObject::ProxyData> m_metaObjects;
+ mutable QList<QDeclarativeProxyMetaObject::ProxyData> m_metaObjects;
};
-QmlTypePrivate::QmlTypePrivate()
+QDeclarativeTypePrivate::QDeclarativeTypePrivate()
: m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0),
m_newFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), m_attachedPropertiesType(0),
m_parserStatusCast(-1), m_propertyValueSourceCast(-1), m_propertyValueInterceptorCast(-1),
@@ -148,8 +148,8 @@ QmlTypePrivate::QmlTypePrivate()
}
-QmlType::QmlType(int type, int listType, const char *iid, int index)
-: d(new QmlTypePrivate)
+QDeclarativeType::QDeclarativeType(int type, int listType, const char *iid, int index)
+: d(new QDeclarativeTypePrivate)
{
d->m_isInterface = true;
d->m_iid = iid;
@@ -162,17 +162,17 @@ QmlType::QmlType(int type, int listType, const char *iid, int index)
d->m_version_min = 0;
}
-QmlType::QmlType(int type, int listType,
+QDeclarativeType::QDeclarativeType(int type, int listType,
QObject *(*newFunc)(), const char *qmlName,
int version_maj, int version_min,
const QMetaObject *metaObject,
- QmlAttachedPropertiesFunc attachedPropertiesFunc,
+ QDeclarativeAttachedPropertiesFunc attachedPropertiesFunc,
const QMetaObject *attachedType,
int parserStatusCast, int propertyValueSourceCast, int propertyValueInterceptorCast,
- QmlPrivate::CreateFunc extFunc,
+ QDeclarativePrivate::CreateFunc extFunc,
const QMetaObject *extMetaObject, int index,
- QmlCustomParser *customParser)
-: d(new QmlTypePrivate)
+ QDeclarativeCustomParser *customParser)
+: d(new QDeclarativeTypePrivate)
{
d->m_name = qmlName;
d->m_version_maj = version_maj;
@@ -194,28 +194,28 @@ QmlType::QmlType(int type, int listType,
d->m_extMetaObject = extMetaObject;
}
-QmlType::~QmlType()
+QDeclarativeType::~QDeclarativeType()
{
delete d->m_customParser;
delete d;
}
-int QmlType::majorVersion() const
+int QDeclarativeType::majorVersion() const
{
return d->m_version_maj;
}
-int QmlType::minorVersion() const
+int QDeclarativeType::minorVersion() const
{
return d->m_version_min;
}
-bool QmlType::availableInVersion(int vmajor, int vminor) const
+bool QDeclarativeType::availableInVersion(int vmajor, int vminor) const
{
return vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min);
}
-void QmlTypePrivate::init() const
+void QDeclarativeTypePrivate::init() const
{
if (m_isSetup) return;
@@ -230,13 +230,13 @@ void QmlTypePrivate::init() const
QMetaObject *mmo = new QMetaObject;
*mmo = *m_extMetaObject;
mmo->d.superdata = mo;
- QmlProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0, 0 };
+ QDeclarativeProxyMetaObject::ProxyData data = { mmo, m_extFunc, 0, 0 };
m_metaObjects << data;
}
mo = mo->d.superdata;
while(mo) {
- QmlType *t = metaTypeData()->metaObjectToType.value(mo);
+ QDeclarativeType *t = metaTypeData()->metaObjectToType.value(mo);
if (t) {
if (t->d->m_extFunc) {
QMetaObject *mmo = new QMetaObject;
@@ -244,7 +244,7 @@ void QmlTypePrivate::init() const
mmo->d.superdata = m_baseMetaObject;
if (!m_metaObjects.isEmpty())
m_metaObjects.last().metaObject->d.superdata = mmo;
- QmlProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0, 0 };
+ QDeclarativeProxyMetaObject::ProxyData data = { mmo, t->d->m_extFunc, 0, 0 };
m_metaObjects << data;
}
}
@@ -262,7 +262,7 @@ void QmlTypePrivate::init() const
lock.unlock();
}
-QByteArray QmlType::typeName() const
+QByteArray QDeclarativeType::typeName() const
{
if (d->m_baseMetaObject)
return d->m_baseMetaObject->className();
@@ -270,43 +270,43 @@ QByteArray QmlType::typeName() const
return QByteArray();
}
-QByteArray QmlType::qmlTypeName() const
+QByteArray QDeclarativeType::qmlTypeName() const
{
return d->m_name;
}
-QObject *QmlType::create() const
+QObject *QDeclarativeType::create() const
{
d->init();
QObject *rv = d->m_newFunc();
if (rv && !d->m_metaObjects.isEmpty())
- (void *)new QmlProxyMetaObject(rv, &d->m_metaObjects);
+ (void *)new QDeclarativeProxyMetaObject(rv, &d->m_metaObjects);
return rv;
}
-QmlCustomParser *QmlType::customParser() const
+QDeclarativeCustomParser *QDeclarativeType::customParser() const
{
return d->m_customParser;
}
-bool QmlType::isInterface() const
+bool QDeclarativeType::isInterface() const
{
return d->m_isInterface;
}
-int QmlType::typeId() const
+int QDeclarativeType::typeId() const
{
return d->m_typeId;
}
-int QmlType::qListTypeId() const
+int QDeclarativeType::qListTypeId() const
{
return d->m_listId;
}
-const QMetaObject *QmlType::metaObject() const
+const QMetaObject *QDeclarativeType::metaObject() const
{
d->init();
@@ -317,55 +317,55 @@ const QMetaObject *QmlType::metaObject() const
}
-const QMetaObject *QmlType::baseMetaObject() const
+const QMetaObject *QDeclarativeType::baseMetaObject() const
{
return d->m_baseMetaObject;
}
-QmlAttachedPropertiesFunc QmlType::attachedPropertiesFunction() const
+QDeclarativeAttachedPropertiesFunc QDeclarativeType::attachedPropertiesFunction() const
{
return d->m_attachedPropertiesFunc;
}
-const QMetaObject *QmlType::attachedPropertiesType() const
+const QMetaObject *QDeclarativeType::attachedPropertiesType() const
{
return d->m_attachedPropertiesType;
}
-int QmlType::parserStatusCast() const
+int QDeclarativeType::parserStatusCast() const
{
return d->m_parserStatusCast;
}
-int QmlType::propertyValueSourceCast() const
+int QDeclarativeType::propertyValueSourceCast() const
{
return d->m_propertyValueSourceCast;
}
-int QmlType::propertyValueInterceptorCast() const
+int QDeclarativeType::propertyValueInterceptorCast() const
{
return d->m_propertyValueInterceptorCast;
}
-const char *QmlType::interfaceIId() const
+const char *QDeclarativeType::interfaceIId() const
{
return d->m_iid;
}
-int QmlType::index() const
+int QDeclarativeType::index() const
{
return d->m_index;
}
-int QmlMetaType::registerInterface(const QmlPrivate::MetaTypeIds &id,
+int QDeclarativeMetaType::registerInterface(const QDeclarativePrivate::MetaTypeIds &id,
const char *iid)
{
QWriteLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
int index = data->types.count();
- QmlType *type = new QmlType(id.typeId, id.listId, iid, index);
+ QDeclarativeType *type = new QDeclarativeType(id.typeId, id.listId, iid, index);
data->types.append(type);
data->idToType.insert(type->typeId(), type);
@@ -384,24 +384,24 @@ int QmlMetaType::registerInterface(const QmlPrivate::MetaTypeIds &id,
return index;
}
-int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QObject *(*func)(),
+int QDeclarativeMetaType::registerType(const QDeclarativePrivate::MetaTypeIds &id, QObject *(*func)(),
const char *uri, int version_maj, int version_min, const char *cname,
- const QMetaObject *mo, QmlAttachedPropertiesFunc attach, const QMetaObject *attachMo,
- int pStatus, int object, int valueSource, int valueInterceptor, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *parser)
+ const QMetaObject *mo, QDeclarativeAttachedPropertiesFunc attach, const QMetaObject *attachMo,
+ int pStatus, int object, int valueSource, int valueInterceptor, QDeclarativePrivate::CreateFunc extFunc, const QMetaObject *extmo, QDeclarativeCustomParser *parser)
{
Q_UNUSED(object);
if (cname) {
for (int ii = 0; cname[ii]; ++ii) {
if (!isalnum(cname[ii])) {
- qWarning("QmlMetaType: Invalid QML name %s", cname);
+ qWarning("QDeclarativeMetaType: Invalid QML name %s", cname);
return -1;
}
}
}
QWriteLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
int index = data->types.count();
QByteArray name = uri;
@@ -409,7 +409,7 @@ int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QObject *(*func
name += '/';
name += cname;
- QmlType *type = new QmlType(id.typeId, id.listId,
+ QDeclarativeType *type = new QDeclarativeType(id.typeId, id.listId,
func, name, version_maj, version_min, mo, attach, attachMo, pStatus,
valueSource, valueInterceptor, extFunc, extmo, index, parser);
@@ -432,7 +432,7 @@ int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QObject *(*func
return index;
}
-QObject *QmlMetaType::toQObject(const QVariant &v, bool *ok)
+QObject *QDeclarativeMetaType::toQObject(const QVariant &v, bool *ok)
{
if (!isQObject(v.userType())) {
if (ok) *ok = false;
@@ -444,52 +444,52 @@ QObject *QmlMetaType::toQObject(const QVariant &v, bool *ok)
return *(QObject **)v.constData();
}
-bool QmlMetaType::isQObject(int userType)
+bool QDeclarativeMetaType::isQObject(int userType)
{
if (userType == QMetaType::QObjectStar)
return true;
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return userType >= 0 && userType < data->objects.size() && data->objects.testBit(userType);
}
/*
Returns the item type for a list of type \a id.
*/
-int QmlMetaType::listType(int id)
+int QDeclarativeMetaType::listType(int id)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
- QmlType *type = data->idToType.value(id);
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ QDeclarativeType *type = data->idToType.value(id);
if (type && type->qListTypeId() == id)
return type->typeId();
else
return 0;
}
-int QmlMetaType::attachedPropertiesFuncId(const QMetaObject *mo)
+int QDeclarativeMetaType::attachedPropertiesFuncId(const QMetaObject *mo)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
- QmlType *type = data->metaObjectToType.value(mo);
+ QDeclarativeType *type = data->metaObjectToType.value(mo);
if (type && type->attachedPropertiesFunction())
return type->index();
else
return -1;
}
-QmlAttachedPropertiesFunc QmlMetaType::attachedPropertiesFuncById(int id)
+QDeclarativeAttachedPropertiesFunc QDeclarativeMetaType::attachedPropertiesFuncById(int id)
{
if (id < 0)
return 0;
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return data->types.at(id)->attachedPropertiesFunction();
}
-QMetaProperty QmlMetaType::defaultProperty(const QMetaObject *metaObject)
+QMetaProperty QDeclarativeMetaType::defaultProperty(const QMetaObject *metaObject)
{
int idx = metaObject->indexOfClassInfo("DefaultProperty");
if (-1 == idx)
@@ -506,7 +506,7 @@ QMetaProperty QmlMetaType::defaultProperty(const QMetaObject *metaObject)
return metaObject->property(idx);
}
-QMetaProperty QmlMetaType::defaultProperty(QObject *obj)
+QMetaProperty QDeclarativeMetaType::defaultProperty(QObject *obj)
{
if (!obj)
return QMetaProperty();
@@ -515,7 +515,7 @@ QMetaProperty QmlMetaType::defaultProperty(QObject *obj)
return defaultProperty(metaObject);
}
-QMetaMethod QmlMetaType::defaultMethod(const QMetaObject *metaObject)
+QMetaMethod QDeclarativeMetaType::defaultMethod(const QMetaObject *metaObject)
{
int idx = metaObject->indexOfClassInfo("DefaultMethod");
if (-1 == idx)
@@ -532,7 +532,7 @@ QMetaMethod QmlMetaType::defaultMethod(const QMetaObject *metaObject)
return metaObject->method(idx);
}
-QMetaMethod QmlMetaType::defaultMethod(QObject *obj)
+QMetaMethod QDeclarativeMetaType::defaultMethod(QObject *obj)
{
if (!obj)
return QMetaMethod();
@@ -541,7 +541,7 @@ QMetaMethod QmlMetaType::defaultMethod(QObject *obj)
return defaultMethod(metaObject);
}
-QmlMetaType::TypeCategory QmlMetaType::typeCategory(int userType)
+QDeclarativeMetaType::TypeCategory QDeclarativeMetaType::typeCategory(int userType)
{
if (userType < 0)
return Unknown;
@@ -549,7 +549,7 @@ QmlMetaType::TypeCategory QmlMetaType::typeCategory(int userType)
return Object;
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
if (userType < data->objects.size() && data->objects.testBit(userType))
return Object;
else if (userType < data->lists.size() && data->lists.testBit(userType))
@@ -558,18 +558,18 @@ QmlMetaType::TypeCategory QmlMetaType::typeCategory(int userType)
return Unknown;
}
-bool QmlMetaType::isInterface(int userType)
+bool QDeclarativeMetaType::isInterface(int userType)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return userType >= 0 && userType < data->interfaces.size() && data->interfaces.testBit(userType);
}
-const char *QmlMetaType::interfaceIId(int userType)
+const char *QDeclarativeMetaType::interfaceIId(int userType)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
- QmlType *type = data->idToType.value(userType);
+ QDeclarativeMetaTypeData *data = metaTypeData();
+ QDeclarativeType *type = data->idToType.value(userType);
lock.unlock();
if (type && type->isInterface() && type->typeId() == userType)
return type->interfaceIId();
@@ -577,10 +577,10 @@ const char *QmlMetaType::interfaceIId(int userType)
return 0;
}
-bool QmlMetaType::isList(int userType)
+bool QDeclarativeMetaType::isList(int userType)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return userType >= 0 && userType < data->lists.size() && data->lists.testBit(userType);
}
@@ -599,11 +599,11 @@ bool QmlMetaType::isList(int userType)
QVariant (*StringConverter)(const QString &);
\endcode
*/
-void QmlMetaType::registerCustomStringConverter(int type, StringConverter converter)
+void QDeclarativeMetaType::registerCustomStringConverter(int type, StringConverter converter)
{
QWriteLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
if (data->stringConverters.contains(type))
return;
data->stringConverters.insert(type, converter);
@@ -613,11 +613,11 @@ void QmlMetaType::registerCustomStringConverter(int type, StringConverter conver
Return the custom string converter for \a type, previously installed through
registerCustomStringConverter()
*/
-QmlMetaType::StringConverter QmlMetaType::customStringConverter(int type)
+QDeclarativeMetaType::StringConverter QDeclarativeMetaType::customStringConverter(int type)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return data->stringConverters.value(type);
}
@@ -625,14 +625,14 @@ QmlMetaType::StringConverter QmlMetaType::customStringConverter(int type)
Returns the type (if any) of URI-qualified named \a name in version specified
by \a version_major and \a version_minor.
*/
-QmlType *QmlMetaType::qmlType(const QByteArray &name, int version_major, int version_minor)
+QDeclarativeType *QDeclarativeMetaType::qmlType(const QByteArray &name, int version_major, int version_minor)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
- QList<QmlType*> types = data->nameToType.values(name);
- foreach (QmlType *t, types) {
- // XXX version_major<0 just a kludge for QmlMetaPropertyPrivate::initProperty
+ QList<QDeclarativeType*> types = data->nameToType.values(name);
+ foreach (QDeclarativeType *t, types) {
+ // XXX version_major<0 just a kludge for QDeclarativeMetaPropertyPrivate::initProperty
if (version_major<0 || t->availableInVersion(version_major,version_minor))
return t;
}
@@ -643,10 +643,10 @@ QmlType *QmlMetaType::qmlType(const QByteArray &name, int version_major, int ver
Returns the type (if any) that corresponds to the \a metaObject. Returns null if no
type is registered.
*/
-QmlType *QmlMetaType::qmlType(const QMetaObject *metaObject)
+QDeclarativeType *QDeclarativeMetaType::qmlType(const QMetaObject *metaObject)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return data->metaObjectToType.value(metaObject);
}
@@ -655,12 +655,12 @@ QmlType *QmlMetaType::qmlType(const QMetaObject *metaObject)
Returns the type (if any) that corresponds to the QVariant::Type \a userType.
Returns null if no type is registered.
*/
-QmlType *QmlMetaType::qmlType(int userType)
+QDeclarativeType *QDeclarativeMetaType::qmlType(int userType)
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
- QmlType *type = data->idToType.value(userType);
+ QDeclarativeType *type = data->idToType.value(userType);
if (type && type->typeId() == userType)
return type;
else
@@ -670,10 +670,10 @@ QmlType *QmlMetaType::qmlType(int userType)
/*!
Returns the list of registered QML type names.
*/
-QList<QByteArray> QmlMetaType::qmlTypeNames()
+QList<QByteArray> QDeclarativeMetaType::qmlTypeNames()
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return data->nameToType.keys();
}
@@ -681,10 +681,10 @@ QList<QByteArray> QmlMetaType::qmlTypeNames()
/*!
Returns the list of registered QML types.
*/
-QList<QmlType*> QmlMetaType::qmlTypes()
+QList<QDeclarativeType*> QDeclarativeMetaType::qmlTypes()
{
QReadLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
+ QDeclarativeMetaTypeData *data = metaTypeData();
return data->nameToType.values();
}
@@ -727,7 +727,7 @@ QT_BEGIN_NAMESPACE
\note This should move into QMetaType once complete
*/
-bool QmlMetaType::copy(int type, void *data, const void *copy)
+bool QDeclarativeMetaType::copy(int type, void *data, const void *copy)
{
if (copy) {
switch(type) {
diff --git a/src/declarative/qml/qdeclarativemetatype.h b/src/declarative/qml/qdeclarativemetatype.h
new file mode 100644
index 0000000..0634939
--- /dev/null
+++ b/src/declarative/qml/qdeclarativemetatype.h
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** 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 "qdeclarativeparserstatus.h"
+#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativepropertyvalueinterceptor.h"
+#include "qdeclarativelist.h"
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qbitarray.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QDeclarativeType;
+class QDeclarativeCustomParser;
+class Q_DECLARATIVE_EXPORT QDeclarativeMetaType
+{
+public:
+ static int registerType(const QDeclarativePrivate::MetaTypeIds &, QObject *(*)(), const char *, int vmaj, int vmin, const char *qmlName, const QMetaObject *, QDeclarativeAttachedPropertiesFunc, const QMetaObject *, int pStatus, int object, int valueSource, int valueInterceptor, QDeclarativePrivate::CreateFunc extFunc, const QMetaObject *extmo, QDeclarativeCustomParser *);
+ static int registerInterface(const QDeclarativePrivate::MetaTypeIds &, const char *);
+
+ static bool copy(int type, void *data, const void *copy = 0);
+
+ static QList<QByteArray> qmlTypeNames();
+ static QList<QDeclarativeType*> 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 QDeclarativeMetaType;
+ friend class QDeclarativeTypePrivate;
+ friend struct QDeclarativeMetaTypeData;
+ QDeclarativeType(int, int, const char *, int);
+ QDeclarativeType(int, int, QObject *(*)(), const char *, int, int, const QMetaObject *, QDeclarativeAttachedPropertiesFunc, const QMetaObject *, int, int, int, QDeclarativePrivate::CreateFunc, const QMetaObject *, int, QDeclarativeCustomParser *);
+ ~QDeclarativeType();
+
+ QDeclarativeTypePrivate *d;
+};
+
+template<typename T>
+int qmlRegisterType(const char *typeName)
+{
+ QByteArray name(typeName);
+ QDeclarativePrivate::MetaTypeIds ids = {
+ qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
+ };
+
+ return QDeclarativeMetaType::registerType(ids, 0, 0, 0, 0, 0,
+ &T::staticMetaObject,
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+ 0, 0, 0);
+}
+
+template<typename T>
+int qmlRegisterType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName)
+{
+ QByteArray name(typeName);
+ QDeclarativePrivate::MetaTypeIds ids = {
+ qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
+ };
+
+ return QDeclarativeMetaType::registerType(ids, QDeclarativePrivate::create<T>,
+ uri, version_maj, version_min, qmlName,
+ &T::staticMetaObject,
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+ 0, 0, 0);
+}
+
+template<typename T, typename E>
+int qmlRegisterExtendedType(const char *typeName)
+{
+ QByteArray name(typeName);
+ QDeclarativePrivate::MetaTypeIds ids = {
+ qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
+ };
+
+ QDeclarativeAttachedPropertiesFunc attached =
+ QDeclarativePrivate::attachedPropertiesFunc<E>();
+ const QMetaObject * attachedMo =
+ QDeclarativePrivate::attachedPropertiesMetaObject<E>();
+ if (!attached) {
+ attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
+ attachedMo = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
+ }
+
+ return QDeclarativeMetaType::registerType(ids, 0, 0, 0, 0, 0,
+ &T::staticMetaObject, attached, attachedMo,
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+ &QDeclarativePrivate::CreateParent<E>::create, &E::staticMetaObject, 0);
+}
+
+template<typename T, typename E>
+int qmlRegisterExtendedType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName)
+{
+ QByteArray name(typeName);
+ QDeclarativePrivate::MetaTypeIds ids = {
+ qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
+ };
+
+ QDeclarativeAttachedPropertiesFunc attached =
+ QDeclarativePrivate::attachedPropertiesFunc<E>();
+ const QMetaObject * attachedMo =
+ QDeclarativePrivate::attachedPropertiesMetaObject<E>();
+ if (!attached) {
+ attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
+ attachedMo = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
+ }
+
+ return QDeclarativeMetaType::registerType(ids, QDeclarativePrivate::create<T>,
+ uri, version_maj, version_min, qmlName,
+ &T::staticMetaObject,
+ attached, attachedMo,
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+ &QDeclarativePrivate::CreateParent<E>::create,
+ &E::staticMetaObject, 0);
+}
+
+template<typename T>
+int qmlRegisterInterface(const char *typeName)
+{
+ QByteArray name(typeName);
+ QDeclarativePrivate::MetaTypeIds ids = {
+ qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
+ };
+
+ return QDeclarativeMetaType::registerInterface(ids, qobject_interface_iid<T *>());
+}
+
+template<typename T>
+int qmlRegisterCustomType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName, QDeclarativeCustomParser *parser)
+{
+ QByteArray name(typeName);
+ QDeclarativePrivate::MetaTypeIds ids = {
+ qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
+ };
+
+ return QDeclarativeMetaType::registerType(ids, QDeclarativePrivate::create<T>,
+ uri, version_maj, version_min, qmlName,
+ &T::staticMetaObject,
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+ 0, 0, parser);
+}
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEMETATYPE_H
+
diff --git a/src/declarative/qml/qmlnetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
index 455d09e..9dd7d39 100644
--- a/src/declarative/qml/qmlnetworkaccessmanagerfactory.cpp
+++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
@@ -39,21 +39,21 @@
**
****************************************************************************/
-#include "qmlnetworkaccessmanagerfactory.h"
+#include "qdeclarativenetworkaccessmanagerfactory.h"
QT_BEGIN_NAMESPACE
/*!
- \class QmlNetworkAccessManagerFactory
+ \class QDeclarativeNetworkAccessManagerFactory
\since 4.7
- \brief The QmlNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager
+ \brief The QDeclarativeNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager
QNetworkAccessManager is used for all network access by QML.
By implementing a factory it is possible to create custom
QNetworkAccessManager with specialized caching, proxy and
cookie support.
- To implement a factory, subclass QmlNetworkAccessManagerFactory and implement
+ To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and implement
the create() method.
If the created QNetworkAccessManager becomes invalid, due to a
@@ -67,12 +67,12 @@ QT_BEGIN_NAMESPACE
/*!
The destructor is empty.
*/
-QmlNetworkAccessManagerFactory::~QmlNetworkAccessManagerFactory()
+QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory()
{
}
/*!
- \fn QNetworkAccessManager *QmlNetworkAccessManagerFactory::create(QObject *parent)
+ \fn QNetworkAccessManager *QDeclarativeNetworkAccessManagerFactory::create(QObject *parent)
Implement this method to create a QNetworkAccessManager with \a parent.
This allows proxies, caching and cookie support to be setup appropriately.
diff --git a/src/declarative/qml/qmlnetworkaccessmanagerfactory.h b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h
index 1660929..8c76013 100644
--- a/src/declarative/qml/qmlnetworkaccessmanagerfactory.h
+++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLNETWORKACCESSMANAGERFACTORY_H
-#define QMLNETWORKACCESSMANAGERFACTORY_H
+#ifndef QDECLARATIVENETWORKACCESSMANAGERFACTORY_H
+#define QDECLARATIVENETWORKACCESSMANAGERFACTORY_H
#include <QtCore/qobject.h>
@@ -51,10 +51,10 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QNetworkAccessManager;
-class Q_DECLARATIVE_EXPORT QmlNetworkAccessManagerFactory
+class Q_DECLARATIVE_EXPORT QDeclarativeNetworkAccessManagerFactory
{
public:
- virtual ~QmlNetworkAccessManagerFactory();
+ virtual ~QDeclarativeNetworkAccessManagerFactory();
virtual QNetworkAccessManager *create(QObject *parent) = 0;
};
@@ -63,4 +63,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLNETWORKACCESSMANAGERFACTORY_H
+#endif // QDECLARATIVENETWORKACCESSMANAGERFACTORY_H
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index 155a7d6..50fe5c0 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#include "qmlobjectscriptclass_p.h"
+#include "qdeclarativeobjectscriptclass_p.h"
-#include "qmlengine_p.h"
-#include "qmlcontext_p.h"
-#include "qmldeclarativedata_p.h"
-#include "qmltypenamescriptclass_p.h"
-#include "qmllistscriptclass_p.h"
-#include "qmlbinding_p.h"
-#include "qmlguard_p.h"
-#include "qmlvmemetaobject_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativedeclarativedata_p.h"
+#include "qdeclarativetypenamescriptclass_p.h"
+#include "qdeclarativelistscriptclass_p.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativeguard_p.h"
+#include "qdeclarativevmemetaobject_p.h"
#include <QtCore/qtimer.h>
#include <QtCore/qvarlengtharray.h>
@@ -59,23 +59,23 @@ QT_BEGIN_NAMESPACE
struct ObjectData : public QScriptDeclarativeClass::Object {
ObjectData(QObject *o, int t) : object(o), type(t) {}
- QmlGuard<QObject> object;
+ QDeclarativeGuard<QObject> object;
int type;
};
/*
- The QmlObjectScriptClass handles property access for QObjects
+ The QDeclarativeObjectScriptClass handles property access for QObjects
via QtScript. It is also used to provide a more useful API in
QtScript for QML.
*/
-QmlObjectScriptClass::QmlObjectScriptClass(QmlEngine *bindEngine)
-: QmlScriptClass(QmlEnginePrivate::getScriptEngine(bindEngine)),
+QDeclarativeObjectScriptClass::QDeclarativeObjectScriptClass(QDeclarativeEngine *bindEngine)
+: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
methods(bindEngine),
#endif
lastData(0), engine(bindEngine)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
m_destroy = scriptEngine->newFunction(destroy);
m_destroyId = createPersistentIdentifier(QLatin1String("destroy"));
@@ -83,35 +83,35 @@ QmlObjectScriptClass::QmlObjectScriptClass(QmlEngine *bindEngine)
m_toStringId = createPersistentIdentifier(QLatin1String("toString"));
}
-QmlObjectScriptClass::~QmlObjectScriptClass()
+QDeclarativeObjectScriptClass::~QDeclarativeObjectScriptClass()
{
}
-QScriptValue QmlObjectScriptClass::newQObject(QObject *object, int type)
+QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (!object)
return newObject(scriptEngine, this, new ObjectData(object, type));
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(object, true);
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(object, true);
if (!ddata->scriptValue.isValid()) {
ddata->scriptValue = newObject(scriptEngine, this, new ObjectData(object, type));
return ddata->scriptValue;
- } else if (ddata->scriptValue.engine() == QmlEnginePrivate::getScriptEngine(engine)) {
+ } else if (ddata->scriptValue.engine() == QDeclarativeEnginePrivate::getScriptEngine(engine)) {
return ddata->scriptValue;
} else {
return newObject(scriptEngine, this, new ObjectData(object, type));
}
}
-QObject *QmlObjectScriptClass::toQObject(const QScriptValue &value) const
+QObject *QDeclarativeObjectScriptClass::toQObject(const QScriptValue &value) const
{
return value.toQObject();
}
-int QmlObjectScriptClass::objectType(const QScriptValue &value) const
+int QDeclarativeObjectScriptClass::objectType(const QScriptValue &value) const
{
if (scriptClass(value) != this)
return QVariant::Invalid;
@@ -121,15 +121,15 @@ int QmlObjectScriptClass::objectType(const QScriptValue &value) const
}
QScriptClass::QueryFlags
-QmlObjectScriptClass::queryProperty(Object *object, const Identifier &name,
+QDeclarativeObjectScriptClass::queryProperty(Object *object, const Identifier &name,
QScriptClass::QueryFlags flags)
{
return queryProperty(toQObject(object), name, flags, 0);
}
QScriptClass::QueryFlags
-QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name,
- QScriptClass::QueryFlags flags, QmlContext *evalContext,
+QDeclarativeObjectScriptClass::queryProperty(QObject *obj, const Identifier &name,
+ QScriptClass::QueryFlags flags, QDeclarativeContext *evalContext,
QueryHints hints)
{
Q_UNUSED(flags);
@@ -143,15 +143,15 @@ QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name,
if (!obj)
return 0;
- QmlEnginePrivate *enginePrivate = QmlEnginePrivate::get(engine);
- lastData = QmlPropertyCache::property(engine, obj, name, local);
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
+ lastData = QDeclarativePropertyCache::property(engine, obj, name, local);
if (lastData)
return QScriptClass::HandlesReadAccess | QScriptClass::HandlesWriteAccess;
if (!(hints & SkipAttachedProperties)) {
if (!evalContext && context()) {
- // Global object, QScriptContext activation object, QmlContext object
+ // Global object, QScriptContext activation object, QDeclarativeContext object
QScriptValue scopeNode = scopeChainValue(context(), -3);
if (scopeNode.isValid()) {
Q_ASSERT(scriptClass(scopeNode) == enginePrivate->contextClass);
@@ -161,10 +161,10 @@ QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name,
}
if (evalContext) {
- QmlContextPrivate *cp = QmlContextPrivate::get(evalContext);
+ QDeclarativeContextPrivate *cp = QDeclarativeContextPrivate::get(evalContext);
if (cp->imports) {
- QmlTypeNameCache::Data *data = cp->imports->data(name);
+ QDeclarativeTypeNameCache::Data *data = cp->imports->data(name);
if (data) {
lastTNData = data;
return QScriptClass::HandlesReadAccess;
@@ -182,16 +182,16 @@ QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name,
return 0;
}
-QmlObjectScriptClass::ScriptValue
-QmlObjectScriptClass::property(Object *object, const Identifier &name)
+QDeclarativeObjectScriptClass::ScriptValue
+QDeclarativeObjectScriptClass::property(Object *object, const Identifier &name)
{
return property(toQObject(object), name);
}
-QmlObjectScriptClass::ScriptValue
-QmlObjectScriptClass::property(QObject *obj, const Identifier &name)
+QDeclarativeObjectScriptClass::ScriptValue
+QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (name == m_destroyId.identifier)
return Value(scriptEngine, m_destroy);
@@ -203,7 +203,7 @@ QmlObjectScriptClass::property(QObject *obj, const Identifier &name)
Q_ASSERT(obj);
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
if (lastTNData) {
@@ -212,9 +212,9 @@ QmlObjectScriptClass::property(QObject *obj, const Identifier &name)
else
return Value(scriptEngine, enginePriv->typeNameClass->newObject(obj, lastTNData->typeNamespace));
- } else if (lastData->flags & QmlPropertyCache::Data::IsFunction) {
- if (lastData->flags & QmlPropertyCache::Data::IsVMEFunction) {
- return Value(scriptEngine, ((QmlVMEMetaObject *)(obj->metaObject()))->vmeMethod(lastData->coreIndex));
+ } else if (lastData->flags & QDeclarativePropertyCache::Data::IsFunction) {
+ if (lastData->flags & QDeclarativePropertyCache::Data::IsVMEFunction) {
+ return Value(scriptEngine, ((QDeclarativeVMEMetaObject *)(obj->metaObject()))->vmeMethod(lastData->coreIndex));
} else {
#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
// Uncomment to use QtScript method call logic
@@ -227,25 +227,25 @@ QmlObjectScriptClass::property(QObject *obj, const Identifier &name)
#endif
}
} else {
- if (enginePriv->captureProperties && !(lastData->flags & QmlPropertyCache::Data::IsConstant)) {
+ if (enginePriv->captureProperties && !(lastData->flags & QDeclarativePropertyCache::Data::IsConstant)) {
enginePriv->capturedProperties <<
- QmlEnginePrivate::CapturedProperty(obj, lastData->coreIndex, lastData->notifyIndex);
+ QDeclarativeEnginePrivate::CapturedProperty(obj, lastData->coreIndex, lastData->notifyIndex);
}
if ((uint)lastData->propType < QVariant::UserType) {
- QmlValueType *valueType = enginePriv->valueTypes[lastData->propType];
+ QDeclarativeValueType *valueType = enginePriv->valueTypes[lastData->propType];
if (valueType)
return Value(scriptEngine, enginePriv->valueTypeClass->newObject(obj, lastData->coreIndex, valueType));
}
- if (lastData->flags & QmlPropertyCache::Data::IsQList) {
+ if (lastData->flags & QDeclarativePropertyCache::Data::IsQList) {
return Value(scriptEngine, enginePriv->listClass->newList(obj, lastData->coreIndex, lastData->propType));
- } else if (lastData->flags & QmlPropertyCache::Data::IsQObjectDerived) {
+ } else if (lastData->flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
QObject *rv = 0;
void *args[] = { &rv, 0 };
QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
return Value(scriptEngine, newQObject(rv, lastData->propType));
- } else if (lastData->flags & QmlPropertyCache::Data::IsQScriptValue) {
+ } else if (lastData->flags & QDeclarativePropertyCache::Data::IsQScriptValue) {
QScriptValue rv = scriptEngine->nullValue();
void *args[] = { &rv, 0 };
QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args);
@@ -293,17 +293,17 @@ QmlObjectScriptClass::property(QObject *obj, const Identifier &name)
}
}
-void QmlObjectScriptClass::setProperty(Object *object,
+void QDeclarativeObjectScriptClass::setProperty(Object *object,
const Identifier &name,
const QScriptValue &value)
{
return setProperty(toQObject(object), name, value);
}
-void QmlObjectScriptClass::setProperty(QObject *obj,
+void QDeclarativeObjectScriptClass::setProperty(QObject *obj,
const Identifier &name,
const QScriptValue &value,
- QmlContext *evalContext)
+ QDeclarativeContext *evalContext)
{
Q_UNUSED(name);
@@ -318,7 +318,7 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
return;
}
- if (!(lastData->flags & QmlPropertyCache::Data::IsWritable)) {
+ if (!(lastData->flags & QDeclarativePropertyCache::Data::IsWritable)) {
QString error = QLatin1String("Cannot assign to read-only property \"") +
toString(name) + QLatin1Char('\"');
if (context())
@@ -326,10 +326,10 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
return;
}
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
if (!evalContext && context()) {
- // Global object, QScriptContext activation object, QmlContext object
+ // Global object, QScriptContext activation object, QDeclarativeContext object
QScriptValue scopeNode = scopeChainValue(context(), -3);
if (scopeNode.isValid()) {
Q_ASSERT(scriptClass(scopeNode) == enginePriv->contextClass);
@@ -338,26 +338,26 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
}
}
- QmlAbstractBinding *delBinding = QmlMetaPropertyPrivate::setBinding(obj, *lastData, 0);
+ QDeclarativeAbstractBinding *delBinding = QDeclarativeMetaPropertyPrivate::setBinding(obj, *lastData, 0);
if (delBinding)
delBinding->destroy();
- if (value.isUndefined() && lastData->flags & QmlPropertyCache::Data::IsResettable) {
+ if (value.isUndefined() && lastData->flags & QDeclarativePropertyCache::Data::IsResettable) {
void *a[] = { 0 };
QMetaObject::metacall(obj, QMetaObject::ResetProperty, lastData->coreIndex, a);
} else {
// ### Can well known types be optimized?
- QVariant v = QmlScriptClass::toVariant(engine, value);
- QmlMetaPropertyPrivate::write(obj, *lastData, v, evalContext);
+ QVariant v = QDeclarativeScriptClass::toVariant(engine, value);
+ QDeclarativeMetaPropertyPrivate::write(obj, *lastData, v, evalContext);
}
}
-bool QmlObjectScriptClass::isQObject() const
+bool QDeclarativeObjectScriptClass::isQObject() const
{
return true;
}
-QObject *QmlObjectScriptClass::toQObject(Object *object, bool *ok)
+QObject *QDeclarativeObjectScriptClass::toQObject(Object *object, bool *ok)
{
if (ok) *ok = true;
@@ -365,7 +365,7 @@ QObject *QmlObjectScriptClass::toQObject(Object *object, bool *ok)
return data->object.data();
}
-QScriptValue QmlObjectScriptClass::tostring(QScriptContext *context, QScriptEngine *)
+QScriptValue QDeclarativeObjectScriptClass::tostring(QScriptContext *context, QScriptEngine *)
{
QObject* obj = context->thisObject().toQObject();
@@ -390,7 +390,7 @@ QScriptValue QmlObjectScriptClass::tostring(QScriptContext *context, QScriptEngi
return QScriptValue(ret);
}
-QScriptValue QmlObjectScriptClass::destroy(QScriptContext *context, QScriptEngine *engine)
+QScriptValue QDeclarativeObjectScriptClass::destroy(QScriptContext *context, QScriptEngine *engine)
{
QObject* obj = context->thisObject().toQObject();
if(obj){
@@ -405,16 +405,16 @@ QScriptValue QmlObjectScriptClass::destroy(QScriptContext *context, QScriptEngin
return engine->nullValue();
}
-QStringList QmlObjectScriptClass::propertyNames(Object *object)
+QStringList QDeclarativeObjectScriptClass::propertyNames(Object *object)
{
QObject *obj = toQObject(object);
if (!obj)
return QStringList();
- QmlEnginePrivate *enginePrivate = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
- QmlPropertyCache *cache = 0;
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(obj);
+ QDeclarativePropertyCache *cache = 0;
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(obj);
if (ddata)
cache = ddata->propertyCache;
if (!cache) {
@@ -431,26 +431,26 @@ QStringList QmlObjectScriptClass::propertyNames(Object *object)
#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
struct MethodData : public QScriptDeclarativeClass::Object {
- MethodData(QObject *o, const QmlPropertyCache::Data &d) : object(o), data(d) {}
+ MethodData(QObject *o, const QDeclarativePropertyCache::Data &d) : object(o), data(d) {}
- QmlGuard<QObject> object;
- QmlPropertyCache::Data data;
+ QDeclarativeGuard<QObject> object;
+ QDeclarativePropertyCache::Data data;
};
-QmlObjectMethodScriptClass::QmlObjectMethodScriptClass(QmlEngine *bindEngine)
-: QScriptDeclarativeClass(QmlEnginePrivate::getScriptEngine(bindEngine)),
+QDeclarativeObjectMethodScriptClass::QDeclarativeObjectMethodScriptClass(QDeclarativeEngine *bindEngine)
+: QScriptDeclarativeClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
engine(bindEngine)
{
setSupportsCall(true);
}
-QmlObjectMethodScriptClass::~QmlObjectMethodScriptClass()
+QDeclarativeObjectMethodScriptClass::~QDeclarativeObjectMethodScriptClass()
{
}
-QScriptValue QmlObjectMethodScriptClass::newMethod(QObject *object, const QmlPropertyCache::Data *method)
+QScriptValue QDeclarativeObjectMethodScriptClass::newMethod(QObject *object, const QDeclarativePropertyCache::Data *method)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
return newObject(scriptEngine, this, new MethodData(object, *method));
}
@@ -461,9 +461,9 @@ struct MetaCallArgument {
inline ~MetaCallArgument();
inline void *dataPtr();
- inline void initAsType(int type, QmlEngine *);
- void fromScriptValue(int type, QmlEngine *, const QScriptValue &);
- inline QScriptDeclarativeClass::Value toValue(QmlEngine *);
+ inline void initAsType(int type, QDeclarativeEngine *);
+ void fromScriptValue(int type, QDeclarativeEngine *, const QScriptValue &);
+ inline QScriptDeclarativeClass::Value toValue(QDeclarativeEngine *);
private:
MetaCallArgument(const MetaCallArgument &);
@@ -504,12 +504,12 @@ void *MetaCallArgument::dataPtr()
return (void *)data;
}
-void MetaCallArgument::initAsType(int callType, QmlEngine *e)
+void MetaCallArgument::initAsType(int callType, QDeclarativeEngine *e)
{
if (type != 0) { cleanup(); type = 0; }
if (callType == 0) return;
- QScriptEngine *engine = QmlEnginePrivate::getScriptEngine(e);
+ QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(e);
if (callType == qMetaTypeId<QScriptValue>()) {
new (data) QScriptValue(engine->undefinedValue());
@@ -535,7 +535,7 @@ void MetaCallArgument::initAsType(int callType, QmlEngine *e)
}
}
-void MetaCallArgument::fromScriptValue(int callType, QmlEngine *engine, const QScriptValue &value)
+void MetaCallArgument::fromScriptValue(int callType, QDeclarativeEngine *engine, const QScriptValue &value)
{
if (type != 0) { cleanup(); type = 0; }
@@ -567,13 +567,13 @@ void MetaCallArgument::fromScriptValue(int callType, QmlEngine *engine, const QS
*((QObject **)data) = value.toQObject();
type = callType;
} else if (callType == qMetaTypeId<QVariant>()) {
- new (data) QVariant(QmlScriptClass::toVariant(engine, value));
+ new (data) QVariant(QDeclarativeScriptClass::toVariant(engine, value));
type = callType;
} else {
new (data) QVariant();
type = -1;
- QVariant v = QmlScriptClass::toVariant(engine, value);
+ QVariant v = QDeclarativeScriptClass::toVariant(engine, value);
if (v.userType() == callType) {
*((QVariant *)data) = v;
} else if (v.canConvert((QVariant::Type)callType)) {
@@ -585,9 +585,9 @@ void MetaCallArgument::fromScriptValue(int callType, QmlEngine *engine, const QS
}
}
-QScriptDeclarativeClass::Value MetaCallArgument::toValue(QmlEngine *e)
+QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e)
{
- QScriptEngine *engine = QmlEnginePrivate::getScriptEngine(e);
+ QScriptEngine *engine = QDeclarativeEnginePrivate::getScriptEngine(e);
if (type == qMetaTypeId<QScriptValue>()) {
return QScriptDeclarativeClass::Value(engine, *((QScriptValue *)data));
@@ -604,19 +604,19 @@ QScriptDeclarativeClass::Value MetaCallArgument::toValue(QmlEngine *e)
} else if (type == QMetaType::QString) {
return QScriptDeclarativeClass::Value(engine, *((QString *)data));
} else if (type == QMetaType::QObjectStar) {
- return QScriptDeclarativeClass::Value(engine, QmlEnginePrivate::get(e)->objectClass->newQObject(*((QObject **)data)));
+ return QScriptDeclarativeClass::Value(engine, QDeclarativeEnginePrivate::get(e)->objectClass->newQObject(*((QObject **)data)));
} else if (type == -1 || type == qMetaTypeId<QVariant>()) {
- return QScriptDeclarativeClass::Value(engine, QmlEnginePrivate::get(e)->scriptValueFromVariant(*((QVariant *)data)));
+ return QScriptDeclarativeClass::Value(engine, QDeclarativeEnginePrivate::get(e)->scriptValueFromVariant(*((QVariant *)data)));
} else {
return QScriptDeclarativeClass::Value();
}
}
-QmlObjectMethodScriptClass::Value QmlObjectMethodScriptClass::call(Object *o, QScriptContext *ctxt)
+QDeclarativeObjectMethodScriptClass::Value QDeclarativeObjectMethodScriptClass::call(Object *o, QScriptContext *ctxt)
{
MethodData *method = static_cast<MethodData *>(o);
- if (method->data.flags & QmlPropertyCache::Data::HasArguments) {
+ if (method->data.flags & QDeclarativePropertyCache::Data::HasArguments) {
QMetaMethod m = method->object->metaObject()->method(method->data.coreIndex);
QList<QByteArray> argTypeNames = m.parameterTypes();
diff --git a/src/declarative/qml/qmlobjectscriptclass_p.h b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
index 729f34f..8023756 100644
--- a/src/declarative/qml/qmlobjectscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLOBJECTSCRIPTCLASS_P_H
-#define QMLOBJECTSCRIPTCLASS_P_H
+#ifndef QDECLARATIVEOBJECTSCRIPTCLASS_P_H
+#define QDECLARATIVEOBJECTSCRIPTCLASS_P_H
//
// W A R N I N G
@@ -53,39 +53,39 @@
// We mean it.
//
-#include "qmlpropertycache_p.h"
-#include "qmltypenamecache_p.h"
+#include "qdeclarativepropertycache_p.h"
+#include "qdeclarativetypenamecache_p.h"
-#include <private/qmlscriptclass_p.h>
+#include <private/qdeclarativescriptclass_p.h>
QT_BEGIN_NAMESPACE
-class QmlEngine;
+class QDeclarativeEngine;
class QScriptContext;
class QScriptEngine;
-class QmlContext;
+class QDeclarativeContext;
#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
-class Q_AUTOTEST_EXPORT QmlObjectMethodScriptClass : public QScriptDeclarativeClass
+class Q_AUTOTEST_EXPORT QDeclarativeObjectMethodScriptClass : public QScriptDeclarativeClass
{
public:
- QmlObjectMethodScriptClass(QmlEngine *);
- ~QmlObjectMethodScriptClass();
+ QDeclarativeObjectMethodScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeObjectMethodScriptClass();
- QScriptValue newMethod(QObject *, const QmlPropertyCache::Data *);
+ QScriptValue newMethod(QObject *, const QDeclarativePropertyCache::Data *);
protected:
virtual Value call(Object *, QScriptContext *);
private:
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
};
#endif
-class Q_AUTOTEST_EXPORT QmlObjectScriptClass : public QmlScriptClass
+class Q_AUTOTEST_EXPORT QDeclarativeObjectScriptClass : public QDeclarativeScriptClass
{
public:
- QmlObjectScriptClass(QmlEngine *);
- ~QmlObjectScriptClass();
+ QDeclarativeObjectScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeObjectScriptClass();
QScriptValue newQObject(QObject *, int type = QMetaType::QObjectStar);
QObject *toQObject(const QScriptValue &) const;
@@ -99,13 +99,13 @@ public:
QScriptClass::QueryFlags queryProperty(QObject *, const Identifier &,
QScriptClass::QueryFlags flags,
- QmlContext *evalContext,
+ QDeclarativeContext *evalContext,
QueryHints hints = 0);
ScriptValue property(QObject *, const Identifier &);
void setProperty(QObject *, const Identifier &name, const QScriptValue &,
- QmlContext *evalContext = 0);
+ QDeclarativeContext *evalContext = 0);
virtual QStringList propertyNames(Object *);
protected:
@@ -119,12 +119,12 @@ protected:
private:
#if (QT_VERSION > QT_VERSION_CHECK(4, 6, 2)) || defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
- QmlObjectMethodScriptClass methods;
+ QDeclarativeObjectMethodScriptClass methods;
#endif
- QmlTypeNameCache::Data *lastTNData;
- QmlPropertyCache::Data *lastData;
- QmlPropertyCache::Data local;
+ QDeclarativeTypeNameCache::Data *lastTNData;
+ QDeclarativePropertyCache::Data *lastData;
+ QDeclarativePropertyCache::Data local;
PersistentIdentifier m_destroyId;
PersistentIdentifier m_toStringId;
@@ -134,11 +134,11 @@ private:
static QScriptValue tostring(QScriptContext *context, QScriptEngine *engine);
static QScriptValue destroy(QScriptContext *context, QScriptEngine *engine);
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
};
-Q_DECLARE_OPERATORS_FOR_FLAGS(QmlObjectScriptClass::QueryHints);
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeObjectScriptClass::QueryHints);
QT_END_NAMESPACE
-#endif // QMLOBJECTSCRIPTCLASS_P_H
+#endif // QDECLARATIVEOBJECTSCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qdeclarativeparser.cpp
index f2690e2..5ac49d5 100644
--- a/src/declarative/qml/qmlparser.cpp
+++ b/src/declarative/qml/qdeclarativeparser.cpp
@@ -39,18 +39,18 @@
**
****************************************************************************/
-#include "qmlparser_p.h"
+#include "qdeclarativeparser_p.h"
-#include "qmlpropertyvaluesource.h"
-#include "qmlvme_p.h"
-#include "qml.h"
-#include "qmlcomponent_p.h"
-#include "qmlcomponent.h"
+#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativevme_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativecomponent_p.h"
+#include "qdeclarativecomponent.h"
#include "qmetaobjectbuilder_p.h"
-#include "qmlvmemetaobject_p.h"
-#include "qmlcompiler_p.h"
-#include "parser/qmljsast_p.h"
-#include "parser/qmljsengine_p.h"
+#include "qdeclarativevmemetaobject_p.h"
+#include "qdeclarativecompiler_p.h"
+#include "parser/qdeclarativejsast_p.h"
+#include "parser/qdeclarativejsengine_p.h"
#include <qfxperf_p_p.h>
@@ -63,15 +63,15 @@
QT_BEGIN_NAMESPACE
-using namespace QmlJS;
-using namespace QmlParser;
+using namespace QDeclarativeJS;
+using namespace QDeclarativeParser;
-QmlParser::Object::Object()
+QDeclarativeParser::Object::Object()
: type(-1), majorVersion(-1), minorVersion(-1), idIndex(-1), metatype(0), defaultProperty(0), parserStatusCast(-1)
{
}
-QmlParser::Object::~Object()
+QDeclarativeParser::Object::~Object()
{
if (defaultProperty) defaultProperty->release();
foreach(Property *prop, properties)
@@ -112,7 +112,7 @@ const QMetaObject *Object::metaObject() const
return metatype;
}
-QmlParser::Property *Object::getDefaultProperty()
+QDeclarativeParser::Property *Object::getDefaultProperty()
{
if (!defaultProperty) {
defaultProperty = new Property;
@@ -121,44 +121,44 @@ QmlParser::Property *Object::getDefaultProperty()
return defaultProperty;
}
-void QmlParser::Object::addValueProperty(Property *p)
+void QDeclarativeParser::Object::addValueProperty(Property *p)
{
p->addref();
valueProperties << p;
}
-void QmlParser::Object::addSignalProperty(Property *p)
+void QDeclarativeParser::Object::addSignalProperty(Property *p)
{
p->addref();
signalProperties << p;
}
-void QmlParser::Object::addAttachedProperty(Property *p)
+void QDeclarativeParser::Object::addAttachedProperty(Property *p)
{
p->addref();
attachedProperties << p;
}
-void QmlParser::Object::addGroupedProperty(Property *p)
+void QDeclarativeParser::Object::addGroupedProperty(Property *p)
{
p->addref();
groupedProperties << p;
}
-void QmlParser::Object::addValueTypeProperty(Property *p)
+void QDeclarativeParser::Object::addValueTypeProperty(Property *p)
{
p->addref();
valueTypeProperties << p;
}
-void QmlParser::Object::addScriptStringProperty(Property *p, int stack)
+void QDeclarativeParser::Object::addScriptStringProperty(Property *p, int stack)
{
p->addref();
scriptStringProperties << qMakePair(p, stack);
}
-Property *QmlParser::Object::getProperty(const QByteArray &name, bool create)
+Property *QDeclarativeParser::Object::getProperty(const QByteArray &name, bool create)
{
if (!properties.contains(name)) {
if (create) {
@@ -172,12 +172,12 @@ Property *QmlParser::Object::getProperty(const QByteArray &name, bool create)
return properties[name];
}
-QmlParser::Object::DynamicProperty::DynamicProperty()
+QDeclarativeParser::Object::DynamicProperty::DynamicProperty()
: isDefaultProperty(false), type(Variant), defaultValue(0)
{
}
-QmlParser::Object::DynamicProperty::DynamicProperty(const DynamicProperty &o)
+QDeclarativeParser::Object::DynamicProperty::DynamicProperty(const DynamicProperty &o)
: isDefaultProperty(o.isDefaultProperty),
type(o.type),
customType(o.customType),
@@ -187,98 +187,98 @@ QmlParser::Object::DynamicProperty::DynamicProperty(const DynamicProperty &o)
{
}
-QmlParser::Object::DynamicSignal::DynamicSignal()
+QDeclarativeParser::Object::DynamicSignal::DynamicSignal()
{
}
-QmlParser::Object::DynamicSignal::DynamicSignal(const DynamicSignal &o)
+QDeclarativeParser::Object::DynamicSignal::DynamicSignal(const DynamicSignal &o)
: name(o.name), parameterTypes(o.parameterTypes),
parameterNames(o.parameterNames)
{
}
-QmlParser::Object::DynamicSlot::DynamicSlot()
+QDeclarativeParser::Object::DynamicSlot::DynamicSlot()
{
}
-QmlParser::Object::DynamicSlot::DynamicSlot(const DynamicSlot &o)
+QDeclarativeParser::Object::DynamicSlot::DynamicSlot(const DynamicSlot &o)
: name(o.name), body(o.body), parameterNames(o.parameterNames)
{
}
-QmlParser::Property::Property()
+QDeclarativeParser::Property::Property()
: parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false)
{
}
-QmlParser::Property::Property(const QByteArray &n)
+QDeclarativeParser::Property::Property(const QByteArray &n)
: parent(0), type(0), index(-1), value(0), name(n), isDefault(false),
isDeferred(false)
{
}
-QmlParser::Property::~Property()
+QDeclarativeParser::Property::~Property()
{
foreach(Value *value, values)
value->release();
if (value) value->release();
}
-Object *QmlParser::Property::getValue()
+Object *QDeclarativeParser::Property::getValue()
{
if (!value) value = new Object;
return value;
}
-void QmlParser::Property::addValue(Value *v)
+void QDeclarativeParser::Property::addValue(Value *v)
{
values << v;
}
-bool QmlParser::Property::isEmpty() const
+bool QDeclarativeParser::Property::isEmpty() const
{
return !value && values.isEmpty();
}
-QmlParser::Value::Value()
+QDeclarativeParser::Value::Value()
: type(Unknown), object(0)
{
}
-QmlParser::Value::~Value()
+QDeclarativeParser::Value::~Value()
{
if (object) object->release();
}
-QmlParser::Variant::Variant()
+QDeclarativeParser::Variant::Variant()
: t(Invalid) {}
-QmlParser::Variant::Variant(const Variant &o)
+QDeclarativeParser::Variant::Variant(const Variant &o)
: t(o.t), d(o.d), s(o.s)
{
}
-QmlParser::Variant::Variant(bool v)
+QDeclarativeParser::Variant::Variant(bool v)
: t(Boolean), b(v)
{
}
-QmlParser::Variant::Variant(double v, const QString &asWritten)
+QDeclarativeParser::Variant::Variant(double v, const QString &asWritten)
: t(Number), d(v), s(asWritten)
{
}
-QmlParser::Variant::Variant(const QString &v)
+QDeclarativeParser::Variant::Variant(const QString &v)
: t(String), s(v)
{
}
-QmlParser::Variant::Variant(const QString &v, QmlJS::AST::Node *n)
+QDeclarativeParser::Variant::Variant(const QString &v, QDeclarativeJS::AST::Node *n)
: t(Script), n(n), s(v)
{
}
-QmlParser::Variant &QmlParser::Variant::operator=(const Variant &o)
+QDeclarativeParser::Variant &QDeclarativeParser::Variant::operator=(const Variant &o)
{
t = o.t;
d = o.d;
@@ -286,27 +286,27 @@ QmlParser::Variant &QmlParser::Variant::operator=(const Variant &o)
return *this;
}
-QmlParser::Variant::Type QmlParser::Variant::type() const
+QDeclarativeParser::Variant::Type QDeclarativeParser::Variant::type() const
{
return t;
}
-bool QmlParser::Variant::asBoolean() const
+bool QDeclarativeParser::Variant::asBoolean() const
{
return b;
}
-QString QmlParser::Variant::asString() const
+QString QDeclarativeParser::Variant::asString() const
{
return s;
}
-double QmlParser::Variant::asNumber() const
+double QDeclarativeParser::Variant::asNumber() const
{
return d;
}
-QString QmlParser::Variant::asScript() const
+QString QDeclarativeParser::Variant::asScript() const
{
switch(type()) {
default:
@@ -325,7 +325,7 @@ QString QmlParser::Variant::asScript() const
}
}
-QmlJS::AST::Node *QmlParser::Variant::asAST() const
+QDeclarativeJS::AST::Node *QDeclarativeParser::Variant::asAST() const
{
if (type() == Script)
return n;
@@ -333,7 +333,7 @@ QmlJS::AST::Node *QmlParser::Variant::asAST() const
return 0;
}
-bool QmlParser::Variant::isStringList() const
+bool QDeclarativeParser::Variant::isStringList() const
{
if (isString())
return true;
@@ -358,7 +358,7 @@ bool QmlParser::Variant::isStringList() const
return true;
}
-QStringList QmlParser::Variant::asStringList() const
+QStringList QDeclarativeParser::Variant::asStringList() const
{
QStringList rv;
if (isString()) {
diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h
index 222229b..cfd0b87 100644
--- a/src/declarative/qml/qmlparser_p.h
+++ b/src/declarative/qml/qdeclarativeparser_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLPARSER_P_H
-#define QMLPARSER_P_H
+#ifndef QDECLARATIVEPARSER_P_H
+#define QDECLARATIVEPARSER_P_H
//
// W A R N I N G
@@ -53,8 +53,8 @@
// We mean it.
//
-#include "qml.h"
-#include "qmlrefcount_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativerefcount_p.h"
#include <QtCore/QByteArray>
#include <QtCore/QList>
@@ -68,20 +68,20 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-namespace QmlJS { namespace AST { class Node; } }
+namespace QDeclarativeJS { namespace AST { class Node; } }
/*
XXX
- These types are created (and owned) by the QmlXmlParser and consumed by the
- QmlCompiler. During the compilation phase the compiler will update some of
- the fields for both its own use and for the use of the upcoming QmlDom API.
+ These types are created (and owned) by the QDeclarativeXmlParser and consumed by the
+ QDeclarativeCompiler. During the compilation phase the compiler will update some of
+ the fields for both its own use and for the use of the upcoming QDeclarativeDom API.
- The types are part of the generic sounding "QmlParser" namespace for legacy
+ The types are part of the generic sounding "QDeclarativeParser" namespace for legacy
reasons (there used to be more in this namespace) and will be cleaned up and
migrated into a more appropriate location shortly.
*/
-namespace QmlParser
+namespace QDeclarativeParser
{
struct Location
{
@@ -105,14 +105,14 @@ namespace QmlParser
};
class Property;
- class Object : public QmlRefCount
+ class Object : public QDeclarativeRefCount
{
public:
Object();
virtual ~Object();
// Type of the object. The integer is an index into the
- // QmlCompiledData::types array, or -1 if the object is a property
+ // QDeclarativeCompiledData::types array, or -1 if the object is a property
// group.
int type;
// The url of this object if it is an external type. Used by the DOM
@@ -126,9 +126,9 @@ namespace QmlParser
QByteArray typeName;
// The class name
QByteArray className;
- // The id assigned to the object (if any). Set by the QmlCompiler
+ // The id assigned to the object (if any). Set by the QDeclarativeCompiler
QString id;
- // The id index assigned to the object (if any). Set by the QmlCompiler
+ // The id index assigned to the object (if any). Set by the QDeclarativeCompiler
int idIndex;
// Custom parsed data
QByteArray custom;
@@ -178,9 +178,9 @@ namespace QmlParser
};
QList<ScriptBlock> scripts;
- // The bytes to cast instances by to get to the QmlParserStatus
+ // The bytes to cast instances by to get to the QDeclarativeParserStatus
// interface. -1 indicates the type doesn't support this interface.
- // Set by the QmlCompiler.
+ // Set by the QDeclarativeCompiler.
int parserStatusCast;
LocationSpan location;
@@ -195,7 +195,7 @@ namespace QmlParser
Type type;
QByteArray customType;
QByteArray name;
- QmlParser::Property *defaultValue;
+ QDeclarativeParser::Property *defaultValue;
LocationSpan location;
};
struct DynamicSignal {
@@ -239,7 +239,7 @@ namespace QmlParser
Variant(bool);
Variant(double, const QString &asWritten=QString());
Variant(const QString &);
- Variant(const QString &, QmlJS::AST::Node *);
+ Variant(const QString &, QDeclarativeJS::AST::Node *);
Variant &operator=(const Variant &);
Type type() const;
@@ -254,7 +254,7 @@ namespace QmlParser
QString asString() const;
double asNumber() const;
QString asScript() const;
- QmlJS::AST::Node *asAST() const;
+ QDeclarativeJS::AST::Node *asAST() const;
QStringList asStringList() const;
private:
@@ -262,12 +262,12 @@ namespace QmlParser
union {
bool b;
double d;
- QmlJS::AST::Node *n;
+ QDeclarativeJS::AST::Node *n;
};
QString s;
};
- class Value : public QmlRefCount
+ class Value : public QDeclarativeRefCount
{
public:
Value();
@@ -280,9 +280,9 @@ namespace QmlParser
Literal,
// This is used as a property binding assignment
PropertyBinding,
- // This is used as a QmlPropertyValueSource assignment
+ // This is used as a QDeclarativePropertyValueSource assignment
ValueSource,
- // This is used as a QmlPropertyValueInterceptor assignment
+ // This is used as a QDeclarativePropertyValueInterceptor assignment
ValueInterceptor,
// This is used as a property QObject assignment
CreatedObject,
@@ -306,7 +306,7 @@ namespace QmlParser
LocationSpan location;
};
- class Property : public QmlRefCount
+ class Property : public QDeclarativeRefCount
{
public:
Property();
@@ -339,7 +339,7 @@ namespace QmlParser
// True if this property was accessed as the default property.
bool isDefault;
// True if the setting of this property will be deferred. Set by the
- // QmlCompiler
+ // QDeclarativeCompiler
bool isDeferred;
LocationSpan location;
@@ -350,8 +350,8 @@ namespace QmlParser
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QmlParser::Variant)
+Q_DECLARE_METATYPE(QDeclarativeParser::Variant)
QT_END_HEADER
-#endif // QMLPARSER_P_H
+#endif // QDECLARATIVEPARSER_P_H
diff --git a/src/declarative/qml/qmlparserstatus.cpp b/src/declarative/qml/qdeclarativeparserstatus.cpp
index 315bc75..ec6260e 100644
--- a/src/declarative/qml/qmlparserstatus.cpp
+++ b/src/declarative/qml/qdeclarativeparserstatus.cpp
@@ -39,24 +39,24 @@
**
****************************************************************************/
-#include "qmlparserstatus.h"
+#include "qdeclarativeparserstatus.h"
QT_BEGIN_NAMESPACE
/*!
- \class QmlParserStatus
+ \class QDeclarativeParserStatus
\since 4.7
- \brief The QmlParserStatus class provides updates on the parser state.
+ \brief The QDeclarativeParserStatus class provides updates on the parser state.
*/
/*! \internal */
-QmlParserStatus::QmlParserStatus()
+QDeclarativeParserStatus::QDeclarativeParserStatus()
: d(0)
{
}
/*! \internal */
-QmlParserStatus::~QmlParserStatus()
+QDeclarativeParserStatus::~QDeclarativeParserStatus()
{
if(d)
(*d) = 0;
@@ -65,7 +65,7 @@ QmlParserStatus::~QmlParserStatus()
/*!
Invoked after class creation, but before any properties have been set.
*/
-void QmlParserStatus::classBegin()
+void QDeclarativeParserStatus::classBegin()
{
}
@@ -74,7 +74,7 @@ void QmlParserStatus::classBegin()
completed construction. At this point all static values and binding values
have been assigned to the class.
*/
-void QmlParserStatus::componentComplete()
+void QDeclarativeParserStatus::componentComplete()
{
}
diff --git a/src/declarative/qml/qmlparserstatus.h b/src/declarative/qml/qdeclarativeparserstatus.h
index e4cfe8b..34528c1 100644
--- a/src/declarative/qml/qmlparserstatus.h
+++ b/src/declarative/qml/qdeclarativeparserstatus.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLPARSERSTATUS_H
-#define QMLPARSERSTATUS_H
+#ifndef QDECLARATIVEPARSERSTATUS_H
+#define QDECLARATIVEPARSERSTATUS_H
#include <QtCore/qobject.h>
@@ -50,26 +50,26 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class Q_DECLARATIVE_EXPORT QmlParserStatus
+class Q_DECLARATIVE_EXPORT QDeclarativeParserStatus
{
public:
- QmlParserStatus();
- virtual ~QmlParserStatus();
+ QDeclarativeParserStatus();
+ virtual ~QDeclarativeParserStatus();
virtual void classBegin();
virtual void componentComplete();
private:
- friend class QmlVME;
- friend class QmlComponent;
- friend class QmlComponentPrivate;
- friend class QmlEnginePrivate;
- QmlParserStatus **d;
+ friend class QDeclarativeVME;
+ friend class QDeclarativeComponent;
+ friend class QDeclarativeComponentPrivate;
+ friend class QDeclarativeEnginePrivate;
+ QDeclarativeParserStatus **d;
};
-Q_DECLARE_INTERFACE(QmlParserStatus, "com.trolltech.qml.QmlParserStatus")
+Q_DECLARE_INTERFACE(QDeclarativeParserStatus, "com.trolltech.qml.QDeclarativeParserStatus")
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLPARSERSTATUS_H
+#endif // QDECLARATIVEPARSERSTATUS_H
diff --git a/src/declarative/qml/qmlprivate.cpp b/src/declarative/qml/qdeclarativeprivate.cpp
index f85e280..444fe56 100644
--- a/src/declarative/qml/qmlprivate.cpp
+++ b/src/declarative/qml/qdeclarativeprivate.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qmlprivate.h"
+#include "qdeclarativeprivate.h"
QT_BEGIN_NAMESPACE
-QmlPrivate::InstanceType::InstanceType(int) {}
+QDeclarativePrivate::InstanceType::InstanceType(int) {}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmlprivate.h b/src/declarative/qml/qdeclarativeprivate.h
index e5ea07f..c8a8c74 100644
--- a/src/declarative/qml/qmlprivate.h
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLPRIVATE_H
-#define QMLPRIVATE_H
+#ifndef QDECLARATIVEPRIVATE_H
+#define QDECLARATIVEPRIVATE_H
#include <QtCore/qglobal.h>
@@ -55,13 +55,13 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-typedef QObject *(*QmlAttachedPropertiesFunc)(QObject *);
+typedef QObject *(*QDeclarativeAttachedPropertiesFunc)(QObject *);
//template<typename T>
//struct qml_hasAttached { static bool const value = false; };
template <typename TYPE>
-class QmlTypeInfo
+class QDeclarativeTypeInfo
{
public:
enum {
@@ -70,7 +70,7 @@ public:
};
-namespace QmlPrivate
+namespace QDeclarativePrivate
{
template<typename T>
QObject *create() { return new T; }
@@ -105,7 +105,7 @@ namespace QmlPrivate
template <typename T>
struct has_attachedPropertiesMember
{
- static bool const value = QmlTypeInfo<T>::hasAttachedProperties;
+ static bool const value = QDeclarativeTypeInfo<T>::hasAttachedProperties;
};
template <typename T, bool hasMember>
@@ -133,7 +133,7 @@ namespace QmlPrivate
class AttachedPropertySelector
{
public:
- static inline QmlAttachedPropertiesFunc func() { return 0; }
+ static inline QDeclarativeAttachedPropertiesFunc func() { return 0; }
static inline const QMetaObject *metaObject() { return 0; }
};
template<typename T>
@@ -147,7 +147,7 @@ namespace QmlPrivate
return &ReturnType::staticMetaObject;
}
public:
- static inline QmlAttachedPropertiesFunc func() {
+ static inline QDeclarativeAttachedPropertiesFunc func() {
return &attachedProperties;
}
static inline const QMetaObject *metaObject() {
@@ -156,7 +156,7 @@ namespace QmlPrivate
};
template<typename T>
- inline QmlAttachedPropertiesFunc attachedPropertiesFunc()
+ inline QDeclarativeAttachedPropertiesFunc attachedPropertiesFunc()
{
return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func();
}
@@ -208,4 +208,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLPRIVATE_H
+#endif // QDECLARATIVEPRIVATE_H
diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp
index 81f8e51..08b47b7 100644
--- a/src/declarative/qml/qmlpropertycache.cpp
+++ b/src/declarative/qml/qdeclarativepropertycache.cpp
@@ -39,17 +39,17 @@
**
****************************************************************************/
-#include "qmlpropertycache_p.h"
+#include "qdeclarativepropertycache_p.h"
-#include "qmlengine_p.h"
-#include "qmlbinding_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativebinding_p.h"
#include <QtCore/qdebug.h>
Q_DECLARE_METATYPE(QScriptValue);
QT_BEGIN_NAMESPACE
-QmlPropertyCache::Data::Flags QmlPropertyCache::Data::flagsForProperty(const QMetaProperty &p, QmlEngine *engine)
+QDeclarativePropertyCache::Data::Flags QDeclarativePropertyCache::Data::flagsForProperty(const QMetaProperty &p, QDeclarativeEngine *engine)
{
int propType = p.userType();
@@ -62,25 +62,25 @@ QmlPropertyCache::Data::Flags QmlPropertyCache::Data::flagsForProperty(const QMe
if (p.isResettable())
flags |= Data::IsResettable;
- if (propType == qMetaTypeId<QmlBinding *>()) {
+ if (propType == qMetaTypeId<QDeclarativeBinding *>()) {
flags |= Data::IsQmlBinding;
} else if (propType == qMetaTypeId<QScriptValue>()) {
flags |= Data::IsQScriptValue;
} else if (p.isEnumType()) {
flags |= Data::IsEnumType;
} else {
- QmlMetaType::TypeCategory cat = engine ? QmlEnginePrivate::get(engine)->typeCategory(propType)
- : QmlMetaType::typeCategory(propType);
- if (cat == QmlMetaType::Object)
+ QDeclarativeMetaType::TypeCategory cat = engine ? QDeclarativeEnginePrivate::get(engine)->typeCategory(propType)
+ : QDeclarativeMetaType::typeCategory(propType);
+ if (cat == QDeclarativeMetaType::Object)
flags |= Data::IsQObjectDerived;
- else if (cat == QmlMetaType::List)
+ else if (cat == QDeclarativeMetaType::List)
flags |= Data::IsQList;
}
return flags;
}
-void QmlPropertyCache::Data::load(const QMetaProperty &p, QmlEngine *engine)
+void QDeclarativePropertyCache::Data::load(const QMetaProperty &p, QDeclarativeEngine *engine)
{
propType = p.userType();
if (QVariant::Type(propType) == QVariant::LastType)
@@ -90,7 +90,7 @@ void QmlPropertyCache::Data::load(const QMetaProperty &p, QmlEngine *engine)
flags = flagsForProperty(p, engine);
}
-void QmlPropertyCache::Data::load(const QMetaMethod &m)
+void QDeclarativePropertyCache::Data::load(const QMetaMethod &m)
{
coreIndex = m.methodIndex();
flags |= Data::IsFunction;
@@ -106,17 +106,17 @@ void QmlPropertyCache::Data::load(const QMetaMethod &m)
}
-QmlPropertyCache::QmlPropertyCache(QmlEngine *e)
-: QmlCleanup(e), engine(e)
+QDeclarativePropertyCache::QDeclarativePropertyCache(QDeclarativeEngine *e)
+: QDeclarativeCleanup(e), engine(e)
{
}
-QmlPropertyCache::~QmlPropertyCache()
+QDeclarativePropertyCache::~QDeclarativePropertyCache()
{
clear();
}
-void QmlPropertyCache::clear()
+void QDeclarativePropertyCache::clear()
{
for (int ii = 0; ii < indexCache.count(); ++ii)
indexCache.at(ii)->release();
@@ -134,12 +134,12 @@ void QmlPropertyCache::clear()
identifierCache.clear();
}
-QmlPropertyCache::Data QmlPropertyCache::create(const QMetaObject *metaObject,
+QDeclarativePropertyCache::Data QDeclarativePropertyCache::create(const QMetaObject *metaObject,
const QString &property)
{
Q_ASSERT(metaObject);
- QmlPropertyCache::Data rv;
+ QDeclarativePropertyCache::Data rv;
int idx = metaObject->indexOfProperty(property.toUtf8());
if (idx != -1) {
rv.load(metaObject->property(idx));
@@ -166,9 +166,9 @@ QmlPropertyCache::Data QmlPropertyCache::create(const QMetaObject *metaObject,
return rv;
}
-QmlPropertyCache *QmlPropertyCache::copy() const
+QDeclarativePropertyCache *QDeclarativePropertyCache::copy() const
{
- QmlPropertyCache *cache = new QmlPropertyCache(engine);
+ QDeclarativePropertyCache *cache = new QDeclarativePropertyCache(engine);
cache->indexCache = indexCache;
cache->stringCache = stringCache;
cache->identifierCache = identifierCache;
@@ -183,10 +183,10 @@ QmlPropertyCache *QmlPropertyCache::copy() const
return cache;
}
-void QmlPropertyCache::append(QmlEngine *engine, const QMetaObject *metaObject,
+void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaObject *metaObject,
Data::Flag propertyFlags, Data::Flag methodFlags)
{
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
int propCount = metaObject->propertyCount();
int propOffset = metaObject->propertyOffset();
@@ -246,21 +246,21 @@ void QmlPropertyCache::append(QmlEngine *engine, const QMetaObject *metaObject,
}
// ### Optimize - check engine for the parent meta object etc.
-QmlPropertyCache *QmlPropertyCache::create(QmlEngine *engine, const QMetaObject *metaObject)
+QDeclarativePropertyCache *QDeclarativePropertyCache::create(QDeclarativeEngine *engine, const QMetaObject *metaObject)
{
Q_ASSERT(engine);
Q_ASSERT(metaObject);
- QmlPropertyCache *cache = new QmlPropertyCache(engine);
+ QDeclarativePropertyCache *cache = new QDeclarativePropertyCache(engine);
cache->update(engine, metaObject);
return cache;
}
-void QmlPropertyCache::update(QmlEngine *engine, const QMetaObject *metaObject)
+void QDeclarativePropertyCache::update(QDeclarativeEngine *engine, const QMetaObject *metaObject)
{
Q_ASSERT(engine);
Q_ASSERT(metaObject);
- QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
clear();
@@ -313,8 +313,8 @@ void QmlPropertyCache::update(QmlEngine *engine, const QMetaObject *metaObject)
}
}
-QmlPropertyCache::Data *
-QmlPropertyCache::property(int index) const
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::property(int index) const
{
if (index < 0 || index >= indexCache.count())
return 0;
@@ -322,13 +322,13 @@ QmlPropertyCache::property(int index) const
return indexCache.at(index);
}
-QmlPropertyCache::Data *
-QmlPropertyCache::property(const QString &str) const
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::property(const QString &str) const
{
return stringCache.value(str);
}
-QString QmlPropertyCache::Data::name(QObject *object)
+QString QDeclarativePropertyCache::Data::name(QObject *object)
{
if (!object)
return QString();
@@ -336,7 +336,7 @@ QString QmlPropertyCache::Data::name(QObject *object)
return name(object->metaObject());
}
-QString QmlPropertyCache::Data::name(const QMetaObject *metaObject)
+QString QDeclarativePropertyCache::Data::name(const QMetaObject *metaObject)
{
if (!metaObject || coreIndex == -1)
return QString();
@@ -355,20 +355,20 @@ QString QmlPropertyCache::Data::name(const QMetaObject *metaObject)
}
}
-QStringList QmlPropertyCache::propertyNames() const
+QStringList QDeclarativePropertyCache::propertyNames() const
{
return stringCache.keys();
}
-QmlPropertyCache::Data *QmlPropertyCache::property(QmlEngine *engine, QObject *obj,
+QDeclarativePropertyCache::Data *QDeclarativePropertyCache::property(QDeclarativeEngine *engine, QObject *obj,
const QScriptDeclarativeClass::Identifier &name, Data &local)
{
- QmlPropertyCache::Data *rv = 0;
+ QDeclarativePropertyCache::Data *rv = 0;
- QmlEnginePrivate *enginePrivate = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
- QmlPropertyCache *cache = 0;
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(obj);
+ QDeclarativePropertyCache *cache = 0;
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(obj);
if (ddata && ddata->propertyCache && ddata->propertyCache->qmlEngine() == engine)
cache = ddata->propertyCache;
if (!cache) {
@@ -379,7 +379,7 @@ QmlPropertyCache::Data *QmlPropertyCache::property(QmlEngine *engine, QObject *o
if (cache) {
rv = cache->property(name);
} else {
- local = QmlPropertyCache::create(obj->metaObject(), enginePrivate->objectClass->toString(name));
+ local = QDeclarativePropertyCache::create(obj->metaObject(), enginePrivate->objectClass->toString(name));
if (local.isValid())
rv = &local;
}
@@ -387,20 +387,20 @@ QmlPropertyCache::Data *QmlPropertyCache::property(QmlEngine *engine, QObject *o
return rv;
}
-QmlPropertyCache::Data *QmlPropertyCache::property(QmlEngine *engine, QObject *obj,
+QDeclarativePropertyCache::Data *QDeclarativePropertyCache::property(QDeclarativeEngine *engine, QObject *obj,
const QString &name, Data &local)
{
- QmlPropertyCache::Data *rv = 0;
+ QDeclarativePropertyCache::Data *rv = 0;
if (!engine) {
- local = QmlPropertyCache::create(obj->metaObject(), name);
+ local = QDeclarativePropertyCache::create(obj->metaObject(), name);
if (local.isValid())
rv = &local;
} else {
- QmlEnginePrivate *enginePrivate = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *enginePrivate = QDeclarativeEnginePrivate::get(engine);
- QmlPropertyCache *cache = 0;
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(obj);
+ QDeclarativePropertyCache *cache = 0;
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(obj);
if (ddata && ddata->propertyCache && ddata->propertyCache->qmlEngine() == engine)
cache = ddata->propertyCache;
if (!cache) {
@@ -411,7 +411,7 @@ QmlPropertyCache::Data *QmlPropertyCache::property(QmlEngine *engine, QObject *o
if (cache) {
rv = cache->property(name);
} else {
- local = QmlPropertyCache::create(obj->metaObject(), name);
+ local = QDeclarativePropertyCache::create(obj->metaObject(), name);
if (local.isValid())
rv = &local;
}
diff --git a/src/declarative/qml/qmlpropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index 4a98b88..7f4b174 100644
--- a/src/declarative/qml/qmlpropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLPROPERTYCACHE_P_H
-#define QMLPROPERTYCACHE_P_H
+#ifndef QDECLARATIVEPROPERTYCACHE_P_H
+#define QDECLARATIVEPROPERTYCACHE_P_H
//
// W A R N I N G
@@ -53,8 +53,8 @@
// We mean it.
//
-#include "qmlrefcount_p.h"
-#include "qmlcleanup_p.h"
+#include "qdeclarativerefcount_p.h"
+#include "qdeclarativecleanup_p.h"
#include <QtCore/qvector.h>
@@ -62,13 +62,13 @@
QT_BEGIN_NAMESPACE
-class QmlEngine;
+class QDeclarativeEngine;
class QMetaProperty;
-class QmlPropertyCache : public QmlRefCount, public QmlCleanup
+class QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
- QmlPropertyCache(QmlEngine *);
- virtual ~QmlPropertyCache();
+ QDeclarativePropertyCache(QDeclarativeEngine *);
+ virtual ~QDeclarativePropertyCache();
struct Data {
inline Data();
@@ -104,8 +104,8 @@ public:
int coreIndex;
int notifyIndex;
- static Flags flagsForProperty(const QMetaProperty &, QmlEngine *engine = 0);
- void load(const QMetaProperty &, QmlEngine *engine = 0);
+ static Flags flagsForProperty(const QMetaProperty &, QDeclarativeEngine *engine = 0);
+ void load(const QMetaProperty &, QDeclarativeEngine *engine = 0);
void load(const QMetaMethod &);
QString name(QObject *);
QString name(const QMetaObject *);
@@ -119,13 +119,13 @@ public:
int valueTypePropType; // The QVariant::Type of access property on the value type wrapper
};
- void update(QmlEngine *, const QMetaObject *);
+ void update(QDeclarativeEngine *, const QMetaObject *);
- QmlPropertyCache *copy() const;
- void append(QmlEngine *, const QMetaObject *, Data::Flag propertyFlags = Data::NoFlags,
+ QDeclarativePropertyCache *copy() const;
+ void append(QDeclarativeEngine *, const QMetaObject *, Data::Flag propertyFlags = Data::NoFlags,
Data::Flag methodFlags = Data::NoFlags);
- static QmlPropertyCache *create(QmlEngine *, const QMetaObject *);
+ static QDeclarativePropertyCache *create(QDeclarativeEngine *, const QMetaObject *);
static Data create(const QMetaObject *, const QString &);
inline Data *property(const QScriptDeclarativeClass::Identifier &id) const;
@@ -133,14 +133,14 @@ public:
Data *property(int) const;
QStringList propertyNames() const;
- inline QmlEngine *qmlEngine() const;
- static Data *property(QmlEngine *, QObject *, const QScriptDeclarativeClass::Identifier &, Data &);
- static Data *property(QmlEngine *, QObject *, const QString &, Data &);
+ inline QDeclarativeEngine *qmlEngine() const;
+ static Data *property(QDeclarativeEngine *, QObject *, const QScriptDeclarativeClass::Identifier &, Data &);
+ static Data *property(QDeclarativeEngine *, QObject *, const QString &, Data &);
protected:
virtual void clear();
private:
- struct RData : public Data, public QmlRefCount {
+ struct RData : public Data, public QDeclarativeRefCount {
QScriptDeclarativeClass::PersistentIdentifier identifier;
};
@@ -148,19 +148,19 @@ private:
typedef QHash<QString, RData *> StringCache;
typedef QHash<QScriptDeclarativeClass::Identifier, RData *> IdentifierCache;
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
IndexCache indexCache;
StringCache stringCache;
IdentifierCache identifierCache;
};
-Q_DECLARE_OPERATORS_FOR_FLAGS(QmlPropertyCache::Data::Flags);
+Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyCache::Data::Flags);
-QmlPropertyCache::Data::Data()
+QDeclarativePropertyCache::Data::Data()
: flags(0), propType(0), coreIndex(-1), notifyIndex(-1)
{
}
-bool QmlPropertyCache::Data::operator==(const QmlPropertyCache::Data &other)
+bool QDeclarativePropertyCache::Data::operator==(const QDeclarativePropertyCache::Data &other)
{
return flags == other.flags &&
propType == other.propType &&
@@ -168,29 +168,29 @@ bool QmlPropertyCache::Data::operator==(const QmlPropertyCache::Data &other)
notifyIndex == other.notifyIndex;
}
-QmlPropertyCache::Data *
-QmlPropertyCache::property(const QScriptDeclarativeClass::Identifier &id) const
+QDeclarativePropertyCache::Data *
+QDeclarativePropertyCache::property(const QScriptDeclarativeClass::Identifier &id) const
{
return identifierCache.value(id);
}
-QmlPropertyCache::ValueTypeData::ValueTypeData()
-: flags(QmlPropertyCache::Data::NoFlags), valueTypeCoreIdx(-1), valueTypePropType(0)
+QDeclarativePropertyCache::ValueTypeData::ValueTypeData()
+: flags(QDeclarativePropertyCache::Data::NoFlags), valueTypeCoreIdx(-1), valueTypePropType(0)
{
}
-bool QmlPropertyCache::ValueTypeData::operator==(const ValueTypeData &o)
+bool QDeclarativePropertyCache::ValueTypeData::operator==(const ValueTypeData &o)
{
return flags == o.flags &&
valueTypeCoreIdx == o.valueTypeCoreIdx &&
valueTypePropType == o.valueTypePropType;
}
-QmlEngine *QmlPropertyCache::qmlEngine() const
+QDeclarativeEngine *QDeclarativePropertyCache::qmlEngine() const
{
return engine;
}
QT_END_NAMESPACE
-#endif // QMLPROPERTYCACHE_P_H
+#endif // QDECLARATIVEPROPERTYCACHE_P_H
diff --git a/src/declarative/qml/qmlpropertyvalueinterceptor.cpp b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp
index ea53e16..7626d56 100644
--- a/src/declarative/qml/qmlpropertyvalueinterceptor.cpp
+++ b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include "qmlpropertyvalueinterceptor.h"
+#include "qdeclarativepropertyvalueinterceptor.h"
-#include "qml.h"
+#include "qdeclarative.h"
QT_BEGIN_NAMESPACE
/*!
- \class QmlPropertyValueInterceptor
- \brief The QmlPropertyValueInterceptor class is inherited by property interceptors such as Behavior.
+ \class QDeclarativePropertyValueInterceptor
+ \brief The QDeclarativePropertyValueInterceptor class is inherited by property interceptors such as Behavior.
\internal
This class intercepts property writes, allowing for custom handling. For example, Behavior uses this
@@ -55,24 +55,24 @@ QT_BEGIN_NAMESPACE
*/
/*!
- Constructs a QmlPropertyValueInterceptor.
+ Constructs a QDeclarativePropertyValueInterceptor.
*/
-QmlPropertyValueInterceptor::QmlPropertyValueInterceptor()
+QDeclarativePropertyValueInterceptor::QDeclarativePropertyValueInterceptor()
{
}
-QmlPropertyValueInterceptor::~QmlPropertyValueInterceptor()
+QDeclarativePropertyValueInterceptor::~QDeclarativePropertyValueInterceptor()
{
}
/*!
- \fn void QmlPropertyValueInterceptor::setTarget(const QmlMetaProperty &property)
+ \fn void QDeclarativePropertyValueInterceptor::setTarget(const QDeclarativeMetaProperty &property)
Set the target \a property for the value interceptor. This method will
be called by the QML engine when assigning a value interceptor.
*/
/*!
- \fn void QmlPropertyValueInterceptor::write(const QVariant &value)
+ \fn void QDeclarativePropertyValueInterceptor::write(const QVariant &value)
This method will be called when a new \a value is assigned to the property being intercepted.
*/
diff --git a/src/declarative/qml/qmlpropertyvalueinterceptor.h b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h
index 74cd5fa..2a29d5b 100644
--- a/src/declarative/qml/qmlpropertyvalueinterceptor.h
+++ b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLPROPERTYVALUEINTERCEPTOR_H
-#define QMLPROPERTYVALUEINTERCEPTOR_H
+#ifndef QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
+#define QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
#include <QtCore/qobject.h>
@@ -50,19 +50,19 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlMetaProperty;
-class Q_DECLARATIVE_EXPORT QmlPropertyValueInterceptor
+class QDeclarativeMetaProperty;
+class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueInterceptor
{
public:
- QmlPropertyValueInterceptor();
- virtual ~QmlPropertyValueInterceptor();
- virtual void setTarget(const QmlMetaProperty &property) = 0;
+ QDeclarativePropertyValueInterceptor();
+ virtual ~QDeclarativePropertyValueInterceptor();
+ virtual void setTarget(const QDeclarativeMetaProperty &property) = 0;
virtual void write(const QVariant &value) = 0;
};
-Q_DECLARE_INTERFACE(QmlPropertyValueInterceptor, "com.trolltech.qml.QmlPropertyValueInterceptor")
+Q_DECLARE_INTERFACE(QDeclarativePropertyValueInterceptor, "com.trolltech.qml.QDeclarativePropertyValueInterceptor")
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLPROPERTYVALUEINTERCEPTOR_H
+#endif // QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
diff --git a/src/declarative/qml/qmlpropertyvaluesource.cpp b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp
index bccdfb7..626e391 100644
--- a/src/declarative/qml/qmlpropertyvaluesource.cpp
+++ b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp
@@ -39,31 +39,31 @@
**
****************************************************************************/
-#include "qmlpropertyvaluesource.h"
+#include "qdeclarativepropertyvaluesource.h"
-#include "qml.h"
+#include "qdeclarative.h"
QT_BEGIN_NAMESPACE
/*!
- \class QmlPropertyValueSource
- \brief The QmlPropertyValueSource class is inherited by property value sources such as animations and bindings.
+ \class QDeclarativePropertyValueSource
+ \brief The QDeclarativePropertyValueSource class is inherited by property value sources such as animations and bindings.
\internal
*/
/*!
- Constructs a QmlPropertyValueSource.
+ Constructs a QDeclarativePropertyValueSource.
*/
-QmlPropertyValueSource::QmlPropertyValueSource()
+QDeclarativePropertyValueSource::QDeclarativePropertyValueSource()
{
}
-QmlPropertyValueSource::~QmlPropertyValueSource()
+QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource()
{
}
/*!
- \fn void QmlPropertyValueSource::setTarget(const QmlMetaProperty &property)
+ \fn void QDeclarativePropertyValueSource::setTarget(const QDeclarativeMetaProperty &property)
Set the target \a property for the value source. This method will
be called by the QML engine when assigning a value source.
*/
diff --git a/src/declarative/qml/qmlpropertyvaluesource.h b/src/declarative/qml/qdeclarativepropertyvaluesource.h
index fc53b8a..99c80af 100644
--- a/src/declarative/qml/qmlpropertyvaluesource.h
+++ b/src/declarative/qml/qdeclarativepropertyvaluesource.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLPROPERTYVALUESOURCE_H
-#define QMLPROPERTYVALUESOURCE_H
+#ifndef QDECLARATIVEPROPERTYVALUESOURCE_H
+#define QDECLARATIVEPROPERTYVALUESOURCE_H
#include <QtCore/qobject.h>
@@ -50,18 +50,18 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlMetaProperty;
-class Q_DECLARATIVE_EXPORT QmlPropertyValueSource
+class QDeclarativeMetaProperty;
+class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueSource
{
public:
- QmlPropertyValueSource();
- virtual ~QmlPropertyValueSource();
- virtual void setTarget(const QmlMetaProperty &) = 0;
+ QDeclarativePropertyValueSource();
+ virtual ~QDeclarativePropertyValueSource();
+ virtual void setTarget(const QDeclarativeMetaProperty &) = 0;
};
-Q_DECLARE_INTERFACE(QmlPropertyValueSource, "com.trolltech.qml.QmlPropertyValueSource")
+Q_DECLARE_INTERFACE(QDeclarativePropertyValueSource, "com.trolltech.qml.QDeclarativePropertyValueSource")
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLPROPERTYVALUESOURCE_H
+#endif // QDECLARATIVEPROPERTYVALUESOURCE_H
diff --git a/src/declarative/qml/qmlproxymetaobject.cpp b/src/declarative/qml/qdeclarativeproxymetaobject.cpp
index 29aad34..1decea1 100644
--- a/src/declarative/qml/qmlproxymetaobject.cpp
+++ b/src/declarative/qml/qdeclarativeproxymetaobject.cpp
@@ -39,17 +39,17 @@
**
****************************************************************************/
-#include "qmlproxymetaobject_p.h"
+#include "qdeclarativeproxymetaobject_p.h"
#include <QDebug>
QT_BEGIN_NAMESPACE
-QmlProxyMetaObject::QmlProxyMetaObject(QObject *obj, QList<ProxyData> *mList)
+QDeclarativeProxyMetaObject::QDeclarativeProxyMetaObject(QObject *obj, QList<ProxyData> *mList)
: metaObjects(mList), proxies(0), parent(0), object(obj)
{
-#ifdef QMLPROXYMETAOBJECT_DEBUG
- qWarning() << "QmlProxyMetaObject" << obj->metaObject()->className();
+#ifdef QDECLARATIVEPROXYMETAOBJECT_DEBUG
+ qWarning() << "QDeclarativeProxyMetaObject" << obj->metaObject()->className();
#endif
*static_cast<QMetaObject *>(this) = *metaObjects->first().metaObject;
@@ -60,7 +60,7 @@ QmlProxyMetaObject::QmlProxyMetaObject(QObject *obj, QList<ProxyData> *mList)
op->metaObject = this;
-#ifdef QMLPROXYMETAOBJECT_DEBUG
+#ifdef QDECLARATIVEPROXYMETAOBJECT_DEBUG
const QMetaObject *mo = obj->metaObject();
while(mo) {
qWarning() << " " << mo->className();
@@ -69,7 +69,7 @@ QmlProxyMetaObject::QmlProxyMetaObject(QObject *obj, QList<ProxyData> *mList)
#endif
}
-QmlProxyMetaObject::~QmlProxyMetaObject()
+QDeclarativeProxyMetaObject::~QDeclarativeProxyMetaObject()
{
if (parent)
delete parent;
@@ -80,7 +80,7 @@ QmlProxyMetaObject::~QmlProxyMetaObject()
proxies = 0;
}
-int QmlProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a)
+int QDeclarativeProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a)
{
if ((c == QMetaObject::ReadProperty ||
c == QMetaObject::WriteProperty) &&
diff --git a/src/declarative/qml/qmlproxymetaobject_p.h b/src/declarative/qml/qdeclarativeproxymetaobject_p.h
index 96cfbf5..3f103b6 100644
--- a/src/declarative/qml/qmlproxymetaobject_p.h
+++ b/src/declarative/qml/qdeclarativeproxymetaobject_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLPROXYMETAOBJECT_P_H
-#define QMLPROXYMETAOBJECT_P_H
+#ifndef QDECLARATIVEPROXYMETAOBJECT_P_H
+#define QDECLARATIVEPROXYMETAOBJECT_P_H
//
// W A R N I N G
@@ -54,7 +54,7 @@
//
#include "qmetaobjectbuilder_p.h"
-#include "qml.h"
+#include "qdeclarative.h"
#include <QtCore/QMetaObject>
#include <QtCore/QObject>
@@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class QmlProxyMetaObject : public QAbstractDynamicMetaObject
+class QDeclarativeProxyMetaObject : public QAbstractDynamicMetaObject
{
public:
struct ProxyData {
@@ -78,8 +78,8 @@ public:
int methodOffset;
};
- QmlProxyMetaObject(QObject *, QList<ProxyData> *);
- virtual ~QmlProxyMetaObject();
+ QDeclarativeProxyMetaObject(QObject *, QList<ProxyData> *);
+ virtual ~QDeclarativeProxyMetaObject();
protected:
virtual int metaCall(QMetaObject::Call _c, int _id, void **_a);
@@ -96,5 +96,5 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLPROXYMETAOBJECT_P_H
+#endif // QDECLARATIVEPROXYMETAOBJECT_P_H
diff --git a/src/declarative/qml/qmlrefcount.cpp b/src/declarative/qml/qdeclarativerefcount.cpp
index 76a6ab6..943e35c 100644
--- a/src/declarative/qml/qmlrefcount.cpp
+++ b/src/declarative/qml/qdeclarativerefcount.cpp
@@ -39,26 +39,26 @@
**
****************************************************************************/
-#include "qmlrefcount_p.h"
+#include "qdeclarativerefcount_p.h"
QT_BEGIN_NAMESPACE
-QmlRefCount::QmlRefCount()
+QDeclarativeRefCount::QDeclarativeRefCount()
: refCount(1)
{
}
-QmlRefCount::~QmlRefCount()
+QDeclarativeRefCount::~QDeclarativeRefCount()
{
}
-void QmlRefCount::addref()
+void QDeclarativeRefCount::addref()
{
Q_ASSERT(refCount > 0);
++refCount;
}
-void QmlRefCount::release()
+void QDeclarativeRefCount::release()
{
Q_ASSERT(refCount > 0);
--refCount;
diff --git a/src/declarative/qml/qmlrefcount_p.h b/src/declarative/qml/qdeclarativerefcount_p.h
index 9b2f52b..1170b86 100644
--- a/src/declarative/qml/qmlrefcount_p.h
+++ b/src/declarative/qml/qdeclarativerefcount_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLREFCOUNT_P_H
-#define QMLREFCOUNT_P_H
+#ifndef QDECLARATIVEREFCOUNT_P_H
+#define QDECLARATIVEREFCOUNT_P_H
//
// W A R N I N G
@@ -61,11 +61,11 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
-class Q_AUTOTEST_EXPORT QmlRefCount
+class Q_AUTOTEST_EXPORT QDeclarativeRefCount
{
public:
- QmlRefCount();
- virtual ~QmlRefCount();
+ QDeclarativeRefCount();
+ virtual ~QDeclarativeRefCount();
void addref();
void release();
@@ -77,4 +77,4 @@ QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLREFCOUNT_P_H
+#endif // QDECLARATIVEREFCOUNT_P_H
diff --git a/src/declarative/qml/qmlrewrite.cpp b/src/declarative/qml/qdeclarativerewrite.cpp
index d8a9350..afc6e63 100644
--- a/src/declarative/qml/qmlrewrite.cpp
+++ b/src/declarative/qml/qdeclarativerewrite.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qmlrewrite_p.h"
+#include "qdeclarativerewrite_p.h"
-#include "qmlglobal_p.h"
+#include "qdeclarativeglobal_p.h"
#include <QtCore/qdebug.h>
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(rewriteDump, QML_REWRITE_DUMP);
-namespace QmlRewrite {
+namespace QDeclarativeRewrite {
bool SharedBindingTester::isSharable(const QString &code)
{
@@ -210,6 +210,6 @@ void RewriteBinding::endVisit(AST::LocalForEachStatement *)
--_inLoop;
}
-} // namespace QmlRewrite
+} // namespace QDeclarativeRewrite
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmlrewrite_p.h b/src/declarative/qml/qdeclarativerewrite_p.h
index 27140ba..33b168c 100644
--- a/src/declarative/qml/qmlrewrite_p.h
+++ b/src/declarative/qml/qdeclarativerewrite_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLREWRITE_P_H
-#define QMLREWRITE_P_H
+#ifndef QDECLARATIVEREWRITE_P_H
+#define QDECLARATIVEREWRITE_P_H
//
// W A R N I N G
@@ -54,14 +54,14 @@
//
#include "rewriter/textwriter_p.h"
-#include "parser/qmljslexer_p.h"
-#include "parser/qmljsparser_p.h"
-#include "parser/qmljsnodepool_p.h"
+#include "parser/qdeclarativejslexer_p.h"
+#include "parser/qdeclarativejsparser_p.h"
+#include "parser/qdeclarativejsnodepool_p.h"
QT_BEGIN_NAMESPACE
-namespace QmlRewrite {
-using namespace QmlJS;
+namespace QDeclarativeRewrite {
+using namespace QDeclarativeJS;
class SharedBindingTester : protected AST::Visitor
{
@@ -113,9 +113,9 @@ private:
int _inLoop;
};
-} // namespace QmlRewrite
+} // namespace QDeclarativeRewrite
QT_END_NAMESPACE
-#endif // QMLREWRITE_P_H
+#endif // QDECLARATIVEREWRITE_P_H
diff --git a/src/declarative/qml/qmlscript.cpp b/src/declarative/qml/qdeclarativescript.cpp
index ef142a5..acfb9e1 100644
--- a/src/declarative/qml/qmlscript.cpp
+++ b/src/declarative/qml/qdeclarativescript.cpp
@@ -42,7 +42,7 @@
// This is just a dummy file to include the documentation
/*!
- \qmlclass Script QmlScript
+ \qmlclass Script QDeclarativeScript
\brief The Script element provides a way to add JavaScript code snippets in QML.
\ingroup group_utility
diff --git a/src/declarative/qml/qmlscriptclass_p.h b/src/declarative/qml/qdeclarativescriptclass_p.h
index e7ccc13..d8733db 100644
--- a/src/declarative/qml/qmlscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativescriptclass_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLSCRIPTCLASS_P_H
-#define QMLSCRIPTCLASS_P_H
+#ifndef QDECLARATIVESCRIPTCLASS_P_H
+#define QDECLARATIVESCRIPTCLASS_P_H
//
// W A R N I N G
@@ -58,13 +58,13 @@
QT_BEGIN_NAMESPACE
-class QmlEngine;
-class QmlScriptClass : public QScriptDeclarativeClass
+class QDeclarativeEngine;
+class QDeclarativeScriptClass : public QScriptDeclarativeClass
{
public:
- QmlScriptClass(QScriptEngine *);
+ QDeclarativeScriptClass(QScriptEngine *);
- static QVariant toVariant(QmlEngine *, const QScriptValue &);
+ static QVariant toVariant(QDeclarativeEngine *, const QScriptValue &);
#if (QT_VERSION <= QT_VERSION_CHECK(4, 6, 2)) && !defined(QT_HAVE_QSCRIPTDECLARATIVECLASS_VALUE)
struct Value : public QScriptValue {
@@ -86,4 +86,4 @@ public:
QT_END_NAMESPACE
-#endif // QMLSCRIPTCLASS_P_H
+#endif // QDECLARATIVESCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index c0d5cf9..9636350 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#include "qmlscriptparser_p.h"
+#include "qdeclarativescriptparser_p.h"
-#include "qmlparser_p.h"
-#include "parser/qmljsengine_p.h"
-#include "parser/qmljsparser_p.h"
-#include "parser/qmljslexer_p.h"
-#include "parser/qmljsnodepool_p.h"
-#include "parser/qmljsastvisitor_p.h"
-#include "parser/qmljsast_p.h"
-#include "qmlrewrite_p.h"
+#include "qdeclarativeparser_p.h"
+#include "parser/qdeclarativejsengine_p.h"
+#include "parser/qdeclarativejsparser_p.h"
+#include "parser/qdeclarativejslexer_p.h"
+#include "parser/qdeclarativejsnodepool_p.h"
+#include "parser/qdeclarativejsastvisitor_p.h"
+#include "parser/qdeclarativejsast_p.h"
+#include "qdeclarativerewrite_p.h"
#include <qfxperf_p_p.h>
@@ -58,8 +58,8 @@
QT_BEGIN_NAMESPACE
-using namespace QmlJS;
-using namespace QmlParser;
+using namespace QDeclarativeJS;
+using namespace QDeclarativeParser;
namespace {
@@ -100,7 +100,7 @@ class ProcessAST: protected AST::Visitor
};
public:
- ProcessAST(QmlScriptParser *parser);
+ ProcessAST(QDeclarativeScriptParser *parser);
virtual ~ProcessAST();
void operator()(const QString &code, AST::Node *node);
@@ -117,7 +117,7 @@ protected:
LocationSpan location,
AST::UiObjectInitializer *initializer = 0);
- QmlParser::Variant getVariant(AST::ExpressionNode *expr);
+ QDeclarativeParser::Variant getVariant(AST::ExpressionNode *expr);
LocationSpan location(AST::SourceLocation start, AST::SourceLocation end);
LocationSpan location(AST::UiQualifiedId *);
@@ -172,7 +172,7 @@ protected:
}
private:
- QmlScriptParser *_parser;
+ QDeclarativeScriptParser *_parser;
StateStack _stateStack;
QStringList _scope;
QString _contents;
@@ -184,7 +184,7 @@ private:
};
-ProcessAST::ProcessAST(QmlScriptParser *parser)
+ProcessAST::ProcessAST(QDeclarativeScriptParser *parser)
: _parser(parser)
{
}
@@ -263,8 +263,8 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
if (!isType) {
if(propertyCount || !currentObject()) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Expected type name"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected type name"));
error.setLine(typeLocation.startLine);
error.setColumn(typeLocation.startColumn);
_parser->_errors << error;
@@ -292,8 +292,8 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
if (isScript) {
if (_stateStack.isEmpty() || _stateStack.top().property) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Invalid use of Script block"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid use of Script block"));
error.setLine(typeLocation.startLine);
error.setColumn(typeLocation.startColumn);
_parser->_errors << error;
@@ -304,7 +304,7 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
Object *obj = new Object;
if (!isScript) {
- QmlScriptParser::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType);
+ QDeclarativeScriptParser::TypeReference *typeRef = _parser->findOrCreateType(resolvableObjectType);
obj->type = typeRef->id;
typeRef->refObjects.append(obj);
@@ -382,7 +382,7 @@ Object *ProcessAST::defineObjectBinding(AST::UiQualifiedId *qualifiedId,
QString propertyName = asString(scriptBinding->qualifiedId);
if (propertyName == QLatin1String("source")) {
if (AST::ExpressionStatement *stmt = AST::cast<AST::ExpressionStatement *>(scriptBinding->statement)) {
- QmlParser::Variant string = getVariant(stmt->expression);
+ QDeclarativeParser::Variant string = getVariant(stmt->expression);
if (string.isStringList()) {
QStringList urls = string.asStringList();
// We need to add this as a resource
@@ -427,13 +427,13 @@ bool ProcessAST::visit(AST::UiProgram *node)
bool ProcessAST::visit(AST::UiImport *node)
{
QString uri;
- QmlScriptParser::Import import;
+ QDeclarativeScriptParser::Import import;
if (node->fileName) {
- import.type = QmlScriptParser::Import::File;
+ import.type = QDeclarativeScriptParser::Import::File;
uri = node->fileName->asString();
} else {
- import.type = QmlScriptParser::Import::Library;
+ import.type = QDeclarativeScriptParser::Import::Library;
uri = asString(node->importUri);
}
@@ -443,8 +443,8 @@ bool ProcessAST::visit(AST::UiImport *node)
if (node->importId) {
import.qualifier = node->importId->asString();
if (!import.qualifier.at(0).isUpper()) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Invalid import qualifier ID"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid import qualifier ID"));
error.setLine(node->importIdToken.startLine);
error.setColumn(node->importIdToken.startColumn);
_parser->_errors << error;
@@ -453,9 +453,9 @@ bool ProcessAST::visit(AST::UiImport *node)
}
if (node->versionToken.isValid())
import.version = textAt(node->versionToken);
- else if (import.type == QmlScriptParser::Import::Library) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Library import requires a version"));
+ else if (import.type == QDeclarativeScriptParser::Import::Library) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Library import requires a version"));
error.setLine(node->importIdToken.startLine);
error.setColumn(node->importIdToken.startColumn);
_parser->_errors << error;
@@ -507,8 +507,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
}
if (!qtType) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Expected parameter type"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected parameter type"));
error.setLine(node->typeToken.startLine);
error.setColumn(node->typeToken.startColumn);
_parser->_errors << error;
@@ -549,8 +549,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
} else if(typemodifier == QLatin1String("list")) {
type = Object::DynamicProperty::CustomList;
} else {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Invalid property type modifier"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Invalid property type modifier"));
error.setLine(node->typeModifierToken.startLine);
error.setColumn(node->typeModifierToken.startColumn);
_parser->_errors << error;
@@ -558,8 +558,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
}
typeFound = true;
} else if (node->typeModifier) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Unexpected property type modifier"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Unexpected property type modifier"));
error.setLine(node->typeModifierToken.startLine);
error.setColumn(node->typeModifierToken.startColumn);
_parser->_errors << error;
@@ -567,8 +567,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
}
if(!typeFound) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Expected property type"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Expected property type"));
error.setLine(node->typeToken.startLine);
error.setColumn(node->typeToken.startColumn);
_parser->_errors << error;
@@ -576,8 +576,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
}
if (node->isReadonlyMember) {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","Readonly not yet supported"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Readonly not yet supported"));
error.setLine(node->readonlyToken.startLine);
error.setColumn(node->readonlyToken.startColumn);
_parser->_errors << error;
@@ -588,7 +588,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
property.isDefaultProperty = node->isDefaultMember;
property.type = type;
if (type >= Object::DynamicProperty::Custom) {
- QmlScriptParser::TypeReference *typeRef =
+ QDeclarativeScriptParser::TypeReference *typeRef =
_parser->findOrCreateType(memberType);
typeRef->refObjects.append(_stateStack.top().object);
}
@@ -646,25 +646,25 @@ bool ProcessAST::visit(AST::UiObjectBinding *node)
return false;
}
-QmlParser::Variant ProcessAST::getVariant(AST::ExpressionNode *expr)
+QDeclarativeParser::Variant ProcessAST::getVariant(AST::ExpressionNode *expr)
{
if (AST::StringLiteral *lit = AST::cast<AST::StringLiteral *>(expr)) {
- return QmlParser::Variant(lit->value->asString());
+ return QDeclarativeParser::Variant(lit->value->asString());
} else if (expr->kind == AST::Node::Kind_TrueLiteral) {
- return QmlParser::Variant(true);
+ return QDeclarativeParser::Variant(true);
} else if (expr->kind == AST::Node::Kind_FalseLiteral) {
- return QmlParser::Variant(false);
+ return QDeclarativeParser::Variant(false);
} else if (AST::NumericLiteral *lit = AST::cast<AST::NumericLiteral *>(expr)) {
- return QmlParser::Variant(lit->value, asString(expr));
+ return QDeclarativeParser::Variant(lit->value, asString(expr));
} else {
if (AST::UnaryMinusExpression *unaryMinus = AST::cast<AST::UnaryMinusExpression *>(expr)) {
if (AST::NumericLiteral *lit = AST::cast<AST::NumericLiteral *>(unaryMinus->expression)) {
- return QmlParser::Variant(-lit->value, asString(expr));
+ return QDeclarativeParser::Variant(-lit->value, asString(expr));
}
}
- return QmlParser::Variant(asString(expr), expr);
+ return QDeclarativeParser::Variant(asString(expr), expr);
}
}
@@ -682,12 +682,12 @@ bool ProcessAST::visit(AST::UiScriptBinding *node)
Property *prop = currentProperty();
- QmlParser::Variant primitive;
+ QDeclarativeParser::Variant primitive;
if (AST::ExpressionStatement *stmt = AST::cast<AST::ExpressionStatement *>(node->statement)) {
primitive = getVariant(stmt->expression);
} else { // do binding
- primitive = QmlParser::Variant(asString(node->statement),
+ primitive = QDeclarativeParser::Variant(asString(node->statement),
node->statement);
}
@@ -748,7 +748,7 @@ bool ProcessAST::visit(AST::UiArrayBinding *node)
bool ProcessAST::visit(AST::UiSourceElement *node)
{
- QmlParser::Object *obj = currentObject();
+ QDeclarativeParser::Object *obj = currentObject();
bool isScript = (obj && obj->typeName == "Script");
@@ -770,8 +770,8 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
obj->dynamicSlots << slot;
} else {
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser","QmlJS declaration outside Script element"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","QDeclarativeJS declaration outside Script element"));
error.setLine(node->firstSourceLocation().startLine);
error.setColumn(node->firstSourceLocation().startColumn);
_parser->_errors << error;
@@ -789,8 +789,8 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
// ignore variable declarations
line = varStmt->declarationKindToken.startLine;
- QmlError error;
- error.setDescription(QCoreApplication::translate("QmlParser", "Variable declarations not allow in inline Script blocks"));
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser", "Variable declarations not allow in inline Script blocks"));
error.setLine(node->firstSourceLocation().startLine);
error.setColumn(node->firstSourceLocation().startColumn);
_parser->_errors << error;
@@ -800,7 +800,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
Value *value = new Value;
value->location = location(node->firstSourceLocation(),
node->lastSourceLocation());
- value->value = QmlParser::Variant(source);
+ value->value = QDeclarativeParser::Variant(source);
obj->getDefaultProperty()->addValue(value);
}
@@ -811,31 +811,31 @@ bool ProcessAST::visit(AST::UiSourceElement *node)
} // end of anonymous namespace
-QmlScriptParser::QmlScriptParser()
+QDeclarativeScriptParser::QDeclarativeScriptParser()
: root(0), data(0)
{
}
-QmlScriptParser::~QmlScriptParser()
+QDeclarativeScriptParser::~QDeclarativeScriptParser()
{
clear();
}
-class QmlScriptParserJsASTData
+class QDeclarativeScriptParserJsASTData
{
public:
- QmlScriptParserJsASTData(const QString &filename)
+ QDeclarativeScriptParserJsASTData(const QString &filename)
: nodePool(filename, &engine) {}
Engine engine;
NodePool nodePool;
};
-bool QmlScriptParser::parse(const QByteArray &qmldata, const QUrl &url)
+bool QDeclarativeScriptParser::parse(const QByteArray &qmldata, const QUrl &url)
{
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QmlPerfTimer<QmlPerf::QmlParsing> pt;
+ QDeclarativePerfTimer<QDeclarativePerf::QDeclarativeParsing> pt;
#endif
clear();
@@ -845,7 +845,7 @@ bool QmlScriptParser::parse(const QByteArray &qmldata, const QUrl &url)
stream.setCodec("UTF-8");
const QString code = stream.readAll();
- data = new QmlScriptParserJsASTData(fileName);
+ data = new QDeclarativeScriptParserJsASTData(fileName);
Lexer lexer(&data->engine);
lexer.setCode(code, /*line = */ 1);
@@ -860,7 +860,7 @@ bool QmlScriptParser::parse(const QByteArray &qmldata, const QUrl &url)
if (m.isWarning())
continue;
- QmlError error;
+ QDeclarativeError error;
error.setUrl(url);
error.setDescription(m.message);
error.setLine(m.loc.startLine);
@@ -882,32 +882,32 @@ bool QmlScriptParser::parse(const QByteArray &qmldata, const QUrl &url)
return _errors.isEmpty();
}
-QList<QmlScriptParser::TypeReference*> QmlScriptParser::referencedTypes() const
+QList<QDeclarativeScriptParser::TypeReference*> QDeclarativeScriptParser::referencedTypes() const
{
return _refTypes;
}
-QList<QUrl> QmlScriptParser::referencedResources() const
+QList<QUrl> QDeclarativeScriptParser::referencedResources() const
{
return _refUrls;
}
-Object *QmlScriptParser::tree() const
+Object *QDeclarativeScriptParser::tree() const
{
return root;
}
-QList<QmlScriptParser::Import> QmlScriptParser::imports() const
+QList<QDeclarativeScriptParser::Import> QDeclarativeScriptParser::imports() const
{
return _imports;
}
-QList<QmlError> QmlScriptParser::errors() const
+QList<QDeclarativeError> QDeclarativeScriptParser::errors() const
{
return _errors;
}
-void QmlScriptParser::clear()
+void QDeclarativeScriptParser::clear()
{
if (root) {
root->release();
@@ -924,7 +924,7 @@ void QmlScriptParser::clear()
}
}
-QmlScriptParser::TypeReference *QmlScriptParser::findOrCreateType(const QString &name)
+QDeclarativeScriptParser::TypeReference *QDeclarativeScriptParser::findOrCreateType(const QString &name)
{
TypeReference *type = 0;
int i = 0;
@@ -942,7 +942,7 @@ QmlScriptParser::TypeReference *QmlScriptParser::findOrCreateType(const QString
return type;
}
-void QmlScriptParser::setTree(Object *tree)
+void QDeclarativeScriptParser::setTree(Object *tree)
{
Q_ASSERT(! root);
diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qdeclarativescriptparser_p.h
index b420b9a..b8f77d1 100644
--- a/src/declarative/qml/qmlscriptparser_p.h
+++ b/src/declarative/qml/qdeclarativescriptparser_p.h
@@ -38,8 +38,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QMLSCRIPTPARSER_P_H
-#define QMLSCRIPTPARSER_P_H
+#ifndef QDECLARATIVESCRIPTPARSER_P_H
+#define QDECLARATIVESCRIPTPARSER_P_H
//
// W A R N I N G
@@ -52,8 +52,8 @@
// We mean it.
//
-#include "qmlerror.h"
-#include "qmlparser_p.h"
+#include "qdeclarativeerror.h"
+#include "qdeclarativeparser_p.h"
#include <QtCore/QList>
#include <QtCore/QUrl>
@@ -66,8 +66,8 @@ QT_MODULE(Declarative)
class QByteArray;
-class QmlScriptParserJsASTData;
-class QmlScriptParser
+class QDeclarativeScriptParserJsASTData;
+class QDeclarativeScriptParser
{
public:
class Import
@@ -82,7 +82,7 @@ public:
QString qualifier;
QString version;
- QmlParser::LocationSpan location;
+ QDeclarativeParser::LocationSpan location;
};
class TypeReference
@@ -94,44 +94,44 @@ public:
// type as it has been referenced in Qml
QString name;
// objects in parse tree referencing the type
- QList<QmlParser::Object*> refObjects;
+ QList<QDeclarativeParser::Object*> refObjects;
};
- QmlScriptParser();
- ~QmlScriptParser();
+ QDeclarativeScriptParser();
+ ~QDeclarativeScriptParser();
bool parse(const QByteArray &data, const QUrl &url = QUrl());
QList<TypeReference*> referencedTypes() const;
QList<QUrl> referencedResources() const;
- QmlParser::Object *tree() const;
+ QDeclarativeParser::Object *tree() const;
QList<Import> imports() const;
void clear();
- QList<QmlError> errors() const;
+ QList<QDeclarativeError> errors() const;
// ### private:
TypeReference *findOrCreateType(const QString &name);
- void setTree(QmlParser::Object *tree);
+ void setTree(QDeclarativeParser::Object *tree);
void setScriptFile(const QString &filename) {_scriptFile = filename; }
QString scriptFile() const { return _scriptFile; }
// ### private:
- QList<QmlError> _errors;
+ QList<QDeclarativeError> _errors;
- QmlParser::Object *root;
+ QDeclarativeParser::Object *root;
QList<Import> _imports;
QList<TypeReference*> _refTypes;
QList<QUrl> _refUrls;
QString _scriptFile;
- QmlScriptParserJsASTData *data;
+ QDeclarativeScriptParserJsASTData *data;
};
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QMLSCRIPTPARSER_P_H
+#endif // QDECLARATIVESCRIPTPARSER_P_H
diff --git a/src/declarative/qml/qmlscriptstring.cpp b/src/declarative/qml/qdeclarativescriptstring.cpp
index a80f66b..5b9afe9 100644
--- a/src/declarative/qml/qmlscriptstring.cpp
+++ b/src/declarative/qml/qdeclarativescriptstring.cpp
@@ -39,29 +39,29 @@
**
****************************************************************************/
-#include "qmlscriptstring.h"
+#include "qdeclarativescriptstring.h"
QT_BEGIN_NAMESPACE
-class QmlScriptStringPrivate : public QSharedData
+class QDeclarativeScriptStringPrivate : public QSharedData
{
public:
- QmlScriptStringPrivate() : context(0), scope(0) {}
+ QDeclarativeScriptStringPrivate() : context(0), scope(0) {}
- QmlContext *context;
+ QDeclarativeContext *context;
QObject *scope;
QString script;
};
/*!
-\class QmlScriptString
+\class QDeclarativeScriptString
\since 4.7
-\brief The QmlScriptString class encapsulates a script and its context.
+\brief The QDeclarativeScriptString class encapsulates a script and its context.
-The QmlScriptString is used by properties that want to accept a script "assignment" from QML.
+The QDeclarativeScriptString is used by properties that want to accept a script "assignment" from QML.
Normally, the following code would result in a binding being established for the \c script
-property. If the property had a type of QmlScriptString, the script - \e {console.log(1921)} - itself
+property. If the property had a type of QDeclarativeScriptString, the script - \e {console.log(1921)} - itself
would be passed to the property and it could choose how to handle it.
\code
@@ -74,15 +74,15 @@ MyType {
/*!
Construct an empty instance.
*/
-QmlScriptString::QmlScriptString()
-: d(new QmlScriptStringPrivate)
+QDeclarativeScriptString::QDeclarativeScriptString()
+: d(new QDeclarativeScriptStringPrivate)
{
}
/*!
Copy \a other.
*/
-QmlScriptString::QmlScriptString(const QmlScriptString &other)
+QDeclarativeScriptString::QDeclarativeScriptString(const QDeclarativeScriptString &other)
: d(other.d)
{
}
@@ -90,14 +90,14 @@ QmlScriptString::QmlScriptString(const QmlScriptString &other)
/*!
\internal
*/
-QmlScriptString::~QmlScriptString()
+QDeclarativeScriptString::~QDeclarativeScriptString()
{
}
/*!
Assign \a other to this.
*/
-QmlScriptString &QmlScriptString::operator=(const QmlScriptString &other)
+QDeclarativeScriptString &QDeclarativeScriptString::operator=(const QDeclarativeScriptString &other)
{
d = other.d;
return *this;
@@ -106,7 +106,7 @@ QmlScriptString &QmlScriptString::operator=(const QmlScriptString &other)
/*!
Return the context for the script.
*/
-QmlContext *QmlScriptString::context() const
+QDeclarativeContext *QDeclarativeScriptString::context() const
{
return d->context;
}
@@ -114,7 +114,7 @@ QmlContext *QmlScriptString::context() const
/*!
Sets the \a context for the script.
*/
-void QmlScriptString::setContext(QmlContext *context)
+void QDeclarativeScriptString::setContext(QDeclarativeContext *context)
{
d->context = context;
}
@@ -122,7 +122,7 @@ void QmlScriptString::setContext(QmlContext *context)
/*!
Returns the scope object for the script.
*/
-QObject *QmlScriptString::scopeObject() const
+QObject *QDeclarativeScriptString::scopeObject() const
{
return d->scope;
}
@@ -130,7 +130,7 @@ QObject *QmlScriptString::scopeObject() const
/*!
Sets the scope \a object for the script.
*/
-void QmlScriptString::setScopeObject(QObject *object)
+void QDeclarativeScriptString::setScopeObject(QObject *object)
{
d->scope = object;
}
@@ -138,7 +138,7 @@ void QmlScriptString::setScopeObject(QObject *object)
/*!
Returns the script text.
*/
-QString QmlScriptString::script() const
+QString QDeclarativeScriptString::script() const
{
return d->script;
}
@@ -146,7 +146,7 @@ QString QmlScriptString::script() const
/*!
Sets the \a script text.
*/
-void QmlScriptString::setScript(const QString &script)
+void QDeclarativeScriptString::setScript(const QString &script)
{
d->script = script;
}
diff --git a/src/declarative/qml/qmlscriptstring.h b/src/declarative/qml/qdeclarativescriptstring.h
index 1789eb5..43bef44 100644
--- a/src/declarative/qml/qmlscriptstring.h
+++ b/src/declarative/qml/qdeclarativescriptstring.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLSCRIPTSTRING_H
-#define QMLSCRIPTSTRING_H
+#ifndef QDECLARATIVESCRIPTSTRING_H
+#define QDECLARATIVESCRIPTSTRING_H
#include <QtCore/qstring.h>
#include <QtCore/qshareddata.h>
@@ -53,19 +53,19 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QObject;
-class QmlContext;
-class QmlScriptStringPrivate;
-class Q_DECLARATIVE_EXPORT QmlScriptString
+class QDeclarativeContext;
+class QDeclarativeScriptStringPrivate;
+class Q_DECLARATIVE_EXPORT QDeclarativeScriptString
{
public:
- QmlScriptString();
- QmlScriptString(const QmlScriptString &);
- ~QmlScriptString();
+ QDeclarativeScriptString();
+ QDeclarativeScriptString(const QDeclarativeScriptString &);
+ ~QDeclarativeScriptString();
- QmlScriptString &operator=(const QmlScriptString &);
+ QDeclarativeScriptString &operator=(const QDeclarativeScriptString &);
- QmlContext *context() const;
- void setContext(QmlContext *);
+ QDeclarativeContext *context() const;
+ void setContext(QDeclarativeContext *);
QObject *scopeObject() const;
void setScopeObject(QObject *);
@@ -74,14 +74,14 @@ public:
void setScript(const QString &);
private:
- QSharedDataPointer<QmlScriptStringPrivate> d;
+ QSharedDataPointer<QDeclarativeScriptStringPrivate> d;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QmlScriptString);
+Q_DECLARE_METATYPE(QDeclarativeScriptString);
QT_END_HEADER
-#endif // QMLSCRIPTSTRING_H
+#endif // QDECLARATIVESCRIPTSTRING_H
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qdeclarativesqldatabase.cpp
index 4e0e0fb..855d623 100644
--- a/src/declarative/qml/qmlsqldatabase.cpp
+++ b/src/declarative/qml/qdeclarativesqldatabase.cpp
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#include "qmlsqldatabase_p.h"
+#include "qdeclarativesqldatabase_p.h"
-#include "qmlengine.h"
-#include "qmlengine_p.h"
-#include "qmlrefcount_p.h"
-#include "qmlengine_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativerefcount_p.h"
+#include "qdeclarativeengine_p.h"
#include <QtCore/qobject.h>
#include <QtScript/qscriptvalue.h>
@@ -67,9 +67,9 @@ Q_DECLARE_METATYPE(QSqlQuery)
QT_BEGIN_NAMESPACE
-class QmlSqlQueryScriptClass: public QScriptClass {
+class QDeclarativeSqlQueryScriptClass: public QScriptClass {
public:
- QmlSqlQueryScriptClass(QScriptEngine *engine) : QScriptClass(engine)
+ QDeclarativeSqlQueryScriptClass(QScriptEngine *engine) : QScriptClass(engine)
{
str_length = engine->toStringHandle(QLatin1String("length"));
str_forwardOnly = engine->toStringHandle(QLatin1String("forwardOnly")); // not in HTML5 (an optimization)
@@ -138,7 +138,7 @@ private:
};
// If the spec changes to allow iteration, check git history...
-// class QmlSqlQueryScriptClassPropertyIterator : public QScriptClassPropertyIterator
+// class QDeclarativeSqlQueryScriptClassPropertyIterator : public QScriptClassPropertyIterator
@@ -175,7 +175,7 @@ static const char* sqlerror[] = {
static QString databaseFile(const QString& connectionName, QScriptEngine *engine)
{
- QmlScriptEngine *qmlengine = static_cast<QmlScriptEngine*>(engine);
+ QDeclarativeScriptEngine *qmlengine = static_cast<QDeclarativeScriptEngine*>(engine);
QString basename = qmlengine->offlineStoragePath
+ QDir::separator() + QLatin1String("Databases") + QDir::separator();
basename += connectionName;
@@ -201,7 +201,7 @@ static QScriptValue qmlsqldatabase_item(QScriptContext *context, QScriptEngine *
static QScriptValue qmlsqldatabase_executeSql_outsidetransaction(QScriptContext *context, QScriptEngine * /*engine*/)
{
- THROW_SQL(DATABASE_ERR,QmlEngine::tr("executeSql called outside transaction()"));
+ THROW_SQL(DATABASE_ERR,QDeclarativeEngine::tr("executeSql called outside transaction()"));
}
static QScriptValue qmlsqldatabase_executeSql(QScriptContext *context, QScriptEngine *engine)
@@ -227,9 +227,9 @@ static QScriptValue qmlsqldatabase_executeSql(QScriptContext *context, QScriptEn
}
if (query.exec()) {
result = engine->newObject();
- QmlScriptEngine *qmlengine = static_cast<QmlScriptEngine*>(engine);
+ QDeclarativeScriptEngine *qmlengine = static_cast<QDeclarativeScriptEngine*>(engine);
if (!qmlengine->sqlQueryClass)
- qmlengine->sqlQueryClass = new QmlSqlQueryScriptClass(engine);
+ qmlengine->sqlQueryClass = new QDeclarativeSqlQueryScriptClass(engine);
QScriptValue rows = engine->newObject(qmlengine->sqlQueryClass);
rows.setData(engine->newVariant(qVariantFromValue(query)));
rows.setProperty(QLatin1String("item"), engine->newFunction(qmlsqldatabase_item,1), QScriptValue::SkipInEnumeration);
@@ -253,7 +253,7 @@ static QScriptValue qmlsqldatabase_executeSql_readonly(QScriptContext *context,
if (sql.startsWith(QLatin1String("SELECT"),Qt::CaseInsensitive)) {
return qmlsqldatabase_executeSql(context,engine);
} else {
- THROW_SQL(SYNTAX_ERR,QmlEngine::tr("Read-only Transaction"))
+ THROW_SQL(SYNTAX_ERR,QDeclarativeEngine::tr("Read-only Transaction"))
}
}
@@ -273,7 +273,7 @@ static QScriptValue qmlsqldatabase_change_version(QScriptContext *context, QScri
QString foundvers = context->thisObject().property(QLatin1String("version")).toString();
if (from_version!=foundvers) {
- THROW_SQL(2,QmlEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(foundvers));
+ THROW_SQL(2,QDeclarativeEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(foundvers));
return engine->undefinedValue();
}
@@ -287,7 +287,7 @@ static QScriptValue qmlsqldatabase_change_version(QScriptContext *context, QScri
} else {
if (!db.commit()) {
db.rollback();
- THROW_SQL(0,QmlEngine::tr("SQL transaction failed"));
+ THROW_SQL(0,QDeclarativeEngine::tr("SQL transaction failed"));
} else {
ok = true;
}
@@ -308,7 +308,7 @@ static QScriptValue qmlsqldatabase_transaction_shared(QScriptContext *context, Q
QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject());
QScriptValue callback = context->argument(0);
if (!callback.isFunction())
- THROW_SQL(UNKNOWN_ERR,QmlEngine::tr("transaction: missing callback"));
+ THROW_SQL(UNKNOWN_ERR,QDeclarativeEngine::tr("transaction: missing callback"));
QScriptValue instance = engine->newObject();
instance.setProperty(QLatin1String("executeSql"),
@@ -365,7 +365,7 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng
database = QSqlDatabase::database(dbid);
version = ini.value(QLatin1String("Version")).toString();
if (version != dbversion && !dbversion.isEmpty() && !version.isEmpty())
- THROW_SQL(VERSION_ERR,QmlEngine::tr("SQL: database version mismatch"));
+ THROW_SQL(VERSION_ERR,QDeclarativeEngine::tr("SQL: database version mismatch"));
} else {
created = !QFile::exists(basename+QLatin1String(".sqlite"));
database = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), dbid);
@@ -381,7 +381,7 @@ static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEng
} else {
if (!dbversion.isEmpty() && ini.value(QLatin1String("Version")) != dbversion) {
// Incompatible
- THROW_SQL(VERSION_ERR,QmlEngine::tr("SQL: database version mismatch"));
+ THROW_SQL(VERSION_ERR,QDeclarativeEngine::tr("SQL: database version mismatch"));
}
version = ini.value(QLatin1String("Version")).toString();
}
diff --git a/src/declarative/qml/qmlsqldatabase_p.h b/src/declarative/qml/qdeclarativesqldatabase_p.h
index 0fd275b..d0b6c0b 100644
--- a/src/declarative/qml/qmlsqldatabase_p.h
+++ b/src/declarative/qml/qdeclarativesqldatabase_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLSQLDATABASE_P_H
-#define QMLSQLDATABASE_P_H
+#ifndef QDECLARATIVESQLDATABASE_P_H
+#define QDECLARATIVESQLDATABASE_P_H
#include <QtScript/qscriptengine.h>
//
@@ -63,5 +63,5 @@ void qt_add_qmlsqldatabase(QScriptEngine *engine);
QT_END_NAMESPACE
-#endif // QMLSQLDATABASE_P_H
+#endif // QDECLARATIVESQLDATABASE_P_H
diff --git a/src/declarative/qml/qmlstringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp
index 6ba70d3..f3497e5 100644
--- a/src/declarative/qml/qmlstringconverters.cpp
+++ b/src/declarative/qml/qdeclarativestringconverters.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qmlstringconverters_p.h"
+#include "qdeclarativestringconverters_p.h"
#include <QtGui/qcolor.h>
#include <QtGui/qvector3d.h>
@@ -78,7 +78,7 @@ static uchar fromHex(const QString &s, int idx)
return fromHex(c, c2);
}
-QVariant QmlStringConverters::variantFromString(const QString &s)
+QVariant QDeclarativeStringConverters::variantFromString(const QString &s)
{
if (s.isEmpty())
return QVariant(s);
@@ -101,7 +101,7 @@ QVariant QmlStringConverters::variantFromString(const QString &s)
return QVariant(s);
}
-QVariant QmlStringConverters::variantFromString(const QString &s, int preferredType, bool *ok)
+QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int preferredType, bool *ok)
{
switch (preferredType) {
case QMetaType::QColor:
@@ -132,7 +132,7 @@ QVariant QmlStringConverters::variantFromString(const QString &s, int preferredT
}
}
-QColor QmlStringConverters::colorFromString(const QString &s, bool *ok)
+QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok)
{
if (s.startsWith(QLatin1Char('#')) && s.length() == 9) {
uchar a = fromHex(s, 1);
@@ -150,21 +150,21 @@ QColor QmlStringConverters::colorFromString(const QString &s, bool *ok)
}
}
-QDate QmlStringConverters::dateFromString(const QString &s, bool *ok)
+QDate QDeclarativeStringConverters::dateFromString(const QString &s, bool *ok)
{
QDate d = QDate::fromString(s, Qt::ISODate);
if (ok) *ok = d.isValid();
return d;
}
-QTime QmlStringConverters::timeFromString(const QString &s, bool *ok)
+QTime QDeclarativeStringConverters::timeFromString(const QString &s, bool *ok)
{
QTime t = QTime::fromString(s, Qt::ISODate);
if (ok) *ok = t.isValid();
return t;
}
-QDateTime QmlStringConverters::dateTimeFromString(const QString &s, bool *ok)
+QDateTime QDeclarativeStringConverters::dateTimeFromString(const QString &s, bool *ok)
{
QDateTime d = QDateTime::fromString(s, Qt::ISODate);
if (ok) *ok = d.isValid();
@@ -172,7 +172,7 @@ QDateTime QmlStringConverters::dateTimeFromString(const QString &s, bool *ok)
}
//expects input of "x,y"
-QPointF QmlStringConverters::pointFFromString(const QString &s, bool *ok)
+QPointF QDeclarativeStringConverters::pointFFromString(const QString &s, bool *ok)
{
if (s.count(QLatin1Char(',')) != 1) {
if (ok)
@@ -196,7 +196,7 @@ QPointF QmlStringConverters::pointFFromString(const QString &s, bool *ok)
}
//expects input of "widthxheight"
-QSizeF QmlStringConverters::sizeFFromString(const QString &s, bool *ok)
+QSizeF QDeclarativeStringConverters::sizeFFromString(const QString &s, bool *ok)
{
if (s.count(QLatin1Char('x')) != 1) {
if (ok)
@@ -220,7 +220,7 @@ QSizeF QmlStringConverters::sizeFFromString(const QString &s, bool *ok)
}
//expects input of "x,y,widthxheight" //### use space instead of second comma?
-QRectF QmlStringConverters::rectFFromString(const QString &s, bool *ok)
+QRectF QDeclarativeStringConverters::rectFFromString(const QString &s, bool *ok)
{
if (s.count(QLatin1Char(',')) != 2 || s.count(QLatin1Char('x')) != 1) {
if (ok)
@@ -248,7 +248,7 @@ QRectF QmlStringConverters::rectFFromString(const QString &s, bool *ok)
}
//expects input of "x,y,z"
-QVector3D QmlStringConverters::vector3DFromString(const QString &s, bool *ok)
+QVector3D QDeclarativeStringConverters::vector3DFromString(const QString &s, bool *ok)
{
if (s.count(QLatin1Char(',')) != 2) {
if (ok)
diff --git a/src/declarative/qml/qmlstringconverters_p.h b/src/declarative/qml/qdeclarativestringconverters_p.h
index c83a1de..7afdfd3 100644
--- a/src/declarative/qml/qmlstringconverters_p.h
+++ b/src/declarative/qml/qdeclarativestringconverters_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLSTRINGCONVERTERS_P_H
-#define QMLSTRINGCONVERTERS_P_H
+#ifndef QDECLARATIVESTRINGCONVERTERS_P_H
+#define QDECLARATIVESTRINGCONVERTERS_P_H
//
// W A R N I N G
@@ -67,7 +67,7 @@ class QByteArray;
class QVector3D;
// XXX - Bauhaus currently uses these methods which is why they're exported
-namespace QmlStringConverters
+namespace QDeclarativeStringConverters
{
QVariant Q_DECLARATIVE_EXPORT variantFromString(const QString &);
QVariant Q_DECLARATIVE_EXPORT variantFromString(const QString &, int preferredType, bool *ok = 0);
@@ -84,4 +84,4 @@ namespace QmlStringConverters
QT_END_NAMESPACE
-#endif // QMLSTRINGCONVERTERS_P_H
+#endif // QDECLARATIVESTRINGCONVERTERS_P_H
diff --git a/src/declarative/qml/qmltypenamecache.cpp b/src/declarative/qml/qdeclarativetypenamecache.cpp
index eef3bae..f94f944 100644
--- a/src/declarative/qml/qmltypenamecache.cpp
+++ b/src/declarative/qml/qdeclarativetypenamecache.cpp
@@ -39,23 +39,23 @@
**
****************************************************************************/
-#include "qmltypenamecache_p.h"
+#include "qdeclarativetypenamecache_p.h"
-#include "qmlengine_p.h"
+#include "qdeclarativeengine_p.h"
QT_BEGIN_NAMESPACE
-QmlTypeNameCache::QmlTypeNameCache(QmlEngine *e)
-: QmlCleanup(e), engine(e)
+QDeclarativeTypeNameCache::QDeclarativeTypeNameCache(QDeclarativeEngine *e)
+: QDeclarativeCleanup(e), engine(e)
{
}
-QmlTypeNameCache::~QmlTypeNameCache()
+QDeclarativeTypeNameCache::~QDeclarativeTypeNameCache()
{
clear();
}
-void QmlTypeNameCache::clear()
+void QDeclarativeTypeNameCache::clear()
{
qDeleteAll(stringCache);
stringCache.clear();
@@ -63,12 +63,12 @@ void QmlTypeNameCache::clear()
engine = 0;
}
-void QmlTypeNameCache::add(const QString &name, QmlType *type)
+void QDeclarativeTypeNameCache::add(const QString &name, QDeclarativeType *type)
{
if (stringCache.contains(name))
return;
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
RData *data = new RData;
// ### Use typename class
@@ -78,12 +78,12 @@ void QmlTypeNameCache::add(const QString &name, QmlType *type)
identifierCache.insert(data->identifier.identifier, data);
}
-void QmlTypeNameCache::add(const QString &name, QmlTypeNameCache *typeNamespace)
+void QDeclarativeTypeNameCache::add(const QString &name, QDeclarativeTypeNameCache *typeNamespace)
{
if (stringCache.contains(name))
return;
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
RData *data = new RData;
// ### Use typename class
@@ -94,7 +94,7 @@ void QmlTypeNameCache::add(const QString &name, QmlTypeNameCache *typeNamespace)
typeNamespace->addref();
}
-QmlTypeNameCache::Data *QmlTypeNameCache::data(const QString &id) const
+QDeclarativeTypeNameCache::Data *QDeclarativeTypeNameCache::data(const QString &id) const
{
return stringCache.value(id);
}
diff --git a/src/declarative/qml/qmltypenamecache_p.h b/src/declarative/qml/qdeclarativetypenamecache_p.h
index e578277..eee5b77 100644
--- a/src/declarative/qml/qmltypenamecache_p.h
+++ b/src/declarative/qml/qdeclarativetypenamecache_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLTYPENAMECACHE_P_H
-#define QMLTYPENAMECACHE_P_H
+#ifndef QDECLARATIVETYPENAMECACHE_P_H
+#define QDECLARATIVETYPENAMECACHE_P_H
//
// W A R N I N G
@@ -53,30 +53,30 @@
// We mean it.
//
-#include "qmlrefcount_p.h"
-#include "qmlcleanup_p.h"
+#include "qdeclarativerefcount_p.h"
+#include "qdeclarativecleanup_p.h"
#include <private/qscriptdeclarativeclass_p.h>
QT_BEGIN_NAMESPACE
-class QmlType;
-class QmlEngine;
-class QmlTypeNameCache : public QmlRefCount, public QmlCleanup
+class QDeclarativeType;
+class QDeclarativeEngine;
+class QDeclarativeTypeNameCache : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
- QmlTypeNameCache(QmlEngine *);
- virtual ~QmlTypeNameCache();
+ QDeclarativeTypeNameCache(QDeclarativeEngine *);
+ virtual ~QDeclarativeTypeNameCache();
struct Data {
inline Data();
inline ~Data();
- QmlType *type;
- QmlTypeNameCache *typeNamespace;
+ QDeclarativeType *type;
+ QDeclarativeTypeNameCache *typeNamespace;
};
- void add(const QString &, QmlType *);
- void add(const QString &, QmlTypeNameCache *);
+ void add(const QString &, QDeclarativeType *);
+ void add(const QString &, QDeclarativeTypeNameCache *);
Data *data(const QString &) const;
inline Data *data(const QScriptDeclarativeClass::Identifier &id) const;
@@ -93,25 +93,25 @@ private:
StringCache stringCache;
IdentifierCache identifierCache;
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
};
-QmlTypeNameCache::Data::Data()
+QDeclarativeTypeNameCache::Data::Data()
: type(0), typeNamespace(0)
{
}
-QmlTypeNameCache::Data::~Data()
+QDeclarativeTypeNameCache::Data::~Data()
{
if (typeNamespace) typeNamespace->release();
}
-QmlTypeNameCache::Data *QmlTypeNameCache::data(const QScriptDeclarativeClass::Identifier &id) const
+QDeclarativeTypeNameCache::Data *QDeclarativeTypeNameCache::data(const QScriptDeclarativeClass::Identifier &id) const
{
return identifierCache.value(id);
}
QT_END_NAMESPACE
-#endif // QMLTYPENAMECACHE_P_H
+#endif // QDECLARATIVETYPENAMECACHE_P_H
diff --git a/src/declarative/qml/qmltypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
index 32a7a25..02370e0 100644
--- a/src/declarative/qml/qmltypenamescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
@@ -39,16 +39,16 @@
**
****************************************************************************/
-#include "qmltypenamescriptclass_p.h"
+#include "qdeclarativetypenamescriptclass_p.h"
-#include "qmlengine_p.h"
-#include "qmltypenamecache_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativetypenamecache_p.h"
QT_BEGIN_NAMESPACE
struct TypeNameData : public QScriptDeclarativeClass::Object {
- TypeNameData(QObject *o, QmlType *t, QmlTypeNameScriptClass::TypeNameMode m) : object(o), type(t), typeNamespace(0), mode(m) {}
- TypeNameData(QObject *o, QmlTypeNameCache *n, QmlTypeNameScriptClass::TypeNameMode m) : object(o), type(0), typeNamespace(n), mode(m) {
+ TypeNameData(QObject *o, QDeclarativeType *t, QDeclarativeTypeNameScriptClass::TypeNameMode m) : object(o), type(t), typeNamespace(0), mode(m) {}
+ TypeNameData(QObject *o, QDeclarativeTypeNameCache *n, QDeclarativeTypeNameScriptClass::TypeNameMode m) : object(o), type(0), typeNamespace(n), mode(m) {
if (typeNamespace) typeNamespace->addref();
}
~TypeNameData() {
@@ -56,37 +56,37 @@ struct TypeNameData : public QScriptDeclarativeClass::Object {
}
QObject *object;
- QmlType *type;
- QmlTypeNameCache *typeNamespace;
- QmlTypeNameScriptClass::TypeNameMode mode;
+ QDeclarativeType *type;
+ QDeclarativeTypeNameCache *typeNamespace;
+ QDeclarativeTypeNameScriptClass::TypeNameMode mode;
};
-QmlTypeNameScriptClass::QmlTypeNameScriptClass(QmlEngine *bindEngine)
-: QmlScriptClass(QmlEnginePrivate::getScriptEngine(bindEngine)),
+QDeclarativeTypeNameScriptClass::QDeclarativeTypeNameScriptClass(QDeclarativeEngine *bindEngine)
+: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)),
engine(bindEngine), object(0), type(0)
{
}
-QmlTypeNameScriptClass::~QmlTypeNameScriptClass()
+QDeclarativeTypeNameScriptClass::~QDeclarativeTypeNameScriptClass()
{
}
-QScriptValue QmlTypeNameScriptClass::newObject(QObject *object, QmlType *type, TypeNameMode mode)
+QScriptValue QDeclarativeTypeNameScriptClass::newObject(QObject *object, QDeclarativeType *type, TypeNameMode mode)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
return QScriptDeclarativeClass::newObject(scriptEngine, this, new TypeNameData(object, type, mode));
}
-QScriptValue QmlTypeNameScriptClass::newObject(QObject *object, QmlTypeNameCache *ns, TypeNameMode mode)
+QScriptValue QDeclarativeTypeNameScriptClass::newObject(QObject *object, QDeclarativeTypeNameCache *ns, TypeNameMode mode)
{
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
return QScriptDeclarativeClass::newObject(scriptEngine, this, new TypeNameData(object, ns, mode));
}
QScriptClass::QueryFlags
-QmlTypeNameScriptClass::queryProperty(Object *obj, const Identifier &name,
+QDeclarativeTypeNameScriptClass::queryProperty(Object *obj, const Identifier &name,
QScriptClass::QueryFlags flags)
{
Q_UNUSED(flags);
@@ -95,11 +95,11 @@ QmlTypeNameScriptClass::queryProperty(Object *obj, const Identifier &name,
object = 0;
type = 0;
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
if (data->typeNamespace) {
- QmlTypeNameCache::Data *d = data->typeNamespace->data(name);
+ QDeclarativeTypeNameCache::Data *d = data->typeNamespace->data(name);
if (d && d->type) {
type = d->type;
return QScriptClass::HandlesReadAccess;
@@ -139,11 +139,11 @@ QmlTypeNameScriptClass::queryProperty(Object *obj, const Identifier &name,
return 0;
}
-QmlTypeNameScriptClass::ScriptValue
-QmlTypeNameScriptClass::property(Object *obj, const Identifier &name)
+QDeclarativeTypeNameScriptClass::ScriptValue
+QDeclarativeTypeNameScriptClass::property(Object *obj, const Identifier &name)
{
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
if (type) {
return Value(scriptEngine, newObject(((TypeNameData *)obj)->object, type, ((TypeNameData *)obj)->mode));
} else if (object) {
@@ -153,12 +153,12 @@ QmlTypeNameScriptClass::property(Object *obj, const Identifier &name)
}
}
-void QmlTypeNameScriptClass::setProperty(Object *o, const Identifier &n, const QScriptValue &v)
+void QDeclarativeTypeNameScriptClass::setProperty(Object *o, const Identifier &n, const QScriptValue &v)
{
Q_ASSERT(object);
Q_ASSERT(!type);
- QmlEnginePrivate *ep = QmlEnginePrivate::get(engine);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
ep->objectClass->setProperty(((TypeNameData *)o)->object, n, v);
}
diff --git a/src/declarative/qml/qmltypenamescriptclass_p.h b/src/declarative/qml/qdeclarativetypenamescriptclass_p.h
index fd5752d..b6e3f51 100644
--- a/src/declarative/qml/qmltypenamescriptclass_p.h
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLTYPENAMESCRIPTCLASS_P_H
-#define QMLTYPENAMESCRIPTCLASS_P_H
+#ifndef QDECLARATIVETYPENAMESCRIPTCLASS_P_H
+#define QDECLARATIVETYPENAMESCRIPTCLASS_P_H
//
// W A R N I N G
@@ -52,26 +52,26 @@
//
// We mean it.
//
-#include "qmlengine_p.h"
+#include "qdeclarativeengine_p.h"
#include <QtScript/qscriptclass.h>
-#include <private/qmlscriptclass_p.h>
+#include <private/qdeclarativescriptclass_p.h>
QT_BEGIN_NAMESPACE
-class QmlEngine;
-class QmlType;
-class QmlTypeNameCache;
-class QmlTypeNameScriptClass : public QmlScriptClass
+class QDeclarativeEngine;
+class QDeclarativeType;
+class QDeclarativeTypeNameCache;
+class QDeclarativeTypeNameScriptClass : public QDeclarativeScriptClass
{
public:
- QmlTypeNameScriptClass(QmlEngine *);
- ~QmlTypeNameScriptClass();
+ QDeclarativeTypeNameScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeTypeNameScriptClass();
enum TypeNameMode { IncludeEnums, ExcludeEnums };
- QScriptValue newObject(QObject *, QmlType *, TypeNameMode = IncludeEnums);
- QScriptValue newObject(QObject *, QmlTypeNameCache *, TypeNameMode = IncludeEnums);
+ QScriptValue newObject(QObject *, QDeclarativeType *, TypeNameMode = IncludeEnums);
+ QScriptValue newObject(QObject *, QDeclarativeTypeNameCache *, TypeNameMode = IncludeEnums);
protected:
virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
@@ -81,13 +81,13 @@ protected:
virtual void setProperty(Object *, const Identifier &name, const QScriptValue &);
private:
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
QObject *object;
- QmlType *type;
+ QDeclarativeType *type;
quint32 enumValue;
};
QT_END_NAMESPACE
-#endif // QMLTYPENAMESCRIPTCLASS_P_H
+#endif // QDECLARATIVETYPENAMESCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
new file mode 100644
index 0000000..df83fa4
--- /dev/null
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -0,0 +1,706 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+#include "qdeclarativevaluetype_p.h"
+
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QDeclarativeValueTypeFactory::QDeclarativeValueTypeFactory()
+{
+ // ### Optimize
+ for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
+ valueTypes[ii] = valueType(ii);
+}
+
+QDeclarativeValueTypeFactory::~QDeclarativeValueTypeFactory()
+{
+ for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
+ delete valueTypes[ii];
+}
+
+QDeclarativeValueType *QDeclarativeValueTypeFactory::valueType(int t)
+{
+ switch (t) {
+ case QVariant::Point:
+ return new QDeclarativePointValueType;
+ case QVariant::PointF:
+ return new QDeclarativePointFValueType;
+ case QVariant::Size:
+ return new QDeclarativeSizeValueType;
+ case QVariant::SizeF:
+ return new QDeclarativeSizeFValueType;
+ case QVariant::Rect:
+ return new QDeclarativeRectValueType;
+ case QVariant::RectF:
+ return new QDeclarativeRectFValueType;
+ case QVariant::Vector3D:
+ return new QDeclarativeVector3DValueType;
+ case QVariant::EasingCurve:
+ return new QDeclarativeEasingValueType;
+ case QVariant::Font:
+ return new QDeclarativeFontValueType;
+ default:
+ return 0;
+ }
+}
+
+QDeclarativeValueType::QDeclarativeValueType(QObject *parent)
+: QObject(parent)
+{
+}
+
+QDeclarativePointFValueType::QDeclarativePointFValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativePointFValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &point, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativePointFValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &point, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativePointFValueType::value()
+{
+ return QVariant(point);
+}
+
+void QDeclarativePointFValueType::setValue(QVariant value)
+{
+ point = qvariant_cast<QPointF>(value);
+}
+
+qreal QDeclarativePointFValueType::x() const
+{
+ return point.x();
+}
+
+qreal QDeclarativePointFValueType::y() const
+{
+ return point.y();
+}
+
+void QDeclarativePointFValueType::setX(qreal x)
+{
+ point.setX(x);
+}
+
+void QDeclarativePointFValueType::setY(qreal y)
+{
+ point.setY(y);
+}
+
+QDeclarativePointValueType::QDeclarativePointValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativePointValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &point, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativePointValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &point, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativePointValueType::value()
+{
+ return QVariant(point);
+}
+
+void QDeclarativePointValueType::setValue(QVariant value)
+{
+ point = qvariant_cast<QPoint>(value);
+}
+
+int QDeclarativePointValueType::x() const
+{
+ return point.x();
+}
+
+int QDeclarativePointValueType::y() const
+{
+ return point.y();
+}
+
+void QDeclarativePointValueType::setX(int x)
+{
+ point.setX(x);
+}
+
+void QDeclarativePointValueType::setY(int y)
+{
+ point.setY(y);
+}
+
+QDeclarativeSizeFValueType::QDeclarativeSizeFValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeSizeFValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &size, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeSizeFValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &size, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeSizeFValueType::value()
+{
+ return QVariant(size);
+}
+
+void QDeclarativeSizeFValueType::setValue(QVariant value)
+{
+ size = qvariant_cast<QSizeF>(value);
+}
+
+qreal QDeclarativeSizeFValueType::width() const
+{
+ return size.width();
+}
+
+qreal QDeclarativeSizeFValueType::height() const
+{
+ return size.height();
+}
+
+void QDeclarativeSizeFValueType::setWidth(qreal w)
+{
+ size.setWidth(w);
+}
+
+void QDeclarativeSizeFValueType::setHeight(qreal h)
+{
+ size.setHeight(h);
+}
+
+QDeclarativeSizeValueType::QDeclarativeSizeValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeSizeValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &size, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeSizeValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &size, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeSizeValueType::value()
+{
+ return QVariant(size);
+}
+
+void QDeclarativeSizeValueType::setValue(QVariant value)
+{
+ size = qvariant_cast<QSize>(value);
+}
+
+int QDeclarativeSizeValueType::width() const
+{
+ return size.width();
+}
+
+int QDeclarativeSizeValueType::height() const
+{
+ return size.height();
+}
+
+void QDeclarativeSizeValueType::setWidth(int w)
+{
+ size.setWidth(w);
+}
+
+void QDeclarativeSizeValueType::setHeight(int h)
+{
+ size.setHeight(h);
+}
+
+QDeclarativeRectFValueType::QDeclarativeRectFValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeRectFValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &rect, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeRectFValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &rect, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeRectFValueType::value()
+{
+ return QVariant(rect);
+}
+
+void QDeclarativeRectFValueType::setValue(QVariant value)
+{
+ rect = qvariant_cast<QRectF>(value);
+}
+
+qreal QDeclarativeRectFValueType::x() const
+{
+ return rect.x();
+}
+
+qreal QDeclarativeRectFValueType::y() const
+{
+ return rect.y();
+}
+
+void QDeclarativeRectFValueType::setX(qreal x)
+{
+ rect.moveLeft(x);
+}
+
+void QDeclarativeRectFValueType::setY(qreal y)
+{
+ rect.moveTop(y);
+}
+
+qreal QDeclarativeRectFValueType::width() const
+{
+ return rect.width();
+}
+
+qreal QDeclarativeRectFValueType::height() const
+{
+ return rect.height();
+}
+
+void QDeclarativeRectFValueType::setWidth(qreal w)
+{
+ rect.setWidth(w);
+}
+
+void QDeclarativeRectFValueType::setHeight(qreal h)
+{
+ rect.setHeight(h);
+}
+
+QDeclarativeRectValueType::QDeclarativeRectValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeRectValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &rect, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeRectValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &rect, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeRectValueType::value()
+{
+ return QVariant(rect);
+}
+
+void QDeclarativeRectValueType::setValue(QVariant value)
+{
+ rect = qvariant_cast<QRect>(value);
+}
+
+int QDeclarativeRectValueType::x() const
+{
+ return rect.x();
+}
+
+int QDeclarativeRectValueType::y() const
+{
+ return rect.y();
+}
+
+void QDeclarativeRectValueType::setX(int x)
+{
+ rect.moveLeft(x);
+}
+
+void QDeclarativeRectValueType::setY(int y)
+{
+ rect.moveTop(y);
+}
+
+int QDeclarativeRectValueType::width() const
+{
+ return rect.width();
+}
+
+int QDeclarativeRectValueType::height() const
+{
+ return rect.height();
+}
+
+void QDeclarativeRectValueType::setWidth(int w)
+{
+ rect.setWidth(w);
+}
+
+void QDeclarativeRectValueType::setHeight(int h)
+{
+ rect.setHeight(h);
+}
+
+QDeclarativeVector3DValueType::QDeclarativeVector3DValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeVector3DValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &vector, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeVector3DValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &vector, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeVector3DValueType::value()
+{
+ return QVariant(vector);
+}
+
+void QDeclarativeVector3DValueType::setValue(QVariant value)
+{
+ vector = qvariant_cast<QVector3D>(value);
+}
+
+qreal QDeclarativeVector3DValueType::x() const
+{
+ return vector.x();
+}
+
+qreal QDeclarativeVector3DValueType::y() const
+{
+ return vector.y();
+}
+
+qreal QDeclarativeVector3DValueType::z() const
+{
+ return vector.z();
+}
+
+void QDeclarativeVector3DValueType::setX(qreal x)
+{
+ vector.setX(x);
+}
+
+void QDeclarativeVector3DValueType::setY(qreal y)
+{
+ vector.setY(y);
+}
+
+void QDeclarativeVector3DValueType::setZ(qreal z)
+{
+ vector.setZ(z);
+}
+
+QDeclarativeEasingValueType::QDeclarativeEasingValueType(QObject *parent)
+: QDeclarativeValueType(parent)
+{
+}
+
+void QDeclarativeEasingValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &easing, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeEasingValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &easing, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeEasingValueType::value()
+{
+ return QVariant(easing);
+}
+
+void QDeclarativeEasingValueType::setValue(QVariant value)
+{
+ easing = qvariant_cast<QEasingCurve>(value);
+}
+
+QDeclarativeEasingValueType::Type QDeclarativeEasingValueType::type() const
+{
+ return (QDeclarativeEasingValueType::Type)easing.type();
+}
+
+qreal QDeclarativeEasingValueType::amplitude() const
+{
+ return easing.amplitude();
+}
+
+qreal QDeclarativeEasingValueType::overshoot() const
+{
+ return easing.overshoot();
+}
+
+qreal QDeclarativeEasingValueType::period() const
+{
+ return easing.period();
+}
+
+void QDeclarativeEasingValueType::setType(QDeclarativeEasingValueType::Type type)
+{
+ easing.setType((QEasingCurve::Type)type);
+}
+
+void QDeclarativeEasingValueType::setAmplitude(qreal amplitude)
+{
+ easing.setAmplitude(amplitude);
+}
+
+void QDeclarativeEasingValueType::setOvershoot(qreal overshoot)
+{
+ easing.setOvershoot(overshoot);
+}
+
+void QDeclarativeEasingValueType::setPeriod(qreal period)
+{
+ easing.setPeriod(period);
+}
+
+QDeclarativeFontValueType::QDeclarativeFontValueType(QObject *parent)
+: QDeclarativeValueType(parent), hasPixelSize(false)
+{
+}
+
+void QDeclarativeFontValueType::read(QObject *obj, int idx)
+{
+ void *a[] = { &font, 0 };
+ QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
+}
+
+void QDeclarativeFontValueType::write(QObject *obj, int idx, QDeclarativeMetaProperty::WriteFlags flags)
+{
+ int status = -1;
+ void *a[] = { &font, 0, &status, &flags };
+ QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
+}
+
+QVariant QDeclarativeFontValueType::value()
+{
+ return QVariant(font);
+}
+
+void QDeclarativeFontValueType::setValue(QVariant value)
+{
+ font = qvariant_cast<QFont>(value);
+}
+
+
+QString QDeclarativeFontValueType::family() const
+{
+ return font.family();
+}
+
+void QDeclarativeFontValueType::setFamily(const QString &family)
+{
+ font.setFamily(family);
+}
+
+bool QDeclarativeFontValueType::bold() const
+{
+ return font.bold();
+}
+
+void QDeclarativeFontValueType::setBold(bool b)
+{
+ font.setBold(b);
+}
+
+QDeclarativeFontValueType::FontWeight QDeclarativeFontValueType::weight() const
+{
+ return (QDeclarativeFontValueType::FontWeight)font.weight();
+}
+
+void QDeclarativeFontValueType::setWeight(QDeclarativeFontValueType::FontWeight w)
+{
+ font.setWeight((QFont::Weight)w);
+}
+
+bool QDeclarativeFontValueType::italic() const
+{
+ return font.italic();
+}
+
+void QDeclarativeFontValueType::setItalic(bool b)
+{
+ font.setItalic(b);
+}
+
+bool QDeclarativeFontValueType::underline() const
+{
+ return font.underline();
+}
+
+void QDeclarativeFontValueType::setUnderline(bool b)
+{
+ font.setUnderline(b);
+}
+
+bool QDeclarativeFontValueType::overline() const
+{
+ return font.overline();
+}
+
+void QDeclarativeFontValueType::setOverline(bool b)
+{
+ font.setOverline(b);
+}
+
+bool QDeclarativeFontValueType::strikeout() const
+{
+ return font.strikeOut();
+}
+
+void QDeclarativeFontValueType::setStrikeout(bool b)
+{
+ font.setStrikeOut(b);
+}
+
+qreal QDeclarativeFontValueType::pointSize() const
+{
+ return font.pointSizeF();
+}
+
+void QDeclarativeFontValueType::setPointSize(qreal size)
+{
+ if (hasPixelSize) {
+ qWarning() << "Both point size and pixel size set. Using pixel size.";
+ return;
+ }
+
+ if (size >= 0.0)
+ font.setPointSizeF(size);
+}
+
+int QDeclarativeFontValueType::pixelSize() const
+{
+ return font.pixelSize();
+}
+
+void QDeclarativeFontValueType::setPixelSize(int size)
+{
+ if (size >=0) {
+ font.setPixelSize(size);
+ hasPixelSize = true;
+ } else {
+ hasPixelSize = false;
+ }
+}
+
+QDeclarativeFontValueType::Capitalization QDeclarativeFontValueType::capitalization() const
+{
+ return (QDeclarativeFontValueType::Capitalization)font.capitalization();
+}
+
+void QDeclarativeFontValueType::setCapitalization(QDeclarativeFontValueType::Capitalization c)
+{
+ font.setCapitalization((QFont::Capitalization)c);
+}
+
+qreal QDeclarativeFontValueType::letterSpacing() const
+{
+ return font.letterSpacing();
+}
+
+void QDeclarativeFontValueType::setLetterSpacing(qreal size)
+{
+ font.setLetterSpacing(QFont::PercentageSpacing, size);
+}
+
+qreal QDeclarativeFontValueType::wordSpacing() const
+{
+ return font.wordSpacing();
+}
+
+void QDeclarativeFontValueType::setWordSpacing(qreal size)
+{
+ font.setWordSpacing(size);
+}
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmlvaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h
index 6dd3703..995433b 100644
--- a/src/declarative/qml/qmlvaluetype_p.h
+++ b/src/declarative/qml/qdeclarativevaluetype_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLVALUETYPE_P_H
-#define QMLVALUETYPE_P_H
+#ifndef QDECLARATIVEVALUETYPE_P_H
+#define QDECLARATIVEVALUETYPE_P_H
//
// W A R N I N G
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qmlmetaproperty.h"
+#include "qdeclarativemetaproperty.h"
#include <QtCore/qobject.h>
#include <QtCore/qrect.h>
@@ -64,38 +64,38 @@
QT_BEGIN_NAMESPACE
-class Q_DECLARATIVE_EXPORT QmlValueType : public QObject
+class Q_DECLARATIVE_EXPORT QDeclarativeValueType : public QObject
{
Q_OBJECT
public:
- QmlValueType(QObject *parent = 0);
+ QDeclarativeValueType(QObject *parent = 0);
virtual void read(QObject *, int) = 0;
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags flags) = 0;
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags flags) = 0;
virtual QVariant value() = 0;
virtual void setValue(QVariant) = 0;
};
-class Q_DECLARATIVE_EXPORT QmlValueTypeFactory
+class Q_DECLARATIVE_EXPORT QDeclarativeValueTypeFactory
{
public:
- QmlValueTypeFactory();
- ~QmlValueTypeFactory();
- static QmlValueType *valueType(int);
+ QDeclarativeValueTypeFactory();
+ ~QDeclarativeValueTypeFactory();
+ static QDeclarativeValueType *valueType(int);
- QmlValueType *valueTypes[QVariant::UserType - 1];
- QmlValueType *operator[](int idx) const { return valueTypes[idx]; }
+ QDeclarativeValueType *valueTypes[QVariant::UserType - 1];
+ QDeclarativeValueType *operator[](int idx) const { return valueTypes[idx]; }
};
-class Q_AUTOTEST_EXPORT QmlPointFValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativePointFValueType : public QDeclarativeValueType
{
Q_PROPERTY(qreal x READ x WRITE setX)
Q_PROPERTY(qreal y READ y WRITE setY)
Q_OBJECT
public:
- QmlPointFValueType(QObject *parent = 0);
+ QDeclarativePointFValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -108,16 +108,16 @@ private:
QPointF point;
};
-class Q_AUTOTEST_EXPORT QmlPointValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativePointValueType : public QDeclarativeValueType
{
Q_PROPERTY(int x READ x WRITE setX)
Q_PROPERTY(int y READ y WRITE setY)
Q_OBJECT
public:
- QmlPointValueType(QObject *parent = 0);
+ QDeclarativePointValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -130,16 +130,16 @@ private:
QPoint point;
};
-class Q_AUTOTEST_EXPORT QmlSizeFValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativeSizeFValueType : public QDeclarativeValueType
{
Q_PROPERTY(qreal width READ width WRITE setWidth)
Q_PROPERTY(qreal height READ height WRITE setHeight)
Q_OBJECT
public:
- QmlSizeFValueType(QObject *parent = 0);
+ QDeclarativeSizeFValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -152,16 +152,16 @@ private:
QSizeF size;
};
-class Q_AUTOTEST_EXPORT QmlSizeValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativeSizeValueType : public QDeclarativeValueType
{
Q_PROPERTY(int width READ width WRITE setWidth)
Q_PROPERTY(int height READ height WRITE setHeight)
Q_OBJECT
public:
- QmlSizeValueType(QObject *parent = 0);
+ QDeclarativeSizeValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -174,7 +174,7 @@ private:
QSize size;
};
-class Q_AUTOTEST_EXPORT QmlRectFValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativeRectFValueType : public QDeclarativeValueType
{
Q_PROPERTY(qreal x READ x WRITE setX)
Q_PROPERTY(qreal y READ y WRITE setY)
@@ -182,10 +182,10 @@ class Q_AUTOTEST_EXPORT QmlRectFValueType : public QmlValueType
Q_PROPERTY(qreal height READ height WRITE setHeight)
Q_OBJECT
public:
- QmlRectFValueType(QObject *parent = 0);
+ QDeclarativeRectFValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -203,7 +203,7 @@ private:
QRectF rect;
};
-class Q_AUTOTEST_EXPORT QmlRectValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativeRectValueType : public QDeclarativeValueType
{
Q_PROPERTY(int x READ x WRITE setX)
Q_PROPERTY(int y READ y WRITE setY)
@@ -211,10 +211,10 @@ class Q_AUTOTEST_EXPORT QmlRectValueType : public QmlValueType
Q_PROPERTY(int height READ height WRITE setHeight)
Q_OBJECT
public:
- QmlRectValueType(QObject *parent = 0);
+ QDeclarativeRectValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -232,17 +232,17 @@ private:
QRect rect;
};
-class Q_AUTOTEST_EXPORT QmlVector3DValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativeVector3DValueType : public QDeclarativeValueType
{
Q_PROPERTY(qreal x READ x WRITE setX)
Q_PROPERTY(qreal y READ y WRITE setY)
Q_PROPERTY(qreal z READ z WRITE setZ)
Q_OBJECT
public:
- QmlVector3DValueType(QObject *parent = 0);
+ QDeclarativeVector3DValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -257,12 +257,12 @@ private:
QVector3D vector;
};
-class Q_AUTOTEST_EXPORT QmlEasingValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativeEasingValueType : public QDeclarativeValueType
{
Q_OBJECT
Q_ENUMS(Type)
- Q_PROPERTY(QmlEasingValueType::Type type READ type WRITE setType)
+ Q_PROPERTY(QDeclarativeEasingValueType::Type type READ type WRITE setType)
Q_PROPERTY(qreal amplitude READ amplitude WRITE setAmplitude)
Q_PROPERTY(qreal overshoot READ overshoot WRITE setOvershoot)
Q_PROPERTY(qreal period READ period WRITE setPeriod)
@@ -293,10 +293,10 @@ public:
SineCurve = QEasingCurve::SineCurve, CosineCurve = QEasingCurve::CosineCurve,
};
- QmlEasingValueType(QObject *parent = 0);
+ QDeclarativeEasingValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -313,7 +313,7 @@ private:
QEasingCurve easing;
};
-class Q_AUTOTEST_EXPORT QmlFontValueType : public QmlValueType
+class Q_AUTOTEST_EXPORT QDeclarativeFontValueType : public QDeclarativeValueType
{
Q_OBJECT
Q_ENUMS(FontWeight)
@@ -344,10 +344,10 @@ public:
SmallCaps = QFont::SmallCaps,
Capitalize = QFont::Capitalize };
- QmlFontValueType(QObject *parent = 0);
+ QDeclarativeFontValueType(QObject *parent = 0);
virtual void read(QObject *, int);
- virtual void write(QObject *, int, QmlMetaProperty::WriteFlags);
+ virtual void write(QObject *, int, QDeclarativeMetaProperty::WriteFlags);
virtual QVariant value();
virtual void setValue(QVariant value);
@@ -394,4 +394,4 @@ private:
QT_END_NAMESPACE
-#endif // QMLVALUETYPE_P_H
+#endif // QDECLARATIVEVALUETYPE_P_H
diff --git a/src/declarative/qml/qmlvaluetypescriptclass.cpp b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
index 0a92014..9cb65f8 100644
--- a/src/declarative/qml/qmlvaluetypescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativevaluetypescriptclass.cpp
@@ -39,43 +39,43 @@
**
****************************************************************************/
-#include "qmlvaluetypescriptclass_p.h"
+#include "qdeclarativevaluetypescriptclass_p.h"
-#include "qmlengine_p.h"
-#include "qmlguard_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeguard_p.h"
QT_BEGIN_NAMESPACE
-struct QmlValueTypeReference : public QScriptDeclarativeClass::Object {
- QmlValueType *type;
- QmlGuard<QObject> object;
+struct QDeclarativeValueTypeReference : public QScriptDeclarativeClass::Object {
+ QDeclarativeValueType *type;
+ QDeclarativeGuard<QObject> object;
int property;
};
-QmlValueTypeScriptClass::QmlValueTypeScriptClass(QmlEngine *bindEngine)
-: QmlScriptClass(QmlEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine)
+QDeclarativeValueTypeScriptClass::QDeclarativeValueTypeScriptClass(QDeclarativeEngine *bindEngine)
+: QDeclarativeScriptClass(QDeclarativeEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine)
{
}
-QmlValueTypeScriptClass::~QmlValueTypeScriptClass()
+QDeclarativeValueTypeScriptClass::~QDeclarativeValueTypeScriptClass()
{
}
-QScriptValue QmlValueTypeScriptClass::newObject(QObject *object, int coreIndex, QmlValueType *type)
+QScriptValue QDeclarativeValueTypeScriptClass::newObject(QObject *object, int coreIndex, QDeclarativeValueType *type)
{
- QmlValueTypeReference *ref = new QmlValueTypeReference;
+ QDeclarativeValueTypeReference *ref = new QDeclarativeValueTypeReference;
ref->type = type;
ref->object = object;
ref->property = coreIndex;
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
return QScriptDeclarativeClass::newObject(scriptEngine, this, ref);
}
QScriptClass::QueryFlags
-QmlValueTypeScriptClass::queryProperty(Object *obj, const Identifier &name,
+QDeclarativeValueTypeScriptClass::queryProperty(Object *obj, const Identifier &name,
QScriptClass::QueryFlags)
{
- QmlValueTypeReference *ref = static_cast<QmlValueTypeReference *>(obj);
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
m_lastIndex = -1;
@@ -98,24 +98,24 @@ QmlValueTypeScriptClass::queryProperty(Object *obj, const Identifier &name,
return rv;
}
-QmlValueTypeScriptClass::ScriptValue QmlValueTypeScriptClass::property(Object *obj, const Identifier &)
+QDeclarativeValueTypeScriptClass::ScriptValue QDeclarativeValueTypeScriptClass::property(Object *obj, const Identifier &)
{
- QmlValueTypeReference *ref = static_cast<QmlValueTypeReference *>(obj);
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
QMetaProperty p = ref->type->metaObject()->property(m_lastIndex);
ref->type->read(ref->object, ref->property);
QVariant rv = p.read(ref->type);
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
- return Value(scriptEngine, static_cast<QmlEnginePrivate *>(QObjectPrivate::get(engine))->scriptValueFromVariant(rv));
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
+ return Value(scriptEngine, static_cast<QDeclarativeEnginePrivate *>(QObjectPrivate::get(engine))->scriptValueFromVariant(rv));
}
-void QmlValueTypeScriptClass::setProperty(Object *obj, const Identifier &,
+void QDeclarativeValueTypeScriptClass::setProperty(Object *obj, const Identifier &,
const QScriptValue &value)
{
- QmlValueTypeReference *ref = static_cast<QmlValueTypeReference *>(obj);
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
- QVariant v = QmlScriptClass::toVariant(engine, value);
+ QVariant v = QDeclarativeScriptClass::toVariant(engine, value);
ref->type->read(ref->object, ref->property);
QMetaProperty p = ref->type->metaObject()->property(m_lastIndex);
@@ -123,9 +123,9 @@ void QmlValueTypeScriptClass::setProperty(Object *obj, const Identifier &,
ref->type->write(ref->object, ref->property, 0);
}
-QVariant QmlValueTypeScriptClass::toVariant(Object *obj, bool *ok)
+QVariant QDeclarativeValueTypeScriptClass::toVariant(Object *obj, bool *ok)
{
- QmlValueTypeReference *ref = static_cast<QmlValueTypeReference *>(obj);
+ QDeclarativeValueTypeReference *ref = static_cast<QDeclarativeValueTypeReference *>(obj);
if (ok) *ok = true;
@@ -137,7 +137,7 @@ QVariant QmlValueTypeScriptClass::toVariant(Object *obj, bool *ok)
}
}
-QVariant QmlValueTypeScriptClass::toVariant(const QScriptValue &value)
+QVariant QDeclarativeValueTypeScriptClass::toVariant(const QScriptValue &value)
{
Q_ASSERT(scriptClass(value) == this);
diff --git a/src/declarative/qml/qmlvaluetypescriptclass_p.h b/src/declarative/qml/qdeclarativevaluetypescriptclass_p.h
index 12aef49..31bd415 100644
--- a/src/declarative/qml/qmlvaluetypescriptclass_p.h
+++ b/src/declarative/qml/qdeclarativevaluetypescriptclass_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLVALUETYPESCRIPTCLASS_P_H
-#define QMLVALUETYPESCRIPTCLASS_P_H
+#ifndef QDECLARATIVEVALUETYPESCRIPTCLASS_P_H
+#define QDECLARATIVEVALUETYPESCRIPTCLASS_P_H
//
// W A R N I N G
@@ -54,19 +54,19 @@
//
-#include <private/qmlscriptclass_p.h>
+#include <private/qdeclarativescriptclass_p.h>
QT_BEGIN_NAMESPACE
-class QmlEngine;
-class QmlValueType;
-class QmlValueTypeScriptClass : public QmlScriptClass
+class QDeclarativeEngine;
+class QDeclarativeValueType;
+class QDeclarativeValueTypeScriptClass : public QDeclarativeScriptClass
{
public:
- QmlValueTypeScriptClass(QmlEngine *);
- ~QmlValueTypeScriptClass();
+ QDeclarativeValueTypeScriptClass(QDeclarativeEngine *);
+ ~QDeclarativeValueTypeScriptClass();
- QScriptValue newObject(QObject *object, int coreIndex, QmlValueType *);
+ QScriptValue newObject(QObject *object, int coreIndex, QDeclarativeValueType *);
virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &,
QScriptClass::QueryFlags flags);
@@ -76,11 +76,11 @@ public:
virtual QVariant toVariant(Object *, bool *ok = 0);
QVariant toVariant(const QScriptValue &);
private:
- QmlEngine *engine;
+ QDeclarativeEngine *engine;
int m_lastIndex;
};
QT_END_NAMESPACE
-#endif // QMLVALUETYPESCRIPTCLASS_P_H
+#endif // QDECLARATIVEVALUETYPESCRIPTCLASS_P_H
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index f8f1ff0..d1140a6 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -39,27 +39,27 @@
**
****************************************************************************/
-#include "qmlvme_p.h"
+#include "qdeclarativevme_p.h"
-#include "qmlcompiler_p.h"
-#include "qmlboundsignal_p.h"
-#include "qmlstringconverters_p.h"
+#include "qdeclarativecompiler_p.h"
+#include "qdeclarativeboundsignal_p.h"
+#include "qdeclarativestringconverters_p.h"
#include "qmetaobjectbuilder_p.h"
-#include "qmldeclarativedata_p.h"
-#include "qml.h"
-#include "qmlcustomparser_p.h"
-#include "qmlengine.h"
-#include "qmlcontext.h"
-#include "qmlcomponent.h"
-#include "qmlbinding_p.h"
-#include "qmlengine_p.h"
-#include "qmlcomponent_p.h"
-#include "qmlvmemetaobject_p.h"
-#include "qmlbinding_p_p.h"
-#include "qmlcontext_p.h"
-#include "qmlcompiledbindings_p.h"
-#include "qmlglobal_p.h"
-#include "qmlscriptstring.h"
+#include "qdeclarativedeclarativedata_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativecustomparser_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarativecomponent.h"
+#include "qdeclarativebinding_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativecomponent_p.h"
+#include "qdeclarativevmemetaobject_p.h"
+#include "qdeclarativebinding_p_p.h"
+#include "qdeclarativecontext_p.h"
+#include "qdeclarativecompiledbindings_p.h"
+#include "qdeclarativeglobal_p.h"
+#include "qdeclarativescriptstring.h"
#include <qfxperf_p_p.h>
@@ -75,13 +75,13 @@
QT_BEGIN_NAMESPACE
-QmlVME::QmlVME()
+QDeclarativeVME::QDeclarativeVME()
{
}
#define VME_EXCEPTION(desc) \
{ \
- QmlError error; \
+ QDeclarativeError error; \
error.setDescription(desc.trimmed()); \
error.setLine(instr.line); \
error.setUrl(comp->url); \
@@ -97,14 +97,14 @@ struct ListInstance
: type(t) {}
int type;
- QmlListProperty<void> qListProperty;
+ QDeclarativeListProperty<void> qListProperty;
};
-QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledData *comp,
+QObject *QDeclarativeVME::run(QDeclarativeContext *ctxt, QDeclarativeCompiledData *comp,
int start, int count,
const QBitField &bindingSkipList)
{
- QmlVMEStack<QObject *> stack;
+ QDeclarativeVMEStack<QObject *> stack;
if (start == -1) start = 0;
if (count == -1) count = comp->bytecode.count();
@@ -112,70 +112,70 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledData *comp,
return run(stack, ctxt, comp, start, count, bindingSkipList);
}
-void QmlVME::runDeferred(QObject *object)
+void QDeclarativeVME::runDeferred(QObject *object)
{
- QmlDeclarativeData *data = QmlDeclarativeData::get(object);
+ QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object);
if (!data || !data->context || !data->deferredComponent)
return;
- QmlContext *ctxt = data->context;
- QmlCompiledData *comp = data->deferredComponent;
+ QDeclarativeContext *ctxt = data->context;
+ QDeclarativeCompiledData *comp = data->deferredComponent;
int start = data->deferredIdx + 1;
int count = data->deferredComponent->bytecode.at(data->deferredIdx).defer.deferCount;
- QmlVMEStack<QObject *> stack;
+ QDeclarativeVMEStack<QObject *> stack;
stack.push(object);
run(stack, ctxt, comp, start, count, QBitField());
}
-QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
- QmlCompiledData *comp,
+QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarativeContext *ctxt,
+ QDeclarativeCompiledData *comp,
int start, int count,
const QBitField &bindingSkipList)
{
Q_ASSERT(comp);
Q_ASSERT(ctxt);
- const QList<QmlCompiledData::TypeReference> &types = comp->types;
+ const QList<QDeclarativeCompiledData::TypeReference> &types = comp->types;
const QList<QString> &primitives = comp->primitives;
const QList<QByteArray> &datas = comp->datas;
- const QList<QmlCompiledData::CustomTypeData> &customTypeData = comp->customTypeData;
+ const QList<QDeclarativeCompiledData::CustomTypeData> &customTypeData = comp->customTypeData;
const QList<int> &intData = comp->intData;
const QList<float> &floatData = comp->floatData;
- const QList<QmlPropertyCache *> &propertyCaches = comp->propertyCaches;
- const QList<QmlParser::Object::ScriptBlock> &scripts = comp->scripts;
+ const QList<QDeclarativePropertyCache *> &propertyCaches = comp->propertyCaches;
+ const QList<QDeclarativeParser::Object::ScriptBlock> &scripts = comp->scripts;
const QList<QUrl> &urls = comp->urls;
- QmlEnginePrivate::SimpleList<QmlAbstractBinding> bindValues;
- QmlEnginePrivate::SimpleList<QmlParserStatus> parserStatus;
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> bindValues;
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> parserStatus;
- QmlVMEStack<ListInstance> qliststack;
+ QDeclarativeVMEStack<ListInstance> qliststack;
vmeErrors.clear();
- QmlEnginePrivate *ep = QmlEnginePrivate::get(ctxt->engine());
- QmlContextPrivate *cp = (QmlContextPrivate *)QObjectPrivate::get(ctxt);
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine());
+ QDeclarativeContextPrivate *cp = (QDeclarativeContextPrivate *)QObjectPrivate::get(ctxt);
int status = -1; //for dbus
- QmlMetaProperty::WriteFlags flags = QmlMetaProperty::BypassInterceptor;
+ QDeclarativeMetaProperty::WriteFlags flags = QDeclarativeMetaProperty::BypassInterceptor;
for (int ii = start; !isError() && ii < (start + count); ++ii) {
- const QmlInstruction &instr = comp->bytecode.at(ii);
+ const QDeclarativeInstruction &instr = comp->bytecode.at(ii);
switch(instr.type) {
- case QmlInstruction::Init:
+ case QDeclarativeInstruction::Init:
{
if (instr.init.bindingsSize)
- bindValues = QmlEnginePrivate::SimpleList<QmlAbstractBinding>(instr.init.bindingsSize);
+ bindValues = QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding>(instr.init.bindingsSize);
if (instr.init.parserStatusSize)
- parserStatus = QmlEnginePrivate::SimpleList<QmlParserStatus>(instr.init.parserStatusSize);
+ parserStatus = QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus>(instr.init.parserStatusSize);
if (instr.init.contextCache != -1)
cp->setIdPropertyData(comp->contextCaches.at(instr.init.contextCache));
if (instr.init.compiledBinding != -1)
- cp->optimizedBindings = new QmlCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt);
+ cp->optimizedBindings = new QDeclarativeCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt);
}
break;
- case QmlInstruction::CreateObject:
+ case QDeclarativeInstruction::CreateObject:
{
QBitField bindings;
if (instr.create.bindingBits != -1) {
@@ -192,17 +192,17 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
if(types.at(instr.create.type).component)
vmeErrors << types.at(instr.create.type).component->errors();
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Unable to create object of type %1").arg(QString::fromLatin1(types.at(instr.create.type).className)));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create object of type %1").arg(QString::fromLatin1(types.at(instr.create.type).className)));
}
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(o);
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(o);
Q_ASSERT(ddata);
ddata->outerContext = ctxt;
ddata->lineNumber = instr.line;
ddata->columnNumber = instr.create.column;
if (instr.create.data != -1) {
- QmlCustomParser *customParser =
+ QDeclarativeCustomParser *customParser =
types.at(instr.create.type).type->customParser();
customParser->setCustomData(o, datas.at(instr.create.data));
}
@@ -217,7 +217,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
// TODO: parent might be a layout
}
} else {
- QmlGraphics_setParent_noEvent(o, parent);
+ QDeclarativeGraphics_setParent_noEvent(o, parent);
// o->setParent(parent);
}
}
@@ -225,7 +225,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::SetId:
+ case QDeclarativeInstruction::SetId:
{
QObject *target = stack.top();
cp->setIdProperty(instr.setId.index, target);
@@ -233,19 +233,19 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
break;
- case QmlInstruction::SetDefault:
+ case QDeclarativeInstruction::SetDefault:
{
QObject *target = stack.top();
ctxt->addDefaultObject(target);
}
break;
- case QmlInstruction::CreateComponent:
+ case QDeclarativeInstruction::CreateComponent:
{
- QObject *qcomp = new QmlComponent(ctxt->engine(), comp, ii + 1, instr.createComponent.count, stack.isEmpty() ? 0 : stack.top());
+ QObject *qcomp = new QDeclarativeComponent(ctxt->engine(), comp, ii + 1, instr.createComponent.count, stack.isEmpty() ? 0 : stack.top());
- QmlEngine::setContextForObject(qcomp, ctxt);
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(qcomp);
+ QDeclarativeEngine::setContextForObject(qcomp, ctxt);
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(qcomp);
Q_ASSERT(ddata);
ddata->outerContext = ctxt;
ddata->lineNumber = instr.line;
@@ -256,7 +256,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreMetaObject:
+ case QDeclarativeInstruction::StoreMetaObject:
{
QObject *target = stack.top();
@@ -264,30 +264,30 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
const QByteArray &metadata = datas.at(instr.storeMeta.data);
QMetaObjectBuilder::fromRelocatableData(&mo, 0, metadata);
- const QmlVMEMetaData *data =
- (const QmlVMEMetaData *)datas.at(instr.storeMeta.aliasData).constData();
+ const QDeclarativeVMEMetaData *data =
+ (const QDeclarativeVMEMetaData *)datas.at(instr.storeMeta.aliasData).constData();
- (void)new QmlVMEMetaObject(target, &mo, data, comp);
+ (void)new QDeclarativeVMEMetaObject(target, &mo, data, comp);
- QmlDeclarativeData *ddata = QmlDeclarativeData::get(target, true);
+ QDeclarativeDeclarativeData *ddata = QDeclarativeDeclarativeData::get(target, true);
if (ddata->propertyCache) ddata->propertyCache->release();
ddata->propertyCache = propertyCaches.at(instr.storeMeta.propertyCache);
ddata->propertyCache->addref();
}
break;
- case QmlInstruction::StoreVariant:
+ case QDeclarativeInstruction::StoreVariant:
{
QObject *target = stack.top();
// XXX - can be more efficient
- QVariant v = QmlStringConverters::variantFromString(primitives.at(instr.storeString.value));
+ QVariant v = QDeclarativeStringConverters::variantFromString(primitives.at(instr.storeString.value));
void *a[] = { &v, 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
instr.storeString.propertyIndex, a);
}
break;
- case QmlInstruction::StoreString:
+ case QDeclarativeInstruction::StoreString:
{
QObject *target = stack.top();
void *a[] = { (void *)&primitives.at(instr.storeString.value), 0, &status, &flags };
@@ -296,7 +296,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreUrl:
+ case QDeclarativeInstruction::StoreUrl:
{
QObject *target = stack.top();
void *a[] = { (void *)&urls.at(instr.storeUrl.value), 0, &status, &flags };
@@ -305,7 +305,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreFloat:
+ case QDeclarativeInstruction::StoreFloat:
{
QObject *target = stack.top();
float f = instr.storeFloat.value;
@@ -315,7 +315,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreDouble:
+ case QDeclarativeInstruction::StoreDouble:
{
QObject *target = stack.top();
double d = instr.storeDouble.value;
@@ -325,7 +325,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreBool:
+ case QDeclarativeInstruction::StoreBool:
{
QObject *target = stack.top();
void *a[] = { (void *)&instr.storeBool.value, 0, &status, &flags };
@@ -334,7 +334,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreInteger:
+ case QDeclarativeInstruction::StoreInteger:
{
QObject *target = stack.top();
void *a[] = { (void *)&instr.storeInteger.value, 0, &status, &flags };
@@ -343,7 +343,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreColor:
+ case QDeclarativeInstruction::StoreColor:
{
QObject *target = stack.top();
QColor c = QColor::fromRgba(instr.storeColor.value);
@@ -353,7 +353,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreDate:
+ case QDeclarativeInstruction::StoreDate:
{
QObject *target = stack.top();
QDate d = QDate::fromJulianDay(instr.storeDate.value);
@@ -363,7 +363,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreTime:
+ case QDeclarativeInstruction::StoreTime:
{
QObject *target = stack.top();
QTime t;
@@ -377,7 +377,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreDateTime:
+ case QDeclarativeInstruction::StoreDateTime:
{
QObject *target = stack.top();
QTime t;
@@ -392,7 +392,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StorePoint:
+ case QDeclarativeInstruction::StorePoint:
{
QObject *target = stack.top();
QPoint p = QPointF(floatData.at(instr.storeRealPair.valueIndex),
@@ -403,7 +403,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StorePointF:
+ case QDeclarativeInstruction::StorePointF:
{
QObject *target = stack.top();
QPointF p(floatData.at(instr.storeRealPair.valueIndex),
@@ -414,7 +414,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreSize:
+ case QDeclarativeInstruction::StoreSize:
{
QObject *target = stack.top();
QSize p = QSizeF(floatData.at(instr.storeRealPair.valueIndex),
@@ -425,7 +425,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreSizeF:
+ case QDeclarativeInstruction::StoreSizeF:
{
QObject *target = stack.top();
QSizeF s(floatData.at(instr.storeRealPair.valueIndex),
@@ -436,7 +436,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreRect:
+ case QDeclarativeInstruction::StoreRect:
{
QObject *target = stack.top();
QRect r = QRectF(floatData.at(instr.storeRect.valueIndex),
@@ -449,7 +449,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreRectF:
+ case QDeclarativeInstruction::StoreRectF:
{
QObject *target = stack.top();
QRectF r(floatData.at(instr.storeRect.valueIndex),
@@ -462,7 +462,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreVector3D:
+ case QDeclarativeInstruction::StoreVector3D:
{
QObject *target = stack.top();
QVector3D p(floatData.at(instr.storeVector3D.valueIndex),
@@ -474,7 +474,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreObject:
+ case QDeclarativeInstruction::StoreObject:
{
QObject *assignObj = stack.pop();
QObject *target = stack.top();
@@ -486,19 +486,19 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
break;
- case QmlInstruction::AssignCustomType:
+ case QDeclarativeInstruction::AssignCustomType:
{
QObject *target = stack.top();
- QmlCompiledData::CustomTypeData data = customTypeData.at(instr.assignCustomType.valueIndex);
+ QDeclarativeCompiledData::CustomTypeData data = customTypeData.at(instr.assignCustomType.valueIndex);
const QString &primitive = primitives.at(data.index);
- QmlMetaType::StringConverter converter =
- QmlMetaType::customStringConverter(data.type);
+ QDeclarativeMetaType::StringConverter converter =
+ QDeclarativeMetaType::customStringConverter(data.type);
QVariant v = (*converter)(primitive);
QMetaProperty prop =
target->metaObject()->property(instr.assignCustomType.propertyIndex);
if (v.isNull() || ((int)prop.type() != data.type && prop.userType() != data.type))
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot assign value %1 to property %2").arg(primitive).arg(QString::fromUtf8(prop.name())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign value %1 to property %2").arg(primitive).arg(QString::fromUtf8(prop.name())));
void *a[] = { (void *)v.data(), 0, &status, &flags };
QMetaObject::metacall(target, QMetaObject::WriteProperty,
@@ -506,7 +506,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::AssignSignalObject:
+ case QDeclarativeInstruction::AssignSignalObject:
{
// XXX optimize
@@ -515,53 +515,53 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
int sigIdx = instr.assignSignalObject.signal;
const QByteArray &pr = datas.at(sigIdx);
- QmlMetaProperty prop(target, QString::fromUtf8(pr));
- if (prop.type() & QmlMetaProperty::SignalProperty) {
+ QDeclarativeMetaProperty prop(target, QString::fromUtf8(pr));
+ if (prop.type() & QDeclarativeMetaProperty::SignalProperty) {
- QMetaMethod method = QmlMetaType::defaultMethod(assign);
+ QMetaMethod method = QDeclarativeMetaType::defaultMethod(assign);
if (method.signature() == 0)
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot assign object type %1 with no default method").arg(QString::fromLatin1(assign->metaObject()->className())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object type %1 with no default method").arg(QString::fromLatin1(assign->metaObject()->className())));
if (!QMetaObject::checkConnectArgs(prop.method().signature(), method.signature()))
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot connect mismatched signal/slot %1 %vs. %2").arg(QString::fromLatin1(method.signature())).arg(QString::fromLatin1(prop.method().signature())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot connect mismatched signal/slot %1 %vs. %2").arg(QString::fromLatin1(method.signature())).arg(QString::fromLatin1(prop.method().signature())));
QMetaObject::connect(target, prop.coreIndex(), assign, method.methodIndex());
} else {
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot assign an object to signal property %1").arg(QString::fromUtf8(pr)));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign an object to signal property %1").arg(QString::fromUtf8(pr)));
}
}
break;
- case QmlInstruction::StoreSignal:
+ case QDeclarativeInstruction::StoreSignal:
{
QObject *target = stack.top();
// XXX scope
QMetaMethod signal =
target->metaObject()->method(instr.storeSignal.signalIndex);
- QmlBoundSignal *bs = new QmlBoundSignal(target, signal, target);
- QmlExpression *expr =
- new QmlExpression(ctxt, primitives.at(instr.storeSignal.value), target);
+ QDeclarativeBoundSignal *bs = new QDeclarativeBoundSignal(target, signal, target);
+ QDeclarativeExpression *expr =
+ new QDeclarativeExpression(ctxt, primitives.at(instr.storeSignal.value), target);
expr->setSourceLocation(comp->name, instr.line);
bs->setExpression(expr);
}
break;
- case QmlInstruction::StoreScript:
+ case QDeclarativeInstruction::StoreScript:
{
QObject *target = stack.top();
cp->addScript(scripts.at(instr.storeScript.value), target);
}
break;
- case QmlInstruction::StoreScriptString:
+ case QDeclarativeInstruction::StoreScriptString:
{
QObject *target = stack.top();
QObject *scope = stack.at(stack.count() - 1 - instr.storeScriptString.scope);
- QmlScriptString ss;
+ QDeclarativeScriptString ss;
ss.setContext(ctxt);
ss.setScopeObject(scope);
ss.setScript(primitives.at(instr.storeScriptString.value));
@@ -572,10 +572,10 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::BeginObject:
+ case QDeclarativeInstruction::BeginObject:
{
QObject *target = stack.top();
- QmlParserStatus *status = reinterpret_cast<QmlParserStatus *>(reinterpret_cast<char *>(target) + instr.begin.castValue);
+ QDeclarativeParserStatus *status = reinterpret_cast<QDeclarativeParserStatus *>(reinterpret_cast<char *>(target) + instr.begin.castValue);
parserStatus.append(status);
status->d = &parserStatus.values[parserStatus.count - 1];
@@ -583,22 +583,22 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreBinding:
+ case QDeclarativeInstruction::StoreBinding:
{
QObject *target =
stack.at(stack.count() - 1 - instr.assignBinding.owner);
QObject *context =
stack.at(stack.count() - 1 - instr.assignBinding.context);
- QmlMetaProperty mp =
- QmlMetaPropertyPrivate::restore(datas.at(instr.assignBinding.property), target, ctxt);
+ QDeclarativeMetaProperty mp =
+ QDeclarativeMetaPropertyPrivate::restore(datas.at(instr.assignBinding.property), target, ctxt);
int coreIndex = mp.coreIndex();
if (stack.count() == 1 && bindingSkipList.testBit(coreIndex))
break;
- QmlBinding *bind = new QmlBinding((void *)datas.at(instr.assignBinding.value).constData(), comp, context, ctxt, comp->name, instr.line, 0);
+ QDeclarativeBinding *bind = new QDeclarativeBinding((void *)datas.at(instr.assignBinding.value).constData(), comp, context, ctxt, comp->name, instr.line, 0);
bindValues.append(bind);
bind->m_mePtr = &bindValues.values[bindValues.count - 1];
bind->setTarget(mp);
@@ -606,7 +606,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreCompiledBinding:
+ case QDeclarativeInstruction::StoreCompiledBinding:
{
QObject *target =
stack.at(stack.count() - 1 - instr.assignBinding.owner);
@@ -617,7 +617,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
if (stack.count() == 1 && bindingSkipList.testBit(property & 0xFFFF))
break;
- QmlAbstractBinding *binding =
+ QDeclarativeAbstractBinding *binding =
cp->optimizedBindings->configBinding(instr.assignBinding.value, target, scope, property);
bindValues.append(binding);
binding->m_mePtr = &bindValues.values[bindValues.count - 1];
@@ -625,43 +625,43 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreValueSource:
+ case QDeclarativeInstruction::StoreValueSource:
{
QObject *obj = stack.pop();
- QmlPropertyValueSource *vs = reinterpret_cast<QmlPropertyValueSource *>(reinterpret_cast<char *>(obj) + instr.assignValueSource.castValue);
+ QDeclarativePropertyValueSource *vs = reinterpret_cast<QDeclarativePropertyValueSource *>(reinterpret_cast<char *>(obj) + instr.assignValueSource.castValue);
QObject *target = stack.at(stack.count() - 1 - instr.assignValueSource.owner);
- QmlMetaProperty prop =
- QmlMetaPropertyPrivate::restore(datas.at(instr.assignValueSource.property), target, ctxt);
+ QDeclarativeMetaProperty prop =
+ QDeclarativeMetaPropertyPrivate::restore(datas.at(instr.assignValueSource.property), target, ctxt);
obj->setParent(target);
vs->setTarget(prop);
}
break;
- case QmlInstruction::StoreValueInterceptor:
+ case QDeclarativeInstruction::StoreValueInterceptor:
{
QObject *obj = stack.pop();
- QmlPropertyValueInterceptor *vi = reinterpret_cast<QmlPropertyValueInterceptor *>(reinterpret_cast<char *>(obj) + instr.assignValueInterceptor.castValue);
+ QDeclarativePropertyValueInterceptor *vi = reinterpret_cast<QDeclarativePropertyValueInterceptor *>(reinterpret_cast<char *>(obj) + instr.assignValueInterceptor.castValue);
QObject *target = stack.at(stack.count() - 1 - instr.assignValueInterceptor.owner);
- QmlMetaProperty prop =
- QmlMetaPropertyPrivate::restore(datas.at(instr.assignValueInterceptor.property), target, ctxt);
+ QDeclarativeMetaProperty prop =
+ QDeclarativeMetaPropertyPrivate::restore(datas.at(instr.assignValueInterceptor.property), target, ctxt);
obj->setParent(target);
vi->setTarget(prop);
- QmlVMEMetaObject *mo = static_cast<QmlVMEMetaObject *>((QMetaObject*)target->metaObject());
+ QDeclarativeVMEMetaObject *mo = static_cast<QDeclarativeVMEMetaObject *>((QMetaObject*)target->metaObject());
mo->registerInterceptor(prop.coreIndex(), prop.valueTypeCoreIndex(), vi);
}
break;
- case QmlInstruction::StoreObjectQList:
+ case QDeclarativeInstruction::StoreObjectQList:
{
QObject *assign = stack.pop();
const ListInstance &list = qliststack.top();
- list.qListProperty.append((QmlListProperty<void>*)&list.qListProperty, assign);
+ list.qListProperty.append((QDeclarativeListProperty<void>*)&list.qListProperty, assign);
}
break;
- case QmlInstruction::AssignObjectList:
+ case QDeclarativeInstruction::AssignObjectList:
{
// This is only used for assigning interfaces
QObject *assign = stack.pop();
@@ -671,18 +671,18 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
void *ptr = 0;
- const char *iid = QmlMetaType::interfaceIId(type);
+ const char *iid = QDeclarativeMetaType::interfaceIId(type);
if (iid)
ptr = assign->qt_metacast(iid);
if (!ptr)
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot assign object to list"));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to list"));
- list.qListProperty.append((QmlListProperty<void>*)&list.qListProperty, ptr);
+ list.qListProperty.append((QDeclarativeListProperty<void>*)&list.qListProperty, ptr);
}
break;
- case QmlInstruction::StoreVariantObject:
+ case QDeclarativeInstruction::StoreVariantObject:
{
QObject *assign = stack.pop();
QObject *target = stack.top();
@@ -694,7 +694,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::StoreInterface:
+ case QDeclarativeInstruction::StoreInterface:
{
QObject *assign = stack.pop();
QObject *target = stack.top();
@@ -702,7 +702,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
int coreIdx = instr.storeObject.propertyIndex;
QMetaProperty prop = target->metaObject()->property(coreIdx);
int t = prop.userType();
- const char *iid = QmlMetaType::interfaceIId(t);
+ const char *iid = QDeclarativeMetaType::interfaceIId(t);
bool ok = false;
if (iid) {
void *ptr = assign->qt_metacast(iid);
@@ -716,24 +716,24 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
if (!ok)
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot assign object to interface property"));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign object to interface property"));
}
break;
- case QmlInstruction::FetchAttached:
+ case QDeclarativeInstruction::FetchAttached:
{
QObject *target = stack.top();
QObject *qmlObject = qmlAttachedPropertiesObjectById(instr.fetchAttached.id, target);
if (!qmlObject)
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Unable to create attached object"));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create attached object"));
stack.push(qmlObject);
}
break;
- case QmlInstruction::FetchQList:
+ case QDeclarativeInstruction::FetchQList:
{
QObject *target = stack.top();
@@ -746,7 +746,7 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::FetchObject:
+ case QDeclarativeInstruction::FetchObject:
{
QObject *target = stack.top();
@@ -759,24 +759,24 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
instr.fetch.property, a);
if (!obj)
- VME_EXCEPTION(QCoreApplication::translate("QmlVME","Cannot set properties on %1 as it is null").arg(QString::fromUtf8(target->metaObject()->property(instr.fetch.property).name())));
+ VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot set properties on %1 as it is null").arg(QString::fromUtf8(target->metaObject()->property(instr.fetch.property).name())));
stack.push(obj);
}
break;
- case QmlInstruction::PopQList:
+ case QDeclarativeInstruction::PopQList:
{
qliststack.pop();
}
break;
- case QmlInstruction::Defer:
+ case QDeclarativeInstruction::Defer:
{
if (instr.defer.deferCount) {
QObject *target = stack.top();
- QmlDeclarativeData *data =
- QmlDeclarativeData::get(target, true);
+ QDeclarativeDeclarativeData *data =
+ QDeclarativeDeclarativeData::get(target, true);
comp->addref();
data->deferredComponent = comp;
data->deferredIdx = ii;
@@ -785,33 +785,33 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
}
break;
- case QmlInstruction::PopFetchedObject:
+ case QDeclarativeInstruction::PopFetchedObject:
{
stack.pop();
}
break;
- case QmlInstruction::FetchValueType:
+ case QDeclarativeInstruction::FetchValueType:
{
QObject *target = stack.top();
- QmlValueType *valueHandler =
+ QDeclarativeValueType *valueHandler =
ep->valueTypes[instr.fetchValue.type];
valueHandler->read(target, instr.fetchValue.property);
stack.push(valueHandler);
}
break;
- case QmlInstruction::PopValueType:
+ case QDeclarativeInstruction::PopValueType:
{
- QmlValueType *valueHandler =
- static_cast<QmlValueType *>(stack.pop());
+ QDeclarativeValueType *valueHandler =
+ static_cast<QDeclarativeValueType *>(stack.pop());
QObject *target = stack.top();
- valueHandler->write(target, instr.fetchValue.property, QmlMetaProperty::BypassInterceptor);
+ valueHandler->write(target, instr.fetchValue.property, QDeclarativeMetaProperty::BypassInterceptor);
}
break;
default:
- qFatal("QmlCompiledData: Internal error - unknown instruction %d", instr.type);
+ qFatal("QDeclarativeCompiledData: Internal error - unknown instruction %d", instr.type);
break;
}
}
@@ -821,8 +821,8 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
delete stack.at(0);
}
- QmlEnginePrivate::clear(bindValues);
- QmlEnginePrivate::clear(parserStatus);
+ QDeclarativeEnginePrivate::clear(bindValues);
+ QDeclarativeEnginePrivate::clear(parserStatus);
return 0;
}
@@ -838,12 +838,12 @@ QObject *QmlVME::run(QmlVMEStack<QObject *> &stack, QmlContext *ctxt,
return 0;
}
-bool QmlVME::isError() const
+bool QDeclarativeVME::isError() const
{
return !vmeErrors.isEmpty();
}
-QList<QmlError> QmlVME::errors() const
+QList<QDeclarativeError> QDeclarativeVME::errors() const
{
return vmeErrors;
}
diff --git a/src/declarative/qml/qmlvme_p.h b/src/declarative/qml/qdeclarativevme_p.h
index ae7dd7f..951f6a7 100644
--- a/src/declarative/qml/qmlvme_p.h
+++ b/src/declarative/qml/qdeclarativevme_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLVME_P_H
-#define QMLVME_P_H
+#ifndef QDECLARATIVEVME_P_H
+#define QDECLARATIVEVME_P_H
//
// W A R N I N G
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qmlerror.h"
+#include "qdeclarativeerror.h"
#include "qbitfield_p.h"
#include <QtCore/QString>
@@ -62,16 +62,16 @@
QT_BEGIN_NAMESPACE
class QObject;
-class QmlInstruction;
-class QmlCompiledData;
-class QmlCompiledData;
-class QmlContext;
+class QDeclarativeInstruction;
+class QDeclarativeCompiledData;
+class QDeclarativeCompiledData;
+class QDeclarativeContext;
template<typename T, int N = 128>
-class QmlVMEStack {
+class QDeclarativeVMEStack {
public:
- QmlVMEStack() : index(-1), maxSize(N), data(fixedData) {}
- ~QmlVMEStack() { if (data != fixedData) qFree(fixedData); }
+ QDeclarativeVMEStack() : index(-1), maxSize(N), data(fixedData) {}
+ ~QDeclarativeVMEStack() { if (data != fixedData) qFree(fixedData); }
bool isEmpty() const { return index == -1; }
const T &top() const { return data[index]; }
@@ -95,25 +95,25 @@ private:
T fixedData[N];
};
-class QmlVME
+class QDeclarativeVME
{
public:
- QmlVME();
+ QDeclarativeVME();
- QObject *run(QmlContext *, QmlCompiledData *,
+ QObject *run(QDeclarativeContext *, QDeclarativeCompiledData *,
int start = -1, int count = -1,
const QBitField & = QBitField());
void runDeferred(QObject *);
bool isError() const;
- QList<QmlError> errors() const;
+ QList<QDeclarativeError> errors() const;
private:
- QObject *run(QmlVMEStack<QObject *> &, QmlContext *, QmlCompiledData *,
+ QObject *run(QDeclarativeVMEStack<QObject *> &, QDeclarativeContext *, QDeclarativeCompiledData *,
int start, int count, const QBitField &);
- QList<QmlError> vmeErrors;
+ QList<QDeclarativeError> vmeErrors;
};
QT_END_NAMESPACE
-#endif // QMLVME_P_H
+#endif // QDECLARATIVEVME_P_H
diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp
index 4886680..6811e13 100644
--- a/src/declarative/qml/qmlvmemetaobject.cpp
+++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
-#include "qmlvmemetaobject_p.h"
+#include "qdeclarativevmemetaobject_p.h"
-#include "qml.h"
-#include "qmlrefcount_p.h"
-#include "qmlexpression.h"
-#include "qmlexpression_p.h"
-#include "qmlcontext_p.h"
+#include "qdeclarative.h"
+#include "qdeclarativerefcount_p.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativeexpression_p.h"
+#include "qdeclarativecontext_p.h"
#include <QColor>
#include <QDate>
@@ -54,10 +54,10 @@
QT_BEGIN_NAMESPACE
-QmlVMEMetaObject::QmlVMEMetaObject(QObject *obj,
+QDeclarativeVMEMetaObject::QDeclarativeVMEMetaObject(QObject *obj,
const QMetaObject *other,
- const QmlVMEMetaData *meta,
- QmlCompiledData *cdata)
+ const QDeclarativeVMEMetaData *meta,
+ QDeclarativeCompiledData *cdata)
: object(obj), compiledData(cdata), ctxt(qmlContext(obj)), metaData(meta), methods(0),
parent(0)
{
@@ -77,13 +77,13 @@ QmlVMEMetaObject::QmlVMEMetaObject(QObject *obj,
data = new QVariant[metaData->propertyCount];
aConnected.resize(metaData->aliasCount);
- int list_type = qMetaTypeId<QmlListProperty<QObject> >();
+ int list_type = qMetaTypeId<QDeclarativeListProperty<QObject> >();
// ### Optimize
for (int ii = 0; ii < metaData->propertyCount; ++ii) {
int t = (metaData->propertyData() + ii)->propertyType;
if (t == list_type) {
listProperties.append(new List(methodOffset + ii));
- data[ii] = QVariant::fromValue(QmlListProperty<QObject>(obj, listProperties.last(), list_append,
+ data[ii] = QVariant::fromValue(QDeclarativeListProperty<QObject>(obj, listProperties.last(), list_append,
list_count, list_at, list_clear));
} else if (t != -1) {
data[ii] = QVariant((QVariant::Type)t);
@@ -91,7 +91,7 @@ QmlVMEMetaObject::QmlVMEMetaObject(QObject *obj,
}
}
-QmlVMEMetaObject::~QmlVMEMetaObject()
+QDeclarativeVMEMetaObject::~QDeclarativeVMEMetaObject()
{
compiledData->release();
delete parent;
@@ -100,25 +100,25 @@ QmlVMEMetaObject::~QmlVMEMetaObject()
delete [] methods;
}
-int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
+int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
{
int id = _id;
if(c == QMetaObject::WriteProperty) {
int flags = *reinterpret_cast<int*>(a[3]);
- if (!(flags & QmlMetaProperty::BypassInterceptor)
+ if (!(flags & QDeclarativeMetaProperty::BypassInterceptor)
&& !aInterceptors.isEmpty()
&& aInterceptors.testBit(id)) {
- QPair<int, QmlPropertyValueInterceptor*> pair = interceptors.value(id);
+ QPair<int, QDeclarativePropertyValueInterceptor*> pair = interceptors.value(id);
int valueIndex = pair.first;
- QmlPropertyValueInterceptor *vi = pair.second;
+ QDeclarativePropertyValueInterceptor *vi = pair.second;
int type = property(id).userType();
if (type != QVariant::Invalid) {
if (valueIndex != -1) {
- QmlEnginePrivate *ep = ctxt?QmlEnginePrivate::get(ctxt->engine()):0;
- QmlValueType *valueType = 0;
+ QDeclarativeEnginePrivate *ep = ctxt?QDeclarativeEnginePrivate::get(ctxt->engine()):0;
+ QDeclarativeValueType *valueType = 0;
if (ep) valueType = ep->valueTypes[type];
- else valueType = QmlValueTypeFactory::valueType(type);
+ else valueType = QDeclarativeValueTypeFactory::valueType(type);
Q_ASSERT(valueType);
valueType->setValue(QVariant(type, a[0]));
@@ -183,9 +183,9 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
default:
break;
}
- if (t == qMetaTypeId<QmlListProperty<QObject> >()) {
- *reinterpret_cast<QmlListProperty<QObject> *>(a[0]) =
- data[id].value<QmlListProperty<QObject> >();
+ if (t == qMetaTypeId<QDeclarativeListProperty<QObject> >()) {
+ *reinterpret_cast<QDeclarativeListProperty<QObject> *>(a[0]) =
+ data[id].value<QDeclarativeListProperty<QObject> >();
}
} else if (c == QMetaObject::WriteProperty) {
@@ -208,14 +208,14 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
if (id < metaData->aliasCount) {
- QmlVMEMetaData::AliasData *d = metaData->aliasData() + id;
+ QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + id;
if (d->flags & QML_ALIAS_FLAG_PTR && c == QMetaObject::ReadProperty)
*reinterpret_cast<void **>(a[0]) = 0;
if (!ctxt) return -1;
- QmlContextPrivate *ctxtPriv =
- (QmlContextPrivate *)QObjectPrivate::get(ctxt);
+ QDeclarativeContextPrivate *ctxtPriv =
+ (QDeclarativeContextPrivate *)QObjectPrivate::get(ctxt);
QObject *target = ctxtPriv->idValues[d->contextIdx].data();
if (!target)
@@ -265,12 +265,12 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
if (!ctxt->engine())
return -1; // We can't run the method
- QmlEnginePrivate *ep = QmlEnginePrivate::get(ctxt->engine());
+ QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine());
QScriptValue function = method(id);
QScriptValueList args;
- QmlVMEMetaData::MethodData *data = metaData->methodData() + id;
+ QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + id;
if (data->parameterCount) {
for (int ii = 0; ii < data->parameterCount; ++ii) {
args << ep->scriptValueFromVariant(*(QVariant *)a[ii + 1]);
@@ -292,13 +292,13 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
return object->qt_metacall(c, _id, a);
}
-QScriptValue QmlVMEMetaObject::method(int index)
+QScriptValue QDeclarativeVMEMetaObject::method(int index)
{
if (!methods)
methods = new QScriptValue[metaData->methodCount];
if (!methods[index].isValid()) {
- QmlVMEMetaData::MethodData *data = metaData->methodData() + index;
+ QDeclarativeVMEMetaData::MethodData *data = metaData->methodData() + index;
const QChar *body =
(const QChar *)(((const char*)metaData) + data->bodyOffset);
@@ -309,42 +309,42 @@ QScriptValue QmlVMEMetaObject::method(int index)
// XXX We should evaluate all methods in a single big script block to
// improve the call time between dynamic methods defined on the same
// object
- methods[index] = QmlExpressionPrivate::evalInObjectScope(ctxt, object, code);
+ methods[index] = QDeclarativeExpressionPrivate::evalInObjectScope(ctxt, object, code);
}
return methods[index];
}
-void QmlVMEMetaObject::listChanged(int id)
+void QDeclarativeVMEMetaObject::listChanged(int id)
{
activate(object, methodOffset + id, 0);
}
-void QmlVMEMetaObject::list_append(QmlListProperty<QObject> *prop, QObject *o)
+void QDeclarativeVMEMetaObject::list_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
{
List *list = static_cast<List *>(prop->data);
list->append(o);
QMetaObject::activate(prop->object, list->notifyIndex, 0);
}
-int QmlVMEMetaObject::list_count(QmlListProperty<QObject> *prop)
+int QDeclarativeVMEMetaObject::list_count(QDeclarativeListProperty<QObject> *prop)
{
return static_cast<List *>(prop->data)->count();
}
-QObject *QmlVMEMetaObject::list_at(QmlListProperty<QObject> *prop, int index)
+QObject *QDeclarativeVMEMetaObject::list_at(QDeclarativeListProperty<QObject> *prop, int index)
{
return static_cast<List *>(prop->data)->at(index);
}
-void QmlVMEMetaObject::list_clear(QmlListProperty<QObject> *prop)
+void QDeclarativeVMEMetaObject::list_clear(QDeclarativeListProperty<QObject> *prop)
{
List *list = static_cast<List *>(prop->data);
list->clear();
QMetaObject::activate(prop->object, list->notifyIndex, 0);
}
-void QmlVMEMetaObject::registerInterceptor(int index, int valueIndex, QmlPropertyValueInterceptor *interceptor)
+void QDeclarativeVMEMetaObject::registerInterceptor(int index, int valueIndex, QDeclarativePropertyValueInterceptor *interceptor)
{
if (aInterceptors.isEmpty())
aInterceptors.resize(propertyCount() + metaData->propertyCount);
@@ -352,11 +352,11 @@ void QmlVMEMetaObject::registerInterceptor(int index, int valueIndex, QmlPropert
interceptors.insert(index, qMakePair(valueIndex, interceptor));
}
-QScriptValue QmlVMEMetaObject::vmeMethod(int index)
+QScriptValue QDeclarativeVMEMetaObject::vmeMethod(int index)
{
if (index < methodOffset) {
Q_ASSERT(parent);
- return static_cast<QmlVMEMetaObject *>(parent)->vmeMethod(index);
+ return static_cast<QDeclarativeVMEMetaObject *>(parent)->vmeMethod(index);
}
int plainSignals = metaData->signalCount + metaData->propertyCount + metaData->aliasCount;
Q_ASSERT(index >= (methodOffset + plainSignals) && index < (methodOffset + plainSignals + metaData->methodCount));
diff --git a/src/declarative/qml/qmlvmemetaobject_p.h b/src/declarative/qml/qdeclarativevmemetaobject_p.h
index 3eb776e..37c0b7a 100644
--- a/src/declarative/qml/qmlvmemetaobject_p.h
+++ b/src/declarative/qml/qdeclarativevmemetaobject_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLVMEMETAOBJECT_P_H
-#define QMLVMEMETAOBJECT_P_H
+#ifndef QDECLARATIVEVMEMETAOBJECT_P_H
+#define QDECLARATIVEVMEMETAOBJECT_P_H
//
// W A R N I N G
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qml.h"
+#include "qdeclarative.h"
#include <QtCore/QMetaObject>
#include <QtCore/QBitArray>
@@ -61,14 +61,14 @@
#include <private/qobject_p.h>
-#include "qmlguard_p.h"
-#include "qmlcompiler_p.h"
+#include "qdeclarativeguard_p.h"
+#include "qdeclarativecompiler_p.h"
QT_BEGIN_NAMESPACE
#define QML_ALIAS_FLAG_PTR 0x00000001
-struct QmlVMEMetaData
+struct QDeclarativeVMEMetaData
{
short propertyCount;
short aliasCount;
@@ -93,7 +93,7 @@ struct QmlVMEMetaData
};
PropertyData *propertyData() const {
- return (PropertyData *)(((const char *)this) + sizeof(QmlVMEMetaData));
+ return (PropertyData *)(((const char *)this) + sizeof(QDeclarativeVMEMetaData));
}
AliasData *aliasData() const {
@@ -105,32 +105,32 @@ struct QmlVMEMetaData
}
};
-class QmlRefCount;
-class QmlVMEMetaObject : public QAbstractDynamicMetaObject
+class QDeclarativeRefCount;
+class QDeclarativeVMEMetaObject : public QAbstractDynamicMetaObject
{
public:
- QmlVMEMetaObject(QObject *obj, const QMetaObject *other, const QmlVMEMetaData *data,
- QmlCompiledData *compiledData);
- ~QmlVMEMetaObject();
+ QDeclarativeVMEMetaObject(QObject *obj, const QMetaObject *other, const QDeclarativeVMEMetaData *data,
+ QDeclarativeCompiledData *compiledData);
+ ~QDeclarativeVMEMetaObject();
- void registerInterceptor(int index, int valueIndex, QmlPropertyValueInterceptor *interceptor);
+ void registerInterceptor(int index, int valueIndex, QDeclarativePropertyValueInterceptor *interceptor);
QScriptValue vmeMethod(int index);
protected:
virtual int metaCall(QMetaObject::Call _c, int _id, void **_a);
private:
QObject *object;
- QmlCompiledData *compiledData;
- QmlGuard<QmlContext> ctxt;
+ QDeclarativeCompiledData *compiledData;
+ QDeclarativeGuard<QDeclarativeContext> ctxt;
- const QmlVMEMetaData *metaData;
+ const QDeclarativeVMEMetaData *metaData;
int propOffset;
int methodOffset;
QVariant *data;
QBitArray aConnected;
QBitArray aInterceptors;
- QHash<int, QPair<int, QmlPropertyValueInterceptor*> > interceptors;
+ QHash<int, QPair<int, QDeclarativePropertyValueInterceptor*> > interceptors;
QScriptValue *methods;
QScriptValue method(int);
@@ -146,12 +146,12 @@ private:
};
QList<List *> listProperties;
- static void list_append(QmlListProperty<QObject> *, QObject *);
- static int list_count(QmlListProperty<QObject> *);
- static QObject *list_at(QmlListProperty<QObject> *, int);
- static void list_clear(QmlListProperty<QObject> *);
+ static void list_append(QDeclarativeListProperty<QObject> *, QObject *);
+ static int list_count(QDeclarativeListProperty<QObject> *);
+ static QObject *list_at(QDeclarativeListProperty<QObject> *, int);
+ static void list_clear(QDeclarativeListProperty<QObject> *);
};
QT_END_NAMESPACE
-#endif // QMLVMEMETAOBJECT_P_H
+#endif // QDECLARATIVEVMEMETAOBJECT_P_H
diff --git a/src/declarative/qml/qmlwatcher.cpp b/src/declarative/qml/qdeclarativewatcher.cpp
index a8a94c5..2f61195 100644
--- a/src/declarative/qml/qmlwatcher.cpp
+++ b/src/declarative/qml/qdeclarativewatcher.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
-#include "qmlwatcher_p.h"
+#include "qdeclarativewatcher_p.h"
-#include "qmlexpression.h"
-#include "qmlcontext.h"
-#include "qml.h"
+#include "qdeclarativeexpression.h"
+#include "qdeclarativecontext.h"
+#include "qdeclarative.h"
-#include <qmldebugservice_p.h>
+#include <qdeclarativedebugservice_p.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qdebug.h>
@@ -53,60 +53,60 @@
QT_BEGIN_NAMESPACE
-class QmlWatchProxy : public QObject
+class QDeclarativeWatchProxy : public QObject
{
Q_OBJECT
public:
- QmlWatchProxy(int id,
+ QDeclarativeWatchProxy(int id,
QObject *object,
int debugId,
const QMetaProperty &prop,
- QmlWatcher *parent = 0);
+ QDeclarativeWatcher *parent = 0);
- QmlWatchProxy(int id,
- QmlExpression *exp,
+ QDeclarativeWatchProxy(int id,
+ QDeclarativeExpression *exp,
int debugId,
- QmlWatcher *parent = 0);
+ QDeclarativeWatcher *parent = 0);
public slots:
void notifyValueChanged();
private:
- friend class QmlWatcher;
+ friend class QDeclarativeWatcher;
int m_id;
- QmlWatcher *m_watch;
+ QDeclarativeWatcher *m_watch;
QObject *m_object;
int m_debugId;
QMetaProperty m_property;
- QmlExpression *m_expr;
+ QDeclarativeExpression *m_expr;
};
-QmlWatchProxy::QmlWatchProxy(int id,
- QmlExpression *exp,
+QDeclarativeWatchProxy::QDeclarativeWatchProxy(int id,
+ QDeclarativeExpression *exp,
int debugId,
- QmlWatcher *parent)
+ QDeclarativeWatcher *parent)
: QObject(parent), m_id(id), m_watch(parent), m_object(0), m_debugId(debugId), m_expr(exp)
{
QObject::connect(m_expr, SIGNAL(valueChanged()), this, SLOT(notifyValueChanged()));
}
-QmlWatchProxy::QmlWatchProxy(int id,
+QDeclarativeWatchProxy::QDeclarativeWatchProxy(int id,
QObject *object,
int debugId,
const QMetaProperty &prop,
- QmlWatcher *parent)
+ QDeclarativeWatcher *parent)
: QObject(parent), m_id(id), m_watch(parent), m_object(object), m_debugId(debugId), m_property(prop), m_expr(0)
{
static int refreshIdx = -1;
if(refreshIdx == -1)
- refreshIdx = QmlWatchProxy::staticMetaObject.indexOfMethod("notifyValueChanged()");
+ refreshIdx = QDeclarativeWatchProxy::staticMetaObject.indexOfMethod("notifyValueChanged()");
if (prop.hasNotifySignal())
QMetaObject::connect(m_object, prop.notifySignalIndex(), this, refreshIdx);
}
-void QmlWatchProxy::notifyValueChanged()
+void QDeclarativeWatchProxy::notifyValueChanged()
{
QVariant v;
if (m_expr)
@@ -118,14 +118,14 @@ void QmlWatchProxy::notifyValueChanged()
}
-QmlWatcher::QmlWatcher(QObject *parent)
+QDeclarativeWatcher::QDeclarativeWatcher(QObject *parent)
: QObject(parent)
{
}
-bool QmlWatcher::addWatch(int id, quint32 debugId)
+bool QDeclarativeWatcher::addWatch(int id, quint32 debugId)
{
- QObject *object = QmlDebugService::objectForId(debugId);
+ QObject *object = QDeclarativeDebugService::objectForId(debugId);
if (object) {
int propCount = object->metaObject()->propertyCount();
for (int ii=0; ii<propCount; ii++)
@@ -135,9 +135,9 @@ bool QmlWatcher::addWatch(int id, quint32 debugId)
return false;
}
-bool QmlWatcher::addWatch(int id, quint32 debugId, const QByteArray &property)
+bool QDeclarativeWatcher::addWatch(int id, quint32 debugId, const QByteArray &property)
{
- QObject *object = QmlDebugService::objectForId(debugId);
+ QObject *object = QDeclarativeDebugService::objectForId(debugId);
if (object) {
int index = object->metaObject()->indexOfProperty(property.constData());
if (index >= 0) {
@@ -148,14 +148,14 @@ bool QmlWatcher::addWatch(int id, quint32 debugId, const QByteArray &property)
return false;
}
-bool QmlWatcher::addWatch(int id, quint32 objectId, const QString &expr)
+bool QDeclarativeWatcher::addWatch(int id, quint32 objectId, const QString &expr)
{
- QObject *object = QmlDebugService::objectForId(objectId);
- QmlContext *context = qmlContext(object);
+ QObject *object = QDeclarativeDebugService::objectForId(objectId);
+ QDeclarativeContext *context = qmlContext(object);
if (context) {
- QmlExpression *exprObj = new QmlExpression(context, expr, object);
+ QDeclarativeExpression *exprObj = new QDeclarativeExpression(context, expr, object);
exprObj->setNotifyOnValueChanged(true);
- QmlWatchProxy *proxy = new QmlWatchProxy(id, exprObj, objectId, this);
+ QDeclarativeWatchProxy *proxy = new QDeclarativeWatchProxy(id, exprObj, objectId, this);
exprObj->setParent(proxy);
m_proxies[id].append(proxy);
proxy->notifyValueChanged();
@@ -164,18 +164,18 @@ bool QmlWatcher::addWatch(int id, quint32 objectId, const QString &expr)
return false;
}
-void QmlWatcher::removeWatch(int id)
+void QDeclarativeWatcher::removeWatch(int id)
{
if (!m_proxies.contains(id))
return;
- QList<QPointer<QmlWatchProxy> > proxies = m_proxies.take(id);
+ QList<QPointer<QDeclarativeWatchProxy> > proxies = m_proxies.take(id);
qDeleteAll(proxies);
}
-void QmlWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, const QMetaProperty &property)
+void QDeclarativeWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, const QMetaProperty &property)
{
- QmlWatchProxy *proxy = new QmlWatchProxy(id, object, debugId, property, this);
+ QDeclarativeWatchProxy *proxy = new QDeclarativeWatchProxy(id, object, debugId, property, this);
m_proxies[id].append(proxy);
proxy->notifyValueChanged();
@@ -183,4 +183,4 @@ void QmlWatcher::addPropertyWatch(int id, QObject *object, quint32 debugId, cons
QT_END_NAMESPACE
-#include <qmlwatcher.moc>
+#include <qdeclarativewatcher.moc>
diff --git a/src/declarative/qml/qmlwatcher_p.h b/src/declarative/qml/qdeclarativewatcher_p.h
index 57b358d..4e3352f 100644
--- a/src/declarative/qml/qmlwatcher_p.h
+++ b/src/declarative/qml/qdeclarativewatcher_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLWATCHER_P_H
-#define QMLWATCHER_P_H
+#ifndef QDECLARATIVEWATCHER_P_H
+#define QDECLARATIVEWATCHER_P_H
//
// W A R N I N G
@@ -62,16 +62,16 @@
QT_BEGIN_NAMESPACE
-class QmlWatchProxy;
-class QmlExpression;
-class QmlContext;
+class QDeclarativeWatchProxy;
+class QDeclarativeExpression;
+class QDeclarativeContext;
class QMetaProperty;
-class QmlWatcher : public QObject
+class QDeclarativeWatcher : public QObject
{
Q_OBJECT
public:
- QmlWatcher(QObject * = 0);
+ QDeclarativeWatcher(QObject * = 0);
bool addWatch(int id, quint32 objectId);
bool addWatch(int id, quint32 objectId, const QByteArray &property);
@@ -83,12 +83,12 @@ Q_SIGNALS:
void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value);
private:
- friend class QmlWatchProxy;
+ friend class QDeclarativeWatchProxy;
void addPropertyWatch(int id, QObject *object, quint32 objectId, const QMetaProperty &property);
- QHash<int, QList<QPointer<QmlWatchProxy> > > m_proxies;
+ QHash<int, QList<QPointer<QDeclarativeWatchProxy> > > m_proxies;
};
QT_END_NAMESPACE
-#endif // QMLWATCHER_P_H
+#endif // QDECLARATIVEWATCHER_P_H
diff --git a/src/declarative/qml/qmlworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index 944d996..03151e4 100644
--- a/src/declarative/qml/qmlworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qmlworkerscript_p.h"
+#include "qdeclarativeworkerscript_p.h"
-#include "qmlengine_p.h"
+#include "qdeclarativeengine_p.h"
#include <QtCore/qcoreevent.h>
#include <QtCore/qcoreapplication.h>
@@ -52,8 +52,8 @@
#include <QtScript/qscriptvalueiterator.h>
#include <QtCore/qfile.h>
#include <QtNetwork/qnetworkaccessmanager.h>
-#include <QtDeclarative/qmlinfo.h>
-#include "qmlnetworkaccessmanagerfactory.h"
+#include <QtDeclarative/qdeclarativeinfo.h>
+#include "qdeclarativenetworkaccessmanagerfactory.h"
QT_BEGIN_NAMESPACE
@@ -102,16 +102,16 @@ private:
int m_id;
};
-class QmlWorkerScriptEnginePrivate : public QObject
+class QDeclarativeWorkerScriptEnginePrivate : public QObject
{
public:
- QmlWorkerScriptEnginePrivate(QmlEngine *eng);
+ QDeclarativeWorkerScriptEnginePrivate(QDeclarativeEngine *eng);
- struct ScriptEngine : public QmlScriptEngine
+ struct ScriptEngine : public QDeclarativeScriptEngine
{
- ScriptEngine(QmlWorkerScriptEnginePrivate *parent) : QmlScriptEngine(0), p(parent), accessManager(0) {}
+ ScriptEngine(QDeclarativeWorkerScriptEnginePrivate *parent) : QDeclarativeScriptEngine(0), p(parent), accessManager(0) {}
~ScriptEngine() { delete accessManager; }
- QmlWorkerScriptEnginePrivate *p;
+ QDeclarativeWorkerScriptEnginePrivate *p;
QNetworkAccessManager *accessManager;
virtual QNetworkAccessManager *networkAccessManager() {
@@ -126,11 +126,11 @@ public:
}
};
ScriptEngine *workerEngine;
- static QmlWorkerScriptEnginePrivate *get(QScriptEngine *e) {
+ static QDeclarativeWorkerScriptEnginePrivate *get(QScriptEngine *e) {
return static_cast<ScriptEngine *>(e)->p;
}
- QmlEngine *qmlengine;
+ QDeclarativeEngine *qmlengine;
QMutex m_lock;
QWaitCondition m_wait;
@@ -140,7 +140,7 @@ public:
int id;
bool initialized;
- QmlWorkerScript *owner;
+ QDeclarativeWorkerScript *owner;
QScriptValue object;
QScriptValue callback;
@@ -166,14 +166,14 @@ private:
};
// Currently this will leak as no-one releases it in the worker thread
-class QmlWorkerListModelAgent : public QObject
+class QDeclarativeWorkerListModelAgent : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count)
public:
- QmlWorkerListModelAgent(QmlWorkerListModel *);
- ~QmlWorkerListModelAgent();
+ QDeclarativeWorkerListModelAgent(QDeclarativeWorkerListModel *);
+ ~QDeclarativeWorkerListModelAgent();
void addref();
void release();
@@ -192,7 +192,7 @@ public:
{
VariantRef() : a(0) {}
VariantRef(const VariantRef &r) : a(r.a) { if (a) a->addref(); }
- VariantRef(QmlWorkerListModelAgent *_a) : a(_a) { if (a) a->addref(); }
+ VariantRef(QDeclarativeWorkerListModelAgent *_a) : a(_a) { if (a) a->addref(); }
~VariantRef() { if (a) a->release(); }
VariantRef &operator=(const VariantRef &o) {
@@ -201,14 +201,14 @@ public:
return *this;
}
- QmlWorkerListModelAgent *a;
+ QDeclarativeWorkerListModelAgent *a;
};
protected:
virtual bool event(QEvent *);
private:
- friend class QmlWorkerScriptEnginePrivate;
- friend class QmlWorkerListModel;
+ friend class QDeclarativeWorkerScriptEnginePrivate;
+ friend class QDeclarativeWorkerListModel;
QScriptEngine *m_engine;
struct Change {
@@ -237,23 +237,23 @@ private:
};
QAtomicInt m_ref;
- QmlWorkerListModel *m_model;
+ QDeclarativeWorkerListModel *m_model;
};
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QmlWorkerListModelAgent::VariantRef);
+Q_DECLARE_METATYPE(QDeclarativeWorkerListModelAgent::VariantRef);
QT_BEGIN_NAMESPACE
-QmlWorkerScriptEnginePrivate::QmlWorkerScriptEnginePrivate(QmlEngine *engine)
+QDeclarativeWorkerScriptEnginePrivate::QDeclarativeWorkerScriptEnginePrivate(QDeclarativeEngine *engine)
: workerEngine(0), qmlengine(engine), m_nextId(0)
{
}
-QScriptValue QmlWorkerScriptEnginePrivate::onMessage(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::onMessage(QScriptContext *ctxt, QScriptEngine *engine)
{
- QmlWorkerScriptEnginePrivate *p = QmlWorkerScriptEnginePrivate::get(engine);
+ QDeclarativeWorkerScriptEnginePrivate *p = QDeclarativeWorkerScriptEnginePrivate::get(engine);
int id = ctxt->thisObject().data().toVariant().toInt();
@@ -267,12 +267,12 @@ QScriptValue QmlWorkerScriptEnginePrivate::onMessage(QScriptContext *ctxt, QScri
return script->callback;
}
-QScriptValue QmlWorkerScriptEnginePrivate::sendMessage(QScriptContext *ctxt, QScriptEngine *engine)
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::sendMessage(QScriptContext *ctxt, QScriptEngine *engine)
{
if (!ctxt->argumentCount())
return engine->undefinedValue();
- QmlWorkerScriptEnginePrivate *p = QmlWorkerScriptEnginePrivate::get(engine);
+ QDeclarativeWorkerScriptEnginePrivate *p = QDeclarativeWorkerScriptEnginePrivate::get(engine);
int id = ctxt->thisObject().data().toVariant().toInt();
@@ -289,7 +289,7 @@ QScriptValue QmlWorkerScriptEnginePrivate::sendMessage(QScriptContext *ctxt, QSc
return engine->undefinedValue();
}
-QScriptValue QmlWorkerScriptEnginePrivate::getWorker(int id)
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::getWorker(int id)
{
QHash<int, WorkerScript *>::ConstIterator iter = workers.find(id);
@@ -315,7 +315,7 @@ QScriptValue QmlWorkerScriptEnginePrivate::getWorker(int id)
return script->object;
}
-bool QmlWorkerScriptEnginePrivate::event(QEvent *event)
+bool QDeclarativeWorkerScriptEnginePrivate::event(QEvent *event)
{
if (event->type() == (QEvent::Type)WorkerDataEvent::WorkerData) {
WorkerDataEvent *workerEvent = static_cast<WorkerDataEvent *>(event);
@@ -330,7 +330,7 @@ bool QmlWorkerScriptEnginePrivate::event(QEvent *event)
}
}
-void QmlWorkerScriptEnginePrivate::processMessage(int id, const QVariant &data)
+void QDeclarativeWorkerScriptEnginePrivate::processMessage(int id, const QVariant &data)
{
WorkerScript *script = workers.value(id);
if (!script)
@@ -344,7 +344,7 @@ void QmlWorkerScriptEnginePrivate::processMessage(int id, const QVariant &data)
}
}
-void QmlWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
+void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
{
if (url.isRelative() || url.scheme() != QLatin1String("file"))
return;
@@ -368,7 +368,7 @@ void QmlWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
}
}
-QVariant QmlWorkerScriptEnginePrivate::scriptValueToVariant(const QScriptValue &value)
+QVariant QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(const QScriptValue &value)
{
if (value.isBool()) {
return QVariant(value.toBool());
@@ -388,9 +388,9 @@ QVariant QmlWorkerScriptEnginePrivate::scriptValueToVariant(const QScriptValue &
return QVariant(list);
} else if (value.isQObject()) {
- QmlWorkerListModel *lm = qobject_cast<QmlWorkerListModel *>(value.toQObject());
+ QDeclarativeWorkerListModel *lm = qobject_cast<QDeclarativeWorkerListModel *>(value.toQObject());
if (lm) {
- QmlWorkerListModelAgent::VariantRef v(lm->agent());
+ QDeclarativeWorkerListModelAgent::VariantRef v(lm->agent());
return qVariantFromValue(v);
} else {
// No other QObject's are allowed to be sent
@@ -413,7 +413,7 @@ QVariant QmlWorkerScriptEnginePrivate::scriptValueToVariant(const QScriptValue &
}
-QScriptValue QmlWorkerScriptEnginePrivate::variantToScriptValue(const QVariant &value, QScriptEngine *engine)
+QScriptValue QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(const QVariant &value, QScriptEngine *engine)
{
if (value.userType() == QVariant::Bool) {
return QScriptValue(value.toBool());
@@ -421,8 +421,8 @@ QScriptValue QmlWorkerScriptEnginePrivate::variantToScriptValue(const QVariant &
return QScriptValue(value.toString());
} else if (value.userType() == QMetaType::QReal) {
return QScriptValue(value.toReal());
- } else if (value.userType() == qMetaTypeId<QmlWorkerListModelAgent::VariantRef>()) {
- QmlWorkerListModelAgent::VariantRef vr = qvariant_cast<QmlWorkerListModelAgent::VariantRef>(value);
+ } else if (value.userType() == qMetaTypeId<QDeclarativeWorkerListModelAgent::VariantRef>()) {
+ QDeclarativeWorkerListModelAgent::VariantRef vr = qvariant_cast<QDeclarativeWorkerListModelAgent::VariantRef>(value);
if (vr.a->m_engine == 0)
vr.a->m_engine = engine;
else if (vr.a->m_engine != engine)
@@ -497,8 +497,8 @@ int WorkerRemoveEvent::workerId() const
return m_id;
}
-QmlWorkerScriptEngine::QmlWorkerScriptEngine(QmlEngine *parent)
-: QThread(parent), d(new QmlWorkerScriptEnginePrivate(parent))
+QDeclarativeWorkerScriptEngine::QDeclarativeWorkerScriptEngine(QDeclarativeEngine *parent)
+: QThread(parent), d(new QDeclarativeWorkerScriptEnginePrivate(parent))
{
d->m_lock.lock();
start(QThread::LowPriority);
@@ -507,20 +507,20 @@ QmlWorkerScriptEngine::QmlWorkerScriptEngine(QmlEngine *parent)
d->m_lock.unlock();
}
-QmlWorkerScriptEngine::~QmlWorkerScriptEngine()
+QDeclarativeWorkerScriptEngine::~QDeclarativeWorkerScriptEngine()
{
qDeleteAll(d->workers);
delete d; d = 0;
}
-QmlWorkerScriptEnginePrivate::WorkerScript::WorkerScript()
+QDeclarativeWorkerScriptEnginePrivate::WorkerScript::WorkerScript()
: id(-1), initialized(false), owner(0)
{
}
-int QmlWorkerScriptEngine::registerWorkerScript(QmlWorkerScript *owner)
+int QDeclarativeWorkerScriptEngine::registerWorkerScript(QDeclarativeWorkerScript *owner)
{
- QmlWorkerScriptEnginePrivate::WorkerScript *script = new QmlWorkerScriptEnginePrivate::WorkerScript;
+ QDeclarativeWorkerScriptEnginePrivate::WorkerScript *script = new QDeclarativeWorkerScriptEnginePrivate::WorkerScript;
script->id = d->m_nextId++;
script->owner = owner;
@@ -531,26 +531,26 @@ int QmlWorkerScriptEngine::registerWorkerScript(QmlWorkerScript *owner)
return script->id;
}
-void QmlWorkerScriptEngine::removeWorkerScript(int id)
+void QDeclarativeWorkerScriptEngine::removeWorkerScript(int id)
{
QCoreApplication::postEvent(d, new WorkerRemoveEvent(id));
}
-void QmlWorkerScriptEngine::executeUrl(int id, const QUrl &url)
+void QDeclarativeWorkerScriptEngine::executeUrl(int id, const QUrl &url)
{
QCoreApplication::postEvent(d, new WorkerLoadEvent(id, url));
}
-void QmlWorkerScriptEngine::sendMessage(int id, const QVariant &data)
+void QDeclarativeWorkerScriptEngine::sendMessage(int id, const QVariant &data)
{
QCoreApplication::postEvent(d, new WorkerDataEvent(id, data));
}
-void QmlWorkerScriptEngine::run()
+void QDeclarativeWorkerScriptEngine::run()
{
d->m_lock.lock();
- d->workerEngine = new QmlWorkerScriptEnginePrivate::ScriptEngine(d);
+ d->workerEngine = new QDeclarativeWorkerScriptEnginePrivate::ScriptEngine(d);
d->m_wait.wakeAll();
@@ -561,22 +561,22 @@ void QmlWorkerScriptEngine::run()
delete d->workerEngine; d->workerEngine = 0;
}
-QmlWorkerScript::QmlWorkerScript(QObject *parent)
+QDeclarativeWorkerScript::QDeclarativeWorkerScript(QObject *parent)
: QObject(parent), m_engine(0), m_scriptId(-1)
{
}
-QmlWorkerScript::~QmlWorkerScript()
+QDeclarativeWorkerScript::~QDeclarativeWorkerScript()
{
if (m_scriptId != -1) m_engine->removeWorkerScript(m_scriptId);
}
-QUrl QmlWorkerScript::source() const
+QUrl QDeclarativeWorkerScript::source() const
{
return m_source;
}
-void QmlWorkerScript::setSource(const QUrl &source)
+void QDeclarativeWorkerScript::setSource(const QUrl &source)
{
if (m_source == source)
return;
@@ -589,26 +589,26 @@ void QmlWorkerScript::setSource(const QUrl &source)
emit sourceChanged();
}
-void QmlWorkerScript::sendMessage(const QScriptValue &message)
+void QDeclarativeWorkerScript::sendMessage(const QScriptValue &message)
{
if (!m_engine) {
- qWarning("QmlWorkerScript: Attempt to send message before WorkerScript establishment");
+ qWarning("QDeclarativeWorkerScript: Attempt to send message before WorkerScript establishment");
return;
}
- m_engine->sendMessage(m_scriptId, QmlWorkerScriptEnginePrivate::scriptValueToVariant(message));
+ m_engine->sendMessage(m_scriptId, QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(message));
}
-void QmlWorkerScript::componentComplete()
+void QDeclarativeWorkerScript::componentComplete()
{
if (!m_engine) {
- QmlEngine *engine = qmlEngine(this);
+ QDeclarativeEngine *engine = qmlEngine(this);
if (!engine) {
- qWarning("QmlWorkerScript: componentComplete() called without qmlEngine() set");
+ qWarning("QDeclarativeWorkerScript: componentComplete() called without qmlEngine() set");
return;
}
- m_engine = QmlEnginePrivate::get(engine)->getWorkerScriptEngine();
+ m_engine = QDeclarativeEnginePrivate::get(engine)->getWorkerScriptEngine();
m_scriptId = m_engine->registerWorkerScript(this);
if (m_source.isValid())
@@ -616,15 +616,15 @@ void QmlWorkerScript::componentComplete()
}
}
-bool QmlWorkerScript::event(QEvent *event)
+bool QDeclarativeWorkerScript::event(QEvent *event)
{
if (event->type() == (QEvent::Type)WorkerDataEvent::WorkerData) {
- QmlEngine *engine = qmlEngine(this);
+ QDeclarativeEngine *engine = qmlEngine(this);
if (engine) {
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
WorkerDataEvent *workerEvent = static_cast<WorkerDataEvent *>(event);
QScriptValue value =
- QmlWorkerScriptEnginePrivate::variantToScriptValue(workerEvent->data(), scriptEngine);
+ QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(workerEvent->data(), scriptEngine);
emit message(value);
}
return true;
@@ -633,30 +633,30 @@ bool QmlWorkerScript::event(QEvent *event)
}
}
-void QmlWorkerListModelAgent::Data::clearChange()
+void QDeclarativeWorkerListModelAgent::Data::clearChange()
{
changes.clear();
}
-void QmlWorkerListModelAgent::Data::insertChange(int index, int count)
+void QDeclarativeWorkerListModelAgent::Data::insertChange(int index, int count)
{
Change c = { Change::Inserted, index, count, 0 };
changes << c;
}
-void QmlWorkerListModelAgent::Data::removeChange(int index, int count)
+void QDeclarativeWorkerListModelAgent::Data::removeChange(int index, int count)
{
Change c = { Change::Removed, index, count, 0 };
changes << c;
}
-void QmlWorkerListModelAgent::Data::changedChange(int index, int count)
+void QDeclarativeWorkerListModelAgent::Data::changedChange(int index, int count)
{
Change c = { Change::Changed, index, count, 0 };
changes << c;
}
-QmlWorkerListModelAgent::QmlWorkerListModelAgent(QmlWorkerListModel *m)
+QDeclarativeWorkerListModelAgent::QDeclarativeWorkerListModelAgent(QDeclarativeWorkerListModel *m)
: m_engine(0), m_ref(1), m_model(m)
{
data.roles = m_model->m_roles;
@@ -664,16 +664,16 @@ QmlWorkerListModelAgent::QmlWorkerListModelAgent(QmlWorkerListModel *m)
data.values = m_model->m_values;
}
-QmlWorkerListModelAgent::~QmlWorkerListModelAgent()
+QDeclarativeWorkerListModelAgent::~QDeclarativeWorkerListModelAgent()
{
}
-void QmlWorkerListModelAgent::addref()
+void QDeclarativeWorkerListModelAgent::addref()
{
m_ref.ref();
}
-void QmlWorkerListModelAgent::release()
+void QDeclarativeWorkerListModelAgent::release()
{
bool del = !m_ref.deref();
@@ -681,19 +681,19 @@ void QmlWorkerListModelAgent::release()
delete this;
}
-int QmlWorkerListModelAgent::count() const
+int QDeclarativeWorkerListModelAgent::count() const
{
return data.values.count();
}
-void QmlWorkerListModelAgent::clear()
+void QDeclarativeWorkerListModelAgent::clear()
{
data.clearChange();
data.removeChange(0, data.values.count());
data.values.clear();
}
-void QmlWorkerListModelAgent::remove(int index)
+void QDeclarativeWorkerListModelAgent::remove(int index)
{
if (data.values.count() <= index)
return;
@@ -702,7 +702,7 @@ void QmlWorkerListModelAgent::remove(int index)
data.removeChange(index, 1);
}
-void QmlWorkerListModelAgent::append(const QScriptValue &value)
+void QDeclarativeWorkerListModelAgent::append(const QScriptValue &value)
{
QHash<int, QVariant> row;
@@ -725,7 +725,7 @@ void QmlWorkerListModelAgent::append(const QScriptValue &value)
data.insertChange(data.values.count() - 1, 1);
}
-void QmlWorkerListModelAgent::insert(int index, const QScriptValue &value)
+void QDeclarativeWorkerListModelAgent::insert(int index, const QScriptValue &value)
{
if (index > data.values.count())
return;
@@ -751,7 +751,7 @@ void QmlWorkerListModelAgent::insert(int index, const QScriptValue &value)
data.insertChange(index, 1);
}
-void QmlWorkerListModelAgent::set(int index, const QScriptValue &value)
+void QDeclarativeWorkerListModelAgent::set(int index, const QScriptValue &value)
{
if (data.values.count() <= index)
return;
@@ -779,7 +779,7 @@ void QmlWorkerListModelAgent::set(int index, const QScriptValue &value)
}
}
-QScriptValue QmlWorkerListModelAgent::get(int index) const
+QScriptValue QDeclarativeWorkerListModelAgent::get(int index) const
{
if (data.values.count() <= index)
return m_engine->undefinedValue();
@@ -793,7 +793,7 @@ QScriptValue QmlWorkerListModelAgent::get(int index) const
return rv;
}
-void QmlWorkerListModelAgent::sync()
+void QDeclarativeWorkerListModelAgent::sync()
{
Sync *s = new Sync;
s->data = data;
@@ -801,7 +801,7 @@ void QmlWorkerListModelAgent::sync()
QCoreApplication::postEvent(this, s);
}
-bool QmlWorkerListModelAgent::event(QEvent *e)
+bool QDeclarativeWorkerListModelAgent::event(QEvent *e)
{
if (e->type() == QEvent::User) {
Sync *s = static_cast<Sync *>(e);
@@ -841,12 +841,12 @@ bool QmlWorkerListModelAgent::event(QEvent *e)
return QObject::event(e);
}
-QmlWorkerListModel::QmlWorkerListModel(QObject *parent)
+QDeclarativeWorkerListModel::QDeclarativeWorkerListModel(QObject *parent)
: QListModelInterface(parent), m_agent(0)
{
}
-QmlWorkerListModel::~QmlWorkerListModel()
+QDeclarativeWorkerListModel::~QDeclarativeWorkerListModel()
{
if (m_agent) {
m_agent->m_model = 0;
@@ -854,7 +854,7 @@ QmlWorkerListModel::~QmlWorkerListModel()
}
}
-void QmlWorkerListModel::clear()
+void QDeclarativeWorkerListModel::clear()
{
if (m_agent) {
qmlInfo(this) << "List can only be modified from a WorkerScript";
@@ -869,7 +869,7 @@ void QmlWorkerListModel::clear()
}
}
-void QmlWorkerListModel::remove(int index)
+void QDeclarativeWorkerListModel::remove(int index)
{
if (m_agent) {
qmlInfo(this) << "List can only be modified from a WorkerScript";
@@ -884,7 +884,7 @@ void QmlWorkerListModel::remove(int index)
emit countChanged();
}
-void QmlWorkerListModel::append(const QScriptValue &value)
+void QDeclarativeWorkerListModel::append(const QScriptValue &value)
{
if (m_agent) {
qmlInfo(this) << "List can only be modified from a WorkerScript";
@@ -914,7 +914,7 @@ void QmlWorkerListModel::append(const QScriptValue &value)
emit countChanged();
}
-void QmlWorkerListModel::insert(int index, const QScriptValue &value)
+void QDeclarativeWorkerListModel::insert(int index, const QScriptValue &value)
{
if (m_agent) {
qmlInfo(this) << "List can only be modified from a WorkerScript";
@@ -946,13 +946,13 @@ void QmlWorkerListModel::insert(int index, const QScriptValue &value)
emit countChanged();
}
-QScriptValue QmlWorkerListModel::get(int index) const
+QScriptValue QDeclarativeWorkerListModel::get(int index) const
{
- QmlEngine *engine = qmlEngine(this);
+ QDeclarativeEngine *engine = qmlEngine(this);
if (!engine || m_values.count() <= index)
return QScriptValue();
- QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+ QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
QScriptValue rv = scriptEngine->newObject();
QHash<int, QVariant> data = m_values.at(index);
@@ -962,7 +962,7 @@ QScriptValue QmlWorkerListModel::get(int index) const
return rv;
}
-void QmlWorkerListModel::set(int index, const QScriptValue &value)
+void QDeclarativeWorkerListModel::set(int index, const QScriptValue &value)
{
if (m_agent) {
qmlInfo(this) << "List can only be modified from a WorkerScript";
@@ -995,30 +995,30 @@ void QmlWorkerListModel::set(int index, const QScriptValue &value)
}
}
-QmlWorkerListModelAgent *QmlWorkerListModel::agent()
+QDeclarativeWorkerListModelAgent *QDeclarativeWorkerListModel::agent()
{
if (!m_agent)
- m_agent = new QmlWorkerListModelAgent(this);
+ m_agent = new QDeclarativeWorkerListModelAgent(this);
return m_agent;
}
-QList<int> QmlWorkerListModel::roles() const
+QList<int> QDeclarativeWorkerListModel::roles() const
{
return m_roles.keys();
}
-QString QmlWorkerListModel::toString(int role) const
+QString QDeclarativeWorkerListModel::toString(int role) const
{
return m_roles.value(role);
}
-int QmlWorkerListModel::count() const
+int QDeclarativeWorkerListModel::count() const
{
return m_values.count();
}
-QHash<int,QVariant> QmlWorkerListModel::data(int index, const QList<int> &) const
+QHash<int,QVariant> QDeclarativeWorkerListModel::data(int index, const QList<int> &) const
{
if (m_values.count() <= index)
return QHash<int, QVariant>();
@@ -1026,7 +1026,7 @@ QHash<int,QVariant> QmlWorkerListModel::data(int index, const QList<int> &) cons
return m_values.at(index);
}
-QVariant QmlWorkerListModel::data(int index, int role) const
+QVariant QDeclarativeWorkerListModel::data(int index, int role) const
{
if (m_values.count() <= index)
return QVariant();
@@ -1036,6 +1036,6 @@ QVariant QmlWorkerListModel::data(int index, int role) const
QT_END_NAMESPACE
-#include "qmlworkerscript.moc"
+#include "qdeclarativeworkerscript.moc"
diff --git a/src/declarative/qml/qmlworkerscript_p.h b/src/declarative/qml/qdeclarativeworkerscript_p.h
index 7698a21..8ebd2c1 100644
--- a/src/declarative/qml/qmlworkerscript_p.h
+++ b/src/declarative/qml/qdeclarativeworkerscript_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLWORKERSCRIPT_P_H
-#define QMLWORKERSCRIPT_P_H
+#ifndef QDECLARATIVEWORKERSCRIPT_P_H
+#define QDECLARATIVEWORKERSCRIPT_P_H
//
// W A R N I N G
@@ -53,8 +53,8 @@
// We mean it.
//
-#include "qml.h"
-#include "qmlparserstatus.h"
+#include "qdeclarative.h"
+#include "qdeclarativeparserstatus.h"
#include <private/qlistmodelinterface_p.h>
#include <QtCore/qthread.h>
@@ -63,16 +63,16 @@
QT_BEGIN_NAMESPACE
-class QmlWorkerScript;
-class QmlWorkerScriptEnginePrivate;
-class QmlWorkerScriptEngine : public QThread
+class QDeclarativeWorkerScript;
+class QDeclarativeWorkerScriptEnginePrivate;
+class QDeclarativeWorkerScriptEngine : public QThread
{
Q_OBJECT
public:
- QmlWorkerScriptEngine(QmlEngine *parent = 0);
- virtual ~QmlWorkerScriptEngine();
+ QDeclarativeWorkerScriptEngine(QDeclarativeEngine *parent = 0);
+ virtual ~QDeclarativeWorkerScriptEngine();
- int registerWorkerScript(QmlWorkerScript *);
+ int registerWorkerScript(QDeclarativeWorkerScript *);
void removeWorkerScript(int);
void executeUrl(int, const QUrl &);
void sendMessage(int, const QVariant &);
@@ -81,18 +81,18 @@ protected:
virtual void run();
private:
- QmlWorkerScriptEnginePrivate *d;
+ QDeclarativeWorkerScriptEnginePrivate *d;
};
-class QmlWorkerScript : public QObject, public QmlParserStatus
+class QDeclarativeWorkerScript : public QObject, public QDeclarativeParserStatus
{
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
- Q_INTERFACES(QmlParserStatus)
+ Q_INTERFACES(QDeclarativeParserStatus)
public:
- QmlWorkerScript(QObject *parent = 0);
- virtual ~QmlWorkerScript();
+ QDeclarativeWorkerScript(QObject *parent = 0);
+ virtual ~QDeclarativeWorkerScript();
QUrl source() const;
void setSource(const QUrl &);
@@ -109,20 +109,20 @@ protected:
virtual bool event(QEvent *);
private:
- QmlWorkerScriptEngine *m_engine;
+ QDeclarativeWorkerScriptEngine *m_engine;
int m_scriptId;
QUrl m_source;
};
-class QmlWorkerListModelAgent;
-class QmlWorkerListModel : public QListModelInterface
+class QDeclarativeWorkerListModelAgent;
+class QDeclarativeWorkerListModel : public QListModelInterface
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
- QmlWorkerListModel(QObject * = 0);
- virtual ~QmlWorkerListModel();
+ QDeclarativeWorkerListModel(QObject * = 0);
+ virtual ~QDeclarativeWorkerListModel();
Q_INVOKABLE void clear();
Q_INVOKABLE void remove(int index);
@@ -131,7 +131,7 @@ public:
Q_INVOKABLE QScriptValue get(int index) const;
Q_INVOKABLE void set(int index, const QScriptValue &);
- QmlWorkerListModelAgent *agent();
+ QDeclarativeWorkerListModelAgent *agent();
virtual QList<int> roles() const;
virtual QString toString(int role) const;
@@ -143,18 +143,18 @@ Q_SIGNALS:
void countChanged();
private:
- friend class QmlWorkerListModelAgent;
+ friend class QDeclarativeWorkerListModelAgent;
QHash<int, QString> m_roles;
QHash<QString, int> m_strings;
QList<QHash<int, QVariant> > m_values;
- QmlWorkerListModelAgent *m_agent;
+ QDeclarativeWorkerListModelAgent *m_agent;
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QmlWorkerScript);
-QML_DECLARE_TYPE(QmlWorkerListModel);
+QML_DECLARE_TYPE(QDeclarativeWorkerScript);
+QML_DECLARE_TYPE(QDeclarativeWorkerListModel);
-#endif // QMLWORKERSCRIPT_P_H
+#endif // QDECLARATIVEWORKERSCRIPT_P_H
diff --git a/src/declarative/qml/qmlxmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
index eda2d9e..3ba53f0 100644
--- a/src/declarative/qml/qmlxmlhttprequest.cpp
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
-#include "qmlxmlhttprequest_p.h"
+#include "qdeclarativexmlhttprequest_p.h"
-#include "qmlengine.h"
-#include "qmlengine_p.h"
-#include "qmlrefcount_p.h"
-#include "qmlengine_p.h"
-#include "qmlexpression_p.h"
+#include "qdeclarativeengine.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativerefcount_p.h"
+#include "qdeclarativeengine_p.h"
+#include "qdeclarativeexpression_p.h"
#include <QtCore/qobject.h>
#include <QtScript/qscriptvalue.h>
@@ -137,7 +137,7 @@ public:
QList<NodeImpl *> attributes;
};
-class DocumentImpl : public QmlRefCount, public NodeImpl
+class DocumentImpl : public QDeclarativeRefCount, public NodeImpl
{
public:
DocumentImpl() : root(0) { type = Document; }
@@ -151,8 +151,8 @@ public:
NodeImpl *root;
- void addref() { QmlRefCount::addref(); }
- void release() { QmlRefCount::release(); }
+ void addref() { QDeclarativeRefCount::addref(); }
+ void release() { QDeclarativeRefCount::release(); }
};
class NamedNodeMap
@@ -757,10 +757,10 @@ QScriptValue NamedNodeMap::create(QScriptEngine *engine, NodeImpl *data, QList<N
instance.setData(engine->newVariant(qVariantFromValue(map)));
- if (!QmlScriptEngine::get(engine)->namedNodeMapClass)
- QmlScriptEngine::get(engine)->namedNodeMapClass= new NamedNodeMapClass(engine);
+ if (!QDeclarativeScriptEngine::get(engine)->namedNodeMapClass)
+ QDeclarativeScriptEngine::get(engine)->namedNodeMapClass= new NamedNodeMapClass(engine);
- instance.setScriptClass(QmlScriptEngine::get(engine)->namedNodeMapClass);
+ instance.setScriptClass(QDeclarativeScriptEngine::get(engine)->namedNodeMapClass);
return instance;
}
@@ -814,10 +814,10 @@ QScriptValue NodeList::create(QScriptEngine *engine, NodeImpl *data)
instance.setData(engine->newVariant(qVariantFromValue(list)));
- if (!QmlScriptEngine::get(engine)->nodeListClass)
- QmlScriptEngine::get(engine)->nodeListClass= new NodeListClass(engine);
+ if (!QDeclarativeScriptEngine::get(engine)->nodeListClass)
+ QDeclarativeScriptEngine::get(engine)->nodeListClass= new NodeListClass(engine);
- instance.setScriptClass(QmlScriptEngine::get(engine)->nodeListClass);
+ instance.setScriptClass(QDeclarativeScriptEngine::get(engine)->nodeListClass);
return instance;
}
@@ -934,7 +934,7 @@ QScriptValue Document::xmlEncoding(QScriptContext *context, QScriptEngine *engin
return QScriptValue(static_cast<DocumentImpl *>(document.d)->encoding);
}
-class QmlXMLHttpRequest : public QObject
+class QDeclarativeXMLHttpRequest : public QObject
{
Q_OBJECT
public:
@@ -942,8 +942,8 @@ public:
Opened = 1, HeadersReceived = 2,
Loading = 3, Done = 4 };
- QmlXMLHttpRequest(QNetworkAccessManager *manager);
- virtual ~QmlXMLHttpRequest();
+ QDeclarativeXMLHttpRequest(QNetworkAccessManager *manager);
+ virtual ~QDeclarativeXMLHttpRequest();
bool sendFlag() const;
bool errorFlag() const;
@@ -997,43 +997,43 @@ private:
QNetworkAccessManager *networkAccessManager() { return m_nam; }
};
-QmlXMLHttpRequest::QmlXMLHttpRequest(QNetworkAccessManager *manager)
+QDeclarativeXMLHttpRequest::QDeclarativeXMLHttpRequest(QNetworkAccessManager *manager)
: m_state(Unsent), m_errorFlag(false), m_sendFlag(false),
m_redirectCount(0), m_network(0), m_nam(manager)
{
}
-QmlXMLHttpRequest::~QmlXMLHttpRequest()
+QDeclarativeXMLHttpRequest::~QDeclarativeXMLHttpRequest()
{
destroyNetwork();
}
-bool QmlXMLHttpRequest::sendFlag() const
+bool QDeclarativeXMLHttpRequest::sendFlag() const
{
return m_sendFlag;
}
-bool QmlXMLHttpRequest::errorFlag() const
+bool QDeclarativeXMLHttpRequest::errorFlag() const
{
return m_errorFlag;
}
-quint32 QmlXMLHttpRequest::readyState() const
+quint32 QDeclarativeXMLHttpRequest::readyState() const
{
return m_state;
}
-int QmlXMLHttpRequest::replyStatus() const
+int QDeclarativeXMLHttpRequest::replyStatus() const
{
return m_status;
}
-QString QmlXMLHttpRequest::replyStatusText() const
+QString QDeclarativeXMLHttpRequest::replyStatusText() const
{
return m_statusText;
}
-QScriptValue QmlXMLHttpRequest::open(QScriptValue *me, const QString &method, const QUrl &url)
+QScriptValue QDeclarativeXMLHttpRequest::open(QScriptValue *me, const QString &method, const QUrl &url)
{
destroyNetwork();
m_sendFlag = false;
@@ -1045,7 +1045,7 @@ QScriptValue QmlXMLHttpRequest::open(QScriptValue *me, const QString &method, co
return dispatchCallback(me);
}
-void QmlXMLHttpRequest::addHeader(const QString &name, const QString &value)
+void QDeclarativeXMLHttpRequest::addHeader(const QString &name, const QString &value)
{
QByteArray utfname = name.toUtf8();
@@ -1056,7 +1056,7 @@ void QmlXMLHttpRequest::addHeader(const QString &name, const QString &value)
}
}
-QString QmlXMLHttpRequest::header(const QString &name)
+QString QDeclarativeXMLHttpRequest::header(const QString &name)
{
QByteArray utfname = name.toLower().toUtf8();
@@ -1067,7 +1067,7 @@ QString QmlXMLHttpRequest::header(const QString &name)
return QString();
}
-QString QmlXMLHttpRequest::headers()
+QString QDeclarativeXMLHttpRequest::headers()
{
QString ret;
@@ -1081,7 +1081,7 @@ QString QmlXMLHttpRequest::headers()
return ret;
}
-void QmlXMLHttpRequest::fillHeadersList()
+void QDeclarativeXMLHttpRequest::fillHeadersList()
{
QList<QByteArray> headerList = m_network->rawHeaderList();
@@ -1096,7 +1096,7 @@ void QmlXMLHttpRequest::fillHeadersList()
}
}
-void QmlXMLHttpRequest::requestFromUrl(const QUrl &url)
+void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url)
{
QNetworkRequest request = m_request;
request.setUrl(url);
@@ -1146,7 +1146,7 @@ void QmlXMLHttpRequest::requestFromUrl(const QUrl &url)
this, SLOT(finished()));
}
-QScriptValue QmlXMLHttpRequest::send(QScriptValue *me, const QByteArray &data)
+QScriptValue QDeclarativeXMLHttpRequest::send(QScriptValue *me, const QByteArray &data)
{
m_errorFlag = false;
m_sendFlag = true;
@@ -1159,7 +1159,7 @@ QScriptValue QmlXMLHttpRequest::send(QScriptValue *me, const QByteArray &data)
return QScriptValue();
}
-QScriptValue QmlXMLHttpRequest::abort(QScriptValue *me)
+QScriptValue QDeclarativeXMLHttpRequest::abort(QScriptValue *me)
{
destroyNetwork();
m_responseEntityBody = QByteArray();
@@ -1180,7 +1180,7 @@ QScriptValue QmlXMLHttpRequest::abort(QScriptValue *me)
return QScriptValue();
}
-void QmlXMLHttpRequest::downloadProgress(qint64 bytes)
+void QDeclarativeXMLHttpRequest::downloadProgress(qint64 bytes)
{
Q_UNUSED(bytes)
m_status =
@@ -1205,7 +1205,7 @@ void QmlXMLHttpRequest::downloadProgress(qint64 bytes)
}
}
-void QmlXMLHttpRequest::error(QNetworkReply::NetworkError error)
+void QDeclarativeXMLHttpRequest::error(QNetworkReply::NetworkError error)
{
Q_UNUSED(error)
m_status =
@@ -1237,7 +1237,7 @@ void QmlXMLHttpRequest::error(QNetworkReply::NetworkError error)
}
#define XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION 15
-void QmlXMLHttpRequest::finished()
+void QDeclarativeXMLHttpRequest::finished()
{
m_redirectCount++;
if (m_redirectCount < XMLHTTPREQUEST_MAXIMUM_REDIRECT_RECURSION) {
@@ -1277,25 +1277,25 @@ void QmlXMLHttpRequest::finished()
}
-QString QmlXMLHttpRequest::responseBody() const
+QString QDeclarativeXMLHttpRequest::responseBody() const
{
return QString::fromUtf8(m_responseEntityBody);
}
-QScriptValue QmlXMLHttpRequest::dispatchCallback(QScriptValue *me)
+QScriptValue QDeclarativeXMLHttpRequest::dispatchCallback(QScriptValue *me)
{
QScriptValue v = me->property(QLatin1String("callback"));
return v.call();
}
-void QmlXMLHttpRequest::printError(const QScriptValue& sv)
+void QDeclarativeXMLHttpRequest::printError(const QScriptValue& sv)
{
- QmlError error;
- QmlExpressionPrivate::exceptionToError(sv.engine(), error);
+ QDeclarativeError error;
+ QDeclarativeExpressionPrivate::exceptionToError(sv.engine(), error);
qWarning().nospace() << qPrintable(error.toString());
}
-void QmlXMLHttpRequest::destroyNetwork()
+void QDeclarativeXMLHttpRequest::destroyNetwork()
{
if (m_network) {
m_network->disconnect();
@@ -1308,7 +1308,7 @@ void QmlXMLHttpRequest::destroyNetwork()
static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngine *engine)
{
QScriptValue dataObject = context->thisObject().data();
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(dataObject.toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
@@ -1328,7 +1328,7 @@ static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngin
QUrl url = QUrl::fromEncoded(context->argument(1).toString().toUtf8());
if (url.isRelative()) {
- url = QmlScriptEngine::get(engine)->resolvedUrl(context,url);
+ url = QDeclarativeScriptEngine::get(engine)->resolvedUrl(context,url);
}
// Argument 2 - async (optional)
@@ -1355,7 +1355,7 @@ static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngin
static QScriptValue qmlxmlhttprequest_setRequestHeader(QScriptContext *context, QScriptEngine *engine)
{
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
@@ -1363,7 +1363,7 @@ static QScriptValue qmlxmlhttprequest_setRequestHeader(QScriptContext *context,
THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
- if (request->readyState() != QmlXMLHttpRequest::Opened ||
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Opened ||
request->sendFlag())
THROW_DOM(INVALID_STATE_ERR, "Invalid state");
@@ -1404,11 +1404,11 @@ static QScriptValue qmlxmlhttprequest_setRequestHeader(QScriptContext *context,
static QScriptValue qmlxmlhttprequest_send(QScriptContext *context, QScriptEngine *)
{
QScriptValue dataObject = context->thisObject().data();
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(dataObject.toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
- if (request->readyState() != QmlXMLHttpRequest::Opened)
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Opened)
THROW_DOM(INVALID_STATE_ERR, "Invalid state");
if (request->sendFlag())
@@ -1424,7 +1424,7 @@ static QScriptValue qmlxmlhttprequest_send(QScriptContext *context, QScriptEngin
static QScriptValue qmlxmlhttprequest_abort(QScriptContext *context, QScriptEngine *)
{
QScriptValue dataObject = context->thisObject().data();
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(dataObject.toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
@@ -1434,16 +1434,16 @@ static QScriptValue qmlxmlhttprequest_abort(QScriptContext *context, QScriptEngi
static QScriptValue qmlxmlhttprequest_getResponseHeader(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(engine)
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
if (context->argumentCount() != 1)
THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
- if (request->readyState() != QmlXMLHttpRequest::Loading &&
- request->readyState() != QmlXMLHttpRequest::Done &&
- request->readyState() != QmlXMLHttpRequest::HeadersReceived)
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done &&
+ request->readyState() != QDeclarativeXMLHttpRequest::HeadersReceived)
THROW_DOM(INVALID_STATE_ERR, "Invalid state");
QString headerName = context->argument(0).toString();
@@ -1454,16 +1454,16 @@ static QScriptValue qmlxmlhttprequest_getResponseHeader(QScriptContext *context,
static QScriptValue qmlxmlhttprequest_getAllResponseHeaders(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(engine)
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
if (context->argumentCount() != 0)
THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
- if (request->readyState() != QmlXMLHttpRequest::Loading &&
- request->readyState() != QmlXMLHttpRequest::Done &&
- request->readyState() != QmlXMLHttpRequest::HeadersReceived)
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done &&
+ request->readyState() != QDeclarativeXMLHttpRequest::HeadersReceived)
THROW_DOM(INVALID_STATE_ERR, "Invalid state");
return QScriptValue(request->headers());
@@ -1473,7 +1473,7 @@ static QScriptValue qmlxmlhttprequest_getAllResponseHeaders(QScriptContext *cont
static QScriptValue qmlxmlhttprequest_readyState(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(engine)
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
@@ -1483,12 +1483,12 @@ static QScriptValue qmlxmlhttprequest_readyState(QScriptContext *context, QScrip
static QScriptValue qmlxmlhttprequest_status(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(engine)
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
- if (request->readyState() == QmlXMLHttpRequest::Unsent ||
- request->readyState() == QmlXMLHttpRequest::Opened)
+ if (request->readyState() == QDeclarativeXMLHttpRequest::Unsent ||
+ request->readyState() == QDeclarativeXMLHttpRequest::Opened)
THROW_DOM(INVALID_STATE_ERR, "Invalid state");
if (request->errorFlag())
@@ -1500,12 +1500,12 @@ static QScriptValue qmlxmlhttprequest_status(QScriptContext *context, QScriptEng
static QScriptValue qmlxmlhttprequest_statusText(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(engine)
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
- if (request->readyState() == QmlXMLHttpRequest::Unsent ||
- request->readyState() == QmlXMLHttpRequest::Opened)
+ if (request->readyState() == QDeclarativeXMLHttpRequest::Unsent ||
+ request->readyState() == QDeclarativeXMLHttpRequest::Opened)
THROW_DOM(INVALID_STATE_ERR, "Invalid state");
if (request->errorFlag())
@@ -1517,12 +1517,12 @@ static QScriptValue qmlxmlhttprequest_statusText(QScriptContext *context, QScrip
static QScriptValue qmlxmlhttprequest_responseText(QScriptContext *context, QScriptEngine *engine)
{
Q_UNUSED(engine)
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
- if (request->readyState() != QmlXMLHttpRequest::Loading &&
- request->readyState() != QmlXMLHttpRequest::Done)
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done)
return QScriptValue(QString());
else
return QScriptValue(request->responseBody());
@@ -1530,12 +1530,12 @@ static QScriptValue qmlxmlhttprequest_responseText(QScriptContext *context, QScr
static QScriptValue qmlxmlhttprequest_responseXML(QScriptContext *context, QScriptEngine *engine)
{
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(context->thisObject().data().toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
- if (request->readyState() != QmlXMLHttpRequest::Loading &&
- request->readyState() != QmlXMLHttpRequest::Done)
+ if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ request->readyState() != QDeclarativeXMLHttpRequest::Done)
return engine->nullValue();
else
return Document::load(engine, request->responseBody());
@@ -1545,7 +1545,7 @@ static QScriptValue qmlxmlhttprequest_onreadystatechange(QScriptContext *context
{
Q_UNUSED(engine);
QScriptValue dataObject = context->thisObject().data();
- QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(dataObject.toQObject());
+ QDeclarativeXMLHttpRequest *request = qobject_cast<QDeclarativeXMLHttpRequest *>(dataObject.toQObject());
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
@@ -1562,7 +1562,7 @@ static QScriptValue qmlxmlhttprequest_onreadystatechange(QScriptContext *context
static QScriptValue qmlxmlhttprequest_new(QScriptContext *context, QScriptEngine *engine)
{
if (context->isCalledAsConstructor()) {
- context->thisObject().setData(engine->newQObject(new QmlXMLHttpRequest(QmlScriptEngine::get(engine)->networkAccessManager()), QScriptEngine::ScriptOwnership));
+ context->thisObject().setData(engine->newQObject(new QDeclarativeXMLHttpRequest(QDeclarativeScriptEngine::get(engine)->networkAccessManager()), QScriptEngine::ScriptOwnership));
}
return engine->undefinedValue();
}
@@ -1628,4 +1628,4 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine)
QT_END_NAMESPACE
-#include <qmlxmlhttprequest.moc>
+#include <qdeclarativexmlhttprequest.moc>
diff --git a/src/declarative/qml/qmlxmlhttprequest_p.h b/src/declarative/qml/qdeclarativexmlhttprequest_p.h
index 59cb211..068cd0f 100644
--- a/src/declarative/qml/qmlxmlhttprequest_p.h
+++ b/src/declarative/qml/qdeclarativexmlhttprequest_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QMLXMLHTTPREQUEST_P_H
-#define QMLXMLHTTPREQUEST_P_H
+#ifndef QDECLARATIVEXMLHTTPREQUEST_P_H
+#define QDECLARATIVEXMLHTTPREQUEST_P_H
#include <QtScript/qscriptengine.h>
//
@@ -63,5 +63,5 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine);
QT_END_NAMESPACE
-#endif // QMLXMLHTTPREQUEST_P_H
+#endif // QDECLARATIVEXMLHTTPREQUEST_P_H
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
index 1e4e234..0d5fcb0 100644
--- a/src/declarative/qml/qml.pri
+++ b/src/declarative/qml/qml.pri
@@ -1,131 +1,131 @@
INCLUDEPATH += $$PWD
SOURCES += \
- $$PWD/qmlparser.cpp \
- $$PWD/qmlinstruction.cpp \
- $$PWD/qmlvmemetaobject.cpp \
- $$PWD/qmlengine.cpp \
- $$PWD/qmlexpression.cpp \
- $$PWD/qmlbinding.cpp \
- $$PWD/qmlmetaproperty.cpp \
- $$PWD/qmlcomponent.cpp \
- $$PWD/qmlcontext.cpp \
- $$PWD/qmlcustomparser.cpp \
- $$PWD/qmlpropertyvaluesource.cpp \
- $$PWD/qmlpropertyvalueinterceptor.cpp \
- $$PWD/qmlproxymetaobject.cpp \
- $$PWD/qmlvme.cpp \
- $$PWD/qmlcompiler.cpp \
- $$PWD/qmlcompileddata.cpp \
- $$PWD/qmlboundsignal.cpp \
- $$PWD/qmldom.cpp \
- $$PWD/qmlrefcount.cpp \
- $$PWD/qmlprivate.cpp \
- $$PWD/qmlmetatype.cpp \
- $$PWD/qmlstringconverters.cpp \
- $$PWD/qmlclassfactory.cpp \
- $$PWD/qmlparserstatus.cpp \
- $$PWD/qmlcompositetypemanager.cpp \
- $$PWD/qmlinfo.cpp \
- $$PWD/qmlerror.cpp \
- $$PWD/qmlscriptparser.cpp \
- $$PWD/qmlenginedebug.cpp \
- $$PWD/qmlrewrite.cpp \
- $$PWD/qmlvaluetype.cpp \
- $$PWD/qmlcompiledbindings.cpp \
- $$PWD/qmlxmlhttprequest.cpp \
- $$PWD/qmlsqldatabase.cpp \
+ $$PWD/qdeclarativeparser.cpp \
+ $$PWD/qdeclarativeinstruction.cpp \
+ $$PWD/qdeclarativevmemetaobject.cpp \
+ $$PWD/qdeclarativeengine.cpp \
+ $$PWD/qdeclarativeexpression.cpp \
+ $$PWD/qdeclarativebinding.cpp \
+ $$PWD/qdeclarativemetaproperty.cpp \
+ $$PWD/qdeclarativecomponent.cpp \
+ $$PWD/qdeclarativecontext.cpp \
+ $$PWD/qdeclarativecustomparser.cpp \
+ $$PWD/qdeclarativepropertyvaluesource.cpp \
+ $$PWD/qdeclarativepropertyvalueinterceptor.cpp \
+ $$PWD/qdeclarativeproxymetaobject.cpp \
+ $$PWD/qdeclarativevme.cpp \
+ $$PWD/qdeclarativecompiler.cpp \
+ $$PWD/qdeclarativecompileddata.cpp \
+ $$PWD/qdeclarativeboundsignal.cpp \
+ $$PWD/qdeclarativedom.cpp \
+ $$PWD/qdeclarativerefcount.cpp \
+ $$PWD/qdeclarativeprivate.cpp \
+ $$PWD/qdeclarativemetatype.cpp \
+ $$PWD/qdeclarativestringconverters.cpp \
+ $$PWD/qdeclarativeclassfactory.cpp \
+ $$PWD/qdeclarativeparserstatus.cpp \
+ $$PWD/qdeclarativecompositetypemanager.cpp \
+ $$PWD/qdeclarativeinfo.cpp \
+ $$PWD/qdeclarativeerror.cpp \
+ $$PWD/qdeclarativescriptparser.cpp \
+ $$PWD/qdeclarativeenginedebug.cpp \
+ $$PWD/qdeclarativerewrite.cpp \
+ $$PWD/qdeclarativevaluetype.cpp \
+ $$PWD/qdeclarativecompiledbindings.cpp \
+ $$PWD/qdeclarativexmlhttprequest.cpp \
+ $$PWD/qdeclarativesqldatabase.cpp \
$$PWD/qmetaobjectbuilder.cpp \
- $$PWD/qmlwatcher.cpp \
- $$PWD/qmlscript.cpp \
- $$PWD/qmlcleanup.cpp \
- $$PWD/qmlpropertycache.cpp \
- $$PWD/qmlintegercache.cpp \
- $$PWD/qmltypenamecache.cpp \
- $$PWD/qmlscriptstring.cpp \
- $$PWD/qmlobjectscriptclass.cpp \
- $$PWD/qmlcontextscriptclass.cpp \
- $$PWD/qmlglobalscriptclass.cpp \
- $$PWD/qmlvaluetypescriptclass.cpp \
- $$PWD/qmltypenamescriptclass.cpp \
- $$PWD/qmllistscriptclass.cpp \
- $$PWD/qmlworkerscript.cpp \
- $$PWD/qmlimageprovider.cpp \
- $$PWD/qmlnetworkaccessmanagerfactory.cpp \
- $$PWD/qmldirparser.cpp \
- $$PWD/qmlextensionplugin.cpp \
- $$PWD/qmllist.cpp
+ $$PWD/qdeclarativewatcher.cpp \
+ $$PWD/qdeclarativescript.cpp \
+ $$PWD/qdeclarativecleanup.cpp \
+ $$PWD/qdeclarativepropertycache.cpp \
+ $$PWD/qdeclarativeintegercache.cpp \
+ $$PWD/qdeclarativetypenamecache.cpp \
+ $$PWD/qdeclarativescriptstring.cpp \
+ $$PWD/qdeclarativeobjectscriptclass.cpp \
+ $$PWD/qdeclarativecontextscriptclass.cpp \
+ $$PWD/qdeclarativeglobalscriptclass.cpp \
+ $$PWD/qdeclarativevaluetypescriptclass.cpp \
+ $$PWD/qdeclarativetypenamescriptclass.cpp \
+ $$PWD/qdeclarativelistscriptclass.cpp \
+ $$PWD/qdeclarativeworkerscript.cpp \
+ $$PWD/qdeclarativeimageprovider.cpp \
+ $$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \
+ $$PWD/qdeclarativedirparser.cpp \
+ $$PWD/qdeclarativeextensionplugin.cpp \
+ $$PWD/qdeclarativelist.cpp
HEADERS += \
- $$PWD/qmlparser_p.h \
- $$PWD/qmlglobal_p.h \
- $$PWD/qmlinstruction_p.h \
- $$PWD/qmlvmemetaobject_p.h \
- $$PWD/qml.h \
- $$PWD/qmlbinding_p.h \
- $$PWD/qmlbinding_p_p.h \
- $$PWD/qmlmetaproperty.h \
- $$PWD/qmlcomponent.h \
- $$PWD/qmlcomponent_p.h \
- $$PWD/qmlcustomparser_p.h \
- $$PWD/qmlcustomparser_p_p.h \
- $$PWD/qmlpropertyvaluesource.h \
- $$PWD/qmlpropertyvalueinterceptor.h \
- $$PWD/qmlboundsignal_p.h \
- $$PWD/qmlparserstatus.h \
- $$PWD/qmlproxymetaobject_p.h \
- $$PWD/qmlvme_p.h \
- $$PWD/qmlcompiler_p.h \
- $$PWD/qmlengine_p.h \
- $$PWD/qmlexpression_p.h \
- $$PWD/qmlprivate.h \
- $$PWD/qmldom_p.h \
- $$PWD/qmldom_p_p.h \
- $$PWD/qmlrefcount_p.h \
- $$PWD/qmlmetatype.h \
- $$PWD/qmlengine.h \
- $$PWD/qmlcontext.h \
- $$PWD/qmlexpression.h \
- $$PWD/qmlstringconverters_p.h \
- $$PWD/qmlclassfactory_p.h \
- $$PWD/qmlinfo.h \
- $$PWD/qmlmetaproperty_p.h \
- $$PWD/qmlcontext_p.h \
- $$PWD/qmlcompositetypedata_p.h \
- $$PWD/qmlcompositetypemanager_p.h \
- $$PWD/qmllist.h \
- $$PWD/qmllist_p.h \
- $$PWD/qmldeclarativedata_p.h \
- $$PWD/qmlerror.h \
- $$PWD/qmlscriptparser_p.h \
- $$PWD/qmlenginedebug_p.h \
- $$PWD/qmlrewrite_p.h \
+ $$PWD/qdeclarativeparser_p.h \
+ $$PWD/qdeclarativeglobal_p.h \
+ $$PWD/qdeclarativeinstruction_p.h \
+ $$PWD/qdeclarativevmemetaobject_p.h \
+ $$PWD/qdeclarative.h \
+ $$PWD/qdeclarativebinding_p.h \
+ $$PWD/qdeclarativebinding_p_p.h \
+ $$PWD/qdeclarativemetaproperty.h \
+ $$PWD/qdeclarativecomponent.h \
+ $$PWD/qdeclarativecomponent_p.h \
+ $$PWD/qdeclarativecustomparser_p.h \
+ $$PWD/qdeclarativecustomparser_p_p.h \
+ $$PWD/qdeclarativepropertyvaluesource.h \
+ $$PWD/qdeclarativepropertyvalueinterceptor.h \
+ $$PWD/qdeclarativeboundsignal_p.h \
+ $$PWD/qdeclarativeparserstatus.h \
+ $$PWD/qdeclarativeproxymetaobject_p.h \
+ $$PWD/qdeclarativevme_p.h \
+ $$PWD/qdeclarativecompiler_p.h \
+ $$PWD/qdeclarativeengine_p.h \
+ $$PWD/qdeclarativeexpression_p.h \
+ $$PWD/qdeclarativeprivate.h \
+ $$PWD/qdeclarativedom_p.h \
+ $$PWD/qdeclarativedom_p_p.h \
+ $$PWD/qdeclarativerefcount_p.h \
+ $$PWD/qdeclarativemetatype.h \
+ $$PWD/qdeclarativeengine.h \
+ $$PWD/qdeclarativecontext.h \
+ $$PWD/qdeclarativeexpression.h \
+ $$PWD/qdeclarativestringconverters_p.h \
+ $$PWD/qdeclarativeclassfactory_p.h \
+ $$PWD/qdeclarativeinfo.h \
+ $$PWD/qdeclarativemetaproperty_p.h \
+ $$PWD/qdeclarativecontext_p.h \
+ $$PWD/qdeclarativecompositetypedata_p.h \
+ $$PWD/qdeclarativecompositetypemanager_p.h \
+ $$PWD/qdeclarativelist.h \
+ $$PWD/qdeclarativelist_p.h \
+ $$PWD/qdeclarativedeclarativedata_p.h \
+ $$PWD/qdeclarativeerror.h \
+ $$PWD/qdeclarativescriptparser_p.h \
+ $$PWD/qdeclarativeenginedebug_p.h \
+ $$PWD/qdeclarativerewrite_p.h \
$$PWD/qpodvector_p.h \
$$PWD/qbitfield_p.h \
- $$PWD/qmlvaluetype_p.h \
- $$PWD/qmlcompiledbindings_p.h \
- $$PWD/qmlxmlhttprequest_p.h \
- $$PWD/qmlsqldatabase_p.h \
+ $$PWD/qdeclarativevaluetype_p.h \
+ $$PWD/qdeclarativecompiledbindings_p.h \
+ $$PWD/qdeclarativexmlhttprequest_p.h \
+ $$PWD/qdeclarativesqldatabase_p.h \
$$PWD/qmetaobjectbuilder_p.h \
- $$PWD/qmlwatcher_p.h \
- $$PWD/qmlcleanup_p.h \
- $$PWD/qmlpropertycache_p.h \
- $$PWD/qmlintegercache_p.h \
- $$PWD/qmltypenamecache_p.h \
- $$PWD/qmlscriptstring.h \
- $$PWD/qmlobjectscriptclass_p.h \
- $$PWD/qmlcontextscriptclass_p.h \
- $$PWD/qmlglobalscriptclass_p.h \
- $$PWD/qmlvaluetypescriptclass_p.h \
- $$PWD/qmltypenamescriptclass_p.h \
- $$PWD/qmllistscriptclass_p.h \
- $$PWD/qmlworkerscript_p.h \
- $$PWD/qmlscriptclass_p.h \
- $$PWD/qmlguard_p.h \
- $$PWD/qmlimageprovider.h \
- $$PWD/qmlnetworkaccessmanagerfactory.h \
- $$PWD/qmldirparser_p.h \
- $$PWD/qmlextensioninterface.h \
- $$PWD/qmlextensionplugin.h
+ $$PWD/qdeclarativewatcher_p.h \
+ $$PWD/qdeclarativecleanup_p.h \
+ $$PWD/qdeclarativepropertycache_p.h \
+ $$PWD/qdeclarativeintegercache_p.h \
+ $$PWD/qdeclarativetypenamecache_p.h \
+ $$PWD/qdeclarativescriptstring.h \
+ $$PWD/qdeclarativeobjectscriptclass_p.h \
+ $$PWD/qdeclarativecontextscriptclass_p.h \
+ $$PWD/qdeclarativeglobalscriptclass_p.h \
+ $$PWD/qdeclarativevaluetypescriptclass_p.h \
+ $$PWD/qdeclarativetypenamescriptclass_p.h \
+ $$PWD/qdeclarativelistscriptclass_p.h \
+ $$PWD/qdeclarativeworkerscript_p.h \
+ $$PWD/qdeclarativescriptclass_p.h \
+ $$PWD/qdeclarativeguard_p.h \
+ $$PWD/qdeclarativeimageprovider.h \
+ $$PWD/qdeclarativenetworkaccessmanagerfactory.h \
+ $$PWD/qdeclarativedirparser_p.h \
+ $$PWD/qdeclarativeextensioninterface.h \
+ $$PWD/qdeclarativeextensionplugin.h
QT += sql
include(parser/parser.pri)
diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h
deleted file mode 100644
index 744d397..0000000
--- a/src/declarative/qml/qmlcompiler_p.h
+++ /dev/null
@@ -1,337 +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 QMLCOMPILER_P_H
-#define QMLCOMPILER_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 "qml.h"
-#include "qmlerror.h"
-#include "qmlinstruction_p.h"
-#include "qmlcompositetypemanager_p.h"
-#include "qmlparser_p.h"
-#include "qmlengine_p.h"
-#include "qbitfield_p.h"
-#include "qmlpropertycache_p.h"
-#include "qmlintegercache_p.h"
-#include "qmltypenamecache_p.h"
-
-#include <QtCore/qbytearray.h>
-#include <QtCore/qset.h>
-
-QT_BEGIN_NAMESPACE
-
-class QmlEngine;
-class QmlComponent;
-class QmlContext;
-
-class QScriptProgram;
-class Q_AUTOTEST_EXPORT QmlCompiledData : public QmlRefCount, public QmlCleanup
-{
-public:
- QmlCompiledData(QmlEngine *engine);
- virtual ~QmlCompiledData();
-
- QString name;
- QUrl url;
- QmlEnginePrivate::Imports imports;
- QmlTypeNameCache *importCache;
-
- struct TypeReference
- {
- TypeReference()
- : type(0), component(0), ref(0) {}
-
- QByteArray className;
- QmlType *type;
- QmlComponent *component;
-
- QmlRefCount *ref;
- QObject *createInstance(QmlContext *, const QBitField &) const;
- const QMetaObject *metaObject() const;
- };
- QList<TypeReference> types;
- struct CustomTypeData
- {
- int index;
- int type;
- };
-
- const QMetaObject *root;
- QAbstractDynamicMetaObject rootData;
- QmlPropertyCache *rootPropertyCache;
- QList<QString> primitives;
- QList<float> floatData;
- QList<int> intData;
- QList<CustomTypeData> customTypeData;
- QList<QByteArray> datas;
- QList<QmlParser::Location> locations;
- QList<QmlInstruction> bytecode;
- QList<QScriptProgram *> cachedPrograms;
- QList<QScriptValue *> cachedClosures;
- QList<QmlPropertyCache *> propertyCaches;
- QList<QmlIntegerCache *> contextCaches;
- QList<QmlParser::Object::ScriptBlock> scripts;
- QList<QUrl> urls;
-
- void dumpInstructions();
-
-protected:
- virtual void clear(); // From QmlCleanup
-
-private:
- void dump(QmlInstruction *, int idx = -1);
- QmlCompiledData(const QmlCompiledData &other);
- QmlCompiledData &operator=(const QmlCompiledData &other);
- QByteArray packData;
- friend class QmlCompiler;
- int pack(const char *, size_t);
-
- int indexForString(const QString &);
- int indexForByteArray(const QByteArray &);
- int indexForFloat(float *, int);
- int indexForInt(int *, int);
- int indexForLocation(const QmlParser::Location &);
- int indexForLocation(const QmlParser::LocationSpan &);
- int indexForUrl(const QUrl &);
-};
-
-class QMetaObjectBuilder;
-class Q_DECLARATIVE_EXPORT QmlCompiler
-{
-public:
- QmlCompiler();
-
- bool compile(QmlEngine *, QmlCompositeTypeData *, QmlCompiledData *);
-
- bool isError() const;
- QList<QmlError> errors() const;
-
- static bool isValidId(const QString &);
- static bool isAttachedPropertyName(const QByteArray &);
- static bool isSignalPropertyName(const QByteArray &);
-
-private:
- static void reset(QmlCompiledData *);
-
- struct BindingContext {
- BindingContext()
- : stack(0), owner(0), object(0) {}
- BindingContext(QmlParser::Object *o)
- : stack(0), owner(0), object(o) {}
- BindingContext incr() const {
- BindingContext rv(object);
- rv.stack = stack + 1;
- return rv;
- }
- bool isSubContext() const { return stack != 0; }
- int stack;
- int owner;
- QmlParser::Object *object;
- };
-
- void compileTree(QmlParser::Object *tree);
-
-
- bool buildObject(QmlParser::Object *obj, const BindingContext &);
- bool buildScript(QmlParser::Object *obj, QmlParser::Object *script);
- bool buildComponent(QmlParser::Object *obj, const BindingContext &);
- bool buildSubObject(QmlParser::Object *obj, const BindingContext &);
- bool buildSignal(QmlParser::Property *prop, QmlParser::Object *obj,
- const BindingContext &);
- bool buildProperty(QmlParser::Property *prop, QmlParser::Object *obj,
- const BindingContext &);
- bool buildPropertyInNamespace(QmlEnginePrivate::ImportedNamespace *ns,
- QmlParser::Property *prop,
- QmlParser::Object *obj,
- const BindingContext &);
- bool buildIdProperty(QmlParser::Property *prop, QmlParser::Object *obj);
- bool buildAttachedProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
- const BindingContext &ctxt);
- bool buildGroupedProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
- const BindingContext &ctxt);
- bool buildValueTypeProperty(QObject *type,
- QmlParser::Object *obj,
- QmlParser::Object *baseObj,
- const BindingContext &ctxt);
- bool buildListProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
- const BindingContext &ctxt);
- bool buildScriptStringProperty(QmlParser::Property *prop,
- QmlParser::Object *obj,
- const BindingContext &ctxt);
- bool buildPropertyAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
- const BindingContext &ctxt);
- bool buildPropertyObjectAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Value *value,
- const BindingContext &ctxt);
- bool buildPropertyLiteralAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Value *value,
- const BindingContext &ctxt);
- bool doesPropertyExist(QmlParser::Property *prop, QmlParser::Object *obj);
- bool testLiteralAssignment(const QMetaProperty &prop,
- QmlParser::Value *value);
- bool testQualifiedEnumAssignment(const QMetaProperty &prop,
- QmlParser::Object *obj,
- QmlParser::Value *value,
- bool *isAssignment);
- enum DynamicMetaMode { IgnoreAliases, ResolveAliases, ForceCreation };
- bool mergeDynamicMetaProperties(QmlParser::Object *obj);
- bool buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode);
- bool checkDynamicMeta(QmlParser::Object *obj);
- bool buildBinding(QmlParser::Value *, QmlParser::Property *prop,
- const BindingContext &ctxt);
- bool buildComponentFromRoot(QmlParser::Object *obj, const BindingContext &);
- bool compileAlias(QMetaObjectBuilder &,
- QByteArray &data,
- QmlParser::Object *obj,
- const QmlParser::Object::DynamicProperty &);
- bool completeComponentBuild();
-
-
- void genObject(QmlParser::Object *obj);
- void genObjectBody(QmlParser::Object *obj);
- void genComponent(QmlParser::Object *obj);
- void genValueProperty(QmlParser::Property *prop, QmlParser::Object *obj);
- void genListProperty(QmlParser::Property *prop, QmlParser::Object *obj);
- void genPropertyAssignment(QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Property *valueTypeProperty = 0);
- void genLiteralAssignment(const QMetaProperty &prop,
- QmlParser::Value *value);
- void genBindingAssignment(QmlParser::Value *binding,
- QmlParser::Property *prop,
- QmlParser::Object *obj,
- QmlParser::Property *valueTypeProperty = 0);
- int genContextCache();
-
- int genValueTypeData(QmlParser::Property *prop, QmlParser::Property *valueTypeProp);
- int genPropertyData(QmlParser::Property *prop);
-
- int componentTypeRef();
-
- static int findSignalByName(const QMetaObject *, const QByteArray &name);
- static QmlType *toQmlType(QmlParser::Object *from);
- bool canCoerce(int to, QmlParser::Object *from);
- bool canCoerce(int to, int from);
-
- QStringList deferredProperties(QmlParser::Object *);
-
- void addId(const QString &, QmlParser::Object *);
-
- void dumpStats();
-
- struct BindingReference {
- QmlParser::Variant expression;
- QmlParser::Property *property;
- QmlParser::Value *value;
-
- enum DataType { QtScript, Experimental };
- DataType dataType;
-
- int compiledIndex;
-
- QByteArray compiledData;
- BindingContext bindingContext;
- };
- void addBindingReference(const BindingReference &);
-
- struct ComponentCompileState
- {
- ComponentCompileState()
- : parserStatusCount(0), pushedProperties(0), root(0) {}
- QHash<QString, QmlParser::Object *> ids;
- QHash<int, QmlParser::Object *> idIndexes;
- int parserStatusCount;
- int pushedProperties;
-
- QByteArray compiledBindingData;
-
- QHash<QmlParser::Value *, BindingReference> bindings;
- QList<QmlParser::Object *> aliasingObjects;
- QmlParser::Object *root;
- };
- ComponentCompileState compileState;
-
- struct ComponentStat
- {
- ComponentStat()
- : ids(0), scriptBindings(0), optimizedBindings(0), objects(0) {}
-
- int lineNumber;
-
- int ids;
- int scriptBindings;
- int optimizedBindings;
- int objects;
- };
- ComponentStat componentStat;
-
- void saveComponentState();
-
- ComponentCompileState componentState(QmlParser::Object *);
- QHash<QmlParser::Object *, ComponentCompileState> savedCompileStates;
- QList<ComponentStat> savedComponentStats;
-
- QList<QmlError> exceptions;
- QmlCompiledData *output;
- QmlEngine *engine;
- QmlParser::Object *unitRoot;
- QmlCompositeTypeData *unit;
-};
-QT_END_NAMESPACE
-
-#endif // QMLCOMPILER_P_H
diff --git a/src/declarative/qml/qmldom_p.h b/src/declarative/qml/qmldom_p.h
deleted file mode 100644
index 8c7288e..0000000
--- a/src/declarative/qml/qmldom_p.h
+++ /dev/null
@@ -1,360 +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 QMLDOM_P_H
-#define QMLDOM_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 "qmlerror.h"
-
-#include <QtCore/qlist.h>
-#include <QtCore/qshareddata.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QString;
-class QByteArray;
-class QmlDomObject;
-class QmlDomList;
-class QmlDomValue;
-class QmlEngine;
-class QmlDomComponent;
-class QmlDomImport;
-class QIODevice;
-
-class QmlDomDocumentPrivate;
-
-class Q_DECLARATIVE_EXPORT QmlDomDocument
-{
-public:
- QmlDomDocument();
- QmlDomDocument(const QmlDomDocument &);
- ~QmlDomDocument();
- QmlDomDocument &operator=(const QmlDomDocument &);
-
- QList<QmlDomImport> imports() const;
-
- QList<QmlError> errors() const;
- bool load(QmlEngine *, const QByteArray &, const QUrl & = QUrl());
-
- QmlDomObject rootObject() const;
-
-private:
- QSharedDataPointer<QmlDomDocumentPrivate> d;
-};
-
-class QmlDomPropertyPrivate;
-class Q_DECLARATIVE_EXPORT QmlDomProperty
-{
-public:
- QmlDomProperty();
- QmlDomProperty(const QmlDomProperty &);
- ~QmlDomProperty();
- QmlDomProperty &operator=(const QmlDomProperty &);
-
- bool isValid() const;
-
- QByteArray propertyName() const;
- QList<QByteArray> propertyNameParts() const;
-
- bool isDefaultProperty() const;
-
- QmlDomValue value() const;
-
- int position() const;
- int length() const;
-
-private:
- friend class QmlDomObject;
- friend class QmlDomDynamicProperty;
- QSharedDataPointer<QmlDomPropertyPrivate> d;
-};
-
-class QmlDomDynamicPropertyPrivate;
-class Q_DECLARATIVE_EXPORT QmlDomDynamicProperty
-{
-public:
- QmlDomDynamicProperty();
- QmlDomDynamicProperty(const QmlDomDynamicProperty &);
- ~QmlDomDynamicProperty();
- QmlDomDynamicProperty &operator=(const QmlDomDynamicProperty &);
-
- bool isValid() const;
-
- QByteArray propertyName() const;
- int propertyType() const;
- QByteArray propertyTypeName() const;
-
- bool isDefaultProperty() const;
- QmlDomProperty defaultValue() const;
-
- bool isAlias() const;
-
- int position() const;
- int length() const;
-
-private:
- friend class QmlDomObject;
- QSharedDataPointer<QmlDomDynamicPropertyPrivate> d;
-};
-
-class QmlDomObjectPrivate;
-class Q_DECLARATIVE_EXPORT QmlDomObject
-{
-public:
- QmlDomObject();
- QmlDomObject(const QmlDomObject &);
- ~QmlDomObject();
- QmlDomObject &operator=(const QmlDomObject &);
-
- bool isValid() const;
-
- QByteArray objectType() const;
- QByteArray objectClassName() const;
-
- int objectTypeMajorVersion() const;
- int objectTypeMinorVersion() const;
-
- QString objectId() const;
-
- QList<QmlDomProperty> properties() const;
- QmlDomProperty property(const QByteArray &) const;
-
- QList<QmlDomDynamicProperty> dynamicProperties() const;
- QmlDomDynamicProperty dynamicProperty(const QByteArray &) const;
-
- bool isCustomType() const;
- QByteArray customTypeData() const;
-
- bool isComponent() const;
- QmlDomComponent toComponent() const;
-
- int position() const;
- int length() const;
-
- QUrl url() const;
-private:
- friend class QmlDomDocument;
- friend class QmlDomComponent;
- friend class QmlDomValue;
- friend class QmlDomValueValueSource;
- friend class QmlDomValueValueInterceptor;
- QSharedDataPointer<QmlDomObjectPrivate> d;
-};
-
-class QmlDomValuePrivate;
-class QmlDomBasicValuePrivate;
-class Q_DECLARATIVE_EXPORT QmlDomValueLiteral
-{
-public:
- QmlDomValueLiteral();
- QmlDomValueLiteral(const QmlDomValueLiteral &);
- ~QmlDomValueLiteral();
- QmlDomValueLiteral &operator=(const QmlDomValueLiteral &);
-
- QString literal() const;
-
-private:
- friend class QmlDomValue;
- QSharedDataPointer<QmlDomBasicValuePrivate> d;
-};
-
-class Q_DECLARATIVE_EXPORT QmlDomValueBinding
-{
-public:
- QmlDomValueBinding();
- QmlDomValueBinding(const QmlDomValueBinding &);
- ~QmlDomValueBinding();
- QmlDomValueBinding &operator=(const QmlDomValueBinding &);
-
- QString binding() const;
-
-private:
- friend class QmlDomValue;
- QSharedDataPointer<QmlDomBasicValuePrivate> d;
-};
-
-class Q_DECLARATIVE_EXPORT QmlDomValueValueSource
-{
-public:
- QmlDomValueValueSource();
- QmlDomValueValueSource(const QmlDomValueValueSource &);
- ~QmlDomValueValueSource();
- QmlDomValueValueSource &operator=(const QmlDomValueValueSource &);
-
- QmlDomObject object() const;
-
-private:
- friend class QmlDomValue;
- QSharedDataPointer<QmlDomBasicValuePrivate> d;
-};
-
-class Q_DECLARATIVE_EXPORT QmlDomValueValueInterceptor
-{
-public:
- QmlDomValueValueInterceptor();
- QmlDomValueValueInterceptor(const QmlDomValueValueInterceptor &);
- ~QmlDomValueValueInterceptor();
- QmlDomValueValueInterceptor &operator=(const QmlDomValueValueInterceptor &);
-
- QmlDomObject object() const;
-
-private:
- friend class QmlDomValue;
- QSharedDataPointer<QmlDomBasicValuePrivate> d;
-};
-
-
-class Q_DECLARATIVE_EXPORT QmlDomComponent : public QmlDomObject
-{
-public:
- QmlDomComponent();
- QmlDomComponent(const QmlDomComponent &);
- ~QmlDomComponent();
- QmlDomComponent &operator=(const QmlDomComponent &);
-
- QmlDomObject componentRoot() const;
-};
-
-class Q_DECLARATIVE_EXPORT QmlDomValue
-{
-public:
- enum Type {
- Invalid,
- Literal,
- PropertyBinding,
- ValueSource,
- ValueInterceptor,
- Object,
- List
- };
-
- QmlDomValue();
- QmlDomValue(const QmlDomValue &);
- ~QmlDomValue();
- QmlDomValue &operator=(const QmlDomValue &);
-
- Type type() const;
-
- bool isInvalid() const;
- bool isLiteral() const;
- bool isBinding() const;
- bool isValueSource() const;
- bool isValueInterceptor() const;
- bool isObject() const;
- bool isList() const;
-
- QmlDomValueLiteral toLiteral() const;
- QmlDomValueBinding toBinding() const;
- QmlDomValueValueSource toValueSource() const;
- QmlDomValueValueInterceptor toValueInterceptor() const;
- QmlDomObject toObject() const;
- QmlDomList toList() const;
-
- int position() const;
- int length() const;
-
-private:
- friend class QmlDomProperty;
- friend class QmlDomList;
- QSharedDataPointer<QmlDomValuePrivate> d;
-};
-
-class Q_DECLARATIVE_EXPORT QmlDomList
-{
-public:
- QmlDomList();
- QmlDomList(const QmlDomList &);
- ~QmlDomList();
- QmlDomList &operator=(const QmlDomList &);
-
- QList<QmlDomValue> values() const;
-
- int position() const;
- int length() const;
-
- QList<int> commaPositions() const;
-
-private:
- friend class QmlDomValue;
- QSharedDataPointer<QmlDomValuePrivate> d;
-};
-
-class QmlDomImportPrivate;
-class Q_DECLARATIVE_EXPORT QmlDomImport
-{
-public:
- enum Type { Library, File };
-
- QmlDomImport();
- QmlDomImport(const QmlDomImport &);
- ~QmlDomImport();
- QmlDomImport &operator=(const QmlDomImport &);
-
- Type type() const;
- QString uri() const;
- QString version() const;
- QString qualifier() const;
-
-private:
- friend class QmlDomDocument;
- QSharedDataPointer<QmlDomImportPrivate> d;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QMLDOM_P_H
diff --git a/src/declarative/qml/qmlinfo.h b/src/declarative/qml/qmlinfo.h
deleted file mode 100644
index 379f211..0000000
--- a/src/declarative/qml/qmlinfo.h
+++ /dev/null
@@ -1,92 +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 QMLINFO_H
-#define QMLINFO_H
-
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class Q_DECLARATIVE_EXPORT QmlInfo : public QDebug
-{
-public:
- QmlInfo(const QObject *);
- ~QmlInfo();
-
- inline QmlInfo &operator<<(QChar t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(QBool t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(bool t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(char t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(signed short t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(unsigned short t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(signed int t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(unsigned int t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(signed long t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(unsigned long t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(qint64 t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(quint64 t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(float t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(double t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(const char* t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(const QString & t) { QDebug::operator<<(t.toLocal8Bit().constData()); return *this; }
- inline QmlInfo &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
- inline QmlInfo &operator<<(const QLatin1String &t) { QDebug::operator<<(t.latin1()); return *this; }
- inline QmlInfo &operator<<(const QByteArray & t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; }
- inline QmlInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; }
- inline QmlInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; }
-};
-
-Q_DECLARATIVE_EXPORT inline QmlInfo qmlInfo(const QObject *me)
-{
- return QmlInfo(me);
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QMLINFO_H
diff --git a/src/declarative/qml/qmlmetatype.h b/src/declarative/qml/qmlmetatype.h
deleted file mode 100644
index 98d04c1..0000000
--- a/src/declarative/qml/qmlmetatype.h
+++ /dev/null
@@ -1,281 +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 QMLMETATYPE_H
-#define QMLMETATYPE_H
-
-#include "qmlprivate.h"
-#include "qmlparserstatus.h"
-#include "qmlpropertyvaluesource.h"
-#include "qmlpropertyvalueinterceptor.h"
-#include "qmllist.h"
-
-#include <QtCore/qglobal.h>
-#include <QtCore/qvariant.h>
-#include <QtCore/qbitarray.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QmlType;
-class QmlCustomParser;
-class Q_DECLARATIVE_EXPORT QmlMetaType
-{
-public:
- static int registerType(const QmlPrivate::MetaTypeIds &, QObject *(*)(), const char *, int vmaj, int vmin, const char *qmlName, const QMetaObject *, QmlAttachedPropertiesFunc, const QMetaObject *, int pStatus, int object, int valueSource, int valueInterceptor, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *);
- static int registerInterface(const QmlPrivate::MetaTypeIds &, const char *);
-
- static bool copy(int type, void *data, const void *copy = 0);
-
- static QList<QByteArray> qmlTypeNames();
- static QList<QmlType*> qmlTypes();
-
- static QmlType *qmlType(const QByteArray &, int, int);
- static QmlType *qmlType(const QMetaObject *);
- static QmlType *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 QmlAttachedPropertiesFunc 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 QmlTypePrivate;
-class Q_DECLARATIVE_EXPORT QmlType
-{
-public:
- QByteArray typeName() const;
- QByteArray qmlTypeName() const;
-
- int majorVersion() const;
- int minorVersion() const;
- bool availableInVersion(int vmajor, int vminor) const;
-
- QObject *create() const;
-
- QmlCustomParser *customParser() const;
-
- bool isInterface() const;
- int typeId() const;
- int qListTypeId() const;
-
- const QMetaObject *metaObject() const;
- const QMetaObject *baseMetaObject() const;
-
- QmlAttachedPropertiesFunc 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 QmlMetaType;
- friend class QmlTypePrivate;
- friend struct QmlMetaTypeData;
- QmlType(int, int, const char *, int);
- QmlType(int, int, QObject *(*)(), const char *, int, int, const QMetaObject *, QmlAttachedPropertiesFunc, const QMetaObject *, int, int, int, QmlPrivate::CreateFunc, const QMetaObject *, int, QmlCustomParser *);
- ~QmlType();
-
- QmlTypePrivate *d;
-};
-
-template<typename T>
-int qmlRegisterType(const char *typeName)
-{
- QByteArray name(typeName);
- QmlPrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QmlListProperty<T> >(QByteArray("QmlListProperty<" + name + ">").constData()),
- };
-
- return QmlMetaType::registerType(ids, 0, 0, 0, 0, 0,
- &T::staticMetaObject,
- QmlPrivate::attachedPropertiesFunc<T>(),
- QmlPrivate::attachedPropertiesMetaObject<T>(),
- QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(),
- QmlPrivate::StaticCastSelector<T,QObject>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueSource>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueInterceptor>::cast(),
- 0, 0, 0);
-}
-
-template<typename T>
-int qmlRegisterType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName)
-{
- QByteArray name(typeName);
- QmlPrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QmlListProperty<T> >(QByteArray("QmlListProperty<" + name + ">").constData()),
- };
-
- return QmlMetaType::registerType(ids, QmlPrivate::create<T>,
- uri, version_maj, version_min, qmlName,
- &T::staticMetaObject,
- QmlPrivate::attachedPropertiesFunc<T>(),
- QmlPrivate::attachedPropertiesMetaObject<T>(),
- QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(),
- QmlPrivate::StaticCastSelector<T,QObject>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueSource>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueInterceptor>::cast(),
- 0, 0, 0);
-}
-
-template<typename T, typename E>
-int qmlRegisterExtendedType(const char *typeName)
-{
- QByteArray name(typeName);
- QmlPrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QmlListProperty<T> >(QByteArray("QmlListProperty<" + name + ">").constData()),
- };
-
- QmlAttachedPropertiesFunc attached =
- QmlPrivate::attachedPropertiesFunc<E>();
- const QMetaObject * attachedMo =
- QmlPrivate::attachedPropertiesMetaObject<E>();
- if (!attached) {
- attached = QmlPrivate::attachedPropertiesFunc<T>();
- attachedMo = QmlPrivate::attachedPropertiesMetaObject<T>();
- }
-
- return QmlMetaType::registerType(ids, 0, 0, 0, 0, 0,
- &T::staticMetaObject, attached, attachedMo,
- QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(),
- QmlPrivate::StaticCastSelector<T,QObject>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueSource>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueInterceptor>::cast(),
- &QmlPrivate::CreateParent<E>::create, &E::staticMetaObject, 0);
-}
-
-template<typename T, typename E>
-int qmlRegisterExtendedType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName)
-{
- QByteArray name(typeName);
- QmlPrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QmlListProperty<T> >(QByteArray("QmlListProperty<" + name + ">").constData()),
- };
-
- QmlAttachedPropertiesFunc attached =
- QmlPrivate::attachedPropertiesFunc<E>();
- const QMetaObject * attachedMo =
- QmlPrivate::attachedPropertiesMetaObject<E>();
- if (!attached) {
- attached = QmlPrivate::attachedPropertiesFunc<T>();
- attachedMo = QmlPrivate::attachedPropertiesMetaObject<T>();
- }
-
- return QmlMetaType::registerType(ids, QmlPrivate::create<T>,
- uri, version_maj, version_min, qmlName,
- &T::staticMetaObject,
- attached, attachedMo,
- QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(),
- QmlPrivate::StaticCastSelector<T,QObject>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueSource>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueInterceptor>::cast(),
- &QmlPrivate::CreateParent<E>::create,
- &E::staticMetaObject, 0);
-}
-
-template<typename T>
-int qmlRegisterInterface(const char *typeName)
-{
- QByteArray name(typeName);
- QmlPrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QmlListProperty<T> >(QByteArray("QmlListProperty<" + name + ">").constData()),
- };
-
- return QmlMetaType::registerInterface(ids, qobject_interface_iid<T *>());
-}
-
-template<typename T>
-int qmlRegisterCustomType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName, QmlCustomParser *parser)
-{
- QByteArray name(typeName);
- QmlPrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QmlListProperty<T> >(QByteArray("QmlListProperty<" + name + ">").constData()),
- };
-
- return QmlMetaType::registerType(ids, QmlPrivate::create<T>,
- uri, version_maj, version_min, qmlName,
- &T::staticMetaObject,
- QmlPrivate::attachedPropertiesFunc<T>(),
- QmlPrivate::attachedPropertiesMetaObject<T>(),
- QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(),
- QmlPrivate::StaticCastSelector<T,QObject>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueSource>::cast(),
- QmlPrivate::StaticCastSelector<T,QmlPropertyValueInterceptor>::cast(),
- 0, 0, parser);
-}
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QMLMETATYPE_H
-
diff --git a/src/declarative/qml/qmlvaluetype.cpp b/src/declarative/qml/qmlvaluetype.cpp
deleted file mode 100644
index e3b4219..0000000
--- a/src/declarative/qml/qmlvaluetype.cpp
+++ /dev/null
@@ -1,706 +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$
-**
-****************************************************************************/
-
-#include "qmlvaluetype_p.h"
-
-#include <QtCore/qdebug.h>
-
-QT_BEGIN_NAMESPACE
-
-QmlValueTypeFactory::QmlValueTypeFactory()
-{
- // ### Optimize
- for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
- valueTypes[ii] = valueType(ii);
-}
-
-QmlValueTypeFactory::~QmlValueTypeFactory()
-{
- for (unsigned int ii = 0; ii < (QVariant::UserType - 1); ++ii)
- delete valueTypes[ii];
-}
-
-QmlValueType *QmlValueTypeFactory::valueType(int t)
-{
- switch (t) {
- case QVariant::Point:
- return new QmlPointValueType;
- case QVariant::PointF:
- return new QmlPointFValueType;
- case QVariant::Size:
- return new QmlSizeValueType;
- case QVariant::SizeF:
- return new QmlSizeFValueType;
- case QVariant::Rect:
- return new QmlRectValueType;
- case QVariant::RectF:
- return new QmlRectFValueType;
- case QVariant::Vector3D:
- return new QmlVector3DValueType;
- case QVariant::EasingCurve:
- return new QmlEasingValueType;
- case QVariant::Font:
- return new QmlFontValueType;
- default:
- return 0;
- }
-}
-
-QmlValueType::QmlValueType(QObject *parent)
-: QObject(parent)
-{
-}
-
-QmlPointFValueType::QmlPointFValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlPointFValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &point, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlPointFValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &point, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlPointFValueType::value()
-{
- return QVariant(point);
-}
-
-void QmlPointFValueType::setValue(QVariant value)
-{
- point = qvariant_cast<QPointF>(value);
-}
-
-qreal QmlPointFValueType::x() const
-{
- return point.x();
-}
-
-qreal QmlPointFValueType::y() const
-{
- return point.y();
-}
-
-void QmlPointFValueType::setX(qreal x)
-{
- point.setX(x);
-}
-
-void QmlPointFValueType::setY(qreal y)
-{
- point.setY(y);
-}
-
-QmlPointValueType::QmlPointValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlPointValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &point, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlPointValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &point, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlPointValueType::value()
-{
- return QVariant(point);
-}
-
-void QmlPointValueType::setValue(QVariant value)
-{
- point = qvariant_cast<QPoint>(value);
-}
-
-int QmlPointValueType::x() const
-{
- return point.x();
-}
-
-int QmlPointValueType::y() const
-{
- return point.y();
-}
-
-void QmlPointValueType::setX(int x)
-{
- point.setX(x);
-}
-
-void QmlPointValueType::setY(int y)
-{
- point.setY(y);
-}
-
-QmlSizeFValueType::QmlSizeFValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlSizeFValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &size, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlSizeFValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &size, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlSizeFValueType::value()
-{
- return QVariant(size);
-}
-
-void QmlSizeFValueType::setValue(QVariant value)
-{
- size = qvariant_cast<QSizeF>(value);
-}
-
-qreal QmlSizeFValueType::width() const
-{
- return size.width();
-}
-
-qreal QmlSizeFValueType::height() const
-{
- return size.height();
-}
-
-void QmlSizeFValueType::setWidth(qreal w)
-{
- size.setWidth(w);
-}
-
-void QmlSizeFValueType::setHeight(qreal h)
-{
- size.setHeight(h);
-}
-
-QmlSizeValueType::QmlSizeValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlSizeValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &size, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlSizeValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &size, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlSizeValueType::value()
-{
- return QVariant(size);
-}
-
-void QmlSizeValueType::setValue(QVariant value)
-{
- size = qvariant_cast<QSize>(value);
-}
-
-int QmlSizeValueType::width() const
-{
- return size.width();
-}
-
-int QmlSizeValueType::height() const
-{
- return size.height();
-}
-
-void QmlSizeValueType::setWidth(int w)
-{
- size.setWidth(w);
-}
-
-void QmlSizeValueType::setHeight(int h)
-{
- size.setHeight(h);
-}
-
-QmlRectFValueType::QmlRectFValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlRectFValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &rect, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlRectFValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &rect, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlRectFValueType::value()
-{
- return QVariant(rect);
-}
-
-void QmlRectFValueType::setValue(QVariant value)
-{
- rect = qvariant_cast<QRectF>(value);
-}
-
-qreal QmlRectFValueType::x() const
-{
- return rect.x();
-}
-
-qreal QmlRectFValueType::y() const
-{
- return rect.y();
-}
-
-void QmlRectFValueType::setX(qreal x)
-{
- rect.moveLeft(x);
-}
-
-void QmlRectFValueType::setY(qreal y)
-{
- rect.moveTop(y);
-}
-
-qreal QmlRectFValueType::width() const
-{
- return rect.width();
-}
-
-qreal QmlRectFValueType::height() const
-{
- return rect.height();
-}
-
-void QmlRectFValueType::setWidth(qreal w)
-{
- rect.setWidth(w);
-}
-
-void QmlRectFValueType::setHeight(qreal h)
-{
- rect.setHeight(h);
-}
-
-QmlRectValueType::QmlRectValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlRectValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &rect, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlRectValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &rect, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlRectValueType::value()
-{
- return QVariant(rect);
-}
-
-void QmlRectValueType::setValue(QVariant value)
-{
- rect = qvariant_cast<QRect>(value);
-}
-
-int QmlRectValueType::x() const
-{
- return rect.x();
-}
-
-int QmlRectValueType::y() const
-{
- return rect.y();
-}
-
-void QmlRectValueType::setX(int x)
-{
- rect.moveLeft(x);
-}
-
-void QmlRectValueType::setY(int y)
-{
- rect.moveTop(y);
-}
-
-int QmlRectValueType::width() const
-{
- return rect.width();
-}
-
-int QmlRectValueType::height() const
-{
- return rect.height();
-}
-
-void QmlRectValueType::setWidth(int w)
-{
- rect.setWidth(w);
-}
-
-void QmlRectValueType::setHeight(int h)
-{
- rect.setHeight(h);
-}
-
-QmlVector3DValueType::QmlVector3DValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlVector3DValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &vector, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlVector3DValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &vector, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlVector3DValueType::value()
-{
- return QVariant(vector);
-}
-
-void QmlVector3DValueType::setValue(QVariant value)
-{
- vector = qvariant_cast<QVector3D>(value);
-}
-
-qreal QmlVector3DValueType::x() const
-{
- return vector.x();
-}
-
-qreal QmlVector3DValueType::y() const
-{
- return vector.y();
-}
-
-qreal QmlVector3DValueType::z() const
-{
- return vector.z();
-}
-
-void QmlVector3DValueType::setX(qreal x)
-{
- vector.setX(x);
-}
-
-void QmlVector3DValueType::setY(qreal y)
-{
- vector.setY(y);
-}
-
-void QmlVector3DValueType::setZ(qreal z)
-{
- vector.setZ(z);
-}
-
-QmlEasingValueType::QmlEasingValueType(QObject *parent)
-: QmlValueType(parent)
-{
-}
-
-void QmlEasingValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &easing, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlEasingValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &easing, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlEasingValueType::value()
-{
- return QVariant(easing);
-}
-
-void QmlEasingValueType::setValue(QVariant value)
-{
- easing = qvariant_cast<QEasingCurve>(value);
-}
-
-QmlEasingValueType::Type QmlEasingValueType::type() const
-{
- return (QmlEasingValueType::Type)easing.type();
-}
-
-qreal QmlEasingValueType::amplitude() const
-{
- return easing.amplitude();
-}
-
-qreal QmlEasingValueType::overshoot() const
-{
- return easing.overshoot();
-}
-
-qreal QmlEasingValueType::period() const
-{
- return easing.period();
-}
-
-void QmlEasingValueType::setType(QmlEasingValueType::Type type)
-{
- easing.setType((QEasingCurve::Type)type);
-}
-
-void QmlEasingValueType::setAmplitude(qreal amplitude)
-{
- easing.setAmplitude(amplitude);
-}
-
-void QmlEasingValueType::setOvershoot(qreal overshoot)
-{
- easing.setOvershoot(overshoot);
-}
-
-void QmlEasingValueType::setPeriod(qreal period)
-{
- easing.setPeriod(period);
-}
-
-QmlFontValueType::QmlFontValueType(QObject *parent)
-: QmlValueType(parent), hasPixelSize(false)
-{
-}
-
-void QmlFontValueType::read(QObject *obj, int idx)
-{
- void *a[] = { &font, 0 };
- QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a);
-}
-
-void QmlFontValueType::write(QObject *obj, int idx, QmlMetaProperty::WriteFlags flags)
-{
- int status = -1;
- void *a[] = { &font, 0, &status, &flags };
- QMetaObject::metacall(obj, QMetaObject::WriteProperty, idx, a);
-}
-
-QVariant QmlFontValueType::value()
-{
- return QVariant(font);
-}
-
-void QmlFontValueType::setValue(QVariant value)
-{
- font = qvariant_cast<QFont>(value);
-}
-
-
-QString QmlFontValueType::family() const
-{
- return font.family();
-}
-
-void QmlFontValueType::setFamily(const QString &family)
-{
- font.setFamily(family);
-}
-
-bool QmlFontValueType::bold() const
-{
- return font.bold();
-}
-
-void QmlFontValueType::setBold(bool b)
-{
- font.setBold(b);
-}
-
-QmlFontValueType::FontWeight QmlFontValueType::weight() const
-{
- return (QmlFontValueType::FontWeight)font.weight();
-}
-
-void QmlFontValueType::setWeight(QmlFontValueType::FontWeight w)
-{
- font.setWeight((QFont::Weight)w);
-}
-
-bool QmlFontValueType::italic() const
-{
- return font.italic();
-}
-
-void QmlFontValueType::setItalic(bool b)
-{
- font.setItalic(b);
-}
-
-bool QmlFontValueType::underline() const
-{
- return font.underline();
-}
-
-void QmlFontValueType::setUnderline(bool b)
-{
- font.setUnderline(b);
-}
-
-bool QmlFontValueType::overline() const
-{
- return font.overline();
-}
-
-void QmlFontValueType::setOverline(bool b)
-{
- font.setOverline(b);
-}
-
-bool QmlFontValueType::strikeout() const
-{
- return font.strikeOut();
-}
-
-void QmlFontValueType::setStrikeout(bool b)
-{
- font.setStrikeOut(b);
-}
-
-qreal QmlFontValueType::pointSize() const
-{
- return font.pointSizeF();
-}
-
-void QmlFontValueType::setPointSize(qreal size)
-{
- if (hasPixelSize) {
- qWarning() << "Both point size and pixel size set. Using pixel size.";
- return;
- }
-
- if (size >= 0.0)
- font.setPointSizeF(size);
-}
-
-int QmlFontValueType::pixelSize() const
-{
- return font.pixelSize();
-}
-
-void QmlFontValueType::setPixelSize(int size)
-{
- if (size >=0) {
- font.setPixelSize(size);
- hasPixelSize = true;
- } else {
- hasPixelSize = false;
- }
-}
-
-QmlFontValueType::Capitalization QmlFontValueType::capitalization() const
-{
- return (QmlFontValueType::Capitalization)font.capitalization();
-}
-
-void QmlFontValueType::setCapitalization(QmlFontValueType::Capitalization c)
-{
- font.setCapitalization((QFont::Capitalization)c);
-}
-
-qreal QmlFontValueType::letterSpacing() const
-{
- return font.letterSpacing();
-}
-
-void QmlFontValueType::setLetterSpacing(qreal size)
-{
- font.setLetterSpacing(QFont::PercentageSpacing, size);
-}
-
-qreal QmlFontValueType::wordSpacing() const
-{
- return font.wordSpacing();
-}
-
-void QmlFontValueType::setWordSpacing(qreal size)
-{
- font.setWordSpacing(size);
-}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/qml/rewriter/rewriter.cpp b/src/declarative/qml/rewriter/rewriter.cpp
index f848936..b458a8d 100644
--- a/src/declarative/qml/rewriter/rewriter.cpp
+++ b/src/declarative/qml/rewriter/rewriter.cpp
@@ -41,11 +41,11 @@
#include "rewriter_p.h"
-#include <qmljsast_p.h>
+#include <qdeclarativejsast_p.h>
QT_QML_BEGIN_NAMESPACE
-using namespace QmlJS;
+using namespace QDeclarativeJS;
void Rewriter::replace(const AST::SourceLocation &loc, const QString &text)
{ replace(loc.offset, loc.length, text); }
@@ -77,8 +77,8 @@ QString Rewriter::textAt(const AST::SourceLocation &loc) const
QString Rewriter::textAt(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc) const
{ return _code.mid(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset); }
-void Rewriter::accept(QmlJS::AST::Node *node)
-{ QmlJS::AST::Node::acceptChild(node, this); }
+void Rewriter::accept(QDeclarativeJS::AST::Node *node)
+{ QDeclarativeJS::AST::Node::acceptChild(node, this); }
void Rewriter::moveTextBefore(const AST::SourceLocation &firstLoc,
const AST::SourceLocation &lastLoc,
diff --git a/src/declarative/qml/rewriter/rewriter_p.h b/src/declarative/qml/rewriter/rewriter_p.h
index 36e8df7..d1445d8 100644
--- a/src/declarative/qml/rewriter/rewriter_p.h
+++ b/src/declarative/qml/rewriter/rewriter_p.h
@@ -44,7 +44,7 @@
#include "textwriter_p.h"
-#include <qmljsastvisitor_p.h>
+#include <qdeclarativejsastvisitor_p.h>
#include <QtCore/QList>
#include <QtCore/QString>
@@ -52,7 +52,7 @@
QT_BEGIN_HEADER
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
////////////////////////////////////////////////////////////////////////////////
// Replacement
@@ -145,7 +145,7 @@ private:
QList<Replacement> _replacementList;
};
-} // end of namespace QmlJS
+} // end of namespace QDeclarativeJS
QT_QML_END_NAMESPACE
QT_END_HEADER
diff --git a/src/declarative/qml/rewriter/textwriter.cpp b/src/declarative/qml/rewriter/textwriter.cpp
index cd3f26a..e63d24c 100644
--- a/src/declarative/qml/rewriter/textwriter.cpp
+++ b/src/declarative/qml/rewriter/textwriter.cpp
@@ -43,7 +43,7 @@
QT_QML_BEGIN_NAMESPACE
-using namespace QmlJS;
+using namespace QDeclarativeJS;
TextWriter::TextWriter()
:string(0), cursor(0)
diff --git a/src/declarative/qml/rewriter/textwriter_p.h b/src/declarative/qml/rewriter/textwriter_p.h
index 43ef669..c712626 100644
--- a/src/declarative/qml/rewriter/textwriter_p.h
+++ b/src/declarative/qml/rewriter/textwriter_p.h
@@ -42,7 +42,7 @@
#ifndef TEXTWRITER_H
#define TEXTWRITER_H
-#include <qmljsglobal_p.h>
+#include <qdeclarativejsglobal_p.h>
#include <QtCore/QString>
#include <QtCore/QList>
@@ -51,7 +51,7 @@
QT_BEGIN_HEADER
QT_QML_BEGIN_NAMESPACE
-namespace QmlJS {
+namespace QDeclarativeJS {
class TextWriter
{
@@ -93,7 +93,7 @@ public:
};
-} // end of namespace QmlJS
+} // end of namespace QDeclarativeJS
QT_QML_END_NAMESPACE
QT_END_HEADER