From fbfc8ffbf39e2e7a540d4d576ec61bea7db63416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 2 Oct 2013 08:52:26 +0200 Subject: 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 Reviewed-by: Gunnar Sletta --- src/gui/kernel/qwindowsysteminterface_p.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gui/kernel/qwindowsysteminterface_p.h') diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index 46479701cc..03e2d420f0 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -91,6 +91,7 @@ public: PlatformPanel = UserInputEvent | 0x17, ContextMenu = UserInputEvent | 0x18, EnterWhatsThisMode = UserInputEvent | 0x19, + Gesture = UserInputEvent | 0x1a, ApplicationStateChanged = 0x19, FlushEvents = 0x20, WindowScreenChanged = 0x21 @@ -398,6 +399,21 @@ public: }; #endif + class GestureEvent : public InputEvent { + public: + GestureEvent(QWindow *window, ulong time, Qt::NativeGestureType type, QPointF pos, QPointF globalPos) + : InputEvent(window, time, Gesture, Qt::NoModifier), type(type), pos(pos), globalPos(globalPos), + realValue(0), sequenceId(0), intValue(0) { } + Qt::NativeGestureType type; + QPointF pos; + QPointF globalPos; + // Mac + qreal realValue; + // Windows + ulong sequenceId; + quint64 intValue; + }; + class WindowSystemEventList { QList impl; mutable QMutex mutex; -- cgit v1.2.3