summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication_win.cpp')
-rw-r--r--src/gui/kernel/qapplication_win.cpp56
1 files changed, 21 insertions, 35 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index fb2837ecf9..0edb8fb417 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"
@@ -116,8 +118,6 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c
# include <winable.h>
#endif
-#include "private/qwinnativepangesturerecognizer_win_p.h"
-
#ifndef WM_TOUCH
# define WM_TOUCH 0x0240
@@ -198,6 +198,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 +212,7 @@ static void resolveAygLibs()
ptrRecognizeGesture = (AygRecognizeGesture) ayglib.resolve("SHRecognizeGesture");
}
}
+#endif // QT_NO_GESTURES
#endif
@@ -463,7 +465,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 +847,7 @@ void qt_init(QApplicationPrivate *priv, int)
ptrSetProcessDPIAware();
#endif
+#ifndef QT_NO_GESTURES
priv->GetGestureInfo = 0;
priv->GetGestureExtraArgs = 0;
priv->CloseGestureInfoHandle = 0;
@@ -883,6 +888,7 @@ void qt_init(QApplicationPrivate *priv, int)
(PtrEndPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"),
"EndPanningFeedback");
#endif
+#endif // QT_NO_GESTURES
}
/*****************************************************************************
@@ -1542,7 +1548,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
case WM_SETTINGCHANGE:
#ifdef Q_WS_WINCE
// CE SIP hide/show
- if (wParam == SPI_SETSIPINFO) {
+ if (qt_desktopWidget && wParam == SPI_SETSIPINFO) {
QResizeEvent re(QSize(0, 0), QSize(0, 0)); // Calculated by QDesktopWidget
QApplication::sendEvent(qt_desktopWidget, &re);
break;
@@ -1667,12 +1673,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
}
}
}
@@ -1936,6 +1944,8 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
QLocalePrivate::updateSystemPrivate();
if (!widget->testAttribute(Qt::WA_SetLocale))
widget->dptr()->setLocale_helper(QLocale(), true);
+ QEvent e(QEvent::LocaleChange);
+ QApplication::sendEvent(qApp, &e);
}
}
else if (msg.wParam == SPI_SETICONTITLELOGFONT) {
@@ -2475,7 +2485,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
QApplication::postEvent(widget, new QEvent(QEvent::Close));
else
#ifndef QT_NO_MENUBAR
- QMenuBar::wceCommands(LOWORD(wParam), (HWND) lParam);
+ QMenuBar::wceCommands(LOWORD(wParam));
#endif
result = true;
}
@@ -2554,6 +2564,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;
@@ -2588,6 +2599,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();
@@ -3823,6 +3835,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);
@@ -3861,7 +3874,7 @@ bool QETWidget::translateGestureEvent(const MSG &, const GESTUREINFO &gi)
qt_sendSpontaneousEvent(widget, &event);
return true;
}
-
+#endif // QT_NO_GESTURES
void QApplication::setCursorFlashTime(int msecs)
{
@@ -4051,36 +4064,9 @@ PtrCloseTouchInputHandle QApplicationPrivate::CloseTouchInputHandle = 0;
void QApplicationPrivate::initializeMultitouch_sys()
{
- static const IID QT_IID_IInkTablets = {0x112086D9, 0x7779, 0x4535, {0xA6, 0x99, 0x86, 0x2B, 0x43, 0xAC, 0x18, 0x63} };
- static const IID QT_IID_IInkTablet2 = {0x90c91ad2, 0xfa36, 0x49d6, {0x95, 0x16, 0xce, 0x8d, 0x57, 0x0f, 0x6f, 0x85} };
- static const CLSID QT_CLSID_InkTablets = {0x6E4FCB12, 0x510A, 0x4d40, {0x93, 0x04, 0x1D, 0xA1, 0x0A, 0xE9, 0x14, 0x7C} };
-
- IInkTablets *iInkTablets = 0;
- HRESULT hr = CoCreateInstance(QT_CLSID_InkTablets, NULL, CLSCTX_ALL, QT_IID_IInkTablets, (void**)&iInkTablets);
- if (SUCCEEDED(hr)) {
- long count = 0;
- iInkTablets->get_Count(&count);
- for (long i = 0; i < count; ++i) {
- IInkTablet *iInkTablet = 0;
- hr = iInkTablets->Item(i, &iInkTablet);
- if (FAILED(hr))
- continue;
- IInkTablet2 *iInkTablet2 = 0;
- hr = iInkTablet->QueryInterface(QT_IID_IInkTablet2, (void**)&iInkTablet2);
- iInkTablet->Release();
- if (FAILED(hr))
- continue;
- TabletDeviceKind kind;
- hr = iInkTablet2->get_DeviceKind(&kind);
- iInkTablet2->Release();
- if (FAILED(hr))
- continue;
- if (kind == TDK_Touch) {
- QApplicationPrivate::HasTouchSupport = true;
- break;
- }
- }
- iInkTablets->Release();
+ if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) {
+ static const int QT_SM_DIGITIZER = 94;
+ QApplicationPrivate::HasTouchSupport = GetSystemMetrics(QT_SM_DIGITIZER);
}
QLibrary library(QLatin1String("user32"));