aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2012-04-24 09:23:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-25 14:26:42 +0200
commit87327515d70f5b66ce5f3f894f9b90ed649b200d (patch)
tree389f9536f6b6e7adacc8fd5b12726fdec5ea8b2a /src/plugins
parent0d284ae2d62707e6c35c8d97ca73e974d35c4167 (diff)
Debugger: Change name and protocol of QDeclarativeObserverMode
Rename QDeclarativeObserverMode to QmlInspector service. This is because the current protocol has been changed completely and just a version change is misleading. Change-Id: I3b72f081f6ab77eac474dcef7a84375ef69e20dc Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro1
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp28
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h4
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.cpp377
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.h49
-rw-r--r--src/plugins/qmltooling/shared/qqmlinspectorprotocol.h133
6 files changed, 149 insertions, 443 deletions
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro
index f40e3f0b04..b031657b20 100644
--- a/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro
@@ -23,7 +23,6 @@ HEADERS += \
qquickviewinspector.h \
../shared/abstracttool.h \
../shared/abstractviewinspector.h \
- ../shared/qqmlinspectorprotocol.h \
../shared/qmlinspectorconstants.h \
inspecttool.h
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp
index cc3f3703aa..243a821cc5 100644
--- a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.cpp
@@ -41,7 +41,6 @@
#include "qquickviewinspector.h"
-#include "qqmlinspectorprotocol.h"
#include "highlight.h"
#include "inspecttool.h"
@@ -121,8 +120,7 @@ QQuickViewInspector::QQuickViewInspector(QQuickView *view, QObject *parent) :
AbstractViewInspector(parent),
m_view(view),
m_overlay(new QQuickItem),
- m_inspectTool(new InspectTool(this, view)),
- m_designMode(true)
+ m_inspectTool(new InspectTool(this, view))
{
// Try to make sure the overlay is always on top
m_overlay->setZ(FLT_MAX);
@@ -131,7 +129,7 @@ QQuickViewInspector::QQuickViewInspector(QQuickView *view, QObject *parent) :
m_overlay->setParentItem(root);
view->installEventFilter(this);
- setCurrentTool(m_inspectTool);
+ appendTool(m_inspectTool);
}
void QQuickViewInspector::changeCurrentObjects(const QList<QObject*> &objects)
@@ -144,12 +142,6 @@ void QQuickViewInspector::changeCurrentObjects(const QList<QObject*> &objects)
syncSelectedItems(items);
}
-void QQuickViewInspector::reloadView()
-{
- // TODO
- emit reloadRequested();
-}
-
void QQuickViewInspector::reparentQmlObject(QObject *object, QObject *newParent)
{
if (!newParent)
@@ -162,22 +154,6 @@ void QQuickViewInspector::reparentQmlObject(QObject *object, QObject *newParent)
item->setParentItem(newParentItem);
}
-void QQuickViewInspector::changeTool(InspectorProtocol::Tool tool)
-{
- switch (tool) {
- case InspectorProtocol::SelectMarqueeTool:
- // TODO
- emit marqueeSelectToolActivated();
- break;
- case InspectorProtocol::InspectTool:
- setCurrentTool(m_inspectTool);
- emit inspectToolActivated();
- break;
- default:
- break;
- }
-}
-
QWindow *getMasterWindow(QWindow *w)
{
QWindow *p = w->parent();
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h
index c523ea2cd0..d6258c5ec1 100644
--- a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h
@@ -66,9 +66,7 @@ public:
// AbstractViewInspector
void changeCurrentObjects(const QList<QObject*> &objects);
- void reloadView();
void reparentQmlObject(QObject *object, QObject *newParent);
- void changeTool(InspectorProtocol::Tool tool);
Qt::WindowFlags windowFlags() const;
void setWindowFlags(Qt::WindowFlags flags);
QQmlEngine *declarativeEngine() const;
@@ -103,8 +101,6 @@ private:
QList<QPointer<QQuickItem> > m_selectedItems;
QHash<QQuickItem*, SelectionHighlight*> m_highlightItems;
-
- bool m_designMode;
};
} // namespace QtQuick2
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.cpp b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
index 0dd3012165..5784f64011 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.cpp
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
@@ -42,8 +42,8 @@
#include "abstractviewinspector.h"
#include "abstracttool.h"
-#include "qqmlinspectorprotocol.h"
+#include <QtCore/QDebug>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
#include <QtCore/private/qabstractanimation_p.h>
@@ -53,17 +53,41 @@
#include <QtGui/QMouseEvent>
#include <QtGui/QTouchEvent>
+//INSPECTOR SERVICE PROTOCOL
+// <HEADER><COMMAND><DATA>
+// <HEADER> : <type{request, response, event}><requestId/eventId>[<response_success_bool>]
+// <COMMAND> : {"enable", "disable", "select", "setAnimationSpeed",
+// "showAppOnTop", "createObject", "destroyObject", "moveObject",
+// "clearCache"}
+// <DATA> : select: <debugIds_int_list>
+// setAnimationSpeed: <speed_real>
+// showAppOnTop: <set_bool>
+// createObject: <qml_string><parentId_int><imports_string_list><filename_string>
+// destroyObject: <debugId_int>
+// moveObject: <debugId_int><newParentId_int>
+// clearCache: void
+
+const char REQUEST[] = "request";
+const char RESPONSE[] = "response";
+const char EVENT[] = "event";
+const char ENABLE[] = "enable";
+const char DISABLE[] = "disable";
+const char SELECT[] = "select";
+const char SET_ANIMATION_SPEED[] = "setAnimationSpeed";
+const char SHOW_APP_ON_TOP[] = "showAppOnTop";
+const char CREATE_OBJECT[] = "createObject";
+const char DESTROY_OBJECT[] = "destroyObject";
+const char MOVE_OBJECT[] = "moveObject";
+const char CLEAR_CACHE[] = "clearCache";
+
namespace QmlJSDebugger {
AbstractViewInspector::AbstractViewInspector(QObject *parent) :
QObject(parent),
- m_currentTool(0),
- m_showAppOnTop(false),
- m_designModeBehavior(false),
- m_animationPaused(false),
- m_slowDownFactor(1.0),
- m_debugService(QQmlInspectorService::instance())
+ m_enabled(false),
+ m_debugService(QQmlInspectorService::instance()),
+ m_eventId(0)
{
}
@@ -95,58 +119,20 @@ void AbstractViewInspector::clearComponentCache()
declarativeEngine()->clearComponentCache();
}
-void AbstractViewInspector::setDesignModeBehavior(bool value)
+void AbstractViewInspector::setEnabled(bool value)
{
- if (m_designModeBehavior == value)
+ if (m_enabled == value)
return;
- m_designModeBehavior = value;
- m_currentTool->enable(m_designModeBehavior);
- emit designModeBehaviorChanged(value);
- sendDesignModeBehavior(value);
+ m_enabled = value;
+ foreach (AbstractTool *tool, m_tools)
+ tool->enable(m_enabled);
}
void AbstractViewInspector::setAnimationSpeed(qreal slowDownFactor)
{
- Q_ASSERT(slowDownFactor > 0);
- if (m_slowDownFactor == slowDownFactor)
- return;
-
- animationSpeedChangeRequested(slowDownFactor);
- sendAnimationSpeed(slowDownFactor);
-}
-
-void AbstractViewInspector::setAnimationPaused(bool paused)
-{
- if (m_animationPaused == paused)
- return;
-
- animationPausedChangeRequested(paused);
- sendAnimationPaused(paused);
-}
-
-void AbstractViewInspector::animationSpeedChangeRequested(qreal factor)
-{
- if (m_slowDownFactor != factor) {
- m_slowDownFactor = factor;
- emit animationSpeedChanged(factor);
- }
-
- const float effectiveFactor = m_animationPaused ? 0 : factor;
- QUnifiedTimer::instance()->setSlowModeEnabled(effectiveFactor != 1.0);
- QUnifiedTimer::instance()->setSlowdownFactor(effectiveFactor);
-}
-
-void AbstractViewInspector::animationPausedChangeRequested(bool paused)
-{
- if (m_animationPaused != paused) {
- m_animationPaused = paused;
- emit animationPausedChanged(paused);
- }
-
- const float effectiveFactor = paused ? 0 : m_slowDownFactor;
- QUnifiedTimer::instance()->setSlowModeEnabled(effectiveFactor != 1.0);
- QUnifiedTimer::instance()->setSlowdownFactor(effectiveFactor);
+ QUnifiedTimer::instance()->setSlowModeEnabled(slowDownFactor != 1.0);
+ QUnifiedTimer::instance()->setSlowdownFactor(slowDownFactor);
}
void AbstractViewInspector::setShowAppOnTop(bool appOnTop)
@@ -158,26 +144,11 @@ void AbstractViewInspector::setShowAppOnTop(bool appOnTop)
flags &= ~Qt::WindowStaysOnTopHint;
setWindowFlags(flags);
-
- m_showAppOnTop = appOnTop;
- sendShowAppOnTop(appOnTop);
-
- emit showAppOnTopChanged(appOnTop);
-}
-
-void AbstractViewInspector::changeToInspectTool()
-{
- changeTool(InspectorProtocol::InspectTool);
-}
-
-void AbstractViewInspector::changeToMarqueeSelectTool()
-{
- changeTool(InspectorProtocol::SelectMarqueeTool);
}
bool AbstractViewInspector::eventFilter(QObject *obj, QEvent *event)
{
- if (!designModeBehavior())
+ if (!enabled())
return QObject::eventFilter(obj, event);
switch (event->type()) {
@@ -228,243 +199,165 @@ bool AbstractViewInspector::eventFilter(QObject *obj, QEvent *event)
bool AbstractViewInspector::leaveEvent(QEvent *event)
{
- m_currentTool->leaveEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->leaveEvent(event);
return true;
}
bool AbstractViewInspector::mousePressEvent(QMouseEvent *event)
{
- m_currentTool->mousePressEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->mousePressEvent(event);
return true;
}
bool AbstractViewInspector::mouseMoveEvent(QMouseEvent *event)
{
if (event->buttons()) {
- m_currentTool->mouseMoveEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->mouseMoveEvent(event);
} else {
- m_currentTool->hoverMoveEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->hoverMoveEvent(event);
}
return true;
}
bool AbstractViewInspector::mouseReleaseEvent(QMouseEvent *event)
{
- m_currentTool->mouseReleaseEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->mouseReleaseEvent(event);
return true;
}
bool AbstractViewInspector::keyPressEvent(QKeyEvent *event)
{
- m_currentTool->keyPressEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->keyPressEvent(event);
return true;
}
bool AbstractViewInspector::keyReleaseEvent(QKeyEvent *event)
{
- switch (event->key()) {
- case Qt::Key_V:
- changeTool(InspectorProtocol::InspectTool);
- break;
-// disabled because multiselection does not do anything useful without design mode
-// case Qt::Key_M:
-// changeTool(InspectorProtocol::SelectMarqueeTool);
-// break;
- case Qt::Key_Space:
- setAnimationPaused(!animationPaused());
- break;
- default:
- break;
- }
-
- m_currentTool->keyReleaseEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->keyReleaseEvent(event);
return true;
}
bool AbstractViewInspector::mouseDoubleClickEvent(QMouseEvent *event)
{
- m_currentTool->mouseDoubleClickEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->mouseDoubleClickEvent(event);
return true;
}
bool AbstractViewInspector::wheelEvent(QWheelEvent *event)
{
- m_currentTool->wheelEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->wheelEvent(event);
return true;
}
bool AbstractViewInspector::touchEvent(QTouchEvent *event)
{
- m_currentTool->touchEvent(event);
+ foreach (AbstractTool *tool, m_tools)
+ tool->touchEvent(event);
return true;
}
void AbstractViewInspector::handleMessage(const QByteArray &message)
{
+ bool success = true;
QDataStream ds(message);
- InspectorProtocol::Message type;
+ QByteArray type;
ds >> type;
- switch (type) {
- case InspectorProtocol::SetCurrentObjects: {
- int itemCount = 0;
- ds >> itemCount;
-
- QList<QObject*> selectedObjects;
- for (int i = 0; i < itemCount; ++i) {
- int debugId = -1;
+ int requestId = -1;
+ if (type == REQUEST) {
+ QByteArray command;
+ ds >> requestId >> command;
+
+ if (command == ENABLE) {
+ setEnabled(true);
+
+ } else if (command == DISABLE) {
+ setEnabled(false);
+
+ } else if (command == SELECT) {
+ QList<int> debugIds;
+ ds >> debugIds;
+
+ QList<QObject*> selectedObjects;
+ foreach (int debugId, debugIds) {
+ if (QObject *obj = QQmlDebugService::objectForId(debugId))
+ selectedObjects << obj;
+ }
+ if (m_enabled)
+ changeCurrentObjects(selectedObjects);
+
+ } else if (command == SET_ANIMATION_SPEED) {
+ qreal speed;
+ ds >> speed;
+ setAnimationSpeed(speed);
+
+ } else if (command == SHOW_APP_ON_TOP) {
+ bool showOnTop;
+ ds >> showOnTop;
+ setShowAppOnTop(showOnTop);
+
+ } else if (command == CREATE_OBJECT) {
+ QString qml;
+ int parentId;
+ QString filename;
+ QStringList imports;
+ ds >> qml >> parentId >> imports >> filename;
+ createQmlObject(qml, QQmlDebugService::objectForId(parentId),
+ imports, filename);
+
+ } else if (command == DESTROY_OBJECT) {
+ int debugId;
ds >> debugId;
if (QObject *obj = QQmlDebugService::objectForId(debugId))
- selectedObjects << obj;
- }
- if (m_designModeBehavior)
- changeCurrentObjects(selectedObjects);
- break;
- }
- case InspectorProtocol::Reload: {
- reloadView();
- break;
- }
- case InspectorProtocol::SetAnimationSpeed: {
- qreal speed;
- ds >> speed;
- animationSpeedChangeRequested(speed);
- break;
- }
- case InspectorProtocol::SetAnimationPaused: {
- bool paused;
- ds >> paused;
- animationPausedChangeRequested(paused);
- break;
- }
- case InspectorProtocol::ChangeTool: {
- InspectorProtocol::Tool tool;
- ds >> tool;
- changeTool(tool);
- break;
- }
- case InspectorProtocol::SetDesignMode: {
- bool inDesignMode;
- ds >> inDesignMode;
- setDesignModeBehavior(inDesignMode);
- break;
- }
- case InspectorProtocol::ShowAppOnTop: {
- bool showOnTop;
- ds >> showOnTop;
- setShowAppOnTop(showOnTop);
- break;
- }
- case InspectorProtocol::CreateObject: {
- QString qml;
- int parentId;
- QString filename;
- QStringList imports;
- ds >> qml >> parentId >> imports >> filename;
- createQmlObject(qml, QQmlDebugService::objectForId(parentId),
- imports, filename);
- break;
- }
- case InspectorProtocol::DestroyObject: {
- int debugId;
- ds >> debugId;
- if (QObject *obj = QQmlDebugService::objectForId(debugId))
- obj->deleteLater();
- break;
- }
- case InspectorProtocol::MoveObject: {
- int debugId, newParent;
- ds >> debugId >> newParent;
- reparentQmlObject(QQmlDebugService::objectForId(debugId),
- QQmlDebugService::objectForId(newParent));
- break;
- }
- case InspectorProtocol::ClearComponentCache: {
- clearComponentCache();
- break;
- }
- default:
- qWarning() << "Warning: Not handling message:" << type;
- }
-}
-
-void AbstractViewInspector::sendDesignModeBehavior(bool inDesignMode)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
+ obj->deleteLater();
- ds << InspectorProtocol::SetDesignMode
- << inDesignMode;
+ } else if (command == MOVE_OBJECT) {
+ int debugId, newParent;
+ ds >> debugId >> newParent;
+ reparentQmlObject(QQmlDebugService::objectForId(debugId),
+ QQmlDebugService::objectForId(newParent));
- m_debugService->sendMessage(message);
-}
+ } else if (command == CLEAR_CACHE) {
+ clearComponentCache();
-void AbstractViewInspector::sendCurrentObjects(const QList<QObject*> &objects)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
+ } else {
+ qWarning() << "Warning: Not handling command:" << command;
+ success = false;
- ds << InspectorProtocol::CurrentObjectsChanged
- << objects.length();
+ }
+ } else {
+ qWarning() << "Warning: Not handling type:" << type << REQUEST;
+ success = false;
- foreach (QObject *object, objects) {
- int id = QQmlDebugService::idForObject(object);
- ds << id;
}
- m_debugService->sendMessage(message);
-}
-
-void AbstractViewInspector::sendCurrentTool(Constants::DesignTool toolId)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << InspectorProtocol::ToolChanged
- << toolId;
-
- m_debugService->sendMessage(message);
+ QByteArray response;
+ QDataStream rs(&response, QIODevice::WriteOnly);
+ rs << QByteArray(RESPONSE) << requestId << success;
+ m_debugService->sendMessage(response);
}
-void AbstractViewInspector::sendAnimationSpeed(qreal slowDownFactor)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << InspectorProtocol::AnimationSpeedChanged
- << slowDownFactor;
-
- m_debugService->sendMessage(message);
-}
-
-void AbstractViewInspector::sendAnimationPaused(bool paused)
+void AbstractViewInspector::sendCurrentObjects(const QList<QObject*> &objects)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << InspectorProtocol::AnimationPausedChanged
- << paused;
-
- m_debugService->sendMessage(message);
-}
+ ds << QByteArray(EVENT) << m_eventId++ << QByteArray(SELECT);
-void AbstractViewInspector::sendReloaded()
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << InspectorProtocol::Reloaded;
-
- m_debugService->sendMessage(message);
-}
-
-void AbstractViewInspector::sendShowAppOnTop(bool showAppOnTop)
-{
- QByteArray message;
- QDataStream ds(&message, QIODevice::WriteOnly);
-
- ds << InspectorProtocol::ShowAppOnTop << showAppOnTop;
+ QList<int> debugIds;
+ foreach (QObject *object, objects)
+ debugIds << QQmlDebugService::idForObject(object);
+ ds << debugIds;
m_debugService->sendMessage(message);
}
@@ -480,4 +373,14 @@ QString AbstractViewInspector::idStringForObject(QObject *obj) const
return QString();
}
+void AbstractViewInspector::appendTool(AbstractTool *tool)
+{
+ m_tools.append(tool);
+}
+
+void AbstractViewInspector::removeTool(AbstractTool *tool)
+{
+ m_tools.removeOne(tool);
+}
+
} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.h b/src/plugins/qmltooling/shared/abstractviewinspector.h
index bbd3fc8e12..d2dd9557da 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.h
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.h
@@ -46,7 +46,6 @@
#include <QtCore/QObject>
#include <QtCore/QStringList>
-#include "qqmlinspectorprotocol.h"
#include "qmlinspectorconstants.h"
QT_BEGIN_NAMESPACE
@@ -80,42 +79,22 @@ public:
const QString &filename = QString());
void clearComponentCache();
- bool showAppOnTop() const { return m_showAppOnTop; }
- bool designModeBehavior() const { return m_designModeBehavior; }
-
- bool animationPaused() const { return m_animationPaused; }
- qreal slowDownFactor() const { return m_slowDownFactor; }
+ bool enabled() const { return m_enabled; }
void sendCurrentObjects(const QList<QObject*> &);
- void sendAnimationSpeed(qreal slowDownFactor);
- void sendAnimationPaused(bool paused);
- void sendCurrentTool(Constants::DesignTool toolId);
- void sendReloaded();
- void sendShowAppOnTop(bool showAppOnTop);
QString idStringForObject(QObject *obj) const;
virtual void changeCurrentObjects(const QList<QObject*> &objects) = 0;
- virtual void reloadView() = 0;
virtual void reparentQmlObject(QObject *object, QObject *newParent) = 0;
- virtual void changeTool(InspectorProtocol::Tool tool) = 0;
virtual Qt::WindowFlags windowFlags() const = 0;
virtual void setWindowFlags(Qt::WindowFlags flags) = 0;
virtual QQmlEngine *declarativeEngine() const = 0;
-signals:
- void designModeBehaviorChanged(bool inDesignMode);
- void showAppOnTopChanged(bool showAppOnTop);
- void reloadRequested();
- void marqueeSelectToolActivated();
- void inspectToolActivated();
-
- void animationSpeedChanged(qreal factor);
- void animationPausedChanged(bool paused);
+ void appendTool(AbstractTool *tool);
+ void removeTool(AbstractTool *tool);
protected:
- AbstractTool *currentTool() const { return m_currentTool; }
- void setCurrentTool(AbstractTool *tool) { m_currentTool = tool; }
bool eventFilter(QObject *, QEvent *);
virtual bool leaveEvent(QEvent *);
@@ -129,31 +108,17 @@ protected:
virtual bool touchEvent(QTouchEvent *event);
private:
- void sendDesignModeBehavior(bool inDesignMode);
-
- void changeToZoomTool();
- void changeToInspectTool();
- void changeToMarqueeSelectTool();
-
- virtual void setDesignModeBehavior(bool value);
+ void setEnabled(bool value);
void setShowAppOnTop(bool appOnTop);
void setAnimationSpeed(qreal factor);
- void setAnimationPaused(bool paused);
-
- void animationSpeedChangeRequested(qreal factor);
- void animationPausedChangeRequested(bool paused);
-
- AbstractTool *m_currentTool;
-
- bool m_showAppOnTop;
- bool m_designModeBehavior;
- bool m_animationPaused;
- qreal m_slowDownFactor;
+ bool m_enabled;
QQmlInspectorService *m_debugService;
+ QList<AbstractTool *> m_tools;
+ int m_eventId;
};
} // namespace QmlJSDebugger
diff --git a/src/plugins/qmltooling/shared/qqmlinspectorprotocol.h b/src/plugins/qmltooling/shared/qqmlinspectorprotocol.h
deleted file mode 100644
index 1614e2e0af..0000000000
--- a/src/plugins/qmltooling/shared/qqmlinspectorprotocol.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQMLINSPECTORPROTOCOL_H
-#define QQMLINSPECTORPROTOCOL_H
-
-#include <QtCore/QDebug>
-#include <QtCore/QMetaType>
-#include <QtCore/QMetaEnum>
-#include <QtCore/QObject>
-
-namespace QmlJSDebugger {
-
-class InspectorProtocol : public QObject
-{
- Q_OBJECT
- Q_ENUMS(Message Tool)
-
-public:
- enum Message {
- AnimationSpeedChanged = 0,
- AnimationPausedChanged = 19, // highest value
- ChangeTool = 1,
- ClearComponentCache = 2,
- CreateObject = 5,
- CurrentObjectsChanged = 6,
- DestroyObject = 7,
- MoveObject = 8,
- Reload = 10,
- Reloaded = 11,
- SetAnimationSpeed = 12,
- SetAnimationPaused = 18,
- SetCurrentObjects = 14,
- SetDesignMode = 15,
- ShowAppOnTop = 16,
- ToolChanged = 17
- };
-
- enum Tool {
- SelectMarqueeTool = 1,
- InspectTool
- };
-
- static inline QString toString(Message message)
- {
- return QLatin1String(staticMetaObject.enumerator(0).valueToKey(message));
- }
-
- static inline QString toString(Tool tool)
- {
- return QLatin1String(staticMetaObject.enumerator(1).valueToKey(tool));
- }
-};
-
-inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Message message)
-{
- return stream << static_cast<quint32>(message);
-}
-
-inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Message &message)
-{
- quint32 i;
- stream >> i;
- message = static_cast<InspectorProtocol::Message>(i);
- return stream;
-}
-
-inline QDebug operator<< (QDebug dbg, InspectorProtocol::Message message)
-{
- dbg << InspectorProtocol::toString(message);
- return dbg;
-}
-
-inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Tool tool)
-{
- return stream << static_cast<quint32>(tool);
-}
-
-inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Tool &tool)
-{
- quint32 i;
- stream >> i;
- tool = static_cast<InspectorProtocol::Tool>(i);
- return stream;
-}
-
-inline QDebug operator<< (QDebug dbg, InspectorProtocol::Tool tool)
-{
- dbg << InspectorProtocol::toString(tool);
- return dbg;
-}
-
-} // namespace QmlJSDebugger
-
-#endif // QQMLINSPECTORPROTOCOL_H