From e1f691d84dad17c5ee47c97c31ae743093ad8bc9 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 8 Oct 2009 09:15:20 +0200 Subject: Ensure that qmake doesn't lose the error code when processing subdirs When processing a project in a subdirs template failed for whatever reason then qmake would lose the result of that and would return an error code of 0 if the subdirs project file itself was processed fine. So now it ensures that any errors arising from processing a project referenced in a subdirs project file are not lost so that the error code returned from qmake will indicate an error actually occured. Task-number: QTBUG-4065 Reviewed-by: mariusSO Original-commit: c15b370c9db16fdbfd9e7bec89ee9bf8c1110827 --- qmake/generators/metamakefile.cpp | 17 ++++++++++++----- qmake/generators/metamakefile.h | 2 +- qmake/main.cpp | 6 +++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 5915fcf..819cdaf 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -291,6 +291,7 @@ SubdirsMetaMakefileGenerator::init() if(init_flag) return false; init_flag = true; + bool hasError = false; if(Option::recursive) { QString old_output_dir = Option::output_dir; @@ -336,14 +337,18 @@ SubdirsMetaMakefileGenerator::init() } qmake_setpwd(sub->input_dir); Option::output_dir = sub->output_dir; - sub_proj->read(subdir.fileName()); + bool tmpError = !sub_proj->read(subdir.fileName()); if(!sub_proj->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) { fprintf(stderr, "Project file(%s) not recursed because all requirements not met:\n\t%s\n", subdir.fileName().toLatin1().constData(), sub_proj->values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData()); delete sub; delete sub_proj; + Option::output_dir = old_output_dir; + qmake_setpwd(oldpwd); continue; + } else { + hasError |= tmpError; } sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name); if(0 && sub->makefile->type() == SUBDIRSMETATYPE) { @@ -351,7 +356,7 @@ SubdirsMetaMakefileGenerator::init() } else { const QString output_name = Option::output.fileName(); Option::output.setFileName(sub->output_file); - sub->makefile->write(sub->output_dir); + hasError |= !sub->makefile->write(sub->output_dir); delete sub; qmakeClearCaches(); sub = 0; @@ -376,7 +381,7 @@ SubdirsMetaMakefileGenerator::init() self->makefile->init(); subs.append(self); - return true; + return !hasError; } bool @@ -482,7 +487,7 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO) } MetaMakefileGenerator * -MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op) +MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op, bool *success) { MetaMakefileGenerator *ret = 0; if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || @@ -492,7 +497,9 @@ MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &na } if (!ret) ret = new BuildsMetaMakefileGenerator(proj, name, op); - ret->init(); + bool res = ret->init(); + if (success) + *success = res; return ret; } diff --git a/qmake/generators/metamakefile.h b/qmake/generators/metamakefile.h index e69304a..f74f4a2 100644 --- a/qmake/generators/metamakefile.h +++ b/qmake/generators/metamakefile.h @@ -62,7 +62,7 @@ public: virtual ~MetaMakefileGenerator(); - static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true); + static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true, bool *success = 0); static MakefileGenerator *createMakefileGenerator(QMakeProject *proj, bool noIO = false); inline QMakeProject *projectFile() const { return project; } diff --git a/qmake/main.cpp b/qmake/main.cpp index 73fdda9..a0346c5 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -168,7 +168,11 @@ int runQMake(int argc, char **argv) continue; } - MetaMakefileGenerator *mkfile = MetaMakefileGenerator::createMetaGenerator(&project, QString(), false); + bool success = true; + MetaMakefileGenerator *mkfile = MetaMakefileGenerator::createMetaGenerator(&project, QString(), false, &success); + if (!success) + exit_val = 3; + if(mkfile && !mkfile->write(oldpwd)) { if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) fprintf(stderr, "Unable to generate project file.\n"); -- cgit v0.12 From 26713a8b3fa4b82ea18c314c01b4d7ccb54d1125 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 26 Oct 2009 11:02:52 +0100 Subject: QDom: make tests fail only on Windows Reviewed-by: Carlos Duclos --- tests/auto/qdom/tst_qdom.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 0d58554e..f3a7909 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -322,7 +322,9 @@ void tst_QDom::toString_01_data() */ void tst_QDom::toString_01() { +#ifdef Q_OS_WIN QFAIL("make test fail instead of timing out, will be fixed later (QT-2357)"); +#endif QFETCH(QString, fileName); QFile f(fileName); -- cgit v0.12 From 1b0dad4d1c9b3693b6fb9c93d8dc06a4eaf42d83 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 27 Oct 2009 12:49:06 +0100 Subject: Designer: Fix potential crash when moving pages of a QTabWidget ... which has movable=true, conflicting with its internal drag and drop. Introduce 'movable' as fake property. Reviewed-by: Jarek Kobus Task-number: QT-1788 --- tools/designer/src/lib/shared/qdesigner_tabwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp b/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp index 2789bd3..f4f3d24 100644 --- a/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp +++ b/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp @@ -399,6 +399,7 @@ static const char *currentTabNameKey = "currentTabName"; static const char *currentTabIconKey = "currentTabIcon"; static const char *currentTabToolTipKey = "currentTabToolTip"; static const char *currentTabWhatsThisKey = "currentTabWhatsThis"; +static const char *tabMovableKey = "movable"; QTabWidgetPropertySheet::QTabWidgetPropertySheet(QTabWidget *object, QObject *parent) : QDesignerPropertySheet(object, parent), @@ -411,6 +412,8 @@ QTabWidgetPropertySheet::QTabWidgetPropertySheet(QTabWidget *object, QObject *pa formWindowBase()->addReloadableProperty(this, indexOf(QLatin1String(currentTabIconKey))); createFakeProperty(QLatin1String(currentTabToolTipKey), qVariantFromValue(qdesigner_internal::PropertySheetStringValue())); createFakeProperty(QLatin1String(currentTabWhatsThisKey), qVariantFromValue(qdesigner_internal::PropertySheetStringValue())); + // Prevent the tab widget's drag and drop handling from interfering with Designer's + createFakeProperty(QLatin1String(tabMovableKey), QVariant(false)); } QTabWidgetPropertySheet::TabWidgetProperty QTabWidgetPropertySheet::tabWidgetPropertyFromName(const QString &name) -- cgit v0.12 From d0b0e0ed8ac857d78e497b74bb1c3596273c53ba Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 27 Oct 2009 15:10:46 +0100 Subject: QLibrary on Windows: Do not show error boxes when library load fails When loading a library fails, the error message "The application or DLL ... is not a valid Windows image. Please check this against your installation diskette." is shown, which is not very helpful. Task-number: QT-2357 Reviewed-by: Marius Storm-Olsen --- src/corelib/plugin/qlibrary.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 2b463a1..6496876 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -659,7 +659,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) #endif if (!pHnd) { #ifdef Q_OS_WIN + //avoid 'Bad Image' message box + UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); hTempModule = ::LoadLibraryEx((wchar_t*)QDir::toNativeSeparators(fileName).utf16(), 0, DONT_RESOLVE_DLL_REFERENCES); + SetErrorMode(oldmode); #else # if defined(Q_OS_SYMBIAN) //Guard against accidentally trying to load non-plugin libraries by making sure the stub exists -- cgit v0.12 From 2d0b29c312ddf422595ce9debb3678bb5c4d51b6 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 27 Oct 2009 16:04:29 +0100 Subject: QAbstractSocket: wait with closing until all bytes have been written only disconnect from host when all bytes have been written; i.e. not only check whether the write buffer is empty, but also check whether the socket engine has still bytes to write. This is necessary for HTTP and SOCKS5 socket engine, because they both contain an inner TCP socket which also does buffering. For the native socket engine, there is no difference with this patch. Reviewed-by: Markus Goetz Reviewed-by: Thiago Macieira --- src/network/socket/qabstractsocket.cpp | 22 +++++++++++++++------- src/network/socket/qabstractsocketengine_p.h | 2 ++ src/network/socket/qhttpsocketengine.cpp | 10 ++++++++++ src/network/socket/qhttpsocketengine_p.h | 2 ++ src/network/socket/qnativesocketengine.cpp | 6 ++++++ src/network/socket/qnativesocketengine_p.h | 2 ++ src/network/socket/qsocks5socketengine.cpp | 14 ++++++++++++++ src/network/socket/qsocks5socketengine_p.h | 2 ++ src/network/ssl/qsslsocket.cpp | 2 ++ tests/auto/qsslsocket/tst_qsslsocket.cpp | 4 +--- 10 files changed, 56 insertions(+), 10 deletions(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 9fb0b47..955fee0 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -669,11 +669,11 @@ bool QAbstractSocketPrivate::canWriteNotification() if (socketEngine) { #if defined (Q_OS_WIN) - if (!writeBuffer.isEmpty()) - socketEngine->setWriteNotificationEnabled(true); + if (!writeBuffer.isEmpty()) + socketEngine->setWriteNotificationEnabled(true); #else - if (writeBuffer.isEmpty()) - socketEngine->setWriteNotificationEnabled(false); + if (writeBuffer.isEmpty() && socketEngine->bytesToWrite() == 0) + socketEngine->setWriteNotificationEnabled(false); #endif } @@ -710,11 +710,17 @@ void QAbstractSocketPrivate::connectionNotification() bool QAbstractSocketPrivate::flush() { Q_Q(QAbstractSocket); - if (!socketEngine || !socketEngine->isValid() || writeBuffer.isEmpty()) { + if (!socketEngine || !socketEngine->isValid() || (writeBuffer.isEmpty() + && socketEngine->bytesToWrite() == 0)) { #if defined (QABSTRACTSOCKET_DEBUG) qDebug("QAbstractSocketPrivate::flush() nothing to do: valid ? %s, writeBuffer.isEmpty() ? %s", socketEngine->isValid() ? "yes" : "no", writeBuffer.isEmpty() ? "yes" : "no"); #endif + + // this covers the case when the buffer was empty, but we had to wait for the socket engine to finish + if (state == QAbstractSocket::ClosingState) + q->disconnectFromHost(); + return false; } @@ -751,7 +757,8 @@ bool QAbstractSocketPrivate::flush() } } - if (writeBuffer.isEmpty() && socketEngine && socketEngine->isWriteNotificationEnabled()) + if (writeBuffer.isEmpty() && socketEngine && socketEngine->isWriteNotificationEnabled() + && !socketEngine->bytesToWrite()) socketEngine->setWriteNotificationEnabled(false); if (state == QAbstractSocket::ClosingState) q->disconnectFromHost(); @@ -2347,7 +2354,8 @@ void QAbstractSocket::disconnectFromHostImplementation() } // Wait for pending data to be written. - if (d->socketEngine && d->socketEngine->isValid() && d->writeBuffer.size() > 0) { + if (d->socketEngine && d->socketEngine->isValid() && (d->writeBuffer.size() > 0 + || d->socketEngine->bytesToWrite() > 0)) { d->socketEngine->setWriteNotificationEnabled(true); #if defined(QABSTRACTSOCKET_DEBUG) diff --git a/src/network/socket/qabstractsocketengine_p.h b/src/network/socket/qabstractsocketengine_p.h index c639092..14b3c81 100644 --- a/src/network/socket/qabstractsocketengine_p.h +++ b/src/network/socket/qabstractsocketengine_p.h @@ -126,6 +126,8 @@ public: virtual qint64 pendingDatagramSize() const = 0; #endif + virtual qint64 bytesToWrite() const = 0; + virtual int option(SocketOption option) const = 0; virtual bool setOption(SocketOption option, int value) = 0; diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index fb61dbf..5c28318 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -276,6 +276,16 @@ qint64 QHttpSocketEngine::pendingDatagramSize() const } #endif // QT_NO_UDPSOCKET +qint64 QHttpSocketEngine::bytesToWrite() const +{ + Q_D(const QHttpSocketEngine); + if (d->socket) { + return d->socket->bytesToWrite(); + } else { + return 0; + } +} + int QHttpSocketEngine::option(SocketOption option) const { Q_D(const QHttpSocketEngine); diff --git a/src/network/socket/qhttpsocketengine_p.h b/src/network/socket/qhttpsocketengine_p.h index a423116..76430db 100644 --- a/src/network/socket/qhttpsocketengine_p.h +++ b/src/network/socket/qhttpsocketengine_p.h @@ -110,6 +110,8 @@ public: qint64 pendingDatagramSize() const; #endif // QT_NO_UDPSOCKET + qint64 bytesToWrite() const; + int option(SocketOption option) const; bool setOption(SocketOption option, int value); diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index e7f8401..a150b26 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -754,6 +754,12 @@ qint64 QNativeSocketEngine::write(const char *data, qint64 size) return d->nativeWrite(data, size); } + +qint64 QNativeSocketEngine::bytesToWrite() const +{ + return 0; +} + /*! Reads up to \a maxSize bytes into \a data from the socket. Returns the number of bytes read, or -1 if an error occurred. diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index 1f6a243..a03d8f1 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -135,6 +135,8 @@ public: bool hasPendingDatagrams() const; qint64 pendingDatagramSize() const; + qint64 bytesToWrite() const; + qint64 receiveBufferSize() const; void setReceiveBufferSize(qint64 bufferSize); diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 30074cf..bd60ad1 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -1235,6 +1235,9 @@ void QSocks5SocketEnginePrivate::_q_controlSocketError(QAbstractSocket::SocketEr if (!readNotificationPending) connectData->readBuffer.clear(); emitReadNotification(); + data->controlSocket->close(); + // cause a disconnect in the outer socket + emitWriteNotification(); } else if (socks5State == Uninitialized || socks5State == AuthenticationMethodsSent || socks5State == Authenticating @@ -1245,6 +1248,7 @@ void QSocks5SocketEnginePrivate::_q_controlSocketError(QAbstractSocket::SocketEr } else { q_func()->setError(data->controlSocket->error(), data->controlSocket->errorString()); emitReadNotification(); + emitWriteNotification(); } } @@ -1623,6 +1627,16 @@ qint64 QSocks5SocketEngine::pendingDatagramSize() const } #endif // QT_NO_UDPSOCKET +qint64 QSocks5SocketEngine::bytesToWrite() const +{ + Q_D(const QSocks5SocketEngine); + if (d->data && d->data->controlSocket) { + return d->data->controlSocket->bytesToWrite(); + } else { + return 0; + } +} + int QSocks5SocketEngine::option(SocketOption option) const { Q_D(const QSocks5SocketEngine); diff --git a/src/network/socket/qsocks5socketengine_p.h b/src/network/socket/qsocks5socketengine_p.h index 7cb0920..2402517 100644 --- a/src/network/socket/qsocks5socketengine_p.h +++ b/src/network/socket/qsocks5socketengine_p.h @@ -100,6 +100,8 @@ public: qint64 pendingDatagramSize() const; #endif // QT_NO_UDPSOCKET + qint64 bytesToWrite() const; + int option(SocketOption option) const; bool setOption(SocketOption option, int value); diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 2c88130..608d772 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -707,6 +707,8 @@ void QSslSocket::close() qDebug() << "QSslSocket::close()"; #endif Q_D(QSslSocket); + if (d->plainSocket) + d->plainSocket->close(); QTcpSocket::close(); // must be cleared, reading/writing not possible on closed socket: diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 2bd1684..db46b66 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -1755,9 +1755,7 @@ void tst_QSslSocket::readFromClosedSocket() socket->close(); QVERIFY(!socket->bytesAvailable()); QVERIFY(!socket->bytesToWrite()); - socket->waitForDisconnected(); - QVERIFY(!socket->bytesAvailable()); - QVERIFY(!socket->bytesToWrite()); + QVERIFY(socket->state() == QAbstractSocket::UnconnectedState); } void tst_QSslSocket::writeBigChunk() -- cgit v0.12 From 2c672ea518265496a0fc7c5de63ca7dda880dd85 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 27 Oct 2009 16:06:36 +0100 Subject: QAbstractSocket: insert timer to prevent timeout This fixes a timeout that occurred on Mac with the gui event dispatcher: we were waiting for a write notification, but timed out when we were in closing state and still waiting for the socket engine to complete writing. Now we close the socket anyway after 2 seconds. Reviewed-by: Thiago Macieira --- src/network/socket/qabstractsocket.cpp | 29 +++++++++++++++++++++++++++-- src/network/socket/qabstractsocket.h | 1 + src/network/socket/qabstractsocket_p.h | 2 ++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 955fee0..89a6e91 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -462,6 +462,7 @@ QAbstractSocketPrivate::QAbstractSocketPrivate() isBuffered(false), blockingTimeout(30000), connectTimer(0), + disconnectTimer(0), connectTimeElapsed(0), hostLookupId(-1), socketType(QAbstractSocket::UnknownSocketType), @@ -497,9 +498,10 @@ void QAbstractSocketPrivate::resetSocketLayer() socketEngine = 0; cachedSocketDescriptor = -1; } - if (connectTimer) { + if (connectTimer) connectTimer->stop(); - } + if (disconnectTimer) + disconnectTimer->stop(); } /*! \internal @@ -1094,6 +1096,15 @@ void QAbstractSocketPrivate::_q_abortConnectionAttempt() } } +void QAbstractSocketPrivate::_q_forceDisconnect() +{ + Q_Q(QAbstractSocket); + if (socketEngine && socketEngine->isValid() && state == QAbstractSocket::ClosingState) { + socketEngine->close(); + q->disconnectFromHost(); + } +} + /*! \internal Reads data from the socket layer into the read buffer. Returns @@ -2356,6 +2367,20 @@ void QAbstractSocket::disconnectFromHostImplementation() // Wait for pending data to be written. if (d->socketEngine && d->socketEngine->isValid() && (d->writeBuffer.size() > 0 || d->socketEngine->bytesToWrite() > 0)) { + // hack: when we are waiting for the socket engine to write bytes (only + // possible when using Socks5 or HTTP socket engine), then close + // anyway after 2 seconds. This is to prevent a timeout on Mac, where we + // sometimes just did not get the write notifier from the underlying + // CFSocket and no progress was made. + if (d->writeBuffer.size() == 0 && d->socketEngine->bytesToWrite() > 0) { + if (!d->disconnectTimer) { + d->disconnectTimer = new QTimer(this); + connect(d->disconnectTimer, SIGNAL(timeout()), this, + SLOT(_q_forceDisconnect()), Qt::DirectConnection); + } + if (!d->disconnectTimer->isActive()) + d->disconnectTimer->start(2000); + } d->socketEngine->setWriteNotificationEnabled(true); #if defined(QABSTRACTSOCKET_DEBUG) diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index 5d94a01..5cfae17 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -216,6 +216,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_startConnecting(const QHostInfo &)) Q_PRIVATE_SLOT(d_func(), void _q_abortConnectionAttempt()) Q_PRIVATE_SLOT(d_func(), void _q_testConnection()) + Q_PRIVATE_SLOT(d_func(), void _q_forceDisconnect()) #ifdef QT3_SUPPORT public: diff --git a/src/network/socket/qabstractsocket_p.h b/src/network/socket/qabstractsocket_p.h index 8ccddd3..acf82bf 100644 --- a/src/network/socket/qabstractsocket_p.h +++ b/src/network/socket/qabstractsocket_p.h @@ -93,6 +93,7 @@ public: void _q_startConnecting(const QHostInfo &hostInfo); void _q_testConnection(); void _q_abortConnectionAttempt(); + void _q_forceDisconnect(); bool readSocketNotifierCalled; bool readSocketNotifierState; @@ -148,6 +149,7 @@ public: int blockingTimeout; QTimer *connectTimer; + QTimer *disconnectTimer; int connectTimeElapsed; int hostLookupId; -- cgit v0.12 From ad342b62f1b4c6b9ca0997ddb937f3871f6d875b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 27 Oct 2009 18:19:53 +0100 Subject: Make QProcess report errors from a failed subprocess start. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: João Abecasis --- src/corelib/io/qprocess_unix.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 99296c7..f040d16 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -108,6 +108,10 @@ QT_END_NAMESPACE QT_BEGIN_NAMESPACE +// POSIX requires PIPE_BUF to be 512 or larger +// so we will use 512 +static const int errorBufferMax = 512; + #ifdef Q_OS_INTEGRITY static inline char *strdup(const char *data) { @@ -752,18 +756,19 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv } // notify failure + QString error = qt_error_string(errno); #if defined (QPROCESS_DEBUG) - fprintf(stderr, "QProcessPrivate::execChild() failed, notifying parent process\n"); + fprintf(stderr, "QProcessPrivate::execChild() failed (%s), notifying parent process\n", qPrintable(error)); #endif - qt_safe_write(childStartedPipe[1], "", 1); + qt_safe_write(childStartedPipe[1], error.data(), error.length() * sizeof(QChar)); qt_safe_close(childStartedPipe[1]); childStartedPipe[1] = -1; } bool QProcessPrivate::processStarted() { - char c; - int i = qt_safe_read(childStartedPipe[0], &c, 1); + ushort buf[errorBufferMax]; + int i = qt_safe_read(childStartedPipe[0], &buf, sizeof buf); if (startupSocketNotifier) { startupSocketNotifier->setEnabled(false); startupSocketNotifier->deleteLater(); @@ -775,6 +780,11 @@ bool QProcessPrivate::processStarted() #if defined (QPROCESS_DEBUG) qDebug("QProcessPrivate::processStarted() == %s", i <= 0 ? "true" : "false"); #endif + + // did we read an error message? + if (i > 0) + q_func()->setErrorString(QString::fromUtf16(buf, i / sizeof(QChar))); + return i <= 0; } -- cgit v0.12 From b3435aa7ae1eb4a0766b82560980e49039aea1d8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 27 Oct 2009 17:54:03 +0100 Subject: Autotest: Add some debugging info as to why the subprocess fails to start --- tests/auto/qudpsocket/tst_qudpsocket.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp index 7ea2163..9418be0 100644 --- a/tests/auto/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp @@ -719,6 +719,8 @@ void tst_QUdpSocket::outOfProcessConnectedClientServerTest() QProcess serverProcess; serverProcess.start(QLatin1String("clientserver/clientserver server 1 1"), QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(serverProcess.waitForStarted(3000), + qPrintable("Failed to start subprocess: " + serverProcess.errorString())); // Wait until the server has started and reports success. while (!serverProcess.canReadLine()) @@ -732,6 +734,9 @@ void tst_QUdpSocket::outOfProcessConnectedClientServerTest() clientProcess.start(QString::fromLatin1("clientserver/clientserver connectedclient %1 %2") .arg(QLatin1String("127.0.0.1")).arg(serverPort), QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(clientProcess.waitForStarted(3000), + qPrintable("Failed to start subprocess: " + clientProcess.errorString())); + // Wait until the server has started and reports success. while (!clientProcess.canReadLine()) QVERIFY(clientProcess.waitForReadyRead(3000)); @@ -779,6 +784,8 @@ void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest() QProcess serverProcess; serverProcess.start(QLatin1String("clientserver/clientserver server 1 1"), QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(serverProcess.waitForStarted(3000), + qPrintable("Failed to start subprocess: " + serverProcess.errorString())); // Wait until the server has started and reports success. while (!serverProcess.canReadLine()) @@ -792,6 +799,9 @@ void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest() clientProcess.start(QString::fromLatin1("clientserver/clientserver unconnectedclient %1 %2") .arg(QLatin1String("127.0.0.1")).arg(serverPort), QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(clientProcess.waitForStarted(3000), + qPrintable("Failed to start subprocess: " + clientProcess.errorString())); + // Wait until the server has started and reports success. while (!clientProcess.canReadLine()) QVERIFY(clientProcess.waitForReadyRead(3000)); -- cgit v0.12 From a8b5aefc48d619c1fc0ff1e97c8e3a42baccb7c0 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 27 Oct 2009 19:07:03 +0100 Subject: QDom autotests: test is not failing anymore removing the temporary QFAIL Reviewed-by: Carlos Duclos --- tests/auto/qdom/tst_qdom.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index f3a7909..6637202 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -322,9 +322,6 @@ void tst_QDom::toString_01_data() */ void tst_QDom::toString_01() { -#ifdef Q_OS_WIN - QFAIL("make test fail instead of timing out, will be fixed later (QT-2357)"); -#endif QFETCH(QString, fileName); QFile f(fileName); -- cgit v0.12 From 5c7345809d7f620981f92cc2e93beb14b10504a9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 10:54:09 +0200 Subject: Add the ability for the match-rule builder to add argument matching. I'll use this feature to match the NameOwnerChanged signal from the bus. --- src/dbus/qdbusconnection.cpp | 4 ++-- src/dbus/qdbusconnection_p.h | 1 + src/dbus/qdbusintegrator.cpp | 17 +++++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index bb0d06f..bead369 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -609,7 +609,7 @@ bool QDBusConnection::connect(const QString &service, const QString &path, const QString owner = d->getNameOwner(service); // we don't care if the owner is empty hook.signature = signature; // it might get started later - if (!d->prepareHook(hook, key, service, owner, path, interface, name, receiver, slot, 0, false)) + if (!d->prepareHook(hook, key, service, owner, path, interface, name, QStringList(), receiver, slot, 0, false)) return false; // don't connect // avoid duplicating: @@ -663,7 +663,7 @@ bool QDBusConnection::disconnect(const QString &service, const QString &path, co QString owner = d->getNameOwner(service); // we don't care of owner is empty hook.signature = signature; - if (!d->prepareHook(hook, key, service, owner, path, interface, name, receiver, slot, 0, false)) + if (!d->prepareHook(hook, key, service, owner, path, interface, name, QStringList(), receiver, slot, 0, false)) return false; // don't disconnect // avoid duplicating: diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index ab96457..df51c27 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -278,6 +278,7 @@ public: static bool prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key, const QString &service, const QString &owner, const QString &path, const QString &interface, const QString &name, + const QStringList &argMatch, QObject *receiver, const char *signal, int minMIdx, bool buildSignature); static DBusHandlerResult messageFilter(DBusConnection *, DBusMessage *, void *); diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index fb2dd77..9e41708 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -392,7 +392,7 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v static QByteArray buildMatchRule(const QString &service, const QString & /*owner*/, const QString &objectPath, const QString &interface, - const QString &member, const QString & /*signature*/) + const QString &member, const QStringList &argMatch, const QString & /*signature*/) { QString result = QLatin1String("type='signal',"); QString keyValue = QLatin1String("%1='%2',"); @@ -406,6 +406,14 @@ static QByteArray buildMatchRule(const QString &service, const QString & /*owner if (!member.isEmpty()) result += keyValue.arg(QLatin1String("member"), member); + // add the argument string-matching now + if (!argMatch.isEmpty()) { + keyValue = QLatin1String("arg%1='%2',"); + for (int i = 0; i < argMatch.count(); ++i) + if (!argMatch.at(i).isNull()) + result += keyValue.arg(i).arg(argMatch.at(i)); + } + result.chop(1); // remove ending comma return result.toLatin1(); } @@ -1195,6 +1203,7 @@ int QDBusConnectionPrivate::findSlot(QObject* obj, const QByteArray &normalizedN bool QDBusConnectionPrivate::prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key, const QString &service, const QString &owner, const QString &path, const QString &interface, const QString &name, + const QStringList &argMatch, QObject *receiver, const char *signal, int minMIdx, bool buildSignature) { @@ -1235,7 +1244,7 @@ bool QDBusConnectionPrivate::prepareHook(QDBusConnectionPrivate::SignalHook &hoo hook.signature += QLatin1String( QDBusMetaType::typeToSignature( hook.params.at(i) ) ); } - hook.matchRule = buildMatchRule(service, owner, path, interface, mname, hook.signature); + hook.matchRule = buildMatchRule(service, owner, path, interface, mname, argMatch, hook.signature); return true; // connect to this signal } @@ -2027,7 +2036,7 @@ void QDBusConnectionPrivate::connectRelay(const QString &service, const QString SignalHook hook; QString key; - if (!prepareHook(hook, key, service, owner, path, interface, QString(), receiver, signal, + if (!prepareHook(hook, key, service, owner, path, interface, QString(), QStringList(), receiver, signal, QDBusAbstractInterface::staticMetaObject.methodCount(), true)) return; // don't connect @@ -2059,7 +2068,7 @@ void QDBusConnectionPrivate::disconnectRelay(const QString &service, const QStri SignalHook hook; QString key; - if (!prepareHook(hook, key, service, owner, path, interface, QString(), receiver, signal, + if (!prepareHook(hook, key, service, owner, path, interface, QString(), QStringList(), receiver, signal, QDBusAbstractInterface::staticMetaObject.methodCount(), true)) return; // don't connect -- cgit v0.12 From 735525dc51952c90846c8129b755422b288b204b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 11:13:10 +0200 Subject: Add new public API to QDBusConnection for connecting with string matching. The bus allows us to match string arguments when receiving messages. This is very useful for the NameOwnerChanged signal, whose first argument is usually what we're interested in. By using these new functions, you can restrict receiving of signals to those that you truly want, instead of receiving NameOwnerChanged for all services registered/unregistered on the bus. --- src/dbus/qdbusconnection.cpp | 88 ++++++++++++++++++++++++++++++++++---------- src/dbus/qdbusconnection.h | 12 ++++-- 2 files changed, 78 insertions(+), 22 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index bead369..3aaba68 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -557,42 +557,61 @@ QDBusPendingCall QDBusConnection::asyncCall(const QDBusMessage &message, int tim bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface, const QString &name, QObject *receiver, const char *slot) { - return connect(service, path, interface, name, QString(), receiver, slot); + return connect(service, path, interface, name, QStringList(), QString(), receiver, slot); } /*! - Disconnects the signal specified by the \a service, \a path, \a interface and \a name parameters from - the slot \a slot in object \a receiver. The arguments \a service and \a path can be empty, - denoting a disconnection from all signals of the (\a interface, \a name) pair, from all remote - applications. + \overload - Returns true if the disconnection was successful. + Connects the signal to the slot \a slot in object \a + receiver. Unlike the previous connect() overload, this function + allows one to specify the parameter signature to be connected + using the \a signature variable. The function will then verify + that this signature can be delivered to the slot specified by \a + slot and return false otherwise. + + Returns true if the connection was successful. + + \note This function verifies that the signal signature matches the + slot's parameters, but it does not verify that the actual + signal exists with the given signature in the remote + service. */ -bool QDBusConnection::disconnect(const QString &service, const QString &path, const QString &interface, - const QString &name, QObject *receiver, const char *slot) +bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface, + const QString &name, const QString &signature, + QObject *receiver, const char *slot) { - return disconnect(service, path, interface, name, QString(), receiver, slot); + return connect(service, path, interface, name, QStringList(), signature, receiver, slot); } /*! \overload + \since 4.6 Connects the signal to the slot \a slot in object \a - receiver. Unlike the other connect() overload, this function + receiver. Unlike the previous connect() overload, this function allows one to specify the parameter signature to be connected using the \a signature variable. The function will then verify that this signature can be delivered to the slot specified by \a slot and return false otherwise. + The \a argumentMatch parameter lists the string parameters to be matched, + in sequential order. Note that, to match an empty string, you need to + pass a QString that is empty but not null (i.e., QString("")). A null + QString skips matching at that position. + + Returns true if the connection was successful. + \note This function verifies that the signal signature matches the slot's parameters, but it does not verify that the actual signal exists with the given signature in the remote service. */ bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface, - const QString &name, const QString &signature, + const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot) { + if (!receiver || !slot || !d || !d->connection) return false; if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) @@ -609,7 +628,7 @@ bool QDBusConnection::connect(const QString &service, const QString &path, const QString owner = d->getNameOwner(service); // we don't care if the owner is empty hook.signature = signature; // it might get started later - if (!d->prepareHook(hook, key, service, owner, path, interface, name, QStringList(), receiver, slot, 0, false)) + if (!d->prepareHook(hook, key, service, owner, path, interface, name, argumentMatch, receiver, slot, 0, false)) return false; // don't connect // avoid duplicating: @@ -634,19 +653,50 @@ bool QDBusConnection::connect(const QString &service, const QString &path, const } /*! + Disconnects the signal specified by the \a service, \a path, \a interface + and \a name parameters from the slot \a slot in object \a receiver. The + arguments must be the same as passed to the connect() function. + + Returns true if the disconnection was successful. +*/ +bool QDBusConnection::disconnect(const QString &service, const QString &path, const QString &interface, + const QString &name, QObject *receiver, const char *slot) +{ + return disconnect(service, path, interface, name, QStringList(), QString(), receiver, slot); +} + +/*! \overload - Disconnects the signal from the slot \a slot in object \a - receiver. Unlike the other disconnect() overload, this function - allows one to specify the parameter signature to be disconnected - using the \a signature variable. The function will then verify - that this signature is connected to the slot specified by \a slot - and return false otherwise. + Disconnects the signal specified by the \a service, \a path, \a + interface, \a name, and \a signature parameters from the slot \a slot in + object \a receiver. The arguments must be the same as passed to the + connect() function. + + Returns true if the disconnection was successful. */ bool QDBusConnection::disconnect(const QString &service, const QString &path, const QString& interface, const QString &name, const QString &signature, QObject *receiver, const char *slot) { + return disconnect(service, path, interface, name, QStringList(), signature, receiver, slot); +} + +/*! + \overload + \since 4.6 + + Disconnects the signal specified by the \a service, \a path, \a + interface, \a name, \a argumentMatch, and \a signature parameters from + the slot \a slot in object \a receiver. The arguments must be the same as + passed to the connect() function. + + Returns true if the disconnection was successful. +*/ +bool QDBusConnection::disconnect(const QString &service, const QString &path, const QString& interface, + const QString &name, const QStringList &argumentMatch, const QString &signature, + QObject *receiver, const char *slot) +{ if (!receiver || !slot || !d || !d->connection) return false; if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) @@ -663,7 +713,7 @@ bool QDBusConnection::disconnect(const QString &service, const QString &path, co QString owner = d->getNameOwner(service); // we don't care of owner is empty hook.signature = signature; - if (!d->prepareHook(hook, key, service, owner, path, interface, name, QStringList(), receiver, slot, 0, false)) + if (!d->prepareHook(hook, key, service, owner, path, interface, name, argumentMatch, receiver, slot, 0, false)) return false; // don't disconnect // avoid duplicating: diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h index 85fc7c2..82ae726 100644 --- a/src/dbus/qdbusconnection.h +++ b/src/dbus/qdbusconnection.h @@ -132,15 +132,21 @@ public: bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot); - bool disconnect(const QString &service, const QString &path, const QString &interface, - const QString &name, QObject *receiver, const char *slot); - bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString& signature, QObject *receiver, const char *slot); + bool connect(const QString &service, const QString &path, const QString &interface, + const QString &name, const QStringList &argumentMatch, const QString& signature, + QObject *receiver, const char *slot); + + bool disconnect(const QString &service, const QString &path, const QString &interface, + const QString &name, QObject *receiver, const char *slot); bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString& signature, QObject *receiver, const char *slot); + bool disconnect(const QString &service, const QString &path, const QString &interface, + const QString &name, const QStringList &argumentMatch, const QString& signature, + QObject *receiver, const char *slot); bool registerObject(const QString &path, QObject *object, RegisterOptions options = ExportAdaptors); -- cgit v0.12 From c180071b66d4e5c22248c488df57c6acd6aa36ed Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 19:23:51 +0200 Subject: Autotest: fix improper use of the serviceOwnerChanged signal This test was doubly wrong: it first registered a service name, then it connected to signal to watch it. You can't receive a signal if you connect to it after it's emitted... Second, it waited for any serviceOwnerChanged() signal to exit the event loop, not necessarily the one we wanted to receive. This used to work because we'd always connect to the D-Bus signal, but now we don't anymore. --- tests/auto/qdbusinterface/tst_qdbusinterface.cpp | 34 ++++++++---------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp index e31a3a0..62d6342 100644 --- a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp +++ b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp @@ -171,6 +171,13 @@ class tst_QDBusInterface: public QObject { Q_OBJECT MyObject obj; +public slots: + void testServiceOwnerChanged(const QString &service) + { + if (service == "com.example.Test") + QTestEventLoop::instance().exitLoop(); + } + private slots: void initTestCase(); @@ -235,32 +242,13 @@ void tst_QDBusInterface::invalidAfterServiceOwnerChanged() QDBusInterface invalidInterface("com.example.Test", "/"); QVERIFY(!invalidInterface.isValid()); + QTestEventLoop::instance().connect(connIface, SIGNAL(serviceOwnerChanged(QString, QString, QString)), + SLOT(exitLoop())); QVERIFY(connIface->registerService("com.example.Test") == QDBusConnectionInterface::ServiceRegistered); - QSignalSpy serviceOwnerChangedSpy(connIface, SIGNAL(serviceOwnerChanged(QString, QString, QString))); - - QEventLoop loop; - QObject::connect(connIface, SIGNAL(serviceOwnerChanged(QString, QString, QString)), - &loop, SLOT(quit())); - loop.exec(); - - // at least once, but other services might have changed while running the test, too. - QVERIFY(serviceOwnerChangedSpy.count() >= 1); - bool foundOurService = false; - for (int i = 0; i < serviceOwnerChangedSpy.count(); ++i) { - QList args = serviceOwnerChangedSpy.at(i); - QString name = args[0].toString(); - QString oldOwner = args[1].toString(); - QString newOwner = args[2].toString(); - if (name == QLatin1String("com.example.Test")) { - if (newOwner == conn.baseService()) { - foundOurService = true; - break; - } - } - } - QVERIFY(foundOurService); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(!invalidInterface.isValid()); } -- cgit v0.12 From feca69fb15a4176689e4f58252361750f3444275 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 19:25:56 +0200 Subject: Autotest: add a test that tries to follow a service changing owners. I'm not sure if this used to work before... --- .../tst_qdbusabstractinterface.cpp | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index baf769f..d84350b 100644 --- a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -103,6 +103,8 @@ private slots: void getComplexSignal_data(); void getComplexSignal(); + void followSignal(); + void createErrors_data(); void createErrors(); @@ -432,6 +434,60 @@ void tst_QDBusAbstractInterface::getComplexSignal() QCOMPARE(s[0][0].value(), expectedValue); } +void tst_QDBusAbstractInterface::followSignal() +{ + const QString serviceToFollow = "com.trolltech.tst_qdbusabstractinterface.FollowMe"; + Pinger p = getPinger(serviceToFollow); + QVERIFY2(p, "Not connected to D-Bus"); + + QDBusConnection con = p->connection(); + QVERIFY(!con.interface()->isServiceRegistered(serviceToFollow)); + Pinger control = getPinger(""); + + // we need to connect the signal somewhere in order for D-Bus to enable the rules + QTestEventLoop::instance().connect(p.data(), SIGNAL(voidSignal()), SLOT(exitLoop())); + QTestEventLoop::instance().connect(control.data(), SIGNAL(voidSignal()), SLOT(exitLoop())); + QSignalSpy s(p.data(), SIGNAL(voidSignal())); + + emit targetObj.voidSignal(); + QTestEventLoop::instance().enterLoop(200); + QVERIFY(!QTestEventLoop::instance().timeout()); + + // signal must not have been received because the service isn't registered + QVERIFY(s.isEmpty()); + + // now register the service + QDBusReply r = + con.interface()->registerService(serviceToFollow, QDBusConnectionInterface::DontQueueService, + QDBusConnectionInterface::DontAllowReplacement); + QVERIFY(r.isValid() && r.value() == QDBusConnectionInterface::ServiceRegistered); + QVERIFY(con.interface()->isServiceRegistered(serviceToFollow)); + + // emit the signal again: + emit targetObj.voidSignal(); + QTestEventLoop::instance().enterLoop(2); + QVERIFY(!QTestEventLoop::instance().timeout()); + + // now the signal must have been received: + QVERIFY(s.size() == 1); + QVERIFY(s.at(0).size() == 0); + s.clear(); + + // disconnect the signal + disconnect(p.data(), SIGNAL(voidSignal()), &QTestEventLoop::instance(), 0); + + // emit the signal again: + emit targetObj.voidSignal(); + QTestEventLoop::instance().enterLoop(2); + QVERIFY(!QTestEventLoop::instance().timeout()); + + // and now it mustn't have been received + QVERIFY(s.isEmpty()); + + // cleanup: + con.interface()->unregisterService(serviceToFollow); +} + void tst_QDBusAbstractInterface::createErrors_data() { QTest::addColumn("service"); -- cgit v0.12 From 95d68417bfced3458e72ab3fdbc8f97ab15dd1db Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 12:02:40 +0200 Subject: Use the new argument-based rule-matching in QDBusAbstractInterface. This allows us to listen only to the activations we're really interested in. --- src/dbus/qdbusabstractinterface.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index 61a9d95..bea365a 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -279,9 +279,17 @@ QDBusAbstractInterface::QDBusAbstractInterface(QDBusAbstractInterfacePrivate &d, : QDBusAbstractInterfaceBase(d, parent) { // keep track of the service owner - if (!d_func()->currentOwner.isEmpty()) - QObject::connect(d_func()->connectionPrivate(), SIGNAL(serviceOwnerChanged(QString,QString,QString)), - this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); + if (d.isValid && + d.connection.isConnected() + && !d.service.isEmpty() + && !d.service.startsWith(QLatin1Char(':'))) + d_func()->connection.connect(QLatin1String(DBUS_SERVICE_DBUS), // service + QString(), // path + QLatin1String(DBUS_INTERFACE_DBUS), // interface + QLatin1String("NameOwnerChanged"), + QStringList() << d.service, + QString(), // signature + this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); } /*! @@ -296,9 +304,17 @@ QDBusAbstractInterface::QDBusAbstractInterface(const QString &service, const QSt con, false), parent) { // keep track of the service owner - if (d_func()->connection.isConnected()) - QObject::connect(d_func()->connectionPrivate(), SIGNAL(serviceOwnerChanged(QString,QString,QString)), - this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); + if (d_func()->isValid && + d_func()->connection.isConnected() + && !service.isEmpty() + && !service.startsWith(QLatin1Char(':'))) + d_func()->connection.connect(QLatin1String(DBUS_SERVICE_DBUS), // service + QString(), // path + QLatin1String(DBUS_INTERFACE_DBUS), // interface + QLatin1String("NameOwnerChanged"), + QStringList() << service, + QString(), //signature + this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); } /*! -- cgit v0.12 From 26c5680cf5adbf0c87357d84f2e2a6256724d4b7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 19:28:35 +0200 Subject: Fix the use of the owner when connecting the service "watcher". Use null services to indicate we're not interested in the owner, but empty-but-not-null to indicate we don't know what the owner is. Since empty service names are not valid, this will mean that this rule won't match. --- src/dbus/qdbusabstractinterface.cpp | 11 +++++++++-- src/dbus/qdbusintegrator.cpp | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index bea365a..994da10 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -560,9 +560,16 @@ void QDBusAbstractInterface::connectNotify(const char *signal) return; QDBusConnectionPrivate *conn = d->connectionPrivate(); - if (conn) - conn->connectRelay(d->service, d->currentOwner, d->path, d->interface, + if (conn) { + // do we know what our owner is? + QString owner; + if (!d->service.isEmpty() && d->currentOwner.isNull()) + owner = QLatin1String(""); + else + owner = d->currentOwner; + conn->connectRelay(d->service, owner, d->path, d->interface, this, signal); + } } /*! diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 9e41708..8fff8b3 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1487,7 +1487,7 @@ void QDBusConnectionPrivate::handleSignal(const QString &key, const QDBusMessage //qDBusDebug() << signalHooks.keys(); for ( ; it != end && it.key() == key; ++it) { const SignalHook &hook = it.value(); - if (!hook.owner.isEmpty() && hook.owner != msg.service()) + if (!hook.owner.isNull() && hook.owner != msg.service()) continue; if (!hook.path.isEmpty() && hook.path != msg.path()) continue; -- cgit v0.12 From ed75146e45d41ca52b64193acbf433e6d2ceaaf5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 19:33:38 +0200 Subject: Move the bulk of the signal connecting/disconnecting code to QDBusConnectionPrivate I'll need to recurse into the signal connection mechanism in the next commit. --- src/dbus/qdbusconnection.cpp | 63 ++------------------------------------ src/dbus/qdbusconnection_p.h | 6 ++++ src/dbus/qdbusintegrator.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 60 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 3aaba68..71e433e 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -619,37 +619,10 @@ bool QDBusConnection::connect(const QString &service, const QString &path, const if (interface.isEmpty() && name.isEmpty()) return false; - // check the slot - QDBusConnectionPrivate::SignalHook hook; - QString key; - QString name2 = name; - if (name2.isNull()) - name2.detach(); - QString owner = d->getNameOwner(service); // we don't care if the owner is empty - hook.signature = signature; // it might get started later - if (!d->prepareHook(hook, key, service, owner, path, interface, name, argumentMatch, receiver, slot, 0, false)) - return false; // don't connect - - // avoid duplicating: + // it might get started later QDBusWriteLocker locker(ConnectAction, d); - QDBusConnectionPrivate::SignalHookHash::ConstIterator it = d->signalHooks.find(key); - QDBusConnectionPrivate::SignalHookHash::ConstIterator end = d->signalHooks.constEnd(); - for ( ; it != end && it.key() == key; ++it) { - const QDBusConnectionPrivate::SignalHook &entry = it.value(); - if (entry.service == hook.service && - entry.owner == hook.owner && - entry.path == hook.path && - entry.signature == hook.signature && - entry.obj == hook.obj && - entry.midx == hook.midx) { - // no need to compare the parameters if it's the same slot - return true; // already there - } - } - - d->connectSignal(key, hook); - return true; + return d->connectSignal(service, owner, path, interface, name, argumentMatch, signature, receiver, slot); } /*! @@ -704,38 +677,8 @@ bool QDBusConnection::disconnect(const QString &service, const QString &path, co if (interface.isEmpty() && name.isEmpty()) return false; - // check the slot - QDBusConnectionPrivate::SignalHook hook; - QString key; - QString name2 = name; - if (name2.isNull()) - name2.detach(); - - QString owner = d->getNameOwner(service); // we don't care of owner is empty - hook.signature = signature; - if (!d->prepareHook(hook, key, service, owner, path, interface, name, argumentMatch, receiver, slot, 0, false)) - return false; // don't disconnect - - // avoid duplicating: QDBusWriteLocker locker(DisconnectAction, d); - QDBusConnectionPrivate::SignalHookHash::Iterator it = d->signalHooks.find(key); - QDBusConnectionPrivate::SignalHookHash::Iterator end = d->signalHooks.end(); - for ( ; it != end && it.key() == key; ++it) { - const QDBusConnectionPrivate::SignalHook &entry = it.value(); - if (entry.service == hook.service && - entry.owner == hook.owner && - entry.path == hook.path && - entry.signature == hook.signature && - entry.obj == hook.obj && - entry.midx == hook.midx) { - // no need to compare the parameters if it's the same slot - d->disconnectSignal(it); - return true; // it was there - } - } - - // the slot was not found - return false; + return d->disconnectSignal(service, path, interface, name, argumentMatch, signature, receiver, slot); } /*! diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index df51c27..2402719 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -175,8 +175,14 @@ public: QDBusPendingCallPrivate *sendWithReplyAsync(const QDBusMessage &message, int timeout = -1); int sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout = -1); + bool connectSignal(const QString &service, const QString &owner, const QString &path, const QString& interface, + const QString &name, const QStringList &argumentMatch, const QString &signature, + QObject *receiver, const char *slot); void connectSignal(const QString &key, const SignalHook &hook); SignalHookHash::Iterator disconnectSignal(SignalHookHash::Iterator &it); + bool disconnectSignal(const QString &service, const QString &path, const QString& interface, + const QString &name, const QStringList &argumentMatch, const QString &signature, + QObject *receiver, const char *slot); void registerObject(const ObjectTreeNode *node); void connectRelay(const QString &service, const QString ¤tOwner, const QString &path, const QString &interface, diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 8fff8b3..89a7449 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1942,6 +1942,42 @@ int QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message, QObj return 1; } +bool QDBusConnectionPrivate::connectSignal(const QString &service, const QString &owner, + const QString &path, const QString &interface, const QString &name, + const QStringList &argumentMatch, const QString &signature, + QObject *receiver, const char *slot) +{ + // check the slot + QDBusConnectionPrivate::SignalHook hook; + QString key; + QString name2 = name; + if (name2.isNull()) + name2.detach(); + + hook.signature = signature; + if (!prepareHook(hook, key, service, owner, path, interface, name, argumentMatch, receiver, slot, 0, false)) + return false; // don't connect + + // avoid duplicating: + QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.find(key); + QDBusConnectionPrivate::SignalHookHash::ConstIterator end = signalHooks.constEnd(); + for ( ; it != end && it.key() == key; ++it) { + const QDBusConnectionPrivate::SignalHook &entry = it.value(); + if (entry.service == hook.service && + entry.owner == hook.owner && + entry.path == hook.path && + entry.signature == hook.signature && + entry.obj == hook.obj && + entry.midx == hook.midx) { + // no need to compare the parameters if it's the same slot + return true; // already there + } + } + + connectSignal(key, hook); + return true; +} + void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook &hook) { signalHooks.insertMulti(key, hook); @@ -1973,6 +2009,43 @@ void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook } } +bool QDBusConnectionPrivate::disconnectSignal(const QString &service, + const QString &path, const QString &interface, const QString &name, + const QStringList &argumentMatch, const QString &signature, + QObject *receiver, const char *slot) +{ + // check the slot + QDBusConnectionPrivate::SignalHook hook; + QString key; + QString name2 = name; + if (name2.isNull()) + name2.detach(); + + hook.signature = signature; + if (!prepareHook(hook, key, service, QString(), path, interface, name, argumentMatch, receiver, slot, 0, false)) + return false; // don't disconnect + + // avoid duplicating: + QDBusConnectionPrivate::SignalHookHash::Iterator it = signalHooks.find(key); + QDBusConnectionPrivate::SignalHookHash::Iterator end = signalHooks.end(); + for ( ; it != end && it.key() == key; ++it) { + const QDBusConnectionPrivate::SignalHook &entry = it.value(); + if (entry.service == hook.service && + //entry.owner == hook.owner && + entry.path == hook.path && + entry.signature == hook.signature && + entry.obj == hook.obj && + entry.midx == hook.midx) { + // no need to compare the parameters if it's the same slot + disconnectSignal(it); + return true; // it was there + } + } + + // the slot was not found + return false; +} + QDBusConnectionPrivate::SignalHookHash::Iterator QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it) { -- cgit v0.12 From 1176ecf0b533279e5a1c97f183e5c5f1c57fb188 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 19:35:19 +0200 Subject: Stop using the NameOwnerChanged signal without arg0 in QtDBus itself We were using this signal to update the signal hooks when the remote service changed. That meant each Qt app received every single service creation, change or destruction. Now we only watch the services we're really interested in. --- src/dbus/qdbusconnection.cpp | 4 ---- src/dbus/qdbusconnection_p.h | 2 ++ src/dbus/qdbusintegrator.cpp | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 71e433e..d7088ff 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -1005,14 +1005,10 @@ void QDBusConnectionPrivate::setBusService(const QDBusConnection &connection) busService = new QDBusConnectionInterface(connection, this); ref.deref(); // busService has increased the refcounting to us // avoid cyclic refcounting -// if (mode != PeerMode) - QObject::connect(busService, SIGNAL(serviceOwnerChanged(QString,QString,QString)), - this, SIGNAL(serviceOwnerChanged(QString,QString,QString))); QObject::connect(this, SIGNAL(callWithCallbackFailed(QDBusError,QDBusMessage)), busService, SIGNAL(callWithCallbackFailed(QDBusError,QDBusMessage)), Qt::QueuedConnection); - } /*! diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index 2402719..ed29e4e 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -154,6 +154,7 @@ public: typedef QMultiHash SignalHookHash; typedef QHash MetaObjectHash; typedef QHash MatchRefCountHash; + typedef QHash WatchedServicesHash; public: // public methods are entry points from other objects @@ -270,6 +271,7 @@ public: QDBusError lastError; QStringList serviceNames; + WatchedServicesHash watchedServiceNames; SignalHookHash signalHooks; MatchRefCountHash matchRefCounts; ObjectTreeNode rootNode; diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 89a7449..c7538c3 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -501,6 +501,11 @@ static QObject *findChildObject(const QDBusConnectionPrivate::ObjectTreeNode *ro return 0; } +static bool shouldWatchService(const QString &service) +{ + return !service.isEmpty() && !service.startsWith(QLatin1Char(':')); +} + extern QDBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook); void qDBusAddSpyHook(QDBusSpyHook hook) { @@ -941,6 +946,7 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p) QDBusMetaTypeId::init(); rootNode.flags = 0; + watchedServiceNames[QLatin1String(DBUS_SERVICE_DBUS)] = 1; connect(this, SIGNAL(serviceOwnerChanged(QString,QString,QString)), this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); @@ -2005,6 +2011,22 @@ void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook hook.obj->metaObject()->method(hook.midx).signature(), qPrintable(qerror.name()), qPrintable(qerror.message())); Q_ASSERT(false); + } else { + // Successfully connected the signal + // Do we need to watch for this name? + if (shouldWatchService(hook.service)) { + WatchedServicesHash::Iterator it = watchedServiceNames.find(hook.service); + if (it != watchedServiceNames.end()) { + // already watching + ++it.value(); + } else { + // we need to watch for this service changing + QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); + connectSignal(dbusServerService, dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), + QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), + this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); + } + } } } } @@ -2051,6 +2073,19 @@ QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it) { const SignalHook &hook = it.value(); + WatchedServicesHash::Iterator sit = watchedServiceNames.find(hook.service); + if (sit != watchedServiceNames.end()) { + if (sit.value() == 1) { + watchedServiceNames.erase(sit); + QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); + disconnectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), + QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), + this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); + } else { + --sit.value(); + } + } + bool erase = false; MatchRefCountHash::iterator i = matchRefCounts.find(hook.matchRule); if (i == matchRefCounts.end()) { -- cgit v0.12 From da9a3a919326e35730b13d0660bb4a7b64e2c81c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 23 Oct 2009 19:37:16 +0200 Subject: Add a warning to user's connecting to serviceOwnerChanged directly We want people to not use this signal directly. --- src/dbus/qdbusconnectioninterface.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dbus/qdbusconnectioninterface.cpp b/src/dbus/qdbusconnectioninterface.cpp index 8670ed5..414d318 100644 --- a/src/dbus/qdbusconnectioninterface.cpp +++ b/src/dbus/qdbusconnectioninterface.cpp @@ -336,8 +336,14 @@ void QDBusConnectionInterface::connectNotify(const char *signalName) else if (qstrcmp(signalName, SIGNAL(serviceUnregistered(QString))) == 0) QDBusAbstractInterface::connectNotify(SIGNAL(NameLost(QString))); - else if (qstrcmp(signalName, SIGNAL(serviceOwnerChanged(QString,QString,QString))) == 0) + else if (qstrcmp(signalName, SIGNAL(serviceOwnerChanged(QString,QString,QString))) == 0) { + static bool warningPrinted = false; + if (!warningPrinted) { + qWarning("Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)"); + warningPrinted = true; + } QDBusAbstractInterface::connectNotify(SIGNAL(NameOwnerChanged(QString,QString,QString))); + } } /*! -- cgit v0.12 From fb941d5c297e3205d421126c38a9f3a262584b88 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 26 Oct 2009 12:21:29 +0100 Subject: Add QDBusServiceWatcher class. --- src/dbus/dbus.pro | 148 ++++++++++++++------------- src/dbus/qdbusservicewatcher.cpp | 211 +++++++++++++++++++++++++++++++++++++++ src/dbus/qdbusservicewatcher.h | 103 +++++++++++++++++++ 3 files changed, 393 insertions(+), 69 deletions(-) create mode 100644 src/dbus/qdbusservicewatcher.cpp create mode 100644 src/dbus/qdbusservicewatcher.h diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro index 57c6a58..9ab3920 100644 --- a/src/dbus/dbus.pro +++ b/src/dbus/dbus.pro @@ -1,77 +1,87 @@ -TARGET = QtDBus -QPRO_PWD = $$PWD -QT = core xml -CONFIG += link_pkgconfig -DEFINES += QDBUS_MAKEDLL DBUS_API_SUBJECT_TO_CHANGE +TARGET = QtDBus +QPRO_PWD = $$PWD +QT = core \ + xml +CONFIG += link_pkgconfig +DEFINES += QDBUS_MAKEDLL \ + DBUS_API_SUBJECT_TO_CHANGE QMAKE_CXXFLAGS += $$QT_CFLAGS_DBUS - -contains(QT_CONFIG, dbus-linked) { +contains(QT_CONFIG, dbus-linked) { LIBS_PRIVATE += $$QT_LIBS_DBUS - DEFINES += QT_LINKED_LIBDBUS + DEFINES += QT_LINKED_LIBDBUS } -#INCLUDEPATH += . - -unix { - QMAKE_PKGCONFIG_DESCRIPTION = Qt DBus module - QMAKE_PKGCONFIG_REQUIRES = QtCore QtXml +# INCLUDEPATH += . +unix { + QMAKE_PKGCONFIG_DESCRIPTION = Qt \ + DBus \ + module + QMAKE_PKGCONFIG_REQUIRES = QtCore \ + QtXml } - -win32 { - LIBS_PRIVATE += -lws2_32 -ladvapi32 -lnetapi32 -luser32 - CONFIG(debug, debug|release):LIBS_PRIVATE += -ldbus-1d - else:LIBS_PRIVATE += -ldbus-1 +win32 { + LIBS_PRIVATE += -lws2_32 \ + -ladvapi32 \ + -lnetapi32 \ + -luser32 + CONFIG(debug, debug|release):LIBS_PRIVATE += -ldbus-1d + else:LIBS_PRIVATE += -ldbus-1 } - include(../qbase.pri) - -PUB_HEADERS = qdbusargument.h \ - qdbusconnectioninterface.h \ - qdbusmacros.h \ - qdbuserror.h \ - qdbusextratypes.h \ - qdbusmessage.h \ - qdbusserver.h \ - qdbusconnection.h \ - qdbusabstractinterface.h \ - qdbusinterface.h \ - qdbusabstractadaptor.h \ - qdbusreply.h \ - qdbusmetatype.h \ - qdbuspendingcall.h \ - qdbuspendingreply.h \ - qdbuscontext.h - +PUB_HEADERS = qdbusargument.h \ + qdbusconnectioninterface.h \ + qdbusmacros.h \ + qdbuserror.h \ + qdbusextratypes.h \ + qdbusmessage.h \ + qdbusserver.h \ + qdbusconnection.h \ + qdbusabstractinterface.h \ + qdbusinterface.h \ + qdbusabstractadaptor.h \ + qdbusreply.h \ + qdbusmetatype.h \ + qdbuspendingcall.h \ + qdbuspendingreply.h \ + qdbuscontext.h HEADERS += $$PUB_HEADERS \ - qdbusconnection_p.h qdbusmessage_p.h \ - qdbusinterface_p.h qdbusxmlparser_p.h qdbusabstractadaptor_p.h \ - qdbusargument_p.h qdbusutil_p.h qdbusabstractinterface_p.h \ - qdbuscontext_p.h qdbusthreaddebug_p.h qdbusintegrator_p.h \ - qdbuspendingcall_p.h qdbus_symbols_p.h - -SOURCES += qdbusconnection.cpp \ - qdbusconnectioninterface.cpp \ - qdbuserror.cpp \ - qdbusintegrator.cpp \ - qdbusmessage.cpp \ - qdbusserver.cpp \ - qdbusabstractinterface.cpp \ - qdbusinterface.cpp \ - qdbusxmlparser.cpp \ - qdbusutil.cpp \ - qdbusintrospection.cpp \ - qdbusabstractadaptor.cpp \ - qdbusinternalfilters.cpp \ - qdbusmetaobject.cpp \ - qdbusxmlgenerator.cpp \ - qdbusmisc.cpp \ - qdbusargument.cpp \ - qdbusreply.cpp \ - qdbusmetatype.cpp \ - qdbusextratypes.cpp \ - qdbusmarshaller.cpp \ - qdbuscontext.cpp \ - qdbuspendingcall.cpp \ - qdbuspendingreply.cpp \ - qdbus_symbols.cpp - + qdbusconnection_p.h \ + qdbusmessage_p.h \ + qdbusinterface_p.h \ + qdbusxmlparser_p.h \ + qdbusabstractadaptor_p.h \ + qdbusargument_p.h \ + qdbusutil_p.h \ + qdbusabstractinterface_p.h \ + qdbuscontext_p.h \ + qdbusthreaddebug_p.h \ + qdbusintegrator_p.h \ + qdbuspendingcall_p.h \ + qdbus_symbols_p.h \ + qdbusservicewatcher.h +SOURCES += qdbusconnection.cpp \ + qdbusconnectioninterface.cpp \ + qdbuserror.cpp \ + qdbusintegrator.cpp \ + qdbusmessage.cpp \ + qdbusserver.cpp \ + qdbusabstractinterface.cpp \ + qdbusinterface.cpp \ + qdbusxmlparser.cpp \ + qdbusutil.cpp \ + qdbusintrospection.cpp \ + qdbusabstractadaptor.cpp \ + qdbusinternalfilters.cpp \ + qdbusmetaobject.cpp \ + qdbusxmlgenerator.cpp \ + qdbusmisc.cpp \ + qdbusargument.cpp \ + qdbusreply.cpp \ + qdbusmetatype.cpp \ + qdbusextratypes.cpp \ + qdbusmarshaller.cpp \ + qdbuscontext.cpp \ + qdbuspendingcall.cpp \ + qdbuspendingreply.cpp \ + qdbus_symbols.cpp \ + qdbusservicewatcher.cpp diff --git a/src/dbus/qdbusservicewatcher.cpp b/src/dbus/qdbusservicewatcher.cpp new file mode 100644 index 0000000..d8a33c3 --- /dev/null +++ b/src/dbus/qdbusservicewatcher.cpp @@ -0,0 +1,211 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDBus module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdbusservicewatcher.h" +#include "qdbusconnection.h" +#include "qdbus_symbols_p.h" + +#include + +#include + +Q_GLOBAL_STATIC_WITH_ARGS(QString, busService, (QLatin1String(DBUS_SERVICE_DBUS))) +Q_GLOBAL_STATIC_WITH_ARGS(QString, busPath, (QLatin1String(DBUS_PATH_DBUS))) +Q_GLOBAL_STATIC_WITH_ARGS(QString, busInterface, (QLatin1String(DBUS_INTERFACE_DBUS))) +Q_GLOBAL_STATIC_WITH_ARGS(QString, signalName, (QLatin1String("NameOwnerChanged"))) + +class QDBusServiceWatcherPrivate: public QObjectPrivate +{ + Q_DECLARE_PUBLIC(QDBusServiceWatcher) +public: + QDBusServiceWatcherPrivate(const QDBusConnection &c, QDBusServiceWatcher::WatchMode wm) + : connection(c), watchMode(wm) + { + } + + QStringList servicesWatched; + QDBusConnection connection; + QDBusServiceWatcher::WatchMode watchMode; + + void _q_serviceOwnerChanged(const QString &, const QString &, const QString &); + void setConnection(const QStringList &services, const QDBusConnection &c, QDBusServiceWatcher::WatchMode watchMode); + + QStringList matchArgsForService(const QString &service); + void addService(const QString &service); + void removeService(const QString &service); +}; + +void QDBusServiceWatcherPrivate::_q_serviceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner) +{ + Q_Q(QDBusServiceWatcher); + emit q->serviceOwnerChanged(service, oldOwner, newOwner); + if (oldOwner.isEmpty()) + emit q->serviceRegistered(service); + else if (newOwner.isEmpty()) + emit q->serviceUnregistered(service); +} + +void QDBusServiceWatcherPrivate::setConnection(const QStringList &s, const QDBusConnection &c, QDBusServiceWatcher::WatchMode wm) +{ + if (connection.isConnected()) { + // remove older rules + foreach (const QString &s, servicesWatched) + removeService(s); + } + + connection = c; + watchMode = wm; + servicesWatched = s; + + if (connection.isConnected()) { + // add new rules + foreach (const QString &s, servicesWatched) + addService(s); + } +} + +QStringList QDBusServiceWatcherPrivate::matchArgsForService(const QString &service) +{ + QStringList matchArgs; + matchArgs << service; + + switch (watchMode) { + case QDBusServiceWatcher::WatchForOwnerChange: + break; + + case QDBusServiceWatcher::WatchForRegistration: + matchArgs << QString::fromLatin1("", 0); + break; + + case QDBusServiceWatcher::WatchForUnregistration: + matchArgs << QString() << QString::fromLatin1("", 0); + break; + } + return matchArgs; +} + +void QDBusServiceWatcherPrivate::addService(const QString &service) +{ + QStringList matchArgs = matchArgsForService(service); + connection.connect(*busService(), *busPath(), *busInterface(), *signalName(), + matchArgs, QString(), q_func(), + SLOT(_q_serviceOwnerChanged(QString,QString,QString))); +} + +void QDBusServiceWatcherPrivate::removeService(const QString &service) +{ + QStringList matchArgs = matchArgsForService(service); + connection.disconnect(*busService(), *busPath(), *busInterface(), *signalName(), + matchArgs, QString(), q_func(), + SLOT(_q_serviceOwnerChanged(QString,QString,QString))); +} + +QDBusServiceWatcher::QDBusServiceWatcher(QObject *parent) + : QObject(*new QDBusServiceWatcherPrivate(QDBusConnection(QString()), WatchForOwnerChange), parent) +{ +} + +QDBusServiceWatcher::QDBusServiceWatcher(const QString &service, const QDBusConnection &connection, WatchMode watchMode, QObject *parent) + : QObject(*new QDBusServiceWatcherPrivate(connection, watchMode), parent) +{ + d_func()->setConnection(QStringList() << service, connection, watchMode); +} + +QDBusServiceWatcher::~QDBusServiceWatcher() +{ +} + +QStringList QDBusServiceWatcher::watchedServices() const +{ + return d_func()->servicesWatched; +} + +void QDBusServiceWatcher::setWatchedServices(const QStringList &services) +{ + Q_D(QDBusServiceWatcher); + if (services == d->servicesWatched) + return; + d->setConnection(services, d->connection, d->watchMode); +} + +void QDBusServiceWatcher::addWatchedService(const QString &newService) +{ + Q_D(QDBusServiceWatcher); + if (d->servicesWatched.contains(newService)) + return; + d->addService(newService); + d->servicesWatched << newService; +} + +bool QDBusServiceWatcher::removeWatchedService(const QString &service) +{ + Q_D(QDBusServiceWatcher); + d->removeService(service); + return d->servicesWatched.removeOne(service); +} + +QDBusServiceWatcher::WatchMode QDBusServiceWatcher::watchMode() const +{ + return d_func()->watchMode; +} + +void QDBusServiceWatcher::setWatchMode(WatchMode mode) +{ + Q_D(QDBusServiceWatcher); + if (mode == d->watchMode) + return; + d->setConnection(d->servicesWatched, d->connection, mode); +} + +QDBusConnection QDBusServiceWatcher::connection() const +{ + return d_func()->connection; +} + +void QDBusServiceWatcher::setConnection(const QDBusConnection &connection) +{ + Q_D(QDBusServiceWatcher); + if (connection.name() == d->connection.name()) + return; + d->setConnection(d->servicesWatched, connection, d->watchMode); +} + +#include "moc_qdbusservicewatcher.cpp" diff --git a/src/dbus/qdbusservicewatcher.h b/src/dbus/qdbusservicewatcher.h new file mode 100644 index 0000000..a968a9c --- /dev/null +++ b/src/dbus/qdbusservicewatcher.h @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDBus module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDBUSSERVICEWATCHER_H +#define QDBUSSERVICEWATCHER_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(DBus) + +class QDBusConnection; + +class QDBusServiceWatcherPrivate; +class QDBUS_EXPORT QDBusServiceWatcher: public QObject +{ + Q_OBJECT + Q_PROPERTY(QStringList watchedServices READ watchedServices WRITE setWatchedServices) + Q_PROPERTY(WatchMode watchMode READ watchMode WRITE setWatchMode) +public: + enum WatchModeFlag { + WatchForRegistration = 0x01, + WatchForUnregistration = 0x02, + WatchForOwnerChange = 0x03 + }; + Q_DECLARE_FLAGS(WatchMode, WatchModeFlag) + + explicit QDBusServiceWatcher(QObject *parent = 0); + QDBusServiceWatcher(const QString &service, const QDBusConnection &connection, + WatchMode watchMode = WatchForOwnerChange, QObject *parent = 0); + ~QDBusServiceWatcher(); + + QStringList watchedServices() const; + void setWatchedServices(const QStringList &services); + void addWatchedService(const QString &newService); + bool removeWatchedService(const QString &service); + + WatchMode watchMode() const; + void setWatchMode(WatchMode mode); + + QDBusConnection connection() const; + void setConnection(const QDBusConnection &connection); + +Q_SIGNALS: + void serviceRegistered(const QString &service); + void serviceUnregistered(const QString &service); + void serviceOwnerChanged(const QString &service, const QString &oldOwner, const QString &newOwner); + +private: + Q_PRIVATE_SLOT(d_func(), void _q_serviceOwnerChanged(QString,QString,QString)) + Q_DISABLE_COPY(QDBusServiceWatcher) + Q_DECLARE_PRIVATE(QDBusServiceWatcher) +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusServiceWatcher::WatchMode) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QDBUSSERVICEWATCHER_H -- cgit v0.12 From f9b55c5263ba25e707c8cc35988935a804af2f50 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 26 Oct 2009 14:08:01 +0100 Subject: Autotest: add unit test for QDBusServiceWatcher --- .../qdbusservicewatcher/qdbusservicewatcher.pro | 8 + .../tst_qdbusservicewatcher.cpp | 273 +++++++++++++++++++++ 2 files changed, 281 insertions(+) create mode 100644 tests/auto/qdbusservicewatcher/qdbusservicewatcher.pro create mode 100644 tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp diff --git a/tests/auto/qdbusservicewatcher/qdbusservicewatcher.pro b/tests/auto/qdbusservicewatcher/qdbusservicewatcher.pro new file mode 100644 index 0000000..4970f16 --- /dev/null +++ b/tests/auto/qdbusservicewatcher/qdbusservicewatcher.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +QT = core +contains(QT_CONFIG,dbus): { + SOURCES += tst_qdbusservicewatcher.cpp + QT += dbus +} else { + SOURCES += ../qdbusmarshall/dummy.cpp +} diff --git a/tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp b/tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp new file mode 100644 index 0000000..10b43b1 --- /dev/null +++ b/tests/auto/qdbusservicewatcher/tst_qdbusservicewatcher.cpp @@ -0,0 +1,273 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class tst_QDBusServiceWatcher: public QObject +{ + Q_OBJECT + QString serviceName; +public: + tst_QDBusServiceWatcher(); + +private slots: + void initTestCase(); + void cleanup(); + + void watchForCreation(); + void watchForDisappearance(); + void watchForOwnerChange(); + void modeChange(); +}; + +tst_QDBusServiceWatcher::tst_QDBusServiceWatcher() + : serviceName("com.example.TestName") +{ +} + +void tst_QDBusServiceWatcher::initTestCase() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + QVERIFY(con.isConnected()); +} + +void tst_QDBusServiceWatcher::cleanup() +{ + // ensure that the name isn't registered + QDBusConnection::sessionBus().unregisterService(serviceName); +} + +void tst_QDBusServiceWatcher::watchForCreation() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + QVERIFY(con.isConnected()); + + QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration); + + QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); + QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString))); + QSignalSpy spyO(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString))); + QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceRegistered(QString)), SLOT(exitLoop())); + + // register a name + QVERIFY(con.registerService(serviceName)); + + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(spyR.count(), 1); + QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyU.count(), 0); + + QCOMPARE(spyO.count(), 1); + QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QVERIFY(spyO.at(0).at(1).toString().isEmpty()); + QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); + + spyR.clear(); + spyU.clear(); + spyO.clear(); + + // unregister it: + con.unregisterService(serviceName); + + // and register again + QVERIFY(con.registerService(serviceName)); + + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(spyR.count(), 1); + QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyU.count(), 0); + + QCOMPARE(spyO.count(), 1); + QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QVERIFY(spyO.at(0).at(1).toString().isEmpty()); + QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); +} + +void tst_QDBusServiceWatcher::watchForDisappearance() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + QVERIFY(con.isConnected()); + + QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForUnregistration); + + QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); + QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString))); + QSignalSpy spyO(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString))); + QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceUnregistered(QString)), SLOT(exitLoop())); + + // register a name + QVERIFY(con.registerService(serviceName)); + + // unregister it: + con.unregisterService(serviceName); + + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(spyR.count(), 0); + + QCOMPARE(spyU.count(), 1); + QCOMPARE(spyU.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyO.count(), 1); + QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(1).toString(), con.baseService()); + QVERIFY(spyO.at(0).at(2).toString().isEmpty()); +} + +void tst_QDBusServiceWatcher::watchForOwnerChange() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + QVERIFY(con.isConnected()); + + QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForOwnerChange); + + QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); + QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString))); + QSignalSpy spyO(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString))); + QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceRegistered(QString)), SLOT(exitLoop())); + + // register a name + QVERIFY(con.registerService(serviceName)); + + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(spyR.count(), 1); + QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyU.count(), 0); + + QCOMPARE(spyO.count(), 1); + QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QVERIFY(spyO.at(0).at(1).toString().isEmpty()); + QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); + + spyR.clear(); + spyU.clear(); + spyO.clear(); + + // unregister it: + con.unregisterService(serviceName); + + // and register again + QVERIFY(con.registerService(serviceName)); + + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(spyR.count(), 1); + QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyU.count(), 1); + QCOMPARE(spyU.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyO.count(), 2); + QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(1).toString(), con.baseService()); + QVERIFY(spyO.at(0).at(2).toString().isEmpty()); + QCOMPARE(spyO.at(1).at(0).toString(), serviceName); + QVERIFY(spyO.at(1).at(1).toString().isEmpty()); + QCOMPARE(spyO.at(1).at(2).toString(), con.baseService()); +} + +void tst_QDBusServiceWatcher::modeChange() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + QVERIFY(con.isConnected()); + + QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration); + + QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString))); + QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString))); + QSignalSpy spyO(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString))); + QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceRegistered(QString)), SLOT(exitLoop())); + + // register a name + QVERIFY(con.registerService(serviceName)); + + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(spyR.count(), 1); + QCOMPARE(spyR.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyU.count(), 0); + + QCOMPARE(spyO.count(), 1); + QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QVERIFY(spyO.at(0).at(1).toString().isEmpty()); + QCOMPARE(spyO.at(0).at(2).toString(), con.baseService()); + + spyR.clear(); + spyU.clear(); + spyO.clear(); + + watcher.setWatchMode(QDBusServiceWatcher::WatchForUnregistration); + + // unregister it: + con.unregisterService(serviceName); + + QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceUnregistered(QString)), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(1); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(spyR.count(), 0); + + QCOMPARE(spyU.count(), 1); + QCOMPARE(spyU.at(0).at(0).toString(), serviceName); + + QCOMPARE(spyO.count(), 1); + QCOMPARE(spyO.at(0).at(0).toString(), serviceName); + QCOMPARE(spyO.at(0).at(1).toString(), con.baseService()); + QVERIFY(spyO.at(0).at(2).toString().isEmpty()); +} + +QTEST_MAIN(tst_QDBusServiceWatcher) +#include "tst_qdbusservicewatcher.moc" -- cgit v0.12 From bd9a8091eb8c731569e4972a04f23c9a2f48391c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 26 Oct 2009 15:16:47 +0100 Subject: Doc: add documentation for QDBusServiceWatcher class. --- src/dbus/qdbusservicewatcher.cpp | 163 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/src/dbus/qdbusservicewatcher.cpp b/src/dbus/qdbusservicewatcher.cpp index d8a33c3..4872732 100644 --- a/src/dbus/qdbusservicewatcher.cpp +++ b/src/dbus/qdbusservicewatcher.cpp @@ -138,26 +138,159 @@ void QDBusServiceWatcherPrivate::removeService(const QString &service) SLOT(_q_serviceOwnerChanged(QString,QString,QString))); } +/*! + \class QDBusServiceWatcher + \since 4.6 + \inmodule QtDBus + + \brief The QDBusServiceWatcher class allows the user to watch for a bus service change. + + A QDBusServiceWatcher object can be used to notify the application about + an ownership change of a service name on the bus. It has three watch + modes: + + \list + \o watching for service registration only + \o watching for service unregistration only + \o watching for any kind of service ownership change (the default mode) + \endlist + + Besides being created or deleted, services may change owners without a + unregister/register operation happening. So the \ref serviceRegistered() + and \ref serviceUnregistered() signals may not be emitted if that + happens. + + This class is more efficient than using the + QDBusConnectionInterface::serviceOwnerChanged() signal because it allows + one to receive only the signals for which the class is interested in. + + \sa QDBusConnection +*/ + +/*! + \enum QDBusServiceWatcher::WatchModeFlag + + QDBusServiceWatcher supports three different watch modes, which are configured by this flag: + + \value WatchForRegistration watch for service registration only, ignoring + any signals related to other service ownership change. + + \value WatchForUnregistration watch for service unregistration only, + ignoring any signals related to other service ownership change. + + \value WatchForOwnerChange watch for any kind of service ownership + change. +*/ + +/*! + \property QDBusServiceWatcher::watchMode + + The \c watchMode property holds the current watch mode for this + QDBusServiceWatcher object. The default value for this property is + QDBusServiceWatcher::WatchForOwnershipChange. +*/ + +/*! + \property QDBusServiceWatcher::watchedServices + + The \c servicesWatched property holds the list of services watched. + + Note that modifying this list with setServicesWatched() is an expensive + operation. If you can, prefer to change it by way of addWatchedService() + and removeWatchedService(). +*/ + +/*! + \fn void QDBusServiceWatcher::serviceRegistered(const QString &serviceName) + + This signal is emitted whenever this object detects that the service \a + serviceName became available on the bus. + + \sa serviceUnregistered(), serviceOwnerChanged() +*/ + +/*! + \fn void QDBusServiceWatcher::serviceUnregistered(const QString &serviceName) + + This signal is emitted whenever this object detects that the service \a + serviceName was unregistered from the bus and is no longer available. + + \sa serviceRegistered(), serviceOwnerChanged() +*/ + +/*! + \fn void QDBusServiceWatcher::serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner) + + This signal is emitted whenever this object detects that there was a + service ownership change relating to the \a serviceName service. The \a + oldOwner parameter contains the old owner name and \a newOwner is the new + owner. Both \a oldOwner and \a newOwner are unique connection names. + + Note that this signal is also emitted whenever the \a serviceName service + was registered or unregistered. If it was registered, \a oldOwner will + contain an empty string, whereas if it was unregistered, \a newOwner will + contain an empty string. + + If you need only to find out if the service is registered or unregistered + only, without being notified that the ownership changed, consider using + the specific modes for those operations. This class is more efficient if + you use the more specific modes. + + \sa serviceRegistered(), serviceUnregistered() +*/ + +/*! + Creates a QDBusServiceWatcher object. Note that until you set a + connection with setConnection(), this object will not emit any signals. + + The \a parent parameter is passed to QObject to set the parent of this + object. +*/ QDBusServiceWatcher::QDBusServiceWatcher(QObject *parent) : QObject(*new QDBusServiceWatcherPrivate(QDBusConnection(QString()), WatchForOwnerChange), parent) { } +/*! + Creates a QDBusServiceWatcher object and attaches it to the \a connection + connection. Also, this function immediately starts watching for \a + watchMode changes to service \a service. + + The \a parent parameter is passed to QObject to set the parent of this + object. +*/ QDBusServiceWatcher::QDBusServiceWatcher(const QString &service, const QDBusConnection &connection, WatchMode watchMode, QObject *parent) : QObject(*new QDBusServiceWatcherPrivate(connection, watchMode), parent) { d_func()->setConnection(QStringList() << service, connection, watchMode); } +/*! + Destroys the QDBusServiceWatcher object and releases any resources + associated with it. +*/ QDBusServiceWatcher::~QDBusServiceWatcher() { } +/*! + Returns the list of D-Bus services that are being watched. + + \sa setWatchedServices() +*/ QStringList QDBusServiceWatcher::watchedServices() const { return d_func()->servicesWatched; } +/*! + Sets the list of D-Bus services being watched to be \a services. + + Note that setting the entire list means removing all previous rules for + watching services and adding new ones. This is an expensive operation and + should be avoided, if possible. Instead, use addWatchedService() and + removeWatchedService() if you can to manipulate entries in the list. +*/ void QDBusServiceWatcher::setWatchedServices(const QStringList &services) { Q_D(QDBusServiceWatcher); @@ -166,6 +299,11 @@ void QDBusServiceWatcher::setWatchedServices(const QStringList &services) d->setConnection(services, d->connection, d->watchMode); } +/*! + Adds \a newService to the list of services to be watched by this object. + This function is more efficient than setWatchedServices() and should be + used whenever possible to add services. +*/ void QDBusServiceWatcher::addWatchedService(const QString &newService) { Q_D(QDBusServiceWatcher); @@ -175,6 +313,14 @@ void QDBusServiceWatcher::addWatchedService(const QString &newService) d->servicesWatched << newService; } +/*! + Removes the \a service from the list of services being watched by this + object. Note that D-Bus notifications are asynchronous, so there may + still be signals pending delivery about \a service. Those signals will + still be emitted whenever the D-Bus messages are processed. + + This function returns true if any services were removed. +*/ bool QDBusServiceWatcher::removeWatchedService(const QString &service) { Q_D(QDBusServiceWatcher); @@ -195,11 +341,28 @@ void QDBusServiceWatcher::setWatchMode(WatchMode mode) d->setConnection(d->servicesWatched, d->connection, mode); } +/*! + Returns the QDBusConnection that this object is attached to. + + \sa setConnection() +*/ QDBusConnection QDBusServiceWatcher::connection() const { return d_func()->connection; } +/*! + Sets the D-Bus connection that this object is attached to be \a + connection. All services watched will be transferred to this connection. + + Note that QDBusConnection objects are reference counted: + QDBusServiceWatcher will keep a reference for this connection while it + exists. The connection is not closed until the reference count drops to + zero, so this will ensure that any notifications are received while this + QDBusServiceWatcher object exists. + + \sa connection() +*/ void QDBusServiceWatcher::setConnection(const QDBusConnection &connection) { Q_D(QDBusServiceWatcher); -- cgit v0.12 From 0283ca4cf2ad1c9e642b24f8376aa7179fa54599 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 22 Oct 2009 20:59:07 +0200 Subject: Add some STL compatibility for QContiguousCache and private inheritance The private inheritance ensures that we don't try to access the types under the wrong pointer. If we did that, we'd cause strict aliasing violations. Reviewed-by: Olivier Goffart --- src/corelib/tools/qcontiguouscache.h | 125 ++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 60 deletions(-) diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h index ad78d1f..862df61 100644 --- a/src/corelib/tools/qcontiguouscache.h +++ b/src/corelib/tools/qcontiguouscache.h @@ -62,6 +62,12 @@ struct Q_CORE_EXPORT QContiguousCacheData int start; int offset; uint sharable : 1; + // uint unused : 31; + + // total is 24 bytes (HP-UX aCC: 40 bytes) + // the next entry is already aligned to 8 bytes + // there will be an 8 byte gap here if T requires 16-byte alignment + // (such as long double on 64-bit platforms, __int128, __float128) #ifdef QT_QCONTIGUOUSCACHE_DEBUG void dump() const; @@ -69,33 +75,32 @@ struct Q_CORE_EXPORT QContiguousCacheData }; template -struct QContiguousCacheTypedData +struct QContiguousCacheTypedData: private QContiguousCacheData { - QBasicAtomicInt ref; - int alloc; - int count; - int start; - int offset; - uint sharable : 1; - // uint unused : 31; - - // total is 24 bytes (HP-UX aCC: 40 bytes) - // the next entry is already aligned to 8 bytes - // there will be an 8 byte gap here if T requires 16-byte alignment - // (such as long double on 64-bit platforms, __int128, __float128) - + // private inheritance to avoid aliasing warningss T array[1]; + + static inline void free(QContiguousCacheTypedData *data) { QContiguousCacheData::free(data); } }; template class QContiguousCache { typedef QContiguousCacheTypedData Data; - union { QContiguousCacheData *p; QContiguousCacheTypedData *d; }; + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; }; public: + // STL compatibility + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef ptrdiff_t difference_type; + typedef int size_type; + explicit QContiguousCache(int capacity = 0); QContiguousCache(const QContiguousCache &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); } - inline ~QContiguousCache() { if (!d) return; if (!d->ref.deref()) free(d); } + inline ~QContiguousCache() { if (!d) return; if (!d->ref.deref()) free(p); } inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } @@ -128,10 +133,10 @@ public: inline int firstIndex() const { return d->offset; } inline int lastIndex() const { return d->offset + d->count - 1; } - inline const T &first() const { Q_ASSERT(!isEmpty()); return d->array[d->start]; } - inline const T &last() const { Q_ASSERT(!isEmpty()); return d->array[(d->start + d->count -1) % d->alloc]; } - inline T &first() { Q_ASSERT(!isEmpty()); detach(); return d->array[d->start]; } - inline T &last() { Q_ASSERT(!isEmpty()); detach(); return d->array[(d->start + d->count -1) % d->alloc]; } + inline const T &first() const { Q_ASSERT(!isEmpty()); return p->array[d->start]; } + inline const T &last() const { Q_ASSERT(!isEmpty()); return p->array[(d->start + d->count -1) % d->alloc]; } + inline T &first() { Q_ASSERT(!isEmpty()); detach(); return p->array[d->start]; } + inline T &last() { Q_ASSERT(!isEmpty()); detach(); return p->array[(d->start + d->count -1) % d->alloc]; } void removeFirst(); T takeFirst(); @@ -161,9 +166,9 @@ private: template void QContiguousCache::detach_helper() { - union { QContiguousCacheData *p; QContiguousCacheTypedData *d; } x; + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; } x; - x.p = malloc(d->alloc); + x.d = malloc(d->alloc); x.d->ref = 1; x.d->count = d->count; x.d->start = d->start; @@ -171,8 +176,8 @@ void QContiguousCache::detach_helper() x.d->alloc = d->alloc; x.d->sharable = true; - T *dest = x.d->array + x.d->start; - T *src = d->array + d->start; + T *dest = x.p->array + x.d->start; + T *src = p->array + d->start; int oldcount = x.d->count; while (oldcount--) { if (QTypeInfo::isComplex) { @@ -181,15 +186,15 @@ void QContiguousCache::detach_helper() *dest = *src; } dest++; - if (dest == x.d->array + x.d->alloc) - dest = x.d->array; + if (dest == x.p->array + x.d->alloc) + dest = x.p->array; src++; - if (src == d->array + d->alloc) - src = d->array; + if (src == p->array + d->alloc) + src = p->array; } if (!d->ref.deref()) - free(d); + free(p); d = x.d; } @@ -205,8 +210,8 @@ void QContiguousCache::setCapacity(int asize) x.d->count = qMin(d->count, asize); x.d->offset = d->offset + d->count - x.d->count; x.d->start = x.d->offset % x.d->alloc; - T *dest = x.d->array + (x.d->start + x.d->count-1) % x.d->alloc; - T *src = d->array + (d->start + d->count-1) % d->alloc; + T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc; + T *src = p->array + (d->start + d->count-1) % d->alloc; int oldcount = x.d->count; while (oldcount--) { if (QTypeInfo::isComplex) { @@ -214,11 +219,11 @@ void QContiguousCache::setCapacity(int asize) } else { *dest = *src; } - if (dest == x.d->array) - dest = x.d->array + x.d->alloc; + if (dest == x.p->array) + dest = x.p->array + x.d->alloc; dest--; - if (src == d->array) - src = d->array + d->alloc; + if (src == p->array) + src = p->array + d->alloc; src--; } /* free old */ @@ -232,24 +237,24 @@ void QContiguousCache::clear() if (d->ref == 1) { if (QTypeInfo::isComplex) { int oldcount = d->count; - T * i = d->array + d->start; - T * e = d->array + d->alloc; + T * i = p->array + d->start; + T * e = p->array + d->alloc; while (oldcount--) { i->~T(); i++; if (i == e) - i = d->array; + i = p->array; } } d->count = d->start = d->offset = 0; } else { - union { QContiguousCacheData *p; QContiguousCacheTypedData *d; } x; - x.p = malloc(d->alloc); + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; } x; + x.d = malloc(d->alloc); x.d->ref = 1; x.d->alloc = d->alloc; x.d->count = x.d->start = x.d->offset = 0; x.d->sharable = true; - if (!d->ref.deref()) free(d); + if (!d->ref.deref()) free(p); d = x.d; } } @@ -263,7 +268,7 @@ inline QContiguousCacheData *QContiguousCache::malloc(int aalloc) template QContiguousCache::QContiguousCache(int cap) { - p = malloc(cap); + d = malloc(cap); d->ref = 1; d->alloc = cap; d->count = d->start = d->offset = 0; @@ -303,13 +308,13 @@ void QContiguousCache::free(Data *x) { if (QTypeInfo::isComplex) { int oldcount = d->count; - T * i = d->array + d->start; - T * e = d->array + d->alloc; + T * i = p->array + d->start; + T * e = p->array + d->alloc; while (oldcount--) { i->~T(); i++; if (i == e) - i = d->array; + i = p->array; } } qFree(x); @@ -320,10 +325,10 @@ void QContiguousCache::append(const T &value) detach(); if (QTypeInfo::isComplex) { if (d->count == d->alloc) - (d->array + (d->start+d->count) % d->alloc)->~T(); - new (d->array + (d->start+d->count) % d->alloc) T(value); + (p->array + (d->start+d->count) % d->alloc)->~T(); + new (p->array + (d->start+d->count) % d->alloc) T(value); } else { - d->array[(d->start+d->count) % d->alloc] = value; + p->array[(d->start+d->count) % d->alloc] = value; } if (d->count == d->alloc) { @@ -349,12 +354,12 @@ void QContiguousCache::prepend(const T &value) d->count++; else if (d->count == d->alloc) - (d->array + d->start)->~T(); + (p->array + d->start)->~T(); if (QTypeInfo::isComplex) - new (d->array + d->start) T(value); + new (p->array + d->start) T(value); else - d->array[d->start] = value; + p->array[d->start] = value; } template @@ -364,9 +369,9 @@ void QContiguousCache::insert(int pos, const T &value) detach(); if (containsIndex(pos)) { if(QTypeInfo::isComplex) - new (d->array + pos % d->alloc) T(value); + new (p->array + pos % d->alloc) T(value); else - d->array[pos % d->alloc] = value; + p->array[pos % d->alloc] = value; } else if (pos == d->offset-1) prepend(value); else if (pos == d->offset+d->count) @@ -378,18 +383,18 @@ void QContiguousCache::insert(int pos, const T &value) d->start = pos % d->alloc; d->count = 1; if (QTypeInfo::isComplex) - new (d->array + d->start) T(value); + new (p->array + d->start) T(value); else - d->array[d->start] = value; + p->array[d->start] = value; } } template inline const T &QContiguousCache::at(int pos) const -{ Q_ASSERT_X(pos >= d->offset && pos - d->offset < d->count, "QContiguousCache::at", "index out of range"); return d->array[pos % d->alloc]; } +{ Q_ASSERT_X(pos >= d->offset && pos - d->offset < d->count, "QContiguousCache::at", "index out of range"); return p->array[pos % d->alloc]; } template inline const T &QContiguousCache::operator[](int pos) const -{ Q_ASSERT_X(pos >= d->offset && pos - d->offset < d->count, "QContiguousCache::at", "index out of range"); return d->array[pos % d->alloc]; } +{ Q_ASSERT_X(pos >= d->offset && pos - d->offset < d->count, "QContiguousCache::at", "index out of range"); return p->array[pos % d->alloc]; } template inline T &QContiguousCache::operator[](int pos) @@ -397,7 +402,7 @@ inline T &QContiguousCache::operator[](int pos) detach(); if (!containsIndex(pos)) insert(pos, T()); - return d->array[pos % d->alloc]; + return p->array[pos % d->alloc]; } template @@ -407,7 +412,7 @@ inline void QContiguousCache::removeFirst() detach(); d->count--; if (QTypeInfo::isComplex) - (d->array + d->start)->~T(); + (p->array + d->start)->~T(); d->start = (d->start + 1) % d->alloc; d->offset++; } @@ -419,7 +424,7 @@ inline void QContiguousCache::removeLast() detach(); d->count--; if (QTypeInfo::isComplex) - (d->array + (d->start + d->count) % d->alloc)->~T(); + (p->array + (d->start + d->count) % d->alloc)->~T(); } template -- cgit v0.12 From 3f0b969772cf3056ed54349bfe6837d9de2995ea Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 22 Oct 2009 18:57:53 +0200 Subject: Add the aligned versions of qMalloc/qRealloc/qFree --- src/corelib/global/qglobal.h | 3 ++ src/corelib/global/qmalloc.cpp | 100 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 5ee1815..cbb8fda 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2065,6 +2065,9 @@ Q_DECLARE_TYPEINFO(long double, Q_PRIMITIVE_TYPE); Q_CORE_EXPORT void *qMalloc(size_t size); Q_CORE_EXPORT void qFree(void *ptr); Q_CORE_EXPORT void *qRealloc(void *ptr, size_t size); +Q_CORE_EXPORT void *qMallocAligned(size_t size, size_t alignment); +Q_CORE_EXPORT void *qReallocAligned(void *ptr, size_t size, size_t oldsize, size_t alignment); +Q_CORE_EXPORT void qFreeAligned(void *ptr); Q_CORE_EXPORT void *qMemCopy(void *dest, const void *src, size_t n); Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp index a9f103c..db5e519 100644 --- a/src/corelib/global/qmalloc.cpp +++ b/src/corelib/global/qmalloc.cpp @@ -42,6 +42,7 @@ #include "qplatformdefs.h" #include +#include /* Define the container allocation functions in a separate file, so that our @@ -65,4 +66,103 @@ void *qRealloc(void *ptr, size_t size) return ::realloc(ptr, size); } +#if ((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)) +# define HAVE_POSIX_MEMALIGN +#endif + +void *qMallocAligned(size_t size, size_t alignment) +{ +#if defined(Q_OS_WIN) + return _aligned_malloc(size, alignment); +#elif defined(HAVE_POSIX_MEMALIGN) + if (alignment <= sizeof(void*)) + return qMalloc(size); + + // we have posix_memalign + void *ptr = 0; + if (posix_memalign(&ptr, alignment, size) == 0) + return ptr; + return 0; +#else + return qReallocAligned(0, size, 0, alignment); +#endif +} + +void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t alignment) +{ +#if defined(Q_OS_WIN) + Q_UNUSED(oldsize); + return _aligned_realloc(oldptr, newsize, alignment); +#elif defined(HAVE_POSIX_MEMALIGN) + if (alignment <= sizeof(void*)) + return qRealloc(oldptr, newsize); + + void *newptr = qMallocAligned(newsize, alignment); + if (!newptr) + return 0; + qMemCopy(newptr, oldptr, qMin(oldsize, newsize)); + qFree(oldptr); + return newptr; +#else + // fake an aligned allocation + Q_UNUSED(oldsize); + + void *actualptr = oldptr ? static_cast(oldptr)[-1] : 0; + if (alignment <= sizeof(void*)) { + // special, fast case + void **newptr = static_cast(qRealloc(actualptr, newsize + sizeof(void*))); + if (!newptr) + return 0; + if (newptr == actualptr) { + // realloc succeeded without reallocating + return oldptr; + } + + *newptr = newptr; + return newptr + 1; + } + + union { void *ptr; void **pptr; quintptr n; } real, faked; + + // qMalloc returns pointers aligned at least at sizeof(size_t) boundaries + // but usually more (8- or 16-byte boundaries). + // So we overallocate by alignment-sizeof(size_t) bytes, so we're guaranteed to find a + // somewhere within the first alignment-sizeof(size_t) that is properly aligned. + + // However, we need to store the actual pointer, so we need to allocate actually size + + // alignment anyway. + + real.ptr = qRealloc(actualptr, newsize + alignment); + if (!real.ptr) + return 0; + + faked.n = real.n + alignment; + faked.n &= ~(alignment - 1); + + // now save the value of the real pointer at faked-sizeof(void*) + // by construction, alignment > sizeof(void*) and is a power of 2, so + // faked-sizeof(void*) is properly aligned for a pointer + faked.pptr[-1] = real.ptr; + + // and save the actual size just before the pointer + //reinterpret_cast(faked.pptr - 1)[-1] = size; + + return faked.ptr; +#endif +} + +void qFreeAligned(void *ptr) +{ +#if defined(Q_OS_WIN) + _aligned_free(ptr); +#elif defined(HAVE_POSIX_MEMALIGN) + ::free(ptr); +#else + if (!ptr) + return; + void **ptr2 = static_cast(ptr); + free(ptr2[-1]); +#endif +} + QT_END_NAMESPACE -- cgit v0.12 From e83bb2fdfc2dc899526c8157fd8b77a68cdde9da Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 22 Oct 2009 21:09:24 +0200 Subject: Fix Qt containers to properly support types with strict alignments. QContiguousCache is a new type, so there are no binary compatibility issues. QHash and QMap didn't have any public qMalloc / qFree, so the entire logic is contained in .cpp code. However, since old code will not inform us of the alignment requirements, we need to add a bit to the structure to indicate whether strict alignment is in use or not. QList doesn't require any changes. For small, movable types, they're all stored in the pointer array itself, so they're aligned. For larger types, we use new(), so types with stricter requirements should define their own operator new(). QLinkedList cannot be fixed. It uses new() on the QLinkedListNode, which contains a T type. Sorry. QVector did have public qMalloc / qFree. I've moved the calls to the inner function and made it keep the old calls if the alignment requirement is below a certain threshold. The idea is that, if it's above, no one was using QVector anyway. Reviewed-by: Bradley T. Hughes --- src/corelib/global/qmalloc.cpp | 3 - src/corelib/tools/qcontiguouscache.cpp | 10 +++ src/corelib/tools/qcontiguouscache.h | 15 +++- src/corelib/tools/qhash.cpp | 27 ++++--- src/corelib/tools/qhash.h | 36 ++++++---- src/corelib/tools/qmap.cpp | 31 ++++++-- src/corelib/tools/qmap.h | 20 ++++-- src/corelib/tools/qvector.cpp | 27 +++++++ src/corelib/tools/qvector.h | 20 +++++- tests/auto/collections/tst_collections.cpp | 109 +++++++++++++++++++++++++++++ 10 files changed, 259 insertions(+), 39 deletions(-) diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp index db5e519..e33f77c 100644 --- a/src/corelib/global/qmalloc.cpp +++ b/src/corelib/global/qmalloc.cpp @@ -144,9 +144,6 @@ void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t align // faked-sizeof(void*) is properly aligned for a pointer faked.pptr[-1] = real.ptr; - // and save the actual size just before the pointer - //reinterpret_cast(faked.pptr - 1)[-1] = size; - return faked.ptr; #endif } diff --git a/src/corelib/tools/qcontiguouscache.cpp b/src/corelib/tools/qcontiguouscache.cpp index b0ed701..dd7cab6 100644 --- a/src/corelib/tools/qcontiguouscache.cpp +++ b/src/corelib/tools/qcontiguouscache.cpp @@ -56,6 +56,16 @@ void QContiguousCacheData::dump() const } #endif +QContiguousCacheData *QContiguousCacheData::allocate(int size, int alignment) +{ + return static_cast(qMallocAligned(size, alignment)); +} + +void QContiguousCacheData::free(QContiguousCacheData *data) +{ + qFreeAligned(data); +} + /*! \class QContiguousCache \brief The QContiguousCache class is a template class that provides a contiguous cache. \ingroup tools diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h index 862df61..b9d04b8 100644 --- a/src/corelib/tools/qcontiguouscache.h +++ b/src/corelib/tools/qcontiguouscache.h @@ -69,6 +69,9 @@ struct Q_CORE_EXPORT QContiguousCacheData // there will be an 8 byte gap here if T requires 16-byte alignment // (such as long double on 64-bit platforms, __int128, __float128) + static QContiguousCacheData *allocate(int size, int alignment); + static void free(QContiguousCacheData *data); + #ifdef QT_QCONTIGUOUSCACHE_DEBUG void dump() const; #endif @@ -161,6 +164,14 @@ private: // count the padding at the end return reinterpret_cast(&(reinterpret_cast(this))->array[1]) - reinterpret_cast(this); } + int alignOfTypedData() const + { +#ifdef Q_ALIGNOF + return qMax(sizeof(void*), Q_ALIGNOF(Data)); +#else + return 0; +#endif + } }; template @@ -262,7 +273,7 @@ void QContiguousCache::clear() template inline QContiguousCacheData *QContiguousCache::malloc(int aalloc) { - return static_cast(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T))); + return QContiguousCacheData::allocate(sizeOfTypedData() + (aalloc - 1) * sizeof(T), alignOfTypedData()); } template @@ -317,7 +328,7 @@ void QContiguousCache::free(Data *x) i = p->array; } } - qFree(x); + x->free(x); } template void QContiguousCache::append(const T &value) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index f33aba9..23fff1c 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -166,29 +166,38 @@ static int countBits(int hint) const int MinNumBits = 4; QHashData QHashData::shared_null = { - 0, 0, Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, MinNumBits, 0, 0, true + 0, 0, Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, MinNumBits, 0, 0, true, false }; void *QHashData::allocateNode() { - void *ptr = qMalloc(nodeSize); + return allocateNode(0); +} + +void *QHashData::allocateNode(int nodeAlign) +{ + void *ptr = strictAlignment ? qMallocAligned(nodeSize, nodeAlign) : qMalloc(nodeSize); Q_CHECK_PTR(ptr); return ptr; } void QHashData::freeNode(void *node) { - qFree(node); + if (strictAlignment) + qFreeAligned(node); + else + qFree(node); } QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize) { - return detach_helper( node_duplicate, 0, nodeSize ); + return detach_helper2( node_duplicate, 0, nodeSize, 0 ); } -QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), - void (*node_delete)(Node *), - int nodeSize) +QHashData *QHashData::detach_helper2(void (*node_duplicate)(Node *, void *), + void (*node_delete)(Node *), + int nodeSize, + int nodeAlign) { union { QHashData *d; @@ -204,6 +213,7 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), d->numBits = numBits; d->numBuckets = numBuckets; d->sharable = true; + d->strictAlignment = nodeAlign > 8; if (numBuckets) { QT_TRY { @@ -222,7 +232,7 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), Node *oldNode = buckets[i]; while (oldNode != this_e) { QT_TRY { - Node *dup = static_cast(allocateNode()); + Node *dup = static_cast(allocateNode(nodeAlign)); QT_TRY { node_duplicate(oldNode, dup); @@ -262,6 +272,7 @@ void QHashData::free_helper(void (*node_delete)(Node *)) while (cur != this_e) { Node *next = cur->next; node_delete(cur); + freeNode(cur); cur = next; } } diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index b65f1d3..67b394b 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -125,12 +125,14 @@ struct Q_CORE_EXPORT QHashData short numBits; int numBuckets; uint sharable : 1; + uint strictAlignment : 1; - void *allocateNode(); + void *allocateNode(); // ### Qt5 remove me + void *allocateNode(int nodeAlign); void freeNode(void *node); QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize); // ### Qt5 remove me - QHashData *detach_helper(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *), - int nodeSize); + QHashData *detach_helper2(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *), + int nodeSize, int nodeAlign); void mightGrow(); bool willGrow(); void hasShrunk(); @@ -267,6 +269,14 @@ class QHash return reinterpret_cast(node); } +#ifdef Q_ALIGNOF + static inline int alignOfNode() { return qMax(sizeof(void*), Q_ALIGNOF(Node)); } + static inline int alignOfDummyNode() { return qMax(sizeof(void*), Q_ALIGNOF(DummyNode)); } +#else + static inline int alignOfNode() { return 0; } + static inline int alignOfDummyNode() { return 0; } +#endif + public: inline QHash() : d(&QHashData::shared_null) { d->ref.ref(); } inline QHash(const QHash &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); } @@ -483,7 +493,7 @@ private: Node **findNode(const Key &key, uint *hp = 0) const; Node *createNode(uint h, const Key &key, const T &value, Node **nextNode); void deleteNode(Node *node); - static void deleteNode(QHashData::Node *node); + static void deleteNode2(QHashData::Node *node); static void duplicateNode(QHashData::Node *originalNode, void *newNode); }; @@ -492,12 +502,12 @@ private: template Q_INLINE_TEMPLATE void QHash::deleteNode(Node *node) { - deleteNode(reinterpret_cast(node)); + deleteNode2(reinterpret_cast(node)); + d->freeNode(node); } - template -Q_INLINE_TEMPLATE void QHash::deleteNode(QHashData::Node *node) +Q_INLINE_TEMPLATE void QHash::deleteNode2(QHashData::Node *node) { #ifdef Q_CC_BOR concrete(node)->~QHashNode(); @@ -506,7 +516,6 @@ Q_INLINE_TEMPLATE void QHash::deleteNode(QHashData::Node *node) #else concrete(node)->~Node(); #endif - qFree(node); } template @@ -527,9 +536,9 @@ QHash::createNode(uint ah, const Key &akey, const T &avalue, Node **anex Node *node; if (QTypeInfo::isDummy) { - node = reinterpret_cast(new (d->allocateNode()) DummyNode(akey)); + node = reinterpret_cast(new (d->allocateNode(alignOfDummyNode())) DummyNode(akey)); } else { - node = new (d->allocateNode()) Node(akey, avalue); + node = new (d->allocateNode(alignOfNode())) Node(akey, avalue); } node->h = ah; @@ -554,7 +563,7 @@ Q_INLINE_TEMPLATE QHash &QHash::unite(const QHash &other template Q_OUTOFLINE_TEMPLATE void QHash::freeData(QHashData *x) { - x->free_helper(deleteNode); + x->free_helper(deleteNode2); } template @@ -566,8 +575,9 @@ Q_INLINE_TEMPLATE void QHash::clear() template Q_OUTOFLINE_TEMPLATE void QHash::detach_helper() { - QHashData *x = d->detach_helper(duplicateNode, deleteNode, - QTypeInfo::isDummy ? sizeof(DummyNode) : sizeof(Node)); + QHashData *x = d->detach_helper2(duplicateNode, deleteNode2, + QTypeInfo::isDummy ? sizeof(DummyNode) : sizeof(Node), + QTypeInfo::isDummy ? alignOfDummyNode() : alignOfNode()); if (!d->ref.deref()) freeData(d); d = x; diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 1385810..cfb18b4 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -53,11 +53,16 @@ QT_BEGIN_NAMESPACE QMapData QMapData::shared_null = { &shared_null, { &shared_null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, 0, false, true + Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, 0, false, true, false }; QMapData *QMapData::createData() { + return createData(0); +} + +QMapData *QMapData::createData(int alignment) +{ QMapData *d = new QMapData; Q_CHECK_PTR(d); Node *e = reinterpret_cast(d); @@ -69,6 +74,7 @@ QMapData *QMapData::createData() d->randomBits = 0; d->insertInOrder = false; d->sharable = true; + d->strictAlignment = alignment > 8; return d; } @@ -80,11 +86,19 @@ void QMapData::continueFreeData(int offset) while (cur != e) { prev = cur; cur = cur->forward[0]; - qFree(reinterpret_cast(prev) - offset); + if (strictAlignment) + qFreeAligned(reinterpret_cast(prev) - offset); + else + qFree(reinterpret_cast(prev) - offset); } delete this; } +QMapData::Node *QMapData::node_create(Node *update[], int offset) +{ + return node_create(update, offset, 0); +} + /*! Creates a new node inside the data structure. @@ -94,10 +108,12 @@ void QMapData::continueFreeData(int offset) \a offset is an amount of bytes that needs to reserved just before the QMapData::Node structure. + \a alignment dictates the alignment for the data. + \internal \since 4.6 */ -QMapData::Node *QMapData::node_create(Node *update[], int offset) +QMapData::Node *QMapData::node_create(Node *update[], int offset, int alignment) { int level = 0; uint mask = (1 << Sparseness) - 1; @@ -118,7 +134,9 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset) if (level == 3 && !insertInOrder) randomBits = qrand(); - void *concreteNode = qMalloc(offset + sizeof(Node) + level * sizeof(Node *)); + void *concreteNode = strictAlignment ? + qMallocAligned(offset + sizeof(Node) + level * sizeof(Node *), alignment) : + qMalloc(offset + sizeof(Node) + level * sizeof(Node *)); Q_CHECK_PTR(concreteNode); Node *abstractNode = reinterpret_cast(reinterpret_cast(concreteNode) + offset); @@ -145,7 +163,10 @@ void QMapData::node_delete(Node *update[], int offset, Node *node) update[i]->forward[i] = node->forward[i]; } --size; - qFree(reinterpret_cast(node) - offset); + if (strictAlignment) + qFreeAligned(reinterpret_cast(node) - offset); + else + qFree(reinterpret_cast(node) - offset); } #ifdef QT_QMAP_DEBUG diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 688aca6..20980e7 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -74,10 +74,13 @@ struct Q_CORE_EXPORT QMapData uint randomBits; uint insertInOrder : 1; uint sharable : 1; + uint strictAlignment : 1; - static QMapData *createData(); + static QMapData *createData(); // ### Qt5 remove me + static QMapData *createData(int alignment); void continueFreeData(int offset); - Node *node_create(Node *update[], int offset); + Node *node_create(Node *update[], int offset); // ### Qt5 remove me + Node *node_create(Node *update[], int offset, int alignment); void node_delete(Node *update[], int offset, Node *node); #ifdef QT_QMAP_DEBUG uint adjust_ptr(Node *node); @@ -145,6 +148,13 @@ class QMap }; static inline int payload() { return sizeof(PayloadNode) - sizeof(QMapData::Node *); } + static inline int alignment() { +#ifdef Q_ALIGNOF + return qMax(sizeof(void*), Q_ALIGNOF(Node)); +#else + return 0; +#endif + } static inline Node *concrete(QMapData::Node *node) { return reinterpret_cast(reinterpret_cast(node) - payload()); } @@ -414,7 +424,7 @@ template Q_INLINE_TEMPLATE typename QMapData::Node * QMap::node_create(QMapData *adt, QMapData::Node *aupdate[], const Key &akey, const T &avalue) { - QMapData::Node *abstractNode = adt->node_create(aupdate, payload()); + QMapData::Node *abstractNode = adt->node_create(aupdate, payload(), alignment()); QT_TRY { Node *concreteNode = concrete(abstractNode); new (&concreteNode->key) Key(akey); @@ -715,7 +725,7 @@ template Q_OUTOFLINE_TEMPLATE void QMap::detach_helper() { union { QMapData *d; QMapData::Node *e; } x; - x.d = QMapData::createData(); + x.d = QMapData::createData(alignment()); if (d->size) { x.d->insertInOrder = true; QMapData::Node *update[QMapData::LastLevel + 1]; @@ -905,7 +915,7 @@ Q_OUTOFLINE_TEMPLATE bool QMap::operator==(const QMap &other) co template Q_OUTOFLINE_TEMPLATE QMap::QMap(const std::map &other) { - d = QMapData::createData(); + d = QMapData::createData(alignment()); d->insertInOrder = true; typename std::map::const_iterator it = other.end(); while (it != other.begin()) { diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 20f3a80..6522791 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -45,6 +45,13 @@ QT_BEGIN_NAMESPACE +static inline int alignmentThreshold() +{ + // malloc on 32-bit platforms should return pointers that are 8-byte aligned or more + // while on 64-bit platforms they should be 16-byte aligned or more + return 2 * sizeof(void*); +} + QVectorData QVectorData::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, true, false }; QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init) @@ -55,6 +62,26 @@ QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVe return p; } +QVectorData *QVectorData::allocate(int size, int alignment) +{ + return static_cast(alignment > alignmentThreshold() ? qMallocAligned(size, alignment) : qMalloc(size)); +} + +QVectorData *QVectorData::reallocate(QVectorData *x, int newsize, int oldsize, int alignment) +{ + if (alignment > alignmentThreshold()) + return static_cast(qReallocAligned(x, newsize, oldsize, alignment)); + return static_cast(qRealloc(x, newsize)); +} + +void QVectorData::free(QVectorData *x, int alignment) +{ + if (alignment > alignmentThreshold()) + qFreeAligned(x); + else + qFree(x); +} + int QVectorData::grow(int sizeofTypedData, int size, int sizeofT, bool excessive) { if (excessive) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index b77b53a..cf7df12 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -79,6 +79,9 @@ struct Q_CORE_EXPORT QVectorData // some debugges when the QVector is member of a class within an unnamed namespace. // ### Qt 5: can be removed completely. (Ralf) static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init); + static QVectorData *allocate(int size, int alignment); + static QVectorData *reallocate(QVectorData *old, int newsize, int oldsize, int alignment); + static void free(QVectorData *data, int alignment); static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive); }; @@ -87,6 +90,8 @@ struct QVectorTypedData : private QVectorData { // private inheritance as we must not access QVectorData member thought QVectorTypedData // as this would break strict aliasing rules. (in the case of shared_null) T array[1]; + + static inline void free(QVectorTypedData *x, int alignment) { QVectorData::free(x, alignment); } }; class QRegion; @@ -302,6 +307,14 @@ private: // count the padding at the end return reinterpret_cast(&(reinterpret_cast(this))->array[1]) - reinterpret_cast(this); } + inline int alignOfTypedData() const + { +#ifdef Q_ALIGNOF + return qMax(sizeof(void*), Q_ALIGNOF(Data)); +#else + return 0; +#endif + } }; template @@ -373,7 +386,7 @@ QVector &QVector::operator=(const QVector &v) template inline QVectorData *QVector::malloc(int aalloc) { - QVectorData *vectordata = static_cast(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T))); + QVectorData *vectordata = QVectorData::allocate(sizeOfTypedData() + (aalloc - 1) * sizeof(T), alignOfTypedData()); Q_CHECK_PTR(vectordata); return vectordata; } @@ -420,7 +433,7 @@ void QVector::free(Data *x) while (i-- != b) i->~T(); } - qFree(x); + x->free(x, alignOfTypedData()); } template @@ -459,7 +472,8 @@ void QVector::realloc(int asize, int aalloc) } } else { QT_TRY { - QVectorData *mem = static_cast(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T))); + QVectorData *mem = QVectorData::reallocate(d, sizeOfTypedData() + (aalloc - 1) * sizeof(T), + sizeOfTypedData() + (d->alloc - 1) * sizeof(T), alignOfTypedData()); Q_CHECK_PTR(mem); x.d = d = mem; x.d->size = d->size; diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index 670cff0..f97805e 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -164,6 +164,7 @@ private slots: void qtimerList(); void containerTypedefs(); void forwardDeclared(); + void alignment(); }; struct LargeStatic { @@ -3481,5 +3482,113 @@ void tst_Collections::forwardDeclared() { typedef QSet C; C *x = 0; /* C::iterator i; */ C::const_iterator j; Q_UNUSED(x) } } +#if defined(Q_ALIGNOF) && defined(Q_DECL_ALIGN) + +class Q_DECL_ALIGN(4) Aligned4 +{ + char i; +public: + Aligned4(int i = 0) : i(i) {} + bool checkAligned() const + { + return (quintptr(this) & 3) == 0; + } + + inline bool operator==(const Aligned4 &other) const { return i == other.i; } + inline bool operator<(const Aligned4 &other) const { return i < other.i; } + friend inline int qHash(const Aligned4 &a) { return qHash(a.i); } +}; + +class Q_DECL_ALIGN(128) Aligned128 +{ + char i; +public: + Aligned128(int i = 0) : i(i) {} + bool checkAligned() const + { + return (quintptr(this) & 127) == 0; + } + + inline bool operator==(const Aligned128 &other) const { return i == other.i; } + inline bool operator<(const Aligned128 &other) const { return i < other.i; } + friend inline int qHash(const Aligned128 &a) { return qHash(a.i); } +}; + +template +void testVectorAlignment() +{ + typedef typename C::value_type Aligned; + C container; + container.append(Aligned()); + QVERIFY(container[0].checkAligned()); + + for (int i = 0; i < 200; ++i) + container.append(Aligned()); + + for (int i = 0; i < container.size(); ++i) + QVERIFY(container.at(i).checkAligned()); +} + +template +void testContiguousCacheAlignment() +{ + typedef typename C::value_type Aligned; + C container(150); + container.append(Aligned()); + QVERIFY(container[container.firstIndex()].checkAligned()); + + for (int i = 0; i < 200; ++i) + container.append(Aligned()); + + for (int i = container.firstIndex(); i < container.lastIndex(); ++i) + QVERIFY(container.at(i).checkAligned()); +} + +template +void testAssociativeContainerAlignment() +{ + typedef typename C::key_type Key; + typedef typename C::mapped_type Value; + C container; + container.insert(Key(), Value()); + + typename C::const_iterator it = container.constBegin(); + QVERIFY(it.key().checkAligned()); + QVERIFY(it.value().checkAligned()); + + // add some more elements + for (int i = 0; i < 200; ++i) + container.insert(Key(i), Value(i)); + + it = container.constBegin(); + for ( ; it != container.constEnd(); ++it) { + QVERIFY(it.key().checkAligned()); + QVERIFY(it.value().checkAligned()); + } +} + +void tst_Collections::alignment() +{ + testVectorAlignment >(); + testVectorAlignment >(); + testContiguousCacheAlignment >(); + testContiguousCacheAlignment >(); + testAssociativeContainerAlignment >(); + testAssociativeContainerAlignment >(); + testAssociativeContainerAlignment >(); + testAssociativeContainerAlignment >(); + testAssociativeContainerAlignment >(); + testAssociativeContainerAlignment >(); + testAssociativeContainerAlignment >(); + testAssociativeContainerAlignment >(); +} + +#else +void tst_Collections::alignment() +{ + QSKIP("Compiler doesn't support necessary extension keywords", SkipAll) +} +#endif + QTEST_APPLESS_MAIN(tst_Collections) #include "tst_collections.moc" -- cgit v0.12 From 5b4b6b2be7b901ef9a29c37431998034730fa3d3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 28 Oct 2009 12:47:35 +0100 Subject: Initialise the reserved bits to 0. This is future compatibility: we must rely on them being 0 in older versions of Qt. Reviewed-by: Bradley T. Hughes --- src/corelib/tools/qcontiguouscache.h | 3 ++- src/corelib/tools/qhash.cpp | 3 ++- src/corelib/tools/qhash.h | 1 + src/corelib/tools/qmap.cpp | 3 ++- src/corelib/tools/qmap.h | 1 + src/corelib/tools/qvector.cpp | 2 +- src/corelib/tools/qvector.h | 2 ++ 7 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h index b9d04b8..ef5b238 100644 --- a/src/corelib/tools/qcontiguouscache.h +++ b/src/corelib/tools/qcontiguouscache.h @@ -62,7 +62,7 @@ struct Q_CORE_EXPORT QContiguousCacheData int start; int offset; uint sharable : 1; - // uint unused : 31; + uint reserved : 31; // total is 24 bytes (HP-UX aCC: 40 bytes) // the next entry is already aligned to 8 bytes @@ -186,6 +186,7 @@ void QContiguousCache::detach_helper() x.d->offset = d->offset; x.d->alloc = d->alloc; x.d->sharable = true; + x.d->reserved = 0; T *dest = x.p->array + x.d->start; T *src = p->array + d->start; diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 23fff1c..c82c389 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -166,7 +166,7 @@ static int countBits(int hint) const int MinNumBits = 4; QHashData QHashData::shared_null = { - 0, 0, Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, MinNumBits, 0, 0, true, false + 0, 0, Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, MinNumBits, 0, 0, true, false, 0 }; void *QHashData::allocateNode() @@ -214,6 +214,7 @@ QHashData *QHashData::detach_helper2(void (*node_duplicate)(Node *, void *), d->numBuckets = numBuckets; d->sharable = true; d->strictAlignment = nodeAlign > 8; + d->reserved = 0; if (numBuckets) { QT_TRY { diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 67b394b..1918229 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -126,6 +126,7 @@ struct Q_CORE_EXPORT QHashData int numBuckets; uint sharable : 1; uint strictAlignment : 1; + uint reserved : 30; void *allocateNode(); // ### Qt5 remove me void *allocateNode(int nodeAlign); diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index cfb18b4..3b48c3f 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QMapData QMapData::shared_null = { &shared_null, { &shared_null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, 0, false, true, false + Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, 0, false, true, false, 0 }; QMapData *QMapData::createData() @@ -75,6 +75,7 @@ QMapData *QMapData::createData(int alignment) d->insertInOrder = false; d->sharable = true; d->strictAlignment = alignment > 8; + d->reserved = 0; return d; } diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 20980e7..65c3d2a 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -75,6 +75,7 @@ struct Q_CORE_EXPORT QMapData uint insertInOrder : 1; uint sharable : 1; uint strictAlignment : 1; + uint reserved : 29; static QMapData *createData(); // ### Qt5 remove me static QMapData *createData(int alignment); diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 6522791..8bb1074 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -52,7 +52,7 @@ static inline int alignmentThreshold() return 2 * sizeof(void*); } -QVectorData QVectorData::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, true, false }; +QVectorData QVectorData::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, true, false, 0 }; QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init) { diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index cf7df12..7402d77 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -72,6 +72,7 @@ struct Q_CORE_EXPORT QVectorData #else uint sharable : 1; uint capacity : 1; + uint reserved : 30; #endif static QVectorData shared_null; @@ -486,6 +487,7 @@ void QVector::realloc(int asize, int aalloc) x.d->alloc = aalloc; x.d->sharable = true; x.d->capacity = d->capacity; + x.d->reserved = 0; } if (QTypeInfo::isComplex) { -- cgit v0.12 From 138e8c17767959c183b3e00e3fb364ab5b6fbdfd Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 28 Oct 2009 14:14:25 +0100 Subject: QLocalServer: block indefinitely when timeout value is -1 ... as described in the documentation. Furthermore: * use qt_safe_select to timeout correctly * return immediately when timeout value is 0 Reviewed-by: Oswald Buddenhagen --- src/network/socket/qlocalserver_unix.cpp | 22 ++++++---------------- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 2 +- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp index 5ffe0c0..e09e547 100644 --- a/src/network/socket/qlocalserver_unix.cpp +++ b/src/network/socket/qlocalserver_unix.cpp @@ -216,24 +216,14 @@ void QLocalServerPrivate::waitForNewConnection(int msec, bool *timedOut) timeout.tv_sec = msec / 1000; timeout.tv_usec = (msec % 1000) * 1000; - // timeout can not be 0 or else select will return an error. - if (0 == msec) - timeout.tv_usec = 1000; - int result = -1; - // on Linux timeout will be updated by select, but _not_ on other systems. - QTime timer; - timer.start(); - while (pendingConnections.isEmpty() && (-1 == msec || timer.elapsed() < msec)) { - result = ::select(listenSocket + 1, &readfds, 0, 0, &timeout); - if (-1 == result && errno != EINTR) { - setError(QLatin1String("QLocalServer::waitForNewConnection")); - closeServer(); - break; - } - if (result > 0) - _q_onNewConnection(); + result = qt_safe_select(listenSocket + 1, &readfds, 0, 0, (msec == -1) ? 0 : &timeout); + if (-1 == result) { + setError(QLatin1String("QLocalServer::waitForNewConnection")); + closeServer(); } + if (result > 0) + _q_onNewConnection(); if (timedOut) *timedOut = (result == 0); } diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index be39d00..ab7b0ac 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -976,7 +976,7 @@ void tst_QLocalSocket::writeOnlySocket() #if defined(Q_OS_SYMBIAN) QTest::qWait(250); #endif - QVERIFY(server.waitForNewConnection()); + QVERIFY(server.waitForNewConnection(200)); QLocalSocket* serverSocket = server.nextPendingConnection(); QVERIFY(serverSocket); -- cgit v0.12 From d5a228fbd44f7dd92a10981a5c835db66e3ea6f8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Oct 2009 09:59:40 +0100 Subject: Fix compilation in QContiguousCache. Reviewed-by: TrustMe --- src/corelib/tools/qcontiguouscache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h index ef5b238..3785938 100644 --- a/src/corelib/tools/qcontiguouscache.h +++ b/src/corelib/tools/qcontiguouscache.h @@ -216,8 +216,8 @@ void QContiguousCache::setCapacity(int asize) if (asize == d->alloc) return; detach(); - union { QContiguousCacheData *p; QContiguousCacheTypedData *d; } x; - x.p = malloc(asize); + union { QContiguousCacheData *d; QContiguousCacheTypedData *p; } x; + x.d = malloc(asize); x.d->alloc = asize; x.d->count = qMin(d->count, asize); x.d->offset = d->offset + d->count - x.d->count; @@ -239,7 +239,7 @@ void QContiguousCache::setCapacity(int asize) src--; } /* free old */ - free(d); + free(p); d = x.d; } -- cgit v0.12 From 8307d3511b35adbb945948eda2cf54bbd3c0a20e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Oct 2009 10:28:28 +0100 Subject: Update confusing qWarning message. Reviewed-by: Olivier Goffart --- src/corelib/kernel/qmetaobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index f98c449..71afc5b 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -574,8 +574,8 @@ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, co if (i >= 0 && m && m->d.superdata) { int conflict = m->d.superdata->indexOfMethod(signal); if (conflict >= 0) - qWarning("QMetaObject::indexOfSignal:%s: Conflict with %s::%s", - m->d.stringdata, m->d.superdata->d.stringdata, signal); + qWarning("QMetaObject::indexOfSignal: signal %s from %s redefined in %s", + signal, m->d.superdata->d.stringdata, m->d.stringdata); } #endif return i; -- cgit v0.12 From ffe49ed60c9ee778b9999ee4145b44851b053f9f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Oct 2009 10:31:48 +0100 Subject: Fix compilation on Mac: there's no malloc.h there Reviewed-by: Trust Me --- src/corelib/global/qmalloc.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp index e33f77c..3584c50 100644 --- a/src/corelib/global/qmalloc.cpp +++ b/src/corelib/global/qmalloc.cpp @@ -42,7 +42,10 @@ #include "qplatformdefs.h" #include -#include + +#ifdef Q_OS_WIN +# include +#endif /* Define the container allocation functions in a separate file, so that our @@ -66,10 +69,6 @@ void *qRealloc(void *ptr, size_t size) return ::realloc(ptr, size); } -#if ((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)) -# define HAVE_POSIX_MEMALIGN -#endif - void *qMallocAligned(size_t size, size_t alignment) { #if defined(Q_OS_WIN) -- cgit v0.12 From 5e4035ede6505f638f4741dcebbf19e485a1b993 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 29 Oct 2009 14:50:51 +0100 Subject: qdoc3: Fixed a linking error for qml properties. This: https://qtmetrics.europe.nokia.com/kinetic-declarativeui/qml-item.html#rotation-prop should now be this: https://qtmetrics.europe.nokia.com/kinetic-declarativeui/qml-item.html#transformOrigin-prop) --- tools/qdoc3/htmlgenerator.cpp | 11 +++++++---- tools/qdoc3/pagegenerator.cpp | 19 +++++++------------ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 18c7916..eaf4b2e 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3467,10 +3467,13 @@ QString HtmlGenerator::refForNode(const Node *node) ref += "-" + QString::number(func->overloadNumber()); } break; - case Node::Property: -#ifdef QDOC_QML +#ifdef QDOC_QML + case Node::Fake: + if (node->subType() != Node::QmlPropertyGroup) + break; case Node::QmlProperty: #endif + case Node::Property: ref = node->name() + "-prop"; break; #ifdef QDOC_QML @@ -3512,9 +3515,9 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) // ### reintroduce this test, without breaking .dcf files if (fn != outFileName()) #endif - link += fn; + link += fn; - if (!node->isInnerNode()) { + if (!node->isInnerNode() || node->subType() == Node::QmlPropertyGroup) { ref = refForNode(node); if (relative && fn == fileName(relative) && ref == refForNode(relative)) return QString(); diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index 83ea561..7d9fbee 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -81,14 +81,13 @@ QString PageGenerator::fileBase(const Node *node) { if (node->relates()) node = node->relates(); - else if (!node->isInnerNode()) { + else if (!node->isInnerNode()) node = node->parent(); #ifdef QDOC_QML - if (node->subType() == Node::QmlPropertyGroup) { - node = node->parent(); - } -#endif + if (node->subType() == Node::QmlPropertyGroup) { + node = node->parent(); } +#endif QString base = node->doc().baseName(); if (!base.isEmpty()) @@ -97,6 +96,7 @@ QString PageGenerator::fileBase(const Node *node) const Node *p = node; forever { + const Node *pp = p->parent(); base.prepend(p->name()); #ifdef QDOC_QML /* @@ -104,15 +104,10 @@ QString PageGenerator::fileBase(const Node *node) we prepend "qml-" to the file name of QML element doc files. */ - if ((p->subType() == Node::QmlClass) || - (p->subType() == Node::QmlPropertyGroup)) - base.prepend("qml-"); - else if ((p->type() == Node::QmlProperty) || - (p->type() == Node::QmlSignal) || - (p->type() == Node::QmlMethod)) + if (p->subType() == Node::QmlClass) { base.prepend("qml-"); + } #endif - const Node *pp = p->parent(); if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake) break; base.prepend(QLatin1Char('-')); -- cgit v0.12 From 4531ffbd8aa2cc0ae656715e449caca1649c18b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 29 Oct 2009 14:28:36 +0100 Subject: Added QImagePixmapCleanupHooks functions for enabling hooks. Better than having to befriend QPixmapData and setting is_cached manually. Reviewed-by: Tom Cooksey --- src/gui/image/qimagepixmapcleanuphooks.cpp | 18 +++++++++++++++++- src/gui/image/qimagepixmapcleanuphooks_p.h | 4 ++++ src/gui/image/qpixmapdata_p.h | 3 +-- src/opengl/qgl.cpp | 4 ++-- src/opengl/qgl_x11.cpp | 3 ++- src/opengl/qgl_x11egl.cpp | 3 ++- 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp index ac30646..35322e9 100644 --- a/src/gui/image/qimagepixmapcleanuphooks.cpp +++ b/src/gui/image/qimagepixmapcleanuphooks.cpp @@ -40,7 +40,8 @@ ****************************************************************************/ #include "qimagepixmapcleanuphooks_p.h" -#include "qpixmapdata_p.h" +#include "private/qpixmapdata_p.h" +#include "private/qimage_p.h" QT_BEGIN_NAMESPACE @@ -132,4 +133,19 @@ void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) qt_image_cleanup_hook_64(key); } +void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) +{ + enableCleanupHooks(const_cast(pixmap).data_ptr().data()); +} + +void QImagePixmapCleanupHooks::enableCleanupHooks(QPixmapData *pixmapData) +{ + pixmapData->is_cached = true; +} + +void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image) +{ + const_cast(image).data_ptr()->is_cached = true; +} + QT_END_NAMESPACE diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h index 16c8974..9e490d7 100644 --- a/src/gui/image/qimagepixmapcleanuphooks_p.h +++ b/src/gui/image/qimagepixmapcleanuphooks_p.h @@ -70,6 +70,10 @@ public: static QImagePixmapCleanupHooks *instance(); + static void enableCleanupHooks(const QImage &image); + static void enableCleanupHooks(const QPixmap &pixmap); + static void enableCleanupHooks(QPixmapData *pixmapData); + // Gets called when a pixmap is about to be modified: void addPixmapModificationHook(_qt_pixmap_cleanup_hook_pm); diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index 2f4f201..e99409c 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -131,12 +131,11 @@ protected: private: friend class QPixmap; - friend class QGLContextPrivate; friend class QX11PixmapData; friend class QS60PixmapData; + friend class QImagePixmapCleanupHooks; // Needs to set is_cached friend class QGLTextureCache; //Needs to check the reference count friend class QExplicitlySharedDataPointer; - friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs to set is_cached QAtomicInt ref; int detach_no; diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index e80521b..3fec1f0 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2137,7 +2137,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G Q_ASSERT(texture); if (texture->id > 0) - const_cast(image).data_ptr()->is_cached = true; + QImagePixmapCleanupHooks::enableCleanupHooks(image); return texture; } @@ -2396,7 +2396,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, Q_ASSERT(texture); if (texture->id > 0) - const_cast(pixmap).data_ptr()->is_cached = true; + QImagePixmapCleanupHooks::enableCleanupHooks(pixmap); return texture; } diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index 86e593d..899047a 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #ifdef Q_OS_HPUX // for GLXPBuffer #include @@ -1704,7 +1705,7 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData *pmd, con pixmapData->gl_surface = (Qt::HANDLE)glxPixmap; // Make sure the cleanup hook gets called so we can delete the glx pixmap - pixmapData->is_cached = true; + QImagePixmapCleanupHooks::enableCleanupHooks(pixmapData); } GLuint textureId; diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index 7180682..9b20297 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -42,6 +42,7 @@ #include "qgl.h" #include #include +#include #include #include #include "qgl_egl_p.h" @@ -531,7 +532,7 @@ bool Q_OPENGL_EXPORT qt_createEGLSurfaceForPixmap(QPixmapData* pmd, bool readOnl Q_ASSERT(sizeof(Qt::HANDLE) >= sizeof(EGLSurface)); // Just to make totally sure! pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; - pixmapData->is_cached = true; // Make sure the cleanup hook gets called + QImagePixmapCleanupHooks::enableCleanupHooks(pixmapData); // Make sure the cleanup hook gets called return true; } -- cgit v0.12 From 7a6296197cdab656053fbf1fc2584707e78cbe54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 8 Oct 2009 12:57:20 +0200 Subject: Make QT_NO_PHONON_PLATFORMPLUGIN work Reviewed-by:tom --- src/3rdparty/phonon/phonon/factory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/phonon/phonon/factory.cpp b/src/3rdparty/phonon/phonon/factory.cpp index 5c3752a..e5adb490 100644 --- a/src/3rdparty/phonon/phonon/factory.cpp +++ b/src/3rdparty/phonon/phonon/factory.cpp @@ -189,11 +189,12 @@ bool FactoryPrivate::createBackend() } FactoryPrivate::FactoryPrivate() + : #ifndef QT_NO_PHONON_PLATFORMPLUGIN - : m_platformPlugin(0), - m_noPlatformPlugin(false) + m_platformPlugin(0), + m_noPlatformPlugin(false), #endif //QT_NO_PHONON_PLATFORMPLUGIN - , m_backendObject(0) + m_backendObject(0) { // Add the post routine to make sure that all other global statics (especially the ones from Qt) // are still available. If the FactoryPrivate dtor is called too late many bad things can happen -- cgit v0.12 From 5c4ed2858f31d6b3adcf5200c3a64fbf188a3f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 9 Oct 2009 11:20:32 +0200 Subject: Fix QFeature QT_NO_PHONON_VOLUMEFADEREFFECT Reviewed-by: Jens Bache-Wiig --- src/3rdparty/phonon/gstreamer/backend.cpp | 4 ++++ src/3rdparty/phonon/gstreamer/volumefadereffect.cpp | 4 ++-- src/3rdparty/phonon/gstreamer/volumefadereffect.h | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/backend.cpp b/src/3rdparty/phonon/gstreamer/backend.cpp index cd49454..ceaf94a 100644 --- a/src/3rdparty/phonon/gstreamer/backend.cpp +++ b/src/3rdparty/phonon/gstreamer/backend.cpp @@ -134,7 +134,11 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const } case VolumeFaderEffectClass: +#ifndef QT_NO_PHONON_VOLUMEFADEREFFECT return new VolumeFaderEffect(this, parent); +#else + return 0; +#endif //QT_NO_PHONON_VOLUMEFADEREFFECT case VisualizationClass: //Fall through default: diff --git a/src/3rdparty/phonon/gstreamer/volumefadereffect.cpp b/src/3rdparty/phonon/gstreamer/volumefadereffect.cpp index d7ee11b..bf0d646 100644 --- a/src/3rdparty/phonon/gstreamer/volumefadereffect.cpp +++ b/src/3rdparty/phonon/gstreamer/volumefadereffect.cpp @@ -21,11 +21,11 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_PHONON_VOLUMEFADEREFFECT namespace Phonon { namespace Gstreamer { - VolumeFaderEffect::VolumeFaderEffect(Backend *backend, QObject *parent) : Effect(backend, parent, AudioSource | AudioSink) , m_fadeCurve(Phonon::VolumeFaderEffect::Fade3Decibel) @@ -156,7 +156,7 @@ bool VolumeFaderEffect::event(QEvent *event) } }} //namespace Phonon::Gstreamer - +#endif //QT_NO_PHONON_VOLUMEFADEREFFECT QT_END_NAMESPACE #include "moc_volumefadereffect.cpp" diff --git a/src/3rdparty/phonon/gstreamer/volumefadereffect.h b/src/3rdparty/phonon/gstreamer/volumefadereffect.h index d74014c..748d2d6 100644 --- a/src/3rdparty/phonon/gstreamer/volumefadereffect.h +++ b/src/3rdparty/phonon/gstreamer/volumefadereffect.h @@ -30,7 +30,7 @@ #include QT_BEGIN_NAMESPACE - +#ifndef QT_NO_PHONON_VOLUMEFADEREFFECT namespace Phonon { namespace Gstreamer @@ -64,7 +64,7 @@ namespace Gstreamer QTime m_fadeStartTime; }; }} //namespace Phonon::Gstreamer - +#endif //QT_NO_PHONON_VOLUMEFADEREFFECT QT_END_NAMESPACE #endif // Phonon_GSTREAMER_VOLUMEFADEREFFECT_H -- cgit v0.12 From a7a70ad81a9a1f3cba5fca66c232e7d8560a2850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 9 Oct 2009 11:21:51 +0200 Subject: Fix QT_NO_IMAGEFORMAT_PNG Reviewed-by: tom --- src/gui/styles/qcommonstyle.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 70d130a..b08dc4b 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -5169,13 +5169,12 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, const QWidget *widget) const { + const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft()); #ifdef QT_NO_IMAGEFORMAT_PNG - Q_UNUSED(option); Q_UNUSED(widget); Q_UNUSED(sp); #else QPixmap pixmap; - const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft()); if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { switch (sp) { -- cgit v0.12 From 86e3be13d870e8dce1e06f7cd0adeb8996fade7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 9 Oct 2009 11:22:24 +0200 Subject: Fix dependencies to QT_NO_PRINTPREVIEWWIDGET Reviewed-by: Trust Me --- src/corelib/global/qfeatures.h | 2 +- src/corelib/global/qfeatures.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 36c2cf9..ab81290 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -767,7 +767,7 @@ #endif // QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER)) +#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MAINWINDOW)) #define QT_NO_PRINTPREVIEWWIDGET #endif diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index ec47883..a0928fc 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -567,7 +567,7 @@ Feature: PRINTPREVIEWWIDGET Description: Provides a widget for previewing page layouts for printer output. a date. Section: Widgets -Requires: GRAPHICSVIEW PRINTER +Requires: GRAPHICSVIEW PRINTER TOOLBAR MAINWINDOW Name: QPrintPreviewWidget SeeAlso: ??? -- cgit v0.12 From 854df9c08635fd175f6658e66320d8fa2360389a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 9 Oct 2009 15:51:57 +0200 Subject: The PRINTER feature now depends on TEMPORARYFILE Reviewed-by: Trust Me --- src/corelib/global/qfeatures.h | 2 +- src/corelib/global/qfeatures.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index ab81290..b18196e 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -522,7 +522,7 @@ #endif // QPrinter -#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE)) +#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) #define QT_NO_PRINTER #endif diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index a0928fc..c18df62 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -910,7 +910,7 @@ SeeAlso: ??? Feature: PRINTER Description: Supports printing Section: Painting -Requires: TEXTSTREAM PICTURE +Requires: TEXTSTREAM PICTURE TEMPORARYFILE Name: QPrinter SeeAlso: ??? -- cgit v0.12 From 8c29407a7bf5af9dbcaff1ea7f24951297aa9e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 16 Oct 2009 10:42:56 +0200 Subject: Fix QT_NO_PHONON_ABSTRACTMEDIASTREAM in phonon Seemed to be missing from gstreamer backend Reviewed-by: Jens Bache-Wiig --- src/3rdparty/phonon/gstreamer/mediaobject.cpp | 5 +++++ src/3rdparty/phonon/gstreamer/phononsrc.cpp | 28 ++++++++++++++++++++++++++ src/3rdparty/phonon/gstreamer/phononsrc.h | 2 ++ src/3rdparty/phonon/gstreamer/streamreader.cpp | 3 ++- src/3rdparty/phonon/gstreamer/streamreader.h | 4 ++++ 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 5dcbd42..0b800af 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -392,6 +392,7 @@ bool MediaObject::createPipefromURL(const QUrl &url) */ bool MediaObject::createPipefromStream(const MediaSource &source) { +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM // Remove any existing data source if (m_datasource) { gst_bin_remove(GST_BIN(m_pipeline), m_datasource); @@ -413,6 +414,10 @@ bool MediaObject::createPipefromStream(const MediaSource &source) return false; } return true; +#else //QT_NO_PHONON_ABSTRACTMEDIASTREAM + Q_UNUSED(source); + return false; +#endif } void MediaObject::createPipeline() diff --git a/src/3rdparty/phonon/gstreamer/phononsrc.cpp b/src/3rdparty/phonon/gstreamer/phononsrc.cpp index f893fb5..97d7220 100644 --- a/src/3rdparty/phonon/gstreamer/phononsrc.cpp +++ b/src/3rdparty/phonon/gstreamer/phononsrc.cpp @@ -109,18 +109,25 @@ static void phonon_src_class_init (PhononSrcClass * klass) static void phonon_src_init (PhononSrc * src, PhononSrcClass * g_class) { Q_UNUSED(g_class); +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM src->device = 0; +#else + Q_UNUSED(src); +#endif } static void phonon_src_finalize (GObject * object) { +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM PhononSrc *src; src = GST_PHONON_SRC (object); delete src->device; src->device = 0; +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM G_OBJECT_CLASS (parent_class)->finalize (object); } +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM static gboolean phonon_src_set_device(PhononSrc * src, StreamReader* device) { GstState state; @@ -145,6 +152,7 @@ wrong_state: return FALSE; } } +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM static void phonon_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { @@ -153,6 +161,7 @@ static void phonon_src_set_property (GObject * object, guint prop_id, const GVal src = GST_PHONON_SRC (object); switch (prop_id) { +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM case ARG_PHONONSRC: { StreamReader *dev = (StreamReader*)(g_value_get_pointer(value)); @@ -160,6 +169,9 @@ static void phonon_src_set_property (GObject * object, guint prop_id, const GVal phonon_src_set_device(src, dev); break; } +#else + Q_UNUSED(value); +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -174,9 +186,13 @@ static void phonon_src_get_property (GObject * object, guint prop_id, GValue * v src = GST_PHONON_SRC (object); switch (prop_id) { +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM case ARG_PHONONSRC: g_value_set_pointer(value, src->device); break; +#else //QT_NO_PHONON_ABSTRACTMEDIASTREAM + Q_UNUSED(value); +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -185,6 +201,7 @@ static void phonon_src_get_property (GObject * object, guint prop_id, GValue * v static GstFlowReturn phonon_src_create_read (PhononSrc * src, guint64 offset, guint length, GstBuffer ** buffer) { +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM Q_ASSERT(src->device); if (!src->device) return GST_FLOW_ERROR; @@ -204,6 +221,13 @@ static GstFlowReturn phonon_src_create_read (PhononSrc * src, guint64 offset, gu gst_mini_object_unref(GST_MINI_OBJECT(buf)); return GST_FLOW_ERROR; +#else //QT_NO_PHONON_ABSTRACTMEDIASTREAM + Q_UNUSED(src); + Q_UNUSED(offset); + Q_UNUSED(length); + Q_UNUSED(buffer); + return GST_FLOW_ERROR; +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM } static GstFlowReturn phonon_src_create (GstBaseSrc * basesrc, guint64 offset, guint length, GstBuffer ** buffer) @@ -218,19 +242,23 @@ static GstFlowReturn phonon_src_create (GstBaseSrc * basesrc, guint64 offset, gu static gboolean phonon_src_is_seekable (GstBaseSrc * basesrc) { PhononSrc *src = GST_PHONON_SRC (basesrc); +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM if (src->device) return src->device->streamSeekable(); +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM return false; } static gboolean phonon_src_get_size (GstBaseSrc * basesrc, guint64 * size) { +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM PhononSrc *src; src = GST_PHONON_SRC (basesrc); if (src->device && src->device->streamSeekable()) { *size = src->device->streamSize(); return TRUE; } +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM *size = 0; return FALSE; } diff --git a/src/3rdparty/phonon/gstreamer/phononsrc.h b/src/3rdparty/phonon/gstreamer/phononsrc.h index a2cd8b3..a50f8a2 100644 --- a/src/3rdparty/phonon/gstreamer/phononsrc.h +++ b/src/3rdparty/phonon/gstreamer/phononsrc.h @@ -49,7 +49,9 @@ typedef struct _PhononSrcClass PhononSrcClass; // PhononSrc: struct _PhononSrc { GstBaseSrc element; +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM StreamReader *device; +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM }; struct _PhononSrcClass { diff --git a/src/3rdparty/phonon/gstreamer/streamreader.cpp b/src/3rdparty/phonon/gstreamer/streamreader.cpp index 04fa6cc..f8219e6 100644 --- a/src/3rdparty/phonon/gstreamer/streamreader.cpp +++ b/src/3rdparty/phonon/gstreamer/streamreader.cpp @@ -20,7 +20,7 @@ along with this library. If not, see . #include QT_BEGIN_NAMESPACE - +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM namespace Phonon { namespace Gstreamer @@ -49,5 +49,6 @@ bool StreamReader::read(quint64 pos, int length, char * buffer) } } +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/gstreamer/streamreader.h b/src/3rdparty/phonon/gstreamer/streamreader.h index c2e61c8..387370c 100644 --- a/src/3rdparty/phonon/gstreamer/streamreader.h +++ b/src/3rdparty/phonon/gstreamer/streamreader.h @@ -23,6 +23,8 @@ along with this library. If not, see . QT_BEGIN_NAMESPACE +#ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM + namespace Phonon { class MediaSource; @@ -91,6 +93,8 @@ private: } } +#endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM + QT_END_NAMESPACE #endif -- cgit v0.12 From 1a8a4b2ce746f357a58b04a02321824f8040b3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 16 Oct 2009 10:44:52 +0200 Subject: Updated qfeatures.h Reviewed-by: Trust Me --- src/corelib/global/qfeatures.h | 27 ++++++++++++++------------- util/scripts/make_qfeatures_dot_h | 1 + 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index b18196e..d87cf64 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -43,6 +43,7 @@ * All features and their dependencies. * * This list is generated from $QTDIR/src/corelib/global/qfeatures.txt + * by $QTSRCDIR/util/scripts/make_qfeatures_dot_h */ // QAction @@ -521,11 +522,6 @@ #define QT_NO_LIBRARY #endif -// QPrinter -#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_PRINTER -#endif - // QScrollArea #if !defined(QT_NO_SCROLLAREA) && (defined(QT_NO_SCROLLBAR)) #define QT_NO_SCROLLAREA @@ -561,6 +557,11 @@ #define QT_NO_MDIAREA #endif +// QPrinter +#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) +#define QT_NO_PRINTER +#endif + // QSpinBox #if !defined(QT_NO_SPINBOX) && (defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR)) #define QT_NO_SPINBOX @@ -731,11 +732,6 @@ #define QT_NO_COMPLETER #endif -// Common UNIX Printing System -#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) -#define QT_NO_CUPS -#endif - // QDataWidgetMapper #if !defined(QT_NO_DATAWIDGETMAPPER) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_PROPERTIES)) #define QT_NO_DATAWIDGETMAPPER @@ -766,9 +762,9 @@ #define QT_NO_TREEWIDGET #endif -// QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_PRINTPREVIEWWIDGET +// Common UNIX Printing System +#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) +#define QT_NO_CUPS #endif // QToolBar @@ -831,6 +827,11 @@ #define QT_NO_FONTDIALOG #endif +// QPrintPreviewWidget +#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MAINWINDOW)) +#define QT_NO_PRINTPREVIEWWIDGET +#endif + // QWorkSpace #if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_MENU) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_MAINWINDOW) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MENUBAR)) #define QT_NO_WORKSPACE diff --git a/util/scripts/make_qfeatures_dot_h b/util/scripts/make_qfeatures_dot_h index bdd68a3..23d88a3 100755 --- a/util/scripts/make_qfeatures_dot_h +++ b/util/scripts/make_qfeatures_dot_h @@ -175,6 +175,7 @@ print OUT * All features and their dependencies. * * This list is generated from $QTDIR/src/corelib/global/qfeatures.txt + * by $QTSRCDIR/util/scripts/make_qfeatures_dot_h */ '; -- cgit v0.12 From 5c4130a509248e897d52e4980cc8d58f0940d76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 16 Oct 2009 11:42:00 +0200 Subject: Added QT_NO_PHONON_EFFECT to gstreamer backend Reviewed-by: Jens Bache-Wiig --- src/3rdparty/phonon/gstreamer/audioeffect.cpp | 3 ++- src/3rdparty/phonon/gstreamer/audioeffect.h | 4 ++-- src/3rdparty/phonon/gstreamer/backend.cpp | 3 ++- src/3rdparty/phonon/gstreamer/effect.cpp | 4 ++-- src/3rdparty/phonon/gstreamer/effect.h | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/audioeffect.cpp b/src/3rdparty/phonon/gstreamer/audioeffect.cpp index db72c8b..d3d7a35 100644 --- a/src/3rdparty/phonon/gstreamer/audioeffect.cpp +++ b/src/3rdparty/phonon/gstreamer/audioeffect.cpp @@ -23,7 +23,7 @@ #include "gsthelper.h" #include - +#ifndef QT_NO_PHONON_EFFECT QT_BEGIN_NAMESPACE namespace Phonon @@ -75,4 +75,5 @@ GstElement* AudioEffect::createEffectBin() } //namespace Phonon::Gstreamer QT_END_NAMESPACE +#endif //QT_NO_PHONON_EFFECT #include "moc_audioeffect.cpp" diff --git a/src/3rdparty/phonon/gstreamer/audioeffect.h b/src/3rdparty/phonon/gstreamer/audioeffect.h index 3a985e5..f49f8d2 100644 --- a/src/3rdparty/phonon/gstreamer/audioeffect.h +++ b/src/3rdparty/phonon/gstreamer/audioeffect.h @@ -29,8 +29,8 @@ #include +#ifndef QT_NO_PHONON_EFFECT QT_BEGIN_NAMESPACE - namespace Phonon { namespace Gstreamer @@ -49,7 +49,7 @@ namespace Gstreamer QString m_effectName; }; }} //namespace Phonon::Gstreamer - QT_END_NAMESPACE +#endif //QT_NO_PHONON_EFFECT #endif // Phonon_GSTREAMER_AUDIOEFFECT_H diff --git a/src/3rdparty/phonon/gstreamer/backend.cpp b/src/3rdparty/phonon/gstreamer/backend.cpp index ceaf94a..b285fd9 100644 --- a/src/3rdparty/phonon/gstreamer/backend.cpp +++ b/src/3rdparty/phonon/gstreamer/backend.cpp @@ -117,9 +117,10 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const m_audioOutputs.append(ao); return ao; } +#ifndef QT_NO_PHONON_EFFECT case EffectClass: return new AudioEffect(this, args[0].toInt(), parent); - +#endif //QT_NO_PHONON_EFFECT case AudioDataOutputClass: logMessage("createObject() : AudioDataOutput not implemented"); break; diff --git a/src/3rdparty/phonon/gstreamer/effect.cpp b/src/3rdparty/phonon/gstreamer/effect.cpp index f653535..4937246 100644 --- a/src/3rdparty/phonon/gstreamer/effect.cpp +++ b/src/3rdparty/phonon/gstreamer/effect.cpp @@ -25,8 +25,8 @@ #include +#ifndef QT_NO_PHONON_EFFECT QT_BEGIN_NAMESPACE - namespace Phonon { namespace Gstreamer @@ -241,6 +241,6 @@ void Effect::setParameterValue(const EffectParameter &p, const QVariant &v) } } //namespace Phonon::Gstreamer - QT_END_NAMESPACE +#endif //QT_NO_PHONON_EFFECT #include "moc_effect.cpp" diff --git a/src/3rdparty/phonon/gstreamer/effect.h b/src/3rdparty/phonon/gstreamer/effect.h index dbbb457..51cbe9c 100644 --- a/src/3rdparty/phonon/gstreamer/effect.h +++ b/src/3rdparty/phonon/gstreamer/effect.h @@ -28,8 +28,8 @@ #include +#ifndef QT_NO_PHONON_EFFECT QT_BEGIN_NAMESPACE - namespace Phonon { namespace Gstreamer @@ -58,7 +58,7 @@ namespace Gstreamer QList m_parameterList; }; }} //namespace Phonon::Gstreamer - QT_END_NAMESPACE +#endif //QT_NO_PHONON_EFFECT #endif // Phonon_GSTREAMER_EFFECT_H -- cgit v0.12 From 7c1122b79df61668525b63670c03c5da7e44ac9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 19 Oct 2009 09:41:57 +0200 Subject: Fix QT_NO_XMLSTREAMREADER Reviewed-by: tom --- src/corelib/xml/qxmlstream.g | 4 +++- src/corelib/xml/qxmlstream_p.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/xml/qxmlstream.g b/src/corelib/xml/qxmlstream.g index 3bf0e7d..6c0c0cf 100644 --- a/src/corelib/xml/qxmlstream.g +++ b/src/corelib/xml/qxmlstream.g @@ -243,7 +243,7 @@ public: class QXmlStreamEntityResolver; - +#ifndef QT_NO_XMLSTREAMREADER class QXmlStreamReaderPrivate : public QXmlStreamReader_Table, public QXmlStreamPrivateTagStack{ QXmlStreamReader *q_ptr; Q_DECLARE_PUBLIC(QXmlStreamReader) @@ -1840,4 +1840,6 @@ nmtoken ::= COLON; } return false; } +#endif //QT_NO_XMLSTREAMREADER.xml + ./ diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index ed65409..eee3a13 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -736,9 +736,9 @@ public: } }; - class QXmlStreamEntityResolver; +#ifndef QT_NO_XMLSTREAMREADER class QXmlStreamReaderPrivate : public QXmlStreamReader_Table, public QXmlStreamPrivateTagStack{ QXmlStreamReader *q_ptr; Q_DECLARE_PUBLIC(QXmlStreamReader) @@ -1959,5 +1959,6 @@ bool QXmlStreamReaderPrivate::parse() return false; } +#endif //QT_NO_XMLSTREAMREADER #endif // QXMLSTREAM_P_H -- cgit v0.12 From 7246b5a5942049b485bfdefbe133d7bb12165301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 19 Oct 2009 09:43:36 +0200 Subject: Fix QT_NO_ACTION dependencies Reviewed-by: tom --- src/corelib/global/qfeatures.h | 25 +++++++++++++++---------- src/corelib/global/qfeatures.txt | 11 +++++++++-- src/gui/kernel/qsoftkeymanager.cpp | 3 ++- src/gui/kernel/qsoftkeymanager_p.h | 2 ++ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index d87cf64..1266be1 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -307,11 +307,6 @@ // //#define QT_NO_XMLSTREAM -// Accessibility -#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_ACCESSIBILITY -#endif - // Animation #if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES)) #define QT_NO_ANIMATION @@ -387,11 +382,6 @@ #define QT_NO_PHONON_VOLUMEFADEREFFECT #endif -// Phonon::VolumeSlider -#if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER)) -#define QT_NO_PHONON_VOLUMESLIDER -#endif - // QProcess #if !defined(QT_NO_PROCESS) && (defined(QT_NO_THREAD)) #define QT_NO_PROCESS @@ -442,6 +432,11 @@ #define QT_NO_SOCKS5 #endif +// QSoftKeyManager +#if !defined(QT_NO_SOFTKEYMANAGER) && (defined(QT_NO_ACTION)) +#define QT_NO_SOFTKEYMANAGER +#endif + // QSplitter #if !defined(QT_NO_SPLITTER) && (defined(QT_NO_RUBBERBAND)) #define QT_NO_SPLITTER @@ -497,6 +492,11 @@ #define QT_NO_XMLSTREAMWRITER #endif +// Accessibility +#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_ACTION)) +#define QT_NO_ACCESSIBILITY +#endif + // Context menu #if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) #define QT_NO_CONTEXTMENU @@ -522,6 +522,11 @@ #define QT_NO_LIBRARY #endif +// Phonon::VolumeSlider +#if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER) || defined(QT_NO_ACTION)) +#define QT_NO_PHONON_VOLUMESLIDER +#endif + // QScrollArea #if !defined(QT_NO_SCROLLAREA) && (defined(QT_NO_SCROLLBAR)) #define QT_NO_SCROLLAREA diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index c18df62..9d4eb5e 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -70,6 +70,13 @@ Requires: Name: QAction SeeAlso: ??? +Feature: SOFTKEYMANAGER +Description: Supports softkeys. +Section: Gui +Requires: ACTION +Name: QSoftKeyManager +SeeAlso: ??? + Feature: CURSOR Description: Supports mouse cursors. Section: Kernel @@ -1146,7 +1153,7 @@ SeeAlso: ??? Feature: ACCESSIBILITY Description: Provides accessibility support. Section: Utilities -Requires: PROPERTIES +Requires: PROPERTIES ACTION Name: Accessibility SeeAlso: ??? @@ -1403,7 +1410,7 @@ SeeAlso: ??? Feature: PHONON_VOLUMESLIDER Description: Support for the Volume Slider class Section: Phonon -Requires: SLIDER +Requires: SLIDER ACTION Name: Phonon::VolumeSlider SeeAlso: ??? diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 75c321e..5249dab 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -48,6 +48,7 @@ #include "private/qsoftkeymanager_p.h" #include "private/qobject_p.h" +#ifndef QT_NO_SOFTKEYMANAGER QT_BEGIN_NAMESPACE #ifdef Q_WS_S60 @@ -277,4 +278,4 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList &) #endif QT_END_NAMESPACE - +#endif //QT_NO_SOFTKEYMANAGER diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h index b455445..62d872f 100644 --- a/src/gui/kernel/qsoftkeymanager_p.h +++ b/src/gui/kernel/qsoftkeymanager_p.h @@ -58,6 +58,7 @@ QT_BEGIN_HEADER +#ifndef QT_NO_SOFTKEYMANAGER QT_BEGIN_NAMESPACE class QSoftKeyManagerPrivate; @@ -100,6 +101,7 @@ private Q_SLOTS: }; QT_END_NAMESPACE +#endif //QT_NO_SOFTKEYMANAGER QT_END_HEADER -- cgit v0.12 From e55810dc838e95c60a275f1ea3be3bb6bb93fb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 19 Oct 2009 10:59:39 +0200 Subject: Fix QT_NO_PROPERTIES However, there are some stuff added to qscript that I'm really not sure about. Reviewed-by: tom --- src/3rdparty/phonon/gstreamer/backend.cpp | 3 ++- src/3rdparty/phonon/phonon/factory.cpp | 3 ++- src/script/bridge/qscriptqobject.cpp | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/backend.cpp b/src/3rdparty/phonon/gstreamer/backend.cpp index b285fd9..647bb6f 100644 --- a/src/3rdparty/phonon/gstreamer/backend.cpp +++ b/src/3rdparty/phonon/gstreamer/backend.cpp @@ -55,12 +55,13 @@ Backend::Backend(QObject *parent, const QVariantList &) g_error_free(err); qRegisterMetaType("Message"); - +#ifndef QT_NO_PROPERTIES setProperty("identifier", QLatin1String("phonon_gstreamer")); setProperty("backendName", QLatin1String("Gstreamer")); setProperty("backendComment", QLatin1String("Gstreamer plugin for Phonon")); setProperty("backendVersion", QLatin1String("0.2")); setProperty("backendWebsite", QLatin1String("http://qt.nokia.com/")); +#endif //QT_NO_PROPERTIES //check if we should enable debug output QString debugLevelString = qgetenv("PHONON_GST_DEBUG"); diff --git a/src/3rdparty/phonon/phonon/factory.cpp b/src/3rdparty/phonon/phonon/factory.cpp index e5adb490..881aca3 100644 --- a/src/3rdparty/phonon/phonon/factory.cpp +++ b/src/3rdparty/phonon/phonon/factory.cpp @@ -443,6 +443,7 @@ QObject *Factory::backend(bool createWhenNull) return globalFactory->m_backendObject; } +#ifndef QT_NO_PROPERTIES #define GET_STRING_PROPERTY(name) \ QString Factory::name() \ { \ @@ -458,7 +459,7 @@ GET_STRING_PROPERTY(backendComment) GET_STRING_PROPERTY(backendVersion) GET_STRING_PROPERTY(backendIcon) GET_STRING_PROPERTY(backendWebsite) - +#endif //QT_NO_PROPERTIES QObject *Factory::registerQObject(QObject *o) { if (o) { diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index 345489f..caf1018 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -1190,6 +1190,7 @@ bool QObjectDelegate::getOwnPropertySlot(QScriptObject *object, JSC::ExecState * const JSC::Identifier &propertyName, JSC::PropertySlot &slot) { +#ifndef QT_NO_PROPERTIES QByteArray name = QString(propertyName.ustring()).toLatin1(); QObject *qobject = data->value; if (!qobject) { @@ -1296,12 +1297,16 @@ bool QObjectDelegate::getOwnPropertySlot(QScriptObject *object, JSC::ExecState * } return QScriptObjectDelegate::getOwnPropertySlot(object, exec, propertyName, slot); +#else //QT_NO_PROPERTIES + return false; +#endif //QT_NO_PROPERTIES } void QObjectDelegate::put(QScriptObject *object, JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot &slot) { +#ifndef QT_NO_PROPERTIES QByteArray name = ((QString)propertyName.ustring()).toLatin1(); QObject *qobject = data->value; if (!qobject) { @@ -1392,12 +1397,14 @@ void QObjectDelegate::put(QScriptObject *object, JSC::ExecState* exec, } QScriptObjectDelegate::put(object, exec, propertyName, value, slot); +#endif //QT_NO_PROPERTIES } bool QObjectDelegate::deleteProperty(QScriptObject *object, JSC::ExecState *exec, const JSC::Identifier& propertyName, bool checkDontDelete) { +#ifndef QT_NO_PROPERTIES QByteArray name = ((QString)propertyName.ustring()).toLatin1(); QObject *qobject = data->value; if (!qobject) { @@ -1436,6 +1443,9 @@ bool QObjectDelegate::deleteProperty(QScriptObject *object, JSC::ExecState *exec } return QScriptObjectDelegate::deleteProperty(object, exec, propertyName, checkDontDelete); +#else //QT_NO_PROPERTIES + return false; +#endif //QT_NO_PROPERTIES } bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object, @@ -1443,6 +1453,7 @@ bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object, const JSC::Identifier &propertyName, unsigned &attributes) const { +#ifndef QT_NO_PROPERTIES // ### try to avoid duplicating logic from getOwnPropertySlot() QByteArray name = ((QString)propertyName.ustring()).toLatin1(); QObject *qobject = data->value; @@ -1511,12 +1522,16 @@ bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object, } return QScriptObjectDelegate::getPropertyAttributes(object, exec, propertyName, attributes); +#else //QT_NO_PROPERTIES + return false; +#endif //QT_NO_PROPERTIES } void QObjectDelegate::getOwnPropertyNames(QScriptObject *object, JSC::ExecState *exec, JSC::PropertyNameArray &propertyNames, bool includeNonEnumerable) { +#ifndef QT_NO_PROPERTIES QObject *qobject = data->value; if (!qobject) { QString message = QString::fromLatin1("cannot get property names of deleted QObject"); @@ -1560,6 +1575,7 @@ void QObjectDelegate::getOwnPropertyNames(QScriptObject *object, JSC::ExecState } QScriptObjectDelegate::getOwnPropertyNames(object, exec, propertyNames, includeNonEnumerable); +#endif //QT_NO_PROPERTIES } void QObjectDelegate::markChildren(QScriptObject *object, JSC::MarkStack& markStack) -- cgit v0.12 From 6eb1faad9511dde6ab31b9a4f75fce0bdfbdc12c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 19 Oct 2009 13:55:38 +0200 Subject: Fixed MENU and QWS_PROXYSCREEN Reviewed-by: tom --- src/corelib/global/qfeatures.h | 20 +++++++++++++++----- src/corelib/global/qfeatures.txt | 16 +++++++++++++++- src/plugins/gfxdrivers/transformed/main.cpp | 5 ++++- src/plugins/gfxdrivers/vnc/main.cpp | 5 ++++- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 1266be1..c9dfabb 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -417,6 +417,16 @@ #define QT_NO_QWS_MANAGER #endif +// QVncTransformed +#if !defined(QT_NO_QWS_TRANSFORMED) && (defined(QT_NO_QWS_PROXYSCREEN)) +#define QT_NO_QWS_TRANSFORMED +#endif + +// QVncScreen +#if !defined(QT_NO_QWS_VNC) && (defined(QT_NO_QWS_PROXYSCREEN)) +#define QT_NO_QWS_VNC +#endif + // QScrollBar #if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_SLIDER)) #define QT_NO_SCROLLBAR @@ -492,11 +502,6 @@ #define QT_NO_XMLSTREAMWRITER #endif -// Accessibility -#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_ACTION)) -#define QT_NO_ACCESSIBILITY -#endif - // Context menu #if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) #define QT_NO_CONTEXTMENU @@ -617,6 +622,11 @@ #define QT_NO_UNDOGROUP #endif +// Accessibility +#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_ACTION) || defined(QT_NO_MENU)) +#define QT_NO_ACCESSIBILITY +#endif + // The Model/View Framework #if !defined(QT_NO_ITEMVIEWS) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_SCROLLAREA)) #define QT_NO_ITEMVIEWS diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 9d4eb5e..fb9181b 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1153,7 +1153,7 @@ SeeAlso: ??? Feature: ACCESSIBILITY Description: Provides accessibility support. Section: Utilities -Requires: PROPERTIES ACTION +Requires: PROPERTIES ACTION MENU Name: Accessibility SeeAlso: ??? @@ -1324,6 +1324,20 @@ Requires: Name: QProxyScreen SeeAlso: ??? +Feature: QWS_VNC +Description: Provides VNC screen driver +Section: Qt for Embedded Linux +Requires: QWS_PROXYSCREEN +Name: QVncScreen +SeeAlso: ??? + +Feature: QWS_TRANSFORMED +Description: Provides Transformed screen driver +Section: Qt for Embedded Linux +Requires: QWS_PROXYSCREEN +Name: QVncTransformed +SeeAlso: ??? + Feature: QWS_DYNAMICSCREENTRANSFORMATION Description: Enables dynamic setting of screen transformation/rotation. Section: Qt for Embedded Linux diff --git a/src/plugins/gfxdrivers/transformed/main.cpp b/src/plugins/gfxdrivers/transformed/main.cpp index 982882e..859fd49 100644 --- a/src/plugins/gfxdrivers/transformed/main.cpp +++ b/src/plugins/gfxdrivers/transformed/main.cpp @@ -68,9 +68,12 @@ QStringList GfxTransformedDriver::keys() const QScreen* GfxTransformedDriver::create(const QString& driver, int displayId) { +#ifndef QT_NO_QWS_TRANSFORMED if (driver.toLower() == "transformed") return new QTransformedScreen(displayId); - +#else //QT_NO_QWS_TRANSFORMED + printf("QT buildt with QT_NO_QWS_TRANSFORMED. No screen driver returned\n"); +#endif //QT_NO_QWS_TRANSFORMED return 0; } diff --git a/src/plugins/gfxdrivers/vnc/main.cpp b/src/plugins/gfxdrivers/vnc/main.cpp index aa20d11..7d91ff5 100644 --- a/src/plugins/gfxdrivers/vnc/main.cpp +++ b/src/plugins/gfxdrivers/vnc/main.cpp @@ -68,9 +68,12 @@ QStringList GfxVncDriver::keys() const QScreen* GfxVncDriver::create(const QString& driver, int displayId) { +#ifndef QT_NO_QWS_VNC if (driver.toLower() == "vnc") return new QVNCScreen(displayId); - +#else //QT_NO_QWS_VNC + printf("QT buildt with QT_NO_QWS_VNC. No screen driver returned\n"); +#endif //QT_NO_QWS_VNC return 0; } -- cgit v0.12 From cbef10e1781cdef5ec6dcf0bdeea6506258ee431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 19 Oct 2009 16:25:44 +0200 Subject: Fix Validator Reviewed-by: tom --- src/gui/widgets/qlinecontrol_p.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h index 68898b6..f8e1a5d 100644 --- a/src/gui/widgets/qlinecontrol_p.h +++ b/src/gui/widgets/qlinecontrol_p.h @@ -174,8 +174,10 @@ public: void setMaxLength(int maxLength); int maxLength() const; +#ifndef QT_NO_VALIDATOR const QValidator *validator() const; void setValidator(const QValidator *); +#endif #ifndef QT_NO_COMPLETER QCompleter *completer() const; @@ -282,7 +284,9 @@ private: bool finishChange(int validateFromState = -1, bool update = false, bool edited = true); +#ifndef QT_NO_VALIDATOR QPointer m_validator; +#endif QPointer m_completer; #ifndef QT_NO_COMPLETER bool advanceToEnabledItem(int dir); @@ -623,6 +627,7 @@ inline int QLineControl::maxLength() const return m_maxLength; } +#ifndef QT_NO_VALIDATOR inline const QValidator *QLineControl::validator() const { return m_validator; @@ -632,6 +637,7 @@ inline void QLineControl::setValidator(const QValidator *v) { m_validator = const_cast(v); } +#endif #ifndef QT_NO_COMPLETER inline QCompleter *QLineControl::completer() const -- cgit v0.12 From f56f27e2cfd5880dfa8435f7648b080e02c8ee99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 20 Oct 2009 09:18:44 +0200 Subject: Fix QT_NO_GROUPBOX Reviewed-by: tom --- src/gui/widgets/qplaintextedit.cpp | 2 +- src/gui/widgets/qtextedit.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index fc61889..bb93546 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -1599,7 +1599,6 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e) return; } } -#endif // QT_NO_SHORTCUT if (!(tif & Qt::TextEditable)) { switch (e->key()) { @@ -1627,6 +1626,7 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e) } return; } +#endif // QT_NO_SHORTCUT d->sendControlEvent(e); #ifdef QT_KEYPAD_NAVIGATION diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index f477fee..d995e0f 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -1246,7 +1246,6 @@ void QTextEdit::keyPressEvent(QKeyEvent *e) return; } } -#endif // QT_NO_SHORTCUT if (!(tif & Qt::TextEditable)) { switch (e->key()) { @@ -1274,6 +1273,7 @@ void QTextEdit::keyPressEvent(QKeyEvent *e) } return; } +#endif // QT_NO_SHORTCUT { QTextCursor cursor = d->control->textCursor(); -- cgit v0.12 From 488a89e2671fb93981db6c71f3557500b9f52588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 20 Oct 2009 09:19:40 +0200 Subject: Fix QT_NO_GROUPBOX Reviewed-by: tom --- src/gui/styles/qcleanlooksstyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index fc12cfe..973e682 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -3825,6 +3825,7 @@ QSize QCleanlooksStyle::sizeFromContents(ContentsType type, const QStyleOption * } } break; +#ifndef QT_NO_GROUPBOX case CT_GroupBox: // Since we use a bold font we have to recalculate base width if (const QGroupBox *gb = qobject_cast(widget)) { @@ -3840,6 +3841,7 @@ QSize QCleanlooksStyle::sizeFromContents(ContentsType type, const QStyleOption * } newSize += QSize(0, 1); break; +#endif //QT_NO_GROUPBOX case CT_RadioButton: case CT_CheckBox: newSize += QSize(0, 1); -- cgit v0.12 From d24fd9b951352fe184ff9bccb0f53e18368e8735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 21 Oct 2009 15:23:30 +0200 Subject: Fix LIBRARY and SETTINGS in phonon Reviewed-by: Jens Bache-Wiig Squash me with Fix LIBRARY and SETTINGS in phonon 7d2282 --- src/3rdparty/phonon/gstreamer/artssink.cpp | 3 ++- src/3rdparty/phonon/gstreamer/devicemanager.cpp | 7 +++++-- src/3rdparty/phonon/gstreamer/mediaobject.cpp | 6 +++++- src/3rdparty/phonon/phonon/factory.cpp | 6 ++++++ src/3rdparty/phonon/phonon/globalconfig.cpp | 14 ++++++++++++-- src/3rdparty/phonon/phonon/globalconfig_p.h | 4 ++++ src/3rdparty/phonon/phonon/qsettingsgroup_p.h | 3 +++ 7 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/artssink.cpp b/src/3rdparty/phonon/gstreamer/artssink.cpp index ff56da9..441607d 100644 --- a/src/3rdparty/phonon/gstreamer/artssink.cpp +++ b/src/3rdparty/phonon/gstreamer/artssink.cpp @@ -233,7 +233,7 @@ static void arts_sink_init (ArtsSink * src, ArtsSinkClass * g_class) Q_UNUSED(g_class); GST_DEBUG_OBJECT (src, "initializing artssink"); src->stream = 0; - +#ifndef QT_NO_LIBRARY p_arts_init = (Ptr_arts_init)QLibrary::resolve(QLatin1String("artsc"), 0, "arts_init"); p_arts_play_stream = (Ptr_arts_play_stream)QLibrary::resolve(QLatin1String("artsc"), 0, "arts_play_stream"); p_arts_close_stream = (Ptr_arts_close_stream)QLibrary::resolve(QLatin1String("artsc"), 0, "arts_close_stream"); @@ -250,6 +250,7 @@ static void arts_sink_init (ArtsSink * src, ArtsSinkClass * g_class) } } sinkCount ++; +#endif //QT_NO_LIBRARY } static void arts_sink_dispose (GObject * object) diff --git a/src/3rdparty/phonon/gstreamer/devicemanager.cpp b/src/3rdparty/phonon/gstreamer/devicemanager.cpp index 2240396..86463c1 100644 --- a/src/3rdparty/phonon/gstreamer/devicemanager.cpp +++ b/src/3rdparty/phonon/gstreamer/devicemanager.cpp @@ -72,18 +72,21 @@ DeviceManager::DeviceManager(Backend *backend) : QObject(backend) , m_backend(backend) { + m_audioSink = qgetenv("PHONON_GST_AUDIOSINK"); + m_videoSinkWidget = qgetenv("PHONON_GST_VIDEOMODE"); + +#ifndef QT_NO_SETTINGS QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); - m_audioSink = qgetenv("PHONON_GST_AUDIOSINK"); if (m_audioSink.isEmpty()) { m_audioSink = settings.value(QLatin1String("audiosink"), "Auto").toByteArray().toLower(); } - m_videoSinkWidget = qgetenv("PHONON_GST_VIDEOMODE"); if (m_videoSinkWidget.isEmpty()) { m_videoSinkWidget = settings.value(QLatin1String("videomode"), "Auto").toByteArray().toLower(); } +#endif //QT_NO_SETTINGS if (m_backend->isValid()) updateDeviceList(); diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 0b800af..1c32c3c 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -226,6 +226,7 @@ void MediaObject::cb_unknown_type (GstElement *decodebin, GstPad *pad, GstCaps * QString value = "unknown codec"; // These functions require GStreamer > 0.10.12 +#ifndef QT_NO_LIBRARY static Ptr_gst_pb_utils_init p_gst_pb_utils_init = 0; static Ptr_gst_pb_utils_get_codec_description p_gst_pb_utils_get_codec_description = 0; if (!p_gst_pb_utils_init) { @@ -239,10 +240,13 @@ void MediaObject::cb_unknown_type (GstElement *decodebin, GstPad *pad, GstCaps * codecName = p_gst_pb_utils_get_codec_description (caps); value = QString::fromUtf8(codecName); g_free (codecName); - } else { + } else +#endif //QT_NO_LIBRARY + { // For GStreamer versions < 0.10.12 GstStructure *str = gst_caps_get_structure (caps, 0); value = QString::fromUtf8(gst_structure_get_name (str)); + } media->addMissingCodecName(value); } diff --git a/src/3rdparty/phonon/phonon/factory.cpp b/src/3rdparty/phonon/phonon/factory.cpp index 881aca3..d5010e7 100644 --- a/src/3rdparty/phonon/phonon/factory.cpp +++ b/src/3rdparty/phonon/phonon/factory.cpp @@ -111,6 +111,7 @@ void Factory::setBackend(QObject *b) bool FactoryPrivate::createBackend() { +#ifndef QT_NO_LIBRARY Q_ASSERT(m_backendObject == 0); #ifndef QT_NO_PHONON_PLATFORMPLUGIN PlatformPlugin *f = globalFactory->platformPlugin(); @@ -186,6 +187,11 @@ bool FactoryPrivate::createBackend() SLOT(objectDescriptionChanged(ObjectDescriptionType))); return true; +#else //QT_NO_LIBRARY + pWarning() << Q_FUNC_INFO << "Trying to use Phonon with QT_NO_LIBRARY defined. " + "That is currently not supported"; + return false; +#endif } FactoryPrivate::FactoryPrivate() diff --git a/src/3rdparty/phonon/phonon/globalconfig.cpp b/src/3rdparty/phonon/phonon/globalconfig.cpp index d13e491..3718c6a 100644 --- a/src/3rdparty/phonon/phonon/globalconfig.cpp +++ b/src/3rdparty/phonon/phonon/globalconfig.cpp @@ -38,7 +38,10 @@ QT_BEGIN_NAMESPACE namespace Phonon { -GlobalConfig::GlobalConfig() : m_config(QLatin1String("kde.org"), QLatin1String("libphonon")) +GlobalConfig::GlobalConfig() +#ifndef QT_NO_SETTINGS + : m_config(QLatin1String("kde.org"), QLatin1String("libphonon")) +#endif //QT_NO_SETTINGS { } @@ -82,6 +85,7 @@ static void filter(ObjectDescriptionType type, BackendInterface *backendIface, Q } } +#ifndef QT_NO_PHONON_SETTINGSGROUP static QList listSortedByConfig(const QSettingsGroup &backendConfig, Phonon::Category category, QList &defaultList) { if (defaultList.size() <= 1) { @@ -126,7 +130,9 @@ static QList listSortedByConfig(const QSettingsGroup &backendConfig, Phonon return deviceList; } +#endif //QT_NO_PHONON_SETTINGSGROUP +#ifndef QT_NO_PHONON_SETTINGSGROUP QList GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int override) const { //The devices need to be stored independently for every backend @@ -172,7 +178,7 @@ QList GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int return listSortedByConfig(backendConfig, category, defaultList); } - +#endif //QT_NO_SETTINGSGROUPS int GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override) const { QList ret = audioOutputDeviceListFor(category, override); @@ -184,6 +190,7 @@ int GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override) #ifndef QT_NO_PHONON_AUDIOCAPTURE QList GlobalConfig::audioCaptureDeviceListFor(Phonon::Category category, int override) const { +#ifndef QT_NO_PHONON_SETTINGSGROUP //The devices need to be stored independently for every backend const QSettingsGroup backendConfig(&m_config, QLatin1String("AudioCaptureDevice")); // + Factory::identifier()); const QSettingsGroup generalGroup(&m_config, QLatin1String("General")); @@ -226,6 +233,9 @@ QList GlobalConfig::audioCaptureDeviceListFor(Phonon::Category category, in } return listSortedByConfig(backendConfig, category, defaultList); +#else //QT_NO_SETTINGSGROUP + return QList(); +#endif //QT_NO_SETTINGSGROUP } int GlobalConfig::audioCaptureDeviceFor(Phonon::Category category, int override) const diff --git a/src/3rdparty/phonon/phonon/globalconfig_p.h b/src/3rdparty/phonon/phonon/globalconfig_p.h index 023858f..034bce3 100644 --- a/src/3rdparty/phonon/phonon/globalconfig_p.h +++ b/src/3rdparty/phonon/phonon/globalconfig_p.h @@ -46,7 +46,9 @@ namespace Phonon AdvancedDevicesFromSettings = 2, HideUnavailableDevices = 4 }; +#ifndef QT_NO_PHONON_SETTINGSGROUP QList audioOutputDeviceListFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const; +#endif //QT_NO_PHONON_SETTINGSGROUP int audioOutputDeviceFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const; #ifndef QT_NO_PHONON_AUDIOCAPTURE @@ -55,7 +57,9 @@ namespace Phonon #endif //QT_NO_PHONON_AUDIOCAPTURE protected: +#ifndef QT_NO_SETTINGS QSettings m_config; +#endif //QT_NO_SETTINGS }; } // namespace Phonon diff --git a/src/3rdparty/phonon/phonon/qsettingsgroup_p.h b/src/3rdparty/phonon/phonon/qsettingsgroup_p.h index 95f6c9b..501fe37 100644 --- a/src/3rdparty/phonon/phonon/qsettingsgroup_p.h +++ b/src/3rdparty/phonon/phonon/qsettingsgroup_p.h @@ -27,6 +27,8 @@ #include #include +#ifndef QT_NO_PHONON_SETTINGSGROUP + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -87,5 +89,6 @@ class QSettingsGroup QT_END_NAMESPACE QT_END_HEADER +#endif //QT_NO_PHONON_SETTINGSGROUP #endif // PHONON_QSETTINGSGROUP_P_H -- cgit v0.12 From f73e3063649220f80b2d0ada3a7f087c32c0bfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 21 Oct 2009 15:25:28 +0200 Subject: Fix dependencies in qfeatures Reviewed-by: Trust Me --- src/corelib/global/qfeatures.h | 110 ++++++++++++++++++++++----------------- src/corelib/global/qfeatures.txt | 41 ++++++++++----- 2 files changed, 89 insertions(+), 62 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index c9dfabb..adc2743 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -148,9 +148,6 @@ // Phonon::ObjectDescriptionModel //#define QT_NO_PHONON_OBJECTDESCRIPTIONMODEL -// Phonon::PlatformPlugin -//#define QT_NO_PHONON_PLATFORMPLUGIN - // Phonon::VideoWidget //#define QT_NO_PHONON_VIDEO @@ -175,9 +172,6 @@ // Decoration //#define QT_NO_QWS_DECORATION_DEFAULT -// QWSInputMethod -//#define QT_NO_QWS_INPUTMETHODS - // Keyboard //#define QT_NO_QWS_KEYBOARD @@ -527,9 +521,9 @@ #define QT_NO_LIBRARY #endif -// Phonon::VolumeSlider -#if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER) || defined(QT_NO_ACTION)) -#define QT_NO_PHONON_VOLUMESLIDER +// Phonon::AbstractMediaStream +#if !defined(QT_NO_PHONON_SETTINGSGROUP) && (defined(QT_NO_SETTINGS)) +#define QT_NO_PHONON_SETTINGSGROUP #endif // QScrollArea @@ -537,6 +531,11 @@ #define QT_NO_SCROLLAREA #endif +// QWindowsVistaStyle +#if !defined(QT_NO_STYLE_WINDOWSVISTA) && (defined(QT_NO_STYLE_WINDOWSXP)) +#define QT_NO_STYLE_WINDOWSVISTA +#endif + // OdfWriter #if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) #define QT_NO_TEXTODFWRITER @@ -552,6 +551,11 @@ #define QT_NO_TRANSLATION_UTF8 #endif +// QUndoGroup +#if !defined(QT_NO_UNDOGROUP) && (defined(QT_NO_UNDOSTACK)) +#define QT_NO_UNDOGROUP +#endif + // Drag and drop #if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_IMAGEFORMAT_XPM)) #define QT_NO_DRAGANDDROP @@ -562,11 +566,21 @@ #define QT_NO_GRAPHICSVIEW #endif +// QInputContext +#if !defined(QT_NO_IM) && (defined(QT_NO_LIBRARY)) +#define QT_NO_IM +#endif + // QMdiArea #if !defined(QT_NO_MDIAREA) && (defined(QT_NO_SCROLLAREA)) #define QT_NO_MDIAREA #endif +// Phonon::PlatformPlugin +#if !defined(QT_NO_PHONON_PLATFORMPLUGIN) && (defined(QT_NO_LIBRARY)) +#define QT_NO_PHONON_PLATFORMPLUGIN +#endif + // QPrinter #if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) #define QT_NO_PRINTER @@ -602,11 +616,6 @@ #define QT_NO_STYLE_WINDOWSMOBILE #endif -// QWindowsVistaStyle -#if !defined(QT_NO_STYLE_WINDOWSVISTA) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_STYLE_WINDOWSXP)) -#define QT_NO_STYLE_WINDOWSVISTA -#endif - // QtSvg module #if !defined(QT_NO_SVG) && (defined(QT_NO_XMLSTREAMREADER) || defined(QT_NO_CSSPARSER)) #define QT_NO_SVG @@ -617,14 +626,14 @@ #define QT_NO_TABBAR #endif -// QUndoGroup -#if !defined(QT_NO_UNDOGROUP) && (defined(QT_NO_UNDOCOMMAND) || defined(QT_NO_UNDOSTACK)) -#define QT_NO_UNDOGROUP +// QWhatsThis +#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLBUTTON)) +#define QT_NO_WHATSTHIS #endif -// Accessibility -#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_ACTION) || defined(QT_NO_MENU)) -#define QT_NO_ACCESSIBILITY +// QColorDialog +#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_SPINBOX)) +#define QT_NO_COLORDIALOG #endif // The Model/View Framework @@ -632,6 +641,16 @@ #define QT_NO_ITEMVIEWS #endif +// Phonon::VolumeSlider +#if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_PHONON_VOLUMESLIDER +#endif + +// QWSInputMethod +#if !defined(QT_NO_QWS_INPUTMETHODS) && (defined(QT_NO_IM)) +#define QT_NO_QWS_INPUTMETHODS +#endif + // Sound Server #if !defined(QT_NO_QWS_SOUNDSERVER) && (defined(QT_NO_SOUND) || defined(QT_NO_HOSTINFO) || defined(QT_NO_QWS_MULTIPROCESS)) #define QT_NO_QWS_SOUNDSERVER @@ -662,11 +681,6 @@ #define QT_NO_TEXTEDIT #endif -// QWhatsThis -#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_ACTION)) -#define QT_NO_WHATSTHIS -#endif - // QDirModel #if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS)) #define QT_NO_DIRMODEL @@ -732,11 +746,6 @@ #define QT_NO_TREEVIEW #endif -// QColorDialog -#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR) || defined(QT_NO_SPINBOX)) -#define QT_NO_COLORDIALOG -#endif - // QColumnView #if !defined(QT_NO_COLUMNVIEW) && (defined(QT_NO_LISTVIEW)) #define QT_NO_COLUMNVIEW @@ -772,11 +781,21 @@ #define QT_NO_TABLEWIDGET #endif +// QToolBox +#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_SCROLLAREA)) +#define QT_NO_TOOLBOX +#endif + // QTreeWidget #if !defined(QT_NO_TREEWIDGET) && (defined(QT_NO_TREEVIEW)) #define QT_NO_TREEWIDGET #endif +// Accessibility +#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_MENUBAR)) +#define QT_NO_ACCESSIBILITY +#endif + // Common UNIX Printing System #if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) #define QT_NO_CUPS @@ -787,11 +806,6 @@ #define QT_NO_TOOLBAR #endif -// QToolBox -#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_ICON) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_SCROLLAREA)) -#define QT_NO_TOOLBOX -#endif - // QDockwidget #if !defined(QT_NO_DOCKWIDGET) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_MAINWINDOW)) #define QT_NO_DOCKWIDGET @@ -808,10 +822,20 @@ #endif // QComboBox -#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW)) +#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW) || defined(QT_NO_ICON)) #define QT_NO_COMBOBOX #endif +// QPrintPreviewWidget +#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_MAINWINDOW)) +#define QT_NO_PRINTPREVIEWWIDGET +#endif + +// QWorkSpace +#if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_MAINWINDOW) || defined(QT_NO_MENUBAR)) +#define QT_NO_WORKSPACE +#endif + // QCalendarWidget #if !defined(QT_NO_CALENDARWIDGET) && (defined(QT_NO_TABLEVIEW) || defined(QT_NO_MENU) || defined(QT_NO_TEXTDATE) || defined(QT_NO_SPINBOX) || defined(QT_NO_TOOLBUTTON)) #define QT_NO_CALENDARWIDGET @@ -842,18 +866,8 @@ #define QT_NO_FONTDIALOG #endif -// QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_PRINTPREVIEWWIDGET -#endif - -// QWorkSpace -#if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_MENU) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_MAINWINDOW) || defined(QT_NO_TOOLBAR) || defined(QT_NO_MENUBAR)) -#define QT_NO_WORKSPACE -#endif - // QPrintDialog -#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_TREEVIEW) || defined(QT_NO_STACKEDWIDGET) || defined(QT_NO_TABWIDGET)) +#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_TREEVIEW) || defined(QT_NO_TABWIDGET)) #define QT_NO_PRINTDIALOG #endif @@ -863,7 +877,7 @@ #endif // QPrintPreviewDialog -#if !defined(QT_NO_PRINTPREVIEWDIALOG) && (defined(QT_NO_PRINTPREVIEWWIDGET) || defined(QT_NO_PRINTDIALOG) || defined(QT_NO_MAINWINDOW)) +#if !defined(QT_NO_PRINTPREVIEWDIALOG) && (defined(QT_NO_PRINTPREVIEWWIDGET) || defined(QT_NO_PRINTDIALOG)) #define QT_NO_PRINTPREVIEWDIALOG #endif diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index fb9181b..4b012d9 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -154,6 +154,12 @@ Requires: XMLSTREAM Name: QXmlStreamWriter SeeAlso: ??? +Feature: IM +Description: Inputmethods with QInputContext +Section: Kernel +Requires: LIBRARY +Name: QInputContext +SeeAlso: ??? # Data structures Feature: STL @@ -346,7 +352,7 @@ SeeAlso: ??? Feature: COMBOBOX Description: Supports comboboxes presenting a list of options to the user. Section: Widgets -Requires: LINEEDIT STANDARDITEMMODEL LISTVIEW +Requires: LINEEDIT STANDARDITEMMODEL LISTVIEW ICON Name: QComboBox SeeAlso: ??? @@ -374,7 +380,7 @@ SeeAlso: ??? Feature: TOOLBOX Description: Supports columns of tabbed widget items. Section: Widgets -Requires: ICON TOOLBUTTON SCROLLAREA +Requires: TOOLBUTTON SCROLLAREA Name: QToolBox SeeAlso: ??? @@ -410,7 +416,7 @@ SeeAlso: ??? Feature: WORKSPACE Description: Supports workspace windows, e.g. used in an MDI application. Section: Widgets -Requires: SCROLLBAR RESIZEHANDLER MENU TOOLBUTTON MAINWINDOW TOOLBAR MENUBAR +Requires: SCROLLBAR MAINWINDOW MENUBAR Name: QWorkSpace SeeAlso: ??? @@ -544,7 +550,7 @@ SeeAlso: ??? Feature: WHATSTHIS Description: Supports displaying "What's this" help. Section: Widgets -Requires: TOOLBUTTON ACTION +Requires: TOOLBUTTON Name: QWhatsThis SeeAlso: ??? @@ -574,7 +580,7 @@ Feature: PRINTPREVIEWWIDGET Description: Provides a widget for previewing page layouts for printer output. a date. Section: Widgets -Requires: GRAPHICSVIEW PRINTER TOOLBAR MAINWINDOW +Requires: GRAPHICSVIEW PRINTER MAINWINDOW Name: QPrintPreviewWidget SeeAlso: ??? @@ -591,7 +597,7 @@ SeeAlso: ??? Feature: COLORDIALOG Description: Supports a dialog widget for specifying colors. Section: Dialogs -Requires: LINEEDIT VALIDATOR SPINBOX +Requires: SPINBOX Name: QColorDialog SeeAlso: ??? @@ -612,14 +618,14 @@ SeeAlso: ??? Feature: PRINTDIALOG Description: Supports a dialog widget for specifying printer configuration. Section: Dialogs -Requires: PRINTER COMBOBOX BUTTONGROUP SPINBOX TREEVIEW STACKEDWIDGET TABWIDGET +Requires: PRINTER COMBOBOX BUTTONGROUP SPINBOX TREEVIEW TABWIDGET Name: QPrintDialog SeeAlso: ??? Feature: PRINTPREVIEWDIALOG Description: Provides a dialog for previewing and configuring page layouts for printer output. Section: Dialogs -Requires: PRINTPREVIEWWIDGET PRINTDIALOG MAINWINDOW +Requires: PRINTPREVIEWWIDGET PRINTDIALOG Name: QPrintPreviewDialog SeeAlso: ??? @@ -779,7 +785,7 @@ SeeAlso: ??? Feature: STYLE_WINDOWSVISTA Description: Supports a Microsoft WindowsVista-like look and feel. Section: Styles -Requires: STYLE_WINDOWS STYLE_WINDOWSXP +Requires: STYLE_WINDOWSXP Name: QWindowsVistaStyle SeeAlso: ??? @@ -1021,7 +1027,7 @@ SeeAlso: ??? Feature: QWS_INPUTMETHODS Description: Supports international input methods. Section: Internationalization -Requires: +Requires: IM Name: QWSInputMethod SeeAlso: ??? @@ -1139,7 +1145,7 @@ SeeAlso: ??? Feature: UNDOGROUP Description: Section: Utilities -Requires: UNDOCOMMAND UNDOSTACK +Requires: UNDOSTACK Name: QUndoGroup SeeAlso: ??? @@ -1153,7 +1159,7 @@ SeeAlso: ??? Feature: ACCESSIBILITY Description: Provides accessibility support. Section: Utilities -Requires: PROPERTIES ACTION MENU +Requires: PROPERTIES MENUBAR Name: Accessibility SeeAlso: ??? @@ -1359,7 +1365,7 @@ SeeAlso: ??? Feature: PHONON_PLATFORMPLUGIN Description: Support for platform plugin Section: Phonon -Requires: +Requires: LIBRARY Name: Phonon::PlatformPlugin SeeAlso: ??? @@ -1424,7 +1430,7 @@ SeeAlso: ??? Feature: PHONON_VOLUMESLIDER Description: Support for the Volume Slider class Section: Phonon -Requires: SLIDER ACTION +Requires: SLIDER TOOLBUTTON Name: Phonon::VolumeSlider SeeAlso: ??? @@ -1441,3 +1447,10 @@ Section: Phonon Requires: Name: Phonon::AbstractMediaStream SeeAlso: ??? + +Feature: PHONON_SETTINGSGROUP +Description: Phonon settingsgroup +Section: Phonon +Requires: SETTINGS +Name: Phonon::AbstractMediaStream +SeeAlso: ??? -- cgit v0.12 From fccbc9b94d843f4c55834ee75127cd6219b4839a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 21 Oct 2009 15:26:06 +0200 Subject: Fix LIBRARY and ICON However, compiling with QT_NO_ICON will still not work :( Reviewed-by: tom --- src/gui/graphicsview/qgraphicsitem.cpp | 2 ++ src/gui/graphicsview/qgraphicsscene.cpp | 2 ++ src/gui/image/qicon.cpp | 2 ++ src/gui/image/qicon_p.h | 3 ++- src/gui/image/qiconloader.cpp | 9 +++++++-- src/gui/image/qiconloader_p.h | 3 +++ src/gui/kernel/qapplication.cpp | 5 ++++- src/gui/kernel/qwidget.cpp | 12 ++++++++++++ src/gui/kernel/qwidget_qws.cpp | 3 ++- src/gui/painting/qprinterinfo_unix.cpp | 2 ++ src/gui/text/qtextcontrol.cpp | 2 ++ src/gui/widgets/qcombobox.h | 1 - src/gui/widgets/qlinecontrol.cpp | 3 ++- src/network/access/qnetworkaccessdebugpipebackend.cpp | 4 ++-- src/plugins/gfxdrivers/qvfb/main.cpp | 2 ++ src/plugins/gfxdrivers/transformed/main.cpp | 3 ++- src/plugins/gfxdrivers/vnc/main.cpp | 3 +++ 17 files changed, 51 insertions(+), 10 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 2685b86..f7cea17 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -9670,12 +9670,14 @@ bool QGraphicsTextItem::sceneEvent(QEvent *event) // Reset the focus widget's input context, regardless // of how this item gained or lost focus. if (QWidget *fw = qApp->focusWidget()) { +#ifndef QT_NO_IM if (QInputContext *qic = fw->inputContext()) { if (event->type() == QEvent::FocusIn || event->type() == QEvent::FocusOut) qic->reset(); else qic->update(); } +#endif //QT_NO_IM } break; default: diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index c459d21..1e4fe6f 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -691,6 +691,7 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item, focusItem = 0; sendEvent(lastFocusItem, &event); +#ifndef QT_NO_IM if (lastFocusItem && (lastFocusItem->flags() & QGraphicsItem::ItemAcceptsInputMethod)) { // Reset any visible preedit text @@ -706,6 +707,7 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item, views.at(i)->inputContext()->reset(); } } +#endif //QT_NO_IM } if (item) { diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index e0779a0..cff9cd2 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -66,6 +66,7 @@ #include "private/qkde_p.h" #endif +#ifndef QT_NO_ICON QT_BEGIN_NAMESPACE /*! @@ -1217,3 +1218,4 @@ QSize QIcon::pixmapSize(Size which) */ QT_END_NAMESPACE +#endif //QT_NO_ICON diff --git a/src/gui/image/qicon_p.h b/src/gui/image/qicon_p.h index fc96a65..43a59a6 100644 --- a/src/gui/image/qicon_p.h +++ b/src/gui/image/qicon_p.h @@ -60,6 +60,7 @@ #include #include +#ifndef QT_NO_ICON QT_BEGIN_NAMESPACE class QIconPrivate @@ -134,5 +135,5 @@ private: }; QT_END_NAMESPACE - +#endif //QT_NO_ICON #endif // QICON_P_H diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 46c5431..234f271 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +#ifndef QT_NO_ICON #include #include @@ -92,11 +92,13 @@ QIconLoader::QIconLoader() : if (m_systemTheme.isEmpty()) m_systemTheme = fallbackTheme(); +#ifndef QT_NO_LIBRARY QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid, QLatin1String("/iconengines"), Qt::CaseInsensitive); if (iconFactoryLoader.keys().contains(QLatin1String("svg"))) m_supportsSvg = true; +#endif //QT_NO_LIBRARY } QIconLoader *QIconLoader::instance() @@ -160,7 +162,7 @@ QIconTheme::QIconTheme(const QString &themeName) break; } } - +#ifndef QT_NO_SETTINGS if (themeIndex.exists()) { const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat); QStringListIterator keyIterator(indexReader.allKeys()); @@ -213,6 +215,7 @@ QIconTheme::QIconTheme(const QString &themeName) if (!m_parents.contains(QLatin1String("hicolor"))) m_parents.append(QLatin1String("hicolor")); } +#endif //QT_NO_SETTINGS } QThemeIconEntries QIconLoader::findIconHelper(const QString &themeName, @@ -546,3 +549,5 @@ void QIconLoaderEngine::virtual_hook(int id, void *data) } QT_END_NAMESPACE + +#endif //QT_NO_ICON diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h index b152d46..2a330d3 100644 --- a/src/gui/image/qiconloader_p.h +++ b/src/gui/image/qiconloader_p.h @@ -42,6 +42,7 @@ #ifndef QDESKTOPICON_P_H #define QDESKTOPICON_P_H +#ifndef QT_NO_ICON // // W A R N I N G // ------------- @@ -185,3 +186,5 @@ private: QT_END_NAMESPACE #endif // QDESKTOPICON_P_H + +#endif //QT_NO_ICON diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 85b055e..30d3c7f 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2081,7 +2081,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) } QWidget *prev = focus_widget; focus_widget = focus; - +#ifndef QT_NO_IM if (prev && ((reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason && prev->testAttribute(Qt::WA_InputMethodEnabled)) // Do reset the input context, in case the new focus widget won't accept keyboard input @@ -2094,6 +2094,7 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) qic->setFocusWidget(0); } } +#endif //QT_NO_IM if(focus_widget) focus_widget->d_func()->setFocus_sys(); @@ -2125,12 +2126,14 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) QApplication::sendEvent(that->style(), &out); } if(focus && QApplicationPrivate::focus_widget == focus) { +#ifndef QT_NO_IM if (focus->testAttribute(Qt::WA_InputMethodEnabled)) { QInputContext *qic = focus->inputContext(); if (qic && focus->testAttribute(Qt::WA_WState_Created) && focus->isEnabled()) qic->setFocusWidget(focus); } +#endif //QT_NO_IM QFocusEvent in(QEvent::FocusIn, reason); QPointer that = focus; QApplication::sendEvent(focus, &in); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 5fa9a92..916ae8b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -3072,6 +3072,7 @@ void QWidgetPrivate::setEnabled_helper(bool enable) #if defined(Q_WS_MAC) setEnabled_helper_sys(enable); #endif +#ifndef QT_NO_IM if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) { QInputContext *qic = inputContext(); if (enable) { @@ -3081,6 +3082,7 @@ void QWidgetPrivate::setEnabled_helper(bool enable) qic->setFocusWidget(0); } } +#endif //QT_NO_IM QEvent e(QEvent::EnabledChange); QApplication::sendEvent(q, &e); #ifdef QT3_SUPPORT @@ -8950,11 +8952,16 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const Qt::InputMethodHints QWidget::inputMethodHints() const { Q_D(const QWidget); +#ifndef QT_NO_IM return d->imHints; +#else //QT_NO_IM + return 0; +#endif //QT_NO_IM } void QWidget::setInputMethodHints(Qt::InputMethodHints hints) { +#ifndef QT_NO_IM Q_D(QWidget); d->imHints = hints; // Optimisation to update input context only it has already been created. @@ -8963,6 +8970,7 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints) if (ic) ic->update(); } +#endif //QT_NO_IM } @@ -10294,6 +10302,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) QApplication::sendEvent(this, &e); break; } case Qt::WA_NativeWindow: { +#ifndef QT_NO_IM QInputContext *ic = 0; if (on && !internalWinId() && testAttribute(Qt::WA_InputMethodEnabled) && hasFocus()) { ic = d->inputContext(); @@ -10306,6 +10315,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) d->createWinId(); if (ic && isEnabled()) ic->setFocusWidget(this); +#endif //QT_NO_IM break; } case Qt::WA_PaintOnScreen: @@ -10335,6 +10345,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) #endif break; case Qt::WA_InputMethodEnabled: { +#ifndef QT_NO_IM QInputContext *ic = d->ic; if (!ic && (!on || hasFocus())) ic = d->inputContext(); @@ -10346,6 +10357,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) ic->setFocusWidget(0); } } +#endif //QT_NO_IM break; } case Qt::WA_WindowPropagation: diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp index 0f46016..e299c6e 100644 --- a/src/gui/kernel/qwidget_qws.cpp +++ b/src/gui/kernel/qwidget_qws.cpp @@ -280,7 +280,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) QApplicationPrivate::leaveModal(this); else if ((windowType() == Qt::Popup)) qApp->d_func()->closePopup(this); - +#ifndef QT_NO_IM if (d->ic) { delete d->ic; d->ic =0; @@ -291,6 +291,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (qic) qic->widgetDestroyed(this); } +#endif //QT_NO_IM if ((windowType() == Qt::Desktop)) { } else { diff --git a/src/gui/painting/qprinterinfo_unix.cpp b/src/gui/painting/qprinterinfo_unix.cpp index 7e2946a..6684ff7 100644 --- a/src/gui/painting/qprinterinfo_unix.cpp +++ b/src/gui/painting/qprinterinfo_unix.cpp @@ -421,6 +421,7 @@ int qt_pd_foreach(int /*status */, char * /*key */, int /*keyLen */, int qt_retrieveNisPrinters(QList *printers) { +#ifndef QT_NO_LIBRARY typedef int (*WildCast)(int, char *, int, char *, int, char *); char printersConfByname[] = "printers.conf.byname"; char *domain; @@ -444,6 +445,7 @@ int qt_retrieveNisPrinters(QList *printers) if (!err) return Success; } +#endif //QT_NO_LIBRARY return Unavail; } diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index ee8b751..3f6545c 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1619,9 +1619,11 @@ void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF if (cursor.position() != oldCursorPos) emit q->cursorPositionChanged(); _q_updateCurrentCharFormatAndSelection(); +#ifndef QT_NO_IM if (QInputContext *ic = inputContext()) { ic->update(); } +#endif //QT_NO_IM } else { //emit q->visibilityRequest(QRectF(mousePos, QSizeF(1, 1))); if (cursor.position() != oldCursorPos) diff --git a/src/gui/widgets/qcombobox.h b/src/gui/widgets/qcombobox.h index 6a85096..462636c 100644 --- a/src/gui/widgets/qcombobox.h +++ b/src/gui/widgets/qcombobox.h @@ -52,7 +52,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Gui) - #ifndef QT_NO_COMBOBOX class QAbstractItemView; diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 7f9ff82..8f17e98 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -447,8 +447,9 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) cursorPositionChanged = true; } } - +#ifndef QT_NO_IM setPreeditArea(m_cursor, event->preeditString()); +#endif //QT_NO_IM m_preeditCursor = event->preeditString().length(); m_hideCursor = false; QList formats; diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index b4af5b6..4f7f15c 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -229,7 +229,7 @@ void QNetworkAccessDebugPipeBackend::possiblyFinish() void QNetworkAccessDebugPipeBackend::closeDownstreamChannel() { - qWarning() << "QNetworkAccessDebugPipeBackend::closeDownstreamChannel()" << operation(); + qWarning("QNetworkAccessDebugPipeBackend::closeDownstreamChannel()",operation());; //if (operation() == QNetworkAccessManager::GetOperation) // socket.disconnectFromHost(); } @@ -237,7 +237,7 @@ void QNetworkAccessDebugPipeBackend::closeDownstreamChannel() void QNetworkAccessDebugPipeBackend::socketError() { - qWarning() << "QNetworkAccessDebugPipeBackend::socketError()" << socket.error(); + qWarning("QNetworkAccessDebugPipeBackend::socketError()", socket.error()); QNetworkReply::NetworkError code; switch (socket.error()) { case QAbstractSocket::RemoteHostClosedError: diff --git a/src/plugins/gfxdrivers/qvfb/main.cpp b/src/plugins/gfxdrivers/qvfb/main.cpp index bcaecab..beca37e 100644 --- a/src/plugins/gfxdrivers/qvfb/main.cpp +++ b/src/plugins/gfxdrivers/qvfb/main.cpp @@ -43,6 +43,7 @@ #include #include +#ifndef QT_NO_LIBRARY QT_BEGIN_NAMESPACE class ScreenVfbDriver : public QScreenDriverPlugin @@ -78,3 +79,4 @@ Q_EXPORT_STATIC_PLUGIN(ScreenVfbDriver) Q_EXPORT_PLUGIN2(qscreenvfb, ScreenVfbDriver) QT_END_NAMESPACE +#endif //QT_NO_LIBRARY diff --git a/src/plugins/gfxdrivers/transformed/main.cpp b/src/plugins/gfxdrivers/transformed/main.cpp index 859fd49..a9ff97d 100644 --- a/src/plugins/gfxdrivers/transformed/main.cpp +++ b/src/plugins/gfxdrivers/transformed/main.cpp @@ -42,7 +42,7 @@ #include #include #include - +#ifndef QT_NO_LIBRARY QT_BEGIN_NAMESPACE class GfxTransformedDriver : public QScreenDriverPlugin @@ -81,3 +81,4 @@ Q_EXPORT_STATIC_PLUGIN(GfxTransformedDriver) Q_EXPORT_PLUGIN2(qgfxtransformed, GfxTransformedDriver) QT_END_NAMESPACE +#endif //QT_NO_LIBRARY diff --git a/src/plugins/gfxdrivers/vnc/main.cpp b/src/plugins/gfxdrivers/vnc/main.cpp index 7d91ff5..58c8c25 100644 --- a/src/plugins/gfxdrivers/vnc/main.cpp +++ b/src/plugins/gfxdrivers/vnc/main.cpp @@ -43,6 +43,7 @@ #include #include +#ifndef QT_NO_LIBRARY QT_BEGIN_NAMESPACE class GfxVncDriver : public QScreenDriverPlugin @@ -81,3 +82,5 @@ Q_EXPORT_STATIC_PLUGIN(GfxVncDriver) Q_EXPORT_PLUGIN2(qgfxvnc, GfxVncDriver) QT_END_NAMESPACE + +#endif //QT_NO_LIBRARY -- cgit v0.12 From a45a8e33b72a4a86ae269acabc5e95ed8452cda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 22 Oct 2009 11:32:20 +0200 Subject: Fix QT_NO_PHONON_VIDEO Reviewed-by: Jens Bache-Wiig --- src/3rdparty/phonon/gstreamer/abstractrenderer.cpp | 3 ++- src/3rdparty/phonon/gstreamer/abstractrenderer.h | 3 ++- src/3rdparty/phonon/gstreamer/backend.cpp | 7 +++---- src/3rdparty/phonon/gstreamer/devicemanager.cpp | 2 ++ src/3rdparty/phonon/gstreamer/videowidget.cpp | 2 ++ src/3rdparty/phonon/gstreamer/videowidget.h | 3 ++- src/3rdparty/phonon/gstreamer/widgetrenderer.cpp | 2 ++ src/3rdparty/phonon/gstreamer/widgetrenderer.h | 3 ++- 8 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/abstractrenderer.cpp b/src/3rdparty/phonon/gstreamer/abstractrenderer.cpp index 924b611..5d88d10 100644 --- a/src/3rdparty/phonon/gstreamer/abstractrenderer.cpp +++ b/src/3rdparty/phonon/gstreamer/abstractrenderer.cpp @@ -17,6 +17,7 @@ #include "abstractrenderer.h" +#ifndef QT_NO_PHONON_VIDEO QT_BEGIN_NAMESPACE namespace Phonon @@ -52,5 +53,5 @@ void AbstractRenderer::movieSizeChanged(const QSize &size) } //namespace Phonon::Gstreamer QT_END_NAMESPACE - +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/gstreamer/abstractrenderer.h b/src/3rdparty/phonon/gstreamer/abstractrenderer.h index 140413d..10a2822 100644 --- a/src/3rdparty/phonon/gstreamer/abstractrenderer.h +++ b/src/3rdparty/phonon/gstreamer/abstractrenderer.h @@ -23,6 +23,7 @@ #include "medianode.h" #include +#ifndef QT_NO_PHONON_VIDEO QT_BEGIN_NAMESPACE class QString; @@ -58,5 +59,5 @@ protected: } //namespace Phonon::Gstreamer QT_END_NAMESPACE - +#endif //QT_NO_PHONON_VIDEO #endif // Phonon_GSTREAMER_ABSTRACTRENDERER_H diff --git a/src/3rdparty/phonon/gstreamer/backend.cpp b/src/3rdparty/phonon/gstreamer/backend.cpp index 647bb6f..e1ffd1f 100644 --- a/src/3rdparty/phonon/gstreamer/backend.cpp +++ b/src/3rdparty/phonon/gstreamer/backend.cpp @@ -126,6 +126,7 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const logMessage("createObject() : AudioDataOutput not implemented"); break; +#ifndef QT_NO_PHONON_VIDEO case VideoDataOutputClass: logMessage("createObject() : VideoDataOutput not implemented"); break; @@ -134,12 +135,10 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QWidget *widget = qobject_cast(parent); return new VideoWidget(this, widget); } - - case VolumeFaderEffectClass: +#endif //QT_NO_PHONON_VIDEO #ifndef QT_NO_PHONON_VOLUMEFADEREFFECT + case VolumeFaderEffectClass: return new VolumeFaderEffect(this, parent); -#else - return 0; #endif //QT_NO_PHONON_VOLUMEFADEREFFECT case VisualizationClass: //Fall through diff --git a/src/3rdparty/phonon/gstreamer/devicemanager.cpp b/src/3rdparty/phonon/gstreamer/devicemanager.cpp index 86463c1..60e860f 100644 --- a/src/3rdparty/phonon/gstreamer/devicemanager.cpp +++ b/src/3rdparty/phonon/gstreamer/devicemanager.cpp @@ -246,6 +246,7 @@ GstElement *DeviceManager::createAudioSink(Category category) return sink; } +#ifndef QT_NO_PHONON_VIDEO AbstractRenderer *DeviceManager::createVideoRenderer(VideoWidget *parent) { #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES) @@ -268,6 +269,7 @@ AbstractRenderer *DeviceManager::createVideoRenderer(VideoWidget *parent) #endif return new WidgetRenderer(parent); } +#endif //QT_NO_PHONON_VIDEO /* * Returns a positive device id or -1 if device diff --git a/src/3rdparty/phonon/gstreamer/videowidget.cpp b/src/3rdparty/phonon/gstreamer/videowidget.cpp index efc750a..e1f0ec9 100644 --- a/src/3rdparty/phonon/gstreamer/videowidget.cpp +++ b/src/3rdparty/phonon/gstreamer/videowidget.cpp @@ -33,6 +33,7 @@ #include "widgetrenderer.h" #include "x11renderer.h" +#ifndef QT_NO_PHONON_VIDEO QT_BEGIN_NAMESPACE namespace Phonon @@ -383,5 +384,6 @@ void VideoWidget::mediaNodeEvent(const MediaNodeEvent *event) } //namespace Phonon::Gstreamer QT_END_NAMESPACE +#endif //QT_NO_PHONON_VIDEO #include "moc_videowidget.cpp" diff --git a/src/3rdparty/phonon/gstreamer/videowidget.h b/src/3rdparty/phonon/gstreamer/videowidget.h index a0ebe5f..dc0754d 100644 --- a/src/3rdparty/phonon/gstreamer/videowidget.h +++ b/src/3rdparty/phonon/gstreamer/videowidget.h @@ -28,6 +28,7 @@ #include +#ifndef QT_NO_PHONON_VIDEO QT_BEGIN_NAMESPACE class QString; @@ -102,5 +103,5 @@ private: } //namespace Phonon::Gstreamer QT_END_NAMESPACE - +#endif //QT_NO_PHONON_VIDEO #endif // Phonon_GSTREAMER_VIDEOWIDGET_H diff --git a/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp b/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp index d4a411f..423af9d 100644 --- a/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp +++ b/src/3rdparty/phonon/gstreamer/widgetrenderer.cpp @@ -32,6 +32,7 @@ # define GL_TEXTURE2 0x84C2 #endif +#ifndef QT_NO_PHONON_VIDEO QT_BEGIN_NAMESPACE static void frameRendered() @@ -148,3 +149,4 @@ bool WidgetRenderer::eventFilter(QEvent * event) } //namespace Phonon::Gstreamer QT_END_NAMESPACE +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/gstreamer/widgetrenderer.h b/src/3rdparty/phonon/gstreamer/widgetrenderer.h index ff64fa7..03ee9c0 100644 --- a/src/3rdparty/phonon/gstreamer/widgetrenderer.h +++ b/src/3rdparty/phonon/gstreamer/widgetrenderer.h @@ -26,6 +26,7 @@ #include #endif +#ifndef QT_NO_PHONON_VIDEO QT_BEGIN_NAMESPACE class QString; @@ -59,5 +60,5 @@ private: } //namespace Phonon::Gstreamer QT_END_NAMESPACE - +#endif //QT_NO_PHONON_VIDEO #endif // Phonon_GSTREAMER_WIDGETRENDERER_H -- cgit v0.12 From 433d3d130ac1b542f12574566c176f065bab29d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 22 Oct 2009 13:46:32 +0200 Subject: Remove ICON from QFeature Reviewed-by: Trust Me --- src/corelib/global/qconfig-local.h | 3 + src/corelib/global/qfeatures.h | 109 ++++++++++++++++++------------------- src/corelib/global/qfeatures.txt | 13 +---- 3 files changed, 58 insertions(+), 67 deletions(-) create mode 100644 src/corelib/global/qconfig-local.h diff --git a/src/corelib/global/qconfig-local.h b/src/corelib/global/qconfig-local.h new file mode 100644 index 0000000..90db873 --- /dev/null +++ b/src/corelib/global/qconfig-local.h @@ -0,0 +1,3 @@ +#ifndef QT_NO_SCROLLAREA +# define QT_NO_SCROLLAREA +#endif diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index adc2743..e4fd67a 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -82,9 +82,6 @@ // QGroupBox //#define QT_NO_GROUPBOX -// QIcon -//#define QT_NO_ICON - // QImageIOPlugin //#define QT_NO_IMAGEFORMATPLUGIN @@ -256,6 +253,9 @@ // QSystemSemaphore //#define QT_NO_SYSTEMSEMAPHORE +// QSystemTrayIcon +//#define QT_NO_SYSTEMTRAYICON + // QTabletEvent //#define QT_NO_TABLETEVENT @@ -466,9 +466,9 @@ #define QT_NO_SXE #endif -// QSystemTrayIcon -#if !defined(QT_NO_SYSTEMTRAYICON) && (defined(QT_NO_ICON)) -#define QT_NO_SYSTEMTRAYICON +// QToolButton +#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ACTION)) +#define QT_NO_TOOLBUTTON #endif // QUndoStack @@ -536,16 +536,16 @@ #define QT_NO_STYLE_WINDOWSVISTA #endif +// QTabBar +#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON)) +#define QT_NO_TABBAR +#endif + // OdfWriter #if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) #define QT_NO_TEXTODFWRITER #endif -// QToolButton -#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ICON) || defined(QT_NO_ACTION)) -#define QT_NO_TOOLBUTTON -#endif - // Translation (UTF-8 representation) #if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC)) #define QT_NO_TRANSLATION_UTF8 @@ -556,6 +556,11 @@ #define QT_NO_UNDOGROUP #endif +// QWhatsThis +#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLBUTTON)) +#define QT_NO_WHATSTHIS +#endif + // Drag and drop #if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_IMAGEFORMAT_XPM)) #define QT_NO_DRAGANDDROP @@ -581,6 +586,11 @@ #define QT_NO_PHONON_PLATFORMPLUGIN #endif +// Phonon::VolumeSlider +#if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_PHONON_VOLUMESLIDER +#endif + // QPrinter #if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) #define QT_NO_PRINTER @@ -621,14 +631,9 @@ #define QT_NO_SVG #endif -// QTabBar -#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON)) -#define QT_NO_TABBAR -#endif - -// QWhatsThis -#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLBUTTON)) -#define QT_NO_WHATSTHIS +// Q3TabDialog +#if !defined(QT_NO_TABDIALOG) && (defined(QT_NO_TABBAR)) +#define QT_NO_TABDIALOG #endif // QColorDialog @@ -641,9 +646,9 @@ #define QT_NO_ITEMVIEWS #endif -// Phonon::VolumeSlider -#if !defined(QT_NO_PHONON_VOLUMESLIDER) && (defined(QT_NO_SLIDER) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_PHONON_VOLUMESLIDER +// QMenuBar +#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_MENU) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_MENUBAR #endif // QWSInputMethod @@ -666,9 +671,9 @@ #define QT_NO_SVGRENDERER #endif -// Q3TabDialog -#if !defined(QT_NO_TABDIALOG) && (defined(QT_NO_TABBAR)) -#define QT_NO_TABDIALOG +// QTabWidget +#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_STACKEDWIDGET)) +#define QT_NO_TABWIDGET #endif // QTextCodecPlugin @@ -696,9 +701,9 @@ #define QT_NO_LISTVIEW #endif -// QMenuBar -#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_MENU) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_MENUBAR +// QMainWindow +#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_MENU) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON)) +#define QT_NO_MAINWINDOW #endif // QAbstractProxyModel @@ -731,21 +736,26 @@ #define QT_NO_TABLEVIEW #endif -// QTabWidget -#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_STACKEDWIDGET)) -#define QT_NO_TABWIDGET -#endif - // QTextBrowser #if !defined(QT_NO_TEXTBROWSER) && (defined(QT_NO_TEXTEDIT)) #define QT_NO_TEXTBROWSER #endif +// QToolBox +#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_SCROLLAREA)) +#define QT_NO_TOOLBOX +#endif + // QTreeView #if !defined(QT_NO_TREEVIEW) && (defined(QT_NO_ITEMVIEWS)) #define QT_NO_TREEVIEW #endif +// Accessibility +#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_MENUBAR)) +#define QT_NO_ACCESSIBILITY +#endif + // QColumnView #if !defined(QT_NO_COLUMNVIEW) && (defined(QT_NO_LISTVIEW)) #define QT_NO_COLUMNVIEW @@ -766,11 +776,6 @@ #define QT_NO_LISTWIDGET #endif -// QMainWindow -#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_MENU) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_MAINWINDOW -#endif - // QSortFilterProxyModel #if !defined(QT_NO_SORTFILTERPROXYMODEL) && (defined(QT_NO_PROXYMODEL)) #define QT_NO_SORTFILTERPROXYMODEL @@ -781,9 +786,9 @@ #define QT_NO_TABLEWIDGET #endif -// QToolBox -#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_SCROLLAREA)) -#define QT_NO_TOOLBOX +// QToolBar +#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW)) +#define QT_NO_TOOLBAR #endif // QTreeWidget @@ -791,21 +796,11 @@ #define QT_NO_TREEWIDGET #endif -// Accessibility -#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_MENUBAR)) -#define QT_NO_ACCESSIBILITY -#endif - // Common UNIX Printing System #if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) #define QT_NO_CUPS #endif -// QToolBar -#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW)) -#define QT_NO_TOOLBAR -#endif - // QDockwidget #if !defined(QT_NO_DOCKWIDGET) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_MAINWINDOW)) #define QT_NO_DOCKWIDGET @@ -822,20 +817,20 @@ #endif // QComboBox -#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW) || defined(QT_NO_ICON)) +#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW)) #define QT_NO_COMBOBOX #endif -// QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_PRINTPREVIEWWIDGET -#endif - // QWorkSpace #if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_MAINWINDOW) || defined(QT_NO_MENUBAR)) #define QT_NO_WORKSPACE #endif +// QPrintPreviewWidget +#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_MAINWINDOW)) +#define QT_NO_PRINTPREVIEWWIDGET +#endif + // QCalendarWidget #if !defined(QT_NO_CALENDARWIDGET) && (defined(QT_NO_TABLEVIEW) || defined(QT_NO_MENU) || defined(QT_NO_TEXTDATE) || defined(QT_NO_SPINBOX) || defined(QT_NO_TOOLBUTTON)) #define QT_NO_CALENDARWIDGET diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 4b012d9..0bee94a 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -352,7 +352,7 @@ SeeAlso: ??? Feature: COMBOBOX Description: Supports comboboxes presenting a list of options to the user. Section: Widgets -Requires: LINEEDIT STANDARDITEMMODEL LISTVIEW ICON +Requires: LINEEDIT STANDARDITEMMODEL LISTVIEW Name: QComboBox SeeAlso: ??? @@ -366,7 +366,7 @@ SeeAlso: ??? Feature: TOOLBUTTON Description: Supports quick-access buttons to commands and options. Section: Widgets -Requires: ICON ACTION +Requires: ACTION Name: QToolButton SeeAlso: ??? @@ -826,13 +826,6 @@ Requires: Name: QImageIOPlugin SeeAlso: ??? -Feature: ICON -Description: Supports scalable icons in different modes and states. -Section: Images -Requires: -Name: QIcon -SeeAlso: ??? - Feature: MOVIE Description: Supports animated images. Section: Images @@ -1124,7 +1117,7 @@ SeeAlso: ??? Feature: SYSTEMTRAYICON Description: Provides an icon for an application in the system tray. Section: Utilities -Requires: ICON +Requires: Name: QSystemTrayIcon SeeAlso: ??? -- cgit v0.12 From 38908792600e7cd471fece1de71e2ad13cbb0866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Thu, 22 Oct 2009 13:48:23 +0200 Subject: Fix SCROLLAREA by fixing missing QT_NO_GRAPHICSVIEW dependencies Reviewed-by: tom --- src/gui/graphicsview/qgraphicsanchorlayout.cpp | 3 ++- src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 3 ++- src/gui/graphicsview/qgraphicsanchorlayout_p.h | 3 ++- src/gui/graphicsview/qgraphicstransform.cpp | 3 ++- src/gui/graphicsview/qgraphicstransform.h | 2 ++ src/gui/graphicsview/qgraphicstransform_p.h | 3 ++- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index e21cd99..2bed776 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -123,7 +123,7 @@ */ #include "qgraphicsanchorlayout_p.h" - +#ifndef QT_NO_GRAPHICSVIEW QT_BEGIN_NAMESPACE QGraphicsAnchor::QGraphicsAnchor(QGraphicsAnchorLayout *parentLayout) @@ -535,3 +535,4 @@ QSizeF QGraphicsAnchorLayout::sizeHint(Qt::SizeHint which, const QSizeF &constra } QT_END_NAMESPACE +#endif //QT_NO_GRAPHICSVIEW diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index 8c8c303..c424be5 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -48,7 +48,7 @@ #endif #include "qgraphicsanchorlayout_p.h" - +#ifndef QT_NO_GRAPHICSVIEW QT_BEGIN_NAMESPACE @@ -2635,3 +2635,4 @@ void QGraphicsAnchorLayoutPrivate::dumpGraph(const QString &name) #endif QT_END_NAMESPACE +#endif //QT_NO_GRAPHICSVIEW diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h index d45c004..9513ddf 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h @@ -60,7 +60,7 @@ #include "qgraphicsanchorlayout.h" #include "qgraph_p.h" #include "qsimplex_p.h" - +#ifndef QT_NO_GRAPHICSVIEW QT_BEGIN_NAMESPACE /* @@ -529,5 +529,6 @@ public: }; QT_END_NAMESPACE +#endif //QT_NO_GRAPHICSVIEW #endif diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp index e2a3f08..83bc9e1 100644 --- a/src/gui/graphicsview/qgraphicstransform.cpp +++ b/src/gui/graphicsview/qgraphicstransform.cpp @@ -93,8 +93,8 @@ #include #include +#ifndef QT_NO_GRAPHICSVIEW QT_BEGIN_NAMESPACE - void QGraphicsTransformPrivate::setItem(QGraphicsItem *i) { if (item == i) @@ -565,3 +565,4 @@ void QGraphicsRotation::applyTo(QMatrix4x4 *matrix) const #include "moc_qgraphicstransform.cpp" QT_END_NAMESPACE +#endif //QT_NO_GRAPHICSVIEW diff --git a/src/gui/graphicsview/qgraphicstransform.h b/src/gui/graphicsview/qgraphicstransform.h index 58075aa..58e3077 100644 --- a/src/gui/graphicsview/qgraphicstransform.h +++ b/src/gui/graphicsview/qgraphicstransform.h @@ -47,6 +47,7 @@ #include #include +#ifndef QT_NO_GRAPHICSVIEW QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -150,5 +151,6 @@ private: QT_END_NAMESPACE QT_END_HEADER +#endif //QT_NO_GRAPHICSVIEW #endif // QFXTRANSFORM_H diff --git a/src/gui/graphicsview/qgraphicstransform_p.h b/src/gui/graphicsview/qgraphicstransform_p.h index 9e708b2..ddf99bb 100644 --- a/src/gui/graphicsview/qgraphicstransform_p.h +++ b/src/gui/graphicsview/qgraphicstransform_p.h @@ -54,7 +54,7 @@ // #include "private/qobject_p.h" - +#ifndef QT_NO_GRAPHICSVIEW QT_BEGIN_NAMESPACE class QGraphicsItem; @@ -73,5 +73,6 @@ public: }; QT_END_NAMESPACE +#endif //QT_NO_GRAPHCISVIEW #endif // QGRAPHICSTRANSFORM_P_H -- cgit v0.12 From 9d4d1814eb7e130cd3ef75393a7957216dc14d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 26 Oct 2009 12:27:20 +0100 Subject: Fix THREAD and TOOLBAR Reviewed-by: tom Squash me with Fix THREAD and TOOLBAR a6e785b4ff9ec9cd48 --- src/corelib/global/qconfig-local.h | 4 +-- src/corelib/global/qfeatures.h | 29 ++++++++++-------- src/corelib/global/qfeatures.txt | 15 ++++++--- src/corelib/thread/qmutexpool.cpp | 20 ++++++------ src/corelib/thread/qmutexpool_p.h | 17 +++++++++-- src/corelib/thread/qthread.cpp | 24 +++++++++------ src/corelib/thread/qthread_p.h | 62 ++++++++++++++++++-------------------- src/gui/dialogs/qfscompleter_p.h | 4 +-- 8 files changed, 101 insertions(+), 74 deletions(-) diff --git a/src/corelib/global/qconfig-local.h b/src/corelib/global/qconfig-local.h index 90db873..b9a5090 100644 --- a/src/corelib/global/qconfig-local.h +++ b/src/corelib/global/qconfig-local.h @@ -1,3 +1,3 @@ -#ifndef QT_NO_SCROLLAREA -# define QT_NO_SCROLLAREA +#ifndef QT_NO_TOOLBAR +# define QT_NO_TOOLBAR #endif diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index e4fd67a..455fead 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -301,11 +301,6 @@ // //#define QT_NO_XMLSTREAM -// Animation -#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_ANIMATION -#endif - // QButtonGroup #if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX)) #define QT_NO_BUTTONGROUP @@ -496,6 +491,11 @@ #define QT_NO_XMLSTREAMWRITER #endif +// Animation +#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_THREAD)) +#define QT_NO_ANIMATION +#endif + // Context menu #if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) #define QT_NO_CONTEXTMENU @@ -686,11 +686,6 @@ #define QT_NO_TEXTEDIT #endif -// QDirModel -#if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_DIRMODEL -#endif - // QErrorMessage #if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_TEXTEDIT)) #define QT_NO_ERRORMESSAGE @@ -806,6 +801,11 @@ #define QT_NO_DOCKWIDGET #endif +// QDirModel +#if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_FILESYSTEMMODEL)) +#define QT_NO_DIRMODEL +#endif + // QUndoView #if !defined(QT_NO_UNDOVIEW) && (defined(QT_NO_UNDOSTACK) || defined(QT_NO_LISTVIEW)) #define QT_NO_UNDOVIEW @@ -816,6 +816,11 @@ #define QT_NO_GRAPHICSSVGITEM #endif +// QCompleter +#if !defined(QT_NO_FSCOMPLETER) && (defined(QT_NO_FILESYSTEMMODEL) || defined(QT_NO_COMPLETER)) +#define QT_NO_FSCOMPLETER +#endif + // QComboBox #if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW)) #define QT_NO_COMBOBOX @@ -867,12 +872,12 @@ #endif // QFileDialog -#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_DIRMODEL) || defined(QT_NO_TREEVIEW) || defined(QT_NO_COMBOBOX) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_TOOLTIP) || defined(QT_NO_SPLITTER) || defined(QT_NO_STACKEDWIDGET) || defined(QT_NO_FILESYSTEMMODEL)) +#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_DIRMODEL) || defined(QT_NO_TREEVIEW) || defined(QT_NO_COMBOBOX) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_TOOLTIP) || defined(QT_NO_SPLITTER) || defined(QT_NO_STACKEDWIDGET)) #define QT_NO_FILEDIALOG #endif // QPrintPreviewDialog -#if !defined(QT_NO_PRINTPREVIEWDIALOG) && (defined(QT_NO_PRINTPREVIEWWIDGET) || defined(QT_NO_PRINTDIALOG)) +#if !defined(QT_NO_PRINTPREVIEWDIALOG) && (defined(QT_NO_PRINTPREVIEWWIDGET) || defined(QT_NO_PRINTDIALOG) || defined(QT_NO_TOOLBAR)) #define QT_NO_PRINTPREVIEWDIALOG #endif diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 0bee94a..f2b5c20 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -604,7 +604,7 @@ SeeAlso: ??? Feature: FILEDIALOG Description: Supports a dialog widget for selecting files or directories. Section: Dialogs -Requires: DIRMODEL TREEVIEW COMBOBOX TOOLBUTTON BUTTONGROUP TOOLTIP SPLITTER STACKEDWIDGET FILESYSTEMMODEL +Requires: DIRMODEL TREEVIEW COMBOBOX TOOLBUTTON BUTTONGROUP TOOLTIP SPLITTER STACKEDWIDGET Name: QFileDialog SeeAlso: ??? @@ -625,7 +625,7 @@ SeeAlso: ??? Feature: PRINTPREVIEWDIALOG Description: Provides a dialog for previewing and configuring page layouts for printer output. Section: Dialogs -Requires: PRINTPREVIEWWIDGET PRINTDIALOG +Requires: PRINTPREVIEWWIDGET PRINTDIALOG TOOLBAR Name: QPrintPreviewDialog SeeAlso: ??? @@ -677,7 +677,7 @@ SeeAlso: ??? Feature: DIRMODEL Description: Supports a data model for the local filesystem. Section: ItemViews -Requires: ITEMVIEWS +Requires: ITEMVIEWS FILESYSTEMMODEL Name: QDirModel SeeAlso: ??? @@ -1107,6 +1107,13 @@ Requires: PROXYMODEL Name: QCompleter SeeAlso: ??? +Feature: FSCOMPLETER +Description: Provides completions based on an item model. +Section: Utilities +Requires: FILESYSTEMMODEL COMPLETER +Name: QCompleter +SeeAlso: ??? + Feature: DESKTOPSERVICES Description: Provides methods for accessing common desktop services. Section: Utilities @@ -1159,7 +1166,7 @@ SeeAlso: ??? Feature: ANIMATION Description: Provides a framework for animations. Section: Utilities -Requires: PROPERTIES +Requires: PROPERTIES THREAD Name: Animation SeeAlso: ??? diff --git a/src/corelib/thread/qmutexpool.cpp b/src/corelib/thread/qmutexpool.cpp index c5c1882..9f37239 100644 --- a/src/corelib/thread/qmutexpool.cpp +++ b/src/corelib/thread/qmutexpool.cpp @@ -42,7 +42,6 @@ #include "qatomic.h" #include "qmutexpool_p.h" -#ifndef QT_NO_THREAD QT_BEGIN_NAMESPACE @@ -50,6 +49,7 @@ QT_BEGIN_NAMESPACE // use QMutexpool::instance() in new clode. Q_CORE_EXPORT QMutexPool *qt_global_mutexpool = 0; Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive)) +#ifndef QT_NO_THREAD /*! \class QMutexPool @@ -114,15 +114,6 @@ QMutexPool::~QMutexPool() mutexes[index] = 0; } } - -/*! - Returns the global QMutexPool instance. -*/ -QMutexPool *QMutexPool::instance() -{ - return globalMutexPool(); -} - /*! Returns a QMutex from the pool. QMutexPool uses the value \a address to determine which mutex is returned from the pool. @@ -152,7 +143,14 @@ QMutex *QMutexPool::globalInstanceGet(const void *address) return 0; return globalInstance->get(address); } +#endif // QT_NO_THREAD +/*! + Returns the global QMutexPool instance. +*/ +QMutexPool *QMutexPool::instance() +{ + return globalMutexPool(); +} QT_END_NAMESPACE -#endif // QT_NO_THREAD diff --git a/src/corelib/thread/qmutexpool_p.h b/src/corelib/thread/qmutexpool_p.h index 3e1bad0..c26711b 100644 --- a/src/corelib/thread/qmutexpool_p.h +++ b/src/corelib/thread/qmutexpool_p.h @@ -57,9 +57,9 @@ #include "QtCore/qmutex.h" #include "QtCore/qvarlengtharray.h" -#ifndef QT_NO_THREAD QT_BEGIN_NAMESPACE +#ifndef QT_NO_THREAD class Q_CORE_EXPORT QMutexPool { @@ -75,11 +75,24 @@ private: QVarLengthArray, 131> mutexes; QMutex::RecursionMode recursionMode; }; +#else //QT_NO_THREAD +Q_GLOBAL_STATIC(QMutex, globalMutex) +class Q_CORE_EXPORT QMutexPool +{ +public: + explicit QMutexPool(QMutex::RecursionMode recursionMode = QMutex::NonRecursive, int size = 131){} + ~QMutexPool(){} + + QMutex *get(const void *address){return globalMutex();} + static QMutexPool *instance(); + static QMutex *globalInstanceGet(const void *address){return globalMutex();} +}; + +#endif // QT_NO_THREAD extern Q_CORE_EXPORT QMutexPool *qt_global_mutexpool; QT_END_NAMESPACE -#endif // QT_NO_THREAD #endif // QMUTEXPOOL_P_H diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index ac191fe..cf57d33 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -727,6 +727,16 @@ QThread *QThread::currentThread() return QThreadData::current()->thread; } +/*! \internal + */ +QThread::QThread(QThreadPrivate &dd, QObject *parent) + : QObject(dd, parent) +{ + Q_D(QThread); + // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this); + d->data->thread = this; +} + QThreadData* QThreadData::current() { static QThreadData *data = 0; // reinterpret_cast(pthread_getspecific(current_thread_data_key)); @@ -738,17 +748,13 @@ QThreadData* QThreadData::current() } return data; } - -/*! \internal - */ -QThread::QThread(QThreadPrivate &dd, QObject *parent) - : QObject(dd, parent) +#endif // QT_NO_THREAD +QThreadData* QThreadData::get2(QThread *thread) { - Q_D(QThread); - // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this); - d->data->thread = this; + Q_ASSERT_X(thread != 0, "QThread", "internal error"); + return thread->d_func()->data; } -#endif // QT_NO_THREAD + QT_END_NAMESPACE diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index af68434..8c3acdb 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -111,6 +111,36 @@ public: { } }; +class QThreadData +{ + QAtomicInt _ref; + +public: + QThreadData(int initialRefCount = 1); + ~QThreadData(); + + static QThreadData *current(); + static QThreadData *get2(QThread *thread); + + void ref(); + void deref(); + + QThread *thread; + bool quitNow; + int loopLevel; + QAbstractEventDispatcher *eventDispatcher; + QStack eventLoops; + QPostEventList postEventList; + bool canWait; + QMap tls; + + QMutex mutex; + +# ifdef Q_OS_SYMBIAN + RThread symbian_thread_handle; +# endif +}; + #ifndef QT_NO_THREAD class QThreadPrivate : public QObjectPrivate { @@ -179,38 +209,6 @@ public: #endif // QT_NO_THREAD -class QThreadData -{ - QAtomicInt _ref; - -public: - QThreadData(int initialRefCount = 1); - ~QThreadData(); - - static QThreadData *current(); - static QThreadData *get2(QThread *thread) - { Q_ASSERT_X(thread != 0, "QThread", "internal error"); return thread->d_func()->data; } - - - void ref(); - void deref(); - - QThread *thread; - bool quitNow; - int loopLevel; - QAbstractEventDispatcher *eventDispatcher; - QStack eventLoops; - QPostEventList postEventList; - bool canWait; - QMap tls; - - QMutex mutex; - -# ifdef Q_OS_SYMBIAN - RThread symbian_thread_handle; -# endif -}; - // thread wrapper for the main() thread class QAdoptedThread : public QThread { diff --git a/src/gui/dialogs/qfscompleter_p.h b/src/gui/dialogs/qfscompleter_p.h index cb1b427..1edab2d 100644 --- a/src/gui/dialogs/qfscompleter_p.h +++ b/src/gui/dialogs/qfscompleter_p.h @@ -56,7 +56,7 @@ #include "qcompleter.h" #include QT_BEGIN_NAMESPACE -#ifndef QT_NO_COMPLETER +#ifndef QT_NO_FSCOMPLETER /*! QCompleter that can deal with QFileSystemModel @@ -76,7 +76,7 @@ public: QAbstractProxyModel *proxyModel; QFileSystemModel *sourceModel; }; -#endif // QT_NO_COMPLETER +#endif // QT_NO_FSCOMPLETER QT_END_NAMESPACE #endif // QFSCOMPLETOR_P_H -- cgit v0.12 From a733f087467c5f8361a7765a38e45037549c019f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 27 Oct 2009 08:34:39 +0100 Subject: Fix FSCOMPLETER Reviewed-by: tom --- src/gui/dialogs/qfiledialog.cpp | 12 ++++++------ src/gui/dialogs/qfiledialog_p.h | 4 ++-- src/gui/dialogs/qprintdialog_unix.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index eab842f..c6b4a77 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -777,7 +777,7 @@ void QFileDialog::setDirectory(const QString &directory) QModelIndex root = d->model->setRootPath(newDirectory); d->qFileDialogUi->newFolderButton->setEnabled(d->model->flags(root) & Qt::ItemIsDropEnabled); if (root != d->rootIndex()) { -#ifndef QT_NO_COMPLETER +#ifndef QT_NO_FSCOMPLETER if (directory.endsWith(QLatin1Char('/'))) d->completer->setCompletionPrefix(newDirectory); else @@ -2177,12 +2177,12 @@ void QFileDialogPrivate::createWidgets() #ifndef QT_NO_SHORTCUT qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit); #endif -#ifndef QT_NO_COMPLETER +#ifndef QT_NO_FSCOMPLETER completer = new QFSCompleter(model, q); qFileDialogUi->fileNameEdit->setCompleter(completer); QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_autoCompleteFileName(QString))); -#endif // QT_NO_COMPLETER +#endif // QT_NO_FSCOMPLETER QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_updateOkButton())); @@ -2302,7 +2302,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) proxyModel->setSourceModel(d->model); d->qFileDialogUi->listView->setModel(d->proxyModel); d->qFileDialogUi->treeView->setModel(d->proxyModel); -#ifndef QT_NO_COMPLETER +#ifndef QT_NO_FSCOMPLETER d->completer->setModel(d->proxyModel); d->completer->proxyModel = d->proxyModel; #endif @@ -2312,7 +2312,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) d->proxyModel = 0; d->qFileDialogUi->listView->setModel(d->model); d->qFileDialogUi->treeView->setModel(d->model); -#ifndef QT_NO_COMPLETER +#ifndef QT_NO_FSCOMPLETER d->completer->setModel(d->model); d->completer->sourceModel = d->model; d->completer->proxyModel = 0; @@ -3218,7 +3218,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e) } } -#ifndef QT_NO_COMPLETER +#ifndef QT_NO_FSCOMPLETER QString QFSCompleter::pathFromIndex(const QModelIndex &index) const { diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index 32cd397..0e447a3 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -234,9 +234,9 @@ public: QStringList watching; QFileSystemModel *model; -#ifndef QT_NO_COMPLETER +#ifndef QT_NO_FSCOMPLETER QFSCompleter *completer; -#endif //QT_NO_COMPLETER +#endif //QT_NO_FSCOMPLETER QFileDialog::FileMode fileMode; QFileDialog::AcceptMode acceptMode; diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 7daa273..6fc270d 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -696,7 +696,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p) #ifndef QT_NO_FILESYSTEMMODEL QFileSystemModel *fsm = new QFileSystemModel(widget.filename); fsm->setRootPath(QDir::homePath()); -#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG) +#if !defined(QT_NO_FSCOMPLETER) && !defined(QT_NO_FILEDIALOG) widget.filename->setCompleter(new QFSCompleter(fsm, widget.filename)); #endif #endif -- cgit v0.12 From c0c9940b371215eea294ae83ed6586a6414957ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 27 Oct 2009 10:53:17 +0100 Subject: Fix TEXTCODEC Reviewed-by: tom --- src/gui/kernel/qclipboard.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp index 5ed4dc9..e43f8b5 100644 --- a/src/gui/kernel/qclipboard.cpp +++ b/src/gui/kernel/qclipboard.cpp @@ -296,12 +296,16 @@ QString QClipboard::text(QString &subtype, Mode mode) const const QByteArray rawData = data->data(QLatin1String("text/") + subtype); +#ifndef QT_NO_TEXTCODEC QTextCodec* codec = QTextCodec::codecForMib(106); // utf-8 is default if (subtype == QLatin1String("html")) codec = QTextCodec::codecForHtml(rawData, codec); else codec = QTextCodec::codecForUtfText(rawData, codec); return codec->toUnicode(rawData); +#else //QT_NO_TEXTCODEC + return rawData; +#endif //QT_NO_TEXTCODEC } /*! -- cgit v0.12 From d0aa2b8422eea07823caef639a0970b8f2a1fde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 27 Oct 2009 10:55:28 +0100 Subject: Fix PROXYMODEL Reviewed-by: Trust Me --- src/corelib/global/qconfig-local.h | 3 --- src/corelib/global/qfeatures.h | 2 +- src/corelib/global/qfeatures.txt | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 src/corelib/global/qconfig-local.h diff --git a/src/corelib/global/qconfig-local.h b/src/corelib/global/qconfig-local.h deleted file mode 100644 index b9a5090..0000000 --- a/src/corelib/global/qconfig-local.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef QT_NO_TOOLBAR -# define QT_NO_TOOLBAR -#endif diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 455fead..3996180 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -872,7 +872,7 @@ #endif // QFileDialog -#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_DIRMODEL) || defined(QT_NO_TREEVIEW) || defined(QT_NO_COMBOBOX) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_TOOLTIP) || defined(QT_NO_SPLITTER) || defined(QT_NO_STACKEDWIDGET)) +#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_DIRMODEL) || defined(QT_NO_TREEVIEW) || defined(QT_NO_COMBOBOX) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_TOOLTIP) || defined(QT_NO_SPLITTER) || defined(QT_NO_STACKEDWIDGET) || defined(QT_NO_PROXYMODEL)) #define QT_NO_FILEDIALOG #endif diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index f2b5c20..543056f 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -604,7 +604,7 @@ SeeAlso: ??? Feature: FILEDIALOG Description: Supports a dialog widget for selecting files or directories. Section: Dialogs -Requires: DIRMODEL TREEVIEW COMBOBOX TOOLBUTTON BUTTONGROUP TOOLTIP SPLITTER STACKEDWIDGET +Requires: DIRMODEL TREEVIEW COMBOBOX TOOLBUTTON BUTTONGROUP TOOLTIP SPLITTER STACKEDWIDGET PROXYMODEL Name: QFileDialog SeeAlso: ??? -- cgit v0.12 From 3117574558b2aeb6e3e3e90ff8e44f4a2e74cf6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 27 Oct 2009 14:30:25 +0100 Subject: Fix SHAREDMEMORY Reviewed-by: tom --- src/corelib/kernel/qsharedmemory_unix.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp index 1165fb1..40b9f04 100644 --- a/src/corelib/kernel/qsharedmemory_unix.cpp +++ b/src/corelib/kernel/qsharedmemory_unix.cpp @@ -49,8 +49,6 @@ #include -#ifndef QT_NO_SHAREDMEMORY - #include #include #include @@ -61,6 +59,7 @@ #include "private/qcore_unix_p.h" +#ifndef QT_NO_SHAREDMEMORY QT_BEGIN_NAMESPACE QSharedMemoryPrivate::QSharedMemoryPrivate() -- cgit v0.12 From eec8980202f05737b0ef0b8db410675e0df5bafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 27 Oct 2009 14:30:56 +0100 Subject: FIX TABBAR Reviewed-by: tom --- src/gui/widgets/qdockarealayout.cpp | 14 ++++++++++---- src/gui/widgets/qdockarealayout_p.h | 8 ++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index 5a0a9d4..ec35c4f 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -1556,9 +1556,10 @@ void QDockAreaLayoutInfo::apply(bool animate) } } } - +#ifndef QT_NO_TABBAR if (sep == 1) updateSeparatorWidgets(); +#endif //QT_NO_TABBAR } static void paintSep(QPainter *p, QWidget *w, const QRect &r, Qt::Orientation o, bool mouse_over) @@ -2008,13 +2009,14 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList updateTabBar(); setCurrentTabId(tabId(item_list.at(index))); } -#endif if (!testing && sep == 1) updateSeparatorWidgets(); +#endif return true; } +#ifndef QT_NO_TABBAR void QDockAreaLayoutInfo::updateSeparatorWidgets() const { if (tabbed) { @@ -2065,6 +2067,7 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const separatorWidgets.resize(j); Q_ASSERT(separatorWidgets.size() == j); } +#endif //QT_NO_TABBAR #ifndef QT_NO_TABBAR void QDockAreaLayoutInfo::updateTabBar() const @@ -3073,9 +3076,10 @@ void QDockAreaLayout::apply(bool animate) widgetAnimator.animate(centralWidgetItem->widget(), centralWidgetRect, animate); } - +#ifndef QT_NO_TABBAR if (sep == 1) updateSeparatorWidgets(); +#endif //QT_NO_TABBAR } void QDockAreaLayout::paintSeparators(QPainter *p, QWidget *widget, @@ -3153,6 +3157,7 @@ int QDockAreaLayout::separatorMove(const QList &separator, const QPoint &or return delta; } +#ifndef QT_NO_TABBAR // Sets the correct positions for the seperator widgets // Allocates new sepearator widgets with getSeparatorWidget void QDockAreaLayout::updateSeparatorWidgets() const @@ -3186,6 +3191,7 @@ void QDockAreaLayout::updateSeparatorWidgets() const separatorWidgets.resize(j); } +#endif //QT_NO_TABBAR QLayoutItem *QDockAreaLayout::itemAt(int *x, int index) const { @@ -3238,7 +3244,6 @@ QSet QDockAreaLayout::usedTabBars() const } return result; } -#endif // Returns the set of all used separator widgets QSet QDockAreaLayout::usedSeparatorWidgets() const @@ -3253,6 +3258,7 @@ QSet QDockAreaLayout::usedSeparatorWidgets() const } return result; } +#endif QRect QDockAreaLayout::gapRect(const QList &path) const { diff --git a/src/gui/widgets/qdockarealayout_p.h b/src/gui/widgets/qdockarealayout_p.h index 99a9dbb..5692850 100644 --- a/src/gui/widgets/qdockarealayout_p.h +++ b/src/gui/widgets/qdockarealayout_p.h @@ -196,9 +196,10 @@ public: QRect rect; QMainWindow *mainWindow; QList item_list; - +#ifndef QT_NO_TABBAR void updateSeparatorWidgets() const; QSet usedSeparatorWidgets() const; +#endif //QT_NO_TABBAR #ifndef QT_NO_TABBAR quintptr currentTabId() const; @@ -278,7 +279,9 @@ public: const QPoint &mouse) const; QRegion separatorRegion() const; int separatorMove(const QList &separator, const QPoint &origin, const QPoint &dest); +#ifndef QT_NO_TABBAR void updateSeparatorWidgets() const; +#endif //QT_NO_TABBAR QLayoutItem *itemAt(int *x, int index) const; QLayoutItem *takeAt(int *x, int index); @@ -292,9 +295,10 @@ public: QRect gapRect(const QList &path) const; void keepSize(QDockWidget *w); - +#ifndef QT_NO_TABBAR QSet usedTabBars() const; QSet usedSeparatorWidgets() const; +#endif //QT_NO_TABBAR }; QT_END_NAMESPACE -- cgit v0.12 From 578b113f3dcceec0a88599494ad686fbc8cbfbb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 28 Oct 2009 08:42:10 +0100 Subject: Fix QT_NO_MAINWINDOW Reviewed-by: tom --- src/gui/widgets/qwidgetanimator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qwidgetanimator.cpp b/src/gui/widgets/qwidgetanimator.cpp index f440961..bdd3c75 100644 --- a/src/gui/widgets/qwidgetanimator.cpp +++ b/src/gui/widgets/qwidgetanimator.cpp @@ -105,7 +105,9 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo #else //we do it in one shot widget->setGeometry(final_geometry); +#ifndef QT_NO_MAINWINDOW m_mainWindowLayout->animationFinished(widget); +#endif //QT_NO_MAINWINDOW #endif //QT_NO_ANIMATION } -- cgit v0.12 From 23b6599324bc62666d4303ca108ed372e8d7c490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 28 Oct 2009 09:23:45 +0100 Subject: Remove QT_NO_ICON from mimimal Reviewed-by: Trust Me --- src/corelib/global/qconfig-minimal.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h index 3d9539e..9cc3057 100644 --- a/src/corelib/global/qconfig-minimal.h +++ b/src/corelib/global/qconfig-minimal.h @@ -123,9 +123,6 @@ #endif /* Images */ -#ifndef QT_NO_ICON -# define QT_NO_ICON -#endif #ifndef QT_NO_IMAGEFORMATPLUGIN # define QT_NO_IMAGEFORMATPLUGIN #endif -- cgit v0.12 From 9c681ddc3a70b220de5d38de498ab1804ec12d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 28 Oct 2009 15:50:04 +0100 Subject: Fix GRAPHICSVIEW Reviewed-by: tom --- src/gui/kernel/qevent.cpp | 2 ++ src/gui/kernel/qevent.h | 2 ++ src/gui/kernel/qgesturemanager.cpp | 2 ++ src/gui/kernel/qgesturemanager_p.h | 2 ++ src/gui/kernel/qwidget.cpp | 40 ++++++++++++++++++++++++--------- src/gui/painting/qbackingstore.cpp | 4 ++-- src/gui/painting/qwindowsurface_qws.cpp | 2 ++ 7 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 065bd09..bf9479f 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4345,6 +4345,7 @@ QWidget *QGestureEvent::widget() const return d_func()->widget; } +#ifndef QT_NO_GRAPHICSVIEW /*! Returns the scene-local coordinates if the \a gesturePoint is inside a graphics view. @@ -4361,6 +4362,7 @@ QPointF QGestureEvent::mapToScene(const QPointF &gesturePoint) const } return QPointF(); } +#endif //QT_NO_GRAPHICSVIEW /*! \internal diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index b7370fd..d6b1dc1 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -854,7 +854,9 @@ public: void setWidget(QWidget *widget); QWidget *widget() const; +#ifndef QT_NO_GRAPHICSVIEW QPointF mapToScene(const QPointF &gesturePoint) const; +#endif private: QGestureEventPrivate *d_func(); diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index ed8e744..5ad607b 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -331,6 +331,7 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event) return filterEventThroughContexts(contexts, event); } +#ifndef QT_NO_GRAPHICSVIEW bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event) { QSet types; @@ -360,6 +361,7 @@ bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event) } return filterEventThroughContexts(contexts, event); } +#endif bool QGestureManager::filterEvent(QGesture *state, QEvent *event) { diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h index f0e7225..8199e02 100644 --- a/src/gui/kernel/qgesturemanager_p.h +++ b/src/gui/kernel/qgesturemanager_p.h @@ -74,7 +74,9 @@ public: bool filterEvent(QWidget *receiver, QEvent *event); bool filterEvent(QGesture *receiver, QEvent *event); +#ifndef QT_NO_GRAPHICSVIEW bool filterEvent(QGraphicsObject *receiver, QEvent *event); +#endif //QT_NO_GRAPHICSVIEW // declared in qapplication.cpp static QGestureManager* instance(); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 916ae8b..62cfd12 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1549,7 +1549,9 @@ void QWidgetPrivate::createExtra() extra = new QWExtra; extra->glContext = 0; extra->topextra = 0; +#ifndef QT_NO_GRAPHICSVIEW extra->proxyWidget = 0; +#endif #ifndef QT_NO_CURSOR extra->curs = 0; #endif @@ -1699,12 +1701,13 @@ void QWidgetPrivate::propagatePaletteChange() { Q_Q(QWidget); // Propagate a new inherited mask to all children. - if (!q->parentWidget() && extra && extra->proxyWidget) { #ifndef QT_NO_GRAPHICSVIEW + if (!q->parentWidget() && extra && extra->proxyWidget) { QGraphicsProxyWidget *p = extra->proxyWidget; inheritedPaletteResolveMask = p->d_func()->inheritedPaletteResolveMask | p->palette().resolve(); + } else #endif //QT_NO_GRAPHICSVIEW - } else if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { + if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { inheritedPaletteResolveMask = 0; } int mask = data.pal.resolve() | inheritedPaletteResolveMask; @@ -4381,7 +4384,11 @@ QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const Q_Q(const QWidget); QPalette naturalPalette = QApplication::palette(q); if (!q->testAttribute(Qt::WA_StyleSheet) - && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) || (extra && extra->proxyWidget))) { + && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) +#ifndef QT_NO_GRAPHICSVIEW + || (extra && extra->proxyWidget) +#endif //QT_NO_GRAPHICSVIEW + )) { if (QWidget *p = q->parentWidget()) { if (!p->testAttribute(Qt::WA_StyleSheet)) { if (!naturalPalette.isCopyOf(QApplication::palette())) { @@ -4392,13 +4399,14 @@ QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const naturalPalette = p->palette(); } } - } else if (extra && extra->proxyWidget) { + } #ifndef QT_NO_GRAPHICSVIEW + else if (extra && extra->proxyWidget) { QPalette inheritedPalette = extra->proxyWidget->palette(); inheritedPalette.resolve(inheritedMask); naturalPalette = inheritedPalette.resolve(naturalPalette); -#endif //QT_NO_GRAPHICSVIEW } +#endif //QT_NO_GRAPHICSVIEW } naturalPalette.resolve(0); return naturalPalette; @@ -4516,7 +4524,11 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const Q_Q(const QWidget); QFont naturalFont = QApplication::font(q); if (!q->testAttribute(Qt::WA_StyleSheet) - && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) || (extra && extra->proxyWidget))) { + && (!q->isWindow() || q->testAttribute(Qt::WA_WindowPropagation) +#ifndef QT_NO_GRAPHICSVIEW + || (extra && extra->proxyWidget) +#endif //QT_NO_GRAPHICSVIEW + )) { if (QWidget *p = q->parentWidget()) { if (!p->testAttribute(Qt::WA_StyleSheet)) { if (!naturalFont.isCopyOf(QApplication::font())) { @@ -4527,13 +4539,14 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const naturalFont = p->font(); } } - } else if (extra && extra->proxyWidget) { + } #ifndef QT_NO_GRAPHICSVIEW + else if (extra && extra->proxyWidget) { QFont inheritedFont = extra->proxyWidget->font(); inheritedFont.resolve(inheritedMask); naturalFont = inheritedFont.resolve(naturalFont); -#endif //QT_NO_GRAPHICSVIEW } +#endif //QT_NO_GRAPHICSVIEW } naturalFont.resolve(0); return naturalFont; @@ -4580,12 +4593,13 @@ void QWidgetPrivate::updateFont(const QFont &font) data.fnt.x11SetScreen(xinfo.screen()); #endif // Combine new mask with natural mask and propagate to children. - if (!q->parentWidget() && extra && extra->proxyWidget) { #ifndef QT_NO_GRAPHICSVIEW + if (!q->parentWidget() && extra && extra->proxyWidget) { QGraphicsProxyWidget *p = extra->proxyWidget; inheritedFontResolveMask = p->d_func()->inheritedFontResolveMask | p->font().resolve(); + } else #endif //QT_NO_GRAPHICSVIEW - } else if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { + if (q->isWindow() && !q->testAttribute(Qt::WA_WindowPropagation)) { inheritedFontResolveMask = 0; } uint newMask = data.fnt.resolve() | inheritedFontResolveMask; @@ -5396,7 +5410,11 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis , sharedPainter, backingStore); } - if (w->updatesEnabled() && (!w->d_func()->extra || !w->d_func()->extra->proxyWidget)) { + if (w->updatesEnabled() +#ifndef QT_NO_GRAPHICSVIEW + && (!w->d_func()->extra || !w->d_func()->extra->proxyWidget) +#endif //QT_NO_GRAPHICSVIEW + ) { QRegion wRegion(rgn); wRegion &= wd->effectiveRectFor(w->data->crect); wRegion.translate(-widgetPos); diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 3cd1402..de97302 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -891,7 +891,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) const QRect parentRect(rect & clipR); bool accelerateMove = accelEnv && isOpaque -#ifndef QT_NO_GRAPHICSCVIEW +#ifndef QT_NO_GRAPHICSVIEW // No accelerate move for proxy widgets. && !tlw->d_func()->extra->proxyWidget #endif @@ -1189,7 +1189,7 @@ void QWidgetBackingStore::sync() : wd->dirty); toClean += widgetDirty; -#ifndef QT_NO_GRAPHICSCVIEW +#ifndef QT_NO_GRAPHICSVIEW if (tlw->d_func()->extra->proxyWidget) { resetWidget(w); continue; diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp index 4f489c4..fa0c80e 100644 --- a/src/gui/painting/qwindowsurface_qws.cpp +++ b/src/gui/painting/qwindowsurface_qws.cpp @@ -668,9 +668,11 @@ void QWSWindowSurface::flush(QWidget *widget, const QRegion ®ion, if (!win) return; +#ifndef QT_NO_GRAPHICSVIEW QWExtra *extra = win->d_func()->extra; if (extra && extra->proxyWidget) return; +#endif //QT_NO_GRAPHICSVIEW Q_UNUSED(offset); -- cgit v0.12 From 2f9c37c4b48c4b5005c89f1c5a5fa036e1e22811 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 29 Oct 2009 17:14:47 +0100 Subject: Avoid infinite loop when laying out text with unconvertible chars When the stringToCMap() fails, it can be because it did not have enough space in the layout, or it can because of other errors. In order to implement "try-again" processing in a simple way, we had an infinite loop which assumed that stringToCMap() would always succeed in the second run (which would be the case if the only possible error was "not enough space".) Since there are other possible failures not related to the number of glyphs, you could easily get into an infinite loop here, e.g. when laying out text that contains the Byte Order Mark. The fix changes the implementation to explictly try stringToCMap() twice at max, and is also how it's implemented in the default qtextengine.cpp. Task-number: QTBUG-4680 Reviewed-by: Trond --- src/gui/text/qtextengine_mac.cpp | 73 ++++++++++++++---------------- tests/auto/qtextlayout/tst_qtextlayout.cpp | 13 ++++++ 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp index eeccc72..54be53b 100644 --- a/src/gui/text/qtextengine_mac.cpp +++ b/src/gui/text/qtextengine_mac.cpp @@ -594,53 +594,50 @@ void QTextEngine::shapeTextMac(int item) const str = reinterpret_cast(uc); } - while (true) { - ensureSpace(num_glyphs); - num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used; - - QGlyphLayout g = availableGlyphs(&si); - g.numGlyphs = num_glyphs; - unsigned short *log_clusters = logClusters(&si); + ensureSpace(num_glyphs); + num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used; - if (fe->stringToCMap(str, - len, - &g, - &num_glyphs, - flags, - log_clusters, - attributes())) { + QGlyphLayout g = availableGlyphs(&si); + g.numGlyphs = num_glyphs; + unsigned short *log_clusters = logClusters(&si); - heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs); - break; - } + bool stringToCMapFailed = false; + if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes())) { + ensureSpace(num_glyphs); + stringToCMapFailed = fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, + attributes()); } - si.num_glyphs = num_glyphs; + if (!stringToCMapFailed) { + heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs); - layoutData->used += si.num_glyphs; + si.num_glyphs = num_glyphs; - QGlyphLayout g = shapedGlyphs(&si); + layoutData->used += si.num_glyphs; - if (si.analysis.script == QUnicodeTables::Arabic) { - QVarLengthArray props(len + 2); - QArabicProperties *properties = props.data(); - int f = si.position; - int l = len; - if (f > 0) { - --f; - ++l; - ++properties; - } - if (f + l < layoutData->string.length()) { - ++l; - } - qt_getArabicProperties((const unsigned short *)(layoutData->string.unicode()+f), l, props.data()); + QGlyphLayout g = shapedGlyphs(&si); - unsigned short *log_clusters = logClusters(&si); + if (si.analysis.script == QUnicodeTables::Arabic) { + QVarLengthArray props(len + 2); + QArabicProperties *properties = props.data(); + int f = si.position; + int l = len; + if (f > 0) { + --f; + ++l; + ++properties; + } + if (f + l < layoutData->string.length()) { + ++l; + } + qt_getArabicProperties((const unsigned short *)(layoutData->string.unicode()+f), l, props.data()); - for (int i = 0; i < len; ++i) { - int gpos = log_clusters[i]; - g.attributes[gpos].justification = properties[i].justification; + unsigned short *log_clusters = logClusters(&si); + + for (int i = 0; i < len; ++i) { + int gpos = log_clusters[i]; + g.attributes[gpos].justification = properties[i].justification; + } } } diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index fe87dfb..7c3f4f2 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -118,6 +118,7 @@ private slots: void smallTextLengthWordWrap(); void smallTextLengthWrapAtWordBoundaryOrAnywhere(); void testLineBreakingAllSpaces(); + void lineWidthFromBOM(); private: @@ -1306,6 +1307,18 @@ void tst_QTextLayout::columnWrapWithTabs() } +void tst_QTextLayout::lineWidthFromBOM() +{ + const QString string(QChar(0xfeff)); // BYTE ORDER MARK + QTextLayout layout(string); + layout.beginLayout(); + QTextLine line = layout.createLine(); + line.setLineWidth(INT_MAX / 256); + layout.endLayout(); + + // Don't spin into an infinite loop + } + QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" -- cgit v0.12 From 9e01ced1d14467c06d7e1db57982556c9e861372 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Oct 2009 18:07:06 +0100 Subject: Remove the posix_memalign and Win32 _aligned_malloc MinGW doesn't have _aligned_malloc and posix_memalign doesn't have a realloc function. So use our own implementation in all platforms. Removing posix_memalign was reviewed by Brad, but I apparently lost the commit. Reviewed-by: Trust Me --- src/corelib/global/qmalloc.cpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp index 3584c50..4aab1bd 100644 --- a/src/corelib/global/qmalloc.cpp +++ b/src/corelib/global/qmalloc.cpp @@ -43,10 +43,6 @@ #include -#ifdef Q_OS_WIN -# include -#endif - /* Define the container allocation functions in a separate file, so that our users can easily override them. @@ -71,38 +67,11 @@ void *qRealloc(void *ptr, size_t size) void *qMallocAligned(size_t size, size_t alignment) { -#if defined(Q_OS_WIN) - return _aligned_malloc(size, alignment); -#elif defined(HAVE_POSIX_MEMALIGN) - if (alignment <= sizeof(void*)) - return qMalloc(size); - - // we have posix_memalign - void *ptr = 0; - if (posix_memalign(&ptr, alignment, size) == 0) - return ptr; - return 0; -#else return qReallocAligned(0, size, 0, alignment); -#endif } void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t alignment) { -#if defined(Q_OS_WIN) - Q_UNUSED(oldsize); - return _aligned_realloc(oldptr, newsize, alignment); -#elif defined(HAVE_POSIX_MEMALIGN) - if (alignment <= sizeof(void*)) - return qRealloc(oldptr, newsize); - - void *newptr = qMallocAligned(newsize, alignment); - if (!newptr) - return 0; - qMemCopy(newptr, oldptr, qMin(oldsize, newsize)); - qFree(oldptr); - return newptr; -#else // fake an aligned allocation Q_UNUSED(oldsize); @@ -144,21 +113,14 @@ void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t align faked.pptr[-1] = real.ptr; return faked.ptr; -#endif } void qFreeAligned(void *ptr) { -#if defined(Q_OS_WIN) - _aligned_free(ptr); -#elif defined(HAVE_POSIX_MEMALIGN) - ::free(ptr); -#else if (!ptr) return; void **ptr2 = static_cast(ptr); free(ptr2[-1]); -#endif } QT_END_NAMESPACE -- cgit v0.12 From 6f602c01b9dc2b037cb42cacfe1c2df6e092a6b4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Oct 2009 18:13:21 +0100 Subject: Autotest: this test is failing, enable debugging to find out why. It doesn't happen on my machine, so I need to figure out what's different. Reviewed-by: Trust Me --- tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index d84350b..91050f5 100644 --- a/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -132,6 +132,9 @@ tst_QDBusAbstractInterface::tst_QDBusAbstractInterface() void tst_QDBusAbstractInterface::initTestCase() { + // enable debugging temporarily: + putenv("QDBUS_DEBUG=1"); + // register the object QDBusConnection con = QDBusConnection::sessionBus(); QVERIFY(con.isConnected()); @@ -469,7 +472,7 @@ void tst_QDBusAbstractInterface::followSignal() QVERIFY(!QTestEventLoop::instance().timeout()); // now the signal must have been received: - QVERIFY(s.size() == 1); + QCOMPARE(s.size(), 1); QVERIFY(s.at(0).size() == 0); s.clear(); -- cgit v0.12 From 79eef278228aac21fbf8b21eaa337f2922bc68c1 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 28 Oct 2009 13:49:19 +0100 Subject: Lazily construct QPixmapData's for null pixmaps Reviewed-by: Trond --- src/gui/image/qpixmap.cpp | 64 +++++++++++++++++++++++++------------------ src/gui/image/qpixmap_mac.cpp | 3 ++ src/gui/image/qpixmap_qws.cpp | 8 +++--- src/gui/image/qpixmap_s60.cpp | 13 +++++---- src/gui/image/qpixmap_win.cpp | 3 ++ src/gui/image/qpixmap_x11.cpp | 7 +++-- src/gui/image/qpixmapdata.cpp | 13 +++++++++ src/gui/image/qpixmapdata_p.h | 2 ++ 8 files changed, 75 insertions(+), 38 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 45ff5f4..c452b9a 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -113,13 +113,10 @@ void QPixmap::init(int w, int h, Type type) void QPixmap::init(int w, int h, int type) { - QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem(); - if (gs) - data = gs->createPixmapData(static_cast(type)); + if ((w > 0 && h > 0) || type == QPixmapData::BitmapType) + data = QPixmapData::create(w, h, (QPixmapData::PixelType) type); else - data = QGraphicsSystem::createDefaultPixmapData(static_cast(type)); - - data->resize(w, h); + data = 0; } /*! @@ -307,7 +304,7 @@ QPixmap::QPixmap(const char * const xpm[]) QImage image(xpm); if (!image.isNull()) { - if (data->pixelType() == QPixmapData::BitmapType) + if (data && data->pixelType() == QPixmapData::BitmapType) *this = QBitmap::fromImage(image); else *this = fromImage(image); @@ -322,8 +319,8 @@ QPixmap::QPixmap(const char * const xpm[]) QPixmap::~QPixmap() { - Q_ASSERT(data->ref >= 1); // Catch if ref-counting changes again - if (data->is_cached && data->ref == 1) // ref will be decrememnted after destructor returns + Q_ASSERT(!data || data->ref >= 1); // Catch if ref-counting changes again + if (data && data->is_cached && data->ref == 1) // ref will be decrememnted after destructor returns QImagePixmapCleanupHooks::executePixmapDestructionHooks(this); } @@ -544,7 +541,7 @@ bool QPixmap::isQBitmap() const */ bool QPixmap::isNull() const { - return data->isNull(); + return !data || data->isNull(); } /*! @@ -556,7 +553,7 @@ bool QPixmap::isNull() const */ int QPixmap::width() const { - return data->width(); + return data ? data->width() : 0; } /*! @@ -568,7 +565,7 @@ int QPixmap::width() const */ int QPixmap::height() const { - return data->height(); + return data ? data->height() : 0; } /*! @@ -581,7 +578,7 @@ int QPixmap::height() const */ QSize QPixmap::size() const { - return QSize(data->width(), data->height()); + return data ? QSize(data->width(), data->height()) : QSize(); } /*! @@ -593,7 +590,7 @@ QSize QPixmap::size() const */ QRect QPixmap::rect() const { - return QRect(0, 0, data->width(), data->height()); + return data ? QRect(0, 0, data->width(), data->height()) : QRect(); } /*! @@ -609,7 +606,7 @@ QRect QPixmap::rect() const */ int QPixmap::depth() const { - return data->depth(); + return data ? data->depth() : 0; } /*! @@ -639,7 +636,7 @@ void QPixmap::resize_helper(const QSize &s) return; // Create new pixmap - QPixmap pm(QSize(w, h), data->type); + QPixmap pm(QSize(w, h), data ? data->type : QPixmapData::PixmapType); bool uninit = false; #if defined(Q_WS_X11) QX11PixmapData *x11Data = data->classId() == QPixmapData::X11Class ? static_cast(data.data()) : 0; @@ -728,6 +725,9 @@ void QPixmap::setMask(const QBitmap &mask) return; } + if (isNull()) + return; + if (static_cast(mask).data == data) // trying to selfmask return; @@ -826,11 +826,14 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers QFileInfo info(fileName); QString key = QLatin1String("qt_pixmap_") + info.absoluteFilePath() + QLatin1Char('_') + QString::number(info.lastModified().toTime_t()) + QLatin1Char('_') + - QString::number(info.size()) + QLatin1Char('_') + QString::number(data->pixelType()); + QString::number(info.size()) + QLatin1Char('_') + QString::number(data ? data->pixelType() : QPixmapData::PixmapType); if (QPixmapCache::find(key, *this)) return true; + if (!data) + data = QPixmapData::create(0, 0, QPixmapData::PixmapType); + if (data->fromFile(fileName, format, flags)) { QPixmapCache::insert(key, *this); return true; @@ -863,6 +866,9 @@ bool QPixmap::loadFromData(const uchar *buf, uint len, const char *format, Qt::I if (len == 0 || buf == 0) return false; + if (!data) + data = QPixmapData::create(0, 0, QPixmapData::PixmapType); + return data->fromData(buf, len, format, flags); } @@ -1008,6 +1014,9 @@ int QPixmap::serialNumber() const */ qint64 QPixmap::cacheKey() const { + if (isNull()) + return 0; + int classKey = data->classId(); if (classKey >= 1024) classKey = -(classKey >> 10); @@ -1224,7 +1233,7 @@ QPixmap::QPixmap(const QImage& image) QPixmap &QPixmap::operator=(const QImage &image) { - if (data->pixelType() == QPixmapData::BitmapType) + if (data && data->pixelType() == QPixmapData::BitmapType) *this = QBitmap::fromImage(image); else *this = fromImage(image); @@ -1254,7 +1263,7 @@ bool QPixmap::loadFromData(const uchar *buf, uint len, const char *format, Color */ bool QPixmap::convertFromImage(const QImage &image, ColorMode mode) { - if (data->pixelType() == QPixmapData::BitmapType) + if (data && data->pixelType() == QPixmapData::BitmapType) *this = QBitmap::fromImage(image, colorModeToFlags(mode)); else *this = fromImage(image, colorModeToFlags(mode)); @@ -1341,7 +1350,7 @@ Q_GUI_EXPORT void copyBlt(QPixmap *dst, int dx, int dy, bool QPixmap::isDetached() const { - return data->ref == 1; + return data && data->ref == 1; } /*! \internal @@ -1753,7 +1762,7 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) */ bool QPixmap::hasAlpha() const { - return (data->hasAlphaChannel() || !data->mask().isNull()); + return data && (data->hasAlphaChannel() || !data->mask().isNull()); } /*! @@ -1764,7 +1773,7 @@ bool QPixmap::hasAlpha() const */ bool QPixmap::hasAlphaChannel() const { - return data->hasAlphaChannel(); + return data && data->hasAlphaChannel(); } /*! @@ -1772,7 +1781,7 @@ bool QPixmap::hasAlphaChannel() const */ int QPixmap::metric(PaintDeviceMetric metric) const { - return data->metric(metric); + return data ? data->metric(metric) : 0; } /*! @@ -1844,7 +1853,7 @@ void QPixmap::setAlphaChannel(const QPixmap &alphaChannel) */ QPixmap QPixmap::alphaChannel() const { - return data->alphaChannel(); + return data ? data->alphaChannel() : QPixmap(); } /*! @@ -1852,7 +1861,7 @@ QPixmap QPixmap::alphaChannel() const */ QPaintEngine *QPixmap::paintEngine() const { - return data->paintEngine(); + return data ? data->paintEngine() : 0; } /*! @@ -1867,7 +1876,7 @@ QPaintEngine *QPixmap::paintEngine() const */ QBitmap QPixmap::mask() const { - return data->mask(); + return data ? data->mask() : QBitmap(); } /*! @@ -1916,6 +1925,9 @@ int QPixmap::defaultDepth() */ void QPixmap::detach() { + if (!data) + return; + QPixmapData::ClassId id = data->classId(); if (id == QPixmapData::RasterClass) { QRasterPixmapData *rasterData = static_cast(data.data()); diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index afa6f83..15350e8 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -965,6 +965,9 @@ Qt::HANDLE QPixmap::macQDAlphaHandle() const Qt::HANDLE QPixmap::macCGHandle() const { + if (isNull()) + return 0; + if (data->classId() == QPixmapData::MacClass) { QMacPixmapData *d = static_cast(data.data()); if (!d->cg_data) diff --git a/src/gui/image/qpixmap_qws.cpp b/src/gui/image/qpixmap_qws.cpp index 6b4283e..a8516a5 100644 --- a/src/gui/image/qpixmap_qws.cpp +++ b/src/gui/image/qpixmap_qws.cpp @@ -114,7 +114,7 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h) QRgb* QPixmap::clut() const { - if (data->classId() == QPixmapData::RasterClass) { + if (data && data->classId() == QPixmapData::RasterClass) { const QRasterPixmapData *d = static_cast(data.data()); return d->image.colorTable().data(); } @@ -124,7 +124,7 @@ QRgb* QPixmap::clut() const int QPixmap::numCols() const { - if (data->classId() == QPixmapData::RasterClass) { + if (data && data->classId() == QPixmapData::RasterClass) { const QRasterPixmapData *d = static_cast(data.data()); return d->image.numColors(); } @@ -134,7 +134,7 @@ int QPixmap::numCols() const const uchar* QPixmap::qwsBits() const { - if (data->classId() == QPixmapData::RasterClass) { + if (data && data->classId() == QPixmapData::RasterClass) { const QRasterPixmapData *d = static_cast(data.data()); return d->image.bits(); } @@ -144,7 +144,7 @@ const uchar* QPixmap::qwsBits() const int QPixmap::qwsBytesPerLine() const { - if (data->classId() == QPixmapData::RasterClass) { + if (data && data->classId() == QPixmapData::RasterClass) { const QRasterPixmapData *d = static_cast(data.data()); return d->image.bytesPerLine(); } diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 666d608..d4c97e1 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -311,7 +311,7 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h) CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const { QPixmapData *data = pixmapData(); - if (data->isNull()) + if (!data || data->isNull()) return 0; return reinterpret_cast(data->toNativeType(QPixmapData::FbsBitmap)); @@ -337,8 +337,9 @@ QPixmap QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *bitmap) if (!bitmap) return QPixmap(); - QPixmap pixmap; - pixmap.pixmapData()->fromNativeType(reinterpret_cast(bitmap), QPixmapData::FbsBitmap); + QScopedPointer data(new QS60PixmapData(QPixmapData::PixmapType)); + data->fromNativeType(reinterpret_cast(bitmap), QPixmapData::FbsBitmap); + QPixmap pixmap(data.take()); return pixmap; } @@ -752,9 +753,9 @@ QPixmap QPixmap::fromSymbianRSgImage(RSgImage *sgImage) if (!sgImage) return QPixmap(); - QPixmap pixmap; - pixmap.pixmapData()->fromNativeType(reinterpret_cast(sgImage), QPixmapData::SgImage); - + QScopedPointer data(new QS60PixmapData(QPixmapData::PixmapType)); + data->fromNativeType(reinterpret_cast(bitmap), QPixmapData::SgImage); + QPixmap pixmap(data.take()); return pixmap; } diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp index 1b61484..04027c1 100644 --- a/src/gui/image/qpixmap_win.cpp +++ b/src/gui/image/qpixmap_win.cpp @@ -121,6 +121,9 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h ) HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const { + if (isNull()) + return 0; + HBITMAP bitmap = 0; if (data->classId() == QPixmapData::RasterClass) { QRasterPixmapData* d = static_cast(data.data()); diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index ea9eff9..8a0120a 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1976,6 +1976,9 @@ void QPixmap::x11SetScreen(int screen) return; } + if (isNull()) + return; + if (data->classId() != QPixmapData::X11Class) return; @@ -2078,7 +2081,7 @@ bool QX11PixmapData::hasAlphaChannel() const const QX11Info &QPixmap::x11Info() const { - if (data->classId() == QPixmapData::X11Class) + if (data && data->classId() == QPixmapData::X11Class) return static_cast(data.data())->xinfo; else { static QX11Info nullX11Info; @@ -2135,7 +2138,7 @@ QPaintEngine* QX11PixmapData::paintEngine() const Qt::HANDLE QPixmap::x11PictureHandle() const { #ifndef QT_NO_XRENDER - if (data->classId() == QPixmapData::X11Class) + if (data && data->classId() == QPixmapData::X11Class) return static_cast(data.data())->picture; else return 0; diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp index 1ad1f02..10194e4 100644 --- a/src/gui/image/qpixmapdata.cpp +++ b/src/gui/image/qpixmapdata.cpp @@ -51,6 +51,19 @@ QT_BEGIN_NAMESPACE const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; +QPixmapData *QPixmapData::create(int w, int h, PixelType type) +{ + QPixmapData *data; + QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem(); + if (gs) + data = gs->createPixmapData(static_cast(type)); + else + data = QGraphicsSystem::createDefaultPixmapData(static_cast(type)); + data->resize(w, h); + return data; +} + + QPixmapData::QPixmapData(PixelType pixelType, int objectId) : w(0), h(0), diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index e99409c..d1bb92a 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -122,6 +122,8 @@ public: virtual void fromNativeType(void* pixmap, NativeType type); #endif + static QPixmapData *create(int w, int h, PixelType type); + protected: void setSerialNumber(int serNo); int w; -- cgit v0.12 From d670ef51fe76adccd6f4d017f6a23940ab5284ee Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 30 Oct 2009 10:55:29 +0100 Subject: rename qstringbuilder test classes --- tests/auto/qstringbuilder1/qstringbuilder1.pro | 3 -- tests/auto/qstringbuilder1/stringbuilder.cpp | 56 +--------------------- tests/auto/qstringbuilder1/stringbuilder.h | 55 --------------------- tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp | 33 ++++++++++++- tests/auto/qstringbuilder2/qstringbuilder2.pro | 3 -- tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp | 32 +++++++++++++ tests/auto/qstringbuilder3/qstringbuilder3.pro | 3 -- tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp | 31 ++++++++++++ tests/auto/qstringbuilder4/qstringbuilder4.pro | 3 -- tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp | 34 ++++++++++++- 10 files changed, 129 insertions(+), 124 deletions(-) delete mode 100644 tests/auto/qstringbuilder1/stringbuilder.h diff --git a/tests/auto/qstringbuilder1/qstringbuilder1.pro b/tests/auto/qstringbuilder1/qstringbuilder1.pro index 1ca9d45..5bb14d4 100644 --- a/tests/auto/qstringbuilder1/qstringbuilder1.pro +++ b/tests/auto/qstringbuilder1/qstringbuilder1.pro @@ -3,7 +3,4 @@ load(qttest_p4) QT = core SOURCES += tst_qstringbuilder1.cpp -HEADERS += ../qstringbuilder1/stringbuilder.h - -DEFINES += SCENARIO=1 diff --git a/tests/auto/qstringbuilder1/stringbuilder.cpp b/tests/auto/qstringbuilder1/stringbuilder.cpp index 9fea137..f35d4d2 100644 --- a/tests/auto/qstringbuilder1/stringbuilder.cpp +++ b/tests/auto/qstringbuilder1/stringbuilder.cpp @@ -39,61 +39,9 @@ ** ****************************************************************************/ -// This is included in various .cpp files as a compile test for various scenarios -// depending on NO_CAST_* and QT_USE_FAST_OPERATOR_PLUS and QT_USE_FAST_CONCATENATION - -#if SCENARIO == 1 -// this is the "no harm done" version. Only operator% is active, -// with NO_CAST * defined -#define P % -#undef QT_USE_FAST_OPERATOR_PLUS -#undef QT_USE_FAST_CONCATENATION -#define QT_NO_CAST_FROM_ASCII -#define QT_NO_CAST_TO_ASCII -#endif - - -#if SCENARIO == 2 -// this is the "full" version. Operator+ is replaced by a QStringBuilder -// based version -// with NO_CAST * defined -#define P + -#define QT_USE_FAST_OPERATOR_PLUS -#define QT_USE_FAST_CONCATENATION -#define QT_NO_CAST_FROM_ASCII -#define QT_NO_CAST_TO_ASCII -#endif - -#if SCENARIO == 3 -// this is the "no harm done" version. Only operator% is active, -// with NO_CAST * _not_ defined -#define P % -#undef QT_USE_FAST_OPERATOR_PLUS -#undef QT_USE_FAST_CONCATENATION -#undef QT_NO_CAST_FROM_ASCII -#undef QT_NO_CAST_TO_ASCII -#endif - -#if SCENARIO == 4 -// this is the "full" version. Operator+ is replaced by a QStringBuilder -// based version -// with NO_CAST * _not_ defined -#define P + -#define QT_USE_FAST_OPERATOR_PLUS -#define QT_USE_FAST_CONCATENATION -#undef QT_NO_CAST_FROM_ASCII -#undef QT_NO_CAST_TO_ASCII -#endif - -#include -#include "stringbuilder.h" - -//TESTED_CLASS=QStringBuilder -//TESTED_FILES=qstringbuilder.cpp - #define LITERAL "some literal" -void tst_QStringBuilder::scenario() +void runScenario() { QLatin1Literal l1literal(LITERAL); QLatin1String l1string(LITERAL); @@ -129,5 +77,3 @@ void tst_QStringBuilder::scenario() QCOMPARE(r, r2); #endif } - -QTEST_APPLESS_MAIN(tst_QStringBuilder) diff --git a/tests/auto/qstringbuilder1/stringbuilder.h b/tests/auto/qstringbuilder1/stringbuilder.h deleted file mode 100644 index 5ac9dbe..0000000 --- a/tests/auto/qstringbuilder1/stringbuilder.h +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TST_QSTRINGBUILDER_H -#define TST_QSTRINGBUILDER_H - -#include - -class tst_QStringBuilder : public QObject -{ - Q_OBJECT - -private slots: - void scenario(); -}; - -#endif diff --git a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp index bd2e4b0..d0a613c 100644 --- a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp +++ b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp @@ -39,4 +39,35 @@ ** ****************************************************************************/ -#include "../qstringbuilder1/stringbuilder.cpp" + +// SCENARIO 1 +// this is the "no harm done" version. Only operator% is active, +// with NO_CAST * defined +#define P % +#undef QT_USE_FAST_OPERATOR_PLUS +#undef QT_USE_FAST_CONCATENATION +#define QT_NO_CAST_FROM_ASCII +#define QT_NO_CAST_TO_ASCII + + +#include + +//TESTED_CLASS=QStringBuilder +//TESTED_FILES=qstringbuilder.cpp + +#define LITERAL "some literal" + +void runScenario(); // Defined in stringbuilder.cpp #included below. + +class tst_QStringBuilder1 : public QObject +{ + Q_OBJECT + +private slots: + void scenario() { runScenario(); } +}; + +#include "stringbuilder.cpp" +#include "tst_qstringbuilder1.moc" + +QTEST_APPLESS_MAIN(tst_QStringBuilder1) diff --git a/tests/auto/qstringbuilder2/qstringbuilder2.pro b/tests/auto/qstringbuilder2/qstringbuilder2.pro index c0b3ebc..4152dc3 100644 --- a/tests/auto/qstringbuilder2/qstringbuilder2.pro +++ b/tests/auto/qstringbuilder2/qstringbuilder2.pro @@ -3,6 +3,3 @@ load(qttest_p4) QT = core SOURCES += tst_qstringbuilder2.cpp -HEADERS += ../qstringbuilder1/stringbuilder.h - -DEFINES += SCENARIO=2 diff --git a/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp index bd2e4b0..4470928 100644 --- a/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp +++ b/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp @@ -39,4 +39,36 @@ ** ****************************************************************************/ + +// SCENARIO 2 +// this is the "full" version. Operator+ is replaced by a QStringBuilder +// based version +// with NO_CAST * defined +#define P + +#define QT_USE_FAST_OPERATOR_PLUS +#define QT_USE_FAST_CONCATENATION +#define QT_NO_CAST_FROM_ASCII +#define QT_NO_CAST_TO_ASCII + + +#include + +//TESTED_CLASS=QStringBuilder +//TESTED_FILES=qstringbuilder.cpp + +#define LITERAL "some literal" + +void runScenario(); // Defined in stringbuilder.cpp #included below. + +class tst_QStringBuilder2 : public QObject +{ + Q_OBJECT + +private slots: + void scenario() { runScenario(); } +}; + #include "../qstringbuilder1/stringbuilder.cpp" +#include "tst_qstringbuilder2.moc" + +QTEST_APPLESS_MAIN(tst_QStringBuilder2) diff --git a/tests/auto/qstringbuilder3/qstringbuilder3.pro b/tests/auto/qstringbuilder3/qstringbuilder3.pro index 93d1a39..b4d2225 100644 --- a/tests/auto/qstringbuilder3/qstringbuilder3.pro +++ b/tests/auto/qstringbuilder3/qstringbuilder3.pro @@ -3,6 +3,3 @@ load(qttest_p4) QT = core SOURCES += tst_qstringbuilder3.cpp -HEADERS += ../qstringbuilder1/stringbuilder.h - -DEFINES += SCENARIO=3 diff --git a/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp index bd2e4b0..30f0181 100644 --- a/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp +++ b/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp @@ -39,4 +39,35 @@ ** ****************************************************************************/ + +// SCENARIO 3 +// this is the "no harm done" version. Only operator% is active, +// with NO_CAST * _not_ defined +#define P % +#undef QT_USE_FAST_OPERATOR_PLUS +#undef QT_USE_FAST_CONCATENATION +#undef QT_NO_CAST_FROM_ASCII +#undef QT_NO_CAST_TO_ASCII + + +#include + +//TESTED_CLASS=QStringBuilder +//TESTED_FILES=qstringbuilder.cpp + +#define LITERAL "some literal" + +void runScenario(); // Defined in stringbuilder.cpp #included below. + +class tst_QStringBuilder3 : public QObject +{ + Q_OBJECT + +private slots: + void scenario() { runScenario(); } +}; + #include "../qstringbuilder1/stringbuilder.cpp" +#include "tst_qstringbuilder3.moc" + +QTEST_APPLESS_MAIN(tst_QStringBuilder3) diff --git a/tests/auto/qstringbuilder4/qstringbuilder4.pro b/tests/auto/qstringbuilder4/qstringbuilder4.pro index eeec447..6ec5228 100644 --- a/tests/auto/qstringbuilder4/qstringbuilder4.pro +++ b/tests/auto/qstringbuilder4/qstringbuilder4.pro @@ -3,6 +3,3 @@ load(qttest_p4) QT = core SOURCES += tst_qstringbuilder4.cpp -HEADERS += ../qstringbuilder1/stringbuilder.h - -DEFINES += SCENARIO=4 diff --git a/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp index 2159283..95b4ec3 100644 --- a/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp +++ b/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the QtXmlPatterns module of the Qt Toolkit. +** This file is part of the test suite module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,4 +39,36 @@ ** ****************************************************************************/ + +// SCENARIO 4 +// this is the "full" version. Operator+ is replaced by a QStringBuilder +// based version +// with NO_CAST * _not_ defined +#define P + +#define QT_USE_FAST_OPERATOR_PLUS +#define QT_USE_FAST_CONCATENATION +#undef QT_NO_CAST_FROM_ASCII +#undef QT_NO_CAST_TO_ASCII + + +#include + +//TESTED_CLASS=QStringBuilder +//TESTED_FILES=qstringbuilder.cpp + +#define LITERAL "some literal" + +void runScenario(); // Defined in stringbuilder.cpp #included below. + +class tst_QStringBuilder4 : public QObject +{ + Q_OBJECT + +private slots: + void scenario() { runScenario(); } +}; + #include "../qstringbuilder1/stringbuilder.cpp" +#include "tst_qstringbuilder4.moc" + +QTEST_APPLESS_MAIN(tst_QStringBuilder4) -- cgit v0.12 From 1bed105d048531e3e260eff0ef2533d7cc8ba7fb Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 26 Oct 2009 12:40:33 +0100 Subject: introduce int QTextDocument::available{Undo,Redo}Steps() const; Formerly, QTextDocument::revision() could be used to guesstimate the number of available undo steps that was used in Qt Creator to store cursor positions in parallel to the actual text contents. Now that revision() is strictly increasing, another means is needed, therefore the new functions providing the needed data. Reviewed-by: mae --- src/gui/text/qtextdocument.cpp | 27 +++++++++++++++++++++++++++ src/gui/text/qtextdocument.h | 3 +++ src/gui/text/qtextdocument_p.h | 3 +++ 3 files changed, 33 insertions(+) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index a8956b8..5398111 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -956,6 +956,8 @@ QString QTextDocument::defaultStyleSheet() const /*! Returns true if undo is available; otherwise returns false. + + \sa isRedoAvailable(), availableUndoSteps() */ bool QTextDocument::isUndoAvailable() const { @@ -965,6 +967,8 @@ bool QTextDocument::isUndoAvailable() const /*! Returns true if redo is available; otherwise returns false. + + \sa isUndoAvailable(), availableRedoSteps() */ bool QTextDocument::isRedoAvailable() const { @@ -972,6 +976,29 @@ bool QTextDocument::isRedoAvailable() const return d->isRedoAvailable(); } +/*! \since 4.6 + + Returns the number of available undo steps. + + \sa isUndoAvailable() +*/ +int QTextDocument::availableUndoSteps() const +{ + Q_D(const QTextDocument); + return d->availableUndoSteps(); +} + +/*! \since 4.6 + + Returns the number of available redo steps. + + \sa isRedoAvailable() +*/ +int QTextDocument::availableRedoSteps() const +{ + Q_D(const QTextDocument); + return d->availableRedoSteps(); +} /*! \since 4.4 diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h index e52716a..d217a4d 100644 --- a/src/gui/text/qtextdocument.h +++ b/src/gui/text/qtextdocument.h @@ -142,6 +142,9 @@ public: bool isUndoAvailable() const; bool isRedoAvailable() const; + int availableUndoSteps() const; + int availableRedoSteps() const; + int revision() const; void setDocumentLayout(QAbstractTextDocumentLayout *layout); diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h index ce25c57..c10855b 100644 --- a/src/gui/text/qtextdocument_p.h +++ b/src/gui/text/qtextdocument_p.h @@ -212,6 +212,9 @@ public: inline bool isUndoAvailable() const { return undoEnabled && undoState > 0; } inline bool isRedoAvailable() const { return undoEnabled && undoState < undoStack.size(); } + inline int availableUndoSteps() const { return undoEnabled ? undoState : 0; } + inline int availableRedoSteps() const { return undoEnabled ? qMax(undoStack.size() - undoState - 1, 0) : 0; } + inline QString buffer() const { return text; } QString plainText() const; inline int length() const { return fragments.length(); } -- cgit v0.12 From b68cd1df21935fc032a93c7d7bc33fcb77c7b8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 30 Oct 2009 12:20:09 +0100 Subject: Reverts bf1a6bb6b3b8c98f6ab402512eb2f1996c2435c7 and removes THREAD from qfeature Reviewed-by: Trust Me --- src/corelib/global/qconfig-minimal.h | 3 -- src/corelib/global/qfeatures.h | 63 ++++++++++++++++-------------------- src/corelib/global/qfeatures.txt | 15 +++------ src/corelib/thread/qmutexpool.cpp | 20 ++++++------ src/corelib/thread/qmutexpool_p.h | 17 ++-------- src/corelib/thread/qthread.cpp | 24 ++++++-------- src/corelib/thread/qthread_p.h | 62 ++++++++++++++++++----------------- 7 files changed, 85 insertions(+), 119 deletions(-) diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h index 9cc3057..58565d6 100644 --- a/src/corelib/global/qconfig-minimal.h +++ b/src/corelib/global/qconfig-minimal.h @@ -255,9 +255,6 @@ #ifndef QT_NO_TEXTHTMLPARSER # define QT_NO_TEXTHTMLPARSER #endif -#ifndef QT_NO_THREAD -# define QT_NO_THREAD -#endif #ifndef QT_NO_CONCURRENT # define QT_NO_CONCURRENT #endif diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 3996180..9b3e817 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -55,6 +55,9 @@ // Color Names //#define QT_NO_COLORNAMES +// QtConcurrent +//#define QT_NO_CONCURRENT + // QCopChannel //#define QT_NO_COP @@ -76,6 +79,9 @@ // Effects //#define QT_NO_EFFECTS +// QFileSystemWatcher +//#define QT_NO_FILESYSTEMWATCHER + // Freetype Font Engine //#define QT_NO_FREETYPE @@ -151,6 +157,9 @@ // QPicture //#define QT_NO_PICTURE +// QProcess +//#define QT_NO_PROCESS + // QProgressBar //#define QT_NO_PROGRESSBAR @@ -274,9 +283,6 @@ // QTextStream //#define QT_NO_TEXTSTREAM -// QThread -//#define QT_NO_THREAD - // QToolTip //#define QT_NO_TOOLTIP @@ -301,6 +307,11 @@ // //#define QT_NO_XMLSTREAM +// Animation +#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES)) +#define QT_NO_ANIMATION +#endif + // QButtonGroup #if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX)) #define QT_NO_BUTTONGROUP @@ -316,11 +327,6 @@ #define QT_NO_CODECS #endif -// QtConcurrent -#if !defined(QT_NO_CONCURRENT) && (defined(QT_NO_THREAD)) -#define QT_NO_CONCURRENT -#endif - // QDate/QTime/QDateTime #if !defined(QT_NO_DATESTRING) && (defined(QT_NO_TEXTDATE)) #define QT_NO_DATESTRING @@ -331,9 +337,9 @@ #define QT_NO_DIAL #endif -// QFileSystemWatcher -#if !defined(QT_NO_FILESYSTEMWATCHER) && (defined(QT_NO_THREAD)) -#define QT_NO_FILESYSTEMWATCHER +// QFileSystemModel +#if !defined(QT_NO_FILESYSTEMMODEL) && (defined(QT_NO_FILESYSTEMWATCHER)) +#define QT_NO_FILESYSTEMMODEL #endif // QHostInfo @@ -371,11 +377,6 @@ #define QT_NO_PHONON_VOLUMEFADEREFFECT #endif -// QProcess -#if !defined(QT_NO_PROCESS) && (defined(QT_NO_THREAD)) -#define QT_NO_PROCESS -#endif - // QProgressDialog #if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_PROGRESSBAR)) #define QT_NO_PROGRESSDIALOG @@ -491,21 +492,11 @@ #define QT_NO_XMLSTREAMWRITER #endif -// Animation -#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_THREAD)) -#define QT_NO_ANIMATION -#endif - // Context menu #if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) #define QT_NO_CONTEXTMENU #endif -// QFileSystemModel -#if !defined(QT_NO_FILESYSTEMMODEL) && (defined(QT_NO_FILESYSTEMWATCHER)) -#define QT_NO_FILESYSTEMMODEL -#endif - // File Transfer Protocol #if !defined(QT_NO_FTP) && (defined(QT_NO_URLINFO) || defined(QT_NO_TEXTDATE)) #define QT_NO_FTP @@ -796,31 +787,31 @@ #define QT_NO_CUPS #endif -// QDockwidget -#if !defined(QT_NO_DOCKWIDGET) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_DOCKWIDGET -#endif - // QDirModel #if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_FILESYSTEMMODEL)) #define QT_NO_DIRMODEL #endif +// QDockwidget +#if !defined(QT_NO_DOCKWIDGET) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_MAINWINDOW)) +#define QT_NO_DOCKWIDGET +#endif + // QUndoView #if !defined(QT_NO_UNDOVIEW) && (defined(QT_NO_UNDOSTACK) || defined(QT_NO_LISTVIEW)) #define QT_NO_UNDOVIEW #endif -// QGraphicsSvgItem -#if !defined(QT_NO_GRAPHICSSVGITEM) && (defined(QT_NO_SVGRENDERER) || defined(QT_NO_GRAPHICSVIEW)) -#define QT_NO_GRAPHICSSVGITEM -#endif - // QCompleter #if !defined(QT_NO_FSCOMPLETER) && (defined(QT_NO_FILESYSTEMMODEL) || defined(QT_NO_COMPLETER)) #define QT_NO_FSCOMPLETER #endif +// QGraphicsSvgItem +#if !defined(QT_NO_GRAPHICSSVGITEM) && (defined(QT_NO_SVGRENDERER) || defined(QT_NO_GRAPHICSVIEW)) +#define QT_NO_GRAPHICSSVGITEM +#endif + // QComboBox #if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW)) #define QT_NO_COMBOBOX diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 543056f..ff34006 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -28,17 +28,10 @@ Requires: Name: CssParser SeeAlso: ??? -Feature: THREAD -Description: Supports multithreaded programming. -Section: Kernel -Requires: -Name: QThread -SeeAlso: ??? - Feature: CONCURRENT Description: Provides a high-level multi-threaded APIs Section: Kernel -Requires: THREAD +Requires: Name: QtConcurrent SeeAlso: ??? @@ -195,7 +188,7 @@ SeeAlso: ??? Feature: PROCESS Description: Supports external process invocation. Section: File I/O -Requires: THREAD +Requires: Name: QProcess SeeAlso: ??? @@ -245,7 +238,7 @@ Feature: FILESYSTEMWATCHER Description: Provides an interface for monitoring files and directories for modications. Section: File I/O -Requires: THREAD +Requires: Name: QFileSystemWatcher SeeAlso: ??? @@ -1166,7 +1159,7 @@ SeeAlso: ??? Feature: ANIMATION Description: Provides a framework for animations. Section: Utilities -Requires: PROPERTIES THREAD +Requires: PROPERTIES Name: Animation SeeAlso: ??? diff --git a/src/corelib/thread/qmutexpool.cpp b/src/corelib/thread/qmutexpool.cpp index 9f37239..c5c1882 100644 --- a/src/corelib/thread/qmutexpool.cpp +++ b/src/corelib/thread/qmutexpool.cpp @@ -42,6 +42,7 @@ #include "qatomic.h" #include "qmutexpool_p.h" +#ifndef QT_NO_THREAD QT_BEGIN_NAMESPACE @@ -49,7 +50,6 @@ QT_BEGIN_NAMESPACE // use QMutexpool::instance() in new clode. Q_CORE_EXPORT QMutexPool *qt_global_mutexpool = 0; Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive)) -#ifndef QT_NO_THREAD /*! \class QMutexPool @@ -114,6 +114,15 @@ QMutexPool::~QMutexPool() mutexes[index] = 0; } } + +/*! + Returns the global QMutexPool instance. +*/ +QMutexPool *QMutexPool::instance() +{ + return globalMutexPool(); +} + /*! Returns a QMutex from the pool. QMutexPool uses the value \a address to determine which mutex is returned from the pool. @@ -143,14 +152,7 @@ QMutex *QMutexPool::globalInstanceGet(const void *address) return 0; return globalInstance->get(address); } -#endif // QT_NO_THREAD -/*! - Returns the global QMutexPool instance. -*/ -QMutexPool *QMutexPool::instance() -{ - return globalMutexPool(); -} QT_END_NAMESPACE +#endif // QT_NO_THREAD diff --git a/src/corelib/thread/qmutexpool_p.h b/src/corelib/thread/qmutexpool_p.h index c26711b..3e1bad0 100644 --- a/src/corelib/thread/qmutexpool_p.h +++ b/src/corelib/thread/qmutexpool_p.h @@ -57,9 +57,9 @@ #include "QtCore/qmutex.h" #include "QtCore/qvarlengtharray.h" +#ifndef QT_NO_THREAD QT_BEGIN_NAMESPACE -#ifndef QT_NO_THREAD class Q_CORE_EXPORT QMutexPool { @@ -75,24 +75,11 @@ private: QVarLengthArray, 131> mutexes; QMutex::RecursionMode recursionMode; }; -#else //QT_NO_THREAD -Q_GLOBAL_STATIC(QMutex, globalMutex) -class Q_CORE_EXPORT QMutexPool -{ -public: - explicit QMutexPool(QMutex::RecursionMode recursionMode = QMutex::NonRecursive, int size = 131){} - ~QMutexPool(){} - - QMutex *get(const void *address){return globalMutex();} - static QMutexPool *instance(); - static QMutex *globalInstanceGet(const void *address){return globalMutex();} -}; - -#endif // QT_NO_THREAD extern Q_CORE_EXPORT QMutexPool *qt_global_mutexpool; QT_END_NAMESPACE +#endif // QT_NO_THREAD #endif // QMUTEXPOOL_P_H diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index cf57d33..ac191fe 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -727,16 +727,6 @@ QThread *QThread::currentThread() return QThreadData::current()->thread; } -/*! \internal - */ -QThread::QThread(QThreadPrivate &dd, QObject *parent) - : QObject(dd, parent) -{ - Q_D(QThread); - // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this); - d->data->thread = this; -} - QThreadData* QThreadData::current() { static QThreadData *data = 0; // reinterpret_cast(pthread_getspecific(current_thread_data_key)); @@ -748,13 +738,17 @@ QThreadData* QThreadData::current() } return data; } -#endif // QT_NO_THREAD -QThreadData* QThreadData::get2(QThread *thread) + +/*! \internal + */ +QThread::QThread(QThreadPrivate &dd, QObject *parent) + : QObject(dd, parent) { - Q_ASSERT_X(thread != 0, "QThread", "internal error"); - return thread->d_func()->data; + Q_D(QThread); + // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this); + d->data->thread = this; } - +#endif // QT_NO_THREAD QT_END_NAMESPACE diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 8c3acdb..af68434 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -111,36 +111,6 @@ public: { } }; -class QThreadData -{ - QAtomicInt _ref; - -public: - QThreadData(int initialRefCount = 1); - ~QThreadData(); - - static QThreadData *current(); - static QThreadData *get2(QThread *thread); - - void ref(); - void deref(); - - QThread *thread; - bool quitNow; - int loopLevel; - QAbstractEventDispatcher *eventDispatcher; - QStack eventLoops; - QPostEventList postEventList; - bool canWait; - QMap tls; - - QMutex mutex; - -# ifdef Q_OS_SYMBIAN - RThread symbian_thread_handle; -# endif -}; - #ifndef QT_NO_THREAD class QThreadPrivate : public QObjectPrivate { @@ -209,6 +179,38 @@ public: #endif // QT_NO_THREAD +class QThreadData +{ + QAtomicInt _ref; + +public: + QThreadData(int initialRefCount = 1); + ~QThreadData(); + + static QThreadData *current(); + static QThreadData *get2(QThread *thread) + { Q_ASSERT_X(thread != 0, "QThread", "internal error"); return thread->d_func()->data; } + + + void ref(); + void deref(); + + QThread *thread; + bool quitNow; + int loopLevel; + QAbstractEventDispatcher *eventDispatcher; + QStack eventLoops; + QPostEventList postEventList; + bool canWait; + QMap tls; + + QMutex mutex; + +# ifdef Q_OS_SYMBIAN + RThread symbian_thread_handle; +# endif +}; + // thread wrapper for the main() thread class QAdoptedThread : public QThread { -- cgit v0.12 From e662c6a07a01506bd14b57790a887d5c68b79420 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 20 Oct 2009 16:42:06 +0200 Subject: Refactor of shader manager to not use partial shaders This is a first step towards supporting binary shaders. Note: This change will introduce a (rare) leak of shader objects, as the shaders will never be kicked out from the cache (because the cache is still a QList) :-) This will be corrected by the next patch. Reviewed-By: Samuel --- .../gl2paintengineex/qglcustomshaderstage.cpp | 21 +- .../gl2paintengineex/qglcustomshaderstage_p.h | 3 +- .../gl2paintengineex/qglengineshadermanager.cpp | 340 ++++++++++----------- .../gl2paintengineex/qglengineshadermanager_p.h | 64 ++-- 4 files changed, 211 insertions(+), 217 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp index ab2026c..b71a7b7 100644 --- a/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp +++ b/src/opengl/gl2paintengineex/qglcustomshaderstage.cpp @@ -67,8 +67,10 @@ QGLCustomShaderStage::QGLCustomShaderStage() QGLCustomShaderStage::~QGLCustomShaderStage() { Q_D(QGLCustomShaderStage); - if (d->m_manager) - d->m_manager->removeCustomStage(this); + if (d->m_manager) { + d->m_manager->removeCustomStage(); + d->m_manager->sharedShaders->cleanupCustomStage(this); + } } void QGLCustomShaderStage::setUniformsDirty() @@ -85,6 +87,8 @@ bool QGLCustomShaderStage::setOnPainter(QPainter* p) qWarning("QGLCustomShaderStage::setOnPainter() - paint engine not OpenGL2"); return false; } + if (d->m_manager) + qWarning("Custom shader is already set on a painter"); QGL2PaintEngineEx *engine = static_cast(p->paintEngine()); d->m_manager = QGL2PaintEngineExPrivate::shaderManagerForEngine(engine); @@ -108,12 +112,21 @@ void QGLCustomShaderStage::removeFromPainter(QPainter* p) // This should leave the program in a compiled/linked state // if the next custom shader stage is this one again. d->m_manager->setCustomStage(0); + d->m_manager = 0; } -const char* QGLCustomShaderStage::source() const +QByteArray QGLCustomShaderStage::source() const { Q_D(const QGLCustomShaderStage); - return d->m_source.constData(); + return d->m_source; +} + +// Called by the shader manager if another custom shader is attached or +// the manager is deleted +void QGLCustomShaderStage::setInactive() +{ + Q_D(QGLCustomShaderStage); + d->m_manager = 0; } void QGLCustomShaderStage::setSource(const QByteArray& s) diff --git a/src/opengl/gl2paintengineex/qglcustomshaderstage_p.h b/src/opengl/gl2paintengineex/qglcustomshaderstage_p.h index f8c13c5..e319389 100644 --- a/src/opengl/gl2paintengineex/qglcustomshaderstage_p.h +++ b/src/opengl/gl2paintengineex/qglcustomshaderstage_p.h @@ -74,8 +74,9 @@ public: bool setOnPainter(QPainter*); void removeFromPainter(QPainter*); - const char* source() const; + QByteArray source() const; + void setInactive(); protected: void setSource(const QByteArray&); diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index af9306f..9dc2b53 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -78,7 +78,6 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) , blitShaderProg(0) , simpleShaderProg(0) { - memset(compiledShaders, 0, sizeof(compiledShaders)); /* Rather than having the shader source array statically initialised, it is initialised @@ -121,7 +120,7 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) code[ImageSrcFragmentShader] = qglslImageSrcFragmentShader; code[ImageSrcWithPatternFragmentShader] = qglslImageSrcWithPatternFragmentShader; code[NonPremultipliedImageSrcFragmentShader] = qglslNonPremultipliedImageSrcFragmentShader; - code[CustomImageSrcFragmentShader] = ""; // Supplied by app. + code[CustomImageSrcFragmentShader] = qglslCustomSrcFragmentShader; // Calls "customShader", which must be appended code[SolidBrushSrcFragmentShader] = qglslSolidBrushSrcFragmentShader; code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader; code[TextureBrushSrcWithPatternFragmentShader] = qglslTextureBrushSrcWithPatternFragmentShader; @@ -163,16 +162,26 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) qglEngineShaderSourceCodePopulated = true; } + QGLShader* fragShader; + QGLShader* vertexShader; + QByteArray source; + // Compile up the simple shader: + source.clear(); + source.append(qglEngineShaderSourceCode[MainVertexShader]); + source.append(qglEngineShaderSourceCode[PositionOnlyVertexShader]); + vertexShader = new QGLShader(QGLShader::VertexShader, context, this); + vertexShader->compile(source); + + source.clear(); + source.append(qglEngineShaderSourceCode[MainFragmentShader]); + source.append(qglEngineShaderSourceCode[ShockingPinkSrcFragmentShader]); + fragShader = new QGLShader(QGLShader::FragmentShader, context, this); + fragShader->compile(source); + simpleShaderProg = new QGLShaderProgram(context, this); - compileNamedShader(MainVertexShader, QGLShader::PartialVertexShader); - compileNamedShader(PositionOnlyVertexShader, QGLShader::PartialVertexShader); - compileNamedShader(MainFragmentShader, QGLShader::PartialFragmentShader); - compileNamedShader(ShockingPinkSrcFragmentShader, QGLShader::PartialFragmentShader); - simpleShaderProg->addShader(compiledShaders[MainVertexShader]); - simpleShaderProg->addShader(compiledShaders[PositionOnlyVertexShader]); - simpleShaderProg->addShader(compiledShaders[MainFragmentShader]); - simpleShaderProg->addShader(compiledShaders[ShockingPinkSrcFragmentShader]); + simpleShaderProg->addShader(vertexShader); + simpleShaderProg->addShader(fragShader); simpleShaderProg->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); simpleShaderProg->link(); if (!simpleShaderProg->isLinked()) { @@ -181,82 +190,29 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) } // Compile the blit shader: + source.clear(); + source.append(qglEngineShaderSourceCode[MainWithTexCoordsVertexShader]); + source.append(qglEngineShaderSourceCode[UntransformedPositionVertexShader]); + vertexShader = new QGLShader(QGLShader::VertexShader, context, this); + vertexShader->compile(source); + + source.clear(); + source.append(qglEngineShaderSourceCode[MainFragmentShader]); + source.append(qglEngineShaderSourceCode[ImageSrcFragmentShader]); + fragShader = new QGLShader(QGLShader::FragmentShader, context, this); + fragShader->compile(source); + blitShaderProg = new QGLShaderProgram(context, this); - compileNamedShader(MainWithTexCoordsVertexShader, QGLShader::PartialVertexShader); - compileNamedShader(UntransformedPositionVertexShader, QGLShader::PartialVertexShader); - compileNamedShader(MainFragmentShader, QGLShader::PartialFragmentShader); - compileNamedShader(ImageSrcFragmentShader, QGLShader::PartialFragmentShader); - blitShaderProg->addShader(compiledShaders[MainWithTexCoordsVertexShader]); - blitShaderProg->addShader(compiledShaders[UntransformedPositionVertexShader]); - blitShaderProg->addShader(compiledShaders[MainFragmentShader]); - blitShaderProg->addShader(compiledShaders[ImageSrcFragmentShader]); + blitShaderProg->addShader(vertexShader); + blitShaderProg->addShader(fragShader); blitShaderProg->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR); blitShaderProg->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); blitShaderProg->link(); if (!blitShaderProg->isLinked()) { qCritical() << "Errors linking blit shader:" - << blitShaderProg->log(); - } -} - -void QGLEngineSharedShaders::shaderDestroyed(QObject *shader) -{ - // Remove any shader programs which has this as the srcPixel shader: - for (int i = 0; i < cachedPrograms.size(); ++i) { - if (cachedPrograms.at(i).srcPixelFragShader == shader) { - delete cachedPrograms.at(i).program; - cachedPrograms.removeAt(i--); - } + << simpleShaderProg->log(); } - emit shaderProgNeedsChanging(); -} - -QGLShader *QGLEngineSharedShaders::compileNamedShader(ShaderName name, QGLShader::ShaderType type) -{ - Q_ASSERT(name != CustomImageSrcFragmentShader); - Q_ASSERT(name < InvalidShaderName); - - if (compiledShaders[name]) - return compiledShaders[name]; - - QByteArray source = qglEngineShaderSourceCode[name]; - QGLShader *newShader = new QGLShader(type, ctxGuard.context(), this); - newShader->compile(source); - -#if defined(QT_DEBUG) - // Name the shader for easier debugging - QMetaEnum m = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("ShaderName")); - newShader->setObjectName(QLatin1String(m.valueToKey(name))); -#endif - - compiledShaders[name] = newShader; - return newShader; -} - -QGLShader *QGLEngineSharedShaders::compileCustomShader(QGLCustomShaderStage *stage, QGLShader::ShaderType type) -{ - QByteArray source = stage->source(); - source += qglslCustomSrcFragmentShader; - - QGLShader *newShader = customShaderCache.object(source); - if (newShader) - return newShader; - - newShader = new QGLShader(type, ctxGuard.context(), this); - newShader->compile(source); - customShaderCache.insert(source, newShader); - - connect(newShader, SIGNAL(destroyed(QObject *)), - this, SLOT(shaderDestroyed(QObject *))); - -#if defined(QT_DEBUG) - // Name the shader for easier debugging - QMetaEnum m = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("ShaderName")); - newShader->setObjectName(QLatin1String(m.valueToKey(CustomImageSrcFragmentShader))); -#endif - - return newShader; } // The address returned here will only be valid until next time this function is called. @@ -270,14 +226,54 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS cachedPrograms.append(prog); QGLEngineShaderProg &cached = cachedPrograms.last(); + QByteArray source; + source.append(qglEngineShaderSourceCode[prog.mainFragShader]); + source.append(qglEngineShaderSourceCode[prog.srcPixelFragShader]); + if (prog.srcPixelFragShader == CustomImageSrcFragmentShader) + source.append(prog.customStageSource); + if (prog.compositionFragShader) + source.append(qglEngineShaderSourceCode[prog.compositionFragShader]); + if (prog.maskFragShader) + source.append(qglEngineShaderSourceCode[prog.maskFragShader]); + QGLShader* fragShader = new QGLShader(QGLShader::FragmentShader, ctxGuard.context(), this); + fragShader->compile(source); + + source.clear(); + source.append(qglEngineShaderSourceCode[prog.mainVertexShader]); + source.append(qglEngineShaderSourceCode[prog.positionVertexShader]); + QGLShader* vertexShader = new QGLShader(QGLShader::VertexShader, ctxGuard.context(), this); + vertexShader->compile(source); + +#if defined(QT_DEBUG) + // Name the shaders for easier debugging + QMetaEnum m = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("ShaderName")); + QByteArray description; + description.append("Fragment shader: main="); + description.append(m.valueToKey(prog.mainFragShader)); + description.append(", srcPixel="); + description.append(m.valueToKey(prog.srcPixelFragShader)); + if (prog.compositionFragShader) { + description.append(", composition="); + description.append(m.valueToKey(prog.compositionFragShader)); + } + if (prog.maskFragShader) { + description.append(", mask="); + description.append(m.valueToKey(prog.maskFragShader)); + } + fragShader->setObjectName(QString::fromLatin1(description)); + + description.clear(); + description.append("Vertex shader: main="); + description.append(m.valueToKey(prog.mainVertexShader)); + description.append(", position="); + description.append(m.valueToKey(prog.positionVertexShader)); + vertexShader->setObjectName(QString::fromLatin1(description)); +#endif + // If the shader program's not found in the cache, create it now. cached.program = new QGLShaderProgram(ctxGuard.context(), this); - cached.program->addShader(cached.mainVertexShader); - cached.program->addShader(cached.positionVertexShader); - cached.program->addShader(cached.mainFragShader); - cached.program->addShader(cached.srcPixelFragShader); - cached.program->addShader(cached.maskFragShader); - cached.program->addShader(cached.compositionFragShader); + cached.program->addShader(vertexShader); + cached.program->addShader(fragShader); // We have to bind the vertex attribute names before the program is linked: cached.program->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); @@ -294,25 +290,11 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS error = QLatin1String("Shader program failed to link,") #if defined(QT_DEBUG) + br - + QLatin1String(" Shaders Used:\n") - + QLatin1String(" mainVertexShader = ") - + (cached.mainVertexShader ? - cached.mainVertexShader->objectName() : none) + br - + QLatin1String(" positionVertexShader = ") - + (cached.positionVertexShader ? - cached.positionVertexShader->objectName() : none) + br - + QLatin1String(" mainFragShader = ") - + (cached.mainFragShader ? - cached.mainFragShader->objectName() : none) + br - + QLatin1String(" srcPixelFragShader = ") - + (cached.srcPixelFragShader ? - cached.srcPixelFragShader->objectName() : none) + br - + QLatin1String(" maskFragShader = ") - + (cached.maskFragShader ? - cached.maskFragShader->objectName() : none) + br - + QLatin1String(" compositionFragShader = ") - + (cached.compositionFragShader ? - cached.compositionFragShader->objectName() : none) + br + + QLatin1String(" Shaders Used:") + br + + QLatin1String(" ") + vertexShader->objectName() + QLatin1String(": ") + br + + QLatin1String(vertexShader->sourceCode()) + br + + QLatin1String(" ") + fragShader->objectName() + QLatin1String(": ") + br + + QLatin1String(fragShader->sourceCode()) + br #endif + QLatin1String(" Error Log:\n") + QLatin1String(" ") + cached.program->log(); @@ -327,6 +309,20 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS } } + +void QGLEngineSharedShaders::cleanupCustomStage(QGLCustomShaderStage* stage) +{ + // Remove any shader programs which has this as the custom shader src: + for (int i = 0; i < cachedPrograms.size(); ++i) { + if (cachedPrograms.at(i).customStageSource == stage->source()) { + delete cachedPrograms.at(i).program; + cachedPrograms.removeAt(i--); + } + } +} + + + QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context) : ctx(context), shaderProgNeedsChanging(true), @@ -335,8 +331,7 @@ QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context) maskType(NoMask), compositionMode(QPainter::CompositionMode_SourceOver), customSrcStage(0), - currentShaderProg(0), - customShader(0) + currentShaderProg(0) { sharedShaders = QGLEngineSharedShaders::shadersForContext(context); connect(sharedShaders, SIGNAL(shaderProgNeedsChanging()), this, SLOT(shaderProgNeedsChangingSlot())); @@ -345,6 +340,7 @@ QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context) QGLEngineShaderManager::~QGLEngineShaderManager() { //### + removeCustomStage(); } uint QGLEngineShaderManager::getUniformLocation(Uniform id) @@ -436,21 +432,20 @@ void QGLEngineShaderManager::setCompositionMode(QPainter::CompositionMode mode) void QGLEngineShaderManager::setCustomStage(QGLCustomShaderStage* stage) { + if (customSrcStage) + removeCustomStage(); customSrcStage = stage; - customShader = 0; // Will be compiled from 'customSrcStage' later. shaderProgNeedsChanging = true; } -void QGLEngineShaderManager::removeCustomStage(QGLCustomShaderStage* stage) +void QGLEngineShaderManager::removeCustomStage() { - Q_UNUSED(stage); // Currently we only support one at a time... - + if (customSrcStage) + customSrcStage->setInactive(); customSrcStage = 0; - customShader = 0; shaderProgNeedsChanging = true; } - QGLShaderProgram* QGLEngineShaderManager::currentProgram() { return currentShaderProg->program; @@ -488,16 +483,16 @@ bool QGLEngineShaderManager::useCorrectShaderProg() // Choose vertex shader shader position function (which typically also sets // varyings) and the source pixel (srcPixel) fragment shader function: - QGLEngineSharedShaders::ShaderName positionVertexShaderName = QGLEngineSharedShaders::InvalidShaderName; - QGLEngineSharedShaders::ShaderName srcPixelFragShaderName = QGLEngineSharedShaders::InvalidShaderName; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::InvalidShaderName; + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::InvalidShaderName; bool isAffine = brushTransform.isAffine(); if ( (srcPixelType >= Qt::Dense1Pattern) && (srcPixelType <= Qt::DiagCrossPattern) ) { if (isAffine) - positionVertexShaderName = QGLEngineSharedShaders::AffinePositionWithPatternBrushVertexShader; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::AffinePositionWithPatternBrushVertexShader; else - positionVertexShaderName = QGLEngineSharedShaders::PositionWithPatternBrushVertexShader; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::PositionWithPatternBrushVertexShader; - srcPixelFragShaderName = QGLEngineSharedShaders::PatternBrushSrcFragmentShader; + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::PatternBrushSrcFragmentShader; } else switch (srcPixelType) { default: @@ -505,172 +500,157 @@ bool QGLEngineShaderManager::useCorrectShaderProg() qFatal("QGLEngineShaderManager::useCorrectShaderProg() - Qt::NoBrush style is set"); break; case QGLEngineShaderManager::ImageSrc: - srcPixelFragShaderName = QGLEngineSharedShaders::ImageSrcFragmentShader; - positionVertexShaderName = QGLEngineSharedShaders::PositionOnlyVertexShader; + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::ImageSrcFragmentShader; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::PositionOnlyVertexShader; texCoords = true; break; case QGLEngineShaderManager::NonPremultipliedImageSrc: - srcPixelFragShaderName = QGLEngineSharedShaders::NonPremultipliedImageSrcFragmentShader; - positionVertexShaderName = QGLEngineSharedShaders::PositionOnlyVertexShader; + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::NonPremultipliedImageSrcFragmentShader; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::PositionOnlyVertexShader; texCoords = true; break; case QGLEngineShaderManager::PatternSrc: - srcPixelFragShaderName = QGLEngineSharedShaders::ImageSrcWithPatternFragmentShader; - positionVertexShaderName = QGLEngineSharedShaders::PositionOnlyVertexShader; + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::ImageSrcWithPatternFragmentShader; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::PositionOnlyVertexShader; texCoords = true; break; case QGLEngineShaderManager::TextureSrcWithPattern: - srcPixelFragShaderName = QGLEngineSharedShaders::TextureBrushSrcWithPatternFragmentShader; - positionVertexShaderName = isAffine ? QGLEngineSharedShaders::AffinePositionWithTextureBrushVertexShader + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::TextureBrushSrcWithPatternFragmentShader; + requiredProgram.positionVertexShader = isAffine ? QGLEngineSharedShaders::AffinePositionWithTextureBrushVertexShader : QGLEngineSharedShaders::PositionWithTextureBrushVertexShader; break; case Qt::SolidPattern: - srcPixelFragShaderName = QGLEngineSharedShaders::SolidBrushSrcFragmentShader; - positionVertexShaderName = QGLEngineSharedShaders::PositionOnlyVertexShader; + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::SolidBrushSrcFragmentShader; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::PositionOnlyVertexShader; break; case Qt::LinearGradientPattern: - srcPixelFragShaderName = QGLEngineSharedShaders::LinearGradientBrushSrcFragmentShader; - positionVertexShaderName = isAffine ? QGLEngineSharedShaders::AffinePositionWithLinearGradientBrushVertexShader + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::LinearGradientBrushSrcFragmentShader; + requiredProgram.positionVertexShader = isAffine ? QGLEngineSharedShaders::AffinePositionWithLinearGradientBrushVertexShader : QGLEngineSharedShaders::PositionWithLinearGradientBrushVertexShader; break; case Qt::ConicalGradientPattern: - srcPixelFragShaderName = QGLEngineSharedShaders::ConicalGradientBrushSrcFragmentShader; - positionVertexShaderName = isAffine ? QGLEngineSharedShaders::AffinePositionWithConicalGradientBrushVertexShader + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::ConicalGradientBrushSrcFragmentShader; + requiredProgram.positionVertexShader = isAffine ? QGLEngineSharedShaders::AffinePositionWithConicalGradientBrushVertexShader : QGLEngineSharedShaders::PositionWithConicalGradientBrushVertexShader; break; case Qt::RadialGradientPattern: - srcPixelFragShaderName = QGLEngineSharedShaders::RadialGradientBrushSrcFragmentShader; - positionVertexShaderName = isAffine ? QGLEngineSharedShaders::AffinePositionWithRadialGradientBrushVertexShader + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::RadialGradientBrushSrcFragmentShader; + requiredProgram.positionVertexShader = isAffine ? QGLEngineSharedShaders::AffinePositionWithRadialGradientBrushVertexShader : QGLEngineSharedShaders::PositionWithRadialGradientBrushVertexShader; break; case Qt::TexturePattern: - srcPixelFragShaderName = QGLEngineSharedShaders::TextureBrushSrcFragmentShader; - positionVertexShaderName = isAffine ? QGLEngineSharedShaders::AffinePositionWithTextureBrushVertexShader + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::TextureBrushSrcFragmentShader; + requiredProgram.positionVertexShader = isAffine ? QGLEngineSharedShaders::AffinePositionWithTextureBrushVertexShader : QGLEngineSharedShaders::PositionWithTextureBrushVertexShader; break; }; - requiredProgram.positionVertexShader = sharedShaders->compileNamedShader(positionVertexShaderName, QGLShader::PartialVertexShader); + if (useCustomSrc) { - if (!customShader) - customShader = sharedShaders->compileCustomShader(customSrcStage, QGLShader::PartialFragmentShader); - requiredProgram.srcPixelFragShader = customShader; - } else { - requiredProgram.srcPixelFragShader = sharedShaders->compileNamedShader(srcPixelFragShaderName, QGLShader::PartialFragmentShader); + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::CustomImageSrcFragmentShader; + requiredProgram.customStageSource = customSrcStage->source(); } const bool hasCompose = compositionMode > QPainter::CompositionMode_Plus; const bool hasMask = maskType != QGLEngineShaderManager::NoMask; // Choose fragment shader main function: - QGLEngineSharedShaders::ShaderName mainFragShaderName; - if (opacityMode == AttributeOpacity) { Q_ASSERT(!hasCompose && !hasMask); - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_ImageArrays; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_ImageArrays; } else { bool useGlobalOpacity = (opacityMode == UniformOpacity); if (hasCompose && hasMask && useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CMO; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_CMO; if (hasCompose && hasMask && !useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CM; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_CM; if (!hasCompose && hasMask && useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_MO; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_MO; if (!hasCompose && hasMask && !useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_M; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_M; if (hasCompose && !hasMask && useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CO; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_CO; if (hasCompose && !hasMask && !useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_C; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_C; if (!hasCompose && !hasMask && useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_O; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader_O; if (!hasCompose && !hasMask && !useGlobalOpacity) - mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader; + requiredProgram.mainFragShader = QGLEngineSharedShaders::MainFragmentShader; } - requiredProgram.mainFragShader = sharedShaders->compileNamedShader(mainFragShaderName, QGLShader::PartialFragmentShader); - if (hasMask) { - QGLEngineSharedShaders::ShaderName maskShaderName = QGLEngineSharedShaders::InvalidShaderName; if (maskType == PixelMask) { - maskShaderName = QGLEngineSharedShaders::MaskFragmentShader; + requiredProgram.maskFragShader = QGLEngineSharedShaders::MaskFragmentShader; texCoords = true; } else if (maskType == SubPixelMaskPass1) { - maskShaderName = QGLEngineSharedShaders::RgbMaskFragmentShaderPass1; + requiredProgram.maskFragShader = QGLEngineSharedShaders::RgbMaskFragmentShaderPass1; texCoords = true; } else if (maskType == SubPixelMaskPass2) { - maskShaderName = QGLEngineSharedShaders::RgbMaskFragmentShaderPass2; + requiredProgram.maskFragShader = QGLEngineSharedShaders::RgbMaskFragmentShaderPass2; texCoords = true; } else if (maskType == SubPixelWithGammaMask) { - maskShaderName = QGLEngineSharedShaders::RgbMaskWithGammaFragmentShader; + requiredProgram.maskFragShader = QGLEngineSharedShaders::RgbMaskWithGammaFragmentShader; texCoords = true; } else { qCritical("QGLEngineShaderManager::useCorrectShaderProg() - Unknown mask type"); } - - requiredProgram.maskFragShader = sharedShaders->compileNamedShader(maskShaderName, QGLShader::PartialFragmentShader); } else { requiredProgram.maskFragShader = 0; } if (hasCompose) { - QGLEngineSharedShaders::ShaderName compositionShaderName = QGLEngineSharedShaders::InvalidShaderName; switch (compositionMode) { case QPainter::CompositionMode_Multiply: - compositionShaderName = QGLEngineSharedShaders::MultiplyCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::MultiplyCompositionModeFragmentShader; break; case QPainter::CompositionMode_Screen: - compositionShaderName = QGLEngineSharedShaders::ScreenCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::ScreenCompositionModeFragmentShader; break; case QPainter::CompositionMode_Overlay: - compositionShaderName = QGLEngineSharedShaders::OverlayCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::OverlayCompositionModeFragmentShader; break; case QPainter::CompositionMode_Darken: - compositionShaderName = QGLEngineSharedShaders::DarkenCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::DarkenCompositionModeFragmentShader; break; case QPainter::CompositionMode_Lighten: - compositionShaderName = QGLEngineSharedShaders::LightenCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::LightenCompositionModeFragmentShader; break; case QPainter::CompositionMode_ColorDodge: - compositionShaderName = QGLEngineSharedShaders::ColorDodgeCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::ColorDodgeCompositionModeFragmentShader; break; case QPainter::CompositionMode_ColorBurn: - compositionShaderName = QGLEngineSharedShaders::ColorBurnCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::ColorBurnCompositionModeFragmentShader; break; case QPainter::CompositionMode_HardLight: - compositionShaderName = QGLEngineSharedShaders::HardLightCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::HardLightCompositionModeFragmentShader; break; case QPainter::CompositionMode_SoftLight: - compositionShaderName = QGLEngineSharedShaders::SoftLightCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::SoftLightCompositionModeFragmentShader; break; case QPainter::CompositionMode_Difference: - compositionShaderName = QGLEngineSharedShaders::DifferenceCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::DifferenceCompositionModeFragmentShader; break; case QPainter::CompositionMode_Exclusion: - compositionShaderName = QGLEngineSharedShaders::ExclusionCompositionModeFragmentShader; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::ExclusionCompositionModeFragmentShader; break; default: qWarning("QGLEngineShaderManager::useCorrectShaderProg() - Unsupported composition mode"); } - requiredProgram.compositionFragShader = sharedShaders->compileNamedShader(compositionShaderName, QGLShader::PartialFragmentShader); } else { requiredProgram.compositionFragShader = 0; } - // Choose vertex shader main function - QGLEngineSharedShaders::ShaderName mainVertexShaderName = QGLEngineSharedShaders::InvalidShaderName; + // Choose vertex shader main function if (opacityMode == AttributeOpacity) { Q_ASSERT(texCoords); - mainVertexShaderName = QGLEngineSharedShaders::MainWithTexCoordsAndOpacityVertexShader; + requiredProgram.mainVertexShader = QGLEngineSharedShaders::MainWithTexCoordsAndOpacityVertexShader; } else if (texCoords) { - mainVertexShaderName = QGLEngineSharedShaders::MainWithTexCoordsVertexShader; + requiredProgram.mainVertexShader = QGLEngineSharedShaders::MainWithTexCoordsVertexShader; } else { - mainVertexShaderName = QGLEngineSharedShaders::MainVertexShader; + requiredProgram.mainVertexShader = QGLEngineSharedShaders::MainVertexShader; } - requiredProgram.mainVertexShader = sharedShaders->compileNamedShader(mainVertexShaderName, QGLShader::PartialVertexShader); requiredProgram.useTextureCoords = texCoords; requiredProgram.useOpacityAttribute = (opacityMode == AttributeOpacity); - // At this point, requiredProgram is fully populated so try to find the program in the cache currentShaderProg = sharedShaders->findProgramInCache(requiredProgram); diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index 291d24c..e4f7aa6 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -234,14 +234,16 @@ QT_BEGIN_NAMESPACE QT_MODULE(OpenGL) + struct QGLEngineShaderProg { - QGLShader* mainVertexShader; - QGLShader* positionVertexShader; - QGLShader* mainFragShader; - QGLShader* srcPixelFragShader; - QGLShader* maskFragShader; // Can be null for no mask - QGLShader* compositionFragShader; // Can be null for GL-handled mode + int mainVertexShader; + int positionVertexShader; + int mainFragShader; + int srcPixelFragShader; + int maskFragShader; + int compositionFragShader; + QByteArray customStageSource; //TODO: Decent cache key for custom stages QGLShaderProgram* program; QVector uniformLocations; @@ -256,7 +258,8 @@ struct QGLEngineShaderProg mainFragShader == other.mainFragShader && srcPixelFragShader == other.srcPixelFragShader && maskFragShader == other.maskFragShader && - compositionFragShader == other.compositionFragShader + compositionFragShader == other.compositionFragShader && + customStageSource == other.customStageSource ); } }; @@ -344,33 +347,44 @@ public: TotalShaderCount, InvalidShaderName }; +#if defined (QT_DEBUG) + Q_ENUMS(ShaderName) +#endif - QGLEngineSharedShaders(const QGLContext *context); +/* + // These allow the ShaderName enum to be used as a cache key + const int mainVertexOffset = 0; + const int positionVertexOffset = (1<<2) - PositionOnlyVertexShader; + const int mainFragOffset = (1<<6) - MainFragmentShader_CMO; + const int srcPixelOffset = (1<<10) - ImageSrcFragmentShader; + const int maskOffset = (1<<14) - NoMaskShader; + const int compositionOffset = (1 << 16) - MultiplyCompositionModeFragmentShader; +*/ - QGLShader *compileNamedShader(ShaderName name, QGLShader::ShaderType type); + QGLEngineSharedShaders(const QGLContext *context); QGLShaderProgram *simpleProgram() { return simpleShaderProg; } QGLShaderProgram *blitProgram() { return blitShaderProg; } // Compile the program if it's not already in the cache, return the item in the cache. QGLEngineShaderProg *findProgramInCache(const QGLEngineShaderProg &prog); // Compile the custom shader if it's not already in the cache, return the item in the cache. - QGLShader *compileCustomShader(QGLCustomShaderStage *stage, QGLShader::ShaderType type); static QGLEngineSharedShaders *shadersForContext(const QGLContext *context); + // Ideally, this would be static and cleanup all programs in all contexts which + // contain the custom code. Currently it is just a hint and we rely on deleted + // custom shaders being cleaned up by being kicked out of the cache when it's + // full. + void cleanupCustomStage(QGLCustomShaderStage* stage); + signals: void shaderProgNeedsChanging(); -private slots: - void shaderDestroyed(QObject *shader); - private: QGLSharedResourceGuard ctxGuard; QGLShaderProgram *blitShaderProg; QGLShaderProgram *simpleShaderProg; QList cachedPrograms; - QCache customShaderCache; - QGLShader* compiledShaders[TotalShaderCount]; static const char* qglEngineShaderSourceCode[TotalShaderCount]; }; @@ -426,7 +440,7 @@ public: void setMaskType(MaskType); void setCompositionMode(QPainter::CompositionMode); void setCustomStage(QGLCustomShaderStage* stage); - void removeCustomStage(QGLCustomShaderStage* stage); + void removeCustomStage(); uint getUniformLocation(Uniform id); @@ -437,19 +451,7 @@ public: QGLShaderProgram* simpleProgram(); // Used to draw into e.g. stencil buffers QGLShaderProgram* blitProgram(); // Used to blit a texture into the framebuffer -/* - // These allow the ShaderName enum to be used as a cache key - const int mainVertexOffset = 0; - const int positionVertexOffset = (1<<2) - PositionOnlyVertexShader; - const int mainFragOffset = (1<<6) - MainFragmentShader_CMO; - const int srcPixelOffset = (1<<10) - ImageSrcFragmentShader; - const int maskOffset = (1<<14) - NoMaskShader; - const int compositionOffset = (1 << 16) - MultiplyCompositionModeFragmentShader; -*/ - -#if defined (QT_DEBUG) - Q_ENUMS(ShaderName) -#endif + QGLEngineSharedShaders* sharedShaders; private slots: void shaderProgNeedsChangingSlot() { shaderProgNeedsChanging = true; } @@ -466,9 +468,7 @@ private: QPainter::CompositionMode compositionMode; QGLCustomShaderStage* customSrcStage; - QGLEngineShaderProg* currentShaderProg; - QGLEngineSharedShaders *sharedShaders; - QGLShader *customShader; + QGLEngineShaderProg* currentShaderProg; }; QT_END_NAMESPACE -- cgit v0.12 From a8d1c0a7137b2d1f7ca74a24321cea41428ce0bd Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Mon, 26 Oct 2009 15:57:22 +0100 Subject: Rename qglEngineShaderSourceCode to qShaderSnippets This patch also adds a "snippetNameStr" helper for debugging. --- .../gl2paintengineex/qglengineshadermanager.cpp | 86 ++++++++++++---------- .../gl2paintengineex/qglengineshadermanager_p.h | 78 +++++++++++--------- 2 files changed, 93 insertions(+), 71 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index 9dc2b53..be0e98a 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -66,7 +66,7 @@ QGLEngineSharedShaders *QGLEngineSharedShaders::shadersForContext(const QGLConte return p; } -const char* QGLEngineSharedShaders::qglEngineShaderSourceCode[] = { +const char* QGLEngineSharedShaders::qShaderSnippets[] = { 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, @@ -85,10 +85,10 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) around without having to change the order of the glsl strings. It is hoped this will make future hard-to-find runtime bugs more obvious and generally give more solid code. */ - static bool qglEngineShaderSourceCodePopulated = false; - if (!qglEngineShaderSourceCodePopulated) { + static bool snippetsPopulated = false; + if (!snippetsPopulated) { - const char** code = qglEngineShaderSourceCode; // shortcut + const char** code = qShaderSnippets; // shortcut code[MainVertexShader] = qglslMainVertexShader; code[MainWithTexCoordsVertexShader] = qglslMainWithTexCoordsVertexShader; @@ -130,11 +130,13 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) code[ConicalGradientBrushSrcFragmentShader] = qglslConicalGradientBrushSrcFragmentShader; code[ShockingPinkSrcFragmentShader] = qglslShockingPinkSrcFragmentShader; + code[NoMaskFragmentShader] = ""; code[MaskFragmentShader] = qglslMaskFragmentShader; code[RgbMaskFragmentShaderPass1] = qglslRgbMaskFragmentShaderPass1; code[RgbMaskFragmentShaderPass2] = qglslRgbMaskFragmentShaderPass2; code[RgbMaskWithGammaFragmentShader] = ""; //### + code[NoCompositionModeFragmentShader] = ""; code[MultiplyCompositionModeFragmentShader] = ""; //### code[ScreenCompositionModeFragmentShader] = ""; //### code[OverlayCompositionModeFragmentShader] = ""; //### @@ -149,17 +151,19 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) #if defined(QT_DEBUG) // Check that all the elements have been filled: - for (int i = 0; i < TotalShaderCount; ++i) { - if (qglEngineShaderSourceCode[i] == 0) { - int enumIndex = staticMetaObject.indexOfEnumerator("ShaderName"); - QMetaEnum m = staticMetaObject.enumerator(enumIndex); - - qCritical() << "qglEngineShaderSourceCode: Source for" << m.valueToKey(i) - << "(shader" << i << ") missing!"; + for (int i = 0; i < TotalSnippetCount; ++i) { + if (qShaderSnippets[i] == 0) { + QByteArray msg; + msg.append("Fatal: Shader Snippet for "); + msg.append(snippetNameStr(SnippetName(i))); + msg.append(" ("); + msg.append(QByteArray::number(i)); + msg.append(") is missing!"); + qFatal(msg.constData()); } } #endif - qglEngineShaderSourceCodePopulated = true; + snippetsPopulated = true; } QGLShader* fragShader; @@ -168,14 +172,14 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) // Compile up the simple shader: source.clear(); - source.append(qglEngineShaderSourceCode[MainVertexShader]); - source.append(qglEngineShaderSourceCode[PositionOnlyVertexShader]); + source.append(qShaderSnippets[MainVertexShader]); + source.append(qShaderSnippets[PositionOnlyVertexShader]); vertexShader = new QGLShader(QGLShader::VertexShader, context, this); vertexShader->compile(source); source.clear(); - source.append(qglEngineShaderSourceCode[MainFragmentShader]); - source.append(qglEngineShaderSourceCode[ShockingPinkSrcFragmentShader]); + source.append(qShaderSnippets[MainFragmentShader]); + source.append(qShaderSnippets[ShockingPinkSrcFragmentShader]); fragShader = new QGLShader(QGLShader::FragmentShader, context, this); fragShader->compile(source); @@ -191,14 +195,14 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) // Compile the blit shader: source.clear(); - source.append(qglEngineShaderSourceCode[MainWithTexCoordsVertexShader]); - source.append(qglEngineShaderSourceCode[UntransformedPositionVertexShader]); + source.append(qShaderSnippets[MainWithTexCoordsVertexShader]); + source.append(qShaderSnippets[UntransformedPositionVertexShader]); vertexShader = new QGLShader(QGLShader::VertexShader, context, this); vertexShader->compile(source); source.clear(); - source.append(qglEngineShaderSourceCode[MainFragmentShader]); - source.append(qglEngineShaderSourceCode[ImageSrcFragmentShader]); + source.append(qShaderSnippets[MainFragmentShader]); + source.append(qShaderSnippets[ImageSrcFragmentShader]); fragShader = new QGLShader(QGLShader::FragmentShader, context, this); fragShader->compile(source); @@ -215,6 +219,14 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) } +#if defined (QT_DEBUG) +QByteArray QGLEngineSharedShaders::snippetNameStr(SnippetName name) +{ + QMetaEnum m = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("SnippetName")); + return QByteArray(m.valueToKey(name)); +} +#endif + // The address returned here will only be valid until next time this function is called. QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineShaderProg &prog) { @@ -225,48 +237,46 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS cachedPrograms.append(prog); QGLEngineShaderProg &cached = cachedPrograms.last(); - QByteArray source; - source.append(qglEngineShaderSourceCode[prog.mainFragShader]); - source.append(qglEngineShaderSourceCode[prog.srcPixelFragShader]); + source.append(qShaderSnippets[prog.mainFragShader]); + source.append(qShaderSnippets[prog.srcPixelFragShader]); if (prog.srcPixelFragShader == CustomImageSrcFragmentShader) source.append(prog.customStageSource); if (prog.compositionFragShader) - source.append(qglEngineShaderSourceCode[prog.compositionFragShader]); + source.append(qShaderSnippets[prog.compositionFragShader]); if (prog.maskFragShader) - source.append(qglEngineShaderSourceCode[prog.maskFragShader]); + source.append(qShaderSnippets[prog.maskFragShader]); QGLShader* fragShader = new QGLShader(QGLShader::FragmentShader, ctxGuard.context(), this); fragShader->compile(source); source.clear(); - source.append(qglEngineShaderSourceCode[prog.mainVertexShader]); - source.append(qglEngineShaderSourceCode[prog.positionVertexShader]); + source.append(qShaderSnippets[prog.mainVertexShader]); + source.append(qShaderSnippets[prog.positionVertexShader]); QGLShader* vertexShader = new QGLShader(QGLShader::VertexShader, ctxGuard.context(), this); vertexShader->compile(source); #if defined(QT_DEBUG) // Name the shaders for easier debugging - QMetaEnum m = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("ShaderName")); QByteArray description; description.append("Fragment shader: main="); - description.append(m.valueToKey(prog.mainFragShader)); + description.append(snippetNameStr(prog.mainFragShader)); description.append(", srcPixel="); - description.append(m.valueToKey(prog.srcPixelFragShader)); + description.append(snippetNameStr(prog.srcPixelFragShader)); if (prog.compositionFragShader) { description.append(", composition="); - description.append(m.valueToKey(prog.compositionFragShader)); + description.append(snippetNameStr(prog.compositionFragShader)); } if (prog.maskFragShader) { description.append(", mask="); - description.append(m.valueToKey(prog.maskFragShader)); + description.append(snippetNameStr(prog.maskFragShader)); } fragShader->setObjectName(QString::fromLatin1(description)); description.clear(); description.append("Vertex shader: main="); - description.append(m.valueToKey(prog.mainVertexShader)); + description.append(snippetNameStr(prog.mainVertexShader)); description.append(", position="); - description.append(m.valueToKey(prog.positionVertexShader)); + description.append(snippetNameStr(prog.positionVertexShader)); vertexShader->setObjectName(QString::fromLatin1(description)); #endif @@ -483,8 +493,8 @@ bool QGLEngineShaderManager::useCorrectShaderProg() // Choose vertex shader shader position function (which typically also sets // varyings) and the source pixel (srcPixel) fragment shader function: - requiredProgram.positionVertexShader = QGLEngineSharedShaders::InvalidShaderName; - requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::InvalidShaderName; + requiredProgram.positionVertexShader = QGLEngineSharedShaders::InvalidSnippetName; + requiredProgram.srcPixelFragShader = QGLEngineSharedShaders::InvalidSnippetName; bool isAffine = brushTransform.isAffine(); if ( (srcPixelType >= Qt::Dense1Pattern) && (srcPixelType <= Qt::DiagCrossPattern) ) { if (isAffine) @@ -594,7 +604,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg() qCritical("QGLEngineShaderManager::useCorrectShaderProg() - Unknown mask type"); } } else { - requiredProgram.maskFragShader = 0; + requiredProgram.maskFragShader = QGLEngineSharedShaders::NoMaskFragmentShader; } if (hasCompose) { @@ -636,7 +646,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg() qWarning("QGLEngineShaderManager::useCorrectShaderProg() - Unsupported composition mode"); } } else { - requiredProgram.compositionFragShader = 0; + requiredProgram.compositionFragShader = QGLEngineSharedShaders::NoCompositionModeFragmentShader; } // Choose vertex shader main function diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index e4f7aa6..fd73b44 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -235,35 +235,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(OpenGL) -struct QGLEngineShaderProg -{ - int mainVertexShader; - int positionVertexShader; - int mainFragShader; - int srcPixelFragShader; - int maskFragShader; - int compositionFragShader; - QByteArray customStageSource; //TODO: Decent cache key for custom stages - QGLShaderProgram* program; - - QVector uniformLocations; - - bool useTextureCoords; - bool useOpacityAttribute; - - bool operator==(const QGLEngineShaderProg& other) { - // We don't care about the program - return ( mainVertexShader == other.mainVertexShader && - positionVertexShader == other.positionVertexShader && - mainFragShader == other.mainFragShader && - srcPixelFragShader == other.srcPixelFragShader && - maskFragShader == other.maskFragShader && - compositionFragShader == other.compositionFragShader && - customStageSource == other.customStageSource - ); - } -}; - /* struct QGLEngineCachedShaderProg { @@ -283,15 +254,19 @@ static const GLuint QT_VERTEX_COORDS_ATTR = 0; static const GLuint QT_TEXTURE_COORDS_ATTR = 1; static const GLuint QT_OPACITY_ATTR = 2; +struct QGLEngineShaderProg; + class QGLEngineSharedShaders : public QObject { Q_OBJECT public: - enum ShaderName { + + enum SnippetName { MainVertexShader, MainWithTexCoordsVertexShader, MainWithTexCoordsAndOpacityVertexShader, + // UntransformedPositionVertexShader must be first in the list: UntransformedPositionVertexShader, PositionOnlyVertexShader, PositionWithPatternBrushVertexShader, @@ -305,6 +280,7 @@ public: AffinePositionWithRadialGradientBrushVertexShader, AffinePositionWithTextureBrushVertexShader, + // MainFragmentShader_CMO must be first in the list: MainFragmentShader_CMO, MainFragmentShader_CM, MainFragmentShader_MO, @@ -315,6 +291,7 @@ public: MainFragmentShader, MainFragmentShader_ImageArrays, + // ImageSrcFragmentShader must be first in the list:: ImageSrcFragmentShader, ImageSrcWithPatternFragmentShader, NonPremultipliedImageSrcFragmentShader, @@ -328,11 +305,15 @@ public: ConicalGradientBrushSrcFragmentShader, ShockingPinkSrcFragmentShader, + // NoMaskFragmentShader must be first in the list: + NoMaskFragmentShader, MaskFragmentShader, RgbMaskFragmentShaderPass1, RgbMaskFragmentShaderPass2, RgbMaskWithGammaFragmentShader, + // NoCompositionModeFragmentShader must be first in the list: + NoCompositionModeFragmentShader, MultiplyCompositionModeFragmentShader, ScreenCompositionModeFragmentShader, OverlayCompositionModeFragmentShader, @@ -345,10 +326,11 @@ public: DifferenceCompositionModeFragmentShader, ExclusionCompositionModeFragmentShader, - TotalShaderCount, InvalidShaderName + TotalSnippetCount, InvalidSnippetName }; #if defined (QT_DEBUG) - Q_ENUMS(ShaderName) + Q_ENUMS(SnippetName) + static QByteArray snippetNameStr(SnippetName snippetName); #endif /* @@ -386,7 +368,37 @@ private: QGLShaderProgram *simpleShaderProg; QList cachedPrograms; - static const char* qglEngineShaderSourceCode[TotalShaderCount]; + static const char* qShaderSnippets[TotalSnippetCount]; +}; + +struct QGLEngineShaderProg +{ + QGLEngineSharedShaders::SnippetName mainVertexShader; + QGLEngineSharedShaders::SnippetName positionVertexShader; + QGLEngineSharedShaders::SnippetName mainFragShader; + QGLEngineSharedShaders::SnippetName srcPixelFragShader; + QGLEngineSharedShaders::SnippetName maskFragShader; + QGLEngineSharedShaders::SnippetName compositionFragShader; + + QByteArray customStageSource; //TODO: Decent cache key for custom stages + QGLShaderProgram* program; + + QVector uniformLocations; + + bool useTextureCoords; + bool useOpacityAttribute; + + bool operator==(const QGLEngineShaderProg& other) { + // We don't care about the program + return ( mainVertexShader == other.mainVertexShader && + positionVertexShader == other.positionVertexShader && + mainFragShader == other.mainFragShader && + srcPixelFragShader == other.srcPixelFragShader && + maskFragShader == other.maskFragShader && + compositionFragShader == other.compositionFragShader && + customStageSource == other.customStageSource + ); + } }; class Q_OPENGL_EXPORT QGLEngineShaderManager : public QObject -- cgit v0.12 From 90567274b900b22ab6b1c016ee66b7915aa994c8 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Fri, 30 Oct 2009 12:38:00 +0100 Subject: Implement a simple caching algorithm for shader programs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the number of programs held in the cache exceeds a threshold, the least frequantly used programs get deleted. This also covers programs with custom snippets of code. As a conequence, when a QGLCustomShaderStage gets deleted, any programs using that code will (eventually) be freed. Reviewed-By: Samuel Rødal --- .../gl2paintengineex/qglengineshadermanager.cpp | 71 +++++++++++++--------- .../gl2paintengineex/qglengineshadermanager_p.h | 13 +++- 2 files changed, 53 insertions(+), 31 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index be0e98a..34c448f 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -231,12 +231,14 @@ QByteArray QGLEngineSharedShaders::snippetNameStr(SnippetName name) QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineShaderProg &prog) { for (int i = 0; i < cachedPrograms.size(); ++i) { - if (cachedPrograms[i] == prog) - return &cachedPrograms[i]; + QGLEngineShaderProg *cachedProg = cachedPrograms[i]; + if (*cachedProg == prog) { + // Move the program to the top of the list as a poor-man's cache algo + cachedPrograms.move(i, 0); + return cachedProg; + } } - cachedPrograms.append(prog); - QGLEngineShaderProg &cached = cachedPrograms.last(); QByteArray source; source.append(qShaderSnippets[prog.mainFragShader]); source.append(qShaderSnippets[prog.srcPixelFragShader]); @@ -280,20 +282,22 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS vertexShader->setObjectName(QString::fromLatin1(description)); #endif + QGLEngineShaderProg* newProg = new QGLEngineShaderProg(prog); + // If the shader program's not found in the cache, create it now. - cached.program = new QGLShaderProgram(ctxGuard.context(), this); - cached.program->addShader(vertexShader); - cached.program->addShader(fragShader); + newProg->program = new QGLShaderProgram(ctxGuard.context(), this); + newProg->program->addShader(vertexShader); + newProg->program->addShader(fragShader); // We have to bind the vertex attribute names before the program is linked: - cached.program->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); - if (cached.useTextureCoords) - cached.program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR); - if (cached.useOpacityAttribute) - cached.program->bindAttributeLocation("opacityArray", QT_OPACITY_ATTR); - - cached.program->link(); - if (!cached.program->isLinked()) { + newProg->program->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR); + if (newProg->useTextureCoords) + newProg->program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR); + if (newProg->useOpacityAttribute) + newProg->program->bindAttributeLocation("opacityArray", QT_OPACITY_ATTR); + + newProg->program->link(); + if (!newProg->program->isLinked()) { QLatin1String none("none"); QLatin1String br("\n"); QString error; @@ -307,32 +311,42 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS + QLatin1String(fragShader->sourceCode()) + br #endif + QLatin1String(" Error Log:\n") - + QLatin1String(" ") + cached.program->log(); + + QLatin1String(" ") + newProg->program->log(); qWarning() << error; - delete cached.program; - cachedPrograms.removeLast(); - return 0; - } else { - // taking the address here is safe since - // cachePrograms isn't resized anywhere else - return &cached; + delete newProg; // Deletes the QGLShaderProgram in it's destructor + newProg = 0; } -} + else { + if (cachedPrograms.count() > 30) { + // The cache is full, so delete the last 5 programs in the list. + // These programs will be least used, as a program us bumped to + // the top of the list when it's used. + for (int i = 0; i < 5; ++i) { + delete cachedPrograms.last(); + cachedPrograms.removeLast(); + } + } + cachedPrograms.insert(0, newProg); + } + + return newProg; +} void QGLEngineSharedShaders::cleanupCustomStage(QGLCustomShaderStage* stage) { // Remove any shader programs which has this as the custom shader src: for (int i = 0; i < cachedPrograms.size(); ++i) { - if (cachedPrograms.at(i).customStageSource == stage->source()) { - delete cachedPrograms.at(i).program; - cachedPrograms.removeAt(i--); + QGLEngineShaderProg *cachedProg = cachedPrograms[i]; + if (cachedProg->customStageSource == stage->source()) { + delete cachedProg; + cachedPrograms.removeAt(i); + i--; } } } - QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context) : ctx(context), shaderProgNeedsChanging(true), @@ -487,7 +501,6 @@ bool QGLEngineShaderManager::useCorrectShaderProg() } QGLEngineShaderProg requiredProgram; - requiredProgram.program = 0; bool texCoords = false; diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index fd73b44..59e50d0 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -366,13 +366,22 @@ private: QGLSharedResourceGuard ctxGuard; QGLShaderProgram *blitShaderProg; QGLShaderProgram *simpleShaderProg; - QList cachedPrograms; + QList cachedPrograms; static const char* qShaderSnippets[TotalSnippetCount]; }; -struct QGLEngineShaderProg + +class QGLEngineShaderProg { +public: + QGLEngineShaderProg() : program(0) {} + + ~QGLEngineShaderProg() { + if (program) + delete program; + } + QGLEngineSharedShaders::SnippetName mainVertexShader; QGLEngineSharedShaders::SnippetName positionVertexShader; QGLEngineSharedShaders::SnippetName mainFragShader; -- cgit v0.12 From fad40eb6261ca72cda438c06dccebfc49e8d0a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 30 Oct 2009 14:34:18 +0100 Subject: Fix some test failures in the qgl test on 16 bit servers. These tests are designed to run in 24 or 32 bit mode, and won't work unless they do.. Reviewed-by: Samuel --- tests/auto/qgl/tst_qgl.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index e036e4b..e9f0476 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -118,6 +118,16 @@ public: void setAutoBufferSwap(bool on) { QGLWidget::setAutoBufferSwap(on); } }; +static int appDefaultDepth() +{ + static int depth = 0; + if (depth == 0) { + QPixmap pm(1, 1); + depth = pm.depth(); + } + return depth; +} + // Using INT_MIN and INT_MAX will cause failures on systems // where "int" is 64-bit, so use the explicit values instead. #define TEST_INT_MIN (-2147483647 - 1) @@ -714,6 +724,8 @@ public: void tst_QGL::graphicsViewClipping() { + if (appDefaultDepth() < 24) + QSKIP("This test won't work for bit depths < 24", SkipAll); const int size = 64; UnclippedWidget *widget = new UnclippedWidget; widget->setFixedSize(size, size); @@ -866,6 +878,8 @@ public: void tst_QGL::glWidgetRendering() { + if (appDefaultDepth() < 24) + QSKIP("This test won't work for bit depths < 24", SkipAll); GLWidget w; w.show(); @@ -1089,6 +1103,8 @@ protected: void tst_QGL::glFBOUseInGLWidget() { + if (appDefaultDepth() < 24) + QSKIP("This test won't work for bit depths < 24", SkipAll); if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle); @@ -1116,6 +1132,8 @@ void tst_QGL::glFBOUseInGLWidget() void tst_QGL::glWidgetReparent() { + if (appDefaultDepth() < 24) + QSKIP("This test won't work for bit depths < 24", SkipAll); // Try it as a top-level first: GLWidget *widget = new GLWidget; widget->setGeometry(0, 0, 200, 30); @@ -1582,6 +1600,8 @@ protected: void tst_QGL::replaceClipping() { + if (appDefaultDepth() < 24) + QSKIP("This test won't work for bit depths < 24", SkipAll); ReplaceClippingGLWidget glw; glw.resize(300, 300); glw.show(); @@ -1707,6 +1727,8 @@ protected: void tst_QGL::clipTest() { + if (appDefaultDepth() < 24) + QSKIP("This test won't work for bit depths < 24", SkipAll); ClipTestGLWidget glw; glw.resize(220, 220); glw.show(); -- cgit v0.12 From 42342c76c86a368b78c55fefc28c4bca1c010d03 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 29 Oct 2009 22:22:32 +0100 Subject: Make Linguist on Mac use the unified toolbar, like Assistant. Reviewed-By: Oswald Buddenhagen --- tools/linguist/linguist/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp index 9bc6641..7f09a1c 100644 --- a/tools/linguist/linguist/mainwindow.cpp +++ b/tools/linguist/linguist/mainwindow.cpp @@ -269,6 +269,7 @@ MainWindow::MainWindow() m_editActiveModel(-1), m_statistics(0) { + setUnifiedTitleAndToolBarOnMac(true); m_ui.setupUi(this); #ifndef Q_WS_MAC -- cgit v0.12 From 0e02c54e7e56ee091aeeb6342faa2df163fbbd74 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 2 Nov 2009 07:51:09 +1000 Subject: Remove partial shader support from QGLShader/QGLShaderProgram Reviewed-by: trustme --- src/opengl/qglshaderprogram.cpp | 182 ++-------------------------------------- src/opengl/qglshaderprogram.h | 9 +- 2 files changed, 6 insertions(+), 185 deletions(-) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 90b496e..080c3b2 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -106,30 +106,6 @@ QT_BEGIN_NAMESPACE \snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 2 - \section1 Partial shaders - - Desktop GLSL can attach an arbitrary number of vertex and fragment - shaders to a shader program. Embedded GLSL/ES on the other hand - supports only a single shader of each type on a shader program. - - Multiple shaders of the same type can be useful when large libraries - of shaders are needed. Common functions can be factored out into - library shaders that can be reused in multiple shader programs. - - To support this use of shaders, the application programmer can - create shaders with the QGLShader::PartialVertexShader and - QGLShader::PartialFragmentShader types. These types direct - QGLShader and QGLShaderProgram to delay shader compilation until - link time. - - When link() is called, the sources for the partial shaders are - concatenated, and a single vertex or fragment shader is compiled - and linked into the shader program. - - It is more efficient to use the QGLShader::VertexShader and - QGLShader::FragmentShader when there is only one shader of that - type in the program. - \sa QGLShader */ @@ -154,11 +130,6 @@ QT_BEGIN_NAMESPACE \value VertexShader Vertex shader written in the OpenGL Shading Language (GLSL). \value FragmentShader Fragment shader written in the OpenGL Shading Language (GLSL). - - \value PartialVertexShader Partial vertex shader that will be concatenated with all other partial vertex shaders at link time. - \value PartialFragmentShader Partial fragment shader that will be concatenated with all other partial fragment shaders at link time. - - \omitvalue PartialShader */ #ifndef GL_FRAGMENT_SHADER @@ -209,8 +180,6 @@ public: : shaderGuard(context) , shaderType(type) , compiled(false) - , isPartial((type & QGLShader::PartialShader) != 0) - , hasPartialSource(false) { } ~QGLShaderPrivate(); @@ -218,10 +187,7 @@ public: QGLSharedResourceGuard shaderGuard; QGLShader::ShaderType shaderType; bool compiled; - bool isPartial; - bool hasPartialSource; QString log; - QByteArray partialSource; bool create(); bool compile(QGLShader *q); @@ -243,8 +209,6 @@ bool QGLShaderPrivate::create() const QGLContext *context = shaderGuard.context(); if (!context) return false; - if (isPartial) - return true; if (qt_resolve_glsl_extensions(const_cast(context))) { GLuint shader; if (shaderType == QGLShader::VertexShader) @@ -264,11 +228,6 @@ bool QGLShaderPrivate::create() bool QGLShaderPrivate::compile(QGLShader *q) { - // Partial shaders are compiled during QGLShaderProgram::link(). - if (isPartial && hasPartialSource) { - compiled = true; - return true; - } GLuint shader = shaderGuard.id(); if (!shader) return false; @@ -441,21 +400,12 @@ static const char redefineHighp[] = Sets the \a source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise. - If shaderType() is PartialVertexShader or PartialFragmentShader, - then this function will always return true, even if the source code - is invalid. Partial shaders are compiled when QGLShaderProgram::link() - is called. - \sa compileFile() */ bool QGLShader::compile(const char *source) { Q_D(QGLShader); - if (d->isPartial) { - d->partialSource = QByteArray(source); - d->hasPartialSource = true; - return d->compile(this); - } else if (d->shaderGuard.id()) { + if (d->shaderGuard.id()) { QVarLengthArray src; QVarLengthArray srclen; int headerLen = 0; @@ -481,8 +431,7 @@ bool QGLShader::compile(const char *source) srclen.append(GLint(sizeof(qualifierDefines) - 1)); #endif #ifdef QGL_REDEFINE_HIGHP - if (d->shaderType == FragmentShader || - d->shaderType == PartialFragmentShader) { + if (d->shaderType == FragmentShader) { src.append(redefineHighp); srclen.append(GLint(sizeof(redefineHighp) - 1)); } @@ -497,71 +446,11 @@ bool QGLShader::compile(const char *source) } /*! - \internal -*/ -bool QGLShader::compile - (const QList& shaders, QGLShader::ShaderType type) -{ - Q_D(QGLShader); - QVarLengthArray src; - QVarLengthArray srclen; - if (!d->shaderGuard.id()) - return false; - foreach (QGLShader *shader, shaders) { - if (shader->shaderType() != type) - continue; - const char *source = shader->d_func()->partialSource.constData(); - int headerLen = 0; - if (src.isEmpty()) { - // First shader: handle the #version and #extension tags - // plus the precision qualifiers. - while (source && source[headerLen] == '#') { - // Skip #version and #extension directives at the start of - // the shader code. We need to insert the qualifierDefines - // and redefineHighp just after them. - if (qstrncmp(source + headerLen, "#version", 8) != 0 && - qstrncmp(source + headerLen, "#extension", 10) != 0) { - break; - } - while (source[headerLen] != '\0' && source[headerLen] != '\n') - ++headerLen; - if (source[headerLen] == '\n') - ++headerLen; - } - if (headerLen > 0) { - src.append(source); - srclen.append(GLint(headerLen)); - } -#ifdef QGL_DEFINE_QUALIFIERS - src.append(qualifierDefines); - srclen.append(GLint(sizeof(qualifierDefines) - 1)); -#endif -#ifdef QGL_REDEFINE_HIGHP - if (d->shaderType == FragmentShader || - d->shaderType == PartialFragmentShader) { - src.append(redefineHighp); - srclen.append(GLint(sizeof(redefineHighp) - 1)); - } -#endif - } - src.append(source + headerLen); - srclen.append(GLint(qstrlen(source + headerLen))); - } - glShaderSource(d->shaderGuard.id(), src.size(), src.data(), srclen.data()); - return d->compile(this); -} - -/*! \overload Sets the \a source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise. - If shaderType() is PartialVertexShader or PartialFragmentShader, - then this function will always return true, even if the source code - is invalid. Partial shaders are compiled when QGLShaderProgram::link() - is called. - \sa compileFile() */ bool QGLShader::compile(const QByteArray& source) @@ -575,11 +464,6 @@ bool QGLShader::compile(const QByteArray& source) Sets the \a source code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise. - If shaderType() is PartialVertexShader or PartialFragmentShader, - then this function will always return true, even if the source code - is invalid. Partial shaders are compiled when QGLShaderProgram::link() - is called. - \sa compileFile() */ bool QGLShader::compile(const QString& source) @@ -592,11 +476,6 @@ bool QGLShader::compile(const QString& source) and compiles it. Returns true if the file could be opened and the source compiled, false otherwise. - If shaderType() is PartialVertexShader or PartialFragmentShader, - then this function will always return true, even if the source code - is invalid. Partial shaders are compiled when QGLShaderProgram::link() - is called. - \sa compile() */ bool QGLShader::compileFile(const QString& fileName) @@ -619,8 +498,6 @@ bool QGLShader::compileFile(const QString& fileName) QByteArray QGLShader::sourceCode() const { Q_D(const QGLShader); - if (d->isPartial) - return d->partialSource; GLuint shader = d->shaderGuard.id(); if (!shader) return QByteArray(); @@ -661,10 +538,6 @@ QString QGLShader::log() const /*! Returns the OpenGL identifier associated with this shader. - If shaderType() is PartialVertexShader or PartialFragmentShader, - this function will always return zero. Partial shaders are - created and compiled when QGLShaderProgram::link() is called. - \sa QGLShaderProgram::programId() */ GLuint QGLShader::shaderId() const @@ -684,7 +557,6 @@ public: : programGuard(context) , linked(false) , inited(false) - , hasPartialShaders(false) , removingShaders(false) , vertexShader(0) , fragmentShader(0) @@ -695,7 +567,6 @@ public: QGLSharedResourceGuard programGuard; bool linked; bool inited; - bool hasPartialShaders; bool removingShaders; QString log; QList shaders; @@ -812,13 +683,9 @@ bool QGLShaderProgram::addShader(QGLShader *shader) } if (!shader->d_func()->compiled) return false; - if (!shader->d_func()->isPartial) { - if (!shader->d_func()->shaderGuard.id()) - return false; - glAttachShader(d->programGuard.id(), shader->d_func()->shaderGuard.id()); - } else { - d->hasPartialShaders = true; - } + if (!shader->d_func()->shaderGuard.id()) + return false; + glAttachShader(d->programGuard.id(), shader->d_func()->shaderGuard.id()); d->linked = false; // Program needs to be relinked. d->shaders.append(shader); connect(shader, SIGNAL(destroyed()), this, SLOT(shaderDestroyed())); @@ -999,45 +866,6 @@ bool QGLShaderProgram::link() GLuint program = d->programGuard.id(); if (!program) return false; - if (d->hasPartialShaders) { - // Compile the partial vertex and fragment shaders. - if (d->hasShader(QGLShader::PartialVertexShader)) { - if (!d->vertexShader) { - d->vertexShader = - new QGLShader(QGLShader::VertexShader, this); - } - if (!d->vertexShader->compile - (d->shaders, QGLShader::PartialVertexShader)) { - d->log = d->vertexShader->log(); - return false; - } - glAttachShader(program, d->vertexShader->d_func()->shaderGuard.id()); - } else { - if (d->vertexShader) { - glDetachShader(program, d->vertexShader->d_func()->shaderGuard.id()); - delete d->vertexShader; - d->vertexShader = 0; - } - } - if (d->hasShader(QGLShader::PartialFragmentShader)) { - if (!d->fragmentShader) { - d->fragmentShader = - new QGLShader(QGLShader::FragmentShader, this); - } - if (!d->fragmentShader->compile - (d->shaders, QGLShader::PartialFragmentShader)) { - d->log = d->fragmentShader->log(); - return false; - } - glAttachShader(program, d->fragmentShader->d_func()->shaderGuard.id()); - } else { - if (d->fragmentShader) { - glDetachShader(program, d->fragmentShader->d_func()->shaderGuard.id()); - delete d->fragmentShader; - d->fragmentShader = 0; - } - } - } glLinkProgram(program); GLint value = 0; glGetProgramiv(program, GL_LINK_STATUS, &value); diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 708cf09..b7bd2d7 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -66,12 +66,7 @@ public: enum ShaderTypeBits { VertexShader = 0x0001, - FragmentShader = 0x0002, - - PartialShader = 0x1000, - - PartialVertexShader = PartialShader | VertexShader, - PartialFragmentShader = PartialShader | FragmentShader + FragmentShader = 0x0002 }; Q_DECLARE_FLAGS(ShaderType, ShaderTypeBits) @@ -100,8 +95,6 @@ private: Q_DISABLE_COPY(QGLShader) Q_DECLARE_PRIVATE(QGLShader) - - bool compile(const QList& shaders, QGLShader::ShaderType type); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGLShader::ShaderType) -- cgit v0.12 From 9f2a0c09a90daa46b7432037595b750406bbd506 Mon Sep 17 00:00:00 2001 From: Peter Yard Date: Mon, 2 Nov 2009 11:44:21 +1000 Subject: Added documentation of RPATH defines. --- doc/src/development/qmake-manual.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 6c53242..352db75 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2342,6 +2342,8 @@ For example: \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. \section1 QMAKE_LFLAGS_RPATH + + \e {This is used on Unix platforms only.} Library paths in this definition are added to the executable at link time so that the added paths will be preferentially searched at runtime. @@ -2673,11 +2675,15 @@ For example: \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 45 \section1 QMAKE_RPATH + + \e {This is used on Unix platforms only.} Is equivalent to \l QMAKE_LFLAGS_RPATH. \section1 QMAKE_RPATHDIR + \e {This is used on Unix platforms only.} + A list of library directory paths, these paths are added to the executable at link time so that the paths will be preferentially searched at runtime. -- cgit v0.12 From 17cda5c55273813cbedcced3a511f1c222978182 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 2 Nov 2009 10:51:08 +0100 Subject: Check for null pixmap Reviewed-by: Trond --- src/gui/painting/qwindowsurface_x11.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp index 46c4c42..77e019c 100644 --- a/src/gui/painting/qwindowsurface_x11.cpp +++ b/src/gui/painting/qwindowsurface_x11.cpp @@ -94,6 +94,8 @@ QPaintDevice *QX11WindowSurface::paintDevice() void QX11WindowSurface::beginPaint(const QRegion &rgn) { #ifndef QT_NO_XRENDER + Q_ASSERT(!d_ptr->device.isNull()); + if (d_ptr->translucentBackground) { if (d_ptr->device.depth() != 32) static_cast(d_ptr->device.data_ptr().data())->convertToARGB32(); @@ -157,8 +159,8 @@ void QX11WindowSurface::setGeometry(const QRect &rect) QPixmap::x11SetDefaultScreen(d_ptr->widget->x11Info().screen()); QX11PixmapData *oldData = static_cast(d_ptr->device.pixmapData()); - Q_ASSERT(oldData); - if (!(oldData->flags & QX11PixmapData::Uninitialized) && hasStaticContents()) { + + if (oldData && !(oldData->flags & QX11PixmapData::Uninitialized) && hasStaticContents()) { // Copy the content of the old pixmap into the new one. QX11PixmapData *newData = new QX11PixmapData(QPixmapData::PixmapType); newData->resize(size.width(), size.height()); -- cgit v0.12 From 85e41590732f15cec16909bf1121d944ae684373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 30 Oct 2009 13:37:05 +0100 Subject: Optimized graphics effects to not needlessly invalidate cache. When the effect rect changes we only need to invalidate the cache if the mode is ExpandToEffectRectPadMode. Reviewed-by: Gunnar Sletta --- src/gui/effects/qgraphicseffect.cpp | 9 ++++++++- src/gui/effects/qgraphicseffect_p.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 3a6bab5..c8e39da 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -279,6 +279,13 @@ QPixmap QGraphicsEffectSource::pixmap(Qt::CoordinateSystem system, QPoint *offse return pm; } +void QGraphicsEffectSourcePrivate::invalidateCache(bool effectRectChanged) const +{ + if (effectRectChanged && m_cachedMode != QGraphicsEffectSource::ExpandToEffectRectPadMode) + return; + QPixmapCache::remove(m_cacheKey); +} + /*! Constructs a new QGraphicsEffect instance having the specified \a parent. @@ -418,7 +425,7 @@ void QGraphicsEffect::updateBoundingRect() Q_D(QGraphicsEffect); if (d->source) { d->source->d_func()->effectBoundingRectChanged(); - d->source->d_func()->invalidateCache(); + d->source->d_func()->invalidateCache(true); } } diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index 1ed7103..0ff5794 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -85,7 +85,7 @@ public: virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0, QGraphicsEffectSource::PixmapPadMode mode = QGraphicsEffectSource::ExpandToTransparentBorderPadMode) const = 0; virtual void effectBoundingRectChanged() = 0; - void invalidateCache() const { QPixmapCache::remove(m_cacheKey); } + void invalidateCache(bool effectRectChanged = false) const; friend class QGraphicsScenePrivate; friend class QGraphicsItem; -- cgit v0.12 From 70b7f26c3155e83d59cae7b89ed1af3b57797a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 30 Oct 2009 13:59:41 +0100 Subject: Added strict size parameter to QGLFramebufferObject pool. The strict size parameter can be used when it's critical that we get the exact size we ask for. Reviewed-by: Gunnar Sletta --- src/opengl/qpixmapdata_gl.cpp | 19 ++++++++++++++++--- src/opengl/qpixmapdata_gl_p.h | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index c965947..5ca37ef 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -89,13 +89,22 @@ static inline QSize maybeRoundToNextPowerOfTwo(const QSize &sz) } -QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize, const QGLFramebufferObjectFormat &requestFormat) +QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize, const QGLFramebufferObjectFormat &requestFormat, bool strictSize) { QGLFramebufferObject *chosen = 0; QGLFramebufferObject *candidate = 0; for (int i = 0; !chosen && i < m_fbos.size(); ++i) { QGLFramebufferObject *fbo = m_fbos.at(i); + if (strictSize) { + if (fbo->size() == requestSize && fbo->format() == requestFormat) { + chosen = fbo; + break; + } else { + continue; + } + } + if (fbo->format() == requestFormat) { // choose the fbo with a matching format and the closest size if (!candidate || areaDiff(requestSize, candidate) > areaDiff(requestSize, fbo)) @@ -127,7 +136,10 @@ QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize } if (!chosen) { - chosen = new QGLFramebufferObject(maybeRoundToNextPowerOfTwo(requestSize), requestFormat); + if (strictSize) + chosen = new QGLFramebufferObject(requestSize, requestFormat); + else + chosen = new QGLFramebufferObject(maybeRoundToNextPowerOfTwo(requestSize), requestFormat); } if (!chosen->isValid()) { @@ -140,7 +152,8 @@ QGLFramebufferObject *QGLFramebufferObjectPool::acquire(const QSize &requestSize void QGLFramebufferObjectPool::release(QGLFramebufferObject *fbo) { - m_fbos << fbo; + if (fbo) + m_fbos << fbo; } diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h index 6190d38..8a13e03 100644 --- a/src/opengl/qpixmapdata_gl_p.h +++ b/src/opengl/qpixmapdata_gl_p.h @@ -69,7 +69,7 @@ class QGLPixmapData; class QGLFramebufferObjectPool { public: - QGLFramebufferObject *acquire(const QSize &size, const QGLFramebufferObjectFormat &format); + QGLFramebufferObject *acquire(const QSize &size, const QGLFramebufferObjectFormat &format, bool strictSize = false); void release(QGLFramebufferObject *fbo); private: -- cgit v0.12 From 2a902676b74d0aa3482e722602879f7a02be1103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 30 Oct 2009 14:26:55 +0100 Subject: Moved Qt::RenderHint back into QGraphicsBlurEffect and added a hint. Added AnimationHint, which didn't make too much sense in a generic enum, so Qt::RenderHint was moved back into QGraphicsBlurEffect as QGraphicsBlurEffect::BlurHint. Reviewed-by: Gunnar Sletta --- dist/changes-4.6.0 | 4 ++++ src/corelib/global/qnamespace.h | 5 ----- src/corelib/global/qnamespace.qdoc | 15 --------------- src/gui/effects/qgraphicseffect.cpp | 37 ++++++++++++++++++++++++++++--------- src/gui/effects/qgraphicseffect.h | 14 ++++++++++---- src/gui/image/qpixmapfilter.cpp | 18 ++++++++++++------ src/gui/image/qpixmapfilter_p.h | 5 +++-- src/opengl/qglpixmapfilter.cpp | 28 ++++++++++++++-------------- 8 files changed, 71 insertions(+), 55 deletions(-) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index 7f723da..c7f9ad7 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -30,6 +30,10 @@ information about a particular change. * [245219] Added QXmlQuery::setFocus(const QString &focus); + - QGraphicsBlurEffect + * Since the 4.6 beta Qt::RenderHint has been moved to + QGraphicsBlurEffect::BlurHint. + - QVariant * Many optimisations * Added QVariant::toFloat() and QVariant::toReal() diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 2b62c6b..42dd3a2 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1645,11 +1645,6 @@ public: NavigationModeCursorAuto, NavigationModeCursorForceVisible }; - - enum RenderHint { - QualityHint, - PerformanceHint - }; } #ifdef Q_MOC_RUN ; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 5f9d01d..e3e881d 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2873,18 +2873,3 @@ \sa QApplication::setNavigationMode() \sa QApplication::navigationMode() */ - -/*! - \enum Qt::RenderHint - \since 4.6 - - This enum describes the possible hints that can be used to control various - rendering operations. - - \value QualityHint Indicates that rendering quality is the most important factor, - at the potential cost of lower performance. - - \value PerformanceHint Indicates that rendering performance is the most important factor, - at the potential cost of lower quality. -*/ - diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index c8e39da..e181b18 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -613,6 +613,26 @@ void QGraphicsColorizeEffect::draw(QPainter *painter, QGraphicsEffectSource *sou */ /*! + \enum QGraphicsBlurEffect::BlurHint + \since 4.6 + + This enum describes the possible hints that can be used to control how + blur effects are applied. The hints might not have an effect in all the + paint engines. + + \value QualityHint Indicates that rendering quality is the most important factor, + at the potential cost of lower performance. + + \value PerformanceHint Indicates that rendering performance is the most important factor, + at the potential cost of lower quality. + + \value AnimationHint Indicates that the blur radius is going to be animated, hinting + that the implementation can keep a cache of blurred verisons of the source pixmap. + Do not use this hint if the source item is going to be dynamically changing. +*/ + + +/*! Constructs a new QGraphicsBlurEffect instance. The \a parent parameter is passed to QGraphicsEffect's constructor. */ @@ -620,7 +640,7 @@ QGraphicsBlurEffect::QGraphicsBlurEffect(QObject *parent) : QGraphicsEffect(*new QGraphicsBlurEffectPrivate, parent) { Q_D(QGraphicsBlurEffect); - d->filter->setBlurHint(Qt::PerformanceHint); + d->filter->setBlurHint(QGraphicsBlurEffect::PerformanceHint); } /*! @@ -667,20 +687,19 @@ void QGraphicsBlurEffect::setBlurRadius(qreal radius) \property QGraphicsBlurEffect::blurHint \brief the blur hint of the effect. - Use the Qt::PerformanceHint hint to say that you want a faster blur, - and the Qt::QualityHint hint to say that you prefer a higher quality blur. - - When animating the blur radius it's recommended to use Qt::PerformanceHint. + Use the PerformanceHint hint to say that you want a faster blur, + the QualityHint hint to say that you prefer a higher quality blur, + or the AnimationHint when you want to animate the blur radius. - By default, the blur hint is Qt::PerformanceHint. + By default, the blur hint is PerformanceHint. */ -Qt::RenderHint QGraphicsBlurEffect::blurHint() const +QGraphicsBlurEffect::BlurHint QGraphicsBlurEffect::blurHint() const { Q_D(const QGraphicsBlurEffect); return d->filter->blurHint(); } -void QGraphicsBlurEffect::setBlurHint(Qt::RenderHint hint) +void QGraphicsBlurEffect::setBlurHint(QGraphicsBlurEffect::BlurHint hint) { Q_D(QGraphicsBlurEffect); if (d->filter->blurHint() == hint) @@ -691,7 +710,7 @@ void QGraphicsBlurEffect::setBlurHint(Qt::RenderHint hint) } /*! - \fn void QGraphicsBlurEffect::blurHintChanged(Qt::RenderHint hint) + \fn void QGraphicsBlurEffect::blurHintChanged(Qt::BlurHint hint) This signal is emitted whenever the effect's blur hint changes. The \a hint parameter holds the effect's new blur hint. diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index bf18581..7335a25 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -183,22 +183,28 @@ class Q_GUI_EXPORT QGraphicsBlurEffect: public QGraphicsEffect { Q_OBJECT Q_PROPERTY(qreal blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) - Q_PROPERTY(Qt::RenderHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) + Q_PROPERTY(BlurHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) public: + enum BlurHint { + QualityHint, + PerformanceHint, + AnimationHint + }; + QGraphicsBlurEffect(QObject *parent = 0); ~QGraphicsBlurEffect(); QRectF boundingRectFor(const QRectF &rect) const; qreal blurRadius() const; - Qt::RenderHint blurHint() const; + BlurHint blurHint() const; public Q_SLOTS: void setBlurRadius(qreal blurRadius); - void setBlurHint(Qt::RenderHint hint); + void setBlurHint(BlurHint hint); Q_SIGNALS: void blurRadiusChanged(qreal blurRadius); - void blurHintChanged(Qt::RenderHint hint); + void blurHintChanged(BlurHint hint); protected: void draw(QPainter *painter, QGraphicsEffectSource *source); diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index d0de03e..e50cc8b 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -504,10 +504,10 @@ void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const Q class QPixmapBlurFilterPrivate : public QPixmapFilterPrivate { public: - QPixmapBlurFilterPrivate() : radius(5), hint(Qt::PerformanceHint) {} + QPixmapBlurFilterPrivate() : radius(5), hint(QGraphicsBlurEffect::PerformanceHint) {} qreal radius; - Qt::RenderHint hint; + QGraphicsBlurEffect::BlurHint hint; }; @@ -556,12 +556,18 @@ qreal QPixmapBlurFilter::radius() const Setting the blur hint to PerformanceHint causes the implementation to trade off visual quality to blur the image faster. Setting the blur hint to QualityHint causes the implementation to improve - visual quality at the expense of speed. The implementation is free - to ignore this value if it only has a single blur algorithm. + visual quality at the expense of speed. + + AnimationHint causes the implementation to optimize for animating + the blur radius, possibly by caching blurred versions of the source + pixmap. + + The implementation is free to ignore this value if it only has a single + blur algorithm. \internal */ -void QPixmapBlurFilter::setBlurHint(Qt::RenderHint hint) +void QPixmapBlurFilter::setBlurHint(QGraphicsBlurEffect::BlurHint hint) { Q_D(QPixmapBlurFilter); d->hint = hint; @@ -572,7 +578,7 @@ void QPixmapBlurFilter::setBlurHint(Qt::RenderHint hint) \internal */ -Qt::RenderHint QPixmapBlurFilter::blurHint() const +QGraphicsBlurEffect::BlurHint QPixmapBlurFilter::blurHint() const { Q_D(const QPixmapBlurFilter); return d->hint; diff --git a/src/gui/image/qpixmapfilter_p.h b/src/gui/image/qpixmapfilter_p.h index fc70795..6a96676 100644 --- a/src/gui/image/qpixmapfilter_p.h +++ b/src/gui/image/qpixmapfilter_p.h @@ -55,6 +55,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -130,10 +131,10 @@ public: ~QPixmapBlurFilter(); void setRadius(qreal radius); - void setBlurHint(Qt::RenderHint hint); + void setBlurHint(QGraphicsBlurEffect::BlurHint hint); qreal radius() const; - Qt::RenderHint blurHint() const; + QGraphicsBlurEffect::BlurHint blurHint() const; QRectF boundingRectFor(const QRectF &rect) const; void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const; diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index 2af69e0..3b94ad3 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -100,7 +100,7 @@ private: class QGLPixmapBlurFilter : public QGLCustomShaderStage, public QGLPixmapFilter { public: - QGLPixmapBlurFilter(Qt::RenderHint hint); + QGLPixmapBlurFilter(QGraphicsBlurEffect::BlurHint hint); void setUniforms(QGLShaderProgram *program); @@ -117,13 +117,13 @@ private: mutable bool m_haveCached; mutable int m_cachedRadius; - mutable Qt::RenderHint m_hint; + mutable QGraphicsBlurEffect::BlurHint m_hint; }; class QGLPixmapDropShadowFilter : public QGLCustomShaderStage, public QGLPixmapFilter { public: - QGLPixmapDropShadowFilter(Qt::RenderHint hint); + QGLPixmapDropShadowFilter(QGraphicsBlurEffect::BlurHint hint); void setUniforms(QGLShaderProgram *program); @@ -137,7 +137,7 @@ private: mutable bool m_haveCached; mutable int m_cachedRadius; - mutable Qt::RenderHint m_hint; + mutable QGraphicsBlurEffect::BlurHint m_hint; }; extern QGLWidget *qt_gl_share_widget(); @@ -153,13 +153,13 @@ QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *pr case QPixmapFilter::BlurFilter: { const QPixmapBlurFilter *proto = static_cast(prototype); - if (proto->blurHint() == Qt::PerformanceHint || proto->radius() <= 5) { + if (proto->blurHint() == QGraphicsBlurEffect::PerformanceHint || proto->radius() <= 5) { if (!d->fastBlurFilter) - d->fastBlurFilter.reset(new QGLPixmapBlurFilter(Qt::PerformanceHint)); + d->fastBlurFilter.reset(new QGLPixmapBlurFilter(QGraphicsBlurEffect::PerformanceHint)); return d->fastBlurFilter.data(); } if (!d->blurFilter) - d->blurFilter.reset(new QGLPixmapBlurFilter(Qt::QualityHint)); + d->blurFilter.reset(new QGLPixmapBlurFilter(QGraphicsBlurEffect::QualityHint)); return d->blurFilter.data(); } @@ -167,11 +167,11 @@ QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *pr const QPixmapDropShadowFilter *proto = static_cast(prototype); if (proto->blurRadius() <= 5) { if (!d->fastDropShadowFilter) - d->fastDropShadowFilter.reset(new QGLPixmapDropShadowFilter(Qt::PerformanceHint)); + d->fastDropShadowFilter.reset(new QGLPixmapDropShadowFilter(QGraphicsBlurEffect::PerformanceHint)); return d->fastDropShadowFilter.data(); } if (!d->dropShadowFilter) - d->dropShadowFilter.reset(new QGLPixmapDropShadowFilter(Qt::QualityHint)); + d->dropShadowFilter.reset(new QGLPixmapDropShadowFilter(QGraphicsBlurEffect::QualityHint)); return d->dropShadowFilter.data(); } @@ -327,7 +327,7 @@ static QByteArray qt_gl_convertToClamped(const QByteArray &source) return result; } -QGLPixmapBlurFilter::QGLPixmapBlurFilter(Qt::RenderHint hint) +QGLPixmapBlurFilter::QGLPixmapBlurFilter(QGraphicsBlurEffect::BlurHint hint) : m_haveCached(false) , m_cachedRadius(0) , m_hint(hint) @@ -341,7 +341,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const int actualRadius = qRound(radius()); int filterRadius = actualRadius; int fastRadii[] = { 1, 2, 3, 5, 8, 15, 25 }; - if (m_hint == Qt::PerformanceHint) { + if (m_hint == QGraphicsBlurEffect::PerformanceHint) { uint i = 0; for (; i < (sizeof(fastRadii)/sizeof(*fastRadii))-1; ++i) { if (fastRadii[i+1] > filterRadius) @@ -428,7 +428,7 @@ void QGLPixmapBlurFilter::setUniforms(QGLShaderProgram *program) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - if (m_hint == Qt::QualityHint) { + if (m_hint == QGraphicsBlurEffect::QualityHint) { if (m_singlePass) program->setUniformValue("delta", 1.0 / m_textureSize.width(), 1.0 / m_textureSize.height()); else if (m_horizontalBlur) @@ -578,7 +578,7 @@ QByteArray QGLPixmapBlurFilter::generateGaussianShader(int radius, bool singlePa return source; } -QGLPixmapDropShadowFilter::QGLPixmapDropShadowFilter(Qt::RenderHint hint) +QGLPixmapDropShadowFilter::QGLPixmapDropShadowFilter(QGraphicsBlurEffect::BlurHint hint) : m_haveCached(false) , m_cachedRadius(0) , m_hint(hint) @@ -685,7 +685,7 @@ void QGLPixmapDropShadowFilter::setUniforms(QGLShaderProgram *program) alpha); } - if (m_hint == Qt::QualityHint) { + if (m_hint == QGraphicsBlurEffect::QualityHint) { if (m_singlePass) program->setUniformValue("delta", 1.0 / m_textureSize.width(), 1.0 / m_textureSize.height()); else if (m_horizontalBlur) -- cgit v0.12 From 64fbefa605d976ab752149bb39880893c82ad8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 30 Oct 2009 14:00:35 +0100 Subject: Optimized animated blur radii in the GL 2 paint engine. We add an internal cache which keeps four half-scaled versions of the source pixmap at different blur radii, then we simply interpolate between the two pixmaps around the desired blur radius, or between the base source pixmap and the first blurred version. Reviewed-by: Gunnar Sletta --- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 1 + src/opengl/qgl.h | 1 + src/opengl/qglpixmapfilter.cpp | 379 ++++++++++++++++++++- 3 files changed, 369 insertions(+), 12 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 209cd36..4cf2a83 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -289,6 +289,7 @@ public: QScopedPointer convolutionFilter; QScopedPointer colorizeFilter; QScopedPointer blurFilter; + QScopedPointer animationBlurFilter; QScopedPointer fastBlurFilter; QScopedPointer dropShadowFilter; QScopedPointer fastDropShadowFilter; diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index e14e7fb..079953f 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -399,6 +399,7 @@ private: friend class QGLTextureGlyphCache; friend class QGLShareRegister; friend class QGLSharedResourceGuard; + friend class QGLPixmapBlurFilter; friend QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags(); #ifdef Q_WS_MAC public: diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index 3b94ad3..ff19e06 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -43,6 +43,8 @@ #include "private/qpixmapdata_gl_p.h" #include "private/qpaintengineex_opengl2_p.h" #include "private/qglengineshadermanager_p.h" +#include "private/qpixmapdata_p.h" +#include "private/qimagepixmapcleanuphooks_p.h" #include "qglpixmapfilter_p.h" #include "qgraphicssystem_gl_p.h" #include "qpaintengine_opengl_p.h" @@ -54,7 +56,7 @@ #include "private/qapplication_p.h" #include "private/qmath_p.h" - +#include "qmath.h" QT_BEGIN_NAMESPACE @@ -114,6 +116,10 @@ private: mutable QSize m_textureSize; mutable bool m_horizontalBlur; mutable bool m_singlePass; + mutable bool m_animatedBlur; + + mutable qreal m_t; + mutable QSize m_targetSize; mutable bool m_haveCached; mutable int m_cachedRadius; @@ -153,6 +159,11 @@ QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *pr case QPixmapFilter::BlurFilter: { const QPixmapBlurFilter *proto = static_cast(prototype); + if (proto->blurHint() == QGraphicsBlurEffect::AnimationHint) { + if (!d->animationBlurFilter) + d->animationBlurFilter.reset(new QGLPixmapBlurFilter(proto->blurHint())); + return d->animationBlurFilter.data(); + } if (proto->blurHint() == QGraphicsBlurEffect::PerformanceHint || proto->radius() <= 5) { if (!d->fastBlurFilter) d->fastBlurFilter.reset(new QGLPixmapBlurFilter(QGraphicsBlurEffect::PerformanceHint)); @@ -328,20 +339,343 @@ static QByteArray qt_gl_convertToClamped(const QByteArray &source) } QGLPixmapBlurFilter::QGLPixmapBlurFilter(QGraphicsBlurEffect::BlurHint hint) - : m_haveCached(false) + : m_animatedBlur(false) + , m_haveCached(false) , m_cachedRadius(0) , m_hint(hint) { } +// should be even numbers as they will be divided by two +static const int qCachedBlurLevels[] = { 6, 14, 30 }; +static const int qNumCachedBlurTextures = sizeof(qCachedBlurLevels) / sizeof(*qCachedBlurLevels); +static const int qMaxCachedBlurLevel = qCachedBlurLevels[qNumCachedBlurTextures - 1]; + +static qreal qLogBlurLevel(int level) +{ + static bool initialized = false; + static qreal logBlurLevelCache[qNumCachedBlurTextures]; + if (!initialized) { + for (int i = 0; i < qNumCachedBlurTextures; ++i) + logBlurLevelCache[i] = qLn(qCachedBlurLevels[i]); + initialized = true; + } + return logBlurLevelCache[level]; +} + +class QGLBlurTextureInfo +{ +public: + QGLBlurTextureInfo(QSize size, GLuint textureIds[]) + : m_size(size) + { + for (int i = 0; i < qNumCachedBlurTextures; ++i) + m_textureIds[i] = textureIds[i]; + } + + ~QGLBlurTextureInfo() + { + glDeleteTextures(qNumCachedBlurTextures, m_textureIds); + } + + QSize size() const { return m_size; } + GLuint textureId(int i) const { return m_textureIds[i]; } + +private: + GLuint m_textureIds[qNumCachedBlurTextures]; + QSize m_size; +}; + +class QGLBlurTextureCache : public QObject +{ +public: + static QGLBlurTextureCache *cacheForContext(const QGLContext *context); + + QGLBlurTextureCache(); + ~QGLBlurTextureCache(); + + QGLBlurTextureInfo *takeBlurTextureInfo(const QPixmap &pixmap); + bool fitsInCache(const QPixmap &pixmap) const; + bool hasBlurTextureInfo(const QPixmap &pixmap) const; + void insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTextureInfo *info); + void clearBlurTextureInfo(const QPixmap &pixmap); + + void timerEvent(QTimerEvent *event); + +private: + static void pixmapDestroyed(QPixmap *pixmap); + + QCache cache; + + static QList blurTextureCaches; + + int timerId; +}; + +QList QGLBlurTextureCache::blurTextureCaches; + +static void QGLBlurTextureCache_free(void *ptr) +{ + delete reinterpret_cast(ptr); +} + +Q_GLOBAL_STATIC_WITH_ARGS(QGLContextResource, qt_blur_texture_caches, (QGLBlurTextureCache_free)) + +QGLBlurTextureCache::QGLBlurTextureCache() + : timerId(0) +{ + cache.setMaxCost(4 * 1024 * 1024); + blurTextureCaches.append(this); +} + +QGLBlurTextureCache::~QGLBlurTextureCache() +{ + blurTextureCaches.removeAt(blurTextureCaches.indexOf(this)); +} + +void QGLBlurTextureCache::timerEvent(QTimerEvent *event) +{ + killTimer(timerId); + timerId = 0; + + cache.clear(); +} + +QGLBlurTextureCache *QGLBlurTextureCache::cacheForContext(const QGLContext *context) +{ + QGLBlurTextureCache *p = reinterpret_cast(qt_blur_texture_caches()->value(context)); + if (!p) { + p = new QGLBlurTextureCache; + qt_blur_texture_caches()->insert(context, p); + } + return p; +} + +QGLBlurTextureInfo *QGLBlurTextureCache::takeBlurTextureInfo(const QPixmap &pixmap) +{ + return cache.take(pixmap.cacheKey()); +} + +void QGLBlurTextureCache::clearBlurTextureInfo(const QPixmap &pixmap) +{ + cache.remove(pixmap.cacheKey()); +} + +bool QGLBlurTextureCache::hasBlurTextureInfo(const QPixmap &pixmap) const +{ + return cache.contains(pixmap.cacheKey()); +} + +void QGLBlurTextureCache::insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTextureInfo *info) +{ + static bool hookAdded = false; + if (!hookAdded) { + QImagePixmapCleanupHooks::instance()->addPixmapDestructionHook(pixmapDestroyed); + hookAdded = true; + } + + QImagePixmapCleanupHooks::enableCleanupHooks(pixmap); + cache.insert(pixmap.cacheKey(), info, pixmap.width() * pixmap.height()); + + if (timerId) + killTimer(timerId); + + timerId = startTimer(1000); +} + +bool QGLBlurTextureCache::fitsInCache(const QPixmap &pixmap) const +{ + return pixmap.width() * pixmap.height() <= cache.maxCost(); +} + +void QGLBlurTextureCache::pixmapDestroyed(QPixmap *pixmap) +{ + foreach (QGLBlurTextureCache *cache, blurTextureCaches) { + if (cache->hasBlurTextureInfo(*pixmap)) + cache->clearBlurTextureInfo(*pixmap); + } +} + +static const char *qt_gl_interpolate_filter = + "uniform lowp float interpolationValue;" + "uniform lowp sampler2D interpolateTarget;" + "uniform highp vec4 interpolateMapping;" + "lowp vec4 customShader(lowp sampler2D src, highp vec2 srcCoords)" + "{" + " return mix(texture2D(interpolateTarget, interpolateMapping.xy + interpolateMapping.zw * srcCoords)," + " texture2D(src, srcCoords), interpolationValue);" + "}"; + +static void initializeTexture(GLuint id, int width, int height) +{ + glBindTexture(GL_TEXTURE_2D, id); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glBindTexture(GL_TEXTURE_2D, 0); +} + bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const QPixmap &src, const QRectF &) const { QGLPixmapBlurFilter *filter = const_cast(this); + QGLContext *ctx = const_cast(QGLContext::currentContext()); + QGLBlurTextureCache *blurTextureCache = QGLBlurTextureCache::cacheForContext(ctx); + + if (m_hint == QGraphicsBlurEffect::AnimationHint && blurTextureCache->fitsInCache(src)) { + QRect targetRect = src.rect().adjusted(-qMaxCachedBlurLevel, -qMaxCachedBlurLevel, qMaxCachedBlurLevel, qMaxCachedBlurLevel); + // ensure even dimensions (going to divide by two) + targetRect.setWidth((targetRect.width() + 1) & ~1); + targetRect.setHeight((targetRect.height() + 1) & ~1); + + QGLBlurTextureInfo *info = 0; + if (blurTextureCache->hasBlurTextureInfo(src)) { + info = blurTextureCache->takeBlurTextureInfo(src); + } else { + m_animatedBlur = false; + m_hint = QGraphicsBlurEffect::QualityHint; + m_singlePass = false; + + QGLFramebufferObjectFormat format; + format.setInternalTextureFormat(GL_RGBA); + QGLFramebufferObject *fbo = qgl_fbo_pool()->acquire(targetRect.size() / 2, format, true); + + if (!fbo) + return false; + + QPainter fboPainter(fbo); + QGL2PaintEngineEx *engine = static_cast(fboPainter.paintEngine()); + + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT); + + // ensure GL_LINEAR filtering is used for scaling down to half the size + fboPainter.setRenderHint(QPainter::SmoothPixmapTransform); + fboPainter.setCompositionMode(QPainter::CompositionMode_Source); + fboPainter.drawPixmap(qMaxCachedBlurLevel / 2, qMaxCachedBlurLevel / 2, + targetRect.width() / 2 - qMaxCachedBlurLevel, targetRect.height() / 2 - qMaxCachedBlurLevel, src); + + GLuint textures[qNumCachedBlurTextures]; // blur textures + glGenTextures(qNumCachedBlurTextures, textures); + GLuint temp; // temp texture + glGenTextures(1, &temp); + + initializeTexture(temp, fbo->width(), fbo->height()); + m_textureSize = fbo->size(); + + int currentBlur = 0; + + QRect fboRect(0, 0, fbo->width(), fbo->height()); + GLuint sourceTexture = fbo->texture(); + for (int i = 0; i < qNumCachedBlurTextures; ++i) { + int targetBlur = qCachedBlurLevels[i] / 2; + + int blurDelta = qRound(qSqrt(targetBlur * targetBlur - currentBlur * currentBlur)); + QByteArray source = generateGaussianShader(blurDelta); + filter->setSource(source); + + currentBlur = targetBlur; + + // now we're going to be nasty and keep using the same FBO with different textures + glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + GL_TEXTURE_2D, temp, 0); + + m_horizontalBlur = true; + filter->setOnPainter(&fboPainter); + engine->drawTexture(fboRect, sourceTexture, fbo->size(), fboRect); + filter->removeFromPainter(&fboPainter); + + sourceTexture = textures[i]; + initializeTexture(sourceTexture, fbo->width(), fbo->height()); + + glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + GL_TEXTURE_2D, textures[i], 0); + + m_horizontalBlur = false; + filter->setOnPainter(&fboPainter); + engine->drawTexture(fboRect, temp, fbo->size(), fboRect); + filter->removeFromPainter(&fboPainter); + } + + glDeleteTextures(1, &temp); + + // reattach the original FBO texture + glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + GL_TEXTURE_2D, fbo->texture(), 0); + + fboPainter.end(); + + qgl_fbo_pool()->release(fbo); + + info = new QGLBlurTextureInfo(fboRect.size(), textures); + } + + if (!m_haveCached || !m_animatedBlur) { + m_haveCached = true; + m_animatedBlur = true; + m_hint = QGraphicsBlurEffect::AnimationHint; + filter->setSource(qt_gl_interpolate_filter); + } + + QGL2PaintEngineEx *engine = static_cast(painter->paintEngine()); + painter->setRenderHint(QPainter::SmoothPixmapTransform); + filter->setOnPainter(painter); + + qreal logRadius = qLn(radius()); + + int t; + for (t = -1; t < qNumCachedBlurTextures - 2; ++t) { + if (logRadius < qLogBlurLevel(t+1)) + break; + } + + qreal logBase = t >= 0 ? qLogBlurLevel(t) : 0; + m_t = qBound(qreal(0), (logRadius - logBase) / (qLogBlurLevel(t+1) - logBase), qreal(1)); + + m_textureSize = info->size(); + + glActiveTexture(GL_TEXTURE0 + 3); + if (t >= 0) { + glBindTexture(GL_TEXTURE_2D, info->textureId(t)); + m_targetSize = info->size(); + } else { + QGLTexture *texture = + ctx->d_func()->bindTexture(src, GL_TEXTURE_2D, GL_RGBA, + QGLContext::InternalBindOption + | QGLContext::CanFlipNativePixmapBindOption); + m_targetSize = src.size(); + if (!(texture->options & QGLContext::InvertedYBindOption)) + m_targetSize.setHeight(-m_targetSize.height()); + } + + // restrict the target rect to the max of the radii we are interpolating between + int radiusDelta = qMaxCachedBlurLevel - qCachedBlurLevels[t+1]; + targetRect = targetRect.translated(pos.toPoint()).adjusted(radiusDelta, radiusDelta, -radiusDelta, -radiusDelta); + + radiusDelta /= 2; + QRect sourceRect = QRect(QPoint(), m_textureSize).adjusted(radiusDelta, radiusDelta, -radiusDelta, -radiusDelta); + + engine->drawTexture(targetRect, info->textureId(t+1), m_textureSize, sourceRect); + + glActiveTexture(GL_TEXTURE0 + 3); + glBindTexture(GL_TEXTURE_2D, 0); + + filter->removeFromPainter(painter); + blurTextureCache->insertBlurTextureInfo(src, info); + + return true; + } + + if (blurTextureCache->hasBlurTextureInfo(src)) + blurTextureCache->clearBlurTextureInfo(src); + int actualRadius = qRound(radius()); int filterRadius = actualRadius; int fastRadii[] = { 1, 2, 3, 5, 8, 15, 25 }; - if (m_hint == QGraphicsBlurEffect::PerformanceHint) { + if (m_hint != QGraphicsBlurEffect::QualityHint) { uint i = 0; for (; i < (sizeof(fastRadii)/sizeof(*fastRadii))-1; ++i) { if (fastRadii[i+1] > filterRadius) @@ -352,9 +686,10 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const m_singlePass = filterRadius <= 3; - if (!m_haveCached || filterRadius != m_cachedRadius) { + if (!m_haveCached || m_animatedBlur || filterRadius != m_cachedRadius) { // Only regenerate the shader from source if parameters have changed. m_haveCached = true; + m_animatedBlur = false; m_cachedRadius = filterRadius; QByteArray source = generateGaussianShader(filterRadius, m_singlePass); filter->setSource(source); @@ -389,13 +724,12 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const QPainter fboPainter(fbo); - if (src.hasAlphaChannel()) { - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - } + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT); // ensure GL_LINEAR filtering is used fboPainter.setRenderHint(QPainter::SmoothPixmapTransform); + fboPainter.setCompositionMode(QPainter::CompositionMode_Source); filter->setOnPainter(&fboPainter); QBrush pixmapBrush = src; pixmapBrush.setTransform(QTransform::fromTranslate(actualRadius, actualRadius)); @@ -428,6 +762,28 @@ void QGLPixmapBlurFilter::setUniforms(QGLShaderProgram *program) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + if (m_animatedBlur) { + program->setUniformValue("interpolateTarget", 3); + program->setUniformValue("interpolationValue", GLfloat(m_t)); + + if (m_textureSize == m_targetSize) { + program->setUniformValue("interpolateMapping", 0.0f, 0.0f, 1.0f, 1.0f); + } else { + float offsetX = (-qMaxCachedBlurLevel - 0.5) / qreal(m_targetSize.width()); + float offsetY = (-qMaxCachedBlurLevel - 0.5) / qreal(m_targetSize.height()); + + if (m_targetSize.height() < 0) + offsetY = 1 + offsetY; + + float scaleX = 2.0f * qreal(m_textureSize.width()) / qreal(m_targetSize.width()); + float scaleY = 2.0f * qreal(m_textureSize.height()) / qreal(m_targetSize.height()); + + program->setUniformValue("interpolateMapping", offsetX, offsetY, scaleX, scaleY); + } + + return; + } + if (m_hint == QGraphicsBlurEffect::QualityHint) { if (m_singlePass) program->setUniformValue("delta", 1.0 / m_textureSize.width(), 1.0 / m_textureSize.height()); @@ -632,13 +988,12 @@ bool QGLPixmapDropShadowFilter::processGL(QPainter *painter, const QPointF &pos, QPainter fboPainter(fbo); - if (src.hasAlphaChannel()) { - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - } + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT); // ensure GL_LINEAR filtering is used fboPainter.setRenderHint(QPainter::SmoothPixmapTransform); + fboPainter.setCompositionMode(QPainter::CompositionMode_Source); filter->setOnPainter(&fboPainter); QBrush pixmapBrush = src; pixmapBrush.setTransform(QTransform::fromTranslate(actualRadius, actualRadius)); -- cgit v0.12 From cb357aad0f26c36eb1f942ae37647f9de071c948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 30 Oct 2009 19:28:43 +0100 Subject: Made QGraphicsEffectSource::draw() use cached pixmap if possible. Small optimization for the case where the source pixmap is cached. Reviewed-by: Gunnar Sletta --- src/gui/effects/qgraphicseffect.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index e181b18..78a18d3 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -210,7 +210,23 @@ const QStyleOption *QGraphicsEffectSource::styleOption() const */ void QGraphicsEffectSource::draw(QPainter *painter) { - d_func()->draw(painter); + Q_D(const QGraphicsEffectSource); + + QPixmap pm; + if (QPixmapCache::find(d->m_cacheKey, &pm)) { + QTransform restoreTransform; + if (d->m_cachedSystem == Qt::DeviceCoordinates) { + restoreTransform = painter->worldTransform(); + painter->setWorldTransform(QTransform()); + } + + painter->drawPixmap(d->m_cachedOffset, pm); + + if (d->m_cachedSystem == Qt::DeviceCoordinates) + painter->setWorldTransform(restoreTransform); + } else { + d_func()->draw(painter); + } } /*! -- cgit v0.12 From 7f9c446f53ba89fb5add8ff6a62088eaa93d3460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 2 Nov 2009 10:14:34 +0100 Subject: Fixed compiler warning on GCC about empty while statement. --- src/opengl/qgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 3fec1f0..2a57468 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2158,7 +2158,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G #ifndef QT_NO_DEBUG // Reset the gl error stack...git - while (glGetError() != GL_NO_ERROR); + while (glGetError() != GL_NO_ERROR) ; #endif // Scale the pixmap if needed. GL textures needs to have the -- cgit v0.12 From d4ea57ff9022305437fb371802b41120074d3467 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 2 Nov 2009 13:56:40 +0100 Subject: Safeguard isNull() pixmaps in bindTexture and remove a compile warning Reviewed-by: TrustMe --- .../gl2paintengineex/qglengineshadermanager_p.h | 2 +- src/opengl/qgl.cpp | 39 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index 59e50d0..50c1432 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -254,7 +254,7 @@ static const GLuint QT_VERTEX_COORDS_ATTR = 0; static const GLuint QT_TEXTURE_COORDS_ATTR = 1; static const GLuint QT_OPACITY_ATTR = 2; -struct QGLEngineShaderProg; +class QGLEngineShaderProg; class QGLEngineSharedShaders : public QObject { diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 3fec1f0..621d926 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2445,6 +2445,9 @@ int QGLContextPrivate::maxTextureSize() */ GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format) { + if (image.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(image, target, format, false, DefaultBindOption); return texture->id; @@ -2477,6 +2480,9 @@ GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format) */ GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format, BindOptions options) { + if (image.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(image, target, format, false, options); return texture->id; @@ -2486,6 +2492,9 @@ GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format, /*! \internal */ GLuint QGLContext::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format) { + if (image.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(image, GLenum(target), GLint(format), false, DefaultBindOption); return texture->id; @@ -2495,6 +2504,9 @@ GLuint QGLContext::bindTexture(const QImage &image, QMacCompatGLenum target, QMa GLuint QGLContext::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format, BindOptions options) { + if (image.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(image, GLenum(target), GLint(format), false, options); return texture->id; @@ -2507,6 +2519,9 @@ GLuint QGLContext::bindTexture(const QImage &image, QMacCompatGLenum target, QMa */ GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint format) { + if (pixmap.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(pixmap, target, format, DefaultBindOption); return texture->id; @@ -2521,6 +2536,9 @@ GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint forma */ GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, BindOptions options) { + if (pixmap.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(pixmap, target, format, options); return texture->id; @@ -2530,6 +2548,9 @@ GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint forma /*! \internal */ GLuint QGLContext::bindTexture(const QPixmap &pixmap, QMacCompatGLenum target, QMacCompatGLint format) { + if (pixmap.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(pixmap, GLenum(target), GLint(format), DefaultBindOption); return texture->id; @@ -2538,6 +2559,9 @@ GLuint QGLContext::bindTexture(const QPixmap &pixmap, QMacCompatGLenum target, Q GLuint QGLContext::bindTexture(const QPixmap &pixmap, QMacCompatGLenum target, QMacCompatGLint format, BindOptions options) { + if (pixmap.isNull()) + return 0; + Q_D(QGLContext); QGLTexture *texture = d->bindTexture(pixmap, GLenum(target), GLint(format), options); return texture->id; @@ -4595,6 +4619,9 @@ bool QGLWidget::autoBufferSwap() const */ GLuint QGLWidget::bindTexture(const QImage &image, GLenum target, GLint format) { + if (image.isNull()) + return 0; + Q_D(QGLWidget); return d->glcx->bindTexture(image, target, format, QGLContext::DefaultBindOption); } @@ -4608,6 +4635,9 @@ GLuint QGLWidget::bindTexture(const QImage &image, GLenum target, GLint format) */ GLuint QGLWidget::bindTexture(const QImage &image, GLenum target, GLint format, QGLContext::BindOptions options) { + if (image.isNull()) + return 0; + Q_D(QGLWidget); return d->glcx->bindTexture(image, target, format, options); } @@ -4617,6 +4647,9 @@ GLuint QGLWidget::bindTexture(const QImage &image, GLenum target, GLint format, /*! \internal */ GLuint QGLWidget::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format) { + if (image.isNull()) + return 0; + Q_D(QGLWidget); return d->glcx->bindTexture(image, GLenum(target), GLint(format), QGLContext::DefaultBindOption); } @@ -4624,6 +4657,9 @@ GLuint QGLWidget::bindTexture(const QImage &image, QMacCompatGLenum target, QMac GLuint QGLWidget::bindTexture(const QImage &image, QMacCompatGLenum target, QMacCompatGLint format, QGLContext::BindOptions options) { + if (image.isNull()) + return 0; + Q_D(QGLWidget); return d->glcx->bindTexture(image, GLenum(target), GLint(format), options); } @@ -4637,6 +4673,9 @@ GLuint QGLWidget::bindTexture(const QImage &image, QMacCompatGLenum target, QMac */ GLuint QGLWidget::bindTexture(const QPixmap &pixmap, GLenum target, GLint format) { + if (pixmap.isNull()) + return 0; + Q_D(QGLWidget); return d->glcx->bindTexture(pixmap, target, format, QGLContext::DefaultBindOption); } -- cgit v0.12 From 99bbe6fa6c2322449bb8ab7dda09c53b18cde68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 2 Nov 2009 14:13:05 +0100 Subject: Minor doc fixes for QGLContext::BindOption. Reviewed-by: Gunnar Sletta --- src/opengl/qgl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 2a57468..6370afd 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1773,10 +1773,12 @@ Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg() /*! \enum QGLContext::BindOption + \since 4.6 + A set of options to decide how to bind a texture using bindTexture(). \value NoBindOption Don't do anything, pass the texture straight - thru. + through. \value InvertedYBindOption Specifies that the texture should be flipped over the X axis so that the texture coordinate 0,0 corresponds to -- cgit v0.12 From c55c08b38dd902765f476f62369378813c8e804f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 15:27:59 +0100 Subject: Doc: i18n overhaul for QObject::tr() and the Qt Linguist manual. Reviewed-by: Trust Me --- doc/src/internationalization/i18n.qdoc | 267 ++++++++++++++- doc/src/internationalization/linguist-manual.qdoc | 368 ++------------------- doc/src/snippets/code/doc_src_i18n.qdoc | 2 +- .../snippets/code/src_corelib_kernel_qobject.cpp | 3 +- examples/mainwindows/sdi/mainwindow.h | 2 + src/corelib/kernel/qobject.cpp | 146 +------- 6 files changed, 310 insertions(+), 478 deletions(-) diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index e873f4e..1a2839d 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -51,6 +51,7 @@ \page internationalization.html \title Internationalization with Qt \brief Information about Qt's support for internationalization and multiple languages. + \nextpage Writing Source Code for Translation \keyword internationalization \keyword i18n @@ -59,11 +60,11 @@ the application usable by people in countries other than one's own. \tableofcontents - + \section1 Relevant Qt Classes and APIs These classes support internationalizing of Qt applications. - + \annotatedlist i18n \section1 Languages and Writing Systems @@ -516,3 +517,265 @@ For details on Mac-specific translation, refer to the Qt/Mac Specific Issues document \l{Qt for Mac OS X - Specific Issues#Translating the Application Menu and Native Dialogs}{here}. */ + +/*! + \page i18n-source-translation.html + \title Writing Source Code for Translation + \ingroup i18n + \previouspage Internationalization with Qt + \contentspage Internationalization with Qt + \nextpage Translation Rules for Plurals + \brief How to write source code in a way that makes it possible for user-visible text to be translated. + + \tableofcontents + + \section1 The Basics + + Developers use the \l{QObject::}{tr()} function to obtain translated text + for their classes, typically for display purposes. This function is also + used to indicate which text strings in an application are translatable. + + Qt indexes each translatable string by the \e{translation context} it is + associated with; this is generally the name of the QObject subclass it is + used in. + + Translation contexts are defined for new QObject-based classes by the use + of the Q_OBJECT macro in each new class definition. + + When tr() is called, it looks up the translatable string using a QTranslator + object. For translation to work, one or more of these must have been + installed on the application object in the way described in the + \l{#Enabling Translation}{Enabling Translation} section below. + + \section1 Defining a Translation Context + + The translation context for QObject and each QObject subclass is the + class name itself. Developers subclassing QObject must use the + Q_OBJECT macro in their class definition to override the translation + context. This macro sets the context to the name of the subclass. + + For example, the following class definition includes the Q_OBJECT macro, + implementing a new tr() that uses the \c MainWindow context: + + \snippet mainwindows/sdi/mainwindow.h class definition with macro + \dots + + If Q_OBJECT is not used in a class definition, the context will be + inherited from the base class. For example, since all QObject-based + classes in Qt provide a context, a new QWidget subclass defined without + a Q_OBJECT macro will use the \c QWidget context if its tr() function + is invoked. + + \section1 Using tr() to Obtain a Translation + + The following example shows how a translation is obtained for the + class shown in the previous section: + + \snippet mainwindows/sdi/mainwindow.cpp implicit tr context + \dots + + Here, the translation context is \c MainWindow because it is the + \c MainWindow::tr() function that is invoked. The text returned + by the tr() function is a translation of "&File" obtained from + the \c MainWindow context. + + When Qt's translation tool, \l lupdate, is used to process a set of source + files, the text wrapped in tr() calls is stored in a section of the translation + file that corresponds to its translation context. + + In some situations, it is useful to give a translation context explicitly + by fully qualifying the call to tr(); for example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp explicit tr context + + This call obtains the translated text for "Page up" from the \c QScrollBar + context. Developers can also use the QCoreApplication::translate() function + to obtain a translation for a particular translation context. + + \section1 Translator Comments + + Developers can include information about each translatable string to + help translators with the translation process. These are extracted + when \l lupdate is used to process the source files. The recommended + way to add comments is to annotate the tr() calls in your code with + comments of the form: + + \tt{//: ...} + + or + + \tt{\begincomment: ... \endcomment} + + Examples: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 40 + + In these examples, the comments will be associated with the strings + passed to tr() in the context of each call. + + \section1 Adding Meta-Data to Strings + + Additional data can be attached to each translatable message. These are + extracted when \l lupdate is used to process the source files. The + recommended way to add meta-data is to annotate the tr() calls in your code + with comments of the form: + + \tt{//= } + + This can be used to give the message a unique identifier to support tools + which need it. + + An alternative way to attach meta-data is to use the following syntax: + + \tt{//~ } + + This can be used to attach meta-data to the message. The field name should + consist of a domain prefix (possibly the conventional file extension of the + file format the field is inspired by), a hyphen and the actual field name + in underscore-delimited notation. For storage in TS files, the field name + together with the prefix "extra-" will form an XML element name. The field + contents will be XML-escaped, but otherwise appear verbatim as the + element's contents. Any number of unique fields can be added to each + message. + + Example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp meta data + + Meta-data appearing right in front of a magic TRANSLATOR comment applies to + the whole TS file. + + \section1 Disambiguation + + If the same translatable string is used in different roles within the same + translation context, an additional identifying string may be passed in + the call to \l{QObject::}{tr()}. This optional disambiguation argument + is used to distinguish between otherwise identical strings. + + Example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17 + \dots + + In Qt 4.4 and earlier, this disambiguation parameter was the preferred + way to specify comments to translators. + + \section1 Character Encodings + + You can set the encoding for the source text by calling QTextCodec::setCodecForTr(). + By default, the source text is assumed to be in Latin-1 encoding. + + \section1 Handling Plurals + + Some translatable strings contain placeholders for integer values and need + to be translated differently depending on the values in use. + + To help with this problem, developers pass an additional integer argument + to the \l{QObject::}{tr()} function, and typically use a special notation + for plurals in each translatable string. + + If this argument is equal or greater than zero, all occurrences of + \c %n in the resulting string are replaced with a decimal representation + of the value supplied. In addition, the translation used will adapt to the + value according to the rules for each language. + + Example: + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 18 + + The table below shows what string is returned depending on the + active translation: + + \table + \header \o \o{3,1} Active Translation + \header \o \a n \o No Translation \o French \o English + \row \o 0 \o "0 message(s) saved" \o "0 message sauvegard\unicode{0xE9}" \o "0 message\bold{s} saved" + \row \o 1 \o "1 message(s) saved" \o "1 message sauvegard\unicode{0xE9}" \o "1 message saved" + \row \o 2 \o "2 message(s) saved" \o "2 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "2 message\bold{s} saved" + \row \o 37 \o "37 message(s) saved" \o "37 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "37 message\bold{s} saved" + \endtable + + This idiom is more flexible than the traditional approach; e.g., + + \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 19 + + because it also works with target languages that have several + plural forms (e.g., Irish has a special "dual" form that should + be used when \c n is 2), and it handles the \e n == 0 case + correctly for languages such as French that require the singular. + See the \l{Qt Linguist Manual} for details. + + Instead of \c %n, you can use \c %Ln to produce a localized + representation of \a n. The conversion uses the default locale, + set using QLocale::setDefault(). (If no default locale was + specified, the "C" locale is used.) + + A summary of the rules used to translate strings containing plurals can be + found in the \l{Translation Rules for Plurals} document. + + \section1 Enabling Translation + + Typically, your application's \c main() function will look like + this: + + \snippet doc/src/snippets/code/doc_src_i18n.qdoc 8 + + Note the use of QLibraryInfo::location() to locate the Qt translations. + Developers should request the path to the translations at run-time by + passing QLibraryInfo::TranslationsPath to this function instead of + using the \c QTDIR environment variable in their applications. + + \section1 Further Reading + + \l{Qt Linguist Manual}, \l{Hello tr Example}, \l{Translation Rules for Plurals} +*/ + +/*! + \page i18n-plural-rules.html + \title Translation Rules for Plurals + \ingroup i18n + \previouspage Writing Source Code for Translation + \contentspage Internationalization with Qt + \brief A summary of the translation rules for plurals produced by Qt's i18n tools. + + The table below shows the specific rules that are produced by Qt Linguist + and \c lrelease for a selection of languages. Cells marked \e otherwise + indicate the form used when none of the other rules are appropriate for a + specific language. + + \table 80% + \header \o Language \o Rule 1 \o Rule 2 \o Rule 3 + \row \o English \o \c{n == 1} + \o \e{otherwise} \o N/A + \row \o French \o \c{n < 2} + \o \e{otherwise} \o N/A + \row \o Czech \o \c{n % 100 == 1} + \o \c{n % 100 >= 2 && n % 100 <= 4} + \o \e{otherwise} + \row \o Irish \o \c{n == 1} + \o \c{n == 2} \o \e{otherwise} + \row \o Latvian \o \c{n % 10 == 1&& n % 100 != 11} + \o \c{n != 0} \o \e{otherwise} + \row \o Lithuanian \o \c{n % 10 == 1&& n % 100 != 11} + \o \c{n % 100 != 12 && n % 10 == 2} + \o \e{otherwise} + \row \o Macedonian \o \c{n % 10 == 1} + \o \c{n % 10 == 2} \o \e{otherwise} + \row \o Polish \o \c{n == 1} + \o \c{n % 10 >= 2 && n % 10 <= 4 + && (n % 100 < 10 || n % 100 > 20)} + \o \e{otherwise} + \row \o Romanian \o \c{n == 1} + \o \c{n == 0|| (n % 100 >= 1 && n % 100 <= 20)} + \o \e{otherwise} + \row \o Russian \o \c{n % 10 == 1&& n % 100 != 11} + \o \c{n % 10 >= 2 && n % 10 <= 4 + && (n % 100 < 10 || n % 100 > 20)} + \o \e{otherwise} + \row \o Slovak \o \c{n == 1} \o \c{n >= 2 && n <= 4} + \o \e{otherwise} + \row \o Japanese \o \e{otherwise} \o N/A \o N/A + \endtable + + The rules themselves are not documented and are internal to Qt Linguist and \c lrelease. +*/ diff --git a/doc/src/internationalization/linguist-manual.qdoc b/doc/src/internationalization/linguist-manual.qdoc index 5d388f1..3e06a2f 100644 --- a/doc/src/internationalization/linguist-manual.qdoc +++ b/doc/src/internationalization/linguist-manual.qdoc @@ -62,7 +62,7 @@ software engineers and the translator. The chapter describes the use of two tools. The \l{lupdate} tool is used to synchronize source code and translations. The \l{lrelease} tool is used to - create runtime translation files for use by the released + create run-time translation files for use by the released application. The \l{linguist-translators.html}{Translators} chapter is for @@ -119,7 +119,7 @@ \o Phrases that contain variables, for example, "The 25 files selected will take 63 seconds to process", where the two numbers - are inserted programmatically at runtime may need to be reworded + are inserted programmatically at run-time may need to be reworded because in a different language the word order and therefore the placement of the variables may have to change. @@ -147,7 +147,7 @@ \row \o{1,2} \inlineimage wVista-Cert-border-small.png \o \e{Qt Linguist 4.3 is Certified for Windows Vista} - + \row \o Windows Vista and the Windows Vista Start button are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. @@ -508,7 +508,7 @@ translation. The state is reset to \inlineimage linguist-danger.png , and the number of accepted translations in the \e{Items} column of the \l{Context Window} {context list} is decremented by 1. - + \row \o Not Accepted \o \inlineimage linguist-check-off.png @@ -781,7 +781,7 @@ changed. Whichever character (alpha or digit) is chosen, the translation must be in the form "Ctrl+" followed by the upper case character. \e{Qt} will automatically display the correct name at - runtime. As with Alt key accelerators, if the translator changes + run-time. As with Alt key accelerators, if the translator changes the character, the new character must not conflict with any other Ctrl key accelerator. @@ -790,14 +790,14 @@ supported languages, \e {Qt} automatically translates these strings. - \section2 Handling Numbered Arguments + \section2 Handling Numbered Arguments and Plurals Some phrases contain numbered arguments. A numbered argument is a - placeholder that will be replaced with text at runtime. A numbered + placeholder that will be replaced with text at run-time. A numbered argument appears in a source string as a percent sign followed by a digit. Consider an example: \c{After processing file %1, file %2 is next in line}. In this string to be translated, \c{%1} and - \c{%2} are numbered arguments. At runtime, \c{%1} and \c{%2} will + \c{%2} are numbered arguments. At run-time, \c{%1} and \c{%2} will be replaced with the first and next file names respectively. The same numbered arguments must appear in the translation, but not necessarily in the same order. A German translation of the string @@ -808,336 +808,14 @@ of where argument \e{i} appears in the argument sequence in the source string. - \section2 Plurals - - The problem of plurals in output is resolved by using an overload of - the \c tr() function with the signature - \code - QString tr(const char *text, const char *comment, int n); - \endcode - Using built in comparisons for the value of \c n the tr() function will - translate the phrase to the plural form for the target language. - - Different languages have various forms for plurals beyond simply - \e singular and \e plural. The rules for determining which form of the - plural to use are encoded as conditional tests. Below is a table - representing the numbers associated with the forms rather than the - conditional tests themselves. - - - - \table 90% - \header - \o Language - \o Form 1 - \o Form 2 - \o Form 3 - \o Form 4 - \row - \o Arabic - \o 0, 1, 11-102, 111-202... - \o 2 - \o 3-10, 103-110, 203-210... - \o - \row - \o Basque - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Bulgarian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Catalan - \o 1 - \o 11, 11 000-11 999, 11 000 000-11 999 999... - \o 0, 2-10, 12-10 999, 12-10 999 999... - \o - \row - \o Chinese-CN - \o 0- - \o - \o - \o - \row - \o Chinese-HK - \o 0- - \o - \o - \o - \row - \o Chinese-TW - \o 0- - \o - \o - \o - \row - \o Croation - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34, 42-44... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Czech - \o 1 - \o 2-4 - \o 0, 5- - \o - \row - \o Danish - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Dutch - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o English - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o English-US - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Estonian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Finnish - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o French-CA - \o 0, 1 - \o 2-100, 101- - \o - \o - \row - \o French-FR - \o 0, 1 - \o 2-100, 101- - \o - \o - \row - \o Galician - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o German - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Greek - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Hebrew - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Hungarian - \o 0- - \o - \o - \o - \row - \o Icelandic - \o 1, 21, 31, 41, 51....101, 121, 131... - \o 0, 2-20, 22-30, 32-40...102-120... - \o - \o - \row - \o Indonesian - \o 0- - \o - \o - \o - \row - \o Italian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Japanese - \o 0- - \o - \o - \o - \row - \o Korean - \o 0- - \o - \o - \o - \row - \o Latvian - \o 0 - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 131, 141... - \o 2-20, 22-30, 32-40, 42-50...202-220, 222-230... - \o - \row - \o Lithuanian - \o 1, 21, 31, 41, 51...101, 121, 131... - \o 2-9, 22-29, 32-39...102-109, 122-129, 132-139... - \o 0, 10-20, 30, 40, 50...110-120, 130, 140... - \o - \row - \o Malay - \o 0- - \o - \o - \o - \row - \o Norwegian - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Persian - \o 0- - \o - \o - \o - \row - \o Polish - \o 1 - \o 2-4, 22-24, 32-34... - \o 5-21, 25-31, 35-41... - \o - \row - \o Portugese-BR - \o 0, 1 - \o 2-100, 101- - \o - \o - \row - \o Portugese-PT - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Romanian - \o 1 - \o 0, 2-19, 101-119, 201-219... - \o 20-100, 120-200, 220-300... - \o - \row - \o Russian - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Serbian - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Slovak - \o 1 - \o 2-4 - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Slovene - \o 1, 101, 201, 301... - \o 2, 102, 202, 302... - \o 3, 4, 103, 104, 203, 204, 303, 304... - \o 0, 5-100, 105-200, 205-300... - \row - \o Spanish-US - \o 1 - \o 0, 2- - \o - \o - \row - \o Spanish-ES - \o 1 - \o 0, 2- - \o - \o - \row - \o Swedish - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Tagalog - \o 0, 1 - \o 2, 3, 5, 7-8, 10-13, 15, 17-18, 20-23...101...1001 - \o 4, 6, 9, 14, 16, 19, 24, 26, 29...104, 106, 109... - \o - \row - \o Thai - \o 0- - \o - \o - \o - \row - \o Turkish - \o 0- - \o - \o - \o - \row - \o Ukrainian - \o 1, 21, 31, 41, 51, 61, 71, 81, 91, 101... - \o 2-4, 22-24, 32-34... - \o 0, 5-20, 25-30, 35-40... - \o - \row - \o Urdu - \o 1 - \o 0, 2-100, 101- - \o - \o - \row - \o Vietnamese - \o 0- - \o - \o - \o - \endtable - - These rules are embedded within the Qt libraries, there is no need for - the developer to know them. Merely to use the correct \c tr() call. - + The use of numbered arguments is often accompanied by the use of + plurals in the source text. In many languages, the form of the + text will depend on the value shown, and more than one translation + is required. If the developers have marked up the source text in + correct way, fields for each of the possible plural forms will be + available in the translation area. (The + \l{Writing Source Code for Translation#Handling Plurals}{Writing Source Code for Translation} + document contains details about this feature for developers.) \section2 Reusing Translations @@ -1157,7 +835,7 @@ {translation area}, and adapts the number of input fields for plural forms accordingly. If not explicitly set, \QL guesses the target language and country by evaluating the translation source - file name: E.g. \c app_de.ts sets the target language to German, + file name. For example, \c app_de.ts sets the target language to German, and \c app_de_ch.ts sets the target language to German and the target country to Switzerland (this also helps loading translations for the current locale automatically; see @@ -1287,7 +965,7 @@ can be used to edit XLIFF files generated by other programs. For standard Qt projects, however, only the TS file format is used. \o QM \e {Qt message files} \BR are binary files that contain - translations used by an application at runtime. These files are + translations used by an application at run-time. These files are generated by \l lrelease, but can also be generated by \QL. \o \c .qph \e {Qt phrase book files} \BR are human-readable XML files containing standard phrases and their translations. These files @@ -1416,7 +1094,7 @@ \endlist - \o \gui {Tools} + \o \gui {Tools} \list \o \gui {Batch Translation...} \BR Opens a \l{Batch @@ -1427,7 +1105,7 @@ Preview}. This window let you instantly see translations for forms created with \QD. \endlist - \o \gui {View} + \o \gui {View} \list \o \gui {Revert Sorting} \BR puts the items in the \l{Context @@ -1449,7 +1127,7 @@ \endlist - \o \gui {Help} + \o \gui {Help} \list \o \gui {Manual F1} \BR opens this manual. \o \gui {About Qt Linguist} \BR Shows information about \QL. @@ -1621,7 +1299,7 @@ \code CODECFORTR = UTF-8 \endcode - + See the \l lupdate and \l lrelease sections. \section2 Loading Translations @@ -1683,7 +1361,7 @@ \snippet doc/src/snippets/code/doc_src_linguist-manual.qdoc 9 - \section2 Distinguishing Identical Strings That Require Different Translations + \section2 Distinguishing Between Identical Translatable Strings The \l lupdate program automatically provides a \e context for every source text. This context is the class name of the class that contains diff --git a/doc/src/snippets/code/doc_src_i18n.qdoc b/doc/src/snippets/code/doc_src_i18n.qdoc index eca2868..80faabc 100644 --- a/doc/src/snippets/code/doc_src_i18n.qdoc +++ b/doc/src/snippets/code/doc_src_i18n.qdoc @@ -184,7 +184,7 @@ void Clock::setTime(const QTime &time) //! [12] -void QWidget::changeEvent(QEvent *event) +void MyWidget::changeEvent(QEvent *event) { if (e->type() == QEvent::LanguageChange) { titleLabel->setText(tr("Document Title")); diff --git a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp index 4c64374..88d8025 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qobject.cpp @@ -235,9 +235,8 @@ MyWindow::MyWindow() { QLabel *senderLabel = new QLabel(tr("Name:")); QLabel *recipientLabel = new QLabel(tr("Name:", "recipient")); - ... -} //! [17] +} //! [18] diff --git a/examples/mainwindows/sdi/mainwindow.h b/examples/mainwindows/sdi/mainwindow.h index ca478df..a925e2f 100644 --- a/examples/mainwindows/sdi/mainwindow.h +++ b/examples/mainwindows/sdi/mainwindow.h @@ -50,12 +50,14 @@ class QMenu; class QTextEdit; QT_END_NAMESPACE +//! [class definition with macro] class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); +//! [class definition with macro] MainWindow(const QString &fileName); protected: diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 7be19b3..7031957 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -582,7 +582,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) QObjects organize themselves in object trees. When you create a QObject with another object as parent, the object will automatically add itself to the parent's children() list. The - parent takes ownership of the object i.e. it will automatically + parent takes ownership of the object; i.e., it will automatically delete its children in its destructor. You can look for an object by name and optionally type using findChild() or findChildren(). @@ -646,7 +646,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) to be stored in one of the container classes. You must store pointers. - \section2 Auto-Connection + \section1 Auto-Connection Qt's meta-object system provides a mechanism to automatically connect signals and slots between QObject subclasses and their children. As long @@ -660,7 +660,7 @@ int QMetaCallEvent::placeMetaCall(QObject *object) given in the \l{Using a Designer UI File in Your Application} section of the \QD manual. - \section2 Dynamic Properties + \section1 Dynamic Properties From Qt 4.2, dynamic properties can be added to and removed from QObject instances at run-time. Dynamic properties do not need to be declared at @@ -673,6 +673,15 @@ int QMetaCallEvent::placeMetaCall(QObject *object) and both standard Qt widgets and user-created forms can be given dynamic properties. + \section1 Internationalization (i18n) + + All QObject subclasses support Qt's translation features, making it possible + to translate an application's user interface into different languages. + + To make user-visible text translatable, it must be wrapped in calls to + the tr() function. This is explained in detail in the + \l{Writing Source Code for Translation} document. + \sa QMetaObject, QPointer, QObjectCleanupHandler, Q_DISABLE_COPY() {Object Trees and Object Ownership} */ @@ -2157,65 +2166,10 @@ void QObject::deleteLater() otherwise returns \a sourceText itself if no appropriate translated string is available. - See the sections below on Disambiguation and Handling Plurals for more - information about the optional \a disambiguation and \a n parameters. - - QObject and its subclasses obtain translated strings from any translator - objects that have been installed on the application object; see the - QTranslator documentation for details about this mechanism. - - A translatable string is referenced by its translation context; - this is the name of the QObject subclass whose tr() function is invoked, - as in the following example: - + Example: \snippet mainwindows/sdi/mainwindow.cpp implicit tr context \dots - Here, the context is \c MainWindow because it is the \c MainWindow::tr() - function that is invoked. Translation contexts can be given explicitly - by fully qualifying the call to tr(); for example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp explicit tr context - - This call obtains the translated text for "Page up" from the \c QScrollBar - context. - - \section1 Defining Translation Contexts - - The translation context for QObject and each QObject subclass is the - class name itself. Developers subclassing QObject must use the - Q_OBJECT macro in their class definition to override the translation - context. This macro sets the context to the name of the subclass. - - If Q_OBJECT is not used in a class definition, the context will be - inherited from the base class. For example, since all QObject-based - classes in Qt provide a context, a new QWidget subclass defined without - a Q_OBJECT macro will use the "QWidget" context if its tr() function - is invoked. - - \section1 Translator Comments - - Developers can include information about each translatable string to - help translators with the translation process. These are extracted - when \l lupdate is used to process the source files. The recommended - way to add comments is to annotate the tr() calls in your code with - comments of the form: - - \tt{//: ...} - - or - - \tt{\begincomment: ... \endcomment} - - Examples: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 40 - - In these examples, the comments will be associated with the strings - passed to tr() in the context of each call. - - \section1 Disambiguation - If the same \a sourceText is used in different roles within the same context, an additional identifying string may be passed in \a disambiguation (0 by default). In Qt 4.4 and earlier, this was @@ -2224,76 +2178,12 @@ void QObject::deleteLater() Example: \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17 + \dots - \section1 Meta Data - - Additional data can be attached to each translatable message. - The syntax: - - \tt{//= } - - can be used to give the message a unique identifier to support tools - which need it. - The syntax: - - \tt{//~ } - - can be used to attach meta data to the message. The field name should consist - of a domain prefix (possibly the conventional file extension of the file format - the field is inspired by), a hyphen and the actual field name in - underscore-delimited notation. For storage in TS files, the field name together - with the prefix "extra-" will form an XML element name. The field contents will - be XML-escaped, but otherwise appear verbatim as the element's contents. - Any number of unique fields can be added to each message. - - Example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp meta data - - Meta data appearing right in front of a magic TRANSLATOR comment applies to the - whole TS file. - - \section1 Character Encodings - - You can set the encoding for \a sourceText by calling QTextCodec::setCodecForTr(). - By default \a sourceText is assumed to be in Latin-1 encoding. - - \section1 Handling Plurals - - If \a n >= 0, all occurrences of \c %n in the resulting string - are replaced with a decimal representation of \a n. In addition, - depending on \a n's value, the translation text may vary. - - Example: - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 18 - - The table below shows what string is returned depending on the - active translation: - - \table - \header \o \o{3,1} Active Translation - \header \o \a n \o No Translation \o French \o English - \row \o 0 \o "0 message(s) saved" \o "0 message sauvegard\unicode{0xE9}" \o "0 message\bold{s} saved" - \row \o 1 \o "1 message(s) saved" \o "1 message sauvegard\unicode{0xE9}" \o "1 message saved" - \row \o 2 \o "2 message(s) saved" \o "2 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "2 message\bold{s} saved" - \row \o 37 \o "37 message(s) saved" \o "37 message\bold{s} sauvegard\unicode{0xE9}\bold{s}" \o "37 message\bold{s} saved" - \endtable - - This idiom is more flexible than the traditional approach; e.g., - - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 19 - - because it also works with target languages that have several - plural forms (e.g., Irish has a special "dual" form that should - be used when \c n is 2), and it handles the \e n == 0 case - correctly for languages such as French that require the singular. - See the \l{Qt Linguist Manual} for details. - - Instead of \c %n, you can use \c %Ln to produce a localized - representation of \a n. The conversion uses the default locale, - set using QLocale::setDefault(). (If no default locale was - specified, the "C" locale is used.) + See \l{Writing Source Code for Translation} for a detailed description of + Qt's translation mechanisms in general, and the + \l{Writing Source Code for Translation#Disambiguation}{Disambiguation} + section for information on disambiguation. \warning This method is reentrant only if all translators are installed \e before calling this method. Installing or removing -- cgit v0.12 From 50a745d31e348c113d42444d527b4286b7064e3e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 15:30:15 +0100 Subject: Doc: Fixed qdoc warnings. Reviewed-by: Trust Me --- src/gui/kernel/qevent.cpp | 2 +- src/gui/symbian/qsymbianevent.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 065bd09..617d016 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4330,7 +4330,7 @@ bool QGestureEvent::isAccepted(QGesture *gesture) const } /*! - Sets the widget for this event. + Sets the widget for this event to the \a widget specified. */ void QGestureEvent::setWidget(QWidget *widget) { diff --git a/src/gui/symbian/qsymbianevent.cpp b/src/gui/symbian/qsymbianevent.cpp index af2c861..2799e6f 100644 --- a/src/gui/symbian/qsymbianevent.cpp +++ b/src/gui/symbian/qsymbianevent.cpp @@ -66,13 +66,13 @@ QT_BEGIN_NAMESPACE */ /*! - \fn QSymbianEvent::type() + \fn QSymbianEvent::type() const Returns the event type contained in the QSymbianEvent instance. */ /*! - \fn QSymbianEvent::isValid() + \fn QSymbianEvent::isValid() const Returns whether this QSymbianEvent instance contains a valid event. */ -- cgit v0.12 From cf800465369fb1ef84e8bddbbbfa7128d95afd27 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 2 Nov 2009 15:34:27 +0100 Subject: Sanitize building Qt with OpenGL ES support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit introduce QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL and QMAKE_LIBS_OPENGL_ES2 so we do not have to force users to copy/paste around entire mkspecs just to change the OpenGL backend. This should make the "-opengl es2" (and friends) configure option work out of the box with any mkspec on Linux+WinCE. Also removes a WinCE specific hack that is not required anymore. Reviewed-by: Tom Cooksey Reviewed-by: Trond Kjernåsen Approved-by: Lars Knoll --- config.tests/unix/opengles1/opengles1.pro | 6 +++--- config.tests/unix/opengles1cl/opengles1cl.pro | 6 +++--- config.tests/unix/opengles2/opengles2.pro | 6 +++--- doc/src/development/qmake-manual.qdoc | 23 +++++++++++++++++++++++ mkspecs/common/linux.conf | 9 +++++++++ mkspecs/common/wince/qmake.conf | 4 ++++ mkspecs/features/unix/opengl.prf | 26 ++++++++++++++++++++++---- src/opengl/opengl.pro | 22 ++++++++++------------ 8 files changed, 77 insertions(+), 25 deletions(-) diff --git a/config.tests/unix/opengles1/opengles1.pro b/config.tests/unix/opengles1/opengles1.pro index ad8dd31..1469aa9 100644 --- a/config.tests/unix/opengles1/opengles1.pro +++ b/config.tests/unix/opengles1/opengles1.pro @@ -1,9 +1,9 @@ SOURCES = opengles1.cpp -INCLUDEPATH += $$QMAKE_INCDIR_OPENGL +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1 -for(p, QMAKE_LIBDIR_OPENGL) { +for(p, QMAKE_LIBDIR_OPENGL_ES1) { exists($$p):LIBS += -L$$p } CONFIG -= qt -LIBS += $$QMAKE_LIBS_OPENGL_QT +LIBS += $$QMAKE_LIBS_OPENGL_ES1 diff --git a/config.tests/unix/opengles1cl/opengles1cl.pro b/config.tests/unix/opengles1cl/opengles1cl.pro index 415cdbb..c4c069e 100644 --- a/config.tests/unix/opengles1cl/opengles1cl.pro +++ b/config.tests/unix/opengles1cl/opengles1cl.pro @@ -1,9 +1,9 @@ SOURCES = opengles1cl.cpp -INCLUDEPATH += $$QMAKE_INCDIR_OPENGL +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL -for(p, QMAKE_LIBDIR_OPENGL) { +for(p, QMAKE_LIBDIR_OPENGL_ES1CL) { exists($$p):LIBS += -L$$p } CONFIG -= qt -LIBS += $$QMAKE_LIBS_OPENGL_QT +LIBS += $$QMAKE_LIBS_OPENGL_ES1CL diff --git a/config.tests/unix/opengles2/opengles2.pro b/config.tests/unix/opengles2/opengles2.pro index 0dfae42..c383fd0 100644 --- a/config.tests/unix/opengles2/opengles2.pro +++ b/config.tests/unix/opengles2/opengles2.pro @@ -1,9 +1,9 @@ SOURCES = opengles2.cpp -INCLUDEPATH += $$QMAKE_INCDIR_OPENGL +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2 -for(p, QMAKE_LIBDIR_OPENGL) { +for(p, QMAKE_LIBDIR_OPENGL_ES2) { exists($$p):LIBS += -L$$p } CONFIG -= qt -LIBS += $$QMAKE_LIBS_OPENGL_QT +LIBS += $$QMAKE_LIBS_OPENGL_ES2 diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 6c53242..09f1b9b 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2252,6 +2252,18 @@ For example: If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_INCDIR_EGL may also need to be set. + \section1 QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES1CL, QMAKE_INCDIR_OPENGL_ES2 + + These variables contain the location of OpenGL headers files to be added + to INCLUDEPATH when building an application with OpenGL ES 1, OpenGL ES 1 Common + Lite or OpenGL ES 2 support respectively. + + The value of this variable is typically handled by \c qmake or + \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + + If the OpenGL implementation uses EGL (most OpenGL/ES systems), + then QMAKE_INCDIR_EGL may also need to be set. + \target QMAKE_INCDIR_OPENVG \section1 QMAKE_INCDIR_OPENVG @@ -2496,6 +2508,17 @@ For example: variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + \section1 QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL, QMAKE_LIBS_OPENGL_ES2 + + These variables contain all the OpenGL libraries for OpenGL ES 1, + OpenGL ES 1 Common Lite profile and OpenGL ES 2. + + The value of these variables is typically handled by \c qmake or + \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. + + If the OpenGL implementation uses EGL (most OpenGL/ES systems), + then QMAKE_LIBS_EGL may also need to be set. + \section1 QMAKE_LIBS_OPENVG This variable contains all OpenVG libraries. The value of this diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index cc5c38b..1ae5608 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -13,6 +13,12 @@ QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib +QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL +QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL +QMAKE_INCDIR_OPENGL_ES1CL = $$QMAKE_INCDIR_OPENGL +QMAKE_LIBDIR_OPENGL_ES1CL = $$QMAKE_LIBDIR_OPENGL +QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL +QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = QMAKE_LIBDIR_EGL = QMAKE_INCDIR_OPENVG = @@ -26,6 +32,9 @@ QMAKE_LIBS_NIS = -lnsl QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGLU -lGL QMAKE_LIBS_OPENGL_QT = -lGL +QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM +QMAKE_LIBS_OPENGL_ES1CL = -lGLES_CL +QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index d6e4ba7..d87be02 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -64,6 +64,10 @@ QMAKE_LIBS_NETWORK = ws2.lib QMAKE_LIBS_OPENGL = QMAKE_LIBS_COMPAT = +QMAKE_LIBS_OPENGL_ES1 = libGLES_CM.lib +QMAKE_LIBS_OPENGL_ES1CL = libGLES_CL.lib +QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib + QMAKE_LIBS_QT_ENTRY = -lqtmain QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe diff --git a/mkspecs/features/unix/opengl.prf b/mkspecs/features/unix/opengl.prf index 2fdf324..f2db819 100644 --- a/mkspecs/features/unix/opengl.prf +++ b/mkspecs/features/unix/opengl.prf @@ -1,4 +1,22 @@ -INCLUDEPATH += $$QMAKE_INCDIR_OPENGL -!isEmpty(QMAKE_LIBDIR_OPENGL):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL -target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_QT -else:LIBS += $$QMAKE_LIBS_OPENGL +contains(QT_CONFIG, opengles1) { + INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1 + !isEmpty(QMAKE_LIBDIR_OPENGL_ES1):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1 + target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1 + else:LIBS += $$QMAKE_LIBS_OPENGL_ES1 +} else:contains(QT_CONFIG, opengles1cl) { + INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL + !isEmpty(QMAKE_LIBDIR_OPENGL_ES1CL):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1CL + target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL + else:LIBS += $$QMAKE_LIBS_OPENGL_ES1CL +} else:contains(QT_CONFIG, opengles2) { + INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2 + !isEmpty(QMAKE_LIBDIR_OPENGL_ES2):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2 + target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES2 + else:LIBS += $$QMAKE_LIBS_OPENGL_ES2 +} else { + INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + !isEmpty(QMAKE_LIBDIR_OPENGL):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL + target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_QT + else:LIBS += $$QMAKE_LIBS_OPENGL +} + diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index a212675..7d6052b 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -103,7 +103,7 @@ x11 { LIBS_PRIVATE += -lfreetype } else { ### Note: how does this compile with a non-system freetype? - # This probably doesn't compile + # This probably does not compile } } else { DEFINES *= QT_NO_FREETYPE @@ -150,17 +150,15 @@ embedded { INCLUDEPATH += ../3rdparty/harfbuzz/src -wince*: { - contains(QT_CONFIG,opengles1) { - QMAKE_LIBS += "libGLES_CM.lib" - } - contains(QT_CONFIG,opengles1cl) { - QMAKE_LIBS += "libGLES_CL.lib" - } - contains(QT_CONFIG,opengles2) { - QMAKE_LIBS += "libGLESv2.lib" - } - +contains(QT_CONFIG,opengles1) { + LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1 + LIBS += $$QMAKE_LFLAGS_OPENGL_ES1 +} else:contains(QT_CONFIG,opengles1cl) { + LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL + LIBS += $$QMAKE_LFLAGS_OPENGL_ES1CL +} else:contains(QT_CONFIG,opengles2) { + LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES2 + LIBS += $$QMAKE_LFLAGS_OPENGL_ES2 } else { LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL LIBS += $$QMAKE_LFLAGS_OPENGL -- cgit v0.12 From ab473d6a8e4fa619537c4cdaaf1b6a9d8544b30a Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 2 Nov 2009 15:30:55 +0100 Subject: Fixed holes in thick strokes. When stroking small paths with a thick pen, it looked like the winding fill rule was ignored. The bug was in the stroke generator which generated paths where the winding number could incorrectly become zero. Task-number: QTBUG-1537 Reviewed-by: Gunnar --- src/gui/painting/qstroker.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index c57b3c1..228a6b1 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -452,6 +452,17 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine #endif if (join == FlatJoin) { + QLineF prevLine(qt_fixed_to_real(m_back2X), qt_fixed_to_real(m_back2Y), + qt_fixed_to_real(m_back1X), qt_fixed_to_real(m_back1Y)); + QPointF isect; + QLineF::IntersectType type = prevLine.intersect(nextLine, &isect); + QLineF shortCut(prevLine.p2(), nextLine.p1()); + qreal angle = shortCut.angleTo(prevLine); + if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) { + emitLineTo(focal_x, focal_y); + emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1())); + return; + } emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1())); @@ -468,8 +479,8 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine // If we are on the inside, do the short cut... QLineF shortCut(prevLine.p2(), nextLine.p1()); qreal angle = shortCut.angleTo(prevLine); - if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) { + emitLineTo(focal_x, focal_y); emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1())); return; } @@ -509,8 +520,9 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine qfixed offset = m_strokeWidth / 2; QLineF shortCut(prevLine.p2(), nextLine.p1()); - qreal angle = prevLine.angle(shortCut); + qreal angle = shortCut.angleTo(prevLine); if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) { + emitLineTo(focal_x, focal_y); emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1())); return; } @@ -581,6 +593,13 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine qt_real_to_fixed(l1.x1()), qt_real_to_fixed(l1.y1())); } else if (join == SvgMiterJoin) { + QLineF shortCut(prevLine.p2(), nextLine.p1()); + qreal angle = shortCut.angleTo(prevLine); + if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) { + emitLineTo(focal_x, focal_y); + emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1())); + return; + } QLineF miterLine(QPointF(qt_fixed_to_real(focal_x), qt_fixed_to_real(focal_y)), isect); if (miterLine.length() > qt_fixed_to_real(m_strokeWidth * m_miterLimit) / 2) { -- cgit v0.12 From 243163c3f61c79146c37da0a4da4bacafa8e1321 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 2 Nov 2009 16:06:06 +0100 Subject: Fixed test, QGraphicsSourceEffect::pixmap(), caching caused failure. Reviewed-by: Samuel --- src/gui/effects/qgraphicseffect.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 3a6bab5..f24d424 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -97,6 +97,8 @@ */ #include "qgraphicseffect_p.h" +#include "private/qgraphicsitem_p.h" + #include #include @@ -260,6 +262,12 @@ QPixmap QGraphicsEffectSource::pixmap(Qt::CoordinateSystem system, QPoint *offse return ((QGraphicsPixmapItem *) item)->pixmap(); } + if (system == Qt::DeviceCoordinates && item + && !static_cast(d_func())->info) { + qWarning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context"); + return QPixmap(); + } + QPixmap pm; if (d->m_cachedSystem == system && d->m_cachedMode == mode) QPixmapCache::find(d->m_cacheKey, &pm); -- cgit v0.12 From c4ce16e1eaa4504787f4cc739f3af7d1fdea8351 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 16:11:49 +0100 Subject: Fixed main window closing when subwindows cancel their close events. Reviewed-by: Trust Me Reported-here: http://lists.trolltech.com/pipermail/qt4-preview-feedback /2009-October/001023.html --- examples/mainwindows/mdi/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mainwindows/mdi/mainwindow.cpp b/examples/mainwindows/mdi/mainwindow.cpp index 712d91f..edb33b7 100644 --- a/examples/mainwindows/mdi/mainwindow.cpp +++ b/examples/mainwindows/mdi/mainwindow.cpp @@ -71,7 +71,7 @@ MainWindow::MainWindow() void MainWindow::closeEvent(QCloseEvent *event) { mdiArea->closeAllSubWindows(); - if (activeMdiChild()) { + if (mdiArea->currentSubWindow()) { event->ignore(); } else { writeSettings(); -- cgit v0.12 From 915f20bb167aa09ca8c8db478a2a78d5e357b67e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 2 Nov 2009 16:58:56 +0100 Subject: Better cosmetic pen scaling for beziers in tristroker. Reviewed-By: Samuel --- src/opengl/gl2paintengineex/qtriangulatingstroker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp index ad18a51..1163eba 100644 --- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp +++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp @@ -114,7 +114,7 @@ void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen) if (m_join_style == Qt::RoundJoin) m_join_style = Qt::MiterJoin; m_curvyness_add = 0.5; - m_curvyness_mul = CURVE_FLATNESS; + m_curvyness_mul = CURVE_FLATNESS / m_inv_scale; m_roundness = 1; } else if (cosmetic) { m_curvyness_add = realWidth / 2; -- cgit v0.12 From 803fb60b1e98beddf4ebb8ea1a9224889c392e4e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 2 Nov 2009 17:34:41 +0100 Subject: Doc: Added a note about QApplication::installTranslator(). Reviewed-by: Alessandro Portale --- doc/src/internationalization/i18n.qdoc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index 1a2839d..2d1b8cc 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -439,9 +439,13 @@ application language. The default event handler for QWidget subclasses responds to the - QEvent::LanguageChange event, and will call this function when necessary; - other application components can also force widgets to update themselves - by posting the \l{QEvent::LanguageChange}{LanguageChange} event to them. + QEvent::LanguageChange event, and will call this function when necessary. + + \l{QEvent::LanguageChange}{LanguageChange} events are posted when a new + translation is installed using the QCoreApplication::installTranslator() + function. Additionally, other application components can also force + widgets to update themselves by posting LanguageChange events to them. + \section1 Translating Non-Qt Classes -- cgit v0.12 From 83e497fdae56e11c79d913cdc665e78615291e9c Mon Sep 17 00:00:00 2001 From: Jure Repinc Date: Mon, 2 Nov 2009 17:48:36 +0100 Subject: Updated Slovenian translation of Qt libraries Merge-request: 1977 Reviewed-by: Oswald Buddenhagen --- translations/qt_sl.ts | 1785 +++++++++++++++++++++++++++---------------------- 1 file changed, 986 insertions(+), 799 deletions(-) diff --git a/translations/qt_sl.ts b/translations/qt_sl.ts index 517ce71..c7684e3 100644 --- a/translations/qt_sl.ts +++ b/translations/qt_sl.ts @@ -12,7 +12,7 @@ FakeReply - + Fake error ! Lažna napaka. @@ -23,14 +23,6 @@ - InputPrivate - - - PUSH: read in bytes = %1 (frames=%2) - - - - Phonon:: @@ -117,10 +109,10 @@ da je nameščen paket libgstreamer-plugins-base. Manjka potreben kodek. Za predvajanje te vsebine morate namestiti sledeče kodeke: %0 - + - + @@ -129,12 +121,12 @@ da je nameščen paket libgstreamer-plugins-base. Ni moč odpreti večpredstavnostnega vira. - + Invalid source type. Neveljavna vrsta vira. - + Could not locate media source. Ni moč najti večpredstavnostnega vira. @@ -150,11 +142,63 @@ da je nameščen paket libgstreamer-plugins-base. + Phonon::MMF + + + Audio Output + Predvajanje zvoka + + + + The audio output device + Naprava za predvajanje zvoka + + + Phonon::MMF::AudioEqualizer - + Frequency band, %1 Hz - + Frekvenčni pas, %1 Hz + + + + Phonon::MMF::EffectFactory + + + audio equalizer + izenačevalnik zvoka + + + + Bass boost + Ojačanje basov + + + + Distance Attenuation + Utišanje zaradi razdalje + + + + + Environmental Reverb + Okoljsko odmevanje + + + + Loudness + Glasnost + + + + Source Orientation + Usmerjenost vira + + + + Stereo Widening + Razširitev sterea @@ -888,7 +932,7 @@ v Dejanje na vtičnici ni podprto - + Socket operation timed out Čas za dejanje na vtičnici je potekel @@ -922,6 +966,14 @@ v + QAccessibleButton + + + Press + Pritisni + + + QApplication @@ -939,7 +991,7 @@ v Napaka nezdružljivosti knjižnice Qt - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -951,117 +1003,6 @@ v - QAudioInputPrivate - - - QAudioInput: snd_pcm_hw_params_any: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_rate_resample: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_access: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_format: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_channels: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_rate_near: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_buffer_time_near: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_period_time_near: err = %1 - - - - - QAudioInput: snd_pcm_hw_params_set_periods_near: err = %1 - - - - - QAudioInput: snd_pcm_hw_params: err = %1 - - - - - PULL: read in bytes = %1 (frames=%2) - - - - - QAudioOutputPrivate - - - QAudioOutput: snd_pcm_hw_params_any: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_rate_resample: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_access: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_format: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_channels: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_rate_near: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_buffer_time_near: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_period_time_near: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params_set_periods_near: err = %1 - - - - - QAudioOutput: snd_pcm_hw_params: err = %1 - - - - QAxSelect @@ -1087,7 +1028,7 @@ v QCheckBox - + Uncheck Odznači @@ -1105,7 +1046,7 @@ v QColorDialog - + Hu&e: &Odtenek: @@ -1145,7 +1086,7 @@ v Izberite barvo - + &Basic colors &Osnovne barve @@ -1214,7 +1155,7 @@ v %1: does not exist QSystemSemaphore - %1: ne obstaja + %1: ne obstaja @@ -1345,7 +1286,7 @@ v - + OK V redu @@ -1544,7 +1485,7 @@ v Usodna napaka: - + &Show this message again &To sporočilo naslednjič spet prikaži @@ -1565,7 +1506,7 @@ v Will not rename sequential file using block copy - + Sekvenčna datoteka ne bo preimenovana z uporabo kopiranja blokov @@ -1596,7 +1537,7 @@ v QFileDialog - + All Files (*) Vse datoteke (*) @@ -1724,7 +1665,7 @@ Ali jo kljub temu želite izbrisati? Ni bilo moč izbrisati mape. - + Recent Places Nedavna mesta @@ -1734,12 +1675,12 @@ Ali jo kljub temu želite izbrisati? Vse datoteke (*.*) - + Save As Shrani kot - + Drive Pogon @@ -1918,50 +1859,50 @@ Ali jo kljub temu želite izbrisati? QFontDatabase - + Normal Normalno - + - + Bold Polkrepko - - + + Demi Bold - + - + Black Črni - + Demi - + Light Lahko - - + + Italic Ležeče - - + + Oblique Nagnjeno @@ -2063,32 +2004,32 @@ Ali jo kljub temu želite izbrisati? Thai - Tajski + Tajska Lao - Laoška + Laoška Tibetan - tibetansko + Tibetanska Myanmar - Mjanmar + Mjanmarska Georgian - gruzijsko + Gruzijska Khmer - Kmersko + Kmerska @@ -2118,7 +2059,7 @@ Ali jo kljub temu želite izbrisati? Symbol - Znak + Simbol @@ -2134,7 +2075,7 @@ Ali jo kljub temu želite izbrisati? QFontDialog - + &Font &Pisava @@ -2174,7 +2115,7 @@ Ali jo kljub temu želite izbrisati? S&istem pisanja - + Select Font Izberite pisavo @@ -2337,13 +2278,9 @@ Ali jo kljub temu želite izbrisati? QHostInfoAgent - - - + - - - + Host not found Ni moč najti gostitelja @@ -2364,20 +2301,20 @@ Ali jo kljub temu želite izbrisati? Neznana napaka - + No host name given - Podano ni bilo nobeno ime gostitelja + Podano ni bilo nobeno ime gostitelja Invalid hostname - Neveljavno ime gostitelja + Neveljavno ime gostitelja QHttp - + @@ -2409,7 +2346,7 @@ Ali jo kljub temu želite izbrisati? Strežnik je nepričakovano prekinil povezavo - + Unknown authentication method Neznan način overjanja @@ -2419,13 +2356,13 @@ Ali jo kljub temu želite izbrisati? Napaka pri pisanju odziva na napravo - + Connection refused Povezava je zavrnjena - + Host %1 not found @@ -2440,7 +2377,7 @@ Ali jo kljub temu želite izbrisati? Zahtevek HTTP ni uspel - + Invalid HTTP response header Neveljavna glava odgovora HTTP @@ -2495,7 +2432,7 @@ Ali jo kljub temu želite izbrisati? Potrebna je overitev - + Connection refused (or timed out) Povezava je bila zavrnjena (ali pa je potekel čas) @@ -2694,7 +2631,7 @@ Ali jo kljub temu želite izbrisati? QIODevice - + Permission denied Nimate dovoljenja @@ -3174,7 +3111,7 @@ Ali jo kljub temu želite izbrisati? QMenuBar - + Actions Dejanja @@ -3527,7 +3464,7 @@ Ali jo kljub temu želite izbrisati? Unable to alloc statement - + Ni moč dodeliti izjave @@ -3553,7 +3490,7 @@ Ali jo kljub temu želite izbrisati? QODBCDriver - + Unable to connect Ni moč vzpostaviti povezave @@ -3586,7 +3523,7 @@ Ali jo kljub temu želite izbrisati? QODBCResult - + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration QODBCResult::reset: ni moč nastaviti 'SQL_CURSOR_STATIC' kot lastnosti izjave. Preverite nastavitve gonilnika ODBC @@ -3638,7 +3575,7 @@ Ali jo kljub temu želite izbrisati? QObject - + Invalid hostname Neveljavno ime gostitelja @@ -3668,42 +3605,6 @@ Ali jo kljub temu želite izbrisati? No host name given Podano ni bilo nobeno ime gostitelja - - - audio equalizer - - - - - Bass boost - - - - - Distance Attenuation - - - - - - Environmental Reverb - - - - - Loudness - - - - - Source Orientation - - - - - Stereo Widening - - QPPDOptionsModel @@ -4050,7 +3951,7 @@ Ali jo kljub temu želite izbrisati? US Common #10 Envelope (105 x 241 mm) - + OK V redu @@ -4610,7 +4511,7 @@ Izberite drugo ime datoteke. Čas za dejanje procesa je potekel - + @@ -4826,32 +4727,32 @@ Izberite drugo ime datoteke. ID - + ID Location - + Lokacija Condition - + Pogoj Ignore-count - + Število prezrtij Single-shot - + Enojen zadetek Hit-count - + Število zadetkov @@ -4859,12 +4760,12 @@ Izberite drugo ime datoteke. New - + Nova Delete - Izbriši + Izbriši @@ -4873,17 +4774,17 @@ Izberite drugo ime datoteke. Go to Line - + Pojdi v vrstico Line: - + Vrstica: Interrupt - + Prekini @@ -4893,7 +4794,7 @@ Izberite drugo ime datoteke. Continue - Nadaljuj + Nadaljuj @@ -4903,7 +4804,7 @@ Izberite drugo ime datoteke. Step Into - + Vstopi @@ -4913,7 +4814,7 @@ Izberite drugo ime datoteke. Step Over - + Prestopi @@ -4923,7 +4824,7 @@ Izberite drugo ime datoteke. Step Out - + Izstopi @@ -4933,7 +4834,7 @@ Izberite drugo ime datoteke. Run to Cursor - + Zaženi do kazalca @@ -4943,12 +4844,12 @@ Izberite drugo ime datoteke. Run to New Script - + Zaženi do novega skripta Toggle Breakpoint - + Preklopi prekinitveno točko @@ -4958,22 +4859,22 @@ Izberite drugo ime datoteke. Clear Debug Output - + Počisti razhroščevalni izhod Clear Error Log - + Počisti dnevnik napak Clear Console - + Počisti konzolo &Find in Script... - + Najdi v &skriptu ... @@ -4983,7 +4884,7 @@ Izberite drugo ime datoteke. Find &Next - + Najdi &naslednje @@ -4993,7 +4894,7 @@ Izberite drugo ime datoteke. Find &Previous - + Najdi &predhodno @@ -5008,7 +4909,7 @@ Izberite drugo ime datoteke. Debug - + Razhrošči @@ -5016,32 +4917,32 @@ Izberite drugo ime datoteke. Close - Zapri + Zapri Previous - + Predhodno Next - + Naslednje Case Sensitive - + Občutljivo na velikost črk Whole words - + Cele besede <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Search wrapped - + <img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Iskanje se nadaljuje na drugem koncu @@ -5049,12 +4950,12 @@ Izberite drugo ime datoteke. Name - Ime + Ime Value - Vrednost + Vrednost @@ -5062,17 +4963,17 @@ Izberite drugo ime datoteke. Level - + Stopnja Name - Ime + Ime Location - + Lokacija @@ -5080,22 +4981,22 @@ Izberite drugo ime datoteke. Toggle Breakpoint - + Preklopi prekinitveno točko Disable Breakpoint - + Onemogoči prekinitveno točko Enable Breakpoint - + Omogoči prekinitveno točko Breakpoint Condition: - + Pogoj za prelomno točko: @@ -5103,52 +5004,52 @@ Izberite drugo ime datoteke. Loaded Scripts - + Naloženi skripti Breakpoints - + Prelomne točke Stack - + Sklad Locals - + Krajevno Console - + Konzola Debug Output - + Razhroščevalni izhod Error Log - + Dnevnik napak Search - Išči + Išči View - + Videz Qt Script Debugger - + Razhroščevalnik za Qt Script @@ -5156,7 +5057,7 @@ Izberite drugo ime datoteke. Close - Zapri + Zapri @@ -5521,7 +5422,7 @@ Izberite drugo ime datoteke. Bass Boost - + Ojačanje basov @@ -5536,12 +5437,12 @@ Izberite drugo ime datoteke. Treble Up - + Več visokih tonov Treble Down - + Manj visokih tonov @@ -5736,7 +5637,7 @@ Izberite drugo ime datoteke. Select - Izberi + Izberi @@ -5771,17 +5672,17 @@ Izberite drugo ime datoteke. Call - Pokliči + Pokliči Hangup - Odloži + Odloži Flip - Obrni + Obrni @@ -5954,7 +5855,7 @@ Izberite drugo ime datoteke. Exit - Končaj + Končaj @@ -6176,7 +6077,7 @@ Izberite drugo ime datoteke. QTextControl - + &Undo &Razveljavi @@ -6219,7 +6120,7 @@ Izberite drugo ime datoteke. QToolButton - + Press Pritisni @@ -6334,12 +6235,12 @@ Izberite drugo ime datoteke. QWebFrame - + Request cancelled Zahtevek je bil preklican - + Request blocked Zahtevek je bil blokiran @@ -6367,12 +6268,12 @@ Izberite drugo ime datoteke. QWebPage - + Bad HTTP request Napačen zahtevek HTTP - + Submit default label for Submit buttons in forms on web pages Pošlji @@ -6390,7 +6291,7 @@ Izberite drugo ime datoteke. Ponastavi - + This is a searchable index. Enter search keywords: text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' To je stvarno kazalo z iskanjem. Vnesite iskane besede: @@ -6777,7 +6678,7 @@ Izberite drugo ime datoteke. Movie time scrubber Media controller element - + @@ -6805,7 +6706,7 @@ Izberite drugo ime datoteke. - Remaining move time + Remaining movie time Media controller element Preostali čas filma @@ -6900,7 +6801,7 @@ Izberite drugo ime datoteke. %1 (%2×%3 pik) - + Web Inspector - %2 Web Inspector - %2 @@ -6974,24 +6875,24 @@ Izberite drugo ime datoteke. %n file(s) number of chosen file - %n datotek - %n datotek - %n datotek + %n datoteka + %n datoteki + %n datoteke %n datotek - + JavaScript Alert - %1 Opozorilo JavaScript - %1 - + JavaScript Confirm - %1 Potrditev JavaScript - %1 - + JavaScript Prompt - %1 Poziv JavaScript - %1 @@ -7006,7 +6907,7 @@ Izberite drugo ime datoteke. Kot kaže ima skript na tej strani težavo. Ali želite ustaviti skript? - + Move the cursor to the next character Premakni kazalec na naslednji znak @@ -7215,6 +7116,12 @@ Izberite drugo ime datoteke. Align Right Poravnaj desno + + + Remaining move time + Media controller element + Preostali čas filma + QWhatsThisAction @@ -7227,7 +7134,7 @@ Izberite drugo ime datoteke. QWidget - + * * @@ -7902,20 +7809,20 @@ Izberite drugo ime datoteke. %1 takes at most %n argument(s). %2 is therefore invalid. + %1 potrebuje največ %n argument. %2 zato ni veljavno. + %1 potrebuje največ %n argumenta. %2 zato ni veljavno. + %1 potrebuje največ %n argumente. %2 zato ni veljavno. %1 potrebuje največ %n argumentov. %2 zato ni veljavno. - - - %1 requires at least %n argument(s). %2 is therefore invalid. + %1 potrebuje najmanj %n argument. %2 zato ni veljavno. + %1 potrebuje najmanj %n argumenta. %2 zato ni veljavno. + %1 potrebuje najmanj %n argumente. %2 zato ni veljavno. %1 potrebuje najmanj %n argumentov. %2 zato ni veljavno. - - - @@ -8613,277 +8520,207 @@ Izberite drugo ime datoteke. - - empty particle cannot be derived from non-empty particle - - - - - derived particle is missing element %1 - - - - - derived element %1 is missing value constraint as defined in base particle - - - - - derived element %1 has weaker value constraint than base particle - - - - - fixed value constraint of element %1 differs from value constraint in base particle - - - - - derived element %1 cannot be nillable as base element is not nillable - - - - - block constraints of derived element %1 must not be more weaker than in the base element - - - - - simple type of derived element %1 cannot be validly derived from base element - - - - - complex type of derived element %1 cannot be validly derived from base element - - - - - element %1 is missing in derived particle - - - - - element %1 does not match namespace constraint of wildcard in base particle - - - - - wildcard in derived particle is not a valid subset of wildcard in base particle - - - - - processContent of wildcard in derived particle is weaker than wildcard in base particle - - - - - derived particle allows content that is not allowed in the base particle - - - - %1 has inheritance loop in its base type %2 + %1 has inheritance loop in its base type %2. - circular inheritance of base type %1 + Circular inheritance of base type %1. - circular inheritance of union %1 + Circular inheritance of union %1. - %1 is not allowed to derive from %2 by restriction as the latter defines it as final + %1 is not allowed to derive from %2 by restriction as the latter defines it as final. - %1 is not allowed to derive from %2 by extension as the latter defines it as final + %1 is not allowed to derive from %2 by extension as the latter defines it as final. - base type of simple type %1 cannot be complex type %2 + Base type of simple type %1 cannot be complex type %2. - simple type %1 cannot have direct base type %2 + Simple type %1 cannot have direct base type %2. - simple type %1 is not allowed to have base type %2 + Simple type %1 is not allowed to have base type %2. - simple type %1 can only have simple atomic type as base type + Simple type %1 can only have simple atomic type as base type. - simple type %1 cannot derive from %2 as the latter defines restriction as final + Simple type %1 cannot derive from %2 as the latter defines restriction as final. - variety of item type of %1 must be either atomic or union + Variety of item type of %1 must be either atomic or union. - variety of member types of %1 must be atomic + Variety of member types of %1 must be atomic. - %1 is not allowed to derive from %2 by list as the latter defines it as final + %1 is not allowed to derive from %2 by list as the latter defines it as final. - simple type %1 is only allowed to have %2 facet + Simple type %1 is only allowed to have %2 facet. - base type of simple type %1 must have variety of type list + Base type of simple type %1 must have variety of type list. - base type of simple type %1 has defined derivation by restriction as final + Base type of simple type %1 has defined derivation by restriction as final. - item type of base type does not match item type of %1 + Item type of base type does not match item type of %1. - simple type %1 contains not allowed facet type %2 + Simple type %1 contains not allowed facet type %2. - %1 is not allowed to derive from %2 by union as the latter defines it as final + %1 is not allowed to derive from %2 by union as the latter defines it as final. - %1 is not allowed to have any facets + %1 is not allowed to have any facets. - base type %1 of simple type %2 must have variety of union + Base type %1 of simple type %2 must have variety of union. - base type %1 of simple type %2 is not allowed to have restriction in %3 attribute + Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute. - member type %1 cannot be derived from member type %2 of %3's base type %4 + Member type %1 cannot be derived from member type %2 of %3's base type %4. - derivation method of %1 must be extension because the base type %2 is a simple type + Derivation method of %1 must be extension because the base type %2 is a simple type. - complex type %1 has duplicated element %2 in its content model + Complex type %1 has duplicated element %2 in its content model. - complex type %1 has non-deterministic content + Complex type %1 has non-deterministic content. - attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3 + Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3. - content model of complex type %1 is not a valid extension of content model of %2 + Content model of complex type %1 is not a valid extension of content model of %2. - complex type %1 must have simple content + Complex type %1 must have simple content. - complex type %1 must have the same simple type as its base class %2 + Complex type %1 must have the same simple type as its base class %2. - complex type %1 cannot be derived from base type %2%3 + Complex type %1 cannot be derived from base type %2%3. - attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3 + Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3. - complex type %1 with simple content cannot be derived from complex base type %2 + Complex type %1 with simple content cannot be derived from complex base type %2. - item type of simple type %1 cannot be a complex type + Item type of simple type %1 cannot be a complex type. - member type of simple type %1 cannot be a complex type + Member type of simple type %1 cannot be a complex type. - %1 is not allowed to have a member type with the same name as itself + %1 is not allowed to have a member type with the same name as itself. - %1 facet collides with %2 facet + %1 facet collides with %2 facet. - %1 facet must have the same value as %2 facet of base type + %1 facet must have the same value as %2 facet of base type. - %1 facet must be equal or greater than %2 facet of base type + %1 facet must be equal or greater than %2 facet of base type. @@ -8895,7 +8732,7 @@ Izberite drugo ime datoteke. - %1 facet must be less than or equal to %2 facet of base type + %1 facet must be less than or equal to %2 facet of base type. @@ -8905,225 +8742,225 @@ Izberite drugo ime datoteke. - unknown notation %1 used in %2 facet + Unknown notation %1 used in %2 facet. - %1 facet contains invalid value %2: %3 + %1 facet contains invalid value %2: %3. - %1 facet cannot be %2 or %3 if %4 facet of base type is %5 + %1 facet cannot be %2 or %3 if %4 facet of base type is %5. - %1 facet cannot be %2 if %3 facet of base type is %4 + %1 facet cannot be %2 if %3 facet of base type is %4. - %1 facet must be less than or equal to %2 facet + %1 facet must be less than or equal to %2 facet. - %1 facet must be less than %2 facet of base type + %1 facet must be less than %2 facet of base type. - %1 facet and %2 facet cannot appear together + %1 facet and %2 facet cannot appear together. - %1 facet must be greater than %2 facet of base type + %1 facet must be greater than %2 facet of base type. - %1 facet must be less than %2 facet + %1 facet must be less than %2 facet. - %1 facet must be greater than or equal to %2 facet of base type + %1 facet must be greater than or equal to %2 facet of base type. - simple type contains not allowed facet %1 + Simple type contains not allowed facet %1. - %1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list + %1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list. - only %1 and %2 facets are allowed when derived by union + Only %1 and %2 facets are allowed when derived by union. - %1 contains %2 facet with invalid data: %3 + %1 contains %2 facet with invalid data: %3. - attribute group %1 contains attribute %2 twice - skupina lastnosti %1 dvakrat vsebuje lastnost %2 + Attribute group %1 contains attribute %2 twice. + Skupina lastnosti %1 dvakrat vsebuje lastnost %2. - attribute group %1 contains two different attributes that both have types derived from %2 + Attribute group %1 contains two different attributes that both have types derived from %2. - attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3 + Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3. - complex type %1 contains attribute %2 twice - kompleksna vrsta %1 dvakrat vsebuje lastnost %2 + Complex type %1 contains attribute %2 twice. + Kompleksna vrsta %1 dvakrat vsebuje lastnost %2. - complex type %1 contains two different attributes that both have types derived from %2 + Complex type %1 contains two different attributes that both have types derived from %2. - complex type %1 contains attribute %2 that has value constraint but type that inherits from %3 + Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3. - element %1 is not allowed to have a value constraint if its base type is complex + Element %1 is not allowed to have a value constraint if its base type is complex. - element %1 is not allowed to have a value constraint if its type is derived from %2 + Element %1 is not allowed to have a value constraint if its type is derived from %2. - value constraint of element %1 is not of elements type: %2 + Value constraint of element %1 is not of elements type: %2. - element %1 is not allowed to have substitution group affiliation as it is no global element + Element %1 is not allowed to have substitution group affiliation as it is no global element. - type of element %1 cannot be derived from type of substitution group affiliation + Type of element %1 cannot be derived from type of substitution group affiliation. - value constraint of attribute %1 is not of attributes type: %2 + Value constraint of attribute %1 is not of attributes type: %2. - attribute %1 has value constraint but has type derived from %2 + Attribute %1 has value constraint but has type derived from %2. - %1 attribute in derived complex type must be %2 like in base type + %1 attribute in derived complex type must be %2 like in base type. - attribute %1 in derived complex type must have %2 value constraint like in base type + Attribute %1 in derived complex type must have %2 value constraint like in base type. - attribute %1 in derived complex type must have the same %2 value constraint like in base type + Attribute %1 in derived complex type must have the same %2 value constraint like in base type. - attribute %1 in derived complex type must have %2 value constraint + Attribute %1 in derived complex type must have %2 value constraint. - processContent of base wildcard must be weaker than derived wildcard + processContent of base wildcard must be weaker than derived wildcard. - element %1 exists twice with different types - element %1 obstaja dvakrat, z različnima vrstama + Element %1 exists twice with different types. + Element %1 obstaja dvakrat, z različnima vrstama. - particle contains non-deterministic wildcards + Particle contains non-deterministic wildcards. - base attribute %1 is required but derived attribute is not + Base attribute %1 is required but derived attribute is not. - type of derived attribute %1 cannot be validly derived from type of base attribute + Type of derived attribute %1 cannot be validly derived from type of base attribute. - value constraint of derived attribute %1 does not match value constraint of base attribute + Value constraint of derived attribute %1 does not match value constraint of base attribute. - derived attribute %1 does not exists in the base definition + Derived attribute %1 does not exists in the base definition. - derived attribute %1 does not match the wildcard in the base definition + Derived attribute %1 does not match the wildcard in the base definition. - base attribute %1 is required but missing in derived definition + Base attribute %1 is required but missing in derived definition. - derived definition contains an %1 element that does not exists in the base definition + Derived definition contains an %1 element that does not exists in the base definition - derived wildcard is not a subset of the base wildcard + Derived wildcard is not a subset of the base wildcard. @@ -9133,905 +8970,1255 @@ Izberite drugo ime datoteke. - attribute %1 from base type is missing in derived type + Attribute %1 from base type is missing in derived type. - type of derived attribute %1 differs from type of base attribute + Type of derived attribute %1 differs from type of base attribute. - base definition contains an %1 element that is missing in the derived definition + Base definition contains an %1 element that is missing in the derived definition - - can not process unknown element %1, expected elements are: %2 - ni moč obdelati neznanega elementa %1, pričakovani elementi so: %2 - - - - element %1 is not allowed in this scope, possible elements are: %2 - element %1 v tem obsegu ni dovoljen, možni elementi so: %2 + + %1 references unknown %2 or %3 element %4. + - - child element is missing in that scope, possible child elements are: %1 - v tem obsegu manjka podelement, možni podelementi so: %1 + + %1 references identity constraint %2 that is no %3 or %4 element. + - - document is not a XML schema - dokument ni shema XML + + %1 has a different number of fields from the identity constraint %2 that it references. + - - %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4 - lastnost %1 elementa %2 vsebuje neveljavno vsebino: {%3} ni vrednost vrste %4 + + Base type %1 of %2 element cannot be resolved. + - - %1 attribute of %2 element contains invalid content: {%3} - lastnost %1 elementa %2 vsebuje neveljavno vsebino: {%3} + + Item type %1 of %2 element cannot be resolved. + - - target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema + + Member type %1 of %2 element cannot be resolved. - - - target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema + + + + Type %1 of %2 element cannot be resolved. - - %1 element is not allowed to have the same %2 attribute value as the target namespace %3 + + Base type %1 of complex type cannot be resolved. - - %1 element without %2 attribute is not allowed inside schema without target namespace + + %1 cannot have complex base type that has a %2. - - - %1 element is not allowed inside %2 element if %3 attribute is present - element %1 znotraj elementa %2 ni dovoljen, če je prisotna lastnost %3 + + Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type. + - - - - %1 element has neither %2 attribute nor %3 child element - element %1 nima niti lastnosti %2 niti podelementa %3 + + Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model. + - - - - - - - - - - - - - - - %1 element with %2 child element must not have a %3 attribute - element %1 s podelementom %2 ne sme imeti lastnosti %3 + + Type of %1 element must be a simple type, %2 is not. + Vrsta elementa %1 mora biti preprosta, %2 to ni. - - %1 attribute of %2 element must be %3 or %4 - lastnost %1 elementa %2 mora biti %3 ali %4 + + Substitution group %1 of %2 element cannot be resolved. + - - %1 attribute of %2 element must have a value of %3 - lastnost %1 elementa %2 mora imeti vrednost %3 + + Substitution group %1 has circular definition. + + - - %1 attribute of %2 element must have a value of %3 or %4 - lastnost %1 elementa %2 mora imeti vrednost %3 ali %4 + Duplicated element names %1 in %2 element. + Podvojeni imeni elementov %1 v elementu %2. - - - - - - - - - - - - - - - %1 element must not have %2 and %3 attribute together - element %1 hkrati ne sme imeti lastnosti %2 in %3 + + + + + Reference %1 of %2 element cannot be resolved. + - - - content of %1 attribute of %2 element must not be from namespace %3 - vsebina lastnosti %1 elementa %2 ne sme biti iz imenskega prostora %3 + + Circular group reference for %1. + - - - %1 attribute of %2 element must not be %3 - lastnost %1 elementa %2 ne sme biti %3 + + %1 element is not allowed in this scope + Element %1 v tem obsegu ni dovoljen - - %1 attribute of %2 element must have the value %3 because the %4 attribute is set + + %1 element cannot have %2 attribute with value other than %3. - - specifying use='prohibited' inside an attribute group has no effect + + %1 element cannot have %2 attribute with value other than %3 or %4. - - %1 element must have either %2 or %3 attribute - element %1 mora imeti lastnost %2 ali %3 + + %1 or %2 attribute of reference %3 does not match with the attribute declaration %4. + - - %1 element must have either %2 attribute or %3 or %4 as child element + + Attribute group %1 has circular reference. - - %1 element requires either %2 or %3 attribute - element %1 potrebuje vsaj lastnost %2 ali %3 + + %1 attribute in %2 must have %3 use like in base type %4. + - - text or entity references not allowed inside %1 element + + Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2. - - - %1 attribute of %2 element must contain %3, %4 or a list of URIs + + %1 has attribute wildcard but its base type %2 has not. - - %1 element is not allowed in this context - element %1 v tem kontekstu ni dovoljen + + Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible. + - - %1 attribute of %2 element has larger value than %3 attribute + + Enumeration facet contains invalid content: {%1} is not a value of type %2. - - prefix of qualified name %1 is not defined + + Namespace prefix of qualified name %1 is not defined. - - - %1 attribute of %2 element must either contain %3 or the other values + + + %1 element %2 is not a valid restriction of the %3 element it redefines: %4. - - component with id %1 has been defined previously - komponenta z ID-jem %1 je že bila definirana + + Empty particle cannot be derived from non-empty particle. + - - element %1 already defined - element %1 je že definiran + + Derived particle is missing element %1. + - - attribute %1 already defined - lastnost %1 je že definirana + + Derived element %1 is missing value constraint as defined in base particle. + - - type %1 already defined - vrsta %1 je že definirana + + Derived element %1 has weaker value constraint than base particle. + - - attribute group %1 already defined - skupina lastnosti %1 je že definirana + + Fixed value constraint of element %1 differs from value constraint in base particle. + - - element group %1 already defined - skupina elementov %1 je že definirana + + Derived element %1 cannot be nillable as base element is not nillable. + - - notation %1 already defined - zapis %1 je že definiran + + Block constraints of derived element %1 must not be more weaker than in the base element. + - identity constraint %1 already defined + Simple type of derived element %1 cannot be validly derived from base element. - - duplicated facets in simple type %1 + + Complex type of derived element %1 cannot be validly derived from base element. - - %1 references unknown %2 or %3 element %4 + + Element %1 is missing in derived particle. - - %1 references identity constraint %2 that is no %3 or %4 element + + Element %1 does not match namespace constraint of wildcard in base particle. - - %1 has a different number of fields from the identity constraint %2 that it references + + Wildcard in derived particle is not a valid subset of wildcard in base particle. - - base type %1 of %2 element cannot be resolved + + processContent of wildcard in derived particle is weaker than wildcard in base particle. - - item type %1 of %2 element cannot be resolved + + Derived particle allows content that is not allowed in the base particle. - - member type %1 of %2 element cannot be resolved - + + Can not process unknown element %1, expected elements are: %2. + Ni moč obdelati neznanega elementa %1, pričakovani elementi so: %2. - - - - type %1 of %2 element cannot be resolved - + + Element %1 is not allowed in this scope, possible elements are: %2. + Element %1 v tem obsegu ni dovoljen, možni elementi so: %2. - - base type %1 of complex type cannot be resolved - + + Child element is missing in that scope, possible child elements are: %1. + V tem obsegu manjka podelement, možni podelementi so: %1. - - %1 cannot have complex base type that has a %2 - + + Document is not a XML schema. + Dokument ni shema XML. - - content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type - + + %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4. + Lastnost %1 elementa %2 vsebuje neveljavno vsebino: {%3} ni vrednost vrste %4. - complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model - + %1 attribute of %2 element contains invalid content: {%3}. + Lastnost %1 elementa %2 vsebuje neveljavno vsebino: {%3}. - - type of %1 element must be a simple type, %2 is not - vrsta elementa %1 mora biti preprosta, %2 to ni + + Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema. + - - substitution group %1 of %2 element cannot be resolved + + + Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema. - - substitution group %1 has circular definition + + %1 element is not allowed to have the same %2 attribute value as the target namespace %3. - + + %1 element without %2 attribute is not allowed inside schema without target namespace. + + + + + + %1 element is not allowed inside %2 element if %3 attribute is present. + Element %1 znotraj elementa %2 ni dovoljen, če je prisotna lastnost %3. + + + + + + %1 element has neither %2 attribute nor %3 child element. + Element %1 nima niti lastnosti %2 niti podelementa %3. + + + + + - duplicated element names %1 in %2 element - podvojeni imeni elementov %1 v elementu %2 + + + + + + + + + + + %1 element with %2 child element must not have a %3 attribute. + Element %1 s podelementom %2 ne sme imeti lastnosti %3. - - - - - reference %1 of %2 element cannot be resolved - + + %1 attribute of %2 element must be %3 or %4. + Lastnost %1 elementa %2 mora biti %3 ali %4. - - circular group reference for %1 - + + %1 attribute of %2 element must have a value of %3. + Lastnost %1 elementa %2 mora imeti vrednost %3. - - %1 element is not allowed in this scope - element %1 v tem obsegu ni dovoljen + + + %1 attribute of %2 element must have a value of %3 or %4. + Lastnost %1 elementa %2 mora imeti vrednost %3 ali %4. - - %1 element cannot have %2 attribute with value other than %3 - + + + + + + + + + + + + + + + %1 element must not have %2 and %3 attribute together. + Element %1 hkrati ne sme imeti lastnosti %2 in %3. - - %1 element cannot have %2 attribute with value other than %3 or %4 + + + Content of %1 attribute of %2 element must not be from namespace %3. + Vsebina lastnosti %1 elementa %2 ne sme biti iz imenskega prostora %3. + + + + + %1 attribute of %2 element must not be %3. + Lastnost %1 elementa %2 ne sme biti %3. + + + + %1 attribute of %2 element must have the value %3 because the %4 attribute is set. - - %1 or %2 attribute of reference %3 does not match with the attribute declaration %4 + + Specifying use='prohibited' inside an attribute group has no effect. - - attribute group %1 has circular reference + + %1 element must have either %2 or %3 attribute. + Element %1 mora imeti lastnost %2 ali %3. + + + + %1 element must have either %2 attribute or %3 or %4 as child element. - - %1 attribute in %2 must have %3 use like in base type %4 + + %1 element requires either %2 or %3 attribute. + Element %1 potrebuje vsaj lastnost %2 ali %3. + + + + Text or entity references not allowed inside %1 element - - attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2 + + + %1 attribute of %2 element must contain %3, %4 or a list of URIs. - - %1 has attribute wildcard but its base type %2 has not + + %1 element is not allowed in this context. + Element %1 v tem kontekstu ni dovoljen. + + + + %1 attribute of %2 element has larger value than %3 attribute. - - union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible + + Prefix of qualified name %1 is not defined. - - enumeration facet contains invalid content: {%1} is not a value of type %2 + + + %1 attribute of %2 element must either contain %3 or the other values. - - namespace prefix of qualified name %1 is not defined + + Component with id %1 has been defined previously. + Komponenta z ID-jem %1 je že bila definirana. + + + + Element %1 already defined. + Element %1 je že definiran. + + + + Attribute %1 already defined. + Lastnost %1 je že definirana. + + + + Type %1 already defined. + Vrsta %1 je že definirana. + + + + Attribute group %1 already defined. + Skupina lastnosti %1 je že definirana. + + + + Element group %1 already defined. + Skupina elementov %1 je že definirana. + + + + Notation %1 already defined. + Zapis %1 je že definiran. + + + + Identity constraint %1 already defined. - - - %1 element %2 is not a valid restriction of the %3 element it redefines: %4 + + Duplicated facets in simple type %1. - %1 is not valid according to %2 - %1 glede na %2 ni veljaven + %1 is not valid according to %2. + %1 glede na %2 ni veljaven. - string content does not match the length facet + String content does not match the length facet. - string content does not match the minLength facet + String content does not match the minLength facet. - string content does not match the maxLength facet + String content does not match the maxLength facet. - string content does not match pattern facet + String content does not match pattern facet. - string content is not listed in the enumeration facet + String content is not listed in the enumeration facet. - signed integer content does not match the maxInclusive facet + Signed integer content does not match the maxInclusive facet. - signed integer content does not match the maxExclusive facet + Signed integer content does not match the maxExclusive facet. - signed integer content does not match the minInclusive facet + Signed integer content does not match the minInclusive facet. - signed integer content does not match the minExclusive facet + Signed integer content does not match the minExclusive facet. - signed integer content is not listed in the enumeration facet + Signed integer content is not listed in the enumeration facet. - signed integer content does not match pattern facet + Signed integer content does not match pattern facet. - signed integer content does not match in the totalDigits facet + Signed integer content does not match in the totalDigits facet. - unsigned integer content does not match the maxInclusive facet + Unsigned integer content does not match the maxInclusive facet. - unsigned integer content does not match the maxExclusive facet + Unsigned integer content does not match the maxExclusive facet. - unsigned integer content does not match the minInclusive facet + Unsigned integer content does not match the minInclusive facet. - unsigned integer content does not match the minExclusive facet + Unsigned integer content does not match the minExclusive facet. - unsigned integer content is not listed in the enumeration facet + Unsigned integer content is not listed in the enumeration facet. - unsigned integer content does not match pattern facet + Unsigned integer content does not match pattern facet. - unsigned integer content does not match in the totalDigits facet + Unsigned integer content does not match in the totalDigits facet. - double content does not match the maxInclusive facet + Double content does not match the maxInclusive facet. - double content does not match the maxExclusive facet + Double content does not match the maxExclusive facet. - double content does not match the minInclusive facet + Double content does not match the minInclusive facet. - double content does not match the minExclusive facet + Double content does not match the minExclusive facet. - double content is not listed in the enumeration facet + Double content is not listed in the enumeration facet. - double content does not match pattern facet + Double content does not match pattern facet. - decimal content does not match in the fractionDigits facet + Decimal content does not match in the fractionDigits facet. - decimal content does not match in the totalDigits facet + Decimal content does not match in the totalDigits facet. - date time content does not match the maxInclusive facet + Date time content does not match the maxInclusive facet. - date time content does not match the maxExclusive facet + Date time content does not match the maxExclusive facet. - date time content does not match the minInclusive facet + Date time content does not match the minInclusive facet. - date time content does not match the minExclusive facet + Date time content does not match the minExclusive facet. - date time content is not listed in the enumeration facet + Date time content is not listed in the enumeration facet. - date time content does not match pattern facet + Date time content does not match pattern facet. - duration content does not match the maxInclusive facet + Duration content does not match the maxInclusive facet. - duration content does not match the maxExclusive facet + Duration content does not match the maxExclusive facet. - duration content does not match the minInclusive facet + Duration content does not match the minInclusive facet. - duration content does not match the minExclusive facet + Duration content does not match the minExclusive facet. - duration content is not listed in the enumeration facet + Duration content is not listed in the enumeration facet. - duration content does not match pattern facet + Duration content does not match pattern facet. - boolean content does not match pattern facet + Boolean content does not match pattern facet. - binary content does not match the length facet + Binary content does not match the length facet. - binary content does not match the minLength facet + Binary content does not match the minLength facet. - binary content does not match the maxLength facet + Binary content does not match the maxLength facet. - binary content is not listed in the enumeration facet + Binary content is not listed in the enumeration facet. - invalid QName content: %1 - neveljavna vsebina QName: %1 + Invalid QName content: %1. + Neveljavna vsebina QName: %1. - QName content is not listed in the enumeration facet + QName content is not listed in the enumeration facet. - QName content does not match pattern facet + QName content does not match pattern facet. - notation content is not listed in the enumeration facet + Notation content is not listed in the enumeration facet. - list content does not match length facet + List content does not match length facet. - list content does not match minLength facet + List content does not match minLength facet. - list content does not match maxLength facet + List content does not match maxLength facet. - list content is not listed in the enumeration facet + List content is not listed in the enumeration facet. - list content does not match pattern facet + List content does not match pattern facet. - union content is not listed in the enumeration facet + Union content is not listed in the enumeration facet. - union content does not match pattern facet + Union content does not match pattern facet. - data of type %1 are not allowed to be empty - podatki vrste %1 ne smejo biti prazni + Data of type %1 are not allowed to be empty. + Podatki vrste %1 ne smejo biti prazni. - element %1 is missing child element - elementu %1 manjka podelement + Element %1 is missing child element. + Elementu %1 manjka podelement. - there is one IDREF value with no corresponding ID: %1 + There is one IDREF value with no corresponding ID: %1. - loaded schema file is invalid + Loaded schema file is invalid. - %1 contains invalid data - %1 vsebuje neveljavne podatke + %1 contains invalid data. + %1 vsebuje neveljavne podatke. - xsi:schemaLocation namespace %1 has already appeared earlier in the instance document + xsi:schemaLocation namespace %1 has already appeared earlier in the instance document. - xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute + xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute. - no schema defined for validation + No schema defined for validation. - no definition for element %1 available - definicija za element %1 ni na voljo + No definition for element %1 available. + Definicija za element %1 ni na voljo. - specified type %1 is not known to the schema + Specified type %1 is not known to the schema. - element %1 is not defined in this scope - element %1 v tem obsegu ni definiran + Element %1 is not defined in this scope. + Element %1 v tem obsegu ni definiran. - declaration for element %1 does not exist - deklaracija elementa %1 ne obstaja + Declaration for element %1 does not exist. + Deklaracija elementa %1 ne obstaja. - element %1 contains invalid content - element %1 vsebuje neveljavno vsebino + Element %1 contains invalid content. + Element %1 vsebuje neveljavno vsebino. - element %1 is declared as abstract - element %1 je deklariran kot abstrakten + Element %1 is declared as abstract. + Element %1 je deklariran kot abstrakten. - element %1 is not nillable + Element %1 is not nillable. - attribute %1 contains invalid data: %2 - + Attribute %1 contains invalid data: %2 + Lastnost %1 vsebuje neveljavne podatke: %2 - element contains content although it is nillable + Element contains content although it is nillable. - fixed value constrained not allowed if element is nillable + Fixed value constrained not allowed if element is nillable. - specified type %1 is not validly substitutable with element type %2 + Specified type %1 is not validly substitutable with element type %2. - complex type %1 is not allowed to be abstract - kompleksna vrsta %1 ne sme biti abstraktna + Complex type %1 is not allowed to be abstract. + Kompleksna vrsta %1 ne sme biti abstraktna. - element %1 contains not allowed attributes - element %1 vsebuje nedovoljene lastnosti + Element %1 contains not allowed attributes. + Element %1 vsebuje nedovoljene lastnosti. - element %1 contains not allowed child element - element %1 vsebuje nedovoljen podelement + Element %1 contains not allowed child element. + Element %1 vsebuje nedovoljen podelement. - content of element %1 does not match its type definition: %2 - vsebina elementa %1 ne ustreza zanj določeni vrsti: %2 + Content of element %1 does not match its type definition: %2. + Vsebina elementa %1 ne ustreza zanj določeni vrsti: %2. - content of element %1 does not match defined value constraint + Content of element %1 does not match defined value constraint. - element %1 contains not allowed child content - element %1 vsebuje nedovoljeno vsebino v podelementih + Element %1 contains not allowed child content. + Element %1 vsebuje nedovoljeno vsebino v podelementih. - element %1 contains not allowed text content - element %1 vsebuje nedovoljeno besedilno vsebino + Element %1 contains not allowed text content. + Element %1 vsebuje nedovoljeno besedilno vsebino. - element %1 can not contain other elements, as it has a fixed content - element %1 ne more vsebovati drugih elementov, ker ima fiksno vsebino + Element %1 can not contain other elements, as it has a fixed content. + Element %1 ne more vsebovati drugih elementov, ker ima fiksno vsebino. - element %1 is missing required attribute %2 - elementu %1 manjka obvezna lastnost %2 + Element %1 is missing required attribute %2. + Elementu %1 manjka obvezna lastnost %2. - attribute %1 does not match the attribute wildcard + Attribute %1 does not match the attribute wildcard. - declaration for attribute %1 does not exist - deklaracija lastnosti %1 ne obstaja + Declaration for attribute %1 does not exist. + Deklaracija lastnosti %1 ne obstaja. - element %1 contains two attributes of type %2 - element %1 vsebuje dve lastnosti vrste %2 + Element %1 contains two attributes of type %2. + Element %1 vsebuje dve lastnosti vrste %2. - attribute %1 contains invalid content - lastnost %1 vsebuje neveljavno vsebino + Attribute %1 contains invalid content. + Lastnost %1 vsebuje neveljavno vsebino. - element %1 contains unknown attribute %2 - element %1 vsebuje neznano lastnost %2 + Element %1 contains unknown attribute %2. + Element %1 vsebuje neznano lastnost %2. - content of attribute %1 does not match its type definition: %2 + Content of attribute %1 does not match its type definition: %2. - content of attribute %1 does not match defined value constraint + Content of attribute %1 does not match defined value constraint. - non-unique value found for constraint %1 + Non-unique value found for constraint %1. - key constraint %1 contains absent fields + Key constraint %1 contains absent fields. - key constraint %1 contains references nillable element %2 + Key constraint %1 contains references nillable element %2. - no referenced value found for key reference %1 + No referenced value found for key reference %1. - more than one value found for field %1 - za polje %1 je bila najdena več kot ena vrednost + More than one value found for field %1. + Za polje %1 je bila najdena več kot ena vrednost. - field %1 has no simple type - polje %1 nima preproste vrste + Field %1 has no simple type. + Polje %1 nima preproste vrste. - ID value '%1' is not unique - Vrednost ID »%1« ni edinstvena + ID value '%1' is not unique. + Vrednost ID »%1« ni edinstvena. + '%1' attribute contains invalid QName content: %2. + Lastnost »%1« vsebuje neveljavno vsebino QName: %2. + + + + attribute group %1 contains attribute %2 twice + skupina lastnosti %1 dvakrat vsebuje lastnost %2 + + + + complex type %1 contains attribute %2 twice + kompleksna vrsta %1 dvakrat vsebuje lastnost %2 + + + + element %1 exists twice with different types + element %1 obstaja dvakrat, z različnima vrstama + + + + can not process unknown element %1, expected elements are: %2 + ni moč obdelati neznanega elementa %1, pričakovani elementi so: %2 + + + + element %1 is not allowed in this scope, possible elements are: %2 + element %1 v tem obsegu ni dovoljen, možni elementi so: %2 + + + + child element is missing in that scope, possible child elements are: %1 + v tem obsegu manjka podelement, možni podelementi so: %1 + + + + document is not a XML schema + dokument ni shema XML + + + + %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4 + lastnost %1 elementa %2 vsebuje neveljavno vsebino: {%3} ni vrednost vrste %4 + + + + %1 attribute of %2 element contains invalid content: {%3} + lastnost %1 elementa %2 vsebuje neveljavno vsebino: {%3} + + + + %1 element is not allowed inside %2 element if %3 attribute is present + element %1 znotraj elementa %2 ni dovoljen, če je prisotna lastnost %3 + + + + %1 element has neither %2 attribute nor %3 child element + element %1 nima niti lastnosti %2 niti podelementa %3 + + + + %1 element with %2 child element must not have a %3 attribute + element %1 s podelementom %2 ne sme imeti lastnosti %3 + + + + %1 attribute of %2 element must be %3 or %4 + lastnost %1 elementa %2 mora biti %3 ali %4 + + + + %1 attribute of %2 element must have a value of %3 + lastnost %1 elementa %2 mora imeti vrednost %3 + + + + %1 attribute of %2 element must have a value of %3 or %4 + lastnost %1 elementa %2 mora imeti vrednost %3 ali %4 + + + + %1 element must not have %2 and %3 attribute together + element %1 hkrati ne sme imeti lastnosti %2 in %3 + + + + content of %1 attribute of %2 element must not be from namespace %3 + vsebina lastnosti %1 elementa %2 ne sme biti iz imenskega prostora %3 + + + + %1 attribute of %2 element must not be %3 + lastnost %1 elementa %2 ne sme biti %3 + + + + %1 element must have either %2 or %3 attribute + element %1 mora imeti lastnost %2 ali %3 + + + + %1 element requires either %2 or %3 attribute + element %1 potrebuje vsaj lastnost %2 ali %3 + + + + %1 element is not allowed in this context + element %1 v tem kontekstu ni dovoljen + + + + component with id %1 has been defined previously + komponenta z ID-jem %1 je že bila definirana + + + + element %1 already defined + element %1 je že definiran + + + + attribute %1 already defined + lastnost %1 je že definirana + + + + type %1 already defined + vrsta %1 je že definirana + + + + attribute group %1 already defined + skupina lastnosti %1 je že definirana + + + + element group %1 already defined + skupina elementov %1 je že definirana + + + + notation %1 already defined + zapis %1 je že definiran + + + + type of %1 element must be a simple type, %2 is not + vrsta elementa %1 mora biti preprosta, %2 to ni + + + + duplicated element names %1 in %2 element + podvojeni imeni elementov %1 v elementu %2 + + + + %1 is not valid according to %2 + %1 glede na %2 ni veljaven + + + + invalid QName content: %1 + neveljavna vsebina QName: %1 + + + + data of type %1 are not allowed to be empty + podatki vrste %1 ne smejo biti prazni + + + + element %1 is missing child element + elementu %1 manjka podelement + + + + %1 contains invalid data + %1 vsebuje neveljavne podatke + + + + no definition for element %1 available + definicija za element %1 ni na voljo + + + + element %1 is not defined in this scope + element %1 v tem obsegu ni definiran + + + + declaration for element %1 does not exist + deklaracija elementa %1 ne obstaja + + + + element %1 contains invalid content + element %1 vsebuje neveljavno vsebino + + + + element %1 is declared as abstract + element %1 je deklariran kot abstrakten + + + + complex type %1 is not allowed to be abstract + kompleksna vrsta %1 ne sme biti abstraktna + + + + element %1 contains not allowed attributes + element %1 vsebuje nedovoljene lastnosti + + + + element %1 contains not allowed child element + element %1 vsebuje nedovoljen podelement + + + + content of element %1 does not match its type definition: %2 + vsebina elementa %1 ne ustreza zanj določeni vrsti: %2 + + + + element %1 contains not allowed child content + element %1 vsebuje nedovoljeno vsebino v podelementih + + + + element %1 contains not allowed text content + element %1 vsebuje nedovoljeno besedilno vsebino + + + + element %1 can not contain other elements, as it has a fixed content + element %1 ne more vsebovati drugih elementov, ker ima fiksno vsebino + + + + element %1 is missing required attribute %2 + elementu %1 manjka obvezna lastnost %2 + + + + declaration for attribute %1 does not exist + deklaracija lastnosti %1 ne obstaja + + + + element %1 contains two attributes of type %2 + element %1 vsebuje dve lastnosti vrste %2 + + + + attribute %1 contains invalid content + lastnost %1 vsebuje neveljavno vsebino + + + + element %1 contains unknown attribute %2 + element %1 vsebuje neznano lastnost %2 + + + + more than one value found for field %1 + za polje %1 je bila najdena več kot ena vrednost + + + + field %1 has no simple type + polje %1 nima preproste vrste + + + + ID value '%1' is not unique + Vrednost ID »%1« ni edinstvena + + + '%1' attribute contains invalid QName content: %2 - Lastnost »%1« vsebuje neveljavno vsebino QName: %2 + Lastnost »%1« vsebuje neveljavno vsebino QName: %2 -- cgit v0.12 From b72d41cf30f82c74c10c31808907cc990c86efe6 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 3 Nov 2009 08:23:18 +1000 Subject: Protect the OpenVG engine from null QPixmapData objects Reviewed-by: Sarah Smith --- src/openvg/qpaintengine_vg.cpp | 10 ++++++++++ src/openvg/qpixmapdata_vg.cpp | 2 ++ src/openvg/qpixmapfilter_vg.cpp | 12 ++++++++++++ 3 files changed, 24 insertions(+) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 8a485a0..047d9d8 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -1178,6 +1178,8 @@ VGPaintType QVGPaintEnginePrivate::setBrush case Qt::TexturePattern: { // The brush is a texture specified by a QPixmap/QImage. QPixmapData *pd = brush.texture().pixmapData(); + if (!pd) + break; // null QPixmap VGImage vgImg; bool deref = false; if (pd->pixelType() == QPixmapData::BitmapType) { @@ -2893,6 +2895,8 @@ void qt_vg_drawVGImageStencil void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) { QPixmapData *pd = pm.pixmapData(); + if (!pd) + return; // null QPixmap if (pd->classId() == QPixmapData::OpenVGClass) { Q_D(QVGPaintEngine); QVGPixmapData *vgpd = static_cast(pd); @@ -2910,6 +2914,8 @@ void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) { QPixmapData *pd = pm.pixmapData(); + if (!pd) + return; // null QPixmap if (pd->classId() == QPixmapData::OpenVGClass) { Q_D(QVGPaintEngine); QVGPixmapData *vgpd = static_cast(pd); @@ -2985,6 +2991,8 @@ void QVGPaintEngine::drawPixmaps // If the pixmap is not VG, or the transformation is projective, // then fall back to the default implementation. QPixmapData *pd = pixmap.pixmapData(); + if (!pd) + return; // null QPixmap if (pd->classId() != QPixmapData::OpenVGClass || !d->simpleTransform) { QPaintEngineEx::drawPixmaps(drawingData, dataCount, pixmap, hints); return; @@ -3581,6 +3589,8 @@ void QVGCompositionHelper::drawCursorPixmap // Fetch the VGImage from the pixmap if possible. QPixmapData *pd = pixmap.pixmapData(); + if (!pd) + return; // null QPixmap if (pd->classId() == QPixmapData::OpenVGClass) { QVGPixmapData *vgpd = static_cast(pd); if (vgpd->isValid()) diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index f86e116..3254aa3 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -369,6 +369,8 @@ QImage::Format QVGPixmapData::sourceFormat() const Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap) { QPixmapData *pd = pixmap.pixmapData(); + if (!pd) + return VG_INVALID_HANDLE; // null QPixmap if (pd->classId() == QPixmapData::OpenVGClass) { QVGPixmapData *vgpd = static_cast(pd); if (vgpd->isValid()) diff --git a/src/openvg/qpixmapfilter_vg.cpp b/src/openvg/qpixmapfilter_vg.cpp index 8e104db..e17c728 100644 --- a/src/openvg/qpixmapfilter_vg.cpp +++ b/src/openvg/qpixmapfilter_vg.cpp @@ -65,6 +65,9 @@ void QVGPixmapConvolutionFilter::draw (QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect) const { + if (src.isNull()) + return; + if (src.pixmapData()->classId() != QPixmapData::OpenVGClass) { // The pixmap data is not an instance of QVGPixmapData, so fall // back to the default convolution filter implementation. @@ -135,6 +138,9 @@ QVGPixmapColorizeFilter::~QVGPixmapColorizeFilter() void QVGPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect) const { + if (src.isNull()) + return; + if (src.pixmapData()->classId() != QPixmapData::OpenVGClass) { // The pixmap data is not an instance of QVGPixmapData, so fall // back to the default colorize filter implementation. @@ -225,6 +231,9 @@ QVGPixmapDropShadowFilter::~QVGPixmapDropShadowFilter() void QVGPixmapDropShadowFilter::draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect) const { + if (src.isNull()) + return; + if (src.pixmapData()->classId() != QPixmapData::OpenVGClass) { // The pixmap data is not an instance of QVGPixmapData, so fall // back to the default drop shadow filter implementation. @@ -290,6 +299,9 @@ QVGPixmapBlurFilter::~QVGPixmapBlurFilter() void QVGPixmapBlurFilter::draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect) const { + if (src.isNull()) + return; + if (src.pixmapData()->classId() != QPixmapData::OpenVGClass) { // The pixmap data is not an instance of QVGPixmapData, so fall // back to the default blur filter implementation. -- cgit v0.12 From f72c2d50b6ab7fc4a8ea3524e22de63ca8a366f7 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Tue, 3 Nov 2009 12:47:48 +1000 Subject: Fixed qrand global static related problem. qrand() uses global static seed storage, but if used from destructors of other global static objects (directly or via ~QSettings() or QMap::insert()) the global static seed storage can be already deleted. Fallback to plain rand() in this case. Task-number: QTBUG-5218 Reviewed-by: Justin McPherson --- src/corelib/global/qglobal.cpp | 59 ++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 7d47944..36e15b9 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2513,10 +2513,19 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value void qsrand(uint seed) { #if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) - SeedStorageType *pseed = randTLS()->localData(); - if (!pseed) - randTLS()->setLocalData(pseed = new SeedStorageType); - *pseed = seed; + SeedStorage *seedStorage = randTLS(); + if (seedStorage) { + SeedStorageType *pseed = seedStorage->localData(); + if (!pseed) + seedStorage->setLocalData(pseed = new SeedStorageType); + *pseed = seed; + } else { + //golbal static seed storage should always exist, + //except after being deleted by QGlobalStaticDeleter. + //But since it still can be called from destructor of another + //global static object, fallback to sqrand(seed) + srand(seed); + } #else // On Windows srand() and rand() already use Thread-Local-Storage // to store the seed between calls @@ -2536,17 +2545,20 @@ void qsrand(uint seed) void qsrand() { #if (defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) - SeedStorageType *pseed = randTLS()->localData(); - if (pseed) { - // already seeded - return; + SeedStorage *seedStorage = randTLS(); + if (seedStorage) { + SeedStorageType *pseed = seedStorage->localData(); + if (pseed) { + // already seeded + return; + } + seedStorage->setLocalData(pseed = new SeedStorageType); + // start beyond 1 to avoid the sequence reset + static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2); + *pseed = QDateTime::currentDateTime().toTime_t() + + quintptr(&pseed) + + serial.fetchAndAddRelaxed(1); } - randTLS()->setLocalData(pseed = new SeedStorageType); - // start beyond 1 to avoid the sequence reset - static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2); - *pseed = QDateTime::currentDateTime().toTime_t() - + quintptr(&pseed) - + serial.fetchAndAddRelaxed(1); #if defined(Q_OS_WIN) // for Windows the srand function must still be called. srand(*pseed); @@ -2584,12 +2596,21 @@ void qsrand() int qrand() { #if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) - SeedStorageType *pseed = randTLS()->localData(); - if (!pseed) { - randTLS()->setLocalData(pseed = new SeedStorageType); - *pseed = 1; + SeedStorage *seedStorage = randTLS(); + if (seedStorage) { + SeedStorageType *pseed = seedStorage->localData(); + if (!pseed) { + seedStorage->setLocalData(pseed = new SeedStorageType); + *pseed = 1; + } + return rand_r(pseed); + } else { + //golbal static seed storage should always exist, + //except after being deleted by QGlobalStaticDeleter. + //But since it still can be called from destructor of another + //global static object, fallback to qrand() + return rand(); } - return rand_r(pseed); #else // On Windows srand() and rand() already use Thread-Local-Storage // to store the seed between calls -- cgit v0.12 From 88f668430023acd3fbad3543a57198a4cf0255c2 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Tue, 3 Nov 2009 17:22:01 +1000 Subject: Fixed compilation on windows. Reviewed-by: trustme --- src/corelib/global/qglobal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 36e15b9..33c6a34 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2558,11 +2558,11 @@ void qsrand() *pseed = QDateTime::currentDateTime().toTime_t() + quintptr(&pseed) + serial.fetchAndAddRelaxed(1); - } #if defined(Q_OS_WIN) - // for Windows the srand function must still be called. - srand(*pseed); + // for Windows the srand function must still be called. + srand(*pseed); #endif + } #elif defined(Q_OS_WIN) static unsigned int seed = 0; -- cgit v0.12 From 5dddf56e703bca59b874e46d3cabd2eba6fbb55e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 13 Aug 2009 15:08:24 +0200 Subject: qdoc: Disabled reporting the NOTIFY signal until I know what it broke. Task-number: 259071 --- tools/qdoc3/cppcodeparser.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 84ec3f4..843bec8 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1759,7 +1759,6 @@ bool CppCodeParser::matchProperty(InnerNode *parent) property->setDesignable(value.toLower() == "true"); else if (key == "RESET") tre->addPropertyFunction(property, value, PropertyNode::Resetter); - else if (key == "NOTIFY") { tre->addPropertyFunction(property, value, PropertyNode::Notifier); } -- cgit v0.12 From 4eff66941486568cd25dc9aaa372f9d36b84dad8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 10:05:11 +0100 Subject: doc: Polish documentation for state machine framework Fix some examples and wording, and add some clarification based on comments in documentation review session. Reviewed-by: Kent Hansen --- doc/src/frameworks-technologies/statemachine.qdoc | 104 +++++++++++----------- doc/src/snippets/statemachine/main2.cpp | 11 +-- doc/src/snippets/statemachine/main5.cpp | 44 +++++++-- 3 files changed, 93 insertions(+), 66 deletions(-) diff --git a/doc/src/frameworks-technologies/statemachine.qdoc b/doc/src/frameworks-technologies/statemachine.qdoc index ed8bc85..ac10314 100644 --- a/doc/src/frameworks-technologies/statemachine.qdoc +++ b/doc/src/frameworks-technologies/statemachine.qdoc @@ -75,6 +75,11 @@ states can be configured to set properties and invoke methods on QObjects. Qt's event system is used to drive the state machines. + The state graph in the State Machine framework is hierarchical. States can be nested inside of + other states, and the current configuration of the state machine consists of the set of states + which are currently active. All the states in a valid configuration of the state machine will + have a common ancestor. + \section1 Classes in the State Machine Framework These classes are provided by qt for creating event-driven state machines. @@ -269,9 +274,17 @@ When a parallel state group is entered, all its child states will be simultaneously entered. Transitions within the individual child states - operate normally. However, any of the child states may take a transition - outside the parent state. When this happens, the parent state and all of its - child states are exited. + operate normally. However, any of the child states may take a transition which exits the parent + state. When this happens, the parent state and all of its child states are exited. + + The parallelism in the State Machine framework follows an interleaved semantics. All parallel + operations will be executed in a single, atomic step of the event processing, so no event can + interrupt the parallel operations. However, events will still be processed sequentially, since + the machine itself is single threaded. As an example: Consider the situation where there are two + transitions that exit the same parallel state group, and their conditions become true + simultaneously. In this case, the event that is processed last of the two will not have any + effect, since the first event will already have caused the machine to exit from the parallel + state. \section1 Detecting that a Composite State has Finished @@ -414,16 +427,7 @@ Take the following code: \code - QStateMachine machine; - machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); - - QState *s1 = new QState(); - s1->assignProperty(object, "fooBar", 1.0); - machine.addState(s1); - machine.setInitialState(s1); - - QState *s2 = new QState(); - machine.addState(s2); + \snippet doc/src/snippets/statemachine/main5.cpp 0 \endcode Lets say the property \c fooBar is 0.0 when the machine starts. When the machine is in state @@ -434,19 +438,7 @@ If we are using nested states, the parent defines a value for the property which is inherited by all descendants that do not explicitly assign a value to the property. \code - QStateMachine machine; - machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); - - QState *s1 = new QState(); - s1->assignProperty(object, "fooBar", 1.0); - machine.addState(s1); - machine.setInitialState(s1); - - QState *s2 = new QState(s1); - s2->assignProperty(object, "fooBar", 2.0); - s1->setInitialState(s2); - - QState *s3 = new QState(s1); + \snippet doc/src/snippets/statemachine/main5.cpp 2 \endcode Here \c s1 has two children: \c s2 and \c s3. When \c s2 is entered, the property \c fooBar @@ -461,13 +453,7 @@ Say we have the following code: \code - QState *s1 = new QState(); - QState *s2 = new QState(); - - s1->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); - s2->assignProperty(button, "geometry", QRectF(0, 0, 100, 100)); - - s1->addTransition(button, SIGNAL(clicked()), s2); + \snippet doc/src/snippets/statemachine/main5.cpp 3 \endcode Here we define two states of a user interface. In \c s1 the \c button is small, and in \c s2 @@ -477,14 +463,7 @@ object. \code - QState *s1 = new QState(); - QState *s2 = new QState(); - - s1->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); - s2->assignProperty(button, "geometry", QRectF(0, 0, 100, 100)); - - QSignalTransition *transition = s1->addTransition(button, SIGNAL(clicked()), s2); - transition->addAnimation(new QPropertyAnimation(button, "geometry")); + \snippet doc/src/snippets/statemachine/main5.cpp 4 \endcode Adding an animation for the property in question means that the property assignment will no @@ -504,28 +483,45 @@ property can potentially have any value, depending on the animation. In some cases, it can be useful to be able to detect when the property has actually been assigned - the value defined by a state. For this, we can use the state's polished() signal. + the value defined by a state. + + Say we have the following code: \code - QState *s1 = new QState(); - s1->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); + \snippet doc/src/snippets/statemachine/main5.cpp 5 + \endcode - QState *s2 = new QState(); + When \c button is clicked, the machine will transition into state \c s2, which will set the + geometry of the button, and then pop up a message box to alert the user that the geometry has + been changed. + + In the normal case, where animations are not used, this will operate as expected. However, if + an animation for the \c geometry of \c button is set on the transition between \c s1 and \c s2, + the animation will be started when \c s2 is entered, but the \c geometry property will not + actually reach its defined value before the animation is finished running. In this case, the + message box will pop up before the geometry of the button has actually been set. - s1->addTransition(s1, SIGNAL(polished()), s2); + To ensure that the message box does not pop up until the geometry actually reaches its final + value, we can use the state's polished() signal. The polished() signal will be emitted when the + the property is assigned its final value, whether this is done immediately or after the animation + has finished playing. + \code + \snippet doc/src/snippets/statemachine/main5.cpp 6 \endcode - The machine will be in state \c s1 until the \c geometry property has been set. Then it will - immediately transition into \c s2. If the transition into \c s1 has an animation for the \c - geometry property, then the machine will stay in \c s1 until the animation has finished. If there - is no animation, it will simply set the property and immediately enter state \c s2. + In this example, when \c button is clicked, the machine will enter \c s2. It will remain in state + \c s2 until the \c geometry property has been set to \c QRect(0, 0, 50, 50). Then it will + transition into \c s3. When \c s3 is entered, the message box will pop up. If the transition into + \c s2 has an animation for the \c geometry property, then the machine will stay in \c s2 until the + animation has finished playing. If there is no such animation, it will simply set the property and + immediately enter state \c s3. - Either way, when the machine is in state \c s2, the property \c geometry has been assigned the - defined value. + Either way, when the machine is in state \c s3, you are guaranteed that the property \c geometry + has been assigned the defined value. If the global restore policy is set to QStateMachine::RestoreProperties, the state will not emit the polished() signal until these have been executed as well. - \section1 What happens if a state is exited before the animation has finished + \section1 What Happens If A State Is Exited Before The Animation Has Finished If a state has property assignments, and the transition into the state has animations for the properties, the state can potentially be exited before the properties have been assigned to the @@ -545,7 +541,7 @@ If the target state does not assign any value to the property, there are two options: By default, the property will be assigned the value defined by the state it is leaving - (the value it would have been assigned if the animation had been permitted to finish playing.) If + (the value it would have been assigned if the animation had been permitted to finish playing). If a global restore policy is set, however, this will take precedence, and the property will be restored as usual. diff --git a/doc/src/snippets/statemachine/main2.cpp b/doc/src/snippets/statemachine/main2.cpp index 2419dc2..9a2890f 100644 --- a/doc/src/snippets/statemachine/main2.cpp +++ b/doc/src/snippets/statemachine/main2.cpp @@ -69,17 +69,18 @@ int main(int argv, char **args) //![1] QButton *interruptButton = new QPushButton("Interrupt Button"); + QWidget *mainWindow = new QWidget(); //![3] QHistoryState *s1h = new QHistoryState(s1); QState *s3 = new QState(); s3->assignProperty(label, "text", "In s3"); - QMessageBox mbox; - mbox.addButton(QMessageBox::Ok); - mbox.setText("Interrupted!"); - mbox.setIcon(QMessageBox::Information); - QObject::connect(s3, SIGNAL(entered()), &mbox, SLOT(exec())); + QMessageBox *mbox = new QMessageBox(mainWindow); + mbox->addButton(QMessageBox::Ok); + mbox->setText("Interrupted!"); + mbox->setIcon(QMessageBox::Information); + QObject::connect(s3, SIGNAL(entered()), mbox, SLOT(exec())); s3->addTransition(s1h); machine.addState(s3); diff --git a/doc/src/snippets/statemachine/main5.cpp b/doc/src/snippets/statemachine/main5.cpp index a9d4091..346cbce 100644 --- a/doc/src/snippets/statemachine/main5.cpp +++ b/doc/src/snippets/statemachine/main5.cpp @@ -44,14 +44,13 @@ int main(int argv, char **args) { QApplication app(argv, args); + QWidget *button; { //![0] QStateMachine machine; machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); -//![0] -//![1] QState *s1 = new QState(); s1->assignProperty(object, "fooBar", 1.0); machine.addState(s1); @@ -59,7 +58,7 @@ int main(int argv, char **args) QState *s2 = new QState(); machine.addState(s2); -//![1] +//![0] } { @@ -110,21 +109,50 @@ int main(int argv, char **args) } { + QMainWindow *mainWindow = 0; //![5] + QMessageBox *messageBox = new QMessageBox(mainWindow); + messageBox->addButton(QMessageBox::Ok); + messageBox->setText("Button geometry has been set!"); + messageBox->setIcon(QMessageBox::Information); + QState *s1 = new QState(); - s1->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); QState *s2 = new QState(); + s2->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); + connect(s2, SIGNAL(entered()), messageBox, SLOT(exec())); - s1->addTransition(s1, SIGNAL(polished()), s2); + s1->addTransition(button, SIGNAL(clicked()), s2); //![5] - } { + QMainWindow *mainWindow = 0; + +//![6] + QMessageBox *messageBox = new QMessageBox(mainWindow); + messageBox->addButton(QMessageBox::Ok); + messageBox->setText("Button geometry has been set!"); + messageBox->setIcon(QMessageBox::Information); + + QState *s1 = new QState(); + + QState *s2 = new QState(); + s2->assignProperty(button, "geometry", QRectF(0, 0, 50, 50)); + + QState *s3 = new QState(); + connect(s3, SIGNAL(entered()), messageBox, SLOT(exec())); + s1->addTransition(button, SIGNAL(clicked()), s2); + s2->addTransition(s2, SIGNAL(polished()), s3); //![6] + + } + + { + +//![7] QState *s1 = new QState(); QState *s2 = new QState(); @@ -134,10 +162,12 @@ int main(int argv, char **args) QStateMachine machine; machine.setInitialState(s1); machine.addDefaultAnimation(new QPropertyAnimation(object, "fooBar")); -//![6] +//![7] } + + return app.exec(); } -- cgit v0.12 From d54a1241a4470c73ccdac4b1a90264a9eaa28478 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 26 Oct 2009 12:22:13 +0100 Subject: disable link time code generation by default on Windows CE To be consistent with desktop Windows Qt, we also disable LTCG by default. To turn it on, use the -ltcg configure switch. Reviewed-by: mauricek --- tools/configure/configureapp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index dd3823b..28645a0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1412,7 +1412,6 @@ void Configure::applySpecSpecifics() dictionary[ "WEBKIT" ] = "no"; dictionary[ "PHONON" ] = "yes"; dictionary[ "DIRECTSHOW" ] = "no"; - dictionary[ "LTCG" ] = "yes"; // We only apply MMX/IWMMXT for mkspecs we know they work if (dictionary[ "XQMAKESPEC" ].startsWith("wincewm")) { dictionary[ "MMX" ] = "yes"; -- cgit v0.12 From 0aade44ed9a2f223c603984a84ab012eadc5c388 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 26 Oct 2009 14:05:16 +0100 Subject: document the -no-ltcg default for Windows CE in changes-4.6.0 --- dist/changes-4.6.0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index ba2b051..5a15cdb 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -58,6 +58,9 @@ information about a particular change. - The reading code of QLocalSocket on Windows has been rewritten to improve reading performance. + - On Windows CE the link time code geration has been disabled by default to + be consistent with win32-msvc200x. + **************************************************************************** * Important Behavior Changes * **************************************************************************** -- cgit v0.12 From fa1856bcb2eff41dadf0900202dd43f44ddb2343 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 27 Oct 2009 16:19:19 +0100 Subject: WebKit compile fix for Windows CE Not sure if this is right fix. We could also disable PLUGIN_PACKAGE_SIMPLE_HASH. But this is automatically enabled when NETSCAPE_PLUGIN_API is disabled. Reviewed-by: thartman --- src/3rdparty/webkit/WebCore/platform/FileSystem.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/3rdparty/webkit/WebCore/platform/FileSystem.h b/src/3rdparty/webkit/WebCore/platform/FileSystem.h index 958eb73..d144990 100644 --- a/src/3rdparty/webkit/WebCore/platform/FileSystem.h +++ b/src/3rdparty/webkit/WebCore/platform/FileSystem.h @@ -90,6 +90,17 @@ struct PlatformModuleVersion { { } + bool operator != (const PlatformModuleVersion& rhs) const + { + return mostSig != rhs.mostSig && leastSig != rhs.leastSig; + } + + + bool operator > (const PlatformModuleVersion& rhs) const + { + return mostSig > rhs.mostSig && leastSig > rhs.leastSig; + } + }; #else typedef QLibrary* PlatformModule; -- cgit v0.12 From 9fab0ede200960f0dbec1457757a6ba3214c3ce6 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 28 Oct 2009 10:03:12 +0100 Subject: fix font height calculation on QWS fontDef.pixelSize is a qreal now and we should round it after multiplication to avoid an accuracy loss. Reviewed-by: mae --- src/gui/text/qfontengine_qpf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp index 6ff0fbd..94974fc 100644 --- a/src/gui/text/qfontengine_qpf.cpp +++ b/src/gui/text/qfontengine_qpf.cpp @@ -819,7 +819,7 @@ FT_Face QFontEngineQPF::lockFace() const FT_Face face = freetype->face; // ### not perfect - const int ysize = int(fontDef.pixelSize) << 6; + const int ysize = qRound(fontDef.pixelSize * qreal(64)); const int xsize = ysize; if (freetype->xsize != xsize || freetype->ysize != ysize) { -- cgit v0.12 From 2a0d6bf8d3f7c92667512d2222cf2304e06130b4 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 3 Nov 2009 10:56:06 +0100 Subject: Adapt testcase to cosmetic pen workarounds in code Reviewed-by: Samuel --- tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp index fbeb425..55294d5 100644 --- a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp +++ b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp @@ -357,7 +357,7 @@ void tst_QGraphicsEffectSource::pixmapPadding_data() QTest::newRow("log,transparent") << int(Qt::LogicalCoordinates) << int(QGraphicsEffectSource::ExpandToTransparentBorderPadMode) - << QSize(12, 12) << QPoint(-1, -1) + << QSize(14, 14) << QPoint(-2, -2) << 0x00000000u; QTest::newRow("log,effectrect") << int(Qt::LogicalCoordinates) @@ -372,7 +372,7 @@ void tst_QGraphicsEffectSource::pixmapPadding_data() QTest::newRow("dev,transparent") << int(Qt::DeviceCoordinates) << int(QGraphicsEffectSource::ExpandToTransparentBorderPadMode) - << QSize(22, 22) << QPoint(39, 39) + << QSize(24, 24) << QPoint(38, 38) << 0x00000000u; QTest::newRow("dev,effectrect") << int(Qt::DeviceCoordinates) -- cgit v0.12 From 1fd46b4495241ed03371fb5c86965b788791b363 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 11:45:16 +0100 Subject: Embed code examples in state machine overview If you put \snippet inside \code tags, it's interpreted as code, not as a tag. Reviewed-by: Trust me --- doc/src/frameworks-technologies/statemachine.qdoc | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/doc/src/frameworks-technologies/statemachine.qdoc b/doc/src/frameworks-technologies/statemachine.qdoc index ac10314..9614dd3 100644 --- a/doc/src/frameworks-technologies/statemachine.qdoc +++ b/doc/src/frameworks-technologies/statemachine.qdoc @@ -426,9 +426,8 @@ value of the property before any property assignments in states were executed.) Take the following code: - \code - \snippet doc/src/snippets/statemachine/main5.cpp 0 - \endcode + + \snippet doc/src/snippets/statemachine/main5.cpp 0 Lets say the property \c fooBar is 0.0 when the machine starts. When the machine is in state \c s1, the property will be 1.0, since the state explicitly assigns this value to it. When the @@ -437,9 +436,8 @@ If we are using nested states, the parent defines a value for the property which is inherited by all descendants that do not explicitly assign a value to the property. - \code + \snippet doc/src/snippets/statemachine/main5.cpp 2 - \endcode Here \c s1 has two children: \c s2 and \c s3. When \c s2 is entered, the property \c fooBar will have the value 2.0, since this is explicitly defined for the state. When the machine is in @@ -452,9 +450,8 @@ properties as they are assigned in states. Say we have the following code: - \code + \snippet doc/src/snippets/statemachine/main5.cpp 3 - \endcode Here we define two states of a user interface. In \c s1 the \c button is small, and in \c s2 it is bigger. If we click the button to transition from \c s1 to \c s2, the geometry of the button @@ -462,9 +459,7 @@ smooth, however, all we need to do is make a QPropertyAnimation and add this to the transition object. - \code \snippet doc/src/snippets/statemachine/main5.cpp 4 - \endcode Adding an animation for the property in question means that the property assignment will no longer take immediate effect when the state has been entered. Instead, the animation will start @@ -486,9 +481,8 @@ the value defined by a state. Say we have the following code: - \code + \snippet doc/src/snippets/statemachine/main5.cpp 5 - \endcode When \c button is clicked, the machine will transition into state \c s2, which will set the geometry of the button, and then pop up a message box to alert the user that the geometry has @@ -504,9 +498,8 @@ value, we can use the state's polished() signal. The polished() signal will be emitted when the the property is assigned its final value, whether this is done immediately or after the animation has finished playing. - \code + \snippet doc/src/snippets/statemachine/main5.cpp 6 - \endcode In this example, when \c button is clicked, the machine will enter \c s2. It will remain in state \c s2 until the \c geometry property has been set to \c QRect(0, 0, 50, 50). Then it will -- cgit v0.12 From 04d5735a608aeeab259463b1bc80842b5134ede6 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Mon, 2 Nov 2009 16:36:41 +0100 Subject: Prepend qt_instdate when using configure.exe as well. Rebuilt configure.exe Rebuilt using VS2008. Reviewed-By: Alessandro Portale --- configure.exe | Bin 1169408 -> 1171968 bytes tools/configure/configureapp.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.exe b/configure.exe index f433888..7c11fec 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 28645a0..3f891f6 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3032,7 +3032,7 @@ void Configure::generateConfigfiles() << "static const char qt_configure_licensed_products_str [512 + 12] = \"qt_lcnsprod=" << dictionary["EDITION"] << "\";" << endl << endl << "/* Build date */" << endl - << "static const char qt_configure_installation [11 + 12] = \"" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl + << "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl << endl; if(!dictionary[ "QT_HOST_PREFIX" ].isNull()) tmpStream << "#if !defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE)" << endl; -- cgit v0.12 From 93ec4104781d7f9929b8b8a05dee3d94f8cd4b17 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 3 Nov 2009 12:06:00 +0100 Subject: Revert "Compile fix until configure.exe is rebuilt for Windows" since the required changes to configure.exe have been added. You will need to run configure after updating! Reviewed-By: Alessandro Portale This reverts commit 94be7bf47fe93ca4fa6ae90f5906f6ef711f558e. --- src/corelib/global/qlibraryinfo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 32693e0..15a06d7 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -215,8 +215,7 @@ QLibraryInfo::buildKey() QDate QLibraryInfo::buildDate() { - return QDate(); - //return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); + return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate); } /*! -- cgit v0.12 From 68be6457f6732437b485812ab2db11c147a24b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 3 Nov 2009 12:15:53 +0100 Subject: Removed usage of CompositionMode_Source in QGraphicsView for X11. Due to the rendering model in XRender ((src IN mask) OP dest) we can't support the PorterDuff composition modes natively under X11. They just behave differently than what we've defined them to do in QPainter, and there is no apparent workaround. Task-number: QTBUG-4829 Reviewed-by: Gunnar --- src/gui/graphicsview/qgraphicsview.cpp | 8 +++++++- src/gui/painting/qpainter.cpp | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 710c745..8945f51 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -281,6 +281,7 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime < #include #include #ifdef Q_WS_X11 +#include #include #endif @@ -3294,7 +3295,12 @@ void QGraphicsView::paintEvent(QPaintEvent *event) backgroundPainter.setClipRegion(d->backgroundPixmapExposed, Qt::ReplaceClip); if (viewTransformed) backgroundPainter.setTransform(viewTransform); - backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source); +#ifdef Q_WS_X11 +#undef X11 + if (backgroundPainter.paintEngine()->type() != QPaintEngine::X11) +#define X11 qt_x11Data +#endif + backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source); drawBackground(&backgroundPainter, exposedSceneRect); d->backgroundPixmapExposed = QRegion(); } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index cddad7d..8d6cad3 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2275,8 +2275,9 @@ void QPainter::setBrushOrigin(const QPointF &p) /*! Sets the composition mode to the given \a mode. - \warning You can only set the composition mode for QPainter - objects that operates on a QImage. + \warning Only a QPainter operating on a QImage fully supports all + composition modes. The RasterOp modes are supported for X11 as + described in compositionMode(). \sa compositionMode() */ -- cgit v0.12 From 159350b766299fee1bfa44410c19500335267fd8 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 3 Nov 2009 13:04:39 +0100 Subject: Fixed crash in QPixmap::fromImage with an Indexed8 without a colortable. Reviewed-by: Trond --- src/gui/image/qpixmap_mac.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 15350e8..9209d45 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -305,11 +305,15 @@ void QMacPixmapData::fromImage(const QImage &img, } break; } - case QImage::Format_Indexed8: - for (int x = 0; x < w; ++x) { - *(drow+x) = PREMUL(image.color(*(srow + x))); + case QImage::Format_Indexed8: { + int numColors = image.numColors(); + if (numColors > 0) { + for (int x = 0; x < w; ++x) { + int index = *(srow + x); + *(drow+x) = PREMUL(image.color(qMin(index, numColors))); + } } - break; + } break; case QImage::Format_RGB32: for (int x = 0; x < w; ++x) *(drow+x) = *(((quint32*)srow) + x) | 0xFF000000; -- cgit v0.12 From 6ec05db9b819a23ebac5a5908b8e3ca56b251e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 3 Nov 2009 12:39:46 +0100 Subject: Made QPainter::drawText() respect Qt::TextDontClip flag. The flag was not respected in the vertical direction for any text lines completely outside the bounding rect. Task-number: QTBUG-1666 Reviewed-by: Trond --- src/gui/painting/qpainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 8d6cad3..e0423f3 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7604,7 +7604,7 @@ start_lengthVariant: l.setPosition(QPointF(0., height)); height += l.height(); width = qMax(width, l.naturalTextWidth()); - if (!brect && height >= r.height()) + if (!dontclip && !brect && height >= r.height()) break; } textLayout.endLayout(); -- cgit v0.12 From 0a24f29a0f53716f9c9e000f5bb55ac5d925df5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 3 Nov 2009 12:11:50 +0100 Subject: Fixed some compiler warnings. Reviewed-by: Trond --- src/gui/painting/qpainterpath_p.h | 9 ++++---- .../gl2paintengineex/qglengineshadermanager.cpp | 9 ++------ src/opengl/qglpixmapfilter.cpp | 24 +--------------------- 3 files changed, 7 insertions(+), 35 deletions(-) diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index 112c2bd..54b9392 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -132,10 +132,9 @@ public: QPainterPathData() : cStart(0), fillRule(Qt::OddEvenFill), - pathConverter(0), dirtyBounds(false), - dirtyControlBounds(false) - + dirtyControlBounds(false), + pathConverter(0) { ref = 1; require_moveTo = false; @@ -146,10 +145,10 @@ public: QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule), bounds(other.bounds), controlBounds(other.controlBounds), - pathConverter(0), dirtyBounds(other.dirtyBounds), dirtyControlBounds(other.dirtyControlBounds), - convex(other.convex) + convex(other.convex), + pathConverter(0) { ref = 1; require_moveTo = false; diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index 34c448f..40a6241 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -153,13 +153,8 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) // Check that all the elements have been filled: for (int i = 0; i < TotalSnippetCount; ++i) { if (qShaderSnippets[i] == 0) { - QByteArray msg; - msg.append("Fatal: Shader Snippet for "); - msg.append(snippetNameStr(SnippetName(i))); - msg.append(" ("); - msg.append(QByteArray::number(i)); - msg.append(") is missing!"); - qFatal(msg.constData()); + qFatal("Shader snippet for %s (#%d) is missing!", + snippetNameStr(SnippetName(i)).constData(), i); } } #endif diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index ff19e06..8768fbc 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -316,28 +316,6 @@ static const char *qt_gl_texture_sampling_helper = " return texture2D(src, srcCoords).a;\n" "}\n"; -static const char *qt_gl_clamped_texture_sampling_helper = - "highp vec4 texture_dimensions;\n" // x = width, y = height, z = 0.5/width, w = 0.5/height - "lowp float clampedTexture2DAlpha(lowp sampler2D src, highp vec2 srcCoords) {\n" - " highp vec2 clampedCoords = clamp(srcCoords, texture_dimensions.zw, vec2(1.0) - texture_dimensions.zw);\n" - " highp vec2 t = clamp(min(srcCoords, vec2(1.0) - srcCoords) * srcDim + 0.5, 0.0, 1.0);\n" - " return texture2D(src, clampedCoords).a * t.x * t.y;\n" - "}\n" - "lowp vec4 clampedTexture2D(lowp sampler2D src, highp vec2 srcCoords) {\n" - " highp vec2 clampedCoords = clamp(srcCoords, texture_dimensions.zw, vec2(1.0) - texture_dimensions.zw);\n" - " highp vec2 t = clamp(min(srcCoords, vec2(1.0) - srcCoords) * srcDim + 0.5, 0.0, 1.0);\n" - " return texture2D(src, clampedCoords) * t.x * t.y;\n" - "}\n"; - -static QByteArray qt_gl_convertToClamped(const QByteArray &source) -{ - QByteArray result; - result.append(qt_gl_clamped_texture_sampling_helper); - result.append(QByteArray(source).replace("texture2DAlpha", "clampedTexture2DAlpha") - .replace("texture2D", "clampedTexture2D")); - return result; -} - QGLPixmapBlurFilter::QGLPixmapBlurFilter(QGraphicsBlurEffect::BlurHint hint) : m_animatedBlur(false) , m_haveCached(false) @@ -433,7 +411,7 @@ QGLBlurTextureCache::~QGLBlurTextureCache() blurTextureCaches.removeAt(blurTextureCaches.indexOf(this)); } -void QGLBlurTextureCache::timerEvent(QTimerEvent *event) +void QGLBlurTextureCache::timerEvent(QTimerEvent *) { killTimer(timerId); timerId = 0; -- cgit v0.12 From 4c011468bb93a3d0b8e5cc0d9dd16e7528079119 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 3 Nov 2009 14:05:00 +0100 Subject: Compile... Reviewed-by: TrustMe --- src/gui/styles/qwindowsxpstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index 9fd9ce9..fe7f5d7 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -2926,10 +2926,10 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } // Draw arrow p->save(); - p->setPen(option->palette.dark()); + p->setPen(option->palette.dark().color()); p->drawLine(menuarea.left(), menuarea.top() + 3, menuarea.left(), menuarea.bottom() - 3); - p->setPen(option->palette.light()); + p->setPen(option->palette.light().color()); p->drawLine(menuarea.left() - 1, menuarea.top() + 3, menuarea.left() - 1, menuarea.bottom() - 3); -- cgit v0.12 From 4d0735b98a9bd6b440adf63725e6062b601ed442 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 3 Nov 2009 14:05:31 +0100 Subject: Check for QPixmap::isNull() in QPainter::drawPixmap() Reviewed-by: Samuel --- src/gui/painting/qpainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 8d6cad3..cbae5b6 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5164,7 +5164,7 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm) Q_D(QPainter); - if (!d->engine) + if (!d->engine || pm.isNull()) return; #ifndef QT_NO_DEBUG -- cgit v0.12 From 53e486c0e8d23d535711debdd3a71c8ef2211c58 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 3 Nov 2009 14:41:22 +0100 Subject: Fixed tst_qgraphicsitem::hitTestGraphicsEffectItem, caching makes testcase invalid... Reviewed-by: Samuel --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 684ad4f..3bc6db5 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -7676,20 +7676,6 @@ void tst_QGraphicsItem::hitTestGraphicsEffectItem() QCOMPARE(items.size(), 1); QCOMPARE(items.at(0), static_cast(item3)); - item1->repaints = 0; - item2->repaints = 0; - item3->repaints = 0; - - view.viewport()->update(75, 75, 20, 20); - QTest::qWait(50); - - // item1 is the effect source and must therefore be repainted. - // item2 intersects with the exposed region - // item3 is just another child outside the exposed region - QCOMPARE(item1->repaints, 1); - QCOMPARE(item2->repaints, 1); - QCOMPARE(item3->repaints, 0); - scene.setItemIndexMethod(QGraphicsScene::NoIndex); QTest::qWait(100); -- cgit v0.12 From edec363cd4dfcb01c488be7f66bdfa2ca93f48bf Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 3 Nov 2009 14:53:19 +0100 Subject: Doc: Added links to the SQL documentation and corrected license info. Reviewed-by: Trust Me --- doc/src/modules.qdoc | 5 ++++- doc/src/sql-programming/sql-programming.qdoc | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 9c92a31..ea5a9dc 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -367,6 +367,9 @@ The QtSql module is part of the \l{Qt Full Framework Edition} and the \l{Open Source Versions of Qt}. + + See the \l{SQL Programming} guide for information about using this + module in your applications. */ /*! @@ -576,7 +579,7 @@ the module under the appropriate version of the GNU LGPL; version 2.1 for applications and libraries licensed under the GNU GPL version 2, or version 3 for applications and libraries licensed under the GNU - GPL version 2. + GPL version 3. \legalese This file is part of the KDE project diff --git a/doc/src/sql-programming/sql-programming.qdoc b/doc/src/sql-programming/sql-programming.qdoc index d0b6776..3aceb17 100644 --- a/doc/src/sql-programming/sql-programming.qdoc +++ b/doc/src/sql-programming/sql-programming.qdoc @@ -49,6 +49,7 @@ /*! \page sql-programming.html \title SQL Programming + \nextpage Connecting to Databases \brief Database integration for Qt applications. @@ -95,7 +96,7 @@ and the SQL API layer. See \l{SQL Database Drivers} for more information. \section2 SQL API Layer - + These classes provide access to databases. Connections are made using the QSqlDatabase class. Database interaction is achieved by using the QSqlQuery class. @@ -119,6 +120,7 @@ \title Connecting to Databases \contentspage SQL Programming + \previouspage SQL Programming \nextpage Executing SQL Statements To access a database with QSqlQuery or QSqlQueryModel, create and -- cgit v0.12 From 86e074f47848955cd0ffbc78112493af46c2ed12 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 3 Nov 2009 15:45:32 +0100 Subject: Doc: Fixed license information. Reviewed-by: Trust Me --- src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 09dfae5..408478c 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -31,7 +31,7 @@ the module under the appropriate version of the GNU LGPL; version 2.1 for applications and libraries licensed under the GNU GPL version 2, or version 3 for applications and libraries licensed under the GNU - GPL version 2. + GPL version 3. \legalese WebKit is licensed under the GNU Library General Public License. -- cgit v0.12 From c95a0e6e8eb8ba5fd2a4412b318ad998b3ccb4fc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 3 Nov 2009 16:06:05 +0100 Subject: Doc/i18n: Fixed source strings for translation. Reviewed-by: Oswald Buddenhagen --- src/3rdparty/phonon/gstreamer/mediaobject.cpp | 2 +- src/3rdparty/phonon/mmf/effectfactory.cpp | 4 ++-- .../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp | 4 ++-- src/gui/itemviews/qdirmodel.cpp | 2 +- src/network/ssl/qsslerror.cpp | 4 ++-- src/network/ssl/qsslsocket_openssl.cpp | 2 +- src/xmlpatterns/expr/qncnameconstructor_p.h | 2 +- src/xmlpatterns/parser/qquerytransformparser.cpp | 18 +++++++++--------- src/xmlpatterns/schema/qxsdschemahelper.cpp | 2 +- src/xmlpatterns/schema/qxsdschemaparser.cpp | 2 +- .../schema/qxsdvalidatinginstancereader.cpp | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 5dcbd42..0eb34b0 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -87,7 +87,7 @@ MediaObject::MediaObject(Backend *backend, QObject *parent) m_name = "MediaObject" + QString::number(count++); if (!m_backend->isValid()) { - setError(tr("Cannot start playback. \n\nCheck your Gstreamer installation and make sure you " + setError(tr("Cannot start playback. \n\nCheck your GStreamer installation and make sure you " "\nhave libgstreamer-plugins-base installed."), Phonon::FatalError); } else { m_root = this; diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 214baa0..e9c5e27 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -62,9 +62,9 @@ QHash EffectFactory::audioEffectDescriptions(AbstractAudio switch (type) { case AbstractAudioEffect::EffectAudioEqualizer: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "audio equalizer"), "Audio equalizer."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Audio Equalizer"), "Audio equalizer."); case AbstractAudioEffect::EffectBassBoost: - return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass boost"), "Bass boost."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass Boost"), "Bass boost."); case AbstractAudioEffect::EffectDistanceAttenuation: return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Distance Attenuation"), "Distance Attenuation."); case AbstractAudioEffect::EffectEnvironmentalReverb: diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 81ccbe8..1ed9b21 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -708,7 +708,7 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request) { ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(), - QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); + QCoreApplication::translate("QWebFrame", "Request canceled", 0, QCoreApplication::UnicodeUTF8)); error.setIsCancellation(true); return error; } @@ -746,7 +746,7 @@ WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response) { return ResourceError("WebKit", WebKitErrorCannotShowMIMEType, response.url().string(), - QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8)); + QCoreApplication::translate("QWebFrame", "Cannot show MIME type", 0, QCoreApplication::UnicodeUTF8)); } WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response) diff --git a/src/gui/itemviews/qdirmodel.cpp b/src/gui/itemviews/qdirmodel.cpp index 2973741..942cfd7 100644 --- a/src/gui/itemviews/qdirmodel.cpp +++ b/src/gui/itemviews/qdirmodel.cpp @@ -1351,7 +1351,7 @@ QString QDirModelPrivate::size(const QModelIndex &index) const return QFileSystemModel::tr("%1 MB").arg(QLocale().toString(qreal(bytes) / mb, 'f', 1)); if (bytes >= kb) return QFileSystemModel::tr("%1 KB").arg(QLocale().toString(bytes / kb)); - return QFileSystemModel::tr("%1 bytes").arg(QLocale().toString(bytes)); + return QFileSystemModel::tr("%1 byte(s)").arg(QLocale().toString(bytes)); } QString QDirModelPrivate::type(const QModelIndex &index) const diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp index 62fcd4c..8fb605c 100644 --- a/src/network/ssl/qsslerror.cpp +++ b/src/network/ssl/qsslerror.cpp @@ -251,10 +251,10 @@ QString QSslError::errorString() const errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "One of the CA certificates is invalid")); break; case PathLengthExceeded: - errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The basicConstraints pathlength parameter has been exceeded")); + errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The basicConstraints path length parameter has been exceeded")); break; case InvalidPurpose: - errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The supplied certificate is unsuited for this purpose")); + errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The supplied certificate is unsuitable for this purpose")); break; case CertificateUntrusted: errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, "The root CA certificate is not trusted for this purpose")); diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 6f7e55a..743722f 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -324,7 +324,7 @@ init_context: // Check if the certificate matches the private key. if (!q_SSL_CTX_check_private_key(ctx)) { - q->setErrorString(QSslSocket::tr("Private key does not certificate public key, %1").arg(SSL_ERRORSTR())); + q->setErrorString(QSslSocket::tr("Private key does not certify public key, %1").arg(SSL_ERRORSTR())); emit q->error(QAbstractSocket::UnknownSocketError); return false; } diff --git a/src/xmlpatterns/expr/qncnameconstructor_p.h b/src/xmlpatterns/expr/qncnameconstructor_p.h index 6875c48..bbf9726 100644 --- a/src/xmlpatterns/expr/qncnameconstructor_p.h +++ b/src/xmlpatterns/expr/qncnameconstructor_p.h @@ -112,7 +112,7 @@ namespace QPatternist { return QtXmlPatterns::tr("The target name in a processing instruction " "cannot be %1 in any combination of upper " - "and lower case. Therefore, is %2 invalid.") + "and lower case. Therefore, %2 is invalid.") .arg(formatKeyword("xml"), formatKeyword(lexTarget)); } }; diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp index 5894b83..c250d0c 100644 --- a/src/xmlpatterns/parser/qquerytransformparser.cpp +++ b/src/xmlpatterns/parser/qquerytransformparser.cpp @@ -418,7 +418,7 @@ static void registerNamedTemplate(const QXmlName &name, if(e) { - parseInfo->staticContext->error(QtXmlPatterns::tr("A template by name %1 " + parseInfo->staticContext->error(QtXmlPatterns::tr("A template with name %1 " "has already been declared.") .arg(formatKeyword(parseInfo->staticContext->namePool(), name)), @@ -882,7 +882,7 @@ static void variableUnavailable(const QXmlName &variableName, const ParserContext *const parseInfo, const YYLTYPE &location) { - parseInfo->staticContext->error(QtXmlPatterns::tr("No variable by name %1 exists") + parseInfo->staticContext->error(QtXmlPatterns::tr("No variable with name %1 exists") .arg(formatKeyword(parseInfo->staticContext->namePool(), variableName)), ReportContext::XPST0008, fromYYLTYPE(location, parseInfo)); } @@ -4028,7 +4028,7 @@ yyreduce: const AtomicValue::Ptr val(Decimal::fromLexical((yyvsp[(2) - (2)].sval))); if(val->hasError()) { - parseInfo->staticContext->error(QtXmlPatterns::tr("The value of attribute %1 must of type %2, which %3 isn't.") + parseInfo->staticContext->error(QtXmlPatterns::tr("The value of attribute %1 must be of type %2, which %3 isn't.") .arg(formatKeyword(QLatin1String("priority")), formatType(parseInfo->staticContext->namePool(), BuiltinTypes::xsDecimal), formatData((yyvsp[(2) - (2)].sval))), @@ -4104,7 +4104,7 @@ yyreduce: else if ((yyvsp[(5) - (7)].sval) == CommonNamespaces::XML || (yyvsp[(3) - (7)].sval) == QLatin1String("xml")) { parseInfo->staticContext->error(QtXmlPatterns::tr( - "The prefix %1 can not be bound. By default, it is already bound " + "The prefix %1 cannot be bound. By default, it is already bound " "to the namespace %2.") .arg(formatKeyword("xml")) .arg(formatURI(CommonNamespaces::XML)), @@ -4415,7 +4415,7 @@ yyreduce: allowedIn(QXmlQuery::XQuery10, parseInfo, (yyloc), (yyvsp[(3) - (9)].enums.Bool)); if(variableByName((yyvsp[(5) - (9)].qName), parseInfo)) { - parseInfo->staticContext->error(QtXmlPatterns::tr("A variable by name %1 has already " + parseInfo->staticContext->error(QtXmlPatterns::tr("A variable with name %1 has already " "been declared.") .arg(formatKeyword(parseInfo->staticContext->namePool()->toLexical((yyvsp[(5) - (9)].qName)))), parseInfo->isXSLT() ? ReportContext::XTSE0630 : ReportContext::XQST0049, @@ -4455,7 +4455,7 @@ yyreduce: else { parseInfo->staticContext->error(QtXmlPatterns::tr("No value is available for the external " - "variable by name %1.") + "variable with name %1.") .arg(formatKeyword(parseInfo->staticContext->namePool(), (yyvsp[(5) - (9)].qName))), parseInfo->isXSLT() ? ReportContext::XTDE0050 : ReportContext::XPDY0002, fromYYLTYPE((yyloc), parseInfo)); @@ -4674,7 +4674,7 @@ yyreduce: { if((*it)->name() == (yyvsp[(3) - (3)].functionArgument)->name()) { - parseInfo->staticContext->error(QtXmlPatterns::tr("An argument by name %1 has already " + parseInfo->staticContext->error(QtXmlPatterns::tr("An argument with name %1 has already " "been declared. Every argument name " "must be unique.") .arg(formatKeyword(parseInfo->staticContext->namePool(), (yyvsp[(3) - (3)].functionArgument)->name())), @@ -6679,7 +6679,7 @@ yyreduce: (yyval.expr) = create(func, (yyloc), parseInfo); else { - parseInfo->staticContext->error(QtXmlPatterns::tr("No function by name %1 is available.") + parseInfo->staticContext->error(QtXmlPatterns::tr("No function with name %1 is available.") .arg(formatKeyword(parseInfo->staticContext->namePool(), (yyvsp[(1) - (4)].qName))), ReportContext::XPST0017, fromYYLTYPE((yyloc), parseInfo)); } @@ -6929,7 +6929,7 @@ yyreduce: &ryy, true); if(declaredAttributes.contains(att)) { - parseInfo->staticContext->error(QtXmlPatterns::tr("An attribute by name %1 has already appeared on this element.") + parseInfo->staticContext->error(QtXmlPatterns::tr("An attribute with name %1 has already appeared on this element.") .arg(formatKeyword(parseInfo->staticContext->namePool(), att)), ReportContext::XQST0040, fromYYLTYPE((yyloc), parseInfo)); diff --git a/src/xmlpatterns/schema/qxsdschemahelper.cpp b/src/xmlpatterns/schema/qxsdschemahelper.cpp index e9f32c2..7813808 100644 --- a/src/xmlpatterns/schema/qxsdschemahelper.cpp +++ b/src/xmlpatterns/schema/qxsdschemahelper.cpp @@ -727,7 +727,7 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis } } else { if (!wildcard) { - errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not exists in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not exist in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp index 41c6b82..beb28bb 100644 --- a/src/xmlpatterns/schema/qxsdschemaparser.cpp +++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp @@ -5959,7 +5959,7 @@ void XsdSchemaParser::validateIdAttribute(const char *elementName) attributeContentError("id", elementName, value, BuiltinTypes::xsID); } else { if (m_idCache->hasId(value)) { - error(QtXmlPatterns::tr("Component with id %1 has been defined previously.").arg(formatData(value))); + error(QtXmlPatterns::tr("Component with ID %1 has been defined previously.").arg(formatData(value))); } else { m_idCache->addId(value); } diff --git a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp index fda3548..622a39f 100644 --- a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp +++ b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp @@ -469,7 +469,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara // 3.2.3.2 if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { - error(QtXmlPatterns::tr("Fixed value constrained not allowed if element is nillable.")); + error(QtXmlPatterns::tr("Fixed value constraint not allowed if element is nillable.")); return false; } } @@ -699,7 +699,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (complexType->contentType()->variety() == XsdComplexType::ContentType::Mixed) { if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (hasChildElement()) { - error(QtXmlPatterns::tr("Element %1 can not contain other elements, as it has a fixed content.").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 cannot contain other elements, as it has a fixed content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } -- cgit v0.12 From a4e7db378ecd11bc858f76beb33c56ccebef6308 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 3 Nov 2009 15:59:41 +0100 Subject: Fixed fillRect on QImage::Format_ARGB32 images. With composition mode set to QPainter::CompositionMode_Source, the raster paint engine's fillRect function filled images which had non-premultiplied format with premultiplied colours. This was fixed by converting the premultiplied colour back to non-premultiplied before writing to the image. Task-number: QTBUG-5189 Reviewed-by: Trond --- src/gui/painting/qdrawhelper.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 53edbb0..41602a1 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -7424,6 +7424,14 @@ QT_RECTFILL(qrgb444) QT_RECTFILL(qargb4444) #undef QT_RECTFILL +inline static void qt_rectfill_nonpremul_quint32(QRasterBuffer *rasterBuffer, + int x, int y, int width, int height, + quint32 color) +{ + qt_rectfill(reinterpret_cast(rasterBuffer->buffer()), + INV_PREMUL(color), x, y, width, height, rasterBuffer->bytesPerLine()); +} + // Map table for destination image format. Contains function pointers // for blends of various types unto the destination @@ -7466,7 +7474,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] = qt_bitmapblit_quint32, qt_alphamapblit_quint32, qt_alphargbblit_quint32, - qt_rectfill_quint32 + qt_rectfill_nonpremul_quint32 }, // Format_ARGB32_Premultiplied { -- cgit v0.12 From 9f62759028b0bdb8fb7991c349d58a89323b8567 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 11:04:07 +0100 Subject: Change name of QStateMachine::animationsEnabled property to "animated" The name "animated" is consistent with naming in Qt otherwise, as in QTreeView::animated and QMainWindow::animated. Reviewed-by: Kent Hansen --- src/corelib/statemachine/qstatemachine.cpp | 14 +++++++------- src/corelib/statemachine/qstatemachine.h | 6 +++--- src/corelib/statemachine/qstatemachine_p.h | 2 +- tests/auto/qstatemachine/tst_qstatemachine.cpp | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 689967a..322e24a 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -164,7 +164,7 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_ANIMATION /*! - \property QStateMachine::animationsEnabled + \property QStateMachine::animated \brief whether animations are enabled @@ -188,7 +188,7 @@ QStateMachinePrivate::QStateMachinePrivate() globalRestorePolicy = QStateMachine::DoNotRestoreProperties; signalEventGenerator = 0; #ifndef QT_NO_ANIMATION - animationsEnabled = true; + animated = true; #endif } @@ -742,7 +742,7 @@ void QStateMachinePrivate::applyProperties(const QList &tr // Find the animations to use for the state change. QList selectedAnimations; - if (animationsEnabled) { + if (animated) { for (int i = 0; i < transitionList.size(); ++i) { QAbstractTransition *transition = transitionList.at(i); @@ -2116,19 +2116,19 @@ void QStateMachine::onExit(QEvent *event) /*! Returns whether animations are enabled for this state machine. */ -bool QStateMachine::animationsEnabled() const +bool QStateMachine::isAnimated() const { Q_D(const QStateMachine); - return d->animationsEnabled; + return d->animated; } /*! Sets whether animations are \a enabled for this state machine. */ -void QStateMachine::setAnimationsEnabled(bool enabled) +void QStateMachine::setAnimated(bool enabled) { Q_D(QStateMachine); - d->animationsEnabled = enabled; + d->animated = enabled; } /*! diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h index 13b6fe2..f7ceba1 100644 --- a/src/corelib/statemachine/qstatemachine.h +++ b/src/corelib/statemachine/qstatemachine.h @@ -67,7 +67,7 @@ class Q_CORE_EXPORT QStateMachine : public QState Q_PROPERTY(RestorePolicy globalRestorePolicy READ globalRestorePolicy WRITE setGlobalRestorePolicy) Q_ENUMS(RestorePolicy) #ifndef QT_NO_ANIMATION - Q_PROPERTY(bool animationsEnabled READ animationsEnabled WRITE setAnimationsEnabled) + Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated) #endif public: class SignalEvent : public QEvent @@ -133,8 +133,8 @@ public: bool isRunning() const; #ifndef QT_NO_ANIMATION - bool animationsEnabled() const; - void setAnimationsEnabled(bool enabled); + bool isAnimated() const; + void setAnimated(bool enabled); void addDefaultAnimation(QAbstractAnimation *animation); QList defaultAnimations() const; diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h index 69b727d..f0d9c7c 100644 --- a/src/corelib/statemachine/qstatemachine_p.h +++ b/src/corelib/statemachine/qstatemachine_p.h @@ -200,7 +200,7 @@ public: QSet pendingErrorStatesForDefaultEntry; #ifndef QT_NO_ANIMATION - bool animationsEnabled; + bool animated; QPair, QList > initializeAnimation(QAbstractAnimation *abstractAnimation, diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 975b301..0df8d52 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -1340,11 +1340,11 @@ void tst_QStateMachine::assignPropertyWithAnimation() // Single animation { QStateMachine machine; - QVERIFY(machine.animationsEnabled()); - machine.setAnimationsEnabled(false); - QVERIFY(!machine.animationsEnabled()); - machine.setAnimationsEnabled(true); - QVERIFY(machine.animationsEnabled()); + QVERIFY(machine.isAnimated()); + machine.setAnimated(false); + QVERIFY(!machine.isAnimated()); + machine.setAnimated(true); + QVERIFY(machine.isAnimated()); QObject obj; obj.setProperty("foo", 321); obj.setProperty("bar", 654); -- cgit v0.12 From b210026bda1fcd6d38b8a5a556aefe4fb5c4f891 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 12:05:55 +0100 Subject: Change name of DoNotRestoreProperties enum to DontRestoreProperties Using the abbreviated "Dont" is consistent with other negated enum names in Qt. Reviewed-by: Kent Hansen --- src/corelib/statemachine/qstatemachine.cpp | 8 ++++---- src/corelib/statemachine/qstatemachine.h | 2 +- tests/auto/qstatemachine/tst_qstatemachine.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 322e24a..0d07093 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -159,7 +159,7 @@ QT_BEGIN_NAMESPACE \brief the restore policy for states of this state machine. The default value of this property is - QStateMachine::DoNotRestoreProperties. + QStateMachine::DontRestoreProperties. */ #ifndef QT_NO_ANIMATION @@ -185,7 +185,7 @@ QStateMachinePrivate::QStateMachinePrivate() stop = false; stopProcessingReason = EventQueueEmpty; error = QStateMachine::NoError; - globalRestorePolicy = QStateMachine::DoNotRestoreProperties; + globalRestorePolicy = QStateMachine::DontRestoreProperties; signalEventGenerator = 0; #ifndef QT_NO_ANIMATION animated = true; @@ -1696,7 +1696,7 @@ QStateMachine::~QStateMachine() already been saved by the state machine, it will not be overwritten until the property has been successfully restored. - \value DoNotRestoreProperties The state machine should not save the initial values of properties + \value DontRestoreProperties The state machine should not save the initial values of properties and restore them later. \value RestoreProperties The state machine should save the initial values of properties and restore them later. @@ -1746,7 +1746,7 @@ QStateMachine::RestorePolicy QStateMachine::globalRestorePolicy() const /*! Sets the restore policy of the state machine to \a restorePolicy. The default - restore policy is QAbstractState::DoNotRestoreProperties. + restore policy is QAbstractState::DontRestoreProperties. \sa globalRestorePolicy() */ diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h index f7ceba1..ff2b667 100644 --- a/src/corelib/statemachine/qstatemachine.h +++ b/src/corelib/statemachine/qstatemachine.h @@ -109,7 +109,7 @@ public: }; enum RestorePolicy { - DoNotRestoreProperties, + DontRestoreProperties, RestoreProperties }; diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 0df8d52..31ab3af 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -162,7 +162,7 @@ private slots: void defaultGlobalRestorePolicy(); void globalRestorePolicySetToRestore(); - void globalRestorePolicySetToDoNotRestore(); + void globalRestorePolicySetToDontRestore(); void noInitialStateForInitialState(); @@ -984,7 +984,7 @@ void tst_QStateMachine::customErrorStateNotInGraph() void tst_QStateMachine::restoreProperties() { QStateMachine machine; - QCOMPARE(machine.globalRestorePolicy(), QStateMachine::DoNotRestoreProperties); + QCOMPARE(machine.globalRestorePolicy(), QStateMachine::DontRestoreProperties); machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); QObject *object = new QObject(&machine); @@ -2736,10 +2736,10 @@ void tst_QStateMachine::restorePolicyNotInherited() }*/ -void tst_QStateMachine::globalRestorePolicySetToDoNotRestore() +void tst_QStateMachine::globalRestorePolicySetToDontRestore() { QStateMachine machine; - machine.setGlobalRestorePolicy(QStateMachine::DoNotRestoreProperties); + machine.setGlobalRestorePolicy(QStateMachine::DontRestoreProperties); QObject *propertyHolder = new QObject(&machine); propertyHolder->setProperty("a", 1); -- cgit v0.12 From 569e4b636fc91a9d5c6f6e4d65967327786adb3c Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 13:13:35 +0100 Subject: Remove return type of QState::addTransition(QAbstractTransition*) Returning the input argument in a function can lead to confusion and serves no purpose here. Instead, we'll mirror the API from QMenu::addAction() overloads, where the overload that takes a preconstructed object has a void return type. Reviewed-by: Kent Hansen --- src/corelib/statemachine/qstate.cpp | 15 +++++---- src/corelib/statemachine/qstate.h | 2 +- tests/auto/qstatemachine/tst_qstatemachine.cpp | 42 +++++++++++++++++--------- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index bcd8364..ea20619 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -286,15 +286,14 @@ void QState::setErrorState(QAbstractState *state) /*! Adds the given \a transition. The transition has this state as the source. - This state takes ownership of the transition. If the transition is successfully - added, the function will return the \a transition pointer. Otherwise it will return null. + This state takes ownership of the transition. */ -QAbstractTransition *QState::addTransition(QAbstractTransition *transition) +void QState::addTransition(QAbstractTransition *transition) { Q_D(QState); if (!transition) { qWarning("QState::addTransition: cannot add null transition"); - return 0; + return ; } transition->setParent(this); @@ -303,18 +302,17 @@ QAbstractTransition *QState::addTransition(QAbstractTransition *transition) QAbstractState *t = targets.at(i).data(); if (!t) { qWarning("QState::addTransition: cannot add transition to null state"); - return 0; + return ; } if ((QAbstractStatePrivate::get(t)->machine() != d->machine()) && QAbstractStatePrivate::get(t)->machine() && d->machine()) { qWarning("QState::addTransition: cannot add transition " "to a state in a different state machine"); - return 0; + return ; } } if (machine() != 0 && machine()->configuration().contains(this)) QStateMachinePrivate::get(machine())->registerTransitions(this); - return transition; } /*! @@ -379,7 +377,8 @@ QAbstractTransition *QState::addTransition(QAbstractState *target) return 0; } UnconditionalTransition *trans = new UnconditionalTransition(target); - return addTransition(trans); + addTransition(trans); + return trans; } /*! diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h index 7a47447..781382d 100644 --- a/src/corelib/statemachine/qstate.h +++ b/src/corelib/statemachine/qstate.h @@ -76,7 +76,7 @@ public: QAbstractState *errorState() const; void setErrorState(QAbstractState *state); - QAbstractTransition *addTransition(QAbstractTransition *transition); + void addTransition(QAbstractTransition *transition); QSignalTransition *addTransition(QObject *sender, const char *signal, QAbstractState *target); QAbstractTransition *addTransition(QAbstractState *target); void removeTransition(QAbstractTransition *transition); diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 31ab3af..fb6567a 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -286,8 +286,8 @@ void tst_QStateMachine::transitionToRootState() machine.addState(initialState); machine.setInitialState(initialState); - QAbstractTransition *trans = initialState->addTransition(new EventTransition(QEvent::User, &machine)); - QVERIFY(trans != 0); + QAbstractTransition *trans = new EventTransition(QEvent::User, &machine); + initialState->addTransition(trans); QCOMPARE(trans->sourceState(), initialState); QCOMPARE(trans->targetState(), static_cast(&machine)); @@ -310,7 +310,7 @@ void tst_QStateMachine::transitionFromRootState() QState *root = &machine; QState *s1 = new QState(root); EventTransition *trans = new EventTransition(QEvent::User, s1); - QCOMPARE(root->addTransition(trans), static_cast(trans)); + root->addTransition(trans); QCOMPARE(trans->sourceState(), root); QCOMPARE(trans->targetState(), static_cast(s1)); } @@ -1155,7 +1155,7 @@ void tst_QStateMachine::stateEntryAndExit() QCOMPARE(t->targetState(), (QAbstractState*)s2); QCOMPARE(t->targetStates().size(), 1); QCOMPARE(t->targetStates().at(0), (QAbstractState*)s2); - QCOMPARE(s1->addTransition(t), (QAbstractTransition*)t); + s1->addTransition(t); QCOMPARE(t->sourceState(), (QState*)s1); QCOMPARE(t->machine(), &machine); @@ -1173,7 +1173,7 @@ void tst_QStateMachine::stateEntryAndExit() s2->removeTransition(trans); QCOMPARE(trans->sourceState(), (QState*)0); QCOMPARE(trans->targetState(), (QAbstractState*)s3); - QCOMPARE(s2->addTransition(trans), trans); + s2->addTransition(trans); QCOMPARE(trans->sourceState(), (QState*)s2); } @@ -3117,7 +3117,9 @@ void tst_QStateMachine::twoAnimatedTransitions() QState *s2 = new QState(&machine); s2->assignProperty(object, "foo", 5.0); QPropertyAnimation *fooAnimation = new QPropertyAnimation(object, "foo", s2); - s1->addTransition(new EventTransition(QEvent::User, s2))->addAnimation(fooAnimation); + EventTransition *trans = new EventTransition(QEvent::User, s2); + s1->addTransition(trans); + trans->addAnimation(fooAnimation); QState *s3 = new QState(&machine); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); @@ -3126,7 +3128,9 @@ void tst_QStateMachine::twoAnimatedTransitions() QState *s4 = new QState(&machine); s4->assignProperty(object, "foo", 2.0); QPropertyAnimation *fooAnimation2 = new QPropertyAnimation(object, "foo", s4); - s3->addTransition(new EventTransition(QEvent::User, s4))->addAnimation(fooAnimation2); + trans = new EventTransition(QEvent::User, s4); + s3->addTransition(trans); + trans->addAnimation(fooAnimation2); QState *s5 = new QState(&machine); QObject::connect(s5, SIGNAL(entered()), QApplication::instance(), SLOT(quit())); @@ -3161,7 +3165,9 @@ void tst_QStateMachine::playAnimationTwice() QState *s2 = new QState(&machine); s2->assignProperty(object, "foo", 5.0); QPropertyAnimation *fooAnimation = new QPropertyAnimation(object, "foo", s2); - s1->addTransition(new EventTransition(QEvent::User, s2))->addAnimation(fooAnimation); + EventTransition *trans = new EventTransition(QEvent::User, s2); + s1->addTransition(trans); + trans->addAnimation(fooAnimation); QState *s3 = new QState(&machine); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); @@ -3169,7 +3175,9 @@ void tst_QStateMachine::playAnimationTwice() QState *s4 = new QState(&machine); s4->assignProperty(object, "foo", 2.0); - s3->addTransition(new EventTransition(QEvent::User, s4))->addAnimation(fooAnimation); + trans = new EventTransition(QEvent::User, s4); + s3->addTransition(trans); + trans->addAnimation(fooAnimation); QState *s5 = new QState(&machine); QObject::connect(s5, SIGNAL(entered()), QApplication::instance(), SLOT(quit())); @@ -3213,14 +3221,16 @@ void tst_QStateMachine::nestedTargetStateForAnimation() QState *s2Child2 = new QState(s2); s2Child2->assignProperty(object, "bar", 11.0); - QAbstractTransition *at = s2Child->addTransition(new EventTransition(QEvent::User, s2Child2)); + QAbstractTransition *at = new EventTransition(QEvent::User, s2Child2); + s2Child->addTransition(at); QPropertyAnimation *animation = new QPropertyAnimation(object, "bar", s2); animation->setDuration(2000); connect(animation, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(animation); - at = s1->addTransition(new EventTransition(QEvent::User, s2)); + at = new EventTransition(QEvent::User, s2); + s1->addTransition(at); animation = new QPropertyAnimation(object, "foo", s2); connect(animation, SIGNAL(finished()), &counter, SLOT(slot())); @@ -3299,7 +3309,8 @@ void tst_QStateMachine::animatedGlobalRestoreProperty() QState *s4 = new QState(&machine); QObject::connect(s4, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); + QAbstractTransition *at = new EventTransition(QEvent::User, s2); + s1->addTransition(at); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", s2); connect(pa, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(pa); @@ -3341,7 +3352,9 @@ void tst_QStateMachine::specificTargetValueOfAnimation() QPropertyAnimation *anim = new QPropertyAnimation(object, "foo"); anim->setEndValue(10.0); - s1->addTransition(new EventTransition(QEvent::User, s2))->addAnimation(anim); + EventTransition *trans = new EventTransition(QEvent::User, s2); + s1->addTransition(trans); + trans->addAnimation(anim); QState *s3 = new QState(&machine); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); @@ -3495,7 +3508,8 @@ void tst_QStateMachine::overrideDefaultAnimationWithSpecific() QState *s3 = new QState(&machine); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); + QAbstractTransition *at = new EventTransition(QEvent::User, s2); + s1->addTransition(at); QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); -- cgit v0.12 From 2596d721d64ad4d484176888cb166fbc43157ca9 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 13:39:40 +0100 Subject: Change name of modifiersMask property to "modifierMask" "modifierMask" is more correct English. Reviewed-by: Kent Hansen --- src/gui/statemachine/qbasickeyeventtransition.cpp | 24 +++++++++++----------- src/gui/statemachine/qbasickeyeventtransition_p.h | 6 +++--- .../statemachine/qbasicmouseeventtransition.cpp | 16 +++++++-------- .../statemachine/qbasicmouseeventtransition_p.h | 4 ++-- src/gui/statemachine/qkeyeventtransition.cpp | 18 ++++++++-------- src/gui/statemachine/qkeyeventtransition.h | 6 +++--- src/gui/statemachine/qmouseeventtransition.cpp | 18 ++++++++-------- src/gui/statemachine/qmouseeventtransition.h | 6 +++--- 8 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/gui/statemachine/qbasickeyeventtransition.cpp b/src/gui/statemachine/qbasickeyeventtransition.cpp index 445a253..bf10e3d 100644 --- a/src/gui/statemachine/qbasickeyeventtransition.cpp +++ b/src/gui/statemachine/qbasickeyeventtransition.cpp @@ -68,14 +68,14 @@ public: QEvent::Type eventType; int key; - Qt::KeyboardModifiers modifiersMask; + Qt::KeyboardModifiers modifierMask; }; QBasicKeyEventTransitionPrivate::QBasicKeyEventTransitionPrivate() { eventType = QEvent::None; key = 0; - modifiersMask = Qt::NoModifier; + modifierMask = Qt::NoModifier; } QBasicKeyEventTransitionPrivate *QBasicKeyEventTransitionPrivate::get(QBasicKeyEventTransition *q) @@ -106,17 +106,17 @@ QBasicKeyEventTransition::QBasicKeyEventTransition(QEvent::Type type, int key, /*! Constructs a new event transition for events of the given \a type for the - given \a key, with the given \a modifiersMask and \a sourceState. + given \a key, with the given \a modifierMask and \a sourceState. */ QBasicKeyEventTransition::QBasicKeyEventTransition(QEvent::Type type, int key, - Qt::KeyboardModifiers modifiersMask, + Qt::KeyboardModifiers modifierMask, QState *sourceState) : QAbstractTransition(*new QBasicKeyEventTransitionPrivate, sourceState) { Q_D(QBasicKeyEventTransition); d->eventType = type; d->key = key; - d->modifiersMask = modifiersMask; + d->modifierMask = modifierMask; } /*! @@ -163,23 +163,23 @@ void QBasicKeyEventTransition::setKey(int key) } /*! - Returns the keyboard modifiers mask that this key event transition checks + Returns the keyboard modifier mask that this key event transition checks for. */ -Qt::KeyboardModifiers QBasicKeyEventTransition::modifiersMask() const +Qt::KeyboardModifiers QBasicKeyEventTransition::modifierMask() const { Q_D(const QBasicKeyEventTransition); - return d->modifiersMask; + return d->modifierMask; } /*! - Sets the keyboard modifiers mask that this key event transition will check + Sets the keyboard modifier mask that this key event transition will check for. */ -void QBasicKeyEventTransition::setModifiersMask(Qt::KeyboardModifiers modifiersMask) +void QBasicKeyEventTransition::setModifierMask(Qt::KeyboardModifiers modifierMask) { Q_D(QBasicKeyEventTransition); - d->modifiersMask = modifiersMask; + d->modifierMask = modifierMask; } /*! @@ -191,7 +191,7 @@ bool QBasicKeyEventTransition::eventTest(QEvent *event) if (event->type() == d->eventType) { QKeyEvent *ke = static_cast(event); return (ke->key() == d->key) - && ((ke->modifiers() & d->modifiersMask) == d->modifiersMask); + && ((ke->modifiers() & d->modifierMask) == d->modifierMask); } return false; } diff --git a/src/gui/statemachine/qbasickeyeventtransition_p.h b/src/gui/statemachine/qbasickeyeventtransition_p.h index 3c2ec7d..87d3dc7 100644 --- a/src/gui/statemachine/qbasickeyeventtransition_p.h +++ b/src/gui/statemachine/qbasickeyeventtransition_p.h @@ -69,7 +69,7 @@ public: QBasicKeyEventTransition(QState *sourceState = 0); QBasicKeyEventTransition(QEvent::Type type, int key, QState *sourceState = 0); QBasicKeyEventTransition(QEvent::Type type, int key, - Qt::KeyboardModifiers modifiersMask, + Qt::KeyboardModifiers modifierMask, QState *sourceState = 0); ~QBasicKeyEventTransition(); @@ -79,8 +79,8 @@ public: int key() const; void setKey(int key); - Qt::KeyboardModifiers modifiersMask() const; - void setModifiersMask(Qt::KeyboardModifiers modifiers); + Qt::KeyboardModifiers modifierMask() const; + void setModifierMask(Qt::KeyboardModifiers modifiers); protected: bool eventTest(QEvent *event); diff --git a/src/gui/statemachine/qbasicmouseeventtransition.cpp b/src/gui/statemachine/qbasicmouseeventtransition.cpp index 694c319..4a977ba 100644 --- a/src/gui/statemachine/qbasicmouseeventtransition.cpp +++ b/src/gui/statemachine/qbasicmouseeventtransition.cpp @@ -69,7 +69,7 @@ public: QEvent::Type eventType; Qt::MouseButton button; - Qt::KeyboardModifiers modifiersMask; + Qt::KeyboardModifiers modifierMask; QPainterPath path; }; @@ -149,23 +149,23 @@ void QBasicMouseEventTransition::setButton(Qt::MouseButton button) } /*! - Returns the keyboard modifiers mask that this mouse event transition checks + Returns the keyboard modifier mask that this mouse event transition checks for. */ -Qt::KeyboardModifiers QBasicMouseEventTransition::modifiersMask() const +Qt::KeyboardModifiers QBasicMouseEventTransition::modifierMask() const { Q_D(const QBasicMouseEventTransition); - return d->modifiersMask; + return d->modifierMask; } /*! - Sets the keyboard modifiers mask that this mouse event transition will check + Sets the keyboard modifier mask that this mouse event transition will check for. */ -void QBasicMouseEventTransition::setModifiersMask(Qt::KeyboardModifiers modifiersMask) +void QBasicMouseEventTransition::setModifierMask(Qt::KeyboardModifiers modifierMask) { Q_D(QBasicMouseEventTransition); - d->modifiersMask = modifiersMask; + d->modifierMask = modifierMask; } /*! @@ -195,7 +195,7 @@ bool QBasicMouseEventTransition::eventTest(QEvent *event) if (event->type() == d->eventType) { QMouseEvent *me = static_cast(event); return (me->button() == d->button) - && ((me->modifiers() & d->modifiersMask) == d->modifiersMask) + && ((me->modifiers() & d->modifierMask) == d->modifierMask) && (d->path.isEmpty() || d->path.contains(me->pos())); } return false; diff --git a/src/gui/statemachine/qbasicmouseeventtransition_p.h b/src/gui/statemachine/qbasicmouseeventtransition_p.h index 512e0f8..8684fa3 100644 --- a/src/gui/statemachine/qbasicmouseeventtransition_p.h +++ b/src/gui/statemachine/qbasicmouseeventtransition_p.h @@ -79,8 +79,8 @@ public: Qt::MouseButton button() const; void setButton(Qt::MouseButton button); - Qt::KeyboardModifiers modifiersMask() const; - void setModifiersMask(Qt::KeyboardModifiers modifiers); + Qt::KeyboardModifiers modifierMask() const; + void setModifierMask(Qt::KeyboardModifiers modifiers); QPainterPath path() const; void setPath(const QPainterPath &path); diff --git a/src/gui/statemachine/qkeyeventtransition.cpp b/src/gui/statemachine/qkeyeventtransition.cpp index dee3168..a15e671 100644 --- a/src/gui/statemachine/qkeyeventtransition.cpp +++ b/src/gui/statemachine/qkeyeventtransition.cpp @@ -69,9 +69,9 @@ QT_BEGIN_NAMESPACE */ /*! - \property QKeyEventTransition::modifiersMask + \property QKeyEventTransition::modifierMask - \brief the keyboard modifiers mask that this key event transition checks for + \brief the keyboard modifier mask that this key event transition checks for */ class QKeyEventTransitionPrivate : public QEventTransitionPrivate @@ -133,23 +133,23 @@ void QKeyEventTransition::setKey(int key) } /*! - Returns the keyboard modifiers mask that this key event transition checks + Returns the keyboard modifier mask that this key event transition checks for. */ -Qt::KeyboardModifiers QKeyEventTransition::modifiersMask() const +Qt::KeyboardModifiers QKeyEventTransition::modifierMask() const { Q_D(const QKeyEventTransition); - return d->transition->modifiersMask(); + return d->transition->modifierMask(); } /*! - Sets the keyboard \a modifiers mask that this key event transition will - check for. + Sets the keyboard modifier mask that this key event transition will + check for to \a modifierMask. */ -void QKeyEventTransition::setModifiersMask(Qt::KeyboardModifiers modifiersMask) +void QKeyEventTransition::setModifierMask(Qt::KeyboardModifiers modifierMask) { Q_D(QKeyEventTransition); - d->transition->setModifiersMask(modifiersMask); + d->transition->setModifierMask(modifierMask); } /*! diff --git a/src/gui/statemachine/qkeyeventtransition.h b/src/gui/statemachine/qkeyeventtransition.h index 8df8138..ab1c155 100644 --- a/src/gui/statemachine/qkeyeventtransition.h +++ b/src/gui/statemachine/qkeyeventtransition.h @@ -57,7 +57,7 @@ class Q_GUI_EXPORT QKeyEventTransition : public QEventTransition { Q_OBJECT Q_PROPERTY(int key READ key WRITE setKey) - Q_PROPERTY(Qt::KeyboardModifiers modifiersMask READ modifiersMask WRITE setModifiersMask) + Q_PROPERTY(Qt::KeyboardModifiers modifierMask READ modifierMask WRITE setModifierMask) public: QKeyEventTransition(QState *sourceState = 0); QKeyEventTransition(QObject *object, QEvent::Type type, int key, @@ -67,8 +67,8 @@ public: int key() const; void setKey(int key); - Qt::KeyboardModifiers modifiersMask() const; - void setModifiersMask(Qt::KeyboardModifiers modifiers); + Qt::KeyboardModifiers modifierMask() const; + void setModifierMask(Qt::KeyboardModifiers modifiers); protected: void onTransition(QEvent *event); diff --git a/src/gui/statemachine/qmouseeventtransition.cpp b/src/gui/statemachine/qmouseeventtransition.cpp index 86cacf7..dbf9e19 100644 --- a/src/gui/statemachine/qmouseeventtransition.cpp +++ b/src/gui/statemachine/qmouseeventtransition.cpp @@ -70,9 +70,9 @@ QT_BEGIN_NAMESPACE */ /*! - \property QMouseEventTransition::modifiersMask + \property QMouseEventTransition::modifierMask - \brief the keyboard modifiers mask that this mouse event transition checks for + \brief the keyboard modifier mask that this mouse event transition checks for */ class QMouseEventTransitionPrivate : public QEventTransitionPrivate @@ -139,23 +139,23 @@ void QMouseEventTransition::setButton(Qt::MouseButton button) } /*! - Returns the keyboard modifiers mask that this mouse event transition checks + Returns the keyboard modifier mask that this mouse event transition checks for. */ -Qt::KeyboardModifiers QMouseEventTransition::modifiersMask() const +Qt::KeyboardModifiers QMouseEventTransition::modifierMask() const { Q_D(const QMouseEventTransition); - return d->transition->modifiersMask(); + return d->transition->modifierMask(); } /*! - Sets the keyboard \a modifiers mask that this mouse event transition will - check for. + Sets the keyboard modifier mask that this mouse event transition will + check for to \a modifierMask. */ -void QMouseEventTransition::setModifiersMask(Qt::KeyboardModifiers modifiersMask) +void QMouseEventTransition::setModifierMask(Qt::KeyboardModifiers modifierMask) { Q_D(QMouseEventTransition); - d->transition->setModifiersMask(modifiersMask); + d->transition->setModifierMask(modifierMask); } /*! diff --git a/src/gui/statemachine/qmouseeventtransition.h b/src/gui/statemachine/qmouseeventtransition.h index 4e324ec..a6687b6 100644 --- a/src/gui/statemachine/qmouseeventtransition.h +++ b/src/gui/statemachine/qmouseeventtransition.h @@ -58,7 +58,7 @@ class Q_GUI_EXPORT QMouseEventTransition : public QEventTransition { Q_OBJECT Q_PROPERTY(Qt::MouseButton button READ button WRITE setButton) - Q_PROPERTY(Qt::KeyboardModifiers modifiersMask READ modifiersMask WRITE setModifiersMask) + Q_PROPERTY(Qt::KeyboardModifiers modifierMask READ modifierMask WRITE setModifierMask) public: QMouseEventTransition(QState *sourceState = 0); QMouseEventTransition(QObject *object, QEvent::Type type, @@ -68,8 +68,8 @@ public: Qt::MouseButton button() const; void setButton(Qt::MouseButton button); - Qt::KeyboardModifiers modifiersMask() const; - void setModifiersMask(Qt::KeyboardModifiers modifiers); + Qt::KeyboardModifiers modifierMask() const; + void setModifierMask(Qt::KeyboardModifiers modifiers); QPainterPath path() const; void setPath(const QPainterPath &path); -- cgit v0.12 From 19421cc33af4f439f4c7aea2de9f449987fbc420 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 13:53:19 +0100 Subject: Change name of QMouseEventTransition::path() to hitTestPath(). Make it clearer what the property actually does. Reviewed-by: Kent Hansen --- src/gui/statemachine/qbasicmouseeventtransition.cpp | 8 ++++---- src/gui/statemachine/qbasicmouseeventtransition_p.h | 4 ++-- src/gui/statemachine/qmouseeventtransition.cpp | 12 ++++++------ src/gui/statemachine/qmouseeventtransition.h | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/statemachine/qbasicmouseeventtransition.cpp b/src/gui/statemachine/qbasicmouseeventtransition.cpp index 4a977ba..fe0dea9 100644 --- a/src/gui/statemachine/qbasicmouseeventtransition.cpp +++ b/src/gui/statemachine/qbasicmouseeventtransition.cpp @@ -169,18 +169,18 @@ void QBasicMouseEventTransition::setModifierMask(Qt::KeyboardModifiers modifierM } /*! - Returns the path for this mouse event transition. + Returns the hit test path for this mouse event transition. */ -QPainterPath QBasicMouseEventTransition::path() const +QPainterPath QBasicMouseEventTransition::hitTestPath() const { Q_D(const QBasicMouseEventTransition); return d->path; } /*! - Sets the path for this mouse event transition. + Sets the hit test path for this mouse event transition. */ -void QBasicMouseEventTransition::setPath(const QPainterPath &path) +void QBasicMouseEventTransition::setHitTestPath(const QPainterPath &path) { Q_D(QBasicMouseEventTransition); d->path = path; diff --git a/src/gui/statemachine/qbasicmouseeventtransition_p.h b/src/gui/statemachine/qbasicmouseeventtransition_p.h index 8684fa3..6754c55 100644 --- a/src/gui/statemachine/qbasicmouseeventtransition_p.h +++ b/src/gui/statemachine/qbasicmouseeventtransition_p.h @@ -82,8 +82,8 @@ public: Qt::KeyboardModifiers modifierMask() const; void setModifierMask(Qt::KeyboardModifiers modifiers); - QPainterPath path() const; - void setPath(const QPainterPath &path); + QPainterPath hitTestPath() const; + void setHitTestPath(const QPainterPath &path); protected: bool eventTest(QEvent *event); diff --git a/src/gui/statemachine/qmouseeventtransition.cpp b/src/gui/statemachine/qmouseeventtransition.cpp index dbf9e19..f5c0cb1 100644 --- a/src/gui/statemachine/qmouseeventtransition.cpp +++ b/src/gui/statemachine/qmouseeventtransition.cpp @@ -159,25 +159,25 @@ void QMouseEventTransition::setModifierMask(Qt::KeyboardModifiers modifierMask) } /*! - Returns the path for this mouse event transition. + Returns the hit test path for this mouse event transition. */ -QPainterPath QMouseEventTransition::path() const +QPainterPath QMouseEventTransition::hitTestPath() const { Q_D(const QMouseEventTransition); - return d->transition->path(); + return d->transition->hitTestPath(); } /*! - Sets the \a path for this mouse event transition. + Sets the hit test path for this mouse event transition to \a path. If a valid path has been set, the transition will only trigger if the mouse event position (QMouseEvent::pos()) is inside the path. \sa QPainterPath::contains() */ -void QMouseEventTransition::setPath(const QPainterPath &path) +void QMouseEventTransition::setHitTestPath(const QPainterPath &path) { Q_D(QMouseEventTransition); - d->transition->setPath(path); + d->transition->setHitTestPath(path); } /*! diff --git a/src/gui/statemachine/qmouseeventtransition.h b/src/gui/statemachine/qmouseeventtransition.h index a6687b6..e7f6a45 100644 --- a/src/gui/statemachine/qmouseeventtransition.h +++ b/src/gui/statemachine/qmouseeventtransition.h @@ -71,8 +71,8 @@ public: Qt::KeyboardModifiers modifierMask() const; void setModifierMask(Qt::KeyboardModifiers modifiers); - QPainterPath path() const; - void setPath(const QPainterPath &path); + QPainterPath hitTestPath() const; + void setHitTestPath(const QPainterPath &path); protected: void onTransition(QEvent *event); -- cgit v0.12 From ddd1c40712a6a50b0574341087118fe4db67c3b2 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 3 Nov 2009 14:19:41 +0100 Subject: Rename QState::polished() signal to "propertiesAssigned" "Polished" was never a very descriptive word, and it already has a meaning attached in the QStyle API. Additionally, "propertiesAssigned" has the benefit of giving the relation to the assignProperty() function as part of the name. Reviewed-by: Kent Hansen --- doc/src/examples/stickman.qdoc | 9 +++--- doc/src/frameworks-technologies/statemachine.qdoc | 10 +++---- doc/src/snippets/statemachine/main5.cpp | 2 +- examples/animation/stickman/lifecycle.cpp | 4 +-- src/corelib/statemachine/qstate.cpp | 16 +++++++---- src/corelib/statemachine/qstate.h | 2 +- src/corelib/statemachine/qstate_p.h | 2 +- src/corelib/statemachine/qstatemachine.cpp | 8 +++--- tests/auto/qstatemachine/tst_qstatemachine.cpp | 34 +++++++++++------------ 9 files changed, 47 insertions(+), 40 deletions(-) diff --git a/doc/src/examples/stickman.qdoc b/doc/src/examples/stickman.qdoc index e70c39b..c9e98d0 100644 --- a/doc/src/examples/stickman.qdoc +++ b/doc/src/examples/stickman.qdoc @@ -55,9 +55,9 @@ Animations are implemented as composite states. Each child state of the animation state represents a frame in the animation by setting the position of each joint in the stickman's skeleton to the positions defined for the particular frame. The frames are then bound together - with animated transitions that trigger on the source state's polished() signal. Thus, the - machine will enter the state representing the next frame in the animation immediately after it - has finished animating into the previous frame. + with animated transitions that trigger on the source state's propertiesAssigned() signal. Thus, + the machine will enter the state representing the next frame in the animation immediately after + it has finished animating into the previous frame. \image stickman-example1.png @@ -67,7 +67,8 @@ \snippet examples/animation/stickman/lifecycle.cpp 1 - The states are then bound together with signal transitions that listen to the polished() signal. + The states are then bound together with signal transitions that listen to the + propertiesAssigned() signal. \snippet examples/animation/stickman/lifecycle.cpp 2 diff --git a/doc/src/frameworks-technologies/statemachine.qdoc b/doc/src/frameworks-technologies/statemachine.qdoc index ac10314..708561d 100644 --- a/doc/src/frameworks-technologies/statemachine.qdoc +++ b/doc/src/frameworks-technologies/statemachine.qdoc @@ -501,9 +501,9 @@ message box will pop up before the geometry of the button has actually been set. To ensure that the message box does not pop up until the geometry actually reaches its final - value, we can use the state's polished() signal. The polished() signal will be emitted when the - the property is assigned its final value, whether this is done immediately or after the animation - has finished playing. + value, we can use the state's propertiesAssigned() signal. The propertiesAssigned() signal will be + emitted when the property is assigned its final value, whether this is done immediately or + after the animation has finished playing. \code \snippet doc/src/snippets/statemachine/main5.cpp 6 \endcode @@ -519,14 +519,14 @@ has been assigned the defined value. If the global restore policy is set to QStateMachine::RestoreProperties, the state will not emit - the polished() signal until these have been executed as well. + the propertiesAssigned() signal until these have been executed as well. \section1 What Happens If A State Is Exited Before The Animation Has Finished If a state has property assignments, and the transition into the state has animations for the properties, the state can potentially be exited before the properties have been assigned to the values defines by the state. This is true in particular when there are transitions out from the - state that do not depend on the state being polished, as described in the previous section. + state that do not depend on the propertiesAssigned signal, as described in the previous section. The State Machine API guarantees that a property assigned by the state machine either: \list diff --git a/doc/src/snippets/statemachine/main5.cpp b/doc/src/snippets/statemachine/main5.cpp index 346cbce..ff25b7b 100644 --- a/doc/src/snippets/statemachine/main5.cpp +++ b/doc/src/snippets/statemachine/main5.cpp @@ -145,7 +145,7 @@ int main(int argv, char **args) connect(s3, SIGNAL(entered()), messageBox, SLOT(exec())); s1->addTransition(button, SIGNAL(clicked()), s2); - s2->addTransition(s2, SIGNAL(polished()), s3); + s2->addTransition(s2, SIGNAL(propertiesAssigned()), s3); //![6] } diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp index 250fb85..1b6f9cd 100644 --- a/examples/animation/stickman/lifecycle.cpp +++ b/examples/animation/stickman/lifecycle.cpp @@ -194,14 +194,14 @@ QState *LifeCycle::makeState(QState *parentState, const QString &animationFileNa topLevel->setInitialState(frameState); else //! [2] - previousState->addTransition(previousState, SIGNAL(polished()), frameState); + previousState->addTransition(previousState, SIGNAL(propertiesAssigned()), frameState); //! [2] previousState = frameState; } // Loop - previousState->addTransition(previousState, SIGNAL(polished()), topLevel->initialState()); + previousState->addTransition(previousState, SIGNAL(propertiesAssigned()), topLevel->initialState()); return topLevel; diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index ea20619..6d89248 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -139,10 +139,10 @@ void QStatePrivate::emitFinished() emit q->finished(); } -void QStatePrivate::emitPolished() +void QStatePrivate::emitPropertiesAssigned() { Q_Q(QState); - emit q->polished(); + emit q->propertiesAssigned(); } /*! @@ -228,7 +228,7 @@ QList QStatePrivate::transitions() const Instructs this state to set the property with the given \a name of the given \a object to the given \a value when the state is entered. - \sa polished() + \sa propertiesAssigned() */ void QState::assignProperty(QObject *object, const char *name, const QVariant &value) @@ -491,9 +491,15 @@ bool QState::event(QEvent *e) */ /*! - \fn QState::polished() + \fn QState::propertiesAssigned() - This signal is emitted when all properties have been assigned their final value. + This signal is emitted when all properties have been assigned their final value. If the state + assigns a value to one or more properties for which an animation exists (either set on the + transition or as a default animation on the state machine), then the signal will not be emitted + until all such animations have finished playing. + + If there are no relevant animations, or no property assignments defined for the state, then + the signal will be emitted immediately before the state is entered. \sa QState::assignProperty(), QAbstractTransition::addAnimation() */ diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h index 781382d..423f940 100644 --- a/src/corelib/statemachine/qstate.h +++ b/src/corelib/statemachine/qstate.h @@ -94,7 +94,7 @@ public: Q_SIGNALS: void finished(); - void polished(); + void propertiesAssigned(); protected: void onEntry(QEvent *event); diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h index 34c8838..7fe6279 100644 --- a/src/corelib/statemachine/qstate_p.h +++ b/src/corelib/statemachine/qstate_p.h @@ -94,7 +94,7 @@ public: QList transitions() const; void emitFinished(); - void emitPolished(); + void emitPropertiesAssigned(); QAbstractState *errorState; QAbstractState *initialState; diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 0d07093..0648d14 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -807,7 +807,7 @@ void QStateMachinePrivate::applyProperties(const QList &tr if (anim->state() == QAbstractAnimation::Running) { // The animation is still running. This can happen if the // animation is a group, and one of its children just finished, - // and that caused a state to emit its polished() signal, and + // and that caused a state to emit its propertiesAssigned() signal, and // that triggered a transition in the machine. // Just stop the animation so it is correctly restarted again. anim->stop(); @@ -829,7 +829,7 @@ void QStateMachinePrivate::applyProperties(const QList &tr } } - // Emit polished signal for entered states that have no animated properties. + // Emit propertiesAssigned signal for entered states that have no animated properties. for (int i = 0; i < enteredStates.size(); ++i) { QState *s = qobject_cast(enteredStates.at(i)); if (s @@ -837,7 +837,7 @@ void QStateMachinePrivate::applyProperties(const QList &tr && !animationsForState.contains(s) #endif ) - QStatePrivate::get(s)->emitPolished(); + QStatePrivate::get(s)->emitPropertiesAssigned(); } } @@ -1100,7 +1100,7 @@ void QStateMachinePrivate::_q_animationFinished() animations.removeOne(anim); if (animations.isEmpty()) { animationsForState.erase(it); - QStatePrivate::get(qobject_cast(state))->emitPolished(); + QStatePrivate::get(qobject_cast(state))->emitPropertiesAssigned(); } } diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index fb6567a..9a2b2ed 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -184,7 +184,7 @@ private slots: void twoAnimatedTransitions(); void playAnimationTwice(); void nestedTargetStateForAnimation(); - void polishedSignalTransitionsReuseAnimationGroup(); + void propertiesAssignedSignalTransitionsReuseAnimationGroup(); void animatedGlobalRestoreProperty(); void specificTargetValueOfAnimation(); @@ -1319,9 +1319,9 @@ void tst_QStateMachine::assignProperty() QCOMPARE(s1->objectName(), QString::fromLatin1("foo")); { - QSignalSpy polishedSpy(s1, SIGNAL(polished())); + QSignalSpy propertiesAssignedSpy(s1, SIGNAL(propertiesAssigned())); machine.start(); - QTRY_COMPARE(polishedSpy.count(), 1); + QTRY_COMPARE(propertiesAssignedSpy.count(), 1); } // nested states @@ -1371,7 +1371,7 @@ void tst_QStateMachine::assignPropertyWithAnimation() QCOMPARE(trans->animations().size(), 1); QCOMPARE(trans->animations().at(0), (QAbstractAnimation*)&anim); QFinalState *s3 = new QFinalState(&machine); - s2->addTransition(s2, SIGNAL(polished()), s3); + s2->addTransition(s2, SIGNAL(propertiesAssigned()), s3); machine.setInitialState(s1); QSignalSpy finishedSpy(&machine, SIGNAL(finished())); @@ -1399,7 +1399,7 @@ void tst_QStateMachine::assignPropertyWithAnimation() anim2.setDuration(150); trans->addAnimation(&anim2); QFinalState *s3 = new QFinalState(&machine); - s2->addTransition(s2, SIGNAL(polished()), s3); + s2->addTransition(s2, SIGNAL(propertiesAssigned()), s3); machine.setInitialState(s1); QSignalSpy finishedSpy(&machine, SIGNAL(finished())); @@ -1427,7 +1427,7 @@ void tst_QStateMachine::assignPropertyWithAnimation() group.addAnimation(new QPropertyAnimation(&obj, "bar")); trans->addAnimation(&group); QFinalState *s3 = new QFinalState(&machine); - s2->addTransition(s2, SIGNAL(polished()), s3); + s2->addTransition(s2, SIGNAL(propertiesAssigned()), s3); machine.setInitialState(s1); QSignalSpy finishedSpy(&machine, SIGNAL(finished())); @@ -1473,10 +1473,10 @@ void tst_QStateMachine::assignPropertyWithAnimation() anim2.setDuration(250); trans->addAnimation(&anim2); - s21->addTransition(s21, SIGNAL(polished()), s22); + s21->addTransition(s21, SIGNAL(propertiesAssigned()), s22); QFinalState *s3 = new QFinalState(&machine); - s22->addTransition(s2, SIGNAL(polished()), s3); + s22->addTransition(s2, SIGNAL(propertiesAssigned()), s3); machine.setInitialState(s1); QSignalSpy finishedSpy(&machine, SIGNAL(finished())); @@ -1513,13 +1513,13 @@ void tst_QStateMachine::assignPropertyWithAnimation() machine.setInitialState(group); machine.start(); QTRY_COMPARE(machine.configuration().contains(s1), true); - QSignalSpy polishedSpy(s2, SIGNAL(polished())); + QSignalSpy propertiesAssignedSpy(s2, SIGNAL(propertiesAssigned())); emitter.emitSignalWithNoArg(); QTRY_COMPARE(machine.configuration().contains(s2), true); - QVERIFY(polishedSpy.isEmpty()); + QVERIFY(propertiesAssignedSpy.isEmpty()); emitter.emitSignalWithNoArg(); // will cause animations from s1-->s2 to abort QTRY_COMPARE(machine.configuration().contains(s3), true); - QVERIFY(polishedSpy.isEmpty()); + QVERIFY(propertiesAssignedSpy.isEmpty()); QCOMPARE(obj.property("foo").toInt(), 911); QCOMPARE(obj.property("bar").toInt(), 789); } @@ -3089,7 +3089,7 @@ void tst_QStateMachine::twoAnimations() QState *s3 = new QState(&machine); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - s2->addTransition(s2, SIGNAL(polished()), s3); + s2->addTransition(s2, SIGNAL(propertiesAssigned()), s3); machine.setInitialState(s1); machine.start(); @@ -3241,7 +3241,7 @@ void tst_QStateMachine::nestedTargetStateForAnimation() at->addAnimation(animation); QState *s3 = new QState(&machine); - s2->addTransition(s2Child, SIGNAL(polished()), s3); + s2->addTransition(s2Child, SIGNAL(propertiesAssigned()), s3); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); @@ -3258,7 +3258,7 @@ void tst_QStateMachine::nestedTargetStateForAnimation() QCOMPARE(counter.counter, 2); } -void tst_QStateMachine::polishedSignalTransitionsReuseAnimationGroup() +void tst_QStateMachine::propertiesAssignedSignalTransitionsReuseAnimationGroup() { QStateMachine machine; QObject *object = new QObject(&machine); @@ -3275,9 +3275,9 @@ void tst_QStateMachine::polishedSignalTransitionsReuseAnimationGroup() QParallelAnimationGroup animationGroup; animationGroup.addAnimation(new QPropertyAnimation(object, "foo")); QSignalSpy animationFinishedSpy(&animationGroup, SIGNAL(finished())); - s1->addTransition(s1, SIGNAL(polished()), s2)->addAnimation(&animationGroup); - s2->addTransition(s2, SIGNAL(polished()), s3)->addAnimation(&animationGroup); - s3->addTransition(s3, SIGNAL(polished()), s4); + s1->addTransition(s1, SIGNAL(propertiesAssigned()), s2)->addAnimation(&animationGroup); + s2->addTransition(s2, SIGNAL(propertiesAssigned()), s3)->addAnimation(&animationGroup); + s3->addTransition(s3, SIGNAL(propertiesAssigned()), s4); machine.setInitialState(s1); QSignalSpy machineFinishedSpy(&machine, SIGNAL(finished())); -- cgit v0.12 From 66056ead409d4ba79b2b7dd08d12332ba47f5307 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 2 Nov 2009 17:42:17 +0100 Subject: Make the QDataStream autotest much more robust In the old version, we'd read all the types, then start comparing. If an operator left the stream in a bogus state, funny things would happen (e.g. crashes). Now, we test the value instantly before reading the next one, thus preventing reading bogus. --- tests/auto/qdatastream/tst_qdatastream.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp index add0945..bb59809 100644 --- a/tests/auto/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/qdatastream/tst_qdatastream.cpp @@ -3180,28 +3180,31 @@ void tst_QDataStream::streamRealDataTypes() QDataStream stream(&file); stream.setVersion(QDataStream::Qt_4_2); - stream >> a >> b >> c >> d >> e >> f >> point - >> rect >> polygon >> matrix >> p; - if (i == 1) - stream >> pict; - stream >> textLength >> col >> rGrad >> cGrad - >> pen; - - QCOMPARE(stream.status(), QDataStream::Ok); - + stream >> a; QCOMPARE(a, qreal(0)); + stream >> b; QCOMPARE(b, qreal(1.0)); + stream >> c; QCOMPARE(c, qreal(1.1)); + stream >> d; QCOMPARE(d, qreal(3.14)); + stream >> e; QCOMPARE(e, qreal(-3.14)); + stream >> f; QCOMPARE(f, qreal(-1)); + stream >> point; QCOMPARE(point, QPointF(3, 5)); + stream >> rect; QCOMPARE(rect, QRectF(-1, -2, 3, 4)); + stream >> polygon; QCOMPARE((QVector &)polygon, (QPolygonF() << QPointF(0, 0) << QPointF(1, 2))); + stream >> matrix; QCOMPARE(matrix, QMatrix().rotate(90).scale(2, 2)); + stream >> p; QCOMPARE(p, path); + if (i == 1) { + stream >> pict; - if (i == 0) { QByteArray pictA, pictB; QBuffer bufA, bufB; QVERIFY(bufA.open(QIODevice::ReadWrite)); @@ -3212,8 +3215,11 @@ void tst_QDataStream::streamRealDataTypes() QCOMPARE(pictA, pictB); } + stream >> textLength; QCOMPARE(textLength, QTextLength(QTextLength::VariableLength, 1.5)); + stream >> col; QCOMPARE(col, color); + stream >> rGrad; QCOMPARE(rGrad.style(), radialBrush.style()); QCOMPARE(rGrad.matrix(), radialBrush.matrix()); QCOMPARE(rGrad.gradient()->type(), radialBrush.gradient()->type()); @@ -3222,6 +3228,7 @@ void tst_QDataStream::streamRealDataTypes() QCOMPARE(((QRadialGradient *)rGrad.gradient())->center(), ((QRadialGradient *)radialBrush.gradient())->center()); QCOMPARE(((QRadialGradient *)rGrad.gradient())->focalPoint(), ((QRadialGradient *)radialBrush.gradient())->focalPoint()); QCOMPARE(((QRadialGradient *)rGrad.gradient())->radius(), ((QRadialGradient *)radialBrush.gradient())->radius()); + stream >> cGrad; QCOMPARE(cGrad.style(), conicalBrush.style()); QCOMPARE(cGrad.matrix(), conicalBrush.matrix()); QCOMPARE(cGrad.gradient()->type(), conicalBrush.gradient()->type()); @@ -3231,7 +3238,10 @@ void tst_QDataStream::streamRealDataTypes() QCOMPARE(((QConicalGradient *)cGrad.gradient())->angle(), ((QConicalGradient *)conicalBrush.gradient())->angle()); QCOMPARE(cGrad, conicalBrush); + stream >> pen; QCOMPARE(pen.widthF(), qreal(1.5)); + + QCOMPARE(stream.status(), QDataStream::Ok); } #if defined(Q_OS_SYMBIAN) #undef qreal -- cgit v0.12 From 18b072835e3f726a1d2d7604b0dc98cd420d3088 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 2 Nov 2009 17:57:54 +0100 Subject: fix test for real - if the reference stream contains doubles, we must read doubles, and not qreals --- tests/auto/qdatastream/tst_qdatastream.cpp | 63 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp index bb59809..56fc53a 100644 --- a/tests/auto/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/qdatastream/tst_qdatastream.cpp @@ -3100,22 +3100,6 @@ void tst_QDataStream::streamToAndFromQByteArray() void tst_QDataStream::streamRealDataTypes() { -#if defined(Q_OS_WINCE) - // Note: Probably actually same 'qreal being typedeffed as float instead of double' issue as in Symbian - // instead of what CE skip message says. - QSKIP("Skipped on CE as it demands too much memory and fragments", SkipAll); -#elif defined(Q_OS_SYMBIAN) - // qreal is typedeffed float in symbian instead of double like in most platforms, so reference stream - // gets corrupted. Basically this test is flawed, as one shouldn't use naked typedeffed types in - // streams that are meant to work cross-platform. - // As this test also tests other floating point using classes, we do not simply skip it, but work around - // the qreal issue by redefining qreal as double for the duration of this function. - // Note that streaming classes works because they do explicitly use double instead of qreal when - // writing/reading to/from stream. -# define qreal double - qWarning("Note: streamRealDataTypes test redefines qreal as double in symbian!!!"); -#endif - // Generate QPicture from SVG. QSvgRenderer renderer(svgFile); QVERIFY(renderer.isValid()); @@ -3163,7 +3147,6 @@ void tst_QDataStream::streamRealDataTypes() file.close(); } - qreal a, b, c, d, e, f; QPointF point; QRectF rect; QPolygonF polygon; @@ -3180,18 +3163,37 @@ void tst_QDataStream::streamRealDataTypes() QDataStream stream(&file); stream.setVersion(QDataStream::Qt_4_2); - stream >> a; - QCOMPARE(a, qreal(0)); - stream >> b; - QCOMPARE(b, qreal(1.0)); - stream >> c; - QCOMPARE(c, qreal(1.1)); - stream >> d; - QCOMPARE(d, qreal(3.14)); - stream >> e; - QCOMPARE(e, qreal(-3.14)); - stream >> f; - QCOMPARE(f, qreal(-1)); + if (i == 0) { + // the reference stream for 4.2 contains doubles, + // so we must read them out as doubles! + double a, b, c, d, e, f; + stream >> a; + QCOMPARE(a, 0.0); + stream >> b; + QCOMPARE(b, 1.0); + stream >> c; + QCOMPARE(c, 1.1); + stream >> d; + QCOMPARE(d, 3.14); + stream >> e; + QCOMPARE(e, -3.14); + stream >> f; + QCOMPARE(f, -1.0); + } else { + qreal a, b, c, d, e, f; + stream >> a; + QCOMPARE(a, qreal(0)); + stream >> b; + QCOMPARE(b, qreal(1.0)); + stream >> c; + QCOMPARE(c, qreal(1.1)); + stream >> d; + QCOMPARE(d, qreal(3.14)); + stream >> e; + QCOMPARE(e, qreal(-3.14)); + stream >> f; + QCOMPARE(f, qreal(-1)); + } stream >> point; QCOMPARE(point, QPointF(3, 5)); stream >> rect; @@ -3243,9 +3245,6 @@ void tst_QDataStream::streamRealDataTypes() QCOMPARE(stream.status(), QDataStream::Ok); } -#if defined(Q_OS_SYMBIAN) - #undef qreal -#endif } #ifdef QT3_SUPPORT -- cgit v0.12 From 4c1ac09381a259e96a1774a5c931c55e8393813f Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 3 Nov 2009 17:02:58 +0100 Subject: Update mkdist-webkit script: - Use newest qtwebkit tag - Keep BitmapInfo.h and BitmalInfo.cpp in src/3rdparty Reviewed-by: TrustMe --- util/webkit/mkdist-webkit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit index f88f10e..ddf74bb 100755 --- a/util/webkit/mkdist-webkit +++ b/util/webkit/mkdist-webkit @@ -5,7 +5,7 @@ die() { exit 1 } -default_tag="qtwebkit-4.6-snapshot-22102009" +default_tag="qtwebkit-4.6-snapshot-20091003" if [ $# -eq 0 ]; then tag="$default_tag" @@ -155,7 +155,7 @@ excluded_directories="$excluded_directories WebKit/chromium" excluded_directories="$excluded_directories WebKit/English.lproj WebKit/WebKit.xcodeproj" excluded_directories="$excluded_directories WebCore/English.lproj" -exclude_with_exceptions_list="WebCore/platform/win/:WebCore/platform/win/SystemTimeWin.cpp" +exclude_with_exceptions_list="WebCore/platform/win/:WebCore/platform/win/SystemTimeWin.cpp\\|WebCore/platform/win/BitmapInfo.*" excluded_directories="$excluded_directories WebKit/mac/Carbon" excluded_directories="$excluded_directories WebKit/mac/ChangeLog" -- cgit v0.12 From 33eefe549f4570a79d2531bad82698f7109ab687 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 3 Nov 2009 17:12:30 +0100 Subject: Updated WebKit from /home/jturcott/dev/webkit/ to qtwebkit-4.6-snapshot-20091003 ( 8f810287200d21aded375664cc0a6ac0476dbdea ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-10-29 Kenneth Rohde Christiansen Reviewed by Tor Arne Vestbø. Remove QWebView::guessUrlFromString() and replace its use with the new QUrl::fromUserInput() if using Qt 4.6 or newer. * Api/qwebview.cpp: * Api/qwebview.h: * QGVLauncher/main.cpp: (urlFromUserInput): (WebPage::applyProxy): (MainWindow::load): * QtLauncher/main.cpp: (urlFromUserInput): (MainWindow::MainWindow): (MainWindow::changeLocation): * tests/qwebview/tst_qwebview.cpp: 2009-10-28 Kenneth Rohde Christiansen Reviewed by Tor Arne Vestbø. Serialize directly to the stream, and not first to an QByteArray, that is later serialized. That is slower and also uses more bytes. * Api/qwebhistory.cpp: (operator<<): (operator>>): 2009-10-28 Shinichiro Hamaji Reviewed by Eric Seidel. [Qt] WebFrame::counterValueForElementById must not be exposed https://bugs.webkit.org/show_bug.cgi?id=30882 * Api/qwebframe.cpp: (qt_drt_counterValueForElementById): * Api/qwebframe.h: 2009-10-27 Shinichiro Hamaji Reviewed by Darin Adler. Provide a way to get counter values with layoutTestContoller https://bugs.webkit.org/show_bug.cgi?id=30555 * Api/qwebframe.cpp: (QWebFrame::counterValueForElementById): (QWebHitTestResult::frame): * Api/qwebframe.h: 2009-10-28 Antonio Gomes Pushing missing WebKit/qt/tests/qwebframe/resources/ dir from bug 29248. [Qt] [API] Make it possible to have 'invisible' loads https://bugs.webkit.org/show_bug.cgi?id=29248 * tests/qwebframe/resources/image2.png: Copied from WebKit/qt/tests/qwebelement/image.png. 2009-10-28 Kenneth Rohde Christiansen Reviewed by Tor Arne Vestbø. [Qt] QWebHistory::saveState() is inconsistent with the Qt API https://bugs.webkit.org/show_bug.cgi?id=30710 Make the versioning internal and enforce it in the WebCore part. Adjust the comments, as well as remove now dead code. * Api/qwebhistory.cpp: (operator<<): (operator>>): * Api/qwebhistory.h: 2009-10-28 Kenneth Rohde Christiansen Reviewed by Holger Freyther. [Qt] QWebHistory::saveState() is inconsistent with the Qt API https://bugs.webkit.org/show_bug.cgi?id=30710 Remove the QWebHistory::saveState() and ::restoreState() as they are inconsistent with the Qt API. Update unittests to reflect the change. * Api/qwebhistory.cpp: (operator<<): (operator>>): * Api/qwebhistory.h: * tests/qwebhistory/tst_qwebhistory.cpp: (saveHistory): (restoreHistory): (tst_QWebHistory::saveAndRestore_crash_1): (tst_QWebHistory::saveAndRestore_crash_2): (tst_QWebHistory::saveAndRestore_crash_3): (tst_QWebHistory::clear): 2009-10-27 Antonio Gomes Reviewed by Holger Freyther. Complementary fix to bug 30779. By mistake I used QWeakPointer's toStrongRef() method which docs explicitly say to not be used in this situation (when the tracked pointer is devired from QObject). Instead QWeakPointer's data() is recommended. * Api/qwebpage.cpp: (QWebPage::view): 2009-10-27 Holger Hans Peter Freyther Reviewed by Simon Fraser. Change HitTestResult methods to use (3d) transformation aware methods https://bugs.webkit.org/show_bug.cgi?id=27347 The HitTestResult::boundingBox method was removed. The RenderObject must be used directly. In contrast to the old HitTestResult::boundingBox method this code must use a (3d) transformation aware method to not run into an assert in SVGRenderBase::mapLocalToContainer. * Api/qwebframe.cpp: (QWebHitTestResultPrivate::QWebHitTestResultPrivate): 2009-10-27 Kenneth Rohde Christiansen Rubberstamped by Oliver Hunt. Change two methods to be internal for DRT use only. Part of [Qt] Review all new API in Qt 4.6 https://bugs.webkit.org/show_bug.cgi?id=29843#c11 * Api/qwebsecurityorigin.cpp: (qt_drt_whiteListAccessFromOrigin): (qt_drt_resetOriginAccessWhiteLists): (QWebSecurityOrigin::localSchemes): * Api/qwebsecurityorigin.h: 2009-10-27 Kenneth Rohde Christiansen Reviewed by Tor Arne Vestbø. Make sure that initiating a rotation while rotating won't make it end up at rotation positions that are not a multiply of 180 degrees. * QGVLauncher/main.cpp: (MainView::animatedFlip): 2009-10-27 Kenneth Rohde Christiansen Unreviewed Qt build fix. Update the tests as well to the new API change. * tests/qwebelement/tst_qwebelement.cpp: (tst_QWebElement::clear): 2009-10-27 Kenneth Rohde Christiansen Rubberstamped by Tor Arne Vestbø. [Qt] QWebElement::removeChildren() should be QWebElement::removeAllChildren() https://bugs.webkit.org/show_bug.cgi?id=30630 * Api/qwebelement.cpp: (QWebElement::removeAllChildren): * Api/qwebelement.h: 2009-10-27 Antonio Gomes Reviewed by Antti Koivisto and Holger Freyther. Make QWebPagePrivate's (QWidget) view to be a QWeakPointer. https://bugs.webkit.org/show_bug.cgi?id=30779 The fact that it was been set from external objects of qwebpage and not being deleted internally can lead to dangling references. * Api/qgraphicswebview.cpp: (QGraphicsWebView::~QGraphicsWebView): * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): (QWebPagePrivate::createContextMenu): (QWebPagePrivate::handleSoftwareInputPanel): (QWebPagePrivate::keyPressEvent): (QWebPage::setView): (QWebPage::view): (QWebPage::javaScriptAlert): (QWebPage::javaScriptConfirm): (QWebPage::javaScriptPrompt): (QWebPage::shouldInterruptJavaScript): (QWebPage::createWindow): (QWebPage::extension): (QWebPage::chooseFile): (QWebPage::userAgentForUrl): * Api/qwebpage_p.h: * Api/qwebview.cpp: (QWebView::~QWebView): 2009-10-26 Kenneth Rohde Christiansen Unreviewed documentation fix from David Boddie (Qt Doc Team) Removes the check around the RenderHints property documentation that was clearly added to synchronize the source and header files when the #if !defined(Q_OS_SYMBIAN) guards was added to the property. The documentation has also been updated to ensure that Symbian users know that there is no actual RenderHints property on their platform. * Api/qwebview.cpp: 2009-10-26 Kenneth Rohde Christiansen Unreviewed documentation fix from David Boddie (Qt Doc Team) Ensure that qdoc will always see the RenderHints property. The property was only defined in the header file if the Q_OS_SYMBIAN symbol was not defined, resulting in the property not showing up in the Qt documentation just because one platform doesn't support it. A follow up commit will improve the documentation for the property and note that it is not supported on the Symbiam platform. * Api/qwebview.h: 2009-10-26 Benjamin Poulain Reviewed by Tor Arne Vestbø. [Qt] Reintroduce QWebElementCollection Revert the patch that has replaced QWebElementCollection with QList. Update the tests accordingly. Remove the constness of the return type of QWebElement operator[]. https://bugs.webkit.org/show_bug.cgi?id=30767 * Api/qwebelement.cpp: (QWebElement::findAll): (QWebElementCollectionPrivate::QWebElementCollectionPrivate): (QWebElementCollectionPrivate::create): (QWebElementCollection::QWebElementCollection): (QWebElementCollection::operator=): (QWebElementCollection::~QWebElementCollection): (QWebElementCollection::operator+): (QWebElementCollection::append): (QWebElementCollection::count): (QWebElementCollection::at): (QWebElementCollection::toList): * Api/qwebelement.h: (const_iterator::begin): (const_iterator::end): (const_iterator::operator[]): * Api/qwebframe.cpp: (QWebFrame::findAllElements): * Api/qwebframe.h: * QtLauncher/main.cpp: (MainWindow::selectElements): * tests/qwebelement/tst_qwebelement.cpp: (tst_QWebElement::simpleCollection): (tst_QWebElement::iteration): (tst_QWebElement::emptyCollection): (tst_QWebElement::appendCollection): (tst_QWebElement::nullSelect): (tst_QWebElement::hasSetFocus): (tst_QWebElement::render): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods): 2009-10-24 Laszlo Gombos Reviewed by Holger Freyther. [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian https://bugs.webkit.org/show_bug.cgi?id=30476 Assign ReadUserData WriteUserData NetworkServices Symbian capabilities to all QtWebkit executables. * QGVLauncher/QGVLauncher.pro: * QtLauncher/QtLauncher.pro: * tests/benchmarks/loading/tst_loading.pro: * tests/benchmarks/painting/tst_painting.pro: * tests/qgraphicswebview/qgraphicswebview.pro: * tests/qwebelement/qwebelement.pro: * tests/qwebframe/qwebframe.pro: * tests/qwebhistory/qwebhistory.pro: * tests/qwebhistoryinterface/qwebhistoryinterface.pro: * tests/qwebpage/qwebpage.pro: * tests/qwebplugindatabase/qwebplugindatabase.pro: * tests/qwebview/qwebview.pro: 2009-10-22 Gavin Barraclough Reviewed by NOBODY (speculative build fix - qt is currently already broken!) Build fix following bug #30696. * Api/qwebelement.cpp: (setupScriptContext): * Api/qwebframe.cpp: (QWebFrame::evaluateJavaScript): 2009-10-22 Shu Chang Reviewed by Eric Seidel. [Qt] Enable track visited links in QWebPage https://bugs.webkit.org/show_bug.cgi?id=30574 Test: fast/history/clicked-link-is-visited.html * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): 2009-10-22 Girish Ramakrishnan Reviewed by Eric Seidel. [Qt] Add Print Shortcut to QtLauncher https://bugs.webkit.org/show_bug.cgi?id=30682 * QtLauncher/main.cpp: (MainWindow::setupUI): 2009-10-22 Antonio Gomes Rubberstamped by Tor Arne Vestbø. Code standarlization for QGVLauncher. 1) Made member initilization lists in constructors to be per line. 2) Made applyProxy method inline as all other methods in WebPage class. * QGVLauncher/main.cpp: (WebPage::WebPage): (WebPage::applyProxy): (MainView::MainView): (MainWindow::MainWindow): (MainWindow::init): 2009-10-22 Antonio Gomes Reviewed by Tor Arne Vestbø. Add a Y-Axis rotation to QGVLauncher. It uses the QStateMachine API from Qt 4.6. * QGVLauncher/main.cpp: (WebView::WebView): (WebView::setYRotation): (WebView::yRotation): (MainView::flip): (MainView::animatedYFlip): (SharedScene::SharedScene): (SharedScene::webView): (MainWindow::init): (MainWindow::animatedYFlip): (MainWindow::buildUI): 2009-10-20 Kenneth Rohde Christiansen Reviewed By Adam Barth. Add some actions to the menu for cursor debugging. GraphicsView based launcher only. * QGVLauncher/main.cpp: (MainView::setWaitCursor): (MainView::resetCursor): (MainView::flip): (MainWindow::setWaitCursor): (MainWindow::resetCursor): (MainWindow::buildUI): 2009-10-20 Kenneth Rohde Christiansen Rubberstamped by Adam Barth. Remove clipRenderToViewport as agreed upon in https://bugs.webkit.org/show_bug.cgi?id=29843 * Api/qwebframe.cpp: * Api/qwebframe.h: * Api/qwebframe_p.h: (QWebFramePrivate::QWebFramePrivate): 2009-10-20 Kenneth Rohde Christiansen Reviewed by Adam Barth. Update the tests to test the new render functionality, and take into consideration that render() clips to the frame itself as well as the viewport. QWebFrame::render() now always clips, so the old tests were bogus. Rendering pure contents (no scrollbars etc) without clipping can now be accomplished using QWebFrame::documentElement()->render(...) * Api/qwebframe.cpp: * Api/qwebframe.h: * Api/qwebframe_p.h: (QWebFramePrivate::QWebFramePrivate): * tests/qwebframe/tst_qwebframe.cpp: 2009-10-20 Kenneth Rohde Christiansen Rubberstamped by Adam Barth. As we do not support rendering a QWebFrame without it being clipped the the frame as well as the viewport, we now set the viewport size to the size of the contents. Rendering pure contents (no scrollbars etc) without clipping can be acomplished using QWebFrame::documentElement()->render(...) * tests/qwebelement/tst_qwebelement.cpp: (tst_QWebElement::render): 2009-10-20 Kenneth Rohde Christiansen Reviewed by Tor Arne Vestbø. Add menu item to dump the plugin list to the console, which can be handy for debugging. * QtLauncher/main.cpp: (MainWindow::dumpPlugins): (MainWindow::setupUI): 2009-10-19 Kenneth Rohde Christiansen Reviewed by Tor Arne Vestbø. Introduce new render method on QWebFrame, which supports specifying which layers to render (scrollbars, contents, pan-icon). * Api/qwebframe.cpp: (QWebFramePrivate::renderPrivate): (QWebFrame::render): * Api/qwebframe.h: * Api/qwebframe_p.h: 2009-10-19 Antonio Gomes Reviewed by Ariya Hidayat. [Qt] Infinite loop (leading to crash) when setting cursor in QGraphicsWebView https://bugs.webkit.org/show_bug.cgi?id=30549 Patch reimplements QGraphicsItem's itemChange method, and make CursorChange event to be emitted after cursor has already been set. QWidget::setCursor send the event just after it sets the cursor, then patch makes both behaviors compatible. * Api/qgraphicswebview.cpp: (QGraphicsWebView::itemChange): * Api/qgraphicswebview.h: --- src/3rdparty/webkit/ChangeLog | 42 + src/3rdparty/webkit/JavaScriptCore/ChangeLog | 524 +++ .../webkit/JavaScriptCore/JavaScriptCore.gypi | 1 + .../webkit/JavaScriptCore/JavaScriptCore.pri | 2 + .../JavaScriptCore/assembler/ARMv7Assembler.h | 168 +- .../JavaScriptCore/assembler/MacroAssemblerARM.h | 9 +- .../JavaScriptCore/assembler/MacroAssemblerARMv7.h | 8 +- .../webkit/JavaScriptCore/bytecode/CodeBlock.cpp | 21 +- .../webkit/JavaScriptCore/bytecode/Opcode.h | 1 + .../bytecompiler/BytecodeGenerator.cpp | 13 + .../bytecompiler/BytecodeGenerator.h | 19 + .../JavaScriptCore/interpreter/Interpreter.cpp | 27 + .../JavaScriptCore/jit/ExecutableAllocator.h | 16 + src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp | 2 + src/3rdparty/webkit/JavaScriptCore/jit/JIT.h | 31 +- src/3rdparty/webkit/JavaScriptCore/jit/JITCall.cpp | 2 +- .../webkit/JavaScriptCore/jit/JITInlineMethods.h | 9 +- .../webkit/JavaScriptCore/jit/JITOpcodes.cpp | 7 +- .../JavaScriptCore/jit/JITPropertyAccess.cpp | 148 +- .../webkit/JavaScriptCore/jit/JITStubs.cpp | 78 +- src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h | 6 +- .../webkit/JavaScriptCore/parser/Nodes.cpp | 9 + .../webkit/JavaScriptCore/runtime/Collector.cpp | 12 +- .../JavaScriptCore/runtime/DateConstructor.cpp | 4 +- .../webkit/JavaScriptCore/runtime/DateInstance.cpp | 84 +- .../webkit/JavaScriptCore/runtime/DateInstance.h | 23 +- .../JavaScriptCore/runtime/DateInstanceCache.h | 89 + .../JavaScriptCore/runtime/DatePrototype.cpp | 235 +- .../webkit/JavaScriptCore/runtime/DatePrototype.h | 2 +- .../webkit/JavaScriptCore/runtime/JSCell.h | 1 + .../webkit/JavaScriptCore/runtime/JSFunction.h | 8 +- .../webkit/JavaScriptCore/runtime/JSGlobalData.h | 4 +- .../webkit/JavaScriptCore/runtime/JSObject.h | 4 +- .../runtime/JSPropertyNameIterator.cpp | 7 +- .../runtime/JSPropertyNameIterator.h | 18 +- .../webkit/JavaScriptCore/runtime/Structure.cpp | 9 + .../webkit/JavaScriptCore/runtime/Structure.h | 11 +- .../webkit/JavaScriptCore/wtf/CurrentTime.cpp | 4 + .../webkit/JavaScriptCore/wtf/DateMath.cpp | 11 +- .../webkit/JavaScriptCore/wtf/FastMalloc.h | 14 +- .../webkit/JavaScriptCore/wtf/MessageQueue.h | 17 +- src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 13 +- .../webkit/JavaScriptCore/wtf/StdLibExtras.h | 2 + .../webkit/JavaScriptCore/wtf/Threading.cpp | 2 +- src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h | 4 + .../JavaScriptCore/wtf/ThreadingPthreads.cpp | 4 +- .../JavaScriptCore/yarr/RegexInterpreter.cpp | 8 +- .../webkit/JavaScriptCore/yarr/RegexJIT.cpp | 5 +- src/3rdparty/webkit/VERSION | 4 +- src/3rdparty/webkit/WebCore/ChangeLog | 4258 +++++++++++++++++++- src/3rdparty/webkit/WebCore/DerivedSources.cpp | 1 + .../ForwardingHeaders/wtf/DateInstanceCache.h | 4 + src/3rdparty/webkit/WebCore/LICENSE-APPLE | 33 +- src/3rdparty/webkit/WebCore/WebCore.gypi | 35 +- src/3rdparty/webkit/WebCore/WebCore.pro | 35 +- .../accessibility/AccessibilityAllInOne.cpp | 44 + .../accessibility/AccessibilityListBoxOption.h | 1 + .../WebCore/accessibility/AccessibilityObject.h | 14 + .../accessibility/AccessibilityRenderObject.cpp | 42 +- .../accessibility/AccessibilityRenderObject.h | 1 + .../accessibility/qt/AccessibilityObjectQt.cpp | 5 + .../WebCore/bindings/ScriptControllerBase.cpp | 4 + .../WebCore/bindings/js/JSAbstractWorkerCustom.cpp | 4 +- .../WebCore/bindings/js/JSBindingsAllInOne.cpp | 150 + .../webkit/WebCore/bindings/js/JSCallbackData.cpp | 9 +- .../webkit/WebCore/bindings/js/JSCallbackData.h | 3 + .../bindings/js/JSCustomXPathNSResolver.cpp | 2 +- .../bindings/js/JSDOMApplicationCacheCustom.cpp | 4 +- .../webkit/WebCore/bindings/js/JSDOMBinding.cpp | 356 +- .../webkit/WebCore/bindings/js/JSDOMBinding.h | 110 +- .../WebCore/bindings/js/JSDOMGlobalObject.cpp | 29 +- .../webkit/WebCore/bindings/js/JSDOMGlobalObject.h | 8 +- .../webkit/WebCore/bindings/js/JSDOMWindowBase.cpp | 32 +- .../webkit/WebCore/bindings/js/JSDOMWindowBase.h | 5 +- .../WebCore/bindings/js/JSDOMWindowCustom.cpp | 15 +- .../WebCore/bindings/js/JSDOMWindowShell.cpp | 8 +- .../webkit/WebCore/bindings/js/JSDOMWindowShell.h | 2 +- .../bindings/js/JSDesktopNotificationsCustom.cpp | 4 +- .../webkit/WebCore/bindings/js/JSEventListener.cpp | 20 +- .../webkit/WebCore/bindings/js/JSEventListener.h | 7 +- .../WebCore/bindings/js/JSEventSourceCustom.cpp | 4 +- .../webkit/WebCore/bindings/js/JSEventTarget.cpp | 4 +- .../webkit/WebCore/bindings/js/JSExceptionBase.cpp | 128 +- .../webkit/WebCore/bindings/js/JSExceptionBase.h | 86 +- .../WebCore/bindings/js/JSHTMLAllCollection.cpp | 35 - .../WebCore/bindings/js/JSHTMLAllCollection.h | 58 - .../bindings/js/JSHTMLAllCollectionCustom.cpp | 135 + .../WebCore/bindings/js/JSHTMLCollectionCustom.cpp | 2 +- .../WebCore/bindings/js/JSHTMLDocumentCustom.cpp | 5 +- .../bindings/js/JSHTMLFrameSetElementCustom.cpp | 4 +- .../bindings/js/JSInspectorBackendCustom.cpp | 7 +- .../WebCore/bindings/js/JSLazyEventListener.cpp | 6 +- .../WebCore/bindings/js/JSLazyEventListener.h | 6 +- .../WebCore/bindings/js/JSMessageChannelCustom.cpp | 14 +- .../WebCore/bindings/js/JSMessagePortCustom.cpp | 11 +- .../webkit/WebCore/bindings/js/JSNodeCustom.cpp | 10 +- .../WebCore/bindings/js/JSNodeFilterCondition.cpp | 2 +- .../bindings/js/JSQuarantinedObjectWrapper.cpp | 8 +- .../bindings/js/JSSVGElementInstanceCustom.cpp | 4 +- .../WebCore/bindings/js/JSSharedWorkerCustom.cpp | 7 +- .../WebCore/bindings/js/JSWebSocketCustom.cpp | 4 +- .../WebCore/bindings/js/JSWorkerContextCustom.cpp | 8 +- .../WebCore/bindings/js/JSXMLHttpRequestCustom.cpp | 11 +- .../bindings/js/JSXMLHttpRequestUploadCustom.cpp | 11 +- .../webkit/WebCore/bindings/js/ScheduledAction.cpp | 15 +- .../webkit/WebCore/bindings/js/ScheduledAction.h | 9 +- .../WebCore/bindings/js/ScriptCachedFrameData.cpp | 13 +- .../WebCore/bindings/js/ScriptController.cpp | 193 +- .../webkit/WebCore/bindings/js/ScriptController.h | 43 +- .../WebCore/bindings/js/ScriptControllerMac.mm | 2 +- .../WebCore/bindings/js/ScriptEventListener.cpp | 4 +- .../WebCore/bindings/js/ScriptFunctionCall.cpp | 6 +- .../WebCore/bindings/js/ScriptObjectQuarantine.cpp | 6 +- .../webkit/WebCore/bindings/js/ScriptSourceCode.h | 8 + .../webkit/WebCore/bindings/js/ScriptState.cpp | 5 +- .../webkit/WebCore/bindings/js/ScriptState.h | 1 + .../WebCore/bindings/js/WorkerScriptController.cpp | 3 +- .../WebCore/bindings/js/WorkerScriptController.h | 3 + .../WebCore/bindings/scripts/CodeGeneratorJS.pm | 40 +- .../WebCore/bindings/scripts/CodeGeneratorV8.pm | 67 +- src/3rdparty/webkit/WebCore/bridge/NP_jsobject.cpp | 9 +- .../webkit/WebCore/bridge/jni/jni_jsobject.mm | 5 +- src/3rdparty/webkit/WebCore/bridge/npapi.h | 25 +- .../webkit/WebCore/bridge/qt/qt_runtime.cpp | 6 +- .../WebCore/css/CSSComputedStyleDeclaration.cpp | 49 +- .../WebCore/css/CSSComputedStyleDeclaration.h | 3 + src/3rdparty/webkit/WebCore/css/CSSParser.cpp | 48 +- src/3rdparty/webkit/WebCore/css/CSSParser.h | 2 +- src/3rdparty/webkit/WebCore/css/CSSParserValues.h | 2 +- .../webkit/WebCore/css/CSSPrimitiveValueMappings.h | 5 +- src/3rdparty/webkit/WebCore/css/CSSProperty.h | 2 +- .../webkit/WebCore/css/CSSPropertyNames.in | 4 + .../webkit/WebCore/css/CSSStyleSelector.cpp | 1 + .../WebCore/css/SVGCSSComputedStyleDeclaration.cpp | 2 + src/3rdparty/webkit/WebCore/css/SVGCSSParser.cpp | 5 + .../webkit/WebCore/css/SVGCSSPropertyNames.in | 2 + .../webkit/WebCore/css/SVGCSSStyleSelector.cpp | 30 + src/3rdparty/webkit/WebCore/dom/Document.cpp | 19 +- src/3rdparty/webkit/WebCore/dom/Document.h | 17 +- src/3rdparty/webkit/WebCore/dom/Element.cpp | 2 +- src/3rdparty/webkit/WebCore/dom/EventTarget.cpp | 35 +- src/3rdparty/webkit/WebCore/dom/EventTarget.h | 20 +- .../webkit/WebCore/dom/HTMLAllCollection.idl | 40 - .../webkit/WebCore/dom/ScriptExecutionContext.cpp | 20 + .../webkit/WebCore/dom/ScriptExecutionContext.h | 4 + src/3rdparty/webkit/WebCore/dom/SelectElement.cpp | 22 +- src/3rdparty/webkit/WebCore/dom/XMLTokenizer.cpp | 49 +- src/3rdparty/webkit/WebCore/dom/XMLTokenizer.h | 7 +- .../webkit/WebCore/dom/XMLTokenizerLibxml2.cpp | 26 +- src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp | 25 +- .../webkit/WebCore/editing/ApplyStyleCommand.cpp | 36 +- .../WebCore/editing/CompositeEditCommand.cpp | 177 +- .../webkit/WebCore/editing/CompositeEditCommand.h | 3 + .../webkit/WebCore/editing/EditorCommand.cpp | 4 +- .../WebCore/editing/IndentOutdentCommand.cpp | 63 +- .../webkit/WebCore/editing/IndentOutdentCommand.h | 1 - .../WebCore/editing/ReplaceNodeWithSpanCommand.cpp | 4 +- .../webkit/WebCore/editing/SelectionController.cpp | 2 + .../webkit/WebCore/generated/CSSPropertyNames.cpp | 428 +- .../webkit/WebCore/generated/CSSPropertyNames.h | 256 +- .../webkit/WebCore/generated/JSAbstractWorker.cpp | 4 +- .../webkit/WebCore/generated/JSBarInfo.cpp | 2 +- .../webkit/WebCore/generated/JSCSSRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSRuleList.cpp | 2 +- .../WebCore/generated/JSCSSStyleDeclaration.cpp | 2 +- .../webkit/WebCore/generated/JSCSSValue.cpp | 2 +- .../generated/JSCSSVariablesDeclaration.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasArray.cpp | 2 +- .../WebCore/generated/JSCanvasArrayBuffer.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasGradient.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasPattern.cpp | 2 +- .../WebCore/generated/JSCanvasRenderingContext.cpp | 2 +- .../webkit/WebCore/generated/JSClientRect.cpp | 2 +- .../webkit/WebCore/generated/JSClientRectList.cpp | 2 +- .../webkit/WebCore/generated/JSClipboard.cpp | 2 +- .../webkit/WebCore/generated/JSConsole.cpp | 2 +- .../webkit/WebCore/generated/JSCoordinates.cpp | 2 +- .../webkit/WebCore/generated/JSCounter.cpp | 2 +- .../WebCore/generated/JSDOMApplicationCache.cpp | 18 +- .../WebCore/generated/JSDOMCoreException.cpp | 2 +- .../WebCore/generated/JSDOMImplementation.cpp | 2 +- .../webkit/WebCore/generated/JSDOMParser.cpp | 2 +- .../webkit/WebCore/generated/JSDOMSelection.cpp | 2 +- .../webkit/WebCore/generated/JSDOMWindow.cpp | 21 +- .../webkit/WebCore/generated/JSDOMWindow.h | 2 + .../webkit/WebCore/generated/JSDataGridColumn.cpp | 2 +- .../WebCore/generated/JSDataGridColumnList.cpp | 2 +- .../webkit/WebCore/generated/JSDatabase.cpp | 2 +- .../webkit/WebCore/generated/JSDocument.cpp | 80 +- .../webkit/WebCore/generated/JSElement.cpp | 78 +- src/3rdparty/webkit/WebCore/generated/JSEvent.cpp | 2 +- .../webkit/WebCore/generated/JSEventException.cpp | 2 +- .../webkit/WebCore/generated/JSEventSource.cpp | 8 +- src/3rdparty/webkit/WebCore/generated/JSFile.cpp | 2 +- .../webkit/WebCore/generated/JSFileList.cpp | 2 +- .../webkit/WebCore/generated/JSGeolocation.cpp | 2 +- .../webkit/WebCore/generated/JSGeoposition.cpp | 2 +- .../WebCore/generated/JSHTMLAllCollection.cpp | 292 ++ .../webkit/WebCore/generated/JSHTMLAllCollection.h | 104 + .../webkit/WebCore/generated/JSHTMLBodyElement.cpp | 16 +- .../webkit/WebCore/generated/JSHTMLCollection.cpp | 24 +- .../webkit/WebCore/generated/JSHTMLCollection.h | 1 - .../WebCore/generated/JSHTMLFrameSetElement.cpp | 16 +- .../webkit/WebCore/generated/JSHistory.cpp | 2 +- .../webkit/WebCore/generated/JSImageData.cpp | 2 +- .../WebCore/generated/JSInspectorBackend.cpp | 2 +- .../WebCore/generated/JSJavaScriptCallFrame.cpp | 2 +- .../webkit/WebCore/generated/JSLocation.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSMedia.cpp | 2 +- .../webkit/WebCore/generated/JSMediaError.cpp | 2 +- .../webkit/WebCore/generated/JSMediaList.cpp | 2 +- .../webkit/WebCore/generated/JSMessageChannel.cpp | 2 +- .../webkit/WebCore/generated/JSMessagePort.cpp | 4 +- .../webkit/WebCore/generated/JSMimeType.cpp | 2 +- .../webkit/WebCore/generated/JSMimeTypeArray.cpp | 2 +- .../webkit/WebCore/generated/JSNamedNodeMap.cpp | 2 +- .../webkit/WebCore/generated/JSNavigator.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSNode.cpp | 2 +- .../webkit/WebCore/generated/JSNodeFilter.cpp | 2 +- .../webkit/WebCore/generated/JSNodeIterator.cpp | 2 +- .../webkit/WebCore/generated/JSNodeList.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSPlugin.cpp | 2 +- .../webkit/WebCore/generated/JSPluginArray.cpp | 2 +- .../webkit/WebCore/generated/JSPositionError.cpp | 2 +- .../webkit/WebCore/generated/JSRGBColor.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRange.cpp | 2 +- .../webkit/WebCore/generated/JSRangeException.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRect.cpp | 2 +- .../webkit/WebCore/generated/JSSQLError.cpp | 2 +- .../webkit/WebCore/generated/JSSQLResultSet.cpp | 2 +- .../WebCore/generated/JSSQLResultSetRowList.cpp | 2 +- .../webkit/WebCore/generated/JSSQLTransaction.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAngle.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedAngle.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedBoolean.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedEnumeration.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedInteger.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedLength.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedLengthList.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedNumber.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedNumberList.cpp | 2 +- .../generated/JSSVGAnimatedPreserveAspectRatio.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedRect.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedString.cpp | 2 +- .../generated/JSSVGAnimatedTransformList.cpp | 2 +- .../WebCore/generated/JSSVGElementInstance.cpp | 82 +- .../WebCore/generated/JSSVGElementInstanceList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGException.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLength.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLengthList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGMatrix.cpp | 2 +- .../webkit/WebCore/generated/JSSVGNumber.cpp | 2 +- .../webkit/WebCore/generated/JSSVGNumberList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSeg.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSegList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPoint.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPointList.cpp | 2 +- .../WebCore/generated/JSSVGPreserveAspectRatio.cpp | 2 +- .../webkit/WebCore/generated/JSSVGRect.cpp | 2 +- .../WebCore/generated/JSSVGRenderingIntent.cpp | 2 +- .../webkit/WebCore/generated/JSSVGStringList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTransform.cpp | 2 +- .../WebCore/generated/JSSVGTransformList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGUnitTypes.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSScreen.cpp | 2 +- .../webkit/WebCore/generated/JSStorage.cpp | 2 +- .../webkit/WebCore/generated/JSStyleSheet.cpp | 2 +- .../webkit/WebCore/generated/JSStyleSheetList.cpp | 2 +- .../webkit/WebCore/generated/JSTextMetrics.cpp | 2 +- .../webkit/WebCore/generated/JSTimeRanges.cpp | 2 +- .../webkit/WebCore/generated/JSTreeWalker.cpp | 2 +- .../webkit/WebCore/generated/JSValidityState.cpp | 2 +- .../webkit/WebCore/generated/JSVoidCallback.cpp | 2 +- .../webkit/WebCore/generated/JSWebKitCSSMatrix.cpp | 2 +- .../webkit/WebCore/generated/JSWebKitPoint.cpp | 2 +- .../webkit/WebCore/generated/JSWebSocket.cpp | 8 +- src/3rdparty/webkit/WebCore/generated/JSWorker.cpp | 2 +- .../webkit/WebCore/generated/JSWorkerContext.cpp | 1 - .../webkit/WebCore/generated/JSWorkerLocation.cpp | 2 +- .../webkit/WebCore/generated/JSWorkerNavigator.cpp | 2 +- .../webkit/WebCore/generated/JSXMLHttpRequest.cpp | 14 +- .../generated/JSXMLHttpRequestException.cpp | 2 +- .../WebCore/generated/JSXMLHttpRequestUpload.cpp | 12 +- .../webkit/WebCore/generated/JSXMLSerializer.cpp | 2 +- .../webkit/WebCore/generated/JSXPathEvaluator.cpp | 2 +- .../webkit/WebCore/generated/JSXPathException.cpp | 2 +- .../webkit/WebCore/generated/JSXPathExpression.cpp | 2 +- .../webkit/WebCore/generated/JSXPathNSResolver.cpp | 2 +- .../webkit/WebCore/generated/JSXPathResult.cpp | 2 +- .../webkit/WebCore/generated/JSXSLTProcessor.cpp | 2 +- .../webkit/WebCore/generated/WebKitVersion.h | 2 +- .../webkit/WebCore/history/qt/HistoryItemQt.cpp | 17 +- .../webkit/WebCore/html/HTMLAllCollection.cpp | 47 + .../webkit/WebCore/html/HTMLAllCollection.h | 44 + .../webkit/WebCore/html/HTMLAllCollection.idl | 43 + .../webkit/WebCore/html/HTMLCanvasElement.cpp | 9 +- src/3rdparty/webkit/WebCore/html/HTMLCollection.h | 3 +- .../webkit/WebCore/html/HTMLCollection.idl | 3 +- src/3rdparty/webkit/WebCore/html/HTMLDocument.idl | 2 +- .../webkit/WebCore/html/HTMLInputElement.cpp | 26 +- .../webkit/WebCore/html/HTMLInputElement.h | 2 + .../webkit/WebCore/html/HTMLMediaElement.cpp | 11 +- .../webkit/WebCore/html/HTMLMediaElement.h | 1 - .../webkit/WebCore/html/HTMLOptionsCollection.idl | 7 +- src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp | 21 +- .../WebCore/html/canvas/CanvasRenderingContext.h | 3 +- .../html/canvas/CanvasRenderingContext2D.cpp | 80 +- .../html/canvas/CanvasRenderingContext3D.cpp | 359 +- .../WebCore/html/canvas/CanvasRenderingContext3D.h | 13 +- .../webkit/WebCore/inspector/ConsoleMessage.cpp | 7 +- .../webkit/WebCore/inspector/ConsoleMessage.h | 1 + .../WebCore/inspector/DOMDispatchTimelineItem.cpp | 58 - .../WebCore/inspector/DOMDispatchTimelineItem.h | 58 - .../WebCore/inspector/InspectorController.cpp | 47 +- .../webkit/WebCore/inspector/InspectorController.h | 3 +- .../webkit/WebCore/inspector/InspectorDOMAgent.h | 5 + .../webkit/WebCore/inspector/InspectorFrontend.cpp | 17 +- .../webkit/WebCore/inspector/InspectorFrontend.h | 5 +- .../webkit/WebCore/inspector/InspectorResource.cpp | 20 +- .../webkit/WebCore/inspector/InspectorResource.h | 2 + .../WebCore/inspector/InspectorTimelineAgent.cpp | 126 +- .../WebCore/inspector/InspectorTimelineAgent.h | 70 +- .../WebCore/inspector/JavaScriptCallFrame.cpp | 3 +- .../webkit/WebCore/inspector/TimelineItem.cpp | 81 - .../webkit/WebCore/inspector/TimelineItem.h | 88 - .../WebCore/inspector/TimelineRecordFactory.cpp | 116 + .../WebCore/inspector/TimelineRecordFactory.h | 63 + .../inspector/front-end/AbstractTimelinePanel.js | 548 +++ .../front-end/BottomUpProfileDataGridTree.js | 214 +- .../webkit/WebCore/inspector/front-end/Color.js | 8 +- .../WebCore/inspector/front-end/ConsoleView.js | 183 +- .../inspector/front-end/DatabaseQueryView.js | 7 +- .../WebCore/inspector/front-end/ElementsPanel.js | 7 +- .../inspector/front-end/ElementsTreeOutline.js | 26 +- .../front-end/EventListenersSidebarPane.js | 11 +- .../inspector/front-end/Images/timelineBarBlue.png | Bin 0 -> 419 bytes .../inspector/front-end/Images/timelineBarGray.png | Bin 0 -> 378 bytes .../front-end/Images/timelineBarGreen.png | Bin 0 -> 414 bytes .../front-end/Images/timelineBarOrange.png | Bin 0 -> 394 bytes .../front-end/Images/timelineBarPurple.png | Bin 0 -> 420 bytes .../inspector/front-end/Images/timelineBarRed.png | Bin 0 -> 408 bytes .../front-end/Images/timelineBarYellow.png | Bin 0 -> 400 bytes .../front-end/Images/timelineCheckmarks.png | Bin 0 -> 3528 bytes .../inspector/front-end/Images/timelineDots.png | Bin 0 -> 2436 bytes .../inspector/front-end/Images/timelineIcon.png | Bin 0 -> 4419 bytes .../WebCore/inspector/front-end/InjectedScript.js | 60 +- .../inspector/front-end/InspectorControllerStub.js | 291 ++ .../webkit/WebCore/inspector/front-end/Panel.js | 99 + .../inspector/front-end/ProfileDataGridTree.js | 36 +- .../WebCore/inspector/front-end/ProfileView.js | 23 +- .../WebCore/inspector/front-end/ProfilesPanel.js | 91 +- .../inspector/front-end/ResourceCategory.js | 11 +- .../WebCore/inspector/front-end/ResourceView.js | 2 +- .../WebCore/inspector/front-end/ResourcesPanel.js | 647 +-- .../WebCore/inspector/front-end/SourceFrame.js | 459 ++- .../WebCore/inspector/front-end/StoragePanel.js | 68 +- .../inspector/front-end/StylesSidebarPane.js | 15 +- .../WebCore/inspector/front-end/SummaryBar.js | 3 +- .../WebCore/inspector/front-end/TestController.js | 10 + .../WebCore/inspector/front-end/TimelineAgent.js | 29 +- .../WebCore/inspector/front-end/TimelinePanel.js | 362 ++ .../front-end/TopDownProfileDataGridTree.js | 9 +- .../webkit/WebCore/inspector/front-end/WebKit.qrc | 2 + .../WebCore/inspector/front-end/inspector.css | 224 +- .../WebCore/inspector/front-end/inspector.html | 7 +- .../WebCore/inspector/front-end/inspector.js | 96 +- .../WebCore/inspector/front-end/utilities.js | 5 + src/3rdparty/webkit/WebCore/loader/Cache.cpp | 6 + .../webkit/WebCore/loader/CachedResource.cpp | 6 + src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp | 52 +- src/3rdparty/webkit/WebCore/loader/FrameLoader.h | 5 + .../webkit/WebCore/loader/RedirectScheduler.cpp | 13 +- .../webkit/WebCore/loader/ResourceLoadNotifier.h | 7 +- .../webkit/WebCore/loader/icon/IconDatabase.cpp | 4 +- .../WebCore/notifications/NotificationCenter.cpp | 14 + .../WebCore/notifications/NotificationCenter.h | 6 +- src/3rdparty/webkit/WebCore/page/Console.cpp | 4 +- src/3rdparty/webkit/WebCore/page/Console.h | 3 +- src/3rdparty/webkit/WebCore/page/DOMTimer.cpp | 27 + src/3rdparty/webkit/WebCore/page/DOMTimer.h | 1 + src/3rdparty/webkit/WebCore/page/DOMWindow.idl | 9 +- src/3rdparty/webkit/WebCore/page/Geolocation.cpp | 128 +- src/3rdparty/webkit/WebCore/page/Geolocation.h | 25 +- src/3rdparty/webkit/WebCore/page/SecurityOrigin.h | 5 +- .../WebCore/page/android/EventHandlerAndroid.cpp | 8 +- .../WebCore/page/animation/AnimationBase.cpp | 2 + src/3rdparty/webkit/WebCore/platform/FileSystem.h | 64 +- .../webkit/WebCore/platform/SSLKeyGenerator.h | 9 +- .../WebCore/platform/android/ClipboardAndroid.h | 44 +- .../WebCore/platform/android/CursorAndroid.cpp | 7 +- .../platform/android/FileChooserAndroid.cpp | 5 +- .../WebCore/platform/android/FileSystemAndroid.cpp | 10 +- .../WebCore/platform/android/KeyEventAndroid.cpp | 288 +- .../WebCore/platform/android/ScreenAndroid.cpp | 32 +- .../platform/android/TemporaryLinkStubs.cpp | 33 +- .../webkit/WebCore/platform/graphics/BitmapImage.h | 4 +- .../WebCore/platform/graphics/GraphicsContext3D.h | 8 +- .../WebCore/platform/graphics/GraphicsLayer.cpp | 6 - .../WebCore/platform/graphics/GraphicsLayer.h | 8 - .../platform/graphics/filters/FEColorMatrix.cpp | 5 +- .../graphics/filters/FEComponentTransfer.cpp | 10 +- .../platform/graphics/filters/FEGaussianBlur.cpp | 9 +- .../WebCore/platform/graphics/qt/ImageQt.cpp | 39 + .../webkit/WebCore/platform/network/Credential.cpp | 3 +- .../webkit/WebCore/platform/network/Credential.h | 2 +- .../WebCore/platform/network/FormDataBuilder.cpp | 38 +- .../platform/network/ResourceRequestBase.cpp | 22 +- .../WebCore/platform/network/ResourceRequestBase.h | 4 +- .../platform/network/qt/QNetworkReplyHandler.cpp | 3 +- .../webkit/WebCore/platform/qt/CursorQt.cpp | 18 +- .../webkit/WebCore/platform/qt/WheelEventQt.cpp | 4 +- .../webkit/WebCore/platform/text/String.cpp | 4 +- .../webkit/WebCore/platform/win/BitmapInfo.cpp | 66 + .../webkit/WebCore/platform/win/BitmapInfo.h | 43 + .../webkit/WebCore/plugins/PluginDatabase.cpp | 4 +- .../webkit/WebCore/plugins/PluginPackage.cpp | 11 +- src/3rdparty/webkit/WebCore/plugins/PluginView.cpp | 2 +- src/3rdparty/webkit/WebCore/plugins/PluginView.h | 8 +- .../webkit/WebCore/plugins/qt/PluginViewQt.cpp | 33 +- .../WebCore/plugins/win/PluginPackageWin.cpp | 11 - .../webkit/WebCore/plugins/win/PluginViewWin.cpp | 128 +- .../webkit/WebCore/rendering/HitTestResult.cpp | 13 +- .../webkit/WebCore/rendering/HitTestResult.h | 1 - .../WebCore/rendering/MediaControlElements.cpp | 9 + .../WebCore/rendering/MediaControlElements.h | 1 + src/3rdparty/webkit/WebCore/rendering/RenderBox.h | 2 +- .../webkit/WebCore/rendering/RenderInline.cpp | 87 + .../webkit/WebCore/rendering/RenderInline.h | 5 + .../webkit/WebCore/rendering/RenderMedia.cpp | 1 + .../rendering/RenderMediaControlsChromium.cpp | 23 +- .../WebCore/rendering/RenderThemeChromiumWin.cpp | 51 +- .../WebCore/rendering/RenderThemeChromiumWin.h | 2 +- .../webkit/WebCore/rendering/RenderTreeAsText.cpp | 28 + .../webkit/WebCore/rendering/RenderTreeAsText.h | 17 +- .../webkit/WebCore/rendering/SVGRenderSupport.cpp | 3 + .../WebCore/rendering/style/SVGRenderStyle.cpp | 5 +- .../WebCore/rendering/style/SVGRenderStyle.h | 4 + .../WebCore/rendering/style/SVGRenderStyleDefs.cpp | 19 + .../WebCore/rendering/style/SVGRenderStyleDefs.h | 28 + src/3rdparty/webkit/WebCore/storage/Database.cpp | 57 +- src/3rdparty/webkit/WebCore/storage/Database.h | 15 +- .../webkit/WebCore/storage/DatabaseThread.cpp | 22 +- .../webkit/WebCore/storage/DatabaseTracker.cpp | 23 +- .../webkit/WebCore/storage/DatabaseTracker.h | 2 + .../webkit/WebCore/storage/OriginQuotaManager.cpp | 3 +- .../webkit/WebCore/storage/SQLTransaction.cpp | 1 - .../WebCore/storage/SQLTransactionClient.cpp | 8 +- .../WebCore/storage/StorageEventDispatcher.cpp | 4 +- .../webkit/WebCore/svg/SVGStyledElement.cpp | 15 +- .../svg/SynchronizablePropertyController.cpp | 128 +- .../WebCore/svg/SynchronizablePropertyController.h | 68 +- .../webkit/WebCore/websockets/WebSocket.cpp | 10 +- .../webkit/WebCore/websockets/WebSocketChannel.cpp | 31 +- .../webkit/WebCore/websockets/WebSocketChannel.h | 4 +- .../webkit/WebCore/workers/WorkerContext.cpp | 1 + .../webkit/WebCore/workers/WorkerContext.idl | 2 +- src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.cpp | 33 +- src/3rdparty/webkit/WebCore/xml/XMLHttpRequest.h | 2 +- src/3rdparty/webkit/WebCore/xml/XPathFunctions.cpp | 9 +- src/3rdparty/webkit/WebKit.pri | 4 + src/3rdparty/webkit/WebKit/ChangeLog | 16 + src/3rdparty/webkit/WebKit/LICENSE | 22 +- .../WebKit/mac/Configurations/Version.xcconfig | 3 +- .../webkit/WebKit/qt/Api/qgraphicswebview.cpp | 122 +- .../webkit/WebKit/qt/Api/qgraphicswebview.h | 1 + src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp | 414 +- src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h | 76 +- src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 119 +- src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h | 19 +- src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h | 4 +- src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp | 149 +- src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h | 15 - src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 58 +- src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 5 + .../webkit/WebKit/qt/Api/qwebsecurityorigin.cpp | 28 +- .../webkit/WebKit/qt/Api/qwebsecurityorigin.h | 2 - src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 109 +- src/3rdparty/webkit/WebKit/qt/Api/qwebview.h | 5 +- src/3rdparty/webkit/WebKit/qt/ChangeLog | 481 +++ .../qt/tests/benchmarks/loading/tst_loading.pro | 5 +- .../qt/tests/benchmarks/painting/tst_painting.pro | 5 +- .../qt/tests/qgraphicswebview/qgraphicswebview.pro | 4 + .../WebKit/qt/tests/qwebelement/qwebelement.pro | 5 +- .../qt/tests/qwebelement/tst_qwebelement.cpp | 91 +- .../webkit/WebKit/qt/tests/qwebframe/qwebframe.pro | 5 +- .../WebKit/qt/tests/qwebframe/resources/image2.png | Bin 0 -> 14743 bytes .../WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 47 +- .../WebKit/qt/tests/qwebhistory/qwebhistory.pro | 5 +- .../qt/tests/qwebhistory/tst_qwebhistory.cpp | 80 +- .../qwebhistoryinterface/qwebhistoryinterface.pro | 5 +- .../webkit/WebKit/qt/tests/qwebpage/qwebpage.pro | 5 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 2 +- .../qwebplugindatabase/qwebplugindatabase.pro | 5 +- .../webkit/WebKit/qt/tests/qwebview/qwebview.pro | 5 +- .../WebKit/qt/tests/qwebview/tst_qwebview.cpp | 64 - 495 files changed, 14556 insertions(+), 4934 deletions(-) create mode 100644 src/3rdparty/webkit/JavaScriptCore/runtime/DateInstanceCache.h create mode 100644 src/3rdparty/webkit/WebCore/ForwardingHeaders/wtf/DateInstanceCache.h create mode 100755 src/3rdparty/webkit/WebCore/accessibility/AccessibilityAllInOne.cpp create mode 100644 src/3rdparty/webkit/WebCore/bindings/js/JSBindingsAllInOne.cpp delete mode 100644 src/3rdparty/webkit/WebCore/bindings/js/JSHTMLAllCollection.cpp delete mode 100644 src/3rdparty/webkit/WebCore/bindings/js/JSHTMLAllCollection.h create mode 100644 src/3rdparty/webkit/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp delete mode 100644 src/3rdparty/webkit/WebCore/dom/HTMLAllCollection.idl create mode 100644 src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.cpp create mode 100644 src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.h create mode 100644 src/3rdparty/webkit/WebCore/html/HTMLAllCollection.cpp create mode 100644 src/3rdparty/webkit/WebCore/html/HTMLAllCollection.h create mode 100644 src/3rdparty/webkit/WebCore/html/HTMLAllCollection.idl delete mode 100644 src/3rdparty/webkit/WebCore/inspector/DOMDispatchTimelineItem.cpp delete mode 100644 src/3rdparty/webkit/WebCore/inspector/DOMDispatchTimelineItem.h delete mode 100644 src/3rdparty/webkit/WebCore/inspector/TimelineItem.cpp delete mode 100644 src/3rdparty/webkit/WebCore/inspector/TimelineItem.h create mode 100644 src/3rdparty/webkit/WebCore/inspector/TimelineRecordFactory.cpp create mode 100644 src/3rdparty/webkit/WebCore/inspector/TimelineRecordFactory.h create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/AbstractTimelinePanel.js create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineBarBlue.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineBarGray.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineBarGreen.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineBarOrange.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineBarPurple.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineBarRed.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineBarYellow.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineCheckmarks.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineDots.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/timelineIcon.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/InspectorControllerStub.js create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/TimelinePanel.js create mode 100644 src/3rdparty/webkit/WebCore/platform/win/BitmapInfo.cpp create mode 100644 src/3rdparty/webkit/WebCore/platform/win/BitmapInfo.h create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebframe/resources/image2.png diff --git a/src/3rdparty/webkit/ChangeLog b/src/3rdparty/webkit/ChangeLog index fb7dddf..dc43e0e 100644 --- a/src/3rdparty/webkit/ChangeLog +++ b/src/3rdparty/webkit/ChangeLog @@ -1,3 +1,45 @@ +2009-10-26 Holger Hans Peter Freyther + + Rubber-stamped by Darin Adler. + + Export fastMalloc, fastCalloc, fastRealloc and fastFree + https://bugs.webkit.org/show_bug.cgi?id=30769 + + Export the FastMalloc functions outside of the libwebkit library + to be able to instrument memory allocations. These are C++ symbols + but do not require the C++ runtime to be useful and should be of + no harm to plain C code. + + * autotools/symbols.filter: + +2009-10-26 Gustavo Noronha Silva + + Reviewed by Jan Alonzo. + + Alternative solution to regression introduced in r48672. + + * GNUmakefile.am: + +2009-10-26 Xan Lopez + + Reviewed by Gustavo Noronha. + + Update for 1.1.16 release. + + * configure.ac: + +2009-10-24 Laszlo Gombos + + Reviewed by Holger Freyther. + + [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian + https://bugs.webkit.org/show_bug.cgi?id=30476 + + Set the stack size to 80 Kb and heap size to the 128kB - 32MB range + to all executables linking against WebKit library. + + * WebKit.pri: + 2009-10-18 Jan Michael Alonzo Reviewed by Holger Freyther. diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index 8d6c2df..e6ab073 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,527 @@ +2009-10-29 Gabor Loki + + Reviewed by Gavin Barraclough. + + Add cacheFlush support for Thumb-2 on Linux + https://bugs.webkit.org/show_bug.cgi?id=30865 + + * jit/ExecutableAllocator.h: + (JSC::ExecutableAllocator::cacheFlush): + +2009-10-28 Gavin Barraclough + + Reviewed by Oliver Hunt. + + JSC JIT on ARMv7 cannot link jumps >16Mb range + https://bugs.webkit.org/show_bug.cgi?id=30891 + + Start planing all relative jumps as move-32-bit-immediate-to-register-BX. + In the cases where the jump would fall within a relative jump range, use a relative jump. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * assembler/ARMv7Assembler.h: + (JSC::ARMv7Assembler::~ARMv7Assembler): + (JSC::ARMv7Assembler::LinkRecord::LinkRecord): + (JSC::ARMv7Assembler::): + (JSC::ARMv7Assembler::executableCopy): + (JSC::ARMv7Assembler::linkJump): + (JSC::ARMv7Assembler::relinkJump): + (JSC::ARMv7Assembler::setInt32): + (JSC::ARMv7Assembler::isB): + (JSC::ARMv7Assembler::isBX): + (JSC::ARMv7Assembler::isMOV_imm_T3): + (JSC::ARMv7Assembler::isMOVT): + (JSC::ARMv7Assembler::isNOP_T1): + (JSC::ARMv7Assembler::isNOP_T2): + (JSC::ARMv7Assembler::linkJumpAbsolute): + (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst): + (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond): + (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp5i6Imm4Reg4EncodedImm): + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::makeJump): + (JSC::MacroAssemblerARMv7::makeBranch): + * jit/JIT.h: + * wtf/Platform.h: + +2009-10-28 Oliver Hunt + + Reviewed by Geoff Garen. + + Improve for..in enumeration performance + https://bugs.webkit.org/show_bug.cgi?id=30887 + + Improve indexing of an object with a for..in iterator by + identifying cases where get_by_val is being used with a iterator + as the subscript and replace it with a new get_by_pname + bytecode. get_by_pname then optimizes lookups that directly access + the base object. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): + * bytecode/Opcode.h: + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitGetByVal): + * bytecompiler/BytecodeGenerator.h: + (JSC::BytecodeGenerator::pushOptimisedForIn): + (JSC::BytecodeGenerator::popOptimisedForIn): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * jit/JIT.cpp: + (JSC::JIT::privateCompileMainPass): + (JSC::JIT::privateCompileSlowCases): + * jit/JIT.h: + * jit/JITPropertyAccess.cpp: + (JSC::JIT::compileGetDirectOffset): + (JSC::JIT::emit_op_get_by_pname): + (JSC::JIT::emitSlow_op_get_by_pname): + * parser/Nodes.cpp: + (JSC::ForInNode::emitBytecode): + * runtime/JSObject.h: + * runtime/JSPropertyNameIterator.cpp: + (JSC::JSPropertyNameIterator::create): + * runtime/JSPropertyNameIterator.h: + (JSC::JSPropertyNameIterator::getOffset): + (JSC::JSPropertyNameIterator::JSPropertyNameIterator): + * runtime/JSValue.h: + (JSC::JSValue::): + * runtime/Structure.cpp: + (JSC::Structure::addPropertyTransition): + (JSC::Structure::changePrototypeTransition): + (JSC::Structure::despecifyFunctionTransition): + (JSC::Structure::addAnonymousSlotsTransition): + (JSC::Structure::getterSetterTransition): + (JSC::Structure::toDictionaryTransition): + (JSC::Structure::addPropertyWithoutTransition): + Track the existence (or not) of non-enumerable properties. + * runtime/Structure.h: + (JSC::Structure::propertyStorageCapacity): + (JSC::Structure::propertyStorageSize): + (JSC::Structure::hasNonEnumerableProperties): + (JSC::Structure::hasAnonymousSlots): + +2009-10-28 Dmitry Titov + + Not reviewed, attemp to fix Windows build. + + Touch the cpp file to cause recompile. + + * wtf/Threading.cpp: + (WTF::threadEntryPoint): + +2009-10-28 Dmitry Titov + + Reviewed by David Levin. + + https://bugs.webkit.org/show_bug.cgi?id=30805 + Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue. + Existing Database tests cover this since Database removes tasks when it is stopped. + + * wtf/MessageQueue.h: + (WTF::::removeIf): + +2009-10-28 Afonso R. Costa Jr. + + Reviewed by Oliver Hunt. + + [Qt] Enable YARR when YARR_JIT is enabled + https://bugs.webkit.org/show_bug.cgi?id=30730 + + When enabling or disabling JIT using JAVASCRIPTCORE_JIT, the ENABLE_YARR should + be toggled also. + + * JavaScriptCore.pri: + +2009-10-24 Martin Robinson + + Reviewed by Oliver Hunt. + + Fix strict aliasing warning by switching reinterpret_cast to bitwise_cast. + + strict-aliasing warnings in JSFunction.h + https://bugs.webkit.org/show_bug.cgi?id=27869 + + * runtime/JSFunction.h: + (JSC::JSFunction::nativeFunction): + (JSC::JSFunction::scopeChain): + (JSC::JSFunction::setScopeChain): + (JSC::JSFunction::setNativeFunction): + +2009-10-28 Jan-Arve Sæther + + Reviewed by Tor Arne Vestbø. + + Build-fix for 64-bit Windows + + * wtf/Platform.h: Make sure to use WTF_USE_JSVALUE64 + +2009-10-28 Gavin Barraclough + + Reviewed by NOBODY (build fix!). + + * jit/JIT.h: + +2009-10-26 Holger Hans Peter Freyther + + Rubber-stamped by Darin Adler. + + Export fastMalloc, fastCalloc, fastRealloc and fastFree on GCC/Unix + https://bugs.webkit.org/show_bug.cgi?id=30769 + + When using -fvisibility=hidden to hide all internal symbols by default + the malloc symbols will be hidden as well. For memory instrumentation + it is needed to provide an instrumented version of these symbols and + override the normal routines and by changing the visibility back to + default this becomes possible. + + The only other solution would be to use system malloc instead of the + TCmalloc implementation but this will not allow to analyze memory + behavior with the default allocator. + + * wtf/FastMalloc.h: Define WTF_FAST_MALLOC_EXPORT for GCC and !darwin + +2009-10-27 Gavin Barraclough + + Rubber Stamped by Samuel Q. Weinig. + + Make the asserts protecting the offsets in the JIT more descriptive. + + * jit/JIT.h: + * jit/JITCall.cpp: + (JSC::JIT::compileOpCall): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_method_check): + (JSC::JIT::compileGetByIdHotPath): + (JSC::JIT::compileGetByIdSlowCase): + (JSC::JIT::emit_op_put_by_id): + +2009-10-27 Geoffrey Garen + + Reviewed by Sam Weinig. + + A little bit of refactoring in the date code. + + * JavaScriptCore.exp: Don't export this unused symbol. + + * runtime/DateConstructor.cpp: + (JSC::constructDate): + + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + * runtime/DateInstance.h: Removed some unused functions. Changed the default + constructor to ensure that a DateInstance is always initialized. + + * runtime/DatePrototype.cpp: + (JSC::DatePrototype::DatePrototype): Pass an initializer to our constructor, + since it now requires one. + + * wtf/DateMath.cpp: + (WTF::msToGregorianDateTime): Only compute our offset from UTC if our + output will require it. Otherwise, our offset is 0. + +2009-10-27 Geoffrey Garen + + Build fix: Mark DateInstaceCache.h private, so other frameworks can see it. + + * JavaScriptCore.xcodeproj/project.pbxproj: + +2009-10-27 Geoffrey Garen + + Build fix: re-readded this file. + + * runtime/DateInstanceCache.h: Added. + (JSC::DateInstanceData::create): + (JSC::DateInstanceData::DateInstanceData): + (JSC::DateInstanceCache::DateInstanceCache): + (JSC::DateInstanceCache::add): + (JSC::DateInstanceCache::lookup): + +2009-10-27 Geoffrey Garen + + Reviewed by Darin Adler and Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=30800 + Cache recently computed date data. + + SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js. + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: Added new file. + + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + (JSC::DateInstance::getGregorianDateTime): Use the shared cache. + + * runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion + of a "cache cache". + + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToISOString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncGetFullYear): + (JSC::dateProtoFuncGetUTCFullYear): + (JSC::dateProtoFuncToGMTString): + (JSC::dateProtoFuncGetMonth): + (JSC::dateProtoFuncGetUTCMonth): + (JSC::dateProtoFuncGetDate): + (JSC::dateProtoFuncGetUTCDate): + (JSC::dateProtoFuncGetDay): + (JSC::dateProtoFuncGetUTCDay): + (JSC::dateProtoFuncGetHours): + (JSC::dateProtoFuncGetUTCHours): + (JSC::dateProtoFuncGetMinutes): + (JSC::dateProtoFuncGetUTCMinutes): + (JSC::dateProtoFuncGetSeconds): + (JSC::dateProtoFuncGetUTCSeconds): + (JSC::dateProtoFuncGetTimezoneOffset): + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + (JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they + can access the DateInstanceCache. + + * runtime/JSGlobalData.h: Keep a DateInstanceCache. + +2009-10-27 James Robinson + + Reviewed by Darin Fisher. + + Ensures that JavaScriptCore/wtf/CurrentTime.cpp is not built in PLATFORM(CHROMIUM) builds. + + Chromium uses a different method to calculate the current time than is used in + JavaScriptCore/wtf/CurrentTime.cpp. This can lead to time skew when calls to currentTime() and Chromium's time + function are mixed. In particular, timers can get scheduled in the past which leads to 100% CPU use. + See http://code.google.com/p/chromium/issues/detail?id=25892 for an example. + + https://bugs.webkit.org/show_bug.cgi?id=30833 + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + * wtf/CurrentTime.cpp: + +2009-10-27 Peter Varga + + Rubber-stamped by Tor Arne Vestbø. + + Fix typo in RegexInterpreter.cpp and RegexJIT.cpp alterantive to + alternative. + + * yarr/RegexInterpreter.cpp: + (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction): + (JSC::Yarr::ByteCompiler::alternativeDisjunction): + (JSC::Yarr::ByteCompiler::emitDisjunction): + * yarr/RegexJIT.cpp: + (JSC::Yarr::RegexGenerator::generateDisjunction): + +2009-10-26 Laszlo Gombos + + Reviewed by Darin Adler. + + Make .rc files compile on Windows without depending on MFC headers + https://bugs.webkit.org/show_bug.cgi?id=30750 + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Use + winresrc.h because it exists even when MFC is not installed, and is + all that's needed here. + +2009-10-26 Gabor Loki + + Reviewed by Gavin Barraclough. + + The thunkReturnAddress is on JITStackFrame on ARM JIT as well + https://bugs.webkit.org/show_bug.cgi?id=30782 + + Move the thunkReturnAddress from top of the stack into the JITStackFrame + structure. This is a requirement for JSValue32_64 support on ARM. + + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::ret): Return with link register + (JSC::MacroAssemblerARM::prepareCall): Store the return address in link register + * jit/JIT.h: Remove unused ctiReturnRegister + * jit/JITInlineMethods.h: Same as ARMv7 + (JSC::JIT::restoreArgumentReference): Ditto. + (JSC::JIT::restoreArgumentReferenceForTrampoline): Ditto. + * jit/JITOpcodes.cpp: Remove ctiReturnRegister related instruction + * jit/JITStubs.cpp: Store thunkReturnAddress on JITStackFrame. Use + small trampoline functions which handle return addresses for each + CTI_STUB_FUNCTION. + * jit/JITStubs.h: Store thunkReturnAddress on JITStackFrame + (JSC::JITStackFrame::returnAddressSlot): Return with the address of thunkReturnAddress + * yarr/RegexJIT.cpp: + (JSC::Yarr::RegexGenerator::generateEnter): Remove the unnecessary instruction + +2009-10-26 Steve Block + + Reviewed by Darin Adler. + + Adds ability to disable ReadWriteLock on platforms (eg Android) that use pthreads but do not support pthread_rwlock. + https://bugs.webkit.org/show_bug.cgi?id=30713 + + * wtf/Platform.h: Modified. Defines HAVE_PTHREAD_RWLOCK for all platforms currently using pthreads. + * wtf/Threading.h: Modified. Use pthread_rwlock_t only when HAVE_PTHREAD_RWLOCK is defined. + * wtf/ThreadingPthreads.cpp: Modified. Build ReadWriteLock methods only when HAVE_PTHREAD_RWLOCK is defined. + +2009-10-24 Laszlo Gombos + + Reviewed by Holger Freyther. + + [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian + https://bugs.webkit.org/show_bug.cgi?id=30476 + + Assign ReadUserData WriteUserData NetworkServices Symbian capabilities + to jsc.exe. + + * jsc.pro: + +2009-10-23 Steve Block + + Reviewed by Dmitry Titov. + + Fixes a leak in createThreadInternal on Android. + https://bugs.webkit.org/show_bug.cgi?id=30698 + + * wtf/ThreadingPthreads.cpp: Modified. + (WTF::createThreadInternal): Avoid leaking a ThreadData object on failure. + +2009-10-22 Geoffrey Garen + + Reviewed by Alexey Proskuryakov. + + Fixed ASSERT when opening Safari's Caches window while the Web Inspector + is open. + + * runtime/Collector.cpp: + (JSC::typeName): Added two new types to the type name list in the Collector. + These types have been around for a while, but nobody remembered to consider them here. + + * runtime/JSCell.h: + (JSC::JSCell::isPropertyNameIterator): + * runtime/JSPropertyNameIterator.h: + (JSC::JSPropertyNameIterator::isPropertyNameIterator): Give the Collector + a way to tell if a cell is a JSPropertyNameIterator. + +2009-10-22 Steve Falkenburg + + Reviewed by Jon Honeycutt. + + https://bugs.webkit.org/show_bug.cgi?id=30686 + Remove debug-specific def file. + Only Debug_All target uses JavaScriptCore_debug.dll naming, and since + that target is only used internally, maintaining two files just to + suppress a single link warning isn't worthwhile. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Removed. + +2009-10-21 Jon Honeycutt + + Screenshots of off-screen plug-ins are blank + After halting a transparent PluginView on + Windows, the transparency is applied twice + + Reviewed by Dan Bernstein. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + Export WTF::deleteOwnedPtr(HDC). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + Ditto. + +2009-10-20 Geoffrey Garen + + Windows build fix: updated variable name. + + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + +2009-10-20 Geoffrey Garen + + Reviewed by Mark Rowe. + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_next_pname): Slightly tweaked this #ifdef to match the + size of a JSValue because m_jsStrings is an array of JSValues. + +2009-10-20 Geoffrey Garen + + Reviewed by Mark Rowe. + + Fixed a 64-bit regression caused by the fix for + https://bugs.webkit.org/show_bug.cgi?id=30570. + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_next_pname): Use TimesEight stepping on 64-bit, since + 64-bit pointers are eight bytes long. + +2009-10-20 Geoffrey Garen + + Reviewed by Sam Weinig. + + Refactored DateInstance::msToGregorianDateTime so that a DateInstance's + caller doesn't need to supply the DateInstance's own internal value to + the DateInstance. + + * runtime/DateInstance.cpp: + (JSC::DateInstance::getGregorianDateTime): Renamed from "msToGregorianDateTime". + + * runtime/DateInstance.h: + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToISOString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncToLocaleString): + (JSC::dateProtoFuncToLocaleDateString): + (JSC::dateProtoFuncToLocaleTimeString): + (JSC::dateProtoFuncGetTime): + (JSC::dateProtoFuncGetFullYear): + (JSC::dateProtoFuncGetUTCFullYear): + (JSC::dateProtoFuncToGMTString): + (JSC::dateProtoFuncGetMonth): + (JSC::dateProtoFuncGetUTCMonth): + (JSC::dateProtoFuncGetDate): + (JSC::dateProtoFuncGetUTCDate): + (JSC::dateProtoFuncGetDay): + (JSC::dateProtoFuncGetUTCDay): + (JSC::dateProtoFuncGetHours): + (JSC::dateProtoFuncGetUTCHours): + (JSC::dateProtoFuncGetMinutes): + (JSC::dateProtoFuncGetUTCMinutes): + (JSC::dateProtoFuncGetSeconds): + (JSC::dateProtoFuncGetUTCSeconds): + (JSC::dateProtoFuncGetTimezoneOffset): + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + (JSC::dateProtoFuncGetYear): Also renamed "utc" to "outputIsUTC", for clarity. + +2009-10-20 Gabor Loki + + Reviewed by Geoffrey Garen. + + The op_next_pname should use 4 bytes addressing mode in case of JSValue32 + https://bugs.webkit.org/show_bug.cgi?id=30570 + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_next_pname): + +2009-10-20 Gabor Loki + + Reviewed by Oliver Hunt. + + Move OverridesMarkChildren flag from DatePrototype to its parent class + https://bugs.webkit.org/show_bug.cgi?id=30372 + + * runtime/DateInstance.h: + (JSC::DateInstance::createStructure): + * runtime/DatePrototype.h: + 2009-10-19 Geoffrey Garen Reviewed by Oliver Hunt. diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.gypi b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.gypi index 4b316c8..03c23c3 100644 --- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.gypi +++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.gypi @@ -194,6 +194,7 @@ 'runtime/DateConversion.h', 'runtime/DateInstance.cpp', 'runtime/DateInstance.h', + 'runtime/DateInstanceCache.h', 'runtime/DatePrototype.cpp', 'runtime/DatePrototype.h', 'runtime/Error.cpp', diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri index 89c483e..eb26664 100644 --- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri +++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri @@ -39,10 +39,12 @@ win32-* { contains(JAVASCRIPTCORE_JIT,yes) { DEFINES+=ENABLE_JIT=1 DEFINES+=ENABLE_YARR_JIT=1 + DEFINES+=ENABLE_YARR=1 } contains(JAVASCRIPTCORE_JIT,no) { DEFINES+=ENABLE_JIT=0 DEFINES+=ENABLE_YARR_JIT=0 + DEFINES+=ENABLE_YARR=0 } # In debug mode JIT disabled until crash fixed diff --git a/src/3rdparty/webkit/JavaScriptCore/assembler/ARMv7Assembler.h b/src/3rdparty/webkit/JavaScriptCore/assembler/ARMv7Assembler.h index 078de44..02ce2e9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/assembler/ARMv7Assembler.h +++ b/src/3rdparty/webkit/JavaScriptCore/assembler/ARMv7Assembler.h @@ -407,6 +407,11 @@ register writeback class ARMv7Assembler { public: + ~ARMv7Assembler() + { + ASSERT(m_jumpsToLink.isEmpty()); + } + typedef ARMRegisters::RegisterID RegisterID; typedef ARMRegisters::FPRegisterID FPRegisterID; @@ -477,6 +482,17 @@ public: private: + struct LinkRecord { + LinkRecord(intptr_t from, intptr_t to) + : from(from) + , to(to) + { + } + + intptr_t from; + intptr_t to; + }; + // ARMv7, Appx-A.6.3 bool BadReg(RegisterID reg) { @@ -574,6 +590,7 @@ private: OP_SUB_SP_imm_T1 = 0xB080, OP_BKPT = 0xBE00, OP_IT = 0xBF00, + OP_NOP_T1 = 0xBF00, } OpcodeID; typedef enum { @@ -608,6 +625,7 @@ private: OP_MOV_imm_T3 = 0xF240, OP_SUB_imm_T4 = 0xF2A0, OP_MOVT = 0xF2C0, + OP_NOP_T2a = 0xF3AF, OP_LDRH_reg_T2 = 0xF830, OP_LDRH_imm_T3 = 0xF830, OP_STR_imm_T4 = 0xF840, @@ -626,6 +644,7 @@ private: typedef enum { OP_B_T4b = 0x9000, + OP_NOP_T2b = 0x8000, } OpcodeID2; struct FourFours { @@ -1481,6 +1500,15 @@ public: void* executableCopy(ExecutablePool* allocator) { void* copy = m_formatter.executableCopy(allocator); + + unsigned jumpCount = m_jumpsToLink.size(); + for (unsigned i = 0; i < jumpCount; ++i) { + uint16_t* location = reinterpret_cast(reinterpret_cast(copy) + m_jumpsToLink[i].from); + uint16_t* target = reinterpret_cast(reinterpret_cast(copy) + m_jumpsToLink[i].to); + linkJumpAbsolute(location, target); + } + m_jumpsToLink.clear(); + ASSERT(copy); return copy; } @@ -1503,11 +1531,7 @@ public: { ASSERT(to.m_offset != -1); ASSERT(from.m_offset != -1); - - uint16_t* location = reinterpret_cast(reinterpret_cast(m_formatter.data()) + from.m_offset); - intptr_t relative = to.m_offset - from.m_offset; - - linkWithOffset(location, relative); + m_jumpsToLink.append(LinkRecord(from.m_offset, to.m_offset)); } static void linkJump(void* code, JmpSrc from, void* to) @@ -1515,9 +1539,7 @@ public: ASSERT(from.m_offset != -1); uint16_t* location = reinterpret_cast(reinterpret_cast(code) + from.m_offset); - intptr_t relative = reinterpret_cast(to) - reinterpret_cast(location); - - linkWithOffset(location, relative); + linkJumpAbsolute(location, to); } // bah, this mathod should really be static, since it is used by the LinkBuffer. @@ -1541,10 +1563,9 @@ public: ASSERT(!(reinterpret_cast(from) & 1)); ASSERT(!(reinterpret_cast(to) & 1)); - intptr_t relative = reinterpret_cast(to) - reinterpret_cast(from); - linkWithOffset(reinterpret_cast(from), relative); + linkJumpAbsolute(reinterpret_cast(from), to); - ExecutableAllocator::cacheFlush(reinterpret_cast(from) - 2, 2 * sizeof(uint16_t)); + ExecutableAllocator::cacheFlush(reinterpret_cast(from) - 5, 5 * sizeof(uint16_t)); } static void relinkCall(void* from, void* to) @@ -1613,14 +1634,14 @@ private: static void setInt32(void* code, uint32_t value) { uint16_t* location = reinterpret_cast(code); + ASSERT(isMOV_imm_T3(location - 4) && isMOVT(location - 2)); - uint16_t lo16 = value; - uint16_t hi16 = value >> 16; - - spliceHi5(location - 4, lo16); - spliceLo11(location - 3, lo16); - spliceHi5(location - 2, hi16); - spliceLo11(location - 1, hi16); + ARMThumbImmediate lo16 = ARMThumbImmediate::makeUInt16(static_cast(value)); + ARMThumbImmediate hi16 = ARMThumbImmediate::makeUInt16(static_cast(value >> 16)); + location[-4] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOV_imm_T3, lo16); + location[-3] = twoWordOp5i6Imm4Reg4EncodedImmSecond((location[-3] >> 8) & 0xf, lo16); + location[-2] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOVT, hi16); + location[-1] = twoWordOp5i6Imm4Reg4EncodedImmSecond((location[-1] >> 8) & 0xf, hi16); ExecutableAllocator::cacheFlush(location - 4, 4 * sizeof(uint16_t)); } @@ -1630,41 +1651,89 @@ private: setInt32(code, reinterpret_cast(value)); } - // Linking & patching: - // This method assumes that the JmpSrc being linked is a T4 b instruction. - static void linkWithOffset(uint16_t* instruction, intptr_t relative) - { - // Currently branches > 16m = mostly deathy. - if (((relative << 7) >> 7) != relative) { - // FIXME: This CRASH means we cannot turn the JIT on by default on arm-v7. - fprintf(stderr, "Error: Cannot link T4b.\n"); - CRASH(); - } - - // ARM encoding for the top two bits below the sign bit is 'peculiar'. - if (relative >= 0) - relative ^= 0xC00000; + static bool isB(void* address) + { + uint16_t* instruction = static_cast(address); + return ((instruction[0] & 0xf800) == OP_B_T4a) && ((instruction[1] & 0xd000) == OP_B_T4b); + } + + static bool isBX(void* address) + { + uint16_t* instruction = static_cast(address); + return (instruction[0] & 0xff87) == OP_BX; + } - // All branch offsets should be an even distance. - ASSERT(!(relative & 1)); + static bool isMOV_imm_T3(void* address) + { + uint16_t* instruction = static_cast(address); + return ((instruction[0] & 0xFBF0) == OP_MOV_imm_T3) && ((instruction[1] & 0x8000) == 0); + } - int word1 = ((relative & 0x1000000) >> 14) | ((relative & 0x3ff000) >> 12); - int word2 = ((relative & 0x800000) >> 10) | ((relative & 0x400000) >> 11) | ((relative & 0xffe) >> 1); + static bool isMOVT(void* address) + { + uint16_t* instruction = static_cast(address); + return ((instruction[0] & 0xFBF0) == OP_MOVT) && ((instruction[1] & 0x8000) == 0); + } - instruction[-2] = OP_B_T4a | word1; - instruction[-1] = OP_B_T4b | word2; + static bool isNOP_T1(void* address) + { + uint16_t* instruction = static_cast(address); + return instruction[0] == OP_NOP_T1; } - // These functions can be used to splice 16-bit immediates back into previously generated instructions. - static void spliceHi5(uint16_t* where, uint16_t what) + static bool isNOP_T2(void* address) { - uint16_t pattern = (what >> 12) | ((what & 0x0800) >> 1); - *where = (*where & 0xFBF0) | pattern; + uint16_t* instruction = static_cast(address); + return (instruction[0] == OP_NOP_T2a) && (instruction[1] == OP_NOP_T2b); } - static void spliceLo11(uint16_t* where, uint16_t what) + + static void linkJumpAbsolute(uint16_t* instruction, void* target) { - uint16_t pattern = ((what & 0x0700) << 4) | (what & 0x00FF); - *where = (*where & 0x8F00) | pattern; + // FIMXE: this should be up in the MacroAssembler layer. :-( + const uint16_t JUMP_TEMPORARY_REGISTER = ARMRegisters::ip; + + ASSERT(!(reinterpret_cast(instruction) & 1)); + ASSERT(!(reinterpret_cast(target) & 1)); + + ASSERT( (isMOV_imm_T3(instruction - 5) && isMOVT(instruction - 3) && isBX(instruction - 1)) + || (isNOP_T1(instruction - 5) && isNOP_T2(instruction - 4) && isB(instruction - 2)) ); + + intptr_t relative = reinterpret_cast(target) - (reinterpret_cast(instruction)); + if (((relative << 7) >> 7) == relative) { + // ARM encoding for the top two bits below the sign bit is 'peculiar'. + if (relative >= 0) + relative ^= 0xC00000; + + // All branch offsets should be an even distance. + ASSERT(!(relative & 1)); + // There may be a better way to fix this, but right now put the NOPs first, since in the + // case of an conditional branch this will be coming after an ITTT predicating *three* + // instructions! Looking backwards to modify the ITTT to an IT is not easy, due to + // variable wdith encoding - the previous instruction might *look* like an ITTT but + // actually be the second half of a 2-word op. + instruction[-5] = OP_NOP_T1; + instruction[-4] = OP_NOP_T2a; + instruction[-3] = OP_NOP_T2b; + instruction[-2] = OP_B_T4a | ((relative & 0x1000000) >> 14) | ((relative & 0x3ff000) >> 12); + instruction[-1] = OP_B_T4b | ((relative & 0x800000) >> 10) | ((relative & 0x400000) >> 11) | ((relative & 0xffe) >> 1); + } else { + ARMThumbImmediate lo16 = ARMThumbImmediate::makeUInt16(static_cast(reinterpret_cast(target) + 1)); + ARMThumbImmediate hi16 = ARMThumbImmediate::makeUInt16(static_cast(reinterpret_cast(target) >> 16)); + instruction[-5] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOV_imm_T3, lo16); + instruction[-4] = twoWordOp5i6Imm4Reg4EncodedImmSecond(JUMP_TEMPORARY_REGISTER, lo16); + instruction[-3] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOVT, hi16); + instruction[-2] = twoWordOp5i6Imm4Reg4EncodedImmSecond(JUMP_TEMPORARY_REGISTER, hi16); + instruction[-1] = OP_BX | (JUMP_TEMPORARY_REGISTER << 3); + } + } + + static uint16_t twoWordOp5i6Imm4Reg4EncodedImmFirst(uint16_t op, ARMThumbImmediate imm) + { + return op | (imm.m_value.i << 10) | imm.m_value.imm4; + } + static uint16_t twoWordOp5i6Imm4Reg4EncodedImmSecond(uint16_t rd, ARMThumbImmediate imm) + { + return (imm.m_value.imm3 << 12) | (rd << 8) | imm.m_value.imm8; } class ARMInstructionFormatter { @@ -1723,8 +1792,11 @@ private: void twoWordOp5i6Imm4Reg4EncodedImm(OpcodeID1 op, int imm4, RegisterID rd, ARMThumbImmediate imm) { - m_buffer.putShort(op | (imm.m_value.i << 10) | imm4); - m_buffer.putShort((imm.m_value.imm3 << 12) | (rd << 8) | imm.m_value.imm8); + ARMThumbImmediate newImm = imm; + newImm.m_value.imm4 = imm4; + + m_buffer.putShort(ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst(op, newImm)); + m_buffer.putShort(ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond(rd, newImm)); } void twoWordOp12Reg4Reg4Imm12(OpcodeID1 op, RegisterID reg1, RegisterID reg2, uint16_t imm) @@ -1749,6 +1821,8 @@ private: private: AssemblerBuffer m_buffer; } m_formatter; + + Vector m_jumpsToLink; }; } // namespace JSC diff --git a/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARM.h b/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARM.h index aa8cbb0..7a72b06 100644 --- a/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARM.h +++ b/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARM.h @@ -65,6 +65,7 @@ public: }; static const RegisterID stackPointerRegister = ARMRegisters::sp; + static const RegisterID linkRegister = ARMRegisters::lr; static const Scale ScalePtr = TimesFour; @@ -530,7 +531,7 @@ public: void ret() { - pop(ARMRegisters::pc); + m_assembler.mov_r(ARMRegisters::pc, linkRegister); } void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest) @@ -746,11 +747,9 @@ protected: void prepareCall() { - ensureSpace(3 * sizeof(ARMWord), sizeof(ARMWord)); + ensureSpace(2 * sizeof(ARMWord), sizeof(ARMWord)); - // S0 might be used for parameter passing - m_assembler.add_r(ARMRegisters::S1, ARMRegisters::pc, ARMAssembler::OP2_IMM | 0x4); - m_assembler.push_r(ARMRegisters::S1); + m_assembler.mov_r(linkRegister, ARMRegisters::pc); } void call32(RegisterID base, int32_t offset) diff --git a/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARMv7.h index a549604..c479517 100644 --- a/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARMv7.h +++ b/src/3rdparty/webkit/JavaScriptCore/assembler/MacroAssemblerARMv7.h @@ -990,13 +990,15 @@ public: protected: ARMv7Assembler::JmpSrc makeJump() { - return m_assembler.b(); + moveFixedWidthEncoding(Imm32(0), dataTempRegister); + return m_assembler.bx(dataTempRegister); } ARMv7Assembler::JmpSrc makeBranch(ARMv7Assembler::Condition cond) { - m_assembler.it(cond); - return m_assembler.b(); + m_assembler.it(cond, true, true); + moveFixedWidthEncoding(Imm32(0), dataTempRegister); + return m_assembler.bx(dataTempRegister); } ARMv7Assembler::JmpSrc makeBranch(Condition cond) { return makeBranch(armV7Condition(cond)); } ARMv7Assembler::JmpSrc makeBranch(DoubleCondition cond) { return makeBranch(armV7Condition(cond)); } diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp index 18ca2ae..c915934 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp @@ -824,6 +824,16 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str()); break; } + case op_get_by_pname: { + int r0 = (++it)->u.operand; + int r1 = (++it)->u.operand; + int r2 = (++it)->u.operand; + int r3 = (++it)->u.operand; + int r4 = (++it)->u.operand; + int r5 = (++it)->u.operand; + printf("[%4d] get_by_pname\t %s, %s, %s, %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), registerName(r3).c_str(), registerName(r4).c_str(), registerName(r5).c_str()); + break; + } case op_put_by_val: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; @@ -1015,14 +1025,17 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& break; } case op_get_pnames: { - int r0 = it[0].u.operand; - int r1 = it[1].u.operand; - printf("[%4d] get_pnames\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str()); + int r0 = it[1].u.operand; + int r1 = it[2].u.operand; + int r2 = it[3].u.operand; + int r3 = it[4].u.operand; + int offset = it[5].u.operand; + printf("[%4d] get_pnames\t %s, %s, %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), registerName(r3).c_str(), offset, location + offset); it += OPCODE_LENGTH(op_get_pnames) - 1; break; } case op_next_pname: { - int dest = it[0].u.operand; + int dest = it[1].u.operand; int iter = it[4].u.operand; int offset = it[5].u.operand; printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(dest).c_str(), registerName(iter).c_str(), offset, location + offset); diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h index 8968252..4facbef 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/Opcode.h @@ -113,6 +113,7 @@ namespace JSC { macro(op_put_by_id_generic, 8) \ macro(op_del_by_id, 4) \ macro(op_get_by_val, 4) \ + macro(op_get_by_pname, 7) \ macro(op_put_by_val, 4) \ macro(op_del_by_val, 4) \ macro(op_put_by_index, 4) \ diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 41b5c39..04dae15 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -1281,6 +1281,19 @@ RegisterID* BytecodeGenerator::emitDeleteById(RegisterID* dst, RegisterID* base, RegisterID* BytecodeGenerator::emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID* property) { + for (size_t i = m_forInContextStack.size(); i > 0; i--) { + ForInContext& context = m_forInContextStack[i - 1]; + if (context.propertyRegister == property) { + emitOpcode(op_get_by_pname); + instructions().append(dst->index()); + instructions().append(base->index()); + instructions().append(property->index()); + instructions().append(context.expectedSubscriptRegister->index()); + instructions().append(context.iterRegister->index()); + instructions().append(context.indexRegister->index()); + return dst; + } + } emitOpcode(op_get_by_val); instructions().append(dst->index()); instructions().append(base->index()); diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h index 61de173..4648fb5 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecompiler/BytecodeGenerator.h @@ -61,6 +61,13 @@ namespace JSC { FinallyContext finallyContext; }; + struct ForInContext { + RefPtr expectedSubscriptRegister; + RefPtr iterRegister; + RefPtr indexRegister; + RefPtr propertyRegister; + }; + class BytecodeGenerator : public FastAllocBase { public: typedef DeclarationStacks::VarStack VarStack; @@ -331,6 +338,17 @@ namespace JSC { void pushFinallyContext(Label* target, RegisterID* returnAddrDst); void popFinallyContext(); + void pushOptimisedForIn(RegisterID* expectedBase, RegisterID* iter, RegisterID* index, RegisterID* propertyRegister) + { + ForInContext context = { expectedBase, iter, index, propertyRegister }; + m_forInContextStack.append(context); + } + + void popOptimisedForIn() + { + m_forInContextStack.removeLast(); + } + LabelScope* breakTarget(const Identifier&); LabelScope* continueTarget(const Identifier&); @@ -467,6 +485,7 @@ namespace JSC { Vector m_scopeContextStack; Vector m_switchContextStack; + Vector m_forInContextStack; int m_nextGlobalIndex; int m_nextParameterIndex; diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index 53964ad..c77a0f1 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -2417,6 +2417,33 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi vPC += OPCODE_LENGTH(op_del_by_id); NEXT_INSTRUCTION(); } + DEFINE_OPCODE(op_get_by_pname) { + int dst = vPC[1].u.operand; + int base = vPC[2].u.operand; + int property = vPC[3].u.operand; + int expected = vPC[4].u.operand; + int iter = vPC[5].u.operand; + int i = vPC[6].u.operand; + + JSValue baseValue = callFrame->r(base).jsValue(); + JSPropertyNameIterator* it = callFrame->r(iter).propertyNameIterator(); + JSValue subscript = callFrame->r(property).jsValue(); + JSValue expectedSubscript = callFrame->r(expected).jsValue(); + int index = callFrame->r(i).i() - 1; + JSValue result; + int offset = 0; + if (subscript == expectedSubscript && baseValue.isCell() && (baseValue.asCell()->structure() == it->cachedStructure()) && it->getOffset(index, offset)) { + callFrame->r(dst) = asObject(baseValue)->getDirectOffset(offset); + vPC += OPCODE_LENGTH(op_get_by_pname); + NEXT_INSTRUCTION(); + } + Identifier propertyName(callFrame, subscript.toString(callFrame)); + result = baseValue.get(callFrame, propertyName); + CHECK_FOR_EXCEPTION(); + callFrame->r(dst) = result; + vPC += OPCODE_LENGTH(op_get_by_pname); + NEXT_INSTRUCTION(); + } DEFINE_OPCODE(op_get_by_val) { /* get_by_val dst(r) base(r) property(r) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h b/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h index 1d15ef0..5c43eeb 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/ExecutableAllocator.h @@ -189,6 +189,22 @@ public: sys_dcache_flush(code, size); sys_icache_invalidate(code, size); } +#elif PLATFORM(ARM_THUMB2) && PLATFORM(LINUX) + static void cacheFlush(void* code, size_t size) + { + asm volatile ( + "push {r7}\n" + "mov r0, %0\n" + "mov r1, %1\n" + "movw r7, #0x2\n" + "movt r7, #0xf\n" + "movs r2, #0x0\n" + "svc 0x0\n" + "pop {r7}\n" + : + : "r" (code), "r" (reinterpret_cast(code) + size) + : "r0", "r1"); + } #elif PLATFORM(SYMBIAN) static void cacheFlush(void* code, size_t size) { diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp index fa0ac2e..000e4b8 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.cpp @@ -239,6 +239,7 @@ void JIT::privateCompileMainPass() DEFINE_OP(op_eq_null) DEFINE_OP(op_get_by_id) DEFINE_OP(op_get_by_val) + DEFINE_OP(op_get_by_pname) DEFINE_OP(op_get_global_var) DEFINE_OP(op_get_pnames) DEFINE_OP(op_get_scoped_var) @@ -385,6 +386,7 @@ void JIT::privateCompileSlowCases() DEFINE_SLOWCASE_OP(op_eq) DEFINE_SLOWCASE_OP(op_get_by_id) DEFINE_SLOWCASE_OP(op_get_by_val) + DEFINE_SLOWCASE_OP(op_get_by_pname) DEFINE_SLOWCASE_OP(op_instanceof) DEFINE_SLOWCASE_OP(op_jfalse) DEFINE_SLOWCASE_OP(op_jnless) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h index 9406d1f..e19ea17 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h @@ -38,6 +38,8 @@ #define JIT_CLASS_ALIGNMENT #endif +#define ASSERT_JIT_OFFSET(actual, expected) ASSERT_WITH_MESSAGE(actual == expected, "JIT Offset \"%s\" should be %d, not %d.\n", #expected, static_cast(actual), static_cast(expected)); + #include "CodeBlock.h" #include "Interpreter.h" #include "JITCode.h" @@ -249,7 +251,6 @@ namespace JSC { static const RegisterID timeoutCheckRegister = ARMRegisters::r5; static const RegisterID callFrameRegister = ARMRegisters::r4; - static const RegisterID ctiReturnRegister = ARMRegisters::r6; static const RegisterID regT0 = ARMRegisters::r0; static const RegisterID regT1 = ARMRegisters::r1; @@ -427,6 +428,7 @@ namespace JSC { #endif void compileGetDirectOffset(RegisterID base, RegisterID resultTag, RegisterID resultPayload, Structure* structure, size_t cachedOffset); void compileGetDirectOffset(JSObject* base, RegisterID temp, RegisterID resultTag, RegisterID resultPayload, size_t cachedOffset); + void compileGetDirectOffset(RegisterID base, RegisterID resultTag, RegisterID resultPayload, RegisterID structure, RegisterID offset); void compilePutDirectOffset(RegisterID base, RegisterID valueTag, RegisterID valuePayload, Structure* structure, size_t cachedOffset); // Arithmetic opcode helpers @@ -528,6 +530,7 @@ namespace JSC { #endif void compileGetDirectOffset(RegisterID base, RegisterID result, Structure* structure, size_t cachedOffset); void compileGetDirectOffset(JSObject* base, RegisterID temp, RegisterID result, size_t cachedOffset); + void compileGetDirectOffset(RegisterID base, RegisterID result, RegisterID structure, RegisterID offset, RegisterID scratch); void compilePutDirectOffset(RegisterID base, RegisterID value, Structure* structure, size_t cachedOffset); #if PLATFORM(X86_64) @@ -583,26 +586,26 @@ namespace JSC { #elif PLATFORM(ARM_THUMB2) // These architecture specific value are used to enable patching - see comment on op_put_by_id. static const int patchOffsetPutByIdStructure = 10; - static const int patchOffsetPutByIdExternalLoad = 20; + static const int patchOffsetPutByIdExternalLoad = 26; static const int patchLengthPutByIdExternalLoad = 12; - static const int patchOffsetPutByIdPropertyMapOffset = 40; + static const int patchOffsetPutByIdPropertyMapOffset = 46; // These architecture specific value are used to enable patching - see comment on op_get_by_id. static const int patchOffsetGetByIdStructure = 10; - static const int patchOffsetGetByIdBranchToSlowCase = 20; - static const int patchOffsetGetByIdExternalLoad = 20; + static const int patchOffsetGetByIdBranchToSlowCase = 26; + static const int patchOffsetGetByIdExternalLoad = 26; static const int patchLengthGetByIdExternalLoad = 12; - static const int patchOffsetGetByIdPropertyMapOffset = 40; - static const int patchOffsetGetByIdPutResult = 44; + static const int patchOffsetGetByIdPropertyMapOffset = 46; + static const int patchOffsetGetByIdPutResult = 50; #if ENABLE(OPCODE_SAMPLING) static const int patchOffsetGetByIdSlowCaseCall = 0; // FIMXE #else static const int patchOffsetGetByIdSlowCaseCall = 28; #endif - static const int patchOffsetOpCallCompareToJump = 10; + static const int patchOffsetOpCallCompareToJump = 16; - static const int patchOffsetMethodCheckProtoObj = 18; - static const int patchOffsetMethodCheckProtoStruct = 28; - static const int patchOffsetMethodCheckPutFunction = 46; + static const int patchOffsetMethodCheckProtoObj = 24; + static const int patchOffsetMethodCheckProtoStruct = 34; + static const int patchOffsetMethodCheckPutFunction = 58; #elif PLATFORM(ARM_TRADITIONAL) // These architecture specific value are used to enable patching - see comment on op_put_by_id. static const int patchOffsetPutByIdStructure = 4; @@ -619,7 +622,7 @@ namespace JSC { #if ENABLE(OPCODE_SAMPLING) #error "OPCODE_SAMPLING is not yet supported" #else - static const int patchOffsetGetByIdSlowCaseCall = 36; + static const int patchOffsetGetByIdSlowCaseCall = 28; #endif static const int patchOffsetOpCallCompareToJump = 12; @@ -640,7 +643,7 @@ namespace JSC { static const int sequenceGetByIdHotPathInstructionSpace = 28; static const int sequenceGetByIdHotPathConstantSpace = 3; // sequenceGetByIdSlowCase - static const int sequenceGetByIdSlowCaseInstructionSpace = 40; + static const int sequenceGetByIdSlowCaseInstructionSpace = 32; static const int sequenceGetByIdSlowCaseConstantSpace = 2; // sequencePutById static const int sequencePutByIdInstructionSpace = 28; @@ -682,6 +685,7 @@ namespace JSC { void emit_op_eq_null(Instruction*); void emit_op_get_by_id(Instruction*); void emit_op_get_by_val(Instruction*); + void emit_op_get_by_pname(Instruction*); void emit_op_get_global_var(Instruction*); void emit_op_get_scoped_var(Instruction*); void emit_op_init_arguments(Instruction*); @@ -771,6 +775,7 @@ namespace JSC { void emitSlow_op_eq(Instruction*, Vector::iterator&); void emitSlow_op_get_by_id(Instruction*, Vector::iterator&); void emitSlow_op_get_by_val(Instruction*, Vector::iterator&); + void emitSlow_op_get_by_pname(Instruction*, Vector::iterator&); void emitSlow_op_instanceof(Instruction*, Vector::iterator&); void emitSlow_op_jfalse(Instruction*, Vector::iterator&); void emitSlow_op_jnless(Instruction*, Vector::iterator&); diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITCall.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITCall.cpp index cfaa69f..f7fcc0a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITCall.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITCall.cpp @@ -614,7 +614,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca END_UNINTERRUPTED_SEQUENCE(sequenceOpCall); addSlowCase(jumpToSlow); - ASSERT(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow) == patchOffsetOpCallCompareToJump); + ASSERT_JIT_OFFSET(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow), patchOffsetOpCallCompareToJump); m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck; // The following is the fast case, only used whan a callee can be linked. diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITInlineMethods.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITInlineMethods.h index f26457a..93d6ce7 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITInlineMethods.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITInlineMethods.h @@ -144,7 +144,7 @@ ALWAYS_INLINE void JIT::endUninterruptedSequence(int insnSpace, int constSpace) #endif -#if PLATFORM(ARM_THUMB2) +#if PLATFORM(ARM) ALWAYS_INLINE void JIT::preserveReturnAddressAfterCall(RegisterID reg) { @@ -161,7 +161,7 @@ ALWAYS_INLINE void JIT::restoreReturnAddressBeforeReturn(Address address) loadPtr(address, linkRegister); } -#else // PLATFORM(X86) || PLATFORM(X86_64) || PLATFORM(ARM_TRADITIONAL) +#else // PLATFORM(X86) || PLATFORM(X86_64) ALWAYS_INLINE void JIT::preserveReturnAddressAfterCall(RegisterID reg) { @@ -191,16 +191,13 @@ ALWAYS_INLINE void JIT::restoreArgumentReference() { move(stackPointerRegister, firstArgumentRegister); poke(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof (void*)); -#if PLATFORM(ARM_TRADITIONAL) - move(ctiReturnRegister, ARMRegisters::lr); -#endif } ALWAYS_INLINE void JIT::restoreArgumentReferenceForTrampoline() { #if PLATFORM(X86) // Within a trampoline the return address will be on the stack at this point. addPtr(Imm32(sizeof(void*)), stackPointerRegister, firstArgumentRegister); -#elif PLATFORM(ARM_THUMB2) +#elif PLATFORM(ARM) move(stackPointerRegister, firstArgumentRegister); #endif // In the trampoline on x86-64, the first argument register is not overwritten. diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp index e10d105..14736cf 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp @@ -1792,7 +1792,6 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr* executable // Setup arg4: This is a plain hack move(stackPointerRegister, ARMRegisters::S0); - move(ctiReturnRegister, ARMRegisters::lr); call(Address(regT1, OBJECT_OFFSETOF(JSFunction, m_data))); addPtr(Imm32(sizeof(ArgList)), stackPointerRegister); @@ -2500,7 +2499,13 @@ void JIT::emit_op_next_pname(Instruction* currentInstruction) // Grab key @ i loadPtr(addressFor(it), regT1); loadPtr(Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_jsStrings)), regT2); + +#if USE(JSVALUE64) loadPtr(BaseIndex(regT2, regT0, TimesEight), regT2); +#else + loadPtr(BaseIndex(regT2, regT0, TimesFour), regT2); +#endif + emitPutVirtualRegister(dst, regT2); // Increment i diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITPropertyAccess.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITPropertyAccess.cpp index 4241111..bf367a6 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITPropertyAccess.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITPropertyAccess.cpp @@ -33,6 +33,7 @@ #include "JITStubCall.h" #include "JSArray.h" #include "JSFunction.h" +#include "JSPropertyNameIterator.h" #include "Interpreter.h" #include "LinkBuffer.h" #include "RepatchBuffer.h" @@ -934,6 +935,69 @@ void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* str #endif // !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) +void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, RegisterID resultPayload, RegisterID structure, RegisterID offset) +{ + ASSERT(sizeof(((Structure*)0)->m_propertyStorageCapacity) == sizeof(int32_t)); + ASSERT(sizeof(JSObject::inlineStorageCapacity) == sizeof(int32_t)); + ASSERT(sizeof(JSValue) == 8); + + Jump notUsingInlineStorage = branch32(NotEqual, Address(structure, OBJECT_OFFSETOF(Structure, m_propertyStorageCapacity)), Imm32(JSObject::inlineStorageCapacity)); + loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSObject, m_inlineStorage)+OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload); + loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSObject, m_inlineStorage)+OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag); + Jump finishedLoad = jump(); + notUsingInlineStorage.link(this); + loadPtr(Address(base, OBJECT_OFFSETOF(JSObject, m_externalStorage)), base); + loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload); + loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag); + finishedLoad.link(this); +} + +void JIT::emit_op_get_by_pname(Instruction* currentInstruction) +{ + unsigned dst = currentInstruction[1].u.operand; + unsigned base = currentInstruction[2].u.operand; + unsigned property = currentInstruction[3].u.operand; + unsigned expected = currentInstruction[4].u.operand; + unsigned iter = currentInstruction[5].u.operand; + unsigned i = currentInstruction[6].u.operand; + + emitLoad2(property, regT1, regT0, base, regT3, regT2); + emitJumpSlowCaseIfNotJSCell(property, regT1); + addSlowCase(branchPtr(NotEqual, regT0, payloadFor(expected))); + // Property registers are now available as the property is known + emitJumpSlowCaseIfNotJSCell(base, regT3); + emitLoadPayload(iter, regT1); + + // Test base's structure + loadPtr(Address(regT2, OBJECT_OFFSETOF(JSCell, m_structure)), regT0); + addSlowCase(branchPtr(NotEqual, regT0, Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_cachedStructure)))); + load32(addressFor(i), regT3); + sub32(Imm32(1), regT3); + addSlowCase(branch32(AboveOrEqual, regT3, Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_numCacheableSlots)))); + compileGetDirectOffset(regT2, regT1, regT0, regT0, regT3); + + emitStore(dst, regT1, regT0); + map(m_bytecodeIndex + OPCODE_LENGTH(op_get_by_pname), dst, regT1, regT0); +} + +void JIT::emitSlow_op_get_by_pname(Instruction* currentInstruction, Vector::iterator& iter) +{ + unsigned dst = currentInstruction[1].u.operand; + unsigned base = currentInstruction[2].u.operand; + unsigned property = currentInstruction[3].u.operand; + + linkSlowCaseIfNotJSCell(iter, property); + linkSlowCase(iter); + linkSlowCaseIfNotJSCell(iter, base); + linkSlowCase(iter); + linkSlowCase(iter); + + JITStubCall stubCall(this, cti_op_get_by_val); + stubCall.addArgument(base); + stubCall.addArgument(property); + stubCall.call(dst); +} + #else // USE(JSVALUE32_64) void JIT::emit_op_get_by_val(Instruction* currentInstruction) @@ -967,6 +1031,48 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction) emitPutVirtualRegister(dst); } +void JIT::emit_op_get_by_pname(Instruction* currentInstruction) +{ + unsigned dst = currentInstruction[1].u.operand; + unsigned base = currentInstruction[2].u.operand; + unsigned property = currentInstruction[3].u.operand; + unsigned expected = currentInstruction[4].u.operand; + unsigned iter = currentInstruction[5].u.operand; + unsigned i = currentInstruction[6].u.operand; + + emitGetVirtualRegister(property, regT0); + addSlowCase(branchPtr(NotEqual, regT0, addressFor(expected))); + emitGetVirtualRegisters(base, regT0, iter, regT1); + emitJumpSlowCaseIfNotJSCell(regT0, base); + + // Test base's structure + loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); + addSlowCase(branchPtr(NotEqual, regT2, Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_cachedStructure)))); + load32(addressFor(i), regT3); + sub32(Imm32(1), regT3); + addSlowCase(branch32(AboveOrEqual, regT3, Address(regT1, OBJECT_OFFSETOF(JSPropertyNameIterator, m_numCacheableSlots)))); + compileGetDirectOffset(regT0, regT0, regT2, regT3, regT1); + + emitPutVirtualRegister(dst, regT0); +} + +void JIT::emitSlow_op_get_by_pname(Instruction* currentInstruction, Vector::iterator& iter) +{ + unsigned dst = currentInstruction[1].u.operand; + unsigned base = currentInstruction[2].u.operand; + unsigned property = currentInstruction[3].u.operand; + + linkSlowCase(iter); + linkSlowCaseIfNotJSCell(iter, base); + linkSlowCase(iter); + linkSlowCase(iter); + + JITStubCall stubCall(this, cti_op_get_by_val); + stubCall.addArgument(base, regT2); + stubCall.addArgument(property, regT2); + stubCall.call(dst); +} + void JIT::emit_op_put_by_val(Instruction* currentInstruction) { unsigned base = currentInstruction[1].u.operand; @@ -1132,9 +1238,9 @@ void JIT::emit_op_method_check(Instruction* currentInstruction) Jump match = jump(); - ASSERT(differenceBetween(info.structureToCompare, protoObj) == patchOffsetMethodCheckProtoObj); - ASSERT(differenceBetween(info.structureToCompare, protoStructureToCompare) == patchOffsetMethodCheckProtoStruct); - ASSERT(differenceBetween(info.structureToCompare, putFunction) == patchOffsetMethodCheckPutFunction); + ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, protoObj), patchOffsetMethodCheckProtoObj); + ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, protoStructureToCompare), patchOffsetMethodCheckProtoStruct); + ASSERT_JIT_OFFSET(differenceBetween(info.structureToCompare, putFunction), patchOffsetMethodCheckPutFunction); // Link the failure cases here. notCell.link(this); @@ -1201,22 +1307,22 @@ void JIT::compileGetByIdHotPath(int, int baseVReg, Identifier*, unsigned propert DataLabelPtr structureToCompare; Jump structureCheck = branchPtrWithPatch(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), structureToCompare, ImmPtr(reinterpret_cast(patchGetByIdDefaultStructure))); addSlowCase(structureCheck); - ASSERT(differenceBetween(hotPathBegin, structureToCompare) == patchOffsetGetByIdStructure); - ASSERT(differenceBetween(hotPathBegin, structureCheck) == patchOffsetGetByIdBranchToSlowCase); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, structureToCompare), patchOffsetGetByIdStructure); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, structureCheck), patchOffsetGetByIdBranchToSlowCase) Label externalLoad = loadPtrWithPatchToLEA(Address(regT0, OBJECT_OFFSETOF(JSObject, m_externalStorage)), regT0); Label externalLoadComplete(this); - ASSERT(differenceBetween(hotPathBegin, externalLoad) == patchOffsetGetByIdExternalLoad); - ASSERT(differenceBetween(externalLoad, externalLoadComplete) == patchLengthGetByIdExternalLoad); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, externalLoad), patchOffsetGetByIdExternalLoad); + ASSERT_JIT_OFFSET(differenceBetween(externalLoad, externalLoadComplete), patchLengthGetByIdExternalLoad); DataLabel32 displacementLabel = loadPtrWithAddressOffsetPatch(Address(regT0, patchGetByIdDefaultOffset), regT0); - ASSERT(differenceBetween(hotPathBegin, displacementLabel) == patchOffsetGetByIdPropertyMapOffset); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel), patchOffsetGetByIdPropertyMapOffset); Label putResult(this); END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdHotPath); - ASSERT(differenceBetween(hotPathBegin, putResult) == patchOffsetGetByIdPutResult); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, putResult), patchOffsetGetByIdPutResult); } void JIT::emitSlow_op_get_by_id(Instruction* currentInstruction, Vector::iterator& iter) @@ -1251,7 +1357,7 @@ void JIT::compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident END_UNINTERRUPTED_SEQUENCE(sequenceGetByIdSlowCase); - ASSERT(differenceBetween(coldPathBegin, call) == patchOffsetGetByIdSlowCaseCall); + ASSERT_JIT_OFFSET(differenceBetween(coldPathBegin, call), patchOffsetGetByIdSlowCaseCall); // Track the location of the call; this will be used to recover patch information. m_propertyAccessCompilationInfo[m_propertyAccessInstructionIndex].callReturnLocation = call; @@ -1282,19 +1388,19 @@ void JIT::emit_op_put_by_id(Instruction* currentInstruction) // It is important that the following instruction plants a 32bit immediate, in order that it can be patched over. DataLabelPtr structureToCompare; addSlowCase(branchPtrWithPatch(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), structureToCompare, ImmPtr(reinterpret_cast(patchGetByIdDefaultStructure)))); - ASSERT(differenceBetween(hotPathBegin, structureToCompare) == patchOffsetPutByIdStructure); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, structureToCompare), patchOffsetPutByIdStructure); // Plant a load from a bogus ofset in the object's property map; we will patch this later, if it is to be used. Label externalLoad = loadPtrWithPatchToLEA(Address(regT0, OBJECT_OFFSETOF(JSObject, m_externalStorage)), regT0); Label externalLoadComplete(this); - ASSERT(differenceBetween(hotPathBegin, externalLoad) == patchOffsetPutByIdExternalLoad); - ASSERT(differenceBetween(externalLoad, externalLoadComplete) == patchLengthPutByIdExternalLoad); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, externalLoad), patchOffsetPutByIdExternalLoad); + ASSERT_JIT_OFFSET(differenceBetween(externalLoad, externalLoadComplete), patchLengthPutByIdExternalLoad); DataLabel32 displacementLabel = storePtrWithAddressOffsetPatch(regT1, Address(regT0, patchGetByIdDefaultOffset)); END_UNINTERRUPTED_SEQUENCE(sequencePutById); - ASSERT(differenceBetween(hotPathBegin, displacementLabel) == patchOffsetPutByIdPropertyMapOffset); + ASSERT_JIT_OFFSET(differenceBetween(hotPathBegin, displacementLabel), patchOffsetPutByIdPropertyMapOffset); } void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector::iterator& iter) @@ -1351,6 +1457,20 @@ void JIT::compileGetDirectOffset(JSObject* base, RegisterID temp, RegisterID res } } +void JIT::compileGetDirectOffset(RegisterID base, RegisterID result, RegisterID structure, RegisterID offset, RegisterID scratch) +{ + ASSERT(sizeof(((Structure*)0)->m_propertyStorageCapacity) == sizeof(int32_t)); + ASSERT(sizeof(JSObject::inlineStorageCapacity) == sizeof(int32_t)); + + Jump notUsingInlineStorage = branch32(NotEqual, Address(structure, OBJECT_OFFSETOF(Structure, m_propertyStorageCapacity)), Imm32(JSObject::inlineStorageCapacity)); + loadPtr(BaseIndex(base, offset, ScalePtr, OBJECT_OFFSETOF(JSObject, m_inlineStorage)), result); + Jump finishedLoad = jump(); + notUsingInlineStorage.link(this); + loadPtr(Address(base, OBJECT_OFFSETOF(JSObject, m_externalStorage)), scratch); + loadPtr(BaseIndex(scratch, offset, ScalePtr, 0), result); + finishedLoad.link(this); +} + void JIT::testPrototype(Structure* structure, JumpList& failureCases) { if (structure->m_prototype.isNull()) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index 457518c..c999618 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -75,25 +75,12 @@ namespace JSC { #define THUMB_FUNC_PARAM(name) #endif -#if PLATFORM(LINUX) && (PLATFORM(X86_64) || PLATFORM(X86)) +#if PLATFORM(LINUX) && PLATFORM(X86_64) #define SYMBOL_STRING_RELOCATION(name) #name "@plt" #else #define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name) #endif -#if PLATFORM(DARWIN) - // Mach-O platform -#define HIDE_SYMBOL(name) ".private_extern _" #name -#elif PLATFORM(AIX) - // IBM's own file format -#define HIDE_SYMBOL(name) ".lglobl " #name -#elif PLATFORM(LINUX) || PLATFORM(FREEBSD) || PLATFORM(OPENBSD) || PLATFORM(SOLARIS) || (PLATFORM(HPUX) && PLATFORM(IA64)) || PLATFORM(SYMBIAN) || PLATFORM(NETBSD) - // ELF platform -#define HIDE_SYMBOL(name) ".hidden " #name -#else -#define HIDE_SYMBOL(name) -#endif - #if USE(JSVALUE32_64) #if COMPILER(GCC) && PLATFORM(X86) @@ -106,9 +93,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x58, JITStackFrame_ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x50, JITStackFrame_code_offset_matches_ctiTrampoline); asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushl %ebp" "\n" "movl %esp, %ebp" "\n" @@ -129,7 +114,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" #if !USE(JIT_STUB_ARGUMENT_VA_LIST) "movl %esp, %ecx" "\n" @@ -145,7 +129,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addl $0x3c, %esp" "\n" "popl %ebx" "\n" @@ -170,7 +153,6 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x80, JITStackFrame_code_ asm volatile ( ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushq %rbp" "\n" "movq %rsp, %rbp" "\n" @@ -197,7 +179,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "movq %rsp, %rdi" "\n" "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" @@ -213,7 +194,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addq $0x48, %rsp" "\n" "popq %rbx" "\n" @@ -235,7 +215,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" @@ -262,7 +241,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" @@ -368,9 +346,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x30, JITStackFrame_code_ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_stub_argument_space_matches_ctiTrampoline); asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushl %ebp" "\n" "movl %esp, %ebp" "\n" @@ -391,7 +367,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" #if !USE(JIT_STUB_ARGUMENT_VA_LIST) "movl %esp, %ecx" "\n" @@ -407,7 +382,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addl $0x1c, %esp" "\n" "popl %ebx" "\n" @@ -430,9 +404,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x48, JITStackFrame_code_ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x78, JITStackFrame_stub_argument_space_matches_ctiTrampoline); asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushq %rbp" "\n" "movq %rsp, %rbp" "\n" @@ -466,7 +438,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "movq %rsp, %rdi" "\n" "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" @@ -482,7 +453,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addq $0x78, %rsp" "\n" "popq %rbx" "\n" @@ -504,7 +474,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" @@ -531,7 +500,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" @@ -549,7 +517,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" @@ -564,45 +531,31 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" #elif COMPILER(GCC) && PLATFORM(ARM_TRADITIONAL) asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "stmdb sp!, {r1-r3}" "\n" "stmdb sp!, {r4-r8, lr}" "\n" - "mov r6, pc" "\n" - "add r6, r6, #40" "\n" - "sub sp, sp, #32" "\n" - "ldr r4, [sp, #60]" "\n" + "sub sp, sp, #36" "\n" + "mov r4, r2" "\n" "mov r5, #512" "\n" - // r0 contains the code - "add r8, pc, #4" "\n" - "str r8, [sp, #-4]!" "\n" + "mov lr, pc" "\n" "mov pc, r0" "\n" - "add sp, sp, #32" "\n" + "add sp, sp, #36" "\n" "ldmia sp!, {r4-r8, lr}" "\n" "add sp, sp, #12" "\n" "mov pc, lr" "\n" - - // the return instruction - "ldr pc, [sp], #4" "\n" ); asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "mov r0, sp" "\n" - "mov lr, r6" "\n" - "add r8, pc, #4" "\n" - "str r8, [sp, #-4]!" "\n" - "b " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" + "bl " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" // Both has the same return sequence ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" - "add sp, sp, #32" "\n" + "add sp, sp, #36" "\n" "ldmia sp!, {r4-r8, lr}" "\n" "add sp, sp, #12" "\n" "mov pc, lr" "\n" @@ -935,7 +888,6 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD ".text" "\n" \ ".align 2" "\n" \ ".globl " SYMBOL_STRING(cti_##op) "\n" \ - HIDE_SYMBOL(cti_##op) "\n" \ ".thumb" "\n" \ ".thumb_func " THUMB_FUNC_PARAM(cti_##op) "\n" \ SYMBOL_STRING(cti_##op) ":" "\n" \ @@ -946,6 +898,22 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD ); \ rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) \ +#elif PLATFORM(ARM_TRADITIONAL) && COMPILER(GCC) + +#define DEFINE_STUB_FUNCTION(rtype, op) \ + extern "C" { \ + rtype JITStubThunked_##op(STUB_ARGS_DECLARATION); \ + }; \ + asm volatile ( \ + ".globl " SYMBOL_STRING(cti_##op) "\n" \ + SYMBOL_STRING(cti_##op) ":" "\n" \ + "str lr, [sp, #32]" "\n" \ + "bl " SYMBOL_STRING(JITStubThunked_##op) "\n" \ + "ldr lr, [sp, #32]" "\n" \ + "mov pc, lr" "\n" \ + ); \ + rtype JITStubThunked_##op(STUB_ARGS_DECLARATION) + #else #define DEFINE_STUB_FUNCTION(rtype, op) rtype JIT_STUB cti_##op(STUB_ARGS_DECLARATION) #endif diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h index ccbcd2a..69776cb 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.h @@ -163,6 +163,8 @@ namespace JSC { JITStubArg padding; // Unused JITStubArg args[7]; + ReturnAddressPtr thunkReturnAddress; + void* preservedR4; void* preservedR5; void* preservedR6; @@ -173,11 +175,13 @@ namespace JSC { RegisterFile* registerFile; CallFrame* callFrame; JSValue* exception; + + // These arguments passed on the stack. Profiler** enabledProfilerReference; JSGlobalData* globalData; // When JIT code makes a call, it pushes its return address just below the rest of the stack. - ReturnAddressPtr* returnAddressSlot() { return reinterpret_cast(this) - 1; } + ReturnAddressPtr* returnAddressSlot() { return &thunkReturnAddress; } }; #else #error "JITStackFrame not defined for this platform." diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp b/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp index b1e317e..45009dc 100644 --- a/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/parser/Nodes.cpp @@ -1477,6 +1477,7 @@ RegisterID* ForInNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds generator.emitNode(base.get(), m_expr); RefPtr i = generator.newTemporary(); RefPtr size = generator.newTemporary(); + RefPtr expectedSubscript; RefPtr iter = generator.emitGetPropertyNames(generator.newTemporary(), base.get(), i.get(), size.get(), scope->breakTarget()); generator.emitJump(scope->continueTarget()); @@ -1484,6 +1485,7 @@ RegisterID* ForInNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds generator.emitLabel(loopStart.get()); RegisterID* propertyName; + bool optimizedForinAccess = false; if (m_lexpr->isResolveNode()) { const Identifier& ident = static_cast(m_lexpr)->identifier(); propertyName = generator.registerFor(ident); @@ -1494,6 +1496,10 @@ RegisterID* ForInNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds generator.emitExpressionInfo(divot(), startOffset(), endOffset()); generator.emitPutById(base, ident, propertyName); + } else { + expectedSubscript = generator.emitMove(generator.newTemporary(), propertyName); + generator.pushOptimisedForIn(expectedSubscript.get(), iter.get(), i.get(), propertyName); + optimizedForinAccess = true; } } else if (m_lexpr->isDotAccessorNode()) { DotAccessorNode* assignNode = static_cast(m_lexpr); @@ -1518,6 +1524,9 @@ RegisterID* ForInNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds generator.emitNode(dst, m_statement); + if (optimizedForinAccess) + generator.popOptimisedForIn(); + generator.emitLabel(scope->continueTarget()); generator.emitNextPropertyName(propertyName, base.get(), i.get(), size.get(), iter.get(), loopStart.get()); generator.emitDebugHook(WillExecuteStatement, firstLine(), lastLine()); diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp index a69115c..b885049 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp @@ -240,9 +240,7 @@ void Heap::destroy() template NEVER_INLINE CollectorBlock* Heap::allocateBlock() { - // Disable the use of vm_map for the Qt build on Darwin, because when compiled on 10.4 - // it crashes on 10.5 -#if PLATFORM(DARWIN) && !PLATFORM(QT) +#if PLATFORM(DARWIN) vm_address_t address = 0; // FIXME: tag the region as a JavaScriptCore heap when we get a registered VM tag: . vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT); @@ -334,9 +332,7 @@ NEVER_INLINE void Heap::freeBlock(size_t block) NEVER_INLINE void Heap::freeBlock(CollectorBlock* block) { - // Disable the use of vm_deallocate for the Qt build on Darwin, because when compiled on 10.4 - // it crashes on 10.5 -#if PLATFORM(DARWIN) && !PLATFORM(QT) +#if PLATFORM(DARWIN) vm_deallocate(current_task(), reinterpret_cast(block), BLOCK_SIZE); #elif PLATFORM(SYMBIAN) userChunk->Free(reinterpret_cast(block)); @@ -1291,6 +1287,10 @@ static const char* typeName(JSCell* cell) #endif if (cell->isGetterSetter()) return "gettersetter"; + if (cell->isAPIValueWrapper()) + return "value wrapper"; + if (cell->isPropertyNameIterator()) + return "for-in iterator"; ASSERT(cell->isObject()); const ClassInfo* info = cell->classInfo(); return info ? info->className : "Object"; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/DateConstructor.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/DateConstructor.cpp index f9b7d84..9908fef 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/DateConstructor.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/DateConstructor.cpp @@ -112,9 +112,7 @@ JSObject* constructDate(ExecState* exec, const ArgList& args) } } - DateInstance* result = new (exec) DateInstance(exec->lexicalGlobalObject()->dateStructure()); - result->setInternalValue(jsNumber(exec, timeClip(value))); - return result; + return new (exec) DateInstance(exec, value); } static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.cpp index 4cd58f5..d4c9ef7 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.cpp @@ -32,95 +32,43 @@ using namespace WTF; namespace JSC { -struct DateInstance::Cache { - double m_gregorianDateTimeCachedForMS; - GregorianDateTime m_cachedGregorianDateTime; - double m_gregorianDateTimeUTCCachedForMS; - GregorianDateTime m_cachedGregorianDateTimeUTC; -}; - const ClassInfo DateInstance::info = {"Date", 0, 0, 0}; -DateInstance::DateInstance(NonNullPassRefPtr structure) +DateInstance::DateInstance(ExecState* exec, NonNullPassRefPtr structure) : JSWrapperObject(structure) - , m_cache(0) { + setInternalValue(jsNaN(exec)); } DateInstance::DateInstance(ExecState* exec, double time) : JSWrapperObject(exec->lexicalGlobalObject()->dateStructure()) - , m_cache(0) { setInternalValue(jsNumber(exec, timeClip(time))); } -DateInstance::~DateInstance() +bool DateInstance::getGregorianDateTime(ExecState* exec, bool outputIsUTC, GregorianDateTime& t) const { - delete m_cache; -} + double milli = internalNumber(); + if (isnan(milli)) + return false; -void DateInstance::msToGregorianDateTime(double milli, bool outputIsUTC, GregorianDateTime& t) const -{ - if (!m_cache) { - m_cache = new Cache; - m_cache->m_gregorianDateTimeCachedForMS = NaN; - m_cache->m_gregorianDateTimeUTCCachedForMS = NaN; - } + if (!m_data) + m_data = exec->globalData().dateInstanceCache.add(milli); if (outputIsUTC) { - if (m_cache->m_gregorianDateTimeUTCCachedForMS != milli) { - WTF::msToGregorianDateTime(milli, true, m_cache->m_cachedGregorianDateTimeUTC); - m_cache->m_gregorianDateTimeUTCCachedForMS = milli; + if (m_data->m_gregorianDateTimeUTCCachedForMS != milli) { + WTF::msToGregorianDateTime(internalNumber(), true, m_data->m_cachedGregorianDateTimeUTC); + m_data->m_gregorianDateTimeUTCCachedForMS = milli; } - t.copyFrom(m_cache->m_cachedGregorianDateTimeUTC); + t.copyFrom(m_data->m_cachedGregorianDateTimeUTC); } else { - if (m_cache->m_gregorianDateTimeCachedForMS != milli) { - WTF::msToGregorianDateTime(milli, false, m_cache->m_cachedGregorianDateTime); - m_cache->m_gregorianDateTimeCachedForMS = milli; + if (m_data->m_gregorianDateTimeCachedForMS != milli) { + WTF::msToGregorianDateTime(internalNumber(), false, m_data->m_cachedGregorianDateTime); + m_data->m_gregorianDateTimeCachedForMS = milli; } - t.copyFrom(m_cache->m_cachedGregorianDateTime); + t.copyFrom(m_data->m_cachedGregorianDateTime); } -} -bool DateInstance::getTime(GregorianDateTime& t, int& offset) const -{ - double milli = internalNumber(); - if (isnan(milli)) - return false; - - msToGregorianDateTime(milli, false, t); - offset = gmtoffset(t); - return true; -} - -bool DateInstance::getUTCTime(GregorianDateTime& t) const -{ - double milli = internalNumber(); - if (isnan(milli)) - return false; - - msToGregorianDateTime(milli, true, t); - return true; -} - -bool DateInstance::getTime(double& milli, int& offset) const -{ - milli = internalNumber(); - if (isnan(milli)) - return false; - - GregorianDateTime t; - msToGregorianDateTime(milli, false, t); - offset = gmtoffset(t); - return true; -} - -bool DateInstance::getUTCTime(double& milli) const -{ - milli = internalNumber(); - if (isnan(milli)) - return false; - return true; } diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.h b/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.h index 36d90b1..38b321c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstance.h @@ -32,27 +32,26 @@ namespace JSC { class DateInstance : public JSWrapperObject { public: DateInstance(ExecState*, double); - explicit DateInstance(NonNullPassRefPtr); - virtual ~DateInstance(); + explicit DateInstance(ExecState*, NonNullPassRefPtr); double internalNumber() const { return internalValue().uncheckedGetNumber(); } - bool getTime(WTF::GregorianDateTime&, int& offset) const; - bool getUTCTime(WTF::GregorianDateTime&) const; - bool getTime(double& milliseconds, int& offset) const; - bool getUTCTime(double& milliseconds) const; - static JS_EXPORTDATA const ClassInfo info; - void msToGregorianDateTime(double, bool outputIsUTC, WTF::GregorianDateTime&) const; + bool getGregorianDateTime(ExecState*, bool outputIsUTC, WTF::GregorianDateTime&) const; + + static PassRefPtr createStructure(JSValue prototype) + { + return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); + } + + protected: + static const unsigned StructureFlags = OverridesMarkChildren | JSWrapperObject::StructureFlags; private: virtual const ClassInfo* classInfo() const { return &info; } - using JSWrapperObject::internalValue; - - struct Cache; - mutable Cache* m_cache; + mutable RefPtr m_data; }; DateInstance* asDateInstance(JSValue); diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstanceCache.h b/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstanceCache.h new file mode 100644 index 0000000..b626c1d --- /dev/null +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/DateInstanceCache.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2009 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef DateInstanceCache_h +#define DateInstanceCache_h + +#include +#include +#include +#include + +namespace JSC { + + extern const double NaN; + + class DateInstanceData : public RefCounted { + public: + static PassRefPtr create() { return adoptRef(new DateInstanceData); } + + double m_gregorianDateTimeCachedForMS; + WTF::GregorianDateTime m_cachedGregorianDateTime; + double m_gregorianDateTimeUTCCachedForMS; + WTF::GregorianDateTime m_cachedGregorianDateTimeUTC; + + private: + DateInstanceData() + : m_gregorianDateTimeCachedForMS(NaN) + , m_gregorianDateTimeUTCCachedForMS(NaN) + { + } + }; + + class DateInstanceCache { + public: + DateInstanceCache() + { + for (size_t i = 0; i < cacheSize; ++i) + m_cache[i].key = NaN; + } + + DateInstanceData* add(double d) + { + CacheEntry& entry = lookup(d); + if (d == entry.key) + return entry.value.get(); + + entry.key = d; + entry.value = DateInstanceData::create(); + return entry.value.get(); + } + + private: + static const size_t cacheSize = 64; + + struct CacheEntry { + double key; + RefPtr value; + }; + + CacheEntry& lookup(double d) { return m_cache[WTF::FloatHash::hash(d) & (cacheSize - 1)]; } + + CacheEntry m_cache[cacheSize]; + }; + +} // namespace JSC + +#endif // DateInstanceCache_h diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.cpp index e46ab67..3f3e1f9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.cpp @@ -251,11 +251,12 @@ static JSCell* formatLocaleDate(ExecState* exec, const GregorianDateTime& gdt, L return jsNontrivialString(exec, timebuffer); } -static JSCell* formatLocaleDate(ExecState* exec, DateInstance* dateObject, double timeInMilliseconds, LocaleDateTimeFormat format, const ArgList&) +static JSCell* formatLocaleDate(ExecState* exec, DateInstance* dateObject, double, LocaleDateTimeFormat format, const ArgList&) { GregorianDateTime gregorianDateTime; - const bool notUTC = false; - dateObject->msToGregorianDateTime(timeInMilliseconds, notUTC, gregorianDateTime); + const bool outputIsUTC = false; + if (!dateObject->getGregorianDateTime(exec, outputIsUTC, gregorianDateTime)) + return jsNontrivialString(exec, "Invalid Date"); return formatLocaleDate(exec, gregorianDateTime, format); } @@ -396,9 +397,8 @@ const ClassInfo DatePrototype::info = {"Date", &DateInstance::info, 0, ExecState // ECMA 15.9.4 DatePrototype::DatePrototype(ExecState* exec, NonNullPassRefPtr structure) - : DateInstance(structure) + : DateInstance(exec, structure) { - setInternalValue(jsNaN(exec)); // The constructor will be added later, after DateConstructor has been built. } @@ -420,16 +420,14 @@ JSValue JSC_HOST_CALL dateProtoFuncToString(ExecState* exec, JSObject*, JSValue if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); - return jsNontrivialString(exec, formatDate(t) + " " + formatTime(t, utc)); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNontrivialString(exec, "Invalid Date"); + return jsNontrivialString(exec, formatDate(t) + " " + formatTime(t, outputIsUTC)); } JSValue JSC_HOST_CALL dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) @@ -437,16 +435,14 @@ JSValue JSC_HOST_CALL dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSVal if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); - return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, utc)); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNontrivialString(exec, "Invalid Date"); + return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, outputIsUTC)); } JSValue JSC_HOST_CALL dateProtoFuncToISOString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) @@ -454,19 +450,17 @@ JSValue JSC_HOST_CALL dateProtoFuncToISOString(ExecState* exec, JSObject*, JSVal if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (!isfinite(milli)) - return jsNontrivialString(exec, "Invalid Date"); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNontrivialString(exec, "Invalid Date"); // Maximum amount of space we need in buffer: 6 (max. digits in year) + 2 * 5 (2 characters each for month, day, hour, minute, second) + 4 (. + 3 digits for milliseconds) // 6 for formatting and one for null termination = 27. We add one extra character to allow us to force null termination. char buffer[28]; - snprintf(buffer, sizeof(buffer) - 1, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", 1900 + t.year, t.month + 1, t.monthDay, t.hour, t.minute, t.second, static_cast(fmod(milli, 1000))); + snprintf(buffer, sizeof(buffer) - 1, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", 1900 + t.year, t.month + 1, t.monthDay, t.hour, t.minute, t.second, static_cast(fmod(thisDateObj->internalNumber(), 1000))); buffer[sizeof(buffer) - 1] = 0; return jsNontrivialString(exec, buffer); } @@ -476,15 +470,13 @@ JSValue JSC_HOST_CALL dateProtoFuncToDateString(ExecState* exec, JSObject*, JSVa if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNontrivialString(exec, "Invalid Date"); return jsNontrivialString(exec, formatDate(t)); } @@ -493,16 +485,14 @@ JSValue JSC_HOST_CALL dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSVa if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); - return jsNontrivialString(exec, formatTime(t, utc)); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNontrivialString(exec, "Invalid Date"); + return jsNontrivialString(exec, formatTime(t, outputIsUTC)); } JSValue JSC_HOST_CALL dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) @@ -511,11 +501,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JS return throwError(exec, TypeError); DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); - - return formatLocaleDate(exec, thisDateObj, milli, LocaleDateAndTime, args); + return formatLocaleDate(exec, thisDateObj, thisDateObj->internalNumber(), LocaleDateAndTime, args); } JSValue JSC_HOST_CALL dateProtoFuncToLocaleDateString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) @@ -524,11 +510,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToLocaleDateString(ExecState* exec, JSObject* return throwError(exec, TypeError); DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); - - return formatLocaleDate(exec, thisDateObj, milli, LocaleDate, args); + return formatLocaleDate(exec, thisDateObj, thisDateObj->internalNumber(), LocaleDate, args); } JSValue JSC_HOST_CALL dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) @@ -537,11 +519,7 @@ JSValue JSC_HOST_CALL dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject* return throwError(exec, TypeError); DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); - - return formatLocaleDate(exec, thisDateObj, milli, LocaleTime, args); + return formatLocaleDate(exec, thisDateObj, thisDateObj->internalNumber(), LocaleTime, args); } JSValue JSC_HOST_CALL dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) @@ -549,12 +527,7 @@ JSValue JSC_HOST_CALL dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValue t if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); - - return jsNumber(exec, milli); + return asDateInstance(thisValue)->internalValue(); } JSValue JSC_HOST_CALL dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) @@ -562,15 +535,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSVal if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, 1900 + t.year); } @@ -579,15 +550,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JS if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, 1900 + t.year); } @@ -596,16 +565,14 @@ JSValue JSC_HOST_CALL dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSVal if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNontrivialString(exec, "Invalid Date"); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); - return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, utc)); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNontrivialString(exec, "Invalid Date"); + return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, outputIsUTC)); } JSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue thisValue, const ArgList&) @@ -613,15 +580,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.month); } @@ -630,15 +595,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSVal if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.month); } @@ -647,15 +610,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValue t if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.monthDay); } @@ -664,15 +625,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValu if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.monthDay); } @@ -681,15 +640,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValue th if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.weekDay); } @@ -698,15 +655,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValue if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.weekDay); } @@ -715,15 +670,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValue if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.hour); } @@ -732,15 +685,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSVal if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.hour); } @@ -749,15 +700,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValu if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.minute); } @@ -766,15 +715,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSV if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.minute); } @@ -783,15 +730,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValu if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.second); } @@ -800,15 +745,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSV if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = true; + const bool outputIsUTC = true; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, t.second); } @@ -847,15 +790,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*, if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); return jsNumber(exec, -gmtoffset(t) / minutesPerHour); } @@ -890,7 +831,7 @@ static JSValue setNewValueFromTimeArgs(ExecState* exec, JSValue thisValue, const double ms = milli - secs * msPerSecond; GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, inputIsUTC, t); + thisDateObj->getGregorianDateTime(exec, inputIsUTC, t); if (!fillStructuresUsingTimeArgs(exec, args, numArgsToUse, &ms, &t)) { JSValue result = jsNaN(exec); @@ -922,11 +863,11 @@ static JSValue setNewValueFromDateArgs(ExecState* exec, JSValue thisValue, const if (numArgsToUse == 3 && isnan(milli)) // Based on ECMA 262 15.9.5.40 - .41 (set[UTC]FullYear) // the time must be reset to +0 if it is NaN. - thisDateObj->msToGregorianDateTime(0, true, t); + WTF::msToGregorianDateTime(0, true, t); else { double secs = floor(milli / msPerSecond); ms = milli - secs * msPerSecond; - thisDateObj->msToGregorianDateTime(milli, inputIsUTC, t); + thisDateObj->getGregorianDateTime(exec, inputIsUTC, t); } if (!fillStructuresUsingDateArgs(exec, args, numArgsToUse, &ms, &t)) { @@ -1029,7 +970,7 @@ JSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue t if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); if (args.isEmpty()) { @@ -1045,11 +986,11 @@ JSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue t if (isnan(milli)) // Based on ECMA 262 B.2.5 (setYear) // the time must be reset to +0 if it is NaN. - thisDateObj->msToGregorianDateTime(0, true, t); + WTF::msToGregorianDateTime(0, true, t); else { double secs = floor(milli / msPerSecond); ms = milli - secs * msPerSecond; - thisDateObj->msToGregorianDateTime(milli, utc, t); + thisDateObj->getGregorianDateTime(exec, outputIsUTC, t); } bool ok = true; @@ -1061,7 +1002,7 @@ JSValue JSC_HOST_CALL dateProtoFuncSetYear(ExecState* exec, JSObject*, JSValue t } t.year = (year > 99 || year < 0) ? year - 1900 : year; - JSValue result = jsNumber(exec, gregorianDateTimeToMS(t, ms, utc)); + JSValue result = jsNumber(exec, gregorianDateTimeToMS(t, ms, outputIsUTC)); thisDateObj->setInternalValue(result); return result; } @@ -1071,15 +1012,13 @@ JSValue JSC_HOST_CALL dateProtoFuncGetYear(ExecState* exec, JSObject*, JSValue t if (!thisValue.inherits(&DateInstance::info)) return throwError(exec, TypeError); - const bool utc = false; + const bool outputIsUTC = false; DateInstance* thisDateObj = asDateInstance(thisValue); - double milli = thisDateObj->internalNumber(); - if (isnan(milli)) - return jsNaN(exec); GregorianDateTime t; - thisDateObj->msToGregorianDateTime(milli, utc, t); + if (!thisDateObj->getGregorianDateTime(exec, outputIsUTC, t)) + return jsNaN(exec); // NOTE: IE returns the full year even in getYear. return jsNumber(exec, t.year); diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.h b/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.h index 5fe4f47..f565775 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/DatePrototype.h @@ -43,7 +43,7 @@ namespace JSC { } protected: - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | DateInstance::StructureFlags; + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | DateInstance::StructureFlags; }; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSCell.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSCell.h index 16a5131..722ae33 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSCell.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSCell.h @@ -59,6 +59,7 @@ namespace JSC { virtual bool isGetterSetter() const; bool inherits(const ClassInfo*) const; virtual bool isAPIValueWrapper() const { return false; } + virtual bool isPropertyNameIterator() const { return false; } Structure* structure() const; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.h index b4356c4..fcac9aa 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSFunction.h @@ -66,7 +66,7 @@ namespace JSC { NativeFunction nativeFunction() { - return *reinterpret_cast(m_data); + return *WTF::bitwise_cast(m_data); } virtual ConstructType getConstructData(ConstructData&); @@ -97,7 +97,7 @@ namespace JSC { ScopeChain& scopeChain() { ASSERT(!isHostFunctionNonInline()); - return *reinterpret_cast(m_data); + return *WTF::bitwise_cast(m_data); } void clearScopeChain() { @@ -112,11 +112,11 @@ namespace JSC { void setScopeChain(const ScopeChain& sc) { ASSERT(!isHostFunctionNonInline()); - *reinterpret_cast(m_data) = sc; + *WTF::bitwise_cast(m_data) = sc; } void setNativeFunction(NativeFunction func) { - *reinterpret_cast(m_data) = func; + *WTF::bitwise_cast(m_data) = func; } unsigned char m_data[sizeof(void*)]; }; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalData.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalData.h index 3ad90ad..d2aa2da 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalData.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalData.h @@ -30,6 +30,7 @@ #define JSGlobalData_h #include "Collector.h" +#include "DateInstanceCache.h" #include "ExecutableAllocator.h" #include "JITStubs.h" #include "JSValue.h" @@ -116,7 +117,8 @@ namespace JSC { const MarkedArgumentBuffer* emptyList; // Lists are supposed to be allocated on the stack to have their elements properly marked, which is not the case here - but this list has nothing to mark. SmallStrings smallStrings; NumericStrings numericStrings; - + DateInstanceCache dateInstanceCache; + #if ENABLE(ASSEMBLER) ExecutableAllocator executableAllocator; #endif diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h index 1dbab94..5a89c40 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h @@ -202,8 +202,8 @@ namespace JSC { void allocatePropertyStorageInline(size_t oldSize, size_t newSize); bool isUsingInlineStorage() const { return m_structure->isUsingInlineStorage(); } - static const size_t inlineStorageCapacity = sizeof(EncodedJSValue) == 2 * sizeof(void*) ? 4 : 3; - static const size_t nonInlineBaseStorageCapacity = 16; + static const unsigned inlineStorageCapacity = sizeof(EncodedJSValue) == 2 * sizeof(void*) ? 4 : 3; + static const unsigned nonInlineBaseStorageCapacity = 16; static PassRefPtr createStructure(JSValue prototype) { diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.cpp index 2cd9f75..6fd0344 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.cpp @@ -43,7 +43,12 @@ JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, JSObject PropertyNameArray propertyNames(exec); o->getPropertyNames(exec, propertyNames); - JSPropertyNameIterator* jsPropertyNameIterator = new (exec) JSPropertyNameIterator(exec, propertyNames.data()); + size_t numCacheableSlots = 0; + if (!o->structure()->hasNonEnumerableProperties() && !o->structure()->hasAnonymousSlots() && + !o->structure()->isUncacheableDictionary() && !o->structure()->typeInfo().overridesGetPropertyNames()) + numCacheableSlots = o->structure()->propertyStorageSize(); + + JSPropertyNameIterator* jsPropertyNameIterator = new (exec) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots); if (o->structure()->isDictionary()) return jsPropertyNameIterator; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.h index 0559e0b..529ae8b 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSPropertyNameIterator.h @@ -50,8 +50,18 @@ namespace JSC { return Structure::create(prototype, TypeInfo(CompoundType, OverridesMarkChildren)); } + virtual bool isPropertyNameIterator() const { return true; } + virtual void markChildren(MarkStack&); + bool getOffset(size_t i, int& offset) + { + if (i >= m_numCacheableSlots) + return false; + offset = i; + return true; + } + JSValue get(ExecState*, JSObject*, size_t i); size_t size() { return m_jsStringsSize; } @@ -62,17 +72,19 @@ namespace JSC { StructureChain* cachedPrototypeChain() { return m_cachedPrototypeChain.get(); } private: - JSPropertyNameIterator(ExecState*, PropertyNameArrayData* propertyNameArrayData); + JSPropertyNameIterator(ExecState*, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlot); Structure* m_cachedStructure; RefPtr m_cachedPrototypeChain; - size_t m_jsStringsSize; + uint32_t m_numCacheableSlots; + uint32_t m_jsStringsSize; OwnArrayPtr m_jsStrings; }; -inline JSPropertyNameIterator::JSPropertyNameIterator(ExecState* exec, PropertyNameArrayData* propertyNameArrayData) +inline JSPropertyNameIterator::JSPropertyNameIterator(ExecState* exec, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlots) : JSCell(exec->globalData().propertyNameIteratorStructure.get()) , m_cachedStructure(0) + , m_numCacheableSlots(numCacheableSlots) , m_jsStringsSize(propertyNameArrayData->propertyNameVector().size()) , m_jsStrings(new JSValue[m_jsStringsSize]) { diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp index a11050f..65b62f9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.cpp @@ -375,6 +375,7 @@ PassRefPtr Structure::addPropertyTransition(Structure* structure, con transition->m_specificValueInPrevious = specificValue; transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity; transition->m_hasGetterSetterProperties = structure->m_hasGetterSetterProperties; + transition->m_hasNonEnumerableProperties = structure->m_hasNonEnumerableProperties; if (structure->m_propertyTable) { if (structure->m_isPinnedPropertyTable) @@ -417,6 +418,7 @@ PassRefPtr Structure::changePrototypeTransition(Structure* structure, transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity; transition->m_hasGetterSetterProperties = structure->m_hasGetterSetterProperties; + transition->m_hasNonEnumerableProperties = structure->m_hasNonEnumerableProperties; // Don't set m_offset, as one can not transition to this. @@ -433,6 +435,7 @@ PassRefPtr Structure::despecifyFunctionTransition(Structure* structur transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity; transition->m_hasGetterSetterProperties = structure->m_hasGetterSetterProperties; + transition->m_hasNonEnumerableProperties = structure->m_hasNonEnumerableProperties; // Don't set m_offset, as one can not transition to this. @@ -464,6 +467,7 @@ PassRefPtr Structure::addAnonymousSlotsTransition(Structure* structur transition->m_specificValueInPrevious = 0; transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity; transition->m_hasGetterSetterProperties = structure->m_hasGetterSetterProperties; + transition->m_hasNonEnumerableProperties = structure->m_hasNonEnumerableProperties; if (structure->m_propertyTable) { if (structure->m_isPinnedPropertyTable) @@ -492,6 +496,7 @@ PassRefPtr Structure::getterSetterTransition(Structure* structure) RefPtr transition = create(structure->storedPrototype(), structure->typeInfo()); transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity; transition->m_hasGetterSetterProperties = transition->m_hasGetterSetterProperties; + transition->m_hasNonEnumerableProperties = structure->m_hasNonEnumerableProperties; // Don't set m_offset, as one can not transition to this. @@ -510,6 +515,7 @@ PassRefPtr Structure::toDictionaryTransition(Structure* structure, Di transition->m_dictionaryKind = kind; transition->m_propertyStorageCapacity = structure->m_propertyStorageCapacity; transition->m_hasGetterSetterProperties = structure->m_hasGetterSetterProperties; + transition->m_hasNonEnumerableProperties = structure->m_hasNonEnumerableProperties; structure->materializePropertyMapIfNecessary(); transition->m_propertyTable = structure->copyPropertyTable(); @@ -550,6 +556,9 @@ size_t Structure::addPropertyWithoutTransition(const Identifier& propertyName, u materializePropertyMapIfNecessary(); m_isPinnedPropertyTable = true; + if (attributes & DontEnum) + m_hasNonEnumerableProperties = true; + size_t offset = put(propertyName, attributes, specificValue); if (propertyStorageSize() > propertyStorageCapacity()) growPropertyStorageCapacity(); diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h index 2496c1b..f355c53 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h @@ -95,8 +95,8 @@ namespace JSC { Structure* previousID() const { return m_previous.get(); } void growPropertyStorageCapacity(); - size_t propertyStorageCapacity() const { return m_propertyStorageCapacity; } - size_t propertyStorageSize() const { return m_propertyTable ? m_propertyTable->keyCount + m_propertyTable->anonymousSlotCount + (m_propertyTable->deletedOffsets ? m_propertyTable->deletedOffsets->size() : 0) : m_offset + 1; } + unsigned propertyStorageCapacity() const { return m_propertyStorageCapacity; } + unsigned propertyStorageSize() const { return m_propertyTable ? m_propertyTable->keyCount + m_propertyTable->anonymousSlotCount + (m_propertyTable->deletedOffsets ? m_propertyTable->deletedOffsets->size() : 0) : m_offset + 1; } bool isUsingInlineStorage() const; size_t get(const Identifier& propertyName); @@ -119,6 +119,10 @@ namespace JSC { bool hasGetterSetterProperties() const { return m_hasGetterSetterProperties; } void setHasGetterSetterProperties(bool hasGetterSetterProperties) { m_hasGetterSetterProperties = hasGetterSetterProperties; } + bool hasNonEnumerableProperties() const { return m_hasNonEnumerableProperties; } + + bool hasAnonymousSlots() const { return m_propertyTable && m_propertyTable->anonymousSlotCount; } + bool isEmpty() const { return m_propertyTable ? !m_propertyTable->keyCount : m_offset == noOffset; } JSCell* specificValue() { return m_specificValueInPrevious; } @@ -190,12 +194,13 @@ namespace JSC { PropertyMapHashTable* m_propertyTable; - size_t m_propertyStorageCapacity; + uint32_t m_propertyStorageCapacity; signed char m_offset; unsigned m_dictionaryKind : 2; bool m_isPinnedPropertyTable : 1; bool m_hasGetterSetterProperties : 1; + bool m_hasNonEnumerableProperties : 1; #if COMPILER(WINSCW) // Workaround for Symbian WINSCW compiler that cannot resolve unsigned type of the declared // bitfield, when used as argument in make_pair() function calls in structure.ccp. diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/CurrentTime.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/CurrentTime.cpp index a3d5290..b36cae5 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/CurrentTime.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/CurrentTime.cpp @@ -63,6 +63,10 @@ extern "C" time_t mktime(struct tm *t); #include #endif +#if PLATFORM(CHROMIUM) +#error Chromium uses a different timer implementation +#endif + namespace WTF { const double msPerSecond = 1000.0; diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp index 0386494..2110432 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp @@ -501,13 +501,13 @@ double gregorianDateTimeToMS(const GregorianDateTime& t, double milliSeconds, bo return result; } +// input is UTC void msToGregorianDateTime(double ms, bool outputIsUTC, GregorianDateTime& tm) { - // input is UTC double dstOff = 0.0; - const double utcOff = getUTCOffset(); - - if (!outputIsUTC) { // convert to local time + double utcOff = 0.0; + if (!outputIsUTC) { + utcOff = getUTCOffset(); dstOff = getDSTOffset(ms, utcOff); ms += dstOff + utcOff; } @@ -522,8 +522,7 @@ void msToGregorianDateTime(double ms, bool outputIsUTC, GregorianDateTime& tm) tm.month = monthFromDayInYear(tm.yearDay, isLeapYear(year)); tm.year = year - 1900; tm.isDST = dstOff != 0.0; - - tm.utcOffset = outputIsUTC ? 0 : static_cast((dstOff + utcOff) / msPerSecond); + tm.utcOffset = static_cast((dstOff + utcOff) / msPerSecond); tm.timeZone = NULL; } diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/FastMalloc.h b/src/3rdparty/webkit/JavaScriptCore/wtf/FastMalloc.h index ca0961c..541b05d 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/FastMalloc.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/FastMalloc.h @@ -26,13 +26,19 @@ #include #include +#if COMPILER(GCC) +#define WTF_FAST_MALLOC_EXPORT __attribute__((visibility("default"))) +#else +#define WTF_FAST_MALLOC_EXPORT +#endif + namespace WTF { // These functions call CRASH() if an allocation fails. - void* fastMalloc(size_t); + void* fastMalloc(size_t) WTF_FAST_MALLOC_EXPORT; void* fastZeroedMalloc(size_t); - void* fastCalloc(size_t numElements, size_t elementSize); - void* fastRealloc(void*, size_t); + void* fastCalloc(size_t numElements, size_t elementSize) WTF_FAST_MALLOC_EXPORT; + void* fastRealloc(void*, size_t) WTF_FAST_MALLOC_EXPORT; struct TryMallocReturnValue { TryMallocReturnValue(void* data) @@ -71,7 +77,7 @@ namespace WTF { TryMallocReturnValue tryFastCalloc(size_t n_elements, size_t element_size); TryMallocReturnValue tryFastRealloc(void* p, size_t n); - void fastFree(void*); + void fastFree(void*) WTF_FAST_MALLOC_EXPORT; #ifndef NDEBUG void fastMallocForbid(); diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h b/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h index 12291cc..9c9a4a7 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/MessageQueue.h @@ -55,9 +55,13 @@ namespace WTF { bool waitForMessage(DataType&); template MessageQueueWaitResult waitForMessageFilteredWithTimeout(DataType&, Predicate&, double absoluteTime); - void kill(); + + template + void removeIf(Predicate&); bool tryGetMessage(DataType&); + + void kill(); bool killed() const; // The result of isEmpty() is only valid if no other thread is manipulating the queue at the same time. @@ -149,6 +153,17 @@ namespace WTF { } template + template + inline void MessageQueue::removeIf(Predicate& predicate) + { + MutexLocker lock(m_mutex); + DequeConstIterator found = m_queue.end(); + while ((found = m_queue.findIf(predicate)) != m_queue.end()) { + m_queue.remove(found); + } + } + + template inline bool MessageQueue::isEmpty() { MutexLocker lock(m_mutex); diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h index 7151b514..7632435 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h @@ -466,6 +466,7 @@ #if PLATFORM(MAC) && !PLATFORM(IPHONE) #define WTF_PLATFORM_CF 1 #define WTF_USE_PTHREADS 1 +#define HAVE_PTHREAD_RWLOCK 1 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && defined(__x86_64__) #define WTF_USE_PLUGIN_HOST_PROCESS 1 #endif @@ -482,6 +483,7 @@ #if PLATFORM(CHROMIUM) && PLATFORM(DARWIN) #define WTF_PLATFORM_CF 1 #define WTF_USE_PTHREADS 1 +#define HAVE_PTHREAD_RWLOCK 1 #endif #if PLATFORM(IPHONE) @@ -498,6 +500,7 @@ #define HAVE_READLINE 1 #define WTF_PLATFORM_CF 1 #define WTF_USE_PTHREADS 1 +#define HAVE_PTHREAD_RWLOCK 1 #endif #if PLATFORM(WIN) @@ -511,6 +514,7 @@ #if PLATFORM(GTK) #if HAVE(PTHREAD_H) #define WTF_USE_PTHREADS 1 +#define HAVE_PTHREAD_RWLOCK 1 #endif #endif @@ -518,6 +522,7 @@ #define HAVE_POSIX_MEMALIGN 1 #define WTF_USE_CURL 1 #define WTF_USE_PTHREADS 1 +#define HAVE_PTHREAD_RWLOCK 1 #define USE_SYSTEM_MALLOC 1 #define ENABLE_NETSCAPE_PLUGIN_API 0 #endif @@ -698,7 +703,7 @@ #endif #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) -#if PLATFORM(X86_64) && (PLATFORM(DARWIN) || PLATFORM(LINUX)) +#if PLATFORM(X86_64) && (PLATFORM(DARWIN) || PLATFORM(LINUX) || PLATFORM(WIN_OS)) #define WTF_USE_JSVALUE64 1 #elif PLATFORM(ARM) || PLATFORM(PPC64) #define WTF_USE_JSVALUE32 1 @@ -725,8 +730,7 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ #define ENABLE_JIT 1 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 #elif PLATFORM(ARM_THUMB2) && PLATFORM(IPHONE) - /* Under development, temporarily disabled until 16Mb link range limit in assembler is fixed. */ - #define ENABLE_JIT 0 + #define ENABLE_JIT 1 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0 /* The JIT is tested & working on x86 Windows */ #elif PLATFORM(X86) && PLATFORM(WIN) @@ -792,8 +796,7 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */ #if (PLATFORM(X86) && PLATFORM(MAC)) \ || (PLATFORM(X86_64) && PLATFORM(MAC)) \ - /* Under development, temporarily disabled until 16Mb link range limit in assembler is fixed. */ \ - || (PLATFORM(ARM_THUMB2) && PLATFORM(IPHONE) && 0) \ + || (PLATFORM(ARM_THUMB2) && PLATFORM(IPHONE)) \ || (PLATFORM(X86) && PLATFORM(WIN)) #define ENABLE_YARR 1 #define ENABLE_YARR_JIT 1 diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/StdLibExtras.h b/src/3rdparty/webkit/JavaScriptCore/wtf/StdLibExtras.h index d21d1ff..c9b5742 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/StdLibExtras.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/StdLibExtras.h @@ -32,6 +32,7 @@ // Use these to declare and define a static local variable (static T;) so that // it is leaked so that its destructors are not called at exit. Using this // macro also allows workarounds a compiler bug present in Apple's version of GCC 4.0.1. +#ifndef DEFINE_STATIC_LOCAL #if COMPILER(GCC) && defined(__APPLE_CC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 1 #define DEFINE_STATIC_LOCAL(type, name, arguments) \ static type* name##Ptr = new type arguments; \ @@ -40,6 +41,7 @@ #define DEFINE_STATIC_LOCAL(type, name, arguments) \ static type& name = *new type arguments #endif +#endif // OBJECT_OFFSETOF: Like the C++ offsetof macro, but you can use it with classes. // The magic number 0x4000 is insignificant. We use it to avoid using NULL, since diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.cpp index 56bf438..1d4185c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.cpp @@ -51,7 +51,7 @@ static void* threadEntryPoint(void* contextData) setThreadNameInternal(context->name); - // Block until our creating thread has completed any extra setup work + // Block until our creating thread has completed any extra setup work. { MutexLocker locker(context->creationMutex); } diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h index 5154545..71c9402 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Threading.h @@ -128,7 +128,11 @@ void detachThread(ThreadIdentifier); #if USE(PTHREADS) typedef pthread_mutex_t PlatformMutex; +#if HAVE(PTHREAD_RWLOCK) typedef pthread_rwlock_t PlatformReadWriteLock; +#else +typedef void* PlatformReadWriteLock; +#endif typedef pthread_cond_t PlatformCondition; #elif PLATFORM(GTK) typedef GOwnPtr PlatformMutex; diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingPthreads.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingPthreads.cpp index e4fb419..6cad5e3 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingPthreads.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingPthreads.cpp @@ -167,6 +167,7 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con if (pthread_create(&threadHandle, 0, runThreadWithRegistration, static_cast(threadData))) { LOG_ERROR("Failed to create pthread at entry point %p with data %p", entryPoint, data); + delete threadData; return 0; } return establishIdentifierForPthreadHandle(threadHandle); @@ -270,7 +271,7 @@ void Mutex::unlock() ASSERT_UNUSED(result, !result); } - +#if HAVE(PTHREAD_RWLOCK) ReadWriteLock::ReadWriteLock() { pthread_rwlock_init(&m_readWriteLock, NULL); @@ -324,6 +325,7 @@ void ReadWriteLock::unlock() int result = pthread_rwlock_unlock(&m_readWriteLock); ASSERT_UNUSED(result, !result); } +#endif // HAVE(PTHREAD_RWLOCK) ThreadCondition::ThreadCondition() { diff --git a/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp index aafea3c..d088086 100644 --- a/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/yarr/RegexInterpreter.cpp @@ -1490,7 +1490,7 @@ public: closeBodyAlternative(); } - void alterantiveBodyDisjunction() + void alternativeBodyDisjunction() { int newAlternativeIndex = m_bodyDisjunction->terms.size(); m_bodyDisjunction->terms[m_currentAlternativeIndex].alternative.next = newAlternativeIndex - m_currentAlternativeIndex; @@ -1499,7 +1499,7 @@ public: m_currentAlternativeIndex = newAlternativeIndex; } - void alterantiveDisjunction() + void alternativeDisjunction() { int newAlternativeIndex = m_bodyDisjunction->terms.size(); m_bodyDisjunction->terms[m_currentAlternativeIndex].alternative.next = newAlternativeIndex - m_currentAlternativeIndex; @@ -1515,9 +1515,9 @@ public: if (alt) { if (disjunction == m_pattern.m_body) - alterantiveBodyDisjunction(); + alternativeBodyDisjunction(); else - alterantiveDisjunction(); + alternativeDisjunction(); } PatternAlternative* alternative = disjunction->m_alternatives[alt]; diff --git a/src/3rdparty/webkit/JavaScriptCore/yarr/RegexJIT.cpp b/src/3rdparty/webkit/JavaScriptCore/yarr/RegexJIT.cpp index b635a45..5ce579a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/yarr/RegexJIT.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/yarr/RegexJIT.cpp @@ -1264,7 +1264,7 @@ class RegexGenerator : private MacroAssembler { // complex here in compilation, and in the common case we should end up coallescing the checks. // // FIXME: a nice improvement here may be to stop trying to match sooner, based on the least - // of the minimum-alterantive-lengths. E.g. if I have two alternatives of length 200 and 150, + // of the minimum-alternative-lengths. E.g. if I have two alternatives of length 200 and 150, // and a string of length 100, we'll end up looping index from 0 to 100, checking whether there // is sufficient input to run either alternative (constantly failing). If there had been only // one alternative, or if the shorter alternative had come first, we would have terminated @@ -1309,9 +1309,6 @@ class RegexGenerator : private MacroAssembler { loadPtr(Address(X86Registers::ebp, 2 * sizeof(void*)), output); #endif #elif PLATFORM(ARM) -#if PLATFORM(ARM_TRADITIONAL) - push(ARMRegisters::lr); -#endif push(ARMRegisters::r4); push(ARMRegisters::r5); push(ARMRegisters::r6); diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 488c6a0..98f007c 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,8 +4,8 @@ This is a snapshot of the Qt port of WebKit from The commit imported was from the - qtwebkit-4.6-snapshot-22102009 branch/tag + qtwebkit-4.6-snapshot-20091003 branch/tag and has the sha1 checksum - 0639bb8e812c8923287cd5523248ca64fa5f7a50 + 8f810287200d21aded375664cc0a6ac0476dbdea diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 4e5dff8..2b36014 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,4260 @@ +2009-11-02 Tor Arne Vestbø + + Rubber-stamped by Antti Koivisto. + + [Qt] Build fix for Windows CE + + * plugins/PluginDatabase.cpp: + +2009-11-02 Jocelyn Turcotte + + Reviewed by Tor Arne Vestbø. + + [Qt] Fix Qt build on Windows. + https://bugs.webkit.org/show_bug.cgi?id=30905 + + * WebCore.pro: + * platform/graphics/BitmapImage.h: + * platform/graphics/qt/ImageQt.cpp: + (WebCore::BitmapImage::BitmapImage): + (WebCore::BitmapImage::create): + +2009-10-28 Adam Barth + + Reviewed by Eric Seidel. + + Don't run JavaScript URLs in view source mode + https://bugs.webkit.org/show_bug.cgi?id=30881 + + Just say no. + + Test: http/tests/security/view-source-no-javascript-url.html + + * bindings/ScriptControllerBase.cpp: + (WebCore::ScriptController::executeIfJavaScriptURL): + +2009-10-29 Gustavo Noronha Silva + + Unreviewed. Fixes style problems pointed out by Evan Martin. + + * platform/gtk/Language.cpp: + (WebCore::defaultLanguage): + +2009-10-29 Dan Bernstein + + Rubber-stamped by Mark Rowe. + + 64-bit Leopard build fix after r50259 + + * platform/graphics/mac/ComplexTextControllerATSUI.cpp: + Declared ATSUTextInserted in 64-bit. + (WebCore::fontHasMirroringInfo): Use %d format and cast to int. + (WebCore::disableLigatures): Ditto. + (WebCore::initializeATSUStyle): Ditto. + (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Ditto. + +2009-10-29 Dan Bernstein + + Tiger build fix after r50259 + + * platform/graphics/mac/ComplexTextController.h: + * platform/graphics/mac/ComplexTextControllerATSUI.cpp: + +2009-10-29 Dan Bernstein + + Attempted Tiger build fix after r50259 + + * platform/graphics/mac/ComplexTextControllerATSUI.cpp: + +2009-10-28 Steve Falkenburg + + Rubber stamped by Mark Rowe. + + https://bugs.webkit.org/show_bug.cgi?id=30899 + WebKit fails to build release on 32-bit Windows systems + + * WebCore.vcproj/WebCore.vcproj: Excluded files from project. + * bindings/js/JSBindingsAllInOne.cpp: Added. + +2009-10-28 Dan Bernstein + + Reviewed by Jon Honeycutt. + + Fixed typos in color names. + + * inspector/front-end/Color.js: + +2009-10-28 Dan Bernstein + + Reviewed by Sam Weinig. + + Share code between the ATSUI- and Core Text-based Font implementations by doing the + following: + - Generalize CoreTextController as ComplexTextController, keeping the Core Text-specific + parts in ComplexTextControllerCoreText.cpp. + - Generalize FontMacCoreText as FontComplexTextMac using ComplexTextController + - Implement ATSUI-specific parts of ComplexTextController in ComplexTextControllerATSUI. + - Remove FontMacATSUI. + + * WebCore.xcodeproj/project.pbxproj: Removed CoreTextController.{cpp,h}, FontMacATSUI.mm, + and FontMacCoreText.cpp, and added ComplexTextController.{cpp,h}, + ComplexTextControllerATSUI.cpp, ComplexTextControllerCoreText.cpp, and + FontComplexTextMac.cpp. + + * platform/graphics/mac/ComplexTextController.cpp: Copied from CoreTextController.cpp and + kept the non-Core Text-specific bits. + (WebCore::ComplexTextController::ComplexTextController): Updated for renames, including + its own. + (WebCore::ComplexTextController::offsetForPosition): Updated for renames and for + m_complexTextRuns holding references instead of objects. + (WebCore::ComplexTextController::collectComplexTextRuns): Updated for renames, including + its own. + (WebCore::ComplexTextController::advance): Updated for renames. + (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Updated for renames and for + m_complexTextRuns holding references instead of objects, and changed to use the glyphs() + and advances() accessors. + + * platform/graphics/mac/ComplexTextController.h: Copied from CoreTextController.h and + renamed CoreTextController to ComplexTextController and CoreTextRun to ComplexTextRun. Made + the latter RefCounted, added ATSUI-specific members to it, and made some other members + Core Text-specific. Renamed m_coreTextRuns to m_complexTextRuns and made it hold references + rather than objects. + (WebCore::ComplexTextController::ComplexTextRun::create): + (WebCore::ComplexTextController::ComplexTextRun::glyphs): + (WebCore::ComplexTextController::ComplexTextRun::advances): + + * platform/graphics/mac/ComplexTextControllerATSUI.cpp: Added. Includes ATSUI-specific + parts of the ComplexTextController implementation. + (WebCore::ComplexTextController::ComplexTextRun::overrideLayoutOperation): This ATSUI + callback populates the ComplexTextRun’s glyphs, advances and indices vectors. It is invoked + when the ComplexTextRun constructor calls ATSUGetGlyphBounds(). + (WebCore::isArabicLamWithAlefLigature): Helper function, copied from FontMacATSUI.mm. + (WebCore::shapeArabic): Helper function, adapted from FontMacATSUI.mm. + (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Sets up the + ATSUTextLayout, substituting the text buffer if necessary for things like shaping Arabic, + mirroring glyphs or directionality overrides, then calls ATSUGetGlyphBounds() in order to + get the glyphs, advances and indices vectors populated. + (WebCore::fontHasMirroringInfo): Helper function, copied from FontMacATSUI.mm. + (WebCore::disableLigatures): Ditto. + (WebCore::initializeATSUStyle): Ditto, somewhat cleaned up and simplified. + (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Constructs + ComplexTextRuns, either missing-glyphs ones or ATSUTextLayout-based ones. + + * platform/graphics/mac/ComplexTextControllerCoreText.cpp: Copied from + CoreTextController.cpp and kept the Core Text-specific bits. + (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Updated for renames, + including its own, and moved the code to initialize m_glyphs and m_advances here. Previously + this was done in adjustGlyphsAndAdvances(). + (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Updated for renames, + including its own. + * platform/graphics/mac/CoreTextController.cpp: Removed. + * platform/graphics/mac/CoreTextController.h: Removed. + * platform/graphics/mac/FontComplexTextMac.cpp: Renamed FontMacCoreText.cpp to this. + (WebCore::Font::selectionRectForComplexText): Changed to use ComplexTextController instead + of CoreTextController. + (WebCore::Font::drawComplexText): Ditto. + (WebCore::Font::floatWidthForComplexText): Ditto. + (WebCore::Font::offsetForPositionForComplexText): Ditto. + * platform/graphics/mac/FontMacATSUI.mm: Removed. + * platform/graphics/mac/FontMacCoreText.cpp: Removed. + +2009-10-27 Chris Fleizach + + Reviewed by Darin Adler. + + WAI-ARIA: add support for 'option' role + https://bugs.webkit.org/show_bug.cgi?id=30843 + + Test: accessibility/aria-option-role.html + + * accessibility/AccessibilityListBoxOption.h: + (WebCore::AccessibilityListBoxOption::canHaveChildren): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::RoleEntry::): + (WebCore::AccessibilityRenderObject::canHaveChildren): + +2009-10-28 Jens Alfke + + Reviewed by Eric Seidel. + + Fix GCC compiler warnings in WebCore, and enable -Wall and -Werror for Chromium build. + https://bugs.webkit.org/show_bug.cgi?id=30716 + + * WebCore.gyp/WebCore.gyp: Enable "chromium_code" flag, just on Mac build for now. + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::createARIARoleMap): Fix struct visibiity warning. + * bindings/v8/ScriptCallStack.h: Fix out-of-order member initialization warning. + * bindings/v8/V8Collection.h: + (WebCore::getV8Object): Function in header should not be 'static' (fixes unused-static warning.) + * bindings/v8/V8DOMWrapper.cpp: + (WebCore::V8DOMWrapper::convertNewNodeToV8Object): Fix signed/unsigned comparison warning. + * bindings/v8/V8GCController.cpp: + (WebCore::ObjectGrouperVisitor::applyGrouping): Fix unused-variable warning. + * css/CSSPrimitiveValueMappings.h: + (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Enable ListButtonPart case to avoid + warning about missing cases in 'switch' statement. + * editing/EditorCommand.cpp: + (WebCore::createCommandMap): Fix struct visibiity warning. + * platform/graphics/skia/PlatformContextSkia.cpp: + (PlatformContextSkia::State::State): Fix out-of-order member initialization warning. + * rendering/RenderMediaControlsChromium.cpp: + (WebCore::RenderMediaControlsChromium::shouldRenderMediaControlPart): Add empty 'default' case in + 'switch' statement to avoid missing-case warning. + (WebCore::RenderMediaControlsChromium::paintMediaControlsPart): Ditto. + * xml/XPathFunctions.cpp: + (WebCore::XPath::createFunctionMap): Fix struct visibiity warning. + +2009-10-29 Adam Barth + + Reviewed by Darin Adler. + + REGRESSION: crashes in WebCore::RedirectScheduler::timerFired(WebCore::Timer*) + https://bugs.webkit.org/show_bug.cgi?id=30839 + + Added null check for the case when the frame is detached from the page. + + * loader/RedirectScheduler.cpp: + (WebCore::RedirectScheduler::timerFired): + +2009-10-28 Joanmarie Diggs + + Reviewed by Xan Lopez. + + https://bugs.webkit.org/show_bug.cgi?id=30817 + Use parentObjectUnignored instead of parentObject in webkit_accessible_get_parent + + Also removes the hack I had originally added to solve bug 25411, because + the fix here is what I should have done in the first place. + + * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: + (webkit_accessible_get_parent): + +2009-10-28 Dmitry Titov + + Reviewed by David Levin. + + https://bugs.webkit.org/show_bug.cgi?id=30805 + Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue. + Existing Database tests cover this, no change in functionality. + + * storage/DatabaseThread.cpp: + (WebCore::SameDatabasePredicate::SameDatabasePredicate): Added predicate that flags the tasks belonging to a specified database. + (WebCore::SameDatabasePredicate::operator()): + (WebCore::DatabaseThread::unscheduleDatabaseTasks): changed to use the new removeIf method. + +2009-10-28 Pavel Feldman + + Reviewed by Timothy Hatcher. + + Web Inspector: Glue subsequent timeline records with same category + and title together. + + https://bugs.webkit.org/show_bug.cgi?id=30885 + + * English.lproj/localizedStrings.js: + * inspector/front-end/TimelinePanel.js: + (WebInspector.TimelinePanel.prototype.addRecordToTimeline): + (WebInspector.TimelinePanel.prototype._formatRecord): + (WebInspector.TimelineRecordTreeElement.prototype.onattach): + (WebInspector.TimelineRecordTreeElement.prototype.refresh): + +2009-10-28 Gustavo Noronha Silva + + Reviewed by Xan Lopez. + + [GTK] Fails new test fast/js/navigator-language.html + https://bugs.webkit.org/show_bug.cgi?id=30440 + + Reimplement WebCore::defaultLanguage to account for changes in + locale done by setLocale. + + Already existing test: fast/js/navigator-language.html + + * platform/gtk/Language.cpp: + (WebCore::defaultLanguage): + +2009-10-28 Eric Carlson + + Reviewed by Simon Fraser. + + + Can't exit full screen mode or restart movie after pressing command -R. + + * html/HTMLMediaElement.cpp: + (WebCore::HTMLMediaElement::removedFromDocument): + (WebCore::HTMLMediaElement::documentWillBecomeInactive): + Exit from fullscreen if necessary. + * html/HTMLMediaElement.h: + +2009-10-28 Alexey Proskuryakov + + Unreviewed - a trivial fix to get Windows bots running. + + https://bugs.webkit.org/show_bug.cgi?id=30841 + WebKit should not pass Referer header through a redirect to a non-secure site + + * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): Don't try to + access empty vector's data. + +2009-10-28 Joanmarie Diggs + + Reviewed by Xan Lopez. + + https://bugs.webkit.org/show_bug.cgi?id=25897 + [Gtk] Extraneous object of ROLE_PANEL in hierarchy for entries + + Remove the extraneous object of ROLE_PANEL. + + * accessibility/gtk/AccessibilityObjectAtk.cpp: + (AccessibilityObject::accessibilityPlatformIncludesObject): + +2009-10-28 Jonathan Dixon + + Reviewed by Eric Seidel. + + Bug 30547: (Chromium) searchbox not rendered properly due to the css property -webkit-border-radius + https://bugs.webkit.org/show_bug.cgi?id=30547 + + Test: fast/css/text-input-with-webkit-border-radius.html + + * rendering/RenderThemeChromiumWin.cpp: + (WebCore::RenderThemeChromiumWin::paintTextFieldInternal): + Implemented rounded border rendering in Chromium Windows theme renderer. + +2009-10-28 Pavel Feldman + + Reviewed by Timothy Hatcher. + + Web Inspector: Pull items collections from resources panel and + timeline panel into AbstractTimelinePanel. + + https://bugs.webkit.org/show_bug.cgi?id=30875 + + * inspector/front-end/AbstractTimelinePanel.js: + (WebInspector.AbstractTimelinePanel): + (WebInspector.AbstractTimelinePanel.prototype.populateSidebar): + (WebInspector.AbstractTimelinePanel.prototype.createItemTreeElement): + (WebInspector.AbstractTimelinePanel.prototype.createItemGraph): + (WebInspector.AbstractTimelinePanel.prototype._showCategory): + (WebInspector.AbstractTimelinePanel.prototype._hideCategory): + (WebInspector.AbstractTimelinePanel.prototype.filter): + (WebInspector.AbstractTimelinePanel.prototype._createGraph): + (WebInspector.AbstractTimelinePanel.prototype.updateMainViewWidth): + (WebInspector.AbstractTimelinePanel.prototype.refresh): + (WebInspector.AbstractTimelinePanel.prototype.reset): + (WebInspector.AbstractTimelinePanel.prototype.get calculator): + (WebInspector.AbstractTimelinePanel.prototype.set calculator): + (WebInspector.AbstractTimelinePanel.prototype.addItem): + (WebInspector.AbstractTimelinePanel.prototype.removeItem): + (WebInspector.AbstractTimelinePanel.prototype.refreshItem): + (WebInspector.AbstractTimelinePanel.prototype.revealAndSelectItem): + (WebInspector.AbstractTimelinePanel.prototype.sortItems): + (WebInspector.AbstractTimelinePanel.prototype.adjustScrollPosition): + (WebInspector.AbstractTimelineCategory): + (WebInspector.AbstractTimelineCategory.prototype.toString): + * inspector/front-end/ResourceCategory.js: + (WebInspector.ResourceCategory): + * inspector/front-end/ResourcesPanel.js: + (WebInspector.ResourcesPanel): + (WebInspector.ResourcesPanel.prototype.createItemTreeElement): + (WebInspector.ResourcesPanel.prototype.createItemGraph): + (WebInspector.ResourcesPanel.prototype.isCategoryVisible): + (WebInspector.ResourcesPanel.prototype.populateSidebar): + (WebInspector.ResourcesPanel.prototype.get searchableViews): + (WebInspector.ResourcesPanel.prototype.get searchResultsSortFunction.sortFuction): + (WebInspector.ResourcesPanel.prototype.get searchResultsSortFunction): + (WebInspector.ResourcesPanel.prototype.searchMatchFound): + (WebInspector.ResourcesPanel.prototype.searchCanceled): + (WebInspector.ResourcesPanel.prototype.performSearch): + (WebInspector.ResourcesPanel.prototype.refresh): + (WebInspector.ResourcesPanel.prototype.reset): + (WebInspector.ResourcesPanel.prototype.removeResource): + (WebInspector.ResourcesPanel.prototype.addMessageToResource): + (WebInspector.ResourcesPanel.prototype.clearMessages): + (WebInspector.ResourcesPanel.prototype.refreshResource): + (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded): + (WebInspector.ResourcesPanel.prototype.showResource): + (WebInspector.ResourcesPanel.prototype._sortResourcesIfNeeded): + (WebInspector.ResourcesPanel.prototype._toggleLargerResources): + (WebInspector.ResourcesPanel.prototype._toggleResourceTracking): + (WebInspector.ResourcesPanel.prototype.get _resources): + (WebInspector.ResourceTimeCalculator.prototype._upperBound): + * inspector/front-end/TimelinePanel.js: + (WebInspector.TimelinePanel): + (WebInspector.TimelinePanel.prototype.get categories): + (WebInspector.TimelinePanel.prototype.populateSidebar): + (WebInspector.TimelinePanel.prototype.addRecordToTimeline): + (WebInspector.TimelinePanel.prototype.createItemTreeElement): + (WebInspector.TimelinePanel.prototype.createItemGraph): + (WebInspector.TimelinePanel.prototype._formatRecord): + (WebInspector.TimelineCategory): + * inspector/front-end/inspector.css: + * inspector/front-end/inspector.html: + +2009-10-28 Kelly Norton + + Reviewed by Pavel Feldman. + + Resets InspectorFrontend in InspectorTimelineAgent instead of removing it so + that it remains active on refreshs and page transitions. + https://bugs.webkit.org/show_bug.cgi?id=30874 + + * inspector/InspectorController.cpp: + (WebCore::InspectorController::setFrontendProxyObject): + * inspector/InspectorTimelineAgent.cpp: + (WebCore::InspectorTimelineAgent::resetFrontendProxyObject): + * inspector/InspectorTimelineAgent.h: + +2009-10-27 Shinichiro Hamaji + + Reviewed by Darin Adler. + + Provide a way to get counter values with layoutTestContoller + https://bugs.webkit.org/show_bug.cgi?id=30555 + + Expose WebCore::counterValueForElement as a WebCore API. + + * WebCore.base.exp: + * rendering/RenderTreeAsText.cpp: + (WebCore::writeCounterValuesFromChildren): + (WebCore::counterValueForElement): + * rendering/RenderTreeAsText.h: + +2009-10-28 Nate Chapin + + Unreviewed, Chromium build fix for r50225. + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::defaultObjectContentType): + +2009-10-28 Eric Z. Ayers + + Reviewed by Pavel Feldman. + + Adds InspectorTimelineAgent instrumentation for encountering a + . Check if it has the // expected value in all cases. // See smart window.open policy for where this is used. - ExecState* exec = m_windowShell->window()->globalExec(); + JSDOMWindowShell* shell = windowShell(world); + ExecState* exec = shell->window()->globalExec(); const String* savedSourceURL = m_sourceURL; m_sourceURL = &sourceURL; @@ -107,9 +117,9 @@ ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode) RefPtr protect = m_frame; - m_windowShell->window()->globalData()->timeoutChecker.start(); - Completion comp = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), jsSourceCode, m_windowShell); - m_windowShell->window()->globalData()->timeoutChecker.stop(); + exec->globalData().timeoutChecker.start(); + Completion comp = WebCore::evaluateInWorld(exec, exec->dynamicGlobalObject()->globalScopeChain(), jsSourceCode, shell, world); + exec->globalData().timeoutChecker.stop(); // Evaluating the JavaScript could cause the frame to be deallocated // so we start the keep alive timer here. @@ -127,52 +137,114 @@ ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode) return JSValue(); } -void ScriptController::evaluateInIsolatedWorld(unsigned /* worldID */, const Vector& sourceCode) +ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode) +{ + return evaluateInWorld(sourceCode, mainThreadNormalWorld()); +} + +// An DOMWrapperWorld other than the thread's normal world. +class IsolatedWorld : public DOMWrapperWorld { +public: + IsolatedWorld(JSGlobalData* globalData) + : DOMWrapperWorld(globalData) + { + JSGlobalData::ClientData* clientData = globalData->clientData; + ASSERT(clientData); + static_cast(clientData)->rememberWorld(this); + } + + static PassRefPtr create(JSGlobalData* globalData) { return adoptRef(new IsolatedWorld(globalData)); } +}; + +static PassRefPtr findWorld(unsigned worldID) +{ + if (!worldID) + return IsolatedWorld::create(JSDOMWindow::commonJSGlobalData()); + + typedef HashMap > WorldMap; + DEFINE_STATIC_LOCAL(WorldMap, isolatedWorlds, ()); + + WorldMap::iterator iter = isolatedWorlds.find(worldID); + if (iter != isolatedWorlds.end()) + return iter->second; + + RefPtr newWorld = IsolatedWorld::create(JSDOMWindow::commonJSGlobalData()); + isolatedWorlds.add(worldID, newWorld); + return newWorld; +} + +JSDOMWindow* ScriptController::globalObject(unsigned worldID) +{ + RefPtr world = findWorld(worldID); + return windowShell(world.get())->window(); +} + +ScriptValue ScriptController::evaluateInIsolatedWorld(unsigned worldID, const ScriptSourceCode& sourceCode) +{ + RefPtr world = findWorld(worldID); + return evaluateInWorld(sourceCode, world.get()); +} + +void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector& sourceCode) { - // FIXME: Actually support isolated worlds! + RefPtr world = findWorld(worldID); + unsigned size = sourceCode.size(); for (unsigned i = 0; i < size; ++i) - evaluate(sourceCode[i]); + evaluateInWorld(sourceCode[i], world.get()); } void ScriptController::clearWindowShell() { - if (!m_windowShell) + if (m_windowShells.isEmpty()) return; JSLock lock(SilenceAssertionsOnly); // Clear the debugger from the current window before setting the new window. + DOMWrapperWorld* debugWorld = debuggerWorld(); attachDebugger(0); - m_windowShell->window()->willRemoveFromWindowShell(); - m_windowShell->setWindow(m_frame->domWindow()); + for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) { + DOMWrapperWorld* world = iter->first; + JSDOMWindowShell* windowShell = iter->second; + windowShell->window()->willRemoveFromWindowShell(); + windowShell->setWindow(m_frame->domWindow()); - if (Page* page = m_frame->page()) { - attachDebugger(page->debugger()); - m_windowShell->window()->setProfileGroup(page->group().identifier()); + if (Page* page = m_frame->page()) { + if (world == debugWorld) + attachDebugger(page->debugger()); + windowShell->window()->setProfileGroup(page->group().identifier()); + } } // There is likely to be a lot of garbage now. gcController().garbageCollectSoon(); } -void ScriptController::initScript() +JSDOMWindowShell* ScriptController::initScript(DOMWrapperWorld* world) { - if (m_windowShell) - return; + ASSERT(!m_windowShells.contains(world)); JSLock lock(SilenceAssertionsOnly); - m_windowShell = new JSDOMWindowShell(m_frame->domWindow()); - m_windowShell->window()->updateDocument(); + JSDOMWindowShell* windowShell = new JSDOMWindowShell(m_frame->domWindow()); + m_windowShells.add(world, windowShell); + world->rememberScriptController(this); + windowShell->window()->updateDocument(world); if (Page* page = m_frame->page()) { - attachDebugger(page->debugger()); - m_windowShell->window()->setProfileGroup(page->group().identifier()); + if (world == debuggerWorld()) + attachDebugger(page->debugger()); + windowShell->window()->setProfileGroup(page->group().identifier()); + } + + { + EnterDOMWrapperWorld worldEntry(*JSDOMWindow::commonJSGlobalData(), world); + m_frame->loader()->dispatchWindowObjectAvailable(); } - m_frame->loader()->dispatchWindowObjectAvailable(); + return windowShell; } bool ScriptController::processingUserGesture() const @@ -182,10 +254,11 @@ bool ScriptController::processingUserGesture() const bool ScriptController::processingUserGestureEvent() const { - if (!m_windowShell) + JSDOMWindowShell* shell = existingWindowShell(mainThreadNormalWorld()); + if (!shell) return false; - if (Event* event = m_windowShell->window()->currentEvent()) { + if (Event* event = shell->window()->currentEvent()) { if (event->createdByDOM()) return false; @@ -243,13 +316,16 @@ bool ScriptController::isEnabled() void ScriptController::attachDebugger(JSC::Debugger* debugger) { - if (!m_windowShell) + // FIXME: Should be able to debug isolated worlds. + JSDOMWindowShell* shell = existingWindowShell(debuggerWorld()); + if (!shell) return; + JSDOMWindow* globalObject = shell->window(); if (debugger) - debugger->attach(m_windowShell->window()); - else if (JSC::Debugger* currentDebugger = m_windowShell->window()->debugger()) - currentDebugger->detach(m_windowShell->window()); + debugger->attach(globalObject); + else if (JSC::Debugger* currentDebugger = globalObject->debugger()) + currentDebugger->detach(globalObject); } void ScriptController::updateDocument() @@ -258,8 +334,8 @@ void ScriptController::updateDocument() return; JSLock lock(SilenceAssertionsOnly); - if (m_windowShell) - m_windowShell->window()->updateDocument(); + for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) + iter->second->window()->updateDocument(iter->first); } void ScriptController::updateSecurityOrigin() @@ -274,7 +350,7 @@ Bindings::RootObject* ScriptController::bindingRootObject() if (!m_bindingRootObject) { JSLock lock(SilenceAssertionsOnly); - m_bindingRootObject = Bindings::RootObject::create(0, globalObject()); + m_bindingRootObject = Bindings::RootObject::create(0, globalObject(pluginWorld())); } return m_bindingRootObject.get(); } @@ -285,7 +361,7 @@ PassRefPtr ScriptController::createRootObject(void* native if (it != m_rootObjects.end()) return it->second; - RefPtr rootObject = Bindings::RootObject::create(nativeHandle, globalObject()); + RefPtr rootObject = Bindings::RootObject::create(nativeHandle, globalObject(pluginWorld())); m_rootObjects.set(nativeHandle, rootObject); return rootObject.release(); @@ -300,7 +376,7 @@ NPObject* ScriptController::windowScriptNPObject() // JavaScript is enabled, so there is a JavaScript window object. // Return an NPObject bound to the window object. JSC::JSLock lock(SilenceAssertionsOnly); - JSObject* win = windowShell()->window(); + JSObject* win = windowShell(pluginWorld())->window(); ASSERT(win); Bindings::RootObject* root = bindingRootObject(); m_windowScriptNPObject = _NPN_CreateScriptObject(0, win, root); @@ -334,8 +410,9 @@ JSObject* ScriptController::jsObjectForPluginElement(HTMLPlugInElement* plugin) // Create a JSObject bound to this element JSLock lock(SilenceAssertionsOnly); - ExecState* exec = globalObject()->globalExec(); - JSValue jsElementValue = toJS(exec, globalObject(), plugin); + JSDOMWindow* globalObj = globalObject(pluginWorld()); + // FIXME: is normal okay? - used for NP plugins? + JSValue jsElementValue = toJS(globalObj->globalExec(), globalObj, plugin); if (!jsElementValue || !jsElementValue.isObject()) return 0; @@ -391,4 +468,44 @@ void ScriptController::clearScriptObjects() #endif } +ScriptValue ScriptController::executeScriptInIsolatedWorld(unsigned worldID, const String& script, bool forceUserGesture) +{ + ScriptSourceCode sourceCode(script, forceUserGesture ? KURL() : m_frame->loader()->url()); + + if (!isEnabled() || isPaused()) + return ScriptValue(); + + bool wasInExecuteScript = m_inExecuteScript; + m_inExecuteScript = true; + + ScriptValue result = evaluateInIsolatedWorld(worldID, sourceCode); + + if (!wasInExecuteScript) { + m_inExecuteScript = false; + Document::updateStyleForAllDocuments(); + } + + return result; +} + +ScriptValue ScriptController::executeScriptInIsolatedWorld(DOMWrapperWorld* world, const String& script, bool forceUserGesture) +{ + ScriptSourceCode sourceCode(script, forceUserGesture ? KURL() : m_frame->loader()->url()); + + if (!isEnabled() || isPaused()) + return ScriptValue(); + + bool wasInExecuteScript = m_inExecuteScript; + m_inExecuteScript = true; + + ScriptValue result = evaluateInWorld(sourceCode, world); + + if (!wasInExecuteScript) { + m_inExecuteScript = false; + Document::updateStyleForAllDocuments(); + } + + return result; +} + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptController.h b/src/3rdparty/webkit/WebCore/bindings/js/ScriptController.h index bd4b65e..f2a497d 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptController.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptController.h @@ -63,31 +63,49 @@ class XSSAuditor; typedef HashMap > RootObjectMap; class ScriptController { + typedef WTF::HashMap > ShellMap; + public: ScriptController(Frame*); ~ScriptController(); - bool haveWindowShell() const { return m_windowShell; } - JSDOMWindowShell* windowShell() + JSDOMWindowShell* windowShell(DOMWrapperWorld* world) + { + ShellMap::iterator iter = m_windowShells.find(world); + return (iter != m_windowShells.end()) ? iter->second.get() : initScript(world); + } + JSDOMWindowShell* existingWindowShell(DOMWrapperWorld* world) const + { + ShellMap::const_iterator iter = m_windowShells.find(world); + return (iter != m_windowShells.end()) ? iter->second.get() : 0; + } + JSDOMWindow* globalObject(DOMWrapperWorld* world) { - initScriptIfNeeded(); - return m_windowShell; + return windowShell(world)->window(); } + JSDOMWindow* globalObject(unsigned worldID); - JSDOMWindow* globalObject() + void forgetWorld(DOMWrapperWorld* world) { - initScriptIfNeeded(); - return m_windowShell->window(); + m_windowShells.remove(world); } ScriptValue executeScript(const ScriptSourceCode&); ScriptValue executeScript(const String& script, bool forceUserGesture = false); + ScriptValue executeScriptInIsolatedWorld(unsigned worldID, const String& script, bool forceUserGesture = false); + ScriptValue executeScriptInIsolatedWorld(DOMWrapperWorld* world, const String& script, bool forceUserGesture = false); // Returns true if argument is a JavaScript URL. bool executeIfJavaScriptURL(const KURL&, bool userGesture = false, bool replaceDocument = true); + // This function must be called from the main thread. It is safe to call it repeatedly. + // Darwin is an exception to this rule: it is OK to call this function from any thread, even reentrantly. + static void initializeThreading(); + ScriptValue evaluate(const ScriptSourceCode&); - void evaluateInIsolatedWorld(unsigned worldID, const Vector&); + ScriptValue evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*); + ScriptValue evaluateInIsolatedWorld(unsigned /*worldID*/, const ScriptSourceCode&); + void evaluateInIsolatedWorld(unsigned /*worldID*/, const Vector&); void setEventHandlerLineNumber(int lineno) { m_handlerLineNumber = lineno; } int eventHandlerLineNumber() { return m_handlerLineNumber; } @@ -144,19 +162,14 @@ public: XSSAuditor* xssAuditor() { return m_XSSAuditor.get(); } private: - void initScriptIfNeeded() - { - if (!m_windowShell) - initScript(); - } - void initScript(); + JSDOMWindowShell* initScript(DOMWrapperWorld* world); void disconnectPlatformScriptObjects(); bool processingUserGestureEvent() const; bool isJavaScriptAnchorNavigation() const; - JSC::ProtectedPtr m_windowShell; + ShellMap m_windowShells; Frame* m_frame; int m_handlerLineNumber; const String* m_sourceURL; diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerMac.mm b/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerMac.mm index e6a654f..21ec0f2 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerMac.mm +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerMac.mm @@ -114,7 +114,7 @@ WebScriptObject* ScriptController::windowScriptObject() if (!m_windowScriptObject) { JSC::JSLock lock(JSC::SilenceAssertionsOnly); JSC::Bindings::RootObject* root = bindingRootObject(); - m_windowScriptObject = [WebScriptObject scriptObjectForJSObject:toRef(windowShell()) originRootObject:root rootObject:root]; + m_windowScriptObject = [WebScriptObject scriptObjectForJSObject:toRef(windowShell(pluginWorld())) originRootObject:root rootObject:root]; } ASSERT([m_windowScriptObject.get() isKindOfClass:[DOMAbstractView class]]); diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptEventListener.cpp b/src/3rdparty/webkit/WebCore/bindings/js/ScriptEventListener.cpp index 0b0047b..8399c7a 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptEventListener.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptEventListener.cpp @@ -71,7 +71,7 @@ PassRefPtr createAttributeEventListener(Node* node, Attribu sourceURL = node->document()->url().string(); } - return JSLazyEventListener::create(attr->localName().string(), eventParameterName(node->isSVGElement()), attr->value(), node, sourceURL, lineNumber); + return JSLazyEventListener::create(attr->localName().string(), eventParameterName(node->isSVGElement()), attr->value(), node, sourceURL, lineNumber, mainThreadNormalWorld()); } PassRefPtr createAttributeEventListener(Frame* frame, Attribute* attr) @@ -93,7 +93,7 @@ PassRefPtr createAttributeEventListener(Frame* frame, Attri lineNumber = scriptController->eventHandlerLineNumber(); sourceURL = frame->document()->url().string(); - return JSLazyEventListener::create(attr->localName().string(), eventParameterName(frame->document()->isSVGDocument()), attr->value(), 0, sourceURL, lineNumber); + return JSLazyEventListener::create(attr->localName().string(), eventParameterName(frame->document()->isSVGDocument()), attr->value(), 0, sourceURL, lineNumber, mainThreadNormalWorld()); } String getEventListenerHandlerBody(ScriptExecutionContext* context, ScriptState* scriptState, EventListener* eventListener) diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptFunctionCall.cpp b/src/3rdparty/webkit/WebCore/bindings/js/ScriptFunctionCall.cpp index 46e80ac..91b2a57 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptFunctionCall.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptFunctionCall.cpp @@ -123,7 +123,8 @@ ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions) if (callType == CallTypeNone) return ScriptValue(); - JSValue result = JSC::call(m_exec, function, callType, callData, thisObject, m_arguments); + // FIXME: Should this function take a worldID? - only used by inspector? + JSValue result = callInWorld(m_exec, function, callType, callData, thisObject, m_arguments, debuggerWorld()); if (m_exec->hadException()) { if (reportExceptions) reportException(m_exec, m_exec->exception()); @@ -161,7 +162,8 @@ ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExcept if (constructType == ConstructTypeNone) return ScriptObject(); - JSValue result = JSC::construct(m_exec, constructor, constructType, constructData, m_arguments); + // FIXME: Currently this method constructs objects in debuggerWorld(). We could use the current world, or pass a worldID to this function? + JSValue result = constructInWorld(m_exec, constructor, constructType, constructData, m_arguments, debuggerWorld()); if (m_exec->hadException()) { if (reportExceptions) reportException(m_exec, m_exec->exception()); diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptObjectQuarantine.cpp b/src/3rdparty/webkit/WebCore/bindings/js/ScriptObjectQuarantine.cpp index b48556e..313530f 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptObjectQuarantine.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptObjectQuarantine.cpp @@ -72,7 +72,7 @@ bool getQuarantinedScriptObject(Database* database, ScriptObject& quarantinedObj if (!frame) return false; - JSDOMGlobalObject* globalObject = toJSDOMWindow(frame); + JSDOMGlobalObject* globalObject = toJSDOMWindow(frame, debuggerWorld()); ExecState* exec = globalObject->globalExec(); JSLock lock(SilenceAssertionsOnly); @@ -89,7 +89,7 @@ bool getQuarantinedScriptObject(Storage* storage, ScriptObject& quarantinedObjec Frame* frame = storage->frame(); ASSERT(frame); - JSDOMGlobalObject* globalObject = toJSDOMWindow(frame); + JSDOMGlobalObject* globalObject = toJSDOMWindow(frame, debuggerWorld()); ExecState* exec = globalObject->globalExec(); JSLock lock(SilenceAssertionsOnly); @@ -116,7 +116,7 @@ bool getQuarantinedScriptObject(DOMWindow* domWindow, ScriptObject& quarantinedO { ASSERT(domWindow); - JSDOMWindow* window = toJSDOMWindow(domWindow->frame()); + JSDOMWindow* window = toJSDOMWindow(domWindow->frame(), debuggerWorld()); ExecState* exec = window->globalExec(); JSLock lock(SilenceAssertionsOnly); diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h b/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h index 1b05ded..32d6298 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h @@ -44,6 +44,7 @@ public: ScriptSourceCode(const String& source, const KURL& url = KURL(), int startLine = 1) : m_provider(StringSourceProvider::create(source, url.isNull() ? String() : url.string())) , m_code(m_provider, startLine) + , m_url(url) { } @@ -59,10 +60,17 @@ public: const String& source() const { return m_provider->source(); } + int startLine() const { return m_code.firstLine(); } + + const KURL& url() const { return m_url; } + private: RefPtr m_provider; JSC::SourceCode m_code; + + KURL m_url; + }; } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.cpp b/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.cpp index 8bfa33d..60ba2a0 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.cpp @@ -32,6 +32,7 @@ #include "ScriptState.h" #include "Frame.h" +#include "JSDOMWindowBase.h" #include "Node.h" #include "Page.h" @@ -49,12 +50,12 @@ ScriptState* scriptStateFromNode(Node* node) return 0; if (!frame->script()->isEnabled()) return 0; - return frame->script()->globalObject()->globalExec(); + return frame->script()->globalObject(mainThreadCurrentWorld())->globalExec(); } ScriptState* scriptStateFromPage(Page* page) { - return page->mainFrame()->script()->globalObject()->globalExec(); + return page->mainFrame()->script()->globalObject(mainThreadCurrentWorld())->globalExec(); } } diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.h b/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.h index fa5c4a8..279234e 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptState.h @@ -35,6 +35,7 @@ #include "JSDOMBinding.h" namespace WebCore { + class DOMWrapperWorld; class Node; class Page; diff --git a/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp b/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp index 3590dad..b66b0e8 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp @@ -52,6 +52,7 @@ WorkerScriptController::WorkerScriptController(WorkerContext* workerContext) , m_workerContext(workerContext) , m_executionForbidden(false) { + m_globalData->clientData = new WebCoreJSClientData(m_globalData.get()); } WorkerScriptController::~WorkerScriptController() @@ -122,7 +123,7 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, ExecState* exec = m_workerContextWrapper->globalExec(); m_workerContextWrapper->globalData()->timeoutChecker.start(); - Completion comp = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), sourceCode.jsSourceCode(), m_workerContextWrapper); + Completion comp = evaluateInWorld(exec, exec->dynamicGlobalObject()->globalScopeChain(), sourceCode.jsSourceCode(), m_workerContextWrapper, currentWorld(exec)); m_workerContextWrapper->globalData()->timeoutChecker.stop(); if (comp.complType() == Normal || comp.complType() == ReturnValue) diff --git a/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.h b/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.h index bb33f60..c820cd9 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.h @@ -62,6 +62,9 @@ namespace WebCore { void setException(ScriptValue); void forbidExecution(); + + JSC::JSGlobalData* globalData() { return m_globalData.get(); } + private: void initScriptIfNeeded() { diff --git a/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorJS.pm b/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorJS.pm index ff7b52f..d8367ac 100644 --- a/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorJS.pm +++ b/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorJS.pm @@ -292,7 +292,7 @@ sub GenerateGetOwnPropertySlotBody my @getOwnPropertySlotImpl = (); - if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection") { + if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") { push(@getOwnPropertySlotImpl, " ${namespaceMaybe}JSValue proto = prototype();\n"); push(@getOwnPropertySlotImpl, " if (proto.isObject() && static_cast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n"); push(@getOwnPropertySlotImpl, " return false;\n\n"); @@ -369,7 +369,7 @@ sub GenerateGetOwnPropertyDescriptorBody my @getOwnPropertyDescriptorImpl = (); - if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection") { + if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") { push(@getOwnPropertyDescriptorImpl, " ${namespaceMaybe}JSValue proto = prototype();\n"); push(@getOwnPropertyDescriptorImpl, " if (proto.isObject() && static_cast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n"); push(@getOwnPropertyDescriptorImpl, " return false;\n\n"); @@ -658,6 +658,12 @@ sub GenerateHeader # Custom lookupSetter function push(@headerContent, " virtual JSC::JSValue lookupSetter(JSC::ExecState*, const JSC::Identifier& propertyName);\n") if $dataNode->extendedAttributes->{"CustomLookupSetter"}; + # Override toBoolean to return false for objects that want to 'MasqueradesAsUndefined'. + if ($dataNode->extendedAttributes->{"MasqueradesAsUndefined"}) { + push(@headerContent, " virtual bool toBoolean(JSC::ExecState*) const { return false; };\n"); + $structureFlags{"JSC::MasqueradesAsUndefined"} = 1; + } + # Constructor object getter push(@headerContent, " static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);\n") if $dataNode->extendedAttributes->{"GenerateConstructor"}; @@ -1188,19 +1194,21 @@ sub GenerateImplementation push(@implContent, " impl()->invalidateEventListeners();\n"); } - if ($interfaceName eq "Node") { - push(@implContent, " forgetDOMNode(impl()->document(), impl());\n"); - } else { - if ($podType) { - my $animatedType = $implClassName; - $animatedType =~ s/SVG/SVGAnimated/; + if (!$dataNode->extendedAttributes->{"ExtendsDOMGlobalObject"}) { + if ($interfaceName eq "Node") { + push(@implContent, " forgetDOMNode(this, impl(), impl()->document());\n"); + } else { + if ($podType) { + my $animatedType = $implClassName; + $animatedType =~ s/SVG/SVGAnimated/; - # Special case for JSSVGNumber - if ($codeGenerator->IsSVGAnimatedType($animatedType) and $podType ne "float") { - push(@implContent, " JSSVGDynamicPODTypeWrapperCache<$podType, $animatedType>::forgetWrapper(m_impl.get());\n"); + # Special case for JSSVGNumber + if ($codeGenerator->IsSVGAnimatedType($animatedType) and $podType ne "float") { + push(@implContent, " JSSVGDynamicPODTypeWrapperCache<$podType, $animatedType>::forgetWrapper(m_impl.get());\n"); + } } + push(@implContent, " forgetDOMObject(this, impl());\n"); } - push(@implContent, " forgetDOMObject(*Heap::heap(this)->globalData(), impl());\n"); } push(@implContent, "}\n\n"); @@ -1210,7 +1218,7 @@ sub GenerateImplementation # its own special handling rather than relying on the caching that Node normally does. if ($interfaceName eq "Document") { push(@implContent, "${className}::~$className()\n"); - push(@implContent, "{\n forgetDOMObject(*Heap::heap(this)->globalData(), static_cast<${implClassName}*>(impl()));\n}\n\n"); + push(@implContent, "{\n forgetDOMObject(this, static_cast<${implClassName}*>(impl()));\n}\n\n"); } if ($needsMarkChildren && !$dataNode->extendedAttributes->{"CustomMarkFunction"}) { @@ -1476,7 +1484,7 @@ sub GenerateImplementation } else { $implIncludes{"Frame.h"} = 1; $implIncludes{"JSDOMGlobalObject.h"} = 1; - push(@implContent, " JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext());\n"); + push(@implContent, " JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec);\n"); push(@implContent, " if (!globalObject)\n"); push(@implContent, " return;\n"); } @@ -1700,7 +1708,7 @@ sub GenerateImplementation push(@implContent, " return toJS(exec, thisObj->globalObject(), static_cast<$implClassName*>(thisObj->impl())->item(slot.index()));\n"); } push(@implContent, "}\n"); - if ($interfaceName eq "HTMLCollection") { + if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") { $implIncludes{"JSNode.h"} = 1; $implIncludes{"Node.h"} = 1; } @@ -1711,7 +1719,7 @@ sub GenerateImplementation push(@implContent, "{\n"); push(@implContent, " return jsNumber(exec, static_cast<$implClassName*>(impl())->item(index));\n"); push(@implContent, "}\n"); - if ($interfaceName eq "HTMLCollection") { + if ($interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") { $implIncludes{"JSNode.h"} = 1; $implIncludes{"Node.h"} = 1; } diff --git a/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorV8.pm b/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorV8.pm index 28562f1..95b2aa2 100644 --- a/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorV8.pm +++ b/src/3rdparty/webkit/WebCore/bindings/scripts/CodeGeneratorV8.pm @@ -215,7 +215,6 @@ sub AddClassForwardIfNeeded sub GetImplementationFileName { my $iface = shift; - return "HTMLCollection.h" if $iface eq "HTMLAllCollection"; return "Event.h" if $iface eq "DOMTimeStamp"; return "NamedAttrMap.h" if $iface eq "NamedNodeMap"; return "NameNodeList.h" if $iface eq "NodeList"; @@ -307,7 +306,7 @@ sub GenerateSetDOMException my $indent = shift; my $result = ""; - $result .= $indent . "if (ec) {\n"; + $result .= $indent . "if (UNLIKELY(ec)) {\n"; $result .= $indent . " V8Proxy::setDOMException(ec);\n"; $result .= $indent . " return v8::Handle();\n"; $result .= $indent . "}\n"; @@ -622,15 +621,17 @@ END push(@implContentDecls, " if (!imp->document())\n"); push(@implContentDecls, " return v8::Undefined();\n"); } - push(@implContentDecls, " $nativeType v = "); - - push(@implContentDecls, "$getterString;\n"); if ($useExceptions) { + push(@implContentDecls, " $nativeType v = "); + push(@implContentDecls, "$getterString;\n"); push(@implContentDecls, GenerateSetDOMException(" ")); + $result = "v"; + $result .= ".release()" if (IsRefPtrType($returnType)); + } else { + # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary + $result = $getterString; } - - $result = "v"; } if (IsSVGTypeNeedingContextParameter($attrType) && !$skipContext) { @@ -646,7 +647,6 @@ END my $classIndex = uc($attrType); push(@implContentDecls, " return V8DOMWrapper::convertToV8Object(V8ClassIndex::$classIndex, wrapper.release());\n"); } else { - $result .= ".release()" if (IsRefPtrType($attrType)); push(@implContentDecls, " " . ReturnNativeToJSValue($attribute->signature, $result, " ").";\n"); } @@ -784,7 +784,8 @@ END } if ($useExceptions) { - push(@implContentDecls, " V8Proxy::setDOMException(ec);\n"); + push(@implContentDecls, " if (UNLIKELY(ec))\n"); + push(@implContentDecls, " V8Proxy::setDOMException(ec);\n"); } if ($isPodType) { @@ -917,7 +918,7 @@ END if (TypeCanFailConversion($parameter)) { $implIncludes{"ExceptionCode.h"} = 1; push(@implContentDecls, -" if (!$parameterName" . (BasicTypeCanFailConversion($parameter) ? "Ok" : "") . ") {\n" . +" if (UNLIKELY(!$parameterName" . (BasicTypeCanFailConversion($parameter) ? "Ok" : "") . ")) {\n" . " V8Proxy::setDOMException(TYPE_MISMATCH_ERR);\n" . " return v8::Handle();\n" . " }\n"); @@ -926,7 +927,7 @@ END if ($parameter->extendedAttributes->{"IsIndex"}) { $implIncludes{"ExceptionCode.h"} = 1; push(@implContentDecls, -" if ($parameterName < 0) {\n" . +" if (UNLIKELY($parameterName < 0)) {\n" . " V8Proxy::setDOMException(INDEX_SIZE_ERR);\n" . " return v8::Handle();\n" . " }\n"); @@ -1322,6 +1323,13 @@ END $template = "instance"; } + my $conditional = ""; + if ($attrExt->{"EnabledAtRuntime"}) { + # Only call Set()/SetAccessor() if this method should be enabled + $enable_function = $interfaceName . $codeGenerator->WK_ucfirst($function->signature->name); + $conditional = "if (V8Custom::v8${enable_function}Enabled())\n"; + } + if ($attrExt->{"DoNotCheckDomainSecurity"} && ($dataNode->extendedAttributes->{"CheckDomainSecurity"} || $interfaceName eq "DOMWindow")) { # Mark the accessor as ReadOnly and set it on the proto object so @@ -1342,7 +1350,7 @@ END push(@implContent, <SetAccessor( + $conditional $template->SetAccessor( v8::String::New("$name"), ${interfaceName}Internal::${name}AttrGetter, 0, @@ -1370,7 +1378,7 @@ END push(@implContent, <Set( + $conditional ${template}->Set( v8::String::New("$name"), $templateFunction, static_cast($property_attributes)); @@ -1388,7 +1396,7 @@ END } # Set the class name. This is used when printing objects. - push(@implContent, " desc->SetClassName(v8::String::New(\"" . GetClassName(${interfaceName}) . "\"));\n"); + push(@implContent, " desc->SetClassName(v8::String::New(\"${interfaceName}\"));\n"); if ($has_constants) { push(@implContent, < > result = $functionString;\n"; - } else { + } elsif (@{$function->raisesExceptions} or $returnsPodType or $isPodType or IsSVGTypeNeedingContextParameter($returnType)) { $result .= $indent . $nativeReturnType . " result = $functionString;\n"; + } else { + # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary + $return = $functionString; + $returnIsRef = 0; } if (@{$function->raisesExceptions}) { $result .= GenerateSetDOMException($indent); } - my $return = "result"; - # If the return type is a POD type, separate out the wrapper generation if ($returnsListItemPodType) { $result .= $indent . "RefPtr > wrapper = "; @@ -1602,7 +1615,7 @@ sub GenerateFunctionCallString() my $classIndex = uc($returnType); $result .= $indent . "return V8DOMWrapper::convertToV8Object(V8ClassIndex::$classIndex, wrapper.release());\n"; } else { - $return .= ".release()" if (IsRefPtrType($returnType)); + $return .= ".release()" if ($returnIsRef); $result .= $indent . ReturnNativeToJSValue($function->signature, $return, $indent) . ";\n"; } @@ -1610,15 +1623,6 @@ sub GenerateFunctionCallString() } -# Get the class name used for printing javascript DOM-object wrappers. -sub GetClassName -{ - my $type = shift; - return "HTMLCollection" if $type eq "HTMLAllCollection"; - return $type; -} - - sub GetTypeFromSignature { my $signature = shift; @@ -1696,6 +1700,7 @@ sub IsRefPtrType return 1 if $type eq "EventListener"; return 1 if $type eq "FileList"; return 1 if $type eq "HTMLCollection"; + return 1 if $type eq "HTMLAllCollection"; return 1 if $type eq "HTMLDocument"; return 1 if $type eq "HTMLElement"; return 1 if $type eq "HTMLOptionsCollection"; @@ -2147,7 +2152,11 @@ sub ReturnNativeToJSValue # special case for non-DOM node interfaces if (IsDOMNodeType($type)) { - return "return V8DOMWrapper::convertNodeToV8Object($value)"; + if ($signature->extendedAttributes->{"ReturnsNew"}) { + return "return V8DOMWrapper::convertNewNodeToV8Object($value)"; + } else { + return "return V8DOMWrapper::convertNodeToV8Object($value)"; + } } if ($type eq "EventTarget" or $type eq "SVGElementInstance") { @@ -2159,7 +2168,7 @@ sub ReturnNativeToJSValue } if ($type eq "EventListener") { - return "return V8DOMWrapper::convertEventListenerToV8Object($value)"; + return "return V8DOMWrapper::convertEventListenerToV8Object(imp->scriptExecutionContext(), $value)"; } if ($type eq "SerializedScriptValue") { diff --git a/src/3rdparty/webkit/WebCore/bridge/NP_jsobject.cpp b/src/3rdparty/webkit/WebCore/bridge/NP_jsobject.cpp index 006f17f..6a89652 100644 --- a/src/3rdparty/webkit/WebCore/bridge/NP_jsobject.cpp +++ b/src/3rdparty/webkit/WebCore/bridge/NP_jsobject.cpp @@ -34,6 +34,7 @@ #include "c_utility.h" #include "c_instance.h" #include "IdentifierRep.h" +#include "JSDOMBinding.h" #include "npruntime_impl.h" #include "npruntime_priv.h" #include "runtime_root.h" @@ -123,7 +124,7 @@ bool _NPN_InvokeDefault(NPP, NPObject* o, const NPVariant* args, uint32_t argCou getListFromVariantArgs(exec, args, argCount, rootObject, argList); ProtectedPtr globalObject = rootObject->globalObject(); globalObject->globalData()->timeoutChecker.start(); - JSValue resultV = call(exec, function, callType, callData, function, argList); + JSValue resultV = callInWorld(exec, function, callType, callData, function, argList, pluginWorld()); globalObject->globalData()->timeoutChecker.stop(); // Convert and return the result of the function call. @@ -173,7 +174,7 @@ bool _NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant* getListFromVariantArgs(exec, args, argCount, rootObject, argList); ProtectedPtr globalObject = rootObject->globalObject(); globalObject->globalData()->timeoutChecker.start(); - JSValue resultV = call(exec, function, callType, callData, obj->imp, argList); + JSValue resultV = callInWorld(exec, function, callType, callData, obj->imp, argList, pluginWorld()); globalObject->globalData()->timeoutChecker.stop(); // Convert and return the result of the function call. @@ -203,7 +204,7 @@ bool _NPN_Evaluate(NPP, NPObject* o, NPString* s, NPVariant* variant) String scriptString = convertNPStringToUTF16(s); ProtectedPtr globalObject = rootObject->globalObject(); globalObject->globalData()->timeoutChecker.start(); - Completion completion = JSC::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(scriptString)); + Completion completion = evaluateInWorld(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(scriptString), JSC::JSValue(), pluginWorld()); globalObject->globalData()->timeoutChecker.stop(); ComplType type = completion.complType(); @@ -443,7 +444,7 @@ bool _NPN_Construct(NPP, NPObject* o, const NPVariant* args, uint32_t argCount, getListFromVariantArgs(exec, args, argCount, rootObject, argList); ProtectedPtr globalObject = rootObject->globalObject(); globalObject->globalData()->timeoutChecker.start(); - JSValue resultV = construct(exec, constructor, constructType, constructData, argList); + JSValue resultV = constructInWorld(exec, constructor, constructType, constructData, argList, pluginWorld()); globalObject->globalData()->timeoutChecker.stop(); // Convert and return the result. diff --git a/src/3rdparty/webkit/WebCore/bridge/jni/jni_jsobject.mm b/src/3rdparty/webkit/WebCore/bridge/jni/jni_jsobject.mm index eb4a6bd..cc28a75 100644 --- a/src/3rdparty/webkit/WebCore/bridge/jni/jni_jsobject.mm +++ b/src/3rdparty/webkit/WebCore/bridge/jni/jni_jsobject.mm @@ -29,6 +29,7 @@ #if ENABLE(MAC_JAVA_BRIDGE) #include "Frame.h" +#include "JSDOMBinding.h" #include "ScriptController.h" #include "StringSourceProvider.h" #include "WebCoreFrameView.h" @@ -302,7 +303,7 @@ jobject JavaJSObject::call(jstring methodName, jobjectArray args) const MarkedArgumentBuffer argList; getListFromJArray(exec, args, argList); rootObject->globalObject()->globalData()->timeoutChecker.start(); - JSValue result = JSC::call(exec, function, callType, callData, _imp, argList); + JSValue result = WebCore::callInWorld(exec, function, callType, callData, _imp, argList, WebCore::pluginWorld()); rootObject->globalObject()->globalData()->timeoutChecker.stop(); return convertValueToJObject(result); @@ -321,7 +322,7 @@ jobject JavaJSObject::eval(jstring script) const return 0; rootObject->globalObject()->globalData()->timeoutChecker.start(); - Completion completion = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script))); + Completion completion = WebCore::evaluateInWorld(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script)), JSC::JSValue(), WebCore::pluginWorld()); rootObject->globalObject()->globalData()->timeoutChecker.stop(); ComplType type = completion.complType(); diff --git a/src/3rdparty/webkit/WebCore/bridge/npapi.h b/src/3rdparty/webkit/WebCore/bridge/npapi.h index 5d48b0d..c6cd557 100644 --- a/src/3rdparty/webkit/WebCore/bridge/npapi.h +++ b/src/3rdparty/webkit/WebCore/bridge/npapi.h @@ -56,6 +56,12 @@ # endif /* XP_WIN */ #endif /* _WIN32 */ +#ifdef __SYMBIAN32__ +# ifndef XP_SYMBIAN +# define XP_SYMBIAN 1 +# endif +#endif /* __SYMBIAN32__ */ + #ifdef __MWERKS__ # define _declspec __declspec # ifdef macintosh @@ -64,22 +70,15 @@ # endif /* XP_MAC */ # endif /* macintosh */ # ifdef __INTEL__ -# ifndef __SYMBIAN32__ +# ifndef XP_SYMBIAN # undef NULL -# endif -# ifndef XP_WIN -# define XP_WIN 1 -# endif /* __INTEL__ */ -# endif /* XP_PC */ +# ifndef XP_WIN +# define XP_WIN 1 +# endif /* XP_WIN */ +# endif /* XP_SYMBIAN */ +# endif /* __INTEL__ */ #endif /* __MWERKS__ */ -#ifdef __SYMBIAN32__ -# ifndef XP_SYMBIAN -# define XP_SYMBIAN 1 -# undef XP_WIN -# endif -#endif /* __SYMBIAN32__ */ - #if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__) && !defined(XP_UNIX) # define XP_MACOSX #endif diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp index 3cb2156..6887325 100644 --- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp +++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp @@ -458,7 +458,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type if (type == Date) { DateInstance* date = static_cast(object); WTF::GregorianDateTime gdt; - date->getUTCTime(gdt); + WTF::msToGregorianDateTime(date->internalNumber(), true, gdt); if (hint == QMetaType::QDateTime) { ret = QDateTime(QDate(gdt.year + 1900, gdt.month + 1, gdt.monthDay), QTime(gdt.hour, gdt.minute, gdt.second), Qt::UTC); dist = 0; @@ -834,9 +834,7 @@ JSValue convertQVariantToValue(ExecState* exec, PassRefPtr root, con dt.isDST = -1; double ms = WTF::gregorianDateTimeToMS(dt, time.msec(), /*inputIsUTC*/ false); - DateInstance* instance = new (exec) DateInstance(exec->lexicalGlobalObject()->dateStructure()); - instance->setInternalValue(jsNumber(exec, trunc(ms))); - return instance; + return new (exec) DateInstance(exec, trunc(ms)); } if (type == QMetaType::QByteArray) { diff --git a/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.cpp b/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.cpp index 4e067ce..b8769f9 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -157,6 +157,7 @@ static const int computedProperties[] = { CSSPropertyWebkitBackgroundClip, CSSPropertyWebkitBackgroundComposite, CSSPropertyWebkitBackgroundOrigin, + CSSPropertyWebkitBackgroundSize, CSSPropertyWebkitBorderFit, CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyWebkitBorderImage, @@ -260,30 +261,13 @@ static const int computedProperties[] = { CSSPropertyTextAnchor, CSSPropertyWritingMode, CSSPropertyGlyphOrientationHorizontal, - CSSPropertyGlyphOrientationVertical + CSSPropertyGlyphOrientationVertical, + CSSPropertyWebkitShadow #endif }; const unsigned numComputedProperties = sizeof(computedProperties) / sizeof(computedProperties[0]); -static PassRefPtr valueForShadow(const ShadowData* shadow, CSSPropertyID propertyID) -{ - if (!shadow) - return CSSPrimitiveValue::createIdentifier(CSSValueNone); - - RefPtr list = CSSValueList::createCommaSeparated(); - for (const ShadowData* s = shadow; s; s = s->next) { - RefPtr x = CSSPrimitiveValue::create(s->x, CSSPrimitiveValue::CSS_PX); - RefPtr y = CSSPrimitiveValue::create(s->y, CSSPrimitiveValue::CSS_PX); - RefPtr blur = CSSPrimitiveValue::create(s->blur, CSSPrimitiveValue::CSS_PX); - RefPtr spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread, CSSPrimitiveValue::CSS_PX); - RefPtr style = propertyID == CSSPropertyTextShadow || s->style == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset); - RefPtr color = CSSPrimitiveValue::createColor(s->color.rgb()); - list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release())); - } - return list.release(); -} - static int valueForRepeatRule(int rule) { switch (rule) { @@ -571,6 +555,26 @@ PassRefPtr CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX); } +PassRefPtr CSSComputedStyleDeclaration::valueForShadow(const ShadowData* shadow, int id) const +{ + if (!shadow) + return CSSPrimitiveValue::createIdentifier(CSSValueNone); + + CSSPropertyID propertyID = static_cast(id); + + RefPtr list = CSSValueList::createCommaSeparated(); + for (const ShadowData* s = shadow; s; s = s->next) { + RefPtr x = CSSPrimitiveValue::create(s->x, CSSPrimitiveValue::CSS_PX); + RefPtr y = CSSPrimitiveValue::create(s->y, CSSPrimitiveValue::CSS_PX); + RefPtr blur = CSSPrimitiveValue::create(s->blur, CSSPrimitiveValue::CSS_PX); + RefPtr spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread, CSSPrimitiveValue::CSS_PX); + RefPtr style = propertyID == CSSPropertyTextShadow || s->style == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset); + RefPtr color = CSSPrimitiveValue::createColor(s->color.rgb()); + list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release())); + } + return list.release(); +} + PassRefPtr CSSComputedStyleDeclaration::getPropertyCSSValue(int propertyID) const { return getPropertyCSSValue(propertyID, UpdateLayout); @@ -676,7 +680,8 @@ PassRefPtr CSSComputedStyleDeclaration::getPropertyCSSValue(int proper if (style->backgroundImage()) return style->backgroundImage()->cssValue(); return CSSPrimitiveValue::createIdentifier(CSSValueNone); - case CSSPropertyBackgroundSize: { + case CSSPropertyBackgroundSize: + case CSSPropertyWebkitBackgroundSize: { EFillSizeType size = style->backgroundSizeType(); if (size == Contain) return CSSPrimitiveValue::createIdentifier(CSSValueContain); @@ -777,7 +782,7 @@ PassRefPtr CSSComputedStyleDeclaration::getPropertyCSSValue(int proper case CSSPropertyWebkitBoxReflect: return valueForReflection(style->boxReflect()); case CSSPropertyWebkitBoxShadow: - return valueForShadow(style->boxShadow(), static_cast(propertyID)); + return valueForShadow(style->boxShadow(), propertyID); case CSSPropertyCaptionSide: return CSSPrimitiveValue::create(style->captionSide()); case CSSPropertyClear: @@ -1061,7 +1066,7 @@ PassRefPtr CSSComputedStyleDeclaration::getPropertyCSSValue(int proper case CSSPropertyTextIndent: return CSSPrimitiveValue::create(style->textIndent()); case CSSPropertyTextShadow: - return valueForShadow(style->textShadow(), static_cast(propertyID)); + return valueForShadow(style->textShadow(), propertyID); case CSSPropertyTextRendering: return CSSPrimitiveValue::create(style->fontDescription().textRenderingMode()); case CSSPropertyTextOverflow: diff --git a/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.h b/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.h index c1f34c3..842a995 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.h +++ b/src/3rdparty/webkit/WebCore/css/CSSComputedStyleDeclaration.h @@ -27,6 +27,7 @@ namespace WebCore { class CSSMutableStyleDeclaration; +class ShadowData; enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; @@ -66,6 +67,8 @@ private: virtual String removeProperty(int propertyID, ExceptionCode&); virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&); + PassRefPtr valueForShadow(const ShadowData*, int) const; + RefPtr m_node; }; diff --git a/src/3rdparty/webkit/WebCore/css/CSSParser.cpp b/src/3rdparty/webkit/WebCore/css/CSSParser.cpp index 10949dd..6024a5b 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSParser.cpp +++ b/src/3rdparty/webkit/WebCore/css/CSSParser.cpp @@ -873,6 +873,7 @@ bool CSSParser::parseValue(int propId, bool important) case CSSPropertyBackgroundPositionX: case CSSPropertyBackgroundPositionY: case CSSPropertyBackgroundSize: + case CSSPropertyWebkitBackgroundSize: case CSSPropertyBackgroundRepeat: case CSSPropertyBackgroundRepeatX: case CSSPropertyBackgroundRepeatY: @@ -1726,6 +1727,15 @@ void CSSParser::addFillValue(RefPtr& lval, PassRefPtr rval) lval = rval; } +static bool parseBackgroundClip(CSSParserValue* parserValue, RefPtr& cssValue) +{ + if (parserValue->id == CSSValueBorderBox || parserValue->id == CSSValuePaddingBox || parserValue->id == CSSValueWebkitText) { + cssValue = CSSPrimitiveValue::createIdentifier(parserValue->id); + return true; + } + return false; +} + const int cMaxFillProperties = 9; bool CSSParser::parseFillShorthand(int propId, const int* properties, int numProperties, bool important) @@ -1777,6 +1787,7 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro RefPtr val1; RefPtr val2; int propId1, propId2; + CSSParserValue* parserValue = m_valueList->current(); if (parseFillProperty(properties[i], propId1, propId2, val1, val2)) { parsedProperty[i] = found = true; addFillValue(values[i], val1.release()); @@ -1786,7 +1797,7 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro addFillValue(repeatYValue, val2.release()); if (properties[i] == CSSPropertyBackgroundOrigin || properties[i] == CSSPropertyWebkitMaskOrigin) { // Reparse the value as a clip, and see if we succeed. - if (parseFillProperty(CSSPropertyBackgroundClip, propId1, propId2, val1, val2)) + if (parseBackgroundClip(parserValue, val1)) addFillValue(clipValue, val1.release()); // The property parsed successfully. else addFillValue(clipValue, CSSInitialValue::createImplicit()); // Some value was used for origin that is not supported by clip. Just reset clip instead. @@ -2319,7 +2330,7 @@ void CSSParser::parseFillRepeat(RefPtr& value1, RefPtr& valu } } -PassRefPtr CSSParser::parseFillSize(bool& allowComma) +PassRefPtr CSSParser::parseFillSize(int propId, bool& allowComma) { allowComma = true; CSSParserValue* value = m_valueList->current(); @@ -2328,7 +2339,7 @@ PassRefPtr CSSParser::parseFillSize(bool& allowComma) return CSSPrimitiveValue::createIdentifier(value->id); RefPtr parsedValue1; - + if (value->id == CSSValueAuto) parsedValue1 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN); else { @@ -2336,8 +2347,9 @@ PassRefPtr CSSParser::parseFillSize(bool& allowComma) return 0; parsedValue1 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit); } - - RefPtr parsedValue2 = parsedValue1; + + CSSPropertyID property = static_cast(propId); + RefPtr parsedValue2; if ((value = m_valueList->next())) { if (value->id == CSSValueAuto) parsedValue2 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN); @@ -2349,7 +2361,13 @@ PassRefPtr CSSParser::parseFillSize(bool& allowComma) parsedValue2 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit); } } - + if (!parsedValue2) { + if (property == CSSPropertyWebkitBackgroundSize || property == CSSPropertyWebkitMaskSize) + parsedValue2 = parsedValue1; + else + parsedValue2 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN); + } + return CSSPrimitiveValue::create(Pair::create(parsedValue1.release(), parsedValue2.release())); } @@ -2425,10 +2443,8 @@ bool CSSParser::parseFillProperty(int propId, int& propId1, int& propId2, } break; case CSSPropertyBackgroundClip: - if (val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueWebkitText) { - currValue = CSSPrimitiveValue::createIdentifier(val->id); + if (parseBackgroundClip(val, currValue)) m_valueList->next(); - } break; case CSSPropertyBackgroundOrigin: if (val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueContentBox) { @@ -2470,8 +2486,9 @@ bool CSSParser::parseFillProperty(int propId, int& propId1, int& propId2, // parseFillRepeat advances the m_valueList pointer break; case CSSPropertyBackgroundSize: + case CSSPropertyWebkitBackgroundSize: case CSSPropertyWebkitMaskSize: { - currValue = parseFillSize(allowComma); + currValue = parseFillSize(propId, allowComma); if (currValue) m_valueList->next(); break; @@ -3736,7 +3753,11 @@ bool CSSParser::parseShadow(int propId, bool important) // Other operators aren't legal or we aren't done with the current shadow // value. Treat as invalid. return false; - +#if ENABLE(SVG) + // -webkit-shadow does not support multiple values. + if (static_cast(propId) == CSSPropertyWebkitShadow) + return false; +#endif // The value is good. Commit it. context.commitValue(); } else if (validUnit(val, FLength, true)) { @@ -5182,11 +5203,6 @@ static int cssPropertyID(const UChar* propertyName, unsigned length) const char* const opacity = "opacity"; name = opacity; length = strlen(opacity); - } else if (strcmp(buffer, "-webkit-background-size") == 0) { - // CSS Backgrounds/Borders. -webkit-background-size worked in Safari 4 and earlier. - const char* const backgroundSize = "background-size"; - name = backgroundSize; - length = strlen(backgroundSize); } else if (hasPrefix(buffer + 7, length - 7, "-border-")) { // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax // differs from border-radius, so it is remains as a distinct property. diff --git a/src/3rdparty/webkit/WebCore/css/CSSParser.h b/src/3rdparty/webkit/WebCore/css/CSSParser.h index 1a156da..6d1bb32 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSParser.h +++ b/src/3rdparty/webkit/WebCore/css/CSSParser.h @@ -83,7 +83,7 @@ namespace WebCore { PassRefPtr parseFillPositionXY(bool& xFound, bool& yFound); void parseFillPosition(RefPtr&, RefPtr&); void parseFillRepeat(RefPtr&, RefPtr&); - PassRefPtr parseFillSize(bool &allowComma); + PassRefPtr parseFillSize(int propId, bool &allowComma); bool parseFillProperty(int propId, int& propId1, int& propId2, RefPtr&, RefPtr&); bool parseFillShorthand(int propId, const int* properties, int numProperties, bool important); diff --git a/src/3rdparty/webkit/WebCore/css/CSSParserValues.h b/src/3rdparty/webkit/WebCore/css/CSSParserValues.h index 242cda8..1e9767a 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSParserValues.h +++ b/src/3rdparty/webkit/WebCore/css/CSSParserValues.h @@ -88,7 +88,7 @@ private: unsigned m_variablesCount; }; -struct CSSParserFunction { +struct CSSParserFunction : FastAllocBase { CSSParserString name; CSSParserValueList* args; diff --git a/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValueMappings.h b/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValueMappings.h index 3616aa5..6f89df9 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValueMappings.h +++ b/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValueMappings.h @@ -200,11 +200,11 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e) case ListboxPart: m_value.ident = CSSValueListbox; break; -#if ENABLE(DATALIST) case ListButtonPart: +#if ENABLE(DATALIST) m_value.ident = CSSValueListButton; - break; #endif + break; case ListItemPart: m_value.ident = CSSValueListitem; break; @@ -378,6 +378,7 @@ template<> inline CSSPrimitiveValue::operator EFillBox() const case CSSValueContentBox: return ContentFillBox; case CSSValueText: + case CSSValueWebkitText: return TextFillBox; default: ASSERT_NOT_REACHED(); diff --git a/src/3rdparty/webkit/WebCore/css/CSSProperty.h b/src/3rdparty/webkit/WebCore/css/CSSProperty.h index 7af8348..b5635d0 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSProperty.h +++ b/src/3rdparty/webkit/WebCore/css/CSSProperty.h @@ -29,7 +29,7 @@ namespace WebCore { -class CSSProperty { +class CSSProperty : public FastAllocBase { public: CSSProperty(int propID, PassRefPtr value, bool important = false, int shorthandID = 0, bool implicit = false) : m_id(propID) diff --git a/src/3rdparty/webkit/WebCore/css/CSSPropertyNames.in b/src/3rdparty/webkit/WebCore/css/CSSPropertyNames.in index 5ef6605..48a18e7 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSPropertyNames.in +++ b/src/3rdparty/webkit/WebCore/css/CSSPropertyNames.in @@ -160,6 +160,10 @@ zoom -webkit-background-clip -webkit-background-composite -webkit-background-origin +# -webkit-background-size differs from background-size only in the interpretation of +# a single value: -webkit-background-size: l; is equivalent to background-size: l l; +# whereas background-size: l; is equivalent to background-size: l auto; +-webkit-background-size -webkit-binding -webkit-border-fit -webkit-border-horizontal-spacing diff --git a/src/3rdparty/webkit/WebCore/css/CSSStyleSelector.cpp b/src/3rdparty/webkit/WebCore/css/CSSStyleSelector.cpp index 181e480..40627cf 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSStyleSelector.cpp +++ b/src/3rdparty/webkit/WebCore/css/CSSStyleSelector.cpp @@ -2961,6 +2961,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) HANDLE_BACKGROUND_VALUE(origin, Origin, value) return; case CSSPropertyBackgroundSize: + case CSSPropertyWebkitBackgroundSize: HANDLE_BACKGROUND_VALUE(size, Size, value) return; case CSSPropertyWebkitMaskAttachment: diff --git a/src/3rdparty/webkit/WebCore/css/SVGCSSComputedStyleDeclaration.cpp b/src/3rdparty/webkit/WebCore/css/SVGCSSComputedStyleDeclaration.cpp index e8492d4..1f19983 100644 --- a/src/3rdparty/webkit/WebCore/css/SVGCSSComputedStyleDeclaration.cpp +++ b/src/3rdparty/webkit/WebCore/css/SVGCSSComputedStyleDeclaration.cpp @@ -166,6 +166,8 @@ PassRefPtr CSSComputedStyleDeclaration::getSVGPropertyCSSValue(int pro return 0; } + case CSSPropertyWebkitShadow: + return valueForShadow(svgStyle->shadow(), propertyID); case CSSPropertyMarker: case CSSPropertyEnableBackground: case CSSPropertyColorProfile: diff --git a/src/3rdparty/webkit/WebCore/css/SVGCSSParser.cpp b/src/3rdparty/webkit/WebCore/css/SVGCSSParser.cpp index 0ae9fbc..8730e49 100644 --- a/src/3rdparty/webkit/WebCore/css/SVGCSSParser.cpp +++ b/src/3rdparty/webkit/WebCore/css/SVGCSSParser.cpp @@ -257,6 +257,11 @@ bool CSSParser::parseSVGValue(int propId, bool important) m_valueList->next(); } break; + case CSSPropertyWebkitShadow: + if (id == CSSValueNone) + valid_primitive = true; + else + return parseShadow(propId, important); /* shorthand properties */ case CSSPropertyMarker: diff --git a/src/3rdparty/webkit/WebCore/css/SVGCSSPropertyNames.in b/src/3rdparty/webkit/WebCore/css/SVGCSSPropertyNames.in index e400ffe..809eabe 100644 --- a/src/3rdparty/webkit/WebCore/css/SVGCSSPropertyNames.in +++ b/src/3rdparty/webkit/WebCore/css/SVGCSSPropertyNames.in @@ -46,3 +46,5 @@ glyph-orientation-vertical kerning text-anchor writing-mode + +-webkit-shadow diff --git a/src/3rdparty/webkit/WebCore/css/SVGCSSStyleSelector.cpp b/src/3rdparty/webkit/WebCore/css/SVGCSSStyleSelector.cpp index b81b4f2..7e4483f 100644 --- a/src/3rdparty/webkit/WebCore/css/SVGCSSStyleSelector.cpp +++ b/src/3rdparty/webkit/WebCore/css/SVGCSSStyleSelector.cpp @@ -37,6 +37,7 @@ #include "CSSPropertyNames.h" #include "CSSValueList.h" #include "Document.h" +#include "ShadowValue.h" #include "SVGColor.h" #include "SVGNames.h" #include "SVGPaint.h" @@ -526,6 +527,35 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value) // Silently ignoring this property for now // http://bugs.webkit.org/show_bug.cgi?id=6022 break; + case CSSPropertyWebkitShadow: { + if (isInherit) + return svgstyle->setShadow(m_parentStyle->svgStyle()->shadow() ? new ShadowData(*m_parentStyle->svgStyle()->shadow()) : 0); + if (isInitial || primitiveValue) // initial | none + return svgstyle->setShadow(0); + + if (!value->isValueList()) + return; + + float zoomFactor = m_style->effectiveZoom(); + + CSSValueList *list = static_cast(value); + ASSERT(list->length() == 1); + ShadowValue* item = static_cast(list->itemWithoutBoundsCheck(0)); + int x = item->x->computeLengthInt(style(), m_rootElementStyle, zoomFactor); + int y = item->y->computeLengthInt(style(), m_rootElementStyle, zoomFactor); + int blur = item->blur ? item->blur->computeLengthInt(style(), m_rootElementStyle, zoomFactor) : 0; + Color color; + if (item->color) + color = getColorFromPrimitiveValue(item->color.get()); + + // -webkit-shadow does should not have a spread or style + ASSERT(!item->spread); + ASSERT(!item->style); + + ShadowData* shadowData = new ShadowData(x, y, blur, 0, Normal, color.isValid() ? color : Color::transparent); + svgstyle->setShadow(shadowData); + return; + } default: // If you crash here, it's because you added a css property and are not handling it // in either this switch statement or the one in CSSStyleSelector::applyProperty diff --git a/src/3rdparty/webkit/WebCore/dom/Document.cpp b/src/3rdparty/webkit/WebCore/dom/Document.cpp index 475a8c1..4eb44f7 100644 --- a/src/3rdparty/webkit/WebCore/dom/Document.cpp +++ b/src/3rdparty/webkit/WebCore/dom/Document.cpp @@ -58,6 +58,7 @@ #include "FrameLoader.h" #include "FrameTree.h" #include "FrameView.h" +#include "HTMLAllCollection.h" #include "HTMLAnchorElement.h" #include "HTMLBodyElement.h" #include "HTMLCanvasElement.h" @@ -511,6 +512,16 @@ Document::~Document() m_styleSheets->documentDestroyed(); } +Document::JSWrapperCache* Document::createWrapperCache(DOMWrapperWorld* world) +{ + JSWrapperCache* wrapperCache = new JSWrapperCache(); + m_wrapperCacheMap.set(world, wrapperCache); +#if USE(JSC) + world->rememberDocument(this); +#endif + return wrapperCache; +} + void Document::resetLinkColor() { m_linkColor = Color(0, 0, 238); @@ -943,7 +954,7 @@ Element* Document::elementFromPoint(int x, int y) const return 0; float zoomFactor = frame->pageZoomFactor(); - IntPoint point = roundedIntPoint(FloatPoint((x + view()->scrollX()) * zoomFactor, (y + view()->scrollY()) * zoomFactor)); + IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor + view()->scrollX(), y * zoomFactor + view()->scrollY())); if (!frameView->visibleContentRect().contains(point)) return 0; @@ -973,7 +984,7 @@ PassRefPtr Document::caretRangeFromPoint(int x, int y) return 0; float zoomFactor = frame->pageZoomFactor(); - IntPoint point = roundedIntPoint(FloatPoint((x + view()->scrollX()) * zoomFactor, (y + view()->scrollY()) * zoomFactor)); + IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor + view()->scrollX(), y * zoomFactor + view()->scrollY())); if (!frameView->visibleContentRect().contains(point)) return 0; @@ -3988,9 +3999,9 @@ PassRefPtr Document::anchors() return HTMLCollection::create(this, DocAnchors); } -PassRefPtr Document::all() +PassRefPtr Document::all() { - return HTMLCollection::create(this, DocAll); + return HTMLAllCollection::create(this); } PassRefPtr Document::windowNamedItems(const String &name) diff --git a/src/3rdparty/webkit/WebCore/dom/Document.h b/src/3rdparty/webkit/WebCore/dom/Document.h index 09bba58..0632be1 100644 --- a/src/3rdparty/webkit/WebCore/dom/Document.h +++ b/src/3rdparty/webkit/WebCore/dom/Document.h @@ -71,6 +71,7 @@ namespace WebCore { class HitTestRequest; class HTMLCanvasElement; class HTMLCollection; + class HTMLAllCollection; class HTMLDocument; class HTMLElement; class HTMLFormElement; @@ -79,6 +80,7 @@ namespace WebCore { class HTMLMapElement; class InspectorTimelineAgent; class IntPoint; + class DOMWrapperWorld; class JSNode; class MouseEventWithHitTestResults; class NodeFilter; @@ -315,12 +317,13 @@ public: PassRefPtr links(); PassRefPtr forms(); PassRefPtr anchors(); - PassRefPtr all(); PassRefPtr objects(); PassRefPtr scripts(); PassRefPtr windowNamedItems(const String& name); PassRefPtr documentNamedItems(const String& name); + PassRefPtr all(); + // Find first anchor with the given name. // First searches for an element with the given ID, but if that fails, then looks // for an anchor with the given name. ID matching is always case sensitive, but @@ -819,7 +822,15 @@ public: virtual void postTask(PassRefPtr); // Executes the task on context's thread asynchronously. typedef HashMap JSWrapperCache; - JSWrapperCache& wrapperCache() { return m_wrapperCache; } + typedef HashMap JSWrapperCacheMap; + JSWrapperCacheMap& wrapperCacheMap() { return m_wrapperCacheMap; } + JSWrapperCache* getWrapperCache(DOMWrapperWorld* world) + { + if (JSWrapperCache* wrapperCache = m_wrapperCacheMap.get(world)) + return wrapperCache; + return createWrapperCache(world); + } + JSWrapperCache* createWrapperCache(DOMWrapperWorld*); virtual void finishedParsing(); @@ -1137,7 +1148,7 @@ private: unsigned m_numNodeListCaches; - JSWrapperCache m_wrapperCache; + JSWrapperCacheMap m_wrapperCacheMap; #if ENABLE(DATABASE) RefPtr m_databaseThread; diff --git a/src/3rdparty/webkit/WebCore/dom/Element.cpp b/src/3rdparty/webkit/WebCore/dom/Element.cpp index 621c63a..9edde25 100644 --- a/src/3rdparty/webkit/WebCore/dom/Element.cpp +++ b/src/3rdparty/webkit/WebCore/dom/Element.cpp @@ -1414,7 +1414,7 @@ KURL Element::getURLAttribute(const QualifiedName& name) const ASSERT(isURLAttribute(attribute)); } #endif - return document()->completeURL(getAttribute(name)); + return document()->completeURL(deprecatedParseURL(getAttribute(name))); } } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/dom/EventTarget.cpp b/src/3rdparty/webkit/WebCore/dom/EventTarget.cpp index ceb5221..694e78a 100644 --- a/src/3rdparty/webkit/WebCore/dom/EventTarget.cpp +++ b/src/3rdparty/webkit/WebCore/dom/EventTarget.cpp @@ -192,9 +192,16 @@ bool EventTarget::removeEventListener(const AtomicString& eventType, EventListen // Notify firing events planning to invoke the listener at 'index' that // they have one less listener to invoke. - for (size_t i = 0; i < d->firingEventEndIterators.size(); ++i) { - if (eventType == *d->firingEventEndIterators[i].eventType && index < *d->firingEventEndIterators[i].value) - --*d->firingEventEndIterators[i].value; + for (size_t i = 0; i < d->firingEventIterators.size(); ++i) { + if (eventType != d->firingEventIterators[i].eventType) + continue; + + if (index >= d->firingEventIterators[i].end) + continue; + + --d->firingEventIterators[i].end; + if (index <= d->firingEventIterators[i].iterator) + --d->firingEventIterators[i].iterator; } return true; @@ -232,6 +239,10 @@ bool EventTarget::dispatchEvent(PassRefPtr event, ExceptionCode& ec) ec = EventException::UNSPECIFIED_EVENT_TYPE_ERR; return false; } + + if (!scriptExecutionContext()) + return false; + return dispatchEvent(event); } @@ -259,9 +270,15 @@ bool EventTarget::fireEventListeners(Event* event) RefPtr protect = this; + // Fire all listeners registered for this event. Don't fire listeners removed + // during event dispatch. Also, don't fire event listeners added during event + // dispatch. Conveniently, all new event listeners will be added after 'end', + // so iterating to 'end' naturally excludes new event listeners. + + size_t i = 0; size_t end = entry.size(); - d->firingEventEndIterators.append(FiringEventEndIterator(&event->type(), &end)); - for (size_t i = 0; i < end; ++i) { + d->firingEventIterators.append(FiringEventIterator(event->type(), i, end)); + for ( ; i < end; ++i) { RegisteredEventListener& registeredListener = entry[i]; if (event->eventPhase() == Event::CAPTURING_PHASE && !registeredListener.useCapture) continue; @@ -271,7 +288,7 @@ bool EventTarget::fireEventListeners(Event* event) // event listeners, even though that violates some versions of the DOM spec. registeredListener.listener->handleEvent(scriptExecutionContext(), event); } - d->firingEventEndIterators.removeLast(); + d->firingEventIterators.removeLast(); return !event->defaultPrevented(); } @@ -298,8 +315,10 @@ void EventTarget::removeAllEventListeners() // Notify firing events planning to invoke the listener at 'index' that // they have one less listener to invoke. - for (size_t i = 0; i < d->firingEventEndIterators.size(); ++i) - *d->firingEventEndIterators[i].value = 0; + for (size_t i = 0; i < d->firingEventIterators.size(); ++i) { + d->firingEventIterators[i].iterator = 0; + d->firingEventIterators[i].end = 0; + } } } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/dom/EventTarget.h b/src/3rdparty/webkit/WebCore/dom/EventTarget.h index 2d612e1..9a1975c 100644 --- a/src/3rdparty/webkit/WebCore/dom/EventTarget.h +++ b/src/3rdparty/webkit/WebCore/dom/EventTarget.h @@ -61,24 +61,26 @@ namespace WebCore { typedef int ExceptionCode; - struct FiringEventEndIterator { - FiringEventEndIterator(const AtomicString* eventType, size_t* value) + struct FiringEventIterator { + FiringEventIterator(const AtomicString& eventType, size_t& iterator, size_t& end) : eventType(eventType) - , value(value) + , iterator(iterator) + , end(end) { } - - const AtomicString* eventType; - size_t* value; + + const AtomicString& eventType; + size_t& iterator; + size_t& end; }; - typedef Vector FiringEventEndIteratorVector; + typedef Vector FiringEventIteratorVector; typedef Vector EventListenerVector; typedef HashMap EventListenerMap; struct EventTargetData { EventListenerMap eventListenerMap; - FiringEventEndIteratorVector firingEventEndIterators; + FiringEventIteratorVector firingEventIterators; }; class EventTarget { @@ -209,7 +211,7 @@ namespace WebCore { EventTargetData* d = eventTargetData(); if (!d) return false; - return d->firingEventEndIterators.size() != 0; + return d->firingEventIterators.size() != 0; } inline bool EventTarget::hasEventListeners() diff --git a/src/3rdparty/webkit/WebCore/dom/HTMLAllCollection.idl b/src/3rdparty/webkit/WebCore/dom/HTMLAllCollection.idl deleted file mode 100644 index dee365f..0000000 --- a/src/3rdparty/webkit/WebCore/dom/HTMLAllCollection.idl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -module html { - - // This interface is used for undetectable HTMLCollections. - // An undetectable HTMLCollection behaves like an HTMLCollection - // when used, but the 'typeof' operator returns undefined and - // ToBoolean returns false. - interface HTMLAllCollection : HTMLCollection { - }; - -} diff --git a/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.cpp b/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.cpp index 45d4e23..f7046e3 100644 --- a/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.cpp +++ b/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.cpp @@ -36,6 +36,10 @@ #include #include +#if USE(JSC) +#include "JSDOMWindow.h" +#endif + namespace WebCore { class ProcessMessagesSoonTask : public ScriptExecutionContext::Task { @@ -195,4 +199,20 @@ ScriptExecutionContext::Task::~Task() { } +#if USE(JSC) +JSC::JSGlobalData* ScriptExecutionContext::globalData() +{ + if (isDocument()) + return JSDOMWindow::commonJSGlobalData(); + +#if ENABLE(WORKERS) + if (isWorkerContext()) + return static_cast(this)->script()->globalData(); +#endif + + ASSERT_NOT_REACHED(); + return 0; +} +#endif + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h b/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h index bb78b6f..398afec 100644 --- a/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h +++ b/src/3rdparty/webkit/WebCore/dom/ScriptExecutionContext.h @@ -104,6 +104,10 @@ namespace WebCore { void removeTimeout(int timeoutId); DOMTimer* findTimeout(int timeoutId); +#if USE(JSC) + JSC::JSGlobalData* globalData(); +#endif + protected: // Explicitly override the security origin for this script context. // Note: It is dangerous to change the security origin of a script context diff --git a/src/3rdparty/webkit/WebCore/dom/SelectElement.cpp b/src/3rdparty/webkit/WebCore/dom/SelectElement.cpp index 49713ba..3d2a549 100644 --- a/src/3rdparty/webkit/WebCore/dom/SelectElement.cpp +++ b/src/3rdparty/webkit/WebCore/dom/SelectElement.cpp @@ -479,12 +479,14 @@ bool SelectElement::appendFormData(SelectElementData& data, Element* element, Fo // We return the first one if it was a combobox select if (!successful && !data.multiple() && data.size() <= 1 && items.size()) { OptionElement* optionElement = toOptionElement(items[0]); - const AtomicString& value = optionElement->value(); - if (value.isNull()) - list.appendData(name, optionElement->text().stripWhiteSpace()); - else - list.appendData(name, value); - successful = true; + if (optionElement) { + const AtomicString& value = optionElement->value(); + if (value.isNull()) + list.appendData(name, optionElement->text().stripWhiteSpace()); + else + list.appendData(name, value); + successful = true; + } } return successful; @@ -874,13 +876,19 @@ void SelectElement::typeAheadFind(SelectElementData& data, Element* element, Key int index = (optionToListIndex(data, element, selected >= 0 ? selected : 0) + searchStartOffset) % itemCount; ASSERT(index >= 0); + // Compute a case-folded copy of the prefix string before beginning the search for + // a matching element. This code uses foldCase to work around the fact that + // String::startWith does not fold non-ASCII characters. This code can be changed + // to use startWith once that is fixed. + String prefixWithCaseFolded(prefix.foldCase()); for (int i = 0; i < itemCount; ++i, index = (index + 1) % itemCount) { OptionElement* optionElement = toOptionElement(items[index]); if (!optionElement || items[index]->disabled()) continue; + // Fold the option string and check if its prefix is equal to the folded prefix. String text = optionElement->textIndentedToRespectGroupLabel(); - if (stripLeadingWhiteSpace(text).startsWith(prefix, false)) { + if (stripLeadingWhiteSpace(text).foldCase().startsWith(prefixWithCaseFolded)) { setSelectedIndex(data, element, listToOptionIndex(data, element, index)); if (!data.usesMenuList()) listBoxOnChange(data, element); diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.cpp b/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.cpp index 543927d..30d39e0 100644 --- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.cpp +++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.cpp @@ -79,15 +79,41 @@ bool XMLTokenizer::isWMLDocument() const } #endif -void XMLTokenizer::setCurrentNode(Node* n) +void XMLTokenizer::pushCurrentNode(Node* n) { - bool nodeNeedsReference = n && n != m_doc; - if (nodeNeedsReference) - n->ref(); - if (m_currentNodeIsReferenced) - m_currentNode->deref(); + ASSERT(n); + ASSERT(m_currentNode); + if (n != m_doc) + n->ref(); + m_currentNodeStack.append(m_currentNode); m_currentNode = n; - m_currentNodeIsReferenced = nodeNeedsReference; +} + +void XMLTokenizer::popCurrentNode() +{ + ASSERT(m_currentNode); + ASSERT(m_currentNodeStack.size()); + + if (m_currentNode != m_doc) + m_currentNode->deref(); + + m_currentNode = m_currentNodeStack.last(); + m_currentNodeStack.removeLast(); +} + +void XMLTokenizer::clearCurrentNodeStack() +{ + if (m_currentNode && m_currentNode != m_doc) + m_currentNode->deref(); + m_currentNode = 0; + + if (m_currentNodeStack.size()) { // Aborted parsing. + for (size_t i = m_currentNodeStack.size() - 1; i != 0; --i) + m_currentNodeStack[i]->deref(); + if (m_currentNodeStack[0] && m_currentNodeStack[0] != m_doc) + m_currentNodeStack[0]->deref(); + m_currentNodeStack.clear(); + } } void XMLTokenizer::write(const SegmentedString& s, bool /*appendData*/) @@ -143,7 +169,7 @@ bool XMLTokenizer::enterText() RefPtr newNode = Text::create(m_doc, ""); if (!m_currentNode->addChild(newNode.get())) return false; - setCurrentNode(newNode.get()); + pushCurrentNode(newNode.get()); return true; } @@ -173,10 +199,7 @@ void XMLTokenizer::exitText() if (m_view && m_currentNode && !m_currentNode->attached()) m_currentNode->attach(); - // FIXME: What's the right thing to do if the parent is really 0? - // Just leaving the current node set to the text node doesn't make much sense. - if (Node* par = m_currentNode->parentNode()) - setCurrentNode(par); + popCurrentNode(); } void XMLTokenizer::end() @@ -190,7 +213,7 @@ void XMLTokenizer::end() m_doc->updateStyleSelector(); } - setCurrentNode(0); + clearCurrentNodeStack(); if (!m_parsingFragment) m_doc->finishedParsing(); } diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.h b/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.h index 019a831..e1ee09f 100644 --- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.h +++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizer.h @@ -124,7 +124,10 @@ public: friend bool parseXMLDocumentFragment(const String& chunk, DocumentFragment* fragment, Element* parent); void initializeParserContext(const char* chunk = 0); - void setCurrentNode(Node*); + + void pushCurrentNode(Node*); + void popCurrentNode(); + void clearCurrentNodeStack(); void insertErrorMessageBlock(); @@ -148,7 +151,7 @@ public: Vector m_bufferedText; #endif Node* m_currentNode; - bool m_currentNodeIsReferenced; + Vector m_currentNodeStack; bool m_sawError; bool m_sawXSLTransform; diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerLibxml2.cpp b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerLibxml2.cpp index 6cc0a0c..9aa0961 100644 --- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerLibxml2.cpp +++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerLibxml2.cpp @@ -530,7 +530,6 @@ XMLTokenizer::XMLTokenizer(Document* _doc, FrameView* _view) , m_context(0) , m_pendingCallbacks(new PendingCallbacks) , m_currentNode(_doc) - , m_currentNodeIsReferenced(false) , m_sawError(false) , m_sawXSLTransform(false) , m_sawFirstElement(false) @@ -557,7 +556,6 @@ XMLTokenizer::XMLTokenizer(DocumentFragment* fragment, Element* parentElement) , m_context(0) , m_pendingCallbacks(new PendingCallbacks) , m_currentNode(fragment) - , m_currentNodeIsReferenced(fragment) , m_sawError(false) , m_sawXSLTransform(false) , m_sawFirstElement(false) @@ -576,8 +574,7 @@ XMLTokenizer::XMLTokenizer(DocumentFragment* fragment, Element* parentElement) , m_scriptStartLine(0) , m_parsingFragment(true) { - if (fragment) - fragment->ref(); + fragment->ref(); if (m_doc) m_doc->ref(); @@ -614,7 +611,7 @@ XMLTokenizer::XMLTokenizer(DocumentFragment* fragment, Element* parentElement) XMLTokenizer::~XMLTokenizer() { - setCurrentNode(0); + clearCurrentNodeStack(); if (m_parsingFragment && m_doc) m_doc->deref(); if (m_pendingScript) @@ -801,7 +798,7 @@ void XMLTokenizer::startElementNs(const xmlChar* xmlLocalName, const xmlChar* xm return; } - setCurrentNode(newElement.get()); + pushCurrentNode(newElement.get()); if (m_view && !newElement->attached()) newElement->attach(); @@ -822,22 +819,29 @@ void XMLTokenizer::endElementNs() exitText(); Node* n = m_currentNode; - RefPtr parent = n->parentNode(); n->finishParsingChildren(); if (!n->isElementNode() || !m_view) { - setCurrentNode(parent.get()); + popCurrentNode(); return; } Element* element = static_cast(n); + + // The element's parent may have already been removed from document. + // Parsing continues in this case, but scripts aren't executed. + if (!element->inDocument()) { + popCurrentNode(); + return; + } + ScriptElement* scriptElement = toScriptElement(element); if (!scriptElement) { - setCurrentNode(parent.get()); + popCurrentNode(); return; } - // don't load external scripts for standalone documents (for now) + // Don't load external scripts for standalone documents (for now). ASSERT(!m_pendingScript); m_requestingScript = true; @@ -865,7 +869,7 @@ void XMLTokenizer::endElementNs() m_view->frame()->script()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine)); } m_requestingScript = false; - setCurrentNode(parent.get()); + popCurrentNode(); } void XMLTokenizer::characters(const xmlChar* s, int len) diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp index 65cbc21..c6e73ba 100644 --- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp +++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp @@ -85,7 +85,6 @@ XMLTokenizer::XMLTokenizer(Document* _doc, FrameView* _view) , m_view(_view) , m_wroteText(false) , m_currentNode(_doc) - , m_currentNodeIsReferenced(false) , m_sawError(false) , m_sawXSLTransform(false) , m_sawFirstElement(false) @@ -114,7 +113,6 @@ XMLTokenizer::XMLTokenizer(DocumentFragment* fragment, Element* parentElement) , m_view(0) , m_wroteText(false) , m_currentNode(fragment) - , m_currentNodeIsReferenced(fragment) , m_sawError(false) , m_sawXSLTransform(false) , m_sawFirstElement(false) @@ -133,8 +131,7 @@ XMLTokenizer::XMLTokenizer(DocumentFragment* fragment, Element* parentElement) , m_scriptStartLine(0) , m_parsingFragment(true) { - if (fragment) - fragment->ref(); + fragment->ref(); if (m_doc) m_doc->ref(); @@ -188,7 +185,7 @@ XMLTokenizer::XMLTokenizer(DocumentFragment* fragment, Element* parentElement) XMLTokenizer::~XMLTokenizer() { - setCurrentNode(0); + clearCurrentNodeStack(); if (m_parsingFragment && m_doc) m_doc->deref(); if (m_pendingScript) @@ -569,7 +566,7 @@ void XMLTokenizer::parseStartElement() return; } - setCurrentNode(newElement.get()); + pushCurrentNode(newElement.get()); if (m_view && !newElement->attached()) newElement->attach(); @@ -582,18 +579,26 @@ void XMLTokenizer::parseEndElement() exitText(); Node* n = m_currentNode; - RefPtr parent = n->parentNode(); n->finishParsingChildren(); if (!n->isElementNode() || !m_view) { - setCurrentNode(parent.get()); + if (!m_currentNodeStack.isEmpty()) + popCurrentNode(); return; } Element* element = static_cast(n); + + // The element's parent may have already been removed from document. + // Parsing continues in this case, but scripts aren't executed. + if (!element->inDocument()) { + popCurrentNode(); + return; + } + ScriptElement* scriptElement = toScriptElement(element); if (!scriptElement) { - setCurrentNode(parent.get()); + popCurrentNode(); return; } @@ -625,7 +630,7 @@ void XMLTokenizer::parseEndElement() m_view->frame()->script()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine)); } m_requestingScript = false; - setCurrentNode(parent.get()); + popCurrentNode(); } void XMLTokenizer::parseCharacters() diff --git a/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp b/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp index 89d862f..7a8f025 100644 --- a/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp +++ b/src/3rdparty/webkit/WebCore/editing/ApplyStyleCommand.cpp @@ -334,6 +334,38 @@ static void diffTextDecorations(CSSMutableStyleDeclaration* style, int propertID setTextDecorationProperty(style, newTextDecoration.get(), propertID); } +static bool fontWeightIsBold(CSSStyleDeclaration* style) +{ + ASSERT(style); + RefPtr fontWeight = style->getPropertyCSSValue(CSSPropertyFontWeight); + + if (!fontWeight) + return false; + if (!fontWeight->isPrimitiveValue()) + return false; + + // Because b tag can only bold text, there are only two states in plain html: bold and not bold. + // Collapse all other values to either one of these two states for editing purposes. + switch (static_cast(fontWeight.get())->getIdent()) { + case CSSValue100: + case CSSValue200: + case CSSValue300: + case CSSValue400: + case CSSValue500: + case CSSValueNormal: + return false; + case CSSValueBold: + case CSSValue600: + case CSSValue700: + case CSSValue800: + case CSSValue900: + return true; + } + + ASSERT_NOT_REACHED(); // For CSSValueBolder and CSSValueLighter + return false; // Make compiler happy +} + RefPtr getPropertiesNotInComputedStyle(CSSStyleDeclaration* style, CSSComputedStyleDeclaration* computedStyle) { ASSERT(style); @@ -345,6 +377,9 @@ RefPtr getPropertiesNotInComputedStyle(CSSStyleDecla diffTextDecorations(result.get(), CSSPropertyTextDecoration, computedTextDecorationsInEffect.get()); diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, computedTextDecorationsInEffect.get()); + if (fontWeightIsBold(result.get()) == fontWeightIsBold(computedStyle)) + result->removeProperty(CSSPropertyFontWeight); + return result; } @@ -352,7 +387,6 @@ RefPtr getPropertiesNotInComputedStyle(CSSStyleDecla // e.g. when a user inserts a new paragraph, all properties listed here must be copied to the new paragraph. // FIXME: The current editingStyleProperties contains all inheritableProperties but we may not need to preserve all inheritable properties static const int editingStyleProperties[] = { - CSSPropertyBackgroundColor, // CSS inheritable properties CSSPropertyBorderCollapse, CSSPropertyColor, diff --git a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp index 0496a8f..1617be8 100644 --- a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp +++ b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.cpp @@ -20,7 +20,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" @@ -71,7 +71,7 @@ namespace WebCore { using namespace HTMLNames; -CompositeEditCommand::CompositeEditCommand(Document *document) +CompositeEditCommand::CompositeEditCommand(Document *document) : EditCommand(document) { } @@ -396,7 +396,7 @@ void CompositeEditCommand::rebalanceWhitespaceAt(const Position& position) Node* node = position.node(); if (!node || !node->isTextNode()) return; - Text* textNode = static_cast(node); + Text* textNode = static_cast(node); if (textNode->length() == 0) return; @@ -739,6 +739,129 @@ void CompositeEditCommand::pushPartiallySelectedAnchorElementsDown() setEndingSelection(originalSelection); } +// Clone the paragraph between start and end under blockElement, +// preserving the hierarchy up to outerNode. + +void CompositeEditCommand::cloneParagraphUnderNewElement(Position& start, Position& end, Node* outerNode, Element* blockElement) +{ + // First we clone the outerNode + + RefPtr lastNode = outerNode->cloneNode(isTableElement(outerNode)); + appendNode(lastNode, blockElement); + + if (start.node() != outerNode) { + Vector > ancestors; + + // Insert each node from innerNode to outerNode (excluded) in a list. + for (Node* n = start.node(); n && n != outerNode; n = n->parentNode()) + ancestors.append(n); + + // Clone every node between start.node() and outerBlock. + + for (size_t i = ancestors.size(); i != 0; --i) { + Node* item = ancestors[i - 1].get(); + RefPtr child = item->cloneNode(isTableElement(item)); + appendNode(child, static_cast(lastNode.get())); + lastNode = child.release(); + } + } + + // Handle the case of paragraphs with more than one node, + // cloning all the siblings until end.node() is reached. + + if (start.node() != end.node()) { + for (Node* n = start.node()->nextSibling(); n != NULL; n = n->nextSibling()) { + RefPtr clonedNode = n->cloneNode(true); + insertNodeAfter(clonedNode, lastNode); + lastNode = clonedNode.release(); + if (n == end.node()) + break; + } + } +} + + +// There are bugs in deletion when it removes a fully selected table/list. +// It expands and removes the entire table/list, but will let content +// before and after the table/list collapse onto one line. +// Deleting a paragraph will leave a placeholder. Remove it (and prune +// empty or unrendered parents). + +void CompositeEditCommand::cleanupAfterDeletion() +{ + VisiblePosition caretAfterDelete = endingSelection().visibleStart(); + if (isStartOfParagraph(caretAfterDelete) && isEndOfParagraph(caretAfterDelete)) { + // Note: We want the rightmost candidate. + Position position = caretAfterDelete.deepEquivalent().downstream(); + Node* node = position.node(); + // Normally deletion will leave a br as a placeholder. + if (node->hasTagName(brTag)) + removeNodeAndPruneAncestors(node); + // If the selection to move was empty and in an empty block that + // doesn't require a placeholder to prop itself open (like a bordered + // div or an li), remove it during the move (the list removal code + // expects this behavior). + else if (isBlock(node)) + removeNodeAndPruneAncestors(node); + else if (lineBreakExistsAtPosition(position)) { + // There is a preserved '\n' at caretAfterDelete. + // We can safely assume this is a text node. + Text* textNode = static_cast(node); + if (textNode->length() == 1) + removeNodeAndPruneAncestors(node); + else + deleteTextFromNode(textNode, position.deprecatedEditingOffset(), 1); + } + } +} + +// This is a version of moveParagraph that preserves style by keeping the original markup +// It is currently used only by IndentOutdentCommand but it is meant to be used in the +// future by several other commands such as InsertList and the align commands. +// The blockElement parameter is the element to move the paragraph to, +// outerNode is the top element of the paragraph hierarchy. + +void CompositeEditCommand::moveParagraphWithClones(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, Element* blockElement, Node* outerNode) +{ + ASSERT(outerNode); + ASSERT(blockElement); + + VisiblePosition beforeParagraph = startOfParagraphToMove.previous(); + VisiblePosition afterParagraph(endOfParagraphToMove.next()); + + // We upstream() the end and downstream() the start so that we don't include collapsed whitespace in the move. + // When we paste a fragment, spaces after the end and before the start are treated as though they were rendered. + Position start = startOfParagraphToMove.deepEquivalent().downstream(); + Position end = endOfParagraphToMove.deepEquivalent().upstream(); + + cloneParagraphUnderNewElement(start, end, outerNode, blockElement); + + setEndingSelection(VisibleSelection(start, end, DOWNSTREAM)); + deleteSelection(false, false, false, false); + + // There are bugs in deletion when it removes a fully selected table/list. + // It expands and removes the entire table/list, but will let content + // before and after the table/list collapse onto one line. + + cleanupAfterDeletion(); + + // Add a br if pruning an empty block level element caused a collapse. For example: + // foo^ + //
bar
+ // baz + // Imagine moving 'bar' to ^. 'bar' will be deleted and its div pruned. That would + // cause 'baz' to collapse onto the line with 'foobar' unless we insert a br. + // Must recononicalize these two VisiblePositions after the pruning above. + beforeParagraph = VisiblePosition(beforeParagraph.deepEquivalent()); + afterParagraph = VisiblePosition(afterParagraph.deepEquivalent()); + + if (beforeParagraph.isNotNull() && !isTableElement(beforeParagraph.deepEquivalent().node()) && (!isEndOfParagraph(beforeParagraph) || beforeParagraph == afterParagraph)) { + // FIXME: Trim text between beforeParagraph and afterParagraph if they aren't equal. + insertNodeAt(createBreakElement(document()), beforeParagraph.deepEquivalent()); + } +} + + // This moves a paragraph preserving its style. void CompositeEditCommand::moveParagraph(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, const VisiblePosition& destination, bool preserveSelection, bool preserveStyle) { @@ -784,7 +907,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap VisiblePosition afterParagraph(endOfParagraphToMove.next()); // We upstream() the end and downstream() the start so that we don't include collapsed whitespace in the move. - // When we paste a fragment, spaces after the end and before the start are treated as though they were rendered. + // When we paste a fragment, spaces after the end and before the start are treated as though they were rendered. Position start = startOfParagraphToMove.deepEquivalent().downstream(); Position end = endOfParagraphToMove.deepEquivalent().upstream(); @@ -793,7 +916,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap Position endRangeCompliant = rangeCompliantEquivalent(end); RefPtr range = Range::create(document(), startRangeCompliant.node(), startRangeCompliant.deprecatedEditingOffset(), endRangeCompliant.node(), endRangeCompliant.deprecatedEditingOffset()); - // FIXME: This is an inefficient way to preserve style on nodes in the paragraph to move. It + // FIXME: This is an inefficient way to preserve style on nodes in the paragraph to move. It // shouldn't matter though, since moved paragraphs will usually be quite small. RefPtr fragment = startOfParagraphToMove != endOfParagraphToMove ? createFragmentFromMarkup(document(), createMarkup(range.get(), 0, DoNotAnnotateForInterchange, true), "") : 0; @@ -813,42 +936,14 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap deleteSelection(false, false, false, false); ASSERT(destination.deepEquivalent().node()->inDocument()); - - // There are bugs in deletion when it removes a fully selected table/list. - // It expands and removes the entire table/list, but will let content - // before and after the table/list collapse onto one line. - - // Deleting a paragraph will leave a placeholder. Remove it (and prune - // empty or unrendered parents). - VisiblePosition caretAfterDelete = endingSelection().visibleStart(); - if (isStartOfParagraph(caretAfterDelete) && isEndOfParagraph(caretAfterDelete)) { - // Note: We want the rightmost candidate. - Position position = caretAfterDelete.deepEquivalent().downstream(); - Node* node = position.node(); - // Normally deletion will leave a br as a placeholder. - if (node->hasTagName(brTag)) - removeNodeAndPruneAncestors(node); - // If the selection to move was empty and in an empty block that - // doesn't require a placeholder to prop itself open (like a bordered - // div or an li), remove it during the move (the list removal code - // expects this behavior). - else if (isBlock(node)) - removeNodeAndPruneAncestors(node); - else if (lineBreakExistsAtVisiblePosition(caretAfterDelete)) { - // There is a preserved '\n' at caretAfterDelete. - Text* textNode = static_cast(node); - if (textNode->length() == 1) - removeNodeAndPruneAncestors(node); - else - deleteTextFromNode(textNode, position.deprecatedEditingOffset(), 1); - } - } - // Add a br if pruning an empty block level element caused a collapse. For example: + cleanupAfterDeletion(); + + // Add a br if pruning an empty block level element caused a collapse. For example: // foo^ //
bar
// baz - // Imagine moving 'bar' to ^. 'bar' will be deleted and its div pruned. That would + // Imagine moving 'bar' to ^. 'bar' will be deleted and its div pruned. That would // cause 'baz' to collapse onto the line with 'foobar' unless we insert a br. // Must recononicalize these two VisiblePositions after the pruning above. beforeParagraph = VisiblePosition(beforeParagraph.deepEquivalent()); @@ -912,7 +1007,7 @@ bool CompositeEditCommand::breakOutOfEmptyListItem() removeNodePreservingChildren(listNode->parentNode()); newBlock = createListItemElement(document()); } - // If listNode does NOT appear at the end of the outer list item, then behave as if in a regular paragraph. + // If listNode does NOT appear at the end of the outer list item, then behave as if in a regular paragraph. } else if (blockEnclosingList->hasTagName(olTag) || blockEnclosingList->hasTagName(ulTag)) newBlock = createListItemElement(document()); } @@ -971,7 +1066,7 @@ bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph() // to hold the caret before the highest blockquote. insertNodeBefore(br, highestBlockquote); VisiblePosition atBR(Position(br.get(), 0)); - // If the br we inserted collapsed, for example foo
...
, insert + // If the br we inserted collapsed, for example foo
...
, insert // a second one. if (!isStartOfParagraph(atBR)) insertNodeBefore(createBreakElement(document()), br); @@ -1002,7 +1097,7 @@ bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph() return true; } -// Operations use this function to avoid inserting content into an anchor when at the start or the end of +// Operations use this function to avoid inserting content into an anchor when at the start or the end of // that anchor, as in NSTextView. // FIXME: This is only an approximation of NSTextViews insertion behavior, which varies depending on how // the caret was made. @@ -1022,7 +1117,7 @@ Position CompositeEditCommand::positionAvoidingSpecialElementBoundary(const Posi if (enclosingAnchor && !isBlock(enclosingAnchor)) { VisiblePosition firstInAnchor(firstDeepEditingPositionForNode(enclosingAnchor)); VisiblePosition lastInAnchor(lastDeepEditingPositionForNode(enclosingAnchor)); - // If visually just after the anchor, insert *inside* the anchor unless it's the last + // If visually just after the anchor, insert *inside* the anchor unless it's the last // VisiblePosition in the document, to match NSTextView. if (visiblePos == lastInAnchor) { // Make sure anchors are pushed down before avoiding them so that we don't diff --git a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.h b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.h index 2c6403e..0cceaaa 100644 --- a/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.h +++ b/src/3rdparty/webkit/WebCore/editing/CompositeEditCommand.h @@ -102,6 +102,9 @@ protected: void moveParagraph(const VisiblePosition&, const VisiblePosition&, const VisiblePosition&, bool preserveSelection = false, bool preserveStyle = true); void moveParagraphs(const VisiblePosition&, const VisiblePosition&, const VisiblePosition&, bool preserveSelection = false, bool preserveStyle = true); + void moveParagraphWithClones(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, Element* blockElement, Node* outerNode); + void cloneParagraphUnderNewElement(Position& start, Position& end, Node* outerNode, Element* blockElement); + void cleanupAfterDeletion(); bool breakOutOfEmptyListItem(); bool breakOutOfEmptyMailBlockquotedParagraph(); diff --git a/src/3rdparty/webkit/WebCore/editing/EditorCommand.cpp b/src/3rdparty/webkit/WebCore/editing/EditorCommand.cpp index abd0174..3379b3c 100644 --- a/src/3rdparty/webkit/WebCore/editing/EditorCommand.cpp +++ b/src/3rdparty/webkit/WebCore/editing/EditorCommand.cpp @@ -1291,10 +1291,10 @@ static String valueForeColor(Frame* frame, Event*) // Map of functions +struct CommandEntry { const char* name; EditorInternalCommand command; }; + static const CommandMap& createCommandMap() { - struct CommandEntry { const char* name; EditorInternalCommand command; }; - static const CommandEntry commands[] = { { "AlignCenter", { executeJustifyCenter, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "AlignJustified", { executeJustifyFull, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, diff --git a/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.cpp b/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.cpp index 84fa147..808a2f8 100644 --- a/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.cpp +++ b/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.cpp @@ -67,37 +67,6 @@ IndentOutdentCommand::IndentOutdentCommand(Document* document, EIndentType typeO { } -// This function is a workaround for moveParagraph's tendency to strip blockquotes. It updates lastBlockquote to point to the -// correct level for the current paragraph, and returns a pointer to a placeholder br where the insertion should be performed. -PassRefPtr IndentOutdentCommand::prepareBlockquoteLevelForInsertion(const VisiblePosition& currentParagraph, RefPtr& lastBlockquote) -{ - int currentBlockquoteLevel = 0; - int lastBlockquoteLevel = 0; - Node* node = currentParagraph.deepEquivalent().node(); - while ((node = enclosingNodeWithTag(Position(node->parentNode(), 0), blockquoteTag))) - currentBlockquoteLevel++; - node = lastBlockquote.get(); - while ((node = enclosingNodeWithTag(Position(node->parentNode(), 0), blockquoteTag))) - lastBlockquoteLevel++; - while (currentBlockquoteLevel > lastBlockquoteLevel) { - RefPtr newBlockquote = createIndentBlockquoteElement(document()); - appendNode(newBlockquote, lastBlockquote); - lastBlockquote = newBlockquote; - lastBlockquoteLevel++; - } - while (currentBlockquoteLevel < lastBlockquoteLevel) { - lastBlockquote = static_cast(enclosingNodeWithTag(Position(lastBlockquote->parentNode(), 0), blockquoteTag)); - lastBlockquoteLevel--; - } - RefPtr placeholder = createBreakElement(document()); - appendNode(placeholder, lastBlockquote); - // Add another br before the placeholder if it collapsed. - VisiblePosition visiblePos(Position(placeholder.get(), 0)); - if (!isStartOfParagraph(visiblePos)) - insertNodeBefore(createBreakElement(document()), placeholder); - return placeholder.release(); -} - bool IndentOutdentCommand::tryIndentingAsListItem(const VisiblePosition& endOfCurrentParagraph) { // If our selection is not inside a list, bail out. @@ -117,13 +86,9 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const VisiblePosition& endOfCu Element* nextList = selectedListItem->nextElementSibling(); RefPtr newList = document()->createElement(listNode->tagQName(), false); - RefPtr newListItem = selectedListItem->cloneElementWithoutChildren(); - RefPtr placeholder = createBreakElement(document()); insertNodeBefore(newList, selectedListItem); - appendNode(newListItem, newList); - appendNode(placeholder, newListItem); - moveParagraph(startOfParagraph(endOfCurrentParagraph), endOfCurrentParagraph, VisiblePosition(Position(placeholder, 0)), true); + moveParagraphWithClones(startOfParagraph(endOfCurrentParagraph), endOfCurrentParagraph, newList.get(), selectedListItem); if (canMergeLists(previousList, newList.get())) mergeIdenticalElements(previousList, newList); @@ -137,25 +102,31 @@ void IndentOutdentCommand::indentIntoBlockquote(const VisiblePosition& endOfCurr { Node* enclosingCell = 0; + Position start = startOfParagraph(endOfCurrentParagraph).deepEquivalent(); + enclosingCell = enclosingNodeOfType(start, &isTableCell); + Node* nodeToSplitTo; + if (enclosingCell) + nodeToSplitTo = enclosingCell; + else if (enclosingList(start.node())) + nodeToSplitTo = enclosingBlock(start.node()); + else + nodeToSplitTo = editableRootForPosition(start); + + RefPtr outerBlock = splitTreeToNode(start.node(), nodeToSplitTo); + if (!targetBlockquote) { // Create a new blockquote and insert it as a child of the root editable element. We accomplish // this by splitting all parents of the current paragraph up to that point. targetBlockquote = createIndentBlockquoteElement(document()); - Position start = startOfParagraph(endOfCurrentParagraph).deepEquivalent(); - enclosingCell = enclosingNodeOfType(start, &isTableCell); - Node* nodeToSplitTo = enclosingCell ? enclosingCell : editableRootForPosition(start); - RefPtr startOfNewBlock = splitTreeToNode(start.node(), nodeToSplitTo); - insertNodeBefore(targetBlockquote, startOfNewBlock); + insertNodeBefore(targetBlockquote, outerBlock); } - RefPtr insertionPoint = prepareBlockquoteLevelForInsertion(endOfCurrentParagraph, targetBlockquote); - + moveParagraphWithClones(startOfParagraph(endOfCurrentParagraph), endOfCurrentParagraph, targetBlockquote.get(), outerBlock.get()); + // Don't put the next paragraph in the blockquote we just created for this paragraph unless // the next paragraph is in the same cell. if (enclosingCell && enclosingCell != enclosingNodeOfType(endOfNextParagraph.deepEquivalent(), &isTableCell)) targetBlockquote = 0; - - moveParagraph(startOfParagraph(endOfCurrentParagraph), endOfCurrentParagraph, VisiblePosition(Position(insertionPoint, 0)), true); } void IndentOutdentCommand::indentRegion() @@ -191,8 +162,6 @@ void IndentOutdentCommand::indentRegion() blockquoteForNextIndent = 0; else indentIntoBlockquote(endOfCurrentParagraph, endOfNextParagraph, blockquoteForNextIndent); - // blockquoteForNextIndent maybe updated - // this is due to the way prepareBlockquoteLevelForInsertion was designed. // Sanity check: Make sure our moveParagraph calls didn't remove endOfNextParagraph.deepEquivalent().node() // If somehow we did, return to prevent crashes. if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent().node()->inDocument()) { diff --git a/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.h b/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.h index 419f832f..817b4c8 100644 --- a/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.h +++ b/src/3rdparty/webkit/WebCore/editing/IndentOutdentCommand.h @@ -49,7 +49,6 @@ private: void indentRegion(); void outdentRegion(); void outdentParagraph(); - PassRefPtr prepareBlockquoteLevelForInsertion(const VisiblePosition&, RefPtr&); bool tryIndentingAsListItem(const VisiblePosition&); void indentIntoBlockquote(const VisiblePosition&, const VisiblePosition&, RefPtr&); diff --git a/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp b/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp index 21ca924..0874201 100644 --- a/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp +++ b/src/3rdparty/webkit/WebCore/editing/ReplaceNodeWithSpanCommand.cpp @@ -57,7 +57,9 @@ static void swapInNodePreservingAttributesAndChildren(Node* newNode, Node* nodeT parentNode->insertBefore(newNode, nodeToReplace, ec); ASSERT(!ec); - for (Node* child = nodeToReplace->firstChild(); child; child = child->nextSibling()) { + Node* nextChild; + for (Node* child = nodeToReplace->firstChild(); child; child = nextChild) { + nextChild = child->nextSibling(); newNode->appendChild(child, ec); ASSERT(!ec); } diff --git a/src/3rdparty/webkit/WebCore/editing/SelectionController.cpp b/src/3rdparty/webkit/WebCore/editing/SelectionController.cpp index 7d99916..00672f2 100644 --- a/src/3rdparty/webkit/WebCore/editing/SelectionController.cpp +++ b/src/3rdparty/webkit/WebCore/editing/SelectionController.cpp @@ -725,6 +725,8 @@ bool SelectionController::modify(EAlteration alter, int verticalDistance, bool u if (userTriggered) m_frame->setSelectionGranularity(CharacterGranularity); + m_lastChangeWasHorizontalExtension = alter == EXTEND; + return true; } diff --git a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp index 8780c36..919eb24 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp +++ b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp @@ -226,7 +226,7 @@ findProp (register const char *str, register unsigned int len) { enum { - TOTAL_KEYWORDS = 278, + TOTAL_KEYWORDS = 280, MIN_WORD_LENGTH = 3, MAX_WORD_LENGTH = 43, MIN_HASH_VALUE = 6, @@ -241,67 +241,67 @@ findProp (register const char *str, register unsigned int len) {"zoom", CSSPropertyZoom}, #line 23 "CSSPropertyNames.gperf" {"border", CSSPropertyBorder}, -#line 267 "CSSPropertyNames.gperf" +#line 268 "CSSPropertyNames.gperf" {"marker", CSSPropertyMarker}, #line 24 "CSSPropertyNames.gperf" {"border-bottom", CSSPropertyBorderBottom}, -#line 269 "CSSPropertyNames.gperf" +#line 270 "CSSPropertyNames.gperf" {"marker-mid", CSSPropertyMarkerMid}, #line 78 "CSSPropertyNames.gperf" {"margin", CSSPropertyMargin}, -#line 285 "CSSPropertyNames.gperf" +#line 286 "CSSPropertyNames.gperf" {"kerning", CSSPropertyKerning}, -#line 268 "CSSPropertyNames.gperf" +#line 269 "CSSPropertyNames.gperf" {"marker-end", CSSPropertyMarkerEnd}, #line 79 "CSSPropertyNames.gperf" {"margin-bottom", CSSPropertyMarginBottom}, -#line 251 "CSSPropertyNames.gperf" +#line 252 "CSSPropertyNames.gperf" {"mask", CSSPropertyMask}, -#line 272 "CSSPropertyNames.gperf" +#line 273 "CSSPropertyNames.gperf" {"stroke", CSSPropertyStroke}, #line 111 "CSSPropertyNames.gperf" {"size", CSSPropertySize}, #line 144 "CSSPropertyNames.gperf" {"word-break", CSSPropertyWordBreak}, -#line 287 "CSSPropertyNames.gperf" +#line 288 "CSSPropertyNames.gperf" {"writing-mode", CSSPropertyWritingMode}, -#line 162 "CSSPropertyNames.gperf" +#line 163 "CSSPropertyNames.gperf" {"-webkit-binding", CSSPropertyWebkitBinding}, #line 109 "CSSPropertyNames.gperf" {"resize", CSSPropertyResize}, -#line 266 "CSSPropertyNames.gperf" +#line 267 "CSSPropertyNames.gperf" {"image-rendering", CSSPropertyImageRendering}, #line 149 "CSSPropertyNames.gperf" {"-webkit-animation", CSSPropertyWebkitAnimation}, -#line 165 "CSSPropertyNames.gperf" +#line 166 "CSSPropertyNames.gperf" {"-webkit-border-image", CSSPropertyWebkitBorderImage}, -#line 205 "CSSPropertyNames.gperf" +#line 206 "CSSPropertyNames.gperf" {"-webkit-mask", CSSPropertyWebkitMask}, #line 136 "CSSPropertyNames.gperf" {"top", CSSPropertyTop}, #line 142 "CSSPropertyNames.gperf" {"widows", CSSPropertyWidows}, -#line 270 "CSSPropertyNames.gperf" +#line 271 "CSSPropertyNames.gperf" {"marker-start", CSSPropertyMarkerStart}, #line 154 "CSSPropertyNames.gperf" {"-webkit-animation-name", CSSPropertyWebkitAnimationName}, #line 102 "CSSPropertyNames.gperf" {"page", CSSPropertyPage}, -#line 210 "CSSPropertyNames.gperf" +#line 211 "CSSPropertyNames.gperf" {"-webkit-mask-image", CSSPropertyWebkitMaskImage}, #line 43 "CSSPropertyNames.gperf" {"border-top", CSSPropertyBorderTop}, #line 97 "CSSPropertyNames.gperf" {"padding", CSSPropertyPadding}, -#line 240 "CSSPropertyNames.gperf" +#line 241 "CSSPropertyNames.gperf" {"-webkit-transition", CSSPropertyWebkitTransition}, -#line 211 "CSSPropertyNames.gperf" +#line 212 "CSSPropertyNames.gperf" {"-webkit-mask-origin", CSSPropertyWebkitMaskOrigin}, #line 98 "CSSPropertyNames.gperf" {"padding-bottom", CSSPropertyPaddingBottom}, #line 82 "CSSPropertyNames.gperf" {"margin-top", CSSPropertyMarginTop}, -#line 197 "CSSPropertyNames.gperf" +#line 198 "CSSPropertyNames.gperf" {"-webkit-margin-start", CSSPropertyWebkitMarginStart}, #line 55 "CSSPropertyNames.gperf" {"content", CSSPropertyContent}, @@ -309,35 +309,35 @@ findProp (register const char *str, register unsigned int len) {"position", CSSPropertyPosition}, #line 59 "CSSPropertyNames.gperf" {"direction", CSSPropertyDirection}, -#line 218 "CSSPropertyNames.gperf" +#line 219 "CSSPropertyNames.gperf" {"-webkit-mask-size", CSSPropertyWebkitMaskSize}, #line 112 "CSSPropertyNames.gperf" {"src", CSSPropertySrc}, #line 146 "CSSPropertyNames.gperf" {"word-wrap", CSSPropertyWordWrap}, -#line 220 "CSSPropertyNames.gperf" +#line 221 "CSSPropertyNames.gperf" {"-webkit-nbsp-mode", CSSPropertyWebkitNbspMode}, #line 105 "CSSPropertyNames.gperf" {"page-break-inside", CSSPropertyPageBreakInside}, -#line 215 "CSSPropertyNames.gperf" +#line 216 "CSSPropertyNames.gperf" {"-webkit-mask-repeat", CSSPropertyWebkitMaskRepeat}, #line 101 "CSSPropertyNames.gperf" {"padding-top", CSSPropertyPaddingTop}, -#line 221 "CSSPropertyNames.gperf" +#line 222 "CSSPropertyNames.gperf" {"-webkit-padding-start", CSSPropertyWebkitPaddingStart}, #line 151 "CSSPropertyNames.gperf" {"-webkit-animation-direction", CSSPropertyWebkitAnimationDirection}, -#line 212 "CSSPropertyNames.gperf" +#line 213 "CSSPropertyNames.gperf" {"-webkit-mask-position", CSSPropertyWebkitMaskPosition}, -#line 193 "CSSPropertyNames.gperf" +#line 194 "CSSPropertyNames.gperf" {"-webkit-line-break", CSSPropertyWebkitLineBreak}, -#line 277 "CSSPropertyNames.gperf" +#line 278 "CSSPropertyNames.gperf" {"stroke-miterlimit", CSSPropertyStrokeMiterlimit}, -#line 226 "CSSPropertyNames.gperf" +#line 227 "CSSPropertyNames.gperf" {"-webkit-rtl-ordering", CSSPropertyWebkitRtlOrdering}, -#line 276 "CSSPropertyNames.gperf" +#line 277 "CSSPropertyNames.gperf" {"stroke-linejoin", CSSPropertyStrokeLinejoin}, -#line 282 "CSSPropertyNames.gperf" +#line 283 "CSSPropertyNames.gperf" {"dominant-baseline", CSSPropertyDominantBaseline}, #line 51 "CSSPropertyNames.gperf" {"caption-side", CSSPropertyCaptionSide}, @@ -357,25 +357,25 @@ findProp (register const char *str, register unsigned int len) {"word-spacing", CSSPropertyWordSpacing}, #line 31 "CSSPropertyNames.gperf" {"border-color", CSSPropertyBorderColor}, -#line 199 "CSSPropertyNames.gperf" +#line 200 "CSSPropertyNames.gperf" {"-webkit-marquee", CSSPropertyWebkitMarquee}, #line 25 "CSSPropertyNames.gperf" {"border-bottom-color", CSSPropertyBorderBottomColor}, #line 152 "CSSPropertyNames.gperf" {"-webkit-animation-duration", CSSPropertyWebkitAnimationDuration}, -#line 245 "CSSPropertyNames.gperf" +#line 246 "CSSPropertyNames.gperf" {"-webkit-user-drag", CSSPropertyWebkitUserDrag}, -#line 166 "CSSPropertyNames.gperf" +#line 167 "CSSPropertyNames.gperf" {"-webkit-border-radius", CSSPropertyWebkitBorderRadius}, -#line 209 "CSSPropertyNames.gperf" +#line 210 "CSSPropertyNames.gperf" {"-webkit-mask-composite", CSSPropertyWebkitMaskComposite}, -#line 262 "CSSPropertyNames.gperf" +#line 263 "CSSPropertyNames.gperf" {"color-rendering", CSSPropertyColorRendering}, #line 137 "CSSPropertyNames.gperf" {"unicode-bidi", CSSPropertyUnicodeBidi}, #line 53 "CSSPropertyNames.gperf" {"clip", CSSPropertyClip}, -#line 242 "CSSPropertyNames.gperf" +#line 243 "CSSPropertyNames.gperf" {"-webkit-transition-duration", CSSPropertyWebkitTransitionDuration}, #line 157 "CSSPropertyNames.gperf" {"-webkit-appearance", CSSPropertyWebkitAppearance}, @@ -395,33 +395,35 @@ findProp (register const char *str, register unsigned int len) {"background-origin", CSSPropertyBackgroundOrigin}, #line 57 "CSSPropertyNames.gperf" {"counter-reset", CSSPropertyCounterReset}, -#line 257 "CSSPropertyNames.gperf" +#line 258 "CSSPropertyNames.gperf" {"stop-color", CSSPropertyStopColor}, -#line 280 "CSSPropertyNames.gperf" +#line 281 "CSSPropertyNames.gperf" {"alignment-baseline", CSSPropertyAlignmentBaseline}, #line 22 "CSSPropertyNames.gperf" {"background-size", CSSPropertyBackgroundSize}, -#line 202 "CSSPropertyNames.gperf" +#line 203 "CSSPropertyNames.gperf" {"-webkit-marquee-repetition", CSSPropertyWebkitMarqueeRepetition}, -#line 275 "CSSPropertyNames.gperf" +#line 276 "CSSPropertyNames.gperf" {"stroke-linecap", CSSPropertyStrokeLinecap}, #line 161 "CSSPropertyNames.gperf" {"-webkit-background-origin", CSSPropertyWebkitBackgroundOrigin}, #line 72 "CSSPropertyNames.gperf" {"letter-spacing", CSSPropertyLetterSpacing}, -#line 203 "CSSPropertyNames.gperf" +#line 204 "CSSPropertyNames.gperf" {"-webkit-marquee-speed", CSSPropertyWebkitMarqueeSpeed}, -#line 208 "CSSPropertyNames.gperf" +#line 209 "CSSPropertyNames.gperf" {"-webkit-mask-clip", CSSPropertyWebkitMaskClip}, #line 153 "CSSPropertyNames.gperf" {"-webkit-animation-iteration-count", CSSPropertyWebkitAnimationIterationCount}, -#line 200 "CSSPropertyNames.gperf" - {"-webkit-marquee-direction", CSSPropertyWebkitMarqueeDirection}, #line 201 "CSSPropertyNames.gperf" + {"-webkit-marquee-direction", CSSPropertyWebkitMarqueeDirection}, +#line 162 "CSSPropertyNames.gperf" + {"-webkit-background-size", CSSPropertyWebkitBackgroundSize}, +#line 202 "CSSPropertyNames.gperf" {"-webkit-marquee-increment", CSSPropertyWebkitMarqueeIncrement}, #line 19 "CSSPropertyNames.gperf" {"background-repeat", CSSPropertyBackgroundRepeat}, -#line 222 "CSSPropertyNames.gperf" +#line 223 "CSSPropertyNames.gperf" {"-webkit-perspective", CSSPropertyWebkitPerspective}, #line 110 "CSSPropertyNames.gperf" {"right", CSSPropertyRight}, @@ -433,7 +435,7 @@ findProp (register const char *str, register unsigned int len) {"background-position", CSSPropertyBackgroundPosition}, #line 86 "CSSPropertyNames.gperf" {"min-width", CSSPropertyMinWidth}, -#line 223 "CSSPropertyNames.gperf" +#line 224 "CSSPropertyNames.gperf" {"-webkit-perspective-origin", CSSPropertyWebkitPerspectiveOrigin}, #line 37 "CSSPropertyNames.gperf" {"border-right", CSSPropertyBorderRight}, @@ -445,18 +447,20 @@ findProp (register const char *str, register unsigned int len) {"margin-right", CSSPropertyMarginRight}, #line 29 "CSSPropertyNames.gperf" {"border-bottom-width", CSSPropertyBorderBottomWidth}, -#line 252 "CSSPropertyNames.gperf" +#line 253 "CSSPropertyNames.gperf" {"enable-background", CSSPropertyEnableBackground}, -#line 279 "CSSPropertyNames.gperf" +#line 280 "CSSPropertyNames.gperf" {"stroke-width", CSSPropertyStrokeWidth}, -#line 189 "CSSPropertyNames.gperf" +#line 190 "CSSPropertyNames.gperf" {"-webkit-columns", CSSPropertyWebkitColumns}, -#line 194 "CSSPropertyNames.gperf" +#line 195 "CSSPropertyNames.gperf" {"-webkit-line-clamp", CSSPropertyWebkitLineClamp}, -#line 259 "CSSPropertyNames.gperf" +#line 260 "CSSPropertyNames.gperf" {"color-interpolation", CSSPropertyColorInterpolation}, -#line 163 "CSSPropertyNames.gperf" +#line 164 "CSSPropertyNames.gperf" {"-webkit-border-fit", CSSPropertyWebkitBorderFit}, +#line 289 "CSSPropertyNames.gperf" + {"-webkit-shadow", CSSPropertyWebkitShadow}, #line 65 "CSSPropertyNames.gperf" {"font-size", CSSPropertyFontSize}, #line 30 "CSSPropertyNames.gperf" @@ -467,11 +471,11 @@ findProp (register const char *str, register unsigned int len) {"z-index", CSSPropertyZIndex}, #line 139 "CSSPropertyNames.gperf" {"vertical-align", CSSPropertyVerticalAlign}, -#line 181 "CSSPropertyNames.gperf" +#line 182 "CSSPropertyNames.gperf" {"-webkit-column-break-inside", CSSPropertyWebkitColumnBreakInside}, #line 100 "CSSPropertyNames.gperf" {"padding-right", CSSPropertyPaddingRight}, -#line 247 "CSSPropertyNames.gperf" +#line 248 "CSSPropertyNames.gperf" {"-webkit-user-select", CSSPropertyWebkitUserSelect}, #line 48 "CSSPropertyNames.gperf" {"border-top-width", CSSPropertyBorderTopWidth}, @@ -479,49 +483,49 @@ findProp (register const char *str, register unsigned int len) {"text-rendering", CSSPropertyTextRendering}, #line 88 "CSSPropertyNames.gperf" {"orphans", CSSPropertyOrphans}, -#line 174 "CSSPropertyNames.gperf" +#line 175 "CSSPropertyNames.gperf" {"-webkit-box-orient", CSSPropertyWebkitBoxOrient}, -#line 234 "CSSPropertyNames.gperf" +#line 235 "CSSPropertyNames.gperf" {"-webkit-transform", CSSPropertyWebkitTransform}, -#line 183 "CSSPropertyNames.gperf" +#line 184 "CSSPropertyNames.gperf" {"-webkit-column-gap", CSSPropertyWebkitColumnGap}, -#line 196 "CSSPropertyNames.gperf" +#line 197 "CSSPropertyNames.gperf" {"-webkit-margin-collapse", CSSPropertyWebkitMarginCollapse}, #line 160 "CSSPropertyNames.gperf" {"-webkit-background-composite", CSSPropertyWebkitBackgroundComposite}, -#line 195 "CSSPropertyNames.gperf" +#line 196 "CSSPropertyNames.gperf" {"-webkit-margin-bottom-collapse", CSSPropertyWebkitMarginBottomCollapse}, #line 13 "CSSPropertyNames.gperf" {"background-color", CSSPropertyBackgroundColor}, -#line 231 "CSSPropertyNames.gperf" +#line 232 "CSSPropertyNames.gperf" {"-webkit-text-stroke", CSSPropertyWebkitTextStroke}, -#line 271 "CSSPropertyNames.gperf" +#line 272 "CSSPropertyNames.gperf" {"shape-rendering", CSSPropertyShapeRendering}, #line 104 "CSSPropertyNames.gperf" {"page-break-before", CSSPropertyPageBreakBefore}, -#line 235 "CSSPropertyNames.gperf" +#line 236 "CSSPropertyNames.gperf" {"-webkit-transform-origin", CSSPropertyWebkitTransformOrigin}, #line 103 "CSSPropertyNames.gperf" {"page-break-after", CSSPropertyPageBreakAfter}, #line 90 "CSSPropertyNames.gperf" {"outline-color", CSSPropertyOutlineColor}, -#line 207 "CSSPropertyNames.gperf" +#line 208 "CSSPropertyNames.gperf" {"-webkit-mask-box-image", CSSPropertyWebkitMaskBoxImage}, -#line 178 "CSSPropertyNames.gperf" +#line 179 "CSSPropertyNames.gperf" {"-webkit-box-sizing", CSSPropertyWebkitBoxSizing}, #line 71 "CSSPropertyNames.gperf" {"left", CSSPropertyLeft}, -#line 238 "CSSPropertyNames.gperf" +#line 239 "CSSPropertyNames.gperf" {"-webkit-transform-origin-z", CSSPropertyWebkitTransformOriginZ}, #line 68 "CSSPropertyNames.gperf" {"font-variant", CSSPropertyFontVariant}, #line 62 "CSSPropertyNames.gperf" {"float", CSSPropertyFloat}, -#line 253 "CSSPropertyNames.gperf" +#line 254 "CSSPropertyNames.gperf" {"filter", CSSPropertyFilter}, #line 32 "CSSPropertyNames.gperf" {"border-left", CSSPropertyBorderLeft}, -#line 206 "CSSPropertyNames.gperf" +#line 207 "CSSPropertyNames.gperf" {"-webkit-mask-attachment", CSSPropertyWebkitMaskAttachment}, #line 115 "CSSPropertyNames.gperf" {"text-decoration", CSSPropertyTextDecoration}, @@ -529,31 +533,31 @@ findProp (register const char *str, register unsigned int len) {"margin-left", CSSPropertyMarginLeft}, #line 12 "CSSPropertyNames.gperf" {"background-clip", CSSPropertyBackgroundClip}, -#line 198 "CSSPropertyNames.gperf" +#line 199 "CSSPropertyNames.gperf" {"-webkit-margin-top-collapse", CSSPropertyWebkitMarginTopCollapse}, -#line 167 "CSSPropertyNames.gperf" +#line 168 "CSSPropertyNames.gperf" {"-webkit-border-vertical-spacing", CSSPropertyWebkitBorderVerticalSpacing}, -#line 250 "CSSPropertyNames.gperf" +#line 251 "CSSPropertyNames.gperf" {"clip-rule", CSSPropertyClipRule}, -#line 169 "CSSPropertyNames.gperf" +#line 170 "CSSPropertyNames.gperf" {"-webkit-box-direction", CSSPropertyWebkitBoxDirection}, #line 141 "CSSPropertyNames.gperf" {"white-space", CSSPropertyWhiteSpace}, #line 114 "CSSPropertyNames.gperf" {"text-align", CSSPropertyTextAlign}, -#line 216 "CSSPropertyNames.gperf" +#line 217 "CSSPropertyNames.gperf" {"-webkit-mask-repeat-x", CSSPropertyWebkitMaskRepeatX}, #line 159 "CSSPropertyNames.gperf" {"-webkit-background-clip", CSSPropertyWebkitBackgroundClip}, -#line 217 "CSSPropertyNames.gperf" +#line 218 "CSSPropertyNames.gperf" {"-webkit-mask-repeat-y", CSSPropertyWebkitMaskRepeatY}, -#line 168 "CSSPropertyNames.gperf" +#line 169 "CSSPropertyNames.gperf" {"-webkit-box-align", CSSPropertyWebkitBoxAlign}, -#line 213 "CSSPropertyNames.gperf" +#line 214 "CSSPropertyNames.gperf" {"-webkit-mask-position-x", CSSPropertyWebkitMaskPositionX}, #line 99 "CSSPropertyNames.gperf" {"padding-left", CSSPropertyPaddingLeft}, -#line 190 "CSSPropertyNames.gperf" +#line 191 "CSSPropertyNames.gperf" {"-webkit-font-size-delta", CSSPropertyWebkitFontSizeDelta}, #line 27 "CSSPropertyNames.gperf" {"border-bottom-right-radius", CSSPropertyBorderBottomRightRadius}, @@ -561,61 +565,61 @@ findProp (register const char *str, register unsigned int len) {"opacity", CSSPropertyOpacity}, #line 38 "CSSPropertyNames.gperf" {"border-right-color", CSSPropertyBorderRightColor}, -#line 175 "CSSPropertyNames.gperf" +#line 176 "CSSPropertyNames.gperf" {"-webkit-box-pack", CSSPropertyWebkitBoxPack}, -#line 172 "CSSPropertyNames.gperf" +#line 173 "CSSPropertyNames.gperf" {"-webkit-box-lines", CSSPropertyWebkitBoxLines}, #line 42 "CSSPropertyNames.gperf" {"border-style", CSSPropertyBorderStyle}, -#line 214 "CSSPropertyNames.gperf" +#line 215 "CSSPropertyNames.gperf" {"-webkit-mask-position-y", CSSPropertyWebkitMaskPositionY}, #line 94 "CSSPropertyNames.gperf" {"overflow", CSSPropertyOverflow}, #line 28 "CSSPropertyNames.gperf" {"border-bottom-style", CSSPropertyBorderBottomStyle}, -#line 263 "CSSPropertyNames.gperf" +#line 264 "CSSPropertyNames.gperf" {"fill", CSSPropertyFill}, #line 150 "CSSPropertyNames.gperf" {"-webkit-animation-delay", CSSPropertyWebkitAnimationDelay}, -#line 278 "CSSPropertyNames.gperf" +#line 279 "CSSPropertyNames.gperf" {"stroke-opacity", CSSPropertyStrokeOpacity}, #line 123 "CSSPropertyNames.gperf" {"text-overline", CSSPropertyTextOverline}, -#line 182 "CSSPropertyNames.gperf" +#line 183 "CSSPropertyNames.gperf" {"-webkit-column-count", CSSPropertyWebkitColumnCount}, #line 125 "CSSPropertyNames.gperf" {"text-overline-mode", CSSPropertyTextOverlineMode}, #line 46 "CSSPropertyNames.gperf" {"border-top-right-radius", CSSPropertyBorderTopRightRadius}, -#line 241 "CSSPropertyNames.gperf" +#line 242 "CSSPropertyNames.gperf" {"-webkit-transition-delay", CSSPropertyWebkitTransitionDelay}, #line 60 "CSSPropertyNames.gperf" {"display", CSSPropertyDisplay}, #line 93 "CSSPropertyNames.gperf" {"outline-width", CSSPropertyOutlineWidth}, -#line 243 "CSSPropertyNames.gperf" +#line 244 "CSSPropertyNames.gperf" {"-webkit-transition-property", CSSPropertyWebkitTransitionProperty}, #line 47 "CSSPropertyNames.gperf" {"border-top-style", CSSPropertyBorderTopStyle}, -#line 184 "CSSPropertyNames.gperf" +#line 185 "CSSPropertyNames.gperf" {"-webkit-column-rule", CSSPropertyWebkitColumnRule}, #line 140 "CSSPropertyNames.gperf" {"visibility", CSSPropertyVisibility}, -#line 249 "CSSPropertyNames.gperf" +#line 250 "CSSPropertyNames.gperf" {"clip-path", CSSPropertyClipPath}, -#line 258 "CSSPropertyNames.gperf" +#line 259 "CSSPropertyNames.gperf" {"stop-opacity", CSSPropertyStopOpacity}, -#line 248 "CSSPropertyNames.gperf" +#line 249 "CSSPropertyNames.gperf" {"-webkit-variable-declaration-block", CSSPropertyWebkitVariableDeclarationBlock}, -#line 230 "CSSPropertyNames.gperf" +#line 231 "CSSPropertyNames.gperf" {"-webkit-text-size-adjust", CSSPropertyWebkitTextSizeAdjust}, -#line 232 "CSSPropertyNames.gperf" +#line 233 "CSSPropertyNames.gperf" {"-webkit-text-stroke-color", CSSPropertyWebkitTextStrokeColor}, -#line 256 "CSSPropertyNames.gperf" +#line 257 "CSSPropertyNames.gperf" {"lighting-color", CSSPropertyLightingColor}, #line 70 "CSSPropertyNames.gperf" {"height", CSSPropertyHeight}, -#line 254 "CSSPropertyNames.gperf" +#line 255 "CSSPropertyNames.gperf" {"flood-color", CSSPropertyFloodColor}, #line 156 "CSSPropertyNames.gperf" {"-webkit-animation-timing-function", CSSPropertyWebkitAnimationTimingFunction}, @@ -635,21 +639,21 @@ findProp (register const char *str, register unsigned int len) {"border-left-color", CSSPropertyBorderLeftColor}, #line 74 "CSSPropertyNames.gperf" {"list-style", CSSPropertyListStyle}, -#line 164 "CSSPropertyNames.gperf" +#line 165 "CSSPropertyNames.gperf" {"-webkit-border-horizontal-spacing", CSSPropertyWebkitBorderHorizontalSpacing}, -#line 244 "CSSPropertyNames.gperf" +#line 245 "CSSPropertyNames.gperf" {"-webkit-transition-timing-function", CSSPropertyWebkitTransitionTimingFunction}, #line 75 "CSSPropertyNames.gperf" {"list-style-image", CSSPropertyListStyleImage}, #line 40 "CSSPropertyNames.gperf" {"border-right-width", CSSPropertyBorderRightWidth}, -#line 188 "CSSPropertyNames.gperf" +#line 189 "CSSPropertyNames.gperf" {"-webkit-column-width", CSSPropertyWebkitColumnWidth}, #line 20 "CSSPropertyNames.gperf" {"background-repeat-x", CSSPropertyBackgroundRepeatX}, #line 69 "CSSPropertyNames.gperf" {"font-weight", CSSPropertyFontWeight}, -#line 261 "CSSPropertyNames.gperf" +#line 262 "CSSPropertyNames.gperf" {"color-profile", CSSPropertyColorProfile}, #line 45 "CSSPropertyNames.gperf" {"border-top-left-radius", CSSPropertyBorderTopLeftRadius}, @@ -659,21 +663,21 @@ findProp (register const char *str, register unsigned int len) {"background-position-x", CSSPropertyBackgroundPositionX}, #line 84 "CSSPropertyNames.gperf" {"max-width", CSSPropertyMaxWidth}, -#line 224 "CSSPropertyNames.gperf" +#line 225 "CSSPropertyNames.gperf" {"-webkit-perspective-origin-x", CSSPropertyWebkitPerspectiveOriginX}, -#line 180 "CSSPropertyNames.gperf" +#line 181 "CSSPropertyNames.gperf" {"-webkit-column-break-before", CSSPropertyWebkitColumnBreakBefore}, -#line 179 "CSSPropertyNames.gperf" +#line 180 "CSSPropertyNames.gperf" {"-webkit-column-break-after", CSSPropertyWebkitColumnBreakAfter}, #line 18 "CSSPropertyNames.gperf" {"background-position-y", CSSPropertyBackgroundPositionY}, -#line 191 "CSSPropertyNames.gperf" +#line 192 "CSSPropertyNames.gperf" {"-webkit-font-smoothing", CSSPropertyWebkitFontSmoothing}, -#line 173 "CSSPropertyNames.gperf" +#line 174 "CSSPropertyNames.gperf" {"-webkit-box-ordinal-group", CSSPropertyWebkitBoxOrdinalGroup}, -#line 204 "CSSPropertyNames.gperf" +#line 205 "CSSPropertyNames.gperf" {"-webkit-marquee-style", CSSPropertyWebkitMarqueeStyle}, -#line 225 "CSSPropertyNames.gperf" +#line 226 "CSSPropertyNames.gperf" {"-webkit-perspective-origin-y", CSSPropertyWebkitPerspectiveOriginY}, #line 129 "CSSPropertyNames.gperf" {"text-shadow", CSSPropertyTextShadow}, @@ -683,13 +687,13 @@ findProp (register const char *str, register unsigned int len) {"list-style-position", CSSPropertyListStylePosition}, #line 113 "CSSPropertyNames.gperf" {"table-layout", CSSPropertyTableLayout}, -#line 177 "CSSPropertyNames.gperf" +#line 178 "CSSPropertyNames.gperf" {"-webkit-box-shadow", CSSPropertyWebkitBoxShadow}, #line 124 "CSSPropertyNames.gperf" {"text-overline-color", CSSPropertyTextOverlineColor}, #line 61 "CSSPropertyNames.gperf" {"empty-cells", CSSPropertyEmptyCells}, -#line 233 "CSSPropertyNames.gperf" +#line 234 "CSSPropertyNames.gperf" {"-webkit-text-stroke-width", CSSPropertyWebkitTextStrokeWidth}, #line 130 "CSSPropertyNames.gperf" {"text-transform", CSSPropertyTextTransform}, @@ -697,25 +701,25 @@ findProp (register const char *str, register unsigned int len) {"font-stretch", CSSPropertyFontStretch}, #line 92 "CSSPropertyNames.gperf" {"outline-style", CSSPropertyOutlineStyle}, -#line 286 "CSSPropertyNames.gperf" +#line 287 "CSSPropertyNames.gperf" {"text-anchor", CSSPropertyTextAnchor}, -#line 185 "CSSPropertyNames.gperf" +#line 186 "CSSPropertyNames.gperf" {"-webkit-column-rule-color", CSSPropertyWebkitColumnRuleColor}, -#line 273 "CSSPropertyNames.gperf" +#line 274 "CSSPropertyNames.gperf" {"stroke-dasharray", CSSPropertyStrokeDasharray}, #line 35 "CSSPropertyNames.gperf" {"border-left-width", CSSPropertyBorderLeftWidth}, -#line 265 "CSSPropertyNames.gperf" +#line 266 "CSSPropertyNames.gperf" {"fill-rule", CSSPropertyFillRule}, -#line 236 "CSSPropertyNames.gperf" +#line 237 "CSSPropertyNames.gperf" {"-webkit-transform-origin-x", CSSPropertyWebkitTransformOriginX}, -#line 281 "CSSPropertyNames.gperf" +#line 282 "CSSPropertyNames.gperf" {"baseline-shift", CSSPropertyBaselineShift}, #line 132 "CSSPropertyNames.gperf" {"text-underline-color", CSSPropertyTextUnderlineColor}, -#line 237 "CSSPropertyNames.gperf" +#line 238 "CSSPropertyNames.gperf" {"-webkit-transform-origin-y", CSSPropertyWebkitTransformOriginY}, -#line 260 "CSSPropertyNames.gperf" +#line 261 "CSSPropertyNames.gperf" {"color-interpolation-filters", CSSPropertyColorInterpolationFilters}, #line 39 "CSSPropertyNames.gperf" {"border-right-style", CSSPropertyBorderRightStyle}, @@ -727,63 +731,63 @@ findProp (register const char *str, register unsigned int len) {"overflow-x", CSSPropertyOverflowX}, #line 122 "CSSPropertyNames.gperf" {"text-overflow", CSSPropertyTextOverflow}, -#line 176 "CSSPropertyNames.gperf" +#line 177 "CSSPropertyNames.gperf" {"-webkit-box-reflect", CSSPropertyWebkitBoxReflect}, -#line 246 "CSSPropertyNames.gperf" +#line 247 "CSSPropertyNames.gperf" {"-webkit-user-modify", CSSPropertyWebkitUserModify}, -#line 187 "CSSPropertyNames.gperf" +#line 188 "CSSPropertyNames.gperf" {"-webkit-column-rule-width", CSSPropertyWebkitColumnRuleWidth}, #line 96 "CSSPropertyNames.gperf" {"overflow-y", CSSPropertyOverflowY}, -#line 239 "CSSPropertyNames.gperf" +#line 240 "CSSPropertyNames.gperf" {"-webkit-transform-style", CSSPropertyWebkitTransformStyle}, #line 91 "CSSPropertyNames.gperf" {"outline-offset", CSSPropertyOutlineOffset}, #line 135 "CSSPropertyNames.gperf" {"text-underline-width", CSSPropertyTextUnderlineWidth}, -#line 255 "CSSPropertyNames.gperf" +#line 256 "CSSPropertyNames.gperf" {"flood-opacity", CSSPropertyFloodOpacity}, #line 34 "CSSPropertyNames.gperf" {"border-left-style", CSSPropertyBorderLeftStyle}, #line 83 "CSSPropertyNames.gperf" {"max-height", CSSPropertyMaxHeight}, -#line 229 "CSSPropertyNames.gperf" +#line 230 "CSSPropertyNames.gperf" {"-webkit-text-security", CSSPropertyWebkitTextSecurity}, -#line 192 "CSSPropertyNames.gperf" +#line 193 "CSSPropertyNames.gperf" {"-webkit-highlight", CSSPropertyWebkitHighlight}, -#line 264 "CSSPropertyNames.gperf" +#line 265 "CSSPropertyNames.gperf" {"fill-opacity", CSSPropertyFillOpacity}, -#line 274 "CSSPropertyNames.gperf" +#line 275 "CSSPropertyNames.gperf" {"stroke-dashoffset", CSSPropertyStrokeDashoffset}, #line 126 "CSSPropertyNames.gperf" {"text-overline-style", CSSPropertyTextOverlineStyle}, #line 77 "CSSPropertyNames.gperf" {"list-style-type", CSSPropertyListStyleType}, -#line 219 "CSSPropertyNames.gperf" +#line 220 "CSSPropertyNames.gperf" {"-webkit-match-nearest-mail-blockquote-color", CSSPropertyWebkitMatchNearestMailBlockquoteColor}, -#line 186 "CSSPropertyNames.gperf" +#line 187 "CSSPropertyNames.gperf" {"-webkit-column-rule-style", CSSPropertyWebkitColumnRuleStyle}, #line 158 "CSSPropertyNames.gperf" {"-webkit-backface-visibility", CSSPropertyWebkitBackfaceVisibility}, -#line 228 "CSSPropertyNames.gperf" +#line 229 "CSSPropertyNames.gperf" {"-webkit-text-fill-color", CSSPropertyWebkitTextFillColor}, #line 134 "CSSPropertyNames.gperf" {"text-underline-style", CSSPropertyTextUnderlineStyle}, -#line 284 "CSSPropertyNames.gperf" +#line 285 "CSSPropertyNames.gperf" {"glyph-orientation-vertical", CSSPropertyGlyphOrientationVertical}, #line 64 "CSSPropertyNames.gperf" {"font-family", CSSPropertyFontFamily}, -#line 170 "CSSPropertyNames.gperf" +#line 171 "CSSPropertyNames.gperf" {"-webkit-box-flex", CSSPropertyWebkitBoxFlex}, #line 117 "CSSPropertyNames.gperf" {"text-line-through", CSSPropertyTextLineThrough}, #line 119 "CSSPropertyNames.gperf" {"text-line-through-mode", CSSPropertyTextLineThroughMode}, -#line 227 "CSSPropertyNames.gperf" +#line 228 "CSSPropertyNames.gperf" {"-webkit-text-decorations-in-effect", CSSPropertyWebkitTextDecorationsInEffect}, -#line 283 "CSSPropertyNames.gperf" +#line 284 "CSSPropertyNames.gperf" {"glyph-orientation-horizontal", CSSPropertyGlyphOrientationHorizontal}, -#line 171 "CSSPropertyNames.gperf" +#line 172 "CSSPropertyNames.gperf" {"-webkit-box-flex-group", CSSPropertyWebkitBoxFlexGroup}, #line 118 "CSSPropertyNames.gperf" {"text-line-through-color", CSSPropertyTextLineThroughColor}, @@ -825,113 +829,113 @@ findProp (register const char *str, register unsigned int len) -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, 81, -1, 82, 83, -1, -1, 84, 85, -1, -1, -1, 86, -1, 87, 88, -1, -1, - -1, -1, -1, 89, -1, 90, -1, -1, -1, -1, - 91, -1, -1, -1, -1, -1, -1, 92, -1, -1, - -1, -1, -1, -1, 93, -1, -1, -1, -1, -1, - 94, -1, 95, -1, -1, 96, -1, -1, -1, 97, - -1, -1, -1, -1, 98, -1, 99, 100, -1, -1, - -1, -1, 101, -1, 102, -1, -1, 103, -1, 104, - -1, -1, -1, -1, -1, -1, -1, 105, -1, -1, - -1, -1, 106, -1, -1, -1, -1, -1, -1, -1, - 107, -1, -1, 108, 109, -1, -1, -1, 110, -1, - -1, -1, -1, -1, 111, 112, 113, 114, -1, 115, - -1, -1, -1, -1, -1, -1, -1, 116, 117, 118, - -1, 119, -1, -1, 120, -1, -1, 121, 122, -1, - -1, -1, 123, 124, -1, -1, -1, -1, 125, -1, - -1, -1, -1, 126, -1, 127, 128, -1, -1, 129, - 130, -1, 131, -1, 132, -1, 133, -1, 134, -1, - -1, -1, 135, 136, 137, -1, 138, 139, -1, -1, - 140, 141, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 142, -1, 143, -1, -1, -1, -1, -1, -1, - 144, 145, -1, -1, -1, 146, -1, 147, -1, -1, - -1, 148, -1, -1, 149, -1, 150, -1, -1, -1, - -1, 151, -1, -1, -1, 152, 153, -1, 154, -1, + -1, -1, -1, 89, -1, 90, -1, -1, 91, -1, + 92, -1, -1, -1, -1, -1, -1, 93, -1, -1, + -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, + 95, -1, 96, -1, -1, 97, -1, -1, -1, 98, + -1, -1, -1, -1, 99, -1, 100, 101, -1, -1, + -1, -1, 102, -1, 103, -1, -1, 104, -1, 105, + -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, + -1, -1, 107, -1, -1, -1, -1, -1, -1, -1, + 108, -1, -1, 109, 110, -1, -1, -1, 111, 112, + -1, -1, -1, -1, 113, 114, 115, 116, -1, 117, + -1, -1, -1, -1, -1, -1, -1, 118, 119, 120, + -1, 121, -1, -1, 122, -1, -1, 123, 124, -1, + -1, -1, 125, 126, -1, -1, -1, -1, 127, -1, + -1, -1, -1, 128, -1, 129, 130, -1, -1, 131, + 132, -1, 133, -1, 134, -1, 135, -1, 136, -1, + -1, -1, 137, 138, 139, -1, 140, 141, -1, -1, + 142, 143, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 144, -1, 145, -1, -1, -1, -1, -1, -1, + 146, 147, -1, -1, -1, 148, -1, 149, -1, -1, + -1, 150, -1, -1, 151, -1, 152, -1, -1, -1, + -1, 153, -1, -1, -1, 154, 155, -1, 156, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 155, 156, 157, -1, - -1, -1, 158, 159, -1, -1, 160, 161, 162, -1, - -1, 163, 164, -1, -1, -1, -1, 165, 166, -1, - -1, -1, -1, 167, 168, -1, -1, -1, -1, 169, - -1, -1, -1, 170, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 171, -1, -1, -1, 172, -1, - 173, -1, -1, 174, -1, -1, -1, -1, 175, 176, - -1, -1, 177, 178, -1, -1, -1, -1, -1, -1, - -1, -1, 179, -1, -1, -1, 180, -1, -1, 181, - 182, -1, -1, -1, -1, -1, -1, -1, -1, 183, - -1, -1, 184, -1, 185, -1, -1, -1, -1, 186, - 187, -1, -1, -1, 188, -1, -1, -1, -1, -1, - -1, 189, -1, -1, -1, -1, 190, -1, 191, 192, - 193, -1, -1, 194, 195, -1, -1, -1, -1, -1, - 196, 197, 198, -1, -1, 199, -1, -1, -1, -1, - -1, -1, -1, 200, 201, -1, -1, -1, -1, -1, - -1, 202, -1, 203, -1, -1, -1, -1, -1, -1, - 204, -1, -1, -1, 205, -1, 206, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 207, -1, - -1, -1, 208, -1, 209, -1, 210, -1, -1, 211, - -1, -1, -1, 212, -1, -1, -1, 213, -1, -1, - -1, 214, -1, -1, -1, -1, 215, 216, -1, -1, - 217, 218, -1, 219, -1, -1, 220, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 221, -1, -1, 222, - -1, -1, -1, -1, -1, -1, -1, 223, 224, 225, - -1, 226, -1, -1, -1, 227, -1, -1, -1, 228, - -1, -1, 229, -1, -1, -1, -1, -1, 230, -1, - -1, 231, -1, -1, -1, -1, -1, -1, -1, -1, - 232, -1, -1, -1, -1, -1, 233, 234, -1, -1, - -1, -1, -1, -1, 235, -1, -1, -1, -1, -1, - -1, 236, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, - 238, 239, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 157, 158, 159, -1, + -1, -1, 160, 161, -1, -1, 162, 163, 164, -1, + -1, 165, 166, -1, -1, -1, -1, 167, 168, -1, + -1, -1, -1, 169, 170, -1, -1, -1, -1, 171, + -1, -1, -1, 172, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 173, -1, -1, -1, 174, -1, + 175, -1, -1, 176, -1, -1, -1, -1, 177, 178, + -1, -1, 179, 180, -1, -1, -1, -1, -1, -1, + -1, -1, 181, -1, -1, -1, 182, -1, -1, 183, + 184, -1, -1, -1, -1, -1, -1, -1, -1, 185, + -1, -1, 186, -1, 187, -1, -1, -1, -1, 188, + 189, -1, -1, -1, 190, -1, -1, -1, -1, -1, + -1, 191, -1, -1, -1, -1, 192, -1, 193, 194, + 195, -1, -1, 196, 197, -1, -1, -1, -1, -1, + 198, 199, 200, -1, -1, 201, -1, -1, -1, -1, + -1, -1, -1, 202, 203, -1, -1, -1, -1, -1, + -1, 204, -1, 205, -1, -1, -1, -1, -1, -1, + 206, -1, -1, -1, 207, -1, 208, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 209, -1, + -1, -1, 210, -1, 211, -1, 212, -1, -1, 213, + -1, -1, -1, 214, -1, -1, -1, 215, -1, -1, + -1, 216, -1, -1, -1, -1, 217, 218, -1, -1, + 219, 220, -1, 221, -1, -1, 222, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 223, -1, -1, 224, + -1, -1, -1, -1, -1, -1, -1, 225, 226, 227, + -1, 228, -1, -1, -1, 229, -1, -1, -1, 230, + -1, -1, 231, -1, -1, -1, -1, -1, 232, -1, + -1, 233, -1, -1, -1, -1, -1, -1, -1, -1, + 234, -1, -1, -1, -1, -1, 235, 236, -1, -1, + -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, + -1, 238, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 239, + 240, 241, -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, 240, -1, -1, -1, -1, -1, 241, -1, - -1, -1, -1, -1, -1, 242, -1, -1, -1, -1, + -1, -1, 242, -1, -1, -1, -1, -1, 243, -1, + -1, -1, -1, -1, -1, 244, -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, 243, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 245, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 244, -1, -1, 245, -1, -1, -1, -1, -1, 246, - -1, -1, -1, -1, 247, 248, -1, -1, -1, -1, - 249, -1, -1, 250, -1, -1, -1, -1, -1, -1, + 246, -1, -1, 247, -1, -1, -1, -1, -1, 248, + -1, -1, -1, -1, 249, 250, -1, -1, -1, -1, + 251, -1, -1, 252, -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, 251, - -1, -1, -1, -1, -1, 252, -1, -1, -1, -1, - -1, -1, -1, 253, -1, -1, -1, -1, -1, -1, - -1, -1, 254, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 253, + -1, -1, -1, -1, -1, 254, -1, -1, -1, -1, + -1, -1, -1, 255, -1, -1, -1, -1, -1, -1, + -1, -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 255, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 257, -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, 256, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 258, -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, 257, -1, -1, -1, -1, 258, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 259, -1, 260, + -1, -1, 259, -1, -1, -1, -1, 260, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 261, -1, 262, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 261, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 262, -1, - 263, -1, -1, -1, -1, -1, -1, 264, -1, -1, - -1, -1, -1, 265, -1, -1, -1, -1, -1, -1, + 263, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 264, -1, + 265, -1, -1, -1, -1, -1, -1, 266, -1, -1, + -1, -1, -1, 267, -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, - 266, -1, -1, -1, -1, -1, 267, -1, -1, -1, + 268, -1, -1, -1, -1, -1, 269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 268, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 269, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 270, -1, -1, -1, -1, 271, -1, -1, + -1, -1, 272, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 272, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 273, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 275, -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, @@ -939,10 +943,10 @@ findProp (register const char *str, register unsigned int len) -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, 274, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 276, -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, 275, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 277, -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, @@ -956,7 +960,7 @@ findProp (register const char *str, register unsigned int len) -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, 276, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 278, -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, @@ -976,7 +980,7 @@ findProp (register const char *str, register unsigned int len) -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, 277 + -1, -1, -1, 279 }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) @@ -998,9 +1002,9 @@ findProp (register const char *str, register unsigned int len) } return 0; } -#line 288 "CSSPropertyNames.gperf" +#line 290 "CSSPropertyNames.gperf" -static const char * const propertyNameStrings[278] = { +static const char * const propertyNameStrings[280] = { "background", "background-attachment", "background-clip", @@ -1153,6 +1157,7 @@ static const char * const propertyNameStrings[278] = { "-webkit-background-clip", "-webkit-background-composite", "-webkit-background-origin", +"-webkit-background-size", "-webkit-binding", "-webkit-border-fit", "-webkit-border-horizontal-spacing", @@ -1279,6 +1284,7 @@ static const char * const propertyNameStrings[278] = { "kerning", "text-anchor", "writing-mode", +"-webkit-shadow", }; const char* getPropertyName(CSSPropertyID id) { diff --git a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h index f1332e3..8957af8 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h +++ b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.h @@ -157,136 +157,138 @@ enum CSSPropertyID { CSSPropertyWebkitBackgroundClip = 1150, CSSPropertyWebkitBackgroundComposite = 1151, CSSPropertyWebkitBackgroundOrigin = 1152, - CSSPropertyWebkitBinding = 1153, - CSSPropertyWebkitBorderFit = 1154, - CSSPropertyWebkitBorderHorizontalSpacing = 1155, - CSSPropertyWebkitBorderImage = 1156, - CSSPropertyWebkitBorderRadius = 1157, - CSSPropertyWebkitBorderVerticalSpacing = 1158, - CSSPropertyWebkitBoxAlign = 1159, - CSSPropertyWebkitBoxDirection = 1160, - CSSPropertyWebkitBoxFlex = 1161, - CSSPropertyWebkitBoxFlexGroup = 1162, - CSSPropertyWebkitBoxLines = 1163, - CSSPropertyWebkitBoxOrdinalGroup = 1164, - CSSPropertyWebkitBoxOrient = 1165, - CSSPropertyWebkitBoxPack = 1166, - CSSPropertyWebkitBoxReflect = 1167, - CSSPropertyWebkitBoxShadow = 1168, - CSSPropertyWebkitBoxSizing = 1169, - CSSPropertyWebkitColumnBreakAfter = 1170, - CSSPropertyWebkitColumnBreakBefore = 1171, - CSSPropertyWebkitColumnBreakInside = 1172, - CSSPropertyWebkitColumnCount = 1173, - CSSPropertyWebkitColumnGap = 1174, - CSSPropertyWebkitColumnRule = 1175, - CSSPropertyWebkitColumnRuleColor = 1176, - CSSPropertyWebkitColumnRuleStyle = 1177, - CSSPropertyWebkitColumnRuleWidth = 1178, - CSSPropertyWebkitColumnWidth = 1179, - CSSPropertyWebkitColumns = 1180, - CSSPropertyWebkitFontSizeDelta = 1181, - CSSPropertyWebkitFontSmoothing = 1182, - CSSPropertyWebkitHighlight = 1183, - CSSPropertyWebkitLineBreak = 1184, - CSSPropertyWebkitLineClamp = 1185, - CSSPropertyWebkitMarginBottomCollapse = 1186, - CSSPropertyWebkitMarginCollapse = 1187, - CSSPropertyWebkitMarginStart = 1188, - CSSPropertyWebkitMarginTopCollapse = 1189, - CSSPropertyWebkitMarquee = 1190, - CSSPropertyWebkitMarqueeDirection = 1191, - CSSPropertyWebkitMarqueeIncrement = 1192, - CSSPropertyWebkitMarqueeRepetition = 1193, - CSSPropertyWebkitMarqueeSpeed = 1194, - CSSPropertyWebkitMarqueeStyle = 1195, - CSSPropertyWebkitMask = 1196, - CSSPropertyWebkitMaskAttachment = 1197, - CSSPropertyWebkitMaskBoxImage = 1198, - CSSPropertyWebkitMaskClip = 1199, - CSSPropertyWebkitMaskComposite = 1200, - CSSPropertyWebkitMaskImage = 1201, - CSSPropertyWebkitMaskOrigin = 1202, - CSSPropertyWebkitMaskPosition = 1203, - CSSPropertyWebkitMaskPositionX = 1204, - CSSPropertyWebkitMaskPositionY = 1205, - CSSPropertyWebkitMaskRepeat = 1206, - CSSPropertyWebkitMaskRepeatX = 1207, - CSSPropertyWebkitMaskRepeatY = 1208, - CSSPropertyWebkitMaskSize = 1209, - CSSPropertyWebkitMatchNearestMailBlockquoteColor = 1210, - CSSPropertyWebkitNbspMode = 1211, - CSSPropertyWebkitPaddingStart = 1212, - CSSPropertyWebkitPerspective = 1213, - CSSPropertyWebkitPerspectiveOrigin = 1214, - CSSPropertyWebkitPerspectiveOriginX = 1215, - CSSPropertyWebkitPerspectiveOriginY = 1216, - CSSPropertyWebkitRtlOrdering = 1217, - CSSPropertyWebkitTextDecorationsInEffect = 1218, - CSSPropertyWebkitTextFillColor = 1219, - CSSPropertyWebkitTextSecurity = 1220, - CSSPropertyWebkitTextSizeAdjust = 1221, - CSSPropertyWebkitTextStroke = 1222, - CSSPropertyWebkitTextStrokeColor = 1223, - CSSPropertyWebkitTextStrokeWidth = 1224, - CSSPropertyWebkitTransform = 1225, - CSSPropertyWebkitTransformOrigin = 1226, - CSSPropertyWebkitTransformOriginX = 1227, - CSSPropertyWebkitTransformOriginY = 1228, - CSSPropertyWebkitTransformOriginZ = 1229, - CSSPropertyWebkitTransformStyle = 1230, - CSSPropertyWebkitTransition = 1231, - CSSPropertyWebkitTransitionDelay = 1232, - CSSPropertyWebkitTransitionDuration = 1233, - CSSPropertyWebkitTransitionProperty = 1234, - CSSPropertyWebkitTransitionTimingFunction = 1235, - CSSPropertyWebkitUserDrag = 1236, - CSSPropertyWebkitUserModify = 1237, - CSSPropertyWebkitUserSelect = 1238, - CSSPropertyWebkitVariableDeclarationBlock = 1239, - CSSPropertyClipPath = 1240, - CSSPropertyClipRule = 1241, - CSSPropertyMask = 1242, - CSSPropertyEnableBackground = 1243, - CSSPropertyFilter = 1244, - CSSPropertyFloodColor = 1245, - CSSPropertyFloodOpacity = 1246, - CSSPropertyLightingColor = 1247, - CSSPropertyStopColor = 1248, - CSSPropertyStopOpacity = 1249, - CSSPropertyColorInterpolation = 1250, - CSSPropertyColorInterpolationFilters = 1251, - CSSPropertyColorProfile = 1252, - CSSPropertyColorRendering = 1253, - CSSPropertyFill = 1254, - CSSPropertyFillOpacity = 1255, - CSSPropertyFillRule = 1256, - CSSPropertyImageRendering = 1257, - CSSPropertyMarker = 1258, - CSSPropertyMarkerEnd = 1259, - CSSPropertyMarkerMid = 1260, - CSSPropertyMarkerStart = 1261, - CSSPropertyShapeRendering = 1262, - CSSPropertyStroke = 1263, - CSSPropertyStrokeDasharray = 1264, - CSSPropertyStrokeDashoffset = 1265, - CSSPropertyStrokeLinecap = 1266, - CSSPropertyStrokeLinejoin = 1267, - CSSPropertyStrokeMiterlimit = 1268, - CSSPropertyStrokeOpacity = 1269, - CSSPropertyStrokeWidth = 1270, - CSSPropertyAlignmentBaseline = 1271, - CSSPropertyBaselineShift = 1272, - CSSPropertyDominantBaseline = 1273, - CSSPropertyGlyphOrientationHorizontal = 1274, - CSSPropertyGlyphOrientationVertical = 1275, - CSSPropertyKerning = 1276, - CSSPropertyTextAnchor = 1277, - CSSPropertyWritingMode = 1278, + CSSPropertyWebkitBackgroundSize = 1153, + CSSPropertyWebkitBinding = 1154, + CSSPropertyWebkitBorderFit = 1155, + CSSPropertyWebkitBorderHorizontalSpacing = 1156, + CSSPropertyWebkitBorderImage = 1157, + CSSPropertyWebkitBorderRadius = 1158, + CSSPropertyWebkitBorderVerticalSpacing = 1159, + CSSPropertyWebkitBoxAlign = 1160, + CSSPropertyWebkitBoxDirection = 1161, + CSSPropertyWebkitBoxFlex = 1162, + CSSPropertyWebkitBoxFlexGroup = 1163, + CSSPropertyWebkitBoxLines = 1164, + CSSPropertyWebkitBoxOrdinalGroup = 1165, + CSSPropertyWebkitBoxOrient = 1166, + CSSPropertyWebkitBoxPack = 1167, + CSSPropertyWebkitBoxReflect = 1168, + CSSPropertyWebkitBoxShadow = 1169, + CSSPropertyWebkitBoxSizing = 1170, + CSSPropertyWebkitColumnBreakAfter = 1171, + CSSPropertyWebkitColumnBreakBefore = 1172, + CSSPropertyWebkitColumnBreakInside = 1173, + CSSPropertyWebkitColumnCount = 1174, + CSSPropertyWebkitColumnGap = 1175, + CSSPropertyWebkitColumnRule = 1176, + CSSPropertyWebkitColumnRuleColor = 1177, + CSSPropertyWebkitColumnRuleStyle = 1178, + CSSPropertyWebkitColumnRuleWidth = 1179, + CSSPropertyWebkitColumnWidth = 1180, + CSSPropertyWebkitColumns = 1181, + CSSPropertyWebkitFontSizeDelta = 1182, + CSSPropertyWebkitFontSmoothing = 1183, + CSSPropertyWebkitHighlight = 1184, + CSSPropertyWebkitLineBreak = 1185, + CSSPropertyWebkitLineClamp = 1186, + CSSPropertyWebkitMarginBottomCollapse = 1187, + CSSPropertyWebkitMarginCollapse = 1188, + CSSPropertyWebkitMarginStart = 1189, + CSSPropertyWebkitMarginTopCollapse = 1190, + CSSPropertyWebkitMarquee = 1191, + CSSPropertyWebkitMarqueeDirection = 1192, + CSSPropertyWebkitMarqueeIncrement = 1193, + CSSPropertyWebkitMarqueeRepetition = 1194, + CSSPropertyWebkitMarqueeSpeed = 1195, + CSSPropertyWebkitMarqueeStyle = 1196, + CSSPropertyWebkitMask = 1197, + CSSPropertyWebkitMaskAttachment = 1198, + CSSPropertyWebkitMaskBoxImage = 1199, + CSSPropertyWebkitMaskClip = 1200, + CSSPropertyWebkitMaskComposite = 1201, + CSSPropertyWebkitMaskImage = 1202, + CSSPropertyWebkitMaskOrigin = 1203, + CSSPropertyWebkitMaskPosition = 1204, + CSSPropertyWebkitMaskPositionX = 1205, + CSSPropertyWebkitMaskPositionY = 1206, + CSSPropertyWebkitMaskRepeat = 1207, + CSSPropertyWebkitMaskRepeatX = 1208, + CSSPropertyWebkitMaskRepeatY = 1209, + CSSPropertyWebkitMaskSize = 1210, + CSSPropertyWebkitMatchNearestMailBlockquoteColor = 1211, + CSSPropertyWebkitNbspMode = 1212, + CSSPropertyWebkitPaddingStart = 1213, + CSSPropertyWebkitPerspective = 1214, + CSSPropertyWebkitPerspectiveOrigin = 1215, + CSSPropertyWebkitPerspectiveOriginX = 1216, + CSSPropertyWebkitPerspectiveOriginY = 1217, + CSSPropertyWebkitRtlOrdering = 1218, + CSSPropertyWebkitTextDecorationsInEffect = 1219, + CSSPropertyWebkitTextFillColor = 1220, + CSSPropertyWebkitTextSecurity = 1221, + CSSPropertyWebkitTextSizeAdjust = 1222, + CSSPropertyWebkitTextStroke = 1223, + CSSPropertyWebkitTextStrokeColor = 1224, + CSSPropertyWebkitTextStrokeWidth = 1225, + CSSPropertyWebkitTransform = 1226, + CSSPropertyWebkitTransformOrigin = 1227, + CSSPropertyWebkitTransformOriginX = 1228, + CSSPropertyWebkitTransformOriginY = 1229, + CSSPropertyWebkitTransformOriginZ = 1230, + CSSPropertyWebkitTransformStyle = 1231, + CSSPropertyWebkitTransition = 1232, + CSSPropertyWebkitTransitionDelay = 1233, + CSSPropertyWebkitTransitionDuration = 1234, + CSSPropertyWebkitTransitionProperty = 1235, + CSSPropertyWebkitTransitionTimingFunction = 1236, + CSSPropertyWebkitUserDrag = 1237, + CSSPropertyWebkitUserModify = 1238, + CSSPropertyWebkitUserSelect = 1239, + CSSPropertyWebkitVariableDeclarationBlock = 1240, + CSSPropertyClipPath = 1241, + CSSPropertyClipRule = 1242, + CSSPropertyMask = 1243, + CSSPropertyEnableBackground = 1244, + CSSPropertyFilter = 1245, + CSSPropertyFloodColor = 1246, + CSSPropertyFloodOpacity = 1247, + CSSPropertyLightingColor = 1248, + CSSPropertyStopColor = 1249, + CSSPropertyStopOpacity = 1250, + CSSPropertyColorInterpolation = 1251, + CSSPropertyColorInterpolationFilters = 1252, + CSSPropertyColorProfile = 1253, + CSSPropertyColorRendering = 1254, + CSSPropertyFill = 1255, + CSSPropertyFillOpacity = 1256, + CSSPropertyFillRule = 1257, + CSSPropertyImageRendering = 1258, + CSSPropertyMarker = 1259, + CSSPropertyMarkerEnd = 1260, + CSSPropertyMarkerMid = 1261, + CSSPropertyMarkerStart = 1262, + CSSPropertyShapeRendering = 1263, + CSSPropertyStroke = 1264, + CSSPropertyStrokeDasharray = 1265, + CSSPropertyStrokeDashoffset = 1266, + CSSPropertyStrokeLinecap = 1267, + CSSPropertyStrokeLinejoin = 1268, + CSSPropertyStrokeMiterlimit = 1269, + CSSPropertyStrokeOpacity = 1270, + CSSPropertyStrokeWidth = 1271, + CSSPropertyAlignmentBaseline = 1272, + CSSPropertyBaselineShift = 1273, + CSSPropertyDominantBaseline = 1274, + CSSPropertyGlyphOrientationHorizontal = 1275, + CSSPropertyGlyphOrientationVertical = 1276, + CSSPropertyKerning = 1277, + CSSPropertyTextAnchor = 1278, + CSSPropertyWritingMode = 1279, + CSSPropertyWebkitShadow = 1280, }; const int firstCSSProperty = 1001; -const int numCSSProperties = 278; +const int numCSSProperties = 280; const size_t maxCSSPropertyNameLength = 43; const char* getPropertyName(CSSPropertyID); diff --git a/src/3rdparty/webkit/WebCore/generated/JSAbstractWorker.cpp b/src/3rdparty/webkit/WebCore/generated/JSAbstractWorker.cpp index d472340..bee17ac 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSAbstractWorker.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSAbstractWorker.cpp @@ -149,7 +149,7 @@ JSAbstractWorker::JSAbstractWorker(NonNullPassRefPtr structure, JSDOM JSAbstractWorker::~JSAbstractWorker() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } void JSAbstractWorker::markChildren(MarkStack& markStack) @@ -199,7 +199,7 @@ void setJSAbstractWorkerOnerror(ExecState* exec, JSObject* thisObject, JSValue v { UNUSED_PARAM(exec); AbstractWorker* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSBarInfo.cpp b/src/3rdparty/webkit/WebCore/generated/JSBarInfo.cpp index 2f02580..348c086 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSBarInfo.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSBarInfo.cpp @@ -76,7 +76,7 @@ JSBarInfo::JSBarInfo(NonNullPassRefPtr structure, JSDOMGlobalObject* JSBarInfo::~JSBarInfo() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSBarInfo::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCSSRule.cpp b/src/3rdparty/webkit/WebCore/generated/JSCSSRule.cpp index 307b17a..8d99056 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCSSRule.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCSSRule.cpp @@ -162,7 +162,7 @@ JSCSSRule::JSCSSRule(NonNullPassRefPtr structure, JSDOMGlobalObject* JSCSSRule::~JSCSSRule() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCSSRule::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCSSRuleList.cpp b/src/3rdparty/webkit/WebCore/generated/JSCSSRuleList.cpp index e02a6ce..0bb58c2 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCSSRuleList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCSSRuleList.cpp @@ -140,7 +140,7 @@ JSCSSRuleList::JSCSSRuleList(NonNullPassRefPtr structure, JSDOMGlobal JSCSSRuleList::~JSCSSRuleList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCSSRuleList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCSSStyleDeclaration.cpp b/src/3rdparty/webkit/WebCore/generated/JSCSSStyleDeclaration.cpp index 6292b64..5fbf986 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCSSStyleDeclaration.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCSSStyleDeclaration.cpp @@ -154,7 +154,7 @@ JSCSSStyleDeclaration::JSCSSStyleDeclaration(NonNullPassRefPtr struct JSCSSStyleDeclaration::~JSCSSStyleDeclaration() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCSSStyleDeclaration::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCSSValue.cpp b/src/3rdparty/webkit/WebCore/generated/JSCSSValue.cpp index 22f6c30..1cb1b75 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCSSValue.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCSSValue.cpp @@ -145,7 +145,7 @@ JSCSSValue::JSCSSValue(NonNullPassRefPtr structure, JSDOMGlobalObject JSCSSValue::~JSCSSValue() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCSSValue::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCSSVariablesDeclaration.cpp b/src/3rdparty/webkit/WebCore/generated/JSCSSVariablesDeclaration.cpp index ef1d726..975d56d 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCSSVariablesDeclaration.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCSSVariablesDeclaration.cpp @@ -147,7 +147,7 @@ JSCSSVariablesDeclaration::JSCSSVariablesDeclaration(NonNullPassRefPtrglobalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCSSVariablesDeclaration::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasArray.cpp b/src/3rdparty/webkit/WebCore/generated/JSCanvasArray.cpp index aeeeb4f..05be08c 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCanvasArray.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasArray.cpp @@ -93,7 +93,7 @@ JSCanvasArray::JSCanvasArray(NonNullPassRefPtr structure, JSDOMGlobal JSCanvasArray::~JSCanvasArray() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCanvasArray::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasArrayBuffer.cpp b/src/3rdparty/webkit/WebCore/generated/JSCanvasArrayBuffer.cpp index cf1c0fe..7099ce9 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCanvasArrayBuffer.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasArrayBuffer.cpp @@ -80,7 +80,7 @@ JSCanvasArrayBuffer::JSCanvasArrayBuffer(NonNullPassRefPtr structure, JSCanvasArrayBuffer::~JSCanvasArrayBuffer() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCanvasArrayBuffer::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasGradient.cpp b/src/3rdparty/webkit/WebCore/generated/JSCanvasGradient.cpp index 22de482..4d2bfa3 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCanvasGradient.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasGradient.cpp @@ -74,7 +74,7 @@ JSCanvasGradient::JSCanvasGradient(NonNullPassRefPtr structure, JSDOM JSCanvasGradient::~JSCanvasGradient() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCanvasGradient::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasPattern.cpp b/src/3rdparty/webkit/WebCore/generated/JSCanvasPattern.cpp index 7356770..cfb521b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCanvasPattern.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasPattern.cpp @@ -61,7 +61,7 @@ JSCanvasPattern::JSCanvasPattern(NonNullPassRefPtr structure, JSDOMGl JSCanvasPattern::~JSCanvasPattern() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCanvasPattern::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext.cpp b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext.cpp index 1d06dfe..07710a1 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext.cpp @@ -126,7 +126,7 @@ JSCanvasRenderingContext::JSCanvasRenderingContext(NonNullPassRefPtr JSCanvasRenderingContext::~JSCanvasRenderingContext() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCanvasRenderingContext::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSClientRect.cpp b/src/3rdparty/webkit/WebCore/generated/JSClientRect.cpp index 175d660..48dccd3 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSClientRect.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSClientRect.cpp @@ -130,7 +130,7 @@ JSClientRect::JSClientRect(NonNullPassRefPtr structure, JSDOMGlobalOb JSClientRect::~JSClientRect() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSClientRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSClientRectList.cpp b/src/3rdparty/webkit/WebCore/generated/JSClientRectList.cpp index 143ee8c..ff9d963 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSClientRectList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSClientRectList.cpp @@ -141,7 +141,7 @@ JSClientRectList::JSClientRectList(NonNullPassRefPtr structure, JSDOM JSClientRectList::~JSClientRectList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSClientRectList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSClipboard.cpp b/src/3rdparty/webkit/WebCore/generated/JSClipboard.cpp index f72e341..8f4a7d4 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSClipboard.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSClipboard.cpp @@ -145,7 +145,7 @@ JSClipboard::JSClipboard(NonNullPassRefPtr structure, JSDOMGlobalObje JSClipboard::~JSClipboard() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSClipboard::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSConsole.cpp b/src/3rdparty/webkit/WebCore/generated/JSConsole.cpp index 4bb40c6..0657890 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSConsole.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSConsole.cpp @@ -104,7 +104,7 @@ JSConsole::JSConsole(NonNullPassRefPtr structure, JSDOMGlobalObject* JSConsole::~JSConsole() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSConsole::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCoordinates.cpp b/src/3rdparty/webkit/WebCore/generated/JSCoordinates.cpp index 6919ad2..348bcc6 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCoordinates.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCoordinates.cpp @@ -83,7 +83,7 @@ JSCoordinates::JSCoordinates(NonNullPassRefPtr structure, JSDOMGlobal JSCoordinates::~JSCoordinates() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCoordinates::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSCounter.cpp b/src/3rdparty/webkit/WebCore/generated/JSCounter.cpp index d17a368..7c22959 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSCounter.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSCounter.cpp @@ -128,7 +128,7 @@ JSCounter::JSCounter(NonNullPassRefPtr structure, JSDOMGlobalObject* JSCounter::~JSCounter() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSCounter::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMApplicationCache.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMApplicationCache.cpp index 2b65699..17a527e 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMApplicationCache.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMApplicationCache.cpp @@ -118,7 +118,7 @@ JSDOMApplicationCache::JSDOMApplicationCache(NonNullPassRefPtr struct JSDOMApplicationCache::~JSDOMApplicationCache() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } void JSDOMApplicationCache::markChildren(MarkStack& markStack) @@ -255,7 +255,7 @@ void setJSDOMApplicationCacheOnchecking(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnchecking(globalObject->createJSAttributeEventListener(value)); @@ -265,7 +265,7 @@ void setJSDOMApplicationCacheOnerror(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); @@ -275,7 +275,7 @@ void setJSDOMApplicationCacheOnnoupdate(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnnoupdate(globalObject->createJSAttributeEventListener(value)); @@ -285,7 +285,7 @@ void setJSDOMApplicationCacheOndownloading(ExecState* exec, JSObject* thisObject { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndownloading(globalObject->createJSAttributeEventListener(value)); @@ -295,7 +295,7 @@ void setJSDOMApplicationCacheOnprogress(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnprogress(globalObject->createJSAttributeEventListener(value)); @@ -305,7 +305,7 @@ void setJSDOMApplicationCacheOnupdateready(ExecState* exec, JSObject* thisObject { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnupdateready(globalObject->createJSAttributeEventListener(value)); @@ -315,7 +315,7 @@ void setJSDOMApplicationCacheOncached(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncached(globalObject->createJSAttributeEventListener(value)); @@ -325,7 +325,7 @@ void setJSDOMApplicationCacheOnobsolete(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); DOMApplicationCache* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnobsolete(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMCoreException.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMCoreException.cpp index d625e2b..ff88905 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMCoreException.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMCoreException.cpp @@ -185,7 +185,7 @@ JSDOMCoreException::JSDOMCoreException(NonNullPassRefPtr structure, J JSDOMCoreException::~JSDOMCoreException() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSDOMCoreException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMImplementation.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMImplementation.cpp index 62eef6c..268647b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMImplementation.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMImplementation.cpp @@ -148,7 +148,7 @@ JSDOMImplementation::JSDOMImplementation(NonNullPassRefPtr structure, JSDOMImplementation::~JSDOMImplementation() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSDOMImplementation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMParser.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMParser.cpp index 4af88cb..ecd336a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMParser.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMParser.cpp @@ -147,7 +147,7 @@ JSDOMParser::JSDOMParser(NonNullPassRefPtr structure, JSDOMGlobalObje JSDOMParser::~JSDOMParser() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSDOMParser::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMSelection.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMSelection.cpp index 45ec248..e3a69b0 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMSelection.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMSelection.cpp @@ -119,7 +119,7 @@ JSDOMSelection::JSDOMSelection(NonNullPassRefPtr structure, JSDOMGlob JSDOMSelection::~JSDOMSelection() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSDOMSelection::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp index dc53217..12edc42 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.cpp @@ -92,6 +92,7 @@ #include "JSEventSource.h" #include "JSFile.h" #include "JSFileList.h" +#include "JSHTMLAllCollection.h" #include "JSHTMLAnchorElement.h" #include "JSHTMLAppletElement.h" #include "JSHTMLAreaElement.h" @@ -246,7 +247,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSDOMWindow); /* Hash table */ -static const HashTableValue JSDOMWindowTableValues[296] = +static const HashTableValue JSDOMWindowTableValues[297] = { { "screen", DontDelete|ReadOnly, (intptr_t)jsDOMWindowScreen, (intptr_t)0 }, { "history", DontDelete|ReadOnly, (intptr_t)jsDOMWindowHistory, (intptr_t)0 }, @@ -468,6 +469,7 @@ static const HashTableValue JSDOMWindowTableValues[296] = { "HTMLTitleElement", DontDelete, (intptr_t)jsDOMWindowHTMLTitleElementConstructor, (intptr_t)setJSDOMWindowHTMLTitleElementConstructor }, { "HTMLUListElement", DontDelete, (intptr_t)jsDOMWindowHTMLUListElementConstructor, (intptr_t)setJSDOMWindowHTMLUListElementConstructor }, { "HTMLCollection", DontDelete, (intptr_t)jsDOMWindowHTMLCollectionConstructor, (intptr_t)setJSDOMWindowHTMLCollectionConstructor }, + { "HTMLAllCollection", DontDelete, (intptr_t)jsDOMWindowHTMLAllCollectionConstructor, (intptr_t)setJSDOMWindowHTMLAllCollectionConstructor }, { "Image", DontDelete, (intptr_t)jsDOMWindowImageConstructor, (intptr_t)setJSDOMWindowImageConstructor }, { "Option", DontDelete, (intptr_t)jsDOMWindowOptionConstructor, (intptr_t)setJSDOMWindowOptionConstructor }, { "CanvasRenderingContext2D", DontDelete, (intptr_t)jsDOMWindowCanvasRenderingContext2DConstructor, (intptr_t)setJSDOMWindowCanvasRenderingContext2DConstructor }, @@ -666,7 +668,6 @@ JSDOMWindow::JSDOMWindow(NonNullPassRefPtr structure, PassRefPtrinvalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); } JSValue jsDOMWindowScreen(ExecState* exec, const Identifier&, const PropertySlot& slot) @@ -2846,6 +2847,14 @@ JSValue jsDOMWindowHTMLCollectionConstructor(ExecState* exec, const Identifier&, return JSHTMLCollection::getConstructor(exec, castedThis); } +JSValue jsDOMWindowHTMLAllCollectionConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + JSDOMWindow* castedThis = static_cast(asObject(slot.slotBase())); + if (!castedThis->allowsAccessFrom(exec)) + return jsUndefined(); + return JSHTMLAllCollection::getConstructor(exec, castedThis); +} + JSValue jsDOMWindowImageConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot) { JSDOMWindow* castedThis = static_cast(asObject(slot.slotBase())); @@ -5261,6 +5270,14 @@ void setJSDOMWindowHTMLCollectionConstructor(ExecState* exec, JSObject* thisObje static_cast(thisObject)->putDirect(Identifier(exec, "HTMLCollection"), value); } +void setJSDOMWindowHTMLAllCollectionConstructor(ExecState* exec, JSObject* thisObject, JSValue value) +{ + if (!static_cast(thisObject)->allowsAccessFrom(exec)) + return; + // Shadowing a built-in constructor + static_cast(thisObject)->putDirect(Identifier(exec, "HTMLAllCollection"), value); +} + void setJSDOMWindowImageConstructor(ExecState* exec, JSObject* thisObject, JSValue value) { if (!static_cast(thisObject)->allowsAccessFrom(exec)) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h index 232c8eb..afc8106 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h +++ b/src/3rdparty/webkit/WebCore/generated/JSDOMWindow.h @@ -577,6 +577,8 @@ JSC::JSValue jsDOMWindowHTMLUListElementConstructor(JSC::ExecState*, const JSC:: void setJSDOMWindowHTMLUListElementConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsDOMWindowHTMLCollectionConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); void setJSDOMWindowHTMLCollectionConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); +JSC::JSValue jsDOMWindowHTMLAllCollectionConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); +void setJSDOMWindowHTMLAllCollectionConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsDOMWindowImageConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); void setJSDOMWindowImageConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); JSC::JSValue jsDOMWindowOptionConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); diff --git a/src/3rdparty/webkit/WebCore/generated/JSDataGridColumn.cpp b/src/3rdparty/webkit/WebCore/generated/JSDataGridColumn.cpp index 586edd1..42b91d1 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDataGridColumn.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDataGridColumn.cpp @@ -157,7 +157,7 @@ JSDataGridColumn::JSDataGridColumn(NonNullPassRefPtr structure, JSDOM JSDataGridColumn::~JSDataGridColumn() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSDataGridColumn::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp b/src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp index 08585fe..945c257 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDataGridColumnList.cpp @@ -151,7 +151,7 @@ JSDataGridColumnList::JSDataGridColumnList(NonNullPassRefPtr structur JSDataGridColumnList::~JSDataGridColumnList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSDataGridColumnList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDatabase.cpp b/src/3rdparty/webkit/WebCore/generated/JSDatabase.cpp index 5acd5b1..c5ac44d 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDatabase.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDatabase.cpp @@ -95,7 +95,7 @@ JSDatabase::JSDatabase(NonNullPassRefPtr structure, JSDOMGlobalObject JSDatabase::~JSDatabase() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSDatabase::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSDocument.cpp b/src/3rdparty/webkit/WebCore/generated/JSDocument.cpp index 47a2936..1fb3b46 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSDocument.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSDocument.cpp @@ -304,7 +304,7 @@ JSDocument::JSDocument(NonNullPassRefPtr structure, JSDOMGlobalObject JSDocument::~JSDocument() { - forgetDOMObject(*Heap::heap(this)->globalData(), static_cast(impl())); + forgetDOMObject(this, static_cast(impl())); } JSObject* JSDocument::createPrototype(ExecState* exec, JSGlobalObject* globalObject) @@ -1099,7 +1099,7 @@ void setJSDocumentOnabort(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnabort(globalObject->createJSAttributeEventListener(value)); @@ -1109,7 +1109,7 @@ void setJSDocumentOnblur(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnblur(globalObject->createJSAttributeEventListener(value)); @@ -1119,7 +1119,7 @@ void setJSDocumentOnchange(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnchange(globalObject->createJSAttributeEventListener(value)); @@ -1129,7 +1129,7 @@ void setJSDocumentOnclick(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnclick(globalObject->createJSAttributeEventListener(value)); @@ -1139,7 +1139,7 @@ void setJSDocumentOncontextmenu(ExecState* exec, JSObject* thisObject, JSValue v { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncontextmenu(globalObject->createJSAttributeEventListener(value)); @@ -1149,7 +1149,7 @@ void setJSDocumentOndblclick(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndblclick(globalObject->createJSAttributeEventListener(value)); @@ -1159,7 +1159,7 @@ void setJSDocumentOndrag(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndrag(globalObject->createJSAttributeEventListener(value)); @@ -1169,7 +1169,7 @@ void setJSDocumentOndragend(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragend(globalObject->createJSAttributeEventListener(value)); @@ -1179,7 +1179,7 @@ void setJSDocumentOndragenter(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragenter(globalObject->createJSAttributeEventListener(value)); @@ -1189,7 +1189,7 @@ void setJSDocumentOndragleave(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragleave(globalObject->createJSAttributeEventListener(value)); @@ -1199,7 +1199,7 @@ void setJSDocumentOndragover(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragover(globalObject->createJSAttributeEventListener(value)); @@ -1209,7 +1209,7 @@ void setJSDocumentOndragstart(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragstart(globalObject->createJSAttributeEventListener(value)); @@ -1219,7 +1219,7 @@ void setJSDocumentOndrop(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndrop(globalObject->createJSAttributeEventListener(value)); @@ -1229,7 +1229,7 @@ void setJSDocumentOnerror(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); @@ -1239,7 +1239,7 @@ void setJSDocumentOnfocus(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnfocus(globalObject->createJSAttributeEventListener(value)); @@ -1249,7 +1249,7 @@ void setJSDocumentOninput(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOninput(globalObject->createJSAttributeEventListener(value)); @@ -1259,7 +1259,7 @@ void setJSDocumentOninvalid(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOninvalid(globalObject->createJSAttributeEventListener(value)); @@ -1269,7 +1269,7 @@ void setJSDocumentOnkeydown(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeydown(globalObject->createJSAttributeEventListener(value)); @@ -1279,7 +1279,7 @@ void setJSDocumentOnkeypress(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeypress(globalObject->createJSAttributeEventListener(value)); @@ -1289,7 +1289,7 @@ void setJSDocumentOnkeyup(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeyup(globalObject->createJSAttributeEventListener(value)); @@ -1299,7 +1299,7 @@ void setJSDocumentOnload(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnload(globalObject->createJSAttributeEventListener(value)); @@ -1309,7 +1309,7 @@ void setJSDocumentOnmousedown(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousedown(globalObject->createJSAttributeEventListener(value)); @@ -1319,7 +1319,7 @@ void setJSDocumentOnmousemove(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousemove(globalObject->createJSAttributeEventListener(value)); @@ -1329,7 +1329,7 @@ void setJSDocumentOnmouseout(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseout(globalObject->createJSAttributeEventListener(value)); @@ -1339,7 +1339,7 @@ void setJSDocumentOnmouseover(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseover(globalObject->createJSAttributeEventListener(value)); @@ -1349,7 +1349,7 @@ void setJSDocumentOnmouseup(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseup(globalObject->createJSAttributeEventListener(value)); @@ -1359,7 +1359,7 @@ void setJSDocumentOnmousewheel(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousewheel(globalObject->createJSAttributeEventListener(value)); @@ -1369,7 +1369,7 @@ void setJSDocumentOnscroll(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnscroll(globalObject->createJSAttributeEventListener(value)); @@ -1379,7 +1379,7 @@ void setJSDocumentOnselect(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnselect(globalObject->createJSAttributeEventListener(value)); @@ -1389,7 +1389,7 @@ void setJSDocumentOnsubmit(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnsubmit(globalObject->createJSAttributeEventListener(value)); @@ -1399,7 +1399,7 @@ void setJSDocumentOnbeforecut(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforecut(globalObject->createJSAttributeEventListener(value)); @@ -1409,7 +1409,7 @@ void setJSDocumentOncut(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncut(globalObject->createJSAttributeEventListener(value)); @@ -1419,7 +1419,7 @@ void setJSDocumentOnbeforecopy(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforecopy(globalObject->createJSAttributeEventListener(value)); @@ -1429,7 +1429,7 @@ void setJSDocumentOncopy(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncopy(globalObject->createJSAttributeEventListener(value)); @@ -1439,7 +1439,7 @@ void setJSDocumentOnbeforepaste(ExecState* exec, JSObject* thisObject, JSValue v { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforepaste(globalObject->createJSAttributeEventListener(value)); @@ -1449,7 +1449,7 @@ void setJSDocumentOnpaste(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnpaste(globalObject->createJSAttributeEventListener(value)); @@ -1459,7 +1459,7 @@ void setJSDocumentOnreset(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnreset(globalObject->createJSAttributeEventListener(value)); @@ -1469,7 +1469,7 @@ void setJSDocumentOnsearch(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnsearch(globalObject->createJSAttributeEventListener(value)); @@ -1479,7 +1479,7 @@ void setJSDocumentOnselectstart(ExecState* exec, JSObject* thisObject, JSValue v { UNUSED_PARAM(exec); Document* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnselectstart(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSElement.cpp b/src/3rdparty/webkit/WebCore/generated/JSElement.cpp index 869c23f..3d3187f 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSElement.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSElement.cpp @@ -897,7 +897,7 @@ void setJSElementOnabort(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnabort(globalObject->createJSAttributeEventListener(value)); @@ -907,7 +907,7 @@ void setJSElementOnblur(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnblur(globalObject->createJSAttributeEventListener(value)); @@ -917,7 +917,7 @@ void setJSElementOnchange(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnchange(globalObject->createJSAttributeEventListener(value)); @@ -927,7 +927,7 @@ void setJSElementOnclick(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnclick(globalObject->createJSAttributeEventListener(value)); @@ -937,7 +937,7 @@ void setJSElementOncontextmenu(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncontextmenu(globalObject->createJSAttributeEventListener(value)); @@ -947,7 +947,7 @@ void setJSElementOndblclick(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndblclick(globalObject->createJSAttributeEventListener(value)); @@ -957,7 +957,7 @@ void setJSElementOndrag(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndrag(globalObject->createJSAttributeEventListener(value)); @@ -967,7 +967,7 @@ void setJSElementOndragend(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragend(globalObject->createJSAttributeEventListener(value)); @@ -977,7 +977,7 @@ void setJSElementOndragenter(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragenter(globalObject->createJSAttributeEventListener(value)); @@ -987,7 +987,7 @@ void setJSElementOndragleave(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragleave(globalObject->createJSAttributeEventListener(value)); @@ -997,7 +997,7 @@ void setJSElementOndragover(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragover(globalObject->createJSAttributeEventListener(value)); @@ -1007,7 +1007,7 @@ void setJSElementOndragstart(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragstart(globalObject->createJSAttributeEventListener(value)); @@ -1017,7 +1017,7 @@ void setJSElementOndrop(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndrop(globalObject->createJSAttributeEventListener(value)); @@ -1027,7 +1027,7 @@ void setJSElementOnerror(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); @@ -1037,7 +1037,7 @@ void setJSElementOnfocus(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnfocus(globalObject->createJSAttributeEventListener(value)); @@ -1047,7 +1047,7 @@ void setJSElementOninput(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOninput(globalObject->createJSAttributeEventListener(value)); @@ -1057,7 +1057,7 @@ void setJSElementOninvalid(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOninvalid(globalObject->createJSAttributeEventListener(value)); @@ -1067,7 +1067,7 @@ void setJSElementOnkeydown(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeydown(globalObject->createJSAttributeEventListener(value)); @@ -1077,7 +1077,7 @@ void setJSElementOnkeypress(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeypress(globalObject->createJSAttributeEventListener(value)); @@ -1087,7 +1087,7 @@ void setJSElementOnkeyup(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeyup(globalObject->createJSAttributeEventListener(value)); @@ -1097,7 +1097,7 @@ void setJSElementOnload(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnload(globalObject->createJSAttributeEventListener(value)); @@ -1107,7 +1107,7 @@ void setJSElementOnmousedown(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousedown(globalObject->createJSAttributeEventListener(value)); @@ -1117,7 +1117,7 @@ void setJSElementOnmousemove(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousemove(globalObject->createJSAttributeEventListener(value)); @@ -1127,7 +1127,7 @@ void setJSElementOnmouseout(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseout(globalObject->createJSAttributeEventListener(value)); @@ -1137,7 +1137,7 @@ void setJSElementOnmouseover(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseover(globalObject->createJSAttributeEventListener(value)); @@ -1147,7 +1147,7 @@ void setJSElementOnmouseup(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseup(globalObject->createJSAttributeEventListener(value)); @@ -1157,7 +1157,7 @@ void setJSElementOnmousewheel(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousewheel(globalObject->createJSAttributeEventListener(value)); @@ -1167,7 +1167,7 @@ void setJSElementOnscroll(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnscroll(globalObject->createJSAttributeEventListener(value)); @@ -1177,7 +1177,7 @@ void setJSElementOnselect(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnselect(globalObject->createJSAttributeEventListener(value)); @@ -1187,7 +1187,7 @@ void setJSElementOnsubmit(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnsubmit(globalObject->createJSAttributeEventListener(value)); @@ -1197,7 +1197,7 @@ void setJSElementOnbeforecut(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforecut(globalObject->createJSAttributeEventListener(value)); @@ -1207,7 +1207,7 @@ void setJSElementOncut(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncut(globalObject->createJSAttributeEventListener(value)); @@ -1217,7 +1217,7 @@ void setJSElementOnbeforecopy(ExecState* exec, JSObject* thisObject, JSValue val { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforecopy(globalObject->createJSAttributeEventListener(value)); @@ -1227,7 +1227,7 @@ void setJSElementOncopy(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncopy(globalObject->createJSAttributeEventListener(value)); @@ -1237,7 +1237,7 @@ void setJSElementOnbeforepaste(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforepaste(globalObject->createJSAttributeEventListener(value)); @@ -1247,7 +1247,7 @@ void setJSElementOnpaste(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnpaste(globalObject->createJSAttributeEventListener(value)); @@ -1257,7 +1257,7 @@ void setJSElementOnreset(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnreset(globalObject->createJSAttributeEventListener(value)); @@ -1267,7 +1267,7 @@ void setJSElementOnsearch(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnsearch(globalObject->createJSAttributeEventListener(value)); @@ -1277,7 +1277,7 @@ void setJSElementOnselectstart(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); Element* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnselectstart(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSEvent.cpp b/src/3rdparty/webkit/WebCore/generated/JSEvent.cpp index acd952f..67eefd0 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSEvent.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSEvent.cpp @@ -199,7 +199,7 @@ JSEvent::JSEvent(NonNullPassRefPtr structure, JSDOMGlobalObject* glob JSEvent::~JSEvent() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSEventException.cpp b/src/3rdparty/webkit/WebCore/generated/JSEventException.cpp index 2246c8f..bd25734 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSEventException.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSEventException.cpp @@ -151,7 +151,7 @@ JSEventException::JSEventException(NonNullPassRefPtr structure, JSDOM JSEventException::~JSEventException() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSEventException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSEventSource.cpp b/src/3rdparty/webkit/WebCore/generated/JSEventSource.cpp index dcec14e..526d8af 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSEventSource.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSEventSource.cpp @@ -120,7 +120,7 @@ JSEventSource::JSEventSource(NonNullPassRefPtr structure, JSDOMGlobal JSEventSource::~JSEventSource() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } void JSEventSource::markChildren(MarkStack& markStack) @@ -205,7 +205,7 @@ void setJSEventSourceOnopen(ExecState* exec, JSObject* thisObject, JSValue value { UNUSED_PARAM(exec); EventSource* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnopen(globalObject->createJSAttributeEventListener(value)); @@ -215,7 +215,7 @@ void setJSEventSourceOnmessage(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); EventSource* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmessage(globalObject->createJSAttributeEventListener(value)); @@ -225,7 +225,7 @@ void setJSEventSourceOnerror(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); EventSource* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSFile.cpp b/src/3rdparty/webkit/WebCore/generated/JSFile.cpp index 2ee62ae..59192af 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSFile.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSFile.cpp @@ -128,7 +128,7 @@ JSFile::JSFile(NonNullPassRefPtr structure, JSDOMGlobalObject* global JSFile::~JSFile() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSFile::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSFileList.cpp b/src/3rdparty/webkit/WebCore/generated/JSFileList.cpp index 931aae4..50e1f0a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSFileList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSFileList.cpp @@ -141,7 +141,7 @@ JSFileList::JSFileList(NonNullPassRefPtr structure, JSDOMGlobalObject JSFileList::~JSFileList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSFileList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSGeolocation.cpp b/src/3rdparty/webkit/WebCore/generated/JSGeolocation.cpp index 17a0509..be50fac 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSGeolocation.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSGeolocation.cpp @@ -92,7 +92,7 @@ JSGeolocation::JSGeolocation(NonNullPassRefPtr structure, JSDOMGlobal JSGeolocation::~JSGeolocation() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSGeolocation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSGeoposition.cpp b/src/3rdparty/webkit/WebCore/generated/JSGeoposition.cpp index a77413b..ab42d2b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSGeoposition.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSGeoposition.cpp @@ -80,7 +80,7 @@ JSGeoposition::JSGeoposition(NonNullPassRefPtr structure, JSDOMGlobal JSGeoposition::~JSGeoposition() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSGeoposition::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.cpp b/src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.cpp new file mode 100644 index 0000000..4a8fc83 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.cpp @@ -0,0 +1,292 @@ +/* + This file is part of the WebKit open source project. + This file has been generated by generate-bindings.pl. DO NOT MODIFY! + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "JSHTMLAllCollection.h" + +#include "AtomicString.h" +#include "HTMLAllCollection.h" +#include "JSNode.h" +#include "JSNodeList.h" +#include "NameNodeList.h" +#include "Node.h" +#include "NodeList.h" +#include +#include +#include +#include + +using namespace JSC; + +namespace WebCore { + +ASSERT_CLASS_FITS_IN_CELL(JSHTMLAllCollection); + +/* Hash table */ + +static const HashTableValue JSHTMLAllCollectionTableValues[3] = +{ + { "length", DontDelete|ReadOnly, (intptr_t)jsHTMLAllCollectionLength, (intptr_t)0 }, + { "constructor", DontEnum|ReadOnly, (intptr_t)jsHTMLAllCollectionConstructor, (intptr_t)0 }, + { 0, 0, 0, 0 } +}; + +static JSC_CONST_HASHTABLE HashTable JSHTMLAllCollectionTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 15, JSHTMLAllCollectionTableValues, 0 }; +#else + { 5, 3, JSHTMLAllCollectionTableValues, 0 }; +#endif + +/* Hash table for constructor */ + +static const HashTableValue JSHTMLAllCollectionConstructorTableValues[1] = +{ + { 0, 0, 0, 0 } +}; + +static JSC_CONST_HASHTABLE HashTable JSHTMLAllCollectionConstructorTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 0, JSHTMLAllCollectionConstructorTableValues, 0 }; +#else + { 1, 0, JSHTMLAllCollectionConstructorTableValues, 0 }; +#endif + +class JSHTMLAllCollectionConstructor : public DOMConstructorObject { +public: + JSHTMLAllCollectionConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) + : DOMConstructorObject(JSHTMLAllCollectionConstructor::createStructure(globalObject->objectPrototype()), globalObject) + { + putDirect(exec->propertyNames().prototype, JSHTMLAllCollectionPrototype::self(exec, globalObject), None); + } + virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); + virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); + virtual const ClassInfo* classInfo() const { return &s_info; } + static const ClassInfo s_info; + + static PassRefPtr createStructure(JSValue proto) + { + return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); + } + +protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags; +}; + +const ClassInfo JSHTMLAllCollectionConstructor::s_info = { "HTMLAllCollectionConstructor", 0, &JSHTMLAllCollectionConstructorTable, 0 }; + +bool JSHTMLAllCollectionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSHTMLAllCollectionConstructorTable, this, propertyName, slot); +} + +bool JSHTMLAllCollectionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSHTMLAllCollectionConstructorTable, this, propertyName, descriptor); +} + +/* Hash table for prototype */ + +static const HashTableValue JSHTMLAllCollectionPrototypeTableValues[4] = +{ + { "item", DontDelete|Function, (intptr_t)jsHTMLAllCollectionPrototypeFunctionItem, (intptr_t)1 }, + { "namedItem", DontDelete|Function, (intptr_t)jsHTMLAllCollectionPrototypeFunctionNamedItem, (intptr_t)1 }, + { "tags", DontDelete|Function, (intptr_t)jsHTMLAllCollectionPrototypeFunctionTags, (intptr_t)1 }, + { 0, 0, 0, 0 } +}; + +static JSC_CONST_HASHTABLE HashTable JSHTMLAllCollectionPrototypeTable = +#if ENABLE(PERFECT_HASH_SIZE) + { 7, JSHTMLAllCollectionPrototypeTableValues, 0 }; +#else + { 8, 7, JSHTMLAllCollectionPrototypeTableValues, 0 }; +#endif + +const ClassInfo JSHTMLAllCollectionPrototype::s_info = { "HTMLAllCollectionPrototype", 0, &JSHTMLAllCollectionPrototypeTable, 0 }; + +JSObject* JSHTMLAllCollectionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMPrototype(exec, globalObject); +} + +bool JSHTMLAllCollectionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticFunctionSlot(exec, &JSHTMLAllCollectionPrototypeTable, this, propertyName, slot); +} + +bool JSHTMLAllCollectionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticFunctionDescriptor(exec, &JSHTMLAllCollectionPrototypeTable, this, propertyName, descriptor); +} + +const ClassInfo JSHTMLAllCollection::s_info = { "HTMLAllCollection", 0, &JSHTMLAllCollectionTable, 0 }; + +JSHTMLAllCollection::JSHTMLAllCollection(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) + : DOMObjectWithGlobalPointer(structure, globalObject) + , m_impl(impl) +{ +} + +JSHTMLAllCollection::~JSHTMLAllCollection() +{ + forgetDOMObject(this, impl()); +} + +JSObject* JSHTMLAllCollection::createPrototype(ExecState* exec, JSGlobalObject* globalObject) +{ + return new (exec) JSHTMLAllCollectionPrototype(JSHTMLAllCollectionPrototype::createStructure(globalObject->objectPrototype())); +} + +bool JSHTMLAllCollection::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + JSValue proto = prototype(); + if (proto.isObject() && static_cast(asObject(proto))->hasProperty(exec, propertyName)) + return false; + + const HashEntry* entry = JSHTMLAllCollectionTable.entry(exec, propertyName); + if (entry) { + slot.setCustom(this, entry->propertyGetter()); + return true; + } + bool ok; + unsigned index = propertyName.toUInt32(&ok, false); + if (ok && index < static_cast(impl())->length()) { + slot.setCustomIndex(this, index, indexGetter); + return true; + } + if (canGetItemsForName(exec, static_cast(impl()), propertyName)) { + slot.setCustom(this, nameGetter); + return true; + } + return getStaticValueSlot(exec, &JSHTMLAllCollectionTable, this, propertyName, slot); +} + +bool JSHTMLAllCollection::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + JSValue proto = prototype(); + if (proto.isObject() && static_cast(asObject(proto))->hasProperty(exec, propertyName)) + return false; + + const HashEntry* entry = JSHTMLAllCollectionTable.entry(exec, propertyName); + if (entry) { + PropertySlot slot; + slot.setCustom(this, entry->propertyGetter()); + descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes()); + return true; + } + bool ok; + unsigned index = propertyName.toUInt32(&ok, false); + if (ok && index < static_cast(impl())->length()) { + PropertySlot slot; + slot.setCustomIndex(this, index, indexGetter); + descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly); + return true; + } + if (canGetItemsForName(exec, static_cast(impl()), propertyName)) { + PropertySlot slot; + slot.setCustom(this, nameGetter); + descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); + return true; + } + return getStaticValueDescriptor(exec, &JSHTMLAllCollectionTable, this, propertyName, descriptor); +} + +bool JSHTMLAllCollection::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) +{ + if (propertyName < static_cast(impl())->length()) { + slot.setCustomIndex(this, propertyName, indexGetter); + return true; + } + return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); +} + +JSValue jsHTMLAllCollectionLength(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + JSHTMLAllCollection* castedThis = static_cast(asObject(slot.slotBase())); + UNUSED_PARAM(exec); + HTMLAllCollection* imp = static_cast(castedThis->impl()); + return jsNumber(exec, imp->length()); +} + +JSValue jsHTMLAllCollectionConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + JSHTMLAllCollection* domObject = static_cast(asObject(slot.slotBase())); + return JSHTMLAllCollection::getConstructor(exec, domObject->globalObject()); +} +void JSHTMLAllCollection::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) +{ + for (unsigned i = 0; i < static_cast(impl())->length(); ++i) + propertyNames.add(Identifier::from(exec, i)); + Base::getOwnPropertyNames(exec, propertyNames); +} + +JSValue JSHTMLAllCollection::getConstructor(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMConstructor(exec, static_cast(globalObject)); +} + +JSValue JSC_HOST_CALL jsHTMLAllCollectionPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.inherits(&JSHTMLAllCollection::s_info)) + return throwError(exec, TypeError); + JSHTMLAllCollection* castedThisObj = static_cast(asObject(thisValue)); + return castedThisObj->item(exec, args); +} + +JSValue JSC_HOST_CALL jsHTMLAllCollectionPrototypeFunctionNamedItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.inherits(&JSHTMLAllCollection::s_info)) + return throwError(exec, TypeError); + JSHTMLAllCollection* castedThisObj = static_cast(asObject(thisValue)); + return castedThisObj->namedItem(exec, args); +} + +JSValue JSC_HOST_CALL jsHTMLAllCollectionPrototypeFunctionTags(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.inherits(&JSHTMLAllCollection::s_info)) + return throwError(exec, TypeError); + JSHTMLAllCollection* castedThisObj = static_cast(asObject(thisValue)); + HTMLAllCollection* imp = static_cast(castedThisObj->impl()); + const UString& name = args.at(0).toString(exec); + + + JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->tags(name))); + return result; +} + + +JSValue JSHTMLAllCollection::indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot) +{ + JSHTMLAllCollection* thisObj = static_cast(asObject(slot.slotBase())); + return toJS(exec, thisObj->globalObject(), static_cast(thisObj->impl())->item(slot.index())); +} +JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, HTMLAllCollection* object) +{ + return getDOMObjectWrapper(exec, globalObject, object); +} +HTMLAllCollection* toHTMLAllCollection(JSC::JSValue value) +{ + return value.inherits(&JSHTMLAllCollection::s_info) ? static_cast(asObject(value))->impl() : 0; +} + +} diff --git a/src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.h b/src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.h new file mode 100644 index 0000000..000986e --- /dev/null +++ b/src/3rdparty/webkit/WebCore/generated/JSHTMLAllCollection.h @@ -0,0 +1,104 @@ +/* + This file is part of the WebKit open source project. + This file has been generated by generate-bindings.pl. DO NOT MODIFY! + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef JSHTMLAllCollection_h +#define JSHTMLAllCollection_h + +#include "DOMObjectWithSVGContext.h" +#include "JSDOMBinding.h" +#include +#include +#include + +namespace WebCore { + +class HTMLAllCollection; + +class JSHTMLAllCollection : public DOMObjectWithGlobalPointer { + typedef DOMObjectWithGlobalPointer Base; +public: + JSHTMLAllCollection(NonNullPassRefPtr, JSDOMGlobalObject*, PassRefPtr); + virtual ~JSHTMLAllCollection(); + static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); + virtual bool getOwnPropertySlot(JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + + static PassRefPtr createStructure(JSC::JSValue prototype) + { + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags)); + } + + virtual JSC::CallType getCallData(JSC::CallData&); + + virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&); + virtual bool toBoolean(JSC::ExecState*) const { return false; }; + static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); + + // Custom functions + JSC::JSValue item(JSC::ExecState*, const JSC::ArgList&); + JSC::JSValue namedItem(JSC::ExecState*, const JSC::ArgList&); + HTMLAllCollection* impl() const { return m_impl.get(); } + +private: + RefPtr m_impl; +protected: + static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | JSC::MasqueradesAsUndefined | Base::StructureFlags; + static JSC::JSValue indexGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); +private: + static bool canGetItemsForName(JSC::ExecState*, HTMLAllCollection*, const JSC::Identifier&); + static JSC::JSValue nameGetter(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); +}; + +JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, HTMLAllCollection*); +HTMLAllCollection* toHTMLAllCollection(JSC::JSValue); + +class JSHTMLAllCollectionPrototype : public JSC::JSObject { + typedef JSC::JSObject Base; +public: + static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); + static PassRefPtr createStructure(JSC::JSValue prototype) + { + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags)); + } + JSHTMLAllCollectionPrototype(NonNullPassRefPtr structure) : JSC::JSObject(structure) { } +protected: + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; +}; + +// Functions + +JSC::JSValue JSC_HOST_CALL jsHTMLAllCollectionPrototypeFunctionItem(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); +JSC::JSValue JSC_HOST_CALL jsHTMLAllCollectionPrototypeFunctionNamedItem(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); +JSC::JSValue JSC_HOST_CALL jsHTMLAllCollectionPrototypeFunctionTags(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); +// Attributes + +JSC::JSValue jsHTMLAllCollectionLength(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); +JSC::JSValue jsHTMLAllCollectionConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); + +} // namespace WebCore + +#endif diff --git a/src/3rdparty/webkit/WebCore/generated/JSHTMLBodyElement.cpp b/src/3rdparty/webkit/WebCore/generated/JSHTMLBodyElement.cpp index 920f152..5e81799 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSHTMLBodyElement.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSHTMLBodyElement.cpp @@ -350,7 +350,7 @@ void setJSHTMLBodyElementOnbeforeunload(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforeunload(globalObject->createJSAttributeEventListener(value)); @@ -360,7 +360,7 @@ void setJSHTMLBodyElementOnhashchange(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnhashchange(globalObject->createJSAttributeEventListener(value)); @@ -370,7 +370,7 @@ void setJSHTMLBodyElementOnmessage(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmessage(globalObject->createJSAttributeEventListener(value)); @@ -380,7 +380,7 @@ void setJSHTMLBodyElementOnoffline(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnoffline(globalObject->createJSAttributeEventListener(value)); @@ -390,7 +390,7 @@ void setJSHTMLBodyElementOnonline(ExecState* exec, JSObject* thisObject, JSValue { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnonline(globalObject->createJSAttributeEventListener(value)); @@ -400,7 +400,7 @@ void setJSHTMLBodyElementOnresize(ExecState* exec, JSObject* thisObject, JSValue { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnresize(globalObject->createJSAttributeEventListener(value)); @@ -410,7 +410,7 @@ void setJSHTMLBodyElementOnstorage(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnstorage(globalObject->createJSAttributeEventListener(value)); @@ -420,7 +420,7 @@ void setJSHTMLBodyElementOnunload(ExecState* exec, JSObject* thisObject, JSValue { UNUSED_PARAM(exec); HTMLBodyElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnunload(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.cpp b/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.cpp index 63c0d93..213b3c5 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.cpp @@ -24,10 +24,7 @@ #include "AtomicString.h" #include "HTMLCollection.h" #include "JSNode.h" -#include "JSNodeList.h" -#include "NameNodeList.h" #include "Node.h" -#include "NodeList.h" #include #include #include @@ -104,11 +101,10 @@ bool JSHTMLCollectionConstructor::getOwnPropertyDescriptor(ExecState* exec, cons /* Hash table for prototype */ -static const HashTableValue JSHTMLCollectionPrototypeTableValues[4] = +static const HashTableValue JSHTMLCollectionPrototypeTableValues[3] = { { "item", DontDelete|Function, (intptr_t)jsHTMLCollectionPrototypeFunctionItem, (intptr_t)1 }, { "namedItem", DontDelete|Function, (intptr_t)jsHTMLCollectionPrototypeFunctionNamedItem, (intptr_t)1 }, - { "tags", DontDelete|Function, (intptr_t)jsHTMLCollectionPrototypeFunctionTags, (intptr_t)1 }, { 0, 0, 0, 0 } }; @@ -116,7 +112,7 @@ static JSC_CONST_HASHTABLE HashTable JSHTMLCollectionPrototypeTable = #if ENABLE(PERFECT_HASH_SIZE) { 7, JSHTMLCollectionPrototypeTableValues, 0 }; #else - { 8, 7, JSHTMLCollectionPrototypeTableValues, 0 }; + { 5, 3, JSHTMLCollectionPrototypeTableValues, 0 }; #endif const ClassInfo JSHTMLCollectionPrototype::s_info = { "HTMLCollectionPrototype", 0, &JSHTMLCollectionPrototypeTable, 0 }; @@ -146,7 +142,7 @@ JSHTMLCollection::JSHTMLCollection(NonNullPassRefPtr structure, JSDOM JSHTMLCollection::~JSHTMLCollection() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSHTMLCollection::createPrototype(ExecState* exec, JSGlobalObject* globalObject) @@ -260,20 +256,6 @@ JSValue JSC_HOST_CALL jsHTMLCollectionPrototypeFunctionNamedItem(ExecState* exec return castedThisObj->namedItem(exec, args); } -JSValue JSC_HOST_CALL jsHTMLCollectionPrototypeFunctionTags(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) -{ - UNUSED_PARAM(args); - if (!thisValue.inherits(&JSHTMLCollection::s_info)) - return throwError(exec, TypeError); - JSHTMLCollection* castedThisObj = static_cast(asObject(thisValue)); - HTMLCollection* imp = static_cast(castedThisObj->impl()); - const UString& name = args.at(0).toString(exec); - - - JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->tags(name))); - return result; -} - JSValue JSHTMLCollection::indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot) { diff --git a/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.h b/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.h index 447f620..e14a2c2 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.h +++ b/src/3rdparty/webkit/WebCore/generated/JSHTMLCollection.h @@ -92,7 +92,6 @@ protected: JSC::JSValue JSC_HOST_CALL jsHTMLCollectionPrototypeFunctionItem(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); JSC::JSValue JSC_HOST_CALL jsHTMLCollectionPrototypeFunctionNamedItem(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); -JSC::JSValue JSC_HOST_CALL jsHTMLCollectionPrototypeFunctionTags(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); // Attributes JSC::JSValue jsHTMLCollectionLength(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&); diff --git a/src/3rdparty/webkit/WebCore/generated/JSHTMLFrameSetElement.cpp b/src/3rdparty/webkit/WebCore/generated/JSHTMLFrameSetElement.cpp index f336c76..9e506a0 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSHTMLFrameSetElement.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSHTMLFrameSetElement.cpp @@ -300,7 +300,7 @@ void setJSHTMLFrameSetElementOnbeforeunload(ExecState* exec, JSObject* thisObjec { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforeunload(globalObject->createJSAttributeEventListener(value)); @@ -310,7 +310,7 @@ void setJSHTMLFrameSetElementOnhashchange(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnhashchange(globalObject->createJSAttributeEventListener(value)); @@ -320,7 +320,7 @@ void setJSHTMLFrameSetElementOnmessage(ExecState* exec, JSObject* thisObject, JS { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmessage(globalObject->createJSAttributeEventListener(value)); @@ -330,7 +330,7 @@ void setJSHTMLFrameSetElementOnoffline(ExecState* exec, JSObject* thisObject, JS { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnoffline(globalObject->createJSAttributeEventListener(value)); @@ -340,7 +340,7 @@ void setJSHTMLFrameSetElementOnonline(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnonline(globalObject->createJSAttributeEventListener(value)); @@ -350,7 +350,7 @@ void setJSHTMLFrameSetElementOnresize(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnresize(globalObject->createJSAttributeEventListener(value)); @@ -360,7 +360,7 @@ void setJSHTMLFrameSetElementOnstorage(ExecState* exec, JSObject* thisObject, JS { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnstorage(globalObject->createJSAttributeEventListener(value)); @@ -370,7 +370,7 @@ void setJSHTMLFrameSetElementOnunload(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); HTMLFrameSetElement* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnunload(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSHistory.cpp b/src/3rdparty/webkit/WebCore/generated/JSHistory.cpp index 5331441..02be6ba 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSHistory.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSHistory.cpp @@ -92,7 +92,7 @@ JSHistory::JSHistory(NonNullPassRefPtr structure, JSDOMGlobalObject* JSHistory::~JSHistory() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSHistory::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSImageData.cpp b/src/3rdparty/webkit/WebCore/generated/JSImageData.cpp index a21fb87..1de3c43 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSImageData.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSImageData.cpp @@ -126,7 +126,7 @@ JSImageData::JSImageData(NonNullPassRefPtr structure, JSDOMGlobalObje JSImageData::~JSImageData() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSImageData::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSInspectorBackend.cpp b/src/3rdparty/webkit/WebCore/generated/JSInspectorBackend.cpp index 8da82cc..f72baaa 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSInspectorBackend.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSInspectorBackend.cpp @@ -214,7 +214,7 @@ JSInspectorBackend::JSInspectorBackend(NonNullPassRefPtr structure, J JSInspectorBackend::~JSInspectorBackend() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSInspectorBackend::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSJavaScriptCallFrame.cpp b/src/3rdparty/webkit/WebCore/generated/JSJavaScriptCallFrame.cpp index 798d540..2acd1af 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSJavaScriptCallFrame.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSJavaScriptCallFrame.cpp @@ -101,7 +101,7 @@ JSJavaScriptCallFrame::JSJavaScriptCallFrame(NonNullPassRefPtr struct JSJavaScriptCallFrame::~JSJavaScriptCallFrame() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSJavaScriptCallFrame::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSLocation.cpp b/src/3rdparty/webkit/WebCore/generated/JSLocation.cpp index ca21205..bb4d56c 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSLocation.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSLocation.cpp @@ -108,7 +108,7 @@ JSLocation::JSLocation(NonNullPassRefPtr structure, JSDOMGlobalObject JSLocation::~JSLocation() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSLocation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp b/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp index b7d4c19..93cde9f 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSMedia.cpp @@ -138,7 +138,7 @@ JSMedia::JSMedia(NonNullPassRefPtr structure, JSDOMGlobalObject* glob JSMedia::~JSMedia() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSMedia::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSMediaError.cpp b/src/3rdparty/webkit/WebCore/generated/JSMediaError.cpp index 97e35e0..534a585 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSMediaError.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSMediaError.cpp @@ -146,7 +146,7 @@ JSMediaError::JSMediaError(NonNullPassRefPtr structure, JSDOMGlobalOb JSMediaError::~JSMediaError() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSMediaError::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSMediaList.cpp b/src/3rdparty/webkit/WebCore/generated/JSMediaList.cpp index 93a17b4..e7b758e 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSMediaList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSMediaList.cpp @@ -142,7 +142,7 @@ JSMediaList::JSMediaList(NonNullPassRefPtr structure, JSDOMGlobalObje JSMediaList::~JSMediaList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSMediaList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSMessageChannel.cpp b/src/3rdparty/webkit/WebCore/generated/JSMessageChannel.cpp index 4fdac64..8ba6f01 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSMessageChannel.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSMessageChannel.cpp @@ -87,7 +87,7 @@ JSMessageChannel::JSMessageChannel(NonNullPassRefPtr structure, JSDOM JSMessageChannel::~JSMessageChannel() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSMessageChannel::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSMessagePort.cpp b/src/3rdparty/webkit/WebCore/generated/JSMessagePort.cpp index 28e1492..a65091c 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSMessagePort.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSMessagePort.cpp @@ -158,7 +158,7 @@ JSMessagePort::JSMessagePort(NonNullPassRefPtr structure, JSDOMGlobal JSMessagePort::~JSMessagePort() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSMessagePort::createPrototype(ExecState* exec, JSGlobalObject* globalObject) @@ -202,7 +202,7 @@ void setJSMessagePortOnmessage(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); MessagePort* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmessage(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSMimeType.cpp b/src/3rdparty/webkit/WebCore/generated/JSMimeType.cpp index f797df2..c91aaeb 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSMimeType.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSMimeType.cpp @@ -131,7 +131,7 @@ JSMimeType::JSMimeType(NonNullPassRefPtr structure, JSDOMGlobalObject JSMimeType::~JSMimeType() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSMimeType::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSMimeTypeArray.cpp b/src/3rdparty/webkit/WebCore/generated/JSMimeTypeArray.cpp index 0384539..3c7b740 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSMimeTypeArray.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSMimeTypeArray.cpp @@ -142,7 +142,7 @@ JSMimeTypeArray::JSMimeTypeArray(NonNullPassRefPtr structure, JSDOMGl JSMimeTypeArray::~JSMimeTypeArray() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSMimeTypeArray::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSNamedNodeMap.cpp b/src/3rdparty/webkit/WebCore/generated/JSNamedNodeMap.cpp index e3cc8d2..e9c79a1 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSNamedNodeMap.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSNamedNodeMap.cpp @@ -147,7 +147,7 @@ JSNamedNodeMap::JSNamedNodeMap(NonNullPassRefPtr structure, JSDOMGlob JSNamedNodeMap::~JSNamedNodeMap() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSNamedNodeMap::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSNavigator.cpp b/src/3rdparty/webkit/WebCore/generated/JSNavigator.cpp index 6dcda62..1c8e190 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSNavigator.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSNavigator.cpp @@ -108,7 +108,7 @@ JSNavigator::JSNavigator(NonNullPassRefPtr structure, JSDOMGlobalObje JSNavigator::~JSNavigator() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSNavigator::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSNode.cpp b/src/3rdparty/webkit/WebCore/generated/JSNode.cpp index e132829..e3a2006 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSNode.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSNode.cpp @@ -221,7 +221,7 @@ JSNode::JSNode(NonNullPassRefPtr structure, JSDOMGlobalObject* global JSNode::~JSNode() { impl()->invalidateEventListeners(); - forgetDOMNode(impl()->document(), impl()); + forgetDOMNode(this, impl(), impl()->document()); } JSObject* JSNode::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSNodeFilter.cpp b/src/3rdparty/webkit/WebCore/generated/JSNodeFilter.cpp index 141a060..22726f6 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSNodeFilter.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSNodeFilter.cpp @@ -167,7 +167,7 @@ JSNodeFilter::JSNodeFilter(NonNullPassRefPtr structure, JSDOMGlobalOb JSNodeFilter::~JSNodeFilter() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSNodeFilter::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSNodeIterator.cpp b/src/3rdparty/webkit/WebCore/generated/JSNodeIterator.cpp index cf85e40..8570d24 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSNodeIterator.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSNodeIterator.cpp @@ -148,7 +148,7 @@ JSNodeIterator::JSNodeIterator(NonNullPassRefPtr structure, JSDOMGlob JSNodeIterator::~JSNodeIterator() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSNodeIterator::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSNodeList.cpp b/src/3rdparty/webkit/WebCore/generated/JSNodeList.cpp index 01ee9ac..3f3131e 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSNodeList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSNodeList.cpp @@ -142,7 +142,7 @@ JSNodeList::JSNodeList(NonNullPassRefPtr structure, JSDOMGlobalObject JSNodeList::~JSNodeList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSNodeList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSPlugin.cpp b/src/3rdparty/webkit/WebCore/generated/JSPlugin.cpp index 035a352..1c7b6ec 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSPlugin.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSPlugin.cpp @@ -147,7 +147,7 @@ JSPlugin::JSPlugin(NonNullPassRefPtr structure, JSDOMGlobalObject* gl JSPlugin::~JSPlugin() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSPlugin::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSPluginArray.cpp b/src/3rdparty/webkit/WebCore/generated/JSPluginArray.cpp index bd0b579..38a9346 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSPluginArray.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSPluginArray.cpp @@ -143,7 +143,7 @@ JSPluginArray::JSPluginArray(NonNullPassRefPtr structure, JSDOMGlobal JSPluginArray::~JSPluginArray() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSPluginArray::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSPositionError.cpp b/src/3rdparty/webkit/WebCore/generated/JSPositionError.cpp index e178bd9..fffa0c1 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSPositionError.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSPositionError.cpp @@ -146,7 +146,7 @@ JSPositionError::JSPositionError(NonNullPassRefPtr structure, JSDOMGl JSPositionError::~JSPositionError() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSPositionError::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSRGBColor.cpp b/src/3rdparty/webkit/WebCore/generated/JSRGBColor.cpp index 0dff99a..e45ce66 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSRGBColor.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSRGBColor.cpp @@ -128,7 +128,7 @@ JSRGBColor::JSRGBColor(NonNullPassRefPtr structure, JSDOMGlobalObject JSRGBColor::~JSRGBColor() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSRGBColor::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSRange.cpp b/src/3rdparty/webkit/WebCore/generated/JSRange.cpp index cc59119..bc9979b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSRange.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSRange.cpp @@ -194,7 +194,7 @@ JSRange::JSRange(NonNullPassRefPtr structure, JSDOMGlobalObject* glob JSRange::~JSRange() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSRange::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSRangeException.cpp b/src/3rdparty/webkit/WebCore/generated/JSRangeException.cpp index 2f8e618..bbb172d 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSRangeException.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSRangeException.cpp @@ -145,7 +145,7 @@ JSRangeException::JSRangeException(NonNullPassRefPtr structure, JSDOM JSRangeException::~JSRangeException() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSRangeException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSRect.cpp b/src/3rdparty/webkit/WebCore/generated/JSRect.cpp index 37c4669..e57d688 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSRect.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSRect.cpp @@ -129,7 +129,7 @@ JSRect::JSRect(NonNullPassRefPtr structure, JSDOMGlobalObject* global JSRect::~JSRect() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSQLError.cpp b/src/3rdparty/webkit/WebCore/generated/JSSQLError.cpp index a318e1d..79fdc89 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSQLError.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSQLError.cpp @@ -83,7 +83,7 @@ JSSQLError::JSSQLError(NonNullPassRefPtr structure, JSDOMGlobalObject JSSQLError::~JSSQLError() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSQLError::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSQLResultSet.cpp b/src/3rdparty/webkit/WebCore/generated/JSSQLResultSet.cpp index 223de95..fa85ad6 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSQLResultSet.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSQLResultSet.cpp @@ -84,7 +84,7 @@ JSSQLResultSet::JSSQLResultSet(NonNullPassRefPtr structure, JSDOMGlob JSSQLResultSet::~JSSQLResultSet() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSQLResultSet::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSQLResultSetRowList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSQLResultSetRowList.cpp index dddf0c4..090e4f7 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSQLResultSetRowList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSQLResultSetRowList.cpp @@ -92,7 +92,7 @@ JSSQLResultSetRowList::JSSQLResultSetRowList(NonNullPassRefPtr struct JSSQLResultSetRowList::~JSSQLResultSetRowList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSQLResultSetRowList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSQLTransaction.cpp b/src/3rdparty/webkit/WebCore/generated/JSSQLTransaction.cpp index c2c0e54..e165dad 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSQLTransaction.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSQLTransaction.cpp @@ -76,7 +76,7 @@ JSSQLTransaction::JSSQLTransaction(NonNullPassRefPtr structure, JSDOM JSSQLTransaction::~JSSQLTransaction() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSQLTransaction::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAngle.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAngle.cpp index 220f4a6..e6d4795 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAngle.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAngle.cpp @@ -156,7 +156,7 @@ JSSVGAngle::JSSVGAngle(NonNullPassRefPtr structure, JSDOMGlobalObject JSSVGAngle::~JSSVGAngle() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAngle::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedAngle.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedAngle.cpp index c09ce1c..599f5ca 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedAngle.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedAngle.cpp @@ -81,7 +81,7 @@ JSSVGAnimatedAngle::JSSVGAnimatedAngle(NonNullPassRefPtr structure, J JSSVGAnimatedAngle::~JSSVGAnimatedAngle() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedAngle::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedBoolean.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedBoolean.cpp index fb3f4c8..131b358 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedBoolean.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedBoolean.cpp @@ -79,7 +79,7 @@ JSSVGAnimatedBoolean::JSSVGAnimatedBoolean(NonNullPassRefPtr structur JSSVGAnimatedBoolean::~JSSVGAnimatedBoolean() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedBoolean::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedEnumeration.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedEnumeration.cpp index 8fbe43e..6a27988 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedEnumeration.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedEnumeration.cpp @@ -80,7 +80,7 @@ JSSVGAnimatedEnumeration::JSSVGAnimatedEnumeration(NonNullPassRefPtr JSSVGAnimatedEnumeration::~JSSVGAnimatedEnumeration() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedEnumeration::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedInteger.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedInteger.cpp index f52a51b..86c388b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedInteger.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedInteger.cpp @@ -80,7 +80,7 @@ JSSVGAnimatedInteger::JSSVGAnimatedInteger(NonNullPassRefPtr structur JSSVGAnimatedInteger::~JSSVGAnimatedInteger() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedInteger::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLength.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLength.cpp index 50826a7..f5fff5e 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLength.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLength.cpp @@ -80,7 +80,7 @@ JSSVGAnimatedLength::JSSVGAnimatedLength(NonNullPassRefPtr structure, JSSVGAnimatedLength::~JSSVGAnimatedLength() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedLength::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLengthList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLengthList.cpp index b0c3743..5525640 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLengthList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedLengthList.cpp @@ -81,7 +81,7 @@ JSSVGAnimatedLengthList::JSSVGAnimatedLengthList(NonNullPassRefPtr st JSSVGAnimatedLengthList::~JSSVGAnimatedLengthList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedLengthList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumber.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumber.cpp index ef16117..69f1490 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumber.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumber.cpp @@ -80,7 +80,7 @@ JSSVGAnimatedNumber::JSSVGAnimatedNumber(NonNullPassRefPtr structure, JSSVGAnimatedNumber::~JSSVGAnimatedNumber() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedNumber::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumberList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumberList.cpp index af11dbd..0fa8afa 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumberList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedNumberList.cpp @@ -81,7 +81,7 @@ JSSVGAnimatedNumberList::JSSVGAnimatedNumberList(NonNullPassRefPtr st JSSVGAnimatedNumberList::~JSSVGAnimatedNumberList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedNumberList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedPreserveAspectRatio.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedPreserveAspectRatio.cpp index 53f0b60..b64ee3a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedPreserveAspectRatio.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedPreserveAspectRatio.cpp @@ -81,7 +81,7 @@ JSSVGAnimatedPreserveAspectRatio::JSSVGAnimatedPreserveAspectRatio(NonNullPassRe JSSVGAnimatedPreserveAspectRatio::~JSSVGAnimatedPreserveAspectRatio() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedPreserveAspectRatio::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedRect.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedRect.cpp index 432a4d5..0db579b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedRect.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedRect.cpp @@ -81,7 +81,7 @@ JSSVGAnimatedRect::JSSVGAnimatedRect(NonNullPassRefPtr structure, JSD JSSVGAnimatedRect::~JSSVGAnimatedRect() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedString.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedString.cpp index c3ccd92..a26a070 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedString.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedString.cpp @@ -82,7 +82,7 @@ JSSVGAnimatedString::JSSVGAnimatedString(NonNullPassRefPtr structure, JSSVGAnimatedString::~JSSVGAnimatedString() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedString::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedTransformList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedTransformList.cpp index 52b2395..62c3121 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedTransformList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGAnimatedTransformList.cpp @@ -81,7 +81,7 @@ JSSVGAnimatedTransformList::JSSVGAnimatedTransformList(NonNullPassRefPtrglobalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGAnimatedTransformList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstance.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstance.cpp index 10d375d..1bb0736 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstance.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstance.cpp @@ -153,7 +153,7 @@ JSSVGElementInstance::JSSVGElementInstance(NonNullPassRefPtr structur JSSVGElementInstance::~JSSVGElementInstance() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGElementInstance::createPrototype(ExecState* exec, JSGlobalObject* globalObject) @@ -724,7 +724,7 @@ void setJSSVGElementInstanceOnabort(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnabort(globalObject->createJSAttributeEventListener(value)); @@ -734,7 +734,7 @@ void setJSSVGElementInstanceOnblur(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnblur(globalObject->createJSAttributeEventListener(value)); @@ -744,7 +744,7 @@ void setJSSVGElementInstanceOnchange(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnchange(globalObject->createJSAttributeEventListener(value)); @@ -754,7 +754,7 @@ void setJSSVGElementInstanceOnclick(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnclick(globalObject->createJSAttributeEventListener(value)); @@ -764,7 +764,7 @@ void setJSSVGElementInstanceOncontextmenu(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncontextmenu(globalObject->createJSAttributeEventListener(value)); @@ -774,7 +774,7 @@ void setJSSVGElementInstanceOndblclick(ExecState* exec, JSObject* thisObject, JS { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndblclick(globalObject->createJSAttributeEventListener(value)); @@ -784,7 +784,7 @@ void setJSSVGElementInstanceOnerror(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); @@ -794,7 +794,7 @@ void setJSSVGElementInstanceOnfocus(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnfocus(globalObject->createJSAttributeEventListener(value)); @@ -804,7 +804,7 @@ void setJSSVGElementInstanceOninput(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOninput(globalObject->createJSAttributeEventListener(value)); @@ -814,7 +814,7 @@ void setJSSVGElementInstanceOnkeydown(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeydown(globalObject->createJSAttributeEventListener(value)); @@ -824,7 +824,7 @@ void setJSSVGElementInstanceOnkeypress(ExecState* exec, JSObject* thisObject, JS { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeypress(globalObject->createJSAttributeEventListener(value)); @@ -834,7 +834,7 @@ void setJSSVGElementInstanceOnkeyup(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnkeyup(globalObject->createJSAttributeEventListener(value)); @@ -844,7 +844,7 @@ void setJSSVGElementInstanceOnload(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnload(globalObject->createJSAttributeEventListener(value)); @@ -854,7 +854,7 @@ void setJSSVGElementInstanceOnmousedown(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousedown(globalObject->createJSAttributeEventListener(value)); @@ -864,7 +864,7 @@ void setJSSVGElementInstanceOnmousemove(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousemove(globalObject->createJSAttributeEventListener(value)); @@ -874,7 +874,7 @@ void setJSSVGElementInstanceOnmouseout(ExecState* exec, JSObject* thisObject, JS { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseout(globalObject->createJSAttributeEventListener(value)); @@ -884,7 +884,7 @@ void setJSSVGElementInstanceOnmouseover(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseover(globalObject->createJSAttributeEventListener(value)); @@ -894,7 +894,7 @@ void setJSSVGElementInstanceOnmouseup(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmouseup(globalObject->createJSAttributeEventListener(value)); @@ -904,7 +904,7 @@ void setJSSVGElementInstanceOnmousewheel(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmousewheel(globalObject->createJSAttributeEventListener(value)); @@ -914,7 +914,7 @@ void setJSSVGElementInstanceOnbeforecut(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforecut(globalObject->createJSAttributeEventListener(value)); @@ -924,7 +924,7 @@ void setJSSVGElementInstanceOncut(ExecState* exec, JSObject* thisObject, JSValue { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncut(globalObject->createJSAttributeEventListener(value)); @@ -934,7 +934,7 @@ void setJSSVGElementInstanceOnbeforecopy(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforecopy(globalObject->createJSAttributeEventListener(value)); @@ -944,7 +944,7 @@ void setJSSVGElementInstanceOncopy(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOncopy(globalObject->createJSAttributeEventListener(value)); @@ -954,7 +954,7 @@ void setJSSVGElementInstanceOnbeforepaste(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnbeforepaste(globalObject->createJSAttributeEventListener(value)); @@ -964,7 +964,7 @@ void setJSSVGElementInstanceOnpaste(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnpaste(globalObject->createJSAttributeEventListener(value)); @@ -974,7 +974,7 @@ void setJSSVGElementInstanceOndragenter(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragenter(globalObject->createJSAttributeEventListener(value)); @@ -984,7 +984,7 @@ void setJSSVGElementInstanceOndragover(ExecState* exec, JSObject* thisObject, JS { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragover(globalObject->createJSAttributeEventListener(value)); @@ -994,7 +994,7 @@ void setJSSVGElementInstanceOndragleave(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragleave(globalObject->createJSAttributeEventListener(value)); @@ -1004,7 +1004,7 @@ void setJSSVGElementInstanceOndrop(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndrop(globalObject->createJSAttributeEventListener(value)); @@ -1014,7 +1014,7 @@ void setJSSVGElementInstanceOndragstart(ExecState* exec, JSObject* thisObject, J { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragstart(globalObject->createJSAttributeEventListener(value)); @@ -1024,7 +1024,7 @@ void setJSSVGElementInstanceOndrag(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndrag(globalObject->createJSAttributeEventListener(value)); @@ -1034,7 +1034,7 @@ void setJSSVGElementInstanceOndragend(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOndragend(globalObject->createJSAttributeEventListener(value)); @@ -1044,7 +1044,7 @@ void setJSSVGElementInstanceOnreset(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnreset(globalObject->createJSAttributeEventListener(value)); @@ -1054,7 +1054,7 @@ void setJSSVGElementInstanceOnresize(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnresize(globalObject->createJSAttributeEventListener(value)); @@ -1064,7 +1064,7 @@ void setJSSVGElementInstanceOnscroll(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnscroll(globalObject->createJSAttributeEventListener(value)); @@ -1074,7 +1074,7 @@ void setJSSVGElementInstanceOnsearch(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnsearch(globalObject->createJSAttributeEventListener(value)); @@ -1084,7 +1084,7 @@ void setJSSVGElementInstanceOnselect(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnselect(globalObject->createJSAttributeEventListener(value)); @@ -1094,7 +1094,7 @@ void setJSSVGElementInstanceOnselectstart(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnselectstart(globalObject->createJSAttributeEventListener(value)); @@ -1104,7 +1104,7 @@ void setJSSVGElementInstanceOnsubmit(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnsubmit(globalObject->createJSAttributeEventListener(value)); @@ -1114,7 +1114,7 @@ void setJSSVGElementInstanceOnunload(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); SVGElementInstance* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnunload(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstanceList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstanceList.cpp index 8bc5bc0..893cc76 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstanceList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGElementInstanceList.cpp @@ -94,7 +94,7 @@ JSSVGElementInstanceList::JSSVGElementInstanceList(NonNullPassRefPtr JSSVGElementInstanceList::~JSSVGElementInstanceList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGElementInstanceList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGException.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGException.cpp index 039182f..8906774 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGException.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGException.cpp @@ -150,7 +150,7 @@ JSSVGException::JSSVGException(NonNullPassRefPtr structure, JSDOMGlob JSSVGException::~JSSVGException() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGLength.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGLength.cpp index f97df89..0bcf836 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGLength.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGLength.cpp @@ -169,7 +169,7 @@ JSSVGLength::JSSVGLength(NonNullPassRefPtr structure, JSDOMGlobalObje JSSVGLength::~JSSVGLength() { JSSVGDynamicPODTypeWrapperCache::forgetWrapper(m_impl.get()); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGLength::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGLengthList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGLengthList.cpp index 952a5f0..a984bd1 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGLengthList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGLengthList.cpp @@ -100,7 +100,7 @@ JSSVGLengthList::JSSVGLengthList(NonNullPassRefPtr structure, JSDOMGl JSSVGLengthList::~JSSVGLengthList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGLengthList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGMatrix.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGMatrix.cpp index ba8dfe8..d46ce6f 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGMatrix.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGMatrix.cpp @@ -107,7 +107,7 @@ JSSVGMatrix::JSSVGMatrix(NonNullPassRefPtr structure, JSDOMGlobalObje JSSVGMatrix::~JSSVGMatrix() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGMatrix::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGNumber.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGNumber.cpp index 2bfe658..8ba2042 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGNumber.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGNumber.cpp @@ -79,7 +79,7 @@ JSSVGNumber::JSSVGNumber(NonNullPassRefPtr structure, JSDOMGlobalObje JSSVGNumber::~JSSVGNumber() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGNumber::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGNumberList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGNumberList.cpp index dc6f5a4..fa0e3cf 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGNumberList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGNumberList.cpp @@ -99,7 +99,7 @@ JSSVGNumberList::JSSVGNumberList(NonNullPassRefPtr structure, JSDOMGl JSSVGNumberList::~JSSVGNumberList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGNumberList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGPathSeg.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGPathSeg.cpp index 2f1ecbd..767098b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGPathSeg.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGPathSeg.cpp @@ -181,7 +181,7 @@ JSSVGPathSeg::JSSVGPathSeg(NonNullPassRefPtr structure, JSDOMGlobalOb JSSVGPathSeg::~JSSVGPathSeg() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGPathSeg::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGPathSegList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGPathSegList.cpp index 0043533..9a35c1b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGPathSegList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGPathSegList.cpp @@ -99,7 +99,7 @@ JSSVGPathSegList::JSSVGPathSegList(NonNullPassRefPtr structure, JSDOM JSSVGPathSegList::~JSSVGPathSegList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGPathSegList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGPoint.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGPoint.cpp index e4c2415..67c35e2 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGPoint.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGPoint.cpp @@ -94,7 +94,7 @@ JSSVGPoint::JSSVGPoint(NonNullPassRefPtr structure, JSDOMGlobalObject JSSVGPoint::~JSSVGPoint() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGPoint::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGPointList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGPointList.cpp index 4a22ff9..6968c80 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGPointList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGPointList.cpp @@ -98,7 +98,7 @@ JSSVGPointList::JSSVGPointList(NonNullPassRefPtr structure, JSDOMGlob JSSVGPointList::~JSSVGPointList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGPointList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGPreserveAspectRatio.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGPreserveAspectRatio.cpp index 0f3329c..578cd34 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGPreserveAspectRatio.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGPreserveAspectRatio.cpp @@ -167,7 +167,7 @@ JSSVGPreserveAspectRatio::JSSVGPreserveAspectRatio(NonNullPassRefPtr JSSVGPreserveAspectRatio::~JSSVGPreserveAspectRatio() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGPreserveAspectRatio::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGRect.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGRect.cpp index 8360b4b..e60a309 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGRect.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGRect.cpp @@ -83,7 +83,7 @@ JSSVGRect::JSSVGRect(NonNullPassRefPtr structure, JSDOMGlobalObject* JSSVGRect::~JSSVGRect() { JSSVGDynamicPODTypeWrapperCache::forgetWrapper(m_impl.get()); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGRect::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGRenderingIntent.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGRenderingIntent.cpp index b484fbf..1793c23 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGRenderingIntent.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGRenderingIntent.cpp @@ -148,7 +148,7 @@ JSSVGRenderingIntent::JSSVGRenderingIntent(NonNullPassRefPtr structur JSSVGRenderingIntent::~JSSVGRenderingIntent() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGRenderingIntent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGStringList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGStringList.cpp index d4a6935..591ca64 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGStringList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGStringList.cpp @@ -100,7 +100,7 @@ JSSVGStringList::JSSVGStringList(NonNullPassRefPtr structure, JSDOMGl JSSVGStringList::~JSSVGStringList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGStringList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGTransform.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGTransform.cpp index 82cddb6..2f51e56 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGTransform.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGTransform.cpp @@ -162,7 +162,7 @@ JSSVGTransform::JSSVGTransform(NonNullPassRefPtr structure, JSDOMGlob JSSVGTransform::~JSSVGTransform() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGTransform::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGTransformList.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGTransformList.cpp index 51c0cca..8ce9342 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGTransformList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGTransformList.cpp @@ -103,7 +103,7 @@ JSSVGTransformList::JSSVGTransformList(NonNullPassRefPtr structure, J JSSVGTransformList::~JSSVGTransformList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGTransformList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSSVGUnitTypes.cpp b/src/3rdparty/webkit/WebCore/generated/JSSVGUnitTypes.cpp index 452fc9c..fb3321a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSSVGUnitTypes.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSSVGUnitTypes.cpp @@ -142,7 +142,7 @@ JSSVGUnitTypes::JSSVGUnitTypes(NonNullPassRefPtr structure, JSDOMGlob JSSVGUnitTypes::~JSSVGUnitTypes() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSSVGUnitTypes::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSScreen.cpp b/src/3rdparty/webkit/WebCore/generated/JSScreen.cpp index 574f44c..7ccffa3 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSScreen.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSScreen.cpp @@ -84,7 +84,7 @@ JSScreen::JSScreen(NonNullPassRefPtr structure, JSDOMGlobalObject* gl JSScreen::~JSScreen() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSScreen::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSStorage.cpp b/src/3rdparty/webkit/WebCore/generated/JSStorage.cpp index 998b8cf..e0ae01b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSStorage.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSStorage.cpp @@ -147,7 +147,7 @@ JSStorage::JSStorage(NonNullPassRefPtr structure, JSDOMGlobalObject* JSStorage::~JSStorage() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSStorage::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSStyleSheet.cpp b/src/3rdparty/webkit/WebCore/generated/JSStyleSheet.cpp index ae7011d..b84ab6b 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSStyleSheet.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSStyleSheet.cpp @@ -136,7 +136,7 @@ JSStyleSheet::JSStyleSheet(NonNullPassRefPtr structure, JSDOMGlobalOb JSStyleSheet::~JSStyleSheet() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSStyleSheet::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSStyleSheetList.cpp b/src/3rdparty/webkit/WebCore/generated/JSStyleSheetList.cpp index 5d07cc1..db3d083 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSStyleSheetList.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSStyleSheetList.cpp @@ -141,7 +141,7 @@ JSStyleSheetList::JSStyleSheetList(NonNullPassRefPtr structure, JSDOM JSStyleSheetList::~JSStyleSheetList() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSStyleSheetList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSTextMetrics.cpp b/src/3rdparty/webkit/WebCore/generated/JSTextMetrics.cpp index 627ad3b..940498a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSTextMetrics.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSTextMetrics.cpp @@ -125,7 +125,7 @@ JSTextMetrics::JSTextMetrics(NonNullPassRefPtr structure, JSDOMGlobal JSTextMetrics::~JSTextMetrics() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSTextMetrics::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSTimeRanges.cpp b/src/3rdparty/webkit/WebCore/generated/JSTimeRanges.cpp index 825ca1b..1306ccb 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSTimeRanges.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSTimeRanges.cpp @@ -93,7 +93,7 @@ JSTimeRanges::JSTimeRanges(NonNullPassRefPtr structure, JSDOMGlobalOb JSTimeRanges::~JSTimeRanges() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSTimeRanges::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSTreeWalker.cpp b/src/3rdparty/webkit/WebCore/generated/JSTreeWalker.cpp index a26425e..10645db 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSTreeWalker.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSTreeWalker.cpp @@ -151,7 +151,7 @@ JSTreeWalker::JSTreeWalker(NonNullPassRefPtr structure, JSDOMGlobalOb JSTreeWalker::~JSTreeWalker() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSTreeWalker::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSValidityState.cpp b/src/3rdparty/webkit/WebCore/generated/JSValidityState.cpp index b355874..7616c58 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSValidityState.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSValidityState.cpp @@ -84,7 +84,7 @@ JSValidityState::JSValidityState(NonNullPassRefPtr structure, JSDOMGl JSValidityState::~JSValidityState() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSValidityState::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSVoidCallback.cpp b/src/3rdparty/webkit/WebCore/generated/JSVoidCallback.cpp index a084949..94ad1c5 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSVoidCallback.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSVoidCallback.cpp @@ -73,7 +73,7 @@ JSVoidCallback::JSVoidCallback(NonNullPassRefPtr structure, JSDOMGlob JSVoidCallback::~JSVoidCallback() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSVoidCallback::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSWebKitCSSMatrix.cpp b/src/3rdparty/webkit/WebCore/generated/JSWebKitCSSMatrix.cpp index bcf8286..0bb2267 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWebKitCSSMatrix.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWebKitCSSMatrix.cpp @@ -120,7 +120,7 @@ JSWebKitCSSMatrix::JSWebKitCSSMatrix(NonNullPassRefPtr structure, JSD JSWebKitCSSMatrix::~JSWebKitCSSMatrix() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSWebKitCSSMatrix::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSWebKitPoint.cpp b/src/3rdparty/webkit/WebCore/generated/JSWebKitPoint.cpp index 255df0a..ea88682 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWebKitPoint.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWebKitPoint.cpp @@ -78,7 +78,7 @@ JSWebKitPoint::JSWebKitPoint(NonNullPassRefPtr structure, JSDOMGlobal JSWebKitPoint::~JSWebKitPoint() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSWebKitPoint::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp b/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp index ea8ff3d..7e48815 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp @@ -122,7 +122,7 @@ JSWebSocket::JSWebSocket(NonNullPassRefPtr structure, JSDOMGlobalObje JSWebSocket::~JSWebSocket() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } void JSWebSocket::markChildren(MarkStack& markStack) @@ -215,7 +215,7 @@ void setJSWebSocketOnopen(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); WebSocket* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnopen(globalObject->createJSAttributeEventListener(value)); @@ -225,7 +225,7 @@ void setJSWebSocketOnmessage(ExecState* exec, JSObject* thisObject, JSValue valu { UNUSED_PARAM(exec); WebSocket* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmessage(globalObject->createJSAttributeEventListener(value)); @@ -235,7 +235,7 @@ void setJSWebSocketOnclose(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); WebSocket* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnclose(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSWorker.cpp b/src/3rdparty/webkit/WebCore/generated/JSWorker.cpp index 42cc502..14153e2 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWorker.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWorker.cpp @@ -129,7 +129,7 @@ void setJSWorkerOnmessage(ExecState* exec, JSObject* thisObject, JSValue value) { UNUSED_PARAM(exec); Worker* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnmessage(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSWorkerContext.cpp b/src/3rdparty/webkit/WebCore/generated/JSWorkerContext.cpp index e29cb32..5b7b105 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWorkerContext.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWorkerContext.cpp @@ -129,7 +129,6 @@ JSWorkerContext::JSWorkerContext(NonNullPassRefPtr structure, PassRef JSWorkerContext::~JSWorkerContext() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); } bool JSWorkerContext::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) diff --git a/src/3rdparty/webkit/WebCore/generated/JSWorkerLocation.cpp b/src/3rdparty/webkit/WebCore/generated/JSWorkerLocation.cpp index e24d0d6..6046aa6 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWorkerLocation.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWorkerLocation.cpp @@ -156,7 +156,7 @@ JSWorkerLocation::JSWorkerLocation(NonNullPassRefPtr structure, JSDOM JSWorkerLocation::~JSWorkerLocation() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSWorkerLocation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSWorkerNavigator.cpp b/src/3rdparty/webkit/WebCore/generated/JSWorkerNavigator.cpp index 8efab1e..29c2364 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWorkerNavigator.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWorkerNavigator.cpp @@ -93,7 +93,7 @@ JSWorkerNavigator::JSWorkerNavigator(NonNullPassRefPtr structure, JSD JSWorkerNavigator::~JSWorkerNavigator() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSWorkerNavigator::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequest.cpp b/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequest.cpp index 9927f5e..d81c689 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequest.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequest.cpp @@ -137,7 +137,7 @@ JSXMLHttpRequest::JSXMLHttpRequest(NonNullPassRefPtr structure, JSDOM JSXMLHttpRequest::~JSXMLHttpRequest() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXMLHttpRequest::createPrototype(ExecState* exec, JSGlobalObject* globalObject) @@ -294,7 +294,7 @@ void setJSXMLHttpRequestOnabort(ExecState* exec, JSObject* thisObject, JSValue v { UNUSED_PARAM(exec); XMLHttpRequest* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnabort(globalObject->createJSAttributeEventListener(value)); @@ -304,7 +304,7 @@ void setJSXMLHttpRequestOnerror(ExecState* exec, JSObject* thisObject, JSValue v { UNUSED_PARAM(exec); XMLHttpRequest* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); @@ -314,7 +314,7 @@ void setJSXMLHttpRequestOnload(ExecState* exec, JSObject* thisObject, JSValue va { UNUSED_PARAM(exec); XMLHttpRequest* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnload(globalObject->createJSAttributeEventListener(value)); @@ -324,7 +324,7 @@ void setJSXMLHttpRequestOnloadstart(ExecState* exec, JSObject* thisObject, JSVal { UNUSED_PARAM(exec); XMLHttpRequest* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnloadstart(globalObject->createJSAttributeEventListener(value)); @@ -334,7 +334,7 @@ void setJSXMLHttpRequestOnprogress(ExecState* exec, JSObject* thisObject, JSValu { UNUSED_PARAM(exec); XMLHttpRequest* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnprogress(globalObject->createJSAttributeEventListener(value)); @@ -344,7 +344,7 @@ void setJSXMLHttpRequestOnreadystatechange(ExecState* exec, JSObject* thisObject { UNUSED_PARAM(exec); XMLHttpRequest* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnreadystatechange(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestException.cpp b/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestException.cpp index 30e0d72..6de17c7 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestException.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestException.cpp @@ -153,7 +153,7 @@ JSXMLHttpRequestException::JSXMLHttpRequestException(NonNullPassRefPtrglobalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXMLHttpRequestException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestUpload.cpp b/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestUpload.cpp index bc5fff9..9ca7972 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestUpload.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXMLHttpRequestUpload.cpp @@ -158,7 +158,7 @@ JSXMLHttpRequestUpload::JSXMLHttpRequestUpload(NonNullPassRefPtr stru JSXMLHttpRequestUpload::~JSXMLHttpRequestUpload() { impl()->invalidateEventListeners(); - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXMLHttpRequestUpload::createPrototype(ExecState* exec, JSGlobalObject* globalObject) @@ -250,7 +250,7 @@ void setJSXMLHttpRequestUploadOnabort(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); XMLHttpRequestUpload* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnabort(globalObject->createJSAttributeEventListener(value)); @@ -260,7 +260,7 @@ void setJSXMLHttpRequestUploadOnerror(ExecState* exec, JSObject* thisObject, JSV { UNUSED_PARAM(exec); XMLHttpRequestUpload* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnerror(globalObject->createJSAttributeEventListener(value)); @@ -270,7 +270,7 @@ void setJSXMLHttpRequestUploadOnload(ExecState* exec, JSObject* thisObject, JSVa { UNUSED_PARAM(exec); XMLHttpRequestUpload* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnload(globalObject->createJSAttributeEventListener(value)); @@ -280,7 +280,7 @@ void setJSXMLHttpRequestUploadOnloadstart(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); XMLHttpRequestUpload* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnloadstart(globalObject->createJSAttributeEventListener(value)); @@ -290,7 +290,7 @@ void setJSXMLHttpRequestUploadOnprogress(ExecState* exec, JSObject* thisObject, { UNUSED_PARAM(exec); XMLHttpRequestUpload* imp = static_cast(static_cast(thisObject)->impl()); - JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext()); + JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec); if (!globalObject) return; imp->setOnprogress(globalObject->createJSAttributeEventListener(value)); diff --git a/src/3rdparty/webkit/WebCore/generated/JSXMLSerializer.cpp b/src/3rdparty/webkit/WebCore/generated/JSXMLSerializer.cpp index e6cdd6b..2fd7e29 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXMLSerializer.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXMLSerializer.cpp @@ -147,7 +147,7 @@ JSXMLSerializer::JSXMLSerializer(NonNullPassRefPtr structure, JSDOMGl JSXMLSerializer::~JSXMLSerializer() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXMLSerializer::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXPathEvaluator.cpp b/src/3rdparty/webkit/WebCore/generated/JSXPathEvaluator.cpp index e25be26..aa8840a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXPathEvaluator.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXPathEvaluator.cpp @@ -158,7 +158,7 @@ JSXPathEvaluator::JSXPathEvaluator(NonNullPassRefPtr structure, JSDOM JSXPathEvaluator::~JSXPathEvaluator() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXPathEvaluator::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXPathException.cpp b/src/3rdparty/webkit/WebCore/generated/JSXPathException.cpp index 3894ac2..fb6a00a 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXPathException.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXPathException.cpp @@ -148,7 +148,7 @@ JSXPathException::JSXPathException(NonNullPassRefPtr structure, JSDOM JSXPathException::~JSXPathException() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXPathException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXPathExpression.cpp b/src/3rdparty/webkit/WebCore/generated/JSXPathExpression.cpp index 9464146..af059df 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXPathExpression.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXPathExpression.cpp @@ -141,7 +141,7 @@ JSXPathExpression::JSXPathExpression(NonNullPassRefPtr structure, JSD JSXPathExpression::~JSXPathExpression() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXPathExpression::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXPathNSResolver.cpp b/src/3rdparty/webkit/WebCore/generated/JSXPathNSResolver.cpp index c3bdef1..7ba29c0 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXPathNSResolver.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXPathNSResolver.cpp @@ -79,7 +79,7 @@ JSXPathNSResolver::JSXPathNSResolver(NonNullPassRefPtr structure, JSD JSXPathNSResolver::~JSXPathNSResolver() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXPathNSResolver::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXPathResult.cpp b/src/3rdparty/webkit/WebCore/generated/JSXPathResult.cpp index 337f473..d70ad29 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXPathResult.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXPathResult.cpp @@ -171,7 +171,7 @@ JSXPathResult::JSXPathResult(NonNullPassRefPtr structure, JSDOMGlobal JSXPathResult::~JSXPathResult() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXPathResult::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/JSXSLTProcessor.cpp b/src/3rdparty/webkit/WebCore/generated/JSXSLTProcessor.cpp index 7dcd9c9..add8a84 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSXSLTProcessor.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSXSLTProcessor.cpp @@ -86,7 +86,7 @@ JSXSLTProcessor::JSXSLTProcessor(NonNullPassRefPtr structure, JSDOMGl JSXSLTProcessor::~JSXSLTProcessor() { - forgetDOMObject(*Heap::heap(this)->globalData(), impl()); + forgetDOMObject(this, impl()); } JSObject* JSXSLTProcessor::createPrototype(ExecState* exec, JSGlobalObject* globalObject) diff --git a/src/3rdparty/webkit/WebCore/generated/WebKitVersion.h b/src/3rdparty/webkit/WebCore/generated/WebKitVersion.h index 11e6af2..568670b 100644 --- a/src/3rdparty/webkit/WebCore/generated/WebKitVersion.h +++ b/src/3rdparty/webkit/WebCore/generated/WebKitVersion.h @@ -31,6 +31,6 @@ #define WebKitVersion_h #define WEBKIT_MAJOR_VERSION 532 -#define WEBKIT_MINOR_VERSION 3 +#define WEBKIT_MINOR_VERSION 4 #endif //WebKitVersion_h diff --git a/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp b/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp index 098a786..c5fb069 100644 --- a/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp +++ b/src/3rdparty/webkit/WebCore/history/qt/HistoryItemQt.cpp @@ -23,10 +23,13 @@ #include "CString.h" #include "FormData.h" -bool WebCore::HistoryItem::restoreState(QDataStream& in, int /*version*/) +bool WebCore::HistoryItem::restoreState(QDataStream& in, int version) { - // there is no different version right now - // switch (version) { + // we only support version 1 for now + + if (version != 1) + return false; + WebCore::String url; WebCore::String title; WebCore::String altTitle; @@ -87,10 +90,12 @@ bool WebCore::HistoryItem::restoreState(QDataStream& in, int /*version*/) return in.status() == QDataStream::Ok; } -QDataStream& WebCore::HistoryItem::saveState(QDataStream& out, int /*version*/) const +QDataStream& WebCore::HistoryItem::saveState(QDataStream& out, int version) const { - // there is no different version right now - // switch (version) { + // we only support version 1 for now. + if (version != 1) + return out; + out << urlString() << title() << alternateTitle() << lastVisitedTime(); out << originalURLString() << referrer() << target() << parent(); out << lastVisitWasHTTPNonGet() << lastVisitWasFailure() << isTargetItem(); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.cpp b/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.cpp new file mode 100644 index 0000000..dbfed28 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "HTMLAllCollection.h" + +#include "Node.h" + +namespace WebCore { + +PassRefPtr HTMLAllCollection::create(PassRefPtr base) +{ + return adoptRef(new HTMLAllCollection(base)); +} + +HTMLAllCollection::HTMLAllCollection(PassRefPtr base) + : HTMLCollection(base, DocAll) +{ +} + +HTMLAllCollection::~HTMLAllCollection() +{ +} + +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.h b/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.h new file mode 100644 index 0000000..1dd3ede --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef HTMLAllCollection_h +#define HTMLAllCollection_h + +#include "HTMLCollection.h" + +namespace WebCore { + +class HTMLAllCollection : public HTMLCollection { +public: + static PassRefPtr create(PassRefPtr); + virtual ~HTMLAllCollection(); + +private: + HTMLAllCollection(PassRefPtr); +}; + +} // namespace WebCore + +#endif // HTMLAllCollection_h diff --git a/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.idl b/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.idl new file mode 100644 index 0000000..d36f41e --- /dev/null +++ b/src/3rdparty/webkit/WebCore/html/HTMLAllCollection.idl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +module html { + + interface [ + GenerateConstructor, + HasIndexGetter, + HasNameGetter, + CustomCall, + MasqueradesAsUndefined + ] HTMLAllCollection { + readonly attribute unsigned long length; + [Custom] Node item(in unsigned long index); + [Custom] Node namedItem(in DOMString name); + + // FIXME: This should return an HTMLAllCollection. + NodeList tags(in DOMString name); + }; + +} diff --git a/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp index 335b20f..7bae6e3 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp @@ -172,10 +172,11 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type) if (m_context && !m_context->is3d()) return 0; if (!m_context) { - m_context = new CanvasRenderingContext3D(this); - - // Need to make sure a RenderLayer and compositing layer get created for the Canvas - setNeedsStyleRecalc(SyntheticStyleChange); + m_context = CanvasRenderingContext3D::create(this); + if (m_context) { + // Need to make sure a RenderLayer and compositing layer get created for the Canvas + setNeedsStyleRecalc(SyntheticStyleChange); + } } return m_context.get(); } diff --git a/src/3rdparty/webkit/WebCore/html/HTMLCollection.h b/src/3rdparty/webkit/WebCore/html/HTMLCollection.h index b04bcbc..eea1777 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLCollection.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLCollection.h @@ -64,6 +64,7 @@ public: protected: HTMLCollection(PassRefPtr base, CollectionType, CollectionCache*); + HTMLCollection(PassRefPtr base, CollectionType); CollectionCache* info() const { return m_info; } void resetCollectionInfo() const; @@ -71,8 +72,6 @@ protected: mutable bool m_idsDone; // for nextNamedItem() private: - HTMLCollection(PassRefPtr base, CollectionType); - virtual Element* itemAfter(Element*) const; virtual unsigned calcLength() const; virtual void updateNameCache() const; diff --git a/src/3rdparty/webkit/WebCore/html/HTMLCollection.idl b/src/3rdparty/webkit/WebCore/html/HTMLCollection.idl index 1ba5ec7..45d1127 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLCollection.idl +++ b/src/3rdparty/webkit/WebCore/html/HTMLCollection.idl @@ -34,8 +34,9 @@ module html { [Custom] Node item(in unsigned long index); [Custom] Node namedItem(in DOMString name); - // Extensions +#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C NodeList tags(in DOMString name); +#endif }; } diff --git a/src/3rdparty/webkit/WebCore/html/HTMLDocument.idl b/src/3rdparty/webkit/WebCore/html/HTMLDocument.idl index 3dd7a07..d250741 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLDocument.idl +++ b/src/3rdparty/webkit/WebCore/html/HTMLDocument.idl @@ -39,7 +39,7 @@ module html { #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT // FIXME: This should eventually be available (if they are wanted) for all languages. - attribute [Custom, Deletable] HTMLCollection all; + attribute [Custom, Deletable] HTMLAllCollection all; #endif void clear(); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp index ed3405a..f25c908 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp @@ -1549,9 +1549,16 @@ void HTMLInputElement::defaultEventHandler(Event* evt) if (r && r->isTextField()) toRenderTextControl(r)->setEdited(false); } - // Form may never have been present, or may have been destroyed by the change event. - if (form()) - form()->submitClick(evt); + + RefPtr formForSubmission = form(); + // If there is no form and the element is an , then create a temporary form just to be used for submission. + if (!formForSubmission && inputType() == ISINDEX) + formForSubmission = createTemporaryFormForIsIndex(); + + // Form may never have been present, or may have been destroyed by code responding to the change event. + if (formForSubmission) + formForSubmission->submitClick(evt); + evt->setDefaultHandled(); return; } @@ -1569,6 +1576,19 @@ void HTMLInputElement::defaultEventHandler(Event* evt) HTMLFormControlElementWithState::defaultEventHandler(evt); } +PassRefPtr HTMLInputElement::createTemporaryFormForIsIndex() +{ + RefPtr form = new HTMLFormElement(formTag, document()); + form->registerFormElement(this); + form->setMethod("GET"); + if (!document()->baseURL().isEmpty()) { + // We treat the href property of the element as the form action, as per section 7.5 + // "Queries and Indexes" of the HTML 2.0 spec. . + form->setAction(document()->baseURL().string()); + } + return form.release(); +} + bool HTMLInputElement::isURLAttribute(Attribute *attr) const { return (attr->name() == srcAttr); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h index 799d92c..0e2da32 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h @@ -256,6 +256,8 @@ private: virtual bool isOptionalFormControl() const { return !isRequiredFormControl(); } virtual bool isRequiredFormControl() const; + PassRefPtr createTemporaryFormForIsIndex(); + #if ENABLE(DATALIST) HTMLDataListElement* dataList() const; #endif diff --git a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp index 11ca3ba..729aceb 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.cpp @@ -247,16 +247,12 @@ void HTMLMediaElement::insertedIntoDocument() scheduleLoad(); } -void HTMLMediaElement::willRemove() -{ - if (m_isFullscreen) - exitFullscreen(); - HTMLElement::willRemove(); -} void HTMLMediaElement::removedFromDocument() { if (m_networkState > NETWORK_EMPTY) pause(); + if (m_isFullscreen) + exitFullscreen(); HTMLElement::removedFromDocument(); } @@ -1678,6 +1674,9 @@ void HTMLMediaElement::userCancelledLoad() void HTMLMediaElement::documentWillBecomeInactive() { + if (m_isFullscreen) + exitFullscreen(); + m_inActiveDocument = false; userCancelledLoad(); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h index 0005e07..405f013 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLMediaElement.h @@ -57,7 +57,6 @@ public: virtual bool rendererIsNeeded(RenderStyle*); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual void insertedIntoDocument(); - virtual void willRemove(); virtual void removedFromDocument(); virtual void attach(); virtual void recalcStyle(StyleChange); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLOptionsCollection.idl b/src/3rdparty/webkit/WebCore/html/HTMLOptionsCollection.idl index 5f85fcb..a7e191a 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLOptionsCollection.idl +++ b/src/3rdparty/webkit/WebCore/html/HTMLOptionsCollection.idl @@ -21,7 +21,6 @@ module html { // FIXME: The W3C spec says that HTMLOptionsCollection should not have a parent class. - interface [ GenerateNativeConverter, HasCustomIndexSetter, @@ -36,9 +35,9 @@ module html { raises (DOMException); [Custom] void remove(in unsigned long index); -#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT - Node item(in unsigned long index); - Node namedItem(in DOMString name); +#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C + Node item(in unsigned long index); + Node namedItem(in DOMString name); #endif }; diff --git a/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp b/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp index 33af997..91285d9 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLTokenizer.cpp @@ -416,13 +416,13 @@ HTMLTokenizer::State HTMLTokenizer::parseNonHTMLText(SegmentedString& src, State return state; } - + HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state) { // We are inside a + @@ -44,6 +45,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + @@ -69,7 +72,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - @@ -94,6 +96,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + @@ -110,7 +113,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-
+
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js index 17b02a1..c24d589 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js @@ -143,8 +143,11 @@ var WebInspector = { this.panels.profiles = new WebInspector.ProfilesPanel(); this.panels.profiles.registerProfileType(new WebInspector.CPUProfileType()); } + if (hiddenPanels.indexOf("timeline") === -1 && hiddenPanels.indexOf("timeline") === -1) + this.panels.timeline = new WebInspector.TimelinePanel(); + if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1) - this.panels.storage = new WebInspector.StoragePanel(); + this.panels.storage = new WebInspector.StoragePanel(); }, _loadPreferences: function() @@ -369,6 +372,7 @@ WebInspector.loaded = function() document.body.addStyleClass("platform-" + platform); this._loadPreferences(); + this.pendingDispatches = 0; this.drawer = new WebInspector.Drawer(); this.console = new WebInspector.ConsoleView(this.drawer); @@ -379,13 +383,13 @@ WebInspector.loaded = function() this.domAgent = new WebInspector.DOMAgent(); this.resourceCategories = { - documents: new WebInspector.ResourceCategory(WebInspector.UIString("Documents"), "documents"), - stylesheets: new WebInspector.ResourceCategory(WebInspector.UIString("Stylesheets"), "stylesheets"), - images: new WebInspector.ResourceCategory(WebInspector.UIString("Images"), "images"), - scripts: new WebInspector.ResourceCategory(WebInspector.UIString("Scripts"), "scripts"), - xhr: new WebInspector.ResourceCategory(WebInspector.UIString("XHR"), "xhr"), - fonts: new WebInspector.ResourceCategory(WebInspector.UIString("Fonts"), "fonts"), - other: new WebInspector.ResourceCategory(WebInspector.UIString("Other"), "other") + documents: new WebInspector.ResourceCategory("documents", WebInspector.UIString("Documents"), "rgb(47,102,236)"), + stylesheets: new WebInspector.ResourceCategory("stylesheets", WebInspector.UIString("Stylesheets"), "rgb(157,231,119)"), + images: new WebInspector.ResourceCategory("images", WebInspector.UIString("Images"), "rgb(164,60,255)"), + scripts: new WebInspector.ResourceCategory("scripts", WebInspector.UIString("Scripts"), "rgb(255,121,0)"), + xhr: new WebInspector.ResourceCategory("xhr", WebInspector.UIString("XHR"), "rgb(231,231,10)"), + fonts: new WebInspector.ResourceCategory("fonts", WebInspector.UIString("Fonts"), "rgb(255,82,62)"), + other: new WebInspector.ResourceCategory("other", WebInspector.UIString("Other"), "rgb(186,186,186)") }; this.panels = {}; @@ -456,8 +460,6 @@ WebInspector.loaded = function() // this._updateErrorAndWarningCounts(); var searchField = document.getElementById("search"); - searchField.addEventListener("keydown", this.searchKeyDown.bind(this), false); - searchField.addEventListener("keyup", this.searchKeyUp.bind(this), false); searchField.addEventListener("search", this.performSearch.bind(this), false); // when the search is emptied toolbarElement.addEventListener("mousedown", this.toolbarDragStart, true); @@ -494,7 +496,9 @@ WebInspector.dispatch = function() { function delayDispatch() { WebInspector[methodName].apply(WebInspector, parameters); + WebInspector.pendingDispatches--; } + WebInspector.pendingDispatches++; setTimeout(delayDispatch, 0); } @@ -511,13 +515,19 @@ WebInspector.windowResize = function(event) WebInspector.windowFocused = function(event) { - if (event.target.nodeType === Node.DOCUMENT_NODE) + // Fires after blur, so when focusing on either the main inspector + // or an