Windows QPA: Remove Windows CE.
Task-number: QTBUG-51673 Change-Id: I5b58a7d1651fce7f868a4d3fdd8fa46f35e67695 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
This commit is contained in:
parent
0fef402d7f
commit
a06ae8452a
@ -6,15 +6,13 @@ HEADERS += \
|
||||
$$PWD/qwindowsaccessibility.h \
|
||||
$$PWD/comutils.h
|
||||
|
||||
!wince: {
|
||||
SOURCES += $$PWD/qwindowsmsaaaccessible.cpp
|
||||
HEADERS += $$PWD/qwindowsmsaaaccessible.h
|
||||
SOURCES += $$PWD/qwindowsmsaaaccessible.cpp
|
||||
HEADERS += $$PWD/qwindowsmsaaaccessible.h
|
||||
|
||||
!mingw: {
|
||||
SOURCES += $$PWD/iaccessible2.cpp
|
||||
HEADERS += $$PWD/iaccessible2.h
|
||||
include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
|
||||
}
|
||||
!mingw: {
|
||||
SOURCES += $$PWD/iaccessible2.cpp
|
||||
HEADERS += $$PWD/iaccessible2.h
|
||||
include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
|
||||
}
|
||||
|
||||
mingw: LIBS *= -luuid
|
||||
|
@ -170,7 +170,6 @@ bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeN
|
||||
case QVariant::LongLong:
|
||||
if (out && arg.vt == (VT_CY|VT_BYREF)) {
|
||||
arg.pcyVal->int64 = qvar.toLongLong();
|
||||
#if !defined(Q_OS_WINCE) && defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
} else if (out && arg.vt == (VT_I8|VT_BYREF)) {
|
||||
*arg.pllVal = qvar.toLongLong();
|
||||
} else {
|
||||
@ -181,22 +180,11 @@ bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeN
|
||||
arg.vt |= VT_BYREF;
|
||||
}
|
||||
}
|
||||
#else
|
||||
} else {
|
||||
arg.vt = VT_CY;
|
||||
arg.cyVal.int64 = qvar.toLongLong();
|
||||
if (out) {
|
||||
arg.pcyVal = new CY(arg.cyVal);
|
||||
arg.vt |= VT_BYREF;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case QVariant::ULongLong:
|
||||
if (out && arg.vt == (VT_CY|VT_BYREF)) {
|
||||
arg.pcyVal->int64 = qvar.toULongLong();
|
||||
#if !defined(Q_OS_WINCE) && defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
} else if (out && arg.vt == (VT_UI8|VT_BYREF)) {
|
||||
*arg.pullVal = qvar.toULongLong();
|
||||
} else {
|
||||
@ -207,18 +195,6 @@ bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeN
|
||||
arg.vt |= VT_BYREF;
|
||||
}
|
||||
}
|
||||
#else
|
||||
} else {
|
||||
arg.vt = VT_CY;
|
||||
arg.cyVal.int64 = qvar.toULongLong();
|
||||
if (out) {
|
||||
arg.pcyVal = new CY(arg.cyVal);
|
||||
arg.vt |= VT_BYREF;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
case QVariant::Bool:
|
||||
|
@ -56,12 +56,10 @@
|
||||
#include <QtGui/qguiapplication.h>
|
||||
|
||||
#include "qwindowsaccessibility.h"
|
||||
#if !defined(Q_OS_WINCE)
|
||||
# ifdef Q_CC_MINGW
|
||||
# include "qwindowsmsaaaccessible.h"
|
||||
# else
|
||||
# include "iaccessible2.h"
|
||||
# endif
|
||||
#ifdef Q_CC_MINGW
|
||||
# include "qwindowsmsaaaccessible.h"
|
||||
#else
|
||||
# include "iaccessible2.h"
|
||||
#endif
|
||||
#include "comutils.h"
|
||||
|
||||
@ -74,11 +72,7 @@
|
||||
|
||||
#include <winuser.h>
|
||||
#if !defined(WINABLEAPI)
|
||||
# if defined(Q_OS_WINCE)
|
||||
# include <bldver.h>
|
||||
# else
|
||||
# include <winable.h>
|
||||
# endif
|
||||
# include <winable.h>
|
||||
#endif
|
||||
|
||||
#include <servprov.h>
|
||||
@ -153,10 +147,6 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WINCE) // ### TODO: check for NotifyWinEvent in CE 6.0
|
||||
// There is no user32.lib nor NotifyWinEvent for CE
|
||||
return;
|
||||
#else
|
||||
// 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 = event->accessibleInterface();
|
||||
@ -179,7 +169,6 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
|
||||
event->type() != QAccessible::ObjectDestroyed) {
|
||||
::NotifyWinEvent(event->type(), hWnd, OBJID_CLIENT, QAccessible::uniqueId(iface));
|
||||
}
|
||||
#endif // Q_OS_WINCE
|
||||
}
|
||||
|
||||
QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface)
|
||||
@ -202,11 +191,6 @@ QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface)
|
||||
*/
|
||||
IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
Q_UNUSED(acc);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
if (!acc)
|
||||
return 0;
|
||||
|
||||
@ -222,12 +206,10 @@ IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
|
||||
IAccessible *iacc = 0;
|
||||
wacc->QueryInterface(IID_IAccessible, reinterpret_cast<void **>(&iacc));
|
||||
return iacc;
|
||||
#endif // defined(Q_OS_WINCE)
|
||||
}
|
||||
|
||||
bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
|
||||
{
|
||||
#if !defined(Q_OS_WINCE)
|
||||
if (static_cast<long>(lParam) == static_cast<long>(UiaRootObjectId)) {
|
||||
/* For UI Automation */
|
||||
} else if (DWORD(lParam) == DWORD(OBJID_CLIENT)) {
|
||||
@ -263,12 +245,6 @@ bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, W
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(hwnd);
|
||||
Q_UNUSED(wParam);
|
||||
Q_UNUSED(lParam);
|
||||
Q_UNUSED(lResult);
|
||||
#endif // !defined(Q_OS_WINCE)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,371 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QPLATFORMFUNCTIONS_WCE_H
|
||||
#define QPLATFORMFUNCTIONS_WCE_H
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is part of the QPA API and is not meant to be used
|
||||
// in applications. Usage of this API may make your code
|
||||
// source and binary incompatible with future versions of Qt.
|
||||
//
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
#include <QtCore/qfunctions_wince.h>
|
||||
#define UNDER_NT
|
||||
#include <wingdi.h>
|
||||
#include <objidl.h>
|
||||
|
||||
#ifndef WM_MOUSELEAVE
|
||||
# define WM_MOUSELEAVE 0x02A3
|
||||
#endif
|
||||
|
||||
#ifndef WM_TOUCH
|
||||
# define WM_TOUCH 0x0240
|
||||
#endif
|
||||
|
||||
#ifndef WM_GETOBJECT
|
||||
#define WM_GETOBJECT 0x003D
|
||||
#endif
|
||||
|
||||
#define GetWindowLongPtr GetWindowLong
|
||||
#define SetWindowLongPtr SetWindowLong
|
||||
#define GWLP_USERDATA GWL_USERDATA
|
||||
|
||||
#ifndef CWP_SKIPINVISIBLE
|
||||
#define CWP_SKIPINVISIBLE 0x0001
|
||||
#define CWP_SKIPTRANSPARENT 0x0004
|
||||
#endif
|
||||
|
||||
#ifndef CS_OWNDC
|
||||
#define CS_OWNDC 0x0020
|
||||
#endif
|
||||
|
||||
#ifndef HWND_MESSAGE
|
||||
#define HWND_MESSAGE 0
|
||||
#endif
|
||||
|
||||
// Real Value would be 0x40000000, but if we pass this to Windows Embedded Compact
|
||||
// he blits it wrongly, so lets not do any harm and define it to 0
|
||||
#ifndef CAPTUREBLT
|
||||
#define CAPTUREBLT (DWORD)0x0
|
||||
#endif
|
||||
|
||||
#define SW_SHOWMINIMIZED SW_MINIMIZE
|
||||
#define SW_SHOWMINNOACTIVE SW_MINIMIZE
|
||||
|
||||
#ifndef CF_DIBV5
|
||||
#define CF_DIBV5 17
|
||||
#endif
|
||||
|
||||
#ifndef WM_MOUSEACTIVATE
|
||||
#define WM_MOUSEACTIVATE 0x0021
|
||||
#endif
|
||||
|
||||
#ifndef WM_CHILDACTIVATE
|
||||
#define WM_CHILDACTIVATE 0x0022
|
||||
#endif
|
||||
|
||||
#ifndef WM_PARENTNOTIFY
|
||||
#define WM_PARENTNOTIFY 0x0210
|
||||
#endif
|
||||
|
||||
#ifndef WM_ENTERIDLE
|
||||
#define WM_ENTERIDLE 0x0121
|
||||
#endif
|
||||
|
||||
#ifndef WM_GETMINMAXINFO
|
||||
#define WM_GETMINMAXINFO 0x0024
|
||||
#endif
|
||||
|
||||
#ifndef WM_WINDOWPOSCHANGING
|
||||
#define WM_WINDOWPOSCHANGING 0x0046
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCMOUSEMOVE
|
||||
#define WM_NCMOUSEMOVE 0x00A0
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCMBUTTONDBLCLK
|
||||
#define WM_NCMBUTTONDBLCLK 0x00A
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCCREATE
|
||||
#define WM_NCCREATE 0x0081
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCCALCSIZE
|
||||
#define WM_NCCALCSIZE 0x0083
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCACTIVATE
|
||||
#define WM_NCACTIVATE 0x0086
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCMOUSELEAVE
|
||||
#define WM_NCMOUSELEAVE 0x02A2
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCLBUTTONDOWN
|
||||
#define WM_NCLBUTTONDOWN 0x00A1
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCLBUTTONUP
|
||||
#define WM_NCLBUTTONUP 0x00A2
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCPAINT
|
||||
#define WM_NCPAINT 0x0085
|
||||
#endif
|
||||
|
||||
#ifndef WM_NCHITTEST
|
||||
#define WM_NCHITTEST 0x0084
|
||||
#endif
|
||||
|
||||
#ifndef WM_THEMECHANGED
|
||||
#define WM_THEMECHANGED 0x031A
|
||||
#endif
|
||||
|
||||
#ifndef WM_DISPLAYCHANGE
|
||||
#define WM_DISPLAYCHANGE 0x007E
|
||||
#endif
|
||||
|
||||
#ifndef VREFRESH
|
||||
#define VREFRESH 116
|
||||
#endif
|
||||
|
||||
#ifndef SM_SWAPBUTTON
|
||||
#define SM_SWAPBUTTON 23
|
||||
#endif
|
||||
|
||||
// application defines
|
||||
#define SPI_SETNONCLIENTMETRICS 72
|
||||
#define SPI_SETICONTITLELOGFONT 0x0022
|
||||
#define WM_ACTIVATEAPP 0x001c
|
||||
#define SW_PARENTCLOSING 1
|
||||
#define SW_OTHERMAXIMIZED 2
|
||||
#define SW_PARENTOPENING 3
|
||||
#define SW_OTHERRESTORED 4
|
||||
#define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
|
||||
|
||||
// drag n drop
|
||||
#ifndef CFSTR_PERFORMEDDROPEFFECT
|
||||
#define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect")
|
||||
#endif
|
||||
|
||||
// QWidget
|
||||
#define SW_SHOWMINIMIZED SW_MINIMIZE
|
||||
|
||||
// QRegion
|
||||
#define ALTERNATE 0
|
||||
#define WINDING 1
|
||||
|
||||
// QFontEngine
|
||||
typedef struct _FIXED {
|
||||
WORD fract;
|
||||
short value;
|
||||
} FIXED;
|
||||
|
||||
typedef struct tagPOINTFX {
|
||||
FIXED x;
|
||||
FIXED y;
|
||||
} POINTFX;
|
||||
|
||||
typedef struct _MAT2 {
|
||||
FIXED eM11;
|
||||
FIXED eM12;
|
||||
FIXED eM21;
|
||||
FIXED eM22;
|
||||
} MAT2;
|
||||
|
||||
typedef struct _GLYPHMETRICS {
|
||||
UINT gmBlackBoxX;
|
||||
UINT gmBlackBoxY;
|
||||
POINT gmptGlyphOrigin;
|
||||
short gmCellIncX;
|
||||
short gmCellIncY;
|
||||
} GLYPHMETRICS;
|
||||
|
||||
typedef struct tagTTPOLYGONHEADER
|
||||
{
|
||||
DWORD cb;
|
||||
DWORD dwType;
|
||||
POINTFX pfxStart;
|
||||
} TTPOLYGONHEADER;
|
||||
|
||||
typedef struct tagTTPOLYCURVE
|
||||
{
|
||||
WORD wType;
|
||||
WORD cpfx;
|
||||
POINTFX apfx[1];
|
||||
} TTPOLYCURVE;
|
||||
|
||||
#define GGO_NATIVE 2
|
||||
#define GGO_GLYPH_INDEX 0x0080
|
||||
#define TT_PRIM_LINE 1
|
||||
#define TT_PRIM_QSPLINE 2
|
||||
#define TT_PRIM_CSPLINE 3
|
||||
#define ANSI_VAR_FONT 12
|
||||
|
||||
#ifndef OleInitialize
|
||||
#define OleInitialize(a) 0
|
||||
#endif
|
||||
|
||||
#ifndef SPI_GETSNAPTODEFBUTTON
|
||||
#define SPI_GETSNAPTODEFBUTTON 95
|
||||
#endif
|
||||
|
||||
#ifndef WS_EX_LAYERED
|
||||
#define WS_EX_LAYERED 0x00080000
|
||||
#endif
|
||||
|
||||
// Clipboard --------------------------------------------------------
|
||||
#ifndef WM_CHANGECBCHAIN
|
||||
#define WM_CHANGECBCHAIN 0x030D
|
||||
#endif
|
||||
|
||||
#ifndef WM_DRAWCLIPBOARD
|
||||
#define WM_DRAWCLIPBOARD 0x0308
|
||||
#endif
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
inline bool IsIconic( HWND /*hWnd*/ )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline int AddFontResourceExW( LPCWSTR name, DWORD /*fl*/, PVOID /*res*/)
|
||||
{
|
||||
QString fName = QString::fromWCharArray(name);
|
||||
QFileInfo fileinfo(fName);
|
||||
fName = fileinfo.absoluteFilePath();
|
||||
return AddFontResource((LPCWSTR)fName.utf16());
|
||||
}
|
||||
|
||||
inline bool RemoveFontResourceExW( LPCWSTR /*name*/, DWORD /*fl*/, PVOID /*pdv*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void OleUninitialize()
|
||||
{
|
||||
}
|
||||
|
||||
inline DWORD GetGlyphOutline( HDC /*hdc*/, UINT /*uChar*/, INT /*fuFormat*/, GLYPHMETRICS * /*lpgm*/,
|
||||
DWORD /*cjBuffer*/, LPVOID /*pvBuffer*/, CONST MAT2 * /*lpmat2*/ )
|
||||
{
|
||||
qFatal("GetGlyphOutline() not supported under Windows CE. Please try using freetype font-rendering, by "
|
||||
"passing the command line argument -platform windows:fontengine=freetype to the application.");
|
||||
return GDI_ERROR;
|
||||
}
|
||||
|
||||
inline HWND GetAncestor(HWND hWnd, UINT /*gaFlags*/)
|
||||
{
|
||||
return GetParent(hWnd);
|
||||
}
|
||||
|
||||
#ifndef GA_PARENT
|
||||
# define GA_PARENT 1
|
||||
#endif
|
||||
|
||||
#ifndef SPI_SETFONTSMOOTHINGTYPE
|
||||
# define SPI_SETFONTSMOOTHINGTYPE 0x200B
|
||||
#endif
|
||||
#ifndef SPI_GETFONTSMOOTHINGTYPE
|
||||
# define SPI_GETFONTSMOOTHINGTYPE 0x200A
|
||||
#endif
|
||||
#ifndef FE_FONTSMOOTHINGCLEARTYPE
|
||||
# define FE_FONTSMOOTHINGCLEARTYPE 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef DEVICE_FONTTYPE
|
||||
#define DEVICE_FONTTYPE 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef RASTER_FONTTYPE
|
||||
#define RASTER_FONTTYPE 0x0001
|
||||
#endif
|
||||
|
||||
#ifndef WM_DISPLAYCHANGE
|
||||
#define WM_DISPLAYCHANGE 0x007E
|
||||
#endif
|
||||
|
||||
BOOL qt_wince_ChangeClipboardChain(
|
||||
HWND hWndRemove, // handle to window to remove
|
||||
HWND hWndNewNext // handle to next window
|
||||
);
|
||||
#define ChangeClipboardChain(a,b) qt_wince_ChangeClipboardChain(a,b);
|
||||
|
||||
HWND qt_wince_SetClipboardViewer(
|
||||
HWND hWndNewViewer // handle to clipboard viewer window
|
||||
);
|
||||
#define SetClipboardViewer(a) qt_wince_SetClipboardViewer(a)
|
||||
|
||||
/* Shell stock icon IDs
|
||||
SHGetStockIconInfo() is not available on CE, but we're using these
|
||||
constants in code that is built on CE as well */
|
||||
enum
|
||||
{
|
||||
SIID_INVALID = -1,
|
||||
SIID_DOCNOASSOC = 0,
|
||||
SIID_FOLDER = 3,
|
||||
SIID_FOLDEROPEN = 4,
|
||||
SIID_DRIVE35 = 6,
|
||||
SIID_DRIVEFIXED = 8,
|
||||
SIID_DRIVENET = 9,
|
||||
SIID_DRIVECD = 11,
|
||||
SIID_HELP = 23,
|
||||
SIID_RECYCLER = 31,
|
||||
SIID_DRIVEDVD = 59,
|
||||
SIID_SHIELD = 77,
|
||||
SIID_WARNING = 78,
|
||||
SIID_INFO = 79,
|
||||
SIID_ERROR = 80
|
||||
};
|
||||
|
||||
#ifndef SHGSI_LINKOVERLAY
|
||||
// Value is wrong, but doesn't matter, not used at runtime
|
||||
#define SHGSI_LINKOVERLAY 0
|
||||
#endif
|
||||
|
||||
#endif // Q_OS_WINCE
|
||||
#endif // QPLATFORMFUNCTIONS_WCE_H
|
@ -43,9 +43,6 @@
|
||||
|
||||
#include "qtwindows_additional.h"
|
||||
#include <QtCore/qnamespace.h>
|
||||
#ifdef Q_OS_WINCE
|
||||
# include "qplatformfunctions_wince.h"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -158,10 +155,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
|
||||
case WM_MOUSEWHEEL:
|
||||
case WM_MOUSEHWHEEL:
|
||||
return QtWindows::MouseWheelEvent;
|
||||
#ifndef Q_OS_WINCE
|
||||
case WM_WINDOWPOSCHANGING:
|
||||
return QtWindows::GeometryChangingEvent;
|
||||
#endif
|
||||
case WM_MOVE:
|
||||
return QtWindows::MoveEvent;
|
||||
case WM_SHOWWINDOW:
|
||||
@ -172,10 +167,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
|
||||
return QtWindows::ResizeEvent;
|
||||
case WM_NCCALCSIZE:
|
||||
return QtWindows::CalculateSize;
|
||||
#ifndef Q_OS_WINCE
|
||||
case WM_NCHITTEST:
|
||||
return QtWindows::NonClientHitTest;
|
||||
#endif // !Q_OS_WINCE
|
||||
case WM_GETMINMAXINFO:
|
||||
return QtWindows::QuerySizeHints;
|
||||
case WM_KEYDOWN: // keyboard event
|
||||
@ -243,12 +236,10 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
|
||||
return QtWindows::ContextMenu;
|
||||
#endif
|
||||
case WM_SYSCOMMAND:
|
||||
#ifndef Q_OS_WINCE
|
||||
if ((wParamIn & 0xfff0) == SC_CONTEXTHELP)
|
||||
return QtWindows::WhatsThisEvent;
|
||||
#endif
|
||||
break;
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
case WM_QUERYENDSESSION:
|
||||
return QtWindows::QueryEndSessionApplicationEvent;
|
||||
case WM_ENDSESSION:
|
||||
|
@ -87,7 +87,6 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion,
|
||||
QWindowsWindow *rw = QWindowsWindow::windowsWindowOf(window);
|
||||
Q_ASSERT(rw);
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
const bool hasAlpha = rw->format().hasAlpha();
|
||||
const Qt::WindowFlags flags = window->flags();
|
||||
if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, hasAlpha, rw->opacity()) && hasAlpha) {
|
||||
@ -115,7 +114,6 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion,
|
||||
QWindowsContext::user32dll.updateLayeredWindow(rw->handle(), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA);
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
const HDC dc = rw->getDC();
|
||||
if (!dc) {
|
||||
qErrnoWarning("%s: GetDC failed", __FUNCTION__);
|
||||
@ -129,9 +127,7 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion,
|
||||
qErrnoWarning(int(lastError), "%s: BitBlt failed", __FUNCTION__);
|
||||
}
|
||||
rw->releaseDC();
|
||||
#ifndef Q_OS_WINCE
|
||||
}
|
||||
#endif
|
||||
|
||||
// Write image for debug purposes.
|
||||
if (QWindowsContext::verbose > 2 && lcQpaBackingStore().isDebugEnabled()) {
|
||||
|
@ -51,7 +51,7 @@
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
# include "accessible/qwindowsaccessibility.h"
|
||||
#endif
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
# include <private/qsessionmanager_p.h>
|
||||
# include "qwindowssessionmanager.h"
|
||||
#endif
|
||||
@ -76,9 +76,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <windowsx.h>
|
||||
#ifndef Q_OS_WINCE
|
||||
# include <comdef.h>
|
||||
#endif
|
||||
#include <comdef.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -101,9 +99,6 @@ int QWindowsContext::verbose = 0;
|
||||
|
||||
static inline bool useRTL_Extensions(QSysInfo::WinVersion ver)
|
||||
{
|
||||
// This is SDK dependent on CE so out of scope for now
|
||||
if (QSysInfo::windowsVersion() & QSysInfo::WV_CE_based)
|
||||
return false;
|
||||
if ((ver & QSysInfo::WV_NT_based) && (ver >= QSysInfo::WV_VISTA)) {
|
||||
// Since the IsValidLanguageGroup/IsValidLocale functions always return true on
|
||||
// Vista, check the Keyboard Layouts for enabling RTL.
|
||||
@ -124,7 +119,6 @@ static inline bool useRTL_Extensions(QSysInfo::WinVersion ver)
|
||||
}
|
||||
return false;
|
||||
} // NT/Vista
|
||||
#ifndef Q_OS_WINCE
|
||||
// Pre-NT: figure out whether a RTL language is installed
|
||||
return IsValidLanguageGroup(LGRPID_ARABIC, LGRPID_INSTALLED)
|
||||
|| IsValidLanguageGroup(LGRPID_HEBREW, LGRPID_INSTALLED)
|
||||
@ -132,12 +126,9 @@ static inline bool useRTL_Extensions(QSysInfo::WinVersion ver)
|
||||
|| IsValidLocale(MAKELCID(MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED)
|
||||
|| IsValidLocale(MAKELCID(MAKELANGID(LANG_SYRIAC, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED)
|
||||
|| IsValidLocale(MAKELCID(MAKELANGID(LANG_FARSI, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
static inline QWindowsSessionManager *platformSessionManager() {
|
||||
QGuiApplicationPrivate *guiPrivate = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
|
||||
QSessionManagerPrivate *managerPrivate = static_cast<QSessionManagerPrivate*>(QObjectPrivate::get(guiPrivate->session_manager));
|
||||
@ -160,9 +151,6 @@ static inline QWindowsSessionManager *platformSessionManager() {
|
||||
\internal
|
||||
\ingroup qt-lighthouse-win
|
||||
*/
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
QWindowsUser32DLL::QWindowsUser32DLL() :
|
||||
setLayeredWindowAttributes(0), updateLayeredWindow(0),
|
||||
updateLayeredWindowIndirect(0),
|
||||
@ -261,8 +249,6 @@ QWindowsUser32DLL QWindowsContext::user32dll;
|
||||
QWindowsShell32DLL QWindowsContext::shell32dll;
|
||||
QWindowsShcoreDLL QWindowsContext::shcoredll;
|
||||
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
QWindowsContext *QWindowsContext::m_instance = 0;
|
||||
|
||||
/*!
|
||||
@ -291,7 +277,7 @@ struct QWindowsContextPrivate {
|
||||
QWindowsMimeConverter m_mimeConverter;
|
||||
QWindowsScreenManager m_screenManager;
|
||||
QSharedPointer<QWindowCreationContext> m_creationContext;
|
||||
#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
|
||||
#if !defined(QT_NO_TABLETEVENT)
|
||||
QScopedPointer<QWindowsTabletSupport> m_tabletSupport;
|
||||
#endif
|
||||
const HRESULT m_oleInitializeResult;
|
||||
@ -307,14 +293,12 @@ QWindowsContextPrivate::QWindowsContextPrivate()
|
||||
, m_lastActiveWindow(0), m_asyncExpose(0)
|
||||
{
|
||||
const QSysInfo::WinVersion ver = QSysInfo::windowsVersion();
|
||||
#ifndef Q_OS_WINCE
|
||||
QWindowsContext::user32dll.init();
|
||||
QWindowsContext::shell32dll.init();
|
||||
QWindowsContext::shcoredll.init();
|
||||
|
||||
if (m_mouseHandler.touchDevice() && QWindowsContext::user32dll.initTouch())
|
||||
m_systemInfo |= QWindowsContext::SI_SupportsTouch;
|
||||
#endif // !Q_OS_WINCE
|
||||
m_displayContext = GetDC(0);
|
||||
m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY);
|
||||
if (useRTL_Extensions(ver)) {
|
||||
@ -338,7 +322,7 @@ QWindowsContext::QWindowsContext() :
|
||||
const QByteArray bv = qgetenv("QT_QPA_VERBOSE");
|
||||
if (!bv.isEmpty())
|
||||
QLoggingCategory::setFilterRules(QString::fromLocal8Bit(bv));
|
||||
#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
|
||||
#if !defined(QT_NO_TABLETEVENT)
|
||||
d->m_tabletSupport.reset(QWindowsTabletSupport::create());
|
||||
qCDebug(lcQpaTablet) << "Tablet support: " << (d->m_tabletSupport.isNull() ? QStringLiteral("None") : d->m_tabletSupport->description());
|
||||
#endif
|
||||
@ -346,7 +330,7 @@ QWindowsContext::QWindowsContext() :
|
||||
|
||||
QWindowsContext::~QWindowsContext()
|
||||
{
|
||||
#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
|
||||
#if !defined(QT_NO_TABLETEVENT)
|
||||
d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes.
|
||||
#endif
|
||||
unregisterWindowClasses();
|
||||
@ -371,12 +355,10 @@ bool QWindowsContext::initTouch(unsigned integrationOptions)
|
||||
if (!touchDevice)
|
||||
return false;
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
if (!QWindowsContext::user32dll.initTouch()) {
|
||||
delete touchDevice;
|
||||
return false;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
if (!(integrationOptions & QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch))
|
||||
touchDevice->setCapabilities(touchDevice->capabilities() | QTouchDevice::MouseEmulation);
|
||||
@ -389,7 +371,7 @@ bool QWindowsContext::initTouch(unsigned integrationOptions)
|
||||
|
||||
void QWindowsContext::setTabletAbsoluteRange(int a)
|
||||
{
|
||||
#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
|
||||
#if !defined(QT_NO_TABLETEVENT)
|
||||
if (!d->m_tabletSupport.isNull())
|
||||
d->m_tabletSupport->setAbsoluteRange(a);
|
||||
#else
|
||||
@ -399,19 +381,16 @@ void QWindowsContext::setTabletAbsoluteRange(int a)
|
||||
|
||||
int QWindowsContext::processDpiAwareness()
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
int result;
|
||||
if (QWindowsContext::shcoredll.getProcessDpiAwareness
|
||||
&& SUCCEEDED(QWindowsContext::shcoredll.getProcessDpiAwareness(NULL, &result))) {
|
||||
return result;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
return -1;
|
||||
}
|
||||
|
||||
void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
qCDebug(lcQpaWindows) << __FUNCTION__ << dpiAwareness;
|
||||
if (QWindowsContext::shcoredll.isValid()) {
|
||||
const HRESULT hr = QWindowsContext::shcoredll.setProcessDpiAwareness(dpiAwareness);
|
||||
@ -426,9 +405,6 @@ void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiA
|
||||
qErrnoWarning("SetProcessDPIAware() failed");
|
||||
}
|
||||
}
|
||||
#else // !Q_OS_WINCE
|
||||
Q_UNUSED(dpiAwareness)
|
||||
#endif
|
||||
}
|
||||
|
||||
QWindowsContext *QWindowsContext::instance()
|
||||
@ -559,19 +535,14 @@ QString QWindowsContext::registerWindowClass(QString cname,
|
||||
if (d->m_registeredWindowClassNames.contains(cname)) // already registered in our list
|
||||
return cname;
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
WNDCLASSEX wc;
|
||||
wc.cbSize = sizeof(WNDCLASSEX);
|
||||
#else
|
||||
WNDCLASS wc;
|
||||
#endif
|
||||
wc.style = style;
|
||||
wc.lpfnWndProc = proc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = appInstance;
|
||||
wc.hCursor = 0;
|
||||
#ifndef Q_OS_WINCE
|
||||
wc.hbrBackground = brush;
|
||||
if (icon) {
|
||||
wc.hIcon = static_cast<HICON>(LoadImage(appInstance, L"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE));
|
||||
@ -587,22 +558,10 @@ QString QWindowsContext::registerWindowClass(QString cname,
|
||||
wc.hIcon = 0;
|
||||
wc.hIconSm = 0;
|
||||
}
|
||||
#else
|
||||
if (icon) {
|
||||
wc.hIcon = (HICON)LoadImage(appInstance, L"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
|
||||
} else {
|
||||
wc.hIcon = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
wc.lpszMenuName = 0;
|
||||
wc.lpszClassName = reinterpret_cast<LPCWSTR>(cname.utf16());
|
||||
#ifndef Q_OS_WINCE
|
||||
ATOM atom = RegisterClassEx(&wc);
|
||||
#else
|
||||
ATOM atom = RegisterClass(&wc);
|
||||
#endif
|
||||
|
||||
if (!atom)
|
||||
qErrnoWarning("QApplication::regClass: Registering window class '%s' failed.",
|
||||
qPrintable(cname));
|
||||
@ -720,28 +679,14 @@ static inline bool findPlatformWindowHelper(const POINT &screenPoint, unsigned c
|
||||
POINT point = screenPoint;
|
||||
ScreenToClient(*hwnd, &point);
|
||||
// Returns parent if inside & none matched.
|
||||
#ifndef Q_OS_WINCE
|
||||
const HWND child = ChildWindowFromPointEx(*hwnd, point, cwexFlags);
|
||||
#else
|
||||
// Under Windows CE we don't use ChildWindowFromPointEx as it's not available
|
||||
// and ChildWindowFromPoint does not work properly.
|
||||
Q_UNUSED(cwexFlags)
|
||||
const HWND child = WindowFromPoint(point);
|
||||
#endif
|
||||
if (!child || child == *hwnd)
|
||||
return false;
|
||||
if (QWindowsWindow *window = context->findPlatformWindow(child)) {
|
||||
*result = window;
|
||||
*hwnd = child;
|
||||
#ifndef Q_OS_WINCE
|
||||
return true;
|
||||
#else
|
||||
// WindowFromPoint does not return same handle in two sequential calls, which leads
|
||||
// to an endless loop, but calling WindowFromPoint once is good enough.
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#ifndef Q_OS_WINCE // Does not have WS_EX_TRANSPARENT .
|
||||
// QTBUG-40555: despite CWP_SKIPINVISIBLE, it is possible to hit on invisible
|
||||
// full screen windows of other applications that have WS_EX_TRANSPARENT set
|
||||
// (for example created by screen sharing applications). In that case, try to
|
||||
@ -757,7 +702,6 @@ static inline bool findPlatformWindowHelper(const POINT &screenPoint, unsigned c
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
*hwnd = child;
|
||||
return true;
|
||||
}
|
||||
@ -784,7 +728,7 @@ QWindowsScreenManager &QWindowsContext::screenManager()
|
||||
|
||||
QWindowsTabletSupport *QWindowsContext::tabletSupport() const
|
||||
{
|
||||
#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
|
||||
#if !defined(QT_NO_TABLETEVENT)
|
||||
return d->m_tabletSupport.data();
|
||||
#else
|
||||
return 0;
|
||||
@ -810,7 +754,6 @@ HWND QWindowsContext::createDummyWindow(const QString &classNameIn,
|
||||
HWND_MESSAGE, NULL, static_cast<HINSTANCE>(GetModuleHandle(0)), NULL);
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
// Re-engineered from the inline function _com_error::ErrorMessage().
|
||||
// We cannot use it directly since it uses swprintf_s(), which is not
|
||||
// present in the MSVCRT.DLL found on Windows XP (QTBUG-35617).
|
||||
@ -829,7 +772,6 @@ static inline QString errorMessageFromComError(const _com_error &comError)
|
||||
return QStringLiteral("IDispatch error #") + QString::number(wCode);
|
||||
return QStringLiteral("Unknown error 0x0") + QString::number(comError.Error(), 16);
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
/*!
|
||||
\brief Common COM error strings.
|
||||
@ -894,12 +836,10 @@ QByteArray QWindowsContext::comErrorString(HRESULT hr)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#ifndef Q_OS_WINCE
|
||||
_com_error error(hr);
|
||||
result += QByteArrayLiteral(" (");
|
||||
result += errorMessageFromComError(error);
|
||||
result += ')';
|
||||
#endif // !Q_OS_WINCE
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -935,9 +875,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
ClientToScreen(msg.hwnd, &msg.pt);
|
||||
}
|
||||
} else {
|
||||
#ifndef Q_OS_WINCE
|
||||
GetCursorPos(&msg.pt);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Run the native event filters.
|
||||
@ -980,7 +918,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
|
||||
switch (et) {
|
||||
case QtWindows::GestureEvent:
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
#else
|
||||
return d->m_mouseHandler.translateGestureEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
@ -1019,11 +957,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
// Pass on to current creation context
|
||||
if (!platformWindow && !d->m_creationContext.isNull()) {
|
||||
switch (et) {
|
||||
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
|
||||
case QtWindows::QuerySizeHints:
|
||||
d->m_creationContext->applyToMinMaxInfo(reinterpret_cast<MINMAXINFO *>(lParam));
|
||||
return true;
|
||||
#endif
|
||||
case QtWindows::ResizeEvent:
|
||||
d->m_creationContext->obtainedGeometry.setSize(QSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
|
||||
return true;
|
||||
@ -1061,7 +997,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
case QtWindows::InputMethodKeyEvent:
|
||||
case QtWindows::InputMethodKeyDownEvent:
|
||||
case QtWindows::AppCommandEvent:
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
return platformSessionManager()->isInteractionBlocked() ? true : d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
|
||||
#else
|
||||
return d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result);
|
||||
@ -1072,7 +1008,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
case QtWindows::ResizeEvent:
|
||||
platformWindow->handleResized(static_cast<int>(wParam));
|
||||
return true;
|
||||
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
|
||||
case QtWindows::QuerySizeHints:
|
||||
platformWindow->getSizeHints(reinterpret_cast<MINMAXINFO *>(lParam));
|
||||
return true;// maybe available on some SDKs revisit WM_NCCALCSIZE
|
||||
@ -1082,30 +1017,18 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
return platformWindow->handleNonClientHitTest(QPoint(msg.pt.x, msg.pt.y), result);
|
||||
case QtWindows::GeometryChangingEvent:
|
||||
return platformWindow->QWindowsWindow::handleGeometryChanging(&msg);
|
||||
#endif // !Q_OS_WINCE
|
||||
case QtWindows::ExposeEvent:
|
||||
return platformWindow->handleWmPaint(hwnd, message, wParam, lParam);
|
||||
case QtWindows::NonClientMouseEvent:
|
||||
if (platformWindow->frameStrutEventsEnabled())
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
#else
|
||||
return d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
#endif
|
||||
break;
|
||||
/* the mouse tracking on windows already handles the reset of the cursor
|
||||
* and does not like somebody else handling it.
|
||||
* on WINCE its necessary to handle this event to get the correct cursor
|
||||
*/
|
||||
#ifdef Q_OS_WINCE
|
||||
case QtWindows::CursorEvent:
|
||||
{
|
||||
QWindowsWindow::baseWindowOf(platformWindow->window())->applyCursor();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
case QtWindows::ScrollEvent:
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateScrollEvent(platformWindow->window(), hwnd, msg, result);
|
||||
#else
|
||||
return d->m_mouseHandler.translateScrollEvent(platformWindow->window(), hwnd, msg, result);
|
||||
@ -1113,13 +1036,13 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
case QtWindows::MouseWheelEvent:
|
||||
case QtWindows::MouseEvent:
|
||||
case QtWindows::LeaveEvent:
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
#else
|
||||
return d->m_mouseHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
#endif
|
||||
case QtWindows::TouchEvent:
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
return platformSessionManager()->isInteractionBlocked() ? true : d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
#else
|
||||
return d->m_mouseHandler.translateTouchEvent(platformWindow->window(), hwnd, et, msg, result);
|
||||
@ -1152,7 +1075,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
case QtWindows::CompositionSettingsChanged:
|
||||
platformWindow->handleCompositionSettingsChanged();
|
||||
return true;
|
||||
#ifndef Q_OS_WINCE
|
||||
case QtWindows::ActivateWindowEvent:
|
||||
if (platformWindow->window()->flags() & Qt::WindowDoesNotAcceptFocus) {
|
||||
*result = LRESULT(MA_NOACTIVATE);
|
||||
@ -1175,7 +1097,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifndef QT_NO_CONTEXTMENU
|
||||
case QtWindows::ContextMenu:
|
||||
return handleContextMenuEvent(platformWindow->window(), msg);
|
||||
@ -1186,7 +1107,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
return true;
|
||||
#endif
|
||||
} break;
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
case QtWindows::QueryEndSessionApplicationEvent: {
|
||||
QWindowsSessionManager *sessionManager = platformSessionManager();
|
||||
if (sessionManager->isActive()) { // bogus message from windows
|
||||
@ -1226,7 +1147,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif // !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#endif // !defined(QT_NO_SESSIONMANAGER)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -79,7 +79,6 @@ class QPoint;
|
||||
class QKeyEvent;
|
||||
class QTouchDevice;
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
struct QWindowsUser32DLL
|
||||
{
|
||||
QWindowsUser32DLL();
|
||||
@ -163,8 +162,6 @@ struct QWindowsShcoreDLL {
|
||||
GetDpiForMonitor getDpiForMonitor;
|
||||
};
|
||||
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
class QWindowsContext
|
||||
{
|
||||
Q_DISABLE_COPY(QWindowsContext)
|
||||
@ -236,11 +233,10 @@ public:
|
||||
QWindowsMimeConverter &mimeConverter() const;
|
||||
QWindowsScreenManager &screenManager();
|
||||
QWindowsTabletSupport *tabletSupport() const;
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
static QWindowsUser32DLL user32dll;
|
||||
static QWindowsShell32DLL shell32dll;
|
||||
static QWindowsShcoreDLL shcoredll;
|
||||
#endif
|
||||
|
||||
static QByteArray comErrorString(HRESULT hr);
|
||||
bool asyncExpose() const;
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
static bool initResources()
|
||||
{
|
||||
#if !defined (Q_OS_WINCE) && !defined (QT_NO_IMAGEFORMAT_PNG)
|
||||
#if !defined (QT_NO_IMAGEFORMAT_PNG)
|
||||
Q_INIT_RESOURCE(cursors);
|
||||
#endif
|
||||
return true;
|
||||
@ -143,7 +143,6 @@ static HCURSOR createBitmapCursor(const QImage &bbits, const QImage &mbits,
|
||||
if (hotSpot.y() < 0)
|
||||
hotSpot.setY(height / 2);
|
||||
const int n = qMax(1, width / 8);
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QScopedArrayPointer<uchar> xBits(new uchar[height * n]);
|
||||
QScopedArrayPointer<uchar> xMask(new uchar[height * n]);
|
||||
int x = 0;
|
||||
@ -164,54 +163,6 @@ static HCURSOR createBitmapCursor(const QImage &bbits, const QImage &mbits,
|
||||
}
|
||||
return CreateCursor(GetModuleHandle(0), hotSpot.x(), hotSpot.y(), width, height,
|
||||
xBits.data(), xMask.data());
|
||||
#elif defined(GWES_ICONCURS) // Q_OS_WINCE
|
||||
// Windows CE only supports fixed cursor size.
|
||||
int sysW = GetSystemMetrics(SM_CXCURSOR);
|
||||
int sysH = GetSystemMetrics(SM_CYCURSOR);
|
||||
int sysN = qMax(1, sysW / 8);
|
||||
uchar* xBits = new uchar[sysH * sysN];
|
||||
uchar* xMask = new uchar[sysH * sysN];
|
||||
int x = 0;
|
||||
for (int i = 0; i < sysH; ++i) {
|
||||
if (i >= height) {
|
||||
memset(&xBits[x] , 255, sysN);
|
||||
memset(&xMask[x] , 0, sysN);
|
||||
x += sysN;
|
||||
} else {
|
||||
int fillWidth = n > sysN ? sysN : n;
|
||||
const uchar *bits = bbits.constScanLine(i);
|
||||
const uchar *mask = mbits.constScanLine(i);
|
||||
for (int j = 0; j < fillWidth; ++j) {
|
||||
uchar b = bits[j];
|
||||
uchar m = mask[j];
|
||||
if (invb)
|
||||
b ^= 0xFF;
|
||||
if (invm)
|
||||
m ^= 0xFF;
|
||||
xBits[x] = ~m;
|
||||
xMask[x] = b ^ m;
|
||||
++x;
|
||||
}
|
||||
for (int j = fillWidth; j < sysN; ++j ) {
|
||||
xBits[x] = 255;
|
||||
xMask[x] = 0;
|
||||
++x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HCURSOR hcurs = CreateCursor(qWinAppInst(), hotSpot.x(), hotSpot.y(), sysW, sysH,
|
||||
xBits, xMask);
|
||||
delete [] xBits;
|
||||
delete [] xMask;
|
||||
return hcurs;
|
||||
#else
|
||||
Q_UNUSED(n);
|
||||
Q_UNUSED(invm);
|
||||
Q_UNUSED(invb);
|
||||
Q_UNUSED(mbits);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Create a cursor from image and mask of the format QImage::Format_Mono.
|
||||
@ -252,7 +203,7 @@ static QSize systemCursorSize(const QPlatformScreen *screen = Q_NULLPTR)
|
||||
return primaryScreenCursorSize;
|
||||
}
|
||||
|
||||
#if defined (Q_OS_WINCE) || defined (QT_NO_IMAGEFORMAT_PNG)
|
||||
#if defined (QT_NO_IMAGEFORMAT_PNG)
|
||||
|
||||
static inline QSize standardCursorSize() { return QSize(32, 32); }
|
||||
|
||||
@ -468,7 +419,7 @@ QWindowsCursor::PixmapCursor QWindowsCursor::customCursor(Qt::CursorShape cursor
|
||||
|
||||
return QWindowsCursor::PixmapCursor();
|
||||
}
|
||||
#else // Q_OS_WINCE || QT_NO_IMAGEFORMAT_PNG
|
||||
#else // QT_NO_IMAGEFORMAT_PNG
|
||||
struct QWindowsCustomPngCursor {
|
||||
Qt::CursorShape shape;
|
||||
int size;
|
||||
@ -526,7 +477,7 @@ QWindowsCursor::PixmapCursor QWindowsCursor::customCursor(Qt::CursorShape cursor
|
||||
QString::fromLatin1(bestFit->fileName));
|
||||
return PixmapCursor(rawImage, QPoint(bestFit->hotSpotX, bestFit->hotSpotY));
|
||||
}
|
||||
#endif // Q_OS_WINCE || QT_NO_IMAGEFORMAT_PNG
|
||||
#endif // !QT_NO_IMAGEFORMAT_PNG
|
||||
|
||||
struct QWindowsStandardCursorMapping {
|
||||
Qt::CursorShape shape;
|
||||
@ -575,13 +526,8 @@ HCURSOR QWindowsCursor::createCursorFromShape(Qt::CursorShape cursorShape, const
|
||||
// Load available standard cursors from resources
|
||||
const QWindowsStandardCursorMapping *sEnd = standardCursors + sizeof(standardCursors) / sizeof(standardCursors[0]);
|
||||
for (const QWindowsStandardCursorMapping *s = standardCursors; s < sEnd; ++s) {
|
||||
if (s->shape == cursorShape) {
|
||||
#ifndef Q_OS_WINCE
|
||||
if (s->shape == cursorShape)
|
||||
return static_cast<HCURSOR>(LoadImage(0, s->resource, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE | LR_SHARED));
|
||||
#else
|
||||
return LoadCursor(0, s->resource);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
qWarning("%s: Invalid cursor shape %d", __FUNCTION__, cursorShape);
|
||||
@ -677,7 +623,6 @@ QPoint QWindowsCursor::mousePosition()
|
||||
|
||||
QWindowsCursor::CursorState QWindowsCursor::cursorState()
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
enum { cursorShowing = 0x1, cursorSuppressed = 0x2 }; // Windows 8: CURSOR_SUPPRESSED
|
||||
CURSORINFO cursorInfo;
|
||||
cursorInfo.cbSize = sizeof(CURSORINFO);
|
||||
@ -687,7 +632,6 @@ QWindowsCursor::CursorState QWindowsCursor::cursorState()
|
||||
if (cursorInfo.flags & cursorSuppressed)
|
||||
return CursorSuppressed;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
return CursorHidden;
|
||||
}
|
||||
|
||||
@ -758,7 +702,6 @@ QPixmap QWindowsCursor::dragDefaultCursor(Qt::DropAction action) const
|
||||
"...............XXXX....."};
|
||||
|
||||
if (m_ignoreDragCursor.isNull()) {
|
||||
#if !defined (Q_OS_WINCE)
|
||||
HCURSOR cursor = LoadCursor(NULL, IDC_NO);
|
||||
ICONINFO iconInfo = {0, 0, 0, 0, 0};
|
||||
GetIconInfo(cursor, &iconInfo);
|
||||
@ -782,9 +725,6 @@ QPixmap QWindowsCursor::dragDefaultCursor(Qt::DropAction action) const
|
||||
DeleteObject(iconInfo.hbmMask);
|
||||
DeleteObject(iconInfo.hbmColor);
|
||||
DestroyCursor(cursor);
|
||||
#else // !Q_OS_WINCE
|
||||
m_ignoreDragCursor = QPixmap(ignoreDragCursorXpmC);
|
||||
#endif // !Q_OS_WINCE
|
||||
}
|
||||
return m_ignoreDragCursor;
|
||||
}
|
||||
|
@ -637,7 +637,6 @@ void QWindowsDialogHelperBase<BaseClass>::stopTimer()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
// Find a file dialog window created by IFileDialog by process id, window
|
||||
// title and class, which starts with a hash '#'.
|
||||
|
||||
@ -673,7 +672,6 @@ static inline HWND findDialogWindow(const QString &title)
|
||||
EnumWindows(findDialogEnumWindowsProc, reinterpret_cast<LPARAM>(&context));
|
||||
return context.hwnd;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
template <class BaseClass>
|
||||
void QWindowsDialogHelperBase<BaseClass>::hide()
|
||||
@ -989,7 +987,6 @@ void QWindowsNativeFileDialogBase::setWindowTitle(const QString &title)
|
||||
|
||||
IShellItem *QWindowsNativeFileDialogBase::shellItem(const QUrl &url)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
if (url.isLocalFile()) {
|
||||
if (!QWindowsContext::shell32dll.sHCreateItemFromParsingName)
|
||||
return Q_NULLPTR;
|
||||
@ -1032,9 +1029,6 @@ IShellItem *QWindowsNativeFileDialogBase::shellItem(const QUrl &url)
|
||||
} else {
|
||||
qWarning() << __FUNCTION__ << ": Unhandled scheme: " << url.scheme();
|
||||
}
|
||||
#else // !Q_OS_WINCE
|
||||
Q_UNUSED(url)
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1050,11 +1044,9 @@ void QWindowsNativeFileDialogBase::setDirectory(const QUrl &directory)
|
||||
|
||||
QString QWindowsNativeFileDialogBase::directory() const
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
IShellItem *item = 0;
|
||||
if (m_fileDialog && SUCCEEDED(m_fileDialog->GetFolder(&item)) && item)
|
||||
return QWindowsNativeFileDialogBase::itemPath(item);
|
||||
#endif
|
||||
return QString();
|
||||
}
|
||||
|
||||
@ -1106,7 +1098,7 @@ void QWindowsNativeFileDialogBase::setMode(QFileDialogOptions::FileMode mode,
|
||||
qErrnoWarning("%s: SetOptions() failed", __FUNCTION__);
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_WINCE) && defined(__IShellLibrary_INTERFACE_DEFINED__) // Windows SDK 7
|
||||
#if defined(__IShellLibrary_INTERFACE_DEFINED__) // Windows SDK 7
|
||||
|
||||
// Helper for "Libraries": collections of folders appearing from Windows 7
|
||||
// on, visible in the file dialogs.
|
||||
@ -1159,7 +1151,7 @@ QString QWindowsNativeFileDialogBase::libraryItemDefaultSaveFolder(IShellItem *i
|
||||
return result;
|
||||
}
|
||||
|
||||
#else // !Q_OS_WINCE && __IShellLibrary_INTERFACE_DEFINED__
|
||||
#else // __IShellLibrary_INTERFACE_DEFINED__
|
||||
|
||||
QList<QUrl> QWindowsNativeFileDialogBase::libraryItemFolders(IShellItem *)
|
||||
{
|
||||
@ -1171,7 +1163,7 @@ QString QWindowsNativeFileDialogBase::libraryItemDefaultSaveFolder(IShellItem *)
|
||||
return QString();
|
||||
}
|
||||
|
||||
#endif // Q_OS_WINCE || !__IShellLibrary_INTERFACE_DEFINED__
|
||||
#endif // !__IShellLibrary_INTERFACE_DEFINED__
|
||||
|
||||
QString QWindowsNativeFileDialogBase::itemPath(IShellItem *item)
|
||||
{
|
||||
@ -1417,14 +1409,12 @@ bool QWindowsNativeFileDialogBase::onFileOk()
|
||||
void QWindowsNativeFileDialogBase::close()
|
||||
{
|
||||
m_fileDialog->Close(S_OK);
|
||||
#ifndef Q_OS_WINCE
|
||||
// IFileDialog::Close() does not work unless invoked from a callback.
|
||||
// Try to find the window and send it a WM_CLOSE in addition.
|
||||
const HWND hwnd = findDialogWindow(m_title);
|
||||
qCDebug(lcQpaDialogs) << __FUNCTION__ << "closing" << hwnd;
|
||||
if (hwnd && IsWindowVisible(hwnd))
|
||||
PostMessageW(hwnd, WM_CLOSE, 0, 0);
|
||||
#endif // !Q_OS_WINCE
|
||||
}
|
||||
|
||||
HRESULT QWindowsNativeFileDialogEventHandler::OnFolderChanging(IFileDialog *, IShellItem *item)
|
||||
@ -1725,8 +1715,6 @@ QString QWindowsFileDialogHelper::selectedNameFilter() const
|
||||
return m_data.selectedNameFilter();
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
/*!
|
||||
\class QWindowsXpNativeFileDialog
|
||||
\brief Native Windows directory dialog for Windows XP using SHlib-functions.
|
||||
@ -2050,8 +2038,6 @@ QString QWindowsXpFileDialogHelper::selectedNameFilter() const
|
||||
return m_data.selectedNameFilter();
|
||||
}
|
||||
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
/*!
|
||||
\class QWindowsNativeColorDialog
|
||||
\brief Native Windows color dialog.
|
||||
@ -2204,17 +2190,13 @@ QPlatformDialogHelper *createHelper(QPlatformTheme::DialogType type)
|
||||
if (QWindowsIntegration::instance()->options() & QWindowsIntegration::NoNativeDialogs)
|
||||
return 0;
|
||||
switch (type) {
|
||||
case QPlatformTheme::FileDialog:
|
||||
#ifndef Q_OS_WINCE // Note: "Windows XP Professional x64 Edition has version number WV_5_2 (WV_2003).
|
||||
case QPlatformTheme::FileDialog: // Note: "Windows XP Professional x64 Edition has version number WV_5_2 (WV_2003).
|
||||
if (QWindowsIntegration::instance()->options() & QWindowsIntegration::XpNativeDialogs
|
||||
|| QSysInfo::windowsVersion() <= QSysInfo::WV_2003) {
|
||||
return new QWindowsXpFileDialogHelper();
|
||||
}
|
||||
if (QSysInfo::windowsVersion() > QSysInfo::WV_2003)
|
||||
return new QWindowsFileDialogHelper();
|
||||
#else
|
||||
return new QWindowsFileDialogHelper();
|
||||
#endif // Q_OS_WINCE
|
||||
case QPlatformTheme::ColorDialog:
|
||||
#ifdef USE_NATIVE_COLOR_DIALOG
|
||||
return new QWindowsColorDialogHelper();
|
||||
|
@ -95,13 +95,9 @@ static void *resolveFunc(HMODULE lib, const char *name)
|
||||
return proc;
|
||||
}
|
||||
#else
|
||||
static void *resolveFunc(HMODULE lib, const char *name)
|
||||
static inline void *resolveFunc(HMODULE lib, const char *name)
|
||||
{
|
||||
# ifndef Q_OS_WINCE
|
||||
return (void *) ::GetProcAddress(lib, name);
|
||||
# else
|
||||
return (void *) ::GetProcAddress(lib, (const wchar_t *) QString::fromLatin1(name).utf16());
|
||||
# endif // Q_OS_WINCE
|
||||
return ::GetProcAddress(lib, name);
|
||||
}
|
||||
#endif // Q_CC_MINGW
|
||||
|
||||
@ -121,7 +117,7 @@ void *QWindowsLibEGL::resolve(const char *name)
|
||||
bool QWindowsLibEGL::init()
|
||||
{
|
||||
const char dllName[] = QT_STRINGIFY(LIBEGL_NAME)
|
||||
#if defined(QT_DEBUG) && !defined(Q_OS_WINCE)
|
||||
#if defined(QT_DEBUG)
|
||||
"d"
|
||||
#endif
|
||||
"";
|
||||
@ -178,7 +174,7 @@ bool QWindowsLibGLESv2::init()
|
||||
{
|
||||
|
||||
const char dllName[] = QT_STRINGIFY(LIBGLESV2_NAME)
|
||||
#if defined(QT_DEBUG) && !defined(Q_OS_WINCE)
|
||||
#if defined(QT_DEBUG)
|
||||
"d"
|
||||
#endif
|
||||
"";
|
||||
|
@ -57,10 +57,6 @@
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
# include "qplatformfunctions_wince.h"
|
||||
#endif
|
||||
|
||||
#if !defined(QT_NO_DIRECTWRITE)
|
||||
# include <dwrite.h>
|
||||
# include <d2d1.h>
|
||||
@ -931,17 +927,6 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
quint32 codePageRange[2] = {
|
||||
signature->fsCsb[0], signature->fsCsb[1]
|
||||
};
|
||||
#ifdef Q_OS_WINCE
|
||||
if (signature->fsUsb[0] == 0) {
|
||||
// If the unicode ranges bit mask is zero then
|
||||
// EnumFontFamiliesEx failed to determine it properly.
|
||||
// In this case we just pretend that the font supports all languages.
|
||||
unicodeRange[0] = 0xbfffffff; // second most significant bit must be zero
|
||||
unicodeRange[1] = 0xffffffff;
|
||||
unicodeRange[2] = 0xffffffff;
|
||||
unicodeRange[3] = 0xffffffff;
|
||||
}
|
||||
#endif
|
||||
writingSystems = QPlatformFontDatabase::writingSystemsFromTrueTypeBits(unicodeRange, codePageRange);
|
||||
// ### Hack to work around problem with Thai text on Windows 7. Segoe UI contains
|
||||
// the symbol for Baht, and Windows thus reports that it supports the Thai script.
|
||||
@ -1101,9 +1086,8 @@ QWindowsFontEngineDataPtr sharedFontData()
|
||||
}
|
||||
#endif // QT_NO_THREAD
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
extern Q_GUI_EXPORT bool qt_needs_a8_gamma_correction;
|
||||
#endif
|
||||
|
||||
QWindowsFontDatabase::QWindowsFontDatabase()
|
||||
{
|
||||
// Properties accessed by QWin32PrintEngine (Qt Print Support)
|
||||
@ -1117,9 +1101,7 @@ QWindowsFontDatabase::QWindowsFontDatabase()
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__ << "Clear type: "
|
||||
<< data->clearTypeEnabled << "gamma: " << data->fontSmoothingGamma;
|
||||
}
|
||||
#ifndef Q_OS_WINCE
|
||||
qt_needs_a8_gamma_correction = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
QWindowsFontDatabase::~QWindowsFontDatabase()
|
||||
@ -1570,14 +1552,12 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request)
|
||||
int strat = OUT_DEFAULT_PRECIS;
|
||||
if (request.styleStrategy & QFont::PreferBitmap) {
|
||||
strat = OUT_RASTER_PRECIS;
|
||||
#ifndef Q_OS_WINCE
|
||||
} else if (request.styleStrategy & QFont::PreferDevice) {
|
||||
strat = OUT_DEVICE_PRECIS;
|
||||
} else if (request.styleStrategy & QFont::PreferOutline) {
|
||||
strat = OUT_OUTLINE_PRECIS;
|
||||
} else if (request.styleStrategy & QFont::ForceOutline) {
|
||||
strat = OUT_TT_ONLY_PRECIS;
|
||||
#endif
|
||||
}
|
||||
|
||||
lf.lfOutPrecision = strat;
|
||||
@ -1586,10 +1566,8 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request)
|
||||
|
||||
if (request.styleStrategy & QFont::PreferMatch)
|
||||
qual = DRAFT_QUALITY;
|
||||
#ifndef Q_OS_WINCE
|
||||
else if (request.styleStrategy & QFont::PreferQuality)
|
||||
qual = PROOF_QUALITY;
|
||||
#endif
|
||||
|
||||
if (request.styleStrategy & QFont::PreferAntialias) {
|
||||
if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && !(request.styleStrategy & QFont::NoSubpixelAntialias)) {
|
||||
|
@ -53,10 +53,6 @@
|
||||
#include <QtGui/QFontDatabase>
|
||||
|
||||
#include <wchar.h>
|
||||
#ifdef Q_OS_WINCE
|
||||
#include <QtCore/QFile>
|
||||
#include <QtEndian>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -108,8 +104,6 @@ static FontFile * createFontFile(const QString &fileName, int index)
|
||||
extern bool localizedName(const QString &name);
|
||||
extern QString getEnglishName(const QString &familyName);
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
namespace {
|
||||
struct FontKey
|
||||
{
|
||||
@ -165,223 +159,6 @@ static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR)
|
||||
return Q_NULLPTR;
|
||||
}
|
||||
|
||||
#else // Q_OS_WINCE
|
||||
|
||||
typedef struct {
|
||||
quint16 majorVersion;
|
||||
quint16 minorVersion;
|
||||
quint16 numTables;
|
||||
quint16 searchRange;
|
||||
quint16 entrySelector;
|
||||
quint16 rangeShift;
|
||||
} OFFSET_TABLE;
|
||||
|
||||
typedef struct {
|
||||
quint32 tag;
|
||||
quint32 checkSum;
|
||||
quint32 offset;
|
||||
quint32 length;
|
||||
} TABLE_DIRECTORY;
|
||||
|
||||
typedef struct {
|
||||
quint16 fontSelector;
|
||||
quint16 nrCount;
|
||||
quint16 storageOffset;
|
||||
} NAME_TABLE_HEADER;
|
||||
|
||||
typedef struct {
|
||||
quint16 platformID;
|
||||
quint16 encodingID;
|
||||
quint16 languageID;
|
||||
quint16 nameID;
|
||||
quint16 stringLength;
|
||||
quint16 stringOffset;
|
||||
} NAME_RECORD;
|
||||
|
||||
typedef struct {
|
||||
quint32 tag;
|
||||
quint16 majorVersion;
|
||||
quint16 minorVersion;
|
||||
quint32 numFonts;
|
||||
} TTC_TABLE_HEADER;
|
||||
|
||||
static QString fontNameFromTTFile(const QString &filename, int startPos = 0)
|
||||
{
|
||||
QFile f(filename);
|
||||
QString retVal;
|
||||
qint64 bytesRead;
|
||||
qint64 bytesToRead;
|
||||
|
||||
if (f.open(QIODevice::ReadOnly)) {
|
||||
f.seek(startPos);
|
||||
OFFSET_TABLE ttOffsetTable;
|
||||
bytesToRead = sizeof(OFFSET_TABLE);
|
||||
bytesRead = f.read((char*)&ttOffsetTable, bytesToRead);
|
||||
if (bytesToRead != bytesRead)
|
||||
return retVal;
|
||||
ttOffsetTable.numTables = qFromBigEndian(ttOffsetTable.numTables);
|
||||
ttOffsetTable.majorVersion = qFromBigEndian(ttOffsetTable.majorVersion);
|
||||
ttOffsetTable.minorVersion = qFromBigEndian(ttOffsetTable.minorVersion);
|
||||
|
||||
if (ttOffsetTable.majorVersion != 1 || ttOffsetTable.minorVersion != 0)
|
||||
return retVal;
|
||||
|
||||
TABLE_DIRECTORY tblDir;
|
||||
bool found = false;
|
||||
|
||||
for (int i = 0; i < ttOffsetTable.numTables; i++) {
|
||||
bytesToRead = sizeof(TABLE_DIRECTORY);
|
||||
bytesRead = f.read((char*)&tblDir, bytesToRead);
|
||||
if (bytesToRead != bytesRead)
|
||||
return retVal;
|
||||
if (qFromBigEndian(tblDir.tag) == MAKE_TAG('n', 'a', 'm', 'e')) {
|
||||
found = true;
|
||||
tblDir.length = qFromBigEndian(tblDir.length);
|
||||
tblDir.offset = qFromBigEndian(tblDir.offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
f.seek(tblDir.offset);
|
||||
NAME_TABLE_HEADER ttNTHeader;
|
||||
bytesToRead = sizeof(NAME_TABLE_HEADER);
|
||||
bytesRead = f.read((char*)&ttNTHeader, bytesToRead);
|
||||
if (bytesToRead != bytesRead)
|
||||
return retVal;
|
||||
ttNTHeader.nrCount = qFromBigEndian(ttNTHeader.nrCount);
|
||||
ttNTHeader.storageOffset = qFromBigEndian(ttNTHeader.storageOffset);
|
||||
NAME_RECORD ttRecord;
|
||||
found = false;
|
||||
|
||||
for (int i = 0; i < ttNTHeader.nrCount; i++) {
|
||||
bytesToRead = sizeof(NAME_RECORD);
|
||||
bytesRead = f.read((char*)&ttRecord, bytesToRead);
|
||||
if (bytesToRead != bytesRead)
|
||||
return retVal;
|
||||
ttRecord.nameID = qFromBigEndian(ttRecord.nameID);
|
||||
if (ttRecord.nameID == 1) {
|
||||
ttRecord.stringLength = qFromBigEndian(ttRecord.stringLength);
|
||||
ttRecord.stringOffset = qFromBigEndian(ttRecord.stringOffset);
|
||||
int nPos = f.pos();
|
||||
f.seek(tblDir.offset + ttRecord.stringOffset + ttNTHeader.storageOffset);
|
||||
|
||||
QByteArray nameByteArray = f.read(ttRecord.stringLength);
|
||||
if (!nameByteArray.isEmpty()) {
|
||||
if (ttRecord.encodingID == 256 || ttRecord.encodingID == 768) {
|
||||
//This is UTF-16 in big endian
|
||||
int stringLength = ttRecord.stringLength / 2;
|
||||
retVal.resize(stringLength);
|
||||
QChar *data = retVal.data();
|
||||
const ushort *srcData = (const ushort *)nameByteArray.data();
|
||||
for (int i = 0; i < stringLength; ++i)
|
||||
data[i] = qFromBigEndian(srcData[i]);
|
||||
return retVal;
|
||||
} else if (ttRecord.encodingID == 0) {
|
||||
//This is Latin1
|
||||
retVal = QString::fromLatin1(nameByteArray);
|
||||
} else {
|
||||
qWarning("Could not retrieve Font name from file: %s", qPrintable(QDir::toNativeSeparators(filename)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
f.seek(nPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
f.close();
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
static QStringList fontNamesFromTTCFile(const QString &filename)
|
||||
{
|
||||
QFile f(filename);
|
||||
QStringList retVal;
|
||||
qint64 bytesRead;
|
||||
qint64 bytesToRead;
|
||||
|
||||
if (f.open(QIODevice::ReadOnly)) {
|
||||
TTC_TABLE_HEADER ttcTableHeader;
|
||||
bytesToRead = sizeof(TTC_TABLE_HEADER);
|
||||
bytesRead = f.read((char*)&ttcTableHeader, bytesToRead);
|
||||
if (bytesToRead != bytesRead)
|
||||
return retVal;
|
||||
ttcTableHeader.majorVersion = qFromBigEndian(ttcTableHeader.majorVersion);
|
||||
ttcTableHeader.minorVersion = qFromBigEndian(ttcTableHeader.minorVersion);
|
||||
ttcTableHeader.numFonts = qFromBigEndian(ttcTableHeader.numFonts);
|
||||
|
||||
if (ttcTableHeader.majorVersion < 1 || ttcTableHeader.majorVersion > 2)
|
||||
return retVal;
|
||||
QVarLengthArray<quint32> offsetTable(ttcTableHeader.numFonts);
|
||||
bytesToRead = sizeof(quint32) * ttcTableHeader.numFonts;
|
||||
bytesRead = f.read((char*)offsetTable.data(), bytesToRead);
|
||||
if (bytesToRead != bytesRead)
|
||||
return retVal;
|
||||
f.close();
|
||||
for (int i = 0; i < (int)ttcTableHeader.numFonts; ++i)
|
||||
retVal << fontNameFromTTFile(filename, qFromBigEndian(offsetTable[i]));
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
static inline QString fontSettingsOrganization() { return QStringLiteral("Qt-Project"); }
|
||||
static inline QString fontSettingsApplication() { return QStringLiteral("Qtbase"); }
|
||||
static inline QString fontSettingsGroup() { return QStringLiteral("CEFontCache"); }
|
||||
|
||||
static QString findFontFile(const QString &faceName)
|
||||
{
|
||||
static QHash<QString, QString> fontCache;
|
||||
|
||||
if (fontCache.isEmpty()) {
|
||||
QSettings settings(QSettings::SystemScope, fontSettingsOrganization(), fontSettingsApplication());
|
||||
settings.beginGroup(fontSettingsGroup());
|
||||
foreach (const QString &fontName, settings.allKeys())
|
||||
fontCache.insert(fontName, settings.value(fontName).toString());
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
QString value = fontCache.value(faceName);
|
||||
|
||||
//Fallback if we haven't cached the font yet or the font got removed/renamed iterate again over all fonts
|
||||
if (value.isEmpty() || !QFile::exists(value)) {
|
||||
QSettings settings(QSettings::SystemScope, fontSettingsOrganization(), fontSettingsApplication());
|
||||
settings.beginGroup(fontSettingsGroup());
|
||||
|
||||
//empty the cache first, as it seems that it is dirty
|
||||
settings.remove(QString());
|
||||
|
||||
QDirIterator it(QStringLiteral("/Windows"), QStringList() << QStringLiteral("*.ttf") << QStringLiteral("*.ttc"), QDir::Files | QDir::Hidden | QDir::System);
|
||||
const QLatin1Char lowerF('f');
|
||||
const QLatin1Char upperF('F');
|
||||
while (it.hasNext()) {
|
||||
const QString fontFile = it.next();
|
||||
QStringList fontNames;
|
||||
const QChar c = fontFile[fontFile.size() - 1];
|
||||
if (c == lowerF || c == upperF)
|
||||
fontNames << fontNameFromTTFile(fontFile);
|
||||
else
|
||||
fontNames << fontNamesFromTTCFile(fontFile);
|
||||
foreach (const QString fontName, fontNames) {
|
||||
if (fontName.isEmpty())
|
||||
continue;
|
||||
fontCache.insert(fontName, fontFile);
|
||||
settings.setValue(fontName, fontFile);
|
||||
|
||||
if (localizedName(fontName)) {
|
||||
QString englishFontName = getEnglishName(fontName);
|
||||
fontCache.insert(englishFontName, fontFile);
|
||||
settings.setValue(englishFontName, fontFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
settings.endGroup();
|
||||
value = fontCache.value(faceName);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
static bool addFontToDatabase(const QString &faceName,
|
||||
const QString &fullName,
|
||||
uchar charSet,
|
||||
@ -453,7 +230,6 @@ static bool addFontToDatabase(const QString &faceName,
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
#ifndef Q_OS_WINCE
|
||||
const FontKey *key = findFontKey(faceName, &index);
|
||||
if (!key) {
|
||||
key = findFontKey(fullName, &index);
|
||||
@ -465,19 +241,11 @@ static bool addFontToDatabase(const QString &faceName,
|
||||
return false;
|
||||
}
|
||||
QString value = key->fileName;
|
||||
#else
|
||||
QString value = findFontFile(faceName);
|
||||
#endif
|
||||
|
||||
if (value.isEmpty())
|
||||
return false;
|
||||
|
||||
if (!QDir::isAbsolutePath(value))
|
||||
#ifndef Q_OS_WINCE
|
||||
value.prepend(QFile::decodeName(qgetenv("windir") + "\\Fonts\\"));
|
||||
#else
|
||||
value.prepend(QFile::decodeName("/Windows/"));
|
||||
#endif
|
||||
|
||||
QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, style, stretch,
|
||||
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
|
||||
@ -501,24 +269,6 @@ static bool addFontToDatabase(const QString &faceName,
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
static QByteArray getFntTable(HFONT hfont, uint tag)
|
||||
{
|
||||
HDC hdc = GetDC(0);
|
||||
HGDIOBJ oldFont = SelectObject(hdc, hfont);
|
||||
quint32 t = qFromBigEndian<quint32>(tag);
|
||||
QByteArray buffer;
|
||||
|
||||
DWORD length = GetFontData(hdc, t, 0, NULL, 0);
|
||||
if (length != GDI_ERROR) {
|
||||
buffer.resize(length);
|
||||
GetFontData(hdc, t, 0, reinterpret_cast<uchar *>(buffer.data()), length);
|
||||
}
|
||||
SelectObject(hdc, oldFont);
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *textmetric,
|
||||
DWORD type, LPARAM)
|
||||
{
|
||||
@ -576,8 +326,6 @@ struct PopulateFamiliesContext
|
||||
};
|
||||
} // namespace
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
// Delayed population of font families
|
||||
|
||||
static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TEXTMETRIC *textmetric,
|
||||
@ -633,74 +381,6 @@ void QWindowsFontDatabaseFT::populateFontDatabase()
|
||||
QPlatformFontDatabase::registerFontFamily(context.systemDefaultFont);
|
||||
}
|
||||
|
||||
#else // !Q_OS_WINCE
|
||||
|
||||
// Non-delayed population of fonts (Windows CE).
|
||||
|
||||
static int QT_WIN_CALLBACK populateFontCe(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric,
|
||||
int type, LPARAM lparam)
|
||||
{
|
||||
// the "@family" fonts are just the same as "family". Ignore them.
|
||||
const wchar_t *faceNameW = f->elfLogFont.lfFaceName;
|
||||
if (faceNameW[0] && faceNameW[0] != L'@' && wcsncmp(faceNameW, L"WST_", 4)) {
|
||||
const uchar charSet = f->elfLogFont.lfCharSet;
|
||||
|
||||
FONTSIGNATURE signature;
|
||||
QByteArray table;
|
||||
|
||||
if (type & TRUETYPE_FONTTYPE) {
|
||||
HFONT hfont = CreateFontIndirect(&f->elfLogFont);
|
||||
table = getFntTable(hfont, MAKE_TAG('O', 'S', '/', '2'));
|
||||
DeleteObject((HGDIOBJ)hfont);
|
||||
}
|
||||
|
||||
if (table.length() >= 86) {
|
||||
// See also qfontdatabase_mac.cpp, offsets taken from OS/2 table in the TrueType spec
|
||||
uchar *tableData = reinterpret_cast<uchar *>(table.data());
|
||||
|
||||
signature.fsUsb[0] = qFromBigEndian<quint32>(tableData + 42);
|
||||
signature.fsUsb[1] = qFromBigEndian<quint32>(tableData + 46);
|
||||
signature.fsUsb[2] = qFromBigEndian<quint32>(tableData + 50);
|
||||
signature.fsUsb[3] = qFromBigEndian<quint32>(tableData + 54);
|
||||
|
||||
signature.fsCsb[0] = qFromBigEndian<quint32>(tableData + 78);
|
||||
signature.fsCsb[1] = qFromBigEndian<quint32>(tableData + 82);
|
||||
} else {
|
||||
memset(&signature, 0, sizeof(signature));
|
||||
}
|
||||
|
||||
// NEWTEXTMETRICEX is a NEWTEXTMETRIC, which according to the documentation is
|
||||
// identical to a TEXTMETRIC except for the last four members, which we don't use
|
||||
// anyway
|
||||
const QString faceName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
|
||||
if (addFontToDatabase(faceName, QString::fromWCharArray(f->elfFullName),
|
||||
charSet, (TEXTMETRIC *)textmetric, &signature, type, true)) {
|
||||
PopulateFamiliesContext *context = reinterpret_cast<PopulateFamiliesContext *>(lparam);
|
||||
if (!context->seenSystemDefaultFont && faceName == context->systemDefaultFont)
|
||||
context->seenSystemDefaultFont = true;
|
||||
}
|
||||
}
|
||||
|
||||
// keep on enumerating
|
||||
return 1;
|
||||
}
|
||||
|
||||
void QWindowsFontDatabaseFT::populateFontDatabase()
|
||||
{
|
||||
LOGFONT lf;
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
HDC dummy = GetDC(0);
|
||||
lf.lfFaceName[0] = 0;
|
||||
lf.lfPitchAndFamily = 0;
|
||||
PopulateFamiliesContext context(QWindowsFontDatabase::systemDefaultFont().family());
|
||||
EnumFontFamiliesEx(dummy, &lf, (FONTENUMPROC)populateFontCe, reinterpret_cast<LPARAM>(&context), 0);
|
||||
ReleaseDC(0, dummy);
|
||||
// Work around EnumFontFamiliesEx() not listing the system font, see below.
|
||||
if (!context.seenSystemDefaultFont)
|
||||
populateFamily(context.systemDefaultFont);
|
||||
}
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
QFontEngine * QWindowsFontDatabaseFT::fontEngine(const QFontDef &fontDef, void *handle)
|
||||
{
|
||||
QFontEngine *fe = QBasicFontDatabase::fontEngine(fontDef, handle);
|
||||
@ -718,21 +398,8 @@ QFontEngine *QWindowsFontDatabaseFT::fontEngine(const QByteArray &fontData, qrea
|
||||
QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
result.append(QWindowsFontDatabase::familyForStyleHint(styleHint));
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\FontLink\\SystemLink"), QSettings::NativeFormat);
|
||||
const QStringList fontList = settings.value(family).toStringList();
|
||||
foreach (const QString &fallback, fontList) {
|
||||
const int sep = fallback.indexOf(QLatin1Char(','));
|
||||
if (sep > 0)
|
||||
result << fallback.mid(sep + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
result.append(QWindowsFontDatabase::extraTryFontsForFamily(family));
|
||||
|
||||
result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script));
|
||||
|
||||
qCDebug(lcQpaFonts) << __FUNCTION__ << family << style << styleHint
|
||||
|
@ -65,10 +65,6 @@
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
# include "qplatformfunctions_wince.h"
|
||||
#endif
|
||||
|
||||
#if !defined(QT_NO_DIRECTWRITE)
|
||||
# include <dwrite.h>
|
||||
#endif
|
||||
@ -205,9 +201,6 @@ int QWindowsFontEngine::getGlyphIndexes(const QChar *str, int numChars, QGlyphLa
|
||||
{
|
||||
int glyph_pos = 0;
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
{
|
||||
#else
|
||||
if (symbol) {
|
||||
QStringIterator it(str, str + numChars);
|
||||
while (it.hasNext()) {
|
||||
@ -225,7 +218,6 @@ int QWindowsFontEngine::getGlyphIndexes(const QChar *str, int numChars, QGlyphLa
|
||||
++glyph_pos;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
QStringIterator it(str, str + numChars);
|
||||
while (it.hasNext()) {
|
||||
const uint uc = it.next();
|
||||
@ -329,21 +321,16 @@ QWindowsFontEngine::~QWindowsFontEngine()
|
||||
|
||||
glyph_t QWindowsFontEngine::glyphIndex(uint ucs4) const
|
||||
{
|
||||
glyph_t glyph;
|
||||
glyph_t glyph = 0;
|
||||
|
||||
#if !defined(Q_OS_WINCE)
|
||||
if (symbol) {
|
||||
glyph = getTrueTypeGlyphIndex(cmap, cmapSize, ucs4);
|
||||
if (glyph == 0 && ucs4 < 0x100)
|
||||
glyph = getTrueTypeGlyphIndex(cmap, cmapSize, ucs4 + 0xf000);
|
||||
} else if (ttf) {
|
||||
glyph = getTrueTypeGlyphIndex(cmap, cmapSize, ucs4);
|
||||
} else
|
||||
#endif
|
||||
if (ucs4 >= tm.tmFirstChar && ucs4 <= tm.tmLastChar) {
|
||||
} else if (ucs4 >= tm.tmFirstChar && ucs4 <= tm.tmLastChar) {
|
||||
glyph = ucs4;
|
||||
} else {
|
||||
glyph = 0;
|
||||
}
|
||||
|
||||
return glyph;
|
||||
@ -377,12 +364,8 @@ bool QWindowsFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout *g
|
||||
|
||||
inline void calculateTTFGlyphWidth(HDC hdc, UINT glyph, int &width)
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
GetCharWidth32(hdc, glyph, glyph, &width);
|
||||
#else
|
||||
if (ptrGetCharWidthI)
|
||||
ptrGetCharWidthI(hdc, glyph, 1, 0, &width);
|
||||
#endif
|
||||
}
|
||||
|
||||
void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const
|
||||
@ -467,7 +450,7 @@ glyph_metrics_t QWindowsFontEngine::boundingBox(const QGlyphLayout &glyphs)
|
||||
|
||||
return glyph_metrics_t(0, -tm.tmAscent, w - lastRightBearing(glyphs), tm.tmHeight, w, 0);
|
||||
}
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
bool QWindowsFontEngine::getOutlineMetrics(glyph_t glyph, const QTransform &t, glyph_metrics_t *metrics) const
|
||||
{
|
||||
Q_ASSERT(metrics != 0);
|
||||
@ -520,11 +503,9 @@ bool QWindowsFontEngine::getOutlineMetrics(glyph_t glyph, const QTransform &t, g
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
glyph_metrics_t QWindowsFontEngine::boundingBox(glyph_t glyph, const QTransform &t)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
HDC hdc = m_fontEngineData->hdc;
|
||||
SelectObject(hdc, hfont);
|
||||
|
||||
@ -542,34 +523,6 @@ glyph_metrics_t QWindowsFontEngine::boundingBox(glyph_t glyph, const QTransform
|
||||
}
|
||||
|
||||
return glyphMetrics;
|
||||
#else
|
||||
HDC hdc = m_fontEngineData->hdc;
|
||||
HGDIOBJ oldFont = SelectObject(hdc, hfont);
|
||||
|
||||
ABC abc;
|
||||
int width;
|
||||
int advance;
|
||||
#ifdef GWES_MGTT // true type fonts
|
||||
if (GetCharABCWidths(hdc, glyph, glyph, &abc)) {
|
||||
width = qAbs(abc.abcA) + abc.abcB + qAbs(abc.abcC);
|
||||
advance = abc.abcA + abc.abcB + abc.abcC;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if defined(GWES_MGRAST) || defined(GWES_MGRAST2) // raster fonts
|
||||
if (GetCharWidth32(hdc, glyph, glyph, &width)) {
|
||||
advance = width;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ // fallback
|
||||
width = tm.tmMaxCharWidth;
|
||||
advance = width;
|
||||
}
|
||||
|
||||
SelectObject(hdc, oldFont);
|
||||
return glyph_metrics_t(0, -tm.tmAscent, width, tm.tmHeight, advance, 0).transformed(t);
|
||||
#endif
|
||||
}
|
||||
|
||||
QFixed QWindowsFontEngine::ascent() const
|
||||
@ -636,22 +589,16 @@ void QWindowsFontEngine::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qre
|
||||
HDC hdc = m_fontEngineData->hdc;
|
||||
SelectObject(hdc, hfont);
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
if (ttf)
|
||||
#endif
|
||||
{
|
||||
if (ttf) {
|
||||
ABC abcWidths;
|
||||
GetCharABCWidthsI(hdc, glyph, 1, 0, &abcWidths);
|
||||
if (leftBearing)
|
||||
*leftBearing = abcWidths.abcA;
|
||||
if (rightBearing)
|
||||
*rightBearing = abcWidths.abcC;
|
||||
}
|
||||
#ifndef Q_OS_WINCE
|
||||
else {
|
||||
} else {
|
||||
QFontEngine::getGlyphBearings(glyph, leftBearing, rightBearing);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif // Q_CC_MINGW
|
||||
|
||||
@ -670,7 +617,6 @@ qreal QWindowsFontEngine::minLeftBearing() const
|
||||
|
||||
qreal QWindowsFontEngine::minRightBearing() const
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
if (rbearing == SHRT_MIN) {
|
||||
int ml = 0;
|
||||
int mr = 0;
|
||||
@ -726,40 +672,6 @@ qreal QWindowsFontEngine::minRightBearing() const
|
||||
}
|
||||
|
||||
return rbearing;
|
||||
#else // !Q_OS_WINCE
|
||||
if (rbearing == SHRT_MIN) {
|
||||
int ml = 0;
|
||||
int mr = 0;
|
||||
HDC hdc = m_fontEngineData->hdc;
|
||||
SelectObject(hdc, hfont);
|
||||
if (ttf) {
|
||||
ABC *abc = 0;
|
||||
int n = tm.tmLastChar - tm.tmFirstChar;
|
||||
if (n <= max_font_count) {
|
||||
abc = new ABC[n+1];
|
||||
GetCharABCWidths(hdc, tm.tmFirstChar, tm.tmLastChar, abc);
|
||||
} else {
|
||||
abc = new ABC[char_table_entries+1];
|
||||
for (int i = 0; i < char_table_entries; i++)
|
||||
GetCharABCWidths(hdc, char_table[i], char_table[i], abc+i);
|
||||
n = char_table_entries;
|
||||
}
|
||||
ml = abc[0].abcA;
|
||||
mr = abc[0].abcC;
|
||||
for (int i = 1; i < n; i++) {
|
||||
if (abc[i].abcA + abc[i].abcB + abc[i].abcC != 0) {
|
||||
ml = qMin(ml,abc[i].abcA);
|
||||
mr = qMin(mr,abc[i].abcC);
|
||||
}
|
||||
}
|
||||
delete [] abc;
|
||||
}
|
||||
lbearing = ml;
|
||||
rbearing = mr;
|
||||
}
|
||||
|
||||
return rbearing;
|
||||
#endif // Q_OS_WINCE
|
||||
}
|
||||
|
||||
static inline double qt_fixed_to_double(const FIXED &p) {
|
||||
@ -786,7 +698,6 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
|
||||
GLYPHMETRICS gMetric;
|
||||
memset(&gMetric, 0, sizeof(GLYPHMETRICS));
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
if (metric) {
|
||||
// If metrics requested, retrieve first using GGO_METRICS, because the returned
|
||||
// values are incorrect for OpenType PS fonts if obtained at the same time as the
|
||||
@ -801,7 +712,6 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
|
||||
int(gMetric.gmBlackBoxX), int(gMetric.gmBlackBoxY),
|
||||
gMetric.gmCellIncX, gMetric.gmCellIncY);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint glyphFormat = GGO_NATIVE;
|
||||
|
||||
@ -820,15 +730,6 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
if (metric) {
|
||||
// #### obey scale
|
||||
*metric = glyph_metrics_t(gMetric.gmptGlyphOrigin.x, -gMetric.gmptGlyphOrigin.y,
|
||||
(int)gMetric.gmBlackBoxX, (int)gMetric.gmBlackBoxY,
|
||||
gMetric.gmCellIncX, gMetric.gmCellIncY);
|
||||
}
|
||||
#endif
|
||||
|
||||
DWORD offset = 0;
|
||||
DWORD headerOffset = 0;
|
||||
|
||||
@ -1052,7 +953,6 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph,
|
||||
|
||||
bool has_transformation = t.type() > QTransform::TxTranslate;
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
unsigned int options = ttf ? ETO_GLYPH_INDEX : 0;
|
||||
XFORM xform;
|
||||
|
||||
@ -1095,13 +995,6 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph,
|
||||
xform.eDx -= tgm.gmptGlyphOrigin.x;
|
||||
xform.eDy += tgm.gmptGlyphOrigin.y;
|
||||
}
|
||||
#else // else wince
|
||||
unsigned int options = 0;
|
||||
if (has_transformation) {
|
||||
qWarning() << "QWindowsFontEngine is unable to apply transformations other than translations for fonts on Windows CE."
|
||||
<< "If you need them anyway, start your application with -platform windows:fontengine=freetype.";
|
||||
}
|
||||
#endif // wince
|
||||
|
||||
// The padding here needs to be kept in sync with the values in alphaMapBoundingBox.
|
||||
QWindowsNativeImage *ni = new QWindowsNativeImage(iw + 2 * margin,
|
||||
@ -1123,14 +1016,11 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph,
|
||||
|
||||
HGDIOBJ old_font = SelectObject(hdc, font);
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
if (has_transformation) {
|
||||
SetGraphicsMode(hdc, GM_ADVANCED);
|
||||
SetWorldTransform(hdc, &xform);
|
||||
ExtTextOut(hdc, 0, 0, options, 0, reinterpret_cast<LPCWSTR>(&glyph), 1, 0);
|
||||
} else
|
||||
#endif // !Q_OS_WINCE
|
||||
{
|
||||
} else {
|
||||
ExtTextOut(hdc, -gx + margin, -gy + margin, options, 0, reinterpret_cast<LPCWSTR>(&glyph), 1, 0);
|
||||
}
|
||||
|
||||
|
@ -149,15 +149,9 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
QWindowsOpengl32DLL QOpenGLStaticContext::opengl32;
|
||||
|
||||
void *QWindowsOpengl32DLL::resolve(const char *name)
|
||||
FARPROC QWindowsOpengl32DLL::resolve(const char *name)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
void *proc = m_lib ? (void *) ::GetProcAddress(m_lib, name) : 0;
|
||||
#else
|
||||
void *proc = m_lib ? (void *) ::GetProcAddress(m_lib, (const wchar_t *) QString::fromLatin1(name).utf16()) : 0;
|
||||
#endif
|
||||
|
||||
return proc;
|
||||
return m_lib ? ::GetProcAddress(m_lib, name) : nullptr;
|
||||
}
|
||||
|
||||
bool QWindowsOpengl32DLL::init(bool softwareRendering)
|
||||
|
@ -122,7 +122,7 @@ struct QWindowsOpengl32DLL
|
||||
void (APIENTRY * glGetIntegerv)(GLenum pname, GLint* params);
|
||||
const GLubyte * (APIENTRY * glGetString)(GLenum name);
|
||||
|
||||
void *resolve(const char *name);
|
||||
FARPROC resolve(const char *name);
|
||||
private:
|
||||
HMODULE m_lib;
|
||||
bool m_nonOpengl32;
|
||||
|
@ -187,11 +187,7 @@ bool QWindowsInputContext::hasCapability(Capability capability) const
|
||||
{
|
||||
switch (capability) {
|
||||
case QPlatformInputContext::HiddenTextCapability:
|
||||
#ifndef Q_OS_WINCE
|
||||
return false; // QTBUG-40691, do not show IME on desktop for password entry fields.
|
||||
#else
|
||||
break; // Windows CE: Show software keyboard.
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@
|
||||
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#ifndef QT_NO_SESSIONMANAGER
|
||||
# include "qwindowssessionmanager.h"
|
||||
#endif
|
||||
#include <QtGui/qtouchdevice.h>
|
||||
@ -102,7 +102,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
It should compile with:
|
||||
\list
|
||||
\li Microsoft Visual Studio 2008 or later (using the Microsoft Windows SDK,
|
||||
\li Microsoft Visual Studio 2013 or later (using the Microsoft Windows SDK,
|
||||
(\c Q_CC_MSVC).
|
||||
\li Stock \l{http://mingw.org/}{MinGW} (\c Q_CC_MINGW).
|
||||
This version ships with headers that are missing a lot of WinAPI.
|
||||
@ -112,7 +112,6 @@ QT_BEGIN_NAMESPACE
|
||||
(\c Q_CC_MINGW and \c __MINGW64_VERSION_MAJOR indicating the version).
|
||||
MinGW-w64 provides more complete headers (compared to stock MinGW from mingw.org),
|
||||
including a considerable part of the Windows SDK.
|
||||
\li Visual Studio 2008 for Windows Embedded (\c Q_OS_WINCE).
|
||||
\endlist
|
||||
|
||||
The file \c qtwindows_additional.h contains defines and declarations that
|
||||
@ -214,9 +213,7 @@ QWindowsIntegrationPrivate::QWindowsIntegrationPrivate(const QStringList ¶mL
|
||||
: m_options(0)
|
||||
, m_fontDatabase(0)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
Q_INIT_RESOURCE(openglblacklists);
|
||||
#endif
|
||||
|
||||
static bool dpiAwarenessSet = false;
|
||||
int tabletAbsoluteRange = -1;
|
||||
@ -467,46 +464,16 @@ QWindowsStaticOpenGLContext *QWindowsIntegration::staticOpenGLContext()
|
||||
}
|
||||
#endif // !QT_NO_OPENGL
|
||||
|
||||
/* Workaround for QTBUG-24205: In 'Auto', pick the FreeType engine for
|
||||
* QML2 applications. */
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
// It's not easy to detect if we are running a QML application
|
||||
// Let's try to do so by checking if the Qt Quick module is loaded.
|
||||
inline bool isQMLApplication()
|
||||
{
|
||||
// check if the Qt Quick module is loaded
|
||||
#ifdef _DEBUG
|
||||
HMODULE handle = GetModuleHandle(L"Qt5Quick" QT_LIBINFIX L"d.dll");
|
||||
#else
|
||||
HMODULE handle = GetModuleHandle(L"Qt5Quick" QT_LIBINFIX L".dll");
|
||||
#endif
|
||||
return (handle != NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
QPlatformFontDatabase *QWindowsIntegration::fontDatabase() const
|
||||
{
|
||||
if (!d->m_fontDatabase) {
|
||||
#ifdef QT_NO_FREETYPE
|
||||
d->m_fontDatabase = new QWindowsFontDatabase();
|
||||
#else // QT_NO_FREETYPE
|
||||
if (d->m_options & QWindowsIntegration::FontDatabaseFreeType) {
|
||||
if (d->m_options & QWindowsIntegration::FontDatabaseFreeType)
|
||||
d->m_fontDatabase = new QWindowsFontDatabaseFT;
|
||||
} else if (d->m_options & QWindowsIntegration::FontDatabaseNative){
|
||||
else
|
||||
d->m_fontDatabase = new QWindowsFontDatabase;
|
||||
} else {
|
||||
#ifndef Q_OS_WINCE
|
||||
d->m_fontDatabase = new QWindowsFontDatabase;
|
||||
#else
|
||||
if (isQMLApplication()) {
|
||||
qCDebug(lcQpaFonts) << "QML application detected, using FreeType rendering";
|
||||
d->m_fontDatabase = new QWindowsFontDatabaseFT;
|
||||
}
|
||||
else
|
||||
d->m_fontDatabase = new QWindowsFontDatabase;
|
||||
#endif
|
||||
}
|
||||
#endif // QT_NO_FREETYPE
|
||||
}
|
||||
return d->m_fontDatabase;
|
||||
@ -594,7 +561,7 @@ unsigned QWindowsIntegration::options() const
|
||||
return d->m_options;
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
QPlatformSessionManager *QWindowsIntegration::createPlatformSessionManager(const QString &id, const QString &key) const
|
||||
{
|
||||
return new QWindowsSessionManager(id, key);
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
|
||||
void beep() const Q_DECL_OVERRIDE;
|
||||
|
||||
#if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER)
|
||||
#if !defined(QT_NO_SESSIONMANAGER)
|
||||
QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE;
|
||||
#endif
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
|
||||
#include "qwindowsinternalmimedata.h"
|
||||
#include "qwindowscontext.h"
|
||||
#include "qplatformfunctions_wince.h"
|
||||
#include "qwindowsmime.h"
|
||||
#include <QDebug>
|
||||
/*!
|
||||
|
@ -552,34 +552,6 @@ inline quint32 winceKeyBend(quint32 keyCode)
|
||||
return KeyTbl[keyCode];
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
QT_BEGIN_INCLUDE_NAMESPACE
|
||||
int ToUnicode(UINT vk, int /*scancode*/, unsigned char* /*kbdBuffer*/, LPWSTR unicodeBuffer, int, int)
|
||||
{
|
||||
QT_USE_NAMESPACE
|
||||
QChar* buf = reinterpret_cast< QChar*>(unicodeBuffer);
|
||||
if (KeyTbl[vk] == 0) {
|
||||
buf[0] = vk;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ToAscii(UINT vk, int scancode, unsigned char *kbdBuffer, LPWORD unicodeBuffer, int flag)
|
||||
{
|
||||
return ToUnicode(vk, scancode, kbdBuffer, (LPWSTR) unicodeBuffer, 0, flag);
|
||||
|
||||
}
|
||||
|
||||
bool GetKeyboardState(unsigned char* kbuffer)
|
||||
{
|
||||
for (int i=0; i< 256; ++i)
|
||||
kbuffer[i] = GetAsyncKeyState(i);
|
||||
return true;
|
||||
}
|
||||
QT_END_INCLUDE_NAMESPACE
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
// Translate a VK into a Qt key code, or unicode character
|
||||
static inline quint32 toKeyOrUnicode(quint32 vk, quint32 scancode, unsigned char *kbdBuffer, bool *isDeadkey = 0)
|
||||
{
|
||||
@ -780,7 +752,6 @@ static void showSystemMenu(QWindow* w)
|
||||
if (!menu)
|
||||
return; // no menu for this window
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
#define enabled (MF_BYCOMMAND | MF_ENABLED)
|
||||
#define disabled (MF_BYCOMMAND | MF_GRAYED)
|
||||
|
||||
@ -805,7 +776,6 @@ static void showSystemMenu(QWindow* w)
|
||||
|
||||
#undef enabled
|
||||
#undef disabled
|
||||
#endif // !Q_OS_WINCE
|
||||
const QPoint pos = QHighDpi::toNativePixels(topLevel->geometry().topLeft(), topLevel);
|
||||
const int ret = TrackPopupMenuEx(menu,
|
||||
TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD,
|
||||
@ -1172,7 +1142,6 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
|
||||
modifiers, scancode, quint32(msg.wParam), nModifiers, text, false);
|
||||
result =true;
|
||||
bool store = true;
|
||||
#ifndef Q_OS_WINCE
|
||||
// Alt+<alphanumerical> go to the Win32 menu system if unhandled by Qt
|
||||
if (msgType == WM_SYSKEYDOWN && !result && a) {
|
||||
HWND parent = GetParent(QWindowsWindow::handleOf(receiver));
|
||||
@ -1186,7 +1155,6 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
|
||||
parent = GetParent(parent);
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
if (!store)
|
||||
key_recorder.findKey(int(msg.wParam), true);
|
||||
}
|
||||
@ -1216,7 +1184,6 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
|
||||
nModifiers,
|
||||
(rec ? rec->text : QString()), false);
|
||||
result = true;
|
||||
#ifndef Q_OS_WINCE
|
||||
// don't pass Alt to Windows unless we are embedded in a non-Qt window
|
||||
if (code == Qt::Key_Alt) {
|
||||
const QWindowsContext *context = QWindowsContext::instance();
|
||||
@ -1229,7 +1196,6 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
|
||||
parent = GetParent(parent);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -403,11 +403,9 @@ QDebug operator<<(QDebug d, const FORMATETC &tc)
|
||||
case CF_UNICODETEXT:
|
||||
d << "CF_UNICODETEXT";
|
||||
break;
|
||||
#ifndef Q_OS_WINCE
|
||||
case CF_ENHMETAFILE:
|
||||
d << "CF_ENHMETAFILE";
|
||||
break;
|
||||
#endif // !Q_OS_WINCE
|
||||
default:
|
||||
d << QWindowsMimeConverter::clipboardFormatName(tc.cfFormat);
|
||||
break;
|
||||
|
@ -203,7 +203,6 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
|
||||
|
||||
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized;
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
// Check for events synthesized from touch. Lower byte is touch index, 0 means pen.
|
||||
static const bool passSynthesizedMouseEvents =
|
||||
!(QWindowsIntegration::instance()->options() & QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch);
|
||||
@ -218,7 +217,6 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
const QPoint winEventPosition(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
|
||||
if (et & QtWindows::NonClientEventFlag) {
|
||||
@ -320,7 +318,6 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
|
||||
|
||||
const bool hasCapture = platformWindow->hasMouseCapture();
|
||||
const bool currentNotCapturing = hasCapture && currentWindowUnderMouse != window;
|
||||
#ifndef Q_OS_WINCE
|
||||
// Enter new window: track to generate leave event.
|
||||
// If there is an active capture, only track if the current window is capturing,
|
||||
// so we don't get extra leave when cursor leaves the application.
|
||||
@ -334,7 +331,6 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
|
||||
qWarning("TrackMouseEvent failed.");
|
||||
m_trackedWindow = window;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
// No enter or leave events are sent as long as there is an autocapturing window.
|
||||
if (!hasCapture || !platformWindow->testFlag(QWindowsWindow::AutoMouseCapture)) {
|
||||
@ -487,7 +483,6 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
|
||||
QtWindows::WindowsEventType,
|
||||
MSG msg, LRESULT *)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
typedef QWindowSystemInterface::TouchPoint QTouchPoint;
|
||||
typedef QList<QWindowSystemInterface::TouchPoint> QTouchPointList;
|
||||
|
||||
@ -563,109 +558,17 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
|
||||
QWindowSystemInterface::handleTouchEvent(window,
|
||||
m_touchDevice,
|
||||
touchPoints);
|
||||
#else // !Q_OS_WINCE
|
||||
Q_UNUSED(window)
|
||||
Q_UNUSED(msg)
|
||||
#endif
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
bool QWindowsMouseHandler::translateGestureEvent(QWindow *window, HWND hwnd,
|
||||
QtWindows::WindowsEventType,
|
||||
MSG msg, LRESULT *)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
Q_UNUSED(window)
|
||||
Q_UNUSED(hwnd)
|
||||
Q_UNUSED(msg)
|
||||
return false;
|
||||
#else // !Q_OS_WINCE
|
||||
GESTUREINFO gi;
|
||||
memset(&gi, 0, sizeof(GESTUREINFO));
|
||||
gi.cbSize = sizeof(GESTUREINFO);
|
||||
|
||||
if (!GetGestureInfo((HGESTUREINFO)msg.lParam, &gi))
|
||||
return false;
|
||||
|
||||
const QPoint position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
|
||||
|
||||
if (gi.dwID != GID_DIRECTMANIPULATION)
|
||||
return true;
|
||||
static QPoint lastTouchPos;
|
||||
const QScreen *screen = window->screen();
|
||||
if (!screen)
|
||||
screen = QGuiApplication::primaryScreen();
|
||||
if (!screen)
|
||||
return true;
|
||||
const QRect screenGeometry = screen->geometry();
|
||||
QWindowSystemInterface::TouchPoint touchPoint;
|
||||
static QWindowSystemInterface::TouchPoint touchPoint2;
|
||||
touchPoint.id = 0;//gi.dwInstanceID;
|
||||
touchPoint.pressure = 1.0;
|
||||
|
||||
if (gi.dwFlags & GF_BEGIN)
|
||||
touchPoint.state = Qt::TouchPointPressed;
|
||||
else if (gi.dwFlags & GF_END)
|
||||
touchPoint.state = Qt::TouchPointReleased;
|
||||
else if (gi.dwFlags == 0)
|
||||
touchPoint.state = Qt::TouchPointMoved;
|
||||
else
|
||||
return true;
|
||||
touchPoint2.pressure = 1.0;
|
||||
touchPoint2.id = 1;
|
||||
const QPoint winEventPosition = position;
|
||||
const int deltaX = GID_DIRECTMANIPULATION_DELTA_X(gi.ullArguments);
|
||||
const int deltaY = GID_DIRECTMANIPULATION_DELTA_Y(gi.ullArguments);
|
||||
//Touch points are taken from the whole screen so map the position to the screen
|
||||
const QPoint globalPosition = QWindowsGeometryHint::mapToGlobal(hwnd, winEventPosition);
|
||||
const QPoint globalPosition2 = QWindowsGeometryHint::mapToGlobal(hwnd, QPoint(position.x() + deltaX, position.y() + deltaY));
|
||||
|
||||
touchPoint.normalPosition =
|
||||
QPointF( (qreal)globalPosition.x() / screenGeometry.width(), (qreal)globalPosition.y() / screenGeometry.height() );
|
||||
|
||||
touchPoint.area.moveCenter(globalPosition);
|
||||
|
||||
QList<QWindowSystemInterface::TouchPoint> pointList;
|
||||
pointList.append(touchPoint);
|
||||
if (deltaX != 0 && deltaY != 0) {
|
||||
touchPoint2.state = m_had2ndTouchPoint ? Qt::TouchPointMoved : Qt::TouchPointPressed;
|
||||
m_had2ndTouchPoint = true;
|
||||
touchPoint2.normalPosition =
|
||||
QPointF( (qreal)globalPosition2.x() / screenGeometry.width(), (qreal)globalPosition2.y() / screenGeometry.height() );
|
||||
|
||||
touchPoint2.area.moveCenter(globalPosition2);
|
||||
lastTouchPos = globalPosition2;
|
||||
pointList.append(touchPoint2);
|
||||
} else if (m_had2ndTouchPoint) {
|
||||
touchPoint2.normalPosition =
|
||||
QPointF( (qreal)lastTouchPos.x() / screenGeometry.width(), (qreal)lastTouchPos.y() / screenGeometry.height() );
|
||||
|
||||
touchPoint2.area.moveCenter(lastTouchPos);
|
||||
touchPoint2.state = Qt::TouchPointReleased;
|
||||
pointList.append(touchPoint2);
|
||||
m_had2ndTouchPoint = false;
|
||||
}
|
||||
|
||||
if (!m_touchDevice) {
|
||||
m_touchDevice = new QTouchDevice;
|
||||
// TODO: Device used to be hardcoded to screen in previous code.
|
||||
m_touchDevice->setType(QTouchDevice::TouchScreen);
|
||||
m_touchDevice->setCapabilities(QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::NormalizedPosition);
|
||||
QWindowSystemInterface::registerTouchDevice(m_touchDevice);
|
||||
}
|
||||
|
||||
QWindowSystemInterface::handleTouchEvent(window, m_touchDevice, pointList);
|
||||
// handle window focusing in/out
|
||||
if (window != m_windowUnderMouse) {
|
||||
if (m_windowUnderMouse)
|
||||
QWindowSystemInterface::handleLeaveEvent(m_windowUnderMouse);
|
||||
if (window)
|
||||
QWindowSystemInterface::handleEnterEvent(window);
|
||||
m_windowUnderMouse = window;
|
||||
}
|
||||
return true;
|
||||
#endif // Q_OS_WINCE
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -91,10 +91,6 @@ private:
|
||||
QTouchDevice *m_touchDevice;
|
||||
bool m_leftButtonDown;
|
||||
QWindow *m_previousCaptureWindow;
|
||||
#ifdef Q_OS_WINCE
|
||||
//This is required to send a touch up if we don't get a second touch position any more
|
||||
bool m_had2ndTouchPoint;
|
||||
#endif
|
||||
};
|
||||
|
||||
Qt::MouseButtons QWindowsMouseHandler::keyStateToMouseButtons(int wParam)
|
||||
|
@ -126,9 +126,7 @@ QWindowsNativeImage::QWindowsNativeImage(int width, int height,
|
||||
m_image = QImage(width, height, format);
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
GdiFlush();
|
||||
#endif
|
||||
}
|
||||
|
||||
QWindowsNativeImage::~QWindowsNativeImage()
|
||||
|
@ -54,17 +54,14 @@
|
||||
#include <private/qopengl_p.h>
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
# include <QtCore/qt_windows.h>
|
||||
# include <private/qsystemlibrary_p.h>
|
||||
# include <d3d9.h>
|
||||
#endif
|
||||
#include <QtCore/qt_windows.h>
|
||||
#include <private/qsystemlibrary_p.h>
|
||||
#include <d3d9.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
GpuDescription GpuDescription::detect()
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
typedef IDirect3D9 * (WINAPI *PtrDirect3DCreate9)(UINT);
|
||||
|
||||
GpuDescription result;
|
||||
@ -95,13 +92,6 @@ GpuDescription GpuDescription::detect()
|
||||
result.description = adapterIdentifier.Description;
|
||||
}
|
||||
return result;
|
||||
#else // !Q_OS_WINCE
|
||||
GpuDescription result;
|
||||
result.vendorId = result.deviceId = result.revision =1;
|
||||
result.driverVersion = QVersionNumber(1, 1, 1);
|
||||
result.driverName = result.description = QByteArrayLiteral("Generic");
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
@ -155,7 +145,6 @@ QVariant GpuDescription::toVariant() const
|
||||
|
||||
QWindowsOpenGLTester::Renderer QWindowsOpenGLTester::requestedGlesRenderer()
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
const char platformVar[] = "QT_ANGLE_PLATFORM";
|
||||
if (qEnvironmentVariableIsSet(platformVar)) {
|
||||
const QByteArray anglePlatform = qgetenv(platformVar);
|
||||
@ -167,13 +156,11 @@ QWindowsOpenGLTester::Renderer QWindowsOpenGLTester::requestedGlesRenderer()
|
||||
return QWindowsOpenGLTester::AngleRendererD3d11Warp;
|
||||
qCWarning(lcQpaGl) << "Invalid value set for " << platformVar << ": " << anglePlatform;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
return QWindowsOpenGLTester::InvalidRenderer;
|
||||
}
|
||||
|
||||
QWindowsOpenGLTester::Renderer QWindowsOpenGLTester::requestedRenderer()
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
const char openGlVar[] = "QT_OPENGL";
|
||||
if (QCoreApplication::testAttribute(Qt::AA_UseOpenGLES)) {
|
||||
const Renderer glesRenderer = QWindowsOpenGLTester::requestedGlesRenderer();
|
||||
@ -195,12 +182,9 @@ QWindowsOpenGLTester::Renderer QWindowsOpenGLTester::requestedRenderer()
|
||||
return QWindowsOpenGLTester::SoftwareRasterizer;
|
||||
qCWarning(lcQpaGl) << "Invalid value set for " << openGlVar << ": " << requested;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
return QWindowsOpenGLTester::InvalidRenderer;
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
static inline QString resolveBugListFile(const QString &fileName)
|
||||
{
|
||||
if (QFileInfo(fileName).isAbsolute())
|
||||
@ -216,12 +200,10 @@ static inline QString resolveBugListFile(const QString &fileName)
|
||||
return QStandardPaths::locate(QStandardPaths::ConfigLocation, fileName);
|
||||
}
|
||||
|
||||
# ifndef QT_NO_OPENGL
|
||||
#ifndef QT_NO_OPENGL
|
||||
typedef QHash<QOpenGLConfig::Gpu, QWindowsOpenGLTester::Renderers> SupportedRenderersCache;
|
||||
Q_GLOBAL_STATIC(SupportedRenderersCache, supportedRenderersCache)
|
||||
# endif
|
||||
|
||||
#endif // !Q_OS_WINCE
|
||||
#endif
|
||||
|
||||
QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(const GpuDescription &gpu, bool glesOnly)
|
||||
{
|
||||
@ -229,8 +211,6 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(c
|
||||
Q_UNUSED(glesOnly)
|
||||
#if defined(QT_NO_OPENGL)
|
||||
return 0;
|
||||
#elif defined(Q_OS_WINCE)
|
||||
return QWindowsOpenGLTester::Gles;
|
||||
#else
|
||||
QOpenGLConfig::Gpu qgpu = QOpenGLConfig::Gpu::fromDevice(gpu.vendorId, gpu.deviceId, gpu.driverVersion, gpu.description);
|
||||
SupportedRenderersCache *srCache = supportedRenderersCache();
|
||||
@ -280,7 +260,7 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::detectSupportedRenderers(c
|
||||
}
|
||||
srCache->insert(qgpu, result);
|
||||
return result;
|
||||
#endif // !Q_OS_WINCE && !QT_NO_OPENGL
|
||||
#endif // !QT_NO_OPENGL
|
||||
}
|
||||
|
||||
QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::supportedGlesRenderers()
|
||||
@ -301,7 +281,7 @@ QWindowsOpenGLTester::Renderers QWindowsOpenGLTester::supportedRenderers()
|
||||
|
||||
bool QWindowsOpenGLTester::testDesktopGL()
|
||||
{
|
||||
#if !defined(QT_NO_OPENGL) && !defined(Q_OS_WINCE)
|
||||
#if !defined(QT_NO_OPENGL)
|
||||
HMODULE lib = 0;
|
||||
HWND wnd = 0;
|
||||
HDC dc = 0;
|
||||
@ -428,7 +408,7 @@ cleanup:
|
||||
return result;
|
||||
#else
|
||||
return false;
|
||||
#endif // !QT_NO_OPENGL && !Q_OS_WINCE
|
||||
#endif // !QT_NO_OPENGL
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -68,8 +68,6 @@ static inline QDpi deviceDPI(HDC hdc)
|
||||
return QDpi(GetDeviceCaps(hdc, LOGPIXELSX), GetDeviceCaps(hdc, LOGPIXELSY));
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
static inline QDpi monitorDPI(HMONITOR hMonitor)
|
||||
{
|
||||
if (QWindowsContext::shcoredll.isValid()) {
|
||||
@ -81,8 +79,6 @@ static inline QDpi monitorDPI(HMONITOR hMonitor)
|
||||
return QDpi(0, 0);
|
||||
}
|
||||
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
typedef QList<QWindowsScreenData> WindowsScreenDataList;
|
||||
|
||||
static bool monitorData(HMONITOR hMonitor, QWindowsScreenData *data)
|
||||
@ -99,20 +95,9 @@ static bool monitorData(HMONITOR hMonitor, QWindowsScreenData *data)
|
||||
if (data->name == QLatin1String("WinDisc")) {
|
||||
data->flags |= QWindowsScreenData::LockScreen;
|
||||
} else {
|
||||
#ifdef Q_OS_WINCE
|
||||
//Windows CE, just supports one Display and expects to get only DISPLAY,
|
||||
//instead of DISPLAY0 and so on, which are passed by info.szDevice
|
||||
HDC hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
|
||||
#else
|
||||
HDC hdc = CreateDC(info.szDevice, NULL, NULL, NULL);
|
||||
#endif
|
||||
if (hdc) {
|
||||
#ifndef Q_OS_WINCE
|
||||
if (const HDC hdc = CreateDC(info.szDevice, NULL, NULL, NULL)) {
|
||||
const QDpi dpi = monitorDPI(hMonitor);
|
||||
data->dpi = dpi.first ? dpi : deviceDPI(hdc);
|
||||
#else
|
||||
data->dpi = deviceDPI(hdc);
|
||||
#endif
|
||||
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));
|
||||
@ -330,7 +315,6 @@ enum OrientationPreference // matching Win32 API ORIENTATION_PREFERENCE
|
||||
bool QWindowsScreen::setOrientationPreference(Qt::ScreenOrientation o)
|
||||
{
|
||||
bool result = false;
|
||||
#ifndef Q_OS_WINCE
|
||||
if (QWindowsContext::user32dll.setDisplayAutoRotationPreferences) {
|
||||
DWORD orientationPreference = 0;
|
||||
switch (o) {
|
||||
@ -352,14 +336,12 @@ bool QWindowsScreen::setOrientationPreference(Qt::ScreenOrientation o)
|
||||
}
|
||||
result = QWindowsContext::user32dll.setDisplayAutoRotationPreferences(orientationPreference);
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
return result;
|
||||
}
|
||||
|
||||
Qt::ScreenOrientation QWindowsScreen::orientationPreference()
|
||||
{
|
||||
Qt::ScreenOrientation result = Qt::PrimaryOrientation;
|
||||
#ifndef Q_OS_WINCE
|
||||
if (QWindowsContext::user32dll.getDisplayAutoRotationPreferences) {
|
||||
DWORD orientationPreference = 0;
|
||||
if (QWindowsContext::user32dll.getDisplayAutoRotationPreferences(&orientationPreference)) {
|
||||
@ -379,7 +361,6 @@ Qt::ScreenOrientation QWindowsScreen::orientationPreference()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -388,7 +369,7 @@ Qt::ScreenOrientation QWindowsScreen::orientationPreference()
|
||||
*/
|
||||
QPlatformScreen::SubpixelAntialiasingType QWindowsScreen::subpixelAntialiasingTypeHint() const
|
||||
{
|
||||
#if defined(Q_OS_WINCE) || !defined(FT_LCD_FILTER_H) || !defined(FT_CONFIG_OPTION_SUBPIXEL_RENDERING)
|
||||
#if !defined(FT_LCD_FILTER_H) || !defined(FT_CONFIG_OPTION_SUBPIXEL_RENDERING)
|
||||
return QPlatformScreen::Subpixel_None;
|
||||
#else
|
||||
QPlatformScreen::SubpixelAntialiasingType type = QPlatformScreen::subpixelAntialiasingTypeHint();
|
||||
|
@ -41,9 +41,6 @@
|
||||
#define QWINDOWSSCREEN_H
|
||||
|
||||
#include "qtwindowsglobal.h"
|
||||
#ifdef Q_OS_WINCE
|
||||
# include "qplatformfunctions_wince.h"
|
||||
#endif
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QVector>
|
||||
|
@ -46,9 +46,7 @@
|
||||
#include <QtCore/QDir>
|
||||
|
||||
#include <shlobj.h>
|
||||
#ifndef Q_OS_WINCE
|
||||
# include <intshcut.h>
|
||||
#endif
|
||||
#include <intshcut.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -56,7 +54,6 @@ enum { debug = 0 };
|
||||
|
||||
static inline bool shellExecute(const QUrl &url)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
const QString nativeFilePath =
|
||||
url.isLocalFile() ? QDir::toNativeSeparators(url.toLocalFile()) : url.toString(QUrl::FullyEncoded);
|
||||
const quintptr result =
|
||||
@ -69,10 +66,6 @@ static inline bool shellExecute(const QUrl &url)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
Q_UNUSED(url);
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Retrieve the commandline for the default mail client. It contains a
|
||||
@ -107,13 +100,9 @@ static inline QString mailCommand()
|
||||
}
|
||||
if (!command[0])
|
||||
return QString();
|
||||
#ifndef Q_OS_WINCE
|
||||
wchar_t expandedCommand[MAX_PATH] = {0};
|
||||
return ExpandEnvironmentStrings(command, expandedCommand, MAX_PATH) ?
|
||||
QString::fromWCharArray(expandedCommand) : QString::fromWCharArray(command);
|
||||
#else
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool launchMail(const QUrl &url)
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#include "qtwindowsglobal.h"
|
||||
|
||||
#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
|
||||
#if !defined(QT_NO_TABLETEVENT)
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QPointF>
|
||||
@ -143,5 +143,5 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // !QT_NO_TABLETEVENT && !Q_OS_WINCE
|
||||
#endif // !QT_NO_TABLETEVENT
|
||||
#endif // QWINDOWSTABLETSUPPORT_H
|
||||
|
@ -49,17 +49,12 @@
|
||||
#include "qwindowsintegration.h"
|
||||
#include "qt_windows.h"
|
||||
#include "qwindowsfontdatabase.h"
|
||||
#ifdef Q_OS_WINCE
|
||||
# include "qplatformfunctions_wince.h"
|
||||
# include "winuser.h"
|
||||
#else
|
||||
# include <commctrl.h>
|
||||
# include <objbase.h>
|
||||
# ifndef Q_CC_MINGW
|
||||
# include <commoncontrols.h>
|
||||
# endif
|
||||
# include <shellapi.h>
|
||||
#include <commctrl.h>
|
||||
#include <objbase.h>
|
||||
#ifndef Q_CC_MINGW
|
||||
# include <commoncontrols.h>
|
||||
#endif
|
||||
#include <shellapi.h>
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QCoreApplication>
|
||||
@ -128,7 +123,6 @@ static inline QColor getSysColor(int index)
|
||||
return COLORREFToQColor(GetSysColor(index));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_WINCE_SHELLSDK
|
||||
// QTBUG-48823/Windows 10: SHGetFileInfo() (as called by item views on file system
|
||||
// models has been observed to trigger a WM_PAINT on the mainwindow. Suppress the
|
||||
// behavior by running it in a thread.
|
||||
@ -161,7 +155,6 @@ static bool shGetFileInfoBackground(QWindowsThreadPoolRunner &r,
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif // !QT_NO_WINCE_SHELLSDK
|
||||
|
||||
// from QStyle::standardPalette
|
||||
static inline QPalette standardPalette()
|
||||
@ -272,14 +265,9 @@ static inline QPalette menuPalette(const QPalette &systemPalette)
|
||||
result.setColor(QPalette::Active, QPalette::ButtonText, menuTextColor);
|
||||
result.setColor(QPalette::Disabled, QPalette::WindowText, disabled);
|
||||
result.setColor(QPalette::Disabled, QPalette::Text, disabled);
|
||||
#ifndef Q_OS_WINCE
|
||||
const bool isFlat = booleanSystemParametersInfo(SPI_GETFLATMENU, false);
|
||||
result.setColor(QPalette::Disabled, QPalette::Highlight,
|
||||
getSysColor(isFlat ? COLOR_MENUHILIGHT : COLOR_HIGHLIGHT));
|
||||
#else
|
||||
result.setColor(QPalette::Disabled, QPalette::Highlight,
|
||||
getSysColor(COLOR_HIGHLIGHT));
|
||||
#endif
|
||||
result.setColor(QPalette::Disabled, QPalette::HighlightedText, disabled);
|
||||
result.setColor(QPalette::Disabled, QPalette::Button,
|
||||
result.color(QPalette::Active, QPalette::Button));
|
||||
@ -305,11 +293,7 @@ static inline QPalette *menuBarPalette(const QPalette &menuPalette)
|
||||
QPalette *result = 0;
|
||||
if (booleanSystemParametersInfo(SPI_GETFLATMENU, false)) {
|
||||
result = new QPalette(menuPalette);
|
||||
#ifndef Q_OS_WINCE
|
||||
const QColor menubar(getSysColor(COLOR_MENUBAR));
|
||||
#else
|
||||
const QColor menubar(getSysColor(COLOR_MENU));
|
||||
#endif
|
||||
result->setColor(QPalette::Active, QPalette::Button, menubar);
|
||||
result->setColor(QPalette::Disabled, QPalette::Button, menubar);
|
||||
result->setColor(QPalette::Inactive, QPalette::Button, menubar);
|
||||
@ -379,12 +363,10 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
|
||||
return QVariant(iconThemeSearchPaths());
|
||||
case StyleNames:
|
||||
return QVariant(styleNames());
|
||||
#ifndef Q_OS_WINCE
|
||||
case TextCursorWidth:
|
||||
return QVariant(int(dWordSystemParametersInfo(SPI_GETCARETWIDTH, 1u)));
|
||||
case DropShadow:
|
||||
return QVariant(booleanSystemParametersInfo(SPI_GETDROPSHADOW, false));
|
||||
#endif // !Q_OS_WINCE
|
||||
case MaximumScrollBarDragDistance:
|
||||
return QVariant(qRound(qreal(QWindowsContext::instance()->defaultDPI()) * 1.375));
|
||||
case KeyboardScheme:
|
||||
@ -438,7 +420,6 @@ void QWindowsTheme::clearFonts()
|
||||
|
||||
void QWindowsTheme::refreshFonts()
|
||||
{
|
||||
#ifndef Q_OS_WINCE // ALL THIS FUNCTIONALITY IS MISSING ON WINCE
|
||||
clearFonts();
|
||||
if (!QGuiApplication::desktopSettingsAware())
|
||||
return;
|
||||
@ -467,7 +448,6 @@ void QWindowsTheme::refreshFonts()
|
||||
m_fonts[DockWidgetTitleFont] = new QFont(titleFont);
|
||||
m_fonts[ItemViewFont] = new QFont(iconTitleFont);
|
||||
m_fonts[FixedFont] = new QFont(fixedFont);
|
||||
#endif // !Q_OS_WINCE
|
||||
}
|
||||
|
||||
bool QWindowsTheme::usePlatformNativeDialog(DialogType type) const
|
||||
@ -491,12 +471,7 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon);
|
||||
|
||||
static QPixmap loadIconFromShell32(int resourceId, QSizeF size)
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
HMODULE hmod = LoadLibrary(L"ceshell");
|
||||
#else
|
||||
HMODULE hmod = QSystemLibrary::load(L"shell32");
|
||||
#endif
|
||||
if (hmod) {
|
||||
if (const HMODULE hmod = QSystemLibrary::load(L"shell32")) {
|
||||
HICON iconHandle =
|
||||
static_cast<HICON>(LoadImage(hmod, MAKEINTRESOURCE(resourceId),
|
||||
IMAGE_ICON, int(size.width()), int(size.height()), 0));
|
||||
@ -578,7 +553,6 @@ QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) con
|
||||
stockId = SIID_RECYCLER;
|
||||
resourceId = 191;
|
||||
break;
|
||||
#ifndef Q_OS_WINCE
|
||||
case MessageBoxInformation:
|
||||
stockId = SIID_INFO;
|
||||
iconName = IDI_INFORMATION;
|
||||
@ -598,12 +572,10 @@ QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) con
|
||||
case VistaShield:
|
||||
stockId = SIID_SHIELD;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
if (stockId != SIID_INVALID) {
|
||||
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
|
||||
&& (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)
|
||||
@ -621,7 +593,6 @@ QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) con
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (resourceId != -1) {
|
||||
QPixmap pixmap = loadIconFromShell32(resourceId, pixmapSize);
|
||||
@ -761,22 +732,13 @@ QPixmap QWindowsTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &s
|
||||
|
||||
SHFILEINFO info;
|
||||
const unsigned int flags =
|
||||
#ifndef Q_OS_WINCE
|
||||
SHGFI_ICON|iconSize|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX;
|
||||
#else
|
||||
iconSize|SHGFI_SYSICONINDEX;
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
|
||||
#if !defined(QT_NO_WINCE_SHELLSDK)
|
||||
const bool val = cacheableDirIcon && useDefaultFolderIcon
|
||||
? shGetFileInfoBackground(m_threadPoolRunner, L"dummy", FILE_ATTRIBUTE_DIRECTORY,
|
||||
&info, flags | SHGFI_USEFILEATTRIBUTES)
|
||||
: shGetFileInfoBackground(m_threadPoolRunner, reinterpret_cast<const wchar_t *>(filePath.utf16()), 0,
|
||||
&info, flags);
|
||||
#else
|
||||
const bool val = false;
|
||||
#endif // !QT_NO_WINCE_SHELLSDK
|
||||
|
||||
// Even if GetFileInfo returns a valid result, hIcon can be empty in some cases
|
||||
if (val && info.hIcon) {
|
||||
|
@ -147,7 +147,6 @@ QDebug operator<<(QDebug d, const POINT &p)
|
||||
return d;
|
||||
}
|
||||
|
||||
# ifndef Q_OS_WINCE
|
||||
QDebug operator<<(QDebug d, const NCCALCSIZE_PARAMS &p)
|
||||
{
|
||||
QDebugStateSaver saver(d);
|
||||
@ -178,14 +177,12 @@ QDebug operator<<(QDebug d, const WINDOWPLACEMENT &wp)
|
||||
<< ", rcNormalPosition=" << wp.rcNormalPosition;
|
||||
return d;
|
||||
}
|
||||
# endif // !Q_OS_WINCE
|
||||
#endif // !QT_NO_DEBUG_STREAM
|
||||
|
||||
// QTBUG-43872, for windows that do not have WS_EX_TOOLWINDOW set, WINDOWPLACEMENT
|
||||
// is in workspace/available area coordinates.
|
||||
static QPoint windowPlacementOffset(HWND hwnd, const QPoint &point)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)
|
||||
return QPoint(0, 0);
|
||||
const QWindowsScreenManager &screenManager = QWindowsContext::instance()->screenManager();
|
||||
@ -193,10 +190,6 @@ static QPoint windowPlacementOffset(HWND hwnd, const QPoint &point)
|
||||
? screenManager.screens().constFirst() : screenManager.screenAtDp(point);
|
||||
if (screen)
|
||||
return screen->availableGeometry().topLeft() - screen->geometry().topLeft();
|
||||
#else
|
||||
Q_UNUSED(hwnd)
|
||||
Q_UNUSED(point)
|
||||
#endif
|
||||
return QPoint(0, 0);
|
||||
}
|
||||
|
||||
@ -205,7 +198,6 @@ static QPoint windowPlacementOffset(HWND hwnd, const QPoint &point)
|
||||
static inline QRect frameGeometry(HWND hwnd, bool topLevel)
|
||||
{
|
||||
RECT rect = { 0, 0, 0, 0 };
|
||||
#ifndef Q_OS_WINCE
|
||||
if (topLevel) {
|
||||
WINDOWPLACEMENT windowPlacement;
|
||||
windowPlacement.length = sizeof(WINDOWPLACEMENT);
|
||||
@ -215,7 +207,6 @@ static inline QRect frameGeometry(HWND hwnd, bool topLevel)
|
||||
return result.translated(windowPlacementOffset(hwnd, result.topLeft()));
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
GetWindowRect(hwnd, &rect); // Screen coordinates.
|
||||
const HWND parent = GetParent(hwnd);
|
||||
if (parent && !topLevel) {
|
||||
@ -236,7 +227,6 @@ static QWindow::Visibility windowVisibility_sys(HWND hwnd)
|
||||
{
|
||||
if (!IsWindowVisible(hwnd))
|
||||
return QWindow::Hidden;
|
||||
#ifndef Q_OS_WINCE
|
||||
WINDOWPLACEMENT windowPlacement;
|
||||
windowPlacement.length = sizeof(WINDOWPLACEMENT);
|
||||
if (GetWindowPlacement(hwnd, &windowPlacement)) {
|
||||
@ -251,7 +241,6 @@ static QWindow::Visibility windowVisibility_sys(HWND hwnd)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
return QWindow::Windowed;
|
||||
}
|
||||
|
||||
@ -269,10 +258,6 @@ static inline bool windowIsOpenGL(const QWindow *w)
|
||||
|
||||
static bool applyBlurBehindWindow(HWND hwnd)
|
||||
{
|
||||
#ifdef Q_OS_WINCE
|
||||
Q_UNUSED(hwnd);
|
||||
return false;
|
||||
#else
|
||||
enum { dwmBbEnable = 0x1, dwmBbBlurRegion = 0x2 };
|
||||
|
||||
struct DwmBlurBehind {
|
||||
@ -327,7 +312,6 @@ static bool applyBlurBehindWindow(HWND hwnd)
|
||||
DeleteObject(blurBehind.hRgnBlur);
|
||||
|
||||
return result;
|
||||
#endif // Q_OS_WINCE
|
||||
}
|
||||
|
||||
// from qwidget_win.cpp, pass flags separately in case they have been "autofixed".
|
||||
@ -346,7 +330,6 @@ static bool shouldShowMaximizeButton(const QWindow *w, Qt::WindowFlags flags)
|
||||
// Qt::WindowTransparentForInput (in combination with WS_EX_TRANSPARENT).
|
||||
bool QWindowsWindow::setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity)
|
||||
{
|
||||
#ifndef Q_OS_WINCE // maybe needs revisiting WS_EX_LAYERED
|
||||
const LONG exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
const bool needsLayered = (flags & Qt::WindowTransparentForInput)
|
||||
|| (hasAlpha && (flags & Qt::FramelessWindowHint)) || opacity < 1.0;
|
||||
@ -359,23 +342,10 @@ bool QWindowsWindow::setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool has
|
||||
}
|
||||
}
|
||||
return needsLayered;
|
||||
#else // !Q_OS_WINCE
|
||||
Q_UNUSED(hwnd);
|
||||
Q_UNUSED(flags);
|
||||
Q_UNUSED(hasAlpha);
|
||||
Q_UNUSED(opacity);
|
||||
return false;
|
||||
#endif // Q_OS_WINCE
|
||||
}
|
||||
|
||||
static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bool openGL, qreal level)
|
||||
{
|
||||
#ifdef Q_OS_WINCE // WINCE does not support that feature and microsoft explicitly warns to use those calls
|
||||
Q_UNUSED(hwnd);
|
||||
Q_UNUSED(flags);
|
||||
Q_UNUSED(hasAlpha);
|
||||
Q_UNUSED(level);
|
||||
#else
|
||||
if (QWindowsWindow::setWindowLayered(hwnd, flags, hasAlpha, level)) {
|
||||
const BYTE alpha = BYTE(qRound(255.0 * level));
|
||||
if (hasAlpha && !openGL && (flags & Qt::FramelessWindowHint)) {
|
||||
@ -388,7 +358,6 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bo
|
||||
} else if (IsWindowVisible(hwnd)) { // Repaint when switching from layered.
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
}
|
||||
|
||||
static inline void updateGLWindowSettings(const QWindow *w, HWND hwnd, Qt::WindowFlags flags, qreal opacity)
|
||||
@ -602,12 +571,10 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
|
||||
exStyle |= WS_EX_TOOLWINDOW;
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
// make mouse events fall through this window
|
||||
// NOTE: WS_EX_TRANSPARENT flag can make mouse inputs fall through a layered window
|
||||
if (flagsIn & Qt::WindowTransparentForInput)
|
||||
exStyle |= WS_EX_LAYERED | WS_EX_TRANSPARENT;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -648,10 +615,6 @@ QWindowsWindowData
|
||||
context->frameX, context->frameY,
|
||||
context->frameWidth, context->frameHeight,
|
||||
parentHandle, NULL, appinst, NULL);
|
||||
#ifdef Q_OS_WINCE
|
||||
if (DisableGestures(result.hwnd, TGF_GID_ALL, TGF_SCOPE_WINDOW))
|
||||
EnableGestures(result.hwnd, TGF_GID_DIRECTMANIPULATION, TGF_SCOPE_WINDOW);
|
||||
#endif
|
||||
qCDebug(lcQpaWindows).nospace()
|
||||
<< "CreateWindowEx: returns " << w << ' ' << result.hwnd << " obtained geometry: "
|
||||
<< context->obtainedGeometry << ' ' << context->margins;
|
||||
@ -762,9 +725,7 @@ bool QWindowsGeometryHint::validSize(const QSize &s) const
|
||||
QMargins QWindowsGeometryHint::frame(DWORD style, DWORD exStyle)
|
||||
{
|
||||
RECT rect = {0,0,0,0};
|
||||
#ifndef Q_OS_WINCE
|
||||
style &= ~(WS_OVERLAPPED); // Not permitted, see docs.
|
||||
#endif
|
||||
if (!AdjustWindowRectEx(&rect, style, FALSE, exStyle))
|
||||
qErrnoWarning("%s: AdjustWindowRectEx failed", __FUNCTION__);
|
||||
const QMargins result(qAbs(rect.left), qAbs(rect.top),
|
||||
@ -777,7 +738,6 @@ QMargins QWindowsGeometryHint::frame(DWORD style, DWORD exStyle)
|
||||
|
||||
bool QWindowsGeometryHint::handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
// NCCALCSIZE_PARAMS structure if wParam==TRUE
|
||||
if (!msg.wParam || customMargins.isNull())
|
||||
return false;
|
||||
@ -793,15 +753,8 @@ bool QWindowsGeometryHint::handleCalculateSize(const QMargins &customMargins, co
|
||||
<< ncp->rgrc[0] << ' ' << ncp->rgrc[1] << ' ' << ncp->rgrc[2]
|
||||
<< ' ' << ncp->lppos->cx << ',' << ncp->lppos->cy;
|
||||
return true;
|
||||
#else
|
||||
Q_UNUSED(customMargins)
|
||||
Q_UNUSED(msg)
|
||||
Q_UNUSED(result)
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
void QWindowsGeometryHint::applyToMinMaxInfo(HWND hwnd, MINMAXINFO *mmi) const
|
||||
{
|
||||
return applyToMinMaxInfo(DWORD(GetWindowLong(hwnd, GWL_STYLE)),
|
||||
@ -833,7 +786,6 @@ void QWindowsGeometryHint::applyToMinMaxInfo(DWORD style, DWORD exStyle, MINMAXI
|
||||
<< " frame=" << margins << ' ' << frameWidth << ',' << frameHeight
|
||||
<< " out " << *mmi;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
bool QWindowsGeometryHint::positionIncludesFrame(const QWindow *w)
|
||||
{
|
||||
@ -1078,9 +1030,6 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
|
||||
m_dropTarget(0),
|
||||
m_savedStyle(0),
|
||||
m_format(aWindow->requestedFormat()),
|
||||
#ifdef Q_OS_WINCE
|
||||
m_previouslyHidden(false),
|
||||
#endif
|
||||
m_iconSmall(0),
|
||||
m_iconBig(0),
|
||||
m_surface(0)
|
||||
@ -1114,10 +1063,8 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
|
||||
QWindowsWindow::~QWindowsWindow()
|
||||
{
|
||||
setFlag(WithinDestroy);
|
||||
#ifndef Q_OS_WINCE
|
||||
if (testFlag(TouchRegistered))
|
||||
QWindowsContext::user32dll.unregisterTouchWindow(m_data.hwnd);
|
||||
#endif // !Q_OS_WINCE
|
||||
destroyWindow();
|
||||
destroyIcon();
|
||||
}
|
||||
@ -1161,14 +1108,6 @@ void QWindowsWindow::destroyWindow()
|
||||
m_surface = 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef Q_OS_WINCE
|
||||
if ((m_windowState & Qt::WindowFullScreen) && !m_previouslyHidden) {
|
||||
HWND handle = FindWindow(L"HHTaskBar", L"");
|
||||
if (handle) {
|
||||
ShowWindow(handle, SW_SHOW);
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
DestroyWindow(m_data.hwnd);
|
||||
context->removeWindow(m_data.hwnd);
|
||||
m_data.hwnd = 0;
|
||||
@ -1336,7 +1275,6 @@ QPoint QWindowsWindow::mapFromGlobal(const QPoint &pos) const
|
||||
return pos;
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
static inline HWND transientParentHwnd(HWND hwnd)
|
||||
{
|
||||
if (GetAncestor(hwnd, GA_PARENT) == GetDesktopWindow()) {
|
||||
@ -1346,7 +1284,6 @@ static inline HWND transientParentHwnd(HWND hwnd)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
// Update the transient parent for a toplevel window. The concept does not
|
||||
// really exist on Windows, the relationship is set by passing a parent along with !WS_CHILD
|
||||
@ -1354,7 +1291,6 @@ static inline HWND transientParentHwnd(HWND hwnd)
|
||||
// SetParent, which would make it a real child).
|
||||
void QWindowsWindow::updateTransientParent() const
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
if (window()->type() == Qt::Popup)
|
||||
return; // QTBUG-34503, // a popup stays on top, no parent, see also WindowCreationData::fromWindow().
|
||||
// Update transient parent.
|
||||
@ -1366,7 +1302,6 @@ void QWindowsWindow::updateTransientParent() const
|
||||
newTransientParent = tw->handle();
|
||||
if (newTransientParent != oldTransientParent)
|
||||
SetWindowLongPtr(m_data.hwnd, GWL_HWNDPARENT, LONG_PTR(newTransientParent));
|
||||
#endif // !Q_OS_WINCE
|
||||
}
|
||||
|
||||
static inline bool testShowWithoutActivating(const QWindow *window)
|
||||
@ -1484,16 +1419,12 @@ void QWindowsWindow::handleCompositionSettingsChanged()
|
||||
|
||||
static QRect normalFrameGeometry(HWND hwnd)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
WINDOWPLACEMENT wp;
|
||||
wp.length = sizeof(WINDOWPLACEMENT);
|
||||
if (GetWindowPlacement(hwnd, &wp)) {
|
||||
const QRect result = qrectFromRECT(wp.rcNormalPosition);
|
||||
return result.translated(windowPlacementOffset(hwnd, result.topLeft()));
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(hwnd)
|
||||
#endif
|
||||
return QRect();
|
||||
}
|
||||
|
||||
@ -1613,7 +1544,6 @@ void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
|
||||
<< " new frame: " << frameGeometry;
|
||||
|
||||
bool result = false;
|
||||
#ifndef Q_OS_WINCE
|
||||
const HWND hwnd = handle();
|
||||
WINDOWPLACEMENT windowPlacement;
|
||||
windowPlacement.length = sizeof(WINDOWPLACEMENT);
|
||||
@ -1626,9 +1556,7 @@ void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
|
||||
RECTfromQRect(frameGeometry.translated(-windowPlacementOffset(hwnd, frameGeometry.topLeft())));
|
||||
windowPlacement.showCmd = windowPlacement.showCmd == SW_SHOWMINIMIZED ? SW_SHOWMINIMIZED : SW_HIDE;
|
||||
result = SetWindowPlacement(hwnd, &windowPlacement);
|
||||
} else
|
||||
#endif // !Q_OS_WINCE
|
||||
{
|
||||
} else {
|
||||
result = MoveWindow(hwnd, frameGeometry.x(), frameGeometry.y(),
|
||||
frameGeometry.width(), frameGeometry.height(), true);
|
||||
}
|
||||
@ -1820,18 +1748,6 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
|
||||
setFlag(FrameDirty);
|
||||
|
||||
if ((oldState == Qt::WindowFullScreen) != (newState == Qt::WindowFullScreen)) {
|
||||
#ifdef Q_OS_WINCE
|
||||
HWND handle = FindWindow(L"HHTaskBar", L"");
|
||||
if (handle) {
|
||||
if (newState == Qt::WindowFullScreen) {
|
||||
BOOL hidden = ShowWindow(handle, SW_HIDE);
|
||||
if (!hidden)
|
||||
m_previouslyHidden = true;
|
||||
} else if (!m_previouslyHidden){
|
||||
ShowWindow(handle, SW_SHOW);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (newState == Qt::WindowFullScreen) {
|
||||
#ifndef Q_FLATTEN_EXPOSE
|
||||
UINT newStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP;
|
||||
@ -1843,17 +1759,13 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
|
||||
// Window state but emulated by changing geometry and style.
|
||||
if (!m_savedStyle) {
|
||||
m_savedStyle = style();
|
||||
#ifndef Q_OS_WINCE
|
||||
if (oldState == Qt::WindowMinimized || oldState == Qt::WindowMaximized) {
|
||||
const QRect nf = normalFrameGeometry(m_data.hwnd);
|
||||
if (nf.isValid())
|
||||
m_savedFrameGeometry = nf;
|
||||
} else {
|
||||
#endif
|
||||
m_savedFrameGeometry = frameGeometry_sys();
|
||||
#ifndef Q_OS_WINCE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (m_savedStyle & WS_SYSMENU)
|
||||
newStyle |= WS_SYSMENU;
|
||||
@ -1966,7 +1878,6 @@ void QWindowsWindow::propagateSizeHints()
|
||||
|
||||
bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &margins)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
if (!qWindow->isTopLevel()) // Implement hasHeightForWidth().
|
||||
return false;
|
||||
WINDOWPOS *windowPos = reinterpret_cast<WINDOWPOS *>(message->lParam);
|
||||
@ -1986,10 +1897,6 @@ bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *
|
||||
windowPos->cx = correctedFrameGeometry.width();
|
||||
windowPos->cy = correctedFrameGeometry.height();
|
||||
return true;
|
||||
#else // !Q_OS_WINCE
|
||||
Q_UNUSED(message)
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool QWindowsWindow::handleGeometryChanging(MSG *message) const
|
||||
@ -2082,7 +1989,6 @@ void QWindowsWindow::requestActivateWindow()
|
||||
// 'Active' state handling is based in focus since it needs to work for
|
||||
// child windows as well.
|
||||
if (m_data.hwnd) {
|
||||
#ifndef Q_OS_WINCE
|
||||
const DWORD currentThread = GetCurrentThreadId();
|
||||
bool attached = false;
|
||||
DWORD foregroundThread = 0;
|
||||
@ -2099,13 +2005,10 @@ void QWindowsWindow::requestActivateWindow()
|
||||
attached = AttachThreadInput(foregroundThread, currentThread, TRUE) == TRUE;
|
||||
}
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
SetForegroundWindow(m_data.hwnd);
|
||||
SetFocus(m_data.hwnd);
|
||||
#ifndef Q_OS_WINCE
|
||||
if (attached)
|
||||
AttachThreadInput(foregroundThread, currentThread, FALSE);
|
||||
#endif // !Q_OS_WINCE
|
||||
}
|
||||
}
|
||||
|
||||
@ -2187,7 +2090,6 @@ void QWindowsWindow::setFrameStrutEventsEnabled(bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
|
||||
void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
|
||||
{
|
||||
const QWindowsGeometryHint hint(window(), m_data.customMargins);
|
||||
@ -2258,8 +2160,6 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
// Return the default cursor (Arrow) from QWindowsCursor's cache.
|
||||
static inline CursorHandlePtr defaultCursor(const QWindow *w)
|
||||
@ -2326,7 +2226,6 @@ void QWindowsWindow::setCursor(const CursorHandlePtr &c)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
void QWindowsWindow::setAlertState(bool enabled)
|
||||
{
|
||||
if (isAlertState() == enabled)
|
||||
@ -2365,7 +2264,6 @@ void QWindowsWindow::stopAlertWindow()
|
||||
info.uCount = 0;
|
||||
FlashWindowEx(&info);
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
bool QWindowsWindow::isEnabled() const
|
||||
{
|
||||
@ -2481,7 +2379,6 @@ void QWindowsWindow::setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWind
|
||||
|
||||
void QWindowsWindow::registerTouchWindow(QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes)
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
if ((QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch)) {
|
||||
ULONG touchFlags = 0;
|
||||
const bool ret = QWindowsContext::user32dll.isTouchWindow(m_data.hwnd, &touchFlags);
|
||||
@ -2494,7 +2391,6 @@ void QWindowsWindow::registerTouchWindow(QWindowsWindowFunctions::TouchWindowTou
|
||||
else
|
||||
qErrnoWarning("RegisterTouchWindow() failed for window '%s'.", qPrintable(window()->objectName()));
|
||||
}
|
||||
#endif // !Q_OS_WINCE
|
||||
}
|
||||
|
||||
void QWindowsWindow::aboutToMakeCurrent()
|
||||
|
@ -41,9 +41,6 @@
|
||||
#define QWINDOWSWINDOW_H
|
||||
|
||||
#include "qtwindows_additional.h"
|
||||
#ifdef Q_OS_WINCE
|
||||
# include "qplatformfunctions_wince.h"
|
||||
#endif
|
||||
#include "qwindowscursor.h"
|
||||
|
||||
#include <qpa/qplatformwindow.h>
|
||||
@ -60,10 +57,8 @@ struct QWindowsGeometryHint
|
||||
explicit QWindowsGeometryHint(const QWindow *w, const QMargins &customMargins);
|
||||
static QMargins frame(DWORD style, DWORD exStyle);
|
||||
static bool handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result);
|
||||
#ifndef Q_OS_WINCE //MinMax maybe define struct if not available
|
||||
void applyToMinMaxInfo(DWORD style, DWORD exStyle, MINMAXINFO *mmi) const;
|
||||
void applyToMinMaxInfo(HWND hwnd, MINMAXINFO *mmi) const;
|
||||
#endif
|
||||
bool validSize(const QSize &s) const;
|
||||
|
||||
static inline QPoint mapToGlobal(HWND hwnd, const QPoint &);
|
||||
@ -83,10 +78,8 @@ struct QWindowCreationContext
|
||||
QWindowCreationContext(const QWindow *w, const QRect &r,
|
||||
const QMargins &customMargins,
|
||||
DWORD style, DWORD exStyle);
|
||||
#ifndef Q_OS_WINCE //MinMax maybe define struct if not available
|
||||
void applyToMinMaxInfo(MINMAXINFO *mmi) const
|
||||
{ geometryHint.applyToMinMaxInfo(style, exStyle, mmi); }
|
||||
#endif
|
||||
|
||||
QWindowsGeometryHint geometryHint;
|
||||
const QWindow *window;
|
||||
@ -293,10 +286,8 @@ public:
|
||||
|
||||
HDC getDC();
|
||||
void releaseDC();
|
||||
#ifndef Q_OS_WINCE // maybe available on some SDKs revisit WM_GETMINMAXINFO
|
||||
void getSizeHints(MINMAXINFO *mmi) const;
|
||||
bool handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const;
|
||||
#endif // !Q_OS_WINCE
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
CursorHandlePtr cursor() const { return m_cursor; }
|
||||
@ -316,12 +307,10 @@ public:
|
||||
void invalidateSurface() Q_DECL_OVERRIDE;
|
||||
void aboutToMakeCurrent();
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
void setAlertState(bool enabled) Q_DECL_OVERRIDE;
|
||||
bool isAlertState() const Q_DECL_OVERRIDE { return testFlag(AlertState); }
|
||||
void alertWindow(int durationMs = 0);
|
||||
void stopAlertWindow();
|
||||
#endif
|
||||
|
||||
static void setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes);
|
||||
void registerTouchWindow(QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes = QWindowsWindowFunctions::NormalTouch);
|
||||
@ -355,9 +344,6 @@ private:
|
||||
unsigned m_savedStyle;
|
||||
QRect m_savedFrameGeometry;
|
||||
const QSurfaceFormat m_format;
|
||||
#ifdef Q_OS_WINCE
|
||||
bool m_previouslyHidden;
|
||||
#endif
|
||||
HICON m_iconSmall;
|
||||
HICON m_iconBig;
|
||||
void *m_surface;
|
||||
@ -366,11 +352,9 @@ private:
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
QDebug operator<<(QDebug d, const RECT &r);
|
||||
QDebug operator<<(QDebug d, const POINT &);
|
||||
# ifndef Q_OS_WINCE
|
||||
QDebug operator<<(QDebug d, const MINMAXINFO &i);
|
||||
QDebug operator<<(QDebug d, const NCCALCSIZE_PARAMS &p);
|
||||
QDebug operator<<(QDebug d, const WINDOWPLACEMENT &);
|
||||
# endif // !Q_OS_WINCE
|
||||
#endif // !QT_NO_DEBUG_STREAM
|
||||
|
||||
// ---------- QWindowsGeometryHint inline functions.
|
||||
@ -434,11 +418,7 @@ inline void QWindowsWindow::destroyIcon()
|
||||
|
||||
inline bool QWindowsWindow::isLayered() const
|
||||
{
|
||||
#ifndef Q_OS_WINCE
|
||||
return GetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE) & WS_EX_LAYERED;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -1,14 +1,11 @@
|
||||
# Note: OpenGL32 must precede Gdi32 as it overwrites some functions.
|
||||
LIBS *= -lole32
|
||||
!wince: LIBS *= -luser32 -lwinspool -limm32 -lwinmm -loleaut32
|
||||
LIBS += -lole32 -luser32 -lwinspool -limm32 -lwinmm -loleaut32
|
||||
|
||||
contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2):!contains(QT_CONFIG, dynamicgl): LIBS *= -lopengl32
|
||||
|
||||
mingw: LIBS *= -luuid
|
||||
# For the dialog helpers:
|
||||
!wince: LIBS *= -lshlwapi -lshell32
|
||||
!wince: LIBS *= -ladvapi32
|
||||
wince: DEFINES *= QT_LIBINFIX=L"\"\\\"$${QT_LIBINFIX}\\\"\""
|
||||
LIBS += -lshlwapi -lshell32 -ladvapi32
|
||||
|
||||
DEFINES *= QT_NO_CAST_FROM_ASCII
|
||||
|
||||
@ -59,7 +56,6 @@ HEADERS += \
|
||||
$$PWD/qwindowstheme.h \
|
||||
$$PWD/qwindowsdialoghelpers.h \
|
||||
$$PWD/qwindowsservices.h \
|
||||
$$PWD/qplatformfunctions_wince.h \
|
||||
$$PWD/qwindowsnativeimage.h \
|
||||
$$PWD/qwindowsnativeinterface.h \
|
||||
$$PWD/qwindowsopengltester.h \
|
||||
@ -98,22 +94,20 @@ contains(QT_CONFIG,dynamicgl) {
|
||||
}
|
||||
}
|
||||
|
||||
!wince:!contains( DEFINES, QT_NO_TABLETEVENT ) {
|
||||
!contains( DEFINES, QT_NO_TABLETEVENT ) {
|
||||
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/wintab
|
||||
HEADERS += $$PWD/qwindowstabletsupport.h
|
||||
SOURCES += $$PWD/qwindowstabletsupport.cpp
|
||||
}
|
||||
|
||||
!wince:!contains( DEFINES, QT_NO_SESSIONMANAGER ) {
|
||||
!contains( DEFINES, QT_NO_SESSIONMANAGER ) {
|
||||
SOURCES += $$PWD/qwindowssessionmanager.cpp
|
||||
HEADERS += $$PWD/qwindowssessionmanager.h
|
||||
}
|
||||
|
||||
!wince:!contains( DEFINES, QT_NO_IMAGEFORMAT_PNG ) {
|
||||
RESOURCES += $$PWD/cursors.qrc
|
||||
}
|
||||
!contains( DEFINES, QT_NO_IMAGEFORMAT_PNG ):RESOURCES += $$PWD/cursors.qrc
|
||||
|
||||
!wince: RESOURCES += $$PWD/openglblacklists.qrc
|
||||
RESOURCES += $$PWD/openglblacklists.qrc
|
||||
|
||||
contains(QT_CONFIG, freetype) {
|
||||
DEFINES *= QT_NO_FONTCONFIG
|
||||
|
@ -4,7 +4,7 @@ QT *= core-private
|
||||
QT *= gui-private
|
||||
QT *= platformsupport-private
|
||||
|
||||
!wince:LIBS *= -lgdi32
|
||||
LIBS += -lgdi32
|
||||
|
||||
include(windows.pri)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user