From b3e0732740d8fdace82d91973dac87261402604f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 28 May 2020 08:20:55 +0200 Subject: [PATCH] Move windows font databases into QtGui Requires adapting a few config checks since cmake currently does not detect directwrite. Task-number: QTBUG-83255 Task-number: QTBUG-83931 Change-Id: I521f1924f701260b41dccbcecf87b19f08df5ccc Reviewed-by: Alexandru Croitor --- src/gui/.prev_CMakeLists.txt | 61 ++++++++++++++++++- src/gui/CMakeLists.txt | 61 ++++++++++++++++++- src/gui/text/text.pri | 5 ++ .../qwindowsdirectwritefontdatabase.cpp | 0 .../qwindowsdirectwritefontdatabase_p.h | 2 +- .../text}/windows/qwindowsfontdatabase.cpp | 26 ++++---- .../text}/windows/qwindowsfontdatabase_ft.cpp | 0 .../text}/windows/qwindowsfontdatabase_ft_p.h | 2 +- .../text}/windows/qwindowsfontdatabase_p.h | 8 ++- .../windows/qwindowsfontdatabasebase.cpp | 36 ++++------- .../windows/qwindowsfontdatabasebase_p.h | 2 +- .../text}/windows/qwindowsfontengine.cpp | 0 .../text}/windows/qwindowsfontengine_p.h | 0 .../windows/qwindowsfontenginedirectwrite.cpp | 0 .../windows/qwindowsfontenginedirectwrite_p.h | 0 .../text}/windows/qwindowsnativeimage.cpp | 0 .../text}/windows/qwindowsnativeimage_p.h | 2 +- src/gui/text/windows/windows.pri | 41 +++++++++++++ .../fontdatabases/.prev_CMakeLists.txt | 61 ------------------- .../fontdatabases/CMakeLists.txt | 61 ------------------- .../fontdatabases/fontdatabases.pro | 4 -- .../fontdatabases/windows/windows.pri | 43 ------------- src/plugins/platforms/direct2d/direct2d.pro | 3 +- .../direct2d/qwindowsdirect2dpaintengine.cpp | 3 +- .../platforms/minimal/.prev_CMakeLists.txt | 2 +- src/plugins/platforms/minimal/CMakeLists.txt | 2 +- src/plugins/platforms/minimal/minimal.pro | 2 +- .../platforms/minimal/qminimalintegration.cpp | 4 +- .../platforms/offscreen/.prev_CMakeLists.txt | 2 +- .../platforms/offscreen/CMakeLists.txt | 2 +- src/plugins/platforms/offscreen/offscreen.pro | 2 +- .../platforms/windows/.prev_CMakeLists.txt | 1 - src/plugins/platforms/windows/CMakeLists.txt | 1 - .../windows/qwindowsbackingstore.cpp | 2 +- .../platforms/windows/qwindowsintegration.cpp | 5 +- .../platforms/windows/qwindowsintegration.h | 2 +- .../windows/qwindowsnativeinterface.cpp | 2 +- .../platforms/windows/qwindowstheme.cpp | 19 +++--- src/plugins/platforms/windows/windows.pro | 3 +- 39 files changed, 228 insertions(+), 244 deletions(-) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsdirectwritefontdatabase.cpp (100%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsdirectwritefontdatabase_p.h (97%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontdatabase.cpp (99%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontdatabase_ft.cpp (100%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontdatabase_ft_p.h (97%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontdatabase_p.h (96%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontdatabasebase.cpp (96%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontdatabasebase_p.h (98%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontengine.cpp (100%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontengine_p.h (100%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontenginedirectwrite.cpp (100%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsfontenginedirectwrite_p.h (100%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsnativeimage.cpp (100%) rename src/{platformsupport/fontdatabases => gui/text}/windows/qwindowsnativeimage_p.h (98%) create mode 100644 src/gui/text/windows/windows.pri delete mode 100644 src/platformsupport/fontdatabases/windows/windows.pri diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt index e53ec30af8..dba7b9d3cb 100644 --- a/src/gui/.prev_CMakeLists.txt +++ b/src/gui/.prev_CMakeLists.txt @@ -306,6 +306,15 @@ qt_extend_target(Gui CONDITION WIN32 platform/windows/qwindowsguieventdispatcher.cpp platform/windows/qwindowsguieventdispatcher_p.h rhi/qrhid3d11.cpp rhi/qrhid3d11_p.h rhi/qrhid3d11_p_p.h + text/windows/qwindowsfontdatabase.cpp text/windows/qwindowsfontdatabase_p.h + text/windows/qwindowsfontdatabasebase.cpp text/windows/qwindowsfontdatabasebase_p.h + text/windows/qwindowsfontengine.cpp text/windows/qwindowsfontengine_p.h + text/windows/qwindowsnativeimage.cpp text/windows/qwindowsnativeimage_p.h + LIBRARIES + advapi32 + gdi32 + ole32 + user32 PUBLIC_LIBRARIES d3d11 dxgi @@ -551,6 +560,52 @@ qt_extend_target(Gui CONDITION APPLE AND QT_FEATURE_freetype WrapFreetype::WrapFreetype ) +qt_extend_target(Gui CONDITION QT_FEATURE_freetype AND WIN32 + SOURCES + text/windows/qwindowsfontdatabase_ft.cpp text/windows/qwindowsfontdatabase_ft_p.h + LIBRARIES + WrapFreetype::WrapFreetype +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 + SOURCES + text/windows/qwindowsfontenginedirectwrite.cpp text/windows/qwindowsfontenginedirectwrite_p.h + LIBRARIES + d2d1 +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite3 AND WIN32 + SOURCES + text/windows/qwindowsdirectwritefontdatabase.cpp text/windows/qwindowsdirectwritefontdatabase_p.h + DEFINES + QT_USE_DIRECTWRITE2 + QT_USE_DIRECTWRITE3 + LIBRARIES + dwrite_3 +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT QT_FEATURE_directwrite3 + DEFINES + QT_USE_DIRECTWRITE2 + LIBRARIES + dwrite_2 +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT QT_FEATURE_directwrite2 AND NOT QT_FEATURE_directwrite3 + LIBRARIES + dwrite +) + +qt_extend_target(Gui CONDITION WIN32 AND (NOT QT_FEATURE_direct2d OR NOT QT_FEATURE_directwrite) + DEFINES + QT_NO_DIRECTWRITE +) + +qt_extend_target(Gui CONDITION MINGW AND WIN32 + LIBRARIES + uuid +) + qt_extend_target(Gui CONDITION UNIX AND NOT ANDROID AND NOT INTEGRITY AND NOT (TEST_architecture_arch STREQUAL "arm64") AND NOT UIKIT DEFINES ENABLE_PIXMAN_DRAWHELPERS @@ -616,7 +671,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan Vulkan::Vulkan_nolink ) -#### Keys ignored in scope 89:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: +#### Keys ignored in scope 99:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: # QMAKE_EXTRA_COMPILERS = "qvkgen_h" "qvkgen_ph" "qvkgen_pimpl" # QMAKE_QVKGEN_INPUT = "vulkan/vk.xml" # QMAKE_QVKGEN_LICENSE_HEADER = "$$QT_SOURCE_TREE/header.LGPL" @@ -632,10 +687,10 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan # qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT" # qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp" -#### Keys ignored in scope 90:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: +#### Keys ignored in scope 100:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: # qvkgen_h.variable_out = "HEADERS" -#### Keys ignored in scope 91:.:vulkan:vulkan/vulkan.pri:else: +#### Keys ignored in scope 101:.:vulkan:vulkan/vulkan.pri:else: # qvkgen_h.CONFIG = "target_predeps" "no_link" qt_extend_target(Gui CONDITION WASM diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 940b81e264..c38129c028 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -395,6 +395,15 @@ qt_extend_target(Gui CONDITION WIN32 platform/windows/qwindowsguieventdispatcher.cpp platform/windows/qwindowsguieventdispatcher_p.h rhi/qrhid3d11.cpp rhi/qrhid3d11_p.h rhi/qrhid3d11_p_p.h + text/windows/qwindowsfontdatabase.cpp text/windows/qwindowsfontdatabase_p.h + text/windows/qwindowsfontdatabasebase.cpp text/windows/qwindowsfontdatabasebase_p.h + text/windows/qwindowsfontengine.cpp text/windows/qwindowsfontengine_p.h + text/windows/qwindowsnativeimage.cpp text/windows/qwindowsnativeimage_p.h + LIBRARIES + advapi32 + gdi32 + ole32 + user32 PUBLIC_LIBRARIES d3d11 dxgi @@ -659,6 +668,52 @@ qt_extend_target(Gui CONDITION APPLE AND QT_FEATURE_freetype WrapFreetype::WrapFreetype ) +qt_extend_target(Gui CONDITION QT_FEATURE_freetype AND WIN32 + SOURCES + text/windows/qwindowsfontdatabase_ft.cpp text/windows/qwindowsfontdatabase_ft_p.h + LIBRARIES + WrapFreetype::WrapFreetype +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 + SOURCES + text/windows/qwindowsfontenginedirectwrite.cpp text/windows/qwindowsfontenginedirectwrite_p.h + LIBRARIES + d2d1 +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite3 AND WIN32 + SOURCES + text/windows/qwindowsdirectwritefontdatabase.cpp text/windows/qwindowsdirectwritefontdatabase_p.h + DEFINES + QT_USE_DIRECTWRITE2 + QT_USE_DIRECTWRITE3 + LIBRARIES + dwrite_3 +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT QT_FEATURE_directwrite3 + DEFINES + QT_USE_DIRECTWRITE2 + LIBRARIES + dwrite_2 +) + +qt_extend_target(Gui CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT QT_FEATURE_directwrite2 AND NOT QT_FEATURE_directwrite3 + LIBRARIES + dwrite +) + +qt_extend_target(Gui CONDITION WIN32 AND (NOT QT_FEATURE_direct2d OR NOT QT_FEATURE_directwrite) + DEFINES + QT_NO_DIRECTWRITE +) + +qt_extend_target(Gui CONDITION MINGW AND WIN32 + LIBRARIES + uuid +) + qt_extend_target(Gui CONDITION UNIX AND NOT ANDROID AND NOT INTEGRITY AND NOT (TEST_architecture_arch STREQUAL "arm64") AND NOT UIKIT DEFINES ENABLE_PIXMAN_DRAWHELPERS @@ -724,7 +779,7 @@ qt_extend_target(Gui CONDITION QT_FEATURE_vulkan Vulkan::Vulkan_nolink ) -#### Keys ignored in scope 89:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: +#### Keys ignored in scope 99:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vkgen: # special case begin # We must always generate syncqt-injected header files, # because we added a custom command earlier for those for framework builds. @@ -780,10 +835,10 @@ add_custom_command( # qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT" # qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp" -#### Keys ignored in scope 90:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: +#### Keys ignored in scope 100:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: # qvkgen_h.variable_out = "HEADERS" -#### Keys ignored in scope 91:.:vulkan:vulkan/vulkan.pri:else: +#### Keys ignored in scope 101:.:vulkan:vulkan/vulkan.pri:else: # qvkgen_h.CONFIG = "target_predeps" "no_link" qt_extend_target(Gui CONDITION WASM diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri index 192cd5f426..8c36dce6b6 100644 --- a/src/gui/text/text.pri +++ b/src/gui/text/text.pri @@ -131,3 +131,8 @@ qtConfig(freetype) { darwin { include($$PWD/coretext/coretext.pri) } + +win32 { + include($$PWD/windows/windows.pri) +} + diff --git a/src/platformsupport/fontdatabases/windows/qwindowsdirectwritefontdatabase.cpp b/src/gui/text/windows/qwindowsdirectwritefontdatabase.cpp similarity index 100% rename from src/platformsupport/fontdatabases/windows/qwindowsdirectwritefontdatabase.cpp rename to src/gui/text/windows/qwindowsdirectwritefontdatabase.cpp diff --git a/src/platformsupport/fontdatabases/windows/qwindowsdirectwritefontdatabase_p.h b/src/gui/text/windows/qwindowsdirectwritefontdatabase_p.h similarity index 97% rename from src/platformsupport/fontdatabases/windows/qwindowsdirectwritefontdatabase_p.h rename to src/gui/text/windows/qwindowsdirectwritefontdatabase_p.h index f46c57e6a5..5637b5dfb0 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsdirectwritefontdatabase_p.h +++ b/src/gui/text/windows/qwindowsdirectwritefontdatabase_p.h @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE #ifdef QT_USE_DIRECTWRITE3 -class QWindowsDirectWriteFontDatabase : public QWindowsFontDatabaseBase +class Q_GUI_EXPORT QWindowsDirectWriteFontDatabase : public QWindowsFontDatabaseBase { Q_DISABLE_COPY_MOVE(QWindowsDirectWriteFontDatabase) public: diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/gui/text/windows/qwindowsfontdatabase.cpp similarity index 99% rename from src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp rename to src/gui/text/windows/qwindowsfontdatabase.cpp index 2beb35eb03..7af20df94c 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/gui/text/windows/qwindowsfontdatabase.cpp @@ -174,13 +174,18 @@ QDebug operator<<(QDebug d, const QFontDef &def) return d; } +void QWindowsFontDatabase::debugFormat(QDebug &d, const LOGFONT &lf) +{ + d << "LOGFONT(\"" << QString::fromWCharArray(lf.lfFaceName) + << "\", lfWidth=" << lf.lfWidth << ", lfHeight=" << lf.lfHeight << ')'; +} + QDebug operator<<(QDebug d, const LOGFONT &lf) { QDebugStateSaver saver(d); d.nospace(); d.noquote(); - d << "LOGFONT(\"" << QString::fromWCharArray(lf.lfFaceName) - << "\", lfWidth=" << lf.lfWidth << ", lfHeight=" << lf.lfHeight << ')'; + QWindowsFontDatabase::debugFormat(d, lf); return d; } #endif // !QT_NO_DEBUG_STREAM @@ -815,13 +820,12 @@ QT_WARNING_POP static_cast(fontEngine)->setUniqueFamilyName(uniqueFamilyName); fontEngine->fontDef.family = actualFontName; break; - -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) case QFontEngine::DirectWrite: static_cast(fontEngine)->setUniqueFamilyName(uniqueFamilyName); fontEngine->fontDef.family = actualFontName; break; -#endif // !QT_NO_DIRECTWRITE +#endif // directwrite && direct2d default: Q_ASSERT_X(false, Q_FUNC_INFO, "Unhandled font engine."); @@ -841,11 +845,11 @@ QT_WARNING_POP if (fontEngine != nullptr) font.updateFromOS2Table(fontEngine); } -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) else { fontEngine = QWindowsFontDatabaseBase::fontEngine(fontData, pixelSize, hintingPreference); } -#endif +#endif // directwrite && direct2d qCDebug(lcQpaFonts) << __FUNCTION__ << "FONTDATA" << fontData << pixelSize << hintingPreference << fontEngine; return fontEngine; @@ -1145,7 +1149,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q DeleteObject(hfont); } -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) if (data->directWriteFactory != nullptr) { const QString fam = QString::fromWCharArray(lf.lfFaceName); const QString nameSubstitute = QWindowsFontEngineDirectWrite::fontNameSubstitute(fam); @@ -1169,7 +1173,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q HRESULT hr = data->directWriteGdiInterop->CreateFontFaceFromHdc(data->hdc, &directWriteFontFace); if (SUCCEEDED(hr)) { bool isColorFont = false; -#if defined(QT_USE_DIRECTWRITE2) +#if QT_CONFIG(direct2d) IDWriteFontFace2 *directWriteFontFace2 = nullptr; if (SUCCEEDED(directWriteFontFace->QueryInterface(__uuidof(IDWriteFontFace2), reinterpret_cast(&directWriteFontFace2)))) { @@ -1178,7 +1182,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q directWriteFontFace2->Release(); } -#endif +#endif // direct2d useDw = useDw || useDirectWrite(hintingPreference, fam, isColorFont); qCDebug(lcQpaFonts) << __FUNCTION__ << request.family << request.pointSize << "pt" << "hintingPreference=" << hintingPreference << "color=" << isColorFont @@ -1210,7 +1214,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q DeleteObject(hfont); } } -#endif // QT_NO_DIRECTWRITE +#endif // directwrite direct2d if (!fe) { QWindowsFontEngine *few = new QWindowsFontEngine(request.family, lf, data); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/gui/text/windows/qwindowsfontdatabase_ft.cpp similarity index 100% rename from src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp rename to src/gui/text/windows/qwindowsfontdatabase_ft.cpp diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h b/src/gui/text/windows/qwindowsfontdatabase_ft_p.h similarity index 97% rename from src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h rename to src/gui/text/windows/qwindowsfontdatabase_ft_p.h index 16f61010d4..af0b1d7077 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h +++ b/src/gui/text/windows/qwindowsfontdatabase_ft_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -class QWindowsFontDatabaseFT : public QFreeTypeFontDatabase +class Q_GUI_EXPORT QWindowsFontDatabaseFT : public QFreeTypeFontDatabase { public: void populateFontDatabase() override; diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/gui/text/windows/qwindowsfontdatabase_p.h similarity index 96% rename from src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h rename to src/gui/text/windows/qwindowsfontdatabase_p.h index 0652685fc5..b870d6c4a0 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h +++ b/src/gui/text/windows/qwindowsfontdatabase_p.h @@ -61,7 +61,9 @@ QT_BEGIN_NAMESPACE -class QWindowsFontDatabase : public QWindowsFontDatabaseBase +class QDebug; + +class Q_GUI_EXPORT QWindowsFontDatabase : public QWindowsFontDatabaseBase { Q_DISABLE_COPY_MOVE(QWindowsFontDatabase) public: @@ -100,6 +102,10 @@ public: static void setFontOptions(unsigned options); static unsigned fontOptions(); +#ifndef QT_NO_DEBUG_STREAM + static void debugFormat(QDebug &d, const LOGFONT &lf); +#endif // !QT_NO_DEBUG_STREAM + private: void removeApplicationFonts(); void addDefaultEUDCFont(); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabasebase.cpp b/src/gui/text/windows/qwindowsfontdatabasebase.cpp similarity index 96% rename from src/platformsupport/fontdatabases/windows/qwindowsfontdatabasebase.cpp rename to src/gui/text/windows/qwindowsfontdatabasebase.cpp index 568d1463e7..6c32b40549 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabasebase.cpp +++ b/src/gui/text/windows/qwindowsfontdatabasebase.cpp @@ -303,7 +303,7 @@ QString QWindowsFontDatabaseBase::EmbeddedFont::changeFamilyName(const QString & return oldFamilyName; } -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) namespace { class DirectWriteFontFileStream: public IDWriteFontFileStream @@ -522,7 +522,7 @@ namespace { }; } // Anonymous namespace -#endif // !defined(QT_NO_DIRECTWRITE) +#endif // directwrite && direct2d QWindowsFontEngineData::~QWindowsFontEngineData() @@ -530,7 +530,7 @@ QWindowsFontEngineData::~QWindowsFontEngineData() if (hdc) DeleteDC(hdc); -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) if (directWriteGdiInterop) directWriteGdiInterop->Release(); if (directWriteFactory) @@ -564,7 +564,7 @@ QSharedPointer QWindowsFontDatabaseBase::data() bool QWindowsFontDatabaseBase::init(QSharedPointer d) { -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) if (!d->directWriteFactory) { createDirectWriteFactory(&d->directWriteFactory); if (!d->directWriteFactory) @@ -577,11 +577,11 @@ bool QWindowsFontDatabaseBase::init(QSharedPointer d) return false; } } -#endif +#endif // directwrite && direct2d return true; } -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) // ### Qt 6: Link directly to dwrite instead typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID &, IUnknown **); static inline DWriteCreateFactoryType resolveDWriteCreateFactory() @@ -622,7 +622,7 @@ void QWindowsFontDatabaseBase::createDirectWriteFactory(IDWriteFactory **factory *factory = static_cast(result); } -#endif // !defined(QT_NO_DIRECTWRITE) +#endif // directwrite && direct2d static int s_defaultVerticalDPI = 96; // Native Pixels @@ -757,30 +757,16 @@ HFONT QWindowsFontDatabaseBase::systemFont() QFont QWindowsFontDatabaseBase::systemDefaultFont() { -#if QT_VERSION >= 0x060000 // Qt 6: Obtain default GUI font (typically "Segoe UI, 9pt", see QTBUG-58610) NONCLIENTMETRICS ncm; ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) + sizeof(LOGFONT); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize , &ncm, 0); const QFont systemFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMessageFont); -#else - LOGFONT lf; - GetObject(systemFont(), sizeof(lf), &lf); - QFont systemFont = LOGFONT_to_QFont(lf); - // "MS Shell Dlg 2" is the correct system font >= Win2k - if (systemFont.family() == QLatin1String("MS Shell Dlg")) - systemFont.setFamily(QStringLiteral("MS Shell Dlg 2")); - // Qt 5 by (Qt 4) legacy uses GetStockObject(DEFAULT_GUI_FONT) to - // obtain the default GUI font (typically "MS Shell Dlg 2, 8pt"). This has been - // long deprecated; the message font of the NONCLIENTMETRICS structure obtained by - // SystemParametersInfo(SPI_GETNONCLIENTMETRICS) should be used instead (see - // QWindowsTheme::refreshFonts(), typically "Segoe UI, 9pt"), which is larger. -#endif // Qt 5 qCDebug(lcQpaFonts) << __FUNCTION__ << systemFont; return systemFont; } -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) IDWriteFontFace *QWindowsFontDatabaseBase::createDirectWriteFace(const QByteArray &fontData) const { QSharedPointer fontEngineData = data(); @@ -831,13 +817,13 @@ IDWriteFontFace *QWindowsFontDatabaseBase::createDirectWriteFace(const QByteArra fontFile->Release(); return directWriteFontFace; } -#endif // !defined(QT_NO_DIRECTWRITE) +#endif // directwrite && direct2d QFontEngine *QWindowsFontDatabaseBase::fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) { QFontEngine *fontEngine = nullptr; -#if !defined(QT_NO_DIRECTWRITE) +#if QT_CONFIG(directwrite) && QT_CONFIG(direct2d) QSharedPointer fontEngineData = data(); if (fontEngineData->directWriteFactory == nullptr) return nullptr; @@ -854,7 +840,7 @@ QFontEngine *QWindowsFontDatabaseBase::fontEngine(const QByteArray &fontData, qr fontEngine->fontDef.hintingPreference = hintingPreference; directWriteFontFace->Release(); -#else // !defined(QT_NO_DIRECTWRITE) +#else // directwrite && direct2d Q_UNUSED(fontData); Q_UNUSED(pixelSize); Q_UNUSED(hintingPreference); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabasebase_p.h b/src/gui/text/windows/qwindowsfontdatabasebase_p.h similarity index 98% rename from src/platformsupport/fontdatabases/windows/qwindowsfontdatabasebase_p.h rename to src/gui/text/windows/qwindowsfontdatabasebase_p.h index 55763f7c76..7f712a2323 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabasebase_p.h +++ b/src/gui/text/windows/qwindowsfontdatabasebase_p.h @@ -84,7 +84,7 @@ public: #endif }; -class QWindowsFontDatabaseBase : public QPlatformFontDatabase +class Q_GUI_EXPORT QWindowsFontDatabaseBase : public QPlatformFontDatabase { public: QWindowsFontDatabaseBase(); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/gui/text/windows/qwindowsfontengine.cpp similarity index 100% rename from src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp rename to src/gui/text/windows/qwindowsfontengine.cpp diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h b/src/gui/text/windows/qwindowsfontengine_p.h similarity index 100% rename from src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h rename to src/gui/text/windows/qwindowsfontengine_p.h diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/gui/text/windows/qwindowsfontenginedirectwrite.cpp similarity index 100% rename from src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp rename to src/gui/text/windows/qwindowsfontenginedirectwrite.cpp diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h b/src/gui/text/windows/qwindowsfontenginedirectwrite_p.h similarity index 100% rename from src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h rename to src/gui/text/windows/qwindowsfontenginedirectwrite_p.h diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp b/src/gui/text/windows/qwindowsnativeimage.cpp similarity index 100% rename from src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp rename to src/gui/text/windows/qwindowsnativeimage.cpp diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage_p.h b/src/gui/text/windows/qwindowsnativeimage_p.h similarity index 98% rename from src/platformsupport/fontdatabases/windows/qwindowsnativeimage_p.h rename to src/gui/text/windows/qwindowsnativeimage_p.h index ed68ac2644..050ecbf03c 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage_p.h +++ b/src/gui/text/windows/qwindowsnativeimage_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -class QWindowsNativeImage +class Q_GUI_EXPORT QWindowsNativeImage { Q_DISABLE_COPY_MOVE(QWindowsNativeImage) public: diff --git a/src/gui/text/windows/windows.pri b/src/gui/text/windows/windows.pri new file mode 100644 index 0000000000..477437833a --- /dev/null +++ b/src/gui/text/windows/windows.pri @@ -0,0 +1,41 @@ +SOURCES += \ + text/windows/qwindowsfontdatabase.cpp \ + text/windows/qwindowsfontdatabasebase.cpp \ + text/windows/qwindowsfontengine.cpp \ + text/windows/qwindowsnativeimage.cpp + +HEADERS += \ + text/windows/qwindowsfontdatabase_p.h \ + text/windows/qwindowsfontdatabasebase_p.h \ + text/windows/qwindowsfontengine_p.h \ + text/windows/qwindowsnativeimage_p.h + +qtConfig(freetype) { + SOURCES += text/windows/qwindowsfontdatabase_ft.cpp + HEADERS += text/windows/qwindowsfontdatabase_ft_p.h + QMAKE_USE_PRIVATE += freetype +} + +qtConfig(directwrite):qtConfig(direct2d) { + qtConfig(directwrite3) { + QMAKE_USE_PRIVATE += dwrite_3 + DEFINES *= QT_USE_DIRECTWRITE3 QT_USE_DIRECTWRITE2 + + SOURCES += text/windows/qwindowsdirectwritefontdatabase.cpp + HEADERS += text/windows/qwindowsdirectwritefontdatabase_p.h + } else: qtConfig(directwrite2) { + QMAKE_USE_PRIVATE += dwrite_2 + DEFINES *= QT_USE_DIRECTWRITE2 + } else { + QMAKE_USE_PRIVATE += dwrite + } + QMAKE_USE_PRIVATE += d2d1 + + SOURCES += text/windows/qwindowsfontenginedirectwrite.cpp + HEADERS += text/windows/qwindowsfontenginedirectwrite_p.h +} else { + DEFINES *= QT_NO_DIRECTWRITE +} + +QMAKE_USE_PRIVATE += advapi32 ole32 user32 gdi32 +mingw: QMAKE_USE_PRIVATE += uuid diff --git a/src/platformsupport/fontdatabases/.prev_CMakeLists.txt b/src/platformsupport/fontdatabases/.prev_CMakeLists.txt index be84811a9e..a19195bc02 100644 --- a/src/platformsupport/fontdatabases/.prev_CMakeLists.txt +++ b/src/platformsupport/fontdatabases/.prev_CMakeLists.txt @@ -34,64 +34,3 @@ qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_fontconfig LIBRARIES Fontconfig::Fontconfig ) - -qt_extend_target(FontDatabaseSupport CONDITION WIN32 - SOURCES - windows/qwindowsfontdatabase.cpp windows/qwindowsfontdatabase_p.h - windows/qwindowsfontdatabasebase.cpp windows/qwindowsfontdatabasebase_p.h - windows/qwindowsfontengine.cpp windows/qwindowsfontengine_p.h - windows/qwindowsnativeimage.cpp windows/qwindowsnativeimage_p.h - LIBRARIES - advapi32 - gdi32 - ole32 - user32 - PUBLIC_LIBRARIES - Qt::GuiPrivate -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32 - SOURCES - windows/qwindowsfontdatabase_ft.cpp windows/qwindowsfontdatabase_ft_p.h - LIBRARIES - WrapFreetype::WrapFreetype -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 - SOURCES - windows/qwindowsfontenginedirectwrite.cpp windows/qwindowsfontenginedirectwrite_p.h - LIBRARIES - d2d1 -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite3 AND WIN32 - SOURCES - windows/qwindowsdirectwritefontdatabase.cpp windows/qwindowsdirectwritefontdatabase_p.h - DEFINES - QT_USE_DIRECTWRITE2 - QT_USE_DIRECTWRITE3 - LIBRARIES - dwrite_3 -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT QT_FEATURE_directwrite3 - DEFINES - QT_USE_DIRECTWRITE2 - LIBRARIES - dwrite_2 -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT QT_FEATURE_directwrite2 AND NOT QT_FEATURE_directwrite3 - LIBRARIES - dwrite -) - -qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND (NOT QT_FEATURE_direct2d OR NOT QT_FEATURE_directwrite) - DEFINES - QT_NO_DIRECTWRITE -) - -qt_extend_target(FontDatabaseSupport CONDITION MINGW AND WIN32 - LIBRARIES - uuid -) diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index 8b37257ded..2f4519ec30 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -46,64 +46,3 @@ if(TARGET WrapFreetype::WrapFreetype) ) endif() # special case end - -qt_extend_target(FontDatabaseSupport CONDITION WIN32 - SOURCES - windows/qwindowsfontdatabase.cpp windows/qwindowsfontdatabase_p.h - windows/qwindowsfontdatabasebase.cpp windows/qwindowsfontdatabasebase_p.h - windows/qwindowsfontengine.cpp windows/qwindowsfontengine_p.h - windows/qwindowsnativeimage.cpp windows/qwindowsnativeimage_p.h - LIBRARIES - advapi32 - gdi32 - ole32 - user32 - PUBLIC_LIBRARIES - Qt::GuiPrivate -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32 - SOURCES - windows/qwindowsfontdatabase_ft.cpp windows/qwindowsfontdatabase_ft_p.h - LIBRARIES - WrapFreetype::WrapFreetype -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 - SOURCES - windows/qwindowsfontenginedirectwrite.cpp windows/qwindowsfontenginedirectwrite_p.h - LIBRARIES - d2d1 -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite3 AND WIN32 - SOURCES - windows/qwindowsdirectwritefontdatabase.cpp windows/qwindowsdirectwritefontdatabase_p.h - DEFINES - QT_USE_DIRECTWRITE2 - QT_USE_DIRECTWRITE3 - LIBRARIES - dwrite_3 -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT QT_FEATURE_directwrite3 - DEFINES - QT_USE_DIRECTWRITE2 - LIBRARIES - dwrite_2 -) - -qt_extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT QT_FEATURE_directwrite2 AND NOT QT_FEATURE_directwrite3 - LIBRARIES - dwrite -) - -qt_extend_target(FontDatabaseSupport CONDITION WIN32 AND (NOT QT_FEATURE_direct2d OR NOT QT_FEATURE_directwrite) - DEFINES - QT_NO_DIRECTWRITE -) - -qt_extend_target(FontDatabaseSupport CONDITION MINGW AND WIN32 - LIBRARIES - uuid -) diff --git a/src/platformsupport/fontdatabases/fontdatabases.pro b/src/platformsupport/fontdatabases/fontdatabases.pro index d597a0d6c2..5406291cea 100644 --- a/src/platformsupport/fontdatabases/fontdatabases.pro +++ b/src/platformsupport/fontdatabases/fontdatabases.pro @@ -15,8 +15,4 @@ qtConfig(fontconfig) { include($$PWD/fontconfig/fontconfig.pri) } -win32 { - include($$PWD/windows/windows.pri) -} - load(qt_module) diff --git a/src/platformsupport/fontdatabases/windows/windows.pri b/src/platformsupport/fontdatabases/windows/windows.pri deleted file mode 100644 index c8466a1d2b..0000000000 --- a/src/platformsupport/fontdatabases/windows/windows.pri +++ /dev/null @@ -1,43 +0,0 @@ -QT *= gui-private - -SOURCES += \ - $$PWD/qwindowsfontdatabase.cpp \ - $$PWD/qwindowsfontdatabasebase.cpp \ - $$PWD/qwindowsfontengine.cpp \ - $$PWD/qwindowsnativeimage.cpp - -HEADERS += \ - $$PWD/qwindowsfontdatabase_p.h \ - $$PWD/qwindowsfontdatabasebase_p.h \ - $$PWD/qwindowsfontengine_p.h \ - $$PWD/qwindowsnativeimage_p.h - -qtConfig(freetype) { - SOURCES += $$PWD/qwindowsfontdatabase_ft.cpp - HEADERS += $$PWD/qwindowsfontdatabase_ft_p.h - QMAKE_USE_PRIVATE += freetype -} - -qtConfig(directwrite):qtConfig(direct2d) { - qtConfig(directwrite3) { - QMAKE_USE_PRIVATE += dwrite_3 - DEFINES *= QT_USE_DIRECTWRITE3 QT_USE_DIRECTWRITE2 - - SOURCES += $$PWD/qwindowsdirectwritefontdatabase.cpp - HEADERS += $$PWD/qwindowsdirectwritefontdatabase_p.h - } else: qtConfig(directwrite2) { - QMAKE_USE_PRIVATE += dwrite_2 - DEFINES *= QT_USE_DIRECTWRITE2 - } else { - QMAKE_USE_PRIVATE += dwrite - } - QMAKE_USE_PRIVATE += d2d1 - - SOURCES += $$PWD/qwindowsfontenginedirectwrite.cpp - HEADERS += $$PWD/qwindowsfontenginedirectwrite_p.h -} else { - DEFINES *= QT_NO_DIRECTWRITE -} - -QMAKE_USE_PRIVATE += advapi32 ole32 user32 gdi32 -mingw: QMAKE_USE_PRIVATE += uuid diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro index cf41ffa116..1f8b41e7ec 100644 --- a/src/plugins/platforms/direct2d/direct2d.pro +++ b/src/plugins/platforms/direct2d/direct2d.pro @@ -1,8 +1,7 @@ TARGET = qdirect2d QT += \ - core-private gui-private \ - fontdatabase_support-private + core-private gui-private LIBS += -ldwmapi -lversion -ld3d11 -ldxgi -ldxguid QMAKE_USE_PRIVATE += gdi32 dwrite_1 d2d1_1 diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp index 0172004de6..4ce5825f95 100644 --- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp +++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp @@ -45,8 +45,7 @@ #include "qwindowsdirect2dbitmap.h" #include "qwindowsdirect2ddevicecontext.h" -#include -#include +#include #include "qwindowsintegration.h" #include diff --git a/src/plugins/platforms/minimal/.prev_CMakeLists.txt b/src/plugins/platforms/minimal/.prev_CMakeLists.txt index cdcdffa8e1..b5e165e2f1 100644 --- a/src/plugins/platforms/minimal/.prev_CMakeLists.txt +++ b/src/plugins/platforms/minimal/.prev_CMakeLists.txt @@ -26,7 +26,7 @@ qt_internal_add_plugin(QMinimalIntegrationPlugin ## Scopes: ##################################################################### -qt_extend_target(QMinimalIntegrationPlugin CONDITION NOT APPLE +qt_extend_target(QMinimalIntegrationPlugin CONDITION UNIX AND NOT APPLE PUBLIC_LIBRARIES Qt::FontDatabaseSupportPrivate ) diff --git a/src/plugins/platforms/minimal/CMakeLists.txt b/src/plugins/platforms/minimal/CMakeLists.txt index 72c1090771..958204bcd8 100644 --- a/src/plugins/platforms/minimal/CMakeLists.txt +++ b/src/plugins/platforms/minimal/CMakeLists.txt @@ -29,7 +29,7 @@ qt_internal_add_plugin(QMinimalIntegrationPlugin ## Scopes: ##################################################################### -qt_extend_target(QMinimalIntegrationPlugin CONDITION NOT APPLE +qt_extend_target(QMinimalIntegrationPlugin CONDITION UNIX AND NOT APPLE PUBLIC_LIBRARIES Qt::FontDatabaseSupportPrivate ) diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro index a644e65026..4eebd0f6ad 100644 --- a/src/plugins/platforms/minimal/minimal.pro +++ b/src/plugins/platforms/minimal/minimal.pro @@ -3,7 +3,7 @@ TARGET = qminimal QT += \ core-private gui-private -!darwin: QT += fontdatabase_support-private +!darwin:!win32: QT += fontdatabase_support-private DEFINES += QT_NO_FOREACH diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp index 16045d5e59..4a3b052200 100644 --- a/src/plugins/platforms/minimal/qminimalintegration.cpp +++ b/src/plugins/platforms/minimal/qminimalintegration.cpp @@ -47,9 +47,9 @@ #include #if defined(Q_OS_WIN) -# include +# include # if QT_CONFIG(freetype) -# include +# include # endif #elif defined(Q_OS_DARWIN) # include diff --git a/src/plugins/platforms/offscreen/.prev_CMakeLists.txt b/src/plugins/platforms/offscreen/.prev_CMakeLists.txt index a8643961d3..6ca250161f 100644 --- a/src/plugins/platforms/offscreen/.prev_CMakeLists.txt +++ b/src/plugins/platforms/offscreen/.prev_CMakeLists.txt @@ -27,7 +27,7 @@ qt_internal_add_plugin(QOffscreenIntegrationPlugin ## Scopes: ##################################################################### -qt_extend_target(QOffscreenIntegrationPlugin CONDITION NOT APPLE +qt_extend_target(QOffscreenIntegrationPlugin CONDITION UNIX AND NOT APPLE PUBLIC_LIBRARIES Qt::FontDatabaseSupportPrivate ) diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt index 59bfb19fc9..a798344238 100644 --- a/src/plugins/platforms/offscreen/CMakeLists.txt +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -28,7 +28,7 @@ qt_internal_add_plugin(QOffscreenIntegrationPlugin ## Scopes: ##################################################################### -qt_extend_target(QOffscreenIntegrationPlugin CONDITION NOT APPLE +qt_extend_target(QOffscreenIntegrationPlugin CONDITION UNIX AND NOT APPLE PUBLIC_LIBRARIES Qt::FontDatabaseSupportPrivate ) diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro index 0d6faf08a4..4bdbf7224a 100644 --- a/src/plugins/platforms/offscreen/offscreen.pro +++ b/src/plugins/platforms/offscreen/offscreen.pro @@ -3,7 +3,7 @@ TARGET = qoffscreen QT += \ core-private gui-private -!darwin: QT += fontdatabase_support-private +!darwin:!win32: QT += fontdatabase_support-private DEFINES += QT_NO_FOREACH diff --git a/src/plugins/platforms/windows/.prev_CMakeLists.txt b/src/plugins/platforms/windows/.prev_CMakeLists.txt index 3c1568ad53..84219ddcd8 100644 --- a/src/plugins/platforms/windows/.prev_CMakeLists.txt +++ b/src/plugins/platforms/windows/.prev_CMakeLists.txt @@ -50,7 +50,6 @@ qt_internal_add_plugin(QWindowsIntegrationPlugin PUBLIC_LIBRARIES Qt::Core Qt::CorePrivate - Qt::FontDatabaseSupportPrivate Qt::Gui Qt::GuiPrivate dwmapi diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt index 823ba613a3..9674710d54 100644 --- a/src/plugins/platforms/windows/CMakeLists.txt +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -51,7 +51,6 @@ qt_internal_add_plugin(QWindowsIntegrationPlugin PUBLIC_LIBRARIES Qt::Core Qt::CorePrivate - Qt::FontDatabaseSupportPrivate Qt::Gui Qt::GuiPrivate dwmapi diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp index e3939ca2d7..e9d1915201 100644 --- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp +++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 2d014a7c07..9503d48bdb 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -49,11 +49,12 @@ #include "qwindowstheme.h" #include "qwindowsservices.h" #ifdef QT_USE_DIRECTWRITE3 -#include +#include #endif #ifndef QT_NO_FREETYPE -# include +# include #endif +#include #if QT_CONFIG(clipboard) # include "qwindowsclipboard.h" # if QT_CONFIG(draganddrop) diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h index 64cbda7c58..3c3763745c 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.h +++ b/src/plugins/platforms/windows/qwindowsintegration.h @@ -43,7 +43,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp index 0cd361516e..efd7d04b3e 100644 --- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp +++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp @@ -54,7 +54,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 36831bdd81..1f4c851742 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -77,7 +77,7 @@ #include #include #include -#include +#include #include #include #include @@ -566,18 +566,23 @@ void QWindowsTheme::refresh() } #ifndef QT_NO_DEBUG_STREAM -QDebug operator<<(QDebug d, const LOGFONT &lf); // in platformsupport - QDebug operator<<(QDebug d, const NONCLIENTMETRICS &m) { QDebugStateSaver saver(d); d.nospace(); d.noquote(); d << "NONCLIENTMETRICS(iMenu=" << m.iMenuWidth << 'x' << m.iMenuHeight - << ", lfCaptionFont=" << m.lfCaptionFont << ", lfSmCaptionFont=" - << m.lfSmCaptionFont << ", lfMenuFont=" << m.lfMenuFont - << ", lfMessageFont=" << m.lfMessageFont << ", lfStatusFont=" - << m.lfStatusFont << ')'; + << ", lfCaptionFont="; + QWindowsFontDatabase::debugFormat(d, m.lfCaptionFont); + d << ", lfSmCaptionFont="; + QWindowsFontDatabase::debugFormat(d, m.lfSmCaptionFont); + d << ", lfMenuFont="; + QWindowsFontDatabase::debugFormat(d, m.lfMenuFont); + d << ", lfMessageFont="; + QWindowsFontDatabase::debugFormat(d, m.lfMessageFont); + d <<", lfStatusFont="; + QWindowsFontDatabase::debugFormat(d, m.lfStatusFont); + d << ')'; return d; } #endif // QT_NO_DEBUG_STREAM diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro index 258ffb0c0d..39a07e6361 100644 --- a/src/plugins/platforms/windows/windows.pro +++ b/src/plugins/platforms/windows/windows.pro @@ -1,8 +1,7 @@ TARGET = qwindows QT += \ - core-private gui-private \ - fontdatabase_support-private + core-private gui-private qtConfig(opengl): QT += opengl-private