Commit Graph

61813 Commits

Author SHA1 Message Date
Kolya Kosenko
897ffb58b0 Use native MIME and display classes in wxGTK/Win32 build
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.
2016-09-08 00:48:41 +02:00
Vadim Zeitlin
9cb762dbd2 Rebake to get rid of whitespace-only changes in generated files
This just commits insignificant changes after rebaking everything to make sure
they don't get mixed up with significant ones at some later time.
2016-09-08 00:48:06 +02:00
Artur Wieczorek
dafc865d49 Optimize wxDCImpl::DoSetClippingRegion
Do intersection operations directly on the final wxRect containing clip box.
2016-09-01 21:43:27 +02:00
Artur Wieczorek
588425a9d4 Add caching of clipping box values for Direct2D graphics context
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.
2016-09-01 21:42:27 +02:00
Artur Wieczorek
ba4b8d5670 Fix retrieving clipping box after changing wxDC coordinates (GTK)
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.
2016-09-01 21:42:13 +02:00
Artur Wieczorek
98714ea452 Fix retrieving clipping box after changing wxGCDC coordinates (MSW, GTK)
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.
2016-09-01 21:41:18 +02:00
Artur Wieczorek
dfc966bf1e Fix retrieving clipping box after changing wxDC coordinates (MSW)
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.
2016-09-01 21:39:48 +02:00
Artur Wieczorek
a37ed9a2b5 Add tests of setting clipping region and retrieving clipping box
These new tests are about setting clipping region and retrieving clipping box for wxDC and wxGCDC with applied transformations.

See #17646
2016-09-01 20:35:09 +02:00
Paul Cornett
378aa9dc39 fix building/running with GTK+ 2.6 2016-08-31 10:22:52 -07:00
Paul Cornett
7986ccf039 Remove incorrect g_object_ref on wxMenuBar
Should probably have been removed as part of 9ff9d30 (r55288)
2016-08-31 10:12:49 -07:00
Paul Cornett
5d04f41d47 Save and restore GtkStyleContext in a few places that were not doing it
Does not fix any known problem, but seems prudent
2016-08-31 10:01:27 -07:00
Paul Cornett
1ba59a410f Remove run-time dependencies on GTK3 backends for Wayland, Mir, Broadway
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.
2016-08-31 09:39:25 -07:00
Lauri Nurmi
84969ba00d Prevent assignment to wxString::const_iterator from compiling
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
2016-08-27 17:51:37 +02:00
arata, mizuki
23527a5f81 Fix wxCHECK_VISUALC_VERSION macro to correctly detect VC14 2016-08-27 17:45:12 +02:00
Lauri Nurmi
394ce5f631 Add C++11-style cbegin, cend, etc. to wxString's iterator interface
These c-prefixed functions always return a const_iterator.
The full list of functions added: cbegin(), cend(), crbegin(), crend().

Closes https://github.com/wxWidgets/wxWidgets/pull/314
2016-08-25 18:54:05 +02:00
Artur Wieczorek
e68bd5a319 Fix compilation breakage due to missing FLT_MAX, FLT_MIN
Include <float.h> header file unconditionally.
2016-08-22 21:04:38 +02:00
samurajj
a93dcc531c Fix error reporting for wxCopyFile() under Unix
Check if copying file actually succeeded, any IO errors that could happen in
it were previously just completely ignored.

Closes #17638.
2016-08-22 14:17:43 +02:00
Artur Wieczorek
1222a9d769 Fix for PCH-less build for wxGDIPlusContext
Including <float.h> header is required for FLT_MAX, FLT_MIN.
2016-08-22 00:03:28 +02:00
Artur Wieczorek
92557dad1c Define REAL_MIN, REAL_MAX if GDI+ headers don't do it
This should fix compilation with MinGW.
2016-08-21 23:44:59 +02:00
Artur Wieczorek
d66ff48fb4 Add new tests to check clipping region with rotated wxDC/wxGCDC
See #17636.
2016-08-21 21:23:01 +02:00
Artur Wieczorek
acc57fccc7 Fix wxDC::Clear
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.
2016-08-21 21:22:05 +02:00
Artur Wieczorek
12eaa61930 Fix wxGCDC::Clear
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.
2016-08-21 21:03:17 +02:00
Artur Wieczorek
78f00da98a Fix wxGraphicsMatrix::TransformDistance for Direct2D implementation
Current transformation matrix without translation component should be used in calculations.
2016-08-21 21:01:52 +02:00
Artur Wieczorek
6ca5c894cd Add tests of setting clipping regions with wxGraphicsContext
The scope of tests corresponds to the scope of existing wxDC/wxGCDC tests. Additionally, newly introduced wxGraphicsContext::GetClipBox() function is tested too.
2016-08-21 21:00:13 +02:00
Artur Wieczorek
a29e6922cf Implement wxGraphicsContext::GetClipBox for Core Graphics 2016-08-21 20:58:56 +02:00
Artur Wieczorek
480a003c00 Add wxGraphicsContext::GetClipBox() function
This method returns bounding box of the current clipping region.
Added declaration, documentation and implemented for GDI+, Direct2D, Cairo renderers.
2016-08-21 20:57:40 +02:00
Gideon van Melle
1927a2f8a0 Update Dutch translations
Closes https://github.com/wxWidgets/wxWidgets/pull/313
2016-08-21 18:08:11 +02:00
Vadim Zeitlin
f9740e8180 Fix wxBitmap ctor from XBM in wxGTK
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.
2016-08-21 14:46:16 +02:00
Kolya Kosenko
3fe7be374d Fix wxSecretStore compilation in wxMSW UTF-8 build
We need to explicitly cast wxScopedWCharBuffer to TCHAR* before casting away
constness from it in this case, unfortunately.

Closes #17634.
2016-08-21 14:43:00 +02:00
Vadim Zeitlin
ec8d0c6e78 Fix recent compilation breakage by not using INT32_MAX
Apparently stdint.h doesn't define it on all platforms, even in 2016, so just
hardcode 2147483647 instead.

See #17629.
2016-08-20 00:12:06 +02:00
David Hart
34d39c9dfb Fix use of dangling reference in wxFileSystemWatcher Unix code
Don't reference the "watch" object after possibly destroying it when handling
IN_DELETE_SELF inotify notification.

Closes #17122.
2016-08-19 23:19:14 +02:00
David Hart
6537356236 Make failure to remove an inotify watch a warning
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.
2016-08-19 23:15:53 +02:00
Jeff Hostetler
534899baa2 Work around unwanted MacOpenFiles() calls in wxOSX applications
Don't try to open any command line arguments as files by using the workaround
from Colin Barrett (see https://bugzilla.mozilla.org/show_bug.cgi?id=366009).
2016-08-19 23:03:47 +02:00
brawer
7f10d1fa8a Add wxSYS_CARET_{ON,OFF,TIMEOUT}_MSEC system settings
Provide a way to retrieve the caret blink times from wxSystemSe and implement
it for wxOSX and wxGTK.

Closes #17629.
2016-08-19 22:55:20 +02:00
Andy Robinson
75e254fce7 Fix format specifiers used for size_t values in wxFileConfig
Fix assert failures when reporting errors in config files under 64 bit systems
where "%d" can't be used to output a "size_t" value.

Closes #17630.
2016-08-19 22:44:23 +02:00
Artur Wieczorek
c9a8dbedc8 Add a test of storing/restoring clipping regions with wxGraphicsContext.
See #17626.
2016-08-12 23:22:34 +02:00
Artur Wieczorek
d9193d5368 Fix saving/restoring drawing state for wxGraphicsContext with Direct2D
Native ID2D1RenderTarget::SaveDrawingState method stores in ID2D1DrawingStateBlock only transform, antialiasing mode, text-rendering options and tags but not currently set ID2D1Layers (which are used in wxD2DContext for clipping purposes). Therefore current stack of layers has to be stored "manually" alongside ID2D1DrawingStateBlock in a dedicated data structure (LayerData) in PushState() and restored also "manually" in PopState().

Closes #17626.
2016-08-12 23:16:09 +02:00
Vadim Zeitlin
7d9d5934b5 Document all the strings supported as menu accelerators
This wasn't documented anywhere until now, so copy the contents of the table
in src/common/accelcmn.cpp to the documentation to have them all in one place.
2016-08-10 22:58:14 +02:00
Scott Talbert
dbe2a1c2fd Fix wxNativeFontInfo::InitFromFont() when using Pango
Use pango_font_description_copy() to make a lossless copy of the original font
instead of doing it using wxWidgets API which is less direct and, in addition,
currently is completely broken as SetXXX() methods don't create the Pango font
description if it doesn't exist as they ought to.

Closes https://github.com/wxWidgets/wxWidgets/pull/312
2016-08-10 15:03:49 +02:00
Artur Wieczorek
b078e348b7 Fix minor typo in wxPGProperty documentation 2016-08-09 20:56:27 +02:00
Artur Wieczorek
c96aec4d44 Don't initialize variable twice 2016-08-09 20:54:47 +02:00
Artur Wieczorek
a1682a4568 Revert to the legacy implementation of setting clipping region given in device coordinates for WXOSX
Solution with full conversion from device to logical coordinates in wxGCDCImpl::DoSetDeviceClippingRegion doesn't seem to work under WXOSX (wxMacCoreGraphics) so we have to use for this port legacy implementation without full conversion of coordinates. Only offset of the origin is taken into account in this case (but not e.g. scale) but this should be enough for simple cases.

Closes #17609
2016-08-09 20:53:13 +02:00
Artur Wieczorek
e3be67a756 Add test of setting clipping region for transformed (rotated) wxGraphicsContext
See #17622
2016-08-09 20:49:58 +02:00
Artur Wieczorek
0f31e05cb8 Adopt clipping box tests for GTK+ 3 environment
1. Under GTK+ 3 wxDC is implemented as wxGCDC (with underlying Cairo renderer) and hence there is no need to test wxDC individually.
2. wxRegion is implemented under GTK+ 2 using GdkRegion but under GTK+ 3 it is implemented using cairo_region_t so some region attributes can be slightly different in some circumstances for both ports. This happens e.g. for non-rectangular regions which can have slightly different clip extents for GTK+ 2 and 3. We have to take this into account in the tests of non-rectangular clipping region and accept that actual clipping box position can differ of few pixels from expected position (so comparing clipping box positions shouldn't be exact but with some error tolerance).
2016-08-09 20:48:43 +02:00
Artur Wieczorek
c468dd67cb Fix setting rectangular clipping region for Direct2D
If transformation matrix of wxGraphicsContext with Direct2D renderer is e.g. rotated then rectangular clipping region represented by layer created with ID2D1RenderTarget::PushAxisAlignedClip is invalid because this kind of layers create axis-aligned clipping regions which edges are always horizontal or vertical (not e.g. rotated).
To take into account current transformation matrix when clipping region is set there is necessary to represent all clipping regions (even rectangular) by generic layers (ID2D1Layer) created with ID2D1RenderTarget::CreateLayer.

Closes #17622
2016-08-09 20:47:57 +02:00
Vadim Zeitlin
85c9e06a29 Remove wxGridTableMessage and wxGridStringTable documentation
This skeleton of documentation was replaced by (minimal but still more
valuable) real documentation in fcd5284aed but
the old classes were accidentally left in.
2016-08-09 01:12:32 +02:00
Vadim Zeitlin
1c4e20d870 Fix documentation of {From,To}DIP() overloads taking int
They were mistakenly using wxSize (already documented just above).
2016-08-09 01:10:24 +02:00
Vadim Zeitlin
985ff1e26e Check for self-assignment in wxArrayString
Assigning array to itself destroyed its contents -- check for this now.

Closes #17619.
2016-08-09 01:07:59 +02:00
Scott Talbert
3572c2c654 Fix the stop function of wxFontEnumerator for wxGTK
In a wxFontEnumerator, if false is returned from OnFacename() or
OnFontEncoding(), the enumeration is supposed to stop.  This was not happening
on wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/311
2016-08-08 14:06:42 +02:00
David Vanderson
e2a846e182 Fix correct screen DPI and not hard-coded 72 in wxOSX
Don't hard-code screen DPI as 72, use the real number instead (which is now
returned correctly, after the last commit).

Closes #17615.
2016-08-08 14:03:12 +02:00