summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r--src/plugins/platforms/windows/array.h4
-rw-r--r--src/plugins/platforms/windows/main.cpp4
-rw-r--r--src/plugins/platforms/windows/qtwindows_additional.h5
-rw-r--r--src/plugins/platforms/windows/qtwindowsglobal.h7
-rw-r--r--src/plugins/platforms/windows/qwindowsaccessibility.cpp24
-rw-r--r--src/plugins/platforms/windows/qwindowsaccessibility.h14
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.h4
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp91
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h10
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp63
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.h17
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp47
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp9
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.h9
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h7
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowsguieventdispatcher.h5
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h6
-rw-r--r--src/plugins/platforms/windows/qwindowsinternalmimedata.h4
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeimage.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeimage.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsole.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsole.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp214
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.h50
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.h8
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h4
-rw-r--r--src/plugins/platforms/windows/windows.pro4
52 files changed, 514 insertions, 262 deletions
diff --git a/src/plugins/platforms/windows/array.h b/src/plugins/platforms/windows/array.h
index f098a77d00..7aac8c5388 100644
--- a/src/plugins/platforms/windows/array.h
+++ b/src/plugins/platforms/windows/array.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/main.cpp b/src/plugins/platforms/windows/main.cpp
index 4d8d4e732e..d54a1dbb89 100644
--- a/src/plugins/platforms/windows/main.cpp
+++ b/src/plugins/platforms/windows/main.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qtwindows_additional.h b/src/plugins/platforms/windows/qtwindows_additional.h
index abb38a1bfd..864107e392 100644
--- a/src/plugins/platforms/windows/qtwindows_additional.h
+++ b/src/plugins/platforms/windows/qtwindows_additional.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -56,6 +56,7 @@
# define SPI_GETFONTSMOOTHINGTYPE 0x200A
# define FE_FONTSMOOTHINGCLEARTYPE 0x0002
# define CLEARTYPE_QUALITY 5
+# define SPI_GETDROPSHADOW 0x1024
# define CF_DIBV5 17
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index 599fb0d201..f044362299 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -95,6 +95,7 @@ enum WindowsEventType // Simplify event types
InputMethodOpenCandidateWindowEvent = InputMethodEventFlag + 4,
InputMethodCloseCandidateWindowEvent = InputMethodEventFlag + 5,
InputMethodRequest = InputMethodEventFlag + 6,
+ DisplayChangedEvent = 437,
UnknownEvent = 542
};
@@ -169,6 +170,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
}
case WM_GETOBJECT:
return QtWindows::AccessibleObjectFromWindowRequest;
+ case WM_DISPLAYCHANGE:
+ return QtWindows::DisplayChangedEvent;
default:
break;
}
diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/qwindowsaccessibility.cpp
index fdf6c9116e..2678fd7f23 100644
--- a/src/plugins/platforms/windows/qwindowsaccessibility.cpp
+++ b/src/plugins/platforms/windows/qwindowsaccessibility.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -60,7 +60,7 @@
#include <QtGui/qplatformnativeinterface_qpa.h>
#include <QtGui/qwindow.h>
#include <QtGui/qaccessible2.h>
-#include <OleAcc.h>
+#include <oleacc.h>
//#include <uiautomationcoreapi.h>
#ifndef UiaRootObjectId
@@ -694,7 +694,7 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT v
case NAVDIR_LEFT:
case NAVDIR_RIGHT:
if (QAccessibleInterface *pIface = accessible->parent()) {
-
+ const int indexOfOurself = pIface->indexOfChild(accessible);
QRect startg = accessible->rect();
QPoint startc = startg.center();
QAccessibleInterface *candidate = 0;
@@ -704,7 +704,7 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT v
QAccessibleInterface *sibling = 0;
sibling = pIface->child(i);
Q_ASSERT(sibling);
- if ((accessible->relationTo(sibling) & QAccessible::Self) || sibling->state().invisible) {
+ if (i == indexOfOurself || sibling->state().invisible) {
//ignore ourself and invisible siblings
delete sibling;
continue;
@@ -1296,10 +1296,10 @@ QWindowsAccessibility::QWindowsAccessibility()
}
-void QWindowsAccessibility::notifyAccessibilityUpdate(QObject *o, int who, QAccessible::Event reason)
+void QWindowsAccessibility::notifyAccessibilityUpdate(const QAccessibleEvent &event)
{
QString soundName;
- switch (reason) {
+ switch (event.type()) {
case QAccessible::PopupMenuStart:
soundName = QLatin1String("MenuPopup");
break;
@@ -1370,8 +1370,9 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QObject *o, int who, QAcce
// An event has to be associated with a window,
// so find the first parent that is a widget and that has a WId
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
+ QAccessibleInterface *iface = event.accessibleInterface();
QWindow *window = iface ? window_helper(iface) : 0;
+ delete iface;
if (!window) {
window = QGuiApplication::activeWindow();
@@ -1382,18 +1383,17 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QObject *o, int who, QAcce
QPlatformNativeInterface *platform = QGuiApplication::platformNativeInterface();
HWND hWnd = (HWND)platform->nativeResourceForWindow("handle", window);
- if (reason != QAccessible::MenuCommand) { // MenuCommand is faked
+ if (event.type() != QAccessible::MenuCommand) { // MenuCommand is faked
// See comment "SENDING EVENTS TO OBJECTS WITH NO WINDOW HANDLE"
eventNum %= 50; //[0..49]
int eventId = - eventNum - 1;
- qAccessibleRecentSentEvents()->insert(eventId, qMakePair(o, who));
- ptrNotifyWinEvent(reason, hWnd, OBJID_CLIENT, eventId );
+ qAccessibleRecentSentEvents()->insert(eventId, qMakePair(event.object(), event.child()));
+ ptrNotifyWinEvent(event.type(), hWnd, OBJID_CLIENT, eventId );
++eventNum;
}
#endif // Q_WS_WINCE
-
}
/*
diff --git a/src/plugins/platforms/windows/qwindowsaccessibility.h b/src/plugins/platforms/windows/qwindowsaccessibility.h
index 892480ecf4..9294f23565 100644
--- a/src/plugins/platforms/windows/qwindowsaccessibility.h
+++ b/src/plugins/platforms/windows/qwindowsaccessibility.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -45,17 +45,23 @@
#include "qtwindowsglobal.h"
#include <QtGui/QPlatformAccessibility>
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
class QWindowsAccessibility : public QPlatformAccessibility
{
public:
QWindowsAccessibility();
static bool handleAccessibleObjectFromWindowRequest(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
- virtual void notifyAccessibilityUpdate(QObject *o, int who, QAccessible::Event reason);
+ virtual void notifyAccessibilityUpdate(const QAccessibleEvent &event);
/*
virtual void setRootObject(QObject *o);
virtual void initialize();
virtual void cleanup();
-*/
+ */
};
+QT_END_NAMESPACE
+QT_END_HEADER
+
#endif // QWINDOWSACCESSIBILITY_H
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index 56e74c5587..bbb6b5305f 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.h b/src/plugins/platforms/windows/qwindowsbackingstore.h
index 60cc5ad787..14ce6c3438 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.h
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp
index e5edab3f4b..521ca3dc07 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.cpp
+++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.h b/src/plugins/platforms/windows/qwindowsclipboard.h
index 321db201e8..643c785e8b 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.h
+++ b/src/plugins/platforms/windows/qwindowsclipboard.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 5e101d1869..5f7dfb1b10 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,9 +48,11 @@
#include "qwindowsmime.h"
#include "qwindowsinputcontext.h"
#include "qwindowsaccessibility.h"
+#include "qwindowsscreen.h"
#include <QtGui/QWindow>
#include <QtGui/QWindowSystemInterface>
+#include <QtGui/QPlatformNativeInterface>
#include <QtCore/QSet>
#include <QtCore/QHash>
@@ -218,6 +220,14 @@ QWindowsContext *QWindowsContext::m_instance = 0;
typedef QHash<HWND, QWindowsWindow *> HandleBaseWindowHash;
struct QWindowsContextPrivate {
+ typedef QPlatformNativeInterface::EventFilter EventFilter;
+
+ enum EventFilterType
+ {
+ GenericWindowsEventFilter,
+ EventFilterTypeCount
+ };
+
QWindowsContextPrivate();
unsigned m_systemInfo;
@@ -228,15 +238,19 @@ struct QWindowsContextPrivate {
QWindowsKeyMapper m_keyMapper;
QWindowsMouseHandler m_mouseHandler;
QWindowsMimeConverter m_mimeConverter;
+ QWindowsScreenManager m_screenManager;
QSharedPointer<QWindowCreationContext> m_creationContext;
const HRESULT m_oleInitializeResult;
+ const QByteArray m_eventType;
+ EventFilter m_eventFilters[EventFilterTypeCount];
};
QWindowsContextPrivate::QWindowsContextPrivate() :
m_systemInfo(0),
m_displayContext(GetDC(0)),
m_defaultDPI(GetDeviceCaps(m_displayContext,LOGPIXELSY)),
- m_oleInitializeResult(OleInitialize(NULL))
+ m_oleInitializeResult(OleInitialize(NULL)),
+ m_eventType(QByteArrayLiteral("windows_generic_MSG"))
{
QWindowsContext::user32dll.init();
QWindowsContext::shell32dll.init();
@@ -250,6 +264,7 @@ QWindowsContextPrivate::QWindowsContextPrivate() :
m_systemInfo |= QWindowsContext::SI_RTL_Extensions;
m_keyMapper.setUseRTLExtensions(true);
}
+ qFill(m_eventFilters, m_eventFilters + EventFilterTypeCount, EventFilter(0));
}
QWindowsContext::QWindowsContext() :
@@ -278,6 +293,7 @@ QWindowsContext::~QWindowsContext()
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
OleUninitialize();
+ d->m_screenManager.clearScreens(); // Order: Potentially calls back to the windows.
m_instance = 0;
}
@@ -330,7 +346,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL)
uint style = 0;
bool icon = false;
- QString cname = "Qt5";
+ QString cname = QStringLiteral("Qt5");
if (w && isGL) {
cname += QStringLiteral("QGLWindow");
style = CS_DBLCLKS|CS_OWNDC;
@@ -541,6 +557,11 @@ QWindowsMimeConverter &QWindowsContext::mimeConverter() const
return d->m_mimeConverter;
}
+QWindowsScreenManager &QWindowsContext::screenManager()
+{
+ return d->m_screenManager;
+}
+
/*!
\brief Convenience to create a non-visible, message-only dummy
window for example used as clipboard watcher or for GL.
@@ -606,6 +627,27 @@ QByteArray QWindowsContext::comErrorString(HRESULT hr)
}
/*!
+ \brief Set event filter.
+
+ \sa QWindowsNativeInterface
+*/
+
+QWindowsContext::EventFilter QWindowsContext::setEventFilter(const QByteArray &eventType, EventFilter filter)
+{
+ int eventFilterType = -1;
+ if (eventType == d->m_eventType)
+ eventFilterType = QWindowsContextPrivate::GenericWindowsEventFilter;
+ if (eventFilterType < 0) {
+ qWarning("%s: Attempt to set unsupported event filter '%s'.",
+ __FUNCTION__, eventType.constData());
+ return 0;
+ }
+ const EventFilter previous = d->m_eventFilters[eventFilterType];
+ d->m_eventFilters[eventFilterType] = filter;
+ return previous;
+}
+
+/*!
\brief Main windows procedure registered for windows.
\sa QWindowsGuiEventDispatcher
@@ -616,6 +658,22 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam, LRESULT *result)
{
*result = 0;
+
+ MSG msg;
+ msg.hwnd = hwnd; // re-create MSG structure
+ msg.message = message; // time and pt fields ignored
+ msg.wParam = wParam;
+ msg.lParam = lParam;
+ msg.pt.x = GET_X_LPARAM(lParam);
+ msg.pt.y = GET_Y_LPARAM(lParam);
+
+ long filterResult = 0;
+ if (d->m_eventFilters[QWindowsContextPrivate::GenericWindowsEventFilter]) {
+ if (d->m_eventFilters[QWindowsContextPrivate::GenericWindowsEventFilter](&msg, &filterResult)) {
+ *result = LRESULT(filterResult);
+ return true;
+ }
+ }
// Events without an associated QWindow or events we are not interested in.
switch (et) {
case QtWindows::DeactivateApplicationEvent:
@@ -641,6 +699,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return false;
case QtWindows::AccessibleObjectFromWindowRequest:
return QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(hwnd, wParam, lParam, result);
+ case QtWindows::DisplayChangedEvent:
+ return d->m_screenManager.handleDisplayChange(wParam, lParam);
default:
break;
}
@@ -676,13 +736,11 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return false;
}
- MSG msg;
- msg.hwnd = hwnd; // re-create MSG structure
- msg.message = message; // time and pt fields ignored
- msg.wParam = wParam;
- msg.lParam = lParam;
- msg.pt.x = GET_X_LPARAM(lParam);
- msg.pt.y = GET_Y_LPARAM(lParam);
+ filterResult = 0;
+ if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) {
+ *result = LRESULT(filterResult);
+ return true;
+ }
switch (et) {
case QtWindows::KeyDownEvent:
@@ -747,18 +805,11 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR
LRESULT result;
const QtWindows::WindowsEventType et = windowsEventType(message, wParam);
const bool handled = QWindowsContext::instance()->windowsProc(hwnd, message, et, wParam, lParam, &result);
- const bool guiEventsQueued = QWindowSystemInterface::windowSystemEventsQueued();
if (QWindowsContext::verboseEvents > 1)
if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message))
- qDebug("EVENT: hwd=%p %s msg=0x%x et=0x%x wp=%d at %d,%d handled=%d gui=%d",
+ qDebug("EVENT: hwd=%p %s msg=0x%x et=0x%x wp=%d at %d,%d handled=%d",
hwnd, eventName, message, et, int(wParam),
- GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), handled, guiEventsQueued);
- if (guiEventsQueued) {
- const QWindowsGuiEventDispatcher::DispatchContext dispatchContext =
- QWindowsGuiEventDispatcher::currentDispatchContext();
- if (dispatchContext.first)
- QWindowSystemInterface::sendWindowSystemEvents(dispatchContext.first, dispatchContext.second);
- }
+ GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), handled);
if (!handled)
result = DefWindowProc(hwnd, message, wParam, lParam);
return result;
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 9a8acbbb51..b5a36c3fe9 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
class QWindow;
class QPlatformScreen;
+class QWindowsScreenManager;
class QWindowsWindow;
class QWindowsMimeConverter;
struct QWindowCreationContext;
@@ -102,6 +103,8 @@ class QWindowsContext
{
Q_DISABLE_COPY(QWindowsContext)
public:
+ typedef bool (*EventFilter)(void *message, long *result);
+
enum SystemInfoFlags
{
SI_RTL_Extensions = 0x1,
@@ -135,6 +138,8 @@ public:
HDC displayContext() const;
int screenDepth() const;
+ EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter);
+
static QWindowsContext *instance();
static QString windowsErrorMessage(unsigned long errorCode);
@@ -162,6 +167,7 @@ public:
unsigned systemInfo() const;
QWindowsMimeConverter &mimeConverter() const;
+ QWindowsScreenManager &screenManager();
static QWindowsUser32DLL user32dll;
static QWindowsShell32DLL shell32dll;
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index 2b228e9fb8..f75cbeb078 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h
index 61ed170af2..a03c77a3b6 100644
--- a/src/plugins/platforms/windows/qwindowscursor.h
+++ b/src/plugins/platforms/windows/qwindowscursor.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 9023769b8b..f7863ae427 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,14 +34,13 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qwindowsdialoghelpers.h"
-#ifdef QT_WIDGETS_LIB
-
#include "qwindowscontext.h"
#include "qwindowswindow.h"
@@ -66,8 +64,8 @@
#include "qtwindows_additional.h"
#define STRICT_TYPED_ITEMIDS
-#include <ShlObj.h>
-#include <Shlwapi.h>
+#include <shlobj.h>
+#include <shlwapi.h>
// #define USE_NATIVE_COLOR_DIALOG /* Testing purposes only */
@@ -341,17 +339,6 @@ void eatMouseMove()
qDebug("%s triggered=%d" , __FUNCTION__, msg.message == WM_MOUSEMOVE);
}
-Type dialogType(const QDialog *dialog)
-{
- if (qobject_cast<const QFileDialog *>(dialog))
- return FileDialog;
- if (qobject_cast<const QFontDialog *>(dialog))
- return FontDialog;
- if (qobject_cast<const QColorDialog *>(dialog))
- return ColorDialog;
- return UnknownType;
-}
-
} // namespace QWindowsDialogs
/*!
@@ -1359,40 +1346,36 @@ QWindowsNativeDialogBase *QWindowsColorDialogHelper::createNativeDialog()
namespace QWindowsDialogs {
// QWindowsDialogHelperBase creation functions
-bool useHelper(const QDialog *dialog)
+bool useHelper(QPlatformTheme::DialogType type)
{
- if (dialog) {
- switch (QWindowsDialogs::dialogType(dialog)) {
- case QWindowsDialogs::FileDialog:
- return true;
- case QWindowsDialogs::ColorDialog:
+ switch (type) {
+ case QPlatformTheme::FileDialog:
+ return true;
+ break;
+ case QPlatformTheme::ColorDialog:
#ifdef USE_NATIVE_COLOR_DIALOG
- return true;
+ return true;
+#else
+ break;
#endif
- case QWindowsDialogs::FontDialog:
- case QWindowsDialogs::UnknownType:
- break;
- }
+ case QPlatformTheme::FontDialog:
+ break;
}
return false;
}
-QPlatformDialogHelper *createHelper(QDialog *dialog)
+QPlatformDialogHelper *createHelper(QPlatformTheme::DialogType type)
{
- if (QWindowsContext::verboseDialogs)
- qDebug("%s %p %s" , __FUNCTION__, dialog, dialog->metaObject()->className());
- if (!dialog)
- return 0;
-
- switch (QWindowsDialogs::dialogType(dialog)) {
- case QWindowsDialogs::FileDialog:
+ switch (type) {
+ case QPlatformTheme::FileDialog:
return new QWindowsFileDialogHelper();
- case QWindowsDialogs::ColorDialog:
+ case QPlatformTheme::ColorDialog:
#ifdef USE_NATIVE_COLOR_DIALOG
return new QWindowsColorDialogHelper();
+#else
+ break;
#endif
- case QWindowsDialogs::FontDialog:
- case QWindowsDialogs::UnknownType:
+ case QPlatformTheme::FontDialog:
break;
}
return 0;
@@ -1402,5 +1385,3 @@ QPlatformDialogHelper *createHelper(QDialog *dialog)
QT_END_NAMESPACE
#include "qwindowsdialoghelpers.moc"
-
-#endif // QT_WIDGETS_LIB
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.h b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
index 120076e58b..3ae22e69eb 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.h
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,10 +42,9 @@
#ifndef QWINDOWSDIALOGHELPER_H
#define QWINDOWSDIALOGHELPER_H
-#ifdef QT_WIDGETS_LIB
-
#include "qtwindows_additional.h"
-#include <QtWidgets/qplatformdialoghelper_qpa.h>
+#include <QtGui/QPlatformDialogHelper>
+#include <QtGui/QPlatformTheme>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
@@ -56,13 +55,10 @@ class QWindowsNativeDialogBase;
namespace QWindowsDialogs
{
- enum Type { UnknownType, ColorDialog, FontDialog, FileDialog };
-
- Type dialogType(const QDialog *dialog);
void eatMouseMove();
- bool useHelper(const QDialog *dialog = 0);
- QPlatformDialogHelper *createHelper(QDialog *dialog = 0);
+ bool useHelper(QPlatformTheme::DialogType type);
+ QPlatformDialogHelper *createHelper(QPlatformTheme::DialogType type);
} // namespace QWindowsDialogs
template <class BaseClass>
@@ -97,5 +93,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_WIDGETS_LIB
#endif // QWINDOWSDIALOGHELPER_H
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index cbd81b99a0..9f2a1dc00c 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsdrag.h b/src/plugins/platforms/windows/qwindowsdrag.h
index 2f2aa569f1..86b5539f92 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.h
+++ b/src/plugins/platforms/windows/qwindowsdrag.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 5969fbf0ab..fa95f4f529 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.h b/src/plugins/platforms/windows/qwindowsfontdatabase.h
index c991aed5ca..b08b682991 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.h
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
index c7bd5ebbb1..f397e9cb92 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -105,11 +105,13 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
const FONTSIGNATURE *signature,
int type)
{
+ typedef QPair<QString, QStringList> FontKey;
+
// the "@family" fonts are just the same as "family". Ignore them.
if (familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
return false;
- const int separatorPos = familyName.indexOf("::");
+ const int separatorPos = familyName.indexOf(QStringLiteral("::"));
const QString faceName =
separatorPos != -1 ? familyName.left(separatorPos) : familyName;
const QString fullName =
@@ -169,20 +171,33 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
writingSystems.setSupported(ws);
}
- const QSettings fontRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts",
+ const QSettings fontRegistry(QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"),
QSettings::NativeFormat);
- QByteArray value;
+ static QVector<FontKey> allFonts;
+ if (allFonts.isEmpty()) {
+ const QStringList allKeys = fontRegistry.allKeys();
+ allFonts.reserve(allKeys.size());
+ const QString trueType = QStringLiteral("(TrueType)");
+ foreach (const QString &key, allKeys) {
+ QString realKey = key;
+ realKey.remove(trueType);
+ QStringList fonts;
+ const QStringList fontNames = realKey.trimmed().split(QLatin1Char('&'));
+ foreach (const QString &fontName, fontNames)
+ fonts.push_back(fontName.trimmed());
+ allFonts.push_back(FontKey(key, fonts));
+ }
+ }
+
+ QString value;
int index = 0;
- foreach (const QString &key, fontRegistry.allKeys()) {
- QString realKey = key;
- realKey = realKey.replace("(TrueType)", "");
- realKey = realKey.trimmed();
- QStringList fonts = realKey.split('&');
- for (int i = 0; i < fonts.length(); ++i) {
- const QString font = fonts[i].trimmed();
+ for (int k = 0; k < allFonts.size(); ++k) {
+ const FontKey &fontKey = allFonts.at(k);
+ for (int i = 0; i < fontKey.second.length(); ++i) {
+ const QString &font = fontKey.second.at(i);
if (font == faceName || (faceName != fullName && fullName == font)) {
- value = fontRegistry.value(key).toByteArray();
+ value = fontRegistry.value(fontKey.first).toString();
index = i;
break;
}
@@ -195,7 +210,7 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
return false;
if (!QDir::isAbsolutePath(value))
- value = qgetenv("windir") + "\\Fonts\\" + value;
+ value.prepend(QString::fromLocal8Bit(qgetenv("windir") + "\\Fonts\\"));
// Pointer is deleted in QBasicFontDatabase::releaseHandle(void *handle)
FontFile *fontFile = new FontFile;
@@ -221,7 +236,9 @@ static int CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric,
int type, LPARAM namesSetIn)
{
typedef QSet<QString> StringSet;
- const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName) + "::" + QString::fromWCharArray(f->elfFullName);
+ const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName)
+ + QStringLiteral("::")
+ + QString::fromWCharArray(f->elfFullName);
const QString script = QString::fromWCharArray(f->elfScript);
const FONTSIGNATURE signature = textmetric->ntmFontSig;
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h
index 94cf556925..b12c1067fd 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index f6c456bc7b..ffa57ad58f 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -89,8 +89,6 @@ QT_BEGIN_NAMESPACE
// common DC for all fonts
-QT_BEGIN_NAMESPACE
-
typedef BOOL (WINAPI *PtrGetCharWidthI)(HDC, UINT, UINT, LPWORD, LPINT);
static PtrGetCharWidthI ptrGetCharWidthI = 0;
static bool resolvedGetCharWidthI = false;
@@ -1096,7 +1094,7 @@ QImage QWindowsFontEngine::alphaMapForGlyph(glyph_t glyph, const QTransform &xfo
#define SPI_GETFONTSMOOTHINGCONTRAST 0x200C
#define SPI_SETFONTSMOOTHINGCONTRAST 0x200D
-QImage QWindowsFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed, int margin, const QTransform &t)
+QImage QWindowsFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed, const QTransform &t)
{
HFONT font = hfont;
@@ -1104,6 +1102,7 @@ QImage QWindowsFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed, int margin
SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &contrast, 0);
SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) 1000, 0);
+ int margin = glyphMargin(QFontEngineGlyphCache::Raster_RGBMask);
QWindowsNativeImage *mask = drawGDIGlyph(font, glyph, margin, t, QImage::Format_RGB32);
SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) contrast, 0);
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.h b/src/plugins/platforms/windows/qwindowsfontengine.h
index 75968cc403..f8ebc896f2 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.h
+++ b/src/plugins/platforms/windows/qwindowsfontengine.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,10 +53,7 @@
// We mean it.
//
-// Enable access to HB_Face in harfbuzz includes included by qfontengine_p.h.
-#define QT_BUILD_GUI_LIB
#include <QtGui/private/qfontengine_p.h>
-#undef QT_BUILD_GUI_LIB
#include <QtGui/QImage>
#include <QtCore/QSharedPointer>
@@ -118,7 +115,7 @@ public:
virtual QImage alphaMapForGlyph(glyph_t t) { return alphaMapForGlyph(t, QTransform()); }
virtual QImage alphaMapForGlyph(glyph_t, const QTransform &xform);
- virtual QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform);
+ virtual QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform);
virtual QFontEngine *cloneWithSize(qreal pixelSize) const;
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
index 293c1c3b15..82410bfb21 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
index f995c49a60..0af52a2384 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -96,8 +96,7 @@ public:
bool supportsSubPixelPositions() const;
QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition);
- QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin,
- const QTransform &xform);
+ QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform);
QFontEngine *cloneWithSize(qreal pixelSize) const;
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 1866faecd1..098f15f0f0 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,8 +48,8 @@
#include <QtGui/QGuiApplication>
#include <QtGui/QPlatformNativeInterface>
-#include <WinGDI.h>
-#include <GL/Gl.h>
+#include <wingdi.h>
+#include <GL/gl.h>
// #define DEBUG_GL
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h
index 17a33a7c14..5aac636f83 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsglcontext.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp b/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
index cd5d28317e..34ab1665d8 100644
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
+++ b/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -97,6 +97,13 @@ bool QWindowsGuiEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags fl
return rc;
}
+void QWindowsGuiEventDispatcher::sendPostedEvents()
+{
+ QWindowsGuiEventDispatcher::DispatchContext context = currentDispatchContext();
+ Q_ASSERT(context.first != 0);
+ QWindowSystemInterface::sendWindowSystemEvents(context.first, context.second);
+}
+
QWindowsGuiEventDispatcher::DispatchContext QWindowsGuiEventDispatcher::currentDispatchContext()
{
const DispatchContextStack &stack = *dispatchContextStack();
@@ -195,7 +202,8 @@ messageDebugEntries[] = {
{WM_IME_COMPOSITION, "WM_IME_COMPOSITION"},
{WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION"},
{WM_IME_NOTIFY, "WM_IME_NOTIFY"},
- {WM_IME_REQUEST, "WM_IME_REQUEST"}
+ {WM_IME_REQUEST, "WM_IME_REQUEST"},
+ {WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE"}
};
static inline const MessageDebugEntry *messageDebugEntry(UINT msg)
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.h b/src/plugins/platforms/windows/qwindowsguieventdispatcher.h
index 8d2bc1997b..49c5d8b490 100644
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.h
+++ b/src/plugins/platforms/windows/qwindowsguieventdispatcher.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -64,6 +64,7 @@ public:
static const char *windowsMessageName(UINT msg);
virtual bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags);
+ virtual void sendPostedEvents();
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index 41c1a6c8f0..5085dfefb7 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -167,7 +167,7 @@ QWindowsInputContext::QWindowsInputContext() :
m_WM_MSIME_MOUSE(RegisterWindowMessage(L"MSIMEMouseOperation")),
m_endCompositionRecursionGuard(false)
{
- connect(qApp->inputPanel(), SIGNAL(cursorRectangleChanged()),
+ connect(qApp->inputMethod(), SIGNAL(cursorRectangleChanged()),
this, SLOT(cursorRectChanged()));
}
@@ -184,7 +184,7 @@ void QWindowsInputContext::reset()
QPlatformInputContext::reset();
if (!m_compositionContext.hwnd)
return;
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
if (QWindowsContext::verboseInputMethods)
qDebug() << __FUNCTION__<< fo;
if (!fo)
@@ -213,8 +213,8 @@ void QWindowsInputContext::cursorRectChanged()
{
if (!m_compositionContext.hwnd)
return;
- const QInputPanel *inputPanel = qApp->inputPanel();
- QRect cursorRectangle = inputPanel->cursorRectangle().toRect();
+ const QInputMethod *inputMethod = qApp->inputMethod();
+ QRect cursorRectangle = inputMethod->cursorRectangle().toRect();
if (!cursorRectangle.isValid())
return;
@@ -249,9 +249,9 @@ void QWindowsInputContext::cursorRectChanged()
ImmReleaseContext(m_compositionContext.hwnd, himc);
}
-void QWindowsInputContext::invokeAction(QInputPanel::Action action, int cursorPosition)
+void QWindowsInputContext::invokeAction(QInputMethod::Action action, int cursorPosition)
{
- if (action != QInputPanel::Click || !m_compositionContext.hwnd) {
+ if (action != QInputMethod::Click || !m_compositionContext.hwnd) {
QPlatformInputContext::invokeAction(action, cursorPosition);
return;
}
@@ -329,11 +329,11 @@ static inline QTextFormat standardFormat(StandardFormat format)
bool QWindowsInputContext::startComposition(HWND hwnd)
{
- const QObject *fo = qApp->inputPanel()->inputItem();
+ const QObject *fo = qApp->inputMethod()->inputItem();
if (!fo)
return false;
// This should always match the object.
- QWindow *window = qApp->inputPanel()->inputWindow();
+ QWindow *window = qApp->inputMethod()->inputWindow();
if (!window)
return false;
if (QWindowsContext::verboseInputMethods)
@@ -397,7 +397,7 @@ static inline QList<QInputMethodEvent::Attribute>
bool QWindowsInputContext::composition(HWND hwnd, LPARAM lParamIn)
{
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
const int lParam = int(lParamIn);
if (QWindowsContext::verboseInputMethods)
qDebug() << '>' << __FUNCTION__ << fo << debugComposition(lParam)
@@ -459,7 +459,7 @@ bool QWindowsInputContext::endComposition(HWND hwnd)
// against that.
if (m_endCompositionRecursionGuard || m_compositionContext.hwnd != hwnd)
return false;
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
if (!fo)
return false;
@@ -537,7 +537,7 @@ bool QWindowsInputContext::handleIME_Request(WPARAM wParam,
int QWindowsInputContext::reconvertString(RECONVERTSTRING *reconv)
{
- QObject *fo = qApp->inputPanel()->inputItem();
+ QObject *fo = qApp->inputMethod()->inputItem();
if (!fo)
return false;
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.h b/src/plugins/platforms/windows/qwindowsinputcontext.h
index d735d1fd93..a33d24e2f6 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.h
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 8bb8bafe74..2771ec7e8a 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -87,6 +87,8 @@ public:
virtual void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
virtual void *nativeResourceForWindow(const QByteArray &resource, QWindow *window);
virtual void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *bs);
+ virtual EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter)
+ { return QWindowsContext::instance()->setEventFilter(eventType, filter); }
};
void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
@@ -178,8 +180,7 @@ QWindowsIntegration::QWindowsIntegration() :
{
QGuiApplicationPrivate::instance()->setEventDispatcher(d->m_eventDispatcher);
d->m_clipboard.registerViewer();
- foreach (QPlatformScreen *pscr, QWindowsScreen::screens())
- screenAdded(pscr);
+ d->m_context.screenManager().handleScreenChanges();
}
QWindowsIntegration::~QWindowsIntegration()
@@ -292,6 +293,7 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
case QPlatformIntegration::StartDragDistance:
case QPlatformIntegration::MouseDoubleClickInterval:
case QPlatformIntegration::KeyboardInputInterval:
+ case QPlatformIntegration::ShowIsFullScreen:
break; // Not implemented
}
return QPlatformIntegration::styleHint(hint);
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index fa133fa5de..a96605f259 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -74,6 +74,8 @@ public:
static QWindowsIntegration *instance();
+ inline void emitScreenAdded(QPlatformScreen *s) { screenAdded(s); }
+
private:
QScopedPointer<QWindowsIntegrationPrivate> d;
};
diff --git a/src/plugins/platforms/windows/qwindowsinternalmimedata.h b/src/plugins/platforms/windows/qwindowsinternalmimedata.h
index ceecd08f70..498c2f751f 100644
--- a/src/plugins/platforms/windows/qwindowsinternalmimedata.h
+++ b/src/plugins/platforms/windows/qwindowsinternalmimedata.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 369deb7598..7b96603c44 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.h b/src/plugins/platforms/windows/qwindowskeymapper.h
index e5e50c5886..483ff57942 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.h
+++ b/src/plugins/platforms/windows/qwindowskeymapper.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index 026ab94d32..570e4b3b6b 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsmime.h b/src/plugins/platforms/windows/qwindowsmime.h
index adac573375..19aef007e3 100644
--- a/src/plugins/platforms/windows/qwindowsmime.h
+++ b/src/plugins/platforms/windows/qwindowsmime.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index e491029ea1..63c2444957 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.h b/src/plugins/platforms/windows/qwindowsmousehandler.h
index 4885d82b84..b3d176db9b 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.h
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsnativeimage.cpp b/src/plugins/platforms/windows/qwindowsnativeimage.cpp
index 353366db8f..8f727c6168 100644
--- a/src/plugins/platforms/windows/qwindowsnativeimage.cpp
+++ b/src/plugins/platforms/windows/qwindowsnativeimage.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsnativeimage.h b/src/plugins/platforms/windows/qwindowsnativeimage.h
index 6d453b0509..8fc41af541 100644
--- a/src/plugins/platforms/windows/qwindowsnativeimage.h
+++ b/src/plugins/platforms/windows/qwindowsnativeimage.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsole.cpp b/src/plugins/platforms/windows/qwindowsole.cpp
index fc61c2aa47..3ae9fe1048 100644
--- a/src/plugins/platforms/windows/qwindowsole.cpp
+++ b/src/plugins/platforms/windows/qwindowsole.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsole.h b/src/plugins/platforms/windows/qwindowsole.h
index 47fc22526c..e20baeb7be 100644
--- a/src/plugins/platforms/windows/qwindowsole.h
+++ b/src/plugins/platforms/windows/qwindowsole.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index c8966f2ecc..1dc5175515 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,12 +42,15 @@
#include "qwindowsscreen.h"
#include "qwindowscontext.h"
#include "qwindowswindow.h"
+#include "qwindowsintegration.h"
#include "qwindowscursor.h"
+#include "qwindowscontext.h"
#include "qtwindows_additional.h"
#include <QtGui/QPixmap>
#include <QtGui/QGuiApplication>
+#include <QtGui/QWindowSystemInterface>
#include <QtGui/QScreen>
#include <QtCore/QDebug>
@@ -55,9 +58,8 @@
QT_BEGIN_NAMESPACE
QWindowsScreenData::QWindowsScreenData() :
- dpi(96, 96),
- depth(32),
- format(QImage::Format_ARGB32_Premultiplied), primary(false)
+ dpi(96, 96), depth(32), format(QImage::Format_ARGB32_Premultiplied),
+ flags(VirtualDesktop), orientation(Qt::LandscapeOrientation)
{
}
@@ -98,6 +100,8 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM
data.geometry = QRect(QPoint(info.rcMonitor.left, info.rcMonitor.top), QPoint(info.rcMonitor.right - 1, info.rcMonitor.bottom - 1));
if (HDC hdc = CreateDC(info.szDevice, NULL, NULL, NULL)) {
data.dpi = deviceDPI(hdc);
+ data.depth = GetDeviceCaps(hdc, BITSPIXEL);
+ data.format = data.depth == 16 ? QImage::Format_RGB16 : QImage::Format_RGB32;
data.physicalSizeMM = QSizeF(GetDeviceCaps(hdc, HORZSIZE), GetDeviceCaps(hdc, VERTSIZE));
DeleteDC(hdc);
} else {
@@ -107,15 +111,47 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM
}
data.geometry = QRect(QPoint(info.rcMonitor.left, info.rcMonitor.top), QPoint(info.rcMonitor.right - 1, info.rcMonitor.bottom - 1));
data.availableGeometry = QRect(QPoint(info.rcWork.left, info.rcWork.top), QPoint(info.rcWork.right - 1, info.rcWork.bottom - 1));
- data.primary = (info.dwFlags & MONITORINFOF_PRIMARY) != 0;
+ data.orientation = data.geometry.height() > data.geometry.width() ?
+ Qt::PortraitOrientation : Qt::LandscapeOrientation;
+ // EnumDisplayMonitors (as opposed to EnumDisplayDevices) enumerates only
+ // virtual desktop screens.
+ data.flags = QWindowsScreenData::VirtualDesktop;
+ if (info.dwFlags & MONITORINFOF_PRIMARY)
+ data.flags |= QWindowsScreenData::PrimaryScreen;
+ data.name = QString::fromWCharArray(info.szDevice);
result->append(data);
return TRUE;
}
+static inline WindowsScreenDataList monitorData()
+{
+ WindowsScreenDataList result;
+ EnumDisplayMonitors(0, 0, monitorEnumCallback, (LPARAM)&result);
+ return result;
+}
+
+static QDebug operator<<(QDebug dbg, const QWindowsScreenData &d)
+{
+ QDebug nospace = dbg.nospace();
+ nospace << "Screen " << d.name << ' '
+ << d.geometry.width() << 'x' << d.geometry.height() << '+' << d.geometry.x() << '+' << d.geometry.y()
+ << " avail: "
+ << d.availableGeometry.width() << 'x' << d.availableGeometry.height() << '+' << d.availableGeometry.x() << '+' << d.availableGeometry.y()
+ << " physical: " << d.physicalSizeMM.width() << 'x' << d.physicalSizeMM.height()
+ << " DPI: " << d.dpi.first << 'x' << d.dpi.second << " Depth: " << d.depth
+ << " Format: " << d.format;
+ if (d.flags & QWindowsScreenData::PrimaryScreen)
+ nospace << " primary";
+ if (d.flags & QWindowsScreenData::VirtualDesktop)
+ nospace << " virtual desktop";
+ return dbg;
+}
+
/*!
\class QWindowsScreen
\brief Windows screen.
\ingroup qt-lighthouse-win
+ \sa QWindowsScreenManager
*/
QWindowsScreen::QWindowsScreen(const QWindowsScreenData &data) :
@@ -123,34 +159,10 @@ QWindowsScreen::QWindowsScreen(const QWindowsScreenData &data) :
{
}
-QList<QPlatformScreen *> QWindowsScreen::screens()
-{
- // Retrieve monitors and add static depth information to each.
- WindowsScreenDataList data;
- EnumDisplayMonitors(0, 0, monitorEnumCallback, (LPARAM)&data);
-
- const int depth = QWindowsContext::instance()->screenDepth();
- const QImage::Format format = depth == 16 ? QImage::Format_RGB16 : QImage::Format_RGB32;
- QList<QPlatformScreen *> result;
-
- const WindowsScreenDataList::const_iterator scend = data.constEnd();
- for (WindowsScreenDataList::const_iterator it = data.constBegin(); it != scend; ++it) {
- QWindowsScreenData d = *it;
- d.depth = depth;
- d.format = format;
- if (QWindowsContext::verboseIntegration)
- qDebug() << "Screen" << d.geometry << d.availableGeometry << d.primary
- << " physical " << d.physicalSizeMM << " DPI" << d.dpi
- << "Depth: " << d.depth << " Format: " << d.format;
- result.append(new QWindowsScreen(d));
- }
- return result;
-}
+Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0);
QPixmap QWindowsScreen::grabWindow(WId window, int x, int y, int width, int height) const
{
- Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0);
-
if (QWindowsContext::verboseIntegration)
qDebug() << __FUNCTION__ << window << x << y << width << height;
RECT r;
@@ -226,4 +238,144 @@ QWindowsScreen *QWindowsScreen::screenOf(const QWindow *w)
return 0;
}
+/*!
+ \brief Determine siblings in a virtual desktop system.
+
+ Self is by definition a sibling, else collect all screens
+ within virtual desktop.
+*/
+
+QList<QPlatformScreen *> QWindowsScreen::virtualSiblings() const
+{
+ QList<QPlatformScreen *> result;
+ if (m_data.flags & QWindowsScreenData::VirtualDesktop) {
+ foreach (QWindowsScreen *screen, QWindowsContext::instance()->screenManager().screens())
+ if (screen->data().flags & QWindowsScreenData::VirtualDesktop)
+ result.push_back(screen);
+ } else {
+ result.push_back(const_cast<QWindowsScreen *>(this));
+ }
+ return result;
+}
+
+/*!
+ \brief Notify QWindowSystemInterface about changes of a screen and synchronize data.
+*/
+
+void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)
+{
+ if (m_data.geometry != newData.geometry) {
+ m_data.geometry = newData.geometry;
+ QWindowSystemInterface::handleScreenGeometryChange(screen(),
+ newData.geometry);
+ }
+ if (m_data.availableGeometry != newData.availableGeometry) {
+ m_data.availableGeometry = newData.availableGeometry;
+ QWindowSystemInterface::handleScreenAvailableGeometryChange(screen(),
+ newData.availableGeometry);
+ }
+ if (!qFuzzyCompare(m_data.dpi.first, newData.dpi.first)
+ || !qFuzzyCompare(m_data.dpi.second, newData.dpi.second)) {
+ m_data.dpi = newData.dpi;
+ QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(),
+ newData.dpi.first,
+ newData.dpi.second);
+ }
+ if (m_data.orientation != newData.orientation) {
+ m_data.orientation = newData.orientation;
+ QWindowSystemInterface::handleScreenOrientationChange(screen(),
+ newData.orientation);
+ }
+}
+
+/*!
+ \class QWindowsScreenManager
+ \brief Manages a list of QWindowsScreen.
+
+ Listens for changes and notifies QWindowSystemInterface about changed/
+ added/deleted screens.
+
+ \ingroup qt-lighthouse-win
+ \sa QWindowsScreen
+*/
+
+QWindowsScreenManager::QWindowsScreenManager() :
+ m_lastDepth(-1), m_lastHorizontalResolution(0), m_lastVerticalResolution(0)
+{
+}
+
+/*!
+ \brief Triggers synchronization of screens (WM_DISPLAYCHANGE).
+
+ Subsequent events are compressed since WM_DISPLAYCHANGE is sent to
+ each top level window.
+*/
+
+bool QWindowsScreenManager::handleDisplayChange(WPARAM wParam, LPARAM lParam)
+{
+ const int newDepth = (int)wParam;
+ const WORD newHorizontalResolution = LOWORD(lParam);
+ const WORD newVerticalResolution = HIWORD(lParam);
+ if (newDepth != m_lastDepth || newHorizontalResolution != m_lastHorizontalResolution
+ || newVerticalResolution != m_lastVerticalResolution) {
+ m_lastDepth = newDepth;
+ m_lastHorizontalResolution = newHorizontalResolution;
+ m_lastVerticalResolution = newVerticalResolution;
+ if (QWindowsContext::verboseWindows)
+ qDebug("%s: Depth=%d, resolution=%hux%hu",
+ __FUNCTION__, newDepth, newHorizontalResolution, newVerticalResolution);
+ handleScreenChanges();
+ }
+ return false;
+}
+
+static inline int indexOfMonitor(const QList<QWindowsScreen *> &screens,
+ const QString &monitorName)
+{
+ for (int i= 0; i < screens.size(); ++i)
+ if (screens.at(i)->data().name == monitorName)
+ return i;
+ return -1;
+}
+
+static inline int indexOfMonitor(const QList<QWindowsScreenData> &screenData,
+ const QString &monitorName)
+{
+ for (int i = 0; i < screenData.size(); ++i)
+ if (screenData.at(i).name == monitorName)
+ return i;
+ return -1;
+}
+
+/*!
+ \brief Synchronizes the screen list, adds new screens, removes deleted
+ ones and propagates resolution changes to QWindowSystemInterface.
+*/
+
+void QWindowsScreenManager::handleScreenChanges()
+{
+ // Look for changed monitors, add new ones
+ const WindowsScreenDataList newDataList = monitorData();
+ foreach (const QWindowsScreenData &newData, newDataList) {
+ const int existingIndex = indexOfMonitor(m_screens, newData.name);
+ if (existingIndex != -1) {
+ m_screens.at(existingIndex)->handleChanges(newData);
+ } else {
+ QWindowsScreen *newScreen = new QWindowsScreen(newData);
+ m_screens.push_back(newScreen);
+ QWindowsIntegration::instance()->emitScreenAdded(newScreen);
+ if (QWindowsContext::verboseWindows)
+ qDebug() << "New Monitor: " << newData;
+ } // exists
+ } // for new screens.
+ // Remove deleted ones.
+ for (int i = m_screens.size() - 1; i >= 0; --i) {
+ if (indexOfMonitor(newDataList, m_screens.at(i)->data().name) == -1) {
+ if (QWindowsContext::verboseWindows)
+ qDebug() << "Removing Monitor: " << m_screens.at(i) ->data();
+ delete m_screens.takeAt(i);
+ } // not found
+ } // for existing screens
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h
index dc1c8238d9..436cc2c0d9 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.h
+++ b/src/plugins/platforms/windows/qwindowsscreen.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,6 +52,12 @@ QT_BEGIN_NAMESPACE
struct QWindowsScreenData
{
+ enum Flags
+ {
+ PrimaryScreen = 0x1,
+ VirtualDesktop = 0x2
+ };
+
QWindowsScreenData();
QRect geometry;
@@ -60,7 +66,9 @@ struct QWindowsScreenData
QSizeF physicalSizeMM;
int depth;
QImage::Format format;
- bool primary;
+ unsigned flags;
+ QString name;
+ Qt::ScreenOrientation orientation;
};
class QWindowsScreen : public QPlatformScreen
@@ -76,7 +84,9 @@ public:
virtual QImage::Format format() const { return m_data.format; }
virtual QSizeF physicalSize() const { return m_data.physicalSizeMM; }
virtual QDpi logicalDpi() const { return m_data.dpi; }
-
+ virtual QString name() const { return m_data.name; }
+ virtual Qt::ScreenOrientation primaryOrientation() { return m_data.orientation; }
+ virtual QList<QPlatformScreen *> virtualSiblings() const;
virtual QWindow *topLevelAt(const QPoint &point) const
{ return QWindowsScreen::findTopLevelAt(point, CWP_SKIPINVISIBLE); }
@@ -84,18 +94,40 @@ public:
static QWindow *windowAt(const QPoint &point, unsigned flags = CWP_SKIPINVISIBLE);
static QWindow *windowUnderMouse(unsigned flags = CWP_SKIPINVISIBLE);
- static QList<QPlatformScreen *> screens();
-
virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const;
- const QWindowsCursor &cursor() const { return m_cursor; }
- QWindowsCursor &cursor() { return m_cursor; }
+ inline void handleChanges(const QWindowsScreenData &newData);
+
+ const QWindowsCursor &cursor() const { return m_cursor; }
+ QWindowsCursor &cursor() { return m_cursor; }
+
+ const QWindowsScreenData &data() const { return m_data; }
private:
- const QWindowsScreenData m_data;
+ QWindowsScreenData m_data;
QWindowsCursor m_cursor;
};
+class QWindowsScreenManager
+{
+public:
+ typedef QList<QWindowsScreen *> WindowsScreenList;
+
+ QWindowsScreenManager();
+
+ inline void clearScreens() { qDeleteAll(m_screens); m_screens.clear(); }
+
+ void handleScreenChanges();
+ bool handleDisplayChange(WPARAM wParam, LPARAM lParam);
+ const WindowsScreenList &screens() const { return m_screens; }
+
+private:
+ WindowsScreenList m_screens;
+ int m_lastDepth;
+ WORD m_lastHorizontalResolution;
+ WORD m_lastVerticalResolution;
+};
+
QT_END_NAMESPACE
#endif // QWINDOWSSCREEN_H
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 31adcfa167..73cff3c9ce 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -81,14 +81,14 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
return QVariant();
}
-bool QWindowsTheme::usePlatformNativeDialog(const QDialog *dialog) const
+bool QWindowsTheme::usePlatformNativeDialog(DialogType type) const
{
- return QWindowsDialogs::useHelper(dialog);
+ return QWindowsDialogs::useHelper(type);
}
-QPlatformDialogHelper *QWindowsTheme::createPlatformDialogHelper(QDialog *dialog) const
+QPlatformDialogHelper *QWindowsTheme::createPlatformDialogHelper(DialogType type) const
{
- return QWindowsDialogs::createHelper(dialog);
+ return QWindowsDialogs::createHelper(type);
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h
index 9bb937d607..77c85b2d6e 100644
--- a/src/plugins/platforms/windows/qwindowstheme.h
+++ b/src/plugins/platforms/windows/qwindowstheme.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,8 +51,8 @@ class QWindowsTheme : public QPlatformTheme
public:
QWindowsTheme();
- virtual bool usePlatformNativeDialog(const QDialog *dialog = 0) const;
- virtual QPlatformDialogHelper *createPlatformDialogHelper(QDialog *dialog = 0) const;
+ virtual bool usePlatformNativeDialog(DialogType type) const;
+ virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const;
virtual QVariant themeHint(ThemeHint) const;
};
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 282576105f..5d8de2e01d 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 364f3d0bc5..1d5f3c29d6 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 4b7202578a..453265405a 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -4,8 +4,6 @@ load(qt_plugin)
QT *= core-private
QT *= gui-private
QT *= platformsupport-private
-# ### fixme: Remove widgets dependencies of dialog helpers
-QT *= widgets
INCLUDEPATH += ../../../3rdparty/harfbuzz/src
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms
@@ -16,6 +14,8 @@ win32-g++: LIBS *= -luuid
# For the dialog helpers:
LIBS *= -lshlwapi -lShell32
+DEFINES *= QT_NO_CAST_FROM_ASCII
+
contains(QT_CONFIG, directwrite) {
LIBS *= -ldwrite
SOURCES += qwindowsfontenginedirectwrite.cpp