From e7af6072770842b5a1f6151304961b86ca08c8f6 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 24 Jun 2009 13:41:00 +1000 Subject: Smooth-scale Big Image while static. --- demos/declarative/flickr/content/ImageDetails.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/demos/declarative/flickr/content/ImageDetails.qml b/demos/declarative/flickr/content/ImageDetails.qml index ccc91cb..ed60d17 100644 --- a/demos/declarative/flickr/content/ImageDetails.qml +++ b/demos/declarative/flickr/content/ImageDetails.qml @@ -89,6 +89,7 @@ Flipable { // Center image if it is smaller than the flickable area. x: ImageContainer.width > width*scale ? (ImageContainer.width - width*scale) / 2 : 0 y: ImageContainer.height > height*scale ? (ImageContainer.height - height*scale) / 2 : 0 + smooth: !Flick.moving onStatusChanged : { // Default scale shows the entire image. if (status == 0 && width != 0) { @@ -135,7 +136,19 @@ Flipable { transitions: [ Transition { - NumericAnimation { easing: "easeInOutQuad"; properties: "rotation"; duration: 500 } + SequentialAnimation { + SetPropertyAction { + target: BigImage + property: "smooth" + value: false + } + NumericAnimation { easing: "easeInOutQuad"; properties: "rotation"; duration: 500 } + SetPropertyAction { + target: BigImage + property: "smooth" + value: !Flick.moving + } + } } ] } -- cgit v0.12 From baea2c29340b14c6ec1f560a09627f23dd358363 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 2 Jul 2009 13:28:02 +1000 Subject: Smooth, but never anti-alias the edges of pixmaps that need to stitch.. Bug 256967 still stops it working correctly. --- src/declarative/fx/qfxpainteditem.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/declarative/fx/qfxpainteditem.cpp b/src/declarative/fx/qfxpainteditem.cpp index 65589f2..0a13dc4 100644 --- a/src/declarative/fx/qfxpainteditem.cpp +++ b/src/declarative/fx/qfxpainteditem.cpp @@ -232,10 +232,10 @@ void QFxPaintedItem::paintGLContents(GLPainter &p) #if defined(QFX_RENDER_QPAINTER) bool oldAntiAliasing = p.testRenderHint(QPainter::Antialiasing); bool oldSmoothPixmap = p.testRenderHint(QPainter::SmoothPixmapTransform); - if (d->smooth) { - p.setRenderHints(QPainter::Antialiasing, true); + if (oldAntiAliasing) + p.setRenderHints(QPainter::Antialiasing, false); // cannot stitch properly otherwise + if (d->smooth) p.setRenderHints(QPainter::SmoothPixmapTransform, true); - } QRectF clipf = p.clipRegion().boundingRect(); if (clipf.isEmpty()) clipf = mapToScene(content); // ### Inefficient: Maps toScene and then fromScene @@ -330,10 +330,10 @@ void QFxPaintedItem::paintGLContents(GLPainter &p) glDisableClientState(GL_TEXTURE_COORD_ARRAY); #endif #if defined(QFX_RENDER_QPAINTER) - if (d->smooth) { + if (oldAntiAliasing) p.setRenderHints(QPainter::Antialiasing, oldAntiAliasing); + if (d->smooth) p.setRenderHints(QPainter::SmoothPixmapTransform, oldSmoothPixmap); - } #endif } -- cgit v0.12 From ff4140013a993a90ae26cbd56e9d75760ec3e40d Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 2 Jul 2009 15:41:41 +1000 Subject: First conversion to new module handling. Works same as before for now, but now the variables and methods are all in the right place. In particular, type resolving is per-component, not per-engine, even though it is the engine that ultimately has the ability to find types, because each component will have a different set of available types. Designed to be optimizable - QmlEngine could share data between QmlEngine::Import objects, and the import objects could read types in bulk rather than always searching. --- src/declarative/fx/qfxitem.cpp | 2 +- src/declarative/fx/qfxwebview.cpp | 2 +- src/declarative/qml/qmlcomponent.cpp | 2 +- src/declarative/qml/qmlcompositetypemanager.cpp | 23 +-- src/declarative/qml/qmlcompositetypemanager_p.h | 5 +- src/declarative/qml/qmlcontext.cpp | 29 ---- src/declarative/qml/qmlcontext.h | 1 - src/declarative/qml/qmlengine.cpp | 202 +++++++++--------------- src/declarative/qml/qmlengine.h | 21 ++- src/declarative/qml/qmlengine_p.h | 1 - src/declarative/qml/qmlscriptparser.cpp | 16 +- src/declarative/qml/qmlscriptparser_p.h | 9 +- 12 files changed, 116 insertions(+), 197 deletions(-) diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 7ccad5f..b5c2c0e 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -1982,7 +1982,7 @@ void QFxItem::newChild(const QString &type) { Q_D(QFxItem); - QUrl url = qmlContext(this)->resolvedUri(QUrl(type)); + QUrl url = qmlContext(this)->resolvedUrl(QUrl(type)); if (url.isEmpty()) return; diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index 3ab64bc..c6a8ebf 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -1006,7 +1006,7 @@ QFxWebView *QFxWebPage::view() QObject *QFxWebPage::createPlugin(const QString &, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) { - QUrl comp = qmlContext(view())->resolvedUri(url); + QUrl comp = qmlContext(view())->resolvedUrl(url); return new QWidget_Dummy_Plugin(comp,view(),paramNames,paramValues); } diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 293082f..988d7c2 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -122,7 +122,7 @@ void QmlComponentPrivate::typeDataReady() void QmlComponentPrivate::fromTypeData(QmlCompositeTypeData *data) { - url = QUrl(data->url); + url = data->imports.baseUrl(); QmlCompiledComponent *c = data->toCompiledComponent(engine); if (!c) { diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index ef77803..1a67bf4 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -88,7 +88,7 @@ QmlComponent *QmlCompositeTypeData::toComponent(QmlEngine *engine) component = new QmlComponent(engine, cc, -1, -1, 0); } else { component = new QmlComponent(engine, 0); - component->d_func()->url = QUrl(url); + component->d_func()->url = imports.baseUrl(); component->d_func()->errors = errors; } @@ -103,8 +103,8 @@ QmlCompositeTypeData::toCompiledComponent(QmlEngine *engine) if (status == Complete && !compiledComponent) { compiledComponent = new QmlCompiledComponent; - compiledComponent->url = QUrl(url); - compiledComponent->name = url.toLatin1(); // ### + compiledComponent->url = imports.baseUrl(); + compiledComponent->name = compiledComponent->url.toString().toLatin1(); // ### QmlCompiler compiler; if (!compiler.compile(engine, this, compiledComponent)) { @@ -143,7 +143,7 @@ QmlCompositeTypeData *QmlCompositeTypeManager::get(const QUrl &url) if (!unit) { unit = new QmlCompositeTypeData; unit->status = QmlCompositeTypeData::Waiting; - unit->url = url.toString(); + unit->imports.setBaseUrl(url); components.insert(url.toString(), unit); loadSource(unit); @@ -158,7 +158,7 @@ QmlCompositeTypeManager::getImmediate(const QByteArray &data, const QUrl &url) { QmlCompositeTypeData *unit = new QmlCompositeTypeData; unit->status = QmlCompositeTypeData::Waiting; - unit->url = url.toString(); + unit->imports.setBaseUrl(url); setData(unit, data, url); return unit; } @@ -209,7 +209,7 @@ void QmlCompositeTypeManager::replyFinished() void QmlCompositeTypeManager::loadSource(QmlCompositeTypeData *unit) { - QUrl url(unit->url); + QUrl url(unit->imports.baseUrl()); if (url.scheme() == QLatin1String("file")) { @@ -250,8 +250,9 @@ void QmlCompositeTypeManager::setData(QmlCompositeTypeData *unit, doComplete(unit); } else { - - engine->addNameSpacePaths(unit->data.nameSpacePaths()); + foreach (QmlScriptParser::Import imp, unit->data.imports()) { + engine->addImport(&unit->imports, imp.uri, imp.prefix, imp.version_major, imp.version_minor); + } compile(unit); } @@ -319,13 +320,13 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit) continue; } - QUrl url = engine->componentUrl(QUrl(QLatin1String(type + ".qml")), QUrl(unit->url)); + QUrl url = engine->resolveType(unit->imports, QString(type)); QmlCompositeTypeData *urlUnit = components.value(url.toString()); if (!urlUnit) { urlUnit = new QmlCompositeTypeData; urlUnit->status = QmlCompositeTypeData::Waiting; - urlUnit->url = url.toString(); + urlUnit->imports.setBaseUrl(url); components.insert(url.toString(), urlUnit); loadSource(urlUnit); @@ -338,7 +339,7 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit) unit->status = QmlCompositeTypeData::Error; { QmlError error; - error.setUrl(QUrl(unit->url)); + error.setUrl(unit->imports.baseUrl()); error.setDescription(tr("Type %1 unavailable").arg(QLatin1String(type))); unit->errors << error; } diff --git a/src/declarative/qml/qmlcompositetypemanager_p.h b/src/declarative/qml/qmlcompositetypemanager_p.h index 96e77d6..a393da4 100644 --- a/src/declarative/qml/qmlcompositetypemanager_p.h +++ b/src/declarative/qml/qmlcompositetypemanager_p.h @@ -57,10 +57,10 @@ #include #include #include +#include QT_BEGIN_NAMESPACE -class QmlEngine; class QmlCompiledComponent; class QmlComponentPrivate; class QmlComponent; @@ -86,7 +86,8 @@ struct QmlCompositeTypeData : public QmlRefCount QList errors; - QString url; + QmlEngine::Imports imports; + QList dependants; // Return a QmlComponent if the QmlCompositeTypeData is not in the Waiting diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index e5016f2..60cb231 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -449,35 +449,6 @@ QUrl QmlContext::resolvedUrl(const QUrl &src) } /*! - Resolves the component URI \a src relative to the URL of the - containing component, and according to the - \l {QmlEngine::nameSpacePaths()} {namespace paths} of the - context's engine, returning the resolved URL. - - \sa QmlEngine::componentUrl(), setBaseUrl() -*/ -QUrl QmlContext::resolvedUri(const QUrl &src) -{ - QmlContext *ctxt = this; - if (src.isRelative()) { - if (ctxt) { - while(ctxt) { - if (ctxt->d_func()->url.isValid()) - break; - else - ctxt = ctxt->parentContext(); - } - - if (ctxt) - return ctxt->d_func()->engine->componentUrl(src, ctxt->d_func()->url); - } - return QUrl(); - } else { - return ctxt->d_func()->engine->componentUrl(src, QUrl()); - } -} - -/*! Explicitly sets the url both resolveUri() and resolveUrl() will use for relative references to \a baseUrl. diff --git a/src/declarative/qml/qmlcontext.h b/src/declarative/qml/qmlcontext.h index ce5fe52..44d8caa 100644 --- a/src/declarative/qml/qmlcontext.h +++ b/src/declarative/qml/qmlcontext.h @@ -77,7 +77,6 @@ public: static QmlContext *activeContext(); - QUrl resolvedUri(const QUrl &); QUrl resolvedUrl(const QUrl &); void setBaseUrl(const QUrl &); diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index d645fb3..dc33b38 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -483,132 +483,6 @@ QmlContext *QmlEngine::activeContext() } /*! - Sets the mappings from namespace URIs to URL to \a map. - - \sa nameSpacePaths() -*/ -void QmlEngine::setNameSpacePaths(const QMap& map) -{ - Q_D(QmlEngine); - d->nameSpacePaths = map; -} - -/*! - Adds mappings (given by \a map) from namespace URIs to URL. - - \sa nameSpacePaths() -*/ -void QmlEngine::addNameSpacePaths(const QMap& map) -{ - Q_D(QmlEngine); - d->nameSpacePaths.unite(map); -} - -/*! - Adds a mapping from namespace URI \a ns to URL \a path. - - \sa nameSpacePaths() -*/ -void QmlEngine::addNameSpacePath(const QString& ns, const QString& path) -{ - Q_D(QmlEngine); - d->nameSpacePaths.insertMulti(ns,path); -} - -/*! - Returns the mapping from namespace URIs to URLs. - - Currently, only the empty namespace is supported - (i.e. types cannot be qualified with a namespace). - - The QML \c import statement can be used to import a directory of - components into the empty namespace. - - \qml - import "MyModuleDirectory" - \endqml - - This is also possible from C++: - - \code - engine->addNameSpacePath("","file:///opt/abcdef"); - \endcode - - \sa componentUrl() -*/ -QMap QmlEngine::nameSpacePaths() const -{ - Q_D(const QmlEngine); - return d->nameSpacePaths; -} - -/*! - Returns the URL for the component source \a src, as mapped - by the nameSpacePaths(), resolved relative to \a baseUrl. - - \sa nameSpacePaths() -*/ -QUrl QmlEngine::componentUrl(const QUrl& src, const QUrl& baseUrl) const -{ - Q_D(const QmlEngine); - - // Find the most-specific namespace matching src. - // For files, multiple paths can be given, the first found is used. - QUrl r; - QMap::const_iterator i = d->nameSpacePaths.constBegin(); - QString rns=QLatin1String(":"); // ns of r, if file found, initial an imposible namespace - QString srcstring = src.toString(); - while (i != d->nameSpacePaths.constEnd()) { - QString ns = i.key(); - QString path = i.value(); - if (ns != rns) { - if (srcstring.startsWith(ns) && (ns.length()==0 || srcstring[ns.length()]==QLatin1Char('/'))) { - QString file = ns.length()==0 ? srcstring : srcstring.mid(ns.length()+1); - QUrl cr = baseUrl.resolved(QUrl(path + QLatin1String("/") + file)); - QString lf = cr.toLocalFile(); - if (lf.isEmpty() || QFile::exists(lf)) { - r = cr; - rns = ns; - } - } - } - ++i; - } - if (r.isEmpty()) - r = baseUrl.resolved(src); - return r; -} - -/*! - Returns the list of base urls the engine browses to find sub-components. - - The search path consists of the base of the \a url, and, in the case of local files, - the directories imported using the "import" statement in \a qml. - */ -QList QmlEngine::componentSearchPath(const QByteArray &qml, const QUrl &url) const -{ - QList searchPath; - - searchPath << url.resolved(QUrl(QLatin1String("."))); - - if (QFileInfo(url.toLocalFile()).exists()) { - QmlScriptParser parser; - if (parser.parse(qml, url)) { - for (int i = 0; i < parser.imports().size(); ++i) { - QUrl importUrl = QUrl(parser.imports().at(i).uri); - if (importUrl.isRelative()) { - searchPath << url.resolved(importUrl); - } else { - searchPath << importUrl; - } - } - } - } - - return searchPath; -} - -/*! Sets the common QNetworkAccessManager, \a network, used by all QML elements instantiated by this engine. @@ -1700,4 +1574,80 @@ void QmlExpressionLog::setResult(const QVariant &r) m_result = r; } +class QmlImportsPrivate { +public: + void add(const QString& uri, const QString& prefix, int version_major, int version_minor) + { + TypeSet *s = set.value(prefix); + if (!s) + set.insert(prefix,(s=new TypeSet)); + QString url = uri; + s->urls.append(url); + s->vmaj.append(version_major); + s->vmin.append(version_minor); + } + + QUrl find(const QString& base, const QString& type) + { + TypeSet *s = 0; + int dot = type.indexOf(QLatin1Char('.')); + if (dot >= 0) { + while (!s) { + s = set.value(type.left(dot)); + int ndot = type.indexOf(QLatin1Char('.'),dot+1); + if (ndot > 0) + dot = ndot; + else + break; + } + } else { + s = set.value(""); + } + QString unqtype = type.mid(dot+1); + QUrl baseUrl(base); + if (s) { + for (int i=0; iurls.count(); ++i) { + QUrl url = baseUrl.resolved(QUrl(s->urls.at(i) +"/"+ unqtype + QLatin1String(".qml"))); + // XXX search non-files too! (eg. zip files, see QT-524) + QFileInfo f(url.toLocalFile()); + if (f.exists()) + return url; + } + } + return baseUrl.resolved(QUrl(type + QLatin1String(".qml"))); + } + +private: + struct TypeSet { + QStringList urls; + QList vmaj; + QList vmin; + }; + QHash set; +}; + +QmlEngine::Imports::Imports() : + d(new QmlImportsPrivate) +{ +} + +QmlEngine::Imports::~Imports() +{ +} + +void QmlEngine::Imports::setBaseUrl(const QUrl& url) +{ + base = url; +} + +void QmlEngine::addImport(Imports* imports, const QString& uri, const QString& prefix, int version_major, int version_minor) const +{ + imports->d->add(uri,prefix,version_major,version_minor); +} + +QUrl QmlEngine::resolveType(const Imports& imports, const QString& type) const +{ + return imports.d->find(imports.base,type); +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h index f114379..b74ad21 100644 --- a/src/declarative/qml/qmlengine.h +++ b/src/declarative/qml/qmlengine.h @@ -42,6 +42,7 @@ #ifndef QMLENGINE_H #define QMLENGINE_H +#include #include #include #include @@ -54,6 +55,7 @@ QT_MODULE(Declarative) class QmlComponent; class QmlEnginePrivate; +class QmlImportsPrivate; class QmlExpression; class QmlContext; class QUrl; @@ -74,13 +76,18 @@ public: void clearComponentCache(); - void setNameSpacePaths(const QMap& map); - void addNameSpacePaths(const QMap& map); - void addNameSpacePath(const QString&,const QString&); - QMap nameSpacePaths() const; - QUrl componentUrl(const QUrl& src, const QUrl& baseUrl) const; - - QList componentSearchPath(const QByteArray &qml, const QUrl &url) const; + struct Imports { + Imports(); + ~Imports(); + void setBaseUrl(const QUrl& url); + QUrl baseUrl() const { return base; } + private: + friend class QmlEngine; + QUrl base; + QmlImportsPrivate *d; + }; + void addImport(Imports*, const QString& uri, const QString& prefix, int version_major, int version_minor) const; + QUrl resolveType(const Imports&, const QString& type) const; void setNetworkAccessManager(QNetworkAccessManager *); QNetworkAccessManager *networkAccessManager() const; diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 93ae704..ca65e3e 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -161,7 +161,6 @@ public: mutable QNetworkAccessManager *networkAccessManager; QmlCompositeTypeManager typeManager; - QMap nameSpacePaths; mutable quint32 uniqueId; quint32 getUniqueId() const { diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 7475943..4358a3e 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -463,7 +463,6 @@ bool ProcessAST::visit(AST::UiProgram *node) bool ProcessAST::visit(AST::UiImport *node) { QString fileName = node->fileName->asString(); - _parser->addNamespacePath(fileName); AST::SourceLocation startLoc = node->importToken; AST::SourceLocation endLoc = node->semicolonToken; @@ -471,6 +470,10 @@ bool ProcessAST::visit(AST::UiImport *node) QmlScriptParser::Import import; import.location = location(startLoc, endLoc); import.uri = fileName; + // XXX not used yet... + import.prefix = ""; + import.version_major = 0; + import.version_minor = 0; _parser->_imports << import; @@ -836,11 +839,6 @@ bool QmlScriptParser::parse(const QByteArray &qmldata, const QUrl &url) return _errors.isEmpty(); } -QMap QmlScriptParser::nameSpacePaths() const -{ - return _nameSpacePaths; -} - QStringList QmlScriptParser::types() const { return _typeNames; @@ -867,7 +865,6 @@ void QmlScriptParser::clear() root->release(); root = 0; } - _nameSpacePaths.clear(); _typeNames.clear(); _errors.clear(); @@ -896,9 +893,4 @@ void QmlScriptParser::setTree(Object *tree) root = tree; } -void QmlScriptParser::addNamespacePath(const QString &path) -{ - _nameSpacePaths.insertMulti(QString(), path); -} - QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h index a4cbd82..05e70a5 100644 --- a/src/declarative/qml/qmlscriptparser_p.h +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -72,9 +72,12 @@ public: class Import { public: - Import() {} + Import() : version_major(0), version_minor(0) {} QString uri; + QString prefix; + int version_major; + int version_minor; QmlParser::LocationSpan location; }; @@ -83,7 +86,6 @@ public: bool parse(const QByteArray &data, const QUrl &url = QUrl()); - QMap nameSpacePaths() const; QStringList types() const; QmlParser::Object *tree() const; @@ -100,12 +102,9 @@ public: void setScriptFile(const QString &filename) {_scriptFile = filename; } QString scriptFile() const { return _scriptFile; } - void addNamespacePath(const QString &path); - // ### private: QList _errors; - QMap _nameSpacePaths; QmlParser::Object *root; QList _imports; QStringList _typeNames; -- cgit v0.12 From b4ec836efcb36313222e0d758f609439509cf5ba Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 2 Jul 2009 16:48:08 +1000 Subject: New module handling: allow "import" of built-in types. This will allow, for example, a different set of types to be imported for "import Qt 4.6" than for "import Qt 4.7". --- src/declarative/qml/qmlcompositetypemanager.cpp | 2 +- src/declarative/qml/qmlengine.cpp | 51 ++++++++++++++++++++++--- src/declarative/qml/qmlengine.h | 2 + src/declarative/qml/qmlmetatype.cpp | 4 +- 4 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index 1a67bf4..1c29b97 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -314,7 +314,7 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit) continue; } - ref.type = QmlMetaType::qmlType(type); + ref.type = engine->resolveBuiltInType(unit->imports, type); if (ref.type) { unit->types << ref; continue; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index dc33b38..fcbda95 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1578,9 +1578,14 @@ class QmlImportsPrivate { public: void add(const QString& uri, const QString& prefix, int version_major, int version_minor) { - TypeSet *s = set.value(prefix); - if (!s) - set.insert(prefix,(s=new TypeSet)); + TypeSet *s; + if (prefix.isEmpty()) { + s = &unqualifiedset; + } else { + s = set.value(prefix); + if (!s) + set.insert(prefix,(s=new TypeSet)); + } QString url = uri; s->urls.append(url); s->vmaj.append(version_major); @@ -1601,13 +1606,13 @@ public: break; } } else { - s = set.value(""); + s = &unqualifiedset; } - QString unqtype = type.mid(dot+1); + QString unqualifiedtype = type.mid(dot+1); QUrl baseUrl(base); if (s) { for (int i=0; iurls.count(); ++i) { - QUrl url = baseUrl.resolved(QUrl(s->urls.at(i) +"/"+ unqtype + QLatin1String(".qml"))); + QUrl url = baseUrl.resolved(QUrl(s->urls.at(i) +QLatin1String("/")+ unqualifiedtype + QLatin1String(".qml"))); // XXX search non-files too! (eg. zip files, see QT-524) QFileInfo f(url.toLocalFile()); if (f.exists()) @@ -1617,12 +1622,40 @@ public: return baseUrl.resolved(QUrl(type + QLatin1String(".qml"))); } + QmlType *findBuiltin(const QString& base, const QByteArray& type) + { + // XXX import only have one space of imports! + TypeSet *s = 0; + int dot = type.indexOf('.'); + if (dot >= 0) { + while (!s) { + s = set.value(QString::fromLatin1(type.left(dot))); + int ndot = type.indexOf('.',dot+1); + if (ndot > 0) + dot = ndot; + else + break; + } + } else { + s = &unqualifiedset; + } + QByteArray unqualifiedtype = dot < 0 ? type : type.mid(dot+1); // common-case opt (QString::mid works fine, but slower) + if (s) { + for (int i=0; iurls.count(); ++i) { + QmlType *t = QmlMetaType::qmlType(s->urls.at(i).toLatin1()+"/"+unqualifiedtype); + if (t) return t; + } + } + return QmlMetaType::qmlType(type); + } + private: struct TypeSet { QStringList urls; QList vmaj; QList vmin; }; + TypeSet unqualifiedset; QHash set; }; @@ -1650,4 +1683,10 @@ QUrl QmlEngine::resolveType(const Imports& imports, const QString& type) const return imports.d->find(imports.base,type); } +QmlType* QmlEngine::resolveBuiltInType(const Imports& imports, const QByteArray& type) const +{ + return imports.d->findBuiltin(imports.base,type); +} + + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h index b74ad21..a07ea96 100644 --- a/src/declarative/qml/qmlengine.h +++ b/src/declarative/qml/qmlengine.h @@ -58,6 +58,7 @@ class QmlEnginePrivate; class QmlImportsPrivate; class QmlExpression; class QmlContext; +class QmlType; class QUrl; class QScriptEngine; class QScriptContext; @@ -88,6 +89,7 @@ public: }; void addImport(Imports*, const QString& uri, const QString& prefix, int version_major, int version_minor) const; QUrl resolveType(const Imports&, const QString& type) const; + QmlType* resolveBuiltInType(const Imports& imports, const QByteArray& type) const; void setNetworkAccessManager(QNetworkAccessManager *); QNetworkAccessManager *networkAccessManager() const; diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp index b15f711..e6c7376 100644 --- a/src/declarative/qml/qmlmetatype.cpp +++ b/src/declarative/qml/qmlmetatype.cpp @@ -423,8 +423,10 @@ int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Fun QmlMetaTypeData *data = metaTypeData(); QString name = QLatin1String(cname); + for (int ii = 0; ii < name.count(); ++ii) { - if (!name.at(ii).isLetterOrNumber()) { + QChar ch = name.at(ii); + if (!ch.isLetterOrNumber() && ch != QChar::fromLatin1('/')) { qWarning("QmlMetaType: Invalid QML name %s", cname); return -1; } -- cgit v0.12 From 1b4c6795c628d4d76ff846977fdc4396ad5d9bda Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 9 Jul 2009 16:59:08 +1000 Subject: URL can convert from string or bytearray. --- src/declarative/qml/qmlbindablevalue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index f447d4f..ef9eb55 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -152,7 +152,7 @@ void QmlBindableValue::update() } if (d->property.propertyType() == QVariant::Url && - value.canConvert(QVariant::String) && !value.isNull()) + (value.type() == QVariant::String || value.type() == QVariant::ByteArray) && !value.isNull()) value.setValue(context()->resolvedUrl(QUrl(value.toString()))); d->property.write(value); -- cgit v0.12 From 888f57107e698731c4a1dd2c46745c6293b2222e Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 9 Jul 2009 17:00:07 +1000 Subject: Allow relative URLs --- src/declarative/util/qmlscript.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index ab095b1..f8cbf96 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -148,9 +148,8 @@ void QmlScript::setSource(const QUrl &source) Q_D(QmlScript); if (d->url == source) return; - d->url = source; - Q_ASSERT(!source.isRelative()); - + d->url = qmlContext(this)->resolvedUrl(source); + #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML if (d->url.scheme() == QLatin1String("file")) { QFile file(d->url.toLocalFile()); -- cgit v0.12 From 7167e868ef96482604a006f957bf608ab6baca95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Mon, 13 Jul 2009 14:40:15 +0200 Subject: Compile. --- src/declarative/util/qfxview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index 103442c..41f7db2 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -60,7 +60,7 @@ #include "qfxview.h" #include #include -#include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 961f765440aee37ee129172a97e681808b2c7928 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 14 Jul 2009 10:06:15 +1000 Subject: Add access to Qt palettes from QML. --- src/declarative/util/qmlpalette.cpp | 163 ++++++++++++++++++++++++++++++++++++ src/declarative/util/qmlpalette.h | 111 ++++++++++++++++++++++++ src/declarative/util/util.pri | 2 + tools/qmlviewer/qmlviewer.cpp | 25 ++++++ tools/qmlviewer/qmlviewer.h | 5 ++ 5 files changed, 306 insertions(+) create mode 100644 src/declarative/util/qmlpalette.cpp create mode 100644 src/declarative/util/qmlpalette.h diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp new file mode 100644 index 0000000..670966d --- /dev/null +++ b/src/declarative/util/qmlpalette.cpp @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "private/qobject_p.h" +#include "qmlpalette.h" + +QT_BEGIN_NAMESPACE + +class QmlPalettePrivate : public QObjectPrivate +{ +public: + QPalette palette; + QPalette::ColorGroup group; +}; + +QML_DEFINE_TYPE(QmlPalette,Palette) + +/*! + \internal + \class QmlPalette + \ingroup group_utility + \brief The QmlPalette class gives access to the Qt palettes. +*/ +QmlPalette::QmlPalette(QObject *parent) + : QObject(*(new QmlPalettePrivate), parent) +{ + Q_D(QmlPalette); + d->group = QPalette::Active; +} + +QmlPalette::~QmlPalette() +{ +} + +QColor QmlPalette::window() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Window); +} + +QColor QmlPalette::windowText() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::WindowText); +} + +QColor QmlPalette::base() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Base); +} + +QColor QmlPalette::alternateBase() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::AlternateBase); +} + +QColor QmlPalette::button() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Button); +} + +QColor QmlPalette::buttonText() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::ButtonText); +} + +QColor QmlPalette::light() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Light); +} + +QColor QmlPalette::midlight() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Midlight); +} + +QColor QmlPalette::dark() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Dark); +} + +QColor QmlPalette::mid() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Mid); +} + +QColor QmlPalette::shadow() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Shadow); +} + +QColor QmlPalette::highlight() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Highlight); +} + +QColor QmlPalette::highlightedText() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::HighlightedText); +} + +void QmlPalette::setColorGroup(QPalette::ColorGroup colorGroup) +{ + Q_D(QmlPalette); + d->group = colorGroup; +} + +QPalette QmlPalette::palette() const +{ + Q_D(const QmlPalette); + return d->palette; +} + +QT_END_NAMESPACE diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h new file mode 100644 index 0000000..f176764 --- /dev/null +++ b/src/declarative/util/qmlpalette.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLPALETTE_H +#define QMLPALETTE_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlPalettePrivate; +class Q_DECLARATIVE_EXPORT QmlPalette : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPalette) + +public: + QmlPalette(QObject *parent=0); + ~QmlPalette(); + + Q_PROPERTY(QColor window READ window CONSTANT) + Q_PROPERTY(QColor windowText READ windowText CONSTANT) + Q_PROPERTY(QColor base READ base CONSTANT) + Q_PROPERTY(QColor alternateBase READ alternateBase CONSTANT) + Q_PROPERTY(QColor button READ button CONSTANT) + Q_PROPERTY(QColor buttonText READ buttonText CONSTANT) + Q_PROPERTY(QColor light READ light CONSTANT) + Q_PROPERTY(QColor midlight READ midlight CONSTANT) + Q_PROPERTY(QColor dark READ dark CONSTANT) + Q_PROPERTY(QColor mid READ mid CONSTANT) + Q_PROPERTY(QColor shadow READ shadow CONSTANT) + Q_PROPERTY(QColor highlight READ highlight CONSTANT) + Q_PROPERTY(QColor highlightedText READ highlightedText CONSTANT) + + QColor window() const; + QColor windowText() const; + + QColor base() const; + QColor alternateBase() const; + + QColor button() const; + QColor buttonText() const; + + QColor light() const; + QColor midlight() const; + QColor dark() const; + QColor mid() const; + QColor shadow() const; + + QColor highlight() const; + QColor highlightedText() const; + + QPalette palette() const; + + void setColorGroup(QPalette::ColorGroup); + +Q_SIGNALS: + void updated(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlPalette) + +QT_END_HEADER + +#endif // QMLPALETTE_H diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index aae10af..dcab10a 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -7,6 +7,7 @@ SOURCES += \ util/qmlscript.cpp \ util/qmlanimation.cpp \ util/qmlfont.cpp \ + util/qmlpalette.cpp \ util/qmlfollow.cpp \ util/qmlstate.cpp\ util/qmltransitionmanager.cpp \ @@ -31,6 +32,7 @@ HEADERS += \ util/qmlanimation.h \ util/qmlanimation_p.h \ util/qmlfont.h \ + util/qmlpalette.h \ util/qmlfollow.h \ util/qmlstate.h\ util/qmlstateoperations.h \ diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index db0dc18..b6ce619 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -17,6 +17,7 @@ #include "qmlviewer.h" #include #include +#include "qmlpalette.h" #include "qml.h" #include #include "qfxtestengine.h" @@ -133,6 +134,8 @@ QmlViewer::QmlViewer(QFxTestEngine::TestMode testMode, const QString &testDir, Q devicemode = false; skin = 0; canvas = 0; + palette = 0; + disabledPalette = 0; record_autotime = 0; record_period = 20; @@ -383,6 +386,7 @@ void QmlViewer::openQml(const QString& fileName) } } + setupPalettes(); canvas->setUrl(url); QTime t; @@ -407,6 +411,18 @@ void QmlViewer::openQml(const QString& fileName) #endif } +void QmlViewer:: setupPalettes() +{ + delete palette; + palette = new QmlPalette; + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("activePalette", palette); + + delete disabledPalette; + disabledPalette = new QmlPalette; + disabledPalette->setColorGroup(QPalette::Disabled); + ctxt->setContextProperty("disabledPalette", disabledPalette); +} void QmlViewer::setSkin(const QString& skinDirectory) { @@ -486,6 +502,15 @@ void QmlViewer::setRecordFile(const QString& f) record_file = f; } +bool QmlViewer::event(QEvent *event) +{ + if (event->type() == QEvent::PaletteChange) { + setupPalette(); + return true; + } + return QWidget::event(event); +} + void QmlViewer::setRecordPeriod(int ms) { record_period = ms; diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index c533fe0..765d42f 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -25,6 +25,7 @@ QT_BEGIN_NAMESPACE class QFxView; class PreviewDeviceSkin; class QFxTestEngine; +class QmlPalette; class QProcess; class QmlViewer : public QWidget @@ -61,6 +62,7 @@ public slots: protected: virtual void keyPressEvent(QKeyEvent *); virtual void timerEvent(QTimerEvent *); + virtual bool event(QEvent *event); void createMenu(QMenuBar *menu, QMenu *flatmenu); @@ -70,11 +72,14 @@ private slots: private: void setupProxy(); + void setupPalettes(); QString currentFileName; PreviewDeviceSkin *skin; QSize skinscreensize; QFxView *canvas; + QmlPalette *palette; + QmlPalette *disabledPalette; void init(QFxTestEngine::TestMode, const QString &, const QString& fileName); QBasicTimer recordTimer; QList frames; -- cgit v0.12 From 2ad297df799c74453607263a4d80724ae748eb4c Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 14 Jul 2009 10:30:27 +1000 Subject: typo --- tools/qmlviewer/qmlviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index b6ce619..6de1b97 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -505,7 +505,7 @@ void QmlViewer::setRecordFile(const QString& f) bool QmlViewer::event(QEvent *event) { if (event->type() == QEvent::PaletteChange) { - setupPalette(); + setupPalettes(); return true; } return QWidget::event(event); -- cgit v0.12 From aff53500dbfba0a3338f8ab649c754cce3569ede Mon Sep 17 00:00:00 2001 From: Damian Jansen Date: Tue, 14 Jul 2009 11:41:25 +1000 Subject: QmlBindContext was renamed to QmlContext, reflect in documentation Reviewed-by: Michael Brasser --- doc/src/declarative/binding.qdoc | 2 +- doc/src/declarative/qmlforcpp.qdoc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/declarative/binding.qdoc b/doc/src/declarative/binding.qdoc index 2920d51..e74e4b1 100644 --- a/doc/src/declarative/binding.qdoc +++ b/doc/src/declarative/binding.qdoc @@ -90,7 +90,7 @@ QFxView *view = new QFxView; view->setUrl("MyUI.qml"); MyScreen *screen = new MyScreen; -QmlBindContext *ctxt = view->rootContext(); +QmlContext *ctxt = view->rootContext(); ctxt->setContextProperty("screen", screen); view->execute(); diff --git a/doc/src/declarative/qmlforcpp.qdoc b/doc/src/declarative/qmlforcpp.qdoc index 38f5665..c0d1b7d 100644 --- a/doc/src/declarative/qmlforcpp.qdoc +++ b/doc/src/declarative/qmlforcpp.qdoc @@ -233,7 +233,7 @@ structures. Every expression is executed in a bind context, encapsulated by the - QmlBindContext C++ class. As covered in the class documentation, a + QmlContext C++ class. As covered in the class documentation, a bind context contains a map of names to values, and a list of default objects. When resolving a name, the name to value map is searched first. If the name cannot be found, the default object's are iterated in turn and @@ -331,7 +331,7 @@ } \endcode - To relate id's back to QmlBindContext, id's exist as properties on the + To relate id's back to QmlContext, id's exist as properties on the component context. Bind expressions can reference any object property. The QML bind engine -- cgit v0.12 From 3da921b6b33a12e8e665ee52536948ca9824b769 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 14 Jul 2009 10:06:15 +1000 Subject: Add access to Qt palettes from QML. --- src/declarative/util/qmlpalette.cpp | 163 ++++++++++++++++++++++++++++++++++++ src/declarative/util/qmlpalette.h | 111 ++++++++++++++++++++++++ src/declarative/util/util.pri | 2 + tools/qmlviewer/qmlviewer.cpp | 25 ++++++ tools/qmlviewer/qmlviewer.h | 5 ++ 5 files changed, 306 insertions(+) create mode 100644 src/declarative/util/qmlpalette.cpp create mode 100644 src/declarative/util/qmlpalette.h diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp new file mode 100644 index 0000000..670966d --- /dev/null +++ b/src/declarative/util/qmlpalette.cpp @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "private/qobject_p.h" +#include "qmlpalette.h" + +QT_BEGIN_NAMESPACE + +class QmlPalettePrivate : public QObjectPrivate +{ +public: + QPalette palette; + QPalette::ColorGroup group; +}; + +QML_DEFINE_TYPE(QmlPalette,Palette) + +/*! + \internal + \class QmlPalette + \ingroup group_utility + \brief The QmlPalette class gives access to the Qt palettes. +*/ +QmlPalette::QmlPalette(QObject *parent) + : QObject(*(new QmlPalettePrivate), parent) +{ + Q_D(QmlPalette); + d->group = QPalette::Active; +} + +QmlPalette::~QmlPalette() +{ +} + +QColor QmlPalette::window() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Window); +} + +QColor QmlPalette::windowText() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::WindowText); +} + +QColor QmlPalette::base() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Base); +} + +QColor QmlPalette::alternateBase() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::AlternateBase); +} + +QColor QmlPalette::button() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Button); +} + +QColor QmlPalette::buttonText() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::ButtonText); +} + +QColor QmlPalette::light() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Light); +} + +QColor QmlPalette::midlight() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Midlight); +} + +QColor QmlPalette::dark() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Dark); +} + +QColor QmlPalette::mid() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Mid); +} + +QColor QmlPalette::shadow() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Shadow); +} + +QColor QmlPalette::highlight() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::Highlight); +} + +QColor QmlPalette::highlightedText() const +{ + Q_D(const QmlPalette); + return d->palette.color(d->group, QPalette::HighlightedText); +} + +void QmlPalette::setColorGroup(QPalette::ColorGroup colorGroup) +{ + Q_D(QmlPalette); + d->group = colorGroup; +} + +QPalette QmlPalette::palette() const +{ + Q_D(const QmlPalette); + return d->palette; +} + +QT_END_NAMESPACE diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h new file mode 100644 index 0000000..f176764 --- /dev/null +++ b/src/declarative/util/qmlpalette.h @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLPALETTE_H +#define QMLPALETTE_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlPalettePrivate; +class Q_DECLARATIVE_EXPORT QmlPalette : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlPalette) + +public: + QmlPalette(QObject *parent=0); + ~QmlPalette(); + + Q_PROPERTY(QColor window READ window CONSTANT) + Q_PROPERTY(QColor windowText READ windowText CONSTANT) + Q_PROPERTY(QColor base READ base CONSTANT) + Q_PROPERTY(QColor alternateBase READ alternateBase CONSTANT) + Q_PROPERTY(QColor button READ button CONSTANT) + Q_PROPERTY(QColor buttonText READ buttonText CONSTANT) + Q_PROPERTY(QColor light READ light CONSTANT) + Q_PROPERTY(QColor midlight READ midlight CONSTANT) + Q_PROPERTY(QColor dark READ dark CONSTANT) + Q_PROPERTY(QColor mid READ mid CONSTANT) + Q_PROPERTY(QColor shadow READ shadow CONSTANT) + Q_PROPERTY(QColor highlight READ highlight CONSTANT) + Q_PROPERTY(QColor highlightedText READ highlightedText CONSTANT) + + QColor window() const; + QColor windowText() const; + + QColor base() const; + QColor alternateBase() const; + + QColor button() const; + QColor buttonText() const; + + QColor light() const; + QColor midlight() const; + QColor dark() const; + QColor mid() const; + QColor shadow() const; + + QColor highlight() const; + QColor highlightedText() const; + + QPalette palette() const; + + void setColorGroup(QPalette::ColorGroup); + +Q_SIGNALS: + void updated(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlPalette) + +QT_END_HEADER + +#endif // QMLPALETTE_H diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index aae10af..dcab10a 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -7,6 +7,7 @@ SOURCES += \ util/qmlscript.cpp \ util/qmlanimation.cpp \ util/qmlfont.cpp \ + util/qmlpalette.cpp \ util/qmlfollow.cpp \ util/qmlstate.cpp\ util/qmltransitionmanager.cpp \ @@ -31,6 +32,7 @@ HEADERS += \ util/qmlanimation.h \ util/qmlanimation_p.h \ util/qmlfont.h \ + util/qmlpalette.h \ util/qmlfollow.h \ util/qmlstate.h\ util/qmlstateoperations.h \ diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index db0dc18..b6ce619 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -17,6 +17,7 @@ #include "qmlviewer.h" #include #include +#include "qmlpalette.h" #include "qml.h" #include #include "qfxtestengine.h" @@ -133,6 +134,8 @@ QmlViewer::QmlViewer(QFxTestEngine::TestMode testMode, const QString &testDir, Q devicemode = false; skin = 0; canvas = 0; + palette = 0; + disabledPalette = 0; record_autotime = 0; record_period = 20; @@ -383,6 +386,7 @@ void QmlViewer::openQml(const QString& fileName) } } + setupPalettes(); canvas->setUrl(url); QTime t; @@ -407,6 +411,18 @@ void QmlViewer::openQml(const QString& fileName) #endif } +void QmlViewer:: setupPalettes() +{ + delete palette; + palette = new QmlPalette; + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("activePalette", palette); + + delete disabledPalette; + disabledPalette = new QmlPalette; + disabledPalette->setColorGroup(QPalette::Disabled); + ctxt->setContextProperty("disabledPalette", disabledPalette); +} void QmlViewer::setSkin(const QString& skinDirectory) { @@ -486,6 +502,15 @@ void QmlViewer::setRecordFile(const QString& f) record_file = f; } +bool QmlViewer::event(QEvent *event) +{ + if (event->type() == QEvent::PaletteChange) { + setupPalette(); + return true; + } + return QWidget::event(event); +} + void QmlViewer::setRecordPeriod(int ms) { record_period = ms; diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index c533fe0..765d42f 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -25,6 +25,7 @@ QT_BEGIN_NAMESPACE class QFxView; class PreviewDeviceSkin; class QFxTestEngine; +class QmlPalette; class QProcess; class QmlViewer : public QWidget @@ -61,6 +62,7 @@ public slots: protected: virtual void keyPressEvent(QKeyEvent *); virtual void timerEvent(QTimerEvent *); + virtual bool event(QEvent *event); void createMenu(QMenuBar *menu, QMenu *flatmenu); @@ -70,11 +72,14 @@ private slots: private: void setupProxy(); + void setupPalettes(); QString currentFileName; PreviewDeviceSkin *skin; QSize skinscreensize; QFxView *canvas; + QmlPalette *palette; + QmlPalette *disabledPalette; void init(QFxTestEngine::TestMode, const QString &, const QString& fileName); QBasicTimer recordTimer; QList frames; -- cgit v0.12 From cec154511676e937c65acad5dd1e15668f3b3966 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 13 Jul 2009 15:35:17 +1000 Subject: Rename classes --- src/declarative/debugger/qmldebug.cpp | 14 +++--- src/declarative/debugger/qmldebug.h | 4 +- src/declarative/debugger/qmldebugclient.cpp | 66 ++++++++++++++--------------- src/declarative/debugger/qmldebugclient.h | 28 ++++++------ tools/qmldebugger/canvasframerate.cpp | 12 +++--- tools/qmldebugger/canvasframerate.h | 4 +- tools/qmldebugger/canvasscene.cpp | 10 ++--- tools/qmldebugger/canvasscene.h | 8 ++-- tools/qmldebugger/engine.cpp | 2 +- tools/qmldebugger/engine.h | 4 +- tools/qmldebugger/main.cpp | 2 +- 11 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index 1808bba..8309ec6 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -3,10 +3,10 @@ #include #include -class QmlEngineDebugClient : public QmlDebugClientPlugin +class QmlEngineDebugClient : public QmlDebugClient { public: - QmlEngineDebugClient(QmlDebugClient *client, QmlEngineDebugPrivate *p); + QmlEngineDebugClient(QmlDebugConnection *client, QmlEngineDebugPrivate *p); protected: virtual void messageReceived(const QByteArray &); @@ -19,7 +19,7 @@ class QmlEngineDebugPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QmlEngineDebug) public: - QmlEngineDebugPrivate(QmlDebugClient *); + QmlEngineDebugPrivate(QmlDebugConnection *); void message(const QByteArray &); @@ -38,9 +38,9 @@ public: QHash objectQuery; }; -QmlEngineDebugClient::QmlEngineDebugClient(QmlDebugClient *client, +QmlEngineDebugClient::QmlEngineDebugClient(QmlDebugConnection *client, QmlEngineDebugPrivate *p) -: QmlDebugClientPlugin(QLatin1String("QmlEngine"), client), priv(p) +: QmlDebugClient(QLatin1String("QmlEngine"), client), priv(p) { setEnabled(true); } @@ -50,7 +50,7 @@ void QmlEngineDebugClient::messageReceived(const QByteArray &data) priv->message(data); } -QmlEngineDebugPrivate::QmlEngineDebugPrivate(QmlDebugClient *c) +QmlEngineDebugPrivate::QmlEngineDebugPrivate(QmlDebugConnection *c) : client(c, this), nextId(0) { } @@ -206,7 +206,7 @@ void QmlEngineDebugPrivate::message(const QByteArray &data) } } -QmlEngineDebug::QmlEngineDebug(QmlDebugClient *client, QObject *parent) +QmlEngineDebug::QmlEngineDebug(QmlDebugConnection *client, QObject *parent) : QObject(*(new QmlEngineDebugPrivate(client)), parent) { } diff --git a/src/declarative/debugger/qmldebug.h b/src/declarative/debugger/qmldebug.h index 52a5400..11e6b3e 100644 --- a/src/declarative/debugger/qmldebug.h +++ b/src/declarative/debugger/qmldebug.h @@ -5,7 +5,7 @@ #include #include -class QmlDebugClient; +class QmlDebugConnection; class QmlDebugWatch; class QmlDebugEnginesQuery; class QmlDebugRootContextQuery; @@ -20,7 +20,7 @@ class Q_DECLARATIVE_EXPORT QmlEngineDebug : public QObject { Q_OBJECT public: - QmlEngineDebug(QmlDebugClient *, QObject * = 0); + QmlEngineDebug(QmlDebugConnection *, QObject * = 0); QmlDebugWatch *addWatch(const QmlDebugPropertyReference &, QObject *parent = 0); diff --git a/src/declarative/debugger/qmldebugclient.cpp b/src/declarative/debugger/qmldebugclient.cpp index 562d87d..7c5c37b 100644 --- a/src/declarative/debugger/qmldebugclient.cpp +++ b/src/declarative/debugger/qmldebugclient.cpp @@ -47,22 +47,22 @@ QT_BEGIN_NAMESPACE -class QmlDebugClientPrivate : public QObject +class QmlDebugConnectionPrivate : public QObject { Q_OBJECT public: - QmlDebugClientPrivate(QmlDebugClient *c); - QmlDebugClient *q; + QmlDebugConnectionPrivate(QmlDebugConnection *c); + QmlDebugConnection *q; QPacketProtocol *protocol; QStringList enabled; - QHash plugins; + QHash plugins; public slots: void connected(); void readyRead(); }; -QmlDebugClientPrivate::QmlDebugClientPrivate(QmlDebugClient *c) +QmlDebugConnectionPrivate::QmlDebugConnectionPrivate(QmlDebugConnection *c) : QObject(c), q(c), protocol(0) { protocol = new QPacketProtocol(q, this); @@ -70,59 +70,59 @@ QmlDebugClientPrivate::QmlDebugClientPrivate(QmlDebugClient *c) QObject::connect(protocol, SIGNAL(readyRead()), this, SLOT(readyRead())); } -void QmlDebugClientPrivate::connected() +void QmlDebugConnectionPrivate::connected() { QPacket pack; pack << QString(QLatin1String("QmlDebugServer")) << enabled; protocol->send(pack); } -void QmlDebugClientPrivate::readyRead() +void QmlDebugConnectionPrivate::readyRead() { QPacket pack = protocol->read(); QString name; QByteArray message; pack >> name >> message; - QHash::Iterator iter = + QHash::Iterator iter = plugins.find(name); if (iter == plugins.end()) { - qWarning() << "QmlDebugClient: Message received for missing plugin" << name; + qWarning() << "QmlDebugConnection: Message received for missing plugin" << name; } else { (*iter)->messageReceived(message); } } -QmlDebugClient::QmlDebugClient(QObject *parent) -: QTcpSocket(parent), d(new QmlDebugClientPrivate(this)) +QmlDebugConnection::QmlDebugConnection(QObject *parent) +: QTcpSocket(parent), d(new QmlDebugConnectionPrivate(this)) { } -bool QmlDebugClient::isConnected() const +bool QmlDebugConnection::isConnected() const { return state() == ConnectedState; } -class QmlDebugClientPluginPrivate : public QObjectPrivate +class QmlDebugClientPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QmlDebugClientPlugin); + Q_DECLARE_PUBLIC(QmlDebugClient); public: - QmlDebugClientPluginPrivate(); + QmlDebugClientPrivate(); QString name; - QmlDebugClient *client; + QmlDebugConnection *client; bool enabled; }; -QmlDebugClientPluginPrivate::QmlDebugClientPluginPrivate() +QmlDebugClientPrivate::QmlDebugClientPrivate() : client(0), enabled(false) { } -QmlDebugClientPlugin::QmlDebugClientPlugin(const QString &name, - QmlDebugClient *parent) -: QObject(*(new QmlDebugClientPluginPrivate), parent) +QmlDebugClient::QmlDebugClient(const QString &name, + QmlDebugConnection *parent) +: QObject(*(new QmlDebugClientPrivate), parent) { - Q_D(QmlDebugClientPlugin); + Q_D(QmlDebugClient); d->name = name; d->client = parent; @@ -130,28 +130,28 @@ QmlDebugClientPlugin::QmlDebugClientPlugin(const QString &name, return; if (d->client->d->plugins.contains(name)) { - qWarning() << "QmlDebugClientPlugin: Conflicting plugin name" << name; + qWarning() << "QmlDebugClient: Conflicting plugin name" << name; d->client = 0; } else { d->client->d->plugins.insert(name, this); } } -QString QmlDebugClientPlugin::name() const +QString QmlDebugClient::name() const { - Q_D(const QmlDebugClientPlugin); + Q_D(const QmlDebugClient); return d->name; } -bool QmlDebugClientPlugin::isEnabled() const +bool QmlDebugClient::isEnabled() const { - Q_D(const QmlDebugClientPlugin); + Q_D(const QmlDebugClient); return d->enabled; } -void QmlDebugClientPlugin::setEnabled(bool e) +void QmlDebugClient::setEnabled(bool e) { - Q_D(QmlDebugClientPlugin); + Q_D(QmlDebugClient); if (e == d->enabled) return; @@ -174,16 +174,16 @@ void QmlDebugClientPlugin::setEnabled(bool e) } } -bool QmlDebugClientPlugin::isConnected() const +bool QmlDebugClient::isConnected() const { - Q_D(const QmlDebugClientPlugin); + Q_D(const QmlDebugClient); return d->client->isConnected(); } -void QmlDebugClientPlugin::sendMessage(const QByteArray &message) +void QmlDebugClient::sendMessage(const QByteArray &message) { - Q_D(QmlDebugClientPlugin); + Q_D(QmlDebugClient); if (!d->client || !d->client->isConnected()) return; @@ -193,7 +193,7 @@ void QmlDebugClientPlugin::sendMessage(const QByteArray &message) d->client->d->protocol->send(pack); } -void QmlDebugClientPlugin::messageReceived(const QByteArray &) +void QmlDebugClient::messageReceived(const QByteArray &) { } diff --git a/src/declarative/debugger/qmldebugclient.h b/src/declarative/debugger/qmldebugclient.h index 194e913..6397670 100644 --- a/src/declarative/debugger/qmldebugclient.h +++ b/src/declarative/debugger/qmldebugclient.h @@ -50,30 +50,30 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QmlDebugClientPrivate; -class Q_DECLARATIVE_EXPORT QmlDebugClient : public QTcpSocket +class QmlDebugConnectionPrivate; +class Q_DECLARATIVE_EXPORT QmlDebugConnection : public QTcpSocket { Q_OBJECT - Q_DISABLE_COPY(QmlDebugClient) + Q_DISABLE_COPY(QmlDebugConnection) public: - QmlDebugClient(QObject * = 0); + QmlDebugConnection(QObject * = 0); bool isConnected() const; private: - QmlDebugClientPrivate *d; - friend class QmlDebugClientPlugin; - friend class QmlDebugClientPluginPrivate; + QmlDebugConnectionPrivate *d; + friend class QmlDebugClient; + friend class QmlDebugClientPrivate; }; -class QmlDebugClientPluginPrivate; -class Q_DECLARATIVE_EXPORT QmlDebugClientPlugin : public QObject +class QmlDebugClientPrivate; +class Q_DECLARATIVE_EXPORT QmlDebugClient : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(QmlDebugClientPlugin) - Q_DISABLE_COPY(QmlDebugClientPlugin) + Q_DECLARE_PRIVATE(QmlDebugClient) + Q_DISABLE_COPY(QmlDebugClient) public: - QmlDebugClientPlugin(const QString &, QmlDebugClient *parent); + QmlDebugClient(const QString &, QmlDebugConnection *parent); QString name() const; @@ -88,8 +88,8 @@ protected: virtual void messageReceived(const QByteArray &); private: - friend class QmlDebugClient; - friend class QmlDebugClientPrivate; + friend class QmlDebugConnection; + friend class QmlDebugConnectionPrivate; }; QT_END_NAMESPACE diff --git a/tools/qmldebugger/canvasframerate.cpp b/tools/qmldebugger/canvasframerate.cpp index f2a813d..d0be579 100644 --- a/tools/qmldebugger/canvasframerate.cpp +++ b/tools/qmldebugger/canvasframerate.cpp @@ -209,11 +209,11 @@ void QLineGraph::paintEvent(QPaintEvent *) drawTime(&p, r); } -class CanvasFrameRatePlugin : public QmlDebugClientPlugin +class CanvasFrameRatePlugin : public QmlDebugClient { Q_OBJECT public: - CanvasFrameRatePlugin(QmlDebugClient *client); + CanvasFrameRatePlugin(QmlDebugConnection *client); signals: void sample(int, int, int, int, bool); @@ -227,8 +227,8 @@ private: int ld; }; -CanvasFrameRatePlugin::CanvasFrameRatePlugin(QmlDebugClient *client) -: QmlDebugClientPlugin(QLatin1String("CanvasFrameRate"), client), la(-1) +CanvasFrameRatePlugin::CanvasFrameRatePlugin(QmlDebugConnection *client) +: QmlDebugClient(QLatin1String("CanvasFrameRate"), client), la(-1) { } @@ -248,7 +248,7 @@ void CanvasFrameRatePlugin::messageReceived(const QByteArray &data) ld = d; } -CanvasFrameRate::CanvasFrameRate(QmlDebugClient *client, QWidget *parent) +CanvasFrameRate::CanvasFrameRate(QmlDebugConnection *client, QWidget *parent) : QWidget(parent) { m_plugin = new CanvasFrameRatePlugin(client); @@ -300,7 +300,7 @@ void CanvasFrameRate::stateChanged(int s) { bool checked = s != 0; - static_cast(m_plugin)->setEnabled(checked); + static_cast(m_plugin)->setEnabled(checked); } QT_END_NAMESPACE diff --git a/tools/qmldebugger/canvasframerate.h b/tools/qmldebugger/canvasframerate.h index cc40d4c..912412b 100644 --- a/tools/qmldebugger/canvasframerate.h +++ b/tools/qmldebugger/canvasframerate.h @@ -5,13 +5,13 @@ QT_BEGIN_NAMESPACE -class QmlDebugClient; +class QmlDebugConnection; class QTabWidget; class CanvasFrameRate : public QWidget { Q_OBJECT public: - CanvasFrameRate(QmlDebugClient *, QWidget *parent = 0); + CanvasFrameRate(QmlDebugConnection *, QWidget *parent = 0); private slots: void newTab(); diff --git a/tools/qmldebugger/canvasscene.cpp b/tools/qmldebugger/canvasscene.cpp index 95f3098..65db9da 100644 --- a/tools/qmldebugger/canvasscene.cpp +++ b/tools/qmldebugger/canvasscene.cpp @@ -10,10 +10,10 @@ QT_BEGIN_NAMESPACE -class CanvasSceneClientPlugin : public QmlDebugClientPlugin +class CanvasSceneClientPlugin : public QmlDebugClient { public: - CanvasSceneClientPlugin(QmlDebugClient *, CanvasScene *s); + CanvasSceneClientPlugin(QmlDebugConnection *, CanvasScene *s); protected: void messageReceived(const QByteArray &); @@ -40,9 +40,9 @@ public: QFxImage *img; }; -CanvasSceneClientPlugin::CanvasSceneClientPlugin(QmlDebugClient *c, +CanvasSceneClientPlugin::CanvasSceneClientPlugin(QmlDebugConnection *c, CanvasScene *s) -: QmlDebugClientPlugin(QLatin1String("CanvasScene"), c), scene(s) +: QmlDebugClient(QLatin1String("CanvasScene"), c), scene(s) { } @@ -144,7 +144,7 @@ void CanvasSceneClientPlugin::dump(QDataStream &ds, int indent) dump(ds, indent + 1); } -CanvasScene::CanvasScene(QmlDebugClient *c, QWidget *parent) +CanvasScene::CanvasScene(QmlDebugConnection *c, QWidget *parent) : QWidget(parent) { client = new CanvasSceneClientPlugin(c, this); diff --git a/tools/qmldebugger/canvasscene.h b/tools/qmldebugger/canvasscene.h index 8b583e8..8c6b8d5 100644 --- a/tools/qmldebugger/canvasscene.h +++ b/tools/qmldebugger/canvasscene.h @@ -8,14 +8,14 @@ QT_BEGIN_NAMESPACE -class QmlDebugClient; +class QmlDebugConnection; class CanvasSceneClient; -class QmlDebugClientPlugin; +class QmlDebugClient; class CanvasScene : public QWidget { Q_OBJECT public: - CanvasScene(QmlDebugClient *, QWidget *parent = 0); + CanvasScene(QmlDebugConnection *, QWidget *parent = 0); void message(QDataStream &); private slots: @@ -29,7 +29,7 @@ private slots: private: void setOpacityRecur(QTreeWidgetItem *, qreal); void clone(QTreeWidgetItem *item, QSimpleCanvasItem *me, QDataStream &); - QmlDebugClientPlugin *client; + QmlDebugClient *client; QTreeWidget *m_tree; QSimpleCanvas *m_canvas; diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp index 46d30c4..3b8c8b1 100644 --- a/tools/qmldebugger/engine.cpp +++ b/tools/qmldebugger/engine.cpp @@ -27,7 +27,7 @@ private: int m_engineId; }; -EnginePane::EnginePane(QmlDebugClient *client, QWidget *parent) +EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent) : QWidget(parent), m_client(client), m_engines(0), m_context(0), m_object(0) { QVBoxLayout *layout = new QVBoxLayout; diff --git a/tools/qmldebugger/engine.h b/tools/qmldebugger/engine.h index 191cd1d..a713f25 100644 --- a/tools/qmldebugger/engine.h +++ b/tools/qmldebugger/engine.h @@ -9,14 +9,14 @@ QT_BEGIN_NAMESPACE -class QmlDebugClient; +class QmlDebugConnection; class EngineClientPlugin; class QLineEdit; class EnginePane : public QWidget { Q_OBJECT public: - EnginePane(QmlDebugClient *, QWidget *parent = 0); + EnginePane(QmlDebugConnection *, QWidget *parent = 0); private slots: void queryEngines(); diff --git a/tools/qmldebugger/main.cpp b/tools/qmldebugger/main.cpp index 4bed41d..500836f 100644 --- a/tools/qmldebugger/main.cpp +++ b/tools/qmldebugger/main.cpp @@ -29,7 +29,7 @@ private slots: void connectionStateChanged(); private: - QmlDebugClient client; + QmlDebugConnection client; QLabel *m_connectionState; QLineEdit *m_host; -- cgit v0.12 From e3112704989d9e9930541307d8262317129b317d Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 13 Jul 2009 17:41:47 +1000 Subject: Missing files --- tools/qmldebugger/engine.png | Bin 0 -> 6394 bytes tools/qmldebugger/engines.qml | 44 ++++++++++++++++++++++++++++++++++++++++++ tools/qmldebugger/refresh.png | Bin 0 -> 6169 bytes 3 files changed, 44 insertions(+) create mode 100644 tools/qmldebugger/engine.png create mode 100644 tools/qmldebugger/engines.qml create mode 100644 tools/qmldebugger/refresh.png diff --git a/tools/qmldebugger/engine.png b/tools/qmldebugger/engine.png new file mode 100644 index 0000000..a0a8a04 Binary files /dev/null and b/tools/qmldebugger/engine.png differ diff --git a/tools/qmldebugger/engines.qml b/tools/qmldebugger/engines.qml new file mode 100644 index 0000000..2435f10 --- /dev/null +++ b/tools/qmldebugger/engines.qml @@ -0,0 +1,44 @@ +Item { + height: 100 + id: Root + signal engineClicked(int id) + signal refreshEngines() + + HorizontalLayout { + anchors.fill: parent + Repeater { + dataSource: engines + Item { + width: 100; height: 100; + Image { + id: Image; + source: "engine.png" + anchors.horizontalCenter: parent.horizontalCenter + } + Text { + anchors.top: Image.bottom; + text: modelData.name + "(" + modelData.engineId + ")" + anchors.horizontalCenter: parent.horizontalCenter + } + MouseRegion { + anchors.fill: parent + onClicked: Root.engineClicked(modelData.engineId); + } + } + } + } + + + Image { + y: 15 + source: "refresh.png"; + width: 75; + height: 63; + smooth: true + anchors.right: parent.right + MouseRegion { + anchors.fill: parent + onClicked: Root.refreshEngines() + } + } +} diff --git a/tools/qmldebugger/refresh.png b/tools/qmldebugger/refresh.png new file mode 100644 index 0000000..8befc80 Binary files /dev/null and b/tools/qmldebugger/refresh.png differ -- cgit v0.12 From 18306f547806f44cfe8beabe9305e3ae09f54d07 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 13 Jul 2009 17:44:29 +1000 Subject: Rename QmlDebugServerPlugin -> QmlDebugService --- src/declarative/canvas/qsimplecanvas.cpp | 2 +- .../canvas/qsimplecanvasdebugplugin.cpp | 6 +- .../canvas/qsimplecanvasdebugplugin_p.h | 6 +- src/declarative/debugger/debugger.pri | 4 +- src/declarative/debugger/qmldebugserver.cpp | 380 --------------------- src/declarative/debugger/qmldebugserver.h | 86 ----- src/declarative/debugger/qmldebugservice.cpp | 380 +++++++++++++++++++++ src/declarative/debugger/qmldebugservice.h | 86 +++++ src/declarative/qml/qmlenginedebug.cpp | 12 +- src/declarative/qml/qmlenginedebug_p.h | 4 +- 10 files changed, 483 insertions(+), 483 deletions(-) delete mode 100644 src/declarative/debugger/qmldebugserver.cpp delete mode 100644 src/declarative/debugger/qmldebugserver.h create mode 100644 src/declarative/debugger/qmldebugservice.cpp create mode 100644 src/declarative/debugger/qmldebugservice.h diff --git a/src/declarative/canvas/qsimplecanvas.cpp b/src/declarative/canvas/qsimplecanvas.cpp index a4998dc..3e586f7 100644 --- a/src/declarative/canvas/qsimplecanvas.cpp +++ b/src/declarative/canvas/qsimplecanvas.cpp @@ -573,7 +573,7 @@ void QSimpleCanvasPrivate::init(QSimpleCanvas::CanvasMode mode) if (continuousUpdate()) qWarning("QSimpleCanvas: Continuous update enabled"); - if (QmlDebugServerPlugin::isDebuggingEnabled()) { + if (QmlDebugService::isDebuggingEnabled()) { debugPlugin = new QSimpleCanvasDebugPlugin(q); new QSimpleCanvasSceneDebugPlugin(q); } diff --git a/src/declarative/canvas/qsimplecanvasdebugplugin.cpp b/src/declarative/canvas/qsimplecanvasdebugplugin.cpp index 12088c1..ffb3517 100644 --- a/src/declarative/canvas/qsimplecanvasdebugplugin.cpp +++ b/src/declarative/canvas/qsimplecanvasdebugplugin.cpp @@ -67,7 +67,7 @@ private: }; QSimpleCanvasDebugPlugin::QSimpleCanvasDebugPlugin(QObject *parent) -: QmlDebugServerPlugin(QLatin1String("CanvasFrameRate"), parent), _breaks(0) +: QmlDebugService(QLatin1String("CanvasFrameRate"), parent), _breaks(0) { _time.start(); new FrameBreakAnimation(this); @@ -96,7 +96,7 @@ void QSimpleCanvasDebugPlugin::frameBreak() } QSimpleCanvasSceneDebugPlugin::QSimpleCanvasSceneDebugPlugin(QSimpleCanvas *parent) -: QmlDebugServerPlugin(QLatin1String("CanvasScene"), parent), m_canvas(parent) +: QmlDebugService(QLatin1String("CanvasScene"), parent), m_canvas(parent) { } @@ -120,7 +120,7 @@ void QSimpleCanvasSceneDebugPlugin::refresh() void QSimpleCanvasSceneDebugPlugin::refresh(QDataStream &ds, QSimpleCanvasItem *item) { - ds << QmlDebugServerPlugin::objectToString(item) << item->x() << item->y() + ds << QmlDebugService::objectToString(item) << item->x() << item->y() << item->z() << item->width() << item->height() << (int)item->transformOrigin() << item->scale() << (int)item->flip() #ifdef QFX_RENDER_OPENGL diff --git a/src/declarative/canvas/qsimplecanvasdebugplugin_p.h b/src/declarative/canvas/qsimplecanvasdebugplugin_p.h index 270b78c..4c6af2c 100644 --- a/src/declarative/canvas/qsimplecanvasdebugplugin_p.h +++ b/src/declarative/canvas/qsimplecanvasdebugplugin_p.h @@ -46,10 +46,10 @@ #include "qtcpserver.h" #include "qtcpsocket.h" #include "qdatetime.h" -#include +#include QT_BEGIN_NAMESPACE -class QSimpleCanvasDebugPlugin : public QmlDebugServerPlugin +class QSimpleCanvasDebugPlugin : public QmlDebugService { public: QSimpleCanvasDebugPlugin(QObject *parent = 0); @@ -65,7 +65,7 @@ private: class QSimpleCanvas; class QSimpleCanvasItem; -class QSimpleCanvasSceneDebugPlugin : public QmlDebugServerPlugin +class QSimpleCanvasSceneDebugPlugin : public QmlDebugService { public: QSimpleCanvasSceneDebugPlugin(QSimpleCanvas *parent = 0); diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 33076ea..82746fc 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -1,11 +1,11 @@ SOURCES += debugger/qmldebuggerstatus.cpp \ debugger/qpacketprotocol.cpp \ - debugger/qmldebugserver.cpp \ + debugger/qmldebugservice.cpp \ debugger/qmldebugclient.cpp \ debugger/qmldebug.cpp HEADERS += debugger/qmldebuggerstatus.h \ debugger/qpacketprotocol.h \ - debugger/qmldebugserver.h \ + debugger/qmldebugservice.h \ debugger/qmldebugclient.h \ debugger/qmldebug.h diff --git a/src/declarative/debugger/qmldebugserver.cpp b/src/declarative/debugger/qmldebugserver.cpp deleted file mode 100644 index ddfb88a..0000000 --- a/src/declarative/debugger/qmldebugserver.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmldebugserver.h" -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QmlDebugServerPrivate; -class QmlDebugServer : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlDebugServer) - Q_DISABLE_COPY(QmlDebugServer) -public: - static QmlDebugServer *instance(); - -private slots: - void readyRead(); - -private: - friend class QmlDebugServerPlugin; - friend class QmlDebugServerPluginPrivate; - QmlDebugServer(int); -}; - -class QmlDebugServerPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QmlDebugServer) -public: - QmlDebugServerPrivate(); - void init(int port); - - QTcpSocket *connection; - QPacketProtocol *protocol; - QHash plugins; - QStringList enabledPlugins; -}; - -class QmlDebugServerPluginPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QmlDebugServerPlugin) -public: - QmlDebugServerPluginPrivate(); - - QString name; - QmlDebugServer *server; -}; - -QmlDebugServerPrivate::QmlDebugServerPrivate() -: connection(0), protocol(0) -{ -} - -void QmlDebugServerPrivate::init(int port) -{ - Q_Q(QmlDebugServer); - QTcpServer server; - - if (!server.listen(QHostAddress::Any, port)) { - qWarning("QmlDebugServer: Unable to listen on port %d", port); - return; - } - - qWarning("QmlDebugServer: Waiting for connection on port %d...", port); - - if (!server.waitForNewConnection(-1)) { - qWarning("QmlDebugServer: Connection error"); - return; - } - - connection = server.nextPendingConnection(); - connection->setParent(q); - protocol = new QPacketProtocol(connection, q); - - // ### Wait for hello - while (!protocol->packetsAvailable()) { - connection->waitForReadyRead(); - } - QPacket hello = protocol->read(); - QString name; - hello >> name >> enabledPlugins; - if (name != QLatin1String("QmlDebugServer")) { - qWarning("QmlDebugServer: Invalid hello message"); - delete protocol; delete connection; connection = 0; protocol = 0; - return; - } - - QObject::connect(protocol, SIGNAL(readyRead()), q, SLOT(readyRead())); - q->readyRead(); - - qWarning("QmlDebugServer: Connection established"); -} - -QmlDebugServer *QmlDebugServer::instance() -{ - static bool envTested = false; - static QmlDebugServer *server = 0; - - if (!envTested) { - envTested = true; - QByteArray env = qgetenv("QML_DEBUG_SERVER_PORT"); - - bool ok = false; - int port = env.toInt(&ok); - - if (ok && port > 1024) - server = new QmlDebugServer(port); - } - - if (server && server->d_func()->connection) - return server; - else - return 0; -} - -QmlDebugServer::QmlDebugServer(int port) -: QObject(*(new QmlDebugServerPrivate)) -{ - Q_D(QmlDebugServer); - d->init(port); -} - -void QmlDebugServer::readyRead() -{ - Q_D(QmlDebugServer); - - QString debugServer(QLatin1String("QmlDebugServer")); - - while (d->protocol->packetsAvailable()) { - QPacket pack = d->protocol->read(); - - QString name; - pack >> name; - - if (name == debugServer) { - int op = -1; QString plugin; - pack >> op >> plugin; - - if (op == 1) { - // Enable - if (!d->enabledPlugins.contains(plugin)) { - d->enabledPlugins.append(plugin); - QHash::Iterator iter = - d->plugins.find(plugin); - if (iter != d->plugins.end()) - (*iter)->enabledChanged(true); - } - - } else if (op == 2) { - // Disable - if (d->enabledPlugins.contains(plugin)) { - d->enabledPlugins.removeAll(plugin); - QHash::Iterator iter = - d->plugins.find(plugin); - if (iter != d->plugins.end()) - (*iter)->enabledChanged(false); - } - } else { - qWarning("QmlDebugServer: Invalid control message %d", op); - } - - } else { - QByteArray message; - pack >> message; - - QHash::Iterator iter = - d->plugins.find(name); - if (iter == d->plugins.end()) { - qWarning() << "QmlDebugServer: Message received for missing plugin" << name; - } else { - (*iter)->messageReceived(message); - } - } - } -} - -QmlDebugServerPluginPrivate::QmlDebugServerPluginPrivate() -: server(0) -{ -} - -QmlDebugServerPlugin::QmlDebugServerPlugin(const QString &name, QObject *parent) -: QObject(*(new QmlDebugServerPluginPrivate), parent) -{ - Q_D(QmlDebugServerPlugin); - d->name = name; - d->server = QmlDebugServer::instance(); - - if (!d->server) - return; - - if (d->server->d_func()->plugins.contains(name)) { - qWarning() << "QmlDebugServerPlugin: Conflicting plugin name" << name; - d->server = 0; - } else { - d->server->d_func()->plugins.insert(name, this); - } -} - -QString QmlDebugServerPlugin::name() const -{ - Q_D(const QmlDebugServerPlugin); - return d->name; -} - -bool QmlDebugServerPlugin::isEnabled() const -{ - Q_D(const QmlDebugServerPlugin); - return (d->server && d->server->d_func()->enabledPlugins.contains(d->name)); -} - -namespace { - - struct ObjectReference - { - QPointer object; - int id; - }; - - struct ObjectReferenceHash - { - ObjectReferenceHash() : nextId(0) {} - - QHash objects; - QHash ids; - - int nextId; - }; - -} -Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash); - - -/*! - Returns a unique id for \a object. Calling this method multiple times - for the same object will return the same id. -*/ -int QmlDebugServerPlugin::idForObject(QObject *object) -{ - if (!object) - return -1; - - ObjectReferenceHash *hash = objectReferenceHash(); - QHash::Iterator iter = - hash->objects.find(object); - - if (iter == hash->objects.end()) { - int id = hash->nextId++; - - hash->ids.insert(id, object); - iter = hash->objects.insert(object, ObjectReference()); - iter->object = object; - iter->id = id; - } else if (iter->object != object) { - int id = hash->nextId++; - - hash->ids.remove(iter->id); - - hash->ids.insert(id, object); - iter->object = object; - iter->id = id; - } - return iter->id; -} - -/*! - Returns the object for unique \a id. If the object has not previously been - assigned an id, through idForObject(), then 0 is returned. If the object - has been destroyed, 0 is returned. -*/ -QObject *QmlDebugServerPlugin::objectForId(int id) -{ - ObjectReferenceHash *hash = objectReferenceHash(); - - QHash::Iterator iter = hash->ids.find(id); - if (iter == hash->ids.end()) - return 0; - - - QHash::Iterator objIter = - hash->objects.find(*iter); - Q_ASSERT(objIter != hash->objects.end()); - - if (objIter->object == 0) { - hash->ids.erase(iter); - hash->objects.erase(objIter); - return 0; - } else { - return *iter; - } -} - -bool QmlDebugServerPlugin::isDebuggingEnabled() -{ - return QmlDebugServer::instance() != 0; -} - -QString QmlDebugServerPlugin::objectToString(QObject *obj) -{ - if(!obj) - return QLatin1String("NULL"); - - QString objectName = obj->objectName(); - if(objectName.isEmpty()) - objectName = QLatin1String(""); - - QString rv = QLatin1String(obj->metaObject()->className()) + - QLatin1String(": ") + objectName; - - return rv; -} - -void QmlDebugServerPlugin::sendMessage(const QByteArray &message) -{ - Q_D(QmlDebugServerPlugin); - - if (!d->server || !d->server->d_func()->connection) - return; - - QPacket pack; - pack << d->name << message; - d->server->d_func()->protocol->send(pack); - d->server->d_func()->connection->flush(); -} - -void QmlDebugServerPlugin::enabledChanged(bool) -{ -} - -void QmlDebugServerPlugin::messageReceived(const QByteArray &) -{ -} - -QT_END_NAMESPACE - -#include "qmldebugserver.moc" diff --git a/src/declarative/debugger/qmldebugserver.h b/src/declarative/debugger/qmldebugserver.h deleted file mode 100644 index b15ee2e..0000000 --- a/src/declarative/debugger/qmldebugserver.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLDEBUGSERVER_H -#define QMLDEBUGSERVER_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QmlDebugServerPluginPrivate; -class QmlDebugServerPlugin : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlDebugServerPlugin) - Q_DISABLE_COPY(QmlDebugServerPlugin) -public: - QmlDebugServerPlugin(const QString &, QObject *parent = 0); - - QString name() const; - - bool isEnabled() const; - - void sendMessage(const QByteArray &); - - static int idForObject(QObject *); - static QObject *objectForId(int); - - - static bool isDebuggingEnabled(); - static QString objectToString(QObject *obj); - -protected: - virtual void enabledChanged(bool); - virtual void messageReceived(const QByteArray &); - -private: - friend class QmlDebugServer; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLDEBUGSERVER_H - diff --git a/src/declarative/debugger/qmldebugservice.cpp b/src/declarative/debugger/qmldebugservice.cpp new file mode 100644 index 0000000..9725494 --- /dev/null +++ b/src/declarative/debugger/qmldebugservice.cpp @@ -0,0 +1,380 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmldebugservice.h" +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QmlDebugServerPrivate; +class QmlDebugServer : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlDebugServer) + Q_DISABLE_COPY(QmlDebugServer) +public: + static QmlDebugServer *instance(); + +private slots: + void readyRead(); + +private: + friend class QmlDebugService; + friend class QmlDebugServicePrivate; + QmlDebugServer(int); +}; + +class QmlDebugServerPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlDebugServer) +public: + QmlDebugServerPrivate(); + void init(int port); + + QTcpSocket *connection; + QPacketProtocol *protocol; + QHash plugins; + QStringList enabledPlugins; +}; + +class QmlDebugServicePrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlDebugService) +public: + QmlDebugServicePrivate(); + + QString name; + QmlDebugServer *server; +}; + +QmlDebugServerPrivate::QmlDebugServerPrivate() +: connection(0), protocol(0) +{ +} + +void QmlDebugServerPrivate::init(int port) +{ + Q_Q(QmlDebugServer); + QTcpServer server; + + if (!server.listen(QHostAddress::Any, port)) { + qWarning("QmlDebugServer: Unable to listen on port %d", port); + return; + } + + qWarning("QmlDebugServer: Waiting for connection on port %d...", port); + + if (!server.waitForNewConnection(-1)) { + qWarning("QmlDebugServer: Connection error"); + return; + } + + connection = server.nextPendingConnection(); + connection->setParent(q); + protocol = new QPacketProtocol(connection, q); + + // ### Wait for hello + while (!protocol->packetsAvailable()) { + connection->waitForReadyRead(); + } + QPacket hello = protocol->read(); + QString name; + hello >> name >> enabledPlugins; + if (name != QLatin1String("QmlDebugServer")) { + qWarning("QmlDebugServer: Invalid hello message"); + delete protocol; delete connection; connection = 0; protocol = 0; + return; + } + + QObject::connect(protocol, SIGNAL(readyRead()), q, SLOT(readyRead())); + q->readyRead(); + + qWarning("QmlDebugServer: Connection established"); +} + +QmlDebugServer *QmlDebugServer::instance() +{ + static bool envTested = false; + static QmlDebugServer *server = 0; + + if (!envTested) { + envTested = true; + QByteArray env = qgetenv("QML_DEBUG_SERVER_PORT"); + + bool ok = false; + int port = env.toInt(&ok); + + if (ok && port > 1024) + server = new QmlDebugServer(port); + } + + if (server && server->d_func()->connection) + return server; + else + return 0; +} + +QmlDebugServer::QmlDebugServer(int port) +: QObject(*(new QmlDebugServerPrivate)) +{ + Q_D(QmlDebugServer); + d->init(port); +} + +void QmlDebugServer::readyRead() +{ + Q_D(QmlDebugServer); + + QString debugServer(QLatin1String("QmlDebugServer")); + + while (d->protocol->packetsAvailable()) { + QPacket pack = d->protocol->read(); + + QString name; + pack >> name; + + if (name == debugServer) { + int op = -1; QString plugin; + pack >> op >> plugin; + + if (op == 1) { + // Enable + if (!d->enabledPlugins.contains(plugin)) { + d->enabledPlugins.append(plugin); + QHash::Iterator iter = + d->plugins.find(plugin); + if (iter != d->plugins.end()) + (*iter)->enabledChanged(true); + } + + } else if (op == 2) { + // Disable + if (d->enabledPlugins.contains(plugin)) { + d->enabledPlugins.removeAll(plugin); + QHash::Iterator iter = + d->plugins.find(plugin); + if (iter != d->plugins.end()) + (*iter)->enabledChanged(false); + } + } else { + qWarning("QmlDebugServer: Invalid control message %d", op); + } + + } else { + QByteArray message; + pack >> message; + + QHash::Iterator iter = + d->plugins.find(name); + if (iter == d->plugins.end()) { + qWarning() << "QmlDebugServer: Message received for missing plugin" << name; + } else { + (*iter)->messageReceived(message); + } + } + } +} + +QmlDebugServicePrivate::QmlDebugServicePrivate() +: server(0) +{ +} + +QmlDebugService::QmlDebugService(const QString &name, QObject *parent) +: QObject(*(new QmlDebugServicePrivate), parent) +{ + Q_D(QmlDebugService); + d->name = name; + d->server = QmlDebugServer::instance(); + + if (!d->server) + return; + + if (d->server->d_func()->plugins.contains(name)) { + qWarning() << "QmlDebugService: Conflicting plugin name" << name; + d->server = 0; + } else { + d->server->d_func()->plugins.insert(name, this); + } +} + +QString QmlDebugService::name() const +{ + Q_D(const QmlDebugService); + return d->name; +} + +bool QmlDebugService::isEnabled() const +{ + Q_D(const QmlDebugService); + return (d->server && d->server->d_func()->enabledPlugins.contains(d->name)); +} + +namespace { + + struct ObjectReference + { + QPointer object; + int id; + }; + + struct ObjectReferenceHash + { + ObjectReferenceHash() : nextId(0) {} + + QHash objects; + QHash ids; + + int nextId; + }; + +} +Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash); + + +/*! + Returns a unique id for \a object. Calling this method multiple times + for the same object will return the same id. +*/ +int QmlDebugService::idForObject(QObject *object) +{ + if (!object) + return -1; + + ObjectReferenceHash *hash = objectReferenceHash(); + QHash::Iterator iter = + hash->objects.find(object); + + if (iter == hash->objects.end()) { + int id = hash->nextId++; + + hash->ids.insert(id, object); + iter = hash->objects.insert(object, ObjectReference()); + iter->object = object; + iter->id = id; + } else if (iter->object != object) { + int id = hash->nextId++; + + hash->ids.remove(iter->id); + + hash->ids.insert(id, object); + iter->object = object; + iter->id = id; + } + return iter->id; +} + +/*! + Returns the object for unique \a id. If the object has not previously been + assigned an id, through idForObject(), then 0 is returned. If the object + has been destroyed, 0 is returned. +*/ +QObject *QmlDebugService::objectForId(int id) +{ + ObjectReferenceHash *hash = objectReferenceHash(); + + QHash::Iterator iter = hash->ids.find(id); + if (iter == hash->ids.end()) + return 0; + + + QHash::Iterator objIter = + hash->objects.find(*iter); + Q_ASSERT(objIter != hash->objects.end()); + + if (objIter->object == 0) { + hash->ids.erase(iter); + hash->objects.erase(objIter); + return 0; + } else { + return *iter; + } +} + +bool QmlDebugService::isDebuggingEnabled() +{ + return QmlDebugServer::instance() != 0; +} + +QString QmlDebugService::objectToString(QObject *obj) +{ + if(!obj) + return QLatin1String("NULL"); + + QString objectName = obj->objectName(); + if(objectName.isEmpty()) + objectName = QLatin1String(""); + + QString rv = QLatin1String(obj->metaObject()->className()) + + QLatin1String(": ") + objectName; + + return rv; +} + +void QmlDebugService::sendMessage(const QByteArray &message) +{ + Q_D(QmlDebugService); + + if (!d->server || !d->server->d_func()->connection) + return; + + QPacket pack; + pack << d->name << message; + d->server->d_func()->protocol->send(pack); + d->server->d_func()->connection->flush(); +} + +void QmlDebugService::enabledChanged(bool) +{ +} + +void QmlDebugService::messageReceived(const QByteArray &) +{ +} + +QT_END_NAMESPACE + +#include "qmldebugservice.moc" diff --git a/src/declarative/debugger/qmldebugservice.h b/src/declarative/debugger/qmldebugservice.h new file mode 100644 index 0000000..b1344c4 --- /dev/null +++ b/src/declarative/debugger/qmldebugservice.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLDEBUGSERVICE_H +#define QMLDEBUGSERVICE_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QmlDebugServicePrivate; +class QmlDebugService : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlDebugService) + Q_DISABLE_COPY(QmlDebugService) +public: + QmlDebugService(const QString &, QObject *parent = 0); + + QString name() const; + + bool isEnabled() const; + + void sendMessage(const QByteArray &); + + static int idForObject(QObject *); + static QObject *objectForId(int); + + + static bool isDebuggingEnabled(); + static QString objectToString(QObject *obj); + +protected: + virtual void enabledChanged(bool); + virtual void messageReceived(const QByteArray &); + +private: + friend class QmlDebugServer; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLDEBUGSERVICE_H + diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index b5e44e7..2b8aac3 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QList QmlEngineDebugServer::m_engines; QmlEngineDebugServer::QmlEngineDebugServer(QObject *parent) -: QmlDebugServerPlugin(QLatin1String("QmlEngine"), parent) +: QmlDebugService(QLatin1String("QmlEngine"), parent) { } @@ -135,7 +135,7 @@ void QmlEngineDebugServer::buildObjectList(QDataStream &message, QmlContextPrivate *p = (QmlContextPrivate *)QObjectPrivate::get(ctxt); QString ctxtName = ctxt->objectName(); - int ctxtId = QmlDebugServerPlugin::idForObject(ctxt); + int ctxtId = QmlDebugService::idForObject(ctxt); message << ctxtName << ctxtId; @@ -182,7 +182,7 @@ QmlEngineDebugServer::objectData(QObject *object) rv.objectName = object->objectName(); rv.objectType = object->metaObject()->className(); - rv.objectId = QmlDebugServerPlugin::idForObject(object); + rv.objectId = QmlDebugService::idForObject(object); return rv; } @@ -207,7 +207,7 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) QmlEngine *engine = m_engines.at(ii); QString engineName = engine->objectName(); - int engineId = QmlDebugServerPlugin::idForObject(engine); + int engineId = QmlDebugService::idForObject(engine); rs << engineName << engineId; } @@ -219,7 +219,7 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) ds >> queryId >> engineId; QmlEngine *engine = - qobject_cast(QmlDebugServerPlugin::objectForId(engineId)); + qobject_cast(QmlDebugService::objectForId(engineId)); QByteArray reply; QDataStream rs(&reply, QIODevice::WriteOnly); @@ -236,7 +236,7 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) ds >> queryId >> objectId >> recurse; - QObject *object = QmlDebugServerPlugin::objectForId(objectId); + QObject *object = QmlDebugService::objectForId(objectId); QByteArray reply; QDataStream rs(&reply, QIODevice::WriteOnly); diff --git a/src/declarative/qml/qmlenginedebug_p.h b/src/declarative/qml/qmlenginedebug_p.h index 634f55f..e85ab6f 100644 --- a/src/declarative/qml/qmlenginedebug_p.h +++ b/src/declarative/qml/qmlenginedebug_p.h @@ -53,7 +53,7 @@ // We mean it. // -#include +#include #include #include @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE class QmlEngine; class QmlContext; class QDataStream; -class QmlEngineDebugServer : public QmlDebugServerPlugin +class QmlEngineDebugServer : public QmlDebugService { public: QmlEngineDebugServer(QObject * = 0); -- cgit v0.12 From c1491ff950f7da733c21bd3f00b88309397cf622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Mon, 13 Jul 2009 14:40:15 +0200 Subject: Compile. --- src/declarative/util/qfxview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index 103442c..41f7db2 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -60,7 +60,7 @@ #include "qfxview.h" #include #include -#include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 2926a7d3b4f0c3a715fe1acae9ee1a2e683e1f0c Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 14 Jul 2009 10:30:27 +1000 Subject: typo --- tools/qmlviewer/qmlviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index b6ce619..6de1b97 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -505,7 +505,7 @@ void QmlViewer::setRecordFile(const QString& f) bool QmlViewer::event(QEvent *event) { if (event->type() == QEvent::PaletteChange) { - setupPalette(); + setupPalettes(); return true; } return QWidget::event(event); -- cgit v0.12 From 59b3e3ba52891197510115f912e7934ac1784d7c Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 10 Jul 2009 16:41:48 +1000 Subject: Doc (fixed typo) --- src/declarative/util/qmllistmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index f5f76b0..61d32f4 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -73,7 +73,7 @@ struct ListModelData \qmlclass ListModel \brief The ListModel element defines a free-form list data source. - The ListModel is a simple heirarchy of items containing data roles. + The ListModel is a simple hierarchy of items containing data roles. For example: \code -- cgit v0.12 From a093c5ef65aa2c28f52f78c8be5bbe7d567646fa Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 14 Jul 2009 14:24:56 +1000 Subject: Libraries and library versioning. --- examples/declarative/modules/builtin-version.qml | 3 + .../declarative/modules/installed-qualified.qml | 4 + examples/declarative/modules/installed-version.qml | 7 + examples/declarative/modules/installed.qml | 2 + examples/declarative/modules/local-qualified.qml | 7 + examples/declarative/modules/local.qml | 2 + examples/declarative/modules/remote-qualified.qml | 4 + examples/declarative/modules/remote-zipped.qml | 4 + .../modules/wrong-installed-version.qml | 2 + examples/declarative/modules/wrong-installed.qml | 3 + .../declarative/modules/wrong-local-qualified.qml | 4 + examples/declarative/modules/wrong-local.qml | 6 + examples/declarative/modules/zipped-qualified.qml | 5 + examples/declarative/modules/zipped.qml | 5 + src/declarative/qml/parser/qmljs.g | 33 +- src/declarative/qml/parser/qmljsast_p.h | 1 + src/declarative/qml/parser/qmljsgrammar.cpp | 1834 ++++++++++++-------- src/declarative/qml/parser/qmljsgrammar_p.h | 22 +- src/declarative/qml/parser/qmljsparser.cpp | 989 ++++++++--- src/declarative/qml/parser/qmljsparser_p.h | 12 +- src/declarative/qml/qmlcompositetypemanager.cpp | 31 +- src/declarative/qml/qmlengine.cpp | 138 +- src/declarative/qml/qmlengine.h | 7 +- src/declarative/qml/qmlengine_p.h | 1 + src/declarative/qml/qmlscriptparser.cpp | 7 +- src/declarative/qml/qmlscriptparser_p.h | 7 +- tools/qmlviewer/main.cpp | 5 +- tools/qmlviewer/qmlviewer.cpp | 5 + 28 files changed, 2146 insertions(+), 1004 deletions(-) create mode 100644 examples/declarative/modules/builtin-version.qml create mode 100644 examples/declarative/modules/installed-qualified.qml create mode 100644 examples/declarative/modules/installed-version.qml create mode 100644 examples/declarative/modules/installed.qml create mode 100644 examples/declarative/modules/local-qualified.qml create mode 100644 examples/declarative/modules/local.qml create mode 100644 examples/declarative/modules/remote-qualified.qml create mode 100644 examples/declarative/modules/remote-zipped.qml create mode 100644 examples/declarative/modules/wrong-installed-version.qml create mode 100644 examples/declarative/modules/wrong-installed.qml create mode 100644 examples/declarative/modules/wrong-local-qualified.qml create mode 100644 examples/declarative/modules/wrong-local.qml create mode 100644 examples/declarative/modules/zipped-qualified.qml create mode 100644 examples/declarative/modules/zipped.qml diff --git a/examples/declarative/modules/builtin-version.qml b/examples/declarative/modules/builtin-version.qml new file mode 100644 index 0000000..78eb860 --- /dev/null +++ b/examples/declarative/modules/builtin-version.qml @@ -0,0 +1,3 @@ +import com.nokia.Qt 4.7 +Rect {} +// and later... SuperRect{} diff --git a/examples/declarative/modules/installed-qualified.qml b/examples/declarative/modules/installed-qualified.qml new file mode 100644 index 0000000..c3217cf --- /dev/null +++ b/examples/declarative/modules/installed-qualified.qml @@ -0,0 +1,4 @@ +import com.nokia.Foo as F +Item { + F.Bar { } +} diff --git a/examples/declarative/modules/installed-version.qml b/examples/declarative/modules/installed-version.qml new file mode 100644 index 0000000..4ba9a2b --- /dev/null +++ b/examples/declarative/modules/installed-version.qml @@ -0,0 +1,7 @@ +import com.nokia.Foo 1.6 +import com.nokia.Foo 1.7 as NewFoo +VerticalLayout { + Bar { } + Baz { } + NewFoo.Bar { } +} diff --git a/examples/declarative/modules/installed.qml b/examples/declarative/modules/installed.qml new file mode 100644 index 0000000..4ce5f76 --- /dev/null +++ b/examples/declarative/modules/installed.qml @@ -0,0 +1,2 @@ +import com.nokia.Foo +Foo.Bar { } diff --git a/examples/declarative/modules/local-qualified.qml b/examples/declarative/modules/local-qualified.qml new file mode 100644 index 0000000..36af092 --- /dev/null +++ b/examples/declarative/modules/local-qualified.qml @@ -0,0 +1,7 @@ +import "local" as X +import "local/SubLib" as Y + +VerticalLayout { + X.Foo { } + Y.Bar { } +} diff --git a/examples/declarative/modules/local.qml b/examples/declarative/modules/local.qml new file mode 100644 index 0000000..70c90df --- /dev/null +++ b/examples/declarative/modules/local.qml @@ -0,0 +1,2 @@ +import "local" +Foo { } diff --git a/examples/declarative/modules/remote-qualified.qml b/examples/declarative/modules/remote-qualified.qml new file mode 100644 index 0000000..d807af7 --- /dev/null +++ b/examples/declarative/modules/remote-qualified.qml @@ -0,0 +1,4 @@ +import "http://qml.nokia.com/Clock.zip" +Item { + Clock.Hand { ... } +} diff --git a/examples/declarative/modules/remote-zipped.qml b/examples/declarative/modules/remote-zipped.qml new file mode 100644 index 0000000..aee838f --- /dev/null +++ b/examples/declarative/modules/remote-zipped.qml @@ -0,0 +1,4 @@ +import "http://qml.nokia.com/Clock.zip" +Item { + Clock { ... } +} diff --git a/examples/declarative/modules/wrong-installed-version.qml b/examples/declarative/modules/wrong-installed-version.qml new file mode 100644 index 0000000..3d2e3e5 --- /dev/null +++ b/examples/declarative/modules/wrong-installed-version.qml @@ -0,0 +1,2 @@ +import com.nokia.Foo 1.5 +Baz { } // Not available in 1.5, only 1.6! diff --git a/examples/declarative/modules/wrong-installed.qml b/examples/declarative/modules/wrong-installed.qml new file mode 100644 index 0000000..b0f2355 --- /dev/null +++ b/examples/declarative/modules/wrong-installed.qml @@ -0,0 +1,3 @@ +import com.nokia.NonExistent + +Rect {} diff --git a/examples/declarative/modules/wrong-local-qualified.qml b/examples/declarative/modules/wrong-local-qualified.qml new file mode 100644 index 0000000..92cbbf3 --- /dev/null +++ b/examples/declarative/modules/wrong-local-qualified.qml @@ -0,0 +1,4 @@ +import "local" as X + +// WRONG: if imported qualified, must qualify +Foo { } diff --git a/examples/declarative/modules/wrong-local.qml b/examples/declarative/modules/wrong-local.qml new file mode 100644 index 0000000..6cb00c4 --- /dev/null +++ b/examples/declarative/modules/wrong-local.qml @@ -0,0 +1,6 @@ +import "local" + +// WRONG - cannot use qualification to access "local sublibraries". +// (would have to import lib.SubLib) +SubLib.Bar { +} diff --git a/examples/declarative/modules/zipped-qualified.qml b/examples/declarative/modules/zipped-qualified.qml new file mode 100644 index 0000000..101df14 --- /dev/null +++ b/examples/declarative/modules/zipped-qualified.qml @@ -0,0 +1,5 @@ +// Not currently supported +import "zips/ClockPack.zip" as CP +Item { + CP.Clock { ... } +} diff --git a/examples/declarative/modules/zipped.qml b/examples/declarative/modules/zipped.qml new file mode 100644 index 0000000..9a0775c --- /dev/null +++ b/examples/declarative/modules/zipped.qml @@ -0,0 +1,5 @@ +// Not currently supported +import "zips/ClockPack.zip" +Item { + Clock { ... } +} diff --git a/src/declarative/qml/parser/qmljs.g b/src/declarative/qml/parser/qmljs.g index 3ed6ee2..8297c08 100644 --- a/src/declarative/qml/parser/qmljs.g +++ b/src/declarative/qml/parser/qmljs.g @@ -557,7 +557,7 @@ UiImport: T_IMPORT UiQualifiedId T_AUTOMATIC_SEMICOLON; UiImport: T_IMPORT UiQualifiedId T_SEMICOLON; /. case $rule_number: { - AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId); + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); node->importToken = loc(1); node->fileNameToken = loc(2); node->semicolonToken = loc(3); @@ -565,11 +565,40 @@ case $rule_number: { } break; ./ +UiImport: T_IMPORT UiQualifiedId T_NUMERIC_LITERAL T_AUTOMATIC_SEMICOLON; +UiImport: T_IMPORT UiQualifiedId T_NUMERIC_LITERAL T_SEMICOLON; +/. +case $rule_number: { + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); + node->importToken = loc(1); + node->fileNameToken = loc(2); + node->versionToken = loc(3); + node->semicolonToken = loc(4); + sym(1).Node = node; +} break; +./ + +UiImport: T_IMPORT UiQualifiedId T_NUMERIC_LITERAL T_AS JsIdentifier T_AUTOMATIC_SEMICOLON; +UiImport: T_IMPORT UiQualifiedId T_NUMERIC_LITERAL T_AS JsIdentifier T_SEMICOLON; +/. +case $rule_number: { + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); + node->importId = sym(5).sval; + node->importToken = loc(1); + node->fileNameToken = loc(2); + node->versionToken = loc(3); + node->asToken = loc(4); + node->importIdToken = loc(5); + node->semicolonToken = loc(6); + sym(1).Node = node; +} break; +./ + UiImport: T_IMPORT UiQualifiedId T_AS JsIdentifier T_AUTOMATIC_SEMICOLON; UiImport: T_IMPORT UiQualifiedId T_AS JsIdentifier T_SEMICOLON; /. case $rule_number: { - AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId); + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); node->importId = sym(4).sval; node->importToken = loc(1); node->fileNameToken = loc(2); diff --git a/src/declarative/qml/parser/qmljsast_p.h b/src/declarative/qml/parser/qmljsast_p.h index bde78c0..6d269ac 100644 --- a/src/declarative/qml/parser/qmljsast_p.h +++ b/src/declarative/qml/parser/qmljsast_p.h @@ -2236,6 +2236,7 @@ public: NameId *importId; SourceLocation importToken; SourceLocation fileNameToken; + SourceLocation versionToken; SourceLocation asToken; SourceLocation importIdToken; SourceLocation semicolonToken; diff --git a/src/declarative/qml/parser/qmljsgrammar.cpp b/src/declarative/qml/parser/qmljsgrammar.cpp index 5ff2ed8..ff25d65 100644 --- a/src/declarative/qml/parser/qmljsgrammar.cpp +++ b/src/declarative/qml/parser/qmljsgrammar.cpp @@ -2,7 +2,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. ** @@ -35,7 +35,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -52,800 +52,1198 @@ const char *const QmlJSGrammar::spell [] = { ")", ";", 0, "*", "*=", "string literal", "property", "signal", "switch", "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^", "^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "public", "import", "as", - 0, 0}; + 0, 0, +#ifndef QLALR_NO_QMLJSGRAMMAR_DEBUG_INFO +"UiProgram", "UiImportListOpt", "UiRootMember", "Empty", "UiImportList", "UiImport", "JsIdentifier", "UiQualifiedId", + "UiObjectDefinition", "UiObjectMemberList", "UiObjectMember", "UiArrayMemberList", "UiObjectInitializer", "UiMultilineStringLiteral", "UiMultilineStringStatement", "Expression", "Block", "EmptyStatement", + "ExpressionStatement", "DebuggerStatement", "IfStatement", "UiPropertyType", "UiParameterListOpt", "UiParameterList", "FunctionDeclaration", "VariableStatement", "PrimaryExpression", "Elision", + "ElementList", "PropertyNameAndValueListOpt", "PropertyNameAndValueList", "AssignmentExpression", "PropertyName", "ReservedIdentifier", "PropertyIdentifier", "MemberExpression", "FunctionExpression", "ArgumentListOpt", + "NewExpression", "CallExpression", "ArgumentList", "LeftHandSideExpression", "PostfixExpression", "UnaryExpression", "MultiplicativeExpression", "AdditiveExpression", "ShiftExpression", "RelationalExpression", + "RelationalExpressionNotIn", "EqualityExpression", "EqualityExpressionNotIn", "BitwiseANDExpression", "BitwiseANDExpressionNotIn", "BitwiseXORExpression", "BitwiseXORExpressionNotIn", "BitwiseORExpression", "BitwiseORExpressionNotIn", "LogicalANDExpression", + "LogicalANDExpressionNotIn", "LogicalORExpression", "LogicalORExpressionNotIn", "ConditionalExpression", "ConditionalExpressionNotIn", "AssignmentExpressionNotIn", "AssignmentOperator", "ExpressionOpt", "ExpressionNotIn", "ExpressionNotInOpt", + "Statement", "IterationStatement", "ContinueStatement", "BreakStatement", "ReturnStatement", "WithStatement", "LabelledStatement", "SwitchStatement", "ThrowStatement", "TryStatement", + "StatementListOpt", "StatementList", "VariableDeclarationKind", "VariableDeclarationList", "VariableDeclaration", "VariableDeclarationListNotIn", "VariableDeclarationNotIn", "InitialiserOpt", "InitialiserNotInOpt", "Initialiser", + "InitialiserNotIn", "CaseBlock", "CaseClausesOpt", "DefaultClause", "CaseClauses", "CaseClause", "Catch", "Finally", "FormalParameterListOpt", "FunctionBodyOpt", + "IdentifierOpt", "FormalParameterList", "FunctionBody", "SourceElements", "SourceElement", "$accept" +#endif // QLALR_NO_QMLJSGRAMMAR_DEBUG_INFO +}; const int QmlJSGrammar::lhs [] = { 92, 93, 93, 96, 96, 97, 97, 97, 97, 97, - 97, 97, 97, 95, 94, 101, 101, 103, 103, 104, - 104, 100, 102, 102, 105, 106, 106, 102, 102, 102, - 102, 102, 102, 102, 113, 113, 113, 114, 114, 115, - 115, 102, 102, 102, 102, 102, 102, 102, 102, 102, - 102, 102, 102, 99, 99, 98, 98, 98, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 99, 99, 120, 120, 120, - 120, 119, 119, 122, 122, 124, 124, 124, 124, 124, - 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 97, 97, 97, 97, 97, 97, 97, 95, 94, 101, + 101, 103, 103, 104, 104, 100, 102, 102, 105, 106, + 106, 102, 102, 102, 102, 102, 102, 102, 113, 113, + 113, 114, 114, 115, 115, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 99, 99, 98, + 98, 98, 118, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 99, + 99, 120, 120, 120, 120, 119, 119, 122, 122, 124, + 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 126, 126, 127, 127, 127, 127, 127, 130, - 130, 131, 131, 131, 131, 129, 129, 132, 132, 133, - 133, 134, 134, 134, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 136, 136, 136, 136, 137, 137, - 137, 138, 138, 138, 138, 139, 139, 139, 139, 139, - 139, 139, 140, 140, 140, 140, 140, 140, 141, 141, - 141, 141, 141, 142, 142, 142, 142, 142, 143, 143, - 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, - 149, 149, 150, 150, 151, 151, 152, 152, 153, 153, - 154, 154, 123, 123, 155, 155, 156, 156, 156, 156, - 156, 156, 156, 156, 156, 156, 156, 156, 107, 107, - 157, 157, 158, 158, 159, 159, 160, 160, 160, 160, + 125, 125, 125, 125, 125, 125, 126, 126, 127, 127, + 127, 127, 127, 130, 130, 131, 131, 131, 131, 129, + 129, 132, 132, 133, 133, 134, 134, 134, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 136, 136, + 136, 136, 137, 137, 137, 138, 138, 138, 138, 139, + 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, + 140, 140, 141, 141, 141, 141, 141, 142, 142, 142, + 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, + 147, 147, 148, 148, 149, 149, 150, 150, 151, 151, + 152, 152, 153, 153, 154, 154, 123, 123, 155, 155, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 107, 107, 157, 157, 158, 158, 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 108, 171, 171, 170, 170, 117, 117, 172, 172, - 173, 173, 175, 175, 174, 176, 179, 177, 177, 180, - 178, 178, 109, 110, 110, 112, 112, 161, 161, 161, - 161, 161, 161, 161, 162, 162, 162, 162, 163, 163, - 163, 163, 164, 164, 165, 167, 181, 181, 184, 184, - 182, 182, 185, 183, 166, 166, 166, 168, 168, 169, - 169, 169, 186, 187, 111, 111, 116, 128, 191, 191, - 188, 188, 189, 189, 192, 193, 193, 194, 194, 190, - 190, 121, 121, 195}; + 160, 160, 160, 160, 160, 108, 171, 171, 170, 170, + 117, 117, 172, 172, 173, 173, 175, 175, 174, 176, + 179, 177, 177, 180, 178, 178, 109, 110, 110, 112, + 112, 161, 161, 161, 161, 161, 161, 161, 162, 162, + 162, 162, 163, 163, 163, 163, 164, 164, 165, 167, + 181, 181, 184, 184, 182, 182, 185, 183, 166, 166, + 166, 168, 168, 169, 169, 169, 186, 187, 111, 111, + 116, 128, 191, 191, 188, 188, 189, 189, 192, 193, + 193, 194, 194, 190, 190, 121, 121, 195}; const int QmlJSGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 5, 5, 3, - 3, 5, 5, 0, 1, 1, 2, 1, 3, 2, - 3, 2, 1, 5, 1, 2, 2, 4, 3, 3, - 3, 3, 3, 3, 1, 1, 1, 0, 1, 2, - 4, 5, 2, 4, 4, 5, 5, 6, 6, 7, - 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, - 4, 5, 3, 4, 3, 1, 3, 1, 2, 3, - 4, 1, 2, 3, 5, 1, 1, 1, 1, 1, + 3, 4, 4, 6, 6, 5, 5, 0, 1, 1, + 2, 1, 3, 2, 3, 2, 1, 5, 1, 2, + 2, 4, 3, 3, 3, 3, 3, 3, 1, 1, + 1, 0, 1, 2, 4, 5, 2, 4, 4, 5, + 5, 6, 6, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 3, 4, 5, 3, 4, 3, 1, + 3, 1, 2, 3, 4, 1, 2, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 3, 5, 1, - 2, 4, 4, 4, 3, 0, 1, 1, 3, 1, - 1, 1, 2, 2, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 1, 3, 3, 3, 1, 3, - 3, 1, 3, 3, 3, 1, 3, 3, 3, 3, - 3, 3, 1, 3, 3, 3, 3, 3, 1, 3, - 3, 3, 3, 1, 3, 3, 3, 3, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 3, 5, 1, 2, 4, 4, 4, 3, 0, + 1, 1, 3, 1, 1, 1, 2, 2, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, + 3, 3, 1, 3, 3, 1, 3, 3, 3, 1, + 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, + 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, + 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 5, - 1, 5, 1, 3, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 0, 1, 1, 3, 0, 1, 1, 1, 1, 1, + 1, 3, 1, 5, 1, 5, 1, 3, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 2, 0, 1, 3, 3, 1, 1, - 1, 3, 1, 3, 2, 2, 2, 0, 1, 2, - 0, 1, 1, 2, 2, 7, 5, 7, 7, 5, - 9, 10, 7, 8, 2, 2, 3, 3, 2, 2, - 3, 3, 3, 3, 5, 5, 3, 5, 1, 2, - 0, 1, 4, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 5, 2, 2, 2, 8, 8, 1, 3, - 0, 1, 0, 1, 1, 1, 2, 1, 1, 0, - 1, 0, 1, 2}; + 1, 1, 1, 1, 1, 3, 1, 2, 0, 1, + 3, 3, 1, 1, 1, 3, 1, 3, 2, 2, + 2, 0, 1, 2, 0, 1, 1, 2, 2, 7, + 5, 7, 7, 5, 9, 10, 7, 8, 2, 2, + 3, 3, 2, 2, 3, 3, 3, 3, 5, 5, + 3, 5, 1, 2, 0, 1, 4, 3, 3, 3, + 3, 3, 3, 3, 3, 4, 5, 2, 2, 2, + 8, 8, 1, 3, 0, 1, 0, 1, 1, 1, + 2, 1, 1, 0, 1, 0, 1, 2}; + + +#ifndef QLALR_NO_QMLJSGRAMMAR_DEBUG_INFO +const int QmlJSGrammar::rule_info [] = { + 92, 93, 94 + , 93, 95 + , 93, 96 + , 96, 97 + , 96, 96, 97 + , 97, 88, 65, 62 + , 97, 88, 65, 61 + , 97, 88, 65, 89, 98, 62 + , 97, 88, 65, 89, 98, 61 + , 97, 88, 99, 62 + , 97, 88, 99, 61 + , 97, 88, 99, 47, 62 + , 97, 88, 99, 47, 61 + , 97, 88, 99, 47, 89, 98, 62 + , 97, 88, 99, 47, 89, 98, 61 + , 97, 88, 99, 89, 98, 62 + , 97, 88, 99, 89, 98, 61 + , 95 + , 94, 100 + , 101, 102 + , 101, 101, 102 + , 103, 100 + , 103, 103, 8, 100 + , 104, 33, 55 + , 104, 33, 101, 55 + , 100, 99, 104 + , 102, 100 + , 102, 99, 7, 34, 103, 56 + , 105, 86 + , 106, 105, 62 + , 106, 105, 61 + , 102, 99, 7, 107, 104 + , 102, 99, 7, 108 + , 102, 99, 7, 109 + , 102, 99, 7, 110 + , 102, 99, 7, 111 + , 102, 99, 7, 106 + , 102, 99, 7, 112 + , 113, 74 + , 113, 85 + , 113, 29 + , 114 + , 114, 115 + , 115, 113, 98 + , 115, 115, 8, 113, 98 + , 102, 67, 29, 36, 114, 60 + , 102, 67, 29 + , 102, 66, 113, 29, 62 + , 102, 66, 113, 29, 61 + , 102, 10, 66, 113, 29, 62 + , 102, 10, 66, 113, 29, 61 + , 102, 66, 113, 29, 7, 107, 62 + , 102, 66, 113, 29, 7, 107, 61 + , 102, 10, 66, 113, 29, 7, 107, 62 + , 102, 10, 66, 113, 29, 7, 107, 61 + , 102, 116 + , 102, 117 + , 99, 85 + , 99, 59 + , 98, 29 + , 98, 66 + , 98, 67 + , 118, 69 + , 118, 98 + , 118, 80 + , 118, 81 + , 118, 82 + , 118, 47 + , 118, 65 + , 118, 12 + , 118, 13 + , 118, 34, 56 + , 118, 34, 119, 56 + , 118, 34, 120, 56 + , 118, 34, 120, 8, 56 + , 118, 34, 120, 8, 119, 56 + , 118, 33, 121, 55 + , 118, 33, 122, 8, 55 + , 118, 36, 107, 60 + , 99, 98 + , 99, 99, 15, 98 + , 120, 123 + , 120, 119, 123 + , 120, 120, 8, 123 + , 120, 120, 8, 119, 123 + , 119, 8 + , 119, 119, 8 + , 122, 124, 7, 123 + , 122, 122, 8, 124, 7, 123 + , 124, 29 + , 124, 67 + , 124, 66 + , 124, 65 + , 124, 47 + , 124, 125 + , 125, 4 + , 125, 5 + , 125, 6 + , 125, 9 + , 125, 10 + , 125, 11 + , 125, 14 + , 125, 16 + , 125, 82 + , 125, 20 + , 125, 21 + , 125, 22 + , 125, 30 + , 125, 31 + , 125, 32 + , 125, 43 + , 125, 80 + , 125, 59 + , 125, 68 + , 125, 69 + , 125, 70 + , 125, 81 + , 125, 72 + , 125, 73 + , 125, 74 + , 125, 75 + , 125, 76 + , 125, 83 + , 125, 84 + , 125, 85 + , 125, 77 + , 126, 98 + , 126, 125 + , 127, 118 + , 127, 128 + , 127, 127, 34, 107, 56 + , 127, 127, 15, 126 + , 127, 43, 127, 36, 129, 60 + , 130, 127 + , 130, 43, 130 + , 131, 127, 36, 129, 60 + , 131, 131, 36, 129, 60 + , 131, 131, 34, 107, 56 + , 131, 131, 15, 126 + , 129 + , 129, 132 + , 132, 123 + , 132, 132, 8, 123 + , 133, 130 + , 133, 131 + , 134, 133 + , 134, 133, 53 + , 134, 133, 42 + , 135, 134 + , 135, 11, 135 + , 135, 75, 135 + , 135, 73, 135 + , 135, 53, 135 + , 135, 42, 135 + , 135, 51, 135 + , 135, 40, 135 + , 135, 71, 135 + , 135, 44, 135 + , 136, 135 + , 136, 136, 63, 135 + , 136, 136, 12, 135 + , 136, 136, 57, 135 + , 137, 136 + , 137, 137, 51, 136 + , 137, 137, 40, 136 + , 138, 137 + , 138, 138, 38, 137 + , 138, 138, 25, 137 + , 138, 138, 27, 137 + , 139, 138 + , 139, 139, 37, 138 + , 139, 139, 24, 138 + , 139, 139, 35, 138 + , 139, 139, 23, 138 + , 139, 139, 32, 138 + , 139, 139, 31, 138 + , 140, 138 + , 140, 140, 37, 138 + , 140, 140, 24, 138 + , 140, 140, 35, 138 + , 140, 140, 23, 138 + , 140, 140, 32, 138 + , 141, 139 + , 141, 141, 18, 139 + , 141, 141, 45, 139 + , 141, 141, 19, 139 + , 141, 141, 46, 139 + , 142, 140 + , 142, 142, 18, 140 + , 142, 142, 45, 140 + , 142, 142, 19, 140 + , 142, 142, 46, 140 + , 143, 141 + , 143, 143, 1, 141 + , 144, 142 + , 144, 144, 1, 142 + , 145, 143 + , 145, 145, 78, 143 + , 146, 144 + , 146, 146, 78, 144 + , 147, 145 + , 147, 147, 48, 145 + , 148, 146 + , 148, 148, 48, 146 + , 149, 147 + , 149, 149, 2, 147 + , 150, 148 + , 150, 150, 2, 148 + , 151, 149 + , 151, 151, 50, 149 + , 152, 150 + , 152, 152, 50, 150 + , 153, 151 + , 153, 151, 54, 123, 7, 123 + , 154, 152 + , 154, 152, 54, 155, 7, 155 + , 123, 153 + , 123, 133, 156, 123 + , 155, 154 + , 155, 133, 156, 155 + , 156, 17 + , 156, 64 + , 156, 13 + , 156, 58 + , 156, 52 + , 156, 41 + , 156, 39 + , 156, 26 + , 156, 28 + , 156, 3 + , 156, 79 + , 156, 49 + , 107, 123 + , 107, 107, 8, 123 + , 157 + , 157, 107 + , 158, 155 + , 158, 158, 8, 155 + , 159 + , 159, 158 + , 160, 108 + , 160, 117 + , 160, 109 + , 160, 110 + , 160, 112 + , 160, 161 + , 160, 162 + , 160, 163 + , 160, 164 + , 160, 165 + , 160, 166 + , 160, 167 + , 160, 168 + , 160, 169 + , 160, 111 + , 108, 33, 170, 55 + , 171, 160 + , 171, 171, 160 + , 170 + , 170, 171 + , 117, 172, 173, 62 + , 117, 172, 173, 61 + , 172, 83 + , 172, 74 + , 173, 174 + , 173, 173, 8, 174 + , 175, 176 + , 175, 175, 8, 176 + , 174, 98, 177 + , 176, 98, 178 + , 179, 17, 123 + , 177 + , 177, 179 + , 180, 17, 155 + , 178 + , 178, 180 + , 109, 61 + , 110, 107, 62 + , 110, 107, 61 + , 112, 30, 36, 107, 60, 160, 16, 160 + , 112, 30, 36, 107, 60, 160 + , 161, 14, 160, 76, 36, 107, 60, 62 + , 161, 14, 160, 76, 36, 107, 60, 61 + , 161, 76, 36, 107, 60, 160 + , 161, 21, 36, 159, 61, 157, 61, 157, 60, 160 + , 161, 21, 36, 74, 175, 61, 157, 61, 157, 60, 160 + , 161, 21, 36, 133, 31, 107, 60, 160 + , 161, 21, 36, 74, 176, 31, 107, 60, 160 + , 162, 9, 62 + , 162, 9, 61 + , 162, 9, 98, 62 + , 162, 9, 98, 61 + , 163, 4, 62 + , 163, 4, 61 + , 163, 4, 98, 62 + , 163, 4, 98, 61 + , 164, 59, 157, 62 + , 164, 59, 157, 61 + , 165, 77, 36, 107, 60, 160 + , 167, 68, 36, 107, 60, 181 + , 181, 33, 182, 55 + , 181, 33, 182, 183, 182, 55 + , 184, 185 + , 184, 184, 185 + , 182 + , 182, 184 + , 185, 5, 107, 7, 170 + , 183, 10, 7, 170 + , 166, 67, 7, 160 + , 166, 66, 7, 160 + , 166, 29, 7, 160 + , 168, 70, 107, 62 + , 168, 70, 107, 61 + , 169, 72, 108, 186 + , 169, 72, 108, 187 + , 169, 72, 108, 186, 187 + , 186, 6, 36, 98, 60, 108 + , 187, 20, 108 + , 111, 84, 62 + , 111, 84, 61 + , 116, 22, 98, 36, 188, 60, 33, 189, 55 + , 128, 22, 190, 36, 188, 60, 33, 189, 55 + , 191, 98 + , 191, 191, 8, 98 + , 188 + , 188, 191 + , 189 + , 189, 192 + , 192, 193 + , 193, 194 + , 193, 193, 194 + , 194, 160 + , 194, 116 + , 190 + , 190, 98 + , 121 + , 121, 122 + , 195, 92, 0}; + +const int QmlJSGrammar::rule_index [] = { + 0, 3, 5, 7, 9, 12, 16, 20, 26, 32, + 36, 40, 45, 50, 57, 64, 70, 76, 77, 79, + 81, 84, 86, 90, 93, 97, 100, 102, 108, 110, + 113, 116, 121, 125, 129, 133, 137, 141, 145, 147, + 149, 151, 152, 154, 157, 162, 168, 171, 176, 181, + 187, 193, 200, 207, 215, 223, 225, 227, 229, 231, + 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, + 253, 255, 258, 262, 266, 271, 277, 281, 286, 290, + 292, 296, 298, 301, 305, 310, 312, 315, 319, 325, + 327, 329, 331, 333, 335, 337, 339, 341, 343, 345, + 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, + 367, 369, 371, 373, 375, 377, 379, 381, 383, 385, + 387, 389, 391, 393, 395, 397, 399, 401, 403, 405, + 407, 412, 416, 422, 424, 427, 432, 437, 442, 446, + 447, 449, 451, 455, 457, 459, 461, 464, 467, 469, + 472, 475, 478, 481, 484, 487, 490, 493, 496, 498, + 502, 506, 510, 512, 516, 520, 522, 526, 530, 534, + 536, 540, 544, 548, 552, 556, 560, 562, 566, 570, + 574, 578, 582, 584, 588, 592, 596, 600, 602, 606, + 610, 614, 618, 620, 624, 626, 630, 632, 636, 638, + 642, 644, 648, 650, 654, 656, 660, 662, 666, 668, + 672, 674, 678, 680, 686, 688, 694, 696, 700, 702, + 706, 708, 710, 712, 714, 716, 718, 720, 722, 724, + 726, 728, 730, 732, 736, 737, 739, 741, 745, 746, + 748, 750, 752, 754, 756, 758, 760, 762, 764, 766, + 768, 770, 772, 774, 776, 778, 782, 784, 787, 788, + 790, 794, 798, 800, 802, 804, 808, 810, 814, 817, + 820, 823, 824, 826, 829, 830, 832, 834, 837, 840, + 848, 854, 862, 870, 876, 886, 897, 905, 914, 917, + 920, 924, 928, 931, 934, 938, 942, 946, 950, 956, + 962, 966, 972, 974, 977, 978, 980, 985, 989, 993, + 997, 1001, 1005, 1009, 1013, 1017, 1022, 1028, 1031, 1034, + 1037, 1046, 1055, 1057, 1061, 1062, 1064, 1065, 1067, 1069, + 1071, 1074, 1076, 1078, 1079, 1081, 1082, 1084}; +#endif // QLALR_NO_QMLJSGRAMMAR_DEBUG_INFO const int QmlJSGrammar::action_default [] = { - 14, 2, 0, 4, 3, 0, 0, 76, 56, 57, - 54, 55, 58, 0, 0, 0, 6, 7, 0, 8, - 9, 0, 10, 0, 11, 0, 12, 13, 77, 5, - 15, 0, 1, 0, 22, 52, 259, 0, 0, 57, - 20, 58, 260, 23, 16, 0, 0, 0, 53, 0, - 37, 36, 35, 0, 0, 46, 0, 47, 162, 229, - 193, 201, 197, 141, 213, 189, 0, 126, 60, 142, - 205, 209, 130, 159, 140, 145, 125, 179, 166, 0, - 66, 67, 63, 330, 332, 0, 0, 0, 0, 0, - 0, 61, 64, 0, 0, 65, 59, 0, 62, 0, - 0, 155, 0, 0, 142, 161, 144, 143, 0, 0, - 0, 157, 158, 156, 160, 0, 190, 0, 0, 0, - 0, 180, 0, 0, 0, 0, 0, 0, 170, 0, - 0, 0, 164, 165, 163, 168, 172, 171, 169, 167, - 182, 181, 183, 0, 198, 0, 194, 0, 0, 136, - 123, 135, 124, 92, 93, 94, 119, 95, 120, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 121, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 122, 0, 0, 134, 230, 137, 0, - 138, 0, 139, 133, 50, 51, 0, 226, 219, 217, - 224, 225, 223, 222, 228, 221, 220, 218, 227, 214, - 0, 202, 0, 0, 206, 0, 0, 210, 0, 0, - 136, 128, 0, 127, 0, 132, 146, 0, 331, 321, - 322, 0, 319, 0, 320, 0, 323, 237, 244, 243, - 251, 239, 0, 240, 324, 0, 329, 241, 242, 247, - 245, 326, 325, 328, 248, 0, 0, 0, 0, 0, - 330, 56, 0, 332, 57, 231, 273, 58, 0, 0, - 0, 0, 0, 249, 250, 238, 246, 274, 275, 318, - 327, 0, 289, 290, 291, 292, 0, 285, 286, 287, - 288, 315, 316, 0, 0, 0, 0, 0, 278, 279, - 235, 233, 195, 203, 199, 215, 191, 236, 0, 142, - 207, 211, 184, 173, 0, 0, 192, 0, 0, 0, - 0, 185, 0, 0, 0, 0, 0, 177, 175, 178, - 176, 174, 187, 186, 188, 0, 200, 0, 196, 0, - 234, 142, 0, 216, 231, 232, 0, 231, 0, 0, - 281, 0, 0, 0, 283, 0, 204, 0, 0, 208, - 0, 0, 212, 271, 0, 263, 272, 266, 0, 270, - 0, 231, 264, 0, 231, 0, 0, 282, 0, 0, - 0, 284, 331, 321, 0, 0, 323, 0, 317, 0, - 307, 0, 0, 0, 277, 0, 276, 0, 333, 0, - 91, 253, 256, 0, 92, 259, 95, 120, 97, 98, - 63, 102, 103, 56, 104, 107, 61, 64, 57, 231, - 58, 65, 110, 59, 112, 62, 114, 115, 260, 117, - 118, 122, 0, 84, 0, 0, 86, 90, 88, 74, - 87, 89, 0, 85, 73, 254, 252, 130, 131, 136, - 0, 129, 0, 306, 0, 293, 294, 0, 305, 0, - 0, 0, 296, 301, 299, 302, 0, 0, 300, 301, - 0, 297, 0, 298, 255, 304, 0, 255, 303, 0, - 308, 309, 0, 255, 310, 311, 0, 0, 312, 0, - 0, 0, 313, 314, 148, 147, 0, 0, 0, 280, - 0, 0, 0, 295, 78, 0, 0, 82, 68, 0, - 70, 80, 0, 71, 81, 83, 72, 79, 69, 0, - 75, 152, 150, 154, 151, 149, 153, 0, 0, 0, - 44, 0, 45, 0, 48, 49, 43, 38, 39, 0, - 0, 0, 0, 41, 42, 40, 21, 17, 0, 29, - 32, 30, 0, 31, 34, 255, 0, 25, 0, 33, - 28, 92, 259, 95, 120, 97, 98, 63, 102, 103, - 56, 104, 107, 61, 64, 57, 231, 58, 65, 110, - 59, 112, 62, 114, 115, 260, 117, 118, 122, 60, - 0, 18, 0, 24, 19, 26, 27, 268, 261, 0, - 269, 265, 0, 267, 257, 0, 258, 262, 334}; + 18, 2, 0, 4, 3, 0, 0, 80, 60, 61, + 58, 59, 62, 0, 0, 0, 6, 7, 0, 8, + 9, 0, 10, 0, 0, 11, 0, 16, 17, 81, + 0, 12, 13, 0, 14, 15, 5, 19, 0, 1, + 0, 26, 56, 263, 0, 0, 61, 24, 62, 264, + 27, 20, 0, 0, 0, 57, 0, 41, 40, 39, + 0, 0, 50, 0, 51, 166, 233, 197, 205, 201, + 145, 217, 193, 0, 130, 64, 146, 209, 213, 134, + 163, 144, 149, 129, 183, 170, 0, 70, 71, 67, + 334, 336, 0, 0, 0, 0, 0, 0, 65, 68, + 0, 0, 69, 63, 0, 66, 0, 0, 159, 0, + 0, 146, 165, 148, 147, 0, 0, 0, 161, 162, + 160, 164, 0, 194, 0, 0, 0, 0, 184, 0, + 0, 0, 0, 0, 0, 174, 0, 0, 0, 168, + 169, 167, 172, 176, 175, 173, 171, 186, 185, 187, + 0, 202, 0, 198, 0, 0, 140, 127, 139, 128, + 96, 97, 98, 123, 99, 124, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 125, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 126, 0, 0, 138, 234, 141, 0, 142, 0, 143, + 137, 54, 55, 0, 230, 223, 221, 228, 229, 227, + 226, 232, 225, 224, 222, 231, 218, 0, 206, 0, + 0, 210, 0, 0, 214, 0, 0, 140, 132, 0, + 131, 0, 136, 150, 0, 335, 325, 326, 0, 323, + 0, 324, 0, 327, 241, 248, 247, 255, 243, 0, + 244, 328, 0, 333, 245, 246, 251, 249, 330, 329, + 332, 252, 0, 0, 0, 0, 0, 334, 60, 0, + 336, 61, 235, 277, 62, 0, 0, 0, 0, 0, + 253, 254, 242, 250, 278, 279, 322, 331, 0, 293, + 294, 295, 296, 0, 289, 290, 291, 292, 319, 320, + 0, 0, 0, 0, 0, 282, 283, 239, 237, 199, + 207, 203, 219, 195, 240, 0, 146, 211, 215, 188, + 177, 0, 0, 196, 0, 0, 0, 0, 189, 0, + 0, 0, 0, 0, 181, 179, 182, 180, 178, 191, + 190, 192, 0, 204, 0, 200, 0, 238, 146, 0, + 220, 235, 236, 0, 235, 0, 0, 285, 0, 0, + 0, 287, 0, 208, 0, 0, 212, 0, 0, 216, + 275, 0, 267, 276, 270, 0, 274, 0, 235, 268, + 0, 235, 0, 0, 286, 0, 0, 0, 288, 335, + 325, 0, 0, 327, 0, 321, 0, 311, 0, 0, + 0, 281, 0, 280, 0, 337, 0, 95, 257, 260, + 0, 96, 263, 99, 124, 101, 102, 67, 106, 107, + 60, 108, 111, 65, 68, 61, 235, 62, 69, 114, + 63, 116, 66, 118, 119, 264, 121, 122, 126, 0, + 88, 0, 0, 90, 94, 92, 78, 91, 93, 0, + 89, 77, 258, 256, 134, 135, 140, 0, 133, 0, + 310, 0, 297, 298, 0, 309, 0, 0, 0, 300, + 305, 303, 306, 0, 0, 304, 305, 0, 301, 0, + 302, 259, 308, 0, 259, 307, 0, 312, 313, 0, + 259, 314, 315, 0, 0, 316, 0, 0, 0, 317, + 318, 152, 151, 0, 0, 0, 284, 0, 0, 0, + 299, 82, 0, 0, 86, 72, 0, 74, 84, 0, + 75, 85, 87, 76, 83, 73, 0, 79, 156, 154, + 158, 155, 153, 157, 0, 0, 0, 48, 0, 49, + 0, 52, 53, 47, 42, 43, 0, 0, 0, 0, + 45, 46, 44, 25, 21, 0, 33, 36, 34, 0, + 35, 38, 259, 0, 29, 0, 37, 32, 96, 263, + 99, 124, 101, 102, 67, 106, 107, 60, 108, 111, + 65, 68, 61, 235, 62, 69, 114, 63, 116, 66, + 118, 119, 264, 121, 122, 126, 64, 0, 22, 0, + 28, 23, 30, 31, 272, 265, 0, 273, 269, 0, + 271, 261, 0, 262, 266, 338}; const int QmlJSGrammar::goto_default [] = { - 6, 5, 32, 1, 4, 3, 68, 31, 43, 45, - 44, 590, 34, 558, 559, 242, 237, 241, 243, 240, - 247, 528, 539, 538, 246, 275, 76, 506, 505, 399, - 398, 59, 397, 400, 151, 72, 67, 189, 74, 63, - 188, 69, 75, 101, 73, 58, 78, 77, 312, 65, - 306, 60, 302, 62, 304, 61, 303, 70, 310, 71, - 311, 64, 305, 301, 342, 454, 307, 308, 401, 248, - 239, 238, 250, 276, 249, 254, 273, 274, 403, 402, - 47, 599, 598, 364, 365, 601, 367, 600, 366, 462, - 466, 469, 465, 464, 484, 485, 231, 245, 227, 230, - 244, 252, 251, 0}; + 6, 5, 39, 1, 4, 3, 75, 38, 50, 52, + 51, 597, 41, 565, 566, 249, 244, 248, 250, 247, + 254, 535, 546, 545, 253, 282, 83, 513, 512, 406, + 405, 66, 404, 407, 158, 79, 74, 196, 81, 70, + 195, 76, 82, 108, 80, 65, 85, 84, 319, 72, + 313, 67, 309, 69, 311, 68, 310, 77, 317, 78, + 318, 71, 312, 308, 349, 461, 314, 315, 408, 255, + 246, 245, 257, 283, 256, 261, 280, 281, 410, 409, + 54, 606, 605, 371, 372, 608, 374, 607, 373, 469, + 473, 476, 472, 471, 491, 492, 238, 252, 234, 237, + 251, 259, 258, 0}; const int QmlJSGrammar::action_index [] = { - -11, -92, 395, -92, 10, 364, 99, -92, -92, -92, - -92, -92, -92, 135, 285, 214, -92, -92, 93, -92, - -92, 214, -92, 214, -92, 101, -92, -92, -92, -92, - -92, 97, -92, 462, -92, -92, -92, 72, 198, 193, - -92, 75, -92, -92, -92, 485, 299, 171, -92, 174, - -92, -92, -92, 74, 192, -92, 761, -92, 85, -92, - 96, 73, 14, 227, -92, 292, 131, -92, -92, 600, - 94, 123, 168, 176, -92, -92, -92, 511, 157, 761, - -92, -92, -92, 139, 1604, 1263, 761, 761, 761, 680, - 761, -92, -92, 761, 761, -92, -92, 761, -92, 761, - 761, -92, 761, 761, 90, 205, -92, -92, 761, 761, - 761, -92, -92, -92, 195, 761, 305, 761, 761, 761, - 761, 511, 761, 761, 761, 761, 761, 761, 203, 761, - 761, 761, 119, 77, 91, 191, 185, 188, 194, 222, - 415, 405, 432, 761, 9, 761, 81, 1516, 761, 761, - -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, + 7, -92, 389, -92, -10, 343, 168, -92, -92, -92, + -92, -92, -92, 233, 308, 178, -92, -92, 86, -92, + -92, 173, -92, 151, 137, -92, 108, -92, -92, -92, + 184, -92, -92, 105, -92, -92, -92, -92, 82, -92, + 456, -92, -92, -92, 44, 190, 195, -92, -27, -92, + -92, -92, 431, 208, 187, -92, 214, -92, -92, -92, + -15, 224, -92, 764, -92, 109, -92, 8, -47, -78, + 194, -92, 376, 143, -92, -92, 603, 6, 85, 186, + 213, -92, -92, -92, 514, 302, 764, -92, -92, -92, + 237, 1607, 1014, 764, 764, 764, 683, 764, -92, -92, + 764, 764, -92, -92, 764, -92, 764, 764, -92, 764, + 764, 133, 220, -92, -92, 764, 764, 764, -92, -92, + -92, 149, 764, 376, 764, 764, 764, 764, 412, 764, + 764, 764, 764, 764, 764, 302, 764, 764, 764, 131, + 152, 145, 302, 235, 235, 302, 235, 514, 427, 392, + 764, -73, 764, 11, 1519, 764, 764, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, - -92, -92, -92, -92, 108, 761, -92, -92, 82, 67, - -92, 761, -92, -92, -92, -92, 761, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, -92, - 761, 70, 761, 761, 78, 71, 761, -92, 1516, 761, - 761, -92, 102, -92, 62, -92, -92, 59, -92, 214, - 68, 60, -92, 255, -92, 55, 1780, -92, -92, -92, - -92, -92, 232, -92, -92, 69, -92, -92, -92, -92, - -92, -92, 1780, -92, -92, 344, 359, 95, 1868, 65, - 246, 76, 58, 2044, 64, 761, -92, 63, 48, 761, - 40, 39, 49, -92, -92, -92, -92, -92, -92, -92, - -92, 104, -92, -92, -92, -92, 86, -92, -92, -92, - -92, -92, -92, -4, 50, 761, 129, 118, -92, -92, - 842, -92, 88, 43, -12, -92, 373, 66, 32, 536, - 151, 124, 442, 264, 250, 761, 373, 761, 761, 761, - 761, 329, 761, 761, 761, 761, 761, 244, 270, 280, - 271, 245, 352, 442, 335, 761, -74, 761, 4, 761, - -92, 600, 761, -92, 761, 2, -52, 761, -40, 1868, - -92, 761, 127, 1868, -92, 761, -34, 761, 761, 15, - 12, 761, -92, -1, 111, -16, -92, -92, 761, -92, - 261, 761, -92, -31, 761, -36, 1868, -92, 761, 107, - 1868, -92, -14, 237, -49, -32, 1780, -23, -92, 1868, - -92, 761, 92, 1868, -10, 1868, -92, 51, 54, 26, - -92, -92, 1868, 24, 319, 57, 333, 79, 761, 1868, - 56, 29, 263, 42, 19, 680, 30, 31, -92, 927, - -92, 28, 0, 22, 761, 33, 13, 761, 36, 761, - 5, -3, 761, -92, 1692, 44, -92, -92, -92, -92, - -92, -92, 761, -92, -92, -92, -92, 175, -92, 761, - -58, -92, 1868, -92, 89, -92, -92, 1868, -92, 761, - 100, 35, -92, 23, -92, 16, 116, 761, -92, 8, - 11, -92, -28, -92, 1868, -92, 98, 1868, -92, 226, - -92, -92, 103, 1868, -13, -92, -24, -8, -92, 169, - -37, -7, -92, -92, -92, -92, 761, 125, 1868, -92, - 761, 126, 1868, -92, -92, 138, 1011, -92, -92, 1179, - -92, -92, 1095, -92, -92, -92, -92, -92, -92, 121, - -92, -92, -92, -92, -92, -92, -92, -5, 18, 224, - -92, 761, -92, 212, -92, -92, -33, 172, 61, -60, - 214, 140, 214, -92, -92, -92, -92, -92, 1428, -92, - -92, -92, 307, -92, -92, 1956, 1347, -92, 83, -92, - -92, 316, 47, 336, 114, 761, 1868, 52, 21, 290, - 46, 20, 680, 45, 53, -92, 927, -92, 37, 6, - 38, 761, 41, 17, 761, 27, 761, 3, 25, 34, - 105, -92, 342, -92, -92, -92, -92, -9, -92, 183, - -92, -92, 761, -92, -92, 214, -92, -92, -92, + -92, 94, 764, -92, -92, 91, 78, -92, 764, -92, + -92, -92, -92, 764, -92, -92, -92, -92, -92, -92, + -92, -92, -92, -92, -92, -92, -92, 764, -41, 764, + 764, 45, 37, 764, -92, 1519, 764, 764, -92, 120, + -92, 41, -92, -92, 73, -92, 171, 54, 26, -92, + 258, -92, 52, 1871, -92, -92, -92, -92, -92, 253, + -92, -92, 2, -92, -92, -92, -92, -92, -92, 1871, + -92, -92, 346, 364, 126, 1783, 30, 250, 56, 25, + 2047, 58, 764, -92, 61, 40, 764, 39, 35, 34, + -92, -92, -92, -92, -92, -92, -92, -92, 122, -92, + -92, -92, -92, 128, -92, -92, -92, -92, -92, -92, + 27, 70, 764, 118, 132, -92, -92, 930, -92, 89, + 65, 67, -92, 320, 83, -2, 516, 92, 141, 445, + 235, 192, 764, 312, 764, 764, 764, 764, 445, 764, + 764, 764, 764, 764, 235, 235, 235, 235, 235, 336, + 445, 445, 764, -67, 764, 76, 764, -92, 603, 764, + -92, 764, -4, -37, 764, -12, 1783, -92, 764, 119, + 1783, -92, 764, 3, 764, 764, 50, 46, 764, -92, + 33, 136, 9, -92, -92, 764, -92, 245, 764, -92, + -30, 764, -22, 1783, -92, 764, 117, 1783, -92, -3, + 234, 69, 12, 1871, -23, -92, 1783, -92, 764, 97, + 1783, 20, 1783, -92, 28, 29, -13, -92, -92, 1783, + -21, 280, 18, 372, 81, 764, 1783, 19, -9, 284, + 23, -8, 683, 22, 36, -92, 849, -92, 42, 24, + 49, 764, 48, 21, 764, 32, 764, 5, 10, 764, + -92, 1695, 16, -92, -92, -92, -92, -92, -92, 764, + -92, -92, -92, -92, 193, -92, 764, -57, -92, 1783, + -92, 111, -92, -92, 1783, -92, 764, 114, -16, -92, + 13, -92, 17, 110, 764, -92, 15, 14, -92, -45, + -92, 1783, -92, 116, 1783, -92, 206, -92, -92, 112, + 1783, -7, -92, -20, -14, -92, 205, -54, -18, -92, + -92, -92, -92, 764, 99, 1783, -92, 764, 103, 1783, + -92, -92, 106, 1266, -92, -92, 1098, -92, -92, 1182, + -92, -92, -92, -92, -92, -92, 104, -92, -92, -92, + -92, -92, -92, -92, 60, 64, 174, -92, 764, -92, + 203, -92, -92, 72, 217, 90, 71, 226, 204, 181, + -92, -92, -92, -92, -92, 1431, -92, -92, -92, 274, + -92, -92, 1959, 1350, -92, 79, -92, -92, 323, 80, + 325, 93, 764, 1783, 62, 38, 297, 51, 31, 683, + 57, 66, -92, 849, -92, 68, 43, 74, 764, 75, + 59, 764, 77, 764, 53, 47, 55, 96, -92, 315, + -92, -92, -92, -92, 63, -92, 244, -92, -92, 764, + -92, -92, 252, -92, -92, -92, - -104, -104, 87, -104, 69, 82, -104, -104, -104, -104, - -104, -104, -104, -104, -104, 49, -104, -104, -104, -104, - -104, 45, -104, 50, -104, -104, -104, -104, -104, -104, - -104, -104, -104, 253, -104, -104, -104, -104, 26, -104, - -104, -104, -104, -104, -104, 261, -104, 1, -104, -7, - -104, -104, -104, -104, -104, -104, -11, -104, -104, -104, - -104, -104, -104, -104, -104, -104, -104, -104, -104, -38, - -104, -104, -104, -104, -104, -104, -104, -104, -104, 135, - -104, -104, -104, 11, -104, -16, 8, 139, 147, 148, - 144, -104, -104, 138, 127, -104, -104, 115, -104, 119, - 150, -104, 120, 125, -104, -104, -104, -104, 116, 232, - 172, -104, -104, -104, -104, 171, -104, 151, 154, 158, - 161, -104, 163, 165, 143, 126, 64, 68, -104, 80, - 86, 61, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, 63, -104, 67, -104, 74, 20, 6, + -104, -104, 82, -104, 6, 78, -104, -104, -104, -104, + -104, -104, -104, -104, -104, 28, -104, -104, -104, -104, + -104, 15, -104, 11, -104, -104, -104, -104, -104, -104, + 19, -104, -104, -104, -104, -104, -104, -104, -104, -104, + 343, -104, -104, -104, -104, 27, -104, -104, -104, -104, + -104, -104, 260, -104, 26, -104, -6, -104, -104, -104, + -104, -104, -104, -11, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -56, -104, -104, -104, + -104, -104, -104, -104, -104, -104, 137, -104, -104, -104, + 60, -104, 50, 64, 141, 144, 90, 147, -104, -104, + 126, 106, -104, -104, 109, -104, 105, 110, -104, 182, + 121, -104, -104, -104, -104, 113, 101, 171, -104, -104, + -104, -104, 164, -104, 170, 152, 150, 151, -104, 154, + 99, 155, 161, 81, 55, -104, 57, 66, 63, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + 80, -104, 69, -104, 93, 36, 38, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, -104, -104, 28, -104, -104, -104, -104, - -104, 14, -104, -104, -104, -104, 12, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - 89, -104, 94, 31, -104, -104, 38, -104, 204, 51, - 102, -104, -104, -104, -104, -104, -104, -104, -104, 7, - -104, -104, -104, 16, -104, -104, -59, -104, -104, -104, + -104, -104, 41, -104, -104, -104, -104, -104, -12, -104, + -104, -104, -104, -17, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, 118, -104, 165, + -2, -104, -104, 25, -104, 209, 16, 172, -104, -104, + -104, -104, -104, -104, -104, -104, 17, -104, -104, -104, + 18, -104, -104, -46, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, 56, + -104, -104, 0, 30, -104, -65, -104, 12, -104, -104, + -104, -104, 119, -104, -104, -104, 13, 14, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, 44, -104, -104, 92, 19, -104, -41, -104, - 24, -104, -104, -104, -104, 5, -104, -104, -104, -4, - -8, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, 23, -104, -104, -104, -104, 148, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, -104, -104, 52, -104, -104, -104, -104, - 91, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -104, -104, -104, 66, 185, -104, 177, 173, 176, - 188, -104, 88, 95, 97, 107, 101, -104, -104, -104, - -104, -104, -104, -104, -104, 212, -104, 187, -104, 199, - -104, -104, 201, -104, 108, -104, -104, 100, -104, -14, - -104, 34, -104, -20, -104, 200, -104, 211, 209, -104, - -104, 202, -104, -104, -104, -104, -104, -104, 186, -104, - 90, 98, -104, -104, 85, -104, -22, -104, 37, -104, - -10, -104, -104, 81, -104, -104, 43, -104, -104, -15, - -104, 32, -104, -24, -104, -34, -104, -104, -104, -104, - -104, -104, -32, -104, 92, -104, 33, -104, 76, -27, - -104, -104, 36, -104, -104, 114, -104, -104, -104, 25, - -104, -104, -104, -104, 18, -104, 59, 79, -104, 83, - -104, -104, 42, -104, 39, -104, -104, -104, -104, -104, - -104, -104, 55, -104, -104, -104, -104, -104, -104, 166, - -104, -104, 15, -104, -104, -104, -104, -3, -104, 46, - -104, -104, -104, -104, -104, -23, -104, 53, -104, -26, - -104, -104, -104, -104, -21, -104, -104, -73, -104, -104, - -104, -104, -104, -104, -94, -104, -104, 0, -104, 22, - -104, 13, -104, -104, -104, -104, 3, -104, -47, -104, - 9, -104, -49, -104, -104, -104, -19, -104, -104, 169, - -104, -104, -25, -104, -104, -104, -104, -104, -104, -104, + -104, 7, 178, -104, 179, 188, 245, 191, -104, 133, + 131, 129, 140, 130, -104, -104, -104, -104, -104, -104, + -104, -104, 207, -104, 205, -104, 217, -104, -104, 199, + -104, 70, -104, -104, 65, -104, -10, -104, 45, -104, + -16, -104, 203, -104, 223, 219, -104, -104, 192, -104, + -104, -104, -104, -104, -104, 189, -104, 77, 76, -104, + -104, 72, -104, 2, -104, 47, -104, 49, -104, -104, + 87, -104, -104, 71, -104, -104, 10, -104, 34, -104, + -1, -104, -20, -104, -104, -104, -104, -104, -104, -5, + -104, 48, -104, 53, -104, 73, 3, -104, -104, 39, + -104, -104, 68, -104, -104, -104, 119, -104, -104, -104, + -104, 58, -104, 59, 54, -104, 114, -104, -104, 46, + -104, 44, -104, -104, -104, -104, -104, -104, -104, 43, + -104, -104, -104, -104, -104, -104, 173, -104, -104, -4, + -104, -104, -104, -104, -7, -104, 42, -104, -104, -104, + -104, -104, -49, -104, 40, -104, -40, -104, -104, -104, + -104, -31, -104, -104, 4, -104, -104, -104, -104, -104, + -104, -30, -104, -104, 52, -104, 37, -104, -15, -104, + -104, -104, -104, -13, -104, -68, -104, -3, -104, -63, + -104, -104, -104, -24, -104, -104, 92, -104, -104, -22, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, - -104, -13, -104, -104, -104, -104, -104, 10, -104, -104, - -6, -18, 4, -104, -104, -104, -104, -104, 264, -104, - -104, -104, 48, -104, -104, -104, 330, -104, -104, -104, - -104, 92, -104, 71, -104, 60, 21, -104, -104, 70, - -104, -104, 57, -104, -104, -104, 23, -104, -104, -104, - -104, 35, -104, 47, 41, -104, 56, -104, -104, -104, - -104, -104, 73, -104, -104, -104, -104, -104, -104, -104, - -104, -104, 54, -104, -104, 72, -104, -104, -104}; + -104, -104, -104, -104, -104, -104, -104, -104, 22, -104, + -104, -104, -104, -104, 21, -104, -104, 35, 32, 33, + -104, -104, -104, -104, -104, 256, -104, -104, -104, 8, + -104, -104, -104, 210, -104, -104, -104, -104, 20, -104, + 30, -104, 51, -41, -104, -104, 29, -104, -104, 74, + -104, -104, -104, 1, -104, -104, -104, -104, 31, -104, + 24, 88, -104, 95, -104, -104, -104, -104, -104, 107, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -21, + -104, -104, 84, -104, -104, -104}; const int QmlJSGrammar::action_info [] = { - 544, 386, 451, 537, 337, 315, 395, 487, 602, 347, - 185, 385, 489, 467, 335, 378, 368, 355, 474, 361, - 349, 467, 383, 491, 376, 483, 483, 473, 467, -111, - 374, 383, 388, 500, -116, -89, 459, -108, -90, 496, - -113, 496, 459, -116, -89, -111, 483, 529, -113, -86, - 483, 442, -108, -86, -119, 391, 391, 300, 432, -100, - -90, 500, 434, -100, -119, 300, 337, -76, 463, 541, - 457, 452, 294, 483, 339, 496, 233, 2, 216, 446, - 210, 444, 115, 389, 459, 500, 295, 145, 236, 315, - 191, 335, 145, 344, 391, 229, 210, 115, 2, 608, - 185, 300, 0, 54, 536, 477, 185, 0, 185, 486, - 185, 0, 23, 592, 0, 185, 185, 102, 143, 370, - 235, 143, 225, 487, 279, 102, 470, 193, 103, 185, - 33, 102, 106, 185, 185, 185, 103, 185, 49, 185, - 292, 291, 103, 107, 596, 595, 509, 290, 289, 0, - 456, 455, 393, 355, 20, 19, 292, 291, 223, 102, - 461, 593, 27, 26, 186, 285, 284, 380, 8, 50, - 103, 471, 371, 212, 357, 292, 291, 213, 358, 299, - 298, 520, 129, 218, 130, 498, 502, 353, 108, 297, - 218, 605, 195, 194, 510, 131, 17, 16, 8, 56, - 8, 50, 219, 50, 220, 9, 12, 108, 0, 219, - 129, 449, 130, 129, 52, 130, 129, 108, 130, 129, - 185, 130, 50, 131, 15, 51, 131, 8, 129, 131, - 130, 531, 131, 109, 185, 9, 12, 9, 12, 110, - 185, 131, 147, 8, 606, 604, 52, 129, 52, 130, - 0, 0, 109, 57, 55, 0, 0, 51, 110, 51, - 131, 148, 109, 149, 9, 12, 8, 52, 110, 129, - 129, 130, 130, 535, 534, 8, 0, 0, 51, 8, - 9, 12, 131, 131, 8, 532, 530, 481, 480, 129, - 8, 130, 8, 278, 277, 129, 129, 130, 130, -330, - 23, 0, 131, 9, 12, 129, 548, 130, 131, 131, - 117, 118, 9, 12, 23, 185, 9, 12, 131, 8, - 0, 9, 12, 117, 118, 0, -330, 9, 12, 9, - 12, 0, 33, 0, 0, 0, 0, 119, 120, 0, - 33, 0, 0, 0, 0, 8, 24, 22, 8, 0, - 119, 120, 322, 323, 0, 0, 9, 12, 322, 323, - 0, 324, 8, 0, 325, 8, 326, 324, 278, 277, - 325, 8, 326, 8, 21, 322, 323, 283, 282, 0, - 283, 282, 9, 12, 324, 9, 12, 325, 8, 326, - 0, 317, 318, 8, 288, 287, 0, 288, 287, 9, - 12, 11, 9, 12, 0, 283, 282, 0, 9, 12, - 9, 12, 0, 0, 0, 0, 0, 0, 319, 320, - 288, 287, 0, 11, 8, 9, 12, 10, 122, 123, - 9, 12, 0, 0, 0, 0, 124, 125, 122, 123, - 126, 0, 127, 0, 0, 0, 124, 125, 0, 10, - 126, 0, 127, 0, 11, 122, 123, 0, 0, 0, - 13, 9, 12, 124, 125, 322, 323, 126, 0, 127, - 0, 0, 37, 0, 324, 0, 0, 325, 0, 326, - 10, 0, 0, 0, 38, 0, 0, 0, 0, 0, - 0, 8, 0, 0, 0, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, - 0, 0, 0, 0, 8, 0, 0, 40, 0, 0, - 0, 11, 0, 0, 0, 0, 0, 0, 39, 41, - 0, 0, 0, 0, 122, 123, 42, 0, 0, 197, - 546, 0, 124, 125, 11, 36, 126, 10, 127, 198, - 0, 39, 41, 199, 0, 0, 0, 0, 0, 42, - 0, 0, 200, 0, 201, 0, 0, 351, 36, 0, - 10, 0, 0, 0, 0, 202, 0, 203, 106, 0, - 0, 0, 0, 0, 0, 204, 0, 0, 205, 107, - 0, 0, 0, 0, 206, 0, 0, 0, 0, 0, - 207, 0, 0, 197, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 198, 0, 208, 0, 199, 0, 0, - 0, 0, 0, 0, 0, 0, 200, 0, 201, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, - 0, 203, 106, 0, 0, 0, 0, 0, 0, 204, - 0, 0, 205, 107, 0, 0, 0, 0, 206, 0, - 0, 0, 0, 0, 207, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 208, + 152, 150, 543, 458, 192, 152, 498, 150, 217, 122, + 480, 344, 122, 494, 61, 490, 496, 470, 474, 490, + 474, 481, 474, 449, 354, -123, -104, 307, 398, -112, + -90, 381, 395, 390, 453, 439, 402, 441, 383, -120, + 385, 503, 451, -94, 223, 393, 507, 217, 356, -93, + 375, 342, 362, 368, 490, -117, -115, 286, -90, 351, + 466, 398, 240, 396, -112, 459, 307, 398, 464, -104, + 507, 503, 490, -94, 307, -93, 466, 322, 2, 466, + 609, -115, -117, 507, -120, 243, 242, -123, -80, 503, + 322, 346, 490, 536, 362, 2, 390, 23, 548, 198, + 0, 232, 192, 301, 599, 192, 302, 192, 544, 236, + 56, 192, 192, 342, 516, 40, 0, 0, 493, 0, + 477, 0, 192, 484, 192, 192, 192, 192, 192, 392, + 0, 551, 494, 0, 0, 219, 0, 0, 200, 220, + 603, 602, 299, 298, 377, 344, 0, 20, 19, 109, + 193, 192, 600, 0, 299, 298, 0, 400, 0, 505, + 110, 115, 517, 509, 527, 478, 35, 34, 615, 28, + 27, 109, 463, 462, 468, 113, 230, 387, 304, 360, + 8, 538, 110, 292, 291, 109, 114, 299, 298, 297, + 296, 364, 109, 306, 305, 365, 110, 378, 32, 31, + 8, 225, 8, 110, 202, 201, 116, 8, 225, 154, + 8, 192, 117, 8, 192, 555, 8, 9, 12, 8, + 226, 8, 227, 23, 57, 115, 30, 226, 155, 456, + 156, 63, 115, 57, 8, 539, 537, 9, 12, 9, + 12, 40, 0, 57, 9, 12, 57, 9, 12, 0, + 9, 12, 612, 9, 12, 8, 9, 12, 9, 12, + 136, 192, 137, 8, 542, 541, 8, 488, 487, 59, + 116, 9, 12, 138, 8, 0, 117, 116, 59, 8, + 58, 8, 192, 117, 0, 64, 62, 8, 59, 58, + 0, 59, 9, 12, 17, 16, 0, 0, 0, 58, + 9, 12, 58, 9, 12, 613, 611, 40, 0, 8, + 0, 9, 12, 8, 285, 284, 9, 12, 9, 12, + -334, 0, 15, 23, 9, 12, 8, 136, 0, 137, + 324, 325, 0, -334, 0, 285, 284, 0, 324, 325, + 138, 290, 289, 0, 8, 0, 9, 12, 0, 0, + 9, 12, 8, 0, 8, 24, 0, 326, 327, 329, + 330, 0, 0, 9, 12, 326, 327, 0, 331, 25, + 22, 332, 8, 333, 11, 8, 0, 0, 0, 0, + 0, 9, 12, 0, 290, 289, 295, 294, 0, 9, + 12, 9, 12, 8, 124, 125, 0, 21, 0, 0, + 10, 8, 11, 0, 0, 0, 0, 290, 289, 9, + 12, 0, 9, 12, 0, 129, 130, 0, 8, 0, + 0, 126, 127, 131, 132, 295, 294, 133, 10, 134, + 9, 12, 0, 295, 294, 129, 130, 0, 9, 12, + 0, 44, 0, 131, 132, 0, 0, 133, 11, 134, + 129, 130, 0, 45, 13, 9, 12, 0, 131, 132, + 8, 0, 133, 0, 134, 0, 44, 0, 329, 330, + 0, 0, 0, 0, 10, 0, 0, 331, 45, 0, + 332, 0, 333, 0, 0, 8, 553, 0, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 46, 48, 0, + 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, + 0, 47, 0, 0, 43, 11, 10, 0, 0, 204, + 0, 0, 46, 48, 0, 0, 0, 0, 0, 205, + 49, 0, 0, 206, 0, 0, 0, 129, 130, 43, + 0, 10, 207, 0, 208, 131, 132, 358, 0, 133, + 0, 134, 0, 0, 0, 209, 0, 210, 113, 0, + 0, 0, 0, 0, 0, 211, 0, 0, 212, 114, + 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, + 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 215, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 204, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 205, 0, 0, 0, + 206, 0, 0, 0, 0, 0, 0, 0, 0, 207, + 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 209, 0, 210, 113, 0, 0, 0, 0, + 0, 0, 211, 0, 0, 212, 114, 0, 0, 0, + 0, 213, 0, 0, 0, 0, 0, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 80, 81, 0, 0, 0, 0, 0, 0, - 0, 0, 83, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 84, 85, 0, 86, 0, 0, 0, - 0, 0, 0, 89, 0, 0, 0, 92, 0, 0, + 0, 0, 215, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 87, 88, 0, 0, 0, + 0, 0, 0, 0, 0, 90, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, 91, 92, 0, 93, + 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, + 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 102, 9, + 12, 0, 103, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 98, 105, 89, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 86, 87, 88, 0, 0, + 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 91, 92, 0, + 93, 0, 0, 0, 94, 0, 95, 96, 97, 0, + 0, 99, 0, 0, 0, 100, 0, 101, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, + 9, 12, 0, 103, 0, 104, 0, 106, 0, 107, + 0, 0, 0, 0, 98, 105, 89, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -113, 0, 0, 0, + 86, 87, 88, 0, 0, 0, 0, 0, 0, 0, + 0, 90, 0, 0, 0, 0, 0, 0, 8, 0, + 0, 0, 91, 92, 0, 93, 0, 0, 0, 94, + 0, 95, 96, 97, 0, 0, 99, 0, 0, 0, + 100, 0, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 102, 9, 12, 0, 103, 0, + 104, 0, 106, 0, 107, 0, 0, 0, 0, 98, + 105, 89, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 86, 87, 88, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 91, 92, 0, 93, 0, 0, 0, + 94, 0, 95, 96, 97, 0, 0, 99, 0, 0, + 0, 100, 0, 101, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 102, 9, 12, 0, 103, + 0, 104, 0, 106, 321, 107, 0, 0, 0, 0, + 98, 105, 89, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 514, 0, 0, 86, 87, 88, 0, 0, + 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 91, 92, 0, + 93, 0, 0, 0, 94, 0, 95, 96, 97, 0, + 0, 99, 0, 0, 0, 100, 0, 101, 0, 0, + 515, 0, 0, 0, 0, 0, 0, 0, 0, 102, + 9, 12, 0, 103, 0, 104, 0, 106, 0, 107, + 0, 0, 0, 0, 98, 105, 89, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 514, 0, 0, 86, + 87, 88, 0, 0, 0, 0, 0, 0, 0, 0, + 90, 0, 0, 0, 0, 0, 0, 8, 0, 0, + 0, 91, 92, 0, 93, 0, 0, 0, 94, 0, + 95, 96, 97, 0, 0, 99, 0, 0, 0, 100, + 0, 101, 0, 0, 520, 0, 0, 0, 0, 0, + 0, 0, 0, 102, 9, 12, 0, 103, 0, 104, + 0, 106, 0, 107, 0, 0, 0, 0, 98, 105, + 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 522, 0, 0, 86, 87, 88, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, + 0, 8, 0, 0, 0, 91, 92, 0, 93, 0, + 0, 0, 94, 0, 95, 96, 97, 0, 0, 99, + 0, 0, 0, 100, 0, 101, 0, 0, 523, 0, + 0, 0, 0, 0, 0, 0, 0, 102, 9, 12, + 0, 103, 0, 104, 0, 106, 0, 107, 0, 0, + 0, 0, 98, 105, 89, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 522, 0, 0, 86, 87, 88, + 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, + 0, 0, 0, 0, 0, 8, 0, 0, 0, 91, + 92, 0, 93, 0, 0, 0, 94, 0, 95, 96, + 97, 0, 0, 99, 0, 0, 0, 100, 0, 101, + 0, 0, 525, 0, 0, 0, 0, 0, 0, 0, + 0, 102, 9, 12, 0, 103, 0, 104, 0, 106, + 0, 107, 0, 0, 0, 0, 98, 105, 89, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 514, 0, + 0, 86, 87, 88, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 91, 92, 0, 93, 0, 0, 0, + 94, 0, 95, 96, 97, 0, 0, 99, 0, 0, + 0, 100, 0, 101, 0, 0, 515, 0, 0, 11, + 0, 0, 0, 0, 0, 102, 9, 12, 0, 103, + 0, 104, 0, 106, 0, 107, 0, 0, 0, 0, + 98, 105, 89, 0, 0, 10, 0, 0, 0, 0, + 0, 0, 86, 87, 88, 0, 0, 0, 0, 0, + 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, + 8, 269, 0, 0, 562, 563, 0, 93, 0, 0, + 0, 94, 0, 95, 96, 97, 0, 0, 99, 0, + 0, 0, 100, 0, 101, 0, 0, 0, 0, 0, + 0, 0, 273, 0, 0, 0, 102, 9, 12, 0, + 103, 0, 104, 0, 106, 0, 107, 0, 0, 0, + 0, 98, 105, 89, 0, 264, 0, 564, 0, 0, + 0, 0, 0, 160, 161, 162, 0, 0, 164, 166, + 167, 0, 0, 168, 0, 169, 0, 0, 0, 171, + 172, 173, 0, 0, 0, 0, 0, 0, 8, 174, + 175, 176, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 177, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 180, 0, + 0, 0, 0, 0, 0, 9, 12, 181, 182, 183, + 0, 185, 186, 187, 188, 189, 190, 0, 0, 178, + 184, 170, 163, 165, 179, 0, 0, 0, 0, 0, + 0, 160, 161, 162, 0, 0, 164, 166, 167, 0, + 0, 168, 0, 169, 0, 0, 0, 171, 172, 173, + 0, 0, 0, 0, 0, 0, 443, 174, 175, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 95, 9, 12, 0, 96, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 91, 98, 82, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 79, 80, 81, 0, 0, 0, 0, 0, - 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 84, 85, 0, 86, 0, 0, - 0, 87, 0, 88, 89, 90, 0, 0, 92, 0, - 0, 0, 93, 0, 94, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 95, 9, 12, 0, - 96, 0, 97, 0, 99, 0, 100, 0, 0, 0, - 0, 91, 98, 82, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 79, 80, 81, 0, 0, 0, 0, - 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, - 0, 8, 0, 0, 0, 84, 85, 0, 86, 0, - 0, 0, 87, 0, 88, 89, 90, 0, 0, 92, - 0, 0, 0, 93, 0, 94, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 95, 9, 12, - 0, 96, 0, 97, 0, 99, 314, 100, 0, 0, - 0, 0, 91, 98, 82, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -109, 0, 0, 0, 79, 80, - 81, 0, 0, 0, 0, 0, 0, 0, 0, 83, - 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, - 84, 85, 0, 86, 0, 0, 0, 87, 0, 88, - 89, 90, 0, 0, 92, 0, 0, 0, 93, 0, - 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 95, 9, 12, 0, 96, 0, 97, 0, - 99, 0, 100, 0, 0, 0, 0, 91, 98, 82, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 515, - 0, 0, 79, 80, 81, 0, 0, 0, 0, 0, - 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 84, 85, 0, 86, 0, 0, - 0, 87, 0, 88, 89, 90, 0, 0, 92, 0, - 0, 0, 93, 0, 94, 0, 0, 518, 0, 0, - 0, 0, 0, 0, 0, 0, 95, 9, 12, 0, - 96, 0, 97, 0, 99, 0, 100, 0, 0, 0, - 0, 91, 98, 82, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 515, 0, 0, 79, 80, 81, 0, - 0, 0, 0, 0, 0, 0, 0, 83, 0, 0, - 0, 0, 0, 0, 8, 0, 0, 0, 84, 85, - 0, 86, 0, 0, 0, 87, 0, 88, 89, 90, - 0, 0, 92, 0, 0, 0, 93, 0, 94, 0, - 0, 516, 0, 0, 0, 0, 0, 0, 0, 0, - 95, 9, 12, 0, 96, 0, 97, 0, 99, 0, - 100, 0, 0, 0, 0, 91, 98, 82, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 507, 0, 0, - 79, 80, 81, 0, 0, 0, 0, 0, 0, 0, - 0, 83, 0, 0, 0, 0, 0, 0, 8, 0, - 0, 0, 84, 85, 0, 86, 0, 0, 0, 87, - 0, 88, 89, 90, 0, 0, 92, 0, 0, 0, - 93, 0, 94, 0, 0, 513, 0, 0, 0, 0, - 0, 0, 0, 0, 95, 9, 12, 0, 96, 0, - 97, 0, 99, 0, 100, 0, 0, 0, 0, 91, - 98, 82, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 507, 0, 0, 79, 80, 81, 0, 0, 0, - 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, - 0, 0, 8, 0, 0, 0, 84, 85, 0, 86, - 0, 0, 0, 87, 0, 88, 89, 90, 0, 0, - 92, 0, 0, 0, 93, 0, 94, 0, 0, 508, - 0, 0, 0, 0, 0, 0, 0, 0, 95, 9, - 12, 0, 96, 0, 97, 0, 99, 0, 100, 0, - 0, 0, 0, 91, 98, 82, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 507, 0, 0, 79, 80, - 81, 0, 0, 0, 0, 0, 0, 0, 0, 83, - 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, - 84, 85, 0, 86, 0, 0, 0, 87, 0, 88, - 89, 90, 0, 0, 92, 0, 0, 0, 93, 0, - 94, 0, 0, 508, 0, 0, 11, 0, 0, 0, - 0, 0, 95, 9, 12, 0, 96, 0, 97, 0, - 99, 0, 100, 0, 0, 0, 0, 91, 98, 82, - 0, 0, 10, 0, 0, 0, 0, 0, 0, 79, - 80, 81, 0, 0, 0, 0, 0, 0, 0, 0, - 83, 0, 0, 0, 0, 0, 0, 8, 262, 0, - 0, 555, 556, 0, 86, 0, 0, 0, 87, 0, - 88, 89, 90, 0, 0, 92, 0, 0, 0, 93, - 0, 94, 0, 0, 0, 0, 0, 0, 0, 266, - 0, 0, 0, 95, 9, 12, 0, 96, 0, 97, - 0, 99, 0, 100, 0, 0, 0, 0, 91, 98, - 82, 0, 257, 0, 557, 0, 0, 0, 0, 0, - 153, 154, 155, 0, 0, 157, 159, 160, 0, 0, - 161, 0, 162, 0, 0, 0, 164, 165, 166, 0, - 0, 0, 0, 0, 0, 8, 167, 168, 169, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 173, 0, 0, 0, 0, - 0, 0, 9, 12, 174, 175, 176, 0, 178, 179, - 180, 181, 182, 183, 0, 0, 171, 177, 163, 156, - 158, 172, 0, 0, 0, 0, 0, 0, 153, 154, - 155, 0, 0, 157, 159, 160, 0, 0, 161, 0, - 162, 0, 0, 0, 164, 165, 166, 0, 0, 0, - 0, 0, 0, 436, 167, 168, 169, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 170, 0, 0, - 0, 437, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 173, 0, 0, 0, 0, 0, 441, - 438, 440, 174, 175, 176, 0, 178, 179, 180, 181, - 182, 183, 0, 0, 171, 177, 163, 156, 158, 172, - 0, 0, 0, 0, 0, 0, 153, 154, 155, 0, - 0, 157, 159, 160, 0, 0, 161, 0, 162, 0, - 0, 0, 164, 165, 166, 0, 0, 0, 0, 0, - 0, 436, 167, 168, 169, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 170, 0, 0, 0, 437, - 0, 0, 0, 0, 0, 0, 0, 439, 0, 0, - 0, 173, 0, 0, 0, 0, 0, 441, 438, 440, - 174, 175, 176, 0, 178, 179, 180, 181, 182, 183, - 0, 0, 171, 177, 163, 156, 158, 172, 0, 0, - 0, 0, 0, 0, 255, 0, 0, 0, 0, 256, - 0, 79, 80, 81, 258, 0, 0, 0, 0, 0, - 0, 259, 260, 0, 0, 0, 0, 0, 0, 261, - 262, 0, 0, 263, 85, 0, 86, 0, 0, 0, - 87, 0, 88, 89, 90, 0, 0, 92, 0, 0, - 0, 93, 0, 94, 0, 0, 0, 0, 0, 265, - 0, 266, 0, 0, 0, 95, 264, 267, 268, 96, - 269, 97, 270, 99, 42, 100, 271, 272, 0, 0, - 91, 98, 82, 36, 257, 0, 0, 0, 0, 0, - 0, 0, 255, 0, 0, 0, 0, 256, 0, 79, - 80, 81, 258, 0, 0, 0, 0, 0, 0, 259, - 83, 0, 0, 0, 0, 0, 0, 261, 262, 0, - 0, 263, 85, 0, 86, 0, 0, 0, 87, 0, - 88, 89, 90, 0, 0, 92, 0, 0, 0, 93, - 0, 94, 0, 0, 0, 0, 0, 265, 0, 266, - 0, 0, 0, 95, 264, 267, 268, 96, 269, 97, - 270, 99, 42, 100, 271, 272, 0, 0, 91, 98, - 82, 36, 257, 0, 0, 0, 0, 0, 0, 0, - 561, 154, 155, 0, 0, 563, 159, 565, 80, 81, - 566, 0, 162, 0, 0, 0, 164, 568, 569, 0, - 0, 0, 0, 0, 0, 570, 571, 168, 169, 263, - 85, 0, 86, 0, 0, 0, 87, 0, 88, 572, - 90, 0, 0, 574, 0, 0, 0, 93, 0, 94, - 0, 0, 0, 0, 0, 576, 0, 266, 0, 0, - 0, 578, 575, 577, 579, 580, 581, 97, 583, 584, - 585, 586, 587, 588, 0, 0, 573, 582, 567, 562, - 564, 172, 0, 0, 0, 0, 0, 0, 404, 154, - 155, 0, 0, 406, 159, 408, 80, 81, 409, 0, - 162, 0, 0, 0, 164, 411, 412, 0, 0, 0, - 0, 0, 0, 413, 414, 168, 169, 263, 85, 0, - 86, 0, 0, 0, 87, 0, 88, 415, 90, 0, - 0, 417, 0, 0, 0, 93, 0, 94, 0, -255, - 0, 0, 0, 419, 0, 266, 0, 0, 0, 421, - 418, 420, 422, 423, 424, 97, 426, 427, 428, 429, - 430, 431, 0, 0, 416, 425, 410, 405, 407, 172, - 0, 0, 0, 0, 0, 0, + 177, 0, 0, 0, 444, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 180, 0, 0, 0, + 0, 0, 448, 445, 447, 181, 182, 183, 0, 185, + 186, 187, 188, 189, 190, 0, 0, 178, 184, 170, + 163, 165, 179, 0, 0, 0, 0, 0, 0, 160, + 161, 162, 0, 0, 164, 166, 167, 0, 0, 168, + 0, 169, 0, 0, 0, 171, 172, 173, 0, 0, + 0, 0, 0, 0, 443, 174, 175, 176, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 177, 0, + 0, 0, 444, 0, 0, 0, 0, 0, 0, 0, + 446, 0, 0, 0, 180, 0, 0, 0, 0, 0, + 448, 445, 447, 181, 182, 183, 0, 185, 186, 187, + 188, 189, 190, 0, 0, 178, 184, 170, 163, 165, + 179, 0, 0, 0, 0, 0, 0, 262, 0, 0, + 0, 0, 263, 0, 86, 87, 88, 265, 0, 0, + 0, 0, 0, 0, 266, 90, 0, 0, 0, 0, + 0, 0, 268, 269, 0, 0, 270, 92, 0, 93, + 0, 0, 0, 94, 0, 95, 96, 97, 0, 0, + 99, 0, 0, 0, 100, 0, 101, 0, 0, 0, + 0, 0, 272, 0, 273, 0, 0, 0, 102, 271, + 274, 275, 103, 276, 104, 277, 106, 49, 107, 278, + 279, 0, 0, 98, 105, 89, 43, 264, 0, 0, + 0, 0, 0, 0, 0, 262, 0, 0, 0, 0, + 263, 0, 86, 87, 88, 265, 0, 0, 0, 0, + 0, 0, 266, 267, 0, 0, 0, 0, 0, 0, + 268, 269, 0, 0, 270, 92, 0, 93, 0, 0, + 0, 94, 0, 95, 96, 97, 0, 0, 99, 0, + 0, 0, 100, 0, 101, 0, 0, 0, 0, 0, + 272, 0, 273, 0, 0, 0, 102, 271, 274, 275, + 103, 276, 104, 277, 106, 49, 107, 278, 279, 0, + 0, 98, 105, 89, 43, 264, 0, 0, 0, 0, + 0, 0, 0, 568, 161, 162, 0, 0, 570, 166, + 572, 87, 88, 573, 0, 169, 0, 0, 0, 171, + 575, 576, 0, 0, 0, 0, 0, 0, 577, 578, + 175, 176, 270, 92, 0, 93, 0, 0, 0, 94, + 0, 95, 579, 97, 0, 0, 581, 0, 0, 0, + 100, 0, 101, 0, 0, 0, 0, 0, 583, 0, + 273, 0, 0, 0, 585, 582, 584, 586, 587, 588, + 104, 590, 591, 592, 593, 594, 595, 0, 0, 580, + 589, 574, 569, 571, 179, 0, 0, 0, 0, 0, + 0, 411, 161, 162, 0, 0, 413, 166, 415, 87, + 88, 416, 0, 169, 0, 0, 0, 171, 418, 419, + 0, 0, 0, 0, 0, 0, 420, 421, 175, 176, + 270, 92, 0, 93, 0, 0, 0, 94, 0, 95, + 422, 97, 0, 0, 424, 0, 0, 0, 100, 0, + 101, 0, -259, 0, 0, 0, 426, 0, 273, 0, + 0, 0, 428, 425, 427, 429, 430, 431, 104, 433, + 434, 435, 436, 437, 438, 0, 0, 423, 432, 417, + 412, 414, 179, 0, 0, 0, 0, 0, 0, - 545, 488, 533, 542, 66, 478, 514, 597, 482, 253, - 543, 479, 517, 232, 53, 504, 493, 228, 497, 503, - 345, 499, 234, 519, 501, 286, 196, 293, 490, 492, - 382, 540, 527, 479, 396, 184, 445, 190, 345, 286, - 345, 293, 228, 209, 394, 192, 377, 392, 354, 352, - 479, 25, 379, 390, 350, 18, 28, 475, 381, 187, - 560, 460, 215, 482, 472, 458, 222, 296, 476, 217, - 468, 435, 363, 433, 29, 482, 228, 286, 597, 7, - 150, 594, 104, 453, 494, 603, 443, 232, 7, 293, - 30, 0, 447, 7, 14, 448, 363, 104, 281, 495, - 345, 104, 104, 226, 104, 104, 134, 152, 104, 104, - 138, 253, 253, 345, 139, 345, 144, 104, 146, 226, - 104, 104, 494, 345, 104, 132, 495, 104, 0, 104, - 104, 133, 309, 190, 327, 104, 104, 313, 104, 224, - 387, 328, 104, 329, 211, 0, 280, 331, 104, 447, - 375, 214, 448, 330, 607, 0, 104, 104, 526, 111, - 104, 104, 494, 373, 105, 348, 104, 104, 104, 114, - 525, 0, 137, 346, 372, 0, 104, 384, 226, 104, - 104, 524, 521, 447, 104, 104, 448, 523, 104, 136, - 522, 104, 104, 495, 0, 104, 512, 190, 121, 104, - 511, 140, 104, 450, 104, 141, 104, 0, 142, 128, - 150, 135, 104, 104, 104, 113, 0, 104, 104, 313, - 116, 332, 313, 313, 333, 321, 104, 341, 104, 104, - 0, 313, 313, 313, 313, 316, 334, 152, 221, 338, - 341, 104, 341, 341, 0, 313, 313, 313, 313, 369, - 341, 0, 104, 104, 0, 313, 356, 313, 313, 7, - 46, 0, 340, 0, 343, 362, 336, 7, 46, 359, - 0, 547, 360, 104, 0, 112, 0, 35, 48, 552, - 549, 551, 553, 550, 554, 35, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 506, 499, 504, 300, 73, 510, 288, 524, 203, 521, + 610, 36, 508, 370, 216, 60, 352, 29, 389, 199, + 567, 26, 260, 239, 241, 33, 288, 300, 486, 222, + 489, 229, 604, 534, 18, 235, 293, 540, 303, 550, + 489, 552, 547, 497, 475, 235, 486, 482, 403, 399, + 479, 191, 361, 549, 288, 483, 224, 467, 357, 293, + 359, 465, 386, 452, 460, 495, 235, 401, 500, 197, + 384, 300, 194, 486, 450, 489, 442, 440, 397, 526, + 352, 511, 485, 370, 7, 352, 37, 352, 7, 14, + 604, 352, 111, 239, 233, 111, 111, 501, 111, 157, + 0, 146, 139, 454, 111, 0, 455, 111, 141, 454, + 111, 140, 455, 7, 111, 601, 233, 388, 0, 519, + 153, 111, 111, 518, 260, 454, 159, 145, 455, 111, + 355, 501, 0, 151, 352, 353, 111, 382, 502, 260, + 111, 380, 111, 0, 119, 142, 111, 111, 501, 532, + 111, 111, 533, 502, 111, 111, 118, 502, 287, 111, + 0, 379, 111, 0, 0, 121, 614, 111, 394, 531, + 111, 111, 111, 218, 111, 336, 338, 335, 111, 334, + 233, 111, 111, 391, 528, 111, 337, 529, 111, 316, + 530, 111, 111, 111, 320, 111, 111, 148, 149, 147, + 135, 143, 111, 197, 197, 111, 111, 144, 0, 231, + 457, 111, 111, 123, 120, 157, 596, 128, 598, 111, + 111, 0, 221, 111, 320, 320, 112, 328, 323, 111, + 348, 0, 111, 348, 320, 320, 339, 320, 320, 341, + 348, 511, 159, 228, 111, 320, 111, 0, 111, 320, + 0, 320, 376, 320, 0, 369, 0, 345, 348, 363, + 348, 343, 350, 320, 111, 320, 7, 53, 0, 320, + 554, 559, 556, 558, 560, 557, 561, 0, 0, 0, + 347, 366, 367, 0, 42, 55, 111, 0, 0, 0, + 0, 320, 0, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 589, 0, 591, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, + 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 42, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0}; + 0, 0, 0, 0, 0, 0, 0}; const int QmlJSGrammar::action_check [] = { - 60, 33, 60, 36, 78, 1, 16, 20, 17, 61, - 8, 60, 36, 5, 48, 31, 17, 2, 7, 7, - 60, 5, 36, 60, 60, 33, 33, 55, 5, 7, - 61, 36, 55, 36, 7, 7, 36, 7, 7, 36, - 7, 36, 36, 7, 7, 7, 33, 29, 7, 7, - 33, 7, 7, 7, 7, 36, 36, 36, 7, 7, - 7, 36, 8, 7, 7, 36, 78, 33, 33, 8, - 7, 7, 76, 33, 8, 36, 8, 88, 7, 55, - 2, 55, 1, 7, 36, 36, 36, 78, 33, 1, - 8, 48, 78, 61, 36, 36, 2, 1, 88, 0, - 8, 36, -1, 29, 29, 7, 8, -1, 8, 6, - 8, -1, 15, 8, -1, 8, 8, 40, 48, 8, - 60, 48, 60, 20, 55, 40, 10, 60, 51, 8, - 33, 40, 42, 8, 8, 8, 51, 8, 66, 8, - 61, 62, 51, 53, 61, 62, 8, 61, 62, -1, - 61, 62, 60, 2, 61, 62, 61, 62, 56, 40, - 60, 56, 61, 62, 56, 61, 62, 60, 29, 29, - 51, 55, 61, 50, 50, 61, 62, 54, 54, 61, - 62, 60, 25, 15, 27, 60, 60, 60, 12, 60, - 15, 8, 61, 62, 56, 38, 61, 62, 29, 7, - 29, 29, 34, 29, 36, 66, 67, 12, -1, 34, - 25, 36, 27, 25, 74, 27, 25, 12, 27, 25, - 8, 27, 29, 38, 89, 85, 38, 29, 25, 38, - 27, 7, 38, 57, 8, 66, 67, 66, 67, 63, - 8, 38, 15, 29, 61, 62, 74, 25, 74, 27, - -1, -1, 57, 61, 62, -1, -1, 85, 63, 85, - 38, 34, 57, 36, 66, 67, 29, 74, 63, 25, - 25, 27, 27, 61, 62, 29, -1, -1, 85, 29, - 66, 67, 38, 38, 29, 61, 62, 61, 62, 25, - 29, 27, 29, 61, 62, 25, 25, 27, 27, 36, - 15, -1, 38, 66, 67, 25, 7, 27, 38, 38, - 18, 19, 66, 67, 15, 8, 66, 67, 38, 29, - -1, 66, 67, 18, 19, -1, 36, 66, 67, 66, - 67, -1, 33, -1, -1, -1, -1, 45, 46, -1, - 33, -1, -1, -1, -1, 29, 61, 62, 29, -1, - 45, 46, 23, 24, -1, -1, 66, 67, 23, 24, - -1, 32, 29, -1, 35, 29, 37, 32, 61, 62, - 35, 29, 37, 29, 89, 23, 24, 61, 62, -1, - 61, 62, 66, 67, 32, 66, 67, 35, 29, 37, - -1, 18, 19, 29, 61, 62, -1, 61, 62, 66, - 67, 59, 66, 67, -1, 61, 62, -1, 66, 67, - 66, 67, -1, -1, -1, -1, -1, -1, 45, 46, - 61, 62, -1, 59, 29, 66, 67, 85, 23, 24, - 66, 67, -1, -1, -1, -1, 31, 32, 23, 24, - 35, -1, 37, -1, -1, -1, 31, 32, -1, 85, - 35, -1, 37, -1, 59, 23, 24, -1, -1, -1, - 65, 66, 67, 31, 32, 23, 24, 35, -1, 37, - -1, -1, 10, -1, 32, -1, -1, 35, -1, 37, - 85, -1, -1, -1, 22, -1, -1, -1, -1, -1, - -1, 29, -1, -1, -1, 10, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, 55, -1, -1, - -1, 59, -1, -1, -1, -1, -1, -1, 66, 67, - -1, -1, -1, -1, 23, 24, 74, -1, -1, 3, - 55, -1, 31, 32, 59, 83, 35, 85, 37, 13, - -1, 66, 67, 17, -1, -1, -1, -1, -1, 74, - -1, -1, 26, -1, 28, -1, -1, 31, 83, -1, - 85, -1, -1, -1, -1, 39, -1, 41, 42, -1, + 78, 48, 29, 60, 8, 78, 60, 48, 2, 1, + 55, 78, 1, 20, 29, 33, 36, 33, 5, 33, + 5, 7, 5, 7, 61, 7, 7, 36, 36, 7, + 7, 61, 55, 36, 55, 7, 16, 8, 60, 7, + 31, 36, 55, 7, 7, 33, 36, 2, 60, 7, + 17, 48, 2, 7, 33, 7, 7, 55, 7, 61, + 36, 36, 8, 7, 7, 7, 36, 36, 7, 7, + 36, 36, 33, 7, 36, 7, 36, 1, 88, 36, + 17, 7, 7, 36, 7, 33, 60, 7, 33, 36, + 1, 8, 33, 29, 2, 88, 36, 15, 8, 8, + -1, 60, 8, 76, 8, 8, 36, 8, 36, 36, + 66, 8, 8, 48, 8, 33, -1, -1, 6, -1, + 10, -1, 8, 7, 8, 8, 8, 8, 8, 60, + -1, 60, 20, -1, -1, 50, -1, -1, 60, 54, + 61, 62, 61, 62, 8, 78, -1, 61, 62, 40, + 56, 8, 56, -1, 61, 62, -1, 60, -1, 60, + 51, 12, 56, 60, 60, 55, 61, 62, 0, 61, + 62, 40, 61, 62, 60, 42, 56, 60, 60, 60, + 29, 7, 51, 61, 62, 40, 53, 61, 62, 61, + 62, 50, 40, 61, 62, 54, 51, 61, 61, 62, + 29, 15, 29, 51, 61, 62, 57, 29, 15, 15, + 29, 8, 63, 29, 8, 7, 29, 66, 67, 29, + 34, 29, 36, 15, 29, 12, 89, 34, 34, 36, + 36, 7, 12, 29, 29, 61, 62, 66, 67, 66, + 67, 33, -1, 29, 66, 67, 29, 66, 67, -1, + 66, 67, 8, 66, 67, 29, 66, 67, 66, 67, + 25, 8, 27, 29, 61, 62, 29, 61, 62, 74, + 57, 66, 67, 38, 29, -1, 63, 57, 74, 29, + 85, 29, 8, 63, -1, 61, 62, 29, 74, 85, + -1, 74, 66, 67, 61, 62, -1, -1, -1, 85, + 66, 67, 85, 66, 67, 61, 62, 33, -1, 29, + -1, 66, 67, 29, 61, 62, 66, 67, 66, 67, + 36, -1, 89, 15, 66, 67, 29, 25, -1, 27, + 18, 19, -1, 36, -1, 61, 62, -1, 18, 19, + 38, 61, 62, -1, 29, -1, 66, 67, -1, -1, + 66, 67, 29, -1, 29, 47, -1, 45, 46, 23, + 24, -1, -1, 66, 67, 45, 46, -1, 32, 61, + 62, 35, 29, 37, 59, 29, -1, -1, -1, -1, + -1, 66, 67, -1, 61, 62, 61, 62, -1, 66, + 67, 66, 67, 29, 18, 19, -1, 89, -1, -1, + 85, 29, 59, -1, -1, -1, -1, 61, 62, 66, + 67, -1, 66, 67, -1, 23, 24, -1, 29, -1, + -1, 45, 46, 31, 32, 61, 62, 35, 85, 37, + 66, 67, -1, 61, 62, 23, 24, -1, 66, 67, + -1, 10, -1, 31, 32, -1, -1, 35, 59, 37, + 23, 24, -1, 22, 65, 66, 67, -1, 31, 32, + 29, -1, 35, -1, 37, -1, 10, -1, 23, 24, + -1, -1, -1, -1, 85, -1, -1, 32, 22, -1, + 35, -1, 37, -1, -1, 29, 55, -1, -1, -1, + 59, -1, -1, -1, -1, -1, -1, 66, 67, -1, + -1, -1, -1, -1, -1, 74, -1, -1, -1, -1, + -1, 55, -1, -1, 83, 59, 85, -1, -1, 3, + -1, -1, 66, 67, -1, -1, -1, -1, -1, 13, + 74, -1, -1, 17, -1, -1, -1, 23, 24, 83, + -1, 85, 26, -1, 28, 31, 32, 31, -1, 35, + -1, 37, -1, -1, -1, 39, -1, 41, 42, -1, -1, -1, -1, -1, -1, 49, -1, -1, 52, 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, - 64, -1, -1, 3, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 13, -1, 79, -1, 17, -1, -1, - -1, -1, -1, -1, -1, -1, 26, -1, 28, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, - -1, 41, 42, -1, -1, -1, -1, -1, -1, 49, - -1, -1, 52, 53, -1, -1, -1, -1, 58, -1, - -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, + 17, -1, -1, -1, -1, -1, -1, -1, -1, 26, + -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 39, -1, 41, 42, -1, -1, -1, -1, + -1, -1, 49, -1, -1, 52, 53, -1, -1, -1, + -1, 58, -1, -1, -1, -1, -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, + -1, -1, 79, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, + 67, -1, 69, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 80, 81, 82, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, + -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, + -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, + 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, + -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, + 66, 67, -1, 69, -1, 71, -1, 73, -1, 75, + -1, -1, -1, -1, 80, 81, 82, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, + 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, -1, 69, -1, + 71, -1, 73, -1, 75, -1, -1, -1, -1, 80, + 81, 82, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, - -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, + -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, 69, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 71, -1, 73, 74, 75, -1, -1, -1, -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, - -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, - 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, - -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, - -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, - 69, -1, 71, -1, 73, -1, 75, -1, -1, -1, - -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, + -1, -1, 8, -1, -1, 11, 12, 13, -1, -1, + -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, + -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, + 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, + -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, + 56, -1, -1, -1, -1, -1, -1, -1, -1, 65, + 66, 67, -1, 69, -1, 71, -1, 73, -1, 75, + -1, -1, -1, -1, 80, 81, 82, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, + 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, + 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, + -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, + 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, + -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, + -1, -1, -1, 65, 66, 67, -1, 69, -1, 71, + -1, 73, -1, 75, -1, -1, -1, -1, 80, 81, + 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 8, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, + -1, -1, -1, 51, -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, - -1, 69, -1, 71, -1, 73, 74, 75, -1, -1, + -1, 69, -1, 71, -1, 73, -1, 75, -1, -1, -1, -1, 80, 81, 82, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 7, -1, -1, -1, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, - -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, - 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, - 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 65, 66, 67, -1, 69, -1, 71, -1, - 73, -1, 75, -1, -1, -1, -1, 80, 81, 82, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, + -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, -1, 69, -1, 71, -1, 73, + -1, 75, -1, -1, -1, -1, 80, 81, 82, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, + -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, + -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, + -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, + 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, + -1, 51, -1, 53, -1, -1, 56, -1, -1, 59, + -1, -1, -1, -1, -1, 65, 66, 67, -1, 69, + -1, 71, -1, 73, -1, 75, -1, -1, -1, -1, + 80, 81, 82, -1, -1, 85, -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, - 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, - -1, -1, 51, -1, 53, -1, -1, 56, -1, -1, - -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, + -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + -1, -1, 61, -1, -1, -1, 65, 66, 67, -1, 69, -1, 71, -1, 73, -1, 75, -1, -1, -1, - -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 8, -1, -1, 11, 12, 13, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, - -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, - -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, - -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 67, -1, 69, -1, 71, -1, 73, -1, - 75, -1, -1, -1, -1, 80, 81, 82, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, - 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, - -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, - -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, - 51, -1, 53, -1, -1, 56, -1, -1, -1, -1, - -1, -1, -1, -1, 65, 66, 67, -1, 69, -1, - 71, -1, 73, -1, 75, -1, -1, -1, -1, 80, - 81, 82, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 8, -1, -1, 11, 12, 13, -1, -1, -1, - -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, 80, 81, 82, -1, 84, -1, 86, -1, -1, + -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, + 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, + 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, + 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, + -1, -1, -1, -1, -1, 66, 67, 68, 69, 70, + -1, 72, 73, 74, 75, 76, 77, -1, -1, 80, + 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, + -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, + -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, + -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, + -1, -1, 65, 66, 67, 68, 69, 70, -1, 72, + 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, + 83, 84, 85, -1, -1, -1, -1, -1, -1, 4, + 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, + -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, + -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, + -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, + 55, -1, -1, -1, 59, -1, -1, -1, -1, -1, + 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, + 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, + 85, -1, -1, -1, -1, -1, -1, 4, -1, -1, + -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, + -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, + -1, -1, 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, - 47, -1, -1, -1, 51, -1, 53, -1, -1, 56, - -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, - 67, -1, 69, -1, 71, -1, 73, -1, 75, -1, - -1, -1, -1, 80, 81, 82, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 8, -1, -1, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, - -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, + -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, 80, 81, 82, 83, 84, -1, -1, + -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, + 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, + -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, + 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, + -1, 80, 81, 82, 83, 84, -1, -1, -1, -1, + -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, + 11, 12, 13, 14, -1, 16, -1, -1, -1, 20, + 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, + 31, 32, 33, 34, -1, 36, -1, -1, -1, 40, + -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, + 51, -1, 53, -1, -1, -1, -1, -1, 59, -1, + 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, -1, -1, 80, + 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, + -1, 4, 5, 6, -1, -1, 9, 10, 11, 12, + 13, 14, -1, 16, -1, -1, -1, 20, 21, 22, + -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, 56, -1, -1, 59, -1, -1, -1, - -1, -1, 65, 66, 67, -1, 69, -1, 71, -1, - 73, -1, 75, -1, -1, -1, -1, 80, 81, 82, - -1, -1, 85, -1, -1, -1, -1, -1, -1, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, -1, -1, -1, -1, -1, 61, - -1, -1, -1, 65, 66, 67, -1, 69, -1, 71, - -1, 73, -1, 75, -1, -1, -1, -1, 80, 81, - 82, -1, 84, -1, 86, -1, -1, -1, -1, -1, - 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, - 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, - -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, - -1, -1, 66, 67, 68, 69, 70, -1, 72, 73, - 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, - 84, 85, -1, -1, -1, -1, -1, -1, 4, 5, - 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, - 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, - -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, - -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, -1, -1, -1, -1, -1, 65, - 66, 67, 68, 69, 70, -1, 72, 73, 74, 75, - 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, - -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, - -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, - -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, - -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 43, -1, -1, -1, 47, - -1, -1, -1, -1, -1, -1, -1, 55, -1, -1, - -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, - 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, - -1, -1, 80, 81, 82, 83, 84, 85, -1, -1, - -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, - -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, - -1, 21, 22, -1, -1, -1, -1, -1, -1, 29, - 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, - 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, - -1, 51, -1, 53, -1, -1, -1, -1, -1, 59, - -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, - 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, - -1, -1, 4, -1, -1, -1, -1, 9, -1, 11, - 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, - 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, - -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, - 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, - 4, 5, 6, -1, -1, 9, 10, 11, 12, 13, - 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, - -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, - 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, - 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, - -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, - -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, - 84, 85, -1, -1, -1, -1, -1, -1, 4, 5, - 6, -1, -1, 9, 10, 11, 12, 13, 14, -1, - 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, -1, - 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, - -1, 47, -1, -1, -1, 51, -1, 53, -1, 55, - -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, - -1, -1, -1, -1, -1, -1, + 53, -1, 55, -1, -1, -1, 59, -1, 61, -1, + -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, + 83, 84, 85, -1, -1, -1, -1, -1, -1, - 6, 95, 15, 21, 15, 78, 31, 6, 16, 68, - 6, 15, 31, 6, 21, 31, 16, 6, 15, 68, - 15, 68, 6, 15, 15, 6, 64, 68, 6, 16, - 6, 21, 6, 15, 68, 15, 68, 31, 15, 6, - 15, 68, 6, 31, 68, 31, 68, 15, 68, 15, - 15, 6, 15, 68, 68, 6, 6, 78, 68, 31, - 12, 15, 31, 16, 90, 68, 15, 15, 15, 31, - 93, 32, 6, 31, 5, 16, 6, 6, 6, 6, - 6, 8, 41, 68, 43, 31, 31, 6, 6, 68, - 8, -1, 35, 6, 7, 38, 6, 41, 6, 43, - 15, 41, 41, 43, 41, 41, 45, 33, 41, 41, - 46, 68, 68, 15, 46, 15, 53, 41, 51, 43, - 41, 41, 43, 15, 41, 45, 43, 41, -1, 41, - 41, 45, 41, 31, 46, 41, 41, 46, 41, 37, - 97, 46, 41, 46, 55, -1, 102, 46, 41, 35, - 65, 57, 38, 46, 82, -1, 41, 41, 43, 43, - 41, 41, 43, 65, 44, 65, 41, 41, 41, 44, - 43, -1, 46, 65, 84, -1, 41, 96, 43, 41, - 41, 43, 43, 35, 41, 41, 38, 43, 41, 46, - 43, 41, 41, 43, -1, 41, 27, 31, 47, 41, - 31, 47, 41, 37, 41, 47, 41, -1, 47, 46, - 6, 46, 41, 41, 41, 43, -1, 41, 41, 46, - 49, 48, 46, 46, 48, 48, 41, 41, 41, 41, - -1, 46, 46, 46, 46, 50, 48, 33, 34, 52, - 41, 41, 41, 41, -1, 46, 46, 46, 46, 63, - 41, -1, 41, 41, -1, 46, 56, 46, 46, 6, - 7, -1, 63, -1, 63, 63, 54, 6, 7, 58, - -1, 10, 63, 41, -1, 43, -1, 24, 25, 15, - 16, 17, 18, 19, 20, 24, 25, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 68, 16, 15, 68, 15, 68, 6, 31, 64, 31, + 31, 5, 15, 6, 31, 21, 15, 6, 6, 31, + 12, 6, 68, 6, 6, 6, 6, 68, 15, 31, + 16, 15, 6, 6, 6, 6, 6, 15, 15, 6, + 16, 6, 21, 6, 93, 6, 15, 78, 68, 15, + 90, 15, 68, 21, 6, 15, 31, 15, 68, 6, + 15, 68, 15, 68, 68, 95, 6, 68, 16, 31, + 68, 68, 31, 15, 31, 16, 32, 31, 68, 15, + 15, 31, 78, 6, 6, 15, 8, 15, 6, 7, + 6, 15, 41, 6, 43, 41, 41, 43, 41, 6, + -1, 46, 45, 35, 41, -1, 38, 41, 45, 35, + 41, 45, 38, 6, 41, 8, 43, 68, -1, 27, + 51, 41, 41, 31, 68, 35, 33, 46, 38, 41, + 65, 43, -1, 53, 15, 65, 41, 65, 43, 68, + 41, 65, 41, -1, 43, 46, 41, 41, 43, 43, + 41, 41, 43, 43, 41, 41, 43, 43, 102, 41, + -1, 84, 41, -1, -1, 44, 82, 41, 97, 43, + 41, 41, 41, 55, 41, 46, 46, 46, 41, 46, + 43, 41, 41, 96, 43, 41, 46, 43, 41, 41, + 43, 41, 41, 41, 46, 41, 41, 47, 47, 47, + 46, 46, 41, 31, 31, 41, 41, 46, -1, 37, + 37, 41, 41, 49, 43, 6, 6, 47, 8, 41, + 41, -1, 57, 41, 46, 46, 44, 48, 50, 41, + 41, -1, 41, 41, 46, 46, 48, 46, 46, 48, + 41, 31, 33, 34, 41, 46, 41, -1, 41, 46, + -1, 46, 63, 46, -1, 63, -1, 52, 41, 56, + 41, 54, 63, 46, 41, 46, 6, 7, -1, 46, + 10, 15, 16, 17, 18, 19, 20, -1, -1, -1, + 63, 58, 63, -1, 24, 25, 41, -1, -1, -1, + -1, 46, -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 6, -1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, + 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1}; + -1, -1, -1, -1, -1, -1, -1}; diff --git a/src/declarative/qml/parser/qmljsgrammar_p.h b/src/declarative/qml/parser/qmljsgrammar_p.h index a8d4bdf..1590274 100644 --- a/src/declarative/qml/parser/qmljsgrammar_p.h +++ b/src/declarative/qml/parser/qmljsgrammar_p.h @@ -2,7 +2,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the QtCore module of the Qt Toolkit. ** @@ -35,7 +35,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://www.qtsoftware.com/contact. +** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -151,20 +151,26 @@ public: T_XOR = 78, T_XOR_EQ = 79, - ACCEPT_STATE = 608, - RULE_COUNT = 334, - STATE_COUNT = 609, + ACCEPT_STATE = 615, + RULE_COUNT = 338, + STATE_COUNT = 616, TERMINAL_COUNT = 92, NON_TERMINAL_COUNT = 104, - GOTO_INDEX_OFFSET = 609, - GOTO_INFO_OFFSET = 2136, - GOTO_CHECK_OFFSET = 2136 + GOTO_INDEX_OFFSET = 616, + GOTO_INFO_OFFSET = 2139, + GOTO_CHECK_OFFSET = 2139 }; static const char *const spell []; static const int lhs []; static const int rhs []; + +#ifndef QLALR_NO_QMLJSGRAMMAR_DEBUG_INFO + static const int rule_index []; + static const int rule_info []; +#endif // QLALR_NO_QMLJSGRAMMAR_DEBUG_INFO + static const int goto_default []; static const int action_default []; static const int action_index []; diff --git a/src/declarative/qml/parser/qmljsparser.cpp b/src/declarative/qml/parser/qmljsparser.cpp index 679d0b3..a13b425 100644 --- a/src/declarative/qml/parser/qmljsparser.cpp +++ b/src/declarative/qml/parser/qmljsparser.cpp @@ -1,5 +1,7 @@ // This file was generated by qlalr - DO NOT EDIT! +#line 95 "qmljs.g" + /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). @@ -51,6 +53,8 @@ #include "qmljsnodepool_p.h" +#line 349 "qmljs.g" + #include "qmljsparser_p.h" #include @@ -193,25 +197,35 @@ bool Parser::parse() switch (r) { +#line 498 "qmljs.g" + case 0: { program = makeAstNode (driver->nodePool(), sym(1).UiImportList, sym(2).UiObjectMemberList->finish()); sym(1).UiProgram = program; } break; +#line 508 "qmljs.g" + case 2: { sym(1).Node = sym(1).UiImportList->finish(); } break; +#line 515 "qmljs.g" + case 3: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiImport); } break; +#line 522 "qmljs.g" + case 4: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiImportList, sym(2).UiImport); } break; +#line 531 "qmljs.g" + case 6: { AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).sval); node->importToken = loc(1); @@ -220,6 +234,8 @@ case 6: { sym(1).Node = node; } break; +#line 543 "qmljs.g" + case 8: { AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).sval); node->importId = sym(4).sval; @@ -231,16 +247,45 @@ case 8: { sym(1).Node = node; } break; +#line 558 "qmljs.g" + case 10: { - AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId); + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); node->importToken = loc(1); node->fileNameToken = loc(2); node->semicolonToken = loc(3); sym(1).Node = node; } break; +#line 570 "qmljs.g" + case 12: { - AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId); + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); + node->importToken = loc(1); + node->fileNameToken = loc(2); + node->versionToken = loc(3); + node->semicolonToken = loc(4); + sym(1).Node = node; +} break; + +#line 583 "qmljs.g" + +case 14: { + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); + node->importId = sym(5).sval; + node->importToken = loc(1); + node->fileNameToken = loc(2); + node->versionToken = loc(3); + node->asToken = loc(4); + node->importIdToken = loc(5); + node->semicolonToken = loc(6); + sym(1).Node = node; +} break; + +#line 599 "qmljs.g" + +case 16: { + AST::UiImport *node = makeAstNode(driver->nodePool(), sym(2).UiQualifiedId->finish()); node->importId = sym(4).sval; node->importToken = loc(1); node->fileNameToken = loc(2); @@ -250,56 +295,76 @@ case 12: { sym(1).Node = node; } break; -case 13: { +#line 613 "qmljs.g" + +case 17: { sym(1).Node = 0; } break; -case 14: { +#line 620 "qmljs.g" + +case 18: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); } break; -case 15: { +#line 627 "qmljs.g" + +case 19: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); } break; -case 16: { +#line 634 "qmljs.g" + +case 20: { AST::UiObjectMemberList *node = makeAstNode (driver->nodePool(), sym(1).UiObjectMemberList, sym(2).UiObjectMember); sym(1).Node = node; } break; -case 17: { +#line 643 "qmljs.g" + +case 21: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).UiObjectMember); } break; -case 18: { +#line 650 "qmljs.g" + +case 22: { AST::UiArrayMemberList *node = makeAstNode (driver->nodePool(), sym(1).UiArrayMemberList, sym(3).UiObjectMember); node->commaToken = loc(2); sym(1).Node = node; } break; -case 19: { +#line 660 "qmljs.g" + +case 23: { AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), (AST::UiObjectMemberList*)0); node->lbraceToken = loc(1); node->rbraceToken = loc(2); sym(1).Node = node; } break; -case 20: { +#line 670 "qmljs.g" + +case 24: { AST::UiObjectInitializer *node = makeAstNode (driver->nodePool(), sym(2).UiObjectMemberList->finish()); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 21: { +#line 680 "qmljs.g" + +case 25: { AST::UiObjectDefinition *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(2).UiObjectInitializer); sym(1).Node = node; } break; -case 23: { +#line 691 "qmljs.g" + +case 27: { AST::UiArrayBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiArrayMemberList->finish()); node->colonToken = loc(2); @@ -308,19 +373,25 @@ case 23: { sym(1).Node = node; } break; -case 24: { +#line 703 "qmljs.g" + +case 28: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 26: { +#line 713 "qmljs.g" + +case 30: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 27: { +#line 723 "qmljs.g" + +case 31: { if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(3).Expression)) { AST::UiObjectBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), qualifiedId, sym(4).UiObjectInitializer); @@ -335,7 +406,21 @@ case 27: { return false; // ### recover } } break; -case 28:case 29:case 30:case 31:case 32:case 33: + +#line 742 "qmljs.g" +case 32: +#line 745 "qmljs.g" +case 33: +#line 748 "qmljs.g" +case 34: +#line 751 "qmljs.g" +case 35: +#line 754 "qmljs.g" +case 36: +#line 757 "qmljs.g" +case 37: +#line 759 "qmljs.g" + { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); @@ -343,35 +428,49 @@ case 28:case 29:case 30:case 31:case 32:case 33: sym(1).Node = node; } break; -case 34: +#line 769 "qmljs.g" + +case 38: -case 35: { +#line 773 "qmljs.g" + +case 39: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); break; } -case 37: { +#line 783 "qmljs.g" + +case 41: { sym(1).Node = 0; } break; -case 38: { +#line 790 "qmljs.g" + +case 42: { sym(1).Node = sym(1).UiParameterList->finish (); } break; -case 39: { +#line 797 "qmljs.g" + +case 43: { AST::UiParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).sval); node->identifierToken = loc(2); sym(1).Node = node; } break; -case 40: { +#line 806 "qmljs.g" + +case 44: { AST::UiParameterList *node = makeAstNode (driver->nodePool(), sym(1).UiParameterList, sym(3).sval, sym(4).sval); node->commaToken = loc(2); node->identifierToken = loc(4); sym(1).Node = node; } break; -case 41: { +#line 816 "qmljs.g" + +case 45: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (NameId *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -381,7 +480,9 @@ case 41: { sym(1).Node = node; } break; -case 42: { +#line 829 "qmljs.g" + +case 46: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (NameId *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -390,7 +491,9 @@ case 42: { sym(1).Node = node; } break; -case 44: { +#line 842 "qmljs.g" + +case 48: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -399,7 +502,9 @@ case 44: { sym(1).Node = node; } break; -case 46: { +#line 855 "qmljs.g" + +case 50: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval); node->isDefaultMember = true; node->defaultToken = loc(1); @@ -410,7 +515,9 @@ case 46: { sym(1).Node = node; } break; -case 48: { +#line 870 "qmljs.g" + +case 52: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->propertyToken = loc(1); @@ -421,7 +528,9 @@ case 48: { sym(1).Node = node; } break; -case 50: { +#line 885 "qmljs.g" + +case 54: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isDefaultMember = true; @@ -434,76 +543,104 @@ case 50: { sym(1).Node = node; } break; -case 51: { +#line 901 "qmljs.g" + +case 55: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 52: { +#line 908 "qmljs.g" + +case 56: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 53: -case 54: + +#line 915 "qmljs.g" +case 57: +#line 918 "qmljs.g" + +case 58: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 56: { +#line 930 "qmljs.g" + +case 60: { QString s = QLatin1String(QmlJSGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 57: { +#line 939 "qmljs.g" + +case 61: { QString s = QLatin1String(QmlJSGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 58: { +#line 952 "qmljs.g" + +case 62: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 59: { +#line 961 "qmljs.g" + +case 63: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 60: { +#line 970 "qmljs.g" + +case 64: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 61: { +#line 979 "qmljs.g" + +case 65: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 62: { +#line 988 "qmljs.g" + +case 66: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 63: { +#line 997 "qmljs.g" + +case 67: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval, lexer->flags); node->literalToken = loc(1); sym(1).Node = node; } break; -case 64: { +#line 1006 "qmljs.g" + +case 68: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 65: { +#line 1018 "qmljs.g" + +case 69: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -514,7 +651,9 @@ case 65: { sym(1).Node = node; } break; -case 66: { +#line 1035 "qmljs.g" + +case 70: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -525,28 +664,36 @@ case 66: { sym(1).Node = node; } break; -case 67: { +#line 1049 "qmljs.g" + +case 71: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), (AST::Elision *) 0); node->lbracketToken = loc(1); node->rbracketToken = loc(2); sym(1).Node = node; } break; -case 68: { +#line 1059 "qmljs.g" + +case 72: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).Elision->finish()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 69: { +#line 1069 "qmljs.g" + +case 73: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 70: { +#line 1079 "qmljs.g" + +case 74: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), (AST::Elision *) 0); node->lbracketToken = loc(1); @@ -555,7 +702,9 @@ case 70: { sym(1).Node = node; } break; -case 71: { +#line 1091 "qmljs.g" + +case 75: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision->finish()); node->lbracketToken = loc(1); @@ -564,7 +713,9 @@ case 71: { sym(1).Node = node; } break; -case 72: { +#line 1110 "qmljs.g" + +case 76: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode (driver->nodePool(), @@ -576,7 +727,9 @@ case 72: { sym(1).Node = node; } break; -case 73: { +#line 1125 "qmljs.g" + +case 77: { AST::ObjectLiteral *node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -584,67 +737,89 @@ case 73: { sym(1).Node = node; } break; -case 74: { +#line 1136 "qmljs.g" + +case 78: { AST::NestedExpression *node = makeAstNode(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 75: { +#line 1146 "qmljs.g" + +case 79: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 76: { +#line 1155 "qmljs.g" + +case 80: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 77: { +#line 1164 "qmljs.g" + +case 81: { sym(1).Node = makeAstNode (driver->nodePool(), (AST::Elision *) 0, sym(1).Expression); } break; -case 78: { +#line 1171 "qmljs.g" + +case 82: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision->finish(), sym(2).Expression); } break; -case 79: { +#line 1178 "qmljs.g" + +case 83: { AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, (AST::Elision *) 0, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 80: { +#line 1188 "qmljs.g" + +case 84: { AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision->finish(), sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 81: { +#line 1198 "qmljs.g" + +case 85: { AST::Elision *node = makeAstNode (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 82: { +#line 1207 "qmljs.g" + +case 86: { AST::Elision *node = makeAstNode (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 83: { +#line 1216 "qmljs.g" + +case 87: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 84: { +#line 1226 "qmljs.g" + +case 88: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -652,116 +827,196 @@ case 84: { sym(1).Node = node; } break; -case 85: { +#line 1237 "qmljs.g" + +case 89: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 86: -case 87: { + +#line 1246 "qmljs.g" +case 90: +#line 1249 "qmljs.g" + +case 91: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 88: { +#line 1258 "qmljs.g" + +case 92: { AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 89: { +#line 1267 "qmljs.g" + +case 93: { AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 90: { +#line 1276 "qmljs.g" + +case 94: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 91: - -case 92: - -case 93: - -case 94: +#line 1285 "qmljs.g" case 95: +#line 1289 "qmljs.g" + case 96: +#line 1293 "qmljs.g" + case 97: +#line 1297 "qmljs.g" + case 98: +#line 1301 "qmljs.g" + case 99: +#line 1305 "qmljs.g" + case 100: +#line 1309 "qmljs.g" + case 101: +#line 1313 "qmljs.g" + case 102: +#line 1317 "qmljs.g" + case 103: +#line 1321 "qmljs.g" + case 104: +#line 1325 "qmljs.g" + case 105: +#line 1329 "qmljs.g" + case 106: +#line 1333 "qmljs.g" + case 107: +#line 1337 "qmljs.g" + case 108: +#line 1341 "qmljs.g" + case 109: +#line 1345 "qmljs.g" + case 110: +#line 1349 "qmljs.g" + case 111: +#line 1353 "qmljs.g" + case 112: +#line 1357 "qmljs.g" + case 113: +#line 1361 "qmljs.g" + case 114: +#line 1365 "qmljs.g" + case 115: +#line 1369 "qmljs.g" + case 116: +#line 1373 "qmljs.g" + case 117: +#line 1377 "qmljs.g" + case 118: +#line 1381 "qmljs.g" + case 119: +#line 1385 "qmljs.g" + case 120: +#line 1389 "qmljs.g" + case 121: + +#line 1393 "qmljs.g" + +case 122: + +#line 1397 "qmljs.g" + +case 123: + +#line 1401 "qmljs.g" + +case 124: + +#line 1405 "qmljs.g" + +case 125: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 126: { +#line 1419 "qmljs.g" + +case 130: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 127: { +#line 1429 "qmljs.g" + +case 131: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 128: { +#line 1439 "qmljs.g" + +case 132: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -769,384 +1024,500 @@ case 128: { sym(1).Node = node; } break; -case 130: { +#line 1452 "qmljs.g" + +case 134: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 131: { +#line 1461 "qmljs.g" + +case 135: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 132: { +#line 1471 "qmljs.g" + +case 136: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 133: { +#line 1481 "qmljs.g" + +case 137: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 134: { +#line 1491 "qmljs.g" + +case 138: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 135: { +#line 1501 "qmljs.g" + +case 139: { sym(1).Node = 0; } break; -case 136: { +#line 1508 "qmljs.g" + +case 140: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 137: { +#line 1515 "qmljs.g" + +case 141: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 138: { +#line 1522 "qmljs.g" + +case 142: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 142: { - AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); +#line 1535 "qmljs.g" + +case 146: { + AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 143: { +#line 1544 "qmljs.g" + +case 147: { AST::PostDecrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 145: { +#line 1555 "qmljs.g" + +case 149: { AST::DeleteExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 146: { +#line 1564 "qmljs.g" + +case 150: { AST::VoidExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 147: { +#line 1573 "qmljs.g" + +case 151: { AST::TypeOfExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 148: { +#line 1582 "qmljs.g" + +case 152: { AST::PreIncrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 149: { +#line 1591 "qmljs.g" + +case 153: { AST::PreDecrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 150: { +#line 1600 "qmljs.g" + +case 154: { AST::UnaryPlusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 151: { +#line 1609 "qmljs.g" + +case 155: { AST::UnaryMinusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 152: { +#line 1618 "qmljs.g" + +case 156: { AST::TildeExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 153: { +#line 1627 "qmljs.g" + +case 157: { AST::NotExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 155: { +#line 1638 "qmljs.g" + +case 159: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 156: { +#line 1648 "qmljs.g" + +case 160: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 157: { +#line 1658 "qmljs.g" + +case 161: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 159: { +#line 1670 "qmljs.g" + +case 163: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +#line 1680 "qmljs.g" + +case 164: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 162: { +#line 1692 "qmljs.g" + +case 166: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 163: { +#line 1702 "qmljs.g" + +case 167: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 164: { +#line 1712 "qmljs.g" + +case 168: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 166: { +#line 1724 "qmljs.g" + +case 170: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 167: { +#line 1734 "qmljs.g" + +case 171: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 168: { +#line 1744 "qmljs.g" + +case 172: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 169: { +#line 1754 "qmljs.g" + +case 173: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 170: { +#line 1764 "qmljs.g" + +case 174: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 171: { +#line 1774 "qmljs.g" + +case 175: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 173: { +#line 1786 "qmljs.g" + +case 177: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 174: { +#line 1796 "qmljs.g" + +case 178: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 175: { +#line 1806 "qmljs.g" + +case 179: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 176: { +#line 1816 "qmljs.g" + +case 180: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 177: { +#line 1826 "qmljs.g" + +case 181: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 179: { +#line 1838 "qmljs.g" + +case 183: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +#line 1848 "qmljs.g" + +case 184: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 181: { +#line 1858 "qmljs.g" + +case 185: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 182: { +#line 1868 "qmljs.g" + +case 186: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 184: { +#line 1880 "qmljs.g" + +case 188: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 185: { +#line 1890 "qmljs.g" + +case 189: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 186: { +#line 1900 "qmljs.g" + +case 190: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 187: { +#line 1910 "qmljs.g" + +case 191: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 189: { +#line 1922 "qmljs.g" + +case 193: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 191: { +#line 1934 "qmljs.g" + +case 195: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 193: { +#line 1946 "qmljs.g" + +case 197: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 195: { +#line 1958 "qmljs.g" + +case 199: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 197: { +#line 1970 "qmljs.g" + +case 201: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 199: { +#line 1982 "qmljs.g" + +case 203: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 201: { +#line 1994 "qmljs.g" + +case 205: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 203: { +#line 2006 "qmljs.g" + +case 207: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 205: { +#line 2018 "qmljs.g" + +case 209: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 207: { +#line 2030 "qmljs.g" + +case 211: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 209: { +#line 2042 "qmljs.g" + +case 213: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1154,7 +1525,9 @@ case 209: { sym(1).Node = node; } break; -case 211: { +#line 2055 "qmljs.g" + +case 215: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1162,112 +1535,160 @@ case 211: { sym(1).Node = node; } break; -case 213: { +#line 2068 "qmljs.g" + +case 217: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 215: { +#line 2080 "qmljs.g" + +case 219: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 216: { +#line 2090 "qmljs.g" + +case 220: { sym(1).ival = QSOperator::Assign; } break; -case 217: { +#line 2097 "qmljs.g" + +case 221: { sym(1).ival = QSOperator::InplaceMul; } break; -case 218: { +#line 2104 "qmljs.g" + +case 222: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 219: { +#line 2111 "qmljs.g" + +case 223: { sym(1).ival = QSOperator::InplaceMod; } break; -case 220: { +#line 2118 "qmljs.g" + +case 224: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 221: { +#line 2125 "qmljs.g" + +case 225: { sym(1).ival = QSOperator::InplaceSub; } break; -case 222: { +#line 2132 "qmljs.g" + +case 226: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 223: { +#line 2139 "qmljs.g" + +case 227: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 224: { +#line 2146 "qmljs.g" + +case 228: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 225: { +#line 2153 "qmljs.g" + +case 229: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 226: { +#line 2160 "qmljs.g" + +case 230: { sym(1).ival = QSOperator::InplaceXor; } break; -case 227: { +#line 2167 "qmljs.g" + +case 231: { sym(1).ival = QSOperator::InplaceOr; } break; -case 229: { +#line 2176 "qmljs.g" + +case 233: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 230: { +#line 2185 "qmljs.g" + +case 234: { sym(1).Node = 0; } break; -case 233: { +#line 2196 "qmljs.g" + +case 237: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 234: { +#line 2205 "qmljs.g" + +case 238: { sym(1).Node = 0; } break; -case 251: { +#line 2231 "qmljs.g" + +case 255: { AST::Block *node = makeAstNode (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 252: { +#line 2241 "qmljs.g" + +case 256: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 253: { +#line 2248 "qmljs.g" + +case 257: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 254: { +#line 2255 "qmljs.g" + +case 258: { sym(1).Node = 0; } break; -case 255: { +#line 2262 "qmljs.g" + +case 259: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 257: { +#line 2270 "qmljs.g" + +case 261: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1275,76 +1696,106 @@ case 257: { sym(1).Node = node; } break; -case 258: { +#line 2281 "qmljs.g" + +case 262: { sym(1).ival = T_CONST; } break; -case 259: { +#line 2288 "qmljs.g" + +case 263: { sym(1).ival = T_VAR; } break; -case 260: { +#line 2295 "qmljs.g" + +case 264: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 261: { +#line 2302 "qmljs.g" + +case 265: { AST::VariableDeclarationList *node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 262: { +#line 2312 "qmljs.g" + +case 266: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 263: { +#line 2319 "qmljs.g" + +case 267: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 264: { +#line 2326 "qmljs.g" + +case 268: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 265: { +#line 2335 "qmljs.g" + +case 269: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 266: { +#line 2344 "qmljs.g" + +case 270: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 267: { +#line 2352 "qmljs.g" + +case 271: { sym(1).Node = 0; } break; -case 269: { +#line 2361 "qmljs.g" + +case 273: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 270: { +#line 2369 "qmljs.g" + +case 274: { sym(1).Node = 0; } break; -case 272: { +#line 2378 "qmljs.g" + +case 276: { AST::EmptyStatement *node = makeAstNode (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 274: { +#line 2388 "qmljs.g" + +case 278: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 275: { +#line 2397 "qmljs.g" + +case 279: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1353,7 +1804,9 @@ case 275: { sym(1).Node = node; } break; -case 276: { +#line 2409 "qmljs.g" + +case 280: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1361,7 +1814,9 @@ case 276: { sym(1).Node = node; } break; -case 278: { +#line 2422 "qmljs.g" + +case 282: { AST::DoWhileStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1371,7 +1826,9 @@ case 278: { sym(1).Node = node; } break; -case 279: { +#line 2435 "qmljs.g" + +case 283: { AST::WhileStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1379,7 +1836,9 @@ case 279: { sym(1).Node = node; } break; -case 280: { +#line 2446 "qmljs.g" + +case 284: { AST::ForStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1390,7 +1849,9 @@ case 280: { sym(1).Node = node; } break; -case 281: { +#line 2460 "qmljs.g" + +case 285: { AST::LocalForStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1403,7 +1864,9 @@ case 281: { sym(1).Node = node; } break; -case 282: { +#line 2476 "qmljs.g" + +case 286: { AST:: ForEachStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1413,7 +1876,9 @@ case 282: { sym(1).Node = node; } break; -case 283: { +#line 2489 "qmljs.g" + +case 287: { AST::LocalForEachStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1424,14 +1889,18 @@ case 283: { sym(1).Node = node; } break; -case 285: { +#line 2504 "qmljs.g" + +case 289: { AST::ContinueStatement *node = makeAstNode (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 287: { +#line 2515 "qmljs.g" + +case 291: { AST::ContinueStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1439,14 +1908,18 @@ case 287: { sym(1).Node = node; } break; -case 289: { +#line 2527 "qmljs.g" + +case 293: { AST::BreakStatement *node = makeAstNode (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 291: { +#line 2538 "qmljs.g" + +case 295: { AST::BreakStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1454,14 +1927,18 @@ case 291: { sym(1).Node = node; } break; -case 293: { +#line 2550 "qmljs.g" + +case 297: { AST::ReturnStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 294: { +#line 2560 "qmljs.g" + +case 298: { AST::WithStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1469,7 +1946,9 @@ case 294: { sym(1).Node = node; } break; -case 295: { +#line 2571 "qmljs.g" + +case 299: { AST::SwitchStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1477,90 +1956,122 @@ case 295: { sym(1).Node = node; } break; -case 296: { +#line 2582 "qmljs.g" + +case 300: { AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 297: { +#line 2592 "qmljs.g" + +case 301: { AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(5); sym(1).Node = node; } break; -case 298: { +#line 2602 "qmljs.g" + +case 302: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 299: { +#line 2609 "qmljs.g" + +case 303: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 300: { +#line 2616 "qmljs.g" + +case 304: { sym(1).Node = 0; } break; -case 301: { +#line 2623 "qmljs.g" + +case 305: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 302: { +#line 2630 "qmljs.g" + +case 306: { AST::CaseClause *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 303: { +#line 2640 "qmljs.g" + +case 307: { AST::DefaultClause *node = makeAstNode (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 304: -case 305: { + +#line 2650 "qmljs.g" +case 308: +#line 2653 "qmljs.g" + +case 309: { AST::LabelledStatement *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 306: { +#line 2663 "qmljs.g" + +case 310: { AST::LabelledStatement *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 308: { +#line 2674 "qmljs.g" + +case 312: { AST::ThrowStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 309: { +#line 2684 "qmljs.g" + +case 313: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 310: { +#line 2693 "qmljs.g" + +case 314: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 311: { +#line 2702 "qmljs.g" + +case 315: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 312: { +#line 2711 "qmljs.g" + +case 316: { AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1569,20 +2080,26 @@ case 312: { sym(1).Node = node; } break; -case 313: { +#line 2723 "qmljs.g" + +case 317: { AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 315: { +#line 2733 "qmljs.g" + +case 319: { AST::DebuggerStatement *node = makeAstNode (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 316: { +#line 2743 "qmljs.g" + +case 320: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1593,7 +2110,9 @@ case 316: { sym(1).Node = node; } break; -case 317: { +#line 2757 "qmljs.g" + +case 321: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1605,59 +2124,85 @@ case 317: { sym(1).Node = node; } break; -case 318: { +#line 2772 "qmljs.g" + +case 322: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 319: { +#line 2781 "qmljs.g" + +case 323: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 320: { +#line 2791 "qmljs.g" + +case 324: { sym(1).Node = 0; } break; -case 321: { +#line 2798 "qmljs.g" + +case 325: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 322: { +#line 2805 "qmljs.g" + +case 326: { sym(1).Node = 0; } break; -case 324: { +#line 2814 "qmljs.g" + +case 328: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 325: { +#line 2829 "qmljs.g" + +case 329: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 326: { +#line 2836 "qmljs.g" + +case 330: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 327: { +#line 2843 "qmljs.g" + +case 331: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 328: { +#line 2850 "qmljs.g" + +case 332: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 329: { +#line 2857 "qmljs.g" + +case 333: { sym(1).sval = 0; } break; -case 331: { +#line 2866 "qmljs.g" + +case 335: { sym(1).Node = 0; } break; +#line 2874 "qmljs.g" + } // switch action = nt_action(state_stack[tos], lhs[r] - TERMINAL_COUNT); } // if diff --git a/src/declarative/qml/parser/qmljsparser_p.h b/src/declarative/qml/parser/qmljsparser_p.h index e82c9c5..e4ca20a 100644 --- a/src/declarative/qml/parser/qmljsparser_p.h +++ b/src/declarative/qml/parser/qmljsparser_p.h @@ -1,5 +1,7 @@ // This file was generated by qlalr - DO NOT EDIT! +#line 148 "qmljs.g" + /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). @@ -198,9 +200,15 @@ protected: -#define J_SCRIPT_REGEXPLITERAL_RULE1 65 +#line 1015 "qmljs.g" + +#define J_SCRIPT_REGEXPLITERAL_RULE1 69 + +#line 1032 "qmljs.g" + +#define J_SCRIPT_REGEXPLITERAL_RULE2 70 -#define J_SCRIPT_REGEXPLITERAL_RULE2 66 +#line 2994 "qmljs.g" QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index 413f820..5be86c2 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -242,19 +242,29 @@ void QmlCompositeTypeManager::setData(QmlCompositeTypeData *unit, const QByteArray &data, const QUrl &url) { + bool ok = true; if (!unit->data.parse(data, url)) { - - unit->status = QmlCompositeTypeData::Error; - unit->errorType = QmlCompositeTypeData::GeneralError; + ok = false; unit->errors << unit->data.errors(); - doComplete(unit); - } else { foreach (QmlScriptParser::Import imp, unit->data.imports()) { - engine->addImport(&unit->imports, imp.uri, imp.as, imp.version_major, imp.version_minor); + if (!engine->addToImport(&unit->imports, imp.uri, imp.qualifier, imp.version, imp.type==QmlScriptParser::Import::Library ? QmlEngine::LibraryImport : QmlEngine::FileImport)) { + QmlError error; + error.setUrl(url); + error.setDescription(tr("Import %1 unavailable").arg(imp.uri)); + unit->errors << error; +qDebug() << "ERR"; + ok = false; + } } - compile(unit); + } + if (ok) { + compile(unit); + } else { + unit->status = QmlCompositeTypeData::Error; + unit->errorType = QmlCompositeTypeData::GeneralError; + doComplete(unit); } } @@ -314,13 +324,16 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit) continue; } - ref.type = engine->resolveBuiltInType(unit->imports, type); + QUrl url; + if (!engine->resolveType(unit->imports, type, &ref.type, &url)) { + // XXX could produce error message here. + } + if (ref.type) { unit->types << ref; continue; } - QUrl url = engine->resolveType(unit->imports, QLatin1String(type)); QmlCompositeTypeData *urlUnit = components.value(url.toString()); if (!urlUnit) { diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 4acdd0c..f465c72 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** + /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) @@ -79,6 +79,7 @@ Q_DECLARE_METATYPE(QList); QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlDebugger, QML_DEBUGGER) +DEFINE_BOOL_CONFIG_OPTION(qmlImportTrace, QML_IMPORT_TRACE) QML_DEFINE_TYPE(QObject,Object) @@ -1100,70 +1101,120 @@ void QmlObjectScriptClass::setProperty(QScriptValue &object, class QmlImportsPrivate { public: - void add(const QString& uri, const QString& prefix, int version_major, int version_minor) + bool add(const QString& uri, const QString& prefix, const QString& version, QmlEngine::ImportType importType, const QStringList& importPath) { TypeSet *s; if (prefix.isEmpty()) { - s = &unqualifiedset; + if (importType == QmlEngine::LibraryImport && version.isEmpty()) { + // unversioned library imports are always qualified - if only by final URI component + int lastdot = uri.lastIndexOf(QLatin1Char('.')); + QString defaultprefix = uri.mid(lastdot+1); + s = set.value(defaultprefix); + if (!s) + set.insert(defaultprefix,(s=new TypeSet)); + } else { + s = &unqualifiedset; + } } else { s = set.value(prefix); if (!s) set.insert(prefix,(s=new TypeSet)); } QString url = uri; + if (importType == QmlEngine::LibraryImport) { + url.replace(QLatin1Char('.'),QLatin1Char('/')); + bool found = false; + foreach (QString p, importPath) { + QString dir = p+QLatin1Char('/')+url; + if (QFile::exists(dir+QLatin1String("/qmldir"))) { + url = dir; + found = true; + break; + } + } + if (!found) + return false; + } s->urls.append(url); - s->vmaj.append(version_major); - s->vmin.append(version_minor); + s->versions.append(version); + s->isLibrary.append(importType == QmlEngine::LibraryImport); + return true; } QUrl find(const QString& base, const QString& type) { TypeSet *s = 0; - int dot = type.indexOf(QLatin1Char('.')); - if (dot >= 0) { + int slash = type.indexOf(QLatin1Char('/')); + if (slash >= 0) { while (!s) { - s = set.value(type.left(dot)); - int ndot = type.indexOf(QLatin1Char('.'),dot+1); - if (ndot > 0) - dot = ndot; + s = set.value(type.left(slash)); + int nslash = type.indexOf(QLatin1Char('/'),slash+1); + if (nslash > 0) + slash = nslash; else break; } } else { s = &unqualifiedset; } - QString unqualifiedtype = type.mid(dot+1); + QString unqualifiedtype = type.mid(slash+1); QUrl baseUrl(base); if (s) { for (int i=0; iurls.count(); ++i) { QUrl url = baseUrl.resolved(QUrl(s->urls.at(i) +QLatin1String("/")+ unqualifiedtype + QLatin1String(".qml"))); + QString version = s->versions.at(i); // XXX search non-files too! (eg. zip files, see QT-524) QFileInfo f(url.toLocalFile()); - if (f.exists()) - return url; + if (f.exists()) { + bool ok=true; + if (!version.isEmpty()) { + ok=false; + // Check version file - XXX cache these in QmlEngine! + QFile qmldir(s->urls.at(i)+QLatin1String("/qmldir")); + if (qmldir.open(QIODevice::ReadOnly)) { + do { + QString line = QString::fromUtf8(qmldir.readLine()); + if (line.at(0) == QLatin1Char('#')) + continue; + int space1 = line.indexOf(QLatin1Char(' ')); + int space2 = space1 >=0 ? line.indexOf(QLatin1Char(' '),space1+1) : -1; + QStringRef maptype = line.leftRef(space1); + QStringRef mapversion = line.midRef(space1+1,space2<0?line.length()-space1-2:space2-space1-1); + QStringRef mapfile = space2<0 ? QStringRef() : line.midRef(space2+1,line.length()-space2-2); + if (maptype==unqualifiedtype && mapversion==version) { + if (mapfile.isEmpty()) + return url; + else + return url.resolved(mapfile.toString()); + } + } while (!qmldir.atEnd()); + } + } + if (ok) + return url; + } } } return baseUrl.resolved(QUrl(type + QLatin1String(".qml"))); } - QmlType *findBuiltin(const QString& base, const QByteArray& type) + QmlType *findBuiltin(const QString&, const QByteArray& type) { - // XXX import only have one space of imports! TypeSet *s = 0; - int dot = type.indexOf('.'); - if (dot >= 0) { + int slash = type.indexOf('/'); + if (slash >= 0) { while (!s) { - s = set.value(QString::fromLatin1(type.left(dot))); - int ndot = type.indexOf('.',dot+1); - if (ndot > 0) - dot = ndot; + s = set.value(QString::fromLatin1(type.left(slash))); + int nslash = type.indexOf('/',slash+1); + if (nslash > 0) + slash = nslash; else break; } } else { s = &unqualifiedset; } - QByteArray unqualifiedtype = dot < 0 ? type : type.mid(dot+1); // common-case opt (QString::mid works fine, but slower) + QByteArray unqualifiedtype = slash < 0 ? type : type.mid(slash+1); // common-case opt (QString::mid works fine, but slower) if (s) { for (int i=0; iurls.count(); ++i) { QmlType *t = QmlMetaType::qmlType(s->urls.at(i).toLatin1()+"/"+unqualifiedtype); @@ -1176,8 +1227,8 @@ public: private: struct TypeSet { QStringList urls; - QList vmaj; - QList vmin; + QStringList versions; + QList isLibrary; }; TypeSet unqualifiedset; QHash set; @@ -1197,19 +1248,44 @@ void QmlEngine::Imports::setBaseUrl(const QUrl& url) base = url; } -void QmlEngine::addImport(Imports* imports, const QString& uri, const QString& prefix, int version_major, int version_minor) const +void QmlEngine::addImportPath(const QString& path) { - imports->d->add(uri,prefix,version_major,version_minor); + if (qmlImportTrace()) + qDebug() << "QmlEngine::addImportPath" << path; + Q_D(QmlEngine); + d->fileImportPath.prepend(path); } -QUrl QmlEngine::resolveType(const Imports& imports, const QString& type) const +bool QmlEngine::addToImport(Imports* imports, const QString& uri, const QString& prefix, const QString& version, ImportType importType) const { - return imports.d->find(imports.base,type); + Q_D(const QmlEngine); + bool ok = imports->d->add(uri,prefix,version,importType,d->fileImportPath); + if (qmlImportTrace()) + qDebug() << "QmlEngine::addToImport(" << imports << uri << prefix << version << (importType==LibraryImport ? "Library" : "File") << ": " << ok; + return ok; } -QmlType* QmlEngine::resolveBuiltInType(const Imports& imports, const QByteArray& type) const +bool QmlEngine::resolveType(const Imports& imports, const QByteArray& type, QmlType** type_return, QUrl* url_return) const { - return imports.d->findBuiltin(imports.base,type); + Q_D(const QmlEngine); + QmlType* t = imports.d->findBuiltin(imports.base,type); + if (t) { + if (type_return) *type_return = t; + if (qmlImportTrace()) + qDebug() << "QmlEngine::resolveType" << type << "= (builtin)"; + return true; + } + QUrl url = imports.d->find(imports.base,type); + if (url.isValid()) { + if (url_return) *url_return = url; + if (qmlImportTrace()) + qDebug() << "QmlEngine::resolveType" << type << "=" << url; + return true; + } + if (qmlImportTrace()) + qDebug() << "QmlEngine::resolveType" << type << " not found"; + return false; } + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h index 0c9da39..6a418b5 100644 --- a/src/declarative/qml/qmlengine.h +++ b/src/declarative/qml/qmlengine.h @@ -87,9 +87,10 @@ public: QUrl base; QmlImportsPrivate *d; }; - void addImport(Imports*, const QString& uri, const QString& prefix, int version_major, int version_minor) const; - QUrl resolveType(const Imports&, const QString& type) const; - QmlType* resolveBuiltInType(const Imports& imports, const QByteArray& type) const; + void addImportPath(const QString& dir); + enum ImportType { LibraryImport, FileImport }; + bool addToImport(Imports*, const QString& uri, const QString& prefix, const QString& version, ImportType type) const; + bool resolveType(const Imports&, const QByteArray& type, QmlType** type_return, QUrl* url_return ) const; void setNetworkAccessManager(QNetworkAccessManager *); QNetworkAccessManager *networkAccessManager() const; diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 9a8b9fb..b9d3833 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -164,6 +164,7 @@ public: mutable QNetworkAccessManager *networkAccessManager; QmlCompositeTypeManager typeManager; + QStringList fileImportPath; mutable quint32 uniqueId; quint32 getUniqueId() const { diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index cf4691f..f26266b 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -477,13 +477,12 @@ bool ProcessAST::visit(AST::UiImport *node) AST::SourceLocation endLoc = node->semicolonToken; if (node->importId) - import.as = node->importId->asString(); + import.qualifier = node->importId->asString(); + if (node->versionToken.isValid()) + import.version = textAt(node->versionToken); import.location = location(startLoc, endLoc); import.uri = uri; - // XXX not parsed yet... - import.version_major = 0; - import.version_minor = 0; _parser->_imports << import; diff --git a/src/declarative/qml/qmlscriptparser_p.h b/src/declarative/qml/qmlscriptparser_p.h index 065c1c0..355ff75 100644 --- a/src/declarative/qml/qmlscriptparser_p.h +++ b/src/declarative/qml/qmlscriptparser_p.h @@ -72,15 +72,14 @@ public: class Import { public: - Import() : type(Library), version_major(0), version_minor(0) {} + Import() : type(Library) {} enum Type { Library, File }; Type type; QString uri; - QString as; // prefix for qualification - int version_major; - int version_minor; + QString qualifier; + QString version; QmlParser::LocationSpan location; }; diff --git a/tools/qmlviewer/main.cpp b/tools/qmlviewer/main.cpp index 335c609..5e5a50a 100644 --- a/tools/qmlviewer/main.cpp +++ b/tools/qmlviewer/main.cpp @@ -124,6 +124,8 @@ int main(int argc, char ** argv) usage(); translationFile = argv[i + 1]; ++i; + } else if (arg == "-L") { + libraries << QString(argv[++i]); } else if (arg[0] != '-') { fileName = arg; } else if (1 || arg == "-help") { @@ -138,6 +140,8 @@ int main(int argc, char ** argv) } QmlViewer viewer(testMode, testDir, 0, frameless ? Qt::FramelessWindowHint : Qt::Widget); + foreach (QString lib, libraries) + viewer.addLibraryPath(lib); viewer.setCacheEnabled(cache); viewer.setRecordFile(recordfile); if (period>0) @@ -160,4 +164,3 @@ int main(int argc, char ** argv) return app.exec(); } - diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index e212391..a769888 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -325,6 +325,11 @@ void QmlViewer::toggleRecording() setRecording(recording); } +void QmlViewer::addLibraryPath(const QString& lib) +{ + canvas->engine()->addImportPath(lib); +} + void QmlViewer::reload() { openQml(currentFileName); -- cgit v0.12 From 72d005edf85d2fa49a8543ae4c23f7a2268a589f Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 14 Jul 2009 15:10:28 +1000 Subject: Move QmlTimer to util/ --- examples/declarative/loader/Button.qml | 14 ++ src/declarative/extra/qmltimer.cpp | 233 --------------------------------- src/declarative/extra/qmltimer.h | 103 --------------- src/declarative/util/qmltimer.cpp | 233 +++++++++++++++++++++++++++++++++ src/declarative/util/qmltimer.h | 103 +++++++++++++++ 5 files changed, 350 insertions(+), 336 deletions(-) create mode 100644 examples/declarative/loader/Button.qml delete mode 100644 src/declarative/extra/qmltimer.cpp delete mode 100644 src/declarative/extra/qmltimer.h create mode 100644 src/declarative/util/qmltimer.cpp create mode 100644 src/declarative/util/qmltimer.h diff --git a/examples/declarative/loader/Button.qml b/examples/declarative/loader/Button.qml new file mode 100644 index 0000000..3efedc4 --- /dev/null +++ b/examples/declarative/loader/Button.qml @@ -0,0 +1,14 @@ +Rect { + id: Container + + property var text + signal clicked + + height: Text.height + 10 + width: Text.width + 20 + pen.width: 1 + radius: 4 + color: "grey" + MouseRegion { anchors.fill: parent; onClicked: Container.clicked() } + Text { id: Text; anchors.centeredIn:parent; font.size: 10; text: parent.text } +} diff --git a/src/declarative/extra/qmltimer.cpp b/src/declarative/extra/qmltimer.cpp deleted file mode 100644 index 4af83d3..0000000 --- a/src/declarative/extra/qmltimer.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "QtCore/qcoreapplication.h" -#include "QtCore/qpauseanimation.h" -#include "private/qobject_p.h" -#include "qmltimer.h" -#include "qdebug.h" - -QT_BEGIN_NAMESPACE - -QML_DEFINE_TYPE(QmlTimer,Timer) - -class QmlTimerPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QmlTimer) -public: - QmlTimerPrivate() - : interval(1000), running(false), repeating(false), triggeredOnStart(false) - , componentComplete(false) {} - int interval; - bool running; - bool repeating; - bool triggeredOnStart; - QPauseAnimation pause; - bool componentComplete; -}; - -/*! - \qmlclass Timer QFxTimer - \brief The Timer item triggers a handler at a specified interval. - - A timer can be used to trigger an action either once, or repeatedly - at a given interval. - - \qml - Timer { - interval: 500; running: true; repeat: true - onTriggered: Time.text = Date().toString() - } - Text { - id: Time - } - \endqml - -*/ - -QmlTimer::QmlTimer(QObject *parent) - : QObject(*(new QmlTimerPrivate), parent) -{ - Q_D(QmlTimer); - connect(&d->pause, SIGNAL(currentLoopChanged(int)), this, SLOT(ticked())); - connect(&d->pause, SIGNAL(finished()), this, SLOT(ticked())); - connect(&d->pause, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)) - , this, SLOT(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State))); - d->pause.setLoopCount(1); - d->pause.setDuration(d->interval); -} - -/*! - \qmlproperty int Timer::interval - - Sets the \a interval in milliseconds between triggering. -*/ -void QmlTimer::setInterval(int interval) -{ - Q_D(QmlTimer); - if (interval != d->interval) { - d->interval = interval; - update(); - } -} - -int QmlTimer::interval() const -{ - Q_D(const QmlTimer); - return d->interval; -} - -/*! - \qmlproperty bool Timer::running - - If set to true, starts the timer; otherwise stops the timer. - For a non-repeating timer, \a running will be set to false after the - timer has been triggered. - - \sa repeat -*/ -bool QmlTimer::isRunning() const -{ - Q_D(const QmlTimer); - return d->running; -} - -void QmlTimer::setRunning(bool running) -{ - Q_D(QmlTimer); - if (d->running != running) { - d->running = running; - emit runningChanged(); - update(); - } -} - -/*! - \qmlproperty bool Timer::repeat - - If \a repeat is true the timer will be triggered repeatedly at the - specified interval; otherwise, the timer will trigger once at the - specified interval and then stop (i.e. running will be set to false). - - \sa running -*/ -bool QmlTimer::isRepeating() const -{ - Q_D(const QmlTimer); - return d->repeating; -} - -void QmlTimer::setRepeating(bool repeating) -{ - Q_D(QmlTimer); - if (repeating != d->repeating) { - d->repeating = repeating; - update(); - } -} - -/*! - \qmlproperty bool Timer::triggeredOnStart - - If \a triggeredOnStart is true, the timer will be triggered immediately - when started, and subsequently at the specified interval. - - \sa running -*/ -bool QmlTimer::triggeredOnStart() const -{ - Q_D(const QmlTimer); - return d->triggeredOnStart; -} - -void QmlTimer::setTriggeredOnStart(bool triggeredOnStart) -{ - Q_D(QmlTimer); - if (d->triggeredOnStart != triggeredOnStart) { - d->triggeredOnStart = triggeredOnStart; - update(); - } -} - -void QmlTimer::update() -{ - Q_D(QmlTimer); - if (!d->componentComplete) - return; - d->pause.stop(); - if (d->running) { - d->pause.setLoopCount(d->repeating ? -1 : 1); - d->pause.setDuration(d->interval); - d->pause.start(); - if (d->triggeredOnStart) { - QCoreApplication::removePostedEvents(this, QEvent::MetaCall); - QMetaObject::invokeMethod(this, "ticked", Qt::QueuedConnection); - } - } -} - -void QmlTimer::componentComplete() -{ - Q_D(QmlTimer); - d->componentComplete = true; - update(); -} - -/*! - \qmlsignal Timer::onTriggered - - This handler is called when the Timer is triggered. -*/ -void QmlTimer::ticked() -{ - emit triggered(); -} - -void QmlTimer::stateChanged(QAbstractAnimation::State, QAbstractAnimation::State state) -{ - Q_D(QmlTimer); - if (d->running && state != QAbstractAnimation::Running) { - d->running = false; - emit runningChanged(); - } -} - -QT_END_NAMESPACE diff --git a/src/declarative/extra/qmltimer.h b/src/declarative/extra/qmltimer.h deleted file mode 100644 index 0df4cb9..0000000 --- a/src/declarative/extra/qmltimer.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (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 either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** 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.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLTIMER_H -#define QMLTIMER_H - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlTimerPrivate; -class Q_DECLARATIVE_EXPORT QmlTimer : public QObject, public QmlParserStatus -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlTimer) - Q_INTERFACES(QmlParserStatus) - Q_PROPERTY(int interval READ interval WRITE setInterval) - Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) - Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating) - Q_PROPERTY(bool triggeredOnStart READ triggeredOnStart WRITE setTriggeredOnStart) - -public: - QmlTimer(QObject *parent=0); - - void setInterval(int interval); - int interval() const; - - bool isRunning() const; - void setRunning(bool running); - - bool isRepeating() const; - void setRepeating(bool repeating); - - bool triggeredOnStart() const; - void setTriggeredOnStart(bool triggeredOnStart); - -protected: - void componentComplete(); - -Q_SIGNALS: - void triggered(); - void runningChanged(); - -private: - void update(); - -private Q_SLOTS: - void ticked(); - void stateChanged(QAbstractAnimation::State,QAbstractAnimation::State); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlTimer) - -QT_END_HEADER - -#endif diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp new file mode 100644 index 0000000..4af83d3 --- /dev/null +++ b/src/declarative/util/qmltimer.cpp @@ -0,0 +1,233 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "QtCore/qcoreapplication.h" +#include "QtCore/qpauseanimation.h" +#include "private/qobject_p.h" +#include "qmltimer.h" +#include "qdebug.h" + +QT_BEGIN_NAMESPACE + +QML_DEFINE_TYPE(QmlTimer,Timer) + +class QmlTimerPrivate : public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QmlTimer) +public: + QmlTimerPrivate() + : interval(1000), running(false), repeating(false), triggeredOnStart(false) + , componentComplete(false) {} + int interval; + bool running; + bool repeating; + bool triggeredOnStart; + QPauseAnimation pause; + bool componentComplete; +}; + +/*! + \qmlclass Timer QFxTimer + \brief The Timer item triggers a handler at a specified interval. + + A timer can be used to trigger an action either once, or repeatedly + at a given interval. + + \qml + Timer { + interval: 500; running: true; repeat: true + onTriggered: Time.text = Date().toString() + } + Text { + id: Time + } + \endqml + +*/ + +QmlTimer::QmlTimer(QObject *parent) + : QObject(*(new QmlTimerPrivate), parent) +{ + Q_D(QmlTimer); + connect(&d->pause, SIGNAL(currentLoopChanged(int)), this, SLOT(ticked())); + connect(&d->pause, SIGNAL(finished()), this, SLOT(ticked())); + connect(&d->pause, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)) + , this, SLOT(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State))); + d->pause.setLoopCount(1); + d->pause.setDuration(d->interval); +} + +/*! + \qmlproperty int Timer::interval + + Sets the \a interval in milliseconds between triggering. +*/ +void QmlTimer::setInterval(int interval) +{ + Q_D(QmlTimer); + if (interval != d->interval) { + d->interval = interval; + update(); + } +} + +int QmlTimer::interval() const +{ + Q_D(const QmlTimer); + return d->interval; +} + +/*! + \qmlproperty bool Timer::running + + If set to true, starts the timer; otherwise stops the timer. + For a non-repeating timer, \a running will be set to false after the + timer has been triggered. + + \sa repeat +*/ +bool QmlTimer::isRunning() const +{ + Q_D(const QmlTimer); + return d->running; +} + +void QmlTimer::setRunning(bool running) +{ + Q_D(QmlTimer); + if (d->running != running) { + d->running = running; + emit runningChanged(); + update(); + } +} + +/*! + \qmlproperty bool Timer::repeat + + If \a repeat is true the timer will be triggered repeatedly at the + specified interval; otherwise, the timer will trigger once at the + specified interval and then stop (i.e. running will be set to false). + + \sa running +*/ +bool QmlTimer::isRepeating() const +{ + Q_D(const QmlTimer); + return d->repeating; +} + +void QmlTimer::setRepeating(bool repeating) +{ + Q_D(QmlTimer); + if (repeating != d->repeating) { + d->repeating = repeating; + update(); + } +} + +/*! + \qmlproperty bool Timer::triggeredOnStart + + If \a triggeredOnStart is true, the timer will be triggered immediately + when started, and subsequently at the specified interval. + + \sa running +*/ +bool QmlTimer::triggeredOnStart() const +{ + Q_D(const QmlTimer); + return d->triggeredOnStart; +} + +void QmlTimer::setTriggeredOnStart(bool triggeredOnStart) +{ + Q_D(QmlTimer); + if (d->triggeredOnStart != triggeredOnStart) { + d->triggeredOnStart = triggeredOnStart; + update(); + } +} + +void QmlTimer::update() +{ + Q_D(QmlTimer); + if (!d->componentComplete) + return; + d->pause.stop(); + if (d->running) { + d->pause.setLoopCount(d->repeating ? -1 : 1); + d->pause.setDuration(d->interval); + d->pause.start(); + if (d->triggeredOnStart) { + QCoreApplication::removePostedEvents(this, QEvent::MetaCall); + QMetaObject::invokeMethod(this, "ticked", Qt::QueuedConnection); + } + } +} + +void QmlTimer::componentComplete() +{ + Q_D(QmlTimer); + d->componentComplete = true; + update(); +} + +/*! + \qmlsignal Timer::onTriggered + + This handler is called when the Timer is triggered. +*/ +void QmlTimer::ticked() +{ + emit triggered(); +} + +void QmlTimer::stateChanged(QAbstractAnimation::State, QAbstractAnimation::State state) +{ + Q_D(QmlTimer); + if (d->running && state != QAbstractAnimation::Running) { + d->running = false; + emit runningChanged(); + } +} + +QT_END_NAMESPACE diff --git a/src/declarative/util/qmltimer.h b/src/declarative/util/qmltimer.h new file mode 100644 index 0000000..0df4cb9 --- /dev/null +++ b/src/declarative/util/qmltimer.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLTIMER_H +#define QMLTIMER_H + +#include +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlTimerPrivate; +class Q_DECLARATIVE_EXPORT QmlTimer : public QObject, public QmlParserStatus +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlTimer) + Q_INTERFACES(QmlParserStatus) + Q_PROPERTY(int interval READ interval WRITE setInterval) + Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged) + Q_PROPERTY(bool repeat READ isRepeating WRITE setRepeating) + Q_PROPERTY(bool triggeredOnStart READ triggeredOnStart WRITE setTriggeredOnStart) + +public: + QmlTimer(QObject *parent=0); + + void setInterval(int interval); + int interval() const; + + bool isRunning() const; + void setRunning(bool running); + + bool isRepeating() const; + void setRepeating(bool repeating); + + bool triggeredOnStart() const; + void setTriggeredOnStart(bool triggeredOnStart); + +protected: + void componentComplete(); + +Q_SIGNALS: + void triggered(); + void runningChanged(); + +private: + void update(); + +private Q_SLOTS: + void ticked(); + void stateChanged(QAbstractAnimation::State,QAbstractAnimation::State); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlTimer) + +QT_END_HEADER + +#endif -- cgit v0.12 From dec30a957ed84d25a06a4c83a972fb02f7ec4fa5 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 14 Jul 2009 15:14:19 +1000 Subject: Update .pri for QmlTimer move. --- src/declarative/extra/extra.pri | 2 -- src/declarative/util/util.pri | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/extra/extra.pri b/src/declarative/extra/extra.pri index fca8ec8..4179817 100644 --- a/src/declarative/extra/extra.pri +++ b/src/declarative/extra/extra.pri @@ -4,7 +4,6 @@ SOURCES += \ extra/qmldatetimeformatter.cpp \ extra/qfxintegermodel.cpp \ extra/qmlfolderlistmodel.cpp \ - extra/qmltimer.cpp \ extra/qfxanimatedimageitem.cpp \ extra/qfxblendedimage.cpp \ extra/qfxflowview.cpp \ @@ -18,7 +17,6 @@ HEADERS += \ extra/qmldatetimeformatter.h \ extra/qfxintegermodel.h \ extra/qmlfolderlistmodel.h \ - extra/qmltimer.h \ extra/qfxanimatedimageitem.h \ extra/qfxanimatedimageitem_p.h \ extra/qfxblendedimage.h \ diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index dcab10a..59e3695 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -19,6 +19,7 @@ SOURCES += \ util/qmllistaccessor.cpp \ util/qmlopenmetaobject.cpp \ util/qmltimeline.cpp \ + util/qmltimer.cpp \ util/qmlbind.cpp HEADERS += \ @@ -46,4 +47,5 @@ HEADERS += \ util/qmlopenmetaobject.h \ util/qmlnullablevalue_p.h \ util/qmltimeline_p.h \ + util/qmltimer.h \ util/qmlbind.h -- cgit v0.12 From 75af1ec1a9840e64d2117475231cd1f359f03d68 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 15 Jul 2009 09:52:20 +1000 Subject: Remove bogus use of QT3_SUPPORT. --- src/declarative/qml/qmlengine.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index b0369e3..46c8b30 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1155,7 +1155,7 @@ public: return true; } - QUrl find(const QString& base, const QString& type) + QUrl find(const QUrl& base, const QString& type) { TypeSet *s = 0; int slash = type.indexOf(QLatin1Char('/')); @@ -1172,10 +1172,9 @@ public: s = &unqualifiedset; } QString unqualifiedtype = type.mid(slash+1); - QUrl baseUrl(base); if (s) { for (int i=0; iurls.count(); ++i) { - QUrl url = baseUrl.resolved(QUrl(s->urls.at(i) +QLatin1String("/")+ unqualifiedtype + QLatin1String(".qml"))); + QUrl url = base.resolved(QUrl(s->urls.at(i) +QLatin1String("/")+ unqualifiedtype + QLatin1String(".qml"))); QString version = s->versions.at(i); // XXX search non-files too! (eg. zip files, see QT-524) QFileInfo f(url.toLocalFile()); @@ -1209,10 +1208,10 @@ public: } } } - return baseUrl.resolved(QUrl(type + QLatin1String(".qml"))); + return base.resolved(QUrl(type + QLatin1String(".qml"))); } - QmlType *findBuiltin(const QString&, const QByteArray& type) + QmlType *findBuiltin(const QUrl& base, const QByteArray& type) { TypeSet *s = 0; int slash = type.indexOf('/'); -- cgit v0.12 From fa0159762ce65c99907dbcb68d1c10e1a126468f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 15 Jul 2009 10:08:42 +1000 Subject: Fix broken qmldom autotests --- tests/auto/declarative/qmldom/MyComponent.qml | 2 ++ tests/auto/declarative/qmldom/top.qml | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 tests/auto/declarative/qmldom/MyComponent.qml create mode 100644 tests/auto/declarative/qmldom/top.qml diff --git a/tests/auto/declarative/qmldom/MyComponent.qml b/tests/auto/declarative/qmldom/MyComponent.qml new file mode 100644 index 0000000..0940753 --- /dev/null +++ b/tests/auto/declarative/qmldom/MyComponent.qml @@ -0,0 +1,2 @@ +Item { +} diff --git a/tests/auto/declarative/qmldom/top.qml b/tests/auto/declarative/qmldom/top.qml new file mode 100644 index 0000000..142d4c8 --- /dev/null +++ b/tests/auto/declarative/qmldom/top.qml @@ -0,0 +1,4 @@ +MyComponent { + width: 100 + height: 100 +} -- cgit v0.12 From 68e47e91af6edca3c714cc3258b65dd88c0ee1e4 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 15 Jul 2009 11:09:31 +1000 Subject: Expose qml import statements in QmlDom --- src/declarative/qml/qmldom.cpp | 98 +++++++++++++++++++++- src/declarative/qml/qmldom.h | 25 +++++- src/declarative/qml/qmldom_p.h | 17 +++- tests/auto/declarative/qmldom/MyComponent.qml | 2 - tests/auto/declarative/qmldom/data/MyComponent.qml | 2 + .../auto/declarative/qmldom/data/importdir/Bar.qml | 0 .../qmldom/data/importlib/sublib/qmldir/Foo.qml | 0 tests/auto/declarative/qmldom/data/top.qml | 4 + tests/auto/declarative/qmldom/top.qml | 4 - tests/auto/declarative/qmldom/tst_qmldom.cpp | 46 +++++++++- 10 files changed, 184 insertions(+), 14 deletions(-) delete mode 100644 tests/auto/declarative/qmldom/MyComponent.qml create mode 100644 tests/auto/declarative/qmldom/data/MyComponent.qml create mode 100644 tests/auto/declarative/qmldom/data/importdir/Bar.qml create mode 100644 tests/auto/declarative/qmldom/data/importlib/sublib/qmldir/Foo.qml create mode 100644 tests/auto/declarative/qmldom/data/top.qml delete mode 100644 tests/auto/declarative/qmldom/top.qml diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 648eb36..e293a93 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -145,9 +145,9 @@ int QmlDomDocument::version() const } /*! - Return the URIs listed by "import " in the qml. + Returns all import statements in qml. */ -QList QmlDomDocument::imports() const +QList QmlDomDocument::imports() const { return d->imports; } @@ -191,7 +191,13 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl } for (int i = 0; i < td->data.imports().size(); ++i) { - d->imports += QUrl(td->data.imports().at(i).uri); + QmlScriptParser::Import parserImport = td->data.imports().at(i); + QmlDomImport domImport; + domImport.d->type = static_cast(parserImport.type); + domImport.d->uri = parserImport.uri; + domImport.d->qualifier = parserImport.qualifier; + domImport.d->version = parserImport.version; + d->imports += domImport; } if (td->data.tree()) { @@ -207,7 +213,6 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl return true; } - /*! Returns the last load errors. The load errors will be reset after a successful call to load(). @@ -1767,4 +1772,89 @@ void QmlDomComponent::setComponentRoot(const QmlDomObject &root) qWarning("QmlDomComponent::setComponentRoot(const QmlDomObject &): Not implemented"); } + +QmlDomImportPrivate::QmlDomImportPrivate() +: type(File) +{ +} + +QmlDomImportPrivate::QmlDomImportPrivate(const QmlDomImportPrivate &other) +: QSharedData(other) +{ +} + +QmlDomImportPrivate::~QmlDomImportPrivate() +{ +} + +/*! + \class QmlDomImport + \internal + \brief The QmlDomImport class represents an import statement. +*/ + +/*! + Construct an empty QmlDomImport. +*/ +QmlDomImport::QmlDomImport() +: d(new QmlDomImportPrivate) +{ +} + +/*! + Create a copy of \a other QmlDomImport. +*/ +QmlDomImport::QmlDomImport(const QmlDomImport &other) +: d(other.d) +{ +} + +/*! + Destroy the QmlDomImport. +*/ +QmlDomImport::~QmlDomImport() +{ +} + +/*! + Assign \a other to this QmlDomImport. +*/ +QmlDomImport &QmlDomImport::operator=(const QmlDomImport &other) +{ + d = other.d; + return *this; +} + +/*! + Returns the type of the import. + */ +QmlDomImport::Type QmlDomImport::type() const +{ + return static_cast(d->type); +} + +/*! + Returns the URI of the import (e.g. 'subdir' or 'com.nokia.Qt') + */ +QString QmlDomImport::uri() const +{ + return d->uri; +} + +/*! + Returns the version specified by the import. An empty string if no version was specified. + */ +QString QmlDomImport::version() const +{ + return d->version; +} + +/*! + Returns the (optional) qualifier string (the token following the 'as' keyword) of the import. + */ +QString QmlDomImport::qualifier() const +{ + return d->qualifier; +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h index ef9fe25..456202a 100644 --- a/src/declarative/qml/qmldom.h +++ b/src/declarative/qml/qmldom.h @@ -59,9 +59,11 @@ class QmlDomList; class QmlDomValue; class QmlEngine; class QmlDomComponent; +class QmlDomImport; class QIODevice; class QmlDomDocumentPrivate; + class Q_DECLARATIVE_EXPORT QmlDomDocument { public: @@ -71,7 +73,7 @@ public: QmlDomDocument &operator=(const QmlDomDocument &); int version() const; - QList imports() const; + QList imports() const; QList errors() const; bool load(QmlEngine *, const QByteArray &, const QUrl & = QUrl()); @@ -304,6 +306,27 @@ private: QSharedDataPointer 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 d; +}; + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/declarative/qml/qmldom_p.h b/src/declarative/qml/qmldom_p.h index 5345c44..b15844a 100644 --- a/src/declarative/qml/qmldom_p.h +++ b/src/declarative/qml/qmldom_p.h @@ -66,7 +66,7 @@ public: ~QmlDomDocumentPrivate(); QList errors; - QList imports; + QList imports; QmlParser::Object *root; QList automaticSemicolonOffsets; }; @@ -129,6 +129,21 @@ public: QmlParser::Value *value; }; +class QmlDomImportPrivate : public QSharedData +{ +public: + QmlDomImportPrivate(); + QmlDomImportPrivate(const QmlDomImportPrivate &); + ~QmlDomImportPrivate(); + + enum Type { Library, File }; + + Type type; + QString uri; + QString version; + QString qualifier; +}; + QT_END_NAMESPACE #endif // QMLDOM_P_H diff --git a/tests/auto/declarative/qmldom/MyComponent.qml b/tests/auto/declarative/qmldom/MyComponent.qml deleted file mode 100644 index 0940753..0000000 --- a/tests/auto/declarative/qmldom/MyComponent.qml +++ /dev/null @@ -1,2 +0,0 @@ -Item { -} diff --git a/tests/auto/declarative/qmldom/data/MyComponent.qml b/tests/auto/declarative/qmldom/data/MyComponent.qml new file mode 100644 index 0000000..0940753 --- /dev/null +++ b/tests/auto/declarative/qmldom/data/MyComponent.qml @@ -0,0 +1,2 @@ +Item { +} diff --git a/tests/auto/declarative/qmldom/data/importdir/Bar.qml b/tests/auto/declarative/qmldom/data/importdir/Bar.qml new file mode 100644 index 0000000..e69de29 diff --git a/tests/auto/declarative/qmldom/data/importlib/sublib/qmldir/Foo.qml b/tests/auto/declarative/qmldom/data/importlib/sublib/qmldir/Foo.qml new file mode 100644 index 0000000..e69de29 diff --git a/tests/auto/declarative/qmldom/data/top.qml b/tests/auto/declarative/qmldom/data/top.qml new file mode 100644 index 0000000..142d4c8 --- /dev/null +++ b/tests/auto/declarative/qmldom/data/top.qml @@ -0,0 +1,4 @@ +MyComponent { + width: 100 + height: 100 +} diff --git a/tests/auto/declarative/qmldom/top.qml b/tests/auto/declarative/qmldom/top.qml deleted file mode 100644 index 142d4c8..0000000 --- a/tests/auto/declarative/qmldom/top.qml +++ /dev/null @@ -1,4 +0,0 @@ -MyComponent { - width: 100 - height: 100 -} diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp index ca8929d..20419fb 100644 --- a/tests/auto/declarative/qmldom/tst_qmldom.cpp +++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp @@ -17,6 +17,7 @@ private slots: void loadProperties(); void loadChildObject(); void loadComposite(); + void loadImports(); void testValueSource(); @@ -52,7 +53,7 @@ void tst_qmldom::loadProperties() QmlDomObject rootObject = document.rootObject(); QVERIFY(rootObject.isValid()); QVERIFY(rootObject.objectId() == "item"); - QVERIFY(rootObject.properties().size() == 2); + QCOMPARE(rootObject.properties().size(), 3); QmlDomProperty xProperty = rootObject.property("x"); QVERIFY(xProperty.propertyName() == "x"); @@ -91,7 +92,7 @@ void tst_qmldom::loadChildObject() void tst_qmldom::loadComposite() { - QFile file(SRCDIR "/top.qml"); + QFile file(SRCDIR "/data/top.qml"); QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QmlDomDocument document; @@ -141,6 +142,47 @@ void tst_qmldom::testValueSource() QVERIFY(sourceValue.toBinding().binding() == "Math.min(Math.max(-130, value*2.2 - 130), 133)"); } +void tst_qmldom::loadImports() +{ + QByteArray qml = "import importlib.sublib 4.7\n" + "import importlib.sublib 4.6 as NewFoo\n" + "import 'import'\n" + "import 'import' as X\n" + "Item {}"; + + QmlEngine engine; + engine.addImportPath(SRCDIR "/data"); + QmlDomDocument document; + QVERIFY(document.load(&engine, qml)); + + QCOMPARE(document.imports().size(), 4); + + QmlDomImport import1 = document.imports().at(0); + QCOMPARE(import1.type(), QmlDomImport::Library); + QCOMPARE(import1.uri(), QLatin1String("importlib.sublib")); + QCOMPARE(import1.qualifier(), QString()); + QCOMPARE(import1.version(), QLatin1String("4.7")); + + QmlDomImport import2 = document.imports().at(1); + QCOMPARE(import2.type(), QmlDomImport::Library); + QCOMPARE(import2.uri(), QLatin1String("importlib.sublib")); + QCOMPARE(import2.qualifier(), QLatin1String("NewFoo")); + QCOMPARE(import2.version(), QLatin1String("4.6")); + + QmlDomImport import3 = document.imports().at(2); + QCOMPARE(import3.type(), QmlDomImport::File); + QCOMPARE(import3.uri(), QLatin1String("import")); + QCOMPARE(import3.qualifier(), QLatin1String("")); + QCOMPARE(import3.version(), QLatin1String("")); + + QmlDomImport import4 = document.imports().at(3); + QCOMPARE(import4.type(), QmlDomImport::File); + QCOMPARE(import4.uri(), QLatin1String("import")); + QCOMPARE(import4.qualifier(), QLatin1String("X")); + QCOMPARE(import4.version(), QLatin1String("")); +} + + QTEST_MAIN(tst_qmldom) #include "tst_qmldom.moc" -- cgit v0.12 From 46fa45fd0f2a40580951903437a5fd1b6c5237ad Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 15 Jul 2009 15:43:35 +1000 Subject: Make QmlPalette properties notifiable. Handle palette changes in QmlPalette. --- src/declarative/util/qmlpalette.cpp | 25 +++++++++++++++++++++++++ src/declarative/util/qmlpalette.h | 31 +++++++++++++++++-------------- tools/qmlviewer/qmlviewer.cpp | 11 +---------- tools/qmlviewer/qmlviewer.h | 1 - 4 files changed, 43 insertions(+), 25 deletions(-) diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp index 670966d..eda0ded 100644 --- a/src/declarative/util/qmlpalette.cpp +++ b/src/declarative/util/qmlpalette.cpp @@ -41,6 +41,7 @@ #include "private/qobject_p.h" #include "qmlpalette.h" +#include QT_BEGIN_NAMESPACE @@ -63,7 +64,9 @@ QmlPalette::QmlPalette(QObject *parent) : QObject(*(new QmlPalettePrivate), parent) { Q_D(QmlPalette); + d->palette = qApp->palette(); d->group = QPalette::Active; + qApp->installEventFilter(this); } QmlPalette::~QmlPalette() @@ -160,4 +163,26 @@ QPalette QmlPalette::palette() const return d->palette; } +bool QmlPalette::eventFilter(QObject *watched, QEvent *event) +{ + if (watched == qApp) { + if (event->type() == QEvent::ApplicationPaletteChange) { + QApplication::postEvent(this, new QEvent(QEvent::ApplicationPaletteChange)); + return false; + } + } + return QObject::eventFilter(watched, event); +} + +bool QmlPalette::event(QEvent *event) +{ + Q_D(QmlPalette); + if (event->type() == QEvent::ApplicationPaletteChange) { + d->palette = qApp->palette(); + emit paletteChanged(); + return true; + } + return QObject::event(event); +} + QT_END_NAMESPACE diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h index f176764..1401ad1 100644 --- a/src/declarative/util/qmlpalette.h +++ b/src/declarative/util/qmlpalette.h @@ -62,19 +62,19 @@ public: QmlPalette(QObject *parent=0); ~QmlPalette(); - Q_PROPERTY(QColor window READ window CONSTANT) - Q_PROPERTY(QColor windowText READ windowText CONSTANT) - Q_PROPERTY(QColor base READ base CONSTANT) - Q_PROPERTY(QColor alternateBase READ alternateBase CONSTANT) - Q_PROPERTY(QColor button READ button CONSTANT) - Q_PROPERTY(QColor buttonText READ buttonText CONSTANT) - Q_PROPERTY(QColor light READ light CONSTANT) - Q_PROPERTY(QColor midlight READ midlight CONSTANT) - Q_PROPERTY(QColor dark READ dark CONSTANT) - Q_PROPERTY(QColor mid READ mid CONSTANT) - Q_PROPERTY(QColor shadow READ shadow CONSTANT) - Q_PROPERTY(QColor highlight READ highlight CONSTANT) - Q_PROPERTY(QColor highlightedText READ highlightedText CONSTANT) + Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) + Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged) + Q_PROPERTY(QColor base READ base NOTIFY paletteChanged) + Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged) + Q_PROPERTY(QColor button READ button NOTIFY paletteChanged) + Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged) + Q_PROPERTY(QColor light READ light NOTIFY paletteChanged) + Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged) + Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged) + Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged) + Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged) + Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged) + Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged) QColor window() const; QColor windowText() const; @@ -98,8 +98,11 @@ public: void setColorGroup(QPalette::ColorGroup); + bool virtual eventFilter(QObject *watched, QEvent *event); + bool virtual event(QEvent *event); + Q_SIGNALS: - void updated(); + void paletteChanged(); }; QT_END_NAMESPACE diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 6de1b97..677c08b 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -194,7 +194,7 @@ void QmlViewer::createMenu(QMenuBar *menu, QMenu *flatmenu) QAction *snapshotAction = new QAction(tr("&Take Snapsot\tF3"), parent); connect(snapshotAction, SIGNAL(triggered()), this, SLOT(takeSnapShot())); recordMenu->addAction(snapshotAction); - + recordAction = new QAction(tr("Start Recording &Video\tF2"), parent); connect(recordAction, SIGNAL(triggered()), this, SLOT(toggleRecordingWithSelection())); recordMenu->addAction(recordAction); @@ -502,15 +502,6 @@ void QmlViewer::setRecordFile(const QString& f) record_file = f; } -bool QmlViewer::event(QEvent *event) -{ - if (event->type() == QEvent::PaletteChange) { - setupPalettes(); - return true; - } - return QWidget::event(event); -} - void QmlViewer::setRecordPeriod(int ms) { record_period = ms; diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index 765d42f..11316c9 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -62,7 +62,6 @@ public slots: protected: virtual void keyPressEvent(QKeyEvent *); virtual void timerEvent(QTimerEvent *); - virtual bool event(QEvent *event); void createMenu(QMenuBar *menu, QMenu *flatmenu); -- cgit v0.12 From dc0a731659f2ed2f53ffe18bb98615d956c51ae4 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 15 Jul 2009 15:58:48 +1000 Subject: Initial commit of the Same Game demo. Compare to KSame if on KDE. This demo primarily demonstrates use of JS and dynamic creation with QML, by creating a functional and animated game entirely with QML & JS --- demos/declarative/samegame/README | 10 ++ demos/declarative/samegame/SameGame.qml | 36 +++++ demos/declarative/samegame/TODO | 5 + demos/declarative/samegame/content/BoomBlock.qml | 48 ++++++ demos/declarative/samegame/content/FastBlock.qml | 41 ++++++ demos/declarative/samegame/content/MediaButton.qml | 39 +++++ demos/declarative/samegame/content/SameDialog.qml | 17 +++ .../samegame/content/pics/background.png | Bin 0 -> 153328 bytes .../samegame/content/pics/blueStone.png | Bin 0 -> 4823 bytes .../samegame/content/pics/button-pressed.png | Bin 0 -> 571 bytes demos/declarative/samegame/content/pics/button.png | Bin 0 -> 564 bytes .../samegame/content/pics/greenStone.png | Bin 0 -> 4724 bytes demos/declarative/samegame/content/pics/qtlogo.png | Bin 0 -> 2738 bytes .../declarative/samegame/content/pics/redStone.png | Bin 0 -> 4585 bytes demos/declarative/samegame/content/pics/star.png | Bin 0 -> 262 bytes .../samegame/content/pics/yellowStone.png | Bin 0 -> 4818 bytes demos/declarative/samegame/content/samegame.js | 163 +++++++++++++++++++++ 17 files changed, 359 insertions(+) create mode 100644 demos/declarative/samegame/README create mode 100644 demos/declarative/samegame/SameGame.qml create mode 100644 demos/declarative/samegame/TODO create mode 100644 demos/declarative/samegame/content/BoomBlock.qml create mode 100644 demos/declarative/samegame/content/FastBlock.qml create mode 100644 demos/declarative/samegame/content/MediaButton.qml create mode 100644 demos/declarative/samegame/content/SameDialog.qml create mode 100644 demos/declarative/samegame/content/pics/background.png create mode 100644 demos/declarative/samegame/content/pics/blueStone.png create mode 100644 demos/declarative/samegame/content/pics/button-pressed.png create mode 100644 demos/declarative/samegame/content/pics/button.png create mode 100644 demos/declarative/samegame/content/pics/greenStone.png create mode 100644 demos/declarative/samegame/content/pics/qtlogo.png create mode 100644 demos/declarative/samegame/content/pics/redStone.png create mode 100644 demos/declarative/samegame/content/pics/star.png create mode 100644 demos/declarative/samegame/content/pics/yellowStone.png create mode 100644 demos/declarative/samegame/content/samegame.js diff --git a/demos/declarative/samegame/README b/demos/declarative/samegame/README new file mode 100644 index 0000000..244b205 --- /dev/null +++ b/demos/declarative/samegame/README @@ -0,0 +1,10 @@ +This demo uses pictures from the KDE project (www.kde.org), +specifically the images from the KSame game. These images are + +background.png +blueStone.png +redStone.png +greenStone.png +yellowStone.png + +and are presumably under the same GPL2 license as the rest of kdegames diff --git a/demos/declarative/samegame/SameGame.qml b/demos/declarative/samegame/SameGame.qml new file mode 100644 index 0000000..0e5bb0f --- /dev/null +++ b/demos/declarative/samegame/SameGame.qml @@ -0,0 +1,36 @@ +import "content" + +Rect { + width: 400 + height: 700 + color: "white" + Script { source: "content/samegame.js" } + Rect{ + property int score: 0 + x:20; y:20; width:360; height:600; id: gameCanvas; + color: "white" + pen.width: 1 + Image { id:background; + source: "content/pics/qtlogo.png" + anchors.fill: parent + } + + MouseRegion { id: gameMR; anchors.fill: parent; + onClicked: handleClick(mouseX, mouseY); + } + } + HorizontalLayout { + anchors.top: gameCanvas.bottom + anchors.topMargin: 10 + anchors.horizontalCenter: parent.horizontalCenter + MediaButton { id: btnA; text: "New Game"; onClicked: {initBoard();} } + MediaButton { id: btnB; text: "Swap Theme"; onClicked: {swapTileSrc(); dialog.opacity = 1;} + } + Text{ text: "Score: " + gameCanvas.score; width:100 } + } + SameDialog { + id: dialog + anchors.centeredIn: parent + text: "Takes effect next game." + } +} diff --git a/demos/declarative/samegame/TODO b/demos/declarative/samegame/TODO new file mode 100644 index 0000000..b02ce54 --- /dev/null +++ b/demos/declarative/samegame/TODO @@ -0,0 +1,5 @@ +Still to do before initial release +-Garbage collect on click +-Particles with count 0->50 should work properly +-Particles are too slow to start +-Everything is too slow, we should have four times the number of tiles there diff --git a/demos/declarative/samegame/content/BoomBlock.qml b/demos/declarative/samegame/content/BoomBlock.qml new file mode 100644 index 0000000..5eaaade --- /dev/null +++ b/demos/declarative/samegame/content/BoomBlock.qml @@ -0,0 +1,48 @@ +Item { id:block + property bool dying: false + property bool spawning: false + property int type: 0 + property int targetX: 0 + property int targetY: 0 + + x: targetX + y: Follow { source: targetY; spring: 1.2; damping: 0.1 } + //y: Behavior { NumberAnimation { properties:"y"; duration: 200 } } + + Image { id: img + source: {if(type==0){"pics/redStone.png";}else if(type==1){"pics/blueStone.png";}else{"pics/greenStone.png";}} + opacity: 0 + opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } + anchors.fill: parent + } + Particles { id: particles + width:1; height:1; anchors.centeredIn: parent; opacity: 0 + lifeSpan: 100000; source: "pics/star.png"; count:1; streamIn: false + angle: 0; angleDeviation: 360; velocity: 100; velocityDeviation:30 + } + states: [ + + State{ name: "SpawnState"; when: spawning == true && dying == false + SetProperties { target: img; opacity: 1 } + }, + State{ name: "DeathState"; when: dying == true + SetProperties { target: particles; count: 50 } + SetProperties { target: particles; opacity: 1 } + SetProperties { target: img; opacity: 0 } + } + ] +// transitions: [ +// Transition { +// fromState: "SpawnState" +// NumberAnimation { properties: "opacity"; duration: 200 } +// }, +// Transition { +// toState: "DeathState" +// SequentialAnimation { +// NumberAnimation { properties: "opacity"; duration: 200 } +// //TODO: Warning about following line, if it works +// //RunScriptAction { script: page.destroy() } +// } +// } +// ] +} diff --git a/demos/declarative/samegame/content/FastBlock.qml b/demos/declarative/samegame/content/FastBlock.qml new file mode 100644 index 0000000..3d14959 --- /dev/null +++ b/demos/declarative/samegame/content/FastBlock.qml @@ -0,0 +1,41 @@ +Rect { id:block + //Note: These properties are the interface used to control the blocks + property bool dying: false + property bool spawning: false + property int type: 0 + property int targetY: 0 + property int targetX: 0 + + color: {if(type==0){"red";}else if(type==1){"blue";}else{"green";}} + pen.width: 1 + pen.color: "black" + opacity: 0 + y: targetY + x: targetX + y: Behavior { NumberAnimation { properties:"y"; duration: 200 } } + opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } + + states: [ + + State{ name: "SpawnState"; when: spawning == true && dying == false + SetProperties { target: block; opacity: 1 } + }, + State{ name: "DeathState"; when: dying == true + SetProperties { target: block; opacity: 0 } + } + ] +// transitions: [ +// Transition { +// fromState: "SpawnState" +// NumberAnimation { properties: "opacity"; duration: 200 } +// }, +// Transition { +// toState: "DeathState" +// SequentialAnimation { +// NumberAnimation { properties: "opacity"; duration: 200 } +// //TODO: Warning about following line, if it works +// //RunScriptAction { script: page.destroy() } +// } +// } +// ] +} diff --git a/demos/declarative/samegame/content/MediaButton.qml b/demos/declarative/samegame/content/MediaButton.qml new file mode 100644 index 0000000..49922f0 --- /dev/null +++ b/demos/declarative/samegame/content/MediaButton.qml @@ -0,0 +1,39 @@ +Item { + id: Container + + signal clicked + + property string text + + Image { + id: Image + source: "pics/button.png" + } + Image { + id: Pressed + source: "pics/button-pressed.png" + opacity: 0 + } + MouseRegion { + id: MouseRegion + anchors.fill: Image + onClicked: { Container.clicked(); } + } + Text { + font.bold: true + color: "white" + anchors.centeredIn: Image + text: Container.text + } + width: Image.width + states: [ + State { + name: "Pressed" + when: MouseRegion.pressed == true + SetProperties { + target: Pressed + opacity: 1 + } + } + ] +} diff --git a/demos/declarative/samegame/content/SameDialog.qml b/demos/declarative/samegame/content/SameDialog.qml new file mode 100644 index 0000000..eed52f0 --- /dev/null +++ b/demos/declarative/samegame/content/SameDialog.qml @@ -0,0 +1,17 @@ +Rect { + property string text: "Hello World!" + property int show: 0 + id: page + opacity: 0 + opacity: Behavior { + SequentialAnimation { + NumberAnimation {property: "opacity"; duration: 1000 } + NumberAnimation {property: "opacity"; to: 0; duration: 1000 } + } + } + color: "white" + pen.width: 1 + width: 200 + height: 60 + Text { anchors.centeredIn: parent; text: parent.text } +} diff --git a/demos/declarative/samegame/content/pics/background.png b/demos/declarative/samegame/content/pics/background.png new file mode 100644 index 0000000..25e885f Binary files /dev/null and b/demos/declarative/samegame/content/pics/background.png differ diff --git a/demos/declarative/samegame/content/pics/blueStone.png b/demos/declarative/samegame/content/pics/blueStone.png new file mode 100644 index 0000000..673f1ce Binary files /dev/null and b/demos/declarative/samegame/content/pics/blueStone.png differ diff --git a/demos/declarative/samegame/content/pics/button-pressed.png b/demos/declarative/samegame/content/pics/button-pressed.png new file mode 100644 index 0000000..e434d32 Binary files /dev/null and b/demos/declarative/samegame/content/pics/button-pressed.png differ diff --git a/demos/declarative/samegame/content/pics/button.png b/demos/declarative/samegame/content/pics/button.png new file mode 100644 index 0000000..56a63ce Binary files /dev/null and b/demos/declarative/samegame/content/pics/button.png differ diff --git a/demos/declarative/samegame/content/pics/greenStone.png b/demos/declarative/samegame/content/pics/greenStone.png new file mode 100644 index 0000000..0c087d0 Binary files /dev/null and b/demos/declarative/samegame/content/pics/greenStone.png differ diff --git a/demos/declarative/samegame/content/pics/qtlogo.png b/demos/declarative/samegame/content/pics/qtlogo.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/demos/declarative/samegame/content/pics/qtlogo.png differ diff --git a/demos/declarative/samegame/content/pics/redStone.png b/demos/declarative/samegame/content/pics/redStone.png new file mode 100644 index 0000000..80c2e2e Binary files /dev/null and b/demos/declarative/samegame/content/pics/redStone.png differ diff --git a/demos/declarative/samegame/content/pics/star.png b/demos/declarative/samegame/content/pics/star.png new file mode 100644 index 0000000..defbde5 Binary files /dev/null and b/demos/declarative/samegame/content/pics/star.png differ diff --git a/demos/declarative/samegame/content/pics/yellowStone.png b/demos/declarative/samegame/content/pics/yellowStone.png new file mode 100644 index 0000000..5349eff Binary files /dev/null and b/demos/declarative/samegame/content/pics/yellowStone.png differ diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js new file mode 100644 index 0000000..f3bb5b6 --- /dev/null +++ b/demos/declarative/samegame/content/samegame.js @@ -0,0 +1,163 @@ +/* This script file handles the game logic */ + +var maxIdx = 18/2;//Nums are for tileSize 20 (desired tile size but too slow) +var maxY = 30/2; +var tileSize = 40; +var maxIndex = maxIdx*maxY; +var board = new Array(maxIndex); +var tileSrc = "content/FastBlock.qml"; +var backSrc = "content/pics/background.png"; +var swapped = false; + +var compSrc; +var component; + +function swapTileSrc(){ + if(swapped) + return; + if(tileSrc == "content/FastBlock.qml"){ + tileSrc = "content/BoomBlock.qml"; + backSrc = "content/pics/background.png"; + }else{ + backSrc = "content/pics/qtlogo.png"; + tileSrc = "content/FastBlock.qml"; + } + swapped = true; +} + +function index(xIdx,yIdx){ + return xIdx + (yIdx * maxIdx); +} + +function initBoard() +{ + background.source = backSrc; + swapped = false; + gameCanvas.score = 0; + for(xIdx=0; xIdx= maxIdx || xIdx < 0 || yIdx >= maxY || yIdx < 0) + return; + if(board[index(xIdx, yIdx)] == null) + return; + removed = 0; + floodKill(xIdx,yIdx, -1); + gameCanvas.score += removed * removed; + shuffleDown(); +} + +function floodKill(xIdx,yIdx,type) +{ + if(xIdx >= maxIdx || xIdx < 0 || yIdx >= maxY || yIdx < 0) + return; + if(board[index(xIdx, yIdx)] == null) + return; + if(type == -1){ + type = board[index(xIdx,yIdx)].type; + }else{ + if(type != board[index(xIdx,yIdx)].type) + return; + } + board[index(xIdx,yIdx)].dying = true; + board[index(xIdx,yIdx)] = null;//They'll have to destroy themselves(can we do that?) + removed += 1; + floodKill(xIdx+1,yIdx,type); + floodKill(xIdx-1,yIdx,type); + floodKill(xIdx,yIdx+1,type); + floodKill(xIdx,yIdx-1,type); +} + +function shuffleDown() +{ + for(xIdx=0; xIdx=0; yIdx--){ + if(board[index(xIdx,yIdx)] == null){ + fallDist += 1; + }else{ + if(fallDist > 0){ + obj = board[index(xIdx,yIdx)]; + obj.targetY += fallDist * tileSize; + board[index(xIdx,yIdx+fallDist)] = obj; + board[index(xIdx,yIdx)] = null; + } + } + } + } +} + +//Need a simpler method of doing this? +var waitStack = new Array(maxIndex); +var waitTop = -1; + +function finishCreatingBlock(xIdx,yIdx){ + //TODO: Doc that the 'xIdx', 'yIdx' here are hidden properties from the calling QFxItem + if(component.isReady()){ + if(xIdx == undefined){ + //Called without arguments, create a previously stored (xIdx,yIdx) + if(waitTop == -1) + return;//Don't have a previously stored (xIdx,yIdx) + xIdx = waitStack[waitTop] % maxIdx; + yIdx = Math.floor(waitStack[waitTop] / maxIdx); + waitTop -= 1; + } + dynamicObject = component.createObject(); + if(dynamicObject == null){ + print("error creating block"); + print(component.errorsString()); + return false; + } + dynamicObject.type = Math.floor(Math.random() * 3); + dynamicObject.parent = gameCanvas; + dynamicObject.targetX = xIdx*tileSize; + dynamicObject.targetY = yIdx*tileSize; + dynamicObject.width = tileSize; + dynamicObject.height = tileSize; + dynamicObject.spawning = true; + board[index(xIdx,yIdx)] = dynamicObject; + return true; + }else if(component.isError()){ + print("error creating block"); + print(component.errorsString()); + }else{ + //It isn't ready, but we'll be called again when it is. + //So store the requested (xIdx,yIdx) for later use + waitTop += 1; + waitStack[waitTop] = index(xIdx,yIdx); + } + return false; +} + +function startCreatingBlock(xIdx,yIdx){ + if(component!=null && compSrc == tileSrc){ + finishCreatingBlock(xIdx,yIdx); + return; + } + + if(component!=null){//Changed source + //delete component; //Does the engine handle this? + compSrc = tileSrc; + } + component = createComponent(tileSrc); + if(finishCreatingBlock(xIdx,yIdx)) + return; + component.statusChanged.connect(finishCreatingBlock()); + return; +} -- cgit v0.12