Commit graph

2179 commits

Author SHA1 Message Date
Vadim Zeitlin
e88e16a964 Allow reusing wxGTK window enter/leave callback
Refactor the existing callbacks to make it possible to call them from
other places than src/gtk/window.cpp.

No real changes yet.
2024-02-19 00:40:30 +01:00
Vadim Zeitlin
9205da74db Generate wxEVT_ENTER_WINDOW in icon part of wxSearchCtrl in wxGTK
Mouse motion events happening over GtkEntry icons are consumed by this
class "event" callback, which simply returns GDK_EVENT_STOP for them if
the icon is insensitive (which is the case for GtkSearchEntry) and so
our "enter-notify-event" callback is never called.

Fix this by handling "event" signal ourselves and generating
wxEVT_ENTER_WINDOW from it if necessary.

Doing this required adding a global pointer to the window currently
under mouse, which is also used for generating wxEVT_LEAVE_WINDOW if
necessary.

See #24245.
2024-02-19 00:40:30 +01:00
Vadim Zeitlin
ccce75f3cc Stop using wxCOMMON_CALLBACK_PROLOGUE macro in wxGTK callbacks
No real changes, just simplify the code and stop using a macro
unnecessarily when we can use a simple inline function instead.
2024-02-18 17:54:15 +01:00
ali kettab
7491ac5b7a Make wxAUI and wxSplitterWindow work properly with wxOverlay under wxGTK2
This Workaround is needed because the DC used to draw on the wxOverlay clips
children by default under wxGTK2. This means that the sash will always appear
behind the sub-windows. making wxOverlay worthless under this platforms.

Notice that calling gdk_gc_set_subwindow() unconditionally in Destroy() is cheap
when DontClipSubWindows() has never been called.
2024-02-09 23:26:36 +01:00
Paul Cornett
d8c5a87fe3 Partial fix for wxSearchCtrl mouse enter/leave events
The events only occur for part of the widget area,
but it's better than the previous nothing.
See #24245
2024-02-09 12:52:30 -08:00
Scott Talbert
fc35ad92bb Remove unnecessary empty destructors
These cause a problem for GCC 14 which detects that there are no
corresponding copy constructors and assignment operators and gives
-Wdeprecated-copy-dtor due to their presence, e.g.

/home/fedora/swt2c/wxWidgets/bld/bk-deps g++ -c -o test_allheaders_allheaders.o  -I/home/fedora/swt2c/wxWidgets/bld/lib/wx/include/gtk3-unicode-3.3 -I../../include -D_FILE_OFFSET_BITS=64 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/webp -I/usr/include/blkid -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/pixman-1 -I/usr/include/libxml2 -I/usr/include/fribidi -I/usr/include/sysprof-6 -pthread -I/usr/include/libpng16 -DWITH_GZFILEOP  -D__WXGTK__      -I../../tests -DWXUSINGDLL -I../../tests/../samples -I../../3rdparty/catch/single_include -pthread -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -O2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/libxml2 -I/usr/include/sysprof-6 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/webp -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0  -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -DPIC   ../../tests/allheaders.cpp
In file included from ../../include/wx/evtloop.h:13,
                 from ../../tests/testprec.h:5,
                 from ../../tests/allheaders.cpp:369:
../../include/wx/event.h: In copy constructor ‘wxSetCursorEvent::wxSetCursorEvent(const wxSetCursorEvent&)’:
../../include/wx/event.h:1943:11: error: implicitly-declared ‘wxCursor::wxCursor(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
 1943 |           m_cursor(event.m_cursor)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../include/wx/cursor.h:51,
                 from ../../include/wx/event.h:21:
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
   37 |     virtual ~wxCursor();
      |             ^
../../include/wx/event.h: In member function ‘void wxSetCursorEvent::SetCursor(const wxCursor&)’:
../../include/wx/event.h:1949:57: error: implicitly-declared ‘wxCursor& wxCursor::operator=(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
 1949 |     void SetCursor(const wxCursor& cursor) { m_cursor = cursor; }
      |                                                         ^~~~~~
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
   37 |     virtual ~wxCursor();
      |             ^

Fixes #24248.

Closes #24255.
2024-01-28 18:16:07 +01:00
Vadim Zeitlin
ff59ef301b Merge branch 'master' into webview-chromium 2024-01-17 00:22:39 +01:00
Vadim Zeitlin
afc635f845 Merge branch 'aui-repaint'
Fix some wxAUI repaint problems and switch to using live resize
everywhere by default.

See #24166.
2024-01-10 18:43:24 +01:00
Paul Cornett
ce1d317768 Remove GLU dependency
See #23721
2023-12-28 14:49:42 -08:00
Paul Cornett
fc8a780932 Avoid applying "no-window" mouse coordinate conversion to generic wxWindow
For a wxPizza widget in a GtkScrolledWindow, the coordinates are already correct.
2023-12-28 12:32:59 -08:00
Vadim Zeitlin
24fd54ed31 Add wxClientDC::CanBeUsedForDrawing()
This function can be used to check if drawing on wxClientDC actually
works. This has to be a run-time, rather than compile-time, check
because in wxGTK3 this depends on the backend being used: wxClientDC
only doesn't work with Wayland, but does work with X11 (and, less
importantly, Win32) backend(s).

Currently the wxWindow parameter of this function is not used but it
could be useful in the future and it will be simpler to allow not
specifying it (by defaulting it to nullptr) than to add it later, so it
seems better to have it.
2023-12-26 19:27:50 +01:00
Paul Cornett
c3d1618cc8 Fix transitory visual glitch with wxBORDER_NONE on GTK3
Changing the CSS after adding child to already-showing parent
can cause a fleeting glimpse of the original style.
See #24105
2023-12-10 09:10:42 -08:00
Vadim Zeitlin
e90817930a Merge branch 'master' into webview-chromium 2023-11-30 18:30:26 +01:00
Vadim Zeitlin
dede4b9326 Use "= default" for all trivial default ctors and dtors
Replace user-specified empty constructors and destructors with the
compiler-generated versions, which has a number of advantages for code
generation, in addition to being more clear.

Closes #22965.

Closes #24058.
2023-11-17 01:33:32 +01:00
Vadim Zeitlin
88a39aa6f8 Implement wxEVT_DPI_CHANGED generation for wxGTK
Just check if the scale factor has changed when getting a "configure"
event for a TLW as we're guaranteed to get one when the scale factor
does change, according to GTK documentation (and it does seem to work).

Closes #19290.
2023-11-07 20:57:31 +01:00
Vadim Zeitlin
e43f913313 Remove all blank "Modified by:" lines from top comment blocks
Having this line is not useful at all as it doesn't contain any
information and shouldn't be filled in the future as git-shortlog can
provide the information about people who changed the given file more
more reliably than consulting the comments in any case.

Keep the non-blank lines for historical purposes.
2023-10-22 01:22:48 +02:00
Vadim Zeitlin
81283f84dd Merge branch 'master' into webview-chromium-new
This pulls in wxWebView::SetProxy() addition.
2023-09-08 01:34:21 +02:00
Vadim Zeitlin
4844d37df1 Make recently added GTK-specific wxTextCtrl accessors public
Make GTKGetTextBuffer() and GTKGetEditable() functions added in
e4388d4f87 (Add accessors for underling wxTextCtrl GTK widgets,
2023-08-27) public instead of protected as it doesn't make sense to
force people to derive from wxTextCtrl just to call them.

See #23829.

Closes #23843.
2023-09-08 01:32:36 +02:00
Vadim Zeitlin
7c5d30fb32 Add wxWebView::SetProxy() and implement it for WebKit2 backend
Update the sample to allow specifying the proxy in it.
2023-09-07 15:33:39 +02:00
Vadim Zeitlin
cdab976148 Build fixes for wxUSE_WEBVIEW_CHROMIUM && !wxUSE_WEBVIEW_WEBKIT
Fix wxGTK build when CEF backend is available but WebKit(2) one is not.
2023-08-31 16:01:21 +02:00
Vadim Zeitlin
b6bfdd97c9 Merge branch 'master' into webview-chromium
Update to the latest master.
2023-08-30 02:03:00 +02:00
Vadim Zeitlin
00366cbaae Merge branch 'animation-hidpi'
Add support for specifying multiple animations to allow automatically
showing a higher resolution version when using high DPI, just as it was
already possible with the bitmaps.

See #23817.
2023-08-29 01:53:36 +02:00
Blake-Madden
e4388d4f87 Add accessors for underling wxTextCtrl GTK widgets
Allow retrieving GtkTextBuffer or GtkEditable used for multi- and
single-line controls respectively.

Closes #23829.
2023-08-29 01:52:51 +02:00
Vadim Zeitlin
27e80f81b4 Add high DPI support to generic wxAnimationCtrl
Allow specifying multiple animation versions, for different resolutions,
when setting the animation to use via wxAnimationBundle class which is a
much simpler version of wxBitmapBundle used elsewhere.

This is not implemented for the native GTK version yet.

Update the sample, even though the difference in it is not really
noticeable as the "high DPI" throbber is just a scaled up version of the
existing standard DPI animation produced using gifsicle.
2023-08-25 20:51:21 +02:00
PB
10d09ec2b2 Remove outdated parts from build system
Remove support for unsupported MSVS versions earlier than 2015
and Windows versions earlier than 7 from CMake build as they are not
supported any longer.

Also update wxUSE_GRAPHICS_GDIPLUS and wxUSE_GRAPHICS_DIRECT2D comments
in wxMSW setup.h to remove mentions of unsupported Windows XP but do
mention that MinGW-w64 can use Direct2D.

Closes #23787.
2023-08-24 15:15:57 +02:00
Stefan Hansson
b84b45161a Implement wxRB_SINGLE support in wxGTK
Create hidden radio button in wxGTK when using wxRB_SINGLE, as
this lets us deactivate the shown button by activating the hidden one.
GTK does not allow deactivating radio buttons by calling them with
gtk_toggle_button_set_active( ..., FALSE), so we need to work around
it like this.

Also update the documentation to mention that this works in wxGTK now.

See #17022.

Closes #23652.

Closes #23677.
2023-07-03 20:14:32 +02:00
Brian Nixon
567a66aac2 Remove dependency of wxUSE_SOCKETS on wxUSE_STOPWATCH
It isn't actually needed, so don't check for it in wx/chkconf.h and
remove the comment claiming that it is from various setup.h files.

Closes #23609.
2023-06-05 15:13:21 +02:00
Vadim Zeitlin
20b3c887f5 Improve wxUSE_STD_IOSTREAM documentation
Clarify that it is 1 by default in the documentation, instead of
implying that it's off by default and needs to be enabled.

Improve the description of this option in setup.h files.

And also document this compilation option in the summary page.
2023-04-28 15:26:46 +02:00
Vadim Zeitlin
7824391f64 Merge branch 'use-std-containers'
Remove avoidable uses of legacy container classes by replacing them with
the standard containers.

See #23440.
2023-04-17 17:02:27 +02:00
Vadim Zeitlin
889845fbc4 Add support for wxNO_IMPLICIT_WXSTRING_CONV_TO_PTR to wxString
This symbol is similar to the existing wxNO_IMPLICIT_WXSTRING_ENCODING
and can be defined when building the application (as opposed to when
building the library) to disable implicit wxString conversions to
pointer types, i.e. char*, wchat_t* and void*.

This makes the just added wxUSE_CHAR_CONV_IN_WXSTRING library build
option unnecessary, so remove it.
2023-04-16 01:16:56 +02:00
Vadim Zeitlin
35c35c235e Remove wxUSE_STL which is not really used any longer
wxString is always based on std::[w]string since 2c0c727f49 (Remove wx
own wxStringImpl implementation, 2022-11-16) and all containers use
standard containers by default too now -- and there is a separate
wxUSE_STD_CONTAINERS for this anyhow.

The only remaining use of wxUSE_STL was as the default value for
wxUSE_STD_STRING_CONV_IN_WXSTRING option, but it's not really needed
for this neither, and this option can just be set to 0 by default.

Also add wxUSE_CHAR_CONV_IN_WXSTRING which can now be set to 0 too to
disable all unwanted implicit conversions (even "safe" ones, to wide
strings, in addition to the unsafe ones to narrow strings that could be
already disabled with wxUSE_UNSAFE_WXSTRING_CONV) to allow people who
don't want to have any implicit conversions at all to do it.

Keep --enable-stl configure option for compatibility, but warn if it is
used to tell people that it is not needed any longer.
2023-04-15 17:22:09 +02:00
Vadim Zeitlin
fb17a5ac38 Merge branch 'use-std-cont-1'
Set wxUSE_STD_CONTAINERS=1 by default.

See #23439.
2023-04-15 15:46:08 +02:00
Vadim Zeitlin
1ca7499221 Stop using wxList in wxGTK wxRadioBox
Note that using vector of incomplete class required moving all ctors out
of line.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
c237d9ee49 Stop using wxList in wxGTK wxNotebook
Use a vector of objects instead.
2023-04-12 18:15:45 +01:00
Vadim Zeitlin
bd3ed34736 Stop using wxList for wxGTK wxDataViewCtrl::m_cols
Use a vector of std::unique_ptr<> instead.
2023-04-12 18:15:45 +01:00
Ian McInerney
01e61f6e7f Remove GTKInsertComboBoxTextItem completely
Instead of having a special function for this, collapse it down into the
DoInsertItems function to allow for only querying the model once from
the combobox.

This function is considered private because of the GTK prefix, so its
removal isn't API-breaking.
2023-04-12 17:55:27 +01:00
Ian McInerney
1ef312a0be Remove overriden GTKInsertComboBoxTextItem from bitmap combobox
The base function now has this exact functionality, but is faster.
2023-04-12 17:55:27 +01:00
Vadim Zeitlin
e273d45c9b Enable use of the standard container classes by default
This is mostly, even if not completely, compatible with the previous
default build using wxUSE_STD_CONTAINERS=0, so try enabling this by
default again. Hopefully it should work better now than the last time we
tried it, see 01871bf642 (Add wxUSE_STD_CONTAINERS and turn it on by
default., 2011-03-30) and the subsequent 7311debd0d (Don't use the
standard containers by default., 2011-05-13).

See #22718.
2023-04-10 17:00:32 +01:00
Vadim Zeitlin
0677d493df Add wxUSE_UNICODE_UTF8 to wx/setup.h
This option can also be used under MSW, so move it to the common setup.h
instead of having it in setup.h.in only.

Also do the same thing for wxUSE_UTF8_LOCALE_ONLY, even if it's less
clear if this one is really useful in non-Unix environment.
2023-03-24 19:18:30 +01:00
Tobias Taschner
e15a1ac18e
Add wxWebViewWindowFeatures and event
This replaces the previously implemented wxWebViewWindowInfo.

It explicitly breaks the previous API to enable WebKitGTK
integration and to make the usage in application code less error prone.

A new event wxEVT_WEBVIEW_NEWWINDOW_FEATURES is added to allow
access to the window features and the child web view.
2023-03-24 15:10:21 +01:00
Tobias Taschner
8d0685ee08
Add wxWebViewConfiguration support for webkitgtk2
Allows setting some webview settings which would be unavailable after
creation.
2023-03-24 15:10:20 +01:00
Vadim Zeitlin
67a5106dc2 Replace wxArrayPtrVoid with a std::vector in GTK wxEventLoop
No real changes, just replace wxArray with a type-safe wxVector and use
a range for loop for iterating over it.
2023-03-06 18:05:41 +00:00
Vadim Zeitlin
49e6f50208 Remove wxGTKPrivate::GetTextEntryWidget(), use GetEntryWidget()
These functions are identical, so leave only one of them and simply
remove the other one.

See #23262.
2023-02-20 18:30:29 +01:00
Vadim Zeitlin
1f9113b40a Add default ctor to wxGLCanvas
It didn't make any sense to have Create() functions in this class
without the default ctor as they could be never used -- calling them
would result in creating the window twice.

Add the default ctor to make this class more similar to all the other
windows.
2023-02-14 16:03:56 +00:00
Vadim Zeitlin
e89f05faba Remove memory debugging/tracing support and all related options
Drop disabled by default and pretty useless memory tracing code and all
the overlapping and poorly documented build options related to it.

Remove memory.cpp entirely and update all the make/project files, but
preserve the now completely trivial wx/memory.h for compatibility and
also keep including wx/string.h from wx/object.h as it seems like a lot
of existing code actually depends on this, even if it should not.

Replace the options in the propgrid sample with a couple of other
debug-related options that were not used before to avoid leaving the
"Debugging Section" completely empty.
2023-01-05 21:41:38 +01:00
Artur Wieczorek
e7a2786352 Remove duplicated method to destroy clipping region in wxPaintDCImpl (wxGTK)
Destroying clipping region is since 106b850593
("Fix wxCairoContext::ResetClip() for wxGTK", 2022-10-28) fully handled in
parent wxGCDCImpl::DestroyClippingRegion() calling wxCairoContext::ResetClip()
(including re-establishing clip for paint update area) so there is no need
to implement overriding method in wxPaintDCImpl.

Closes #23046.
2022-12-22 18:42:57 +01:00
Vadim Zeitlin
a577af1ca6 Initialize atoms used in wxGTK wxDataObject on demand
This allows to avoid having to call PrepareFormats() manually which was
not only verbose, but also error-prone as proved by the fact that
wxURLDataObject used wxTextURIListDataObject which used g_fileAtom in
its ctor without calling PrepareFormats() first and meant that this
class didn't work correctly unless some other wxDataObject had been
created before it.
2022-12-06 01:56:21 +01:00
Vadim Zeitlin
c2f3a3db01 Always use wxDynamicLibrary in wxMSW and remove checks for it
Force wxUSE_DYNLIB_CLASS to be 1 when using wxMSW and remove checks for
it being 0 from the code.

No real changes.
2022-12-04 02:12:22 +00:00
Vadim Zeitlin
be7860c766 Remove wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY
Assume they are always 1 now, there is no good reason to ever set them
to 0 any more.

Note that we still keep wxUSE_STD_IOSTREAM for now, but we can drop
wxUSE_STD_DEFAULT as it's not worth having it just for this single
option (previously it was used as the default value for 3 of them).
2022-11-17 00:40:50 +01:00
Vadim Zeitlin
b4b23ac423 Merge branch 'always-use-thread-local'
Always use thread_local as we can rely on compiler TLS support working
under Windows 7 and later.

There are some known problems in MinGW thread local variable support,
but they only affect (obsolete) 32-bit builds and will hopefully be
fixed in this compiler soon.

See #22917.
2022-11-10 16:32:42 +01:00