Commit Graph

69056 Commits

Author SHA1 Message Date
Vadim Zeitlin
9c2cf91223 Don't remove const-ness using C-style cast
Avoid another -Wcast-qual from gcc.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9c48b0e8e7 Remove redundant wxSetCursor() declarations
Avoid -Wredundant-decls from gcc by not duplicating the declaration from
wx/gdicmn.h in wx/*/cursor.h.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9206a9de00 Remove trailing semicolon from wxDFB_DECLARE_INTERFACE()
This avoids -Wpedantic warnings when a semicolon is used after it.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
dca6f310bb Replace C-style cast with const_cast<> in wxUniv
Don't use C casts to remove const-ness (avoids gcc -Wcast-qual).
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
ca7fcfe9c3 Add wxGCC_ONLY_WARNING_{SUPPRESS,RESTORE} macros
When the original wxGCC_WARNING_SUPPRESS was added, clang understood all
gcc warnings, so it made sense to also apply it when building with
clang, but recent gcc versions have added warnings not available in
clang any more, so we now need a macro for disabling warning the
warnings for gcc only.

Perhaps we should rename the existing wxGCC_XXX macros to use
wxGCC_OR_CLANG prefix.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
266c3a962f Disable -Winline as we can't ensure all functions are inlined
It doesn't really make sense to enable this for C++ code, with a lot of
implicitly inline functions.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
1861065ef2 Disable -Wformat in system headers
This is given for the use of %zu by gcc 5.4.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
3c628138f5 Suppress bogus -Wnoexcept from gcc9 in wx/graphics.h
Due to what looks like a bug, gcc 9.3.0 gives the following incomplete
error message without it:

include/wx/graphics.h:278:7: error: but
‘wxGraphicsGradientStop::wxGraphicsGradientStop(wxGraphicsGradientStop&&)’
does not throw; perhaps it should be declared ‘noexcept’
[-Werror=noexcept]

(without any other diagnostics).
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
7d74df9a03 Add wxNOEXCEPT to the hash structs operator() declarations
gcc 9 gives -Wnoexcept for these operators and, apparently, not making
them noexcept prevents some optimizations in the standard library
implementation of unordered_foo<>, so do add it.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
831979ead1 Suppress gcc -Wctor-dtor-privacy in wx/strvararg.h
Helper structs declared in this header intentionally define their ctor
as private, avoid gcc complaints about it.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
2f605badf3 Fix g++ 4.8 -Wshadow for parameter/function conflicts
Unlike the later versions, g++ 4.8 produces a -Wshadow when the name of
a parameter is the same of the name of a method, so rename the (private)
parameters to avoid this.
2020-08-31 01:25:07 +02:00
Vadim Zeitlin
23334af81b Test headers compilation with maximum warnings options with gcc
As wx headers are included from user applications which may compile with
higher warning level than wx itself, try to check headers compilation
with almost all of gcc warning flags turned on.

This notably should prevent the headers from becoming uncompilable with
-pedantic again in the future.
2020-08-31 01:24:57 +02:00
Vadim Zeitlin
1ec571fb64 Avoid -Wshadow warnings when using multiple wxCHECK()s
If the same function used any of macros from wxCHECK() family more than
once, wxDummyCheckStruct was redeclared, resulting in -Wshadow warnings
from gcc.

Fix this by using unique names for the dummy macro.
2020-08-25 17:37:25 +02:00
Vadim Zeitlin
054d98b1df Fix -Wpedantic in wxDECLARE_ABSTRACT_CLASS()
Fix a regression introduced in c924ecb10a (Suppress -Wsuggest-override
warnings in user code for gcc too, 2020-07-27) and rearrange the macro
to make sure a semicolon is necessary after it.

Closes #18901.
2020-08-25 17:36:02 +02:00
Vadim Zeitlin
30fc873626 Remove useless hdrstop pragma from allheaders test
It shouldn't be necessary for a test not using PCH at all and Borland
compiler is almost certainly not supported anyhow any longer.
2020-08-25 16:54:23 +02:00
Vadim Zeitlin
c1d3e65ac4 Merge branch 'wine-heap-fix'
Wine heap fix and other global memory-related cleanup.

See https://github.com/wxWidgets/wxWidgets/pull/2030
2020-08-24 00:18:57 +02:00
Vadim Zeitlin
3df9d772a4 Merge branch 'display-ppi-from-scaling-factor'
Determine display DPI from scaling factor instead of trying to compute
it from the physical display dimensions.

See https://github.com/wxWidgets/wxWidgets/pull/2015

Closes #18855.
2020-08-24 00:14:27 +02:00
Vadim Zeitlin
1bf76ee594 Add a safety check for the buffer size in wxIDataObject
Avoid size overflow if the offset value is greater than it.
2020-08-22 23:48:58 +02:00
Paul Cornett
3f9884817d Allow wxButton to show explicitly set bitmaps regardless of theme setting with GTK3
See #18874
2020-08-22 11:18:48 -07:00
Vadim Zeitlin
75ad798d8b Use GlobalPtrLock instead of manual GlobalUnlock() calls
Make the code safer and shorter by using RAII wrapper instead of manual
Global{Lock,Unlock}() calls.

No real changes.
2020-08-22 19:45:19 +02:00
Vadim Zeitlin
0d7be7c189 Use GlobalPtrLock instead of manual Global{Lock,Unlock}() calls
Also add GlobalPtrLock::GetSize() and use it instead of calling
GetSizeFromBuffer() as it's more direct and doesn't require the use of
::GlobalHandle().
2020-08-22 19:45:19 +02:00
Vadim Zeitlin
aadfaada7a Fix crash when using custom DnD formats under Wine
Using ::HeapSize() on a global pointer is wrong, and even though it
somehow still works under "genuine" MSW, it crashes under Wine.

Fix this by using ::GlobalSize() instead, which is the right function to
use with this kind of pointer.

Thanks to Damjan Jovanovic for the analysis of the problem in Wine
bugzilla (see https://bugs.winehq.org/show_bug.cgi?id=38924#c10).

Closes #18887.
2020-08-22 19:45:19 +02:00
Vadim Zeitlin
93c580ccaf Don't mangle ampersands in wxToolBar tooltips under MSW
Preserve the ampersands in the string, which is consistent with wxGTK
behaviour and less surprising than the default behaviour, which creates
mnemonics in the tooltips that are, of course, perfectly useless, as
they can't be activated from keyboard anyhow.

Turn on TTS_NOPREFIX, which is already used by wxToolTip, to fix this.

Closes #18899.
2020-08-22 18:49:25 +02:00
Václav Slavík
adb7c8a53d cfstring.h compilation fix for ARC builds 2020-08-22 16:46:27 +02:00
Vadim Zeitlin
ff3cb34d18 Add a unit test for using bitmaps with image and empty label
This used to be broken, see #18898, and now that it is fixed by
5a70051c7e (Avoid assertion failure in wxButton with bitmap and empty
label, see #18898, 2020-08-21) add a unit test so that it stays fixed.
2020-08-21 20:21:17 -07:00
Paul Cornett
5a70051c7e Avoid assertion failure in wxButton with bitmap and empty label, see #18898 2020-08-21 08:43:50 -07:00
Vadim Zeitlin
58456523b5 Merge branch 'dpi-misc' of https://github.com/MaartenBent/wxWidgets
Miscellaneous DPI Improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2025
2020-08-21 02:44:07 +02:00
KT
b50aca9596 Inherit art provider in wxAuiFloatingFrame by default
Use the same art provider for a floating frame detached from an existing
wxAuiManager as was used by the original wxAuiManager itself, to ensure
that the appearance of this frame is consistent with the appearance of
its parent.

Implementing this required adding wxAuiDockArt::Clone() to allow copying
it in the new frame and this patch also adds GetAuiManager() to
wxAuiFloatingFrame, similar to the existing method in wxAuiNotebook, in
order to allow changing the dock art from the application code if
desired.

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

Closes #18882.
2020-08-21 02:43:28 +02:00
Vadim Zeitlin
126c976f5b Merge branch 'taskbar-icon-get-menu'
Add wxTaskBarIcon::GetPopupMenu() allowing to avoid recreating the menu
every time.

See https://github.com/wxWidgets/wxWidgets/pull/2020
2020-08-21 02:42:13 +02:00
Vadim Zeitlin
d8c308a4e0 Merge branch 'wxrc_flavour' of https://github.com/ardovm/wxWidgets
Append WX_FLAVOUR to the name of wxrc executable.

See https://github.com/wxWidgets/wxWidgets/pull/2013
2020-08-21 02:40:55 +02:00
Vadim Zeitlin
8c9ba23eae Merge branch 'string-art-ids'
Make the wxART_* constants const wxStrings to improve compatibility with
pre-3.1.4 code and, in particular, allow taking the address of these
constants.

See https://github.com/wxWidgets/wxWidgets/pull/1996
2020-08-21 02:39:12 +02:00
Maarten Bent
8cb0d0741c Don't iterate all item of wxListCtrl on DPI change
This can take multiple seconds in big lists, meanwhile the UI is frozen at the
display border. Adjust the font of the attribute to the DPI when it is used for
drawing.
2020-08-19 21:35:49 +02:00
Maarten Bent
c661be4fc9 Make custom renderer in dataview sample DPI Aware 2020-08-19 21:35:49 +02:00
Maarten Bent
6f7f387b1b Use GDI Scaling for dpi-unaware system dialogs
Fall back to system scaling when GDI scaling fails or is unavailable.
2020-08-19 21:35:48 +02:00
Paul Cornett
5192feb38e Fix restoring TLW size when using wxPersistenceManager on GTK
The decoration size must be restored before restoring the window size
See #18863
2020-08-18 08:46:19 -07:00
Arrigo Marchiori
a63ef850fb Also mention --flavour in wx-config script
The parameter is already supported but not documented.
2020-08-18 15:47:33 +02:00
Vadim Zeitlin
d5f5376e95 Remove useless "Modified by:" header line
This is not needed nor used since a long time any longer.
2020-08-17 02:04:59 +02:00
Vadim Zeitlin
8e1f2adc3b Add wx/artids.h to build/files and rerun upmake and bakefile
Finish adding the new file, which was previously added manually to a
couple of files, but not everywhere.
2020-08-17 02:03:45 +02:00
Vadim Zeitlin
21b37aa88e Add ctor to wxArtStockMapping to fix C++98 build
Can't use aggregate initialization without C++11.
2020-08-17 02:01:11 +02:00
Vadim Zeitlin
b6a369bd86 Remove trailing blank line from the new wx/artids.h file
No real changes.
2020-08-17 01:58:45 +02:00
Vadim Zeitlin
ae1bcc5cb2 Show only the first difference when images differ in the tests
The code was supposed to do this, but didn't, as "break" only broke from
the inner loop, but not the outer one, so replace it with "return".
2020-08-15 16:16:45 +02:00
Vadim Zeitlin
5324b9f184 Update libtiff and expat to allow using them with CMake
These changes are required in order to use the built-in versions of
these libraries with CMake.
2020-08-15 15:42:25 +02:00
Vadim Zeitlin
41142dff20 Make a minor optimization in Mac wxDisplay::GetFromWindow()
Call GetContentScaleFactor() only once, which doesn't cost anything and
could be minutely faster on systems with multiple displays.
2020-08-15 00:28:32 +02:00
Stefan Csomor
08a63c3b49 use common contentScaleFactor also for DPI on macOS
and give a reasonable default for missing tlw
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
c346fd0321 Show scale factor in the display sample too
Show it for consistency with all the other wxDisplay accessors and to
make it simpler to test its return value.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
434faa39e6 Remove unused wxDisplayImpl::GetSizeMM()
This is not needed any longer after the changes of the last commit.

Note that the (still existent) public wxGetDisplaySizeMM() didn't use
this function, but used PPI instead.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
bcb101b9e9 Simplify PPI and scale factor handling in wxDisplay
Don't try computing the PPI ourselves from the physical size and the
number of pixels, this doesn't work and nobody else does it like this.

Just assume that we're using standard PPI by default and use
toolkit-specific functions for the platforms with support for high DPI.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
4e6df3f7b2 Implement GetDPIScaleFactor() more directly for wxMSW too
Use the existing GetDPI() implementation instead of forwarding to
wxDisplay.
2020-08-15 00:28:32 +02:00
Vadim Zeitlin
6a820a8f9a Implement GetDPIScaleFactor() more efficiently in wxGTK
Don't pass via wxDisplay, but use gtk_widget_get_scale_factor() (almost)
directly instead.
2020-08-15 00:28:32 +02:00
Stefan Csomor
99f7c8f3a4 using common method for determining scale from displayID 2020-08-15 00:28:32 +02:00