diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-08-03 13:04:43 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-08-04 14:22:43 (GMT) |
commit | fbee62af06ebe2c8cf6da1cc18a665c69c64eff7 (patch) | |
tree | 19557818b61c744a0513bf11f1f7ef8d465f62d6 /src/gui | |
parent | 627c5c865d77cca1f0d6508f8facfe6c0bf4d363 (diff) | |
download | Qt-fbee62af06ebe2c8cf6da1cc18a665c69c64eff7.zip Qt-fbee62af06ebe2c8cf6da1cc18a665c69c64eff7.tar.gz Qt-fbee62af06ebe2c8cf6da1cc18a665c69c64eff7.tar.bz2 |
Renamed internal WinGesture event to NativeGesture.
It will also be used on Mac, so it doesn't make sense to keep it windows
specific.
Reviewed-by: trustme
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_win.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qevent_p.h | 13 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 16 |
5 files changed, 25 insertions, 17 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index e210556..c24ff49 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -4052,7 +4052,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) touchEvent->setAccepted(eventAccepted); break; } - case QEvent::WinGesture: + case QEvent::NativeGesture: { // only propagate the first gesture event (after the GID_BEGIN) QWidget *w = static_cast<QWidget *>(receiver); diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index d5c820c..3b5c0c3 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -3735,7 +3735,7 @@ bool QETWidget::translateGestureEvent(const MSG &msg) alienWidget = 0; QWidget *widget = alienWidget ? alienWidget : this; - QWinGestureEvent event; + QNativeGestureEvent event; event.sequenceId = gi.dwSequenceID; event.position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); if (bResult) { @@ -3744,13 +3744,13 @@ bool QETWidget::translateGestureEvent(const MSG &msg) // we are not interested in this type of event. break; case GID_END: - event.gestureType = QWinGestureEvent::GestureEnd; + event.gestureType = QNativeGestureEvent::GestureEnd; break; case GID_ZOOM: - event.gestureType = QWinGestureEvent::Pinch; + event.gestureType = QNativeGestureEvent::Pinch; break; case GID_PAN: - event.gestureType = QWinGestureEvent::Pan; + event.gestureType = QNativeGestureEvent::Pan; break; case GID_ROTATE: case GID_TWOFINGERTAP: @@ -3758,7 +3758,7 @@ bool QETWidget::translateGestureEvent(const MSG &msg) default: break; } - if (event.gestureType != QWinGestureEvent::None) + if (event.gestureType != QNativeGestureEvent::None) qt_sendSpontaneousEvent(widget, &event); } else { DWORD dwErr = GetLastError(); diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index bc3633c..0fc36e7 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -49,7 +49,6 @@ #include "qmime.h" #include "qdnd_p.h" #include "qevent_p.h" -#include "qgesture.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index 67441ea..940e587 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -119,7 +119,7 @@ public: qreal pressure; }; -class QWinGestureEvent : public QEvent +class QNativeGestureEvent : public QEvent { public: enum Type { @@ -129,10 +129,19 @@ public: Pinch }; - QWinGestureEvent() : QEvent(QEvent::WinGesture), gestureType(None), sequenceId(0) { } + QNativeGestureEvent() + : QEvent(QEvent::NativeGesture), gestureType(None) +#ifdef Q_WS_WIN + , sequenceId(0) +#endif + { + } + Type gestureType; +#ifdef Q_WS_WIN QPoint position; ulong sequenceId; +#endif }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 43ac37d..5400146 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7941,8 +7941,8 @@ bool QWidget::event(QEvent *event) break; } #ifdef Q_WS_WIN - case QEvent::WinGesture: { - QWinGestureEvent *ev = static_cast<QWinGestureEvent*>(event); + case QEvent::NativeGesture: { + QNativeGestureEvent *ev = static_cast<QNativeGestureEvent*>(event); QApplicationPrivate *qAppPriv = qApp->d_func(); QApplicationPrivate::WidgetStandardGesturesMap::iterator it; it = qAppPriv->widgetGestures.find(this); @@ -7950,15 +7950,15 @@ bool QWidget::event(QEvent *event) Qt::GestureState state = Qt::GestureUpdated; if (qAppPriv->lastGestureId == 0) state = Qt::GestureStarted; - QWinGestureEvent::Type type = ev->gestureType; - if (ev->gestureType == QWinGestureEvent::GestureEnd) { - type = (QWinGestureEvent::Type)qAppPriv->lastGestureId; + QNativeGestureEvent::Type type = ev->gestureType; + if (ev->gestureType == QNativeGestureEvent::GestureEnd) { + type = (QNativeGestureEvent::Type)qAppPriv->lastGestureId; state = Qt::GestureFinished; } QGesture *gesture = 0; switch (type) { - case QWinGestureEvent::Pan: { + case QNativeGestureEvent::Pan: { QPanGesture *pan = it.value().pan; gesture = pan; if (state == Qt::GestureStarted) { @@ -7970,7 +7970,7 @@ bool QWidget::event(QEvent *event) gesture->setPos(ev->position); break; } - case QWinGestureEvent::Pinch: + case QNativeGestureEvent::Pinch: break; default: break; @@ -7984,7 +7984,7 @@ bool QWidget::event(QEvent *event) emit gesture->finished(); event->accept(); } - if (ev->gestureType == QWinGestureEvent::GestureEnd) { + if (ev->gestureType == QNativeGestureEvent::GestureEnd) { qAppPriv->lastGestureId = 0; } else { qAppPriv->lastGestureId = type; |