From 51fc85f16a2d11ccc5543b70253cb99de3f24766 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:21:48 +0100 Subject: [PATCH 01/18] CMake: disable options when ole or ActiveX is not available --- build/cmake/init.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index ab17223baf..8bf61a8b5e 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -203,6 +203,31 @@ if(DEFINED wxUSE_OLE AND wxUSE_OLE) set(wxUSE_OLE_AUTOMATION ON) endif() +if(wxUSE_ACTIVEX AND DEFINED wxUSE_OLE AND NOT wxUSE_OLE) + message(WARNING "wxActiveXContainer requires wxUSE_OLE... disabled") + wx_option_force_value(wxUSE_ACTIVEX OFF) +endif() + +if(wxUSE_DRAG_AND_DROP AND DEFINED wxUSE_OLE AND NOT wxUSE_OLE) + message(WARNING "wxUSE_DRAG_AND_DROP requires wxUSE_OLE... disabled") + wx_option_force_value(wxUSE_DRAG_AND_DROP OFF) +endif() + +if(wxUSE_ACCESSIBILITY AND DEFINED wxUSE_OLE AND NOT wxUSE_OLE) + message(WARNING "wxUSE_ACCESSIBILITY requires wxUSE_OLE... disabled") + wx_option_force_value(wxUSE_ACCESSIBILITY OFF) +endif() + +if(wxUSE_MEDIACTRL AND DEFINED wxUSE_ACTIVEX AND NOT wxUSE_ACTIVEX) + message(WARNING "wxMediaCtl requires wxActiveXContainer... disabled") + wx_option_force_value(wxUSE_MEDIACTRL OFF) +endif() + +if(wxUSE_WEBVIEW AND DEFINED wxUSE_ACTIVEX AND NOT wxUSE_ACTIVEX) + message(WARNING "wxWebView requires wxActiveXContainer... disabled") + wx_option_force_value(wxUSE_WEBVIEW OFF) +endif() + if(wxUSE_OPENGL) set(wxUSE_GLCANVAS ON) endif() From b42de093f6cb9d62640d2f99e4fa2934ce257cd1 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:30:19 +0100 Subject: [PATCH 02/18] CMake: disable wxUSE_MIMETYPE when wxUSE_TEXTFILE is disabled --- build/cmake/init.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 8bf61a8b5e..1361e1a85b 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -272,6 +272,11 @@ if(wxUSE_TEXTFILE AND (NOT wxUSE_FILE OR NOT wxUSE_TEXTBUFFER)) wx_option_force_value(wxUSE_TEXTFILE OFF) endif() +if(wxUSE_MIMETYPE AND NOT wxUSE_TEXTFILE) + message(WARNING "wxUSE_MIMETYPE requires wxTextFile... disabled") + wx_option_force_value(wxUSE_MIMETYPE OFF) +endif() + if(wxUSE_CONFIG) if(NOT wxUSE_TEXTFILE) message(WARNING "wxConfig requires wxTextFile... disabled") From 3d9ee4852af0674b967187ddb08bbe1be4f84e41 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:22:38 +0100 Subject: [PATCH 03/18] CMake: fix build with wxUSE_OLE disabled wxDirDialog falls back to using wxGenericDirDialog, add this file to the sources. --- build/cmake/lib/core/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/cmake/lib/core/CMakeLists.txt b/build/cmake/lib/core/CMakeLists.txt index e991c3d3e3..825fc081f3 100644 --- a/build/cmake/lib/core/CMakeLists.txt +++ b/build/cmake/lib/core/CMakeLists.txt @@ -25,6 +25,9 @@ if(WXMSW) wx_append_sources(CORE_SRC MSW_DESKTOP_LOWLEVEL) wx_append_sources(CORE_SRC MSW) wx_append_sources(CORE_SRC MSW_DESKTOP) + if(NOT wxUSE_OLE) + wx_list_add_prefix(CORE_SRC "${wxSOURCE_DIR}/" "src/generic/dirdlgg.cpp") + endif() elseif(WXGTK) if(WXGTK2) wx_append_sources(CORE_SRC GTK2_LOWLEVEL) From 5fefe1df11263cff11c6dd3341b4a317d2da6a75 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:26:00 +0100 Subject: [PATCH 04/18] wxUSE_ACCESSIBILITY requires wxUSE_OLE --- include/wx/msw/chkconf.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index 3ca6761472..abf12efc45 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -381,6 +381,15 @@ # define wxUSE_DRAG_AND_DROP 0 # endif # endif + +# if wxUSE_ACCESSIBILITY +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_ACCESSIBILITY requires wxUSE_OLE" +# else +# undef wxUSE_ACCESSIBILITY +# define wxUSE_ACCESSIBILITY 0 +# endif +# endif #endif /* !wxUSE_OLE */ #if !wxUSE_ACTIVEX From 0c212421f530c5a0c55e0d185debef09335ae6b6 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:26:57 +0100 Subject: [PATCH 05/18] Fix building wxDebugReport without wxUSE_OWNER_DRAWN replace wxCheckListBox with wxListBox. --- src/generic/dbgrptg.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/generic/dbgrptg.cpp b/src/generic/dbgrptg.cpp index 75d406dc7e..3acf1ea1e3 100644 --- a/src/generic/dbgrptg.cpp +++ b/src/generic/dbgrptg.cpp @@ -270,7 +270,11 @@ private: wxDebugReport& m_dbgrpt; +#if wxUSE_OWNER_DRAWN wxCheckListBox *m_checklst; +#else + wxListBox *m_checklst; +#endif wxTextCtrl *m_notes; wxArrayString m_files; @@ -342,7 +346,11 @@ wxDebugReportDialog::wxDebugReportDialog(wxDebugReport& dbgrpt) wxSizerFlags().Border(wxTOP)); sizerFileBtns->AddStretchSpacer(1); +#if wxUSE_OWNER_DRAWN m_checklst = new wxCheckListBox(this, wxID_ANY); +#else + m_checklst = new wxListBox(this, wxID_ANY); +#endif wxSizer *sizerFiles = new wxBoxSizer(wxHORIZONTAL); sizerFiles->Add(m_checklst, flagsExpand); @@ -390,7 +398,9 @@ bool wxDebugReportDialog::TransferDataToWindow() if ( m_dbgrpt.GetFile(n, &name, &desc) ) { m_checklst->Append(name + wxT(" (") + desc + wxT(')')); +#if wxUSE_OWNER_DRAWN m_checklst->Check(n); +#endif m_files.Add(name); } @@ -401,6 +411,7 @@ bool wxDebugReportDialog::TransferDataToWindow() bool wxDebugReportDialog::TransferDataFromWindow() { +#if wxUSE_OWNER_DRAWN // any unchecked files should be removed from the report const size_t count = m_checklst->GetCount(); for ( size_t n = 0; n < count; n++ ) @@ -410,6 +421,7 @@ bool wxDebugReportDialog::TransferDataFromWindow() m_dbgrpt.RemoveFile(m_files[n]); } } +#endif // if the user entered any notes, add them to the report const wxString notes = m_notes->GetValue(); From 3d1a8ef54e5d5c6572fae6fb6590dc2826b19fd6 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:26:29 +0100 Subject: [PATCH 06/18] Fix 'switch label contains default but no case' warning --- samples/widgets/listbox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/widgets/listbox.cpp b/samples/widgets/listbox.cpp index 19ca1db964..2ab069a397 100644 --- a/samples/widgets/listbox.cpp +++ b/samples/widgets/listbox.cpp @@ -500,6 +500,8 @@ void ListboxWidgetsPage::CreateLbox() flags); break; #endif // wxUSE_REARRANGECTRL + case LboxType_ListBox: + wxFALLTHROUGH; default: m_lbox = new wxListBox(this, ListboxPage_Listbox, wxDefaultPosition, wxDefaultSize, From d068bcfb577ce09da8fed343f3a874653ef2572e Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:27:20 +0100 Subject: [PATCH 07/18] Fix unreferenced parameter warning with wxUSE_ACCEL disabled --- src/msw/frame.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 607b82f320..fe8c35fce7 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -741,6 +741,8 @@ bool wxFrame::MSWDoTranslateMessage(wxFrame *frame, WXMSG *pMsg) wxMenuBar *menuBar = GetMenuBar(); if ( menuBar && menuBar->GetAcceleratorTable()->Translate(frame, pMsg) ) return true; +#else + wxUnusedVar(frame); #endif // wxUSE_MENUS && wxUSE_ACCEL return false; From e80be3e3cb322f12d20cada0d6493877735625fb Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:27:57 +0100 Subject: [PATCH 08/18] Fix unreferenced function warning with wxUSE_DRAG_AND_DROP disabled --- src/msw/window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index ad808c60cd..23c965885c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1746,6 +1746,8 @@ void wxWindowMSW::Update() // drag and drop // --------------------------------------------------------------------------- +#if wxUSE_DRAG_AND_DROP + #if wxUSE_STATBOX // we need to lower the sibling static boxes so controls contained within can be @@ -1777,8 +1779,6 @@ static inline void AdjustStaticBoxZOrder(wxWindow * WXUNUSED(parent)) #endif // wxUSE_STATBOX/!wxUSE_STATBOX -#if wxUSE_DRAG_AND_DROP - void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget) { if ( m_dropTarget != 0 ) { From bfe737e7e7763d98fe236d42db829c393c5bb921 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:29:01 +0100 Subject: [PATCH 09/18] Fix build with wxUSE_FILE disabled --- src/msw/registry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 73631b105c..bc5e1d273c 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -1233,7 +1233,7 @@ static inline bool WriteAsciiString(wxOutputStream& ostr, const wxString& s) bool wxRegKey::Export(const wxString& filename) const { -#if wxUSE_FFILE && wxUSE_STREAMS +#if wxUSE_FILE && wxUSE_FFILE && wxUSE_STREAMS if ( wxFile::Exists(filename) ) { wxLogError(_("Exporting registry key: file \"%s\" already exists and won't be overwritten."), From 016f00777e66e974e8157b6c8c3791171c0aa266 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 21 Nov 2019 21:29:36 +0100 Subject: [PATCH 10/18] Fix 'declaration hides previous local declaration' warnings --- samples/richtext/richtext.cpp | 58 +++++++++++++++++----------------- samples/sockets/baseclient.cpp | 8 ++--- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index cc6582e576..03b69bb459 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -1190,17 +1190,17 @@ void MyFrame::WriteInitialText() r.Newline(); - wxRichTextAttr attr; - attr.GetTextBoxAttr().GetMargins().GetLeft().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetMargins().GetTop().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetMargins().GetRight().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetMargins().GetBottom().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); + wxRichTextAttr attr1; + attr1.GetTextBoxAttr().GetMargins().GetLeft().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetMargins().GetTop().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetMargins().GetRight().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetMargins().GetBottom().SetValue(20, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK); - attr.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID); + attr1.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK); + attr1.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID); - wxRichTextBox* textBox = r.WriteTextBox(attr); + wxRichTextBox* textBox = r.WriteTextBox(attr1); r.SetFocusObject(textBox); r.WriteText("This is a text box. Just testing! Once more unto the breach, dear friends, once more..."); @@ -1216,22 +1216,22 @@ void MyFrame::WriteInitialText() r.Newline(); - wxRichTextAttr attr; - attr.GetTextBoxAttr().GetMargins().GetLeft().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetMargins().GetTop().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetMargins().GetRight().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetMargins().GetBottom().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetPadding() = attr.GetTextBoxAttr().GetMargins(); + wxRichTextAttr attr1; + attr1.GetTextBoxAttr().GetMargins().GetLeft().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetMargins().GetTop().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetMargins().GetRight().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetMargins().GetBottom().SetValue(5, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetPadding() = attr.GetTextBoxAttr().GetMargins(); - attr.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK); - attr.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS); - attr.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID); + attr1.GetTextBoxAttr().GetBorder().SetColour(*wxBLACK); + attr1.GetTextBoxAttr().GetBorder().SetWidth(1, wxTEXT_ATTR_UNITS_PIXELS); + attr1.GetTextBoxAttr().GetBorder().SetStyle(wxTEXT_BOX_ATTR_BORDER_SOLID); - wxRichTextAttr cellAttr = attr; + wxRichTextAttr cellAttr = attr1; cellAttr.GetTextBoxAttr().GetWidth().SetValue(200, wxTEXT_ATTR_UNITS_PIXELS); cellAttr.GetTextBoxAttr().GetHeight().SetValue(150, wxTEXT_ATTR_UNITS_PIXELS); - wxRichTextTable* table = r.WriteTable(6, 4, attr, cellAttr); + wxRichTextTable* table = r.WriteTable(6, 4, attr1, cellAttr); int i, j; for (j = 0; j < table->GetRowCount(); j++) @@ -1382,15 +1382,15 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) if (dialog.ShowModal() == wxID_OK) { - wxString path = dialog.GetPath(); + wxString path1 = dialog.GetPath(); - if (!path.empty()) + if (!path1.empty()) { int filterIndex = dialog.GetFilterIndex(); int fileType = (filterIndex < (int) fileTypes.GetCount()) ? fileTypes[filterIndex] : wxRICHTEXT_TYPE_TEXT; - m_richTextCtrl->LoadFile(path, fileType); + m_richTextCtrl->LoadFile(path1, fileType); } } } @@ -1420,14 +1420,14 @@ void MyFrame::OnSaveAs(wxCommandEvent& WXUNUSED(event)) if (dialog.ShowModal() == wxID_OK) { - wxString path = dialog.GetPath(); + wxString path1 = dialog.GetPath(); - if (!path.empty()) + if (!path1.empty()) { wxBusyCursor busy; wxStopWatch stopwatch; - m_richTextCtrl->SaveFile(path); + m_richTextCtrl->SaveFile(path1); long t = stopwatch.Time(); wxLogDebug("Saving took %ldms", t); @@ -2315,10 +2315,10 @@ wxRichTextTable* MyRichTextCtrl::FindTable() const while (obj) { obj = obj->GetParent(); - wxRichTextTable* table = wxDynamicCast(obj, wxRichTextTable); - if (table) + wxRichTextTable* table1 = wxDynamicCast(obj, wxRichTextTable); + if (table1) { - return table; + return table1; } } diff --git a/samples/sockets/baseclient.cpp b/samples/sockets/baseclient.cpp index 10b1e7703d..f1e48019da 100644 --- a/samples/sockets/baseclient.cpp +++ b/samples/sockets/baseclient.cpp @@ -677,8 +677,8 @@ wxThread::ExitCode ThreadWorker::Entry() } else { //wxLogMessage("ThreadWorker: Connected. Sending %d bytes of data",m_outsize); etype = WorkerEvent::SENDING; - WorkerEvent e(this,etype); - wxGetApp().AddPendingEvent(e); + WorkerEvent e1(this,etype); + wxGetApp().AddPendingEvent(e1); int to_process = m_outsize; do { m_clientSocket->Write(m_outbuf,m_outsize); @@ -692,8 +692,8 @@ wxThread::ExitCode ThreadWorker::Entry() if (!failed) { etype = WorkerEvent::RECEIVING; - WorkerEvent e(this,etype); - wxGetApp().AddPendingEvent(e); + WorkerEvent e2(this,etype); + wxGetApp().AddPendingEvent(e2); to_process = m_insize; do { m_clientSocket->Read(m_inbuf,m_insize); From a6bfd845b4aa110c487fe9cac656b2a3f1f3b00c Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 27 Nov 2019 20:03:54 +0100 Subject: [PATCH 11/18] CMake: find PangoFT2 when wxUSE_PRIVATE_FONTS is enabled in GTK Rewrite and simplify FindFontconfig. --- build/cmake/init.cmake | 5 +- build/cmake/lib/core/CMakeLists.txt | 4 +- build/cmake/modules/FindFontconfig.cmake | 83 +++++++----------------- build/cmake/modules/FindPangoFT2.cmake | 30 +++++++++ 4 files changed, 57 insertions(+), 65 deletions(-) create mode 100644 build/cmake/modules/FindPangoFT2.cmake diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 1361e1a85b..a0cfe8c541 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -420,8 +420,9 @@ if(wxUSE_GUI) if(wxUSE_PRIVATE_FONTS AND WXGTK) find_package(Fontconfig) - if(NOT FONTCONFIG_FOUND) - message(WARNING "Fontconfig not found, Private fonts won't be available") + find_package(PangoFT2) + if(NOT FONTCONFIG_FOUND OR NOT PANGOFT2_FOUND) + message(WARNING "Fontconfig or PangoFT2 not found, Private fonts won't be available") wx_option_force_value(wxUSE_PRIVATE_FONTS OFF) endif() endif() diff --git a/build/cmake/lib/core/CMakeLists.txt b/build/cmake/lib/core/CMakeLists.txt index 825fc081f3..d8125aa255 100644 --- a/build/cmake/lib/core/CMakeLists.txt +++ b/build/cmake/lib/core/CMakeLists.txt @@ -77,8 +77,8 @@ if(WXOSX_COCOA) endif() endif() if(WXGTK AND wxUSE_PRIVATE_FONTS) - wx_lib_include_directories(core PUBLIC ${FONTCONFIG_INCLUDE_DIR}) - wx_lib_link_libraries(core PUBLIC ${FONTCONFIG_LIBRARIES}) + wx_lib_include_directories(core PUBLIC ${FONTCONFIG_INCLUDE_DIRS} ${PANGOFT2_INCLUDE_DIRS}) + wx_lib_link_libraries(core PUBLIC ${FONTCONFIG_LIBRARIES} ${PANGOFT2_LIBRARIES}) endif() if(wxUSE_LIBSDL) if(SDL2_FOUND) diff --git a/build/cmake/modules/FindFontconfig.cmake b/build/cmake/modules/FindFontconfig.cmake index c7796b1643..43f04914a9 100644 --- a/build/cmake/modules/FindFontconfig.cmake +++ b/build/cmake/modules/FindFontconfig.cmake @@ -1,69 +1,30 @@ -# - Try to find the Fontconfig +# - Try to find Fontconfig # Once done this will define # # FONTCONFIG_FOUND - system has Fontconfig -# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers -# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG -# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG +# FONTCONFIG_INCLUDE_DIRS - The include directory to use for the Fontconfig headers +# FONTCONFIG_LIBRARIES - Link these to use Fontconfig -# Copyright (c) 2006,2007 Laurent Montel, -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# +find_package(PkgConfig) +pkg_check_modules(PC_FONTCONFIG QUIET fontconfig) -if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) +find_path(FONTCONFIG_INCLUDE_DIRS + NAMES fontconfig.h + HINTS ${PC_FONTCONFIG_INCLUDEDIR} + ${PC_FONTCONFIG_INCLUDE_DIRS} + PATH_SUFFIXES fontconfig +) - # in cache already - set(FONTCONFIG_FOUND TRUE) +find_library(FONTCONFIG_LIBRARIES + NAMES fontconfig + HINTS ${PC_FONTCONFIG_LIBDIR} + ${PC_FONTCONFIG_LIBRARY_DIRS} +) -else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(FONTCONFIG DEFAULT_MSG FONTCONFIG_INCLUDE_DIRS FONTCONFIG_LIBRARIES) - if (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PC_FONTCONFIG QUIET fontconfig) - - set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER}) - endif (NOT WIN32) - - find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h - PATHS - ${PC_FONTCONFIG_INCLUDEDIR} - ${PC_FONTCONFIG_INCLUDE_DIRS} - /usr/X11/include - ) - - find_library(FONTCONFIG_LIBRARIES NAMES fontconfig - PATHS - ${PC_FONTCONFIG_LIBDIR} - ${PC_FONTCONFIG_LIBRARY_DIRS} - ) - - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR ) - - mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR) - -endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) +mark_as_advanced( + FONTCONFIG_INCLUDE_DIRS + FONTCONFIG_LIBRARIES +) diff --git a/build/cmake/modules/FindPangoFT2.cmake b/build/cmake/modules/FindPangoFT2.cmake new file mode 100644 index 0000000000..8526b9aad5 --- /dev/null +++ b/build/cmake/modules/FindPangoFT2.cmake @@ -0,0 +1,30 @@ +# - Try to find PangoFT2 +# Once done this will define +# +# PANGOFT2_FOUND - system has PangoFT2 +# PANGOFT2_INCLUDE_DIRS - The include directory to use for the PangoFT2 headers +# PANGOFT2_LIBRARIES - Link these to use PangoFT2 + +find_package(PkgConfig) +pkg_check_modules(PC_PANGOFT2 QUIET pangoft2) + +find_path(PANGOFT2_INCLUDE_DIRS + NAMES pango-context.h + HINTS ${PC_PANGOFT2_INCLUDEDIR} + ${PC_PANGOFT2_INCLUDE_DIRS} + PATH_SUFFIXES pango +) + +find_library(PANGOFT2_LIBRARIES + NAMES pangoft2-1.0 + HINTS ${PC_PANGOFT2_LIBDIR} + ${PC_PANGOFT2_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PANGOFT2 REQUIRED_VARS PANGOFT2_INCLUDE_DIRS PANGOFT2_LIBRARIES) + +mark_as_advanced( + PANGOFT2_INCLUDE_DIRS + PANGOFT2_LIBRARIES +) From a45afd2f981bc063deff417c961a3236ceaa0c04 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 27 Nov 2019 20:05:53 +0100 Subject: [PATCH 12/18] Add uninstall icon to installer script --- build/tools/wxwidgets.iss | 1 + 1 file changed, 1 insertion(+) diff --git a/build/tools/wxwidgets.iss b/build/tools/wxwidgets.iss index 67c8dc3adf..0c5b4436d9 100644 --- a/build/tools/wxwidgets.iss +++ b/build/tools/wxwidgets.iss @@ -37,6 +37,7 @@ OutputDir={#WXW_DIR}\.. OutputBaseFilename={#SETUPFILENAME} PrivilegesRequired=none SetupIconFile={#WXW_DIR}\art\wxwin.ico +UninstallDisplayIcon={#WXW_DIR}\art\wxwin.ico Compression=lzma SolidCompression=yes From 147dab61b359b1edcf353b9e0928e865d3fd48c5 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 27 Nov 2019 20:09:14 +0100 Subject: [PATCH 13/18] Check for more webkit packages on TravisCI --- build/tools/before_install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/tools/before_install.sh b/build/tools/before_install.sh index 40b72ee7d7..129cee2d9e 100755 --- a/build/tools/before_install.sh +++ b/build/tools/before_install.sh @@ -24,7 +24,8 @@ case $(uname -s) in pgk_check="libgstreamermm-1.0-dev libgstreamermm-0.10-dev \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev \ - libwebkitgtk-dev libglu1-mesa-dev libsecret-1-dev libnotify-dev" + libwebkit2gtk-4.0-dev libwebkitgtk-3.0-dev libwebkitgtk-dev \ + libglu1-mesa-dev libsecret-1-dev libnotify-dev" for pkg in $pgk_check; do if $(apt-cache pkgnames | grep -q $pkg) ; then From 4d7273971459f54a2b79b8ac847c03fef32cdc82 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 27 Nov 2019 20:11:09 +0100 Subject: [PATCH 14/18] CMake: fix using cotire with clang on Windows --- build/cmake/modules/cotire.cmake | 38 ++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/build/cmake/modules/cotire.cmake b/build/cmake/modules/cotire.cmake index 97275d6497..bb69643fe6 100644 --- a/build/cmake/modules/cotire.cmake +++ b/build/cmake/modules/cotire.cmake @@ -1551,7 +1551,8 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags endif() endif() elseif (_compilerID MATCHES "Clang") - if (UNIX) + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) + if (NOT WIN32 OR NOT _compilerName MATCHES "cl$") # Clang options used # -H print the name of each header file used # -E invoke preprocessor @@ -1564,7 +1565,7 @@ function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flags # return as a flag string set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly") endif() - elseif (WIN32) + else() # Clang-cl.exe options used # /TC treat all files named on the command line as C source files # /TP treat all files named on the command line as C++ source files @@ -1671,7 +1672,8 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"") endif() elseif (_compilerID MATCHES "Clang") - if (UNIX) + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) + if (NOT WIN32 OR NOT _compilerName MATCHES "cl$") # Clang options used # -x specify the source language # -c compile but do not link @@ -1692,7 +1694,7 @@ function (cotire_add_pch_compilation_flags _language _compilerID _compilerVersio set (_flags "${_flags} -Xclang -fno-pch-timestamp") endif() endif() - elseif (WIN32) + else() # Clang-cl.exe options used # /Yc creates a precompiled header file # /Fp specifies precompiled header binary file name @@ -1830,7 +1832,8 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV set (_flags "-Winvalid-pch -include \"${_prefixFile}\"") endif() elseif (_compilerID MATCHES "Clang") - if (UNIX) + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) + if (NOT WIN32 OR NOT _compilerName MATCHES "cl$") # Clang options used # -include process include file as the first line of the primary source file # note: ccache requires the -include flag to be used in order to process precompiled header correctly @@ -1841,7 +1844,7 @@ function (cotire_add_prefix_pch_inclusion_flags _language _compilerID _compilerV # return as a flag string set (_flags "-include \"${_prefixFile}\"") endif() - elseif (WIN32) + else() # Clang-cl.exe options used # /Yu uses a precompiled header file during build # /Fp specifies precompiled header binary file name @@ -2006,15 +2009,12 @@ function (cotire_check_precompiled_header_support _language _target _msgVar) set (${_msgVar} "" PARENT_SCOPE) endif() elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang") - if (UNIX) + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) + if (NOT WIN32 OR NOT _compilerName MATCHES "cl$") # all Unix Clang versions have PCH support set (${_msgVar} "" PARENT_SCOPE) - elseif (WIN32) - # only clang-cl is supported under Windows - get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) - if (NOT _compilerName MATCHES "cl$") - set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE) - endif() + else() + # clang-cl under Windows endif() elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel") # Intel PCH support requires version >= 8.0.0 @@ -2381,8 +2381,9 @@ endfunction() function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile) set (_sourceFiles ${ARGN}) + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR - (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) + (WIN32 AND _compilerName MATCHES "cl$")) # for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file # the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion if (_sourceFiles) @@ -2428,8 +2429,9 @@ function (cotire_setup_pch_file_compilation _language _target _targetScript _pre endfunction() function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile) + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR - (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) + (WIN32 AND _compilerName MATCHES "cl$")) # for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file # the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation set (_sourceFiles ${ARGN}) @@ -2578,8 +2580,9 @@ function (cotire_setup_target_pch_usage _languages _target _wholeTarget) set (_language "${_languages}") # for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level # see cotire_setup_pch_file_inclusion + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT - (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) + (WIN32 AND _compilerName MATCHES "cl$")) get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER) if (_prefixFile) get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER) @@ -3071,8 +3074,9 @@ function (cotire_setup_pch_target _languages _configurations _target) set (_dependsFiles "") foreach (_language ${_languages}) set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE) + get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE) if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT - (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) + (WIN32 AND _compilerName MATCHES "cl$")) # MSVC, Intel and clang-cl only create precompiled header as a side effect list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER) endif() From 38c38e2274af694b5de0598a20ca69eca5e049a5 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 27 Nov 2019 20:40:11 +0100 Subject: [PATCH 15/18] CMake: private includes before public includes This way, build-in headers (for example png headers) will always be included before system headers. --- build/cmake/functions.cmake | 8 ++++++-- build/cmake/lib/CMakeLists.txt | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 7d772546da..fa412910e0 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -405,14 +405,18 @@ endmacro() # Forwards everything to target_include_directories() except for monolithic # build where it collects all include paths for linking with the mono lib macro(wx_lib_include_directories name) + cmake_parse_arguments(_LIB_INCLUDE_DIRS "" "" "PUBLIC;PRIVATE" ${ARGN}) if(wxBUILD_MONOLITHIC) - cmake_parse_arguments(_LIB_INCLUDE_DIRS "" "" "PUBLIC;PRIVATE" ${ARGN}) list(APPEND wxMONO_INCLUDE_DIRS_PUBLIC ${_LIB_INCLUDE_DIRS_PUBLIC}) list(APPEND wxMONO_INCLUDE_DIRS_PRIVATE ${_LIB_INCLUDE_DIRS_PRIVATE}) set(wxMONO_INCLUDE_DIRS_PUBLIC ${wxMONO_INCLUDE_DIRS_PUBLIC} PARENT_SCOPE) set(wxMONO_INCLUDE_DIRS_PRIVATE ${wxMONO_INCLUDE_DIRS_PRIVATE} PARENT_SCOPE) else() - target_include_directories(${name};BEFORE;${ARGN}) + set(INCLUDE_POS) + if (_LIB_INCLUDE_DIRS_PRIVATE) + set(INCLUDE_POS BEFORE) + endif() + target_include_directories(${name};${INCLUDE_POS};${ARGN}) endif() endmacro() diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index 1a625e54ae..939eba57d3 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -86,7 +86,11 @@ if(wxBUILD_MONOLITHIC) target_link_libraries(mono ${vis} ${wxMONO_LIBS_${vis}}) endif() if(wxMONO_INCLUDE_DIRS_${vis}) - target_include_directories(mono ${vis} ${wxMONO_INCLUDE_DIRS_${vis}}) + set(INCLUDE_POS) + if (vis STREQUAL PRIVATE) + set(INCLUDE_POS BEFORE) + endif() + target_include_directories(mono ${INCLUDE_POS} ${vis} ${wxMONO_INCLUDE_DIRS_${vis}}) endif() if(wxMONO_DEFINITIONS_${vis}) target_compile_definitions(mono ${vis} ${wxMONO_DEFINITIONS_${vis}}) From c6ce2a77bf5dd8f38fded3b1caad5c7ee2974cbb Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Fri, 29 Nov 2019 00:23:26 +0100 Subject: [PATCH 16/18] Fix wxEditorDialogProperty type declaration --- include/wx/propgrid/props.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 6db101447e..a8b549eb31 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -575,7 +575,7 @@ protected: class WXDLLIMPEXP_PROPGRID wxEditorDialogProperty : public wxPGProperty { friend class wxPGDialogAdapter; - wxDECLARE_ABSTRACT_CLASS(wxDialogProperty); + wxDECLARE_ABSTRACT_CLASS(wxEditorDialogProperty); public: virtual ~wxEditorDialogProperty(); From 51254a148e6f5e56325c72a5395f2ff623ccd3e6 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Fri, 29 Nov 2019 01:10:43 +0100 Subject: [PATCH 17/18] Make wxSVGFileDC an abstract class --- include/wx/dcsvg.h | 7 +------ src/common/dcsvg.cpp | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 939b0dd36e..a0b794a122 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -324,12 +324,7 @@ public: void SetShapeRenderingMode(wxSVGShapeRenderingMode renderingMode); private: - wxSVGFileDC() - : wxDC(new wxSVGFileDCImpl(this, wxString())) - { - } - - wxDECLARE_DYNAMIC_CLASS(wxSVGFileDC); + wxDECLARE_ABSTRACT_CLASS(wxSVGFileDC); }; #endif // wxUSE_SVG diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index c70b16ae1c..29aae36ce9 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -465,7 +465,7 @@ wxSVGBitmapFileHandler::ProcessBitmap(const wxBitmap& bmp, // wxSVGFileDC (specialisations) // ---------------------------------------------------------- -wxIMPLEMENT_DYNAMIC_CLASS(wxSVGFileDC, wxDC); +wxIMPLEMENT_ABSTRACT_CLASS(wxSVGFileDC, wxDC); void wxSVGFileDC::SetBitmapHandler(wxSVGBitmapHandler* handler) { From 0833c8b8618f2502d94ecae57df49c41e8986f2e Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Fri, 29 Nov 2019 01:11:37 +0100 Subject: [PATCH 18/18] Disable webview in GTK3 build on TravisCI It does not pass the tests. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1316f8047c..62907a985a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: env: wxCONFIGURE_FLAGS="--enable-utf8 --enable-utf8only --enable-monolithic" wxUSE_XVFB=1 - dist: trusty compiler: gcc - env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" wxUSE_XVFB=1 + env: wxGTK_VERSION=3 wxCONFIGURE_FLAGS="--enable-cxx11 --enable-stl --disable-webview" wxMAKEFILE_FLAGS="CXXFLAGS=-std=c++11" wxUSE_XVFB=1 - dist: trusty compiler: clang env: wxCONFIGURE_FLAGS="--disable-shared --disable-sys-libs --disable-webview" wxUSE_XVFB=1