diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-10-02 08:52:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-17 15:58:32 +0200 |
commit | fbfc8ffbf39e2e7a540d4d576ec61bea7db63416 (patch) | |
tree | 5df0b25a1fae3e88a538075c857e5cc3bcc18a03 /src/gui/kernel/qwindowsysteminterface.cpp | |
parent | 73e3d2f6cb002be4ce409c3738db74b61beb12f4 (diff) |
Implement native gestures on OS X.
Add QWindowSystemInterface::GestureEvent and
QNativeGestureEvent to QtGui. These events are copies
of Qt4's QNativeGestureEvent, where it was an implementation
detail of QGestureManager.
Add gesture message handlers to QNSView and bring
back the Mac gesture recognizers for QGestureManager.
Task-number: QTBUG-28126
Change-Id: I1304e09e776fa7c44d133d54ca8b895ca2f544c5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index d62330083e..902c32419d 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -669,6 +669,35 @@ void QWindowSystemInterface::handleTabletLeaveProximityEvent(int device, int poi handleTabletLeaveProximityEvent(time, device, pointerType, uid); } +#ifndef QT_NO_GESTURES +void QWindowSystemInterface::handleGestureEvent(QWindow *window, ulong timestamp, Qt::NativeGestureType type, + QPointF &local, QPointF &global) +{ + QWindowSystemInterfacePrivate::GestureEvent *e = + new QWindowSystemInterfacePrivate::GestureEvent(window, timestamp, type, local, global); + QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); +} + +void QWindowSystemInterface::handleGestureEventWithRealValue(QWindow *window, ulong timestamp, Qt::NativeGestureType type, + qreal value, QPointF &local, QPointF &global) +{ + QWindowSystemInterfacePrivate::GestureEvent *e = + new QWindowSystemInterfacePrivate::GestureEvent(window, timestamp, type, local, global); + e->realValue = value; + QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); +} + +void QWindowSystemInterface::handleGestureEventWithSequenceIdAndValue(QWindow *window, ulong timestamp, Qt::NativeGestureType type, + ulong sequenceId, quint64 value, QPointF &local, QPointF &global) +{ + QWindowSystemInterfacePrivate::GestureEvent *e = + new QWindowSystemInterfacePrivate::GestureEvent(window, timestamp, type, local, global); + e->sequenceId = sequenceId; + e->intValue = value; + QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); +} +#endif // QT_NO_GESTURES + void QWindowSystemInterface::handlePlatformPanelEvent(QWindow *w) { QWindowSystemInterfacePrivate::PlatformPanelEvent *e = |