summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-10 11:26:27 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-11-14 18:22:01 +0000
commit08a4b7f74507be7aa9dc09a9234d3bc83d4ed908 (patch)
treecacc8ae29466661e5a99093c4034d49cd6433a07 /src
parent8ff36d48978cbdc848053338a7cec3d990da4ff2 (diff)
Windows: Move GUI event dispatcher to QtPlatformSupport.
This makes it possible to reuse it for the minimalegl QPA plugin. Change-Id: I1c3dbaf67f32294a5d0e03cc1eb8557049b810a5 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/eventdispatchers/eventdispatchers.pri6
-rw-r--r--src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp (renamed from src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp)58
-rw-r--r--src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h (renamed from src/plugins/platforms/windows/qwindowsguieventdispatcher.h)11
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp2
-rw-r--r--src/plugins/platforms/windows/windows.pri2
8 files changed, 50 insertions, 39 deletions
diff --git a/src/platformsupport/eventdispatchers/eventdispatchers.pri b/src/platformsupport/eventdispatchers/eventdispatchers.pri
index 6e16a46b34..a0b37cae1a 100644
--- a/src/platformsupport/eventdispatchers/eventdispatchers.pri
+++ b/src/platformsupport/eventdispatchers/eventdispatchers.pri
@@ -6,6 +6,12 @@ SOURCES +=\
HEADERS +=\
$$PWD/qunixeventdispatcher_qpa_p.h\
$$PWD/qgenericunixeventdispatcher_p.h\
+} else: win32 {
+SOURCES +=\
+ $$PWD/qwindowsguieventdispatcher.cpp
+
+HEADERS +=\
+ $$PWD/qwindowsguieventdispatcher_p.h
}
contains(QT_CONFIG, glib) {
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp
index 0bfa0239aa..f57d16f51d 100644
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
+++ b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher.cpp
@@ -32,17 +32,13 @@
**
****************************************************************************/
-#include "qwindowsguieventdispatcher.h"
-#include "qwindowscontext.h"
+#include "qwindowsguieventdispatcher_p.h"
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/QCoreApplication>
-#include <QtCore/QStack>
#include <QtCore/QDebug>
-#include <windowsx.h>
-
QT_BEGIN_NAMESPACE
/*!
@@ -69,11 +65,7 @@ bool QWindowsGuiEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags fl
{
const QEventLoop::ProcessEventsFlags oldFlags = m_flags;
m_flags = flags;
- if (QWindowsContext::verbose > 2 && lcQpaEvents().isDebugEnabled())
- qCDebug(lcQpaEvents) << '>' << __FUNCTION__ << objectName() << flags;
const bool rc = QEventDispatcherWin32::processEvents(flags);
- if (QWindowsContext::verbose > 2 && lcQpaEvents().isDebugEnabled())
- qCDebug(lcQpaEvents) << '<' << __FUNCTION__ << "returns" << rc;
m_flags = oldFlags;
return rc;
}
@@ -100,10 +92,6 @@ messageDebugEntries[] = {
{WM_DESTROY, "WM_DESTROY", true},
{WM_MOVE, "WM_MOVE", true},
{WM_SIZE, "WM_SIZE", true},
- {WM_MOUSEACTIVATE,"WM_MOUSEACTIVATE", true},
- {WM_CHILDACTIVATE, "WM_CHILDACTIVATE", true},
- {WM_PARENTNOTIFY, "WM_PARENTNOTIFY", true},
- {WM_ENTERIDLE, "WM_ENTERIDLE", false},
{WM_GETICON, "WM_GETICON", false},
{WM_KEYDOWN, "WM_KEYDOWN", true},
{WM_SYSKEYDOWN, "WM_SYSKEYDOWN", true},
@@ -119,16 +107,13 @@ messageDebugEntries[] = {
{WM_CHAR, "WM_CHAR", true},
{WM_DEADCHAR, "WM_DEADCHAR", true},
{WM_ACTIVATE, "WM_ACTIVATE", true},
- {WM_GETMINMAXINFO, "WM_GETMINMAXINFO", true},
{WM_SETFOCUS, "WM_SETFOCUS", true},
{WM_KILLFOCUS, "WM_KILLFOCUS", true},
{WM_ENABLE, "WM_ENABLE", true},
{WM_SHOWWINDOW, "WM_SHOWWINDOW", true},
- {WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
{WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED", true},
{WM_SETCURSOR, "WM_SETCURSOR", false},
{WM_GETFONT, "WM_GETFONT", true},
- {WM_NCMOUSEMOVE, "WM_NCMOUSEMOVE", true},
{WM_LBUTTONDOWN, "WM_LBUTTONDOWN", true},
{WM_LBUTTONUP, "WM_LBUTTONUP", true},
{WM_LBUTTONDBLCLK, "WM_LBUTTONDBLCLK", true},
@@ -143,18 +128,6 @@ messageDebugEntries[] = {
{WM_XBUTTONUP, "WM_XBUTTONUP", true},
{WM_XBUTTONDBLCLK, "WM_XBUTTONDBLCLK", true},
{WM_MOUSEHWHEEL, "WM_MOUSEHWHEEL", true},
- {WM_NCCREATE, "WM_NCCREATE", true},
- {WM_NCCALCSIZE, "WM_NCCALCSIZE", true},
- {WM_NCACTIVATE, "WM_NCACTIVATE", true},
- {WM_NCMOUSELEAVE, "WM_NCMOUSELEAVE", true},
- {WM_NCLBUTTONDOWN, "WM_NCLBUTTONDOWN", true},
- {WM_NCLBUTTONUP, "WM_NCLBUTTONUP", true},
- {WM_ACTIVATEAPP, "WM_ACTIVATEAPP", true},
- {WM_NCPAINT, "WM_NCPAINT", true},
- {WM_ERASEBKGND, "WM_ERASEBKGND", true},
- {WM_MOUSEMOVE, "WM_MOUSEMOVE", true},
- {WM_MOUSELEAVE, "WM_MOUSELEAVE", true},
- {WM_NCHITTEST, "WM_NCHITTEST", false},
{WM_IME_SETCONTEXT, "WM_IME_SETCONTEXT", true},
{WM_INPUTLANGCHANGE, "WM_INPUTLANGCHANGE", true},
{WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
@@ -163,9 +136,6 @@ messageDebugEntries[] = {
#endif
{WM_IME_SETCONTEXT, "WM_IME_SETCONTEXT", true},
{WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
- {WM_TOUCH, "WM_TOUCH", true},
- {WM_CHANGECBCHAIN, "WM_CHANGECBCHAIN", true},
- {WM_DRAWCLIPBOARD, "WM_DRAWCLIPBOARD", true},
{WM_RENDERFORMAT, "WM_RENDERFORMAT", true},
{WM_RENDERALLFORMATS, "WM_RENDERALLFORMATS", true},
{WM_DESTROYCLIPBOARD, "WM_DESTROYCLIPBOARD", true},
@@ -179,7 +149,33 @@ messageDebugEntries[] = {
{WM_QUERYENDSESSION, "WM_QUERYENDSESSION", true},
{WM_ENDSESSION, "WM_ENDSESSION", true},
#endif
+#ifndef Q_OS_WINCE
+ {WM_MOUSEACTIVATE,"WM_MOUSEACTIVATE", true},
+ {WM_CHILDACTIVATE, "WM_CHILDACTIVATE", true},
+ {WM_PARENTNOTIFY, "WM_PARENTNOTIFY", true},
+ {WM_ENTERIDLE, "WM_ENTERIDLE", false},
+ {WM_GETMINMAXINFO, "WM_GETMINMAXINFO", true},
+ {WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
+ {WM_NCCREATE, "WM_NCCREATE", true},
+ {WM_NCCALCSIZE, "WM_NCCALCSIZE", true},
+ {WM_NCACTIVATE, "WM_NCACTIVATE", true},
+ {WM_NCMOUSEMOVE, "WM_NCMOUSEMOVE", true},
+ {WM_NCMOUSELEAVE, "WM_NCMOUSELEAVE", true},
+ {WM_NCLBUTTONDOWN, "WM_NCLBUTTONDOWN", true},
+ {WM_NCLBUTTONUP, "WM_NCLBUTTONUP", true},
+ {WM_ACTIVATEAPP, "WM_ACTIVATEAPP", true},
+ {WM_NCPAINT, "WM_NCPAINT", true},
+ {WM_ERASEBKGND, "WM_ERASEBKGND", true},
+ {WM_MOUSEMOVE, "WM_MOUSEMOVE", true},
+ {WM_MOUSELEAVE, "WM_MOUSELEAVE", true},
+ {WM_NCHITTEST, "WM_NCHITTEST", false},
+#ifdef WM_TOUCH
+ {WM_TOUCH, "WM_TOUCH", true},
+#endif
+ {WM_CHANGECBCHAIN, "WM_CHANGECBCHAIN", true},
{WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE", true},
+ {WM_DRAWCLIPBOARD, "WM_DRAWCLIPBOARD", true},
+#endif // !Q_OS_WINCE
{WM_THEMECHANGED, "WM_THEMECHANGED", true}
};
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.h b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h
index 3389139461..1e9c906cc8 100644
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.h
+++ b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h
@@ -34,7 +34,16 @@
#ifndef QWINDOWSGUIEVENTDISPATCHER_H
#define QWINDOWSGUIEVENTDISPATCHER_H
-#include "qtwindows_additional.h"
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of the QLibrary class. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
#include <QtCore/private/qeventdispatcher_win_p.h>
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp
index 8936b96b1f..25cfd12b44 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.cpp
+++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp
@@ -35,7 +35,6 @@
#include "qwindowscontext.h"
#include "qwindowsole.h"
#include "qwindowsmime.h"
-#include "qwindowsguieventdispatcher.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
@@ -48,6 +47,8 @@
#include <QtCore/QVariant>
#include <QtCore/QUrl>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+
QT_BEGIN_NAMESPACE
static const char formatTextPlainC[] = "text/plain";
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 02accfae01..5cda6379de 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -36,7 +36,6 @@
#include "qwindowsintegration.h"
#include "qwindowswindow.h"
#include "qwindowskeymapper.h"
-#include "qwindowsguieventdispatcher.h"
#include "qwindowsmousehandler.h"
#include "qtwindowsglobal.h"
#include "qwindowsmime.h"
@@ -66,6 +65,8 @@
#include <QtCore/QScopedArrayPointer>
#include <QtCore/private/qsystemlibrary_p.h>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+
#include <stdlib.h>
#include <stdio.h>
#include <windowsx.h>
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 36ec9ebc92..797a96cda7 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -44,7 +44,6 @@
# include "qwindowsfontdatabase_ft.h"
#endif
#include "qwindowsfontdatabase.h"
-#include "qwindowsguieventdispatcher.h"
#ifndef QT_NO_CLIPBOARD
# include "qwindowsclipboard.h"
# ifndef QT_NO_DRAGANDDROP
@@ -66,7 +65,8 @@
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/qpa/qplatforminputcontextfactory_p.h>
-#include <QtCore/private/qeventdispatcher_win_p.h>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+
#include <QtCore/QDebug>
#include <QtCore/QVariant>
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index f8e2ded228..4c0b94e6e7 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -35,7 +35,6 @@
#include "qwindowscontext.h"
#include "qwindowsintegration.h"
#include "qwindowswindow.h"
-#include "qwindowsguieventdispatcher.h"
#include "qwindowsinputcontext.h"
#include <QtGui/QWindow>
@@ -43,6 +42,7 @@
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>
#include <QtGui/QKeyEvent>
+#include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
#if defined(WM_APPCOMMAND)
# ifndef FAPPCOMMAND_MOUSE
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index 6e5789a86e..29297116da 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -29,7 +29,6 @@ SOURCES += \
$$PWD/qwindowsfontengine.cpp \
$$PWD/qwindowsfontdatabase.cpp \
$$PWD/qwindowsmousehandler.cpp \
- $$PWD/qwindowsguieventdispatcher.cpp \
$$PWD/qwindowsole.cpp \
$$PWD/qwindowsmime.cpp \
$$PWD/qwindowsinternalmimedata.cpp \
@@ -51,7 +50,6 @@ HEADERS += \
$$PWD/qwindowsfontengine.h \
$$PWD/qwindowsfontdatabase.h \
$$PWD/qwindowsmousehandler.h \
- $$PWD/qwindowsguieventdispatcher.h \
$$PWD/qtwindowsglobal.h \
$$PWD/qtwindows_additional.h \
$$PWD/qwindowsole.h \