Commit Graph

72393 Commits

Author SHA1 Message Date
Vadim Zeitlin
61e24f6be0 Give more information if wxFont unit tests fail
Use INFO() to provide extra information instead of the ugly
WX_ASSERT_MESSAGE().
2022-04-18 14:29:53 +02:00
Stefan Csomor
6afd2e8f87 Revert "making sure CI builds don’t contaminated checked out directory on self-hosted runner"
This reverts commit 88bd6d0135. we’re trying to use this approach: https://docs.github.com/en/actions/hosting-your-own-runners/running-scripts-before-or-after-a-job
2022-04-17 23:33:50 +02:00
Stefan Csomor
88bd6d0135 making sure CI builds don’t contaminated checked out directory on self-hosted runner
self-hosted runners are stateful - surprise - so we have to isolate things better
2022-04-17 20:47:54 +02:00
Vadim Zeitlin
b66d4488e1 Merge branch 'fn-long-path'
Fix wxPATH_NORM_LONG with UNC paths and slightly optimize long path
normalization.

See #22307.
2022-04-17 18:51:09 +02:00
Vadim Zeitlin
6998eaf154 Merge branches 'no-unused-err' and 'dynlib-test-fix'
Fix CI builds under macOS 12 with clang 13.
2022-04-17 18:49:52 +02:00
Vadim Zeitlin
26e35e0170 Use port free even under macOS 12 port for running httpbin
The default httpbin listening port 5000 is used by Monterrey (macOS 12)
Control Center for its own needs, so use another port to avoid conflicts
with it and the resulting failures when running wxWebRequest unit tests
under this macOS version.
2022-04-17 18:48:12 +02:00
Vadim Zeitlin
2144ca38d2 Get rid of CppUnit boilerplate in DynamicLibraryTestCase
Use CATCH macros directly, this is simpler and more clear.

Also use narrow strings instead of wide ones and get rid of wxT() too.

No real changes.

This commit is best viewed ignoring whitespace-only changes.
2022-04-17 18:44:51 +02:00
Vadim Zeitlin
f3b4ee3b5f Skip dynamic library file existence check under Darwin
Under Monterrey (macOS 10.12) we can actually load the file using
wxDynamicLibrary even though it does _not_ exist on the disk, so don't
skip the test just because of this.
2022-04-17 18:38:08 +02:00
Vadim Zeitlin
c6b3b4a39c Make the warning in DynamicLibraryTestCase actually visible
Using wxLogWarning() doesn't work as logs are suppressed by default, but
using CATCH WARN() macro does work.
2022-04-17 18:35:34 +02:00
Vadim Zeitlin
6a48431ca1 Add missing wxLogWarning() argument to wxDynamicLibrary test
The argument corresponding to the "%s" format specifier was missing,
which resulted in a crash if the dynamic library tested didn't actually
exist.
2022-04-17 18:30:42 +02:00
utelle
8ab635b451 Improve wxLocale backwards compatibility and enhance wxUILocale
Restore the old behaviour of wxLocale, which is supposed to use the
default locale and not the preferred language, which may not be the same
(see #22281).

Also apply the following fixes and improvements to wxUILocale:

- Add new GetSystemLocale() method.
- Change the MSW implementation to use the default locale instead of the
  preferred UI language for Windows versions below Windows 10.
- Change the Unix implementation to respect LANGUAGE environment
  variable and use it for determining the preferred UI languages.
- Use wxUILocale in wxTranslations to determine the preferred UI
  languages.
- Use wxUILocale during initialization of internat sample.

Closes #22281.

Closes #22318.
2022-04-17 18:04:21 +02:00
Maarten Bent
4a3098aebb Optimize MSW wxNotebook background painting
MSWDefWindowProc(WM_PAINT, ...) in OnPaint causes performance issues on
large screens so only use it when an actual custom background colour is
set.

Closes #22308.

Closes #22320.
2022-04-17 17:59:24 +02:00
Vadim Zeitlin
7d31e055c4 Don't touch non-wx libraries in "make install" under Mac
Only run install_name_tool on our own libraries as part of "make
install" instead of doing it on all libraries in the installation
directory: this was at best useless and at worst harmful, as some
combinations of install_name_tool and macOS versions don't work well
together and result in corrupting the already installed libraries.
2022-04-17 17:59:01 +02:00
Vadim Zeitlin
67da8bc7e0 Fix warning about unused "err" from clang 13 in release build
Don't just wxASSERT(err == 0), as this expands to nothing in the release
builds. Use wxCHECK() instead so that we at least return an error even
in the release builds too.
2022-04-17 16:31:03 +02:00
Vadim Zeitlin
37a9a33150 Use wxScopedArray instead of new[] in wxOSX display code
Avoid manual memory management.

This was already fixed once in 563f41c686 (Fix memory leak on error
return in wxOSX wxDisplay code., 2014-02-21) but incompletely and then
another instance of new/delete[] was reintroduced in d5180d3604 (add a
GetFromWindow implementation to wxDisplayFactory, 2020-08-07). Get rid
of all of them now and use wxScopedArray<> instead (we could also use
wxVector<> or even std::vector<> too).

No real changes.
2022-04-17 16:30:58 +02:00
Vadim Zeitlin
73dc9086f5 Don't fail the entire CI run just because of cache saving error
Update ccache-action to a not yet released version including the fix for
failing the entire CI job if saving the cache failed -- this shouldn't
happen at all, but in practice it does happen from time to time, and
it's better to succeed, rather than fail in this case.
2022-04-16 16:07:20 +02:00
kkocdko
02741a6c92 CMake: Fix build with wxBUILD_MONOLITHIC
Add wxUSE_WEBVIEW test before using wx_webview_copy_webview2_loader.

Closes #22315, #22316.
2022-04-16 15:38:44 +02:00
Maarten Bent
4fa3b8c276 CMake: Fix the minimum supported version
Change the minimum version to 3.0. Version 2.8.12 has never worked,
because it does not support the VERSION parameter in project().

Replace GREATER_EQUAL comparisons, these are only supported since 3.7.

Move PCH related code to a separate file, and include it after
options.cmake and init.cmake. Because only then the wxBUILD_PRECOMP
variable is fully initialized.

Closes #22312.
2022-04-16 15:35:49 +02:00
PB
92deb92e29 Use doubled backslashes in examples in wxFileName documentation
Fix syntax of C strings in the examples.

Closes #22311.
2022-04-16 15:34:08 +02:00
Vadim Zeitlin
a47382f95d Revert accidental changes to the samples
This reverts parts of 533958be10 (recreating Xcode project files with
new script, 2022-04-16) that seem to have been committed accidentally
and are now preventing CI builds from passing.
2022-04-16 15:33:05 +02:00
Stefan Csomor
88f5a14d34 Removing outdated AppleScript, updating docs 2022-04-16 14:48:58 +02:00
Stefan Csomor
533958be10 recreating Xcode project files with new script 2022-04-16 14:27:24 +02:00
Artur Wieczorek
d72a3f7cec Create wxBitmap compatible with wxDC for all ports
Ctor creating wxBitmap compatible with wxDC is now implemented in all
ports.
2022-04-15 10:12:41 +02:00
Vadim Zeitlin
d6c3344c6f Don't try finding the long form of non-existent paths
This is at best useless and at worst harmful, as shown by the bug fixed
in the previous commit, so just don't do it if GetLongPathName() has
already determined that the path doesn't exist.
2022-04-15 00:32:35 +01:00
Vadim Zeitlin
35d08e6a87 Don't corrupt UNC paths when normalizing with wxPATH_NORM_LONG
After the fixes to UNC paths handling, Normalize(wxPATH_NORM_LONG)
started adding an extra colon after the UNC paths.

Fix this by using wxGetVolumeString() instead of constructing this thing
manually and add a unit test checking for this.

Closes #22275.
2022-04-15 00:32:35 +01:00
Vadim Zeitlin
e50c7b2e2f Add GetDOSPath() helper to wxFileName unit test
No real changes.
2022-04-15 00:13:07 +01:00
DINAKAR T.D
95cb963d33 Update Tamil translations for wx 3.1.6 2022-04-14 23:57:45 +02:00
Maarten Bent
9a255463f9 Fix wrong wxMenuItem::GetBitmap() return type documentation
This function returns wxBitmap by object, not by (const) reference since
wxBitmapBundle-related changes.

Also change signature of the other methods taking wxBitmapBundle instead
of wxBitmap now.

And some other minor improvements.

Closes #22306.
2022-04-14 23:22:41 +02:00
Vadim Zeitlin
105e81a4b0 Merge branch 'cmake-gtk2' of github.com:MaartenBent/wxWidgets
Fix some CMake and build warnings with GTK2.

See #22305.
2022-04-14 23:19:54 +02:00
Vadim Zeitlin
54bdc6bbd2 Merge branch 'configure-snprintf'
Don't use AC_CHECK_FUNCS(snprintf) which doesn't work with the latest
MinGW API headers (see https://sourceforge.net/p/mingw-w64/bugs/935/)
and some other minor cleanup.

See #22302.
2022-04-14 23:18:16 +02:00
Maarten Bent
5bea1dc18a Fix static build using extended RTTI
Fix declaration of 'o' hides previous local declaration warnings.

Change two wxCONSTRUCTOR_5 definitions using wxBitmapBundle instead of
wxBitmap (this does not give build errors).

wxGenericCalendarCtrl is missing all XTI implementations, so just use
RTTI. And fix building the xti sample.

Note the shared build still fails due to WXDLLIMPEXP related issues.

Closes #22300.

Closes #22301.
2022-04-14 23:17:05 +02:00
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