diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-06 23:56:32 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-06 23:56:32 (GMT) |
commit | 1ae95bbda437d6b4829cc3979b40ceffc5eb2ff2 (patch) | |
tree | 2b42dee7e29da05ee3c185dae653bdb90b1d834a | |
parent | 627f9b09896a1933dd55e1157a06bdec84c7d70c (diff) | |
parent | 15e78b8487ee223eb44acf3d34e1cb71f76234ca (diff) | |
download | Qt-1ae95bbda437d6b4829cc3979b40ceffc5eb2ff2.zip Qt-1ae95bbda437d6b4829cc3979b40ceffc5eb2ff2.tar.gz Qt-1ae95bbda437d6b4829cc3979b40ceffc5eb2ff2.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
109 files changed, 2469 insertions, 2063 deletions
diff --git a/demos/boxes/boxes.pro b/demos/boxes/boxes.pro index a7b19a3..33f1f14 100644 --- a/demos/boxes/boxes.pro +++ b/demos/boxes/boxes.pro @@ -15,8 +15,7 @@ HEADERS += 3rdparty/fbm.h \ qtbox.h \ roundedbox.h \ scene.h \ - trackball.h \ - vector.h + trackball.h SOURCES += 3rdparty/fbm.c \ glbuffers.cpp \ glextensions.cpp \ diff --git a/demos/boxes/glbuffers.cpp b/demos/boxes/glbuffers.cpp index b2a594e..a25a425 100644 --- a/demos/boxes/glbuffers.cpp +++ b/demos/boxes/glbuffers.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "glbuffers.h" +#include <QtGui/qmatrix4x4.h> //============================================================================// // GLTexture // @@ -346,7 +347,7 @@ void GLRenderTargetCube::end() m_fbo.setAsRenderTarget(false); } -void GLRenderTargetCube::getViewMatrix(gfx::Matrix4x4f& mat, int face) +void GLRenderTargetCube::getViewMatrix(QMatrix4x4& mat, int face) { if (face < 0 || face >= 6) { qWarning("GLRenderTargetCube::getViewMatrix: 'face' must be in the range [0, 6). (face == %d)", face); @@ -371,20 +372,21 @@ void GLRenderTargetCube::getViewMatrix(gfx::Matrix4x4f& mat, int face) {-1.0f, -1.0f, +1.0f}, }; - memset(mat.bits(), 0, sizeof(float) * 16); + memset(mat.data(), 0, sizeof(float) * 16); for (int i = 0; i < 3; ++i) - mat(perm[face][i], i) = signs[face][i]; + mat(i, perm[face][i]) = signs[face][i]; mat(3, 3) = 1.0f; } -void GLRenderTargetCube::getProjectionMatrix(gfx::Matrix4x4f& mat, float nearZ, float farZ) +void GLRenderTargetCube::getProjectionMatrix(QMatrix4x4& mat, float nearZ, float farZ) { - float proj[] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, (nearZ+farZ)/(nearZ-farZ), -1.0f, - 0.0f, 0.0f, 2.0f*nearZ*farZ/(nearZ-farZ), 0.0f, - }; - - memcpy(mat.bits(), proj, sizeof(float) * 16); + static const QMatrix4x4 reference( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, -1.0f, 0.0f); + + mat = reference; + mat(2, 2) = (nearZ+farZ)/(nearZ-farZ); + mat(2, 3) = 2.0f*nearZ*farZ/(nearZ-farZ); } diff --git a/demos/boxes/glbuffers.h b/demos/boxes/glbuffers.h index 88de4e8..392924e 100644 --- a/demos/boxes/glbuffers.h +++ b/demos/boxes/glbuffers.h @@ -48,8 +48,6 @@ #include <QtGui> #include <QtOpenGL> -#include "vector.h" - #define BUFFER_OFFSET(i) ((char*)0 + (i)) #define SIZE_OF_MEMBER(cls, member) sizeof(static_cast<cls *>(0)->member) @@ -60,6 +58,8 @@ if (m_failed || !(assertion)) { returnStatement; \ } +class QMatrix4x4; + class GLTexture { public: @@ -135,8 +135,8 @@ public: void end(); virtual bool failed() {return m_failed || m_fbo.failed();} - static void getViewMatrix(gfx::Matrix4x4f& mat, int face); - static void getProjectionMatrix(gfx::Matrix4x4f& mat, float nearZ, float farZ); + static void getViewMatrix(QMatrix4x4& mat, int face); + static void getProjectionMatrix(QMatrix4x4& mat, float nearZ, float farZ); private: GLFrameBufferObject m_fbo; }; diff --git a/demos/boxes/qtbox.cpp b/demos/boxes/qtbox.cpp index 0607698..ba9f95d 100644 --- a/demos/boxes/qtbox.cpp +++ b/demos/boxes/qtbox.cpp @@ -269,19 +269,20 @@ bool ItemBase::isInResizeArea(const QPointF &pos) QtBox::QtBox(int size, int x, int y) : ItemBase(size, x, y), m_texture(0) { for (int i = 0; i < 8; ++i) { - m_vertices[i][0] = (i & 1 ? 0.5f : -0.5f); - m_vertices[i][1] = (i & 2 ? 0.5f : -0.5f); - m_vertices[i][2] = (i & 4 ? 0.5f : -0.5f); + m_vertices[i].setX(i & 1 ? 0.5f : -0.5f); + m_vertices[i].setY(i & 2 ? 0.5f : -0.5f); + m_vertices[i].setZ(i & 4 ? 0.5f : -0.5f); } for (int i = 0; i < 4; ++i) { - m_texCoords[i][0] = (i & 1 ? 1.0f : 0.0f); - m_texCoords[i][1] = (i & 2 ? 1.0f : 0.0f); - } - memset(m_normals, 0, sizeof(m_normals)); - for (int i = 0; i < 3; ++i) { - m_normals[2 * i + 0][i] = -1.0f; - m_normals[2 * i + 1][i] = 1.0f; + m_texCoords[i].setX(i & 1 ? 1.0f : 0.0f); + m_texCoords[i].setY(i & 2 ? 1.0f : 0.0f); } + m_normals[0] = QVector3D(-1.0f, 0.0f, 0.0f); + m_normals[1] = QVector3D(1.0f, 0.0f, 0.0f); + m_normals[2] = QVector3D(0.0f, -1.0f, 0.0f); + m_normals[3] = QVector3D(0.0f, 1.0f, 0.0f); + m_normals[4] = QVector3D(0.0f, 0.0f, -1.0f); + m_normals[5] = QVector3D(0.0f, 0.0f, 1.0f); } QtBox::~QtBox() @@ -351,21 +352,21 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi glColor4f(1.0f, 1.0f, 1.0f, 1.0); glBegin(GL_TRIANGLE_STRIP); - glNormal3fv(m_normals[2 * dir + 0].bits()); + glNormal3fv(reinterpret_cast<float *>(&m_normals[2 * dir + 0])); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 2; ++j) { - glTexCoord2fv(m_texCoords[(j << 1) | i].bits()); - glVertex3fv(m_vertices[(i << ((dir + 2) % 3)) | (j << ((dir + 1) % 3))].bits()); + glTexCoord2fv(reinterpret_cast<float *>(&m_texCoords[(j << 1) | i])); + glVertex3fv(reinterpret_cast<float *>(&m_vertices[(i << ((dir + 2) % 3)) | (j << ((dir + 1) % 3))])); } } glEnd(); glBegin(GL_TRIANGLE_STRIP); - glNormal3fv(m_normals[2 * dir + 1].bits()); + glNormal3fv(reinterpret_cast<float *>(&m_normals[2 * dir + 1])); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 2; ++j) { - glTexCoord2fv(m_texCoords[(j << 1) | i].bits()); - glVertex3fv(m_vertices[(1 << dir) | (i << ((dir + 1) % 3)) | (j << ((dir + 2) % 3))].bits()); + glTexCoord2fv(reinterpret_cast<float *>(&m_texCoords[(j << 1) | i])); + glVertex3fv(reinterpret_cast<float *>(&m_vertices[(1 << dir) | (i << ((dir + 1) % 3)) | (j << ((dir + 2) % 3))])); } } glEnd(); diff --git a/demos/boxes/qtbox.h b/demos/boxes/qtbox.h index aae8256..5042077 100644 --- a/demos/boxes/qtbox.h +++ b/demos/boxes/qtbox.h @@ -44,7 +44,7 @@ #include <QtGui> -#include "vector.h" +#include <QtGui/qvector3d.h> #include "glbuffers.h" class ItemBase : public QObject, public QGraphicsItem @@ -85,9 +85,9 @@ public: protected: virtual ItemBase *createNew(int size, int x, int y); private: - gfx::Vector3f m_vertices[8]; - gfx::Vector2f m_texCoords[4]; - gfx::Vector3f m_normals[6]; + QVector3D m_vertices[8]; + QVector3D m_texCoords[4]; + QVector3D m_normals[6]; GLTexture *m_texture; }; diff --git a/demos/boxes/roundedbox.cpp b/demos/boxes/roundedbox.cpp index f238da2..93ebce7 100644 --- a/demos/boxes/roundedbox.cpp +++ b/demos/boxes/roundedbox.cpp @@ -46,9 +46,10 @@ //============================================================================// VertexDescription P3T2N3Vertex::description[] = { - {VertexDescription::Position, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, position) / sizeof(float), offsetof(P3T2N3Vertex, position), 0}, - {VertexDescription::TexCoord, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, texCoord) / sizeof(float), offsetof(P3T2N3Vertex, texCoord), 0}, - {VertexDescription::Normal, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, normal) / sizeof(float), offsetof(P3T2N3Vertex, normal), 0}, + {VertexDescription::Position, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, position) / sizeof(float), 0, 0}, + {VertexDescription::TexCoord, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, texCoord) / sizeof(float), sizeof(QVector3D), 0}, + {VertexDescription::Normal, GL_FLOAT, SIZE_OF_MEMBER(P3T2N3Vertex, normal) / sizeof(float), sizeof(QVector3D) + sizeof(QVector2D), 0}, + {VertexDescription::Null, 0, 0, 0, 0}, }; @@ -78,10 +79,9 @@ GLRoundedBox::GLRoundedBox(float r, float scale, int n) } for (int corner = 0; corner < 8; ++corner) { - gfx::Vector3f centre; - centre[0] = (corner & 1 ? 1.0f : -1.0f); - centre[1] = (corner & 2 ? 1.0f : -1.0f); - centre[2] = (corner & 4 ? 1.0f : -1.0f); + QVector3D centre(corner & 1 ? 1.0f : -1.0f, + corner & 2 ? 1.0f : -1.0f, + corner & 4 ? 1.0f : -1.0f); int winding = (corner & 1) ^ ((corner >> 1) & 1) ^ (corner >> 2); int offsX = ((corner ^ 1) - corner) * vertexCountPerCorner; int offsY = ((corner ^ 2) - corner) * vertexCountPerCorner; @@ -129,12 +129,13 @@ GLRoundedBox::GLRoundedBox(float r, float scale, int n) } for (int j = 0; j <= i; ++j) { - gfx::Vector3f normal = gfx::Vector3f::vector(i - j, j, n + 1 - i).normalized(); - gfx::Vector3f pos = centre * (0.5f - r + r * normal); + QVector3D normal = QVector3D(i - j, j, n + 1 - i).normalized(); + QVector3D offset(0.5f - r, 0.5f - r, 0.5f - r); + QVector3D pos = centre * (offset + r * normal); vp[vidx].position = scale * pos; vp[vidx].normal = centre * normal; - vp[vidx].texCoord = gfx::Vector2f::vector(pos[0], pos[1]) + 0.5f; + vp[vidx].texCoord = QVector2D(pos.x() + 0.5f, pos.y() + 0.5f); // Corner polygons if (i < n + 1) { diff --git a/demos/boxes/roundedbox.h b/demos/boxes/roundedbox.h index b934ade..65b545e 100644 --- a/demos/boxes/roundedbox.h +++ b/demos/boxes/roundedbox.h @@ -49,14 +49,15 @@ #include <QtOpenGL> #include "gltrianglemesh.h" -#include "vector.h" +#include <QtGui/qvector3d.h> +#include <QtGui/qvector2d.h> #include "glbuffers.h" struct P3T2N3Vertex { - gfx::Vector3f position; - gfx::Vector2f texCoord; - gfx::Vector3f normal; + QVector3D position; + QVector2D texCoord; + QVector3D normal; static VertexDescription description[]; }; diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp index 5f1fe14..e2aa16b 100644 --- a/demos/boxes/scene.cpp +++ b/demos/boxes/scene.cpp @@ -39,7 +39,10 @@ ** ****************************************************************************/ +#include <QDebug> #include "scene.h" +#include <QtGui/qmatrix4x4.h> +#include <QtGui/qvector3d.h> #include "3rdparty/fbm.h" @@ -484,9 +487,9 @@ Scene::Scene(int width, int height, int maxTextureSize) { setSceneRect(0, 0, width, height); - m_trackBalls[0] = TrackBall(0.0005f, gfx::Vector3f::vector(0, 1, 0), TrackBall::Sphere); - m_trackBalls[1] = TrackBall(0.0001f, gfx::Vector3f::vector(0, 0, 1), TrackBall::Sphere); - m_trackBalls[2] = TrackBall(0.0f, gfx::Vector3f::vector(0, 1, 0), TrackBall::Plane); + m_trackBalls[0] = TrackBall(0.05f, QVector3D(0, 1, 0), TrackBall::Sphere); + m_trackBalls[1] = TrackBall(0.005f, QVector3D(0, 0, 1), TrackBall::Sphere); + m_trackBalls[2] = TrackBall(0.0f, QVector3D(0, 1, 0), TrackBall::Plane); m_renderOptions = new RenderOptionsDialog; m_renderOptions->move(20, 120); @@ -620,11 +623,11 @@ void Scene::initGL() if (!program->link()) { qWarning("Failed to compile and link shader program"); qWarning("Vertex shader log:"); - qWarning() << m_vertexShader->errors(); + qWarning() << m_vertexShader->log(); qWarning() << "Fragment shader log ( file =" << file.absoluteFilePath() << "):"; - qWarning() << shader->errors(); + qWarning() << shader->log(); qWarning("Shader program log:"); - qWarning() << program->errors(); + qWarning() << program->log(); delete shader; delete program; @@ -648,9 +651,9 @@ void Scene::initGL() // If one of the boxes should not be rendered, set excludeBox to its index. // If the main box should not be rendered, set excludeBox to -1. -void Scene::renderBoxes(const gfx::Matrix4x4f &view, int excludeBox) +void Scene::renderBoxes(const QMatrix4x4 &view, int excludeBox) { - gfx::Matrix4x4f invView = view.inverse(); + QMatrix4x4 invView = view.inverted(); // If multi-texturing is supported, use three saplers. if (glActiveTexture) { @@ -666,11 +669,11 @@ void Scene::renderBoxes(const gfx::Matrix4x4f &view, int excludeBox) glDisable(GL_LIGHTING); glDisable(GL_CULL_FACE); - gfx::Matrix4x4f viewRotation(view); + QMatrix4x4 viewRotation(view); viewRotation(3, 0) = viewRotation(3, 1) = viewRotation(3, 2) = 0.0f; viewRotation(0, 3) = viewRotation(1, 3) = viewRotation(2, 3) = 0.0f; viewRotation(3, 3) = 1.0f; - glLoadMatrixf(viewRotation.bits()); + glLoadMatrixf(viewRotation.data()); glScalef(20.0f, 20.0f, 20.0f); // Don't render the environment if the environment texture can't be set for the correct sampler. @@ -685,7 +688,7 @@ void Scene::renderBoxes(const gfx::Matrix4x4f &view, int excludeBox) m_environment->unbind(); } - glLoadMatrixf(view.bits()); + glLoadMatrixf(view.data()); glEnable(GL_CULL_FACE); glEnable(GL_LIGHTING); @@ -695,9 +698,11 @@ void Scene::renderBoxes(const gfx::Matrix4x4f &view, int excludeBox) continue; glPushMatrix(); - gfx::Matrix4x4f m; - m_trackBalls[1].rotation().matrix(m); - glMultMatrixf(m.bits()); + QMatrix4x4 m; + m.rotate(m_trackBalls[1].rotation()); + m = m.transposed(); + + glMultMatrixf(m.data()); glRotatef(360.0f * i / m_programs.size(), 0.0f, 0.0f, 1.0f); glTranslatef(2.0f, 0.0f, 0.0f); @@ -713,12 +718,8 @@ void Scene::renderBoxes(const gfx::Matrix4x4f &view, int excludeBox) m_programs[i]->setUniformValue("tex", GLint(0)); m_programs[i]->setUniformValue("env", GLint(1)); m_programs[i]->setUniformValue("noise", GLint(2)); - QMatrix4x4 mview; - QMatrix4x4 minvview; - memcpy(mview.data(), view.bits(), sizeof(float) * 16); - memcpy(minvview.data(), invView.bits(), sizeof(float) * 16); - m_programs[i]->setUniformValue("view", mview); - m_programs[i]->setUniformValue("invView", minvview); + m_programs[i]->setUniformValue("view", view); + m_programs[i]->setUniformValue("invView", invView); m_box->draw(); m_programs[i]->disable(); @@ -732,9 +733,10 @@ void Scene::renderBoxes(const gfx::Matrix4x4f &view, int excludeBox) } if (-1 != excludeBox) { - gfx::Matrix4x4f m; - m_trackBalls[0].rotation().matrix(m); - glMultMatrixf(m.bits()); + QMatrix4x4 m; + m.rotate(m_trackBalls[0].rotation()); + m = m.transposed(); + glMultMatrixf(m.data()); if (glActiveTexture) { if (m_dynamicCubemap) @@ -747,12 +749,8 @@ void Scene::renderBoxes(const gfx::Matrix4x4f &view, int excludeBox) m_programs[m_currentShader]->setUniformValue("tex", GLint(0)); m_programs[m_currentShader]->setUniformValue("env", GLint(1)); m_programs[m_currentShader]->setUniformValue("noise", GLint(2)); - QMatrix4x4 mview; - QMatrix4x4 minvview; - memcpy(mview.data(), view.bits(), sizeof(float) * 16); - memcpy(minvview.data(), invView.bits(), sizeof(float) * 16); - m_programs[m_currentShader]->setUniformValue("view", mview); - m_programs[m_currentShader]->setUniformValue("invView", minvview); + m_programs[m_currentShader]->setUniformValue("view", view); + m_programs[m_currentShader]->setUniformValue("invView", invView); m_box->draw(); m_programs[m_currentShader]->disable(); @@ -839,31 +837,32 @@ void Scene::renderCubemaps() // To speed things up, only update the cubemaps for the small cubes every N frames. const int N = (m_updateAllCubemaps ? 1 : 3); - gfx::Matrix4x4f mat; + QMatrix4x4 mat; GLRenderTargetCube::getProjectionMatrix(mat, 0.1f, 100.0f); glMatrixMode(GL_PROJECTION); glPushMatrix(); - glLoadMatrixf(mat.bits()); + glLoadMatrixf(mat.data()); glMatrixMode(GL_MODELVIEW); glPushMatrix(); - gfx::Vector3f center; + QVector3D center; for (int i = m_frame % N; i < m_cubemaps.size(); i += N) { if (0 == m_cubemaps[i]) continue; float angle = 2.0f * PI * i / m_cubemaps.size(); - center = m_trackBalls[1].rotation().transform(gfx::Vector3f::vector(cos(angle), sin(angle), 0)); + + center = m_trackBalls[1].rotation().rotateVector(QVector3D(cos(angle), sin(angle), 0.0f)); for (int face = 0; face < 6; ++face) { m_cubemaps[i]->begin(face); GLRenderTargetCube::getViewMatrix(mat, face); - gfx::Vector4f v = gfx::Vector4f::vector(-center[0], -center[1], -center[2], 1.0); - mat[3] = v * mat; + QVector4D v = QVector4D(-center.x(), -center.y(), -center.z(), 1.0); + mat.setColumn(3, v * mat); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); renderBoxes(mat, i); @@ -907,12 +906,9 @@ void Scene::drawBackground(QPainter *painter, const QRectF &) glMatrixMode(GL_MODELVIEW); - //gfx::Matrix4x4f view = gfx::Matrix4x4f::identity(); - //view(3, 2) -= 2.0f * exp(m_distExp / 1200.0f); - - gfx::Matrix4x4f view; - m_trackBalls[2].rotation().matrix(view); - view(3, 2) -= 2.0f * exp(m_distExp / 1200.0f); + QMatrix4x4 view; + view.rotate(m_trackBalls[2].rotation()); + view(2, 3) -= 2.0f * exp(m_distExp / 1200.0f); renderBoxes(view); defaultStates(); @@ -946,10 +942,10 @@ void Scene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) } if (event->buttons() & Qt::MidButton) { - m_trackBalls[2].move(pixelPosToViewPos(event->scenePos()), gfx::Quaternionf::identity()); + m_trackBalls[2].move(pixelPosToViewPos(event->scenePos()), QQuaternion()); event->accept(); } else { - m_trackBalls[2].release(pixelPosToViewPos(event->scenePos()), gfx::Quaternionf::identity()); + m_trackBalls[2].release(pixelPosToViewPos(event->scenePos()), QQuaternion()); } } @@ -970,7 +966,7 @@ void Scene::mousePressEvent(QGraphicsSceneMouseEvent *event) } if (event->buttons() & Qt::MidButton) { - m_trackBalls[2].push(pixelPosToViewPos(event->scenePos()), gfx::Quaternionf::identity()); + m_trackBalls[2].push(pixelPosToViewPos(event->scenePos()), QQuaternion()); event->accept(); } } @@ -992,7 +988,7 @@ void Scene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } if (event->button() == Qt::MidButton) { - m_trackBalls[2].release(pixelPosToViewPos(event->scenePos()), gfx::Quaternionf::identity()); + m_trackBalls[2].release(pixelPosToViewPos(event->scenePos()), QQuaternion()); event->accept(); } } diff --git a/demos/boxes/scene.h b/demos/boxes/scene.h index c056739..48ecaba 100644 --- a/demos/boxes/scene.h +++ b/demos/boxes/scene.h @@ -50,13 +50,13 @@ #include "roundedbox.h" #include "gltrianglemesh.h" -#include "vector.h" #include "trackball.h" #include "glbuffers.h" #include "qtbox.h" #define PI 3.14159265358979 +class QMatrix4x4; class ParameterEdit : public QWidget { public: @@ -194,7 +194,7 @@ public slots: void setFloatParameter(const QString &name, float value); void newItem(ItemDialog::ItemType type); protected: - void renderBoxes(const gfx::Matrix4x4f &view, int excludeBox = -2); + void renderBoxes(const QMatrix4x4 &view, int excludeBox = -2); void setStates(); void setLights(); void defaultStates(); @@ -237,6 +237,4 @@ private: QGLShaderProgram *m_environmentProgram; }; - - #endif diff --git a/demos/boxes/trackball.cpp b/demos/boxes/trackball.cpp index 980f6ed..a8bfe44 100644 --- a/demos/boxes/trackball.cpp +++ b/demos/boxes/trackball.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "trackball.h" +#include "scene.h" //============================================================================// // TrackBall // @@ -51,23 +52,23 @@ TrackBall::TrackBall(TrackMode mode) , m_pressed(false) , m_mode(mode) { - m_axis = gfx::Vector3f::vector(0, 1, 0); - m_rotation = gfx::Quaternionf::quaternion(1.0f, 0.0f, 0.0f, 0.0f); + m_axis = QVector3D(0, 1, 0); + m_rotation = QQuaternion(); m_lastTime = QTime::currentTime(); } -TrackBall::TrackBall(float angularVelocity, const gfx::Vector3f& axis, TrackMode mode) +TrackBall::TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode) : m_axis(axis) , m_angularVelocity(angularVelocity) , m_paused(false) , m_pressed(false) , m_mode(mode) { - m_rotation = gfx::Quaternionf::quaternion(1.0f, 0.0f, 0.0f, 0.0f); + m_rotation = QQuaternion(); m_lastTime = QTime::currentTime(); } -void TrackBall::push(const QPointF& p, const gfx::Quaternionf &) +void TrackBall::push(const QPointF& p, const QQuaternion &) { m_rotation = rotation(); m_pressed = true; @@ -76,7 +77,7 @@ void TrackBall::push(const QPointF& p, const gfx::Quaternionf &) m_angularVelocity = 0.0f; } -void TrackBall::move(const QPointF& p, const gfx::Quaternionf &transformation) +void TrackBall::move(const QPointF& p, const QQuaternion &transformation) { if (!m_pressed) return; @@ -90,44 +91,45 @@ void TrackBall::move(const QPointF& p, const gfx::Quaternionf &transformation) case Plane: { QLineF delta(m_lastPos, p); - m_angularVelocity = delta.length() / msecs; - m_axis = gfx::Vector3f::vector(delta.dy(), -delta.dx(), 0.0f).normalized(); - m_axis = transformation.transform(m_axis); - m_rotation *= gfx::Quaternionf::rotation(delta.length(), m_axis); + m_angularVelocity = 180*delta.length() / (PI*msecs); + m_axis = QVector3D(delta.dy(), -delta.dx(), 0.0f).normalized(); + m_axis = transformation.rotateVector(m_axis); + m_rotation *= QQuaternion::fromAxisAndAngle(m_axis, delta.length()); } break; case Sphere: { - gfx::Vector3f lastPos3D = gfx::Vector3f::vector(m_lastPos.x(), m_lastPos.y(), 0); - float sqrZ = 1 - lastPos3D.sqrNorm(); + QVector3D lastPos3D = QVector3D(m_lastPos.x(), m_lastPos.y(), 0.0f); + float sqrZ = 1 - QVector3D::dotProduct(lastPos3D, lastPos3D); if (sqrZ > 0) - lastPos3D[2] = sqrt(sqrZ); + lastPos3D.setZ(sqrt(sqrZ)); else lastPos3D.normalize(); - gfx::Vector3f currentPos3D = gfx::Vector3f::vector(p.x(), p.y(), 0); - sqrZ = 1 - currentPos3D.sqrNorm(); + QVector3D currentPos3D = QVector3D(p.x(), p.y(), 0.0f); + sqrZ = 1 - QVector3D::dotProduct(currentPos3D, currentPos3D); if (sqrZ > 0) - currentPos3D[2] = sqrt(sqrZ); + currentPos3D.setZ(sqrt(sqrZ)); else currentPos3D.normalize(); - m_axis = gfx::Vector3f::cross(currentPos3D, lastPos3D); - float angle = asin(sqrt(m_axis.sqrNorm())); + m_axis = QVector3D::crossProduct(currentPos3D, lastPos3D); + float angle = asin(sqrt(QVector3D::dotProduct(m_axis, m_axis))); - m_angularVelocity = angle / msecs; + m_angularVelocity = 180*angle / (PI*msecs); m_axis.normalize(); - m_axis = transformation.transform(m_axis); - m_rotation *= gfx::Quaternionf::rotation(angle, m_axis); + m_axis = transformation.rotateVector(m_axis); + m_rotation *= QQuaternion::fromAxisAndAngle(m_axis, angle); } break; } + m_lastPos = p; m_lastTime = currentTime; } -void TrackBall::release(const QPointF& p, const gfx::Quaternionf &transformation) +void TrackBall::release(const QPointF& p, const QQuaternion &transformation) { // Calling move() caused the rotation to stop if the framerate was too low. move(p, transformation); @@ -146,13 +148,13 @@ void TrackBall::stop() m_paused = true; } -gfx::Quaternionf TrackBall::rotation() const +QQuaternion TrackBall::rotation() const { if (m_paused || m_pressed) return m_rotation; QTime currentTime = QTime::currentTime(); float angle = m_angularVelocity * m_lastTime.msecsTo(currentTime); - return m_rotation * gfx::Quaternionf::rotation(angle, m_axis); + return m_rotation * QQuaternion::fromAxisAndAngle(m_axis, angle); } diff --git a/demos/boxes/trackball.h b/demos/boxes/trackball.h index 5e3f40c..66e9b68 100644 --- a/demos/boxes/trackball.h +++ b/demos/boxes/trackball.h @@ -44,7 +44,8 @@ #include <QtGui> -#include "vector.h" +#include <QtGui/qvector3d.h> +#include <QtGui/qquaternion.h> class TrackBall { @@ -55,17 +56,17 @@ public: Sphere, }; TrackBall(TrackMode mode = Sphere); - TrackBall(float angularVelocity, const gfx::Vector3f& axis, TrackMode mode = Sphere); + TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode = Sphere); // coordinates in [-1,1]x[-1,1] - void push(const QPointF& p, const gfx::Quaternionf &transformation); - void move(const QPointF& p, const gfx::Quaternionf &transformation); - void release(const QPointF& p, const gfx::Quaternionf &transformation); + void push(const QPointF& p, const QQuaternion &transformation); + void move(const QPointF& p, const QQuaternion &transformation); + void release(const QPointF& p, const QQuaternion &transformation); void start(); // starts clock void stop(); // stops clock - gfx::Quaternionf rotation() const; + QQuaternion rotation() const; private: - gfx::Quaternionf m_rotation; - gfx::Vector3f m_axis; + QQuaternion m_rotation; + QVector3D m_axis; float m_angularVelocity; QPointF m_lastPos; diff --git a/demos/boxes/vector.h b/demos/boxes/vector.h deleted file mode 100644 index bb24531..0000000 --- a/demos/boxes/vector.h +++ /dev/null @@ -1,602 +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 demonstration applications 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 VECTOR_H -#define VECTOR_H - -#include <cassert> -#include <cmath> -#include <iostream> - -namespace gfx -{ - -template<class T, int n> -struct Vector -{ - // Keep the Vector struct a plain old data (POD) struct by avoiding constructors - - static Vector vector(T x) - { - Vector result; - for (int i = 0; i < n; ++i) - result.v[i] = x; - return result; - } - - // Use only for 2D vectors - static Vector vector(T x, T y) - { - assert(n == 2); - Vector result; - result.v[0] = x; - result.v[1] = y; - return result; - } - - // Use only for 3D vectors - static Vector vector(T x, T y, T z) - { - assert(n == 3); - Vector result; - result.v[0] = x; - result.v[1] = y; - result.v[2] = z; - return result; - } - - // Use only for 4D vectors - static Vector vector(T x, T y, T z, T w) - { - assert(n == 4); - Vector result; - result.v[0] = x; - result.v[1] = y; - result.v[2] = z; - result.v[3] = w; - return result; - } - - // Pass 'n' arguments to this function. - static Vector vector(T *v) - { - Vector result; - for (int i = 0; i < n; ++i) - result.v[i] = v[i]; - return result; - } - - T &operator [] (int i) {return v[i];} - T operator [] (int i) const {return v[i];} - -#define VECTOR_BINARY_OP(op, arg, rhs) \ - Vector operator op (arg) const \ - { \ - Vector result; \ - for (int i = 0; i < n; ++i) \ - result.v[i] = v[i] op rhs; \ - return result; \ - } - - VECTOR_BINARY_OP(+, const Vector &u, u.v[i]) - VECTOR_BINARY_OP(-, const Vector &u, u.v[i]) - VECTOR_BINARY_OP(*, const Vector &u, u.v[i]) - VECTOR_BINARY_OP(/, const Vector &u, u.v[i]) - VECTOR_BINARY_OP(+, T s, s) - VECTOR_BINARY_OP(-, T s, s) - VECTOR_BINARY_OP(*, T s, s) - VECTOR_BINARY_OP(/, T s, s) -#undef VECTOR_BINARY_OP - - Vector operator - () const - { - Vector result; - for (int i = 0; i < n; ++i) - result.v[i] = -v[i]; - return result; - } - -#define VECTOR_ASSIGN_OP(op, arg, rhs) \ - Vector &operator op (arg) \ - { \ - for (int i = 0; i < n; ++i) \ - v[i] op rhs; \ - return *this; \ - } - - VECTOR_ASSIGN_OP(+=, const Vector &u, u.v[i]) - VECTOR_ASSIGN_OP(-=, const Vector &u, u.v[i]) - VECTOR_ASSIGN_OP(=, T s, s) - VECTOR_ASSIGN_OP(*=, T s, s) - VECTOR_ASSIGN_OP(/=, T s, s) -#undef VECTOR_ASSIGN_OP - - static T dot(const Vector &u, const Vector &v) - { - T sum(0); - for (int i = 0; i < n; ++i) - sum += u.v[i] * v.v[i]; - return sum; - } - - static Vector cross(const Vector &u, const Vector &v) - { - assert(n == 3); - return vector(u.v[1] * v.v[2] - u.v[2] * v.v[1], - u.v[2] * v.v[0] - u.v[0] * v.v[2], - u.v[0] * v.v[1] - u.v[1] * v.v[0]); - } - - T sqrNorm() const - { - return dot(*this, *this); - } - - // requires floating point type T - void normalize() - { - T s = sqrNorm(); - if (s != 0) - *this /= sqrt(s); - } - - // requires floating point type T - Vector normalized() const - { - T s = sqrNorm(); - if (s == 0) - return *this; - return *this / sqrt(s); - } - - T *bits() {return v;} - const T *bits() const {return v;} - - T v[n]; -}; - -#define SCALAR_VECTOR_BINARY_OP(op) \ -template<class T, int n> \ -Vector<T, n> operator op (T s, const Vector<T, n>& u) \ -{ \ - Vector<T, n> result; \ - for (int i = 0; i < n; ++i) \ - result[i] = s op u[i]; \ - return result; \ -} - -SCALAR_VECTOR_BINARY_OP(+) -SCALAR_VECTOR_BINARY_OP(-) -SCALAR_VECTOR_BINARY_OP(*) -SCALAR_VECTOR_BINARY_OP(/) -#undef SCALAR_VECTOR_BINARY_OP - -template<class T, int n> -std::ostream &operator << (std::ostream &os, const Vector<T, n> &v) -{ - assert(n > 0); - os << "[" << v[0]; - for (int i = 1; i < n; ++i) - os << ", " << v[i]; - os << "]"; - return os; -} - -typedef Vector<float, 2> Vector2f; -typedef Vector<float, 3> Vector3f; -typedef Vector<float, 4> Vector4f; - -template<class T, int rows, int cols> -struct Matrix -{ - // Keep the Matrix struct a plain old data (POD) struct by avoiding constructors - - static Matrix matrix(T x) - { - Matrix result; - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) - result.v[i][j] = x; - } - return result; - } - - static Matrix matrix(T *m) - { - Matrix result; - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - result.v[i][j] = *m; - ++m; - } - } - return result; - } - - T &operator () (int i, int j) {return v[i][j];} - T operator () (int i, int j) const {return v[i][j];} - Vector<T, cols> &operator [] (int i) {return v[i];} - const Vector<T, cols> &operator [] (int i) const {return v[i];} - - // TODO: operators, methods - - Vector<T, rows> operator * (const Vector<T, cols> &u) const - { - Vector<T, rows> result; - for (int i = 0; i < rows; ++i) - result[i] = Vector<T, cols>::dot(v[i], u); - return result; - } - - template<int k> - Matrix<T, rows, k> operator * (const Matrix<T, cols, k> &m) - { - Matrix<T, rows, k> result; - for (int i = 0; i < rows; ++i) - result[i] = v[i] * m; - return result; - } - - T* bits() {return reinterpret_cast<T *>(this);} - const T* bits() const {return reinterpret_cast<const T *>(this);} - - // Simple Gauss elimination. - // TODO: Optimize and improve stability. - Matrix inverse(bool *ok = 0) const - { - assert(rows == cols); - Matrix rhs = identity(); - Matrix lhs(*this); - T temp; - // Down - for (int i = 0; i < rows; ++i) { - // Pivoting - int pivot = i; - for (int j = i; j < rows; ++j) { - if (qAbs(lhs(j, i)) > lhs(pivot, i)) - pivot = j; - } - // TODO: fuzzy compare. - if (lhs(pivot, i) == T(0)) { - if (ok) - *ok = false; - return rhs; - } - if (pivot != i) { - for (int j = i; j < cols; ++j) { - temp = lhs(pivot, j); - lhs(pivot, j) = lhs(i, j); - lhs(i, j) = temp; - } - for (int j = 0; j < cols; ++j) { - temp = rhs(pivot, j); - rhs(pivot, j) = rhs(i, j); - rhs(i, j) = temp; - } - } - - // Normalize i-th row - rhs[i] /= lhs(i, i); - for (int j = cols - 1; j > i; --j) - lhs(i, j) /= lhs(i, i); - - // Eliminate non-zeros in i-th column below the i-th row. - for (int j = i + 1; j < rows; ++j) { - rhs[j] -= lhs(j, i) * rhs[i]; - for (int k = i + 1; k < cols; ++k) - lhs(j, k) -= lhs(j, i) * lhs(i, k); - } - } - // Up - for (int i = rows - 1; i > 0; --i) { - for (int j = i - 1; j >= 0; --j) - rhs[j] -= lhs(j, i) * rhs[i]; - } - if (ok) - *ok = true; - return rhs; - } - - Matrix<T, cols, rows> transpose() const - { - Matrix<T, cols, rows> result; - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) - result.v[j][i] = v[i][j]; - } - return result; - } - - static Matrix identity() - { - Matrix result = matrix(T(0)); - for (int i = 0; i < rows && i < cols; ++i) - result.v[i][i] = T(1); - return result; - } - - Vector<T, cols> v[rows]; -}; - -template<class T, int rows, int cols> -Vector<T, cols> operator * (const Vector<T, rows> &u, const Matrix<T, rows, cols> &m) -{ - Vector<T, cols> result = Vector<T, cols>::vector(T(0)); - for (int i = 0; i < rows; ++i) - result += m[i] * u[i]; - return result; -} - -template<class T, int rows, int cols> -std::ostream &operator << (std::ostream &os, const Matrix<T, rows, cols> &m) -{ - assert(rows > 0); - os << "[" << m[0]; - for (int i = 1; i < rows; ++i) - os << ", " << m[i]; - os << "]"; - return os; -} - - -typedef Matrix<float, 2, 2> Matrix2x2f; -typedef Matrix<float, 3, 3> Matrix3x3f; -typedef Matrix<float, 4, 4> Matrix4x4f; - -template<class T> -struct Quaternion -{ - // Keep the Quaternion struct a plain old data (POD) struct by avoiding constructors - - static Quaternion quaternion(T s, T x, T y, T z) - { - Quaternion result; - result.scalar = s; - result.vector[0] = x; - result.vector[1] = y; - result.vector[2] = z; - return result; - } - - static Quaternion quaternion(T s, const Vector<T, 3> &v) - { - Quaternion result; - result.scalar = s; - result.vector = v; - return result; - } - - static Quaternion identity() - { - return quaternion(T(1), T(0), T(0), T(0)); - } - - // assumes that all the elements are packed tightly - T& operator [] (int i) {return reinterpret_cast<T *>(this)[i];} - T operator [] (int i) const {return reinterpret_cast<const T *>(this)[i];} - -#define QUATERNION_BINARY_OP(op, arg, rhs) \ - Quaternion operator op (arg) const \ - { \ - Quaternion result; \ - for (int i = 0; i < 4; ++i) \ - result[i] = (*this)[i] op rhs; \ - return result; \ - } - - QUATERNION_BINARY_OP(+, const Quaternion &q, q[i]) - QUATERNION_BINARY_OP(-, const Quaternion &q, q[i]) - QUATERNION_BINARY_OP(*, T s, s) - QUATERNION_BINARY_OP(/, T s, s) -#undef QUATERNION_BINARY_OP - - Quaternion operator - () const - { - return Quaternion(-scalar, -vector); - } - - Quaternion operator * (const Quaternion &q) const - { - Quaternion result; - result.scalar = scalar * q.scalar - Vector<T, 3>::dot(vector, q.vector); - result.vector = scalar * q.vector + vector * q.scalar + Vector<T, 3>::cross(vector, q.vector); - return result; - } - - Quaternion operator * (const Vector<T, 3> &v) const - { - Quaternion result; - result.scalar = -Vector<T, 3>::dot(vector, v); - result.vector = scalar * v + Vector<T, 3>::cross(vector, v); - return result; - } - - friend Quaternion operator * (const Vector<T, 3> &v, const Quaternion &q) - { - Quaternion result; - result.scalar = -Vector<T, 3>::dot(v, q.vector); - result.vector = v * q.scalar + Vector<T, 3>::cross(v, q.vector); - return result; - } - -#define QUATERNION_ASSIGN_OP(op, arg, rhs) \ - Quaternion &operator op (arg) \ - { \ - for (int i = 0; i < 4; ++i) \ - (*this)[i] op rhs; \ - return *this; \ - } - - QUATERNION_ASSIGN_OP(+=, const Quaternion &q, q[i]) - QUATERNION_ASSIGN_OP(-=, const Quaternion &q, q[i]) - QUATERNION_ASSIGN_OP(=, T s, s) - QUATERNION_ASSIGN_OP(*=, T s, s) - QUATERNION_ASSIGN_OP(/=, T s, s) -#undef QUATERNION_ASSIGN_OP - - Quaternion& operator *= (const Quaternion &q) - { - Quaternion result; - result.scalar = scalar * q.scalar - Vector<T, 3>::dot(vector, q.vector); - result.vector = scalar * q.vector + vector * q.scalar + Vector<T, 3>::cross(vector, q.vector); - return (*this = result); - } - - Quaternion& operator *= (const Vector<T, 3> &v) - { - Quaternion result; - result.scalar = -Vector<T, 3>::dot(vector, v); - result.vector = scalar * v + Vector<T, 3>::cross(vector, v); - return (*this = result); - } - - Quaternion conjugate() const - { - return quaternion(scalar, -vector); - } - - T sqrNorm() const - { - return scalar * scalar + vector.sqrNorm(); - } - - Quaternion inverse() const - { - return conjugate() / sqrNorm(); - } - - // requires floating point type T - Quaternion normalized() const - { - T s = sqrNorm(); - if (s == 0) - return *this; - return *this / sqrt(s); - } - - void matrix(Matrix<T, 3, 3>& m) const - { - T bb = vector[0] * vector[0]; - T cc = vector[1] * vector[1]; - T dd = vector[2] * vector[2]; - T diag = scalar * scalar - bb - cc - dd; - T ab = scalar * vector[0]; - T ac = scalar * vector[1]; - T ad = scalar * vector[2]; - T bc = vector[0] * vector[1]; - T cd = vector[1] * vector[2]; - T bd = vector[2] * vector[0]; - m(0, 0) = diag + 2 * bb; - m(0, 1) = 2 * (bc - ad); - m(0, 2) = 2 * (ac + bd); - m(1, 0) = 2 * (ad + bc); - m(1, 1) = diag + 2 * cc; - m(1, 2) = 2 * (cd - ab); - m(2, 0) = 2 * (bd - ac); - m(2, 1) = 2 * (ab + cd); - m(2, 2) = diag + 2 * dd; - } - - void matrix(Matrix<T, 4, 4>& m) const - { - T bb = vector[0] * vector[0]; - T cc = vector[1] * vector[1]; - T dd = vector[2] * vector[2]; - T diag = scalar * scalar - bb - cc - dd; - T ab = scalar * vector[0]; - T ac = scalar * vector[1]; - T ad = scalar * vector[2]; - T bc = vector[0] * vector[1]; - T cd = vector[1] * vector[2]; - T bd = vector[2] * vector[0]; - m(0, 0) = diag + 2 * bb; - m(0, 1) = 2 * (bc - ad); - m(0, 2) = 2 * (ac + bd); - m(0, 3) = 0; - m(1, 0) = 2 * (ad + bc); - m(1, 1) = diag + 2 * cc; - m(1, 2) = 2 * (cd - ab); - m(1, 3) = 0; - m(2, 0) = 2 * (bd - ac); - m(2, 1) = 2 * (ab + cd); - m(2, 2) = diag + 2 * dd; - m(2, 3) = 0; - m(3, 0) = 0; - m(3, 1) = 0; - m(3, 2) = 0; - m(3, 3) = 1; - } - - // assumes that 'this' is normalized - Vector<T, 3> transform(const Vector<T, 3> &v) const - { - Matrix<T, 3, 3> m; - matrix(m); - return v * m; - } - - // assumes that all the elements are packed tightly - T* bits() {return reinterpret_cast<T *>(this);} - const T* bits() const {return reinterpret_cast<const T *>(this);} - - // requires floating point type T - static Quaternion rotation(T angle, const Vector<T, 3> &unitAxis) - { - T s = sin(angle / 2); - T c = cos(angle / 2); - return quaternion(c, unitAxis * s); - } - - T scalar; - Vector<T, 3> vector; -}; - -template<class T> -Quaternion<T> operator * (T s, const Quaternion<T>& q) -{ - return Quaternion<T>::quaternion(s * q.scalar, s * q.vector); -} - -typedef Quaternion<float> Quaternionf; - -} // end namespace gfx - -#endif diff --git a/demos/declarative/flickr/content/ImageDetails.qml b/demos/declarative/flickr/content/ImageDetails.qml new file mode 100644 index 0000000..7b16831 --- /dev/null +++ b/demos/declarative/flickr/content/ImageDetails.qml @@ -0,0 +1,103 @@ +Flipable { + id: Container + + property var frontContainer: ContainerFront + property var flickableArea: Flickable + property var fullScreenArea: BigImage + property string photoTitle: "" + property string photoDescription: "" + property int photoWidth + property int photoHeight + property string photoType + property string photoAuthor + property string photoDate + property string photoUrl + property int rating: 2 + + signal closed + + axis: Axis { startX: Container.width / 2; endX: Container.width / 2; endY: 1 } + + front: Item { + id: ContainerFront; anchors.fill: Container + + Rect { + anchors.fill: parent + color: "black"; opacity: 0.4 + pen.color: "white"; pen.width: 2 + } + + MediaButton { + id: BackButton; x: 630; y: 370; text: "Back" + onClicked: { Container.closed.emit() } + } + + MediaButton { + id: MoreButton; x: 530; y: 370; text: "View..." + onClicked: { Container.state='Back' } + } + + Text { id: TitleText; style: "Raised"; styleColor: "black"; color: "white"; elide: "ElideRight" + x: 220; y: 30; width: parent.width - 240; text: Container.photoTitle; font.size: 22 } + + LikeOMeter { x: 40; y: 250; rating: Container.rating } + + Flickable { id: Flickable; x: 220; width: 480; height: 230; y: 120; clip: true + viewportWidth: 480; viewportHeight: DescriptionText.height + + WebView { id: DescriptionText; width: parent.width + html: "<style TYPE=\"text/css\">body {color: white;} a:link {color: cyan; text-decoration: underline; }</style>" + Container.photoDescription } + } + + Text { id: Size; color: "white"; width: 300; x: 40; y: 300 + text: "<b>Size:</b> " + Container.photoWidth + 'x' + Container.photoHeight } + Text { id: Type; color: "white"; width: 300; x: 40; anchors.top: Size.bottom + text: "<b>Type:</b> " + Container.photoType } + + Text { id: Author; color: "white"; width: 300; x: 220; y: 80 + text: "<b>Author:</b> " + Container.photoAuthor } + Text { id: Date; color: "white"; width: 300; x: 220; anchors.top: Author.bottom + text: "<b>Published:</b> " + Container.photoDate } + + ScrollBar { id: ScrollBar; x: 720; y: Flickable.y; width: 7; height: Flickable.height; opacity: 0; + flickableArea: Flickable; clip: true } + } + + back: Item { + anchors.fill: Container + + Rect { anchors.fill: parent; color: "black"; opacity: 0.4; pen.color: "white"; pen.width: 2 } + + Loading { anchors.centeredIn: parent; visible: BigImage.status } + Flickable { + id: Flick; width: Container.width - 10; height: Container.height - 10 + x: 5; y: 5; clip: true; viewportWidth: (BigImage.width * BigImage.scale) + BigImage.x; + viewportHeight: BigImage.height * BigImage.scale + + Image { + id: BigImage; source: Container.photoUrl; scale: Slider.value + x:Math.max(0, ((Flick.width/2)-(width * scale / 2))); + y:Math.max(0, (Flick.height/2)-(height * scale / 2)); + } + } + + MediaButton { + id: BackButton2; x: 630; y: 370; text: "Back"; onClicked: { Container.state = '' } + } + + Slider { id: Slider; x: 25; y: 374; imageWidth: Container.photoWidth; imageHeight: Container.photoHeight } + } + + states: [ + State { + name: "Back" + SetProperty { target: Container; property: "rotation"; value: 180 } + } + ] + + transitions: [ + Transition { + NumericAnimation { easing: "easeInOutQuad"; properties: "rotation"; duration: 500 } + } + ] +} diff --git a/demos/declarative/flickr/content/LikeOMeter.qml b/demos/declarative/flickr/content/LikeOMeter.qml new file mode 100644 index 0000000..61317ae --- /dev/null +++ b/demos/declarative/flickr/content/LikeOMeter.qml @@ -0,0 +1,33 @@ +Item { + id: Container + + property int rating: 2 + + HorizontalLayout { + Star { + rating: 0 + onClicked: { Container.rating = rating } + on: Container.rating >= 0 + } + Star { + rating: 1 + onClicked: { Container.rating = rating } + on: Container.rating >= 1 + } + Star { + rating: 2 + onClicked: { Container.rating = rating } + on: Container.rating >= 2 + } + Star { + rating: 3 + onClicked: { Container.rating = rating } + on: Container.rating >= 3 + } + Star { + rating: 4 + onClicked: { Container.rating = rating } + on: Container.rating >= 4 + } + } +} diff --git a/demos/declarative/flickr/content/Loading.qml b/demos/declarative/flickr/content/Loading.qml new file mode 100644 index 0000000..cf27e38 --- /dev/null +++ b/demos/declarative/flickr/content/Loading.qml @@ -0,0 +1,6 @@ +Image { + id: Loading; source: "pics/loading.png"; transformOrigin: "Center" + rotation: NumericAnimation { + id: "RotationAnimation"; from: 0; to: 360; running:true; repeat: true; duration: 900 + } +} diff --git a/demos/declarative/flickr/content/MediaButton.qml b/demos/declarative/flickr/content/MediaButton.qml new file mode 100644 index 0000000..6392a13 --- /dev/null +++ b/demos/declarative/flickr/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.emit(); } + } + 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/flickr/content/ScrollBar.qml b/demos/declarative/flickr/content/ScrollBar.qml new file mode 100644 index 0000000..2c4ff54 --- /dev/null +++ b/demos/declarative/flickr/content/ScrollBar.qml @@ -0,0 +1,38 @@ +Item { + id: Container + + property var flickableArea + + Rect { + radius: 5 + color: "black" + opacity: 0.3 + pen.color: "white" + pen.width: 2 + x: 0 + y: flickableArea.pageYPosition * Container.height + width: parent.width + height: flickableArea.pageHeight * Container.height + } + states: [ + State { + name: "show" + when: flickableArea.moving + SetProperties { + target: Container + opacity: 1 + } + } + ] + transitions: [ + Transition { + fromState: "*" + toState: "*" + NumericAnimation { + target: Container + properties: "opacity" + duration: 400 + } + } + ] +} diff --git a/demos/declarative/flickr/content/Slider.qml b/demos/declarative/flickr/content/Slider.qml new file mode 100644 index 0000000..ba9d842 --- /dev/null +++ b/demos/declarative/flickr/content/Slider.qml @@ -0,0 +1,24 @@ +Item { + id: Slider; width: 400; height: 16 + + property var value: Handle.x / Slider.xMax + property int xMax: Slider.width - Handle.width - 2 + property int imageWidth + property int imageHeight + + Rect { + id: Container; anchors.fill: parent; gradientColor: "#66000000"; + pen.color: "white"; pen.width: 1; color: "#66343434"; radius: 8 + } + + Rect { + id: Handle + x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: 12 + color: "lightgray"; gradientColor: "gray"; radius: 6 + + MouseRegion { + anchors.fill: parent; drag.target: parent + drag.axis: "x"; drag.xmin: 2; drag.xmax: Slider.xMax + } + } +} diff --git a/demos/declarative/flickr/content/Star.qml b/demos/declarative/flickr/content/Star.qml new file mode 100644 index 0000000..22fc138 --- /dev/null +++ b/demos/declarative/flickr/content/Star.qml @@ -0,0 +1,44 @@ +Item { + id: Container + width: 24 + height: 24 + + property string rating + property string on + + signal clicked + + Image { + id: Image + source: "pics/ghns_star.png" + x: 6 + y: 7 + opacity: 0.4 + scale: 0.5 + } + MouseRegion { + anchors.fill: Container + onClicked: { Container.clicked.emit() } + } + states: [ + State { + name: "on" + when: Container.on == true + SetProperties { + target: Image + opacity: 1 + scale: 1 + x: 1 + y: 0 + } + } + ] + transitions: [ + Transition { + NumericAnimation { + properties: "opacity,scale,x,y" + easing: "easeOutBounce" + } + } + ] +} diff --git a/demos/declarative/flickr/content/pics/background.png b/demos/declarative/flickr/content/pics/background.png Binary files differnew file mode 100644 index 0000000..5b37072 --- /dev/null +++ b/demos/declarative/flickr/content/pics/background.png diff --git a/demos/declarative/flickr/content/pics/button-pressed.png b/demos/declarative/flickr/content/pics/button-pressed.png Binary files differnew file mode 100644 index 0000000..e434d32 --- /dev/null +++ b/demos/declarative/flickr/content/pics/button-pressed.png diff --git a/demos/declarative/flickr/content/pics/button.png b/demos/declarative/flickr/content/pics/button.png Binary files differnew file mode 100644 index 0000000..56a63ce --- /dev/null +++ b/demos/declarative/flickr/content/pics/button.png diff --git a/demos/declarative/flickr/content/pics/ghns_star.png b/demos/declarative/flickr/content/pics/ghns_star.png Binary files differnew file mode 100644 index 0000000..4ad43cc --- /dev/null +++ b/demos/declarative/flickr/content/pics/ghns_star.png diff --git a/demos/declarative/flickr/content/pics/loading.png b/demos/declarative/flickr/content/pics/loading.png Binary files differnew file mode 100644 index 0000000..47a1589 --- /dev/null +++ b/demos/declarative/flickr/content/pics/loading.png diff --git a/demos/declarative/flickr/content/pics/reflection.png b/demos/declarative/flickr/content/pics/reflection.png Binary files differnew file mode 100644 index 0000000..c143a48 --- /dev/null +++ b/demos/declarative/flickr/content/pics/reflection.png diff --git a/demos/declarative/flickr/content/pics/shadow-bottom.png b/demos/declarative/flickr/content/pics/shadow-bottom.png Binary files differnew file mode 100644 index 0000000..523f6e7 --- /dev/null +++ b/demos/declarative/flickr/content/pics/shadow-bottom.png diff --git a/demos/declarative/flickr/content/pics/shadow-corner.png b/demos/declarative/flickr/content/pics/shadow-corner.png Binary files differnew file mode 100644 index 0000000..ef8c856 --- /dev/null +++ b/demos/declarative/flickr/content/pics/shadow-corner.png diff --git a/demos/declarative/flickr/content/pics/shadow-right-screen.png b/demos/declarative/flickr/content/pics/shadow-right-screen.png Binary files differnew file mode 100644 index 0000000..9856c4f --- /dev/null +++ b/demos/declarative/flickr/content/pics/shadow-right-screen.png diff --git a/demos/declarative/flickr/content/pics/shadow-right.png b/demos/declarative/flickr/content/pics/shadow-right.png Binary files differnew file mode 100644 index 0000000..f534a35 --- /dev/null +++ b/demos/declarative/flickr/content/pics/shadow-right.png diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml new file mode 100644 index 0000000..0ff539d --- /dev/null +++ b/demos/declarative/flickr/flickr.qml @@ -0,0 +1,178 @@ +import "content" + +Item { + id: MainWindow; width: 800; height: 450 + + property bool showPathView : false + + resources: [ + XmlListModel { + id: FeedModel + source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2" + query: "doc($src)/rss/channel/item" + namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" + + Role { name: "title"; query: "title/string()" } + Role { name: "imagePath"; query: "media:thumbnail/@url/string()" } + Role { name: "url"; query: "media:content/@url/string()" } + Role { name: "description"; query: "description/string()"; isCData: true } + Role { name: "photoWidth"; query: "media:content/@width/string()" } + Role { name: "photoHeight"; query: "media:content/@height/string()" } + Role { name: "photoType"; query: "media:content/@type/string()" } + Role { name: "photoAuthor"; query: "author/string()" } + Role { name: "photoDate"; query: "pubDate/string()" } + }, + + Component { + id: PhotoDelegate + Item { + id: Wrapper; width: 85; height: 85 + scale: Wrapper.PathView.scale; z: Wrapper.PathView.z + + transform: [ + Rotation3D { id: Rotation; axis.startX: 30; axis.endX: 30; axis.endY: 60; angle: Wrapper.PathView.angle } + ] + + Connection { + sender: ImageDetails; signal: "closed()" + script: { if (Wrapper.state == 'Details') Wrapper.state = '' } + } + + Script { + function photoClicked() { + ImageDetails.photoTitle = title; + ImageDetails.flickableArea.yPosition = 0; + ImageDetails.fullScreenArea.source = ""; + ImageDetails.photoDescription = description; + ImageDetails.photoWidth = photoWidth; + ImageDetails.photoHeight = photoHeight; + ImageDetails.photoType = photoType; + ImageDetails.photoAuthor = photoAuthor; + ImageDetails.photoDate = photoDate; + ImageDetails.photoUrl = url; + ImageDetails.rating = 0; + Wrapper.state = "Details"; + } + } + + Rect { + id: WhiteRect; anchors.fill: parent; color: "white"; radius: 5 + + Loading { x: 26; y: 26; visible: Thumb.status } + Image { id: Thumb; source: imagePath; x: 5; y: 5 } + + Item { + id: Shadows + Image { source: "content/pics/shadow-right.png"; x: WhiteRect.width; height: WhiteRect.height } + Image { source: "content/pics/shadow-bottom.png"; y: WhiteRect.height; width: WhiteRect.width } + Image { id: Corner; source: "content/pics/shadow-corner.png"; x: WhiteRect.width; y: WhiteRect.height } + } + } + + MouseRegion { anchors.fill: Wrapper; onClicked: { photoClicked() } } + + states: [ + State { + name: "Details" + ParentChange { target: Wrapper; parent: ImageDetails.frontContainer } + SetProperties { target: Wrapper; x: 45; y: 35; scale: 1 } + SetProperties { target: Rotation; angle: 0 } + SetProperties { target: Shadows; opacity: 0 } + SetProperties { target: ImageDetails; y: 20 } + SetProperties { target: PhotoGridView; y: "-480" } + SetProperties { target: PhotoPathView; y: "-480" } + SetProperties { target: CloseButton; opacity: 0 } + SetProperties { target: FetchButton; opacity: 0 } + SetProperties { target: CategoryText; y: "-50" } + } + ] + + transitions: [ + Transition { + fromState: "*"; toState: "*" + ParentChangeAction { } + NumericAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } + } + ] + } + } + ] + + Item { + id: Background + + Image { source: "content/pics/background.png"; opaque: true } + + GridView { + id: PhotoGridView; model: FeedModel; delegate: PhotoDelegate + cellWidth: 105; cellHeight: 105; x:32; y: 80; width: 800; height: 330 + } + + PathView { + id: PhotoPathView; model: FeedModel; delegate: PhotoDelegate + y: -380; width: 800; height: 330; pathItemCount: 10 + path: Path { + startX: -50; startY: 40; + + PathAttribute { name: "scale"; value: 1 } + PathAttribute { name: "angle"; value: -45 } + + PathCubic { + x: 400; y: 220 + control1X: 140; control1Y: 40 + control2X: 210; control2Y: 220 + } + + PathAttribute { name: "scale"; value: 1.2 } + PathAttribute { name: "z"; value: 1 } + PathAttribute { name: "angle"; value: 0 } + + PathCubic { + x: 850; y: 40 + control2X: 660; control2Y: 40 + control1X: 590; control1Y: 220 + } + + PathAttribute { name: "scale"; value: 1 } + PathAttribute { name: "angle"; value: 45 } + } + + } + + ImageDetails { id: ImageDetails; width: 750; x: 25; y: 500; height: 410 } + + MediaButton { + id: CloseButton; x: 680; y: 410; text: "View Mode" + onClicked: { if (MainWindow.showPathView == true) MainWindow.showPathView = false; else MainWindow.showPathView = true } + } + + MediaButton { + id: FetchButton + text: "Update" + anchors.right: CloseButton.left; anchors.rightMargin: 5 + anchors.top: CloseButton.top + onClicked: { FeedModel.fetch(); } + } + + states: [ + State { + name: "PathView" + when: MainWindow.showPathView == true + SetProperties { target: PhotoPathView; y: 80 } + SetProperties { target: PhotoGridView; y: -380 } + } + ] + + transitions: [ + Transition { + fromState: "*"; toState: "*" + NumericAnimation { properties: "y"; duration: 650; easing: "easeOutBounce(amplitude:0.1)" } + } + ] + } + + Text { + id: CategoryText; anchors.horizontalCenter: parent.horizontalCenter; y: 15; text: "Flickr - Uploads from everyone" + font.size: 16; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" + } +} diff --git a/doc/src/qmlviewer.qdoc b/doc/src/declarative/qmlviewer.qdoc index e9f8029..8228737 100644 --- a/doc/src/qmlviewer.qdoc +++ b/doc/src/declarative/qmlviewer.qdoc @@ -68,12 +68,7 @@ that is a qreal from 0 to 86400 representing the number of seconds since midnight, dummy data for this could be provided by \c dummydata/clock.qml: \code - Object { - properties: Property { - name: "time" - value: 12345 - } - } + Object { property real time: 12345 } \endcode Any QML can be used in the dummy data files. You could even animate the fictional data! diff --git a/doc/src/images/declarative-removebutton.gif b/doc/src/images/declarative-removebutton.gif Binary files differnew file mode 100644 index 0000000..ca4d7e6 --- /dev/null +++ b/doc/src/images/declarative-removebutton.gif diff --git a/doc/src/images/declarative-tutorial-list-open.gif b/doc/src/images/declarative-tutorial-list-open.gif Binary files differnew file mode 100644 index 0000000..5b93597 --- /dev/null +++ b/doc/src/images/declarative-tutorial-list-open.gif diff --git a/doc/src/images/declarative-tutorial-list.gif b/doc/src/images/declarative-tutorial-list.gif Binary files differnew file mode 100644 index 0000000..24db426 --- /dev/null +++ b/doc/src/images/declarative-tutorial-list.gif diff --git a/doc/src/properties.qdoc b/doc/src/properties.qdoc index 0775b12..d934f13 100644 --- a/doc/src/properties.qdoc +++ b/doc/src/properties.qdoc @@ -89,7 +89,12 @@ and QWidget::setCursor(), and it also has a \c RESET function, QWidget::unsetCursor(), since no call to QWidget::setCursor() can mean \e {reset to the context specific cursor}. The \c RESET - function musrt return void and take no parameters. + function must return void and take no parameters. + + \o A \c NOTIFY signal is optional. If defined, the signal will be + emitted whenever the value of the property changes. The signal must + take one parameter, which must be of the same type as the property; the + parameter will take the new value of the property. \o The \c DESIGNABLE attribute indicates whether the property should be visible in the property editor of GUI design tool (e.g., diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc index 39581a2..172bc60 100644 --- a/doc/src/qmake-manual.qdoc +++ b/doc/src/qmake-manual.qdoc @@ -932,6 +932,7 @@ \o \l{qmake Variable Reference#QT}{QT} \o \l{qmake Variable Reference#RCC_DIR}{RCC_DIR} \o \l{qmake Variable Reference#REQUIRES}{REQUIRES} + \o \l{qmake Variable Reference#RESOURCES}{RESOURCES} \o \l{qmake Variable Reference#SOURCES}{SOURCES} \o \l{qmake Variable Reference#SUBDIRS}{SUBDIRS} \o \l{qmake Variable Reference#TARGET}{TARGET} @@ -2420,6 +2421,12 @@ This is mainly used in Qt's build system for building the examples. + \section1 RESOURCES + + This variable contains the name of the resource collection file (qrc) + for the application. Further information about the resource collection + file can be found at \l{The Qt Resource System}. + \section1 RES_FILE This variable contains the name of the resource file for the application. diff --git a/doc/src/snippets/code/doc_src_properties.qdoc b/doc/src/snippets/code/doc_src_properties.qdoc index ba7f79b..377cc9c 100644 --- a/doc/src/snippets/code/doc_src_properties.qdoc +++ b/doc/src/snippets/code/doc_src_properties.qdoc @@ -3,6 +3,7 @@ Q_PROPERTY(type name READ getFunction [WRITE setFunction] [RESET resetFunction] + [NOTIFY notifySignal] [DESIGNABLE bool] [SCRIPTABLE bool] [STORED bool] diff --git a/doc/src/tutorials/declarative.qdoc b/doc/src/tutorials/declarative.qdoc index 543f274..75d0c06 100644 --- a/doc/src/tutorials/declarative.qdoc +++ b/doc/src/tutorials/declarative.qdoc @@ -106,7 +106,7 @@ confirm icon on the left, the text "Remove" in the middle, and a cancel icon on the right. - \image declarative-removebutton.png + \image declarative-removebutton.gif Because Declarative UI is declarative, you don't pass instructions on what to paint in a sequential manner as you may be used to. Instead @@ -559,7 +559,7 @@ data displayed, a delegate to indicate how elements are drawn and a view to arrange the elements. - \image declarative-tutorial-list.png + \image declarative-tutorial-list.gif For the purposes of this tutorial we will be using an SQL query as our data model. This can be declared in the resources section of @@ -604,8 +604,7 @@ similar to how the contents of the FieldText and RemoveButton components are swapped in and out. - \image declarative-tutorial-list-closed.png - \image declarative-tutorial-list-open.png + \image declarative-tutorial-list-open.gif \snippet declarative/tutorials/contacts/3_Collections/2/ContactView.qml components diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml index 964975f..3c20462 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/3/RemoveButton.qml @@ -32,7 +32,7 @@ Rect { anchors.rightMargin: 4 font.bold: true color: "white" - hAlign: AlignHCenter + hAlign: "AlignHCenter" text: "Remove" } } diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml index 79aae7a..a359aaf 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4/RemoveButton.qml @@ -71,7 +71,7 @@ Rect { anchors.rightMargin: 4 font.bold: true color: "white" - hAlign: AlignHCenter + hAlign: "AlignHCenter" text: "Remove" opacity: 0 } diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4a/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4a/RemoveButton.qml index ce8459d..4db49ea 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4a/RemoveButton.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/4a/RemoveButton.qml @@ -78,7 +78,7 @@ Rect { anchors.rightMargin: 4 font.bold: true color: "white" - hAlign: AlignHCenter + hAlign: "AlignHCenter" text: "Remove" opacity: 0 } diff --git a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml index 6c9078a..29d464b 100644 --- a/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml +++ b/examples/declarative/tutorials/contacts/1_Drawing_and_Animation/5/RemoveButton.qml @@ -67,7 +67,7 @@ Rect { anchors.rightMargin: 4 font.bold: true color: "white" - hAlign: AlignHCenter + hAlign: "AlignHCenter" text: "Remove" opacity: 0 } diff --git a/examples/declarative/tutorials/contacts/2_Reuse/1b/lib/RemoveButton.qml b/examples/declarative/tutorials/contacts/2_Reuse/1b/lib/RemoveButton.qml index a358b21..bf6e82d 100644 --- a/examples/declarative/tutorials/contacts/2_Reuse/1b/lib/RemoveButton.qml +++ b/examples/declarative/tutorials/contacts/2_Reuse/1b/lib/RemoveButton.qml @@ -69,7 +69,7 @@ Rect { anchors.rightMargin: 4 font.bold: true color: "white" - hAlign: AlignHCenter + hAlign: "AlignHCenter" text: "Remove" opacity: 0 } diff --git a/examples/phonon/README b/examples/phonon/README index d0f4462..51213cb 100644 --- a/examples/phonon/README +++ b/examples/phonon/README @@ -1,4 +1,4 @@ -Qt usese the Phonon cross-platform multimedia framework to play common +Qt uses the Phonon cross-platform multimedia framework to play common multimedia formats. Applications can be written to take advantage of the native multimedia diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 3c015da..f63d29e 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -67,7 +67,8 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 1 Note that you cannot use QTextStream::atEnd(), which returns true when you - have reached the end of the data stream, with stdin. + have reached the end of the data stream, with stdin because as long as the + application is running, stdin has no end. Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp index badc6fb..af72ecc 100644 --- a/src/declarative/extra/qmlxmllistmodel.cpp +++ b/src/declarative/extra/qmlxmllistmodel.cpp @@ -239,12 +239,15 @@ void QmlXmlListModel::classComplete() void QmlXmlListModel::fetch() { Q_D(QmlXmlListModel); + + //clear existing data + d->size = 0; + int count = d->data.count(); + d->data.clear(); + emit itemsRemoved(0, count); + if (d->src.isEmpty()) { qWarning() << "Can't fetch empty src string"; - //clear existing data? - //int count = d->data.count(); - //d->data.clear(); - //emit itemsRemoved(0, count); return; } diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h index d06cabf..acc54a9 100644 --- a/src/declarative/extra/qmlxmllistmodel.h +++ b/src/declarative/extra/qmlxmllistmodel.h @@ -116,6 +116,8 @@ public: void setNamespaceDeclarations(const QString&); virtual void classComplete(); + +public Q_SLOTS: void fetch(); protected: diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 810a359..715ae5a 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -699,6 +699,12 @@ void QFxPathView::itemsRemoved(int modelIndex, int count) d->regenerate(); } + if (d->model->count() == 0) { + d->currentIndex = -1; + d->moveOffset.setValue(0); + return; + } + // make sure the current item is still at the snap position if (d->currentIndex >= d->model->count()) d->currentIndex = d->model->count() - 1; diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index ec81a7a..d66266f 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -264,10 +264,10 @@ public: enum Kind { Warning, Error }; DiagnosticMessage() - : kind(Error), line(0), column(0) {} + : kind(Error) {} - DiagnosticMessage(Kind kind, int line, int column, const QString &message) - : kind(kind), line(line), column(column), message(message) {} + DiagnosticMessage(Kind kind, const JavaScript::AST::SourceLocation &loc, const QString &message) + : kind(kind), loc(loc), message(message) {} bool isWarning() const { return kind == Warning; } @@ -276,8 +276,7 @@ public: { return kind == Error; } Kind kind; - int line; - int column; + JavaScript::AST::SourceLocation loc; QString message; }; @@ -307,10 +306,10 @@ public: { return diagnosticMessage().message; } inline int errorLineNumber() const - { return diagnosticMessage().line; } + { return diagnosticMessage().loc.startLine; } inline int errorColumnNumber() const - { return diagnosticMessage().column; } + { return diagnosticMessage().loc.startColumn; } protected: void reallocateStack(); @@ -471,7 +470,7 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) -- Declarative UI -------------------------------------------------------------------------------------------------------- -UiProgram: UiImportListOpt UiObjectMemberList ; +UiProgram: UiImportListOpt UiRootMember ; /. case $rule_number: { program = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList, @@ -522,6 +521,13 @@ case $rule_number: { } break; ./ +UiRootMember: UiObjectDefinition ; +/. +case $rule_number: { + sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember); +} break; +./ + UiObjectMemberList: UiObjectMember ; /. case $rule_number: { @@ -587,9 +593,7 @@ case $rule_number: { } break; ./ -UiArrayObjectMember: T_IDENTIFIER UiObjectInitializer ; -/. case $rule_number: ./ -UiObjectMember: T_IDENTIFIER UiObjectInitializer ; +UiObjectDefinition: T_IDENTIFIER UiObjectInitializer ; /. case $rule_number: { AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).sval, @@ -599,6 +603,9 @@ case $rule_number: { } break; ./ +UiArrayObjectMember: UiObjectDefinition ; +UiObjectMember: UiObjectDefinition ; + UiArrayObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; /. case $rule_number: ./ UiObjectMember: UiQualifiedId T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ; @@ -865,9 +872,8 @@ PrimaryExpression: T_DIVIDE_ ; case $rule_number: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; // ### remove me } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); @@ -883,9 +889,8 @@ PrimaryExpression: T_DIVIDE_EQ ; case $rule_number: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); @@ -2695,10 +2700,8 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; yylloc.startColumn += yylloc.length; yylloc.length = 0; - const QString msg = QString::fromUtf8("Missing `;'"); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, - yylloc.startLine, yylloc.startColumn, msg)); + //const QString msg = QString::fromUtf8("Missing `;'"); + //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg)); first_token = &token_buffer[0]; last_token = &token_buffer[1]; @@ -2723,9 +2726,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; if (t_action(errorState, yytoken)) { const QString msg = QString::fromUtf8("Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; goto _Lcheck_token; @@ -2753,9 +2754,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[*tk])); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = *tk; yylval = 0; @@ -2777,8 +2776,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[tk])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = tk; yylval = 0; @@ -2791,8 +2789,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; } const QString msg = QString::fromUtf8("Syntax error"); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); } return false; diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index a33f343..cb98c36 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -55,622 +55,625 @@ const char *const JavaScriptGrammar::spell [] = { 0}; const int JavaScriptGrammar::lhs [] = { - 91, 92, 92, 95, 95, 96, 96, 94, 93, 93, - 98, 98, 100, 100, 99, 97, 99, 97, 99, 97, - 102, 103, 103, 97, 99, 97, 105, 105, 105, 97, - 97, 97, 97, 97, 97, 97, 101, 101, 109, 109, - 109, 101, 101, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 112, 112, - 116, 116, 111, 111, 114, 114, 117, 117, 117, 117, - 117, 117, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 119, 119, 120, 120, 120, 120, 120, - 123, 123, 124, 124, 124, 124, 122, 122, 125, 125, - 126, 126, 127, 127, 127, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 129, 129, 129, 129, 130, - 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, - 132, 132, 132, 133, 133, 133, 133, 133, 133, 134, - 134, 134, 134, 134, 135, 135, 135, 135, 135, 136, - 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, - 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, - 146, 147, 147, 115, 115, 148, 148, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 106, - 106, 150, 150, 151, 151, 152, 152, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 153, 168, 168, 167, 167, 108, 108, 169, - 169, 170, 170, 172, 172, 171, 173, 176, 174, 174, - 177, 175, 175, 154, 155, 155, 156, 156, 157, 157, - 157, 157, 157, 157, 157, 158, 158, 158, 158, 159, - 159, 159, 159, 160, 160, 161, 163, 178, 178, 181, - 181, 179, 179, 182, 180, 162, 162, 162, 164, 164, - 165, 165, 165, 183, 184, 166, 166, 107, 121, 188, - 188, 185, 185, 186, 186, 189, 190, 190, 191, 191, - 187, 187, 113, 113, 192}; + 91, 92, 92, 95, 95, 96, 96, 94, 93, 98, + 98, 100, 100, 102, 102, 101, 99, 97, 101, 99, + 101, 99, 104, 105, 105, 99, 101, 99, 107, 107, + 107, 99, 99, 99, 99, 99, 99, 99, 103, 103, + 111, 111, 111, 103, 103, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 114, 114, 118, 118, 113, 113, 116, 116, 119, 119, + 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 121, 121, 122, 122, 122, + 122, 122, 125, 125, 126, 126, 126, 126, 124, 124, + 127, 127, 128, 128, 129, 129, 129, 130, 130, 130, + 130, 130, 130, 130, 130, 130, 130, 131, 131, 131, + 131, 132, 132, 132, 133, 133, 133, 133, 134, 134, + 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, + 135, 136, 136, 136, 136, 136, 137, 137, 137, 137, + 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, + 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, + 147, 148, 148, 149, 149, 117, 117, 150, 150, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 108, 108, 152, 152, 153, 153, 154, 154, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 155, 170, 170, 169, 169, 110, + 110, 171, 171, 172, 172, 174, 174, 173, 175, 178, + 176, 176, 179, 177, 177, 156, 157, 157, 158, 158, + 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, + 160, 161, 161, 161, 161, 162, 162, 163, 165, 180, + 180, 183, 183, 181, 181, 184, 182, 164, 164, 164, + 166, 166, 167, 167, 167, 185, 186, 168, 168, 109, + 123, 190, 190, 187, 187, 188, 188, 191, 192, 192, + 193, 193, 189, 189, 115, 115, 194}; const int JavaScriptGrammar:: rhs[] = { - 2, 1, 1, 1, 2, 3, 3, 0, 1, 2, - 1, 3, 2, 3, 4, 4, 2, 2, 5, 5, - 1, 2, 2, 3, 3, 3, 1, 1, 1, 2, - 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 5, 3, 4, 3, 2, 4, - 1, 2, 0, 1, 3, 5, 1, 1, 1, 1, + 2, 1, 1, 1, 2, 3, 3, 0, 1, 1, + 2, 1, 3, 2, 3, 4, 4, 2, 1, 1, + 5, 5, 1, 2, 2, 3, 3, 3, 1, 1, + 1, 2, 3, 4, 5, 6, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 3, 5, 3, 4, 3, + 2, 4, 1, 2, 0, 1, 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, 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, + 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, - 5, 1, 5, 1, 3, 1, 3, 1, 1, 1, + 3, 1, 5, 1, 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 0, 1, 1, 3, 0, 1, 1, 1, 1, + 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, 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, 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}; const int JavaScriptGrammar::action_default [] = { 8, 2, 0, 4, 3, 0, 0, 0, 6, 7, - 5, 35, 42, 240, 0, 0, 39, 40, 37, 38, - 41, 241, 9, 1, 0, 0, 36, 0, 29, 28, - 27, 0, 32, 0, 143, 210, 174, 182, 178, 122, - 194, 170, 34, 107, 45, 123, 186, 190, 111, 140, - 121, 126, 106, 160, 147, 0, 51, 52, 48, 311, - 39, 313, 63, 0, 0, 0, 0, 0, 46, 49, - 0, 0, 40, 41, 50, 44, 0, 47, 0, 0, - 136, 0, 0, 123, 142, 125, 124, 0, 0, 0, - 138, 139, 137, 141, 0, 171, 0, 0, 0, 0, - 161, 0, 0, 0, 0, 0, 0, 151, 0, 0, - 0, 145, 146, 144, 149, 153, 152, 150, 148, 163, - 162, 164, 0, 179, 0, 175, 0, 0, 117, 104, - 116, 105, 73, 74, 75, 100, 76, 101, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 102, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 103, 0, 0, 115, 211, 118, 0, 119, - 0, 120, 114, 0, 207, 200, 198, 205, 206, 204, - 203, 209, 202, 201, 199, 208, 195, 0, 183, 0, - 0, 187, 0, 0, 191, 0, 0, 117, 109, 0, - 108, 0, 113, 127, 0, 312, 302, 303, 0, 300, - 0, 301, 0, 304, 218, 225, 224, 232, 220, 0, - 221, 305, 0, 310, 222, 223, 228, 226, 307, 306, - 309, 229, 0, 0, 0, 0, 0, 311, 39, 0, - 313, 40, 212, 254, 41, 0, 0, 0, 0, 0, - 230, 231, 219, 227, 255, 256, 299, 308, 0, 270, - 271, 272, 273, 0, 266, 267, 268, 269, 296, 297, - 0, 0, 0, 0, 0, 259, 260, 216, 214, 176, - 184, 180, 196, 172, 217, 0, 123, 188, 192, 165, - 154, 0, 0, 173, 0, 0, 0, 0, 166, 0, - 0, 0, 0, 0, 158, 156, 159, 157, 155, 168, - 167, 169, 0, 181, 0, 177, 0, 215, 123, 0, - 197, 212, 213, 0, 212, 0, 0, 262, 0, 0, - 0, 264, 0, 185, 0, 0, 189, 0, 0, 193, - 252, 0, 244, 253, 247, 0, 251, 0, 212, 245, - 0, 212, 0, 0, 263, 0, 0, 0, 265, 312, - 302, 0, 0, 304, 0, 298, 0, 288, 0, 0, - 0, 258, 0, 257, 0, 314, 0, 72, 234, 237, - 0, 73, 240, 76, 101, 78, 79, 48, 83, 84, - 39, 85, 88, 46, 49, 40, 212, 41, 50, 91, - 44, 93, 47, 95, 96, 241, 98, 99, 103, 0, - 65, 0, 0, 67, 71, 69, 57, 68, 70, 0, - 66, 56, 235, 233, 111, 112, 117, 0, 110, 0, - 287, 0, 274, 275, 0, 286, 0, 0, 0, 277, - 282, 280, 283, 0, 0, 281, 282, 0, 278, 0, - 279, 236, 285, 0, 236, 284, 0, 289, 290, 0, - 236, 291, 292, 0, 0, 293, 0, 0, 0, 294, - 295, 129, 128, 0, 0, 0, 261, 0, 0, 0, - 276, 0, 64, 0, 61, 63, 54, 0, 60, 55, - 62, 59, 53, 0, 58, 133, 131, 135, 132, 130, - 134, 0, 0, 18, 13, 0, 14, 10, 0, 31, - 0, 33, 30, 0, 0, 26, 39, 63, 21, 0, - 24, 16, 39, 0, 11, 0, 17, 0, 20, 12, - 0, 25, 39, 63, 15, 0, 19, 22, 23, 43, - 249, 242, 0, 250, 246, 0, 248, 238, 0, 239, - 243, 315}; + 5, 0, 9, 1, 0, 18, 37, 44, 242, 0, + 0, 41, 42, 14, 39, 40, 43, 243, 20, 10, + 0, 0, 0, 38, 0, 31, 30, 29, 0, 34, + 0, 145, 212, 176, 184, 180, 124, 196, 172, 36, + 109, 47, 125, 188, 192, 113, 142, 123, 128, 108, + 162, 149, 0, 53, 54, 50, 313, 41, 315, 65, + 0, 0, 0, 0, 0, 48, 51, 0, 0, 42, + 43, 52, 46, 0, 49, 0, 0, 138, 0, 0, + 125, 144, 127, 126, 0, 0, 0, 140, 141, 139, + 143, 0, 173, 0, 0, 0, 0, 163, 0, 0, + 0, 0, 0, 0, 153, 0, 0, 0, 147, 148, + 146, 151, 155, 154, 152, 150, 165, 164, 166, 0, + 181, 0, 177, 0, 0, 119, 106, 118, 107, 75, + 76, 77, 102, 78, 103, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 104, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 105, + 0, 0, 117, 213, 120, 0, 121, 0, 122, 116, + 0, 209, 202, 200, 207, 208, 206, 205, 211, 204, + 203, 201, 210, 197, 0, 185, 0, 0, 189, 0, + 0, 193, 0, 0, 119, 111, 0, 110, 0, 115, + 129, 0, 314, 304, 305, 0, 302, 0, 303, 0, + 306, 220, 227, 226, 234, 222, 0, 223, 307, 0, + 312, 224, 225, 230, 228, 309, 308, 311, 231, 0, + 0, 0, 0, 0, 313, 41, 0, 315, 42, 214, + 256, 43, 0, 0, 0, 0, 0, 232, 233, 221, + 229, 257, 258, 301, 310, 0, 272, 273, 274, 275, + 0, 268, 269, 270, 271, 298, 299, 0, 0, 0, + 0, 0, 261, 262, 218, 216, 178, 186, 182, 198, + 174, 219, 0, 125, 190, 194, 167, 156, 0, 0, + 175, 0, 0, 0, 0, 168, 0, 0, 0, 0, + 0, 160, 158, 161, 159, 157, 170, 169, 171, 0, + 183, 0, 179, 0, 217, 125, 0, 199, 214, 215, + 0, 214, 0, 0, 264, 0, 0, 0, 266, 0, + 187, 0, 0, 191, 0, 0, 195, 254, 0, 246, + 255, 249, 0, 253, 0, 214, 247, 0, 214, 0, + 0, 265, 0, 0, 0, 267, 314, 304, 0, 0, + 306, 0, 300, 0, 290, 0, 0, 0, 260, 0, + 259, 0, 316, 0, 74, 236, 239, 0, 75, 242, + 78, 103, 80, 81, 50, 85, 86, 41, 87, 90, + 48, 51, 42, 214, 43, 52, 93, 46, 95, 49, + 97, 98, 243, 100, 101, 105, 0, 67, 0, 0, + 69, 73, 71, 59, 70, 72, 0, 68, 58, 237, + 235, 113, 114, 119, 0, 112, 0, 289, 0, 276, + 277, 0, 288, 0, 0, 0, 279, 284, 282, 285, + 0, 0, 283, 284, 0, 280, 0, 281, 238, 287, + 0, 238, 286, 0, 291, 292, 0, 238, 293, 294, + 0, 0, 295, 0, 0, 0, 296, 297, 131, 130, + 0, 0, 0, 263, 0, 0, 0, 278, 0, 66, + 0, 63, 65, 56, 0, 62, 57, 64, 61, 55, + 0, 60, 135, 133, 137, 134, 132, 136, 0, 0, + 33, 0, 35, 32, 15, 11, 0, 0, 28, 41, + 65, 23, 0, 26, 17, 0, 12, 19, 0, 0, + 22, 13, 0, 27, 41, 65, 16, 0, 21, 24, + 25, 45, 251, 244, 0, 252, 248, 0, 250, 240, + 0, 241, 245, 317}; const int JavaScriptGrammar::goto_default [] = { - 6, 5, 23, 1, 4, 3, 22, 523, 524, 503, - 24, 519, 520, 378, 508, 219, 11, 252, 44, 52, - 483, 481, 376, 375, 35, 482, 374, 377, 130, 48, - 43, 168, 50, 39, 167, 45, 51, 80, 49, 34, - 54, 53, 289, 41, 283, 36, 279, 38, 281, 37, - 280, 46, 287, 47, 288, 40, 282, 278, 319, 431, - 284, 285, 214, 218, 220, 224, 225, 216, 215, 227, - 253, 226, 231, 250, 251, 217, 380, 379, 25, 542, - 541, 341, 342, 544, 344, 543, 343, 439, 443, 446, - 442, 441, 461, 462, 208, 222, 204, 207, 221, 229, - 228, 0}; + 6, 5, 13, 1, 4, 3, 527, 30, 29, 525, + 526, 15, 528, 522, 523, 385, 509, 226, 230, 259, + 51, 59, 490, 488, 383, 382, 42, 489, 381, 384, + 137, 55, 50, 175, 57, 46, 174, 52, 58, 87, + 56, 41, 61, 60, 296, 48, 290, 43, 286, 45, + 288, 44, 287, 53, 294, 54, 295, 47, 289, 285, + 326, 438, 291, 292, 221, 225, 227, 231, 232, 223, + 222, 234, 260, 233, 238, 257, 258, 224, 387, 386, + 32, 544, 543, 348, 349, 546, 351, 545, 350, 446, + 450, 453, 449, 448, 468, 469, 215, 229, 211, 214, + 228, 236, 235, 0}; const int JavaScriptGrammar::action_index [] = { - 62, -91, -18, -91, -40, 362, 44, 117, -91, -91, - -91, -91, -91, -91, -12, 144, 20, 130, -91, -91, - 14, -91, -91, 356, 127, 195, -91, 158, -91, -91, - -91, 11, 34, 678, 125, -91, 41, -9, -27, 204, - -91, 263, 58, -91, -91, 519, 61, 63, 220, 131, - -91, -91, -91, 330, 159, 678, -91, -91, -91, 154, - -91, 1176, 53, 678, 678, 678, 598, 678, -91, -91, - 678, 678, -91, -91, -91, -91, 678, -91, 678, 678, - -91, 678, 678, 118, 221, -91, -91, 678, 678, 678, - -91, -91, -91, 217, 678, 269, 678, 678, 678, 678, - 311, 678, 678, 678, 678, 678, 678, 228, 678, 678, - 678, 104, 65, 64, 187, 164, 214, 295, 295, 431, - 431, 345, 678, -7, 678, 90, 1089, 678, 678, -91, + -27, -91, 56, -91, -22, 60, 62, 109, -91, -91, + -91, 54, -91, -91, 438, -91, -91, -91, -91, 49, + 220, 53, 172, -91, -91, -91, 50, -91, -91, -91, + 415, 84, 207, -91, 226, -91, -91, -91, 61, 63, + 725, 80, -91, 68, 69, 59, 217, -91, 342, 74, + -91, -91, 566, 66, 72, 144, 140, -91, -91, -91, + 395, 160, 725, -91, -91, -91, 176, -91, 1223, 64, + 725, 725, 725, 645, 725, -91, -91, 725, 725, -91, + -91, -91, -91, 725, -91, 725, 725, -91, 725, 725, + 107, 178, -91, -91, 725, 725, 725, -91, -91, -91, + 187, 725, 342, 725, 725, 725, 725, 385, 725, 725, + 725, 725, 725, 725, 269, 725, 725, 725, 132, 113, + 79, 193, 269, 196, 199, 200, 370, 478, 478, 725, + 59, 725, 73, 1136, 725, 725, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, -91, 113, 678, -91, -91, 42, -8, -91, - 678, -91, -91, 678, -91, -91, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -91, -91, 678, 22, 678, - 678, 29, 5, 678, -91, 1089, 678, 678, -91, 110, - -91, 51, -91, -91, 36, -91, 184, 85, 60, -91, - 151, -91, 56, 1437, -91, -91, -91, -91, -91, 166, - -91, -91, 28, -91, -91, -91, -91, -91, -91, 1437, - -91, -91, 290, 244, 102, 1350, 49, 178, 73, 39, - 1698, 70, 678, -91, 72, 46, 678, 43, 37, 38, - -91, -91, -91, -91, -91, -91, -91, -91, 68, -91, - -91, -91, -91, 71, -91, -91, -91, -91, -91, -91, - 50, 54, 678, 88, 66, -91, -91, 842, -91, 87, - 47, 45, -91, 257, 59, 26, 486, 84, 146, 363, - 295, 205, 678, 249, 678, 678, 678, 678, 363, 678, - 678, 678, 678, 678, 295, 295, 295, 295, 295, 293, - 363, 363, 678, -21, 678, 18, 678, -91, 519, 678, - -91, 678, 13, -37, 678, -38, 1350, -91, 678, 98, - 1350, -91, 678, -28, 678, 678, 16, 8, 678, -91, - 0, 229, -15, -91, -91, 678, -91, 219, 678, -91, - -34, 678, -32, 1350, -91, 678, 89, 1350, -91, -6, - 197, -24, 1, 1437, -23, -91, 1350, -91, 678, 94, - 1350, 17, 1350, -91, 6, 15, -26, -91, -91, 1350, - -30, 231, 7, 278, 76, 678, 1350, -5, -36, 260, - -3, -29, 598, -4, -1, -91, 762, -91, 3, 19, - 4, 678, -2, -25, 678, 2, 678, -35, -10, 678, - -91, 1263, 52, -91, -91, -91, -91, -91, -91, 678, - -91, -91, -91, -91, 167, -91, 678, 21, -91, 1350, - -91, 74, -91, -91, 1350, -91, 678, 91, 25, -91, - 105, -91, 105, 97, 678, -91, 105, 55, -91, 23, - -91, 1350, -91, 101, 1350, -91, 208, -91, -91, 92, - 1350, 40, -91, 33, 35, -91, 180, 24, 31, -91, - -91, -91, -91, 678, 86, 1350, -91, 678, 93, 1350, - -91, 106, 57, 922, -91, 48, -91, 1002, -91, -91, - -91, -91, -91, 132, -91, -91, -91, -91, -91, -91, - -91, 10, 424, -91, -91, 421, -91, -91, 9, 30, - 678, 27, -91, 1611, 156, -91, 134, 342, -91, 95, - -91, -91, 12, 116, -91, 124, -91, 270, -91, -91, - 1524, -91, 112, 352, -91, 114, -91, -91, -91, -91, - 32, -91, 169, -91, -91, 678, -91, -91, 139, -91, - -91, -91, + 94, 725, -91, -91, 65, 47, -91, 725, -91, -91, + 725, -91, -91, -91, -91, -91, -91, -91, -91, -91, + -91, -91, -91, -91, 725, 46, 725, 725, 55, 51, + 725, -91, 1136, 725, 725, -91, 95, -91, 38, -91, + -91, 35, -91, 210, 48, 32, -91, 223, -91, 34, + 1484, -91, -91, -91, -91, -91, 240, -91, -91, 33, + -91, -91, -91, -91, -91, -91, 1484, -91, -91, 281, + 266, 71, 1397, 39, 216, 52, 45, 1745, 58, 725, + -91, 57, 44, 725, 43, 41, 42, -91, -91, -91, + -91, -91, -91, -91, -91, 104, -91, -91, -91, -91, + 106, -91, -91, -91, -91, -91, -91, -28, 27, 725, + 117, 100, -91, -91, 805, -91, 83, 70, 67, -91, + 260, 77, -56, 503, 12, 119, 289, 231, 204, 725, + 285, 725, 725, 725, 725, 333, 725, 725, 725, 725, + 725, 181, 157, 169, 177, 269, 410, 339, 317, 725, + -65, 725, 15, 725, -91, 566, 725, -91, 725, 9, + -42, 725, -38, 1397, -91, 725, 116, 1397, -91, 725, + -48, 725, 725, 5, 120, 725, -91, 25, 203, 13, + -91, -91, 725, -91, 218, 725, -91, -1, 725, -8, + 1397, -91, 725, 103, 1397, -91, 19, 225, -19, 4, + 1484, -25, -91, 1397, -91, 725, 97, 1397, 24, 1397, + -91, 26, 31, -23, -91, -91, 1397, -24, 337, 22, + 324, 81, 725, 1397, 40, 10, 252, -3, -33, 645, + 2, 1, -91, 889, -91, 11, -13, 3, 725, 8, + 18, 725, 21, 725, -2, -10, 725, -91, 1310, 29, + -91, -91, -91, -91, -91, -91, 725, -91, -91, -91, + -91, 194, -91, 725, -6, -91, 1397, -91, 78, -91, + -91, 1397, -91, 725, 128, -12, -91, 6, -91, 7, + 91, 725, -91, -4, 36, -91, -53, -91, 1397, -91, + 105, 1397, -91, 130, -91, -91, 108, 1397, 0, -91, + 14, 16, -91, 150, 23, 20, -91, -91, -91, -91, + 725, 121, 1397, -91, 725, 126, 1397, -91, 85, 30, + 1049, -91, 37, -91, 969, -91, -91, -91, -91, -91, + 96, -91, -91, -91, -91, -91, -91, -91, -9, -5, + 28, 725, 17, -91, -91, -91, 1658, 146, -91, 102, + 406, -91, 86, -91, -91, 98, -91, -91, 93, 279, + -91, -91, 1571, -91, 90, 384, -91, 88, -91, -91, + -91, -91, -11, -91, 206, -91, -91, 725, -91, -91, + 232, -91, -91, -91, - -102, -102, -102, -102, 34, 63, -102, -102, -102, -102, - -102, -102, -102, -102, -102, 53, -102, -102, -102, -102, - -102, -102, -102, 235, -102, 9, -102, 4, -102, -102, - -102, -102, -102, -5, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -51, -102, -102, -102, -102, - -102, -102, -102, -102, -102, 156, -102, -102, -102, 18, - -102, -102, -102, -11, 95, 88, 90, 79, -102, -102, - 80, 100, -102, -102, -102, -102, 114, -102, 101, 107, - -102, 73, 131, -102, -102, -102, -102, 108, 111, 115, - -102, -102, -102, -102, 165, -102, 83, 85, 118, 71, - -102, 120, 144, 145, 143, 147, 159, -102, 122, 129, - 66, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, 41, -102, 65, -102, 77, 26, 19, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, 27, -102, -102, -102, -102, -102, - 28, -102, -102, 42, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, 139, -102, 138, - -1, -102, -102, 1, -102, 230, -10, 55, -102, -102, - -102, -102, -102, -102, -102, -102, -3, -102, -102, -102, - -4, -102, -102, 86, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, 254, - -102, -102, 56, 50, -102, 46, -102, -6, -102, -102, - -102, -102, -2, -102, -102, -102, 17, -28, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, 5, -102, -102, -102, -102, 146, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, 43, 225, -102, 237, 226, 197, 196, -102, 127, - 136, 137, 135, 93, -102, -102, -102, -102, -102, -102, - -102, -102, 174, -102, 180, -102, 170, -102, -102, 183, - -102, 68, -102, -102, 70, -102, 49, -102, 48, -102, - 47, -102, 193, -102, 161, 219, -102, -102, 189, -102, - -102, -102, -102, -102, -102, 190, -102, 59, 72, -102, - -102, 75, -102, 57, -102, 58, -102, 51, -102, -102, - 64, -102, -102, 203, -102, -102, 44, -102, 32, -102, - 31, -102, 29, -102, -102, -102, -102, -102, -102, 40, - -102, 37, -102, 38, -102, 61, 36, -102, -102, 30, - -102, -102, 62, -102, -102, -102, 35, -102, -102, -102, - -102, 39, -102, 3, 128, -102, 155, -102, -102, 22, - -102, 14, -102, -102, -102, -102, -102, -102, -102, 13, - -102, -102, -102, -102, -102, -102, 123, -102, -102, 45, - -102, -102, -102, -102, 25, -102, 52, -102, -102, -102, - -102, -102, -80, -102, 54, -102, -72, -102, -102, -102, - -102, -73, -102, -102, -76, -102, -102, -102, -102, -102, - -102, -87, -102, -102, -45, -102, 12, -102, -31, -102, - -102, -102, -102, 20, -102, 15, -102, 98, -102, 6, - -102, -102, -102, 0, -102, 2, -102, -16, -102, -102, - -102, -102, -102, -102, -102, -102, -102, -102, -102, -102, - -102, -102, 232, -102, -102, 238, -102, -102, -102, -102, - 11, -102, -102, 16, -9, -102, -7, 74, -102, -102, - -102, -102, 24, -102, -102, -102, -102, 194, -102, -102, - 8, -102, -8, 188, -102, -102, -102, -102, -102, -102, - -102, -102, -102, -102, -102, 21, -102, -102, 60, -102, - -102, -102}; + -104, -104, -104, -104, -3, 5, -104, -104, -104, -104, + -104, -104, -104, -104, 241, -104, -104, -104, -104, -104, + 4, -104, -104, -104, -104, -104, -104, -104, -104, -104, + 246, -104, 2, -104, 3, -104, -104, -104, -104, -104, + 15, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -45, -104, -104, -104, -104, -104, -104, -104, + -104, -104, 104, -104, -104, -104, -6, -104, -104, -104, + -14, 124, 119, 97, 113, -104, -104, 108, 112, -104, + -104, -104, -104, 127, -104, 120, 116, -104, 96, 85, + -104, -104, -104, -104, 128, 109, 105, -104, -104, -104, + -104, 89, -104, 146, 158, 143, 84, -104, 142, 136, + 135, 154, 145, 76, -104, 71, 134, 42, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, 70, + -104, 73, -104, 80, 37, 31, -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, -104, -104, -104, -104, -104, -104, + -104, 34, -104, -104, -104, -104, -104, 27, -104, -104, + -18, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, 123, -104, 132, 22, -104, -104, + 24, -104, 180, 23, 90, -104, -104, -104, -104, -104, + -104, -104, -104, 7, -104, -104, -104, -2, -104, -104, + 26, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, 74, -104, -104, -8, + 19, -104, 28, -104, 1, -104, -104, -104, -104, 8, + -104, -104, -104, 17, -41, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, 67, + -104, -104, -104, -104, 93, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, 32, 202, + -104, 198, 188, 192, 189, -104, 151, 201, 45, 60, + 69, -104, -104, -104, -104, -104, -104, -104, -104, 169, + -104, 176, -104, 204, -104, -104, 268, -104, 77, -104, + -104, 68, -104, 55, -104, 57, -104, 56, -104, 170, + -104, 160, 161, -104, -104, 162, -104, -104, -104, -104, + -104, -104, 186, -104, 53, 78, -104, -104, 79, -104, + 62, -104, 51, -104, 50, -104, -104, 94, -104, -104, + 65, -104, -104, 48, -104, 49, -104, 47, -104, 44, + -104, -104, -104, -104, -104, -104, 43, -104, 36, -104, + 41, -104, 66, 63, -104, -104, 52, -104, -104, 59, + -104, -104, -104, 64, -104, -104, -104, -104, 30, -104, + -29, 131, -104, 155, -104, -104, 38, -104, 39, -104, + -104, -104, -104, -104, -104, -104, 29, -104, -104, -104, + -104, -104, -104, 91, -104, -104, 61, -104, -104, -104, + -104, 54, -104, 58, -104, -104, -104, -104, -104, -57, + -104, -11, -104, -83, -104, -104, -104, -104, -73, -104, + -104, -68, -104, -104, -104, -104, -104, -104, -86, -104, + -104, -60, -104, -20, -104, -63, -104, -104, -104, -104, + 0, -104, 18, -104, 21, -104, 16, -104, -104, -104, + 11, -104, 20, -104, 25, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -1, -104, -104, -104, -104, 13, 10, -104, 9, + 6, -104, -104, -104, -104, -104, -104, -104, -104, 81, + -104, -104, 14, -104, 33, 95, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -13, -104, -104, + 72, -104, -104, -104}; const int JavaScriptGrammar::action_info [] = { - 277, 473, -81, -89, -67, -94, -71, 368, 460, -97, - -70, -92, 193, 409, -100, 338, 355, 345, 332, 292, - 312, 164, 326, 411, 324, 423, 477, 351, 353, 421, - 360, 187, 365, 372, 363, 164, 362, 510, 509, 122, - 32, 33, 94, 512, 551, 502, 360, 7, 2, 545, - 170, 124, 172, 502, 27, 436, 484, 314, 440, 419, - 464, 484, 451, 187, 460, 490, 164, 316, 460, 466, - 122, 124, 206, 473, 477, 368, 460, 429, 450, 434, - 366, 428, 436, 256, 468, 277, 332, 321, 292, 213, - 272, 94, 0, 210, 164, 312, 164, 164, 463, 164, - 0, 164, 164, 0, 81, 81, 164, 447, 454, 164, - 444, 202, 464, 189, 485, 82, 82, 190, 164, 366, - 212, 164, 527, 314, 527, 0, 271, 276, 275, 262, - 261, 530, 267, 266, 513, 433, 432, 269, 268, 514, - 164, 366, 514, 87, 81, 502, 475, 0, 274, 357, - 2, 438, 448, 479, 370, 82, 538, 537, 330, 28, - 85, 0, 486, 269, 268, 81, 200, 502, 60, 165, - 536, 86, 528, 60, 164, 0, 82, 548, 9, 8, - 60, 0, 195, 60, 108, 60, 109, 28, 88, 108, - 0, 109, 494, 0, 89, 0, 334, 110, 0, 0, - 335, 196, 110, 426, 30, 72, 73, 60, 0, 60, - 72, 73, 108, 60, 109, 29, 164, 72, 73, 126, - 72, 73, 72, 73, 60, 110, 60, 255, 254, 87, - 549, 547, 30, 87, 60, 195, 0, 347, 127, 108, - 128, 109, 0, 29, 72, 73, 72, 73, 60, 0, - 72, 73, 110, 108, 196, 109, 197, 0, 0, 0, - 60, 72, 73, 72, 73, 0, 110, 294, 295, 458, - 457, 72, 73, 60, 88, 294, 295, 0, 88, 0, - 89, 96, 97, 0, 89, 72, 73, 96, 97, 60, - 348, 0, 260, 259, 296, 297, -311, 72, 73, 522, - 0, 0, 296, 297, 0, 265, 264, 60, 98, 99, - 72, 73, 0, 0, 98, 99, 299, 300, 0, 60, - 108, 0, 109, 0, 0, 301, 72, 73, 302, 19, - 303, 0, 0, 110, 101, 102, 72, 73, 0, 265, - 264, 0, 103, 104, 72, 73, 105, 0, 106, 0, - 484, 260, 259, 101, 102, 18, 72, 73, 0, 0, - 484, 103, 104, 0, 0, 105, 14, 106, 101, 102, - 0, 522, 14, 0, 0, 0, 103, 104, 15, 0, - 105, 522, 106, 0, 15, 16, 299, 300, 0, 0, - 0, 16, 0, 0, 0, 301, 0, 0, 302, 0, - 303, 19, 0, 0, 0, 0, 0, 0, 72, 73, - 0, 19, 0, 0, 0, 19, 0, 0, 72, 73, - 0, 19, 17, 20, 0, 0, 0, 18, 17, 20, - 21, 14, 0, 0, 14, 0, 21, 18, 0, 13, - 0, 18, 0, 15, 0, 13, 15, 18, 0, 0, - 16, 0, 0, 16, 101, 102, 0, 0, 0, 0, - 0, 0, 103, 104, 0, 0, 105, 0, 106, 0, - 0, 0, 0, 0, 0, 0, 506, 0, 0, 504, - 19, 0, 0, 19, 0, 0, 0, 17, 20, 174, - 17, 20, 0, 0, 0, 21, 0, 0, 21, 175, - 0, 0, 0, 176, 13, 0, 18, 13, 0, 18, - 0, 0, 177, 0, 178, 0, 0, 328, 0, 0, - 0, 0, 174, 0, 0, 179, 0, 180, 85, 0, - 0, 0, 175, 0, 0, 181, 176, 0, 182, 86, - 0, 0, 0, 0, 183, 177, 0, 178, 0, 0, - 184, 0, 0, 0, 0, 0, 0, 0, 179, 0, - 180, 85, 0, 0, 0, 185, 0, 0, 181, 0, - 0, 182, 86, 0, 0, 0, 0, 183, 0, 0, - 0, 0, 0, 184, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 185, 0, + 319, 451, 457, 375, -69, 328, 547, 339, -73, -91, + -94, 451, 451, 321, 339, -96, 299, 171, -72, 331, + 471, 447, 333, 443, 510, 171, 484, 367, -99, -102, + 372, 430, 428, 416, 480, 511, 426, 370, 497, 418, + 379, 369, 352, 458, 362, 491, 284, -83, 278, 467, + 473, 467, 360, 467, 435, 367, 217, 194, 200, 373, + 358, 2, 553, 279, 441, 436, 2, 220, 194, 101, + 40, 213, 491, 177, 101, 284, 467, 480, 484, 513, + 443, 375, 171, 475, 299, 323, 14, 14, 263, 11, + 39, 516, 219, 492, 129, 0, 529, 373, 209, 517, + 532, 454, 171, 171, 171, 171, 529, 179, 517, 373, + 0, 171, 461, 171, 470, 34, 0, 129, 319, 88, + 88, 7, 196, 14, 171, 171, 197, 345, 471, 171, + 89, 89, 276, 275, 171, 14, 171, 131, 171, 440, + 439, 493, 276, 275, 538, 321, 455, 540, 539, 92, + 172, 207, 94, 88, 530, 0, 501, 377, 0, 202, + 93, 283, 282, 364, 89, 269, 268, 274, 273, 341, + 9, 8, 88, 342, 0, 67, 337, 281, 203, 67, + 204, 482, 115, 89, 116, 115, 486, 116, 445, 0, + 94, 465, 464, 0, 115, 117, 116, 95, 117, 94, + 0, 35, 115, 96, 116, 67, 115, 117, 116, 202, + 0, 354, 79, 80, 550, 117, 79, 80, 115, 117, + 116, 115, 0, 116, 115, 115, 116, 116, 203, 0, + 433, 117, 133, 67, 117, 95, 67, 117, 117, 67, + 0, 96, 79, 80, 95, 67, 37, 67, 171, 67, + 96, 134, 67, 135, 67, 35, 115, 36, 116, 0, + 0, 67, 0, 0, 355, 0, 0, 551, 549, 117, + 79, 80, 0, 79, 80, 0, 79, 80, 301, 302, + 0, 67, 79, 80, 79, 80, 79, 80, -313, 79, + 80, 79, 80, 0, 115, 67, 116, 0, 79, 80, + 37, 262, 261, 301, 302, 303, 304, 117, 21, 0, + 67, 36, 306, 307, 0, 0, 0, 0, 79, 80, + 0, 308, 0, 0, 309, 0, 310, 272, 271, 0, + 303, 304, 79, 80, 0, 0, 0, 0, 25, 0, + 306, 307, 267, 266, 0, 79, 80, 79, 80, 308, + 0, 0, 309, 67, 310, 0, 306, 307, 0, 0, + 103, 104, 306, 307, 24, 308, 67, 0, 309, 0, + 310, 308, 0, 0, 309, 0, 310, 0, 0, 0, + 0, 0, 0, 0, 0, 272, 271, 105, 106, 0, + 79, 80, 491, 108, 109, 0, 0, 0, 267, 266, + 0, 110, 111, 79, 80, 112, 0, 113, 108, 109, + 0, 0, 0, 21, 491, 0, 110, 111, 108, 109, + 112, 0, 113, 0, 0, 19, 110, 111, 0, 0, + 112, 0, 113, 306, 307, 21, 0, 20, 0, 0, + 0, 0, 308, 25, 21, 309, 0, 310, 19, 0, + 79, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 25, 0, 21, 0, 24, + 514, 0, 79, 80, 25, 0, 0, 0, 0, 0, + 0, 22, 26, 0, 0, 0, 0, 0, 0, 27, + 0, 24, 0, 23, 0, 0, 0, 25, 18, 0, + 24, 108, 109, 0, 22, 26, 181, 0, 0, 110, + 111, 0, 27, 112, 0, 113, 182, 0, 0, 0, + 183, 18, 0, 24, 0, 0, 0, 0, 0, 184, + 0, 185, 0, 0, 335, 0, 0, 0, 0, 0, + 0, 0, 186, 0, 187, 92, 0, 0, 0, 0, + 0, 0, 188, 0, 0, 189, 93, 0, 0, 0, + 0, 190, 0, 0, 0, 0, 0, 191, 0, 181, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 182, + 0, 0, 192, 183, 0, 0, 0, 0, 0, 0, + 0, 0, 184, 0, 185, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 186, 0, 187, 92, 0, + 0, 0, 0, 0, 0, 188, 0, 0, 189, 93, + 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, + 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 0, 0, 0, 0, 67, 0, 0, 0, 68, 69, + 0, 70, 0, 0, 0, 0, 0, 0, 73, 0, + 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, - 59, 0, 0, 0, 0, 0, 0, 60, 0, 0, - 0, 61, 62, 0, 63, 0, 0, 0, 0, 0, - 0, 66, 0, 0, 0, 69, 0, 0, 0, 0, + 81, 79, 80, 0, 82, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 75, 84, 65, 0, 0, + 0, 0, 0, 0, 0, 0, 62, 63, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 0, 0, 0, 0, 67, 0, 0, 0, 68, 69, + 0, 70, 0, 0, 0, 71, 0, 72, 73, 74, + 0, 0, 76, 0, 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 72, 73, 0, 75, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 77, - 58, 0, 0, 0, 0, 0, 0, 0, 0, 55, - 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, - 59, 0, 0, 0, 0, 0, 0, 60, 0, 0, - 0, 61, 62, 0, 63, 0, 0, 0, 64, 0, - 65, 66, 67, 0, 0, 69, 0, 0, 0, 70, - 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 72, 73, 0, 75, 0, 76, - 0, 78, 0, 79, 0, 0, 0, 0, 68, 77, - 58, 0, 0, 0, 0, 0, 0, 0, 0, -90, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 0, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 291, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 492, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 0, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 55, 56, 57, 0, 0, 0, 0, - 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, - 0, 60, 0, 0, 0, 61, 62, 0, 63, 0, - 0, 0, 64, 0, 65, 66, 67, 0, 0, 69, - 0, 0, 0, 70, 0, 71, 0, 0, 489, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 72, 73, - 0, 75, 0, 76, 0, 78, 0, 79, 0, 0, - 0, 0, 68, 77, 58, 0, 0, 0, 0, 0, - 0, 0, 0, 132, 133, 134, 0, 0, 136, 138, - 139, 0, 0, 140, 0, 141, 0, 0, 0, 143, - 144, 145, 0, 0, 0, 0, 0, 0, 60, 146, - 147, 148, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 152, 0, - 0, 0, 0, 0, 0, 72, 73, 153, 154, 155, - 0, 157, 158, 159, 160, 161, 162, 0, 0, 150, - 156, 142, 135, 137, 151, 0, 0, 0, 0, 0, - 132, 133, 134, 0, 0, 136, 138, 139, 0, 0, - 140, 0, 141, 0, 0, 0, 143, 144, 145, 0, - 0, 0, 0, 0, 0, 413, 146, 147, 148, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, - 0, 0, 0, 414, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 152, 0, 0, 0, 0, - 0, 418, 415, 417, 153, 154, 155, 0, 157, 158, - 159, 160, 161, 162, 0, 0, 150, 156, 142, 135, - 137, 151, 0, 0, 0, 0, 0, 132, 133, 134, - 0, 0, 136, 138, 139, 0, 0, 140, 0, 141, - 0, 0, 0, 143, 144, 145, 0, 0, 0, 0, - 0, 0, 413, 146, 147, 148, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 149, 0, 0, 0, - 414, 0, 0, 0, 0, 0, 0, 0, 416, 0, - 0, 0, 152, 0, 0, 0, 0, 0, 418, 415, - 417, 153, 154, 155, 0, 157, 158, 159, 160, 161, - 162, 0, 0, 150, 156, 142, 135, 137, 151, 0, - 0, 0, 0, 0, 232, 0, 0, 0, 0, 233, - 0, 55, 56, 57, 235, 0, 0, 0, 0, 0, - 0, 236, 59, 0, 0, 0, 0, 0, 0, 238, - 239, 0, 0, 240, 62, 0, 63, 0, 0, 0, - 64, 0, 65, 66, 67, 0, 0, 69, 0, 0, - 0, 70, 0, 71, 0, 0, 0, 0, 0, 242, - 0, 243, 0, 0, 0, 74, 241, 244, 245, 75, - 246, 76, 247, 78, 21, 79, 248, 249, 0, 0, - 68, 77, 58, 13, 234, 0, 0, 0, 0, 0, - 0, 232, 0, 0, 0, 0, 233, 0, 55, 56, - 57, 235, 0, 0, 0, 0, 0, 0, 236, 237, - 0, 0, 0, 0, 0, 0, 238, 239, 0, 0, - 240, 62, 0, 63, 0, 0, 0, 64, 0, 65, - 66, 67, 0, 0, 69, 0, 0, 0, 70, 0, - 71, 0, 0, 0, 0, 0, 242, 0, 243, 0, - 0, 0, 74, 241, 244, 245, 75, 246, 76, 247, - 78, 21, 79, 248, 249, 0, 0, 68, 77, 58, - 13, 234, 0, 0, 0, 0, 0, 0, 232, 0, - 0, 0, 0, 233, 0, 55, 56, 57, 235, 0, - 0, 0, 0, 0, 0, 236, 59, 0, 0, 0, - 0, 0, 0, 532, 239, 0, 0, 240, 533, 0, - 63, 0, 0, 0, 64, 0, 65, 66, 67, 0, - 0, 69, 0, 0, 0, 70, 0, 71, 0, 0, - 0, 0, 0, 242, 0, 243, 0, 0, 0, 74, - 241, 244, 245, 75, 246, 76, 247, 78, 21, 79, - 248, 249, 0, 0, 68, 77, 58, 13, 234, 0, - 0, 0, 0, 0, 0, 232, 0, 0, 0, 0, - 233, 0, 55, 56, 57, 235, 0, 0, 0, 0, - 0, 0, 236, 59, 0, 0, 0, 0, 0, 0, - 516, 239, 0, 0, 240, 517, 0, 63, 0, 0, - 0, 64, 0, 65, 66, 67, 0, 0, 69, 0, - 0, 0, 70, 0, 71, 0, 0, 0, 0, 0, - 242, 0, 243, 0, 0, 0, 74, 241, 244, 245, - 75, 246, 76, 247, 78, 21, 79, 248, 249, 0, - 0, 68, 77, 58, 13, 234, 0, 518, 0, 0, - 0, 0, 381, 133, 134, 0, 0, 383, 138, 385, - 56, 57, 386, 0, 141, 0, 0, 0, 143, 388, - 389, 0, 0, 0, 0, 0, 0, 390, 391, 147, - 148, 240, 62, 0, 63, 0, 0, 0, 64, 0, - 65, 392, 67, 0, 0, 394, 0, 0, 0, 70, - 0, 71, 0, -236, 0, 0, 0, 396, 0, 243, - 0, 0, 0, 398, 395, 397, 399, 400, 401, 76, - 403, 404, 405, 406, 407, 408, 0, 0, 393, 402, - 387, 382, 384, 151, 0, 0, 0, 0, 0, + 81, 79, 80, 0, 82, 0, 83, 0, 85, 0, + 86, 0, 0, 0, 0, 75, 84, 65, 0, 0, + 0, 0, 0, 0, 0, 0, 62, 63, 64, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, + 0, 0, 0, 0, 67, 0, 0, 0, 68, 69, + 0, 70, 0, 0, 0, 71, 0, 72, 73, 74, + 0, 0, 76, 0, 0, 0, 77, 0, 78, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 81, 79, 80, 0, 82, 0, 83, 0, 85, 298, + 86, 0, 0, 0, 0, 75, 84, 65, 0, 0, + 0, 0, 0, 0, 0, 0, -92, 0, 0, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 0, 0, 0, 0, 0, 0, 67, 0, + 0, 0, 68, 69, 0, 70, 0, 0, 0, 71, + 0, 72, 73, 74, 0, 0, 76, 0, 0, 0, + 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 79, 80, 0, 82, 0, + 83, 0, 85, 0, 86, 0, 0, 0, 0, 75, + 84, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 0, 0, 0, 0, 0, 0, 67, 0, + 0, 0, 68, 69, 0, 70, 0, 0, 0, 71, + 0, 72, 73, 74, 0, 0, 76, 0, 0, 0, + 77, 0, 78, 0, 0, 496, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 79, 80, 0, 82, 0, + 83, 0, 85, 0, 86, 0, 0, 0, 0, 75, + 84, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 0, 0, 0, 0, 0, 0, 67, 0, + 0, 0, 68, 69, 0, 70, 0, 0, 0, 71, + 0, 72, 73, 74, 0, 0, 76, 0, 0, 0, + 77, 0, 78, 0, 0, 499, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 79, 80, 0, 82, 0, + 83, 0, 85, 0, 86, 0, 0, 0, 0, 75, + 84, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 139, 140, 141, 0, 0, 143, 145, 146, 0, 0, + 147, 0, 148, 0, 0, 0, 150, 151, 152, 0, + 0, 0, 0, 0, 0, 67, 153, 154, 155, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 159, 0, 0, 0, 0, + 0, 0, 79, 80, 160, 161, 162, 0, 164, 165, + 166, 167, 168, 169, 0, 0, 157, 163, 149, 142, + 144, 158, 0, 0, 0, 0, 0, 139, 140, 141, + 0, 0, 143, 145, 146, 0, 0, 147, 0, 148, + 0, 0, 0, 150, 151, 152, 0, 0, 0, 0, + 0, 0, 420, 153, 154, 155, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, + 421, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 159, 0, 0, 0, 0, 0, 425, 422, + 424, 160, 161, 162, 0, 164, 165, 166, 167, 168, + 169, 0, 0, 157, 163, 149, 142, 144, 158, 0, + 0, 0, 0, 0, 139, 140, 141, 0, 0, 143, + 145, 146, 0, 0, 147, 0, 148, 0, 0, 0, + 150, 151, 152, 0, 0, 0, 0, 0, 0, 420, + 153, 154, 155, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 156, 0, 0, 0, 421, 0, 0, + 0, 0, 0, 0, 0, 423, 0, 0, 0, 159, + 0, 0, 0, 0, 0, 425, 422, 424, 160, 161, + 162, 0, 164, 165, 166, 167, 168, 169, 0, 0, + 157, 163, 149, 142, 144, 158, 0, 0, 0, 0, + 0, 239, 0, 0, 0, 0, 240, 0, 62, 63, + 64, 242, 0, 0, 0, 0, 0, 0, 243, 66, + 0, 0, 0, 0, 0, 0, 245, 246, 0, 0, + 247, 69, 0, 70, 0, 0, 0, 71, 0, 72, + 73, 74, 0, 0, 76, 0, 0, 0, 77, 0, + 78, 0, 0, 0, 0, 0, 249, 0, 250, 0, + 0, 0, 81, 248, 251, 252, 82, 253, 83, 254, + 85, 27, 86, 255, 256, 0, 0, 75, 84, 65, + 18, 241, 0, 0, 0, 0, 0, 0, 239, 0, + 0, 0, 0, 240, 0, 62, 63, 64, 242, 0, + 0, 0, 0, 0, 0, 243, 244, 0, 0, 0, + 0, 0, 0, 245, 246, 0, 0, 247, 69, 0, + 70, 0, 0, 0, 71, 0, 72, 73, 74, 0, + 0, 76, 0, 0, 0, 77, 0, 78, 0, 0, + 0, 0, 0, 249, 0, 250, 0, 0, 0, 81, + 248, 251, 252, 82, 253, 83, 254, 85, 27, 86, + 255, 256, 0, 0, 75, 84, 65, 18, 241, 0, + 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, + 240, 0, 62, 63, 64, 242, 0, 0, 0, 0, + 0, 0, 243, 66, 0, 0, 0, 0, 0, 0, + 534, 246, 0, 0, 247, 535, 0, 70, 0, 0, + 0, 71, 0, 72, 73, 74, 0, 0, 76, 0, + 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, + 249, 0, 250, 0, 0, 0, 81, 248, 251, 252, + 82, 253, 83, 254, 85, 27, 86, 255, 256, 0, + 0, 75, 84, 65, 18, 241, 0, 0, 0, 0, + 0, 0, 239, 0, 0, 0, 0, 240, 0, 62, + 63, 64, 242, 0, 0, 0, 0, 0, 0, 243, + 66, 0, 0, 0, 0, 0, 0, 519, 246, 0, + 0, 247, 520, 0, 70, 0, 0, 0, 71, 0, + 72, 73, 74, 0, 0, 76, 0, 0, 0, 77, + 0, 78, 0, 0, 0, 0, 0, 249, 0, 250, + 0, 0, 0, 81, 248, 251, 252, 82, 253, 83, + 254, 85, 27, 86, 255, 256, 0, 0, 75, 84, + 65, 18, 241, 0, 521, 0, 0, 0, 0, 388, + 140, 141, 0, 0, 390, 145, 392, 63, 64, 393, + 0, 148, 0, 0, 0, 150, 395, 396, 0, 0, + 0, 0, 0, 0, 397, 398, 154, 155, 247, 69, + 0, 70, 0, 0, 0, 71, 0, 72, 399, 74, + 0, 0, 401, 0, 0, 0, 77, 0, 78, 0, + -238, 0, 0, 0, 403, 0, 250, 0, 0, 0, + 405, 402, 404, 406, 407, 408, 83, 410, 411, 412, + 413, 414, 415, 0, 0, 400, 409, 394, 389, 391, + 158, 0, 0, 0, 0, 0, - 455, 534, 521, 452, 493, 199, 465, 173, 488, 539, - 42, 445, 359, 322, 211, 209, 449, 470, 31, 480, - 273, 531, 487, 192, 491, 194, 511, 540, 476, 515, - 467, 469, 456, 526, 459, 474, 205, 420, 435, 10, - 412, 163, 373, 169, 371, 546, 410, 369, 205, 270, - 322, 166, 171, 422, 456, 258, 263, 367, 430, 270, - 331, 340, 327, 329, 358, 459, 186, 437, 263, 453, - 354, 501, 0, 356, 258, 0, 83, 340, 540, 169, - 26, 12, 209, 322, 525, 322, 201, 322, 123, 0, - 322, 424, 12, 0, 425, 129, 83, 0, 203, 230, - 83, 83, 223, 0, 131, 113, 83, 0, 83, 0, - 125, 84, 121, 478, 83, 83, 497, 498, 83, 424, - 83, 0, 425, 83, 100, 496, 119, 323, 83, 325, - 83, 350, 495, 308, 352, 83, 83, 499, 471, 0, - 550, 349, 83, 83, 472, 90, 83, 169, 91, 83, - 83, 500, 92, 83, 427, 83, 0, 83, 361, 120, - 107, 111, 83, 83, 83, 471, 83, 304, 112, 93, - 83, 83, 83, 83, 83, 307, 305, 306, 83, 83, - 83, 286, 83, 116, 114, 115, 290, 117, 188, 191, - 83, 83, 472, 203, 83, 535, 83, 0, 525, 118, - 83, 290, 529, 0, 525, 318, 12, 0, 95, 83, - 290, 0, 12, 336, 290, 83, 230, 0, 318, 223, - 290, 0, 313, 290, 318, 318, 315, 317, 83, 290, - 290, 83, 83, 290, 505, 0, 290, 290, 311, 310, - 320, 507, 0, 333, 507, 0, 339, 346, 129, 26, - 12, 0, 26, 12, 318, 26, 12, 131, 198, 290, - 83, 83, 0, 0, 0, 290, 290, 230, 309, 293, - 223, 0, 83, 0, 0, 0, 337, 290, 0, 298, + 474, 476, 10, 500, 477, 459, 460, 456, 193, 472, + 462, 12, 265, 548, 212, 180, 512, 481, 218, 38, + 524, 366, 542, 466, 508, 329, 17, 216, 518, 533, + 541, 487, 49, 483, 463, 466, 452, 498, 485, 270, + 206, 237, 494, 277, 536, 0, 0, 463, 199, 0, + 201, 495, 347, 178, 170, 427, 265, 176, 429, 380, + 173, 270, 378, 374, 417, 365, 376, 419, 363, 442, + 334, 338, 212, 347, 336, 444, 437, 361, 277, 90, + 237, 329, 90, 120, 280, 329, 0, 313, 0, 237, + 431, 531, 542, 432, 329, 329, 329, 90, 0, 0, + 136, 17, 314, 90, 537, 210, 90, 90, 90, 138, + 90, 315, 118, 90, 216, 17, 176, 176, 125, 130, + 132, 90, 90, 208, 434, 100, 90, 128, 431, 332, + 293, 432, 0, 90, 102, 297, 91, 356, 330, 357, + 359, 90, 90, 210, 99, 90, 90, 505, 98, 90, + 90, 506, 504, 90, 552, 479, 90, 90, 503, 478, + 90, 90, 371, 502, 90, 90, 507, 97, 90, 90, + 478, 90, 90, 90, 195, 119, 264, 122, 121, 90, + 90, 0, 90, 90, 114, 198, 127, 124, 90, 107, + 368, 90, 90, 311, 479, 90, 123, 90, 325, 325, + 136, 126, 297, 297, 297, 0, 90, 90, 0, 138, + 205, 297, 297, 90, 343, 0, 0, 0, 297, 320, + 344, 346, 340, 325, 322, 90, 90, 0, 297, 90, + 297, 297, 316, 318, 297, 90, 317, 0, 90, 90, + 297, 325, 305, 312, 297, 353, 297, 28, 300, 0, + 0, 0, 28, 31, 515, 0, 0, 0, 31, 16, + 33, 17, 0, 324, 16, 33, 17, 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, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, + 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 327, 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, 257, 0}; + 0, 0}; const int JavaScriptGrammar::action_check [] = { - 36, 36, 7, 7, 7, 7, 7, 36, 33, 7, - 7, 7, 7, 7, 7, 7, 31, 17, 2, 1, - 48, 8, 60, 8, 61, 55, 36, 61, 60, 55, - 36, 2, 55, 16, 33, 8, 60, 7, 29, 48, - 29, 7, 1, 29, 0, 33, 36, 65, 88, 17, - 8, 78, 60, 33, 66, 36, 8, 78, 33, 7, - 20, 8, 7, 2, 33, 8, 8, 8, 33, 36, - 48, 78, 36, 36, 36, 36, 33, 7, 55, 7, - 7, 60, 36, 55, 60, 36, 2, 61, 1, 33, - 36, 1, -1, 8, 8, 48, 8, 8, 6, 8, - -1, 8, 8, -1, 40, 40, 8, 10, 7, 8, - 5, 60, 20, 50, 8, 51, 51, 54, 8, 7, - 60, 8, 8, 78, 8, -1, 76, 61, 62, 61, - 62, 7, 61, 62, 7, 61, 62, 61, 62, 15, - 8, 7, 15, 12, 40, 33, 60, -1, 60, 60, - 88, 60, 55, 60, 60, 51, 61, 62, 60, 29, - 42, -1, 56, 61, 62, 40, 56, 33, 29, 56, - 56, 53, 56, 29, 8, -1, 51, 8, 61, 62, - 29, -1, 15, 29, 25, 29, 27, 29, 57, 25, - -1, 27, 60, -1, 63, -1, 50, 38, -1, -1, - 54, 34, 38, 36, 74, 66, 67, 29, -1, 29, - 66, 67, 25, 29, 27, 85, 8, 66, 67, 15, - 66, 67, 66, 67, 29, 38, 29, 61, 62, 12, - 61, 62, 74, 12, 29, 15, -1, 8, 34, 25, - 36, 27, -1, 85, 66, 67, 66, 67, 29, -1, - 66, 67, 38, 25, 34, 27, 36, -1, -1, -1, - 29, 66, 67, 66, 67, -1, 38, 18, 19, 61, - 62, 66, 67, 29, 57, 18, 19, -1, 57, -1, - 63, 18, 19, -1, 63, 66, 67, 18, 19, 29, - 61, -1, 61, 62, 45, 46, 36, 66, 67, 29, - -1, -1, 45, 46, -1, 61, 62, 29, 45, 46, - 66, 67, -1, -1, 45, 46, 23, 24, -1, 29, - 25, -1, 27, -1, -1, 32, 66, 67, 35, 59, - 37, -1, -1, 38, 23, 24, 66, 67, -1, 61, - 62, -1, 31, 32, 66, 67, 35, -1, 37, -1, - 8, 61, 62, 23, 24, 85, 66, 67, -1, -1, - 8, 31, 32, -1, -1, 35, 10, 37, 23, 24, - -1, 29, 10, -1, -1, -1, 31, 32, 22, -1, - 35, 29, 37, -1, 22, 29, 23, 24, -1, -1, - -1, 29, -1, -1, -1, 32, -1, -1, 35, -1, - 37, 59, -1, -1, -1, -1, -1, -1, 66, 67, - -1, 59, -1, -1, -1, 59, -1, -1, 66, 67, - -1, 59, 66, 67, -1, -1, -1, 85, 66, 67, - 74, 10, -1, -1, 10, -1, 74, 85, -1, 83, - -1, 85, -1, 22, -1, 83, 22, 85, -1, -1, - 29, -1, -1, 29, 23, 24, -1, -1, -1, -1, - -1, -1, 31, 32, -1, -1, 35, -1, 37, -1, - -1, -1, -1, -1, -1, -1, 55, -1, -1, 55, - 59, -1, -1, 59, -1, -1, -1, 66, 67, 3, - 66, 67, -1, -1, -1, 74, -1, -1, 74, 13, - -1, -1, -1, 17, 83, -1, 85, 83, -1, 85, - -1, -1, 26, -1, 28, -1, -1, 31, -1, -1, - -1, -1, 3, -1, -1, 39, -1, 41, 42, -1, - -1, -1, 13, -1, -1, 49, 17, -1, 52, 53, - -1, -1, -1, -1, 58, 26, -1, 28, -1, -1, - 64, -1, -1, -1, -1, -1, -1, -1, 39, -1, - 41, 42, -1, -1, -1, 79, -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, -1, + 48, 5, 55, 36, 7, 61, 17, 2, 7, 7, + 7, 5, 5, 78, 2, 7, 1, 8, 7, 61, + 20, 33, 60, 36, 29, 8, 36, 36, 7, 7, + 55, 55, 55, 7, 36, 7, 7, 33, 8, 8, + 16, 60, 17, 7, 31, 8, 36, 7, 76, 33, + 36, 33, 60, 33, 60, 36, 8, 2, 7, 7, + 61, 88, 0, 36, 7, 7, 88, 33, 2, 1, + 7, 36, 8, 8, 1, 36, 33, 36, 36, 29, + 36, 36, 8, 60, 1, 8, 33, 33, 55, 29, + 29, 7, 60, 8, 48, -1, 8, 7, 60, 15, + 7, 10, 8, 8, 8, 8, 8, 60, 15, 7, + -1, 8, 7, 8, 6, 66, -1, 48, 48, 40, + 40, 65, 50, 33, 8, 8, 54, 7, 20, 8, + 51, 51, 61, 62, 8, 33, 8, 78, 8, 61, + 62, 56, 61, 62, 56, 78, 55, 61, 62, 42, + 56, 56, 12, 40, 56, -1, 60, 60, -1, 15, + 53, 61, 62, 60, 51, 61, 62, 61, 62, 50, + 61, 62, 40, 54, -1, 29, 60, 60, 34, 29, + 36, 60, 25, 51, 27, 25, 60, 27, 60, -1, + 12, 61, 62, -1, 25, 38, 27, 57, 38, 12, + -1, 29, 25, 63, 27, 29, 25, 38, 27, 15, + -1, 8, 66, 67, 8, 38, 66, 67, 25, 38, + 27, 25, -1, 27, 25, 25, 27, 27, 34, -1, + 36, 38, 15, 29, 38, 57, 29, 38, 38, 29, + -1, 63, 66, 67, 57, 29, 74, 29, 8, 29, + 63, 34, 29, 36, 29, 29, 25, 85, 27, -1, + -1, 29, -1, -1, 61, -1, -1, 61, 62, 38, + 66, 67, -1, 66, 67, -1, 66, 67, 18, 19, + -1, 29, 66, 67, 66, 67, 66, 67, 36, 66, + 67, 66, 67, -1, 25, 29, 27, -1, 66, 67, + 74, 61, 62, 18, 19, 45, 46, 38, 29, -1, + 29, 85, 23, 24, -1, -1, -1, -1, 66, 67, + -1, 32, -1, -1, 35, -1, 37, 61, 62, -1, + 45, 46, 66, 67, -1, -1, -1, -1, 59, -1, + 23, 24, 61, 62, -1, 66, 67, 66, 67, 32, + -1, -1, 35, 29, 37, -1, 23, 24, -1, -1, + 18, 19, 23, 24, 85, 32, 29, -1, 35, -1, + 37, 32, -1, -1, 35, -1, 37, -1, -1, -1, + -1, -1, -1, -1, -1, 61, 62, 45, 46, -1, + 66, 67, 8, 23, 24, -1, -1, -1, 61, 62, + -1, 31, 32, 66, 67, 35, -1, 37, 23, 24, + -1, -1, -1, 29, 8, -1, 31, 32, 23, 24, + 35, -1, 37, -1, -1, 10, 31, 32, -1, -1, + 35, -1, 37, 23, 24, 29, -1, 22, -1, -1, + -1, -1, 32, 59, 29, 35, -1, 37, 10, -1, + 66, 67, -1, -1, -1, -1, -1, -1, -1, -1, + 22, -1, -1, -1, -1, 59, -1, 29, -1, 85, + 55, -1, 66, 67, 59, -1, -1, -1, -1, -1, + -1, 66, 67, -1, -1, -1, -1, -1, -1, 74, + -1, 85, -1, 55, -1, -1, -1, 59, 83, -1, + 85, 23, 24, -1, 66, 67, 3, -1, -1, 31, + 32, -1, 74, 35, -1, 37, 13, -1, -1, -1, + 17, 83, -1, 85, -1, -1, -1, -1, -1, 26, + -1, 28, -1, -1, 31, -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, 3, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, + -1, -1, 79, 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, -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, - 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, + 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, 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, - -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, 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, 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, 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, 74, 75, -1, -1, - -1, -1, 80, 81, 82, -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, 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, 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, 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, + 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, 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, 74, + 75, -1, -1, -1, -1, 80, 81, 82, -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, + 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, + 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, 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, -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, + -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, 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, + 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, 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, -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, 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, @@ -696,51 +699,62 @@ const int JavaScriptGrammar::action_check [] = { -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, 86, -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, + -1, 80, 81, 82, 83, 84, -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, 55, -1, -1, -1, 59, -1, 61, + -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, + 82, 83, 84, -1, 86, -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, - 76, 9, 9, 76, 15, 15, 93, 58, 24, 18, - 15, 91, 18, 15, 18, 18, 88, 62, 14, 13, - 15, 13, 20, 24, 24, 24, 15, 18, 13, 13, - 18, 62, 15, 9, 62, 15, 18, 24, 13, 5, - 26, 15, 13, 24, 13, 24, 24, 15, 18, 13, - 15, 24, 24, 13, 15, 18, 18, 13, 13, 13, - 13, 18, 13, 15, 13, 62, 24, 15, 18, 15, - 13, 18, -1, 15, 18, -1, 35, 18, 18, 24, - 17, 18, 18, 15, 10, 15, 31, 15, 47, -1, - 15, 29, 18, -1, 32, 18, 35, -1, 37, 13, - 35, 35, 16, -1, 27, 39, 35, -1, 35, -1, - 45, 38, 41, 15, 35, 35, 37, 37, 35, 29, - 35, -1, 32, 35, 41, 37, 41, 59, 35, 59, - 35, 59, 37, 40, 59, 35, 35, 37, 37, -1, - 80, 82, 35, 35, 37, 37, 35, 24, 37, 35, - 35, 37, 37, 35, 31, 35, -1, 35, 94, 41, - 40, 39, 35, 35, 35, 37, 35, 40, 39, 38, - 35, 35, 35, 35, 35, 40, 40, 40, 35, 35, - 35, 35, 35, 40, 40, 40, 40, 40, 49, 51, - 35, 35, 37, 37, 35, 7, 35, -1, 10, 40, - 35, 40, 8, -1, 10, 35, 18, -1, 43, 35, - 40, -1, 18, 52, 40, 35, 13, -1, 35, 16, - 40, -1, 48, 40, 35, 35, 46, 57, 35, 40, - 40, 35, 35, 40, 2, -1, 40, 40, 42, 42, - 57, 6, -1, 50, 6, -1, 57, 57, 18, 17, - 18, -1, 17, 18, 35, 17, 18, 27, 28, 40, - 35, 35, -1, -1, -1, 40, 40, 13, 42, 44, - 16, -1, 35, -1, -1, -1, 57, 40, -1, 42, + 20, 64, 5, 17, 64, 78, 17, 90, 26, 95, + 78, 6, 20, 26, 20, 60, 17, 17, 20, 16, + 11, 20, 20, 64, 20, 17, 20, 20, 15, 15, + 20, 15, 17, 15, 17, 64, 93, 26, 17, 20, + 17, 15, 22, 15, 11, -1, -1, 17, 26, -1, + 26, 26, 20, 26, 17, 26, 20, 26, 15, 15, + 26, 20, 15, 15, 26, 15, 17, 28, 17, 15, + 15, 15, 20, 20, 17, 17, 15, 15, 15, 37, + 15, 17, 37, 41, 17, 17, -1, 42, -1, 15, + 31, 10, 20, 34, 17, 17, 17, 37, -1, -1, + 20, 20, 42, 37, 9, 39, 37, 37, 37, 29, + 37, 42, 41, 37, 20, 20, 26, 26, 42, 49, + 47, 37, 37, 33, 33, 40, 37, 43, 31, 61, + 37, 34, -1, 37, 45, 42, 40, 84, 61, 61, + 61, 37, 37, 39, 39, 37, 37, 39, 39, 37, + 37, 39, 39, 37, 82, 39, 37, 37, 39, 39, + 37, 37, 97, 39, 37, 37, 39, 39, 37, 37, + 39, 37, 37, 37, 51, 41, 102, 42, 42, 37, + 37, -1, 37, 37, 42, 53, 43, 42, 37, 43, + 96, 37, 37, 42, 39, 37, 42, 37, 37, 37, + 20, 43, 42, 42, 42, -1, 37, 37, -1, 29, + 30, 42, 42, 37, 54, -1, -1, -1, 42, 50, + 59, 59, 52, 37, 48, 37, 37, -1, 42, 37, + 42, 42, 44, 44, 42, 37, 44, -1, 37, 37, + 42, 37, 44, 42, 42, 59, 42, 6, 46, -1, + -1, -1, 6, 12, 8, -1, -1, -1, 12, 18, + 19, 20, -1, 59, 18, 19, 20, -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, 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, + 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 59, -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, 100, -1}; + -1, -1}; diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index c01d1cc..3b98238 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -150,15 +150,15 @@ public: T_XOR = 78, T_XOR_EQ = 79, - ACCEPT_STATE = 551, - RULE_COUNT = 315, - STATE_COUNT = 552, + ACCEPT_STATE = 553, + RULE_COUNT = 317, + STATE_COUNT = 554, TERMINAL_COUNT = 91, - NON_TERMINAL_COUNT = 102, + NON_TERMINAL_COUNT = 104, - GOTO_INDEX_OFFSET = 552, - GOTO_INFO_OFFSET = 1789, - GOTO_CHECK_OFFSET = 1789 + GOTO_INDEX_OFFSET = 554, + GOTO_INFO_OFFSET = 1836, + GOTO_CHECK_OFFSET = 1836 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 897f0ce..0857eef 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -199,51 +199,55 @@ case 8: { } break; case 9: { + sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember); +} break; + +case 10: { AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMemberList, sym(2).UiObjectMember); sym(1).Node = node; } break; -case 10: { +case 11: { sym(1).Node = makeAstNode<AST::UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMember); } break; -case 11: { +case 12: { AST::UiObjectMemberList *node = makeAstNode<AST:: UiObjectMemberList> (driver->nodePool(), sym(1).UiObjectMemberList, sym(3).UiObjectMember); sym(1).Node = node; } break; -case 12: { +case 13: { AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), (AST::UiObjectMemberList*)0); node->lbraceToken = loc(1); node->rbraceToken = loc(2); sym(1).Node = node; } break; -case 13: { +case 14: { AST::UiObjectInitializer *node = makeAstNode<AST::UiObjectInitializer> (driver->nodePool(), sym(2).UiObjectMemberList->finish()); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; - case 14: -case 15: { + case 15: +case 16: { AST::UiObjectBinding *node = makeAstNode<AST::UiObjectBinding> (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).sval, sym(4).UiObjectInitializer); node->colonToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; - case 16: + case 17: { AST::UiObjectDefinition *node = makeAstNode<AST::UiObjectDefinition> (driver->nodePool(), sym(1).sval, sym(2).UiObjectInitializer); node->identifierToken = loc(1); sym(1).Node = node; } break; - case 18: -case 19: { + case 20: +case 21: { AST::UiArrayBinding *node = makeAstNode<AST::UiArrayBinding> (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); @@ -252,33 +256,33 @@ case 19: { sym(1).Node = node; } break; -case 20: { +case 22: { AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 22: { +case 24: { AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; - case 23: case 24: -case 25: { + case 25: case 26: +case 27: { AST::UiScriptBinding *node = makeAstNode<AST::UiScriptBinding> (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 26: +case 28: -case 27: { +case 29: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); break; } -case 29: { +case 31: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), (JavaScriptNameIdImpl *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -287,7 +291,7 @@ case 29: { sym(1).Node = node; } break; -case 30: { +case 32: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -295,7 +299,7 @@ case 30: { sym(1).Node = node; } break; -case 31: { +case 33: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval); node->isDefaultMember = true; node->defaultToken = loc(1); @@ -305,7 +309,7 @@ case 31: { sym(1).Node = node; } break; -case 32: { +case 34: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->propertyToken = loc(1); @@ -315,7 +319,7 @@ case 32: { sym(1).Node = node; } break; -case 33: { +case 35: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isDefaultMember = true; @@ -327,126 +331,124 @@ case 33: { sym(1).Node = node; } break; -case 34: { +case 36: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 35: { +case 37: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 36: -case 37: +case 38: +case 39: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 39: { +case 41: { QString s = QLatin1String(JavaScriptGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 40: { +case 42: { QString s = QLatin1String(JavaScriptGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 41: { +case 43: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 42: { +case 44: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 43: { +case 45: { AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 44: { +case 46: { AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 45: { +case 47: { AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 46: { +case 48: { AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 47: { +case 49: { AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 48: { +case 50: { AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 49: { +case 51: { AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 50: { +case 52: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; // ### remove me } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); sym(1).Node = node; } break; -case 51: { +case 53: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), - lexer->startColumnNo(), lexer->errorMessage())); - return false; + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); + return false; } AST::RegExpLiteral *node = makeAstNode<AST::RegExpLiteral> (driver->nodePool(), lexer->pattern, lexer->flags); node->literalToken = loc(1); sym(1).Node = node; } break; -case 52: { +case 54: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 53: { +case 55: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 54: { +case 56: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); node->lbracketToken = loc(1); node->commaToken = loc(3); @@ -454,7 +456,7 @@ case 54: { sym(1).Node = node; } break; -case 55: { +case 57: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), @@ -466,7 +468,7 @@ case 55: { sym(1).Node = node; } break; -case 56: { +case 58: { AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -474,51 +476,51 @@ case 56: { sym(1).Node = node; } break; -case 57: { +case 59: { AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 58: { +case 60: { sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 59: { +case 61: { AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 60: { +case 62: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 61: { +case 63: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 62: { +case 64: { sym(1).Node = 0; } break; -case 63: { +case 65: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 64: { +case 66: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 65: { +case 67: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -526,40 +528,36 @@ case 65: { sym(1).Node = node; } break; -case 66: { +case 68: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 67: -case 68: { +case 69: +case 70: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 69: { +case 71: { AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 70: { +case 72: { AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 71: { +case 73: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 72: - -case 73: - case 74: case 75: @@ -617,25 +615,29 @@ case 100: case 101: case 102: + +case 103: + +case 104: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 107: { +case 109: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 108: { +case 110: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 109: { +case 111: { AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -643,316 +645,309 @@ case 109: { sym(1).Node = node; } break; -case 111: { +case 113: { AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 112: { +case 114: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 113: { +case 115: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 114: { +case 116: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 115: { +case 117: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 116: { +case 118: { sym(1).Node = 0; } break; -case 117: { +case 119: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 118: { +case 120: { sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression); } break; -case 119: { +case 121: { AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 123: { +case 125: { AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 124: { +case 126: { AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 126: { +case 128: { AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 127: { +case 129: { AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 128: { +case 130: { AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 129: { +case 131: { AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 130: { +case 132: { AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 131: { +case 133: { AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 132: { +case 134: { AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 133: { +case 135: { AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 134: { +case 136: { AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 136: { +case 138: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 137: { +case 139: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 138: { +case 140: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 140: { +case 142: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 141: { +case 143: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 143: { +case 145: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 144: { +case 146: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 147: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 147: { +case 149: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 148: { +case 150: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 149: { +case 151: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 150: { +case 152: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 151: { +case 153: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 152: { +case 154: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 154: { +case 156: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 155: { +case 157: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 156: { +case 158: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 157: { +case 159: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 158: { +case 160: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +case 162: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 161: { +case 163: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 162: { +case 164: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 163: { +case 165: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 165: { +case 167: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 166: { +case 168: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 167: { +case 169: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 168: { - AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::StrictNotEqual, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - case 170: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitAnd, sym(3).Expression); + QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -966,7 +961,7 @@ case 172: { case 174: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitXor, sym(3).Expression); + QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -980,7 +975,7 @@ case 176: { case 178: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitOr, sym(3).Expression); + QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -994,7 +989,7 @@ case 180: { case 182: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::And, sym(3).Expression); + QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1008,7 +1003,7 @@ case 184: { case 186: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::Or, sym(3).Expression); + QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -1021,6 +1016,13 @@ case 188: { } break; case 190: { + AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; +} break; + +case 192: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1028,7 +1030,7 @@ case 190: { sym(1).Node = node; } break; -case 192: { +case 194: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1036,112 +1038,112 @@ case 192: { sym(1).Node = node; } break; -case 194: { +case 196: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 196: { +case 198: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 197: { +case 199: { sym(1).ival = QSOperator::Assign; } break; -case 198: { +case 200: { sym(1).ival = QSOperator::InplaceMul; } break; -case 199: { +case 201: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 200: { +case 202: { sym(1).ival = QSOperator::InplaceMod; } break; -case 201: { +case 203: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 202: { +case 204: { sym(1).ival = QSOperator::InplaceSub; } break; -case 203: { +case 205: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 204: { +case 206: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 205: { +case 207: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 206: { +case 208: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 207: { +case 209: { sym(1).ival = QSOperator::InplaceXor; } break; -case 208: { +case 210: { sym(1).ival = QSOperator::InplaceOr; } break; -case 210: { +case 212: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 211: { +case 213: { sym(1).Node = 0; } break; -case 214: { +case 216: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 215: { +case 217: { sym(1).Node = 0; } break; -case 232: { +case 234: { AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 233: { +case 235: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement); } break; -case 234: { +case 236: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 235: { +case 237: { sym(1).Node = 0; } break; -case 236: { +case 238: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 238: { +case 240: { AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1149,76 +1151,76 @@ case 238: { sym(1).Node = node; } break; -case 239: { +case 241: { sym(1).ival = T_CONST; } break; -case 240: { +case 242: { sym(1).ival = T_VAR; } break; -case 241: { +case 243: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 242: { +case 244: { AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 243: { +case 245: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 244: { +case 246: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 245: { +case 247: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 246: { +case 248: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 247: { +case 249: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 248: { +case 250: { sym(1).Node = 0; } break; -case 250: { +case 252: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 251: { +case 253: { sym(1).Node = 0; } break; -case 253: { +case 255: { AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 255: { +case 257: { AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 256: { +case 258: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1227,7 +1229,7 @@ case 256: { sym(1).Node = node; } break; -case 257: { +case 259: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1235,7 +1237,7 @@ case 257: { sym(1).Node = node; } break; -case 259: { +case 261: { AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1245,7 +1247,7 @@ case 259: { sym(1).Node = node; } break; -case 260: { +case 262: { AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1253,7 +1255,7 @@ case 260: { sym(1).Node = node; } break; -case 261: { +case 263: { AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1264,7 +1266,7 @@ case 261: { sym(1).Node = node; } break; -case 262: { +case 264: { AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1277,7 +1279,7 @@ case 262: { sym(1).Node = node; } break; -case 263: { +case 265: { AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1287,7 +1289,7 @@ case 263: { sym(1).Node = node; } break; -case 264: { +case 266: { AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1298,14 +1300,14 @@ case 264: { sym(1).Node = node; } break; -case 266: { +case 268: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 268: { +case 270: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1313,14 +1315,14 @@ case 268: { sym(1).Node = node; } break; -case 270: { +case 272: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 272: { +case 274: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1328,14 +1330,14 @@ case 272: { sym(1).Node = node; } break; -case 274: { +case 276: { AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 275: { +case 277: { AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1343,7 +1345,7 @@ case 275: { sym(1).Node = node; } break; -case 276: { +case 278: { AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1351,90 +1353,90 @@ case 276: { sym(1).Node = node; } break; -case 277: { +case 279: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 278: { +case 280: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (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 279: { +case 281: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause); } break; -case 280: { +case 282: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 281: { +case 283: { sym(1).Node = 0; } break; -case 282: { +case 284: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 283: { +case 285: { AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 284: { +case 286: { AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 285: -case 286: { +case 287: +case 288: { AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (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 287: { +case 289: { AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 289: { +case 291: { AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 290: { +case 292: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 291: { +case 293: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 292: { +case 294: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 293: { +case 295: { AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1443,20 +1445,20 @@ case 293: { sym(1).Node = node; } break; -case 294: { +case 296: { AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 296: { +case 298: { AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 297: { +case 299: { AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1467,7 +1469,7 @@ case 297: { sym(1).Node = node; } break; -case 298: { +case 300: { AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1479,56 +1481,56 @@ case 298: { sym(1).Node = node; } break; -case 299: { +case 301: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 300: { +case 302: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 301: { +case 303: { sym(1).Node = 0; } break; -case 302: { +case 304: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 303: { +case 305: { sym(1).Node = 0; } break; -case 305: { +case 307: { sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 306: { +case 308: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement); } break; -case 307: { +case 309: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 308: { +case 310: { sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement); } break; -case 309: { +case 311: { sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 310: { +case 312: { sym(1).sval = 0; } break; -case 312: { +case 314: { sym(1).Node = 0; } break; @@ -1552,10 +1554,8 @@ case 312: { yylloc.startColumn += yylloc.length; yylloc.length = 0; - const QString msg = QString::fromUtf8("Missing `;'"); - - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, - yylloc.startLine, yylloc.startColumn, msg)); + //const QString msg = QString::fromUtf8("Missing `;'"); + //diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, yylloc, msg)); first_token = &token_buffer[0]; last_token = &token_buffer[1]; @@ -1581,8 +1581,7 @@ case 312: { if (t_action(errorState, yytoken)) { const QString msg = QString::fromUtf8("Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; goto _Lcheck_token; @@ -1611,8 +1610,7 @@ case 312: { if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[*tk])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = *tk; yylval = 0; @@ -1634,8 +1632,7 @@ case 312: { int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { const QString msg = QString::fromUtf8("Expected token `%1'").arg(QLatin1String(spell[tk])); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); yytoken = tk; yylval = 0; @@ -1648,8 +1645,7 @@ case 312: { } const QString msg = QString::fromUtf8("Syntax error"); - diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, - token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); } return false; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index 497fae8..5e68fe7 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -119,10 +119,10 @@ public: enum Kind { Warning, Error }; DiagnosticMessage() - : kind(Error), line(0), column(0) {} + : kind(Error) {} - DiagnosticMessage(Kind kind, int line, int column, const QString &message) - : kind(kind), line(line), column(column), message(message) {} + DiagnosticMessage(Kind kind, const JavaScript::AST::SourceLocation &loc, const QString &message) + : kind(kind), loc(loc), message(message) {} bool isWarning() const { return kind == Warning; } @@ -131,8 +131,7 @@ public: { return kind == Error; } Kind kind; - int line; - int column; + JavaScript::AST::SourceLocation loc; QString message; }; @@ -162,10 +161,10 @@ public: { return diagnosticMessage().message; } inline int errorLineNumber() const - { return diagnosticMessage().line; } + { return diagnosticMessage().loc.startLine; } inline int errorColumnNumber() const - { return diagnosticMessage().column; } + { return diagnosticMessage().loc.startColumn; } protected: void reallocateStack(); @@ -206,9 +205,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 50 +#define J_SCRIPT_REGEXPLITERAL_RULE1 52 -#define J_SCRIPT_REGEXPLITERAL_RULE2 51 +#define J_SCRIPT_REGEXPLITERAL_RULE2 53 QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 8be0e5a..d4962ba 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -614,8 +614,8 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) QmlError error; error.setUrl(url); error.setDescription(m.message); - error.setLine(m.line); - error.setColumn(m.column); + error.setLine(m.loc.startLine); + error.setColumn(m.loc.startColumn); _errors << error; } diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 82df3bc..ca4f9c9 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -48,6 +48,7 @@ #include <private/qmlcustomparser_p.h> #include <qperformancelog.h> #include <QStack> +#include <QWidget> #include <private/qmlcompiledcomponent_p.h> #include <QColor> #include <QPointF> @@ -274,7 +275,11 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in } if (!stack.isEmpty()) { QObject *parent = stack.top(); - o->setParent(parent); + if (o->isWidgetType()) { + qobject_cast<QWidget*>(o)->setParent(qobject_cast<QWidget*>(parent)); + } else { + o->setParent(parent); + } } stack.push(o); } diff --git a/src/gui/dialogs/qabstractprintdialog.cpp b/src/gui/dialogs/qabstractprintdialog.cpp index 0dc16c9..5ed8852 100644 --- a/src/gui/dialogs/qabstractprintdialog.cpp +++ b/src/gui/dialogs/qabstractprintdialog.cpp @@ -400,7 +400,7 @@ void QAbstractPrintDialogPrivate::setPrinter(QPrinter *newPrinter) QAbstractPrintDialog::setEnabledOptions() and QAbstractPrintDialog::addEnabledOption() have no effect. - In Qt 4.4, it was possible to use the satic functions to show a sheet on + In Qt 4.4, it was possible to use the static functions to show a sheet on Mac OS X. This is no longer supported in Qt 4.5. If you want this functionality, use QPrintDialog::open(). diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 92be62f..bc9b2fa 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1966,7 +1966,7 @@ void QGraphicsItem::setOpacity(qreal opacity) itemChange(ItemOpacityHasChanged, newOpacity); // Update. - d_ptr->fullUpdateHelper(); + d_ptr->fullUpdateHelper(/*childrenOnly=*/false, /*maybeDirtyClipPath=*/false, /*ignoreOpacity=*/true); } /*! @@ -3512,10 +3512,16 @@ bool QGraphicsItem::contains(const QPointF &point) const } /*! - Returns true if this item collides with \a other; otherwise returns false. - The ways items collide is determined by \a mode. The default value for \a - mode is Qt::IntersectsItemShape; \a other collides with this item if it - either intersects, contains, or is contained by this item's shape. + + Returns true if this item collides with \a other; otherwise + returns false. + + The \a mode is applied to \a other, and the resulting shape or + bounding rectangle is then compared to this item's shape. The + default value for \a mode is Qt::IntersectsItemShape; \a other + collides with this item if it either intersects, contains, or is + contained by this item's shape (see Qt::ItemSelectionMode for + details). The default implementation is based on shape intersection, and it calls shape() on both items. Because the complexity of arbitrary shape-shape @@ -3570,6 +3576,11 @@ bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelecti Qt::IntersectsItemShape; \a path collides with this item if it either intersects, contains, or is contained by this item's shape. + Note that this function checks whether the item's shape or + bounding rectangle (depending on \a mode) is contained within \a + path, and not whether \a path is contained within the items shape + or bounding rectangle. + \sa collidesWithItem(), contains(), shape() */ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode) const @@ -3610,11 +3621,12 @@ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelection /*! Returns a list of all items that collide with this item. - The way collisions are detected is determined by \a mode. The default - value for \a mode is Qt::IntersectsItemShape; All items whose shape - intersects or is contained by this item's shape are returned. + The way collisions are detected is determined by applying \a mode + to items that are compared to this item, i.e., each item's shape + or bounding rectangle is checked against this item's shape. The + default value for \a mode is Qt::IntersectsItemShape. - \sa QGraphicsScene::collidingItems(), collidesWithItem() + \sa collidesWithItem() */ QList<QGraphicsItem *> QGraphicsItem::collidingItems(Qt::ItemSelectionMode mode) const { @@ -3898,9 +3910,8 @@ void QGraphicsItem::setBoundingRegionGranularity(qreal granularity) \internal Returns true if we can discard an update request; otherwise false. */ -bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, - bool ignoreVisibleBit, - bool ignoreDirtyBit) const +bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, bool ignoreVisibleBit, + bool ignoreDirtyBit, bool ignoreOpacity) const { // No scene, or if the scene is updating everything, means we have nothing // to do. The only exception is if the scene tracks the growing scene rect. @@ -3909,7 +3920,7 @@ bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, || !scene || (scene->d_func()->updateAll && scene->d_func()->hasSceneRect) || (!ignoreClipping && (childrenClippedToShape() && isClippedAway())) - || (childrenCombineOpacity() && isFullyTransparent()); + || (!ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); } /*! @@ -3939,11 +3950,10 @@ void QGraphicsItemPrivate::updateHelper(const QRectF &rect, bool force, bool may Propagates updates to \a item and all its children. */ -void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath) +void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath, bool ignoreOpacity) { - if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, - /*ignoreVisibleBit=*/false, - /*ignoreDirtyBit=*/true)) { + if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, /*ignoreVisibleBit=*/false, + /*ignoreDirtyBit=*/true, ignoreOpacity)) { return; } diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index bcbd737..062274f 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -175,11 +175,10 @@ public: void setPosHelper(const QPointF &pos); void setVisibleHelper(bool newVisible, bool explicitly, bool update = true); void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true); - bool discardUpdateRequest(bool ignoreClipping = false, - bool ignoreVisibleBit = false, - bool ignoreDirtyBit = false) const; + bool discardUpdateRequest(bool ignoreClipping = false, bool ignoreVisibleBit = false, + bool ignoreDirtyBit = false, bool ignoreOpacity = false) const; void updateHelper(const QRectF &rect = QRectF(), bool force = false, bool maybeDirtyClipPath = false); - void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false); + void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false, bool ignoreOpacity = false); void updateEffectiveOpacity(); void resolveEffectiveOpacity(qreal effectiveParentOpacity); void resolveDepth(int parentDepth); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 644e843..2876016 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1081,8 +1081,12 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg QList<QGraphicsItem *> itemList(scene->items()); int i = 0; while (i < itemList.size()) { + const QGraphicsItem *item = itemList.at(i); // But we only want to include items that are visible - if (!itemList.at(i)->isVisible()) + // The following check is basically the same as item->d_ptr->isInvisible(), except + // that we don't check whether the item clips children to shape or propagates its + // opacity (we loop through all items, so those checks are wrong in this context). + if (!item->isVisible() || item->d_ptr->isClippedAway() || item->d_ptr->isFullyTransparent()) itemList.removeAt(i); else ++i; diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 5de39d9..7f36be9 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -1337,6 +1337,7 @@ QByteArray QImageReader::imageFormat(QIODevice *device) \row \o TIFF \o Tagged Image File Format \row \o XBM \o X11 Bitmap \row \o XPM \o X11 Pixmap + \row \o SVG \o Scalable Vector Graphics \endtable Reading and writing SVG files is supported through Qt's diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 61f1b5b..ab03fea 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -680,10 +680,9 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto // refresh the height cache here; we don't really lose anything by getting the size hint, // since QAbstractItemView::dataChanged() will get the visualRect for the items anyway - QModelIndex top = topLeft.sibling(topLeft.row(), 0); - int topViewIndex = d->viewIndex(top); + int topViewIndex = d->viewIndex(topLeft); if (topViewIndex == 0) - d->defaultItemHeight = indexRowSizeHint(top); + d->defaultItemHeight = indexRowSizeHint(topLeft); bool sizeChanged = false; if (topViewIndex != -1) { if (topLeft == bottomRight) { @@ -691,8 +690,7 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto d->invalidateHeightCache(topViewIndex); sizeChanged = (oldHeight != d->itemHeight(topViewIndex)); } else { - QModelIndex bottom = bottomRight.sibling(bottomRight.row(), 0); - int bottomViewIndex = d->viewIndex(bottom); + int bottomViewIndex = d->viewIndex(bottomRight); for (int i = topViewIndex; i <= bottomViewIndex; ++i) { int oldHeight = d->itemHeight(i); d->invalidateHeightCache(i); @@ -1815,10 +1813,10 @@ void QTreeView::mouseDoubleClickEvent(QMouseEvent *event) if (i == -1) return; // user clicked outside the items - const QModelIndex &index = d->viewItems.at(i).index; + const QPersistentModelIndex firstColumnIndex = d->viewItems.at(i).index; int column = d->header->logicalIndexAt(event->x()); - QPersistentModelIndex persistent = index.sibling(index.row(), column); + QPersistentModelIndex persistent = firstColumnIndex.sibling(firstColumnIndex.row(), column); if (d->pressedIndex != persistent) { mousePressEvent(event); @@ -1841,10 +1839,10 @@ void QTreeView::mouseDoubleClickEvent(QMouseEvent *event) if (d->itemsExpandable && d->expandsOnDoubleClick && d->hasVisibleChildren(persistent)) { - if (!((i < d->viewItems.count()) && (d->viewItems.at(i).index == persistent))) { + if (!((i < d->viewItems.count()) && (d->viewItems.at(i).index == firstColumnIndex))) { // find the new index of the item for (i = 0; i < d->viewItems.count(); ++i) { - if (d->viewItems.at(i).index == persistent) + if (d->viewItems.at(i).index == firstColumnIndex) break; } if (i == d->viewItems.count()) @@ -2422,14 +2420,10 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end) ? d->viewItems.count() : d->viewItems.at(parentItem).total) - 1; - int firstColumn = 0; - while (isColumnHidden(firstColumn) && firstColumn < header()->count() - 1) - ++firstColumn; - const int delta = end - start + 1; QVector<QTreeViewItem> insertedItems(delta); for (int i = 0; i < delta; ++i) { - insertedItems[i].index = d->model->index(i + start, firstColumn, parent); + insertedItems[i].index = d->model->index(i + start, 0, parent); insertedItems[i].level = childLevel; } if (d->viewItems.isEmpty()) @@ -2612,7 +2606,7 @@ void QTreeView::expandAll() d->viewItems[i].expanded = true; d->layout(i); QModelIndex idx = d->viewItems.at(i).index; - d->expandedIndexes.insert(idx.sibling(idx.row(), 0)); + d->expandedIndexes.insert(idx); } updateGeometries(); d->viewport->update(); @@ -3130,13 +3124,9 @@ void QTreeViewPrivate::layout(int i) int last = 0; int children = 0; - int firstColumn = 0; - while (header->isSectionHidden(firstColumn) && firstColumn < header->count()) - ++firstColumn; - for (int j = first; j < first + count; ++j) { - current = model->index(j - first, firstColumn, parent); - if (isRowHidden(current.sibling(current.row(), 0))) { + current = model->index(j - first, 0, parent); + if (isRowHidden(current)) { ++hidden; last = j - hidden + children; } else { @@ -3319,15 +3309,11 @@ int QTreeViewPrivate::itemAtCoordinate(int coordinate) const int QTreeViewPrivate::viewIndex(const QModelIndex &_index) const { - Q_Q(const QTreeView); if (!_index.isValid() || viewItems.isEmpty()) return -1; const int totalCount = viewItems.count(); - int firstColumn = 0; - while (q->isColumnHidden(firstColumn) && firstColumn < header->count()) - ++firstColumn; - const QModelIndex index = _index.sibling(_index.row(), firstColumn); + const QModelIndex index = _index.sibling(_index.row(), 0); // A quick check near the last item to see if we are just incrementing diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 60ac062..1cbc960 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -199,6 +199,7 @@ extern "C" { composingText = new QString(); composing = false; sendKeyEvents = true; + currentCustomTypes = 0; [self setHidden:YES]; return self; } @@ -213,10 +214,16 @@ extern "C" { object:self]; } --(void)registerDragTypes:(bool)accept +-(void)registerDragTypes { QMacCocoaAutoReleasePool pool; - if (accept) { + // Calling registerForDraggedTypes is slow, so only do it once for each widget + // or when the custom types change. + const QStringList& customTypes = qEnabledDraggedTypes(); + if (currentCustomTypes == 0 || *currentCustomTypes != customTypes) { + if (currentCustomTypes == 0) + currentCustomTypes = new QStringList(); + *currentCustomTypes = customTypes; const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, NSFilenamesPboardType, NSStringPboardType, @@ -228,13 +235,10 @@ extern "C" { NSFilesPromisePboardType, NSInkTextPboardType, NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; // Add custom types supported by the application. - const QStringList& customTypes = qEnabledDraggedTypes(); for (int i = 0; i < customTypes.size(); i++) { [supportedTypes addObject:reinterpret_cast<const NSString *>(QCFString::toCFStringRef(customTypes[i]))]; } [self registerForDraggedTypes:supportedTypes]; - } else { - [self unregisterDraggedTypes]; } } @@ -283,6 +287,8 @@ extern "C" { - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { + if (qwidget->testAttribute(Qt::WA_DropSiteRegistered) == false) + return NSDragOperationNone; [self addDropData:sender]; QMimeData *mimeData = dropData; if (QDragManager::self()->source()) @@ -416,6 +422,8 @@ extern "C" { { delete composingText; [[NSNotificationCenter defaultCenter] removeObserver:self]; + delete currentCustomTypes; + [self unregisterDraggedTypes]; [super dealloc]; } diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index ec1281e..1d4e3e4 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -84,6 +84,7 @@ Q_GUI_EXPORT int composingLength; bool sendKeyEvents; QString *composingText; + QStringList *currentCustomTypes; } - (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; - (void) finishInitWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; @@ -92,7 +93,7 @@ Q_GUI_EXPORT - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender; - (void)draggingExited:(id < NSDraggingInfo >)sender; - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender; -- (void)registerDragTypes:(bool)accept; +- (void)registerDragTypes; - (void)removeDropData; - (void)addDropData:(id <NSDraggingInfo>)sender; - (void)setSupportedActions:(NSDragOperation)actions; diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp index e2d6108..a665c89 100644 --- a/src/gui/kernel/qformlayout.cpp +++ b/src/gui/kernel/qformlayout.cpp @@ -689,12 +689,16 @@ void QFormLayoutPrivate::setupVerticalLayoutData(int width) // are split. maxLabelWidth = 0; if (!wrapAllRows) { + int maxFieldMinWidth = 0; //the maximum minimum size of the field for (int i = 0; i < rr; ++i) { const QFormLayoutItem *label = m_matrix(i, 0); const QFormLayoutItem *field = m_matrix(i, 1); - if (label && (label->sizeHint.width() + (field ? field->minSize.width() : 0) <= width)) + if (label && field && label->sideBySide) maxLabelWidth = qMax(maxLabelWidth, label->sizeHint.width()); + if (field) + maxFieldMinWidth = qMax(maxFieldMinWidth, field->minSize.width() + field->sbsHSpace); } + maxLabelWidth = qMin(maxLabelWidth, width - maxFieldMinWidth); } else { maxLabelWidth = width; } diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index f000292..9165836 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -826,13 +826,28 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev QWidget *qwidget = [theView qt_qwidget]; QWidget *widgetToGetMouse = qwidget; QWidget *popup = qAppInstance()->activePopupWidget(); - if (popup && popup != qwidget->window()) - widgetToGetMouse = popup; NSView *tmpView = theView; - if (widgetToGetMouse != qwidget) { - tmpView = qt_mac_nativeview_for(widgetToGetMouse); + + if (popup && popup != qwidget->window()) { + widgetToGetMouse = popup; + tmpView = qt_mac_nativeview_for(popup); windowPoint = [[tmpView window] convertScreenToBase:globalPoint]; + + QPoint qWindowPoint(windowPoint.x, windowPoint.y); + if (widgetToGetMouse->rect().contains(qWindowPoint)) { + // Keeping the mouse pressed on a combobox button will make + // the popup pop in front of the mouse. But all mouse events + // will be sendt to the button. Since we want mouse events + // to be sendt to widgets inside the popup, we search for the + // widget in front of the mouse: + tmpView = [tmpView hitTest:windowPoint]; + if (!tmpView) + return false; + widgetToGetMouse = + [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(tmpView) qt_qwidget]; + } } + NSPoint localPoint = [tmpView convertPoint:windowPoint fromView:nil]; QPoint qlocalPoint(localPoint.x, localPoint.y); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index dd95053..cbf9585 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4810,7 +4810,7 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, Q_ASSERT(engine); QPaintEnginePrivate *enginePriv = engine->d_func(); Q_ASSERT(enginePriv); - QPaintDevice *target = painter->worldMatrixEnabled() ? engine->paintDevice() : painter->device(); + QPaintDevice *target = engine->paintDevice(); Q_ASSERT(target); // Render via a pixmap when dealing with non-opaque painters or printers. diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 9da0b6b..1896b97 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4491,8 +4491,8 @@ void QWidgetPrivate::registerDropSite(bool on) SetControlDragTrackingEnabled(qt_mac_nativeview_for(q), on); #else NSView *view = qt_mac_nativeview_for(q); - if ([view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { - [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes:on]; + if (on && [view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { + [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes]; } #endif } diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp index 6329135..ae93efe 100644 --- a/src/gui/kernel/qx11embed_x11.cpp +++ b/src/gui/kernel/qx11embed_x11.cpp @@ -1297,9 +1297,6 @@ bool QX11EmbedContainer::eventFilter(QObject *o, QEvent *event) // focus is set to our focus proxy. We want to intercept all // keypresses. if (o == window() && d->client) { - if (!d->isEmbedded() && d->activeContainer == this) - d->moveInputToProxy(); - if (d->clientIsXEmbed) { sendXEmbedMessage(d->client, x11Info().display(), XEMBED_WINDOW_ACTIVATE); } else { @@ -1307,6 +1304,8 @@ bool QX11EmbedContainer::eventFilter(QObject *o, QEvent *event) if (hasFocus()) XSetInputFocus(x11Info().display(), d->client, XRevertToParent, x11Time()); } + if (!d->isEmbedded()) + d->moveInputToProxy(); } break; case QEvent::WindowDeactivate: @@ -1729,10 +1728,10 @@ void QX11EmbedContainerPrivate::acceptClient(WId window) checkGrab(); if (q->hasFocus()) { XSetInputFocus(q->x11Info().display(), client, XRevertToParent, x11Time()); - } else { - if (!isEmbedded()) - moveInputToProxy(); } + } else { + if (!isEmbedded()) + moveInputToProxy(); } emit q->clientIsEmbedded(); @@ -1749,11 +1748,9 @@ void QX11EmbedContainerPrivate::acceptClient(WId window) void QX11EmbedContainerPrivate::moveInputToProxy() { Q_Q(QX11EmbedContainer); - WId focus; - int revert_to; - XGetInputFocus(q->x11Info().display(), &focus, &revert_to); - if (focus != focusProxy->internalWinId()) - XSetInputFocus(q->x11Info().display(), focusProxy->internalWinId(), XRevertToParent, x11Time()); + // Following Owen Taylor's advice from the XEmbed specification to + // always use CurrentTime when no explicit user action is involved. + XSetInputFocus(q->x11Info().display(), focusProxy->internalWinId(), XRevertToParent, CurrentTime); } /*! \internal diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index 16dd617..8f4a2bf 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -44,8 +44,6 @@ QT_BEGIN_NAMESPACE -static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; - struct SourceOnlyAlpha { inline uchar alpha(uchar src) const { return src; } @@ -140,14 +138,11 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha { template <typename SRC, typename T> void qt_scale_image_16bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); @@ -617,14 +612,11 @@ struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha { template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 8077b9b..3428faf 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2577,7 +2577,11 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe QRasterPaintEngineState *s = state(); const bool aa = s->flags.antialiased || s->flags.bilinear; if (!aa && sr.size() == QSize(1, 1)) { - fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + // as fillRect will apply the aliased coordinate delta we need to + // subtract it here as we don't use it for image drawing + const QRectF targetRect = r.translated(-aliasedCoordinateDelta, + -aliasedCoordinateDelta); + fillRect(targetRect, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); return; } diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 4b2fbca..9cc9683 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1543,6 +1543,8 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p QX11PaintEnginePrivate::GCMode gcMode, QPaintEngine::PolygonDrawMode mode) { + Q_Q(QX11PaintEngine); + int clippedCount = 0; qt_float_point *clippedPoints = 0; @@ -1617,7 +1619,29 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p } else #endif if (fill.style() != Qt::NoBrush) { - if (clippedCount > 0) { + if (clippedCount > 200000) { + QPolygon poly; + for (int i = 0; i < clippedCount; ++i) + poly << QPoint(qFloor(clippedPoints[i].x), qFloor(clippedPoints[i].y)); + + const QRect bounds = poly.boundingRect(); + const QRect aligned = bounds + & QRect(QPoint(), QSize(pdev->width(), pdev->height())); + + QImage img(aligned.size(), QImage::Format_ARGB32_Premultiplied); + img.fill(0); + + QPainter painter(&img); + painter.translate(-aligned.x(), -aligned.y()); + painter.setPen(Qt::NoPen); + painter.setBrush(fill); + if (gcMode == BrushGC) + painter.setBrushOrigin(q->painter()->brushOrigin()); + painter.drawPolygon(poly); + painter.end(); + + q->drawImage(aligned, img, img.rect(), Qt::AutoColor); + } else if (clippedCount > 0) { QVarLengthArray<XPoint> xpoints(clippedCount); for (int i = 0; i < clippedCount; ++i) { xpoints[i].x = qFloor(clippedPoints[i].x); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index ebddfd5..dcc11b8 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4758,7 +4758,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op case CT_LineEdit: #ifndef QT_NO_SPINBOX // ### hopelessly broken QAbstractSpinBox (part 2) - if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w->parentWidget())) { + if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0)) { QRenderRule rule = renderRule(spinBox, opt); if (rule.hasBox() || !rule.hasNativeBorder()) return csz; diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 47fe5c2..d7a9c23 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -624,6 +624,45 @@ QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int /* margin */, const Q return rgbMask; } +QImage QFontEngine::alphaMapForGlyph(glyph_t glyph) +{ + glyph_metrics_t gm = boundingBox(glyph); + int glyph_x = qFloor(gm.x.toReal()); + int glyph_y = qFloor(gm.y.toReal()); + int glyph_width = qCeil((gm.x + gm.width).toReal()) - glyph_x; + int glyph_height = qCeil((gm.y + gm.height).toReal()) - glyph_y; + + if (glyph_width <= 0 || glyph_height <= 0) + return QImage(); + QFixedPoint pt; + pt.x = 0; + pt.y = -glyph_y; // the baseline + QPainterPath path; + QImage im(glyph_width + qAbs(glyph_x) + 4, glyph_height, QImage::Format_ARGB32_Premultiplied); + im.fill(Qt::transparent); + QPainter p(&im); + p.setRenderHint(QPainter::Antialiasing); + addGlyphsToPath(&glyph, &pt, 1, &path, 0); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawPath(path); + p.end(); + + QImage indexed(im.width(), im.height(), QImage::Format_Indexed8); + QVector<QRgb> colors(256); + for (int i=0; i<256; ++i) + colors[i] = qRgba(0, 0, 0, i); + indexed.setColorTable(colors); + + for (int y=0; y<im.height(); ++y) { + uchar *dst = (uchar *) indexed.scanLine(y); + uint *src = (uint *) im.scanLine(y); + for (int x=0; x<im.width(); ++x) + dst[x] = qAlpha(src[x]); + } + + return indexed; +} void QFontEngine::removeGlyphFromCache(glyph_t) { diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index cb0b436..de03a3c 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1788,9 +1788,11 @@ QImage QFontEngineFT::alphaMapForGlyph(glyph_t g) GlyphFormat glyph_format = antialias ? Format_A8 : Format_Mono; - Glyph *glyph = loadGlyph(g, glyph_format); - if (!glyph) - return QImage(); + Glyph *glyph = defaultGlyphSet.outline_drawing ? 0 : loadGlyph(g, glyph_format); + if (!glyph) { + unlockFace(); + return QFontEngine::alphaMapForGlyph(g); + } const int pitch = antialias ? (glyph->width + 3) & ~3 : ((glyph->width + 31)/32) * 4; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 8f6b92a..92efb6c 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -178,7 +178,7 @@ public: * Create a qimage with the alpha values for the glyph. * Returns an image indexed_8 with index values ranging from 0=fully transparant to 255=opaque */ - virtual QImage alphaMapForGlyph(glyph_t) = 0; + virtual QImage alphaMapForGlyph(glyph_t); virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t); virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index c327b9f..48963bb 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1074,7 +1074,10 @@ QTextCursor::QTextCursor(const QTextCursor &cursor) } /*! - Makes a copy of \a cursor and assigns it to this QTextCursor. + Makes a copy of \a cursor and assigns it to this QTextCursor. Note + that QTextCursor is an \l{Implicitly Shared Classes}{implicitly + shared} class. + */ QTextCursor &QTextCursor::operator=(const QTextCursor &cursor) { diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index e84b324..873f846 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -287,7 +287,7 @@ QTextCodec *Qt::codecForHtml(const QByteArray &ba) that inform connected editor widgets about the state of the undo/redo system. - \sa QTextCursor QTextEdit \link richtext.html Rich Text Processing\endlink + \sa QTextCursor, QTextEdit, \link richtext.html Rich Text Processing\endlink , {Text Object Example} */ /*! diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index 3f4c8e5..71b68e0 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE objects, you will also need to reimplement QTextDocument::createObject() which acts as a factory method for creating text objects. - \sa QTextDocument + \sa QTextDocument, {Text Object Example} */ /*! diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 1afb28a..502c1e9 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -480,9 +480,6 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) oldMenuBar->hide(); oldMenuBar->deleteLater(); } -#ifdef Q_WS_WINCE - if (menuBar && menuBar->size().height() > 0) -#endif d->layout->setMenuBar(menuBar); } diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index a51ed2d..14efd23 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -629,7 +629,7 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx) if (viewport->updatesEnabled() && viewport->isVisible()) { int dy = 0; - if (doc->findBlockByLineNumber(control->topBlock).isValid()) { + if (doc->findBlockByNumber(control->topBlock).isValid()) { dy = (int)(-q->blockBoundingGeometry(block).y()) + verticalOffset() - verticalOffset(blockNumber, lineNumber); } diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index ce1ac09..0b4ce9d 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1084,7 +1084,7 @@ void QTabBar::setTabData(int index, const QVariant & data) } /*! - Returns the datad of the tab at position \a index, or a null + Returns the data of the tab at position \a index, or a null variant if \a index is out of range. */ QVariant QTabBar::tabData(int index) const @@ -2223,6 +2223,7 @@ void QTabBar::setTabButton(int index, ButtonPosition position, QWidget *widget) d->tabList[index].rightWidget = widget; } d->layoutTabs(); + d->refresh(); update(); } diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 14a04f1..d42370d 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -193,7 +193,11 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData) } else { QString templateName = d->tmpCacheFileName(); cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data); - cacheItem->file->open(); + if (!cacheItem->file->open()) { + qWarning() << "QNetworkDiskCache::prepare() unable to open temporary file"; + delete cacheItem; + return 0; + } cacheItem->writeHeader(cacheItem->file); device = cacheItem->file; } @@ -231,7 +235,7 @@ void QNetworkDiskCachePrivate::storeItem(QCacheItem *cacheItem) if (QFile::exists(fileName)) { if (!QFile::remove(fileName)) { - qWarning() << "QNetworkDiskCache: could't remove the cache file " << fileName; + qWarning() << "QNetworkDiskCache: couldn't remove the cache file " << fileName; return; } } diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp index d6b1507..77a999b 100644 --- a/src/network/socket/qlocalserver.cpp +++ b/src/network/socket/qlocalserver.cpp @@ -276,9 +276,13 @@ QLocalSocket *QLocalServer::nextPendingConnection() if (d->pendingConnections.isEmpty()) return 0; QLocalSocket *nextSocket = d->pendingConnections.dequeue(); +#ifndef QT_LOCALSOCKET_TCP + if (d->pendingConnections.size() <= d->maxPendingConnections) #ifndef Q_OS_WIN - d->socketNotifier->setEnabled(d->pendingConnections.size() - <= d->maxPendingConnections); + d->socketNotifier->setEnabled(true); +#else + d->connectionEventNotifier->setEnabled(true); +#endif #endif return nextSocket; } diff --git a/src/network/socket/qlocalserver.h b/src/network/socket/qlocalserver.h index 8e8babd..1488a75 100644 --- a/src/network/socket/qlocalserver.h +++ b/src/network/socket/qlocalserver.h @@ -86,15 +86,7 @@ protected: private: Q_DISABLE_COPY(QLocalServer) -#if defined(QT_LOCALSOCKET_TCP) Q_PRIVATE_SLOT(d_func(), void _q_onNewConnection()) -#elif defined(Q_OS_WIN) - Q_PRIVATE_SLOT(d_func(), void _q_openSocket(HANDLE handle)) - Q_PRIVATE_SLOT(d_func(), void _q_stoppedListening()) - Q_PRIVATE_SLOT(d_func(), void _q_setError(QAbstractSocket::SocketError error, const QString &errorString)) -#else - Q_PRIVATE_SLOT(d_func(), void _q_socketActivated()) -#endif }; #endif // QT_NO_LOCALSERVER diff --git a/src/network/socket/qlocalserver_p.h b/src/network/socket/qlocalserver_p.h index 8e96401..7b31082 100644 --- a/src/network/socket/qlocalserver_p.h +++ b/src/network/socket/qlocalserver_p.h @@ -63,7 +63,7 @@ # include <qtcpserver.h> #elif defined(Q_OS_WIN) # include <qt_windows.h> -# include <qthread.h> +# include <private/qwineventnotifier_p.h> #else # include <private/qnativesocketengine_p.h> # include <qsocketnotifier.h> @@ -71,52 +71,13 @@ QT_BEGIN_NAMESPACE -#if defined(Q_OS_WIN) && !defined(QT_LOCALSOCKET_TCP) - -/*! - \internal - QLocalServerThread exists because Windows does not have a - way to provide notifications when there is a new connections to - the server. - */ -class QLocalServerThread : public QThread -{ - Q_OBJECT - -Q_SIGNALS: - void connected(HANDLE newSocket); - void error(QAbstractSocket::SocketError error, const QString &errorString); - -public: - QLocalServerThread(QObject *parent = 0); - ~QLocalServerThread(); - void closeServer(); - -public: - QString setName(const QString &name); - void run(); - void stop(); - bool makeHandle(); - - HANDLE gotConnectionEvent; - QQueue<HANDLE> pendingHandles; - int maxPendingConnections; -private: - HANDLE stopEvent; - QString fullServerName; -}; - -#endif - class QLocalServerPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QLocalServer) public: QLocalServerPrivate() : -#if defined(Q_OS_WIN) && !defined(QT_LOCALSOCKET_TCP) - inWaitingFunction(false), -#elif !defined(QT_LOCALSOCKET_TCP) +#if !defined(QT_LOCALSOCKET_TCP) && !defined(Q_OS_WIN) listenSocket(-1), socketNotifier(0), #endif maxPendingConnections(30), error(QAbstractSocket::UnknownSocketError) @@ -128,22 +89,26 @@ public: static bool removeServer(const QString &name); void closeServer(); void waitForNewConnection(int msec, bool *timedOut); + void _q_onNewConnection(); #if defined(QT_LOCALSOCKET_TCP) - void _q_onNewConnection(); QTcpServer tcpServer; QMap<quintptr, QTcpSocket*> socketMap; #elif defined(Q_OS_WIN) - void _q_openSocket(HANDLE socket); - void _q_stoppedListening(); - void _q_setError(QAbstractSocket::SocketError error, const QString &errorString); + struct Listener { + HANDLE handle; + OVERLAPPED overlapped; + }; + + void setError(const QString &function); + bool addListener(); - QLocalServerThread waitForConnection; - bool inWaitingFunction; + QList<Listener> listeners; + HANDLE eventHandle; + QWinEventNotifier *connectionEventNotifier; #else void setError(const QString &function); - void _q_socketActivated(); int listenSocket; QSocketNotifier *socketNotifier; diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp index e7d2252..53ee6b6 100644 --- a/src/network/socket/qlocalserver_unix.cpp +++ b/src/network/socket/qlocalserver_unix.cpp @@ -132,7 +132,7 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName) socketNotifier = new QSocketNotifier(listenSocket, QSocketNotifier::Read, q); q->connect(socketNotifier, SIGNAL(activated(int)), - q, SLOT(_q_socketActivated())); + q, SLOT(_q_onNewConnection())); socketNotifier->setEnabled(maxPendingConnections > 0); return true; } @@ -164,7 +164,7 @@ void QLocalServerPrivate::closeServer() We have received a notification that we can read on the listen socket. Accept the new socket. */ -void QLocalServerPrivate::_q_socketActivated() +void QLocalServerPrivate::_q_onNewConnection() { Q_Q(QLocalServer); if (-1 == listenSocket) @@ -209,7 +209,7 @@ void QLocalServerPrivate::waitForNewConnection(int msec, bool *timedOut) break; } if (result > 0) - _q_socketActivated(); + _q_onNewConnection(); } if (timedOut) *timedOut = (result == 0); diff --git a/src/network/socket/qlocalserver_win.cpp b/src/network/socket/qlocalserver_win.cpp index 880cd7e..b14bbf7 100644 --- a/src/network/socket/qlocalserver_win.cpp +++ b/src/network/socket/qlocalserver_win.cpp @@ -44,68 +44,26 @@ #include "qlocalsocket.h" #include <qdebug.h> -#include <qdatetime.h> -#include <qcoreapplication.h> -#include <QMetaType> // The buffer size need to be 0 otherwise data could be // lost if the socket that has written data closes the connection // before it is read. Pipewriter is used for write buffering. #define BUFSIZE 0 -QT_BEGIN_NAMESPACE - -QLocalServerThread::QLocalServerThread(QObject *parent) : QThread(parent), - maxPendingConnections(1) -{ - stopEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - gotConnectionEvent = CreateEvent(NULL, TRUE, FALSE, NULL); -} +// ###: This should be a property. Should replace the insane 50 on unix as well. +#define SYSTEM_MAX_PENDING_SOCKETS 8 -QLocalServerThread::~QLocalServerThread() -{ - stop(); - closeServer(); - CloseHandle(stopEvent); - CloseHandle(gotConnectionEvent); -} - -void QLocalServerThread::stop() -{ - if (isRunning()) { - SetEvent(stopEvent); - wait(); - ResetEvent(stopEvent); - } -} - -void QLocalServerThread::closeServer() -{ - while (!pendingHandles.isEmpty()) - CloseHandle(pendingHandles.dequeue()); -} - -QString QLocalServerThread::setName(const QString &name) -{ - QString pipePath = QLatin1String("\\\\.\\pipe\\"); - if (name.startsWith(pipePath)) - fullServerName = name; - else - fullServerName = pipePath + name; - for (int i = pendingHandles.count(); i < maxPendingConnections; ++i) - if (!makeHandle()) - break; - return fullServerName; -} +QT_BEGIN_NAMESPACE -bool QLocalServerThread::makeHandle() +bool QLocalServerPrivate::addListener() { - if (pendingHandles.count() >= maxPendingConnections) - return false; + // The object must not change its address once the + // contained OVERLAPPED struct is passed to Windows. + listeners << Listener(); + Listener &listener = listeners.last(); - HANDLE handle = INVALID_HANDLE_VALUE; QT_WA({ - handle = CreateNamedPipeW( + listener.handle = CreateNamedPipeW( (TCHAR*)fullServerName.utf16(), // pipe name PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access PIPE_TYPE_MESSAGE | // message type pipe @@ -117,7 +75,7 @@ bool QLocalServerThread::makeHandle() 3000, // client time-out NULL); }, { - handle = CreateNamedPipeA( + listener.handle = CreateNamedPipeA( fullServerName.toLocal8Bit().constData(), // pipe name PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, // read/write access PIPE_TYPE_MESSAGE | // message type pipe @@ -129,68 +87,43 @@ bool QLocalServerThread::makeHandle() 3000, // client time-out NULL); }); - - if (INVALID_HANDLE_VALUE == handle) { + if (listener.handle == INVALID_HANDLE_VALUE) { + setError(QLatin1String("QLocalServerPrivate::addListener")); + listeners.removeLast(); return false; } - pendingHandles.enqueue(handle); + + memset(&listener.overlapped, 0, sizeof(listener.overlapped)); + listener.overlapped.hEvent = eventHandle; + if (!ConnectNamedPipe(listener.handle, &listener.overlapped)) { + switch (GetLastError()) { + case ERROR_IO_PENDING: + break; + case ERROR_PIPE_CONNECTED: + SetEvent(eventHandle); + break; + default: + CloseHandle(listener.handle); + setError(QLatin1String("QLocalServerPrivate::addListener")); + listeners.removeLast(); + return false; + } + } else { + Q_ASSERT_X(false, "QLocalServerPrivate::addListener", "The impossible happened"); + SetEvent(eventHandle); + } return true; } -void QLocalServerThread::run() +void QLocalServerPrivate::setError(const QString &function) { - OVERLAPPED op; - HANDLE handleArray[2]; - memset(&op, 0, sizeof(op)); - handleArray[0] = op.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - handleArray[1] = stopEvent; - HANDLE handle = INVALID_HANDLE_VALUE; - - forever { - if (INVALID_HANDLE_VALUE == handle) { - makeHandle(); - if (!pendingHandles.isEmpty()) - handle = pendingHandles.dequeue(); - } - if (INVALID_HANDLE_VALUE == handle) { - int windowsError = GetLastError(); - QString function = QLatin1String("QLocalServer::run"); - QString errorString = QLocalServer::tr("%1: Unknown error %2").arg(function).arg(windowsError); - emit error(QAbstractSocket::UnknownSocketError, errorString); - CloseHandle(handleArray[0]); - SetEvent(gotConnectionEvent); - return; - } - - BOOL isConnected = ConnectNamedPipe(handle, &op) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); - if (!isConnected) { - switch (WaitForMultipleObjects(2, handleArray, FALSE, INFINITE)) - { - case WAIT_OBJECT_0 + 1: - CloseHandle(handle); - CloseHandle(handleArray[0]); - return; - } - } - emit connected(handle); - handle = INVALID_HANDLE_VALUE; - ResetEvent(handleArray[0]); - SetEvent(gotConnectionEvent); - } + int windowsError = GetLastError(); + errorString = QString::fromLatin1("%1: %2").arg(function).arg(qt_error_string(windowsError)); + error = QAbstractSocket::UnknownSocketError; } void QLocalServerPrivate::init() { - Q_Q(QLocalServer); - qRegisterMetaType<HANDLE>("HANDLE"); - q->connect(&waitForConnection, SIGNAL(connected(HANDLE)), - q, SLOT(_q_openSocket(HANDLE)), Qt::QueuedConnection); - q->connect(&waitForConnection, SIGNAL(finished()), - q, SLOT(_q_stoppedListening()), Qt::QueuedConnection); - q->connect(&waitForConnection, SIGNAL(terminated()), - q, SLOT(_q_stoppedListening()), Qt::QueuedConnection); - q->connect(&waitForConnection, SIGNAL(error(QAbstractSocket::SocketError, const QString &)), - q, SLOT(_q_setError(QAbstractSocket::SocketError, const QString &))); } bool QLocalServerPrivate::removeServer(const QString &name) @@ -201,35 +134,71 @@ bool QLocalServerPrivate::removeServer(const QString &name) bool QLocalServerPrivate::listen(const QString &name) { - fullServerName = waitForConnection.setName(name); - serverName = name; - waitForConnection.start(); - return true; -} + Q_Q(QLocalServer); -void QLocalServerPrivate::_q_setError(QAbstractSocket::SocketError e, const QString &eString) -{ - error = e; - errorString = eString; -} + QString pipePath = QLatin1String("\\\\.\\pipe\\"); + if (name.startsWith(pipePath)) + fullServerName = name; + else + fullServerName = pipePath + name; -void QLocalServerPrivate::_q_stoppedListening() -{ - Q_Q(QLocalServer); - if (!inWaitingFunction) - q->close(); + // Use only one event for all listeners of one socket. + // The idea is that listener events are rare, so polling all listeners once in a while is + // cheap compared to waiting for N additional events in each iteration of the main loop. + eventHandle = CreateEvent(NULL, TRUE, FALSE, NULL); + connectionEventNotifier = new QWinEventNotifier(eventHandle , q); + q->connect(connectionEventNotifier, SIGNAL(activated(HANDLE)), q, SLOT(_q_onNewConnection())); + + for (int i = 0; i < SYSTEM_MAX_PENDING_SOCKETS; ++i) + if (!addListener()) + return false; + return true; } -void QLocalServerPrivate::_q_openSocket(HANDLE handle) +void QLocalServerPrivate::_q_onNewConnection() { Q_Q(QLocalServer); - q->incomingConnection((int)handle); + DWORD dummy; + + // Reset first, otherwise we could reset an event which was asserted + // immediately after we checked the conn status. + ResetEvent(eventHandle); + + // Testing shows that there is indeed absolutely no guarantee which listener gets + // a client connection first, so there is no way around polling all of them. + for (int i = 0; i < listeners.size(); ) { + HANDLE handle = listeners[i].handle; + if (GetOverlappedResult(handle, &listeners[i].overlapped, &dummy, FALSE)) { + listeners.removeAt(i); + + addListener(); + + if (pendingConnections.size() > maxPendingConnections) + connectionEventNotifier->setEnabled(false); + + // Make this the last thing so connected slots can wreak the least havoc + q->incomingConnection((quintptr)handle); + } else { + if (GetLastError() != ERROR_IO_INCOMPLETE) { + setError(QLatin1String("QLocalServerPrivate::_q_onNewConnection")); + closeServer(); + return; + } + + ++i; + } + } } void QLocalServerPrivate::closeServer() { - waitForConnection.stop(); - waitForConnection.closeServer(); + connectionEventNotifier->setEnabled(false); // Otherwise, closed handle is checked before deleter runs + connectionEventNotifier->deleteLater(); + connectionEventNotifier = 0; + CloseHandle(eventHandle); + for (int i = 0; i < listeners.size(); ++i) + CloseHandle(listeners[i].handle); + listeners.clear(); } void QLocalServerPrivate::waitForNewConnection(int msecs, bool *timedOut) @@ -238,14 +207,12 @@ void QLocalServerPrivate::waitForNewConnection(int msecs, bool *timedOut) if (!pendingConnections.isEmpty() || !q->isListening()) return; - DWORD result = WaitForSingleObject(waitForConnection.gotConnectionEvent, - (msecs == -1) ? INFINITE : msecs); + DWORD result = WaitForSingleObject(eventHandle, (msecs == -1) ? INFINITE : msecs); if (result == WAIT_TIMEOUT) { if (timedOut) *timedOut = true; } else { - ResetEvent(waitForConnection.gotConnectionEvent); - QCoreApplication::instance()->processEvents(); + _q_onNewConnection(); } } diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index 505c662..7fec2df 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -64,9 +64,9 @@ #ifndef QT_NO_DEBUG_STREAM #include <QtCore/qdebug.h> +#endif QT_BEGIN_NAMESPACE -#endif /*! Constructs an empty QSslCipher object. diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index cc91e55..d74b930 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ @@ -19,7 +49,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) /*! \class QGLShaderProgram @@ -231,7 +261,7 @@ public: bool compiled; bool isPartial; bool hasPartialSource; - QString errors; + QString log; QByteArray partialSource; bool create(); @@ -279,12 +309,12 @@ bool QGLShaderPrivate::compile() value = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &value); if (!compiled && value > 1) { - char *log = new char [value]; + char *logbuf = new char [value]; GLint len; - glGetShaderInfoLog(shader, value, &len, log); - errors = QString::fromLatin1(log); - qWarning() << "QGLShader::compile:" << errors; - delete [] log; + glGetShaderInfoLog(shader, value, &len, logbuf); + log = QString::fromLatin1(logbuf); + qWarning() << "QGLShader::compile:" << log; + delete [] logbuf; } return compiled; } @@ -543,9 +573,6 @@ bool QGLShader::setSourceCode(const QString& source) */ bool QGLShader::setSourceCodeFile(const QString& fileName) { - if (!d->shader) - return false; - QFile file(fileName); if (!file.open(QFile::ReadOnly)) { qWarning() << "QGLShader: Unable to open file" << fileName; @@ -669,13 +696,13 @@ bool QGLShader::isCompiled() const } /*! - Returns the errors that occurred during the last compile. + Returns the errors and warnings that occurred during the last compile. \sa setSourceCode() */ -QString QGLShader::errors() const +QString QGLShader::log() const { - return d->errors; + return d->log; } /*! @@ -719,7 +746,7 @@ public: bool linked; bool inited; bool hasPartialShaders; - QString errors; + QString log; QList<QGLShader *> shaders; QList<QGLShader *> anonShaders; QGLShader *vertexShader; @@ -819,13 +846,16 @@ bool QGLShaderProgram::addShader(QGLShader *shader) return false; if (d->shaders.contains(shader)) return true; // Already added to this shader program. - if (d->program && shader && shader->d->shader) { + if (d->program && shader) { if (!shader->d->compiled) return false; - if (!shader->d->isPartial) + if (!shader->d->isPartial) { + if (!shader->d->shader) + return false; glAttachShader(d->program, shader->d->shader); - else + } else { d->hasPartialShaders = true; + } d->linked = false; // Program needs to be relinked. d->shaders.append(shader); return true; @@ -838,13 +868,13 @@ bool QGLShaderProgram::addShader(QGLShader *shader) Compiles \a source as a shader of the specified \a type and adds it to this shader program. Returns true if compilation was successful, false otherwise. The compilation errors - will be made available via errors(). + and warnings will be made available via log(). This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance of QGLShader first. - \sa removeShader(), link(), errors(), removeAllShaders() + \sa removeShader(), link(), log(), removeAllShaders() */ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const char *source) { @@ -852,7 +882,7 @@ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const char *source) return false; QGLShader *shader = new QGLShader(type, this); if (!shader->setSourceCode(source)) { - d->errors = shader->errors(); + d->log = shader->log(); delete shader; return false; } @@ -866,13 +896,13 @@ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const char *source) Compiles \a source as a shader of the specified \a type and adds it to this shader program. Returns true if compilation was successful, false otherwise. The compilation errors - will be made available via errors(). + and warnings will be made available via log(). This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance of QGLShader first. - \sa removeShader(), link(), errors(), removeAllShaders() + \sa removeShader(), link(), log(), removeAllShaders() */ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QByteArray& source) { @@ -885,13 +915,13 @@ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QByteArray& s Compiles \a source as a shader of the specified \a type and adds it to this shader program. Returns true if compilation was successful, false otherwise. The compilation errors - will be made available via errors(). + and warnings will be made available via log(). This function is intended to be a short-cut for quickly adding vertex and fragment shaders to a shader program without creating an instance of QGLShader first. - \sa removeShader(), link(), errors(), removeAllShaders() + \sa removeShader(), link(), log(), removeAllShaders() */ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QString& source) { @@ -1022,14 +1052,14 @@ bool QGLShaderProgram::setProgramBinary(int format, const QByteArray& binary) d->linked = (value != 0); value = 0; glGetProgramiv(d->program, GL_INFO_LOG_LENGTH, &value); - d->errors = QString(); + d->log = QString(); if (value > 1) { - char *log = new char [value]; + char *logbuf = new char [value]; GLint len; - glGetProgramInfoLog(d->program, value, &len, log); - d->errors = QString::fromLatin1(log); - qWarning() << "QGLShaderProgram::setProgramBinary:" << d->errors; - delete [] log; + glGetProgramInfoLog(d->program, value, &len, logbuf); + d->log = QString::fromLatin1(logbuf); + qWarning() << "QGLShaderProgram::setProgramBinary:" << d->log; + delete [] logbuf; } return d->linked; #else @@ -1043,7 +1073,7 @@ bool QGLShaderProgram::setProgramBinary(int format, const QByteArray& binary) Returns the list of program binary formats that are accepted by this system for use with setProgramBinary(). - \sa programBinary, setProgramBinary() + \sa programBinary(), setProgramBinary() */ QList<int> QGLShaderProgram::programBinaryFormats() { @@ -1065,7 +1095,7 @@ QList<int> QGLShaderProgram::programBinaryFormats() Links together the shaders that were added to this program with addShader(). Returns true if the link was successful or false otherwise. If the link failed, the error messages can - be retrieved with errors(). + be retrieved with log(). Subclasses can override this function to initialize attributes and uniform variables for use in specific shader programs. @@ -1073,7 +1103,7 @@ QList<int> QGLShaderProgram::programBinaryFormats() If the shader program was already linked, calling this function again will force it to be re-linked. - \sa addShader(), errors() + \sa addShader(), log() */ bool QGLShaderProgram::link() { @@ -1101,7 +1131,7 @@ bool QGLShaderProgram::link() new QGLShader(QGLShader::VertexShader, this); } if (!d->vertexShader->setSourceCode(vertexSource)) { - d->errors = d->vertexShader->errors(); + d->log = d->vertexShader->log(); return false; } glAttachShader(d->program, d->vertexShader->d->shader); @@ -1118,7 +1148,7 @@ bool QGLShaderProgram::link() new QGLShader(QGLShader::FragmentShader, this); } if (!d->fragmentShader->setSourceCode(fragmentSource)) { - d->errors = d->fragmentShader->errors(); + d->log = d->fragmentShader->log(); return false; } glAttachShader(d->program, d->fragmentShader->d->shader); @@ -1130,14 +1160,14 @@ bool QGLShaderProgram::link() d->linked = (value != 0); value = 0; glGetProgramiv(d->program, GL_INFO_LOG_LENGTH, &value); - d->errors = QString(); + d->log = QString(); if (value > 1) { - char *log = new char [value]; + char *logbuf = new char [value]; GLint len; - glGetProgramInfoLog(d->program, value, &len, log); - d->errors = QString::fromLatin1(log); - qWarning() << "QGLShaderProgram::link:" << d->errors; - delete [] log; + glGetProgramInfoLog(d->program, value, &len, logbuf); + d->log = QString::fromLatin1(logbuf); + qWarning() << "QGLShaderProgram::link:" << d->log; + delete [] logbuf; } return d->linked; } @@ -1153,14 +1183,14 @@ bool QGLShaderProgram::isLinked() const } /*! - Returns the errors that occurred during the last link() + Returns the errors and warnings that occurred during the last link() or addShader() with explicitly specified source code. \sa link() */ -QString QGLShaderProgram::errors() const +QString QGLShaderProgram::log() const { - return d->errors; + return d->log; } /*! @@ -1181,8 +1211,11 @@ bool QGLShaderProgram::enable() return true; } +#undef ctx +#define ctx QGLContext::currentContext() + /*! - Disables this shader program in the currently active QGLContext. + Disables the active shader program in the current QGLContext. This is equivalent to calling \c{glUseProgram(0)}. \sa enable() @@ -1197,6 +1230,9 @@ void QGLShaderProgram::disable() #endif } +#undef ctx +#define ctx d->context + /*! Returns the OpenGL identifier associated with this shader program. @@ -1782,7 +1818,6 @@ void QGLShaderProgram::setUniformValue(const char *name, GLfloat value) /*! Sets the uniform variable at \a location in the current context to \a value. - This function must be used when setting sampler values. \sa setAttributeValue() */ @@ -1796,7 +1831,7 @@ void QGLShaderProgram::setUniformValue(int location, GLint value) \overload Sets the uniform variable called \a name in the current context - to \a value. This function must be used when setting sampler values. + to \a value. \sa setAttributeValue() */ @@ -1806,6 +1841,31 @@ void QGLShaderProgram::setUniformValue(const char *name, GLint value) } /*! + Sets the uniform variable at \a location in the current context to \a value. + This function should be used when setting sampler values. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(int location, GLuint value) +{ + if (location != -1) + glUniform1i(location, value); +} + +/*! + \overload + + Sets the uniform variable called \a name in the current context + to \a value. This function should be used when setting sampler values. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(const char *name, GLuint value) +{ + setUniformValue(uniformLocation(name), value); +} + +/*! Sets the uniform variable at \a location in the current context to the 2D vector (\a x, \a y). @@ -1990,6 +2050,114 @@ void QGLShaderProgram::setUniformValue(const char *name, const QColor& color) } /*! + Sets the uniform variable at \a location in the current context to + the x and y coordinates of \a point. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(int location, const QPoint& point) +{ + if (location != -1) { + GLfloat values[4] = {point.x(), point.y()}; + glUniform2fv(location, 1, values); + } +} + +/*! + \overload + + Sets the uniform variable associated with \a name in the current + context to the x and y coordinates of \a point. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(const char *name, const QPoint& point) +{ + setUniformValue(uniformLocation(name), point); +} + +/*! + Sets the uniform variable at \a location in the current context to + the x and y coordinates of \a point. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(int location, const QPointF& point) +{ + if (location != -1) { + GLfloat values[4] = {point.x(), point.y()}; + glUniform2fv(location, 1, values); + } +} + +/*! + \overload + + Sets the uniform variable associated with \a name in the current + context to the x and y coordinates of \a point. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(const char *name, const QPointF& point) +{ + setUniformValue(uniformLocation(name), point); +} + +/*! + Sets the uniform variable at \a location in the current context to + the width and height of the given \a size. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(int location, const QSize& size) +{ + if (location != -1) { + GLfloat values[4] = {size.width(), size.width()}; + glUniform2fv(location, 1, values); + } +} + +/*! + \overload + + Sets the uniform variable associated with \a name in the current + context to the width and height of the given \a size. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(const char *name, const QSize& size) +{ + setUniformValue(uniformLocation(name), size); +} + +/*! + Sets the uniform variable at \a location in the current context to + the width and height of the given \a size. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(int location, const QSizeF& size) +{ + if (location != -1) { + GLfloat values[4] = {size.width(), size.height()}; + glUniform2fv(location, 1, values); + } +} + +/*! + \overload + + Sets the uniform variable associated with \a name in the current + context to the width and height of the given \a size. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValue(const char *name, const QSizeF& size) +{ + setUniformValue(uniformLocation(name), size); +} + +/*! Sets the uniform variable at \a location in the current context to a 2x2 matrix \a value. @@ -2351,8 +2519,7 @@ void QGLShaderProgram::setUniformValue /*! Sets the uniform variable array at \a location in the current - context to the \a count elements of \a values. This overload - must be used when setting an array of sampler values. + context to the \a count elements of \a values. \sa setAttributeValue() */ @@ -2366,8 +2533,7 @@ void QGLShaderProgram::setUniformValueArray(int location, const GLint *values, i \overload Sets the uniform variable array called \a name in the current - context to the \a count elements of \a values. This overload - must be used when setting an array of sampler values. + context to the \a count elements of \a values. \sa setAttributeValue() */ @@ -2379,6 +2545,34 @@ void QGLShaderProgram::setUniformValueArray /*! Sets the uniform variable array at \a location in the current + context to the \a count elements of \a values. This overload + should be used when setting an array of sampler values. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValueArray(int location, const GLuint *values, int count) +{ + if (location != -1) + glUniform1iv(location, count, reinterpret_cast<const GLint *>(values)); +} + +/*! + \overload + + Sets the uniform variable array called \a name in the current + context to the \a count elements of \a values. This overload + should be used when setting an array of sampler values. + + \sa setAttributeValue() +*/ +void QGLShaderProgram::setUniformValueArray + (const char *name, const GLuint *values, int count) +{ + setUniformValueArray(uniformLocation(name), values, count); +} + +/*! + Sets the uniform variable array at \a location in the current context to the \a count elements of \a values. Each element has \a size components. The \a size must be 1, 2, 3, or 4. diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 047bb3c..b69d28e 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -1,28 +1,47 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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 QGLSHADERPROGRAM_H #define QGLSHADERPROGRAM_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - #include <QtOpenGL/qgl.h> #include <QtGui/qvector2d.h> #include <QtGui/qvector3d.h> @@ -35,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(OpenGL) -#if !defined(QT_OPENGL_ES_1_CL) && !defined(QT_GL_FIXED_PREFERRED) +#if !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) class QGLShaderProgram; class QGLShaderPrivate; @@ -77,7 +96,7 @@ public: QByteArray sourceCode() const; bool isCompiled() const; - QString errors() const; + QString log() const; GLuint shaderId() const; @@ -117,10 +136,10 @@ public: virtual bool link(); bool isLinked() const; - QString errors() const; + QString log() const; bool enable(); - void disable(); + static void disable(); GLuint programId() const; @@ -177,6 +196,7 @@ public: void setUniformValue(int location, GLfloat value); void setUniformValue(int location, GLint value); + void setUniformValue(int location, GLuint value); void setUniformValue(int location, GLfloat x, GLfloat y); void setUniformValue(int location, GLfloat x, GLfloat y, GLfloat z); void setUniformValue(int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); @@ -184,6 +204,10 @@ public: void setUniformValue(int location, const QVector3D& value); void setUniformValue(int location, const QVector4D& value); void setUniformValue(int location, const QColor& color); + void setUniformValue(int location, const QPoint& point); + void setUniformValue(int location, const QPointF& point); + void setUniformValue(int location, const QSize& size); + void setUniformValue(int location, const QSizeF& size); void setUniformValue(int location, const QMatrix2x2& value); void setUniformValue(int location, const QMatrix2x3& value); void setUniformValue(int location, const QMatrix2x4& value); @@ -198,6 +222,7 @@ public: void setUniformValue(const char *name, GLfloat value); void setUniformValue(const char *name, GLint value); + void setUniformValue(const char *name, GLuint value); void setUniformValue(const char *name, GLfloat x, GLfloat y); void setUniformValue(const char *name, GLfloat x, GLfloat y, GLfloat z); void setUniformValue(const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); @@ -205,6 +230,10 @@ public: void setUniformValue(const char *name, const QVector3D& value); void setUniformValue(const char *name, const QVector4D& value); void setUniformValue(const char *name, const QColor& color); + void setUniformValue(const char *name, const QPoint& point); + void setUniformValue(const char *name, const QPointF& point); + void setUniformValue(const char *name, const QSize& size); + void setUniformValue(const char *name, const QSizeF& size); void setUniformValue(const char *name, const QMatrix2x2& value); void setUniformValue(const char *name, const QMatrix2x3& value); void setUniformValue(const char *name, const QMatrix2x4& value); @@ -219,6 +248,7 @@ public: void setUniformValueArray(int location, const GLfloat *values, int count, int size); void setUniformValueArray(int location, const GLint *values, int count); + void setUniformValueArray(int location, const GLuint *values, int count); void setUniformValueArray(int location, const QVector2D *values, int count); void setUniformValueArray(int location, const QVector3D *values, int count); void setUniformValueArray(int location, const QVector4D *values, int count); @@ -234,6 +264,7 @@ public: void setUniformValueArray(const char *name, const GLfloat *values, int count, int size); void setUniformValueArray(const char *name, const GLint *values, int count); + void setUniformValueArray(const char *name, const GLuint *values, int count); void setUniformValueArray(const char *name, const QVector2D *values, int count); void setUniformValueArray(const char *name, const QVector3D *values, int count); void setUniformValueArray(const char *name, const QVector4D *values, int count); diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 77ff9fb..aee351d 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -5067,9 +5067,8 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte // fall back to drawing a polygon if the scale factor is large, or // we use a gradient pen - if (ti.fontEngine->fontDef.pixelSize >= 64 - || (d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern - && d->pen_brush_style <= Qt::ConicalGradientPattern)) { + if ((d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern + && d->pen_brush_style <= Qt::ConicalGradientPattern)) { QPaintEngine::drawTextItem(p, textItem); return; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 6d8f617..91a60e7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -80,7 +80,7 @@ template <typename T> inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr<bool>(const bool &) { return 0; } template <typename device, typename T1, typename T2, typename T3> static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, - QDirectFBPaintEnginePrivate::Scale scale, bool matrixRotShear, bool simplePen, + int scale, bool matrixRotShear, bool simplePen, bool dfbHandledClip, bool forceRasterPrimitives, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, @@ -211,6 +211,8 @@ static QCache<qint64, CachedImage> imageCache(4*1024*1024); // 4 MB class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate { public: + enum Scale { NoScale, Scaled, NegativeScale }; + QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p); ~QDirectFBPaintEnginePrivate(); @@ -266,7 +268,7 @@ private: bool simplePen; bool matrixRotShear; - enum Scale { NoScale, Scaled, NegativeScale } scale; + Scale scale; SurfaceCache *surfaceCache; QTransform transform; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 25e24fd..f571d1b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -818,7 +818,7 @@ static const QByteArray flagDescriptions(uint mask, const FlagDescription *flags -static void printDirectFBInfo(IDirectFB *fb) +static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) { DFBResult result; DFBGraphicsDeviceDescription dev; @@ -829,10 +829,14 @@ static void printDirectFBInfo(IDirectFB *fb) return; } - qDebug("Device: %s (%s), Driver: %s v%i.%i (%s)\n" + DFBSurfacePixelFormat pixelFormat; + primarySurface->GetPixelFormat(primarySurface, &pixelFormat); + + qDebug("Device: %s (%s), Driver: %s v%i.%i (%s) Pixelformat: %d (%d)\n" "acceleration: 0x%x%s\nblit: 0x%x%s\ndraw: 0x%0x%s\nvideo: %iKB\n", dev.name, dev.vendor, dev.driver.name, dev.driver.major, - dev.driver.minor, dev.driver.vendor, dev.acceleration_mask, + dev.driver.minor, dev.driver.vendor, DFB_PIXELFORMAT_INDEX(pixelFormat), + QDirectFBScreen::getImageFormat(primarySurface), dev.acceleration_mask, ::flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(), dev.blitting_flags, ::flagDescriptions(dev.blitting_flags, blitDescriptions).constData(), dev.drawing_flags, ::flagDescriptions(dev.drawing_flags, drawDescriptions).constData(), @@ -883,9 +887,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } - if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) - printDirectFBInfo(d_ptr->dfb); - if (displayArgs.contains(QLatin1String("videoonly"), Qt::CaseInsensitive)) d_ptr->directFBFlags |= VideoOnly; @@ -952,6 +953,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } + if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) + printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface); + // Work out what format we're going to use for surfaces with an alpha channel d_ptr->alphaPixmapFormat = QDirectFBScreen::getImageFormat(d_ptr->dfbSurface); setPixelFormat(d_ptr->alphaPixmapFormat); diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index c053c30..a1a6d52 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -158,7 +158,10 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XFail) { QTestElement *failureElement = new QTestElement(QTest::LET_Failure); failureElement->addAttribute(QTest::AI_Result, typeBuf); - failureElement->addAttribute(QTest::AI_File, file); + if(file) + failureElement->addAttribute(QTest::AI_File, file); + else + failureElement->addAttribute(QTest::AI_File, ""); QTest::qt_snprintf(buf, sizeof(buf), "%i", line); failureElement->addAttribute(QTest::AI_Line, buf); failureElement->addAttribute(QTest::AI_Description, description); diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp index cf99b96..055abe0 100644 --- a/src/testlib/qtestxmlstreamer.cpp +++ b/src/testlib/qtestxmlstreamer.cpp @@ -54,7 +54,7 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, char *formatted) QXmlTestLogger::xmlCdata(cdataTag, element->attributeValue(QTest::AI_Tag), sizeof(cdataTag)); QTest::qt_snprintf(formatted, 1024, "<Incident type=\"%s\" %s>\n" - " <DataTag><![CDATA[%s]]></Description>\n" + " <DataTag><![CDATA[%s]]></DataTag>\n" " <Description><![CDATA[%s]]></Description>\n" "</Incident>\n", element->attributeValue(QTest::AI_Result), location, cdataTag, cdataDesc); diff --git a/tests/arthur/data/qps/borderimage.qps b/tests/arthur/data/qps/borderimage.qps index 747a74d..14073fe 100644 --- a/tests/arthur/data/qps/borderimage.qps +++ b/tests/arthur/data/qps/borderimage.qps @@ -106,6 +106,23 @@ repeat_block draw_column resetMatrix setRenderHint Antialiasing off +translate 200.1 520.1 + +begin_block one_pixel_border +drawImage borderimage 0 0 16 16 0 0 16 16 +drawImage borderimage 16 0 64 16 16 0 1 1 +drawImage borderimage 80 0 16 16 48 0 16 16 + +drawImage borderimage 0 16 16 64 16 0 1 1 +drawImage borderimage 80 16 16 64 16 0 1 1 + +drawImage borderimage 0 80 16 16 0 48 16 16 +drawImage borderimage 16 80 64 16 16 0 1 1 +drawImage borderimage 80 80 16 16 48 48 16 16 +end_block one_pixel_border + +resetMatrix + setPen red drawRect 0 0 70 680 @@ -127,3 +144,6 @@ drawText 174 114 "smoothpixmaptransform off" drawRect 164 128 224 134 drawText 174 252 "smoothpixmaptransform on" + +drawRect 200 520 97 128 +drawText 210 638 "1x1 edges" diff --git a/tests/arthur/data/qps/borderimage_qps.png b/tests/arthur/data/qps/borderimage_qps.png Binary files differindex 89a8eba..a4ec6cb 100644 --- a/tests/arthur/data/qps/borderimage_qps.png +++ b/tests/arthur/data/qps/borderimage_qps.png diff --git a/tests/auto/qformlayout/tst_qformlayout.cpp b/tests/auto/qformlayout/tst_qformlayout.cpp index c4c6f70..242974d 100644 --- a/tests/auto/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/qformlayout/tst_qformlayout.cpp @@ -125,6 +125,7 @@ private slots: Qt::Orientations expandingDirections() const; */ + void fieldMinimumSize(); }; tst_QFormLayout::tst_QFormLayout() @@ -905,6 +906,35 @@ void tst_QFormLayout::layoutAlone() QTest::qWait(500); } + +void tst_QFormLayout::fieldMinimumSize() +{ + //check that the field with is bigger than its minimumSizeHint for any size of the widget + // even if the label with is not fixed + QWidget w; + QFormLayout layout; + layout.setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); + w.setLayout(&layout); + QLabel label1("Here is a strange test case"); + label1.setWordWrap(true); + QLabel label2("Here is another label"); + label2.setWordWrap(true); + QLabel shortLabel("short"); + QLabel longLabel("Quite long label"); + layout.addRow(&label1, &shortLabel); + layout.addRow(&label2, &longLabel); + w.show(); + int width = w.size().width() + 9; + + do { + w.resize(width, w.size().height()); + layout.activate(); + QVERIFY(shortLabel.size().width() >= shortLabel.minimumSizeHint().width()); + QVERIFY(longLabel.size().width() >= longLabel.minimumSizeHint().width()); + width -= 3; + } while(width >= w.minimumSizeHint().width()); +} + QTEST_MAIN(tst_QFormLayout) #include "tst_qformlayout.moc" diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 88c64d3..3b9895d 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -78,8 +78,7 @@ Q_DECLARE_METATYPE(QRectF) class EventTester : public QGraphicsItem { public: - EventTester() - : repaints(0) + EventTester(QGraphicsItem *parent = 0) : QGraphicsItem(parent), repaints(0) { br = QRectF(-10, -10, 20, 20); } void setGeometry(const QRectF &rect) @@ -209,6 +208,7 @@ private slots: void itemTransform_unrelated(); void opacity_data(); void opacity(); + void opacity2(); void itemStacksBehindParent(); void nestedClipping(); void nestedClippingTransforms(); @@ -5641,6 +5641,91 @@ void tst_QGraphicsItem::opacity() QCOMPARE(c3->effectiveOpacity(), c3_effectiveOpacity); } +void tst_QGraphicsItem::opacity2() +{ + EventTester *parent = new EventTester; + EventTester *child = new EventTester(parent); + EventTester *grandChild = new EventTester(child); + + QGraphicsScene scene; + scene.addItem(parent); + + class MyGraphicsView : public QGraphicsView + { public: + int repaints; + MyGraphicsView(QGraphicsScene *scene) : QGraphicsView(scene), repaints(0) {} + void paintEvent(QPaintEvent *e) { ++repaints; QGraphicsView::paintEvent(e); } + }; + + MyGraphicsView view(&scene); + view.show(); +#ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&view); +#endif + QTest::qWait(250); + +#define RESET_REPAINT_COUNTERS \ + parent->repaints = 0; \ + child->repaints = 0; \ + grandChild->repaints = 0; \ + view.repaints = 0; + + RESET_REPAINT_COUNTERS + + child->setOpacity(0.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 0); + + RESET_REPAINT_COUNTERS + + child->setOpacity(1.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 1); + QCOMPARE(grandChild->repaints, 1); + + RESET_REPAINT_COUNTERS + + parent->setOpacity(0.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 0); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 0); + + RESET_REPAINT_COUNTERS + + parent->setOpacity(1.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 1); + QCOMPARE(grandChild->repaints, 1); + + grandChild->setFlag(QGraphicsItem::ItemIgnoresParentOpacity); + RESET_REPAINT_COUNTERS + + child->setOpacity(0.0); + QTest::qWait(100); + QCOMPARE(view.repaints, 1); + QCOMPARE(parent->repaints, 1); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 1); + + RESET_REPAINT_COUNTERS + + child->setOpacity(0.0); // Already 0.0; no change. + QTest::qWait(100); + QCOMPARE(view.repaints, 0); + QCOMPARE(parent->repaints, 0); + QCOMPARE(child->repaints, 0); + QCOMPARE(grandChild->repaints, 0); +} + void tst_QGraphicsItem::itemStacksBehindParent() { QGraphicsRectItem *parent1 = new QGraphicsRectItem(QRectF(0, 0, 100, 50)); diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index deabda6..785eab0 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -101,6 +101,8 @@ private slots: void recycleServer(); + void multiConnect(); + void debug(); }; @@ -842,6 +844,31 @@ void tst_QLocalSocket::recycleServer() QVERIFY(server.nextPendingConnection() != 0); } +void tst_QLocalSocket::multiConnect() +{ + QLocalServer server; + QLocalSocket client1; + QLocalSocket client2; + QLocalSocket client3; + + QVERIFY(server.listen("multiconnect")); + + client1.connectToServer("multiconnect"); + client2.connectToServer("multiconnect"); + client3.connectToServer("multiconnect"); + + QVERIFY(client1.waitForConnected(201)); + QVERIFY(client2.waitForConnected(202)); + QVERIFY(client3.waitForConnected(203)); + + QVERIFY(server.waitForNewConnection(201)); + QVERIFY(server.nextPendingConnection() != 0); + QVERIFY(server.waitForNewConnection(202)); + QVERIFY(server.nextPendingConnection() != 0); + QVERIFY(server.waitForNewConnection(203)); + QVERIFY(server.nextPendingConnection() != 0); +} + void tst_QLocalSocket::debug() { // Make sure this compiles diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index 37cb5b0..71d7b4d 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -226,6 +226,7 @@ private slots: void task244304_clickOnDecoration(); void task246536_scrollbarsNotWorking(); void task250683_wrongSectionSize(); + void task239271_addRowsWithFirstColumnHidden(); }; class QtTestModel: public QAbstractItemModel @@ -3289,6 +3290,45 @@ void tst_QTreeView::task250683_wrongSectionSize() QCOMPARE(treeView.header()->sectionSize(0) + treeView.header()->sectionSize(1), treeView.viewport()->width()); } +void tst_QTreeView::task239271_addRowsWithFirstColumnHidden() +{ + class MyDelegate : public QStyledItemDelegate + { + public: + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const + { + paintedIndexes << index; + QStyledItemDelegate::paint(painter, option, index); + } + + mutable QSet<QModelIndex> paintedIndexes; + }; + + QTreeView view; + QStandardItemModel model; + view.setModel(&model); + MyDelegate delegate; + view.setItemDelegate(&delegate); + QStandardItem root0("root0"), root1("root1"); + model.invisibleRootItem()->appendRow(QList<QStandardItem*>() << &root0 << &root1); + QStandardItem sub0("sub0"), sub00("sub00"); + root0.appendRow(QList<QStandardItem*>() << &sub0 << &sub00); + view.expand(root0.index()); + + view.hideColumn(0); + view.show(); + QTest::qWait(200); + delegate.paintedIndexes.clear(); + QStandardItem sub1("sub1"), sub11("sub11"); + root0.appendRow(QList<QStandardItem*>() << &sub1 << &sub11); + + QTest::qWait(200); + //items in the 2nd column should have been painted + QVERIFY(delegate.paintedIndexes.contains(sub00.index())); + QVERIFY(delegate.paintedIndexes.contains(sub11.index())); +} + + QTEST_MAIN(tst_QTreeView) #include "tst_qtreeview.moc" diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index ee61871..efdaaec 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -287,6 +287,7 @@ private slots: void render_systemClip2(); void render_systemClip3_data(); void render_systemClip3(); + void render_task252837(); void setContentsMargins(); @@ -7138,6 +7139,16 @@ void tst_QWidget::render_systemClip3() } } +void tst_QWidget::render_task252837() +{ + QWidget widget; + widget.resize(200, 200); + + QPixmap pixmap(widget.size()); + QPainter painter(&pixmap); + // Please do not crash. + widget.render(&painter); +} void tst_QWidget::setContentsMargins() { QLabel label("why does it always rain on me?"); diff --git a/tests/auto/selftests/badxml/tst_badxml.cpp b/tests/auto/selftests/badxml/tst_badxml.cpp index 6b2e4c4..fa5b717 100644 --- a/tests/auto/selftests/badxml/tst_badxml.cpp +++ b/tests/auto/selftests/badxml/tst_badxml.cpp @@ -58,6 +58,8 @@ private slots: void badMessage() const; void badMessage_data() const; + void failWithNoFile() const; + public: static QList<QByteArray> const& badStrings(); }; @@ -116,6 +118,11 @@ void tst_BadXml::badDataTag_data() const } } +void tst_BadXml::failWithNoFile() const +{ + QTest::qFail("failure message", 0, 0); +} + /* Outputs a message containing a bad string. */ diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index aa1048b..603e730 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -307,13 +307,12 @@ void tst_Selftests::initTestCase() m_checkXMLBlacklist.append("qexecstringlist"); m_checkXMLBlacklist.append("benchliboptions"); + /* These tests use printf and therefore corrupt the testlog */ + m_checkXMLBlacklist.append("subtest"); + m_checkXMLBlacklist.append("globaldata"); + m_checkXMLBlacklist.append("warnings"); + m_checkXunitBlacklist = m_checkXMLBlacklist; - m_checkXunitBlacklist.append("benchlibwalltime"); - m_checkXunitBlacklist.append("benchlibeventcounter"); - m_checkXunitBlacklist.append("benchlibcallgrind"); - m_checkXunitBlacklist.append("subtest"); - m_checkXunitBlacklist.append("globaldata"); - m_checkXunitBlacklist.append("warnings"); } void tst_Selftests::checkXML() const @@ -324,34 +323,41 @@ void tst_Selftests::checkXML() const if(m_checkXMLBlacklist.contains(subdir)) return; - arguments.prepend("-xml"); - arguments.prepend("-flush"); - - QProcess proc; - proc.setEnvironment(QStringList("")); - proc.start(subdir + "/" + subdir, arguments); - QVERIFY(proc.waitForFinished()); - - QByteArray out(proc.readAllStandardOutput()); - QByteArray err(proc.readAllStandardError()); - - /* Some platforms decides to output a message for uncaught exceptions. For instance, - * this is what windows platforms says: - * "This application has requested the Runtime to terminate it in an unusual way. - * Please contact the application's support team for more information." */ - if(subdir != QLatin1String("exception") && subdir != QLatin1String("fetchbogus")) - QVERIFY2(err.isEmpty(), err.constData()); - - QXmlStreamReader reader(out); - - while(!reader.atEnd()) - reader.readNext(); - - QVERIFY2(!reader.error(), qPrintable(QString("line %1, col %2: %3") - .arg(reader.lineNumber()) - .arg(reader.columnNumber()) - .arg(reader.errorString()) - )); + QStringList args; + /* Test both old (-flush) and new XML logger implementation */ + for (int i = 0; i < 2; ++i) { + bool flush = i; + args = arguments; + args.prepend("-xml"); + if (flush) args.prepend("-flush"); + + QProcess proc; + proc.setEnvironment(QStringList("")); + proc.start(subdir + "/" + subdir, args); + QVERIFY(proc.waitForFinished()); + + QByteArray out(proc.readAllStandardOutput()); + QByteArray err(proc.readAllStandardError()); + + /* Some platforms decides to output a message for uncaught exceptions. For instance, + * this is what windows platforms says: + * "This application has requested the Runtime to terminate it in an unusual way. + * Please contact the application's support team for more information." */ + if(subdir != QLatin1String("exception") && subdir != QLatin1String("fetchbogus")) + QVERIFY2(err.isEmpty(), err.constData()); + + QXmlStreamReader reader(out); + + while(!reader.atEnd()) + reader.readNext(); + + QVERIFY2(!reader.error(), qPrintable(QString("(flush %0) line %1, col %2: %3") + .arg(flush) + .arg(reader.lineNumber()) + .arg(reader.columnNumber()) + .arg(reader.errorString()) + )); + } } void tst_Selftests::checkXunitxml() const diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 4390a10..ec54d0c 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -262,8 +262,9 @@ CentralWidget::~CentralWidget() QString zoomCount; QString currentPages; QLatin1Char separator('|'); - int i = m_searchWidget->isAttached() ? 1 : 0; + bool searchAttached = m_searchWidget->isAttached(); + int i = searchAttached ? 1 : 0; for (; i < tabWidget->count(); ++i) { HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(i)); if (viewer && viewer->source().isValid()) { @@ -274,6 +275,7 @@ CentralWidget::~CentralWidget() engine.setCustomValue(QLatin1String("LastTabPage"), lastTabPage); engine.setCustomValue(QLatin1String("LastShownPages"), currentPages); + engine.setCustomValue(QLatin1String("SearchWasAttached"), searchAttached); #if !defined(QT_NO_WEBKIT) engine.setCustomValue(QLatin1String("LastPagesZoomWebView"), zoomCount); #else @@ -418,7 +420,18 @@ void CentralWidget::setLastShownPages() setSourceInNewTab((*it), (*zIt).toFloat()); const QLatin1String lastTab("LastTabPage"); - tabWidget->setCurrentIndex(helpEngine->customValue(lastTab, 1).toInt()); + int tab = helpEngine->customValue(lastTab, 1).toInt(); + + const QLatin1String searchKey("SearchWasAttached"); + const bool searchIsAttached = m_searchWidget->isAttached(); + const bool searchWasAttached = helpEngine->customValue(searchKey).toBool(); + + if (searchWasAttached && !searchIsAttached) + tabWidget->setCurrentIndex(--tab); + else if (!searchWasAttached && searchIsAttached) + tabWidget->setCurrentIndex(++tab); + else + tabWidget->setCurrentIndex(tab); } bool CentralWidget::hasSelection() const @@ -978,22 +991,29 @@ void CentralWidget::updateBrowserFont() void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) { - if (!m_searchWidget) { - m_searchWidget = new SearchWidget(searchEngine, this); - connect(m_searchWidget, SIGNAL(requestShowLink(QUrl)), this, - SLOT(setSourceFromSearch(QUrl))); - connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(QUrl)), this, - SLOT(setSourceFromSearchInNewTab(QUrl))); - } - tabWidget->insertTab(0, m_searchWidget, tr("Search")); - m_searchWidget->setAttached(true); + if (m_searchWidget) + return; + + m_searchWidget = new SearchWidget(searchEngine, this); + connect(m_searchWidget, SIGNAL(requestShowLink(QUrl)), this, + SLOT(setSourceFromSearch(QUrl))); + connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(QUrl)), this, + SLOT(setSourceFromSearchInNewTab(QUrl))); } -void CentralWidget::activateSearchWidget() +void CentralWidget::activateSearchWidget(bool updateLastTabPage) { - if (!m_searchWidget->isAttached()) + if (!m_searchWidget) createSearchWidget(helpEngine->searchEngine()); + if (!m_searchWidget->isAttached()) { + tabWidget->insertTab(0, m_searchWidget, tr("Search")); + m_searchWidget->setAttached(true); + + if (updateLastTabPage) + lastTabPage++; + } + tabWidget->setCurrentWidget(m_searchWidget); m_searchWidget->setFocus(); } diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index 2c28091..e3ce200 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -118,7 +118,7 @@ public: void activateTab(bool onlyHelpViewer = false); void createSearchWidget(QHelpSearchEngine *searchEngine); - void activateSearchWidget(); + void activateSearchWidget(bool updateLastTabPage = false); void removeSearchWidget(); int availableHelpViewer() const; diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 426a828..b0c2c6b 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -126,6 +126,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); m_centralWidget->createSearchWidget(searchEngine); + m_centralWidget->activateSearchWidget(); QString defWindowTitle = tr("Qt Assistant"); setWindowTitle(defWindowTitle); @@ -234,6 +235,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) else checkInitState(); } + setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); } MainWindow::~MainWindow() @@ -461,7 +463,7 @@ void MainWindow::setupActions() QKeySequence(tr("ALT+I"))); m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarks()), QKeySequence(tr("ALT+O"))); - m_viewMenu->addAction(tr("Search"), this, SLOT(showSearch()), + m_viewMenu->addAction(tr("Search"), this, SLOT(showSearchWidget()), QKeySequence(tr("ALT+S"))); menu = menuBar()->addMenu(tr("&Go")); @@ -880,6 +882,11 @@ void MainWindow::showSearch() m_centralWidget->activateSearchWidget(); } +void MainWindow::showSearchWidget() +{ + m_centralWidget->activateSearchWidget(true); +} + void MainWindow::hideSearch() { m_centralWidget->removeSearchWidget(); diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 7d08a74..d7f5c69 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -92,6 +92,7 @@ public slots: void showIndex(); void showBookmarks(); void showSearch(); + void showSearchWidget(); void syncContents(); void activateCurrentCentralWidgetTab(); diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit index a7ecbc6..a2ef05b 100755 --- a/util/webkit/mkdist-webkit +++ b/util/webkit/mkdist-webkit @@ -46,6 +46,7 @@ excluded_directories="$excluded_directories JavaScriptCore/wtf/wx" excluded_directories="$excluded_directories JavaScriptCore/wtf/gtk" excluded_directories="$excluded_directories JavaScriptCore/wtf/mac" excluded_directories="$excluded_directories JavaScriptCore/wtf/win" +excluded_directories="$excluded_directories JavaScriptCore/wtf/chromium" excluded_directories="$excluded_directories WebCore/WebCore.vcproj" excluded_directories="$excluded_directories WebCore/DerivedSources.make" @@ -70,6 +71,7 @@ excluded_directories="$excluded_directories WebCore/loader/win" excluded_directories="$excluded_directories WebCore/page/gtk" excluded_directories="$excluded_directories WebCore/page/mac" excluded_directories="$excluded_directories WebCore/page/wx" +excluded_directories="$excluded_directories WebCore/page/chromium" excluded_directories="$excluded_directories WebCore/history/mac" @@ -78,6 +80,7 @@ excluded_directories="$excluded_directories WebCore/editing/wx" excluded_directories="$excluded_directories WebCore/platform/text/wx" excluded_directories="$excluded_directories WebCore/platform/text/gtk" +excluded_directories="$excluded_directories WebCore/platform/text/chromium" excluded_directories="$excluded_directories WebCore/manual-tests" @@ -87,6 +90,7 @@ excluded_directories="$excluded_directories WebCore/platform/network/curl" excluded_directories="$excluded_directories WebCore/platform/network/mac" excluded_directories="$excluded_directories WebCore/platform/network/win" excluded_directories="$excluded_directories WebCore/platform/network/soup" +excluded_directories="$excluded_directories WebCore/platform/network/chromium" excluded_directories="$excluded_directories WebCore/platform/graphics/cg" excluded_directories="$excluded_directories WebCore/platform/graphics/cairo" @@ -95,6 +99,7 @@ excluded_directories="$excluded_directories WebCore/platform/graphics/wx" excluded_directories="$excluded_directories WebCore/platform/graphics/mac" excluded_directories="$excluded_directories WebCore/platform/graphics/win" excluded_directories="$excluded_directories WebCore/platform/graphics/skia" +excluded_directories="$excluded_directories WebCore/platform/graphics/chromium" excluded_directories="$excluded_directories WebCore/platform/image-decoders/bmp" excluded_directories="$excluded_directories WebCore/platform/image-decoders/gif" @@ -105,6 +110,7 @@ excluded_directories="$excluded_directories WebCore/platform/image-decoders/jpeg excluded_directories="$excluded_directories WebCore/platform/image-decoders/xbm" excluded_directories="$excluded_directories WebCore/plugins/gtk" +excluded_directories="$excluded_directories WebCore/plugins/chromium" excluded_directories="$excluded_directories WebCore/platform/symbian WebCore/platform/wx" excluded_directories="$excluded_directories WebKit/gtk" |