diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 87cd46ef36..a3809a6259 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -193,6 +193,33 @@ function(wx_set_target_properties target_name is_base) target_include_directories(${target_name} PUBLIC ${wxTOOLKIT_INCLUDE_DIRS}) endif() + + if (WXMSW) + set(WXMSW_LIBRARIES + kernel32 + user32 + gdi32 + comdlg32 + winspool + winmm + shell32 + shlwapi + comctl32 + ole32 + oleaut32 + uuid + rpcrt4 + advapi32 + version + wsock32 + wininet + oleacc + uxtheme + ) + target_link_libraries(${target_name} + PUBLIC ${WXMSW_LIBRARIES}) + endif() + if(wxTOOLKIT_LIBRARIES) target_link_libraries(${target_name} PUBLIC ${wxTOOLKIT_LIBRARIES}) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 689cc2c291..bb17e3fd85 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -119,18 +119,24 @@ set(wxUSE_STD_DEFAULT ON) if(wxUSE_UNICODE) set(wxUSE_WCHAR_T ON) endif() -if(wxUSE_EXPAT) - set(wxUSE_XML ON) -else() - set(wxUSE_XML OFF) +if(NOT wxUSE_EXPAT) + set(wxUSE_XRC OFF) endif() +set(wxUSE_XML ${wxUSE_XRC}) if(wxUSE_CONFIG) set(wxUSE_CONFIG_NATIVE ON) endif() if(DEFINED wxUSE_OLE AND wxUSE_OLE) set(wxUSE_OLE_AUTOMATION ON) - set(wxUSE_ACTIVEX ON) +endif() + +if(DEFINED wxUSE_GRAPHICS_DIRECT2D AND NOT wxUSE_GRAPHICS_CONTEXT) + set(wxUSE_GRAPHICS_DIRECT2D OFF) +endif() + +if(wxUSE_OPENGL) + set(wxUSE_GLCANVAS ON) endif() if(wxUSE_THREADS) @@ -138,22 +144,11 @@ if(wxUSE_THREADS) endif() if(wxUSE_GUI) - # Constants for GUI - set(wxUSE_COMMON_DIALOGS ON) - - if(wxUSE_TASKBARICON) - set(wxUSE_TASKBARICON_BALLOONS ON) - endif() - if(WIN32 AND wxUSE_METAFILE) # this one should probably be made separately configurable set(wxUSE_ENH_METAFILE ON) endif() - if(wxUSE_IMAGE) - set(wxUSE_WXDIB ON) - endif() - if(wxUSE_OPENGL) find_package(OpenGL) if(NOT OPENGL_FOUND) diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index a676510ad7..45a7696d01 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -20,7 +20,7 @@ if(wxBUILD_MONOLITHIC) endif() # Define third party libraries -set(LIBS_THIRDPARTY regex zlib) +set(LIBS_THIRDPARTY regex zlib expat) if(wxUSE_GUI) list(APPEND LIBS_THIRDPARTY jpeg png tiff) endif() diff --git a/build/cmake/lib/expat.cmake b/build/cmake/lib/expat.cmake new file mode 100644 index 0000000000..1d2b79b1fa --- /dev/null +++ b/build/cmake/lib/expat.cmake @@ -0,0 +1,20 @@ +############################################################################# +# Name: build/cmake/lib/expat.cmake +# Purpose: Use external or internal expat lib +# Author: Tobias Taschner +# Created: 2016-09-21 +# Copyright: (c) 2016 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +if(wxUSE_EXPAT STREQUAL "builtin") + wx_add_builtin_library(wxexpat + src/expat/expat/lib/xmlparse.c + src/expat/expat/lib/xmlrole.c + src/expat/expat/lib/xmltok.c + ) + set(EXPAT_LIBRARIES wxexpat) + set(EXPAT_INCLUDE_DIRS ${wxSOURCE_DIR}/src/expat/expat/lib) +elseif(wxUSE_EXPAT) + find_package(EXPAT REQUIRED) +endif() diff --git a/build/cmake/lib/jpeg.cmake b/build/cmake/lib/jpeg.cmake index d46c7fb6e9..77014944a7 100644 --- a/build/cmake/lib/jpeg.cmake +++ b/build/cmake/lib/jpeg.cmake @@ -7,8 +7,6 @@ # Licence: wxWindows licence ############################################################################# -wx_add_thirdparty_library(wxUSE_LIBJPEG JPEG "use libjpeg (JPEG file format)") - if(wxUSE_LIBJPEG STREQUAL "builtin") wx_add_builtin_library(wxjpeg src/jpeg/jaricom.c diff --git a/build/cmake/lib/png.cmake b/build/cmake/lib/png.cmake index d0fe5b854a..9dd9fdcf3b 100644 --- a/build/cmake/lib/png.cmake +++ b/build/cmake/lib/png.cmake @@ -7,8 +7,6 @@ # Licence: wxWindows licence ############################################################################# -wx_add_thirdparty_library(wxUSE_LIBPNG PNG "use libpng (PNG image format)") - if(wxUSE_LIBPNG STREQUAL "builtin") wx_add_builtin_library(wxpng src/png/png.c diff --git a/build/cmake/lib/regex.cmake b/build/cmake/lib/regex.cmake index e2bc97c546..0478f5d42e 100644 --- a/build/cmake/lib/regex.cmake +++ b/build/cmake/lib/regex.cmake @@ -7,8 +7,6 @@ # Licence: wxWindows licence ############################################################################# -wx_add_thirdparty_library(wxUSE_REGEX REGEX "enable support for wxRegEx class" DEFAULT builtin) - if(wxUSE_REGEX) # TODO: Forcing builtin until sys is implemented set(wxUSE_REGEX builtin) diff --git a/build/cmake/lib/tiff.cmake b/build/cmake/lib/tiff.cmake index 3cd5a664ac..d1ef8d51f6 100644 --- a/build/cmake/lib/tiff.cmake +++ b/build/cmake/lib/tiff.cmake @@ -7,8 +7,6 @@ # Licence: wxWindows licence ############################################################################# -wx_add_thirdparty_library(wxUSE_LIBTIFF TIFF "use libtiff (TIFF file format)") - if(wxUSE_LIBTIFF STREQUAL "builtin") # TODO: implement building libtiff via ExternalProject_Add() if(UNIX AND NOT APPLE) diff --git a/build/cmake/lib/xml/CMakeLists.txt b/build/cmake/lib/xml/CMakeLists.txt index 4dfc9e4cc2..21173c5ad1 100644 --- a/build/cmake/lib/xml/CMakeLists.txt +++ b/build/cmake/lib/xml/CMakeLists.txt @@ -9,18 +9,6 @@ include(../../source_groups.cmake) -if(wxUSE_EXPAT STREQUAL "builtin") - wx_add_builtin_library(wxexpat - src/expat/expat/lib/xmlparse.c - src/expat/expat/lib/xmlrole.c - src/expat/expat/lib/xmltok.c - ) - set(EXPAT_LIBRARIES wxexpat) - set(EXPAT_INCLUDE_DIRS ${wxSOURCE_DIR}/src/expat/expat/lib) -elseif(wxUSE_EXPAT) - find_package(EXPAT) -endif() - wx_append_sources(XML_FILES XML) wx_add_library(xml IS_BASE ${XML_FILES}) wx_lib_link_libraries(xml diff --git a/build/cmake/lib/zlib.cmake b/build/cmake/lib/zlib.cmake index c5687f2deb..0666e010ec 100644 --- a/build/cmake/lib/zlib.cmake +++ b/build/cmake/lib/zlib.cmake @@ -7,9 +7,6 @@ # Licence: wxWindows licence ############################################################################# -wx_add_thirdparty_library(wxUSE_ZLIB ZLIB "use zlib for LZW compression" - DEFAULT_APPLE sys) - if(wxUSE_ZLIB STREQUAL "builtin") wx_add_builtin_library(wxzlib src/zlib/adler32.c diff --git a/build/cmake/main.cmake b/build/cmake/main.cmake index c9620bb051..79b633185f 100644 --- a/build/cmake/main.cmake +++ b/build/cmake/main.cmake @@ -67,9 +67,9 @@ wx_print_thirdparty_library_summary() message(STATUS "Configured wxWidgets ${wxVERSION} for ${CMAKE_SYSTEM} Min OS Version required at runtime: ${wxREQUIRED_OS_DESC} - Which GUI toolkit should wxWidgets use?: ${wxBUILD_TOOLKIT} ${wxTOOLKIT_VERSION} + Which GUI toolkit should wxWidgets use? ${wxBUILD_TOOLKIT} ${wxTOOLKIT_VERSION} Should wxWidgets be compiled into single library? ${wxBUILD_MONOLITHIC} Should wxWidgets be linked as a shared library? ${wxBUILD_SHARED} Should wxWidgets support Unicode? ${wxUSE_UNICODE} - What level of wxWidgets compatibility should be enabled? ${wxBUILD_COMPATIBILITY}" + What wxWidgets compatibility level should be used? ${wxBUILD_COMPATIBILITY}" ) diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index fd0dab3cbe..5d1d9a606e 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -47,17 +47,24 @@ wx_dependent_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" OF wx_option(wxUSE_UNICODE "compile with Unicode support (NOT RECOMMENDED to be turned off)") if(NOT WIN32) wx_option(wxUSE_UNICODE_UTF8 "use UTF-8 representation for strings (Unix only)" OFF) - wx_dependent_option(wxUSE_UNICODE_UTF8_LOCALE "only support UTF-8 locales in UTF-8 build (Unix only)" ON "wxUSE_UNICODE_UTF8" OFF) + wx_dependent_option(wxUSE_UTF8_LOCALE_ONLY "only support UTF-8 locales in UTF-8 build (Unix only)" ON "wxUSE_UNICODE_UTF8" OFF) endif() wx_option(wxUSE_COMPILER_TLS "enable use of compiler TLS support") wx_option(wxUSE_VISIBILITY "use of ELF symbols visibility") +wx_option(wxUSE_UNSAFE_WXSTRING_CONV "provide unsafe implicit conversions in wxString to const char* or std::string") +wx_option(wxUSE_REPRODUCIBLE_BUILD "enable reproducable build" OFF) # --------------------------------------------------------------------------- # external libraries # --------------------------------------------------------------------------- -wx_add_thirdparty_library(wxUSE_EXPAT EXPAT "use expat for XML parsing" - DEFAULT_APPLE sys) + +wx_add_thirdparty_library(wxUSE_REGEX REGEX "enable support for wxRegEx class" DEFAULT builtin) +wx_add_thirdparty_library(wxUSE_ZLIB ZLIB "use zlib for LZW compression" DEFAULT_APPLE sys) +wx_add_thirdparty_library(wxUSE_EXPAT EXPAT "use expat for XML parsing" DEFAULT_APPLE sys) +wx_add_thirdparty_library(wxUSE_LIBJPEG JPEG "use libjpeg (JPEG file format)") +wx_add_thirdparty_library(wxUSE_LIBPNG PNG "use libpng (PNG image format)") +wx_add_thirdparty_library(wxUSE_LIBTIFF TIFF "use libtiff (TIFF file format)") wx_option(wxUSE_OPENGL "use OpenGL (or Mesa)") @@ -72,10 +79,6 @@ wx_option(wxUSE_INTL "use internationalization system") wx_option(wxUSE_XLOCALE "use x-locale support (requires wxLocale)") wx_option(wxUSE_CONFIG "use wxConfig (and derived) classes") -wx_option(wxUSE_PROTOCOL "use wxProtocol and derived classes") -wx_option(wxUSE_PROTOCOL_FTP "use wxFTP (requires wxProtocol") -wx_option(wxUSE_PROTOCOL_HTTP "use wxHTTP (requires wxProtocol") -wx_option(wxUSE_PROTOCOL_FILE "use wxFileProto class (requires wxProtocol") wx_option(wxUSE_SOCKETS "use socket/network classes") wx_option(wxUSE_IPV6 "enable IPv6 support in wxSocket") if(WIN32) @@ -165,6 +168,7 @@ wx_option(wxUSE_MS_HTML_HELP "use MS HTML Help (win32)") wx_option(wxUSE_HTML "use wxHTML sub-library") wx_option(wxUSE_WXHTML_HELP "use wxHTML-based help") wx_option(wxUSE_XRC "use XRC resources sub-library") +wx_option(wxUSE_XML "use the xml library (overruled by wxUSE_XRC)") wx_option(wxUSE_AUI "use AUI docking library") wx_option(wxUSE_PROPGRID "use wxPropertyGrid library") wx_option(wxUSE_RIBBON "use wxRibbon library") @@ -172,16 +176,19 @@ wx_option(wxUSE_STC "use wxStyledTextCtrl library") wx_option(wxUSE_CONSTRAINTS "use layout-constraints system") wx_option(wxUSE_LOGGUI "use standard GUI logger") wx_option(wxUSE_LOGWINDOW "use wxLogWindow") -wx_option(wxUSE_LOGDIALOG "use wxLogDialog") +wx_option(wxUSE_LOG_DIALOG "use wxLogDialog") wx_option(wxUSE_MDI "use multiple document interface architecture") wx_option(wxUSE_MDI_ARCHITECTURE "use docview architecture with MDI") wx_option(wxUSE_MEDIACTRL "use wxMediaCtrl class") wx_option(wxUSE_RICHTEXT "use wxRichTextCtrl") wx_option(wxUSE_POSTSCRIPT "use wxPostscriptDC device context (default for gtk+)") +wx_option(wxUSE_AFM_FOR_POSTSCRIPT "in wxPostScriptDC class use AFM (adobe font metrics) file for character widths") wx_option(wxUSE_PRINTING_ARCHITECTURE "use printing architecture") wx_option(wxUSE_SVG "use wxSVGFileDC device context") -wx_option(wxUSE_WEBKIT "use wxWebKitCtrl (Mac-only, use wxWebView instead)") wx_option(wxUSE_WEBVIEW "use wxWebView library") +if(APPLE) + wx_option(wxUSE_WEBKIT "use wxWebKitCtrl (Mac-only, use wxWebView instead)") +endif() # wxDC is implemented in terms of wxGraphicsContext in wxOSX so the latter # can't be disabled, don't even provide an option to do it @@ -189,8 +196,18 @@ if(APPLE) set(wxUSE_GRAPHICS_CONTEXT ON) else() wx_option(wxUSE_GRAPHICS_CONTEXT "use graphics context 2D drawing API") + if (WIN32 AND (NOT MSVC OR MSVC_VERSION LESS 1600)) + wx_option(wxUSE_GRAPHICS_DIRECT2D "enable Direct2D graphics context" OFF) + endif() endif() +if(WXGTK) + set(wxUSE_CAIRO_DEFAULT ON) +else() + set(wxUSE_CAIRO_DEFAULT OFF) +endif() +wx_option(wxUSE_CAIRO "enable Cairo graphics context" ${wxUSE_CAIRO_DEFAULT}) + # --------------------------------------------------------------------------- # IPC &c # --------------------------------------------------------------------------- @@ -293,7 +310,7 @@ wx_option(wxUSE_TREELISTCTRL "use wxTreeListCtrl class") # common dialogs # --------------------------------------------------------------------------- -wx_option(wxUSE_COMMONDLGS "use all common dialogs") +wx_option(wxUSE_COMMON_DIALOGS "use all common dialogs") wx_option(wxUSE_ABOUTDLG "use wxAboutBox") wx_option(wxUSE_CHOICEDLG "use wxChoiceDialog") wx_option(wxUSE_COLOURDLG "use wxColourDialog") @@ -325,11 +342,18 @@ wx_option(wxUSE_JOYSTICK "use wxJoystick") wx_option(wxUSE_METAFILE "use wxMetaFile") wx_option(wxUSE_DRAGIMAGE "use wxDragImage") if(WIN32) - wx_option(wxUSE_ACCESSIBILITY "enable accessibility support" ON) + wx_option(wxUSE_ACCESSIBILITY "enable accessibility support") endif() wx_option(wxUSE_UIACTIONSIMULATOR "use wxUIActionSimulator (experimental)") wx_option(wxUSE_DC_TRANSFORM_MATRIX "use wxDC::SetTransformMatrix and related") wx_option(wxUSE_WEBVIEW_WEBKIT "use wxWebView WebKit backend") +# TODO: wxUSE_WEBVIEW_WEBKIT2 +if(WIN32 OR APPLE) + set(wxUSE_PRIVATE_FONTS_DEFAULT ON) +else() + set(wxUSE_PRIVATE_FONTS_DEFAULT OFF) +endif() +wx_option(wxUSE_PRIVATE_FONTS "use fonts not installed on the system" ${wxUSE_PRIVATE_FONTS_DEFAULT}) # --------------------------------------------------------------------------- # support for image formats that do not rely on external library @@ -343,19 +367,31 @@ wx_option(wxUSE_TGA "use tga images (TGA file format)") wx_option(wxUSE_IFF "use iff images (IFF file format)") wx_option(wxUSE_PNM "use pnm images (PNM file format)") wx_option(wxUSE_XPM "use xpm images (XPM file format)") -wx_option(wxUSE_ICO_CUR "_cur use Windows ICO and CUR formats") +wx_option(wxUSE_ICO_CUR "use Windows ICO and CUR formats") # --------------------------------------------------------------------------- # wxMSW-only options # --------------------------------------------------------------------------- if(WIN32) + wx_option(wxUSE_ACTIVEX " enable wxActiveXContainer class (Win32 only)") + wx_option(wxUSE_CRASHREPORT "enable wxCrashReport::Generate() to create mini dumps (Win32 only)") wx_option(wxUSE_DC_CACHEING "cache temporary wxDC objects (Win32 only)") - wx_option(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW "use PS printing in wxMSW (Win32 only)") + wx_option(wxUSE_NATIVE_PROGRESSDLG "use native progress dialog implementation") + wx_option(wxUSE_NATIVE_STATUSBAR "use native statusbar implementation)") wx_option(wxUSE_OWNER_DRAWN "use owner drawn controls (Win32)") + wx_option(wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW "use PS printing in wxMSW (Win32 only)") + wx_option(wxUSE_TASKBARICON_BALLOONS "enable wxTaskBarIcon::ShowBalloon() method (Win32 only)") wx_option(wxUSE_UXTHEME "enable support for Windows XP themed look (Win32 only)") - wx_option(wxUSE_DIB "use wxDIB class (Win32 only)") wx_option(wxUSE_WEBVIEW_IE "use wxWebView IE backend (Win32 only)") + wx_option(wxUSE_WXDIB "use wxDIB class (Win32 only)") + if(MSVC_VERSION GREATER 1600 AND NOT CMAKE_VS_PLATFORM_TOOLSET MATCHES "_xp$") + set(wxUSE_WINRT_DEFAULT ON) + else() + set(wxUSE_WINRT_DEFAULT OFF) + endif() + wx_option(wxUSE_WINRT "enable WinRT support" ${wxUSE_WINRT_DEFAULT}) + endif() # this one is not really MSW-specific but it exists mainly to be turned off diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index a21a2449a8..2dd2de9262 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -471,24 +471,6 @@ endif() # CMAKE_USE_PTHREADS_INIT check_symbol_exists(localtime_r time.h HAVE_LOCALTIME_R) check_symbol_exists(gmtime_r time.h HAVE_GMTIME_R) -if(WXMSW) - set(wxUSE_WEBVIEW_IE ON) -elseif(WXGTK OR APPLE) - set(wxUSE_WEBVIEW_WEBKIT ON) -endif() - -if(MSVC) - set(wxUSE_GRAPHICS_CONTEXT ON) -endif() - -if(MSVC_VERSION GREATER 1600 AND NOT CMAKE_VS_PLATFORM_TOOLSET MATCHES "_xp$") - set(wxUSE_WINRT ON) -endif() - -if(wxUSE_OPENGL) - set(wxUSE_GLCANVAS ON) -endif() - # --------------------------------------------------------------------------- # Checks for typedefs # --------------------------------------------------------------------------- diff --git a/build/cmake/toolkit.cmake b/build/cmake/toolkit.cmake index 49b798451d..edcf0ebe69 100644 --- a/build/cmake/toolkit.cmake +++ b/build/cmake/toolkit.cmake @@ -39,10 +39,6 @@ wx_option(wxBUILD_TOOLKIT "Toolkit used by wxWidgets" ${wxDEFAULT_TOOLKIT} # TODO: set to univ for universal build set(wxBUILD_WIDGETSET "") -if(NOT wxUSE_GUI) - set(wxBUILD_TOOLKIT "base") -endif() - # Create shortcut variable for easy toolkit tests string(TOUPPER ${wxBUILD_TOOLKIT} toolkit_upper) set(WX${toolkit_upper} ON) @@ -54,6 +50,13 @@ endif() set(wxTOOLKIT_DEFINITIONS __WX${toolkit_upper}__) +if(NOT wxUSE_GUI) + set(wxBUILD_TOOLKIT "base") + string(TOUPPER ${wxBUILD_TOOLKIT} toolkit_upper) + set(WX${toolkit_upper} ON) + set(wxTOOLKIT_DEFINITIONS __WX${toolkit_upper}__) +endif() + # Initialize toolkit variables if(wxUSE_GUI) set(wxTOOLKIT_INCLUDE_DIRS) @@ -66,29 +69,7 @@ if(UNIX AND NOT APPLE AND NOT WIN32) list(APPEND wxTOOLKIT_LIBRARIES ${X11_LIBRARIES}) endif() -if(WXMSW) - set(wxTOOLKIT_LIBRARIES - kernel32 - user32 - gdi32 - comdlg32 - winspool - winmm - shell32 - shlwapi - comctl32 - ole32 - oleaut32 - uuid - rpcrt4 - advapi32 - version - wsock32 - wininet - oleacc - uxtheme - ) -elseif(WXGTK) +if(WXGTK) if(WXGTK3) set(gtk_lib GTK3) elseif(WXGTK2) diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 243a4ad6ba..69a20f5730 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -235,6 +235,17 @@ DEFINE_GUID(wxIID_IDWriteFactory, DEFINE_GUID(wxIID_IWICBitmapSource, 0x00000120, 0xa8f2, 0x4877, 0xba, 0x0a, 0xfd, 0x2b, 0x66, 0x45, 0xfb, 0x94); +DEFINE_GUID(GUID_WICPixelFormat32bppPBGRA, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x10); + +DEFINE_GUID(GUID_WICPixelFormat32bppBGR, + 0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0e); + +#ifndef CLSID_WICImagingFactory +DEFINE_GUID(CLSID_WICImagingFactory, + 0xcacaf262, 0x9370, 0x4615, 0xa1, 0x3b, 0x9f, 0x55, 0x39, 0xda, 0x4c, 0xa); +#endif + // Implementation of the Direct2D functions HRESULT WINAPI wxD2D1CreateFactory( D2D1_FACTORY_TYPE factoryType, @@ -3071,7 +3082,7 @@ public: wxCHECK_HRESULT_RET(hr); } - void DrawBitmap(ID2D1Image* image, D2D1_POINT_2F offset, + void DrawBitmap(ID2D1Bitmap* image, D2D1_POINT_2F offset, D2D1_RECT_F imageRectangle, wxInterpolationQuality interpolationQuality, wxCompositionMode compositionMode) wxOVERRIDE {