Graphics renderers (exposed through wxGraphicsContext) support arbitrary affine transformations so it is possible to add support for affine transformations in wxGCDC by implementing all wxGCDC::*TransformMatrix() functions with calls to respective wxGraphicsContext functions.
Additionally, this implementation adds support for affine transformations in wxDC under wxGTK3 because in this port wxDC is equivalent to wxGCDC.
Remove the unnecessary 'CodePair' struct from a header, make the huge
keySymTab array const, and don't compile it for platforms that don't
use it, it's only used by wxX11
Since wxStyledTextCtrl::StyleSetFont does not change its 'font' parameter, it
should be a constant reference so we can pass in temporary wxFont objects.
Closes https://github.com/wxWidgets/wxWidgets/pull/321
wxGetKeyState() does not currently work on non-X11 GTK backends, and in some
cases it has been reported to crash. It seems that the most likely use case
for wxGetKeyState() is to query the modifier keys, so on non-X11 backends, use
GTK+ calls to retrieve the modifier key state.
Non-modifier keys are not currently implemented, update the documentation to
mention this.
Closes https://github.com/wxWidgets/wxWidgets/pull/320
Use Windows file associations when running under this OS, even when using
wxGTK, because this is the right thing to do.
Also use native wxDisplay implementation because it works better than the GTK+
one under this platform.
Closes#17651.
Since retrieving actual clipping box is an expensive operation so to improve performance of wxD2DContext::GetClipBox() we need to store just retrieved clipping box data in the cache. These stored data will be then used in the forthcoming requests for clipping box values. Cached clipping box data are invalidated whenever clipping region is explicitly set using Clip()/ResetClip() or whenever transformation matrix is changed (to take into account new coordinates). If there is a call for clipping box (with GetClipBox) and cached data are marked as invalid then clipping box is retrieved/recalculated and stored in the cache.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when wxDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale(), SetLogicalScale(), SetTransformMatrix() or ResetTransformMatrix().
When any of these functions is called then clipping box data are marked as invalid and updated by recalculating extents of the clipping region in new coordinates at nearest call to GetClippingBox().
Closes#17646.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing wxGraphicsContext is associated with wxGCDC using SetGraphicsContext() or when wxGCDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale() or SetLogicalScale().
When any of these functions is called then clipping box data are marked as invalid and retrieved from underlying graphics context using wxGraphicsContext::GetClipBox() at nearest call to GetClippingBox().
See #17646.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing HDC is associated with wxDC using SetHDC() or when wxDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale(), SetLogicalScale(), SetTransformMatrix() or ResetTransformMatrix().
When any of these functions is called then clipping box data are marked as invalid and updated using GetClipBox() Win API at nearest call to GetClippingBox().
See #17646.
This allows running with a GTK+ library that was built with different backends
than the one wxWidgets was built with. Since GTK3 provides no way to determine
the backends available at run-time, avoid referencing symbols in the backends
by checking the type name of the GdkDisplay, on the assumption that they are
unlikely to ever be changed. The X11 backend is still required at run-time if
it was available at build-time, although this dependency could also be removed.
Make const_reference const and dereference const_iterator into a
const_reference to ensure that the code trying to assign to a (dereferenced)
const_iterator doesn't compile.
Closes https://github.com/wxWidgets/wxWidgets/pull/316
When complex transformation (including e.g. rotation) is applied to DC then coordinates of the clip box return by GetClipBox() API can be inaccurate due to the rounding errors.
To compensate these errors we need to fill rectangle which is slightly larger then just retrieved clip box.
Closes#17636.
If underlying graphics context is rotated then drawing a rectangle with origin at (0,0) doesn't cover all the drawing area. To draw over entire area we need to get extents of the actual clipping region (with applied all transformations) and use it as coordinates of the drawn rectangle.
See #17636.
The scope of tests corresponds to the scope of existing wxDC/wxGCDC tests. Additionally, newly introduced wxGraphicsContext::GetClipBox() function is tested too.
Width and height were exchanged in the loops, so the conversion code didn't
work correctly and overflowed the pixel buffer (due to extra padding in the
row stride) for non-square bitmaps. It also resulted in a completely wrong
bitmap appearance, but somehow this managed to go unnoticed, unlike the memory
errors.
Closes#17633.
Apparently this can happen when a directory is deleted just before the watch
is removed and it is impossible to avoid it, so just send a warning message so
that the program could react to this, if necessary, but don't annoy the user
with an error in this case.
See #17122.