Add a new class allowing to store passwords and other sensitive information
using the OS-provided facilities.
Add implementations for all the main platforms, documentation and a new sample
(which contains an ad hoc unit test as the real unit test for this class would
probably be a bad idea as it wouldn't run in non-interactive contexts and
could show OS level dialog boxes if it did).
The hack used in cc774bb301 to include some
standard headers after undefining __STRICT_ANSI__ doesn't work when
precompiled headers are used because the headers had been already included
from wx/wxprec.h then.
So instead bite the bullet and just reproduce MinGW stdlib.h declarations to
define "environ" ourselves, it's not that bad and hopefully won't need much
maintenance as later versions won't need the strict ANSI workarounds at all.
As for tzset(), wxDECL_FOR_STRICT_MINGW32() can be used for it without any
problems at all, not sure why hasn't it been done like this since the
beginning.
See #16984.
This function is not present in older MinGW import libraries, up to at least
MinGW 4.8.1, so we can't use it directly as it was done in
22f0801378 and we need to load it dynamically.
This was already done in wxDC code, so just reuse the same wrapper function
after extracting it (and a few others, for consistency) into a new header.
On OS X at least, the user is free to customize numbers formatting rules
and use more than one character for separators. Don’t assert in such
cases (the rules are untrusted input), but instead fall back to
something reasonable, as is already done if we can’t retrieve the rules.
Reworked calculations of the center of the arc and start/end angles of the arc to get correct results for any spatial orientation of starting and ending lines.
Closes#17552
Modified calculations of sweep angle to get its correct value for all combinations of start/end angle values and clockwise/counter-clockwise drawing.
See #17552
In addition to copying the underlying geometry sink itself also auxiliary data, like collection of transformed geometries and positional data have to copied the the new wxD2DPathData instance.
Because wxGraphicsPath comprises current ID2D1PathGeometry object and the collection of transformed (sub-)geometries (ID2D1TransformedGeometry objects) so to concatenate two paths we need to concatenate their current geometries as well as to combine the collections of transformed geometries.
Unfortunately, it seems that this is not a straightforward method to apply transformation to the current underlying path geometry (ID2D1PathGeometry object) "in-place" (ie. transform it and use for further graphics operations). Some simple methods offered by Direct2D are not useful for these purposes:
1. ID2D1Factory::CreateTransformedGeometry() converts ID2D1PathGeometry object to ID2D1TransformedGeometry object and ID2D1TransformedGeometry inherits from ID2D1Geometry (not from ID2D1PathGeometry) and cannot be used for path operations.
2. ID2D1Geometry::CombineWithGeometry() which could be used to get final geometry by combining empty geometry with transformed geometry doesn't offer any combine mode which would produce a "sum" of geometries (D2D1_COMBINE_MODE_UNION gives kind of outline). Moreover the result is stored in ID2D1SimplifiedGeometrySink not in ID2DGeometrySink.
So, it seems that ability to transform the wxGraphicsPath (even several times) and still use it after this operation(s) can be achieved by using a geometry group object (ID2D1GeometryGroup) this way:
1. After applying transformation to the current path geometry with ID2D1Factory::CreateTransformedGeometry() the result is stored in the collection of transformed geometries (an auxiliary array) and after that a new (empty) geometry is open (in the same state as just closed one) and this geometry is used as a current one for further graphics operations.
2. Above steps are done at every transformation so our effective geometry will be a superposition of all previously transformed geometries stored in the collection (array) and the current operational geometry.
3. If there is necessary to use this combined effective geometry in any operation then ID2D1GeometryGroup created with ID2D1Factory::CreateGeometryGroup() from the collection of stored geometries will act as a proxy geometry.
Closes#17549
A GTK+ bug involving GtkHandleBox somehow prevents drawing of its child
since 3.19.7. Avoid this by disabling the docking functionality, which
is preferable to having the bar be blank.
See #17539
Just returning false is enough, there is no need to log a debug message as
well.
Also simplify the logic of this function a little by always returning true at
the end and returning false before on failure.
Closes#13759.
This merges a branch with a (slightly tweaked to apply) copy of the
cve-2016-0718-fix-2-2-1 branch from the official Expat repository at
https://sourceforge.net/p/expat/code_git/
On Gtk and OS X, but unfortunately not MSW, an assert fails if a
wxFileSystemWatcher is created too early. Therefore give a hint about
where and when one should be created.
Closes https://github.com/wxWidgets/wxWidgets/pull/287
The headers for this compiler, at least in the version packaged under Debian,
define BCN_DROPDOWN but not the NMBCDROPDOWN struct we also need, so we have
no choice but to redeclare the struct ourselves to allow this code to compile.
For some reason, "long" was used for window coordinates even though they're
really "int", and implicitly converting from the former to the latter resulted
in warnings in user code including this header with e.g. Apple clang.
Just use int to avoid conversions.
Selecting a leaf node in a wxDataViewCtrl and then pressing the right arrow
key resulted in using an out-of-bounds index for accessing the columns list.
Fix this by setting the current column to the first one, and not to the second
one which might not exist.
Closes#17537.
std::isnan() is always available when using C++11, so just use it.
Also pout the test for C++11 implementations of both wxIsNaN() and wxFinite()
first, eventually the rest of the checks will become obsolete and will be
removed.
Closes https://github.com/wxWidgets/wxWidgets/pull/283
Ensure the proper class hierarchy in wxGTK, this notably allows to override
SetValue() in classes derived from wxGauge, which didn't work in wxGTK (but
did in wxMSW and wxOSX) before.
Also remove the now unnecessary IsVertical().
When using the keyboard to select an item by typing the first characters of
its name, we need to make the item visible in addition to selecting it.
Closes#16336.
Since only geometry with closed sink (immutable) can be transferred to another geometry object with ID2D1PathGeometry::Stream() so we have to check if actual transfer succeeded and return NULL if not.
To ensure compatibility with Cairo renderer the new sub-path should be started at the joined endpoint of the current (just closed) sub-path.
Closes#17532
Because only ID2D1PathGeometry with closed sink (in the immutable state) can be transferred to another geometry object with ID2D1PathGeometry::Stream() so appending one wxGraphicsPath to another has to be done with source path geometry in the non-writable state and closing this geometry has to be done prior to any other operation.
But we want source wxGraphicsPath to stay in the writable state after appending it to another path so we have to prepare a writable copy of the source ID2D1PathGeometry and assign it to the source wxGraphicPath after the appending.
See #17532
Cairo renderer places MOVE_TO element into the path immediately after after the CLOSE_PATH element so to ensure that GDI+ will behave in the same way the new sub-path should be started at the joined endpoint of the current just closed sub-path.
See #17532
Since resulting wxGraphicPath should have the same state as appended path so we have to grab in wxGraphicsPath::AddPath also auxiliary data from appended wxGraphicsPath.
See #17532