diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 9b2c75bd05a..633fa4e0607 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -10,5 +10,6 @@ SUBDIRS = \ utils/process_stub.pro \ cplusplus \ qmljs \ + qmljsdebugger \ symbianutils \ 3rdparty diff --git a/src/tools/qml/qmlobserver/editor/abstractformeditortool.cpp b/src/libs/qmljsdebugger/editor/abstractformeditortool.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/abstractformeditortool.cpp rename to src/libs/qmljsdebugger/editor/abstractformeditortool.cpp diff --git a/src/tools/qml/qmlobserver/editor/abstractformeditortool.h b/src/libs/qmljsdebugger/editor/abstractformeditortool.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/abstractformeditortool.h rename to src/libs/qmljsdebugger/editor/abstractformeditortool.h diff --git a/src/tools/qml/qmlobserver/editor/boundingrecthighlighter.cpp b/src/libs/qmljsdebugger/editor/boundingrecthighlighter.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/boundingrecthighlighter.cpp rename to src/libs/qmljsdebugger/editor/boundingrecthighlighter.cpp diff --git a/src/tools/qml/qmlobserver/editor/boundingrecthighlighter.h b/src/libs/qmljsdebugger/editor/boundingrecthighlighter.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/boundingrecthighlighter.h rename to src/libs/qmljsdebugger/editor/boundingrecthighlighter.h diff --git a/src/tools/qml/qmlobserver/editor/colorpickertool.cpp b/src/libs/qmljsdebugger/editor/colorpickertool.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/colorpickertool.cpp rename to src/libs/qmljsdebugger/editor/colorpickertool.cpp diff --git a/src/tools/qml/qmlobserver/editor/colorpickertool.h b/src/libs/qmljsdebugger/editor/colorpickertool.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/colorpickertool.h rename to src/libs/qmljsdebugger/editor/colorpickertool.h diff --git a/src/tools/qml/qmlobserver/editor/crumblepath.cpp b/src/libs/qmljsdebugger/editor/crumblepath.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/crumblepath.cpp rename to src/libs/qmljsdebugger/editor/crumblepath.cpp diff --git a/src/tools/qml/qmlobserver/editor/editor.pri b/src/libs/qmljsdebugger/editor/editor.pri similarity index 92% rename from src/tools/qml/qmlobserver/editor/editor.pri rename to src/libs/qmljsdebugger/editor/editor.pri index 33bf4eb1996..e66576150b2 100644 --- a/src/tools/qml/qmlobserver/editor/editor.pri +++ b/src/libs/qmljsdebugger/editor/editor.pri @@ -8,15 +8,13 @@ HEADERS += \ $$PWD/rubberbandselectionmanipulator.h \ $$PWD/selectionrectangle.h \ $$PWD/selectionindicator.h \ - $$PWD/qmlviewerconstants.h \ $$PWD/boundingrecthighlighter.h \ $$PWD/subcomponenteditortool.h \ $$PWD/subcomponentmasklayeritem.h \ $$PWD/zoomtool.h \ $$PWD/colorpickertool.h \ $$PWD/qmltoolbar.h \ - $$PWD/toolbarcolorbox.h \ - $$PWD/crumblepath.h + $$PWD/toolbarcolorbox.h SOURCES += \ $$PWD/abstractformeditortool.cpp \ diff --git a/src/tools/qml/qmlobserver/editor/editor.qrc b/src/libs/qmljsdebugger/editor/editor.qrc similarity index 100% rename from src/tools/qml/qmlobserver/editor/editor.qrc rename to src/libs/qmljsdebugger/editor/editor.qrc diff --git a/src/tools/qml/qmlobserver/editor/images/color-picker.png b/src/libs/qmljsdebugger/editor/images/color-picker.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/color-picker.png rename to src/libs/qmljsdebugger/editor/images/color-picker.png diff --git a/src/tools/qml/qmlobserver/editor/images/designmode.png b/src/libs/qmljsdebugger/editor/images/designmode.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/designmode.png rename to src/libs/qmljsdebugger/editor/images/designmode.png diff --git a/src/tools/qml/qmlobserver/editor/images/from-qml.png b/src/libs/qmljsdebugger/editor/images/from-qml.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/from-qml.png rename to src/libs/qmljsdebugger/editor/images/from-qml.png diff --git a/src/tools/qml/qmlobserver/editor/images/pause.png b/src/libs/qmljsdebugger/editor/images/pause.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/pause.png rename to src/libs/qmljsdebugger/editor/images/pause.png diff --git a/src/tools/qml/qmlobserver/editor/images/play.png b/src/libs/qmljsdebugger/editor/images/play.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/play.png rename to src/libs/qmljsdebugger/editor/images/play.png diff --git a/src/tools/qml/qmlobserver/editor/images/resize_handle.png b/src/libs/qmljsdebugger/editor/images/resize_handle.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/resize_handle.png rename to src/libs/qmljsdebugger/editor/images/resize_handle.png diff --git a/src/tools/qml/qmlobserver/editor/images/segment-end.png b/src/libs/qmljsdebugger/editor/images/segment-end.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/segment-end.png rename to src/libs/qmljsdebugger/editor/images/segment-end.png diff --git a/src/tools/qml/qmlobserver/editor/images/segment-hover-end.png b/src/libs/qmljsdebugger/editor/images/segment-hover-end.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/segment-hover-end.png rename to src/libs/qmljsdebugger/editor/images/segment-hover-end.png diff --git a/src/tools/qml/qmlobserver/editor/images/segment-hover.png b/src/libs/qmljsdebugger/editor/images/segment-hover.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/segment-hover.png rename to src/libs/qmljsdebugger/editor/images/segment-hover.png diff --git a/src/tools/qml/qmlobserver/editor/images/segment-selected-end.png b/src/libs/qmljsdebugger/editor/images/segment-selected-end.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/segment-selected-end.png rename to src/libs/qmljsdebugger/editor/images/segment-selected-end.png diff --git a/src/tools/qml/qmlobserver/editor/images/segment-selected.png b/src/libs/qmljsdebugger/editor/images/segment-selected.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/segment-selected.png rename to src/libs/qmljsdebugger/editor/images/segment-selected.png diff --git a/src/tools/qml/qmlobserver/editor/images/segment.png b/src/libs/qmljsdebugger/editor/images/segment.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/segment.png rename to src/libs/qmljsdebugger/editor/images/segment.png diff --git a/src/tools/qml/qmlobserver/editor/images/select-marquee.png b/src/libs/qmljsdebugger/editor/images/select-marquee.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/select-marquee.png rename to src/libs/qmljsdebugger/editor/images/select-marquee.png diff --git a/src/tools/qml/qmlobserver/editor/images/select.png b/src/libs/qmljsdebugger/editor/images/select.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/select.png rename to src/libs/qmljsdebugger/editor/images/select.png diff --git a/src/tools/qml/qmlobserver/editor/images/to-qml.png b/src/libs/qmljsdebugger/editor/images/to-qml.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/to-qml.png rename to src/libs/qmljsdebugger/editor/images/to-qml.png diff --git a/src/tools/qml/qmlobserver/editor/images/zoom.png b/src/libs/qmljsdebugger/editor/images/zoom.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/images/zoom.png rename to src/libs/qmljsdebugger/editor/images/zoom.png diff --git a/src/tools/qml/qmlobserver/editor/layeritem.cpp b/src/libs/qmljsdebugger/editor/layeritem.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/layeritem.cpp rename to src/libs/qmljsdebugger/editor/layeritem.cpp diff --git a/src/tools/qml/qmlobserver/editor/layeritem.h b/src/libs/qmljsdebugger/editor/layeritem.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/layeritem.h rename to src/libs/qmljsdebugger/editor/layeritem.h diff --git a/src/tools/qml/qmlobserver/editor/movemanipulator.cpp b/src/libs/qmljsdebugger/editor/movemanipulator.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/movemanipulator.cpp rename to src/libs/qmljsdebugger/editor/movemanipulator.cpp diff --git a/src/tools/qml/qmlobserver/editor/movemanipulator.h b/src/libs/qmljsdebugger/editor/movemanipulator.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/movemanipulator.h rename to src/libs/qmljsdebugger/editor/movemanipulator.h diff --git a/src/tools/qml/qmlobserver/editor/movetool.cpp b/src/libs/qmljsdebugger/editor/movetool.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/movetool.cpp rename to src/libs/qmljsdebugger/editor/movetool.cpp diff --git a/src/tools/qml/qmlobserver/editor/movetool.h b/src/libs/qmljsdebugger/editor/movetool.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/movetool.h rename to src/libs/qmljsdebugger/editor/movetool.h diff --git a/src/tools/qml/qmlobserver/editor/qmltoolbar.cpp b/src/libs/qmljsdebugger/editor/qmltoolbar.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/qmltoolbar.cpp rename to src/libs/qmljsdebugger/editor/qmltoolbar.cpp diff --git a/src/tools/qml/qmlobserver/editor/qmltoolbar.h b/src/libs/qmljsdebugger/editor/qmltoolbar.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/qmltoolbar.h rename to src/libs/qmljsdebugger/editor/qmltoolbar.h diff --git a/src/tools/qml/qmlobserver/editor/resize_handle.png b/src/libs/qmljsdebugger/editor/resize_handle.png similarity index 100% rename from src/tools/qml/qmlobserver/editor/resize_handle.png rename to src/libs/qmljsdebugger/editor/resize_handle.png diff --git a/src/tools/qml/qmlobserver/editor/resizecontroller.cpp b/src/libs/qmljsdebugger/editor/resizecontroller.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizecontroller.cpp rename to src/libs/qmljsdebugger/editor/resizecontroller.cpp diff --git a/src/tools/qml/qmlobserver/editor/resizecontroller.h b/src/libs/qmljsdebugger/editor/resizecontroller.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizecontroller.h rename to src/libs/qmljsdebugger/editor/resizecontroller.h diff --git a/src/tools/qml/qmlobserver/editor/resizehandleitem.cpp b/src/libs/qmljsdebugger/editor/resizehandleitem.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizehandleitem.cpp rename to src/libs/qmljsdebugger/editor/resizehandleitem.cpp diff --git a/src/tools/qml/qmlobserver/editor/resizehandleitem.h b/src/libs/qmljsdebugger/editor/resizehandleitem.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizehandleitem.h rename to src/libs/qmljsdebugger/editor/resizehandleitem.h diff --git a/src/tools/qml/qmlobserver/editor/resizeindicator.cpp b/src/libs/qmljsdebugger/editor/resizeindicator.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizeindicator.cpp rename to src/libs/qmljsdebugger/editor/resizeindicator.cpp diff --git a/src/tools/qml/qmlobserver/editor/resizeindicator.h b/src/libs/qmljsdebugger/editor/resizeindicator.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizeindicator.h rename to src/libs/qmljsdebugger/editor/resizeindicator.h diff --git a/src/tools/qml/qmlobserver/editor/resizemanipulator.cpp b/src/libs/qmljsdebugger/editor/resizemanipulator.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizemanipulator.cpp rename to src/libs/qmljsdebugger/editor/resizemanipulator.cpp diff --git a/src/tools/qml/qmlobserver/editor/resizemanipulator.h b/src/libs/qmljsdebugger/editor/resizemanipulator.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizemanipulator.h rename to src/libs/qmljsdebugger/editor/resizemanipulator.h diff --git a/src/tools/qml/qmlobserver/editor/resizetool.cpp b/src/libs/qmljsdebugger/editor/resizetool.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizetool.cpp rename to src/libs/qmljsdebugger/editor/resizetool.cpp diff --git a/src/tools/qml/qmlobserver/editor/resizetool.h b/src/libs/qmljsdebugger/editor/resizetool.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/resizetool.h rename to src/libs/qmljsdebugger/editor/resizetool.h diff --git a/src/tools/qml/qmlobserver/editor/rubberbandselectionmanipulator.cpp b/src/libs/qmljsdebugger/editor/rubberbandselectionmanipulator.cpp similarity index 97% rename from src/tools/qml/qmlobserver/editor/rubberbandselectionmanipulator.cpp rename to src/libs/qmljsdebugger/editor/rubberbandselectionmanipulator.cpp index 26f969f2839..ec703c014dd 100644 --- a/src/tools/qml/qmlobserver/editor/rubberbandselectionmanipulator.cpp +++ b/src/libs/qmljsdebugger/editor/rubberbandselectionmanipulator.cpp @@ -34,7 +34,7 @@ namespace QmlViewer { -RubberBandSelectionManipulator::RubberBandSelectionManipulator(LayerItem *layerItem, QDeclarativeDesignView *editorView) +RubberBandSelectionManipulator::RubberBandSelectionManipulator(QGraphicsObject *layerItem, QDeclarativeDesignView *editorView) : m_selectionRectangleElement(layerItem), m_editorView(editorView), m_beginFormEditorItem(0), diff --git a/src/tools/qml/qmlobserver/editor/rubberbandselectionmanipulator.h b/src/libs/qmljsdebugger/editor/rubberbandselectionmanipulator.h similarity index 95% rename from src/tools/qml/qmlobserver/editor/rubberbandselectionmanipulator.h rename to src/libs/qmljsdebugger/editor/rubberbandselectionmanipulator.h index c2a4486cf31..272d054b650 100644 --- a/src/tools/qml/qmlobserver/editor/rubberbandselectionmanipulator.h +++ b/src/libs/qmljsdebugger/editor/rubberbandselectionmanipulator.h @@ -47,7 +47,7 @@ public: }; - RubberBandSelectionManipulator(LayerItem *layerItem, QDeclarativeDesignView *editorView); + RubberBandSelectionManipulator(QGraphicsObject *layerItem, QDeclarativeDesignView *editorView); void setItems(const QList &itemList); diff --git a/src/tools/qml/qmlobserver/editor/selectionindicator.cpp b/src/libs/qmljsdebugger/editor/selectionindicator.cpp similarity index 99% rename from src/tools/qml/qmlobserver/editor/selectionindicator.cpp rename to src/libs/qmljsdebugger/editor/selectionindicator.cpp index f58282cb399..49b96ea1ee8 100644 --- a/src/tools/qml/qmlobserver/editor/selectionindicator.cpp +++ b/src/libs/qmljsdebugger/editor/selectionindicator.cpp @@ -37,7 +37,7 @@ namespace QmlViewer { -SelectionIndicator::SelectionIndicator(QDeclarativeDesignView *editorView, LayerItem *layerItem) +SelectionIndicator::SelectionIndicator(QDeclarativeDesignView *editorView, QGraphicsObject *layerItem) : m_layerItem(layerItem), m_view(editorView) { } diff --git a/src/tools/qml/qmlobserver/editor/selectionindicator.h b/src/libs/qmljsdebugger/editor/selectionindicator.h similarity index 92% rename from src/tools/qml/qmlobserver/editor/selectionindicator.h rename to src/libs/qmljsdebugger/editor/selectionindicator.h index 80e5acd972e..0d23758ce01 100644 --- a/src/tools/qml/qmlobserver/editor/selectionindicator.h +++ b/src/libs/qmljsdebugger/editor/selectionindicator.h @@ -32,7 +32,7 @@ #include #include -#include "layeritem.h" +#include namespace QmlViewer { @@ -41,7 +41,7 @@ class QDeclarativeDesignView; class SelectionIndicator { public: - SelectionIndicator(QDeclarativeDesignView* editorView, LayerItem *layerItem); + SelectionIndicator(QDeclarativeDesignView* editorView, QGraphicsObject *layerItem); ~SelectionIndicator(); void show(); @@ -57,7 +57,7 @@ private: private: QHash m_indicatorShapeHash; - QWeakPointer m_layerItem; + QWeakPointer m_layerItem; QDeclarativeDesignView *m_view; }; diff --git a/src/tools/qml/qmlobserver/editor/selectionrectangle.cpp b/src/libs/qmljsdebugger/editor/selectionrectangle.cpp similarity index 97% rename from src/tools/qml/qmlobserver/editor/selectionrectangle.cpp rename to src/libs/qmljsdebugger/editor/selectionrectangle.cpp index 3229c5853bc..832a2d4ba21 100644 --- a/src/tools/qml/qmlobserver/editor/selectionrectangle.cpp +++ b/src/libs/qmljsdebugger/editor/selectionrectangle.cpp @@ -45,7 +45,7 @@ public: int type() const { return Constants::EditorItemType; } }; -SelectionRectangle::SelectionRectangle(LayerItem *layerItem) +SelectionRectangle::SelectionRectangle(QGraphicsObject *layerItem) : m_controlShape(new SelectionRectShape(layerItem)), m_layerItem(layerItem) { diff --git a/src/tools/qml/qmlobserver/editor/selectionrectangle.h b/src/libs/qmljsdebugger/editor/selectionrectangle.h similarity index 93% rename from src/tools/qml/qmlobserver/editor/selectionrectangle.h rename to src/libs/qmljsdebugger/editor/selectionrectangle.h index 372a8ebd3e8..3301a95793b 100644 --- a/src/tools/qml/qmlobserver/editor/selectionrectangle.h +++ b/src/libs/qmljsdebugger/editor/selectionrectangle.h @@ -32,14 +32,14 @@ #include #include -#include "layeritem.h" +#include namespace QmlViewer { class SelectionRectangle { public: - SelectionRectangle(LayerItem *layerItem); + SelectionRectangle(QGraphicsObject *layerItem); ~SelectionRectangle(); void show(); @@ -54,7 +54,7 @@ public: private: QGraphicsRectItem *m_controlShape; - QWeakPointer m_layerItem; + QWeakPointer m_layerItem; }; } diff --git a/src/tools/qml/qmlobserver/editor/selectiontool.cpp b/src/libs/qmljsdebugger/editor/selectiontool.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/selectiontool.cpp rename to src/libs/qmljsdebugger/editor/selectiontool.cpp diff --git a/src/tools/qml/qmlobserver/editor/selectiontool.h b/src/libs/qmljsdebugger/editor/selectiontool.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/selectiontool.h rename to src/libs/qmljsdebugger/editor/selectiontool.h diff --git a/src/tools/qml/qmlobserver/editor/singleselectionmanipulator.cpp b/src/libs/qmljsdebugger/editor/singleselectionmanipulator.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/singleselectionmanipulator.cpp rename to src/libs/qmljsdebugger/editor/singleselectionmanipulator.cpp diff --git a/src/tools/qml/qmlobserver/editor/singleselectionmanipulator.h b/src/libs/qmljsdebugger/editor/singleselectionmanipulator.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/singleselectionmanipulator.h rename to src/libs/qmljsdebugger/editor/singleselectionmanipulator.h diff --git a/src/tools/qml/qmlobserver/editor/snappinglinecreator.cpp b/src/libs/qmljsdebugger/editor/snappinglinecreator.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/snappinglinecreator.cpp rename to src/libs/qmljsdebugger/editor/snappinglinecreator.cpp diff --git a/src/tools/qml/qmlobserver/editor/snappinglinecreator.h b/src/libs/qmljsdebugger/editor/snappinglinecreator.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/snappinglinecreator.h rename to src/libs/qmljsdebugger/editor/snappinglinecreator.h diff --git a/src/tools/qml/qmlobserver/editor/subcomponenteditortool.cpp b/src/libs/qmljsdebugger/editor/subcomponenteditortool.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/subcomponenteditortool.cpp rename to src/libs/qmljsdebugger/editor/subcomponenteditortool.cpp diff --git a/src/tools/qml/qmlobserver/editor/subcomponenteditortool.h b/src/libs/qmljsdebugger/editor/subcomponenteditortool.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/subcomponenteditortool.h rename to src/libs/qmljsdebugger/editor/subcomponenteditortool.h diff --git a/src/tools/qml/qmlobserver/editor/subcomponentmasklayeritem.cpp b/src/libs/qmljsdebugger/editor/subcomponentmasklayeritem.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/subcomponentmasklayeritem.cpp rename to src/libs/qmljsdebugger/editor/subcomponentmasklayeritem.cpp diff --git a/src/tools/qml/qmlobserver/editor/subcomponentmasklayeritem.h b/src/libs/qmljsdebugger/editor/subcomponentmasklayeritem.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/subcomponentmasklayeritem.h rename to src/libs/qmljsdebugger/editor/subcomponentmasklayeritem.h diff --git a/src/tools/qml/qmlobserver/editor/toolbarcolorbox.cpp b/src/libs/qmljsdebugger/editor/toolbarcolorbox.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/toolbarcolorbox.cpp rename to src/libs/qmljsdebugger/editor/toolbarcolorbox.cpp diff --git a/src/tools/qml/qmlobserver/editor/toolbarcolorbox.h b/src/libs/qmljsdebugger/editor/toolbarcolorbox.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/toolbarcolorbox.h rename to src/libs/qmljsdebugger/editor/toolbarcolorbox.h diff --git a/src/tools/qml/qmlobserver/editor/zoomtool.cpp b/src/libs/qmljsdebugger/editor/zoomtool.cpp similarity index 100% rename from src/tools/qml/qmlobserver/editor/zoomtool.cpp rename to src/libs/qmljsdebugger/editor/zoomtool.cpp diff --git a/src/tools/qml/qmlobserver/editor/zoomtool.h b/src/libs/qmljsdebugger/editor/zoomtool.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/zoomtool.h rename to src/libs/qmljsdebugger/editor/zoomtool.h diff --git a/src/tools/qml/qmlobserver/editor/crumblepath.h b/src/libs/qmljsdebugger/include/crumblepath.h similarity index 95% rename from src/tools/qml/qmlobserver/editor/crumblepath.h rename to src/libs/qmljsdebugger/include/crumblepath.h index e0c7696628b..a8846fad9da 100644 --- a/src/tools/qml/qmlobserver/editor/crumblepath.h +++ b/src/libs/qmljsdebugger/include/crumblepath.h @@ -32,6 +32,7 @@ #include #include +#include "qmljsdebugger_global.h" QT_FORWARD_DECLARE_CLASS(QResizeEvent); @@ -39,7 +40,7 @@ namespace QmlViewer { class CrumblePathButton; -class CrumblePath : public QWidget +class QMLJSDEBUGGER_EXPORT CrumblePath : public QWidget { Q_OBJECT public: diff --git a/src/tools/qml/qmlobserver/jsdebuggeragent.h b/src/libs/qmljsdebugger/include/jsdebuggeragent.h similarity index 96% rename from src/tools/qml/qmlobserver/jsdebuggeragent.h rename to src/libs/qmljsdebugger/include/jsdebuggeragent.h index 0618dcc0553..d27fea95235 100644 --- a/src/tools/qml/qmlobserver/jsdebuggeragent.h +++ b/src/libs/qmljsdebugger/include/jsdebuggeragent.h @@ -60,13 +60,14 @@ #include #include +#include "qmljsdebugger_global.h" QT_BEGIN_NAMESPACE class JSAgentWatchData; class QScriptContext; -class JSDebuggerAgent : public QDeclarativeDebugService , public QScriptEngineAgent +class QMLJSDEBUGGER_EXPORT JSDebuggerAgent : public QDeclarativeDebugService , public QScriptEngineAgent { Q_OBJECT public: JSDebuggerAgent(QScriptEngine *engine); diff --git a/src/tools/qml/qmlobserver/qdeclarativedesigndebugserver.h b/src/libs/qmljsdebugger/include/qdeclarativedesigndebugserver.h similarity index 96% rename from src/tools/qml/qmlobserver/qdeclarativedesigndebugserver.h rename to src/libs/qmljsdebugger/include/qdeclarativedesigndebugserver.h index dacfe83f979..a43684234fe 100644 --- a/src/tools/qml/qmlobserver/qdeclarativedesigndebugserver.h +++ b/src/libs/qmljsdebugger/include/qdeclarativedesigndebugserver.h @@ -44,6 +44,7 @@ #include #include "qmlviewerconstants.h" +#include "qmljsdebugger_global.h" #include @@ -55,7 +56,7 @@ class QDeclarativeContext; class QDeclarativeWatcher; class QDataStream; -class QDeclarativeDesignDebugServer : public QDeclarativeDebugService +class QMLJSDEBUGGER_EXPORT QDeclarativeDesignDebugServer : public QDeclarativeDebugService { Q_OBJECT public: diff --git a/src/libs/qmljsdebugger/include/qdeclarativedesignview.h b/src/libs/qmljsdebugger/include/qdeclarativedesignview.h new file mode 100644 index 00000000000..30c216205b3 --- /dev/null +++ b/src/libs/qmljsdebugger/include/qdeclarativedesignview.h @@ -0,0 +1,141 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef QDECLARATIVEDESIGNVIEW_H +#define QDECLARATIVEDESIGNVIEW_H + +#include "qmljsdebugger_global.h" +#include "qmlviewerconstants.h" +#include +#include + +QT_FORWARD_DECLARE_CLASS(QDeclarativeItem); +QT_FORWARD_DECLARE_CLASS(QMouseEvent); +QT_FORWARD_DECLARE_CLASS(QToolBar); + +namespace QmlViewer { + +class CrumblePath; +class QDeclarativeDesignViewPrivate; + +class QMLJSDEBUGGER_EXPORT QDeclarativeDesignView : public QDeclarativeView +{ + Q_OBJECT +public: + enum ContextFlags { + IgnoreContext, + ContextSensitive + }; + + explicit QDeclarativeDesignView(QWidget *parent = 0); + ~QDeclarativeDesignView(); + + void setSelectedItems(QList items); + QList selectedItems(); + + QGraphicsObject *manipulatorLayer() const; + void changeTool(Constants::DesignTool tool, + Constants::ToolFlags flags = Constants::NoToolFlags); + + void clearHighlight(); + void highlight(QList item, ContextFlags flags = ContextSensitive); + void highlight(QGraphicsItem *item, ContextFlags flags = ContextSensitive); + + bool mouseInsideContextItem() const; + bool isEditorItem(QGraphicsItem *item) const; + + QList selectableItems(const QPoint &pos) const; + QList selectableItems(const QPointF &scenePos) const; + QList selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const; + QGraphicsItem *currentRootItem() const; + + CrumblePath *crumblePathWidget() const; + QToolBar *toolbar() const; + static QString idStringForObject(QObject *obj); + QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace); + +public Q_SLOTS: + void setDesignModeBehavior(bool value); + bool designModeBehavior() const; + void changeToSingleSelectTool(); + void changeToMarqueeSelectTool(); + void changeToZoomTool(); + void changeToColorPickerTool(); + + void changeAnimationSpeed(qreal slowdownFactor); + void continueExecution(qreal slowdownFactor = 1.0f); + void pauseExecution(); + +Q_SIGNALS: + void designModeBehaviorChanged(bool inDesignMode); + void reloadRequested(); + void marqueeSelectToolActivated(); + void selectToolActivated(); + void zoomToolActivated(); + void colorPickerActivated(); + void selectedColorChanged(const QColor &color); + + void executionStarted(qreal slowdownFactor); + void executionPaused(); + +protected: + void leaveEvent(QEvent *); + void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *keyEvent); + void mouseDoubleClickEvent(QMouseEvent *event); + void wheelEvent(QWheelEvent *event); + +private Q_SLOTS: + void reloadView(); + void onStatusChanged(QDeclarativeView::Status status); + void onCurrentObjectsChanged(QList objects); + void applyChangesFromClient(); + void createQmlObject(const QString &qml, QObject *parent, + const QStringList &imports, const QString &filename = QString()); + +private: + void clearEditorItems(); + void createToolbar(); + void changeToSelectTool(); + QList filterForCurrentContext(QList &itemlist) const; + QList filterForSelection(QList &itemlist) const; + + QDeclarativeDesignViewPrivate *data; + +private: + Q_DISABLE_COPY(QDeclarativeDesignView) + +}; + +} //namespace QmlViewer + +#endif // QDECLARATIVEDESIGNVIEW_H diff --git a/src/libs/qmljsdebugger/include/qmljsdebugger_global.h b/src/libs/qmljsdebugger/include/qmljsdebugger_global.h new file mode 100644 index 00000000000..6aba5be4262 --- /dev/null +++ b/src/libs/qmljsdebugger/include/qmljsdebugger_global.h @@ -0,0 +1,43 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef QMLJSDEBUGGER_GLOBAL_H +#define QMLJSDEBUGGER_GLOBAL_H + +#include + +# if defined(BUILD_QMLJSDEBUGGER_LIB) +# define QMLJSDEBUGGER_EXPORT Q_DECL_EXPORT +# elif defined(BUILD_QMLJSDEBUGGER_STATIC_LIB) +# define QMLJSDEBUGGER_EXPORT +# else +# define QMLJSDEBUGGER_EXPORT Q_DECL_IMPORT +#endif + +#endif // QMLJSDEBUGGER_GLOBAL_H diff --git a/src/tools/qml/qmlobserver/editor/qmlviewerconstants.h b/src/libs/qmljsdebugger/include/qmlviewerconstants.h similarity index 100% rename from src/tools/qml/qmlobserver/editor/qmlviewerconstants.h rename to src/libs/qmljsdebugger/include/qmlviewerconstants.h diff --git a/src/tools/qml/qmlobserver/jsdebuggeragent.cpp b/src/libs/qmljsdebugger/jsdebuggeragent.cpp similarity index 100% rename from src/tools/qml/qmlobserver/jsdebuggeragent.cpp rename to src/libs/qmljsdebugger/jsdebuggeragent.cpp diff --git a/src/tools/qml/qmlobserver/qdeclarativedesigndebugserver.cpp b/src/libs/qmljsdebugger/qdeclarativedesigndebugserver.cpp similarity index 100% rename from src/tools/qml/qmlobserver/qdeclarativedesigndebugserver.cpp rename to src/libs/qmljsdebugger/qdeclarativedesigndebugserver.cpp diff --git a/src/tools/qml/qmlobserver/qdeclarativedesignview.cpp b/src/libs/qmljsdebugger/qdeclarativedesignview.cpp similarity index 65% rename from src/tools/qml/qmlobserver/qdeclarativedesignview.cpp rename to src/libs/qmljsdebugger/qdeclarativedesignview.cpp index ec93e25e4cf..d92aa08a52e 100644 --- a/src/tools/qml/qmlobserver/qdeclarativedesignview.cpp +++ b/src/libs/qmljsdebugger/qdeclarativedesignview.cpp @@ -1,4 +1,5 @@ #include "qdeclarativedesignview.h" +#include "qdeclarativedesignview_p.h" #include "qdeclarativedesigndebugserver.h" #include "selectiontool.h" #include "zoomtool.h" @@ -25,23 +26,34 @@ namespace QmlViewer { Q_GLOBAL_STATIC(QDeclarativeDesignDebugServer, qmlDesignDebugServer) -QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) : - QDeclarativeView(parent), - m_designModeBehavior(false), - m_executionPaused(false), - m_slowdownFactor(1.0f), - m_toolbar(0) +QDeclarativeDesignViewPrivate::QDeclarativeDesignViewPrivate() : + designModeBehavior(false), + executionPaused(false), + slowdownFactor(1.0f), + toolbar(0) { - m_crumblePath = new CrumblePath(0); - m_manipulatorLayer = new LayerItem(scene()); - m_selectionTool = new SelectionTool(this); - m_zoomTool = new ZoomTool(this); - m_colorPickerTool = new ColorPickerTool(this); - m_boundingRectHighlighter = new BoundingRectHighlighter(this); - m_subcomponentEditorTool = new SubcomponentEditorTool(this); - m_subcomponentEditorTool->setCrumblePathWidget(m_crumblePath); - m_currentTool = m_selectionTool; +} + +QDeclarativeDesignViewPrivate::~QDeclarativeDesignViewPrivate() +{ +} + +QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) : + QDeclarativeView(parent) +{ + data = new QDeclarativeDesignViewPrivate; + + data->crumblePath = new CrumblePath(0); + + data->manipulatorLayer = new LayerItem(scene()); + data->selectionTool = new SelectionTool(this); + data->zoomTool = new ZoomTool(this); + data->colorPickerTool = new ColorPickerTool(this); + data->boundingRectHighlighter = new BoundingRectHighlighter(this); + data->subcomponentEditorTool = new SubcomponentEditorTool(this); + data->subcomponentEditorTool->setCrumblePathWidget(data->crumblePath); + data->currentTool = data->selectionTool; setMouseTracking(true); @@ -61,8 +73,8 @@ QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) : connect(this, SIGNAL(statusChanged(QDeclarativeView::Status)), SLOT(onStatusChanged(QDeclarativeView::Status))); - connect(m_colorPickerTool, SIGNAL(selectedColorChanged(QColor)), SIGNAL(selectedColorChanged(QColor))); - connect(m_colorPickerTool, SIGNAL(selectedColorChanged(QColor)), + connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), SIGNAL(selectedColorChanged(QColor))); + connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), qmlDesignDebugServer(), SLOT(selectedColorChanged(QColor))); createToolbar(); @@ -74,7 +86,7 @@ QDeclarativeDesignView::~QDeclarativeDesignView() void QDeclarativeDesignView::reloadView() { - m_subcomponentEditorTool->clear(); + data->subcomponentEditorTool->clear(); clearHighlight(); emit reloadRequested(); } @@ -100,8 +112,8 @@ void QDeclarativeDesignView::mousePressEvent(QMouseEvent *event) QDeclarativeView::mousePressEvent(event); return; } - m_cursorPos = event->pos(); - m_currentTool->mousePressEvent(event); + data->cursorPos = event->pos(); + data->currentTool->mousePressEvent(event); } void QDeclarativeDesignView::mouseMoveEvent(QMouseEvent *event) @@ -111,7 +123,7 @@ void QDeclarativeDesignView::mouseMoveEvent(QMouseEvent *event) QDeclarativeView::mouseMoveEvent(event); return; } - m_cursorPos = event->pos(); + data->cursorPos = event->pos(); QList selItems = selectableItems(event->pos()); if (!selItems.isEmpty()) { @@ -120,11 +132,11 @@ void QDeclarativeDesignView::mouseMoveEvent(QMouseEvent *event) setToolTip(QString()); } if (event->buttons()) { - m_subcomponentEditorTool->mouseMoveEvent(event); - m_currentTool->mouseMoveEvent(event); + data->subcomponentEditorTool->mouseMoveEvent(event); + data->currentTool->mouseMoveEvent(event); } else { - m_subcomponentEditorTool->hoverMoveEvent(event); - m_currentTool->hoverMoveEvent(event); + data->subcomponentEditorTool->hoverMoveEvent(event); + data->currentTool->hoverMoveEvent(event); } } @@ -134,12 +146,12 @@ void QDeclarativeDesignView::mouseReleaseEvent(QMouseEvent *event) QDeclarativeView::mouseReleaseEvent(event); return; } - m_subcomponentEditorTool->mouseReleaseEvent(event); + data->subcomponentEditorTool->mouseReleaseEvent(event); - m_cursorPos = event->pos(); - m_currentTool->mouseReleaseEvent(event); + data->cursorPos = event->pos(); + data->currentTool->mouseReleaseEvent(event); - qmlDesignDebugServer()->setCurrentObjects(AbstractFormEditorTool::toObjectList(selectedItems())); + //qmlDesignDebugServer()->setCurrentObjects(AbstractFormEditorTool::toObjectList(selectedItems())); } void QDeclarativeDesignView::keyPressEvent(QKeyEvent *event) @@ -148,7 +160,7 @@ void QDeclarativeDesignView::keyPressEvent(QKeyEvent *event) QDeclarativeView::keyPressEvent(event); return; } - m_currentTool->keyPressEvent(event); + data->currentTool->keyPressEvent(event); } void QDeclarativeDesignView::keyReleaseEvent(QKeyEvent *event) @@ -174,11 +186,11 @@ void QDeclarativeDesignView::keyReleaseEvent(QKeyEvent *event) case Qt::Key_Enter: case Qt::Key_Return: if (!selectedItems().isEmpty()) - m_subcomponentEditorTool->setCurrentItem(selectedItems().first()); + data->subcomponentEditorTool->setCurrentItem(selectedItems().first()); break; case Qt::Key_Space: - if (m_executionPaused) { - continueExecution(m_slowdownFactor); + if (data->executionPaused) { + continueExecution(data->slowdownFactor); } else { pauseExecution(); } @@ -187,7 +199,7 @@ void QDeclarativeDesignView::keyReleaseEvent(QKeyEvent *event) break; } - m_currentTool->keyReleaseEvent(event); + data->currentTool->keyReleaseEvent(event); } void QDeclarativeDesignView::createQmlObject(const QString &qml, QObject *parent, const QStringList &importList, const QString &filename) @@ -218,7 +230,7 @@ void QDeclarativeDesignView::createQmlObject(const QString &qml, QObject *parent QGraphicsItem *QDeclarativeDesignView::currentRootItem() const { - return m_subcomponentEditorTool->currentRootItem(); + return data->subcomponentEditorTool->currentRootItem(); } void QDeclarativeDesignView::mouseDoubleClickEvent(QMouseEvent *event) @@ -238,10 +250,10 @@ void QDeclarativeDesignView::mouseDoubleClickEvent(QMouseEvent *event) } if (itemToEnter) - itemToEnter = m_subcomponentEditorTool->firstChildOfContext(itemToEnter); + itemToEnter = data->subcomponentEditorTool->firstChildOfContext(itemToEnter); - m_subcomponentEditorTool->setCurrentItem(itemToEnter); - m_subcomponentEditorTool->mouseDoubleClickEvent(event); + data->subcomponentEditorTool->setCurrentItem(itemToEnter); + data->subcomponentEditorTool->mouseDoubleClickEvent(event); if ((event->buttons() & Qt::LeftButton) && itemToEnter) { QGraphicsObject *objectToEnter = itemToEnter->toGraphicsObject(); @@ -252,37 +264,37 @@ void QDeclarativeDesignView::mouseDoubleClickEvent(QMouseEvent *event) } void QDeclarativeDesignView::wheelEvent(QWheelEvent *event) { - if (!m_designModeBehavior) { + if (!data->designModeBehavior) { QDeclarativeView::wheelEvent(event); return; } - m_currentTool->wheelEvent(event); + data->currentTool->wheelEvent(event); } void QDeclarativeDesignView::setDesignModeBehavior(bool value) { emit designModeBehaviorChanged(value); - m_toolbar->setDesignModeBehavior(value); + data->toolbar->setDesignModeBehavior(value); qmlDesignDebugServer()->setDesignModeBehavior(value); - m_designModeBehavior = value; - if (m_subcomponentEditorTool) { - m_subcomponentEditorTool->clear(); + data->designModeBehavior = value; + if (data->subcomponentEditorTool) { + data->subcomponentEditorTool->clear(); clearHighlight(); setSelectedItems(QList()); if (rootObject()) - m_subcomponentEditorTool->pushContext(rootObject()); + data->subcomponentEditorTool->pushContext(rootObject()); } - if (!m_designModeBehavior) + if (!data->designModeBehavior) clearEditorItems(); } bool QDeclarativeDesignView::designModeBehavior() const { - return m_designModeBehavior; + return data->designModeBehavior; } void QDeclarativeDesignView::changeTool(Constants::DesignTool tool, Constants::ToolFlags /*flags*/) @@ -293,30 +305,30 @@ void QDeclarativeDesignView::changeTool(Constants::DesignTool tool, Constants::T break; case Constants::NoTool: default: - m_currentTool = 0; + data->currentTool = 0; break; } } void QDeclarativeDesignView::setSelectedItems(QList items) { - m_currentSelection.clear(); + data->currentSelection.clear(); foreach(QGraphicsItem *item, items) { if (item) { QGraphicsObject *obj = item->toGraphicsObject(); if (obj) - m_currentSelection << obj; + data->currentSelection << obj; } } - m_currentTool->updateSelectedItems(); + data->currentTool->updateSelectedItems(); } QList QDeclarativeDesignView::selectedItems() { QList selection; - foreach(const QWeakPointer &selectedObject, m_currentSelection) { + foreach(const QWeakPointer &selectedObject, data->currentSelection) { if (selectedObject.isNull()) { - m_currentSelection.removeOne(selectedObject); + data->currentSelection.removeOne(selectedObject); } else { selection << selectedObject.data(); } @@ -325,14 +337,9 @@ QList QDeclarativeDesignView::selectedItems() return selection; } -AbstractFormEditorTool *QDeclarativeDesignView::currentTool() const -{ - return m_currentTool; -} - void QDeclarativeDesignView::clearHighlight() { - m_boundingRectHighlighter->clear(); + data->boundingRectHighlighter->clear(); } void QDeclarativeDesignView::highlight(QGraphicsItem * item, ContextFlags flags) @@ -349,7 +356,7 @@ void QDeclarativeDesignView::highlight(QList items, ContextFlag foreach(QGraphicsItem *item, items) { QGraphicsItem *child = item; if (flags & ContextSensitive) - child = m_subcomponentEditorTool->firstChildOfContext(item); + child = data->subcomponentEditorTool->firstChildOfContext(item); if (child) { QGraphicsObject *childObject = child->toGraphicsObject(); @@ -358,12 +365,12 @@ void QDeclarativeDesignView::highlight(QList items, ContextFlag } } - m_boundingRectHighlighter->highlight(objectList); + data->boundingRectHighlighter->highlight(objectList); } bool QDeclarativeDesignView::mouseInsideContextItem() const { - return m_subcomponentEditorTool->containsCursor(m_cursorPos.toPoint()); + return data->subcomponentEditorTool->containsCursor(data->cursorPos.toPoint()); } QList QDeclarativeDesignView::selectableItems(const QPointF &scenePos) const @@ -387,8 +394,8 @@ QList QDeclarativeDesignView::selectableItems(const QRectF &scen void QDeclarativeDesignView::changeToSingleSelectTool() { - m_currentToolMode = Constants::SelectionToolMode; - m_selectionTool->setRubberbandSelectionMode(false); + data->currentToolMode = Constants::SelectionToolMode; + data->selectionTool->setRubberbandSelectionMode(false); changeToSelectTool(); @@ -398,20 +405,20 @@ void QDeclarativeDesignView::changeToSingleSelectTool() void QDeclarativeDesignView::changeToSelectTool() { - if (m_currentTool == m_selectionTool) + if (data->currentTool == data->selectionTool) return; - m_currentTool->clear(); - m_currentTool = m_selectionTool; - m_currentTool->clear(); - m_currentTool->updateSelectedItems(); + data->currentTool->clear(); + data->currentTool = data->selectionTool; + data->currentTool->clear(); + data->currentTool->updateSelectedItems(); } void QDeclarativeDesignView::changeToMarqueeSelectTool() { changeToSelectTool(); - m_currentToolMode = Constants::MarqueeSelectionToolMode; - m_selectionTool->setRubberbandSelectionMode(true); + data->currentToolMode = Constants::MarqueeSelectionToolMode; + data->selectionTool->setRubberbandSelectionMode(true); emit marqueeSelectToolActivated(); qmlDesignDebugServer()->setCurrentTool(Constants::MarqueeSelectionToolMode); @@ -419,10 +426,10 @@ void QDeclarativeDesignView::changeToMarqueeSelectTool() void QDeclarativeDesignView::changeToZoomTool() { - m_currentToolMode = Constants::ZoomMode; - m_currentTool->clear(); - m_currentTool = m_zoomTool; - m_currentTool->clear(); + data->currentToolMode = Constants::ZoomMode; + data->currentTool->clear(); + data->currentTool = data->zoomTool; + data->currentTool->clear(); emit zoomToolActivated(); qmlDesignDebugServer()->setCurrentTool(Constants::ZoomMode); @@ -430,13 +437,13 @@ void QDeclarativeDesignView::changeToZoomTool() void QDeclarativeDesignView::changeToColorPickerTool() { - if (m_currentTool == m_colorPickerTool) + if (data->currentTool == data->colorPickerTool) return; - m_currentToolMode = Constants::ColorPickerMode; - m_currentTool->clear(); - m_currentTool = m_colorPickerTool; - m_currentTool->clear(); + data->currentToolMode = Constants::ColorPickerMode; + data->currentTool->clear(); + data->currentTool = data->colorPickerTool; + data->currentTool->clear(); emit colorPickerActivated(); qmlDesignDebugServer()->setCurrentTool(Constants::ColorPickerMode); @@ -444,10 +451,10 @@ void QDeclarativeDesignView::changeToColorPickerTool() void QDeclarativeDesignView::changeAnimationSpeed(qreal slowdownFactor) { - m_slowdownFactor = slowdownFactor; + data->slowdownFactor = slowdownFactor; - if (m_slowdownFactor != 0) { - continueExecution(m_slowdownFactor); + if (data->slowdownFactor != 0) { + continueExecution(data->slowdownFactor); } else { pauseExecution(); } @@ -457,17 +464,17 @@ void QDeclarativeDesignView::continueExecution(qreal slowdownFactor) { Q_ASSERT(slowdownFactor > 0); - m_slowdownFactor = slowdownFactor; + data->slowdownFactor = slowdownFactor; static const qreal animSpeedSnapDelta = 0.01f; - bool useStandardSpeed = (qAbs(1.0f - m_slowdownFactor) < animSpeedSnapDelta); + bool useStandardSpeed = (qAbs(1.0f - data->slowdownFactor) < animSpeedSnapDelta); QUnifiedTimer *timer = QUnifiedTimer::instance(); - timer->setSlowdownFactor(m_slowdownFactor); + timer->setSlowdownFactor(data->slowdownFactor); timer->setSlowModeEnabled(!useStandardSpeed); - m_executionPaused = false; + data->executionPaused = false; - emit executionStarted(m_slowdownFactor); - qmlDesignDebugServer()->setAnimationSpeed(m_slowdownFactor); + emit executionStarted(data->slowdownFactor); + qmlDesignDebugServer()->setAnimationSpeed(data->slowdownFactor); } void QDeclarativeDesignView::pauseExecution() @@ -475,7 +482,7 @@ void QDeclarativeDesignView::pauseExecution() QUnifiedTimer *timer = QUnifiedTimer::instance(); timer->setSlowdownFactor(0); timer->setSlowModeEnabled(true); - m_executionPaused = true; + data->executionPaused = true; emit executionPaused(); qmlDesignDebugServer()->setAnimationSpeed(0); @@ -486,15 +493,15 @@ void QDeclarativeDesignView::applyChangesFromClient() } -LayerItem *QDeclarativeDesignView::manipulatorLayer() const +QGraphicsObject *QDeclarativeDesignView::manipulatorLayer() const { - return m_manipulatorLayer; + return data->manipulatorLayer; } QList QDeclarativeDesignView::filterForSelection(QList &itemlist) const { foreach(QGraphicsItem *item, itemlist) { - if (isEditorItem(item) || !m_subcomponentEditorTool->isChildOfContext(item)) + if (isEditorItem(item) || !data->subcomponentEditorTool->isChildOfContext(item)) itemlist.removeOne(item); } @@ -505,10 +512,10 @@ QList QDeclarativeDesignView::filterForCurrentContext(QListisDirectChildOfContext(item)) { + if (isEditorItem(item) || !data->subcomponentEditorTool->isDirectChildOfContext(item)) { // if we're a child, but not directly, replace with the parent that is directly in context. - if (QGraphicsItem *contextParent = m_subcomponentEditorTool->firstChildOfContext(item)) { + if (QGraphicsItem *contextParent = data->subcomponentEditorTool->firstChildOfContext(item)) { if (contextParent != item) { if (itemlist.contains(contextParent)) { itemlist.removeOne(item); @@ -536,7 +543,7 @@ void QDeclarativeDesignView::onStatusChanged(QDeclarativeView::Status status) { if (status == QDeclarativeView::Ready) { if (rootObject()) { - m_subcomponentEditorTool->pushContext(rootObject()); + data->subcomponentEditorTool->pushContext(rootObject()); emit executionStarted(1.0f); } qmlDesignDebugServer()->reloaded(); @@ -588,44 +595,44 @@ QRectF QDeclarativeDesignView::adjustToScreenBoundaries(const QRectF &boundingRe CrumblePath *QDeclarativeDesignView::crumblePathWidget() const { - return m_crumblePath; + return data->crumblePath; } QToolBar *QDeclarativeDesignView::toolbar() const { - return m_toolbar; + return data->toolbar; } void QDeclarativeDesignView::createToolbar() { - m_toolbar = new QmlToolbar(this); - connect(this, SIGNAL(selectedColorChanged(QColor)), m_toolbar, SLOT(setColorBoxColor(QColor))); + data->toolbar = new QmlToolbar(this); + connect(this, SIGNAL(selectedColorChanged(QColor)), data->toolbar, SLOT(setColorBoxColor(QColor))); - connect(this, SIGNAL(designModeBehaviorChanged(bool)), m_toolbar, SLOT(setDesignModeBehavior(bool))); + connect(this, SIGNAL(designModeBehaviorChanged(bool)), data->toolbar, SLOT(setDesignModeBehavior(bool))); - connect(m_toolbar, SIGNAL(designModeBehaviorChanged(bool)), this, SLOT(setDesignModeBehavior(bool))); - connect(m_toolbar, SIGNAL(executionStarted()), this, SLOT(continueExecution())); - connect(m_toolbar, SIGNAL(executionPaused()), this, SLOT(pauseExecution())); - connect(m_toolbar, SIGNAL(colorPickerSelected()), this, SLOT(changeToColorPickerTool())); - connect(m_toolbar, SIGNAL(zoomToolSelected()), this, SLOT(changeToZoomTool())); - connect(m_toolbar, SIGNAL(selectToolSelected()), this, SLOT(changeToSingleSelectTool())); - connect(m_toolbar, SIGNAL(marqueeSelectToolSelected()), this, SLOT(changeToMarqueeSelectTool())); + connect(data->toolbar, SIGNAL(designModeBehaviorChanged(bool)), this, SLOT(setDesignModeBehavior(bool))); + connect(data->toolbar, SIGNAL(executionStarted()), this, SLOT(continueExecution())); + connect(data->toolbar, SIGNAL(executionPaused()), this, SLOT(pauseExecution())); + connect(data->toolbar, SIGNAL(colorPickerSelected()), this, SLOT(changeToColorPickerTool())); + connect(data->toolbar, SIGNAL(zoomToolSelected()), this, SLOT(changeToZoomTool())); + connect(data->toolbar, SIGNAL(selectToolSelected()), this, SLOT(changeToSingleSelectTool())); + connect(data->toolbar, SIGNAL(marqueeSelectToolSelected()), this, SLOT(changeToMarqueeSelectTool())); - connect(m_toolbar, SIGNAL(applyChangesFromQmlFileSelected()), SLOT(applyChangesFromClient())); + connect(data->toolbar, SIGNAL(applyChangesFromQmlFileSelected()), SLOT(applyChangesFromClient())); - connect(this, SIGNAL(executionStarted(qreal)), m_toolbar, SLOT(startExecution())); - connect(this, SIGNAL(executionPaused()), m_toolbar, SLOT(pauseExecution())); + connect(this, SIGNAL(executionStarted(qreal)), data->toolbar, SLOT(startExecution())); + connect(this, SIGNAL(executionPaused()), data->toolbar, SLOT(pauseExecution())); - connect(this, SIGNAL(selectToolActivated()), m_toolbar, SLOT(activateSelectTool())); + connect(this, SIGNAL(selectToolActivated()), data->toolbar, SLOT(activateSelectTool())); // disabled features - //connect(m_toolbar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient())); - //connect(this, SIGNAL(resizeToolActivated()), m_toolbar, SLOT(activateSelectTool())); - //connect(this, SIGNAL(moveToolActivated()), m_toolbar, SLOT(activateSelectTool())); + //connect(d->m_toolbar, SIGNAL(applyChangesToQmlFileSelected()), SLOT(applyChangesToClient())); + //connect(this, SIGNAL(resizeToolActivated()), d->m_toolbar, SLOT(activateSelectTool())); + //connect(this, SIGNAL(moveToolActivated()), d->m_toolbar, SLOT(activateSelectTool())); - connect(this, SIGNAL(colorPickerActivated()), m_toolbar, SLOT(activateColorPicker())); - connect(this, SIGNAL(zoomToolActivated()), m_toolbar, SLOT(activateZoom())); - connect(this, SIGNAL(marqueeSelectToolActivated()), m_toolbar, SLOT(activateMarqueeSelectTool())); + connect(this, SIGNAL(colorPickerActivated()), data->toolbar, SLOT(activateColorPicker())); + connect(this, SIGNAL(zoomToolActivated()), data->toolbar, SLOT(activateZoom())); + connect(this, SIGNAL(marqueeSelectToolActivated()), data->toolbar, SLOT(activateMarqueeSelectTool())); } } //namespace QmlViewer diff --git a/src/libs/qmljsdebugger/qdeclarativedesignview_p.h b/src/libs/qmljsdebugger/qdeclarativedesignview_p.h new file mode 100644 index 00000000000..6405525a8cc --- /dev/null +++ b/src/libs/qmljsdebugger/qdeclarativedesignview_p.h @@ -0,0 +1,82 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef QDECLARATIVEDESIGNVIEW_P_H +#define QDECLARATIVEDESIGNVIEW_P_H + +#include +#include + +namespace QmlViewer { + +class QDeclarativeDesignView; +class SelectionTool; +class ZoomTool; +class ColorPickerTool; +class LayerItem; +class BoundingRectHighlighter; +class SubcomponentEditorTool; +class QmlToolbar; +class CrumblePath; +class AbstractFormEditorTool; + +class QDeclarativeDesignViewPrivate +{ + +public: + QDeclarativeDesignViewPrivate(); + ~QDeclarativeDesignViewPrivate(); + + QPointF cursorPos; + QList > currentSelection; + + Constants::DesignTool currentToolMode; + AbstractFormEditorTool *currentTool; + + SelectionTool *selectionTool; + ZoomTool *zoomTool; + ColorPickerTool *colorPickerTool; + SubcomponentEditorTool *subcomponentEditorTool; + LayerItem *manipulatorLayer; + + BoundingRectHighlighter *boundingRectHighlighter; + + bool designModeBehavior; + + bool executionPaused; + qreal slowdownFactor; + + QmlToolbar *toolbar; + CrumblePath *crumblePath; + +}; + +} // namespace QmlViewer + +#endif // QDECLARATIVEDESIGNVIEW_P_H diff --git a/src/libs/qmljsdebugger/qmljsdebugger-lib.pri b/src/libs/qmljsdebugger/qmljsdebugger-lib.pri new file mode 100644 index 00000000000..bf0141dfff5 --- /dev/null +++ b/src/libs/qmljsdebugger/qmljsdebugger-lib.pri @@ -0,0 +1,32 @@ +QT += declarative +INCLUDEPATH += $$PWD $$PWD/include editor +DEPENDPATH += $$PWD $$PWD/include editor + +contains(CONFIG, dll) { + DEFINES += BUILD_QMLJSDEBUGGER_LIB +} else { + DEFINES += BUILD_QMLJSDEBUGGER_STATIC_LIB +} + +## Once is not enough +include($$PWD/../../private_headers.pri) +include($$PWD/../../private_headers.pri) + +include($$PWD/editor/editor.pri) + +## Input +HEADERS += \ + include/jsdebuggeragent.h \ + include/qdeclarativedesignview.h \ + include/qdeclarativedesigndebugserver.h \ + include/crumblepath.h \ + include/qmlviewerconstants.h \ + include/qmljsdebugger_global.h \ + qdeclarativedesignview_p.h + +SOURCES += \ + jsdebuggeragent.cpp \ + qdeclarativedesignview.cpp \ + qdeclarativedesigndebugserver.cpp + +OTHER_FILES += qmljsdebugger.pri diff --git a/src/libs/qmljsdebugger/qmljsdebugger.pri b/src/libs/qmljsdebugger/qmljsdebugger.pri new file mode 100644 index 00000000000..8987d2e4522 --- /dev/null +++ b/src/libs/qmljsdebugger/qmljsdebugger.pri @@ -0,0 +1,5 @@ +INCLUDEPATH += $$PWD/include +DEPENDPATH += $$PWD $$PWD/include $$PWD/editor +QT += declarative + +LIBS *= -l$$qtLibraryTarget(QmlJSDebugger) diff --git a/src/libs/qmljsdebugger/qmljsdebugger.pro b/src/libs/qmljsdebugger/qmljsdebugger.pro new file mode 100644 index 00000000000..3f5b3207c11 --- /dev/null +++ b/src/libs/qmljsdebugger/qmljsdebugger.pro @@ -0,0 +1,8 @@ +TEMPLATE = lib +CONFIG+=dll +TARGET = QmlJSDebugger + +unix:QMAKE_CXXFLAGS_DEBUG += -O3 + +include(../../qtcreatorlibrary.pri) +include(qmljsdebugger-lib.pri) diff --git a/src/tools/qml/qmlobserver/qml.pri b/src/tools/qml/qmlobserver/qml.pri index dff02fe7138..c351d58caf3 100644 --- a/src/tools/qml/qmlobserver/qml.pri +++ b/src/tools/qml/qmlobserver/qml.pri @@ -1,33 +1,26 @@ QT += declarative script network sql + contains(QT_CONFIG, opengl) { QT += opengl DEFINES += GL_SUPPORTED } -include($$PWD/editor/editor.pri) - INCLUDEPATH += $$PWD HEADERS += $$PWD/qmlruntime.h \ $$PWD/proxysettings.h \ $$PWD/qdeclarativetester.h \ $$PWD/deviceorientation.h \ - $$PWD/loggerwidget.h \ - $$PWD/qdeclarativedesigndebugserver.h \ - $$PWD/qdeclarativedesignview.h \ - $$PWD/jsdebuggeragent.h + $$PWD/loggerwidget.h SOURCES += $$PWD/qmlruntime.cpp \ $$PWD/proxysettings.cpp \ $$PWD/qdeclarativetester.cpp \ - $$PWD/loggerwidget.cpp \ - $$PWD/qdeclarativedesigndebugserver.cpp \ - $$PWD/qdeclarativedesignview.cpp \ - $$PWD/jsdebuggeragent.cpp - + $$PWD/loggerwidget.cpp RESOURCES += $$PWD/qmlruntime.qrc + maemo5 { QT += dbus HEADERS += $$PWD/texteditautoresizer_maemo5.h diff --git a/src/tools/qml/qmlobserver/qmlobserver.pro b/src/tools/qml/qmlobserver/qmlobserver.pro index 2c51eab5f10..bdcdc2d8052 100644 --- a/src/tools/qml/qmlobserver/qmlobserver.pro +++ b/src/tools/qml/qmlobserver/qmlobserver.pro @@ -5,6 +5,7 @@ include(qml.pri) SOURCES += main.cpp +include(../../../libs/qmljsdebugger/qmljsdebugger.pri) include(../../../../qtcreator.pri) include(../../../private_headers.pri) DESTDIR = $$IDE_BIN_PATH diff --git a/src/tools/qml/qmlobserver/qmlruntime.cpp b/src/tools/qml/qmlobserver/qmlruntime.cpp index bfa26c4478d..0109914f031 100644 --- a/src/tools/qml/qmlobserver/qmlruntime.cpp +++ b/src/tools/qml/qmlobserver/qmlruntime.cpp @@ -54,8 +54,9 @@ # include "ui_recopts.h" #endif -#include "qdeclarativedesignview.h" -#include "crumblepath.h" +#include +#include + #include "qmlruntime.h" #include #include