From 39dece190a3954d0b1b0fca1e41bd826df44e4cf Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 1 Dec 2015 12:14:55 +0000 Subject: Rename QActionHandler to QAxisActionhandler No need to have two classes for the handlers. Change-Id: Ia174502f21b5392179774ce8e0d8f2cd228a7ea6 Reviewed-by: Paul Lemire --- src/input/frontend/frontend.pri | 6 +- src/input/frontend/qactionhandler.cpp | 94 ------------------------------- src/input/frontend/qactionhandler.h | 83 --------------------------- src/input/frontend/qactionhandler_p.h | 73 ------------------------ src/input/frontend/qaxisactionhandler.cpp | 94 +++++++++++++++++++++++++++++++ src/input/frontend/qaxisactionhandler.h | 83 +++++++++++++++++++++++++++ src/input/frontend/qaxisactionhandler_p.h | 73 ++++++++++++++++++++++++ 7 files changed, 253 insertions(+), 253 deletions(-) delete mode 100644 src/input/frontend/qactionhandler.cpp delete mode 100644 src/input/frontend/qactionhandler.h delete mode 100644 src/input/frontend/qactionhandler_p.h create mode 100644 src/input/frontend/qaxisactionhandler.cpp create mode 100644 src/input/frontend/qaxisactionhandler.h create mode 100644 src/input/frontend/qaxisactionhandler_p.h (limited to 'src/input/frontend') diff --git a/src/input/frontend/frontend.pri b/src/input/frontend/frontend.pri index 8c9a249d6..ee06b732b 100644 --- a/src/input/frontend/frontend.pri +++ b/src/input/frontend/frontend.pri @@ -22,8 +22,8 @@ HEADERS += \ $$PWD/qinputdeviceintegrationfactory_p.h \ $$PWD/qaxissetting.h \ $$PWD/qabstractphysicaldevice_p.h \ - $$PWD/qactionhandler.h \ - $$PWD/qactionhandler_p.h + $$PWD/qaxisactionhandler_p.h \ + $$PWD/qaxisactionhandler.h SOURCES += \ $$PWD/qinputaspect.cpp \ @@ -43,6 +43,6 @@ SOURCES += \ $$PWD/qabstractphysicaldevice.cpp \ $$PWD/qinputdeviceintegrationfactory.cpp \ $$PWD/qaxissetting.cpp \ - $$PWD/qactionhandler.cpp + $$PWD/qaxisactionhandler.cpp INCLUDEPATH += $$PWD diff --git a/src/input/frontend/qactionhandler.cpp b/src/input/frontend/qactionhandler.cpp deleted file mode 100644 index a99d1eff3..000000000 --- a/src/input/frontend/qactionhandler.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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 "qactionhandler.h" -#include "qactionhandler_p.h" - -#include - -QT_BEGIN_NAMESPACE - -namespace Qt3DInput { - -QActionHandlerPrivate::QActionHandlerPrivate() - : Qt3DCore::QComponentPrivate() - , m_logicalDevice(Q_NULLPTR) -{ -} - -QActionHandler::QActionHandler(Qt3DCore::QNode *parent) - : Qt3DCore::QComponent(*new QActionHandlerPrivate, parent) -{ -} - -QActionHandler::QActionHandler(QActionHandlerPrivate &dd, Qt3DCore::QNode *parent) - : Qt3DCore::QComponent(dd, parent) -{ - -} - -QActionHandler::~QActionHandler() -{ - QNode::cleanup(); -} - -Qt3DInput::QLogicalDevice *QActionHandler::logicalDevice() const -{ - Q_D(const QActionHandler); - return d->m_logicalDevice; -} - -void QActionHandler::setLogicalDevice(Qt3DInput::QLogicalDevice *logicalDevice) -{ - Q_D(QActionHandler); - if (d->m_logicalDevice == logicalDevice) - return; - - d->m_logicalDevice = logicalDevice; - emit logicalDeviceChanged(logicalDevice); -} - -void QActionHandler::copy(const QNode *ref) -{ - QComponent::copy(ref); - const QActionHandler *component = static_cast(ref); - d_func()->m_logicalDevice = qobject_cast(QNode::clone(component->d_func()->m_logicalDevice)); -} - -QT_END_NAMESPACE - -} // namespace Qt3DInput - diff --git a/src/input/frontend/qactionhandler.h b/src/input/frontend/qactionhandler.h deleted file mode 100644 index 6034b6eae..000000000 --- a/src/input/frontend/qactionhandler.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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_QACTIONHANDLER_H -#define QT3DINPUT_QACTIONHANDLER_H - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace Qt3DInput { - -class QActionHandlerPrivate; -class QLogicalDevice; - -class QT3DINPUTSHARED_EXPORT QActionHandler : public Qt3DCore::QComponent -{ - Q_OBJECT - Q_PROPERTY(Qt3DInput::QLogicalDevice* logicalDevice READ logicalDevice WRITE setLogicalDevice NOTIFY logicalDeviceChanged) - -public: - QActionHandler(Qt3DCore::QNode *parent = Q_NULLPTR); - ~QActionHandler(); - - Qt3DInput::QLogicalDevice *logicalDevice() const; - -public Q_SLOTS: - void setLogicalDevice(Qt3DInput::QLogicalDevice *logicalDevice); - -Q_SIGNALS: - void logicalDeviceChanged(Qt3DInput::QLogicalDevice *logicalDevice); - - void actionStarted(const QString &name); - void actionFinished(const QString &name); - -protected: - Q_DECLARE_PRIVATE(QActionHandler) - QActionHandler(QActionHandlerPrivate &dd, Qt3DCore::QNode *parent = 0); - void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; - -private: - QT3D_CLONEABLE(QActionHandler) -}; - -} // namespace Qt3DInput - -QT_END_NAMESPACE - -#endif // QT3DINPUT_QACTIONHANDLER_H diff --git a/src/input/frontend/qactionhandler_p.h b/src/input/frontend/qactionhandler_p.h deleted file mode 100644 index 27ac1177e..000000000 --- a/src/input/frontend/qactionhandler_p.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 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_QACTIONHANDLER_P_H -#define QT3DINPUT_QACTIONHANDLER_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 - -QT_BEGIN_NAMESPACE - -namespace Qt3DInput { - -class QLogicalDevice; - -class QActionHandlerPrivate : public Qt3DCore::QComponentPrivate -{ -public: - QActionHandlerPrivate(); - - QLogicalDevice *m_logicalDevice; -}; - -} - - -QT_END_NAMESPACE - -#endif // QT3DINPUT_QACTIONHANDLER_P_H - diff --git a/src/input/frontend/qaxisactionhandler.cpp b/src/input/frontend/qaxisactionhandler.cpp new file mode 100644 index 000000000..8f493cf9e --- /dev/null +++ b/src/input/frontend/qaxisactionhandler.cpp @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2015 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 "qaxisactionhandler.h" +#include "qaxisactionhandler_p.h" + +#include + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +QAxisActionHandlerPrivate::QAxisActionHandlerPrivate() + : Qt3DCore::QComponentPrivate() + , m_logicalDevice(Q_NULLPTR) +{ +} + +QAxisActionHandler::QAxisActionHandler(Qt3DCore::QNode *parent) + : Qt3DCore::QComponent(*new QAxisActionHandlerPrivate, parent) +{ +} + +QAxisActionHandler::QAxisActionHandler(QAxisActionHandlerPrivate &dd, Qt3DCore::QNode *parent) + : Qt3DCore::QComponent(dd, parent) +{ + +} + +QAxisActionHandler::~QAxisActionHandler() +{ + QNode::cleanup(); +} + +Qt3DInput::QLogicalDevice *QAxisActionHandler::logicalDevice() const +{ + Q_D(const QAxisActionHandler); + return d->m_logicalDevice; +} + +void QAxisActionHandler::setLogicalDevice(Qt3DInput::QLogicalDevice *logicalDevice) +{ + Q_D(QAxisActionHandler); + if (d->m_logicalDevice == logicalDevice) + return; + + d->m_logicalDevice = logicalDevice; + emit logicalDeviceChanged(logicalDevice); +} + +void QAxisActionHandler::copy(const QNode *ref) +{ + QComponent::copy(ref); + const QAxisActionHandler *component = static_cast(ref); + d_func()->m_logicalDevice = qobject_cast(QNode::clone(component->d_func()->m_logicalDevice)); +} + +QT_END_NAMESPACE + +} // namespace Qt3DInput + diff --git a/src/input/frontend/qaxisactionhandler.h b/src/input/frontend/qaxisactionhandler.h new file mode 100644 index 000000000..e77e088b2 --- /dev/null +++ b/src/input/frontend/qaxisactionhandler.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2015 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_QAXISACTIONHANDLER_H +#define QT3DINPUT_QAXISACTIONHANDLER_H + +#include +#include + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QAxisActionHandlerPrivate; +class QLogicalDevice; + +class QT3DINPUTSHARED_EXPORT QAxisActionHandler : public Qt3DCore::QComponent +{ + Q_OBJECT + Q_PROPERTY(Qt3DInput::QLogicalDevice* logicalDevice READ logicalDevice WRITE setLogicalDevice NOTIFY logicalDeviceChanged) + +public: + QAxisActionHandler(Qt3DCore::QNode *parent = Q_NULLPTR); + ~QAxisActionHandler(); + + Qt3DInput::QLogicalDevice *logicalDevice() const; + +public Q_SLOTS: + void setLogicalDevice(Qt3DInput::QLogicalDevice *logicalDevice); + +Q_SIGNALS: + void logicalDeviceChanged(Qt3DInput::QLogicalDevice *logicalDevice); + + void actionStarted(const QString &name); + void actionFinished(const QString &name); + +protected: + Q_DECLARE_PRIVATE(QAxisActionHandler) + QAxisActionHandler(QAxisActionHandlerPrivate &dd, Qt3DCore::QNode *parent = 0); + void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; + +private: + QT3D_CLONEABLE(QAxisActionHandler) +}; + +} // namespace Qt3DInput + +QT_END_NAMESPACE + +#endif // QT3DINPUT_QAXISACTIONHANDLER_H diff --git a/src/input/frontend/qaxisactionhandler_p.h b/src/input/frontend/qaxisactionhandler_p.h new file mode 100644 index 000000000..9b97a51df --- /dev/null +++ b/src/input/frontend/qaxisactionhandler_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2015 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_QACTIONHANDLER_P_H +#define QT3DINPUT_QACTIONHANDLER_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 + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QLogicalDevice; + +class QAxisActionHandlerPrivate : public Qt3DCore::QComponentPrivate +{ +public: + QAxisActionHandlerPrivate(); + + QLogicalDevice *m_logicalDevice; +}; + +} + + +QT_END_NAMESPACE + +#endif // QT3DINPUT_QACTIONHANDLER_P_H + -- cgit v1.2.3