Commit Graph

69455 Commits

Author SHA1 Message Date
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
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
Pavel Tyunin
307a97dadf Add wxConvAuto::IsUTF8() 2020-10-03 19:10:17 +03:00
Pavel Tyunin
2b8fd103b7 Add wxConvAuto::IsFallbackEncoding() 2020-10-03 19:10:17 +03:00
Stefan Brüns
03e6ca87db Revert client_data parameter name to clientData
Commit 5925893eed ("Fix various doxygen issues in the documentation")
changed the name to client_data.

This does not fit the naming scheme, and breaks some code in Phoenix
which assumes the param is called clientData (to be able to use a
binding specific type for it).
2020-10-03 16:19:06 +02:00
Stefan Brüns
d47b857b09 Change data and shortHelpString to adhere to naming convention
Rename data to clientData in the inlined overloads. This change is
transparent for any users.

Rename shortHelpString to shortHelp (dito for longHelp). Although this
change is in general visible for any users, Phoenix already mangles the
the parameter names to strip the 'String' suffix.
2020-10-03 16:12:04 +02:00
Stefan Brüns
1171155fee Remove LIST_HITTEST_ONITEMRIGHT handling from listtest sample
The ONITEMRIGHT case is only meaningful for trees, and according to the
code comment, "not used".

Closes https://github.com/wxWidgets/wxWidgets/pull/2070
2020-10-03 13:31:00 +02:00
Paul Cornett
aef3976e13 Fix WriteText() not scrolling to bottom with GTK >= 3.14
The introduction of scrollbar animations broke scroll-to-end functionality when
large amounts of text are written, due to interactions with GtkTextView's
background layout. Work around this by scrolling after the layout has finished.
See #18864
2020-10-02 11:10:14 -07:00
Stefan Brüns
d18e7718fd Fix wxWindowId parameter type and name in wxHtmlHelpWindow
The type obviously should be wxWindowID, not int.

Rename the parameter, as it is the only instance where the id is not
named 'id', the implementation already uses 'id', and for Phoenix naming
it id is also preferred, as the name is used for mangling.

The naming change causes no further breakage for Phoenix, as the generator
is currently broken anyway for this case.

Closes https://github.com/wxWidgets/wxWidgets/pull/2069
2020-10-02 15:02:03 +02:00
Eric Raijmakers
ec8bfbebdc Fix wrong step size in wxImage::Paste()
Fix a bug with wrong size passed to memset() introduced in 1f0ade29f0
(Fix using mask colour even if there is no mask in wxImage::Paste,
2020-09-30) which caused memory corruption and add a test (the one with
the large negative vertical offset) allowing to reproduce this reliably.

Closes https://github.com/wxWidgets/wxWidgets/pull/2067
2020-10-02 14:54:40 +02:00
Artur Wieczorek
0c3494592a Fix calculating mouse position in drawing sample
Displayed logical mouse position was improper for rotated wxDC.
2020-10-01 17:47:12 +02:00
Stefan Brüns
204d8a4536 Add missing wxRibbonMSWArtProvider::GetButtonBarButtonTextWidth interface
The missing override in the interface makes the inherited classes abstract
from the Phoenix SIP generators view.
2020-10-01 05:01:53 +02:00
Vadim Zeitlin
123044c68c Merge branch 'fix-caret-default'
Fix using default-constructed wxCaret.

See https://github.com/wxWidgets/wxWidgets/pull/2007
2020-10-01 02:29:43 +02:00
Vadim Zeitlin
88f808e303 Add a unit test for wxCaret::Create()
Verify that constructing wxCaret using its default ctor and Create()
works too, now that it does -- previously it uses to result in a GTK
warning and a crash in wxGTK.
2020-10-01 02:28:42 +02:00
oneeyeman1
61ef150044 Implement GetStringSelection() in generic wxBitmapComboBox
Also update the test to avoid assuming that wxBitmapComboBox inherits
from wxComboBox, which now allows it to build (and pass) on all
platforms.

Closes https://github.com/wxWidgets/wxWidgets/pull/2057
2020-10-01 02:19:12 +02:00
Eric Raijmakers
1f0ade29f0 Fix using mask colour even if there is no mask in wxImage::Paste
In case an image without alpha is pasted on top of an image with alpha,
the alpha blending gives wrong results. This is caused by the fact that
the final (if nothing has been pasted yet) pixel copying algorithm in
Paste() does not take into account whether the pasted image actually
uses a mask.

To fix this:

- Add the check for image.HasMask().
- In case there is no mask, simply copy the image via memcpy.
- Finally, update the alpha channel of the changed image (if present):
  whenever a pixel is copied, the alpha is set to fully opaque.

Closes https://github.com/wxWidgets/wxWidgets/pull/2065
2020-10-01 02:13:28 +02:00
Vadim Zeitlin
a94fda4503 Merge branch 'high-dpi-doc'
Add a new "High DPI" overview, mostly to have a place to document more
new DPI-related APIs later.

See https://github.com/wxWidgets/wxWidgets/pull/2054
2020-09-29 03:46:39 +02:00
Stefan Csomor
9aa5eb9c53 Add beginning of the artwork paragraph
This will be fleshed out later.
2020-09-29 03:46:23 +02:00
Maarten Bent
56521ad8af CMake: add missing test files
Add the source files present in the bkl but not CMakeLists.txt to the
latter one too.

Also link with AUI library now that a test file using it is included.

Closes https://github.com/wxWidgets/wxWidgets/pull/2064
2020-09-29 03:30:15 +02:00
Thomas Khyn
d9deaa8b76 Allow CMake dependencies to be interfaces
In some cases (see https://github.com/bincrafters/community/issues/1181),
the dependencies can be library interfaces.

As CMake's get_target_property is not tolerant about what properties can
be extracted on different library types, it is necessary to make a
distinction between interface libraries and plain libraries.

Closes https://github.com/wxWidgets/wxWidgets/pull/2058
2020-09-29 03:27:38 +02:00
Ian McInerney
bf7965a2d7 Add null check in wxAuiToolBar event handler
This also prevents the AUI_TOOLBAR_BEGIN_DRAG event from
being sent if there is no active toolbar item being dragged.

Closes https://github.com/wxWidgets/wxWidgets/pull/2062
2020-09-29 03:26:26 +02:00
Vadim Zeitlin
5358dd7007 Add a check for trailing whitespace and TABs
Just use Git itself to check for it in the new files.
2020-09-28 03:24:44 +02:00
Vadim Zeitlin
daa6eca2e7 Skip AppVeyor builds when GitHub workflows are modified
Don't waste AppVeyor CI resources unnecessarily.
2020-09-28 02:56:55 +02:00
Vadim Zeitlin
ba547496f9 Minor edit to the high DPI overview
Provide some link between the end of the introduction and the main part
of the text.
2020-09-28 01:57:41 +02:00