Commit Graph

72662 Commits

Author SHA1 Message Date
Maarten Bent
34afcb57a8 CMake: Improve Linux GTK2 build
Use version comparison instead of normal comparison for libnotify.
Fix warning if mismatched if statement in FindGNOMEVFS2.
Check for GREATER_EQUAL GTK versions, same as configure does.
Don't check for GTK 1 or define __WXGTK127__. CMake does not support GTK1 and it should not be defined when GTK 2/3/4 is used.
2022-04-14 22:59:08 +02:00
Maarten Bent
5ebcfd7681 Fix warnings in GTK2 build 2022-04-14 22:58:46 +02:00
Vadim Zeitlin
0ba4cf8ac9 Avoid spurious MSVC warning about uninitialized variable
Use wxDUMMY_INITIALIZE() to suppress a warning in wxDVC unit test.
2022-04-14 17:46:39 +01:00
Vadim Zeitlin
4e6e1ce054 Show debug log messages on the console in the test when enabled
Using LogEnabler in wxFileSystemWatcher test case still didn't show
anything even in case of unexpected failures because debug messages
didn't appear in the test output.

Fix this by using a custom log target which shows the debug (and trace)
messages on stderr, instead of using the debug output for them, even
under MSW.

Also make LogEnabler public, and rename it to a more unique name, as it
could be useful in the other tests too.
2022-04-14 17:37:32 +01:00
Vadim Zeitlin
4b918d16d0 Fix wrong format specifier in wxMarkupParser debug logs
Use "%z" and not "%l" for size_t arguments.
2022-04-14 17:37:32 +01:00
Vadim Zeitlin
0407d74eaa Remove __WXSTUBS__ mention and test
This has never really been a thing and there remained just one (never
used) test for it in the sources, so simply remove it.

No real changes.
2022-04-14 00:40:36 +02:00
Vadim Zeitlin
7b45060d30 Remove remains of Classic Mac support
Don't test for __WXMAC__ after testing for __UNIX__ just above, as the
latter is now always defined when the latter is, we don't support
non-Unix Mac systems since an awfully long time.

No real changes.
2022-04-14 00:39:37 +02:00
Vadim Zeitlin
d31d645777 Drop remains of support for Metrowerks Standard C++ library
This compiler is not supported since a very long time, so get rid of the
tests for __MSL__.
2022-04-14 00:38:03 +02:00
Vadim Zeitlin
7b0d77e0c0 Remove checks for [v]snprintf() and vsscanf() declarations
Consider that all still supported/existing platforms provide these
declarations, if they provide these functions at all (and they probably
all do, so we almost certainly could remove all the test for them, but
keep them for now).

Note that we still test for broken declarations as this might still be
useful on HP-UX 11 systems, where this problem was reported "only" 8
years ago.

By not using AC_CHECK_FUNCS() we avoid the problem when using it with
snprintf() when cross-compiling with the latest MinGW API headers, see
https://sourceforge.net/p/mingw-w64/bugs/935/ for more details.

This commit is best viewed ignoring whitespace-only changes.
2022-04-14 00:33:51 +02:00
Vadim Zeitlin
d63b0c2cf9 Update libtiff submodule to remove snprintf() check in configure
This fixes build failure when using the latest MinGW headers.
2022-04-14 00:26:01 +02:00
Vadim Zeitlin
ce46d77360 Merge branch 'bitmap-dc-ctor'
Add wxBitmap ctors taking wxDC to all ports and set the scale factor
correctly in the existing ctors taking wxDC in wxMSW.

See #22297.
2022-04-13 15:57:35 +02:00
Vadim Zeitlin
85daadd659 Merge branch 'cmake-improvements' of https://github.com/MaartenBent/wxWidgets
Use newer CMake PCH support instead of cotire and many other
improvements to CMake build system.

See #22295.
2022-04-13 15:56:09 +02:00
Vadim Zeitlin
2d719165ca Fix wxMSW build with wxUSE_UNICODE==0
Use wxChar in wxUILocaleImplLCID to allow the code to compile and work
correctly even when GetLocaleInfo() is GetLocaleInfoA() and not the W
version as usual.

Closes #22299.
2022-04-12 23:46:36 +02:00
Maarten Bent
039f0a924a CMake: Create only one target file
Put the target file in lib/cmake/wxWidgets directory.
2022-04-12 22:08:46 +02:00
Maarten Bent
797df0530d CMake: Fix different identifier warning when building with XCode
Add plist file to the Resource group.
2022-04-12 22:08:46 +02:00
Maarten Bent
681e32f521 CMake: Add IS_MONO option to wx_add_library and wx_set_target_properties
Use this instead of checking for the target name.
2022-04-12 22:08:45 +02:00
Maarten Bent
323e6e8320 CMake: Fix using precompiled headers with Objective-C++ files
Compiling .mm files gives error 'Objective C file was disabled in PCH but is currently enabled'.

Enable the OBJCXX language so the Objective-C++ compiler will be detected and used for .mm files instead of the c++ compiler.
Detect if there are .mm files and enable PCH for them too.

Don't set COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS when cotire is not used.
2022-04-12 22:08:45 +02:00
Maarten Bent
0f8b828394 Fix unused parameter warning in macOS build 2022-04-12 22:08:45 +02:00
Vadim Zeitlin
24970061fa Add wxBitmap(wxImage, wxDC) ctor to all ports
This ctor was previously present only in wxMSW, make it available in all
ports to allow the same code to compile everywhere.

In most of them wxDC argument is simply ignored, but in wxGTK and wxOSX
it is used to assign the appropriate scale factor for the new bitmap.

Enable previously wxMSW-only unit test checking for this.
2022-04-12 19:08:56 +01:00
Vadim Zeitlin
b185186ebf Handle scale factor in another wxMSW wxBitmap ctor taking wxDC
This is similar to db6d565fad (Handle wxDC scale factor in wxBitmap ctor
taking wxDC in wxMSW, 2022-04-10), but for the constructor taking
wxImage and wxDC -- it should also use the DC scale factor, even if it
is not used for scaling the bitmap size in this case.

Add a unit test checking for this.
2022-04-12 17:57:49 +01:00
Vadim Zeitlin
558a300996 Create bitmaps from image and a wxDC without an HDC in wxMSW
This is similar to 7382e99bbb (Create bitmaps even when given a wxDC
without an HDC in wxMSW, 2022-04-10) and does the same change to
wxBitmap ctor from wxImage and wxDC -- and also extends the unit test to
check for this under wxMSW, which is the only port in which this ctor is
currently available.
2022-04-12 17:30:42 +01:00
Maarten Bent
05917b04ae CMake: Add source group for CMake files
Add all of the CMake related files together in one group/filter.
This includes the CMakeLists.txt of the project, cmake_pch.[hxx,cxx] when
using CMake's precompiled header feature, and a .rule file created by cotire.

Also include manifest files in the Resource group. Even though they are not
visible (in VS2022), they would create an empty MSW Headers group for samples.
2022-04-11 23:29:16 +02:00
Maarten Bent
d61c9ee4bf CMake: Apply source groups using a function
This will add source groups to all projects, not only libraries.
And there is no need anymore to include it in every project file.
2022-04-11 23:18:58 +02:00
Maarten Bent
7683219f90 CMake: Remove duplicate and unused defines
Remove unused CMake code to get number of mono source files.
wxUSE_BASE=1 is also defined in wx_set_target_properties.
There seems no reason to define _LIB and DLL_EXPORTS, wx does not use it. They
were probably added because the vcxproj files have them.
2022-04-10 23:44:59 +02:00
Maarten Bent
4999c1c84b CMake: Export WXUSINGDLL for shared builds
Always define WXUSINGDLL for plugins.
2022-04-10 23:41:49 +02:00
Maarten Bent
87465898f3 Fix unused variable warnings 2022-04-10 23:41:44 +02:00
Maarten Bent
13a82b3d67 CMake: Fix building tests and sample after making target includes private 2022-04-10 23:41:44 +02:00
Maarten Bent
f00e7ced27 CMake: Fix monolithic build
Don't target net and webview libraries directly, but use the wx_ function that will add it to the mono library when applicable.
2022-04-10 21:00:39 +02:00
Maarten Bent
0125a52376 CMake: Improve handling plugin in wx_set_target_properties
Don't link with toolkit or wx libraries, and set the correct defines.
2022-04-10 21:00:39 +02:00
Maarten Bent
f4367b3fee CMake: Use target_precompile_headers when available
Keep using cotire for CMake versions older than 3.16, or when user specifies wxBUILD_PRECOMP=COTIRE.
The scintilla headers need to be specified for target_precompile_headers to work.
Enable it when the target has at least 2 source files (same as cotire does).
2022-04-10 20:46:56 +02:00
Maarten Bent
614d58bf38 CMake: Set precompiled headers when adding libraries
Combine the three pch related functions into one.
2022-04-10 20:46:56 +02:00
JackBoosY
e2a02d4206 CMake: Export target files 2022-04-10 20:46:56 +02:00
Maarten Bent
affbbce1a3 CMake: Make all target_compile_definitions private
It is only used to build scintilla, no need to expose these definitions to external projects.
2022-04-10 20:46:53 +02:00
Maarten Bent
de495c19a3 CMake: Make all target_include_directories private
There is no need to expose them to external projects.
2022-04-10 20:46:26 +02:00
Vadim Zeitlin
db6d565fad Handle wxDC scale factor in wxBitmap ctor taking wxDC in wxMSW
When using wxBitmap ctor taking wxDC, the bitmap should inherit the
scale factor of the DC, both because it's already the case in the other
ports and because it makes sense to do it.

Add a unit test checking that this is the case in all ports now.
2022-04-10 19:45:59 +01:00
Vadim Zeitlin
7382e99bbb Create bitmaps even when given a wxDC without an HDC in wxMSW
It seems wrong to just fail to create the bitmap entirely if a not
wxMSWDCImpl-derived wxDC is provided to wxBitmap::Create(size, wxDC)
overload, especially because no check is done to see if the associated
HDC is non-null for wxMSWDCImpl-derived classes.

Instead, simply create a DIB-based bitmap with the specified size, as
this seems more useful and less surprising and was already the behaviour
in the other ports.

Add a test ensuring that this remains the case in the future.
2022-04-10 19:43:29 +01:00
Artur Wieczorek
eb054c8286 Fix typo 2022-04-10 18:27:17 +02:00
Vadim Zeitlin
d08498eb16 Add wxBitmap(size, dc) ctor to all ports
Previously this ctor was only available in wxMSW and wxOSX, which was
especially strange as the equivalent Create() overload, taking wxDC, was
already available in all ports.
2022-04-10 17:17:02 +01:00
Vadim Zeitlin
bf75fe9d64 Remove redundant forward decls and headers from wx/*/bitmap.h
No real changes, just don't redeclare the classes already forward
declared in wx/bitmap.h in the files included (only) from it and don't
include redundant headers.

Also forward declare wxCursor and wxPixelDataBase in wx/bitmap.h itself
for consistency, as many (even though not all) headers use them.

Do not forward declare wxControl in wx/{msw,osx}/bitmap.h, however,
there is no reason to do it in this header.
2022-04-10 17:09:52 +01:00
DietmarSchwertberger
a6cc2c7238 Fix recent regression in grid sample
Changes of 3719ab3725 (Add support for rearranging wxGrid rows order
interactively, 2022-04-02) broke TabularGridFrame in the sample, fix it
by removing the duplicate call to wxSizer::Add().

See #22260.

Closes #22296.
2022-04-10 17:50:43 +02:00
Vadim Zeitlin
2d675acd6b Fix handling apt install errors in install script
Logging the error code reset it (as echo executed successfully), so save
it first.

Also check for the failure of the second attempt to run apt too.
2022-04-10 17:47:54 +02:00
DietmarSchwertberger
7f8f2a9aa3 Fix asserts when changing columns of wxGrid using native header
The number of columns has to be changed after updating the m_colAt and
m_colWidths arrays, as the native header uses them.

This extends the changes of a2d65663a0 (Fix assert when adding columns
to wxGrid using native header., 2013-05-31) to inserting and deleting
the columns too.

See #15225.

Closes #22294.
2022-04-10 16:14:58 +02:00
Kaya Zeren
7e34e9f572 Update Turkish translations for 3.1.6 2022-04-10 16:01:11 +02:00
Vadim Zeitlin
d981c0e43d Use canonical name and address for Gérard Durand 2022-04-10 15:53:17 +02:00
Gérard DURAND
79559dbfeb Update French translations for 3.1.6 2022-04-10 15:48:08 +02:00
Felipe
2abc5496fa Update Brazilian Portuguese translations for 3.1.6 2022-04-10 15:46:15 +02:00
Artur Wieczorek
254e1afea5 Create wxBitmap compatible with wxDC only for wxMSW
Ctor creating wxBitmap compatible with wxDC is available only for wxMSW.
2022-04-10 14:17:33 +02:00
Artur Wieczorek
891e6a26a3 Simplify wxPGPropArgCls 2022-04-10 13:43:09 +02:00
Artur Wieczorek
1a31eef189 Cleanup wxPropertyGridInterface declarations
Move definitions of GetPropertyValueAs*() functions away from class
declaration to avoid polluting the header.
2022-04-10 13:40:08 +02:00
Artur Wieczorek
ef20164efb Refactor to simplify break statements in the nested if/else blocks 2022-04-10 13:38:55 +02:00