diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-26 13:46:01 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2010-05-26 13:46:01 (GMT) |
commit | 4fa3766090972de9faf9c25d9cba6d5ab467abeb (patch) | |
tree | 8916e4dac3584bca1b7c9d994bc185270e52daba /src/gui/kernel/qwindowsysteminterface.h | |
parent | 8ace0f0b97a4b321037e034b35b6342cf0e779cf (diff) | |
download | Qt-4fa3766090972de9faf9c25d9cba6d5ab467abeb.zip Qt-4fa3766090972de9faf9c25d9cba6d5ab467abeb.tar.gz Qt-4fa3766090972de9faf9c25d9cba6d5ab467abeb.tar.bz2 |
touch interface for lighthouse plugins
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.h')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index e0c46d1..ca73305 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -75,6 +75,21 @@ public: static void handleWheelEvent(QWidget *w, ulong timestamp, const QPoint & local, const QPoint & global, int d, Qt::Orientation o); + struct TouchPoint { + int id; // for application use + bool isPrimary; // for application use + QPointF normalPosition; // touch device coordinates, (0 to 1, 0 to 1) + QRectF area; // the touched area, centered at position in screen coordinates + qreal pressure; // 0 to 1 + Qt::TouchPointStates state; //Qt::TouchPoint{Pressed|Moved|Stationary|Released} + }; + + static void handleTouchEvent(QWidget *w, QEvent::Type type, QTouchEvent::DeviceType devType, QList<struct TouchPoint> points) { + handleTouchEvent(w, eventTime.elapsed(), type, devType, points); + } + + static void handleTouchEvent(QWidget *w, ulong timestamp, QEvent::Type type, QTouchEvent::DeviceType devType, QList<struct TouchPoint> points); + // delivered directly by the plugin via spontaneous events static void handleGeometryChange(QWidget *w, const QRect &newRect); static void handleCloseEvent(QWidget *w); @@ -121,6 +136,14 @@ public: Qt::KeyboardModifiers modifiers; }; + class TouchEvent : public UserEvent { + public: + TouchEvent(QWidget *w, ulong time, QEvent::Type t, QTouchEvent::DeviceType d, QList<struct TouchPoint> p) + :UserEvent(w, time, t) { devType = d; points = p; } + QTouchEvent::DeviceType devType; + QList<struct TouchPoint> points; + }; + private: static QTime eventTime; |