Commit graph

20196 commits

Author SHA1 Message Date
Vadim Zeitlin
0ef1cdcc21 Remove support for wxMotif
This port hasn't been updated for ages and is not used by anybody any
longer, so remove its code to facilitate maintenance.

Also remove references to this port from the documentation and most of
the other places (VMS-specific descrip.vms files still check for it
because it's not clear how to update them all), including configure.

Regenerate the latter and rebake all makefiles.

Finally document that this port is not available any longer.
2022-10-16 16:39:56 +02:00
Vadim Zeitlin
ecf321924e Merge branch 'cxx11'
Require C++11 compiler and start using some C++ features in the code.

See #22684, #22854.
2022-10-15 18:14:55 +02:00
Vadim Zeitlin
d4ced54755 Merge branch 'msw-double-buffer'
Enable double buffering by default for all windows in wxMSW.

See #22851.
2022-10-15 17:12:11 +01:00
PB
88d526660f Replace wxOVERRIDE and wxNOEXCEPT with override and noexcept
Don't use deprecated macros in wxWidgets itself.
2022-10-15 18:10:45 +02:00
Vadim Zeitlin
86348a9d28 Stop testing for pre-standard hash map/set classes
Always use std::unordered_{map,set} when we use them at all, don't
bother with checking for their availability and with tr1 or even older
alternatives.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
a0ae0cd316 Use <type_traits> unconditionally
Don't use or even mention tr1/type_traits any more.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
583a426a37 Use std::string::compare() unconditionally
Don't test for it in configure/CMake and just always use it.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
0a387693c6 Use std::wstring unconditionally
Don't test for its existence in configure and CMake and don't use
wxStdWideString in the code.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
eb97bf90e4 Remove custom wxVector implementation
Always use std::vector<>, we don't support platforms not providing the
standard library classes any longer.
2022-10-11 00:45:30 +02:00
Vadim Zeitlin
f99e02267a Remove our own implementation of std::is_convertible
Just use the standard trait instead.
2022-10-11 00:25:27 +02:00
Vadim Zeitlin
b83178086d Use wxVector::shrink_to_fit() directly
Don't use deprecated wxShrinkToFit() as now wxVector always has this
member function because it is available even in STL build when using
C++11.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
dd404fdd77 Remove HAVE_STRTOULL and HAVE_WCSTOULL
We can assume these functions are always available now as they are part
of C++11.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
924db833f4 Require MSVS 2015+ and remove checks for earlier versions
Simplify the code checking for _MSC_VER or __VISUALC__ or using
wxCHECK_VISUALC_VERSION() macro (which is not very useful any longer,
but keep it in case we need it again in the future).
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
7ee8ea2d5b Update wxMSW-specific options in wxUniv setup.h
This section of the file wasn't updated when rerunning update-setup-h,
add the missing line to it and commit the results of rerunning it.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
824f7e63f2 Stop using obsolete wxW64 macro
Still define it for compatibility, but at least don't use it in our own
code.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
e1d63e5629 Add an explicit check for gcc version
This doesn't cost much and might be helpful to people accidentally using
an ancient compiler version.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
23a57b981f Remove checks for gcc <= 4.8 and always assume it's 4.8+
Previous versions don't provide C++11 support which is required now
anyhow and so can't be used any longer.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
1e26cbfcaf Always set wxUSE_GRAPHICS_CONTEXT to 1 by default
Don't bother with compiler and gcc version check, all compilers should
provide GDI+ headers/libraries by now.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
6bbfdb157e Check that C++11 is available and remove tests for it
Don't bother checking for various C++11 features that are available in
all C++11 compilers.

Also assume that std::exception_ptr is available in all still supported
MinGW versions and remove checks for it too (see #16634).

Further simplifications remain possible, this is just the first step.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
73869d37fd Always use variadic macros and remove wxNO_VARIADIC_MACROS
Variadic macros are always available in C++11, which will be required
very soon, so don't bother testing for them and just always use them.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
0f2b8a2065 Move Cygwin __USE_W32_SOCKETS definition to wxMSW-specific file
Don't do this in wx/defs.h itself.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
635ec6c2af Remove 20+ years old workaround for gcc under HP-UX
This is almost surely not necessary any longer as the version of gcc
that must have needed that is no longer supported.
2022-10-11 00:02:29 +02:00
Lauri Nurmi
fc499810ce Use wxChoice for month selection in wxGenericCalendarCtrl
For no obvious reason the generic calendar control used
a read-only wxComboBox until now.

While this is more or less identical to a wxChoice on MSW,
it is somewhat different on OSX and Gtk: Whereas a wxChoice
can be opened by clicking anywhere on it, a wxComboBox requires
clicking on the arrows on the right edge. A wxComboBox
allows selecting and copying the current value, but this is
probably not terribly useful in a calendar.

See #22853.
2022-10-09 23:57:57 +02:00
Vadim Zeitlin
fcc7430610 Set wxALWAYS_NATIVE_DOUBLE_BUFFER to 1 to wxMSW too
Double buffering is always used in wxMSW after the last commit, so there
is no need to implement double buffering in our own code there any more.

This also means that only wxMotif and wxGTK1 don't have native double
buffering now, so flip the direction of the check and test for them only
(which will make removing support for them simpler).
2022-10-06 02:20:27 +01:00
Vadim Zeitlin
179629205d Allow passing NULL to wxWindow::CreateUsingMSWClass()
Instead of calling GetMSWClassName() in wxWindow::Create() itself, just
use NULL there and interpret this as meaning to use the default wxWindow
class in CreateUsingMSWClass(), as it will allow it to distinguish
between creating generic windows and native controls.

No real changes yet.
2022-10-06 02:17:48 +01:00
Vadim Zeitlin
30f30ff946 Add wxComboBox::MSWRecreate() and use it from wxBitmapComboBox
No real changes, this is just a refactoring moving the code recreating
the native MSW combobox into wxComboBox itself, as it seems better to do
this in this class itself rather than outside of it.

This commit is best viewed with Git --color-moved option.
2022-10-05 23:47:09 +01:00
Vadim Zeitlin
b03cb010ca Merge branch 'ThreadCleanUp' of https://github.com/nietsu/wxWidgets
Fix memory leak when creating new wxThreads.

See #22840.
2022-10-05 00:39:59 +02:00
Tobias Taschner
0ace9894c7 Queue wxWebViewEdge events to avoid difficult to debug bugs
Using HandleWindowEvent() from the WebView2 event callbacks
is a common error source when user code does something blocking
like RunScript() or ShowModal().
Queue the events to prevent this where possible, in
wxEVT_WEBVIEW_NAVIGATING at least warn the developer instead
of hanging silently.

Closes #22834, #22744, #19075
2022-10-05 00:33:30 +02:00
Vadim Zeitlin
2d3da75cf2 Update TLW icon when the DPI changes in wxMSW
While we selected the icon of the size most appropriate for the current
DPI when the window was created, we didn't update the icon later if the
DPI changed as we should, so do it now.

Note that we abuse the existing MSWUpdateFontOnDPIChange() to make it
simple to backport this fix to 3.2 without breaking the ABI.

See #22807, #22831.
2022-10-05 00:32:33 +02:00
Vadim Zeitlin
4d9131d2ec Drop wxThread::CallEntry() and clean up in platform-specific code
Calling wxThreadSpecificInfo::ThreadCleanUp() in CallEntry() was
premature as thread-specific info could be recreated later, e.g. due to
any wxLogXXX() call, so don't do it there, but do it in the
platform-specific code just before exiting the thread.

As this renders CallEntry() useless, remove it entirely.
2022-10-03 19:24:51 +02:00
Vadim Zeitlin
7897253304 Initialize members in wxFDIOHandlerEntry ctor
This avoids -Wuninitialized gcc warnings in wxFDIOHandlerMap expansion
when using -Og optimization level: apparently it is enough to enable
this warning but not enough to discard the function which doesn't seem
to be actually used (as it doesn't result in this warning in a really
optimized build).
2022-10-02 01:32:40 +02:00
Michael Kirkham
6a10e048f9 Define GDK_KEY_LaunchX to fix build with GTK < 2.21.8
Use the old names for these keys too for compatibility with the really
old GTK versions, just as we already did for a bunch of other ones.

This should have been done in 61d835d8b3 (wxKeyCode: add
WXK_LAUNCH_[0-9A-F] for gtk bindings, 2021-11-01), see #2575, but was
forgotten there.

Closes #22830.
2022-09-30 15:34:28 +02:00
Vadim Zeitlin
ee1e638579 Merge branch 'dont-disable-depr-warnings'
Don't disable deprecation warnings in wxGTK build globally but avoid or
disable them in all places where they occur.

See #22821.
2022-09-30 15:32:52 +02:00
Manolo-ES
e11ea1b737 Fix creating wxGLCanvas with NULL attributes list
Using NULL attributes list was not the same as using default
wxGLAttributes, but used a platform-dependent set of attributes that was
traditionally used by old wxWidgets versions for compatibility.

However these attributes didn't specify some important attributes,
notably depth buffer size, and relied on OpenGL driver using some
reasonable defaults, but this turns out to not be the case any more and
resulted in not enabling depth buffer at all, see #22787.

Fix this by using the same default attributes as were already used by
wxGLAttributes::Defaults() in this case, as this is much more useful,
even if not 100%-compatible with the old behaviour.

See #22828.
2022-09-28 23:59:31 +02:00
Vadim Zeitlin
d1f18ecca6 Refactor the code to use wxEGLUpdatePosition()
No real changes, just add a helper function and call it instead of using
m_wlSubsurface directly.

This has the advantage of reusing the same code as in CreateSurface()
and also avoids making m_wlSubsurface public unnecessarily, as was done
in the parent commit.
2022-09-24 23:28:01 +02:00
Carl Hetherington
800d6ed69b Update subsurface position when a GL canvas is sized.
This fixes problems with OpenGL canvases being in rendered in
the wrong place on Linux/Wayland.

See #22811.
2022-09-24 23:26:13 +02:00
Vadim Zeitlin
c8af0a3b71 Don't give warnings when implementing deprecated classes
Check for WXBUILDING when defining wxDEPRECATED_EXPORT_CORE() and don't
actually include the "deprecated" part in this macro when building wx
itself to avoid warnings during the build (which are suppressed when
building wxGTK3 but not the other ports).

This should have been part of 2d939a3665 (Add wxDEPRECATED_EXPORT_CORE()
macro for wxTransformMatrix, 2022-09-18), see #22790.

This commit is best viewed ignoring whitespace-only changes.

See #22820.
2022-09-24 15:09:37 +02:00
Vadim Zeitlin
630f9c5ad2 Avoid deprecation warnings for gdk_cairo_create()
We have to use this function for wxWindowDC implementation and setting
drag-and-drop icons, even though it is deprecated, as this API can't be
implemented otherwise, so suppress the deprecation warnings about doing
it.

Also include the private GTK header in the Cairo wxGraphicsContext
implementation just to avoid the deprecation warnings there too.
2022-09-23 01:43:21 +02:00
Vadim Zeitlin
affbd46356 Add RAII wxGTKImpl::CairoContext helper and use it
Ensure that cairo_destroy() is automatically called from this class dtor
instead of having to remember to call it manually.

No real changes.
2022-09-23 01:43:10 +02:00
Vadim Zeitlin
dbdcf8fb91 Avoid deprecation warnings for gdk_threads_enter/leave()
Use wrapper functions just to avoid the warnings for them, as we want to
keep calling them for compatibility, even if the functions are
deprecated in GTK since a very long time.
2022-09-23 01:43:10 +02:00
Vadim Zeitlin
0922873cf1 Add wxGDKThreadsLock helper class
Don't call gdk_threads_enter/leave() manually but use a RAII helper.

No real changes.
2022-09-23 01:43:10 +02:00
Vadim Zeitlin
cc973ab0e2 Add wrappers to minimize the differences between GTK 2/3/4
The new wx_gdk_device_get_window_at_position() can be used instead of
gdk_window_at_pointer() without, or with reduced number of, GTK version
preprocessor checks, while wx_get_gdk_device_from_display() is needed to
call it anyhow and also allows to avoid differentiating between GTK 3
and 4 in another place.
2022-09-23 01:43:10 +02:00
Vadim Zeitlin
7d635dfc17 Stop using gdk_flush()
We don't need to flush all the displays, do it just for the one we're
working with, which seems to be relatively important when we do it in
every call to gtk_window_motion_notify_callback() (while there is a
mouse capture).
2022-09-23 01:43:10 +02:00
Vadim Zeitlin
5c5f8aa7d6 Merge branch 'deprecated-exported-class'
Fix compiling deprecated exported class declaration.

See #22810.
2022-09-22 18:23:12 +02:00
Vadim Zeitlin
6f615cbd09 Merge branch 'webview_improved_handlers' of https://github.com/TcT2k/wxWidgets
WebView handler improvements for advanced requests and Edge handler
implementation.

See #22797.
2022-09-22 18:21:39 +02:00
Tobias Taschner
a589d83233
Reimplement wxCOMStreamAdapterBase COM interface
Add inline implementation of IUnkown methods to avoid link
errors if comstream.h would be included multiple times.
2022-09-19 20:43:42 +02:00
Vadim Zeitlin
2d939a3665 Add wxDEPRECATED_EXPORT_CORE() macro for wxTransformMatrix
wxDEPRECATED_MSG() and WXDLLIMPEXP_CORE can't be used together in the
same declaration when the former uses the standard attribute ([[...]])
and the latter uses a legacy one (__attribute__((....))), at least not
with gcc 12.

Work around this problem by defining a special new macro that combines
both attributes in a working way.

This is rather ugly, as it would seem to be better to just always define
WXDLLIMPEXP_CORE using the standard attribute, but unfortunately this
doesn't work as the standard attribute must be placed before the
function and variable declarations, while we currently use our DLL
export macros in the middle of the declaration. Maybe we can change all
the declarations doing this later, but for now this is the simplest
solution to the immediate problem.

See #22790.
2022-09-18 19:53:39 +02:00
Tobias Taschner
d998d864e8
Edge wxWebViewHandler implementation
Currently custom protocols are not supported. Implement using
virtual hosts and emulate custom protocol loading in LoadURI().
While this is not a exact match it will at least work without
code changes in many common cases.
2022-09-16 20:47:52 +02:00
Tobias Taschner
4500a48407
Add wxWebViewHandler::StartRequest()
The new method an associated classes allow for a more detailed
handling in wxWebViewHandler instances.

Most notibly post data and headers from the request can be processsed.
The response can be send asynchronously.
2022-09-16 20:47:52 +02:00
Tobias Taschner
0021241d78
Add COM stream adapter
This allows easy usage of IStream based COM APIs
2022-09-16 20:47:52 +02:00