diff options
author | Colin Ogilvie <colin.ogilvie@kdab.com> | 2016-01-12 14:18:01 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-01-12 18:38:16 +0000 |
commit | 7f308fe0a9ec54d30c886203876d765e284f3826 (patch) | |
tree | 7de05e868303c94db89b9ba85a2a5395445d1885 | |
parent | da80f3ffc733e19968b582699d4e4657ce7601fc (diff) |
Added front end classes as a start to support aggregate actions
Change-Id: Ic852ccf3994bb8604924687165bb49cb1dec3077
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/input/frontend/frontend.pri | 11 | ||||
-rw-r--r-- | src/input/frontend/qabstractaggregateactioninput.cpp | 86 | ||||
-rw-r--r-- | src/input/frontend/qabstractaggregateactioninput.h | 71 | ||||
-rw-r--r-- | src/input/frontend/qabstractaggregateactioninput_p.h | 76 | ||||
-rw-r--r-- | src/input/frontend/qinputchord.cpp | 74 | ||||
-rw-r--r-- | src/input/frontend/qinputchord.h | 71 | ||||
-rw-r--r-- | src/input/frontend/qinputsequence.cpp | 75 | ||||
-rw-r--r-- | src/input/frontend/qinputsequence.h | 71 |
8 files changed, 533 insertions, 2 deletions
diff --git a/src/input/frontend/frontend.pri b/src/input/frontend/frontend.pri index 4a6559a05..3860716c1 100644 --- a/src/input/frontend/frontend.pri +++ b/src/input/frontend/frontend.pri @@ -25,7 +25,11 @@ HEADERS += \ $$PWD/qabstractphysicaldevice_p.h \ $$PWD/qaxisactionhandler_p.h \ $$PWD/qaxisactionhandler.h \ - $$PWD/qabstractactioninput.h + $$PWD/qabstractactioninput.h \ + $$PWD/qabstractaggregateactioninput.h \ + $$PWD/qinputchord.h \ + $$PWD/qinputsequence.h \ + $$PWD/qabstractaggregateactioninput_p.h SOURCES += \ $$PWD/qinputaspect.cpp \ @@ -46,6 +50,9 @@ SOURCES += \ $$PWD/qinputdeviceintegrationfactory.cpp \ $$PWD/qaxissetting.cpp \ $$PWD/qaxisactionhandler.cpp \ - $$PWD/qabstractactioninput.cpp + $$PWD/qabstractactioninput.cpp \ + $$PWD/qabstractaggregateactioninput.cpp \ + $$PWD/qinputchord.cpp \ + $$PWD/qinputsequence.cpp INCLUDEPATH += $$PWD diff --git a/src/input/frontend/qabstractaggregateactioninput.cpp b/src/input/frontend/qabstractaggregateactioninput.cpp new file mode 100644 index 000000000..03e2d41bf --- /dev/null +++ b/src/input/frontend/qabstractaggregateactioninput.cpp @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +****************************************************************************/ + +#include "qabstractaggregateactioninput.h" +#include <Qt3DCore/private/qnode_p.h> +#include <Qt3DInput/private/qabstractaggregateactioninput_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +QAbstractAggregateActionInputPrivate::QAbstractAggregateActionInputPrivate() + : m_inputs() +{ +} + +QAbstractAggregateActionInput::QAbstractAggregateActionInput(Qt3DInput::QAbstractAggregateActionInputPrivate &dd, Qt3DCore::QNode *parent) + : Qt3DInput::QAbstractActionInput(dd, parent) +{ +} + +QAbstractAggregateActionInput::~QAbstractAggregateActionInput() +{ +} + +void QAbstractAggregateActionInput::addInput(QAbstractActionInput *input) +{ + Q_D(QAbstractAggregateActionInput); + if (!d->m_inputs.contains(input)) + d->m_inputs.push_back(input); +} + +void QAbstractAggregateActionInput::removeInput(QAbstractActionInput *input) +{ + Q_D(QAbstractAggregateActionInput); + if (d->m_inputs.contains(input)) + d->m_inputs.removeOne(input); +} + +QVector<QAbstractActionInput *> QAbstractAggregateActionInput::inputs() const +{ + Q_D(const QAbstractAggregateActionInput); + return d->m_inputs; +} + +void QAbstractAggregateActionInput::copy(const Qt3DCore::QNode *ref) +{ + QNode::copy(ref); + const QAbstractAggregateActionInput *aggregateInput = static_cast<const QAbstractAggregateActionInput *>(ref); + d_func()->m_inputs = aggregateInput->inputs(); +} +} // Qt3DInput + +QT_END_NAMESPACE diff --git a/src/input/frontend/qabstractaggregateactioninput.h b/src/input/frontend/qabstractaggregateactioninput.h new file mode 100644 index 000000000..fbc777a8e --- /dev/null +++ b/src/input/frontend/qabstractaggregateactioninput.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +****************************************************************************/ + +#ifndef QT3DINPUT_QABSTRACTAGGREGATEACTIONINPUT_H +#define QT3DINPUT_QABSTRACTAGGREGATEACTIONINPUT_H + +#include <Qt3DInput/qt3dinput_global.h> +#include <Qt3DCore/qnode.h> +#include <Qt3DInput/qabstractactioninput.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QAbstractActionInput; +class QNodePrivate; +class QAbstractAggregateActionInputPrivate; + +class QT3DINPUTSHARED_EXPORT QAbstractAggregateActionInput : public Qt3DInput::QAbstractActionInput +{ + Q_OBJECT +public: + explicit QAbstractAggregateActionInput(Qt3DInput::QAbstractAggregateActionInputPrivate &dd, Qt3DCore::QNode *parent = 0); + ~QAbstractAggregateActionInput(); + + void addInput(QAbstractActionInput *input); + void removeInput(QAbstractActionInput *input); + QVector<QAbstractActionInput *> inputs() const; + +protected: + void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; + Q_DECLARE_PRIVATE(QAbstractAggregateActionInput) +}; + +} // Qt3DInput + +QT_END_NAMESPACE + +#endif // QT3DINPUT_QABSTRACTAGGREGATEACTIONINPUT_H diff --git a/src/input/frontend/qabstractaggregateactioninput_p.h b/src/input/frontend/qabstractaggregateactioninput_p.h new file mode 100644 index 000000000..2ee406e59 --- /dev/null +++ b/src/input/frontend/qabstractaggregateactioninput_p.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DINPUT_QABSTRACTAGGREGATEACTIONINPUT_P_H +#define QT3DINPUT_QABSTRACTAGGREGATEACTIONINPUT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <Qt3DInput/qt3dinput_global.h> +#include <Qt3DCore/private/qnode_p.h> +#include <QtCore/qvector.h> +#include <Qt3DInput/private/qt3dinput_global_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QAbstractActionInput; + +class QT3DINPUTSHARED_PRIVATE_EXPORT QAbstractAggregateActionInputPrivate : public Qt3DCore::QNodePrivate +{ +public: + QAbstractAggregateActionInputPrivate(); + + Q_DECLARE_PUBLIC(QAbstractAggregateActionInput) + QVector<QAbstractActionInput *> m_inputs; +}; + +} + +QT_END_NAMESPACE + +#endif // QT3DINPUT_QABSTRACTAGGREGATEACTIONINPUT_P_H + diff --git a/src/input/frontend/qinputchord.cpp b/src/input/frontend/qinputchord.cpp new file mode 100644 index 000000000..c1f18414c --- /dev/null +++ b/src/input/frontend/qinputchord.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +****************************************************************************/ + +#include "qinputchord.h" +#include <Qt3DInput/private/qabstractaggregateactioninput_p.h> +#include <Qt3DInput/qabstractphysicaldevice.h> +#include <Qt3DInput/qabstractaggregateactioninput.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QInputChordPrivate : public Qt3DInput::QAbstractAggregateActionInputPrivate +{ +public: + QInputChordPrivate() + : Qt3DInput::QAbstractAggregateActionInputPrivate() + {} + +}; + +QInputChord::QInputChord(Qt3DCore::QNode *parent) + : Qt3DInput::QAbstractAggregateActionInput(*new QInputChordPrivate(), parent) +{ + +} + +QInputChord::~QInputChord() +{ + QNode::cleanup(); +} + + + +void QInputChord::copy(const Qt3DCore::QNode *ref) +{ + QAbstractAggregateActionInput::copy(ref); +} + +} // Qt3DInput + +QT_END_NAMESPACE diff --git a/src/input/frontend/qinputchord.h b/src/input/frontend/qinputchord.h new file mode 100644 index 000000000..ca537ba93 --- /dev/null +++ b/src/input/frontend/qinputchord.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DINPUT_QINPUTCHORD_H +#define QT3DINPUT_QINPUTCHORD_H + +#include <Qt3DInput/qt3dinput_global.h> +#include <Qt3DCore/qnode.h> +#include <Qt3DInput/qabstractaggregateactioninput.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QAbstractPhysicalDevice; +class QInputChordPrivate; + +class QT3DINPUTSHARED_EXPORT QInputChord : public Qt3DInput::QAbstractAggregateActionInput +{ + Q_OBJECT + +public: + explicit QInputChord(Qt3DCore::QNode *parent = Q_NULLPTR); + ~QInputChord(); + +protected: + void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; + +private: + Q_DECLARE_PRIVATE(QInputChord) + QT3D_CLONEABLE(QInputChord) +}; + +} // Qt3DInput + +QT_END_NAMESPACE + +#endif // QT3DINPUT_QINPUTCHORD_H diff --git a/src/input/frontend/qinputsequence.cpp b/src/input/frontend/qinputsequence.cpp new file mode 100644 index 000000000..e99f9a123 --- /dev/null +++ b/src/input/frontend/qinputsequence.cpp @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +****************************************************************************/ + +#include "qinputsequence.h" +#include <Qt3DCore/private/qnode_p.h> +#include <Qt3DInput/qabstractphysicaldevice.h> +#include <Qt3DInput/QAbstractAggregateActionInput> +#include <Qt3DInput/private/qabstractaggregateactioninput_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QInputSequencePrivate : public Qt3DInput::QAbstractAggregateActionInputPrivate +{ +public: + QInputSequencePrivate() + : Qt3DInput::QAbstractAggregateActionInputPrivate() + {} + +}; + +QInputSequence::QInputSequence(Qt3DCore::QNode *parent) + : Qt3DInput::QAbstractAggregateActionInput(*new QInputSequencePrivate(), parent) +{ + +} + +QInputSequence::~QInputSequence() +{ + QNode::cleanup(); +} + + + +void QInputSequence::copy(const Qt3DCore::QNode *ref) +{ + QAbstractAggregateActionInput::copy(ref); +} + +} // Qt3DInput + +QT_END_NAMESPACE diff --git a/src/input/frontend/qinputsequence.h b/src/input/frontend/qinputsequence.h new file mode 100644 index 000000000..3063c68e9 --- /dev/null +++ b/src/input/frontend/qinputsequence.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DINPUT_QINPUTSEQUENCE_H +#define QT3DINPUT_QINPUTSEQUENCE_H + +#include <Qt3DInput/qt3dinput_global.h> +#include <Qt3DCore/qnode.h> +#include <Qt3DInput/qabstractaggregateactioninput.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QAbstractPhysicalDevice; +class QInputSequencePrivate; + +class QT3DINPUTSHARED_EXPORT QInputSequence : public Qt3DInput::QAbstractAggregateActionInput +{ + Q_OBJECT + +public: + explicit QInputSequence(Qt3DCore::QNode *parent = Q_NULLPTR); + ~QInputSequence(); + +protected: + void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; + +private: + Q_DECLARE_PRIVATE(QInputSequence) + QT3D_CLONEABLE(QInputSequence) +}; + +} // Qt3DInput + +QT_END_NAMESPACE + +#endif // QT3DINPUT_QINPUTSEQUENCE_H |