Commit Graph

69277 Commits

Author SHA1 Message Date
37d983ef6f [*] i cant be arsed to debug this. something is making the wxWindow class register twice. the other win32 apis are hardened. we can just fail later. i dont care. lets not fail here. 2021-10-12 01:41:27 +01:00
22f52051f5 ???????? 2021-10-11 03:59:52 +01:00
f81e0ed2cb Annoying bug 2021-07-01 11:34:51 +01:00
Reece Wilson
d329a01a0c
Merge pull request #1 from wxWidgets/master
Pull upstream branch
2020-10-12 04:50:08 +01:00
Vadim Zeitlin
ae8820b2f6 Fix build error with clang in the widgets sample
Don't use overloaded function as event handler.
2020-10-10 22:22:48 +02:00
PB
fafc5613f4 Fix slider event counter in widgets sample
Commit 952e5f3 introduced logging wxEVT_SLIDER events in addition to
scrolling events but the event count was incorrect as the wxEVT_SLIDER
handler and scrolling events handler kept their own event count.

Fix this by using a static member variable shared by both event handlers.
2020-10-10 19:38:34 +02:00
ali kettab
fedc80eee3 Improve selection and focus events generation in wxGenericLisCtrl
Avoid sending spurious wxEVT_LIST_ITEM_{FOCUSED, SELECTED, DESELECTED}
events and make the generic version consistent with the behaviour of the
native wxMSW one.

Also add/extend the tests and slightly improve the sample.

Closes https://github.com/wxWidgets/wxWidgets/pull/2044
2020-10-10 19:13:52 +02:00
Artur Sochirca
80a3cd2db9 Avoid using non-ASCII key codes in key up/down events in wxOSX
Generating such events could result in mishandling some key presses as
special keys, e.g. the Turkish "ş" characters was mistakenly processed
as F12 because F12 corresponds to its Unicode character code (U+015F).

Avoid this by only setting wxKeyEvent::m_keyCode for printable
characters (while still making the actual key available in m_uniChar).

This makes wxOSX consistent with wxGTK and documented behaviour.

Closes https://github.com/wxWidgets/wxWidgets/pull/2081
2020-10-10 18:32:36 +02:00
PB
952e5f32cd Fix generation of extraneous wxEVT_SLIDER events in wxMSW
Don't send the event when it's redundant, i.e. doesn't really notify
about the change in the slider value.

Also add a test case for wxEVT_SLIDER and show these events in the
widgets sample.

Closes https://github.com/wxWidgets/wxWidgets/pull/2080

Closes #18929.
2020-10-10 18:21:27 +02:00
Vadim Zeitlin
7ed330a197 Merge branch 'image-paste-fix'
Fix recent regression resulting in a crash in wxImage::Paste().

See https://github.com/wxWidgets/wxWidgets/pull/2076
2020-10-10 18:12:35 +02:00
Vadim Zeitlin
87fc7a9dc0 Merge branch 'webkit-extension-fixes' of https://github.com/vslavik/wxWidgets
Improve WebKit2 extension loading: make the code cleaner and safer.

See https://github.com/wxWidgets/wxWidgets/pull/2075
2020-10-10 18:11:45 +02:00
Vadim Zeitlin
e21f8ba1a3 Merge branch 'convauto_getencoding' of https://github.com/pavel-t/wxWidgets
Add wxConvAuto::GetEncoding(), other improvements and bug fixes.

See https://github.com/wxWidgets/wxWidgets/pull/2072
2020-10-10 18:09:29 +02:00
Václav Slavík
8756ff4320 Don't load webkit extensions from CWD-relative paths
wxgtk_initialize_web_extensions() tries to find extensions in the
location where "make install" puts them. If that fails, either because
wx wasn't installed yet, or it was deployed (e.g. in static build)
without them, it looks into additional places - paths relative to CWD.
This is to faciliate running wx samples and tests, but by being enabled
in release builds too, it allowed loading unexpected executable code
from untrusted locations. For example, on typical desktops, one could
put malicious .so files into $HOME/lib to have them loaded by
wxWebView-using applications.

Address this by making the helper paths relative to the executable's
location, not working directory.
2020-10-08 19:41:30 +02:00
Václav Slavík
b355e00149 Only warn about missing WebKit extension when used
Don't log failure to load the extension during initialization, because
it isn't needed for many uses of wxWebView. Instead, only report the
failure at the time when functionality depending on it is used.

Also use g_warning() for logging consistently with other failures in
this file. This doesn't interrupt the user, yet shows the problem highly
visibly in the console.
2020-10-08 19:32:49 +02:00
Václav Slavík
2388f5d33f Don't crash if WXPREFIX env. variable is set
Change wxGetInstallPrefix() to return a string instead of const
wxChar*. The latter was incorrectly obtained from a temporary string if
WXPREFIX was set. While it's possible to fix in a backward compatible
manner without changing the function's signature, it's not worth the
effort for something pretty obscure and used mostly internally.
2020-10-08 18:50:56 +02:00
Artur Wieczorek
365c3a2ae9 Revert "Get rid of unused wxTransformMatrix"
wxTransformMatrix is undocumented but it is appartently
in use so it has to be present in the library.

This reverts commit 3e88df56f5.
2020-10-07 23:15:10 +02:00
Pavel Tyunin
0ab3b4eac7
Fix UTF-8 build 2020-10-07 17:53:43 +03:00
Pavel Tyunin
c9dd9e96a1
Allow decoding even shorter strings in fallback encoding
Complete UTF-8 characters (except leading nulls) never appear in failed decoding attempts when the input is fed byte by byte.
2020-10-07 17:31:42 +03:00
Pavel Tyunin
1cbcf24832
Make leading nulls a special case to avoid breaking decoding some short strings in fallback encoding 2020-10-07 17:02:06 +03:00
Pavel Tyunin
b536457e07
Use tableUtf8Lengths[] in sringops.cpp too 2020-10-07 15:41:15 +03:00
Pavel Tyunin
240fcee90e
Move wxIsUTF8Prefix() to convauto.cpp 2020-10-07 15:18:30 +03:00
Pavel Tyunin
13700025be
Add wx/private/unicode.h 2020-10-07 15:18:17 +03:00
Artur Wieczorek
3e88df56f5 Get rid of unused wxTransformMatrix
As it is stated in matrix.cpp wxTransformMatrix was intended to be used
in wxDC to replace the basic system of scaling/translation but actually
it was never used.
Because applying affine transformations can be done with wxAffineMatrix2D
and wxDC::SetTransformMatrix() we can get rid of this dead code.

Closes #13114.
2020-10-06 20:49:32 +02:00
Vadim Zeitlin
96eb09a383 Really ignore TABs in makefiles etc in the whitespace check
Add missing ":" in the beginning of Git pathspecs to make the exclusions
really work.

Also add entries for Makefile.in, which is not caught by **/*akefile*,
and other files in the root directory containing hard TABs.
2020-10-06 02:14:46 +02:00
Vadim Zeitlin
1668b0bb4e Replace hard TABs in wx-config with spaces
No real changes, just de-TAB-ify.
2020-10-06 02:14:27 +02:00
Hartwig
728f2f958f Fix crash in wxImage::Paste() when using images without alpha
Check for the presence of alpha channel before using it in the fallback
code.

Also add a unit test exercising this branch of the code and which
crashed before.
2020-10-06 00:48:48 +02:00
Vadim Zeitlin
d58f9bea72 Rearrange sections in wxImage::Paste unit test
No real changes, just execute only the tests relevant for the section
being executed instead of always running the code loading PNG images
when running a section not using them at all.

This has the advantages of being a bit faster to execute (and the total
test suite run time does add up) and, more importantly, showing the
right amount of tests when executing a single section: e.g. now it's 1
in the simplest case, as expected, and not 5.

The disadvantage is, of course, slightly more code duplication, but it
doesn't seem a huge problem in practice and making each section code
more self-contained is arguably worth it.

Also, compensate for this somewhat by extracting all XPM definitions at
the function level: those are only initialized once (being static), so
there is no need to duplicate them.

Finally, also call AddHandler() once instead of once per section as
before.
2020-10-06 00:40:59 +02:00
Vadim Zeitlin
cb5e0d221c Fix running new wxImage::Paste() unit tests from build directory
Add new image test files added in 6e8da8641c (Add alpha blending for
wxImage::Paste, 2020-09-23) and 1f0ade29f0 (Fix using mask colour even
if there is no mask in wxImage::Paste, 2020-09-30) to Makefile, so that
they're copied to the build directory and could be found by the test
there, otherwise running wxImage::Paste test when building outside of
the source directory failed.
2020-10-06 00:37:56 +02:00
Václav Slavík
23992c2e77 Fix implicit conversion loss warning in wx/math.h 2020-10-05 18:56:40 +02:00
Maarten Bent
5e57976bba Don't use ID2D1Bitmap::GetSize() to get source bitmap size
Closes https://github.com/wxWidgets/wxWidgets/pull/2074

See #17171, #18686.
2020-10-05 17:22:35 +02:00
Pavel Tyunin
d2e7b5bdd1
Fix GetEncoding() after global fallback encoding is changed
Save global fallback encoding when switching to it, so GetEncoding() can still return the correct value if global fallback encoding is changed later. Also do not switch to wxFONTENCODING_MAX when it is set as global fallback encoding.
2020-10-05 18:10:27 +03:00
Václav Slavík
633165fd13 Log stale lock files in verbose mode only
Actually do what the comment says is intended. wxLogInfo() and
wxLogVerbose() differ in that only the latter must be explicitly
enabled with --verbose.
2020-10-05 17:03:48 +02:00
Václav Slavík
301e5ec9fe Fix autogen.mk after e70fc11e
cppunit.m4 was removed, don't fail if it's missing.
2020-10-05 17:01:55 +02:00
Václav Slavík
40e5152cfc Remove WX_WEB_EXTENSIONS_DIRECTORY define
wxWidgets already has a mechanism for locating plugins under
$libdir/wx/*, there's no reason to duplicate it with another
compile-time symbol.

As a consequence, this makes the library relocatable via WXPREFIX again.
2020-10-05 16:54:16 +02:00
Václav Slavík
737e9be2d0 CMake: use same location for web-extensions as Bakefile
Fix the location where the web-extension plugin is installed to be
consistent with the primary bakefile-based build system: i.e. to use
lib/wx/x.y.z for devel versions and lib/wx/x.y for stable.
2020-10-05 16:54:16 +02:00
b3c612268b update check config to work without cario on win32/macos 2020-10-05 15:46:22 +01:00
Pavel Tyunin
307a0916fd
Add comment about 2 extra bytes in wxConvAuto::ToWChar 2020-10-05 15:32:24 +03:00
Pavel Tyunin
4832565e10
Rename IsFallbackEncoding() to IsUsingFallbackEncoding() 2020-10-05 15:32:07 +03:00
Artur Wieczorek
fe064de26b Use dedicated functions to convert between degrees and radians 2020-10-04 21:47:43 +02:00
Artur Wieczorek
9e5f333bcc Optimize calculations of the angles in DrawArc()
Perform calculations in radians to avoid conversions to/from degrees.
2020-10-04 21:43:56 +02:00
Vadim Zeitlin
c91ced2412 Revert "Fix wxMSW ListCtrl drawing of horizontal rules for new items"
This reverts commit 374db28747 (Fix wxMSW ListCtrl drawing of horizontal
rules for new items, 2016-05-04) and also commit bb3177dd3b (Avoid
infinite repaint loop in wxListCtrl with wxLC_HRULES, 2020-07-24) which
fixed one problem with the original change, but not all of them, as it
was still easily possible to get into an infinite repaint loop.

So just return to the simplest and not too bad, even if not optimal,
solution of refreshing everything after changing a column width when
using horizontal rules.

See #17158, #18850.

Closes #18927.
2020-10-04 18:19:12 +02:00
Vadim Zeitlin
5ddb8182d7 Merge branch 'naming_convention_fixes'
Use more consistent naming conventions for some parameters in the actual
headers and the documentation.

See https://github.com/wxWidgets/wxWidgets/pull/2073
2020-10-04 16:02:15 +02:00
Vadim Zeitlin
4f90d31274 Harmonize wxXmlDoctype ctor parameter names
Make the names more clear and similar to the names of member variables
to which they correspond and also use them consistently in the
documentation.

This reverts the changes to this interface header done in 5925893eed
(Fix various doxygen issues in the documentation, 2019-10-20).
2020-10-04 16:00:34 +02:00
Pavel Tyunin
45adce8561
Fix wxTextInputStream for some inputs starting with nulls 2020-10-03 19:49:46 +03:00
Pavel Tyunin
b3eff48e28
Switch to fallback earlier if the input is not valid UTF-8 prefix 2020-10-03 19:49:46 +03:00
Pavel Tyunin
bc838b4773
Do not delete and create the fallback conversion again when it fails 2020-10-03 19:49:46 +03:00
Pavel Tyunin
1e435d2347
Fix wxTextInputStream incorrectly decoding multibyte fallback encodings 2020-10-03 19:49:45 +03:00
Pavel Tyunin
857950c626
Add more wxConvAuto test cases 2020-10-03 19:49:40 +03:00
Pavel Tyunin
3676635231
Check wxConvAuto state in tests 2020-10-03 19:47:06 +03:00
Pavel Tyunin
28823424e9
Add wxConvAuto::GetEncoding() 2020-10-03 19:10:17 +03:00