diff options
Diffstat (limited to 'src/plugins/generic/tuiotouch')
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiocursor_p.h | 16 | ||||
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiohandler.cpp | 13 | ||||
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiotoken_p.h | 20 |
3 files changed, 24 insertions, 25 deletions
diff --git a/src/plugins/generic/tuiotouch/qtuiocursor_p.h b/src/plugins/generic/tuiotouch/qtuiocursor_p.h index 46134e6f3f..b8301bcf2c 100644 --- a/src/plugins/generic/tuiotouch/qtuiocursor_p.h +++ b/src/plugins/generic/tuiotouch/qtuiocursor_p.h @@ -55,7 +55,7 @@ public: , m_vx(0) , m_vy(0) , m_acceleration(0) - , m_state(Qt::TouchPointPressed) + , m_state(QEventPoint::State::Pressed) { } @@ -63,9 +63,9 @@ public: void setX(float x) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_x + 2.0, x + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_x = x; } @@ -73,9 +73,9 @@ public: void setY(float y) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_y + 2.0, y + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_y = y; } @@ -90,8 +90,8 @@ public: void setAcceleration(float acceleration) { m_acceleration = acceleration; } float acceleration() const { return m_acceleration; } - void setState(const Qt::TouchPointState &state) { m_state = state; } - Qt::TouchPointState state() const { return m_state; } + void setState(const QEventPoint::State &state) { m_state = state; } + QEventPoint::State state() const { return m_state; } private: int m_id; @@ -100,7 +100,7 @@ private: float m_vx; float m_vy; float m_acceleration; - Qt::TouchPointState m_state; + QEventPoint::State m_state; }; Q_DECLARE_TYPEINFO(QTuioCursor, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible, m_state is = 1, not 0. diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp index 260dc883af..f61bd906bf 100644 --- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp +++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp @@ -260,12 +260,12 @@ void QTuioHandler::process2DCurAlive(const QOscMessage &message) if (!oldActiveCursors.contains(cursorId)) { // newly active QTuioCursor cursor(cursorId); - cursor.setState(Qt::TouchPointPressed); + cursor.setState(QEventPoint::State::Pressed); newActiveCursors.insert(cursorId, cursor); } else { // we already know about it, remove it so it isn't marked as released QTuioCursor cursor = oldActiveCursors.value(cursorId); - cursor.setState(Qt::TouchPointStationary); // position change in SET will update if needed + cursor.setState(QEventPoint::State::Stationary); // position change in SET will update if needed newActiveCursors.insert(cursorId, cursor); oldActiveCursors.remove(cursorId); } @@ -378,7 +378,7 @@ void QTuioHandler::process2DCurFseq(const QOscMessage &message) for (const QTuioCursor &tc : qAsConst(m_deadCursors)) { QWindowSystemInterface::TouchPoint tp = cursorToTouchPoint(tc, win); - tp.state = Qt::TouchPointReleased; + tp.state = QEventPoint::State::Released; tpl.append(tp); } QWindowSystemInterface::handleTouchEvent(win, m_device, tpl); @@ -425,12 +425,12 @@ void QTuioHandler::process2DObjAlive(const QOscMessage &message) if (!oldActiveTokens.contains(sessionId)) { // newly active QTuioToken token(sessionId); - token.setState(Qt::TouchPointPressed); + token.setState(QEventPoint::State::Pressed); newActiveTokens.insert(sessionId, token); } else { // we already know about it, remove it so it isn't marked as released QTuioToken token = oldActiveTokens.value(sessionId); - token.setState(Qt::TouchPointStationary); // position change in SET will update if needed + token.setState(QEventPoint::State::Stationary); // position change in SET will update if needed newActiveTokens.insert(sessionId, token); oldActiveTokens.remove(sessionId); } @@ -511,7 +511,6 @@ QWindowSystemInterface::TouchPoint QTuioHandler::tokenToTouchPoint(const QTuioTo QWindowSystemInterface::TouchPoint tp; tp.id = tc.id(); tp.uniqueId = tc.classId(); // TODO TUIO 2.0: populate a QVariant, and register the mapping from int to arbitrary UID data - tp.flags = QTouchEvent::TouchPoint::Token; tp.pressure = 1.0f; tp.normalPosition = QPointF(tc.x(), tc.y()); @@ -552,7 +551,7 @@ void QTuioHandler::process2DObjFseq(const QOscMessage &message) for (const QTuioToken & t : qAsConst(m_deadTokens)) { QWindowSystemInterface::TouchPoint tp = tokenToTouchPoint(t, win); - tp.state = Qt::TouchPointReleased; + tp.state = QEventPoint::State::Released; tp.velocity = QVector2D(); tpl.append(tp); } diff --git a/src/plugins/generic/tuiotouch/qtuiotoken_p.h b/src/plugins/generic/tuiotouch/qtuiotoken_p.h index b784190d53..0c72436c4c 100644 --- a/src/plugins/generic/tuiotouch/qtuiotoken_p.h +++ b/src/plugins/generic/tuiotouch/qtuiotoken_p.h @@ -66,7 +66,7 @@ public: , m_angle(0) , m_angularVelocity(0) , m_angularAcceleration(0) - , m_state(Qt::TouchPointPressed) + , m_state(QEventPoint::State::Pressed) { } @@ -77,9 +77,9 @@ public: void setX(float x) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_x + 2.0, x + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_x = x; } @@ -87,9 +87,9 @@ public: void setY(float y) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_y + 2.0, y + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_y = y; } @@ -109,9 +109,9 @@ public: { if (angle > M_PI) angle = angle - M_PI * 2.0; // zero is pointing upwards, and is the default; but we want to have negative angles when rotating left - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_angle + 2.0, angle + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_angle = angle; } @@ -122,8 +122,8 @@ public: float angularAcceleration() const { return m_angularAcceleration; } void setAngularAcceleration(float angularAcceleration) { m_angularAcceleration = angularAcceleration; } - void setState(const Qt::TouchPointState &state) { m_state = state; } - Qt::TouchPointState state() const { return m_state; } + void setState(const QEventPoint::State &state) { m_state = state; } + QEventPoint::State state() const { return m_state; } private: int m_id; // sessionID, temporary object ID @@ -136,7 +136,7 @@ private: float m_angle; float m_angularVelocity; float m_angularAcceleration; - Qt::TouchPointState m_state; + QEventPoint::State m_state; }; Q_DECLARE_TYPEINFO(QTuioToken, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible: m_id, m_classId == -1 |