summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_win.cpp
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@nokia.com>2010-06-02 07:35:14 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2010-06-02 07:37:03 (GMT)
commitf62926954a742990a33a54ad598de1af0989d92b (patch)
tree34a392cc5c8359eac142207c3c726294c514d822 /src/gui/kernel/qapplication_win.cpp
parent37a0291f932b0af0f6844898ccbce52415f0f179 (diff)
downloadQt-f62926954a742990a33a54ad598de1af0989d92b.zip
Qt-f62926954a742990a33a54ad598de1af0989d92b.tar.gz
Qt-f62926954a742990a33a54ad598de1af0989d92b.tar.bz2
Add a new qconfig feature GESTURES
Merge-request: 535 Reviewed-by: Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>
Diffstat (limited to 'src/gui/kernel/qapplication_win.cpp')
-rw-r--r--src/gui/kernel/qapplication_win.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 60fc5e1..c52fbdf 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -52,9 +52,11 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c
#include <windowsm.h>
#include <tpcshell.h>
#ifdef QT_WINCE_GESTURES
+#ifndef QT_NO_GESTURES
#include <gesture.h>
#endif
#endif
+#endif
#include "qapplication.h"
#include "qdesktopwidget.h"
@@ -198,6 +200,7 @@ struct SHRGINFO {
#define SPI_SETSIPINFO 224
#endif
+#ifndef QT_NO_GESTURES
typedef DWORD (API *AygRecognizeGesture)(SHRGINFO*);
static AygRecognizeGesture ptrRecognizeGesture = 0;
static bool aygResolved = false;
@@ -211,6 +214,7 @@ static void resolveAygLibs()
ptrRecognizeGesture = (AygRecognizeGesture) ayglib.resolve("SHRecognizeGesture");
}
}
+#endif // QT_NO_GESTURES
#endif
@@ -463,7 +467,9 @@ public:
bool translateConfigEvent(const MSG &msg);
bool translateCloseEvent(const MSG &msg);
bool translateTabletEvent(const MSG &msg, PACKET *localPacketBuf, int numPackets);
+#ifndef QT_NO_GESTURES
bool translateGestureEvent(const MSG &msg, const GESTUREINFO &gi);
+#endif
void repolishStyle(QStyle &style);
inline void showChildren(bool spontaneous) { d_func()->showChildren(spontaneous); }
inline void hideChildren(bool spontaneous) { d_func()->hideChildren(spontaneous); }
@@ -843,6 +849,7 @@ void qt_init(QApplicationPrivate *priv, int)
ptrSetProcessDPIAware();
#endif
+#ifndef QT_NO_GESTURES
priv->GetGestureInfo = 0;
priv->GetGestureExtraArgs = 0;
priv->CloseGestureInfoHandle = 0;
@@ -883,6 +890,7 @@ void qt_init(QApplicationPrivate *priv, int)
(PtrEndPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"),
"EndPanningFeedback");
#endif
+#endif // QT_NO_GESTURES
}
/*****************************************************************************
@@ -1667,12 +1675,14 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
shrg.ptDown.y = GET_Y_LPARAM(lParam);
shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
resolveAygLibs();
+#ifndef QT_NO_GESTURES
if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
if (QApplication::activePopupWidget())
QApplication::activePopupWidget()->close();
QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
result = qt_sendSpontaneousEvent(alienWidget, &e);
}
+#endif // QT_NO_GESTURES
}
}
}
@@ -2556,6 +2566,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
}
result = false;
break;
+#ifndef QT_NO_GESTURES
#if !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
case WM_GESTURE: {
GESTUREINFO gi;
@@ -2590,6 +2601,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
break;
}
#endif // !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
+#endif // QT_NO_GESTURES
#ifndef QT_NO_CURSOR
case WM_SETCURSOR: {
QCursor *ovr = QApplication::overrideCursor();
@@ -3825,6 +3837,7 @@ bool QETWidget::translateCloseEvent(const MSG &)
return d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent);
}
+#ifndef QT_NO_GESTURES
bool QETWidget::translateGestureEvent(const MSG &, const GESTUREINFO &gi)
{
const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
@@ -3863,7 +3876,7 @@ bool QETWidget::translateGestureEvent(const MSG &, const GESTUREINFO &gi)
qt_sendSpontaneousEvent(widget, &event);
return true;
}
-
+#endif // QT_NO_GESTURES
void QApplication::setCursorFlashTime(int msecs)
{