Commit graph

73443 commits

Author SHA1 Message Date
Vadim Zeitlin
4e802e6fc7 Remove wxUSE_COMPILER_TLS and always use C++11 thread_local
Don't use compiler-specific __thread and use the standard keyword
instead.

Keep the existing TLS-related macros for compatibility, but remove our
custom implementation of them, so that they're always trivial now.
2022-10-26 03:31:54 +02:00
Vadim Zeitlin
5845312825 Merge branch 'generic-listctrl-hidpi-images'
Support high DPI images in generic wxListCtrl.

See #22916.
2022-10-26 02:39:28 +02:00
Vadim Zeitlin
7904c11f22 Merge branch 'dont-mess-with-pkg-config-libdir'
Don't change PKG_CONFIG_LIBDIR in configure, this is better done by its
caller.

See #22915.
2022-10-25 23:54:00 +02:00
PB
232e161ed6 Update strftime() link in wxDateTime::Format() docs
The old link to https://cplusplus.com became invalid.

Closes #22913.
2022-10-25 23:53:25 +02:00
Vadim Zeitlin
7ae2281874 Merge branch 'bitmap-macro'
Fix wxBITMAP() in wxQt and improve its documentation.

See #22911.
2022-10-25 23:52:21 +02:00
Vadim Zeitlin
99c52403f9 Use usual half-open interval for wxID_LOWEST..wxID_HIGHEST
The reserved wx IDs were previously in (wxID_LOWEST, wxID_HIGHEST]
range, which was very unusual, as C++ always uses intervals half-open in
the other direction, i.e. [begin, end).

It also conflicted (in theory, if not in practice, as wxID_HIGHEST
wasn't actually used for anything) with the common practice, used even
by wx own samples, of starting the custom IDs at wxID_HIGHEST rather
than wxID_HIGHEST+1.

So change this to use the standard convention, retroactively making all
the code using wxID_HIGHEST valid -- this seems better than insisting on
starting the IDs from wxID_HIGHEST+1.

Closes #22909.
2022-10-25 23:51:21 +02:00
Vadim Zeitlin
c94399121f Don't duplicate same code for small icon, list and report modes
Handle all of them in a single condition instead of using three
different ones.

No real changes.
2022-10-25 23:48:25 +02:00
Vadim Zeitlin
6dd4e73ea3 Add wxDrawImageBitmap() helper and use it in wx{List,Tree}Ctrl
Add a helper function calling wxDC::DrawBitmap() and hiding its ugly
"useMask" boolean parameter which was also error-prone, e.g. some
recently modified code passed wxIMAGELIST_DRAW_TRANSPARENT to it by
mistake.

No real changes, this is just a refactoring.
2022-10-25 23:48:25 +02:00
Vadim Zeitlin
69648b4322 Rename variable to have a less confusing name
After the changes of the last commit this variable is not of wxImageList
type any more, so its name became confusing, so rename it and also be a
bit more precise by indicating that it corresponds to the small, and not
normal, images.

No real changes.
2022-10-25 23:48:25 +02:00
Gerhard Stein
502e189f47 Support high DPI bitmaps in wxGenericListCtrl
Use wxWithImages::GetImageBitmapFor() instead of wxImageList in this
control code to ensure that we use the provided high DPI bitmaps, if we
have them, instead of always scaling up the fixed-size image list
images.

Closes #22907.
2022-10-25 23:48:25 +02:00
Vadim Zeitlin
c440fbce78 Disable use of host pkg-config in wxiOS CI build
Set PKG_CONFIG_LIBDIR=/dev/null explicitly to disable the use of the
host libraries when cross-compiling.
2022-10-25 21:38:27 +02:00
Vadim Zeitlin
2bdd648128 Remove unnecessary wxCONFIGURE_FLAGS environment variable
It was confusing to have both it and wxCONFIGURE_OPTIONS, so remove it
and just use its value as part of wxCONFIGURE_OPTIONS.

No real changes.
2022-10-25 20:50:24 +02:00
Vadim Zeitlin
6dbf59f34f Revert "Disable use of build system pkg-config files when cross-compiling"
This reverts commit 893ebbab0c because it
breaks cross-compiling using target-specific pkg-config installed on the
main system, which is a perfectly legitimate use case.

To avoid the original problem fixed by that commit, PKG_CONFIG_LIBDIR
needs to be set manually before running configure when using host
pkg-config -- but not when using target pkg-config.

Closes #22886.
2022-10-25 18:51:31 +02:00
Artur Wieczorek
ed6c25beed Skip tests known not to work under wxGTK 2022-10-25 11:24:07 +02:00
Artur Wieczorek
5e9609dfe0 Fix wxGCDC::DestroyClippingRegion() for wxMSW
We don't need special handling of clipping area in DestroyClippingRegion().
2022-10-25 11:01:56 +02:00
Artur Wieczorek
b16fdd50db Fix using wxGCDC (Cairo) with scrolled wxDC (wxMSW)
Since 4f9186f (Increase usable scrolling range in wxMSW by a
factor of 10,000, 2022-04-30) the shift of wxDC origin is not passed
through HDC so we need to apply it as an internal transform of
Cairo context. This transform is for internal purposes only and is
not exposed with GetTransform().

See #22480.
See #22914.
2022-10-25 11:01:25 +02:00
Artur Wieczorek
3fa1e9bd2b Pass reference to wxDC instead of pointer to wxD2DContext ctor 2022-10-25 10:58:27 +02:00
Artur Wieczorek
c87970b29d Fix using wxGCDC (Direct2D) with scrolled wxDC
Because since 4f9186f (Increase usable scrolling range in wxMSW by a
factor of 10,000, 2022-04-30) the shift of wxDC origin is not passed
through HDC so we need to apply it as an internal transform of
ID2D1RenderTarget. This transform is for internal purposes only and is
not exposed with GetTransform().

See #22480.
See #22914.
2022-10-25 10:57:06 +02:00
Artur Wieczorek
a23f159869 Fix using wxGCDC (GDI+) with scrolled wxDC
Instead of shifting origin of HDC we can apply required shift of wxDC
origin as an internal transform of the Graphics object. This transform
is for internal purposes only and is not exposed with GetTransform().

See #22480.
See #22914.
2022-10-25 10:53:55 +02:00
Artur Wieczorek
ee70221a0d Handle wxOSX-specific clipping in wxOSX wxWindowDC implementation
Instead of setting clipping for client area for wxOSX windows
with non-native borders in the common wxGCDC::DestroyClippingRegion()
we can encapsulate this operation in dedicated DestroyClippingRegion()
implementation in wxWindowDC.

See #19108.
See #22914.
2022-10-25 10:50:40 +02:00
Artur Wieczorek
7d3f776ec3 Extend tests to check clipping on wxGCDC when origin of its parent wxDC is shifted
See #22914.
See #22480.
2022-10-25 10:44:09 +02:00
Artur Wieczorek
9a2d594d9d Use logical 'and' operator in logical expressions 2022-10-25 10:42:47 +02:00
Artur Wieczorek
3c8ca52f0d Enclose test case tags in square brackets 2022-10-25 10:42:17 +02:00
Vadim Zeitlin
4eae6b7ff1 Improve wxBITMAP() documentation
Document wxHAS_IMAGE_RESOURCES and talk about wxBITMAP_PNG() before
wxBITMAP() instead of doing it as only an afterthought.
2022-10-23 16:31:52 +02:00
Vadim Zeitlin
6a00104cbd Use wxHAS_IMAGES_IN_RESOURCES instead of checking all platforms
No real changes, just simplify the preprocessor check.
2022-10-23 16:31:27 +02:00
Vadim Zeitlin
95b6e1270e Fix wxBITMAP() definition for wxQt
Define wxBITMAP() for all non-MSW ports in the same, working, way
instead of using a weird definition which happened to accidentally work
before for wxQt due to implicitly using wxImage ctor from XPN, but
doesn't work any longer since the changes of 5e53f74af1 (Make wxImage
ctor from XPM data explicit, 2021-04-17).

Closes #22908.
2022-10-23 16:07:25 +02:00
Vadim Zeitlin
adb29b1903 Merge branch 'scintilla_3.10.5' of https://github.com/MaartenBent/wxWidgets
Upgrade Scintilla to 3.21.1.

See #1331.
2022-10-23 16:03:31 +02:00
Vadim Zeitlin
4e52fbc4b5 Merge branch 'qt-fixes'
Various wxQt build fixes.

See #22902.
2022-10-23 15:55:03 +02:00
Vadim Zeitlin
ca4e70df74 Add a Docker container for regenerating wx configure
This allows doing it on any system with Docker instead of having to do
it only under Debian stable that was traditionally used for this.

Closes #22889.
2022-10-23 15:24:21 +02:00
Vadim Zeitlin
ee67242b5f Add support for wxUSE_TASKBARBUTTON option to configure
Add new --enable-taskbarbutton option and define wxUSE_TASKBARBUTTON as
1 by default instead of always defining it as 0, as was the case before.

Closes #22900.
2022-10-23 15:03:03 +02:00
Vadim Zeitlin
bd75dc392a Merge branch 'doc_cxx11_remove'
Remove "if C++11 is used" parts from the docs: it now always is.

See #22897.
2022-10-23 15:01:59 +02:00
PB
c22f6ba4fc Update comments in setup_inc.h and various wx/setup.h files
Update the outdated or just plain incorrect comments.

Closes #22857.
2022-10-23 15:00:38 +02:00
Vadim Zeitlin
ed510012ba Also add Unix files to wxQt CMake build
Similar to the last commit for configure-based build system.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
2022-10-23 14:53:44 +02:00
Maarten Bent
619071cb71
Fix NULL usage
Ignore scintilla files in NULL check.
Allow to use nullptr as an alias.
2022-10-22 21:30:37 +02:00
Maarten Bent
875e127108
Regenerate Xcode projects 2022-10-22 20:06:06 +02:00
Maarten Bent
fb6d8168c7
Fix build warnings and errors in Scintilla code
Conversion from 'size_t' to 'int' (MSVC).
-Wdefaulted-function-deleted (macOS Clang).
Redeclare 'enum class' as 'enum' (VS2015).
'std::string': type not allowed for 'constexpr' (VS2015).
2022-10-22 20:06:06 +02:00
Maarten Bent
289cd2e58e
Exclude Scintilla from whitespace check 2022-10-22 20:06:05 +02:00
Maarten Bent
530275b191
Add GradientRectangle implementations
D2D implementation is based on Scite implementation.
2022-10-22 20:06:05 +02:00
Maarten Bent
7b823ace48
Use all modifiers with mouse events
Add handling of meta-key modifier.
2022-10-22 20:06:04 +02:00
Maarten Bent
5d0d599504
Use native scintilla selection event 2022-10-22 20:06:04 +02:00
Maarten Bent
f02a43076f
Fix compiling wxSTC
Add missing namespaces and includes.
Use correct parameter types.
Remove overridden methods that do not exist anymore.
Add methods that do need to be overridden (without implementation).
Update listbox action implementation.
SCI_LOADLEXERLIBRARY is now handled inside ScintillaBase::WndProc.
Cleanup includes, use copy from ScintillaWin.cxx for scintilla includes.
2022-10-22 20:06:03 +02:00
Maarten Bent
314fe7e4fc
Update and run wxSTC python scripts
Remap scintilla enums to int.
Add implementations for function using scintilla::stringresult.
Silence warnings: Unknown line type: ali
2022-10-22 20:05:53 +02:00
Maarten Bent
27ddafca51
Update scintilla version, remove patch instructions
Don't apply the patch unless new build error reports come in.
2022-10-22 19:05:18 +02:00
Maarten Bent
2af3719a4e
Add new scintilla sources to build systems
Mention updating the CMake file in the readme.
Remove NO_CXX11_REGEX from scintilla build.
Manually update vcxproj files.
Define LPEG_LEXER=0, prevent LPEG_LEXER is not defined error.
2022-10-22 19:05:18 +02:00
Maarten Bent
6c3b0f66f3
Update scintilla to 3.21.1 2022-10-22 19:05:06 +02:00
Vadim Zeitlin
fba8a119a1 Add Unix files to wxQt build under Unix
Compile Unix, but not GUI toolkit, specific wxDialUpManager, wxJoystick
and wxSound implementations when building wxQt.

Closes #22895, #22896.
2022-10-21 19:01:22 +02:00
Vadim Zeitlin
e28ab8974d Avoid some simple to fix deprecation warnings with Qt 5.14
Replace the deprecated functions with the new equivalents when this
doesn't really change the code semantics.

Also add new compat.h private header where more functions like
wxQtGetWidthFromMetrics() can be added in the future.

There are still quite a few of deprecation warnings requiring more
changes remaining.
2022-10-21 19:00:36 +02:00
Vadim Zeitlin
fab5f1bdec Strengthen advice to use std::thread instead of wx classes
Be more categoric about it as there is no reason to use wx classes any
more, now that wx can't be used with C++98 compilers anyhow.
2022-10-21 14:13:57 +02:00
Vadim Zeitlin
0a33da8058 Fix MSW "Save" dialog overwrite prompt for files without ext
We need to call IFileDialog::SetDefaultExtension() to ensure that the
native dialog itself appends the extension itself to the files entered
without extension it, otherwise it doesn't do it at all, in spite of
SetFileTypes() being already called, and so doesn't show "Confirm
overwrite" prompt for them, while wxMSW own code does append the
extension later, resulting in the existing files being overwritten
without any confirmation.

It would probably be a good idea to stop appending the extension on our
own and just use the one appended by the dialog to ensure that we don't
have similar problems in the future, but don't change this yet.

Closes #22898.
2022-10-21 01:46:58 +01:00
Vadim Zeitlin
0850666ebd Fix wxTaskBarButton availability in the documentation
It's only available under MSW and doesn't have a generic implementation.
2022-10-21 02:21:22 +02:00