Commit eff5ceea authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlJsDebugger: Remove dependency to Qt private headers being installed

Copy over the private header files to creator source tree, along the
lines of the what the designer plugin does.

Reviewed-by: Christiaan Janssen
parent f343cc4b
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "abstractformeditortool.h" #include "abstractformeditortool.h"
#include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver.h"
#include "qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include <QDeclarativeEngine> #include <QDeclarativeEngine>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
**************************************************************************/ **************************************************************************/
#include "rubberbandselectionmanipulator.h" #include "rubberbandselectionmanipulator.h"
#include "qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include <QDebug> #include <QDebug>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
**************************************************************************/ **************************************************************************/
#include "selectionindicator.h" #include "selectionindicator.h"
#include "qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"
#include <QPen> #include <QPen>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "layeritem.h" #include "layeritem.h"
//#include "resizehandleitem.h" //#include "resizehandleitem.h"
#include "qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include <QDeclarativeEngine> #include <QDeclarativeEngine>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "singleselectionmanipulator.h" #include "singleselectionmanipulator.h"
#include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver.h"
#include "qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include <QtDebug> #include <QtDebug>
namespace QmlJSDebugger { namespace QmlJSDebugger {
......
#include "subcomponenteditortool.h" #include "subcomponenteditortool.h"
#include "qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include "subcomponentmasklayeritem.h" #include "subcomponentmasklayeritem.h"
#include "layeritem.h" #include "layeritem.h"
......
#include "zoomtool.h" #include "zoomtool.h"
#include "qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include <QMouseEvent> #include <QMouseEvent>
#include <QWheelEvent> #include <QWheelEvent>
......
...@@ -57,9 +57,10 @@ ...@@ -57,9 +57,10 @@
#include <QtScript/QScriptValue> #include <QtScript/QScriptValue>
#include <QtCore/QEventLoop> #include <QtCore/QEventLoop>
#include <QtCore/QSet> #include <QtCore/QSet>
#include <private/qdeclarativedebugservice_p.h>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include "qt_private/qdeclarativedebugservice_p.h"
#include "qmljsdebugger_global.h" #include "qmljsdebugger_global.h"
QT_FORWARD_DECLARE_CLASS(QScriptContext); QT_FORWARD_DECLARE_CLASS(QScriptContext);
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#ifndef QDECLARATIVEDESIGNDEBUGSERVER_H #ifndef QDECLARATIVEDESIGNDEBUGSERVER_H
#define QDECLARATIVEDESIGNDEBUGSERVER_H #define QDECLARATIVEDESIGNDEBUGSERVER_H
#include <private/qdeclarativedebugservice_p.h> #include "qt_private/qdeclarativedebugservice_p.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"
#include "qmljsdebugger_global.h" #include "qmljsdebugger_global.h"
......
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDECLARATIVEDEBUGHELPER_P_H
#define QDECLARATIVEDEBUGHELPER_P_H
#include <QtCore/qglobal.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QScriptEngine;
class QDeclarativeEngine;
// Helper methods to access private API through a stable interface
// This is used in the qmljsdebugger library of QtCreator.
class Q_DECLARATIVE_EXPORT QDeclarativeDebugHelper
{
public:
static QScriptEngine *getScriptEngine(QDeclarativeEngine *engine);
static void setAnimationSlowDownFactor(qreal factor);
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QDECLARATIVEDEBUGHELPER_P_H
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDECLARATIVEDEBUGSERVICE_H
#define QDECLARATIVEDEBUGSERVICE_H
#include <QtCore/qobject.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeDebugServicePrivate;
class Q_DECLARATIVE_EXPORT QDeclarativeDebugService : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativeDebugService)
Q_DISABLE_COPY(QDeclarativeDebugService)
public:
explicit QDeclarativeDebugService(const QString &, QObject *parent = 0);
~QDeclarativeDebugService();
QString name() const;
enum Status { NotConnected, Unavailable, Enabled };
Status status() const;
void sendMessage(const QByteArray &);
static int idForObject(QObject *);
static QObject *objectForId(int);
static QString objectToString(QObject *obj);
static bool isDebuggingEnabled();
static bool hasDebuggingClient();
protected:
virtual void statusChanged(Status);
virtual void messageReceived(const QByteArray &);
private:
friend class QDeclarativeDebugServer;
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QDECLARATIVEDEBUGSERVICE_H
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
****************************************************************************/ ****************************************************************************/
#include "jsdebuggeragent.h" #include "jsdebuggeragent.h"
#include "qt_private/qdeclarativedebughelper_p.h"
#include <QtCore/qcoreapplication.h> #include <QtCore/qcoreapplication.h>
#include <QtCore/qset.h> #include <QtCore/qset.h>
...@@ -49,7 +50,6 @@ ...@@ -49,7 +50,6 @@
#include <QtCore/QUrl> #include <QtCore/QUrl>
#include <QtCore/QDateTime> #include <QtCore/QDateTime>
#include <QtScript/qscriptvalueiterator.h> #include <QtScript/qscriptvalueiterator.h>
#include <private/qdeclarativeengine_p.h>
namespace QmlJSDebugger { namespace QmlJSDebugger {
...@@ -193,7 +193,7 @@ JSDebuggerAgent::JSDebuggerAgent(QScriptEngine *engine) ...@@ -193,7 +193,7 @@ JSDebuggerAgent::JSDebuggerAgent(QScriptEngine *engine)
JSDebuggerAgent::JSDebuggerAgent(QDeclarativeEngine *engine) JSDebuggerAgent::JSDebuggerAgent(QDeclarativeEngine *engine)
: QDeclarativeDebugService("JSDebugger") : QDeclarativeDebugService("JSDebugger")
, QScriptEngineAgent(QDeclarativeEnginePrivate::getScriptEngine(engine)) , QScriptEngineAgent(QDeclarativeDebugHelper::getScriptEngine(engine))
, state(NoState) , state(NoState)
{} {}
...@@ -513,7 +513,6 @@ void JSDebuggerAgent::continueExec() ...@@ -513,7 +513,6 @@ void JSDebuggerAgent::continueExec()
void JSDebuggerAgent::statusChanged(Status status) void JSDebuggerAgent::statusChanged(Status status)
{ {
engine()->setAgent(on ? this : 0);
engine()->setAgent((status == QDeclarativeDebugService::Enabled) ? this : 0); engine()->setAgent((status == QDeclarativeDebugService::Enabled) ? this : 0);
} }
......
# Try to find location of Qt private headers (see README)
isEmpty(QT_PRIVATE_HEADERS) {
QT_PRIVATE_HEADERS = $$[QT_INSTALL_HEADERS]
}
INCLUDEPATH += \
$${QT_PRIVATE_HEADERS} \
$${QT_PRIVATE_HEADERS}/QtCore \
$${QT_PRIVATE_HEADERS}/QtGui \
$${QT_PRIVATE_HEADERS}/QtScript \
$${QT_PRIVATE_HEADERS}/QtDeclarative
DEPENDPATH += \
$${QT_PRIVATE_HEADERS} \
$${QT_PRIVATE_HEADERS}/QtCore \
$${QT_PRIVATE_HEADERS}/QtGui \
$${QT_PRIVATE_HEADERS}/QtScript \
$${QT_PRIVATE_HEADERS}/QtDeclarative
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "qmltoolbar.h" #include "qmltoolbar.h"
#include "jsdebuggeragent.h" #include "jsdebuggeragent.h"
#include "qt_private/qdeclarativedebughelper_p.h"
#include <QDeclarativeItem> #include <QDeclarativeItem>
#include <QDeclarativeEngine> #include <QDeclarativeEngine>
#include <QDeclarativeContext> #include <QDeclarativeContext>
...@@ -47,10 +49,7 @@ ...@@ -47,10 +49,7 @@
#include <QMouseEvent> #include <QMouseEvent>
#include <QGraphicsObject> #include <QGraphicsObject>
#include <QApplication> #include <QApplication>
#include <QAbstractAnimation> #include <QAbstractAnimation>
#include <private/qdeclarativeengine_p.h>
#include <private/qabstractanimation_p.h>
namespace QmlJSDebugger { namespace QmlJSDebugger {
...@@ -626,11 +625,13 @@ void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor) ...@@ -626,11 +625,13 @@ void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor)
data->slowdownFactor = slowdownFactor; data->slowdownFactor = slowdownFactor;
static const qreal animSpeedSnapDelta = 0.01f; static const qreal animSpeedSnapDelta = 0.01f;
bool useStandardSpeed = (qAbs(1.0f - data->slowdownFactor) < animSpeedSnapDelta);
QUnifiedTimer *timer = QUnifiedTimer::instance(); qreal slowDownFactor = data->slowdownFactor;
timer->setSlowdownFactor(data->slowdownFactor); if (qAbs(1.0f - slowDownFactor) < animSpeedSnapDelta) {
timer->setSlowModeEnabled(!useStandardSpeed); slowDownFactor = 1.0f;
}
QDeclarativeDebugHelper::setAnimationSlowDownFactor(slowDownFactor);
data->executionPaused = false; data->executionPaused = false;
emit executionStarted(data->slowdownFactor); emit executionStarted(data->slowdownFactor);
...@@ -639,9 +640,7 @@ void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor) ...@@ -639,9 +640,7 @@ void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor)
void QDeclarativeViewObserver::pauseExecution() void QDeclarativeViewObserver::pauseExecution()
{ {
QUnifiedTimer *timer = QUnifiedTimer::instance(); QDeclarativeDebugHelper::setAnimationSlowDownFactor(0.0f);
timer->setSlowdownFactor(0);
timer->setSlowModeEnabled(true);
data->executionPaused = true; data->executionPaused = true;
emit executionPaused(); emit executionPaused();
...@@ -796,7 +795,7 @@ void QDeclarativeViewObserverPrivate::createToolbar() ...@@ -796,7 +795,7 @@ void QDeclarativeViewObserverPrivate::createToolbar()
void QDeclarativeViewObserver::setDebugMode(bool isDebugMode) void QDeclarativeViewObserver::setDebugMode(bool isDebugMode)
{ {
if (isDebugMode && !data->jsDebuggerAgent) if (isDebugMode && !data->jsDebuggerAgent)
data->jsDebuggerAgent = new JSDebuggerAgent(QDeclarativeEnginePrivate::getScriptEngine(data->view->engine())); data->jsDebuggerAgent = new JSDebuggerAgent(data->view->engine());
} }
} //namespace QmlJSDebugger } //namespace QmlJSDebugger
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef QDECLARATIVEDESIGNVIEW_P_H #ifndef QDECLARATIVEVIEWOBSERVER_P_H
#define QDECLARATIVEDESIGNVIEW_P_H #define QDECLARATIVEVIEWOBSERVER_P_H
#include <QWeakPointer> #include <QWeakPointer>
#include <QPointF> #include <QPointF>
...@@ -138,4 +138,4 @@ public: ...@@ -138,4 +138,4 @@ public:
} // namespace QmlJSDebugger } // namespace QmlJSDebugger
#endif // QDECLARATIVEDESIGNVIEW_P_H #endif // QDECLARATIVEVIEWOBSERVER_P_H
QT += declarative script QT += declarative script
INCLUDEPATH += $$PWD $$PWD/include editor INCLUDEPATH += $$PWD/include
DEPENDPATH += $$PWD $$PWD/include editor DEPENDPATH += $$PWD $$PWD/include editor $$PWD/qt-private
contains(CONFIG, dll) { contains(CONFIG, dll) {
DEFINES += BUILD_QMLJSDEBUGGER_LIB DEFINES += BUILD_QMLJSDEBUGGER_LIB
...@@ -8,28 +8,28 @@ contains(CONFIG, dll) { ...@@ -8,28 +8,28 @@ contains(CONFIG, dll) {
DEFINES += BUILD_QMLJSDEBUGGER_STATIC_LIB DEFINES += BUILD_QMLJSDEBUGGER_STATIC_LIB
} }
include($$PWD/private_headers.pri)
## Input ## Input
HEADERS += \ HEADERS += \
$$PWD/include/jsdebuggeragent.h \ include/jsdebuggeragent.h \
$$PWD/include/qmljsdebugger_global.h include/qmljsdebugger_global.h \
include/qt_private/qdeclarativedebughelper_p.h \
include/qt_private/qdeclarativedebugservice_p.h
SOURCES += \ SOURCES += \
$$PWD/jsdebuggeragent.cpp jsdebuggeragent.cpp
contains(DEFINES, QMLOBSERVER) { contains(DEFINES, QMLOBSERVER) {
include($$PWD/editor/editor.pri) include($$PWD/editor/editor.pri)
HEADERS += \ HEADERS += \
$$PWD/include/qdeclarativeviewobserver.h \ include/qdeclarativeviewobserver.h \
$$PWD/include/qdeclarativeobserverservice.h \ include/qdeclarativeobserverservice.h \
$$PWD/include/qmlobserverconstants.h \ include/qmlobserverconstants.h \
$$PWD/qdeclarativeviewobserver_p.h qdeclarativeviewobserver_p.h
SOURCES += \ SOURCES += \
$$PWD/qdeclarativeviewobserver.cpp \ qdeclarativeviewobserver.cpp \
$$PWD/qdeclarativeobserverservice.cpp qdeclarativeobserverservice.cpp
} }
OTHER_FILES += $$PWD/qmljsdebugger.pri OTHER_FILES += qmljsdebugger.pri
...@@ -139,13 +139,15 @@ QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessag ...@@ -139,13 +139,15 @@ QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessag
<< QLatin1String("LICENSE.LGPL") << QLatin1String("LGPL_EXCEPTION.TXT"); << QLatin1String("LICENSE.LGPL") << QLatin1String("LGPL_EXCEPTION.TXT");
QStringList debuggerLibFiles; QStringList debuggerLibFiles;
debuggerLibFiles << QLatin1String("jsdebuggeragent.cpp") << QLatin1String("private_headers.pri") debuggerLibFiles << QLatin1String("jsdebuggeragent.cpp")
<< QLatin1String("qdeclarativeobserverservice.cpp") << QLatin1String("qdeclarativeviewobserver.cpp") << QLatin1String("qdeclarativeobserverservice.cpp") << QLatin1String("qdeclarativeviewobserver.cpp")
<< QLatin1String("qdeclarativeviewobserver_p.h") << QLatin1String("qmljsdebugger.pri") << QLatin1String("qdeclarativeviewobserver_p.h") << QLatin1String("qmljsdebugger.pri")
<< QLatin1String("qmljsdebugger.pro") << QLatin1String("qmljsdebugger-lib.pri") << QLatin1String("qmljsdebugger.pro") << QLatin1String("qmljsdebugger-lib.pri")
<< QLatin1String("include/jsdebuggeragent.h") << QLatin1String("include/qdeclarativeobserverservice.h") << QLatin1String("include/jsdebuggeragent.h") << QLatin1String("include/qdeclarativeobserverservice.h")
<< QLatin1String("include/qdeclarativeviewobserver.h") << QLatin1String("include/qmljsdebugger_global.h") << QLatin1String("include/qdeclarativeviewobserver.h") << QLatin1String("include/qmljsdebugger_global.h")
<< QLatin1String("include/qmlobserverconstants.h"); << QLatin1String("include/qmlobserverconstants.h")
<< QLatin1String("include/qt_private/qdeclarativedebughelper_p.h")
<< QLatin1String("include/qt_private/qdeclarativedebugservice_p.h");
QStringList debuggerLibEditorFiles; QStringList debuggerLibEditorFiles;
debuggerLibEditorFiles << QLatin1String("abstractformeditortool.cpp") << QLatin1String("abstractformeditortool.h") debuggerLibEditorFiles << QLatin1String("abstractformeditortool.cpp") << QLatin1String("abstractformeditortool.h")
...@@ -183,7 +185,8 @@ QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessag ...@@ -183,7 +185,8 @@ QString QmlObserverTool::copy(const QString &qtInstallData, QString *errorMessag
foreach(const QString &directory, directories) { foreach(const QString &directory, directories) {
if (!mkpath(directory + QLatin1String("/content/images"), errorMessage) if (!mkpath(directory + QLatin1String("/content/images"), errorMessage)
|| !mkpath(directory + QLatin1String("/qmljsdebugger/editor/images"), errorMessage) || !mkpath(directory + QLatin1String("/qmljsdebugger/editor/images"), errorMessage)
|| !mkpath(directory + QLatin1String("/qmljsdebugger/include"), errorMessage)) || !mkpath(directory + QLatin1String("/qmljsdebugger/include"), errorMessage)
|| !mkpath(directory + QLatin1String("/qmljsdebugger/include/qt_private"), errorMessage))
{ {
continue; continue;
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment