Commit Graph

71396 Commits

Author SHA1 Message Date
Scott Talbert
c315359c72 Fix linking issues with wxGLCanvasEGL for autoconf
1) Link with the wayland-egl library, but do so only if we determine that we
have Wayland support in the GDK backend with a compile test.
2) Provide a way to force disable the EGL backend.
2020-09-12 15:54:15 -07:00
Stefan Csomor
bc9e7b71e7 macOS wxNativeFontInfo changes (#2045)
* adding native font descriptor serialization = v2

* remove common xml prefix from serialized string

* Update src/osx/carbon/font.cpp

Co-authored-by: VZ <vz-github@zeitlins.org>

* Update src/osx/carbon/font.cpp

Co-authored-by: VZ <vz-github@zeitlins.org>

* static string via accessor

* striping off xml preamble unconditionally

if we use a different format in the future, we will have to increase our version number

* applying italic directly to the font descriptor

thus preserving attributes in the native font descriptor which we don’t store explicitly yet

* Adding support for preserving font width

Although we don’t express this in the public API yet, we try to preserve eg condensed, when changing the font width

* Adding reference, bug fix

double checked the font weight constants,

Co-authored-by: VZ <vz-github@zeitlins.org>
2020-09-12 19:29:26 +02:00
Robin Dunn
16ab09208f Add missing dock art Clone methods 2020-09-10 12:39:05 -07:00
Ian McInerney
b4a50b1ea7 Document return types in wxAuiToolBarItem better
These functions return only specific flags inside an integer,
so in order to use the functions we need to know the flags.

Fixes #14972
2020-09-04 18:25:41 +01:00
Ian McInerney
55f80941bf Mention that wxFD_OVERWRITE_PROMPT is always enabled on OSX
This style is ignored on OSX because there is no way to disable
the overwrite prompt from showing.

Fixes #13541
2020-09-04 18:25:41 +01:00
Vadim Zeitlin
c2b1dbda83 Call GDK functions from main thread in wxGStreamerMediaBackend
This fixes another problem similar to the one fixed in be1854c617 (Avoid
UI functions in non-main thread in wxGStreamerMediaBackend, 2020-09-02)
and does it in a similar way: SetupXOverlay(), which calls gdk_flush(),
was called from gst_bus_sync_callback() which is executed in the worker
thread, so use CallAfter() to call it from the main thread later.
2020-09-02 23:24:05 +02:00
Vadim Zeitlin
e4333fdeac Fix recurrent typo in "usable"
This word has a single "e".
2020-09-02 20:49:39 +02:00
Vadim Zeitlin
bf71a70a12 Merge branch 'updateui-ischeckable'
Add a flag to wxUpdateUIEvent to tell if the item supports the check
action.

See https://github.com/wxWidgets/wxWidgets/pull/2027
2020-09-02 19:34:05 +02:00
Vadim Zeitlin
7be693212c Improve documentation of wxUpdateUIEvent::IsCheckable()
Explain when this method can be useful.
2020-09-02 19:33:39 +02:00
Vadim Zeitlin
1db3751235 Merge branch 'macos11-preferences' of https://github.com/vslavik/wxWidgets
Update wxPreferencesEditor to add support for macOS 11.

See https://github.com/wxWidgets/wxWidgets/pull/2040
2020-09-02 19:26:41 +02:00
Vadim Zeitlin
eb8c48a481 Merge branch 'macos11-fix-ui-fonts-handling' of https://github.com/vslavik/wxWidgets
Fix system UI font handling on macOS 11.

See https://github.com/wxWidgets/wxWidgets/pull/2034
2020-09-02 19:24:26 +02:00
Scott Talbert
be1854c617 Avoid UI functions in non-main thread in wxGStreamerMediaBackend
In aa2cd42206 (Report video size changes to the media backend,
2016-02-22), a couple of calls to NotifyMovieSizeChanged() were added,
presumably for a good reason.  Unfortunately, NotifySizeChanged() makes
UI calls on wxGTK, so this resulted in UI calls happening on a non-main
thread because many of GStreamer's callbacks occur on arbitrary threads.
This is bad because it caused random X11 crashes.

Fix this by calling NotifyMovieSizeChanged() with CallAfter().

Closes https://github.com/wxWidgets/wxWidgets/pull/2042
2020-09-02 19:22:46 +02:00
Jouk
1ce2ab5d49 Add definition of wxUSE_GLCANVAS_EGL 2020-09-02 07:46:25 +02:00
Paul Cornett
05a134d985 Build fix for GDK_WINDOWING_WAYLAND not defined
Add some missing GDK_WINDOWING_WAYLAND wrappers.
Also some minor changes to includes.
2020-09-01 08:14:58 -07:00
Vadim Zeitlin
5dd3b733bd Test building without 3.0 compatibility on Travis CI too
This will test errors like the one fixed by the previous commit by
testing that samples and tests still build without 3.0 API.
2020-09-01 15:07:31 +02:00
Vadim Zeitlin
0a053580c0 Use wxEVT_GRID_RANGE_SELECTED instead of deprecated SELECT
Fix building the tests with WXWIN_COMPATIBILITY_3_0 disabled.
2020-09-01 15:04:39 +02:00
Scott Talbert
7cd12a2bd6 Add EGL-based backend for wxGLCanvas
Among other things, this enables wxGLCanvas to be used natively on
Wayland.

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

Closes #17702.
2020-09-01 15:03:30 +02:00
Vadim Zeitlin
ed4b9e5f97 Merge branch 'mac-native-focus-ring' of https://github.com/vslavik/wxWidgets
Draw wxTextCtrl focus ring natively on Mac.

Add wxWindow::EnableVisibleFocus() to explicitly control the focus ring
visibility if necessary.

See https://github.com/wxWidgets/wxWidgets/pull/2037
2020-09-01 14:59:42 +02:00
Rob McKay
94e8129f3f Explicitly specify application class in wxiOS
Although @"UIApplication" is supposed to be used by default anyhow,
passing "nil" is reported to result in an assertion failure in
'_UIApplicationGetPrincipalClass' when running under the iOS 13.1
simulator, so pass this string explicitly.

Closes https://github.com/wxWidgets/wxWidgets/pull/2035
2020-09-01 14:57:29 +02:00
Stefan Brüns
b8a4b96243 Create underlying bitmap for caret when it is explicitly created
wxCaret::Create implies a size change, so call DoSize to initialize
the underlying wxBitmap.
2020-08-31 16:49:21 +02:00
Stefan Brüns
d87abd132e Do not try to create bitmap for default constructed Caret
If a Caret is default-constructed, the width and height are still 0,
and the wxBitmap::Create implementations expect valid sizes.

The same applies for the bitmap after a size change.
2020-08-31 16:45:47 +02:00
Vadim Zeitlin
b9f946fcd3 Merge branch 'check-headers-max-warn'
Check compilation of all wx headers with all gcc warnings enabled.

This should make it impossible to introduce problems that only appear
when -Wpedantic or -Wany-other-not-completely-unreasonable-warning is
enabled when building user code including wx headers again.

See https://github.com/wxWidgets/wxWidgets/pull/2033
2020-08-31 15:10:16 +02:00
Arrigo Marchiori
629c4aac97 Add EXEEXT to the wxrc versioned executable
Fix name of wxrc executable when cross-compiling from Unix.

Note that the Makefile hasn't been rebaked after the changes of
f3bd129568 (Append WX_FLAVOUR to the name of wxrc executable,
2020-08-06), so this commit reflects the changes to wxrc.bkl from both
that commit and this one.

Closes https://github.com/wxWidgets/wxWidgets/pull/2041
2020-08-31 14:59:39 +02:00
Vadim Zeitlin
be2a61519b Merge branch 'grid-selected'
Split the wxGrid RANGE_SELECT event into separate SELECTING and SELECTED
events.

See https://github.com/wxWidgets/wxWidgets/pull/2028
2020-08-31 14:55:56 +02:00
Vadim Zeitlin
d41539ef05 Merge branch 'fix-grid-resizing'
Fix bugs in wxGrid mouse handling and simplify the code.

See https://github.com/wxWidgets/wxWidgets/pull/2018
2020-08-31 14:53:37 +02:00
Vadim Zeitlin
82f7cb6e9b Merge branch 'art-ids-literals'
Revert art ids changes and make them `char*` literals again.

See https://github.com/wxWidgets/wxWidgets/pull/2031
2020-08-31 14:51:52 +02:00
Ian McInerney
7f7a0bfa81 Fix documentation for wxSYS_COLOUR_INACTIVECAPTIONTEXT
Just s/active/inactive/ in the description.

Closes https://github.com/wxWidgets/wxWidgets/pull/2039
2020-08-31 14:49:45 +02:00
Václav Slavík
8efc6fb003 Add wxWindow::WXAdjustFontToOwnPPI()
Avoid calling GeTDPI() in font.WXAdjustToPPI(GetDPI()); invocations in
common code on platforms that don't need any adjustment (i.e. anything
other than MSW).

This fixes wxOSX crashes when GetFont() is called too early during
window creation, but is the right thing to do regardless.

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

Closes #18903.
2020-08-31 14:45:02 +02:00
Vadim Zeitlin
2a17eef2ed Pre-include even more standard headers with MinGW/Cygwin
Avoid -Wredundant-decls when including them later by pre-including them
before enabling this warning.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
8b7ddbd0ac Use wxOVERRIDE for wxStackWalker and wxStackFrame in wxMSW
Thanks gcc for -Wsuggest-override.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
03bc49de2d Include <windows.h> before enabling all the warnings
This avoids tons of -Wredundant-decls and -Wnon-virtual-dtor (given for
all OLE interfaces).
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
6f9390306d Disable -Wsuggest-final-xxx in the headers for now
We don't use "final" in our code, as very few classes in wx code have
virtual functions but are not meant to be derived from in the user code.

Ideal would be to check the existing warnings and maybe apply "final" if
it's relevant and disable it otherwise, as these warnings can be useful
to build the application code with, but for now just disable them in the
test suite.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
3fc5d134a3 Suppress strange -Wunsafe-loop-optimizations in wxString code
The error message

wx/string.h:558:47: error: missed loop optimization, the loop counter may overflow
                    [-Werror=unsafe-loop-optimizations]
       for ( Cache::Element *c = cacheBegin; c != cacheEnd; c++ )
                                             ~~^~~~~~~~~~~

doesn't seem to really make much sense, as it shouldn't overflow here.
2020-08-31 12:40:50 +02:00
Vadim Zeitlin
a535d2c64d Suppress -Wnull-dereference in wxString::GetCacheElement()
It doesn't seem to be really possible here.
2020-08-31 12:40:50 +02:00
Václav Slavík
9c5abea266 Don’t add non-default focus ring to NSTextView
NSTextView does not natively show a focus ring by default, and it is
extremely rare thing to do in native applications.

Don't do it in wxTextCtrl either.
2020-08-31 10:38:59 +02:00
Václav Slavík
9f66b03c5c Allow configuring visible focus on Mac
Add wxWindow::EnableVisibleFocus() for changing focus ring behavior on
macOS (currently not implemented elsewhere, although GTK+ has a
discouraged option to do it).
2020-08-31 10:38:59 +02:00
Vadim Zeitlin
24914ec7df Suppress unavoidable -Wformat-literal in wx[F]printf()
Disable gcc format string checks inside these functions.
2020-08-31 01:26:04 +02:00
Vadim Zeitlin
36c5884acb Generalize WX_ATTRIBUTE_PRINTF to WX_ATTRIBUTE_FORMAT
Allow applying gcc "format" attribute to other functions and do apply it
to wxStrftime().

Also suppress -Wformat-nonliteral inside wxStrftime() itself, as it's
now supposed to be checked when calling it.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
7352a2879c Rename Qt-specific GetEventType() to start with "Qt" prefix
This avoids conflicts with another method with the same name defined in
generic wxGenericFileDirButton, which must neither override nor hide
this method of wxButton.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
9f63592eba Remove unnecessary wxBitmap copy ctor from wxQt
This ctor is not needed as the inherited wxObject ctor is sufficient and
defining it but not operator=() explicitly results in -Wdeprecated-copy
from gcc 10.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
19bc293086 Remove extraneous semicolon in wx/qt/menuitem.h
Avoid -Wpedantic from gcc.
2020-08-31 01:25:45 +02:00
Vadim Zeitlin
3bbefcdd74 Don't trigger warnings in standard headers when building wxQt
Pre-include QFont header in wxQt to avoid warnings for the other headers
included from it.
2020-08-31 01:25:45 +02:00
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