diff options
Diffstat (limited to 'share/qtcreator/qml/qmlpuppet/commands')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/commands/commands.pri | 6 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/commands/enable3dviewcommand.cpp (renamed from share/qtcreator/qml/qmlpuppet/commands/change3dviewcommand.cpp) | 28 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/commands/enable3dviewcommand.h (renamed from share/qtcreator/qml/qmlpuppet/commands/change3dviewcommand.h) | 25 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.cpp | 106 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.h | 69 |
5 files changed, 205 insertions, 29 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/commands/commands.pri b/share/qtcreator/qml/qmlpuppet/commands/commands.pri index ffd1ce6dea..7985b25975 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/commands.pri +++ b/share/qtcreator/qml/qmlpuppet/commands/commands.pri @@ -28,7 +28,8 @@ HEADERS += $$PWD/removesharedmemorycommand.h HEADERS += $$PWD/puppetalivecommand.h HEADERS += $$PWD/changeselectioncommand.h HEADERS += $$PWD/drop3dlibraryitemcommand.h -HEADERS += $$PWD/change3dviewcommand.h +HEADERS += $$PWD/update3dviewstatecommand.h +HEADERS += $$PWD/enable3dviewcommand.h SOURCES += $$PWD/synchronizecommand.cpp SOURCES += $$PWD/debugoutputcommand.cpp @@ -58,4 +59,5 @@ SOURCES += $$PWD/removesharedmemorycommand.cpp SOURCES += $$PWD/puppetalivecommand.cpp SOURCES += $$PWD/changeselectioncommand.cpp SOURCES += $$PWD/drop3dlibraryitemcommand.cpp -SOURCES += $$PWD/change3dviewcommand.cpp +SOURCES += $$PWD/update3dviewstatecommand.cpp +SOURCES += $$PWD/enable3dviewcommand.cpp diff --git a/share/qtcreator/qml/qmlpuppet/commands/change3dviewcommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/enable3dviewcommand.cpp index ad4832d86b..7fd3b3f350 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/change3dviewcommand.cpp +++ b/share/qtcreator/qml/qmlpuppet/commands/enable3dviewcommand.cpp @@ -23,41 +23,43 @@ ** ****************************************************************************/ -#include "change3dviewcommand.h" +#include "enable3dviewcommand.h" #include <QDebug> +#include <QDataStream> namespace QmlDesigner { -Change3DViewCommand::Change3DViewCommand() = default; - -Change3DViewCommand::Change3DViewCommand(const QVector<InformationContainer> &informationVector) - : m_informationVector(informationVector) +// open / close edit view 3D command +Enable3DViewCommand::Enable3DViewCommand(bool enable) + : m_enable(enable) { } -QVector<InformationContainer> Change3DViewCommand::informationVector() const +bool Enable3DViewCommand::isEnable() const { - return m_informationVector; + return m_enable; } -QDataStream &operator<<(QDataStream &out, const Change3DViewCommand &command) +QDataStream &operator<<(QDataStream &out, const Enable3DViewCommand &command) { - out << command.informationVector(); + out << qint32(command.isEnable()); return out; } -QDataStream &operator>>(QDataStream &in, Change3DViewCommand &command) +QDataStream &operator>>(QDataStream &in, Enable3DViewCommand &command) { - in >> command.m_informationVector; + qint32 enable; + in >> enable; + command.m_enable = enable; return in; } -QDebug operator <<(QDebug debug, const Change3DViewCommand &command) +QDebug operator<<(QDebug debug, const Enable3DViewCommand &command) { - return debug.nospace() << "Change3DViewCommand(auxiliaryChanges: " << command.m_informationVector << ")"; + return debug.nospace() << "Enable3DViewCommand(enable: " << command.m_enable << ")"; } } // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/commands/change3dviewcommand.h b/share/qtcreator/qml/qmlpuppet/commands/enable3dviewcommand.h index 6b1b062da0..cd9529fbb5 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/change3dviewcommand.h +++ b/share/qtcreator/qml/qmlpuppet/commands/enable3dviewcommand.h @@ -26,32 +26,29 @@ #pragma once #include <QMetaType> -#include <QVector> - -#include "informationcontainer.h" namespace QmlDesigner { -class Change3DViewCommand +class Enable3DViewCommand { - friend QDataStream &operator>>(QDataStream &in, Change3DViewCommand &command); - friend QDebug operator <<(QDebug debug, const Change3DViewCommand &command); + friend QDataStream &operator>>(QDataStream &in, Enable3DViewCommand &command); + friend QDebug operator<<(QDebug debug, const Enable3DViewCommand &command); public: - Change3DViewCommand(); - explicit Change3DViewCommand(const QVector<InformationContainer> &auxiliaryChangeVector); + explicit Enable3DViewCommand(bool enable); + Enable3DViewCommand() = default; - QVector<InformationContainer> informationVector() const; + bool isEnable() const; private: - QVector<InformationContainer> m_informationVector; + bool m_enable = true; }; -QDataStream &operator<<(QDataStream &out, const Change3DViewCommand &command); -QDataStream &operator>>(QDataStream &in, Change3DViewCommand &command); +QDataStream &operator<<(QDataStream &out, const Enable3DViewCommand &command); +QDataStream &operator>>(QDataStream &in, Enable3DViewCommand &command); -QDebug operator <<(QDebug debug, const Change3DViewCommand &command); +QDebug operator<<(QDebug debug, const Enable3DViewCommand &command); } // namespace QmlDesigner -Q_DECLARE_METATYPE(QmlDesigner::Change3DViewCommand) +Q_DECLARE_METATYPE(QmlDesigner::Enable3DViewCommand) diff --git a/share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.cpp b/share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.cpp new file mode 100644 index 0000000000..b387cf09f3 --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.cpp @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "update3dviewstatecommand.h" + +#include <QDebug> +#include <QDataStream> + +namespace QmlDesigner { + +Update3dViewStateCommand::Update3dViewStateCommand(Qt::WindowStates previousStates, + Qt::WindowStates currentStates) + : m_previousStates(previousStates) + , m_currentStates(currentStates) + , m_type(Update3dViewStateCommand::StateChange) +{ +} + +Update3dViewStateCommand::Update3dViewStateCommand(bool active, bool hasPopup) + : m_active(active) + , m_hasPopup(hasPopup) + , m_type(Update3dViewStateCommand::ActiveChange) +{ +} + +Qt::WindowStates Update3dViewStateCommand::previousStates() const +{ + return m_previousStates; +} + +Qt::WindowStates Update3dViewStateCommand::currentStates() const +{ + return m_currentStates; +} + +bool Update3dViewStateCommand::isActive() const +{ + return m_active; +} + +bool Update3dViewStateCommand::hasPopup() const +{ + return m_hasPopup; +} + +Update3dViewStateCommand::Type Update3dViewStateCommand::type() const +{ + return m_type; +} + +QDataStream &operator<<(QDataStream &out, const Update3dViewStateCommand &command) +{ + out << command.previousStates(); + out << command.currentStates(); + out << qint32(command.isActive()); + out << qint32(command.hasPopup()); + out << qint32(command.type()); + + return out; +} + +QDataStream &operator>>(QDataStream &in, Update3dViewStateCommand &command) +{ + in >> command.m_previousStates; + in >> command.m_currentStates; + qint32 active; + qint32 hasPopup; + qint32 type; + in >> active; + in >> hasPopup; + in >> type; + command.m_active = active; + command.m_hasPopup = hasPopup; + command.m_type = Update3dViewStateCommand::Type(type); + + return in; +} + +QDebug operator<<(QDebug debug, const Update3dViewStateCommand &command) +{ + return debug.nospace() << "Update3dViewStateCommand(type: " << command.m_type << ")"; +} + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.h b/share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.h new file mode 100644 index 0000000000..de8511255d --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/commands/update3dviewstatecommand.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#pragma once + +#include <QMetaType> + +namespace QmlDesigner { + +class Update3dViewStateCommand +{ + friend QDataStream &operator>>(QDataStream &in, Update3dViewStateCommand &command); + friend QDebug operator<<(QDebug debug, const Update3dViewStateCommand &command); + +public: + enum Type { StateChange, ActiveChange, Empty }; + + explicit Update3dViewStateCommand(Qt::WindowStates previousStates, Qt::WindowStates currentStates); + explicit Update3dViewStateCommand(bool active, bool hasPopup); + Update3dViewStateCommand() = default; + + Qt::WindowStates previousStates() const; + Qt::WindowStates currentStates() const; + + bool isActive() const; + bool hasPopup() const; + + Type type() const; + +private: + Qt::WindowStates m_previousStates = Qt::WindowNoState; + Qt::WindowStates m_currentStates = Qt::WindowNoState; + + bool m_active = false; + bool m_hasPopup = false; + + Type m_type = Empty; +}; + +QDataStream &operator<<(QDataStream &out, const Update3dViewStateCommand &command); +QDataStream &operator>>(QDataStream &in, Update3dViewStateCommand &command); + +QDebug operator<<(QDebug debug, const Update3dViewStateCommand &command); + +} // namespace QmlDesigner + +Q_DECLARE_METATYPE(QmlDesigner::Update3dViewStateCommand) |