Commit Graph

2021 Commits

Author SHA1 Message Date
Paul Cornett
0a28e3267c Remove unused macro definition 2021-03-24 11:25:15 -07:00
Paul Cornett
0995797158 Remove run-time dependencies on X11 backend with GTK3
As with Wayland, the X11 backend may not be available at run-time,
so types defined in it can't be used
2021-03-24 11:25:01 -07:00
Vadim Zeitlin
e442d90b0d Merge branch 'webrequest-build-fixes' of https://github.com/MaartenBent/wxWidgets
wxWebRequest-related build fixes for MinGW.

See https://github.com/wxWidgets/wxWidgets/pull/2283
2021-03-23 14:16:07 +01:00
Maarten Bent
3cc48e2e56 Fix checking __MINGW64_VERSION_MAJOR for wxUSE_WEBREQUEST_WINHTTP
It is not yet defined for setup.h, so check it in chkconf.h.
Fixes #19105
2021-03-23 00:39:16 +01:00
Vadim Zeitlin
5d6525ccf1 Merge branch 'webview_useragent' of https://github.com/TcT2k/wxWidgets
Add support for custom user agent to wxWebView.

See https://github.com/wxWidgets/wxWidgets/pull/2280
2021-03-19 22:39:00 +01:00
Pierluigi Passaro
b824ed8fe6 Support Wayland in wxGTK wxMediaCtrl
For GTK, the current implementation assumes X11 is the only window option.
Introduce runtime checks to manage Wayland too.

Signed-off-by: Pierluigi Passaro <pierluigi.p@variscite.com>

Closes https://github.com/wxWidgets/wxWidgets/pull/2257
2021-03-19 22:36:59 +01:00
Tobias Taschner
7f7191066b Implement user agent access for GTK 2021-03-17 09:42:01 +01:00
Tobias Taschner
80c04e3941 Merge branch 'master' into webview_script_message 2021-03-01 09:57:13 +01:00
Tobias Taschner
e8371824bd Disable new methods for webkit1 2021-02-28 20:48:01 +01:00
Artur Wieczorek
9a29ea6e63 Fix setting wxBU_EXACTFIT style for wxButton under wxGTK2
The way wxBU_EXACTFIT is implemented in commit c1bb80987f
("Improve implementation of wxBU_EXACTFIT style for wxButton under wxGTK2",
2020-04-12) is too intrusive and disrupts button's appearance in some
themes. It should work better with themes if we reduce inner border in
a more GTK-compliant way by applying a dedicated GTK style to the button.

Closes #19081.
2021-02-27 17:08:37 +01:00
Tobias Taschner
c9606d7b5a Implement AddUserScript() for GTK 2021-02-27 10:59:23 +01:00
Tobias Taschner
71f745e647 Implement script message for GTK backend 2021-02-26 21:27:50 +01:00
Tobias Taschner
3af4702b11 Implement wxWebView::EnableAccessToDevTools() for GTK 2021-02-26 18:53:46 +01:00
Paul Cornett
62c119fa1e Fix RTL mirroring for wxClientDC, etc with GTK3
The changes to the Cairo context must be done before wxGC::CreateFromNative()
is called, otherwise they will be overwritten
2021-02-06 08:28:13 -08:00
Vadim Zeitlin
67fc7c5508 Merge branch 'remove-setup0.h'
Drop wx/setup0.h files hack and just use wx/setup.h.

See https://github.com/wxWidgets/wxWidgets/pull/2205
2021-02-06 14:26:25 +01:00
Tobias Taschner
d17e8978a6 Make wxWebView::RunScript() const 2021-02-05 22:18:31 +01:00
Tobias Taschner
b351e7762d Move common wxWebView code to base class
Removes duplicate code in the various webview backends
2021-02-05 22:18:29 +01:00
Tobias Taschner
0d82348328 Add wxWebView::GetBackendVersionInfo()
Allows to get the WebView backend version if available
Currently implemented for IE, Edge and webkit2.
2021-02-05 22:18:28 +01:00
Paul Cornett
e85f89e522 Implement wxDC mirroring for RTL layout with GTK3
Co-Authored-By: AliKet <aliket1435@gmail.com>
2021-01-31 20:59:29 -08:00
Vadim Zeitlin
d1810b0dce Remove setup0.h files
Simplify things by putting setup.h files themselves under version
control and getting rid of setup0.h ones.

The initial motivation for using separate setup0.h files was to allow
having local changes to setup.h, but with Git there is a simple way to
do it by using "git update-index --skip-worktree include/wx/msw/setup.h"
for example, so we don't really need setup0.h any more and dropping them
makes things simpler.
2021-01-31 19:02:56 +01:00
Vadim Zeitlin
fa4339a935 Initialize wxGtkValue in a way not requiring C++11
As we still support C++98, don't use G_VALUE_INIT as the initializer:
it's a braced-init-list, which is only allowed in C++11.

Co-Authored-By: Paul Cornett <paulcor@users.noreply.github.com>
2021-01-25 00:49:27 +01:00
Vadim Zeitlin
3568a160a9 Use wxGtkValue RAII wrapper in wxGTK code
wxGtkValue class was added back in 3f84cb17ca (Add wxActivityIndicator
control., 2015-03-06), but somehow never used. Start using it now
(better late than never...) as it makes the code simpler, shorter and
more robust.

No real changes.
2021-01-24 23:55:43 +01:00
Paul Cornett
638f0f89fc Fix mouse event coordinates for single-line wxTextCtrl with GTK3 2021-01-21 11:27:00 -08:00
Vadim Zeitlin
181be127a5 Simplify wxUSE_WEBREQUEST_XXX logic
Remove automatic definition of wxUSE_WEBREQUEST depending on whether
wxUSE_WEBREQUEST_XXX are defined and follow the same approach as with
wxUSE_GRAPHICS_XXX, i.e. define wxUSE_WEBREQUEST_XXX as wxUSE_WEBREQUEST
by default instead.

Move wxUSE_WEBREQUEST_WINHTTP to wxMSW-specific file, it doesn't need to
be in common one (unfortunately this can't be done for the Mac-specific
wxUSE_WEBREQUEST_URLSESSION yet, because macOS-specific settings are not
injected into setup.h.in currently).

Also fix test for winhttp.h availability: it seems to be present in all
MinGW64 distributions, but not in MinGW32, so test for this and not for
gcc version.

Finally remove the now unnecessary test for macOS 10.9, as we only
support 10.10+ anyhow by now.
2020-12-13 16:34:47 +01:00
Vadim Zeitlin
5c3db1574e Fix typo and slightly improve wxUSE_WEBREQUEST_CURL comment 2020-12-13 00:10:28 +01:00
Vadim Zeitlin
6bdab7b3c8 Merge branch 'master' into web-request
Merge with the latest master in preparation for merging into master.

Rebake to resolve conflicts in generated files.
2020-12-12 18:12:25 +01:00
Vadim Zeitlin
d47fa718cd Add wxDataViewCtrl::ExpandChildren()
This convenient method allows to expand all children of the item
recursively.

This is directly supported by both native implementations, so it makes
sense to have this in wxDataViewCtrl itself, even if it could be also
(less efficiently) implemented in the user code.
2020-12-05 16:37:13 +01:00
Vadim Zeitlin
712c2d4004 Add possibility to create "Close" bitmap button from XRC
This requires refactoring NewCloseButton() in order to extract
CreateCloseButton() from it, as XRC relies on being able to use two-step
creation which was previously impossible for this kind of buttons.

CreateCloseButton() is rather unusual, as it has to be declared in the
derived, platform-specific class, in order to be able to call its
Create(), but is defined only once in common, platform-independent,
code. However the only alternative seems to be to have a static
function, e.g. InitCloseButton(), which wouldn't be very pretty neither.

Closes https://github.com/wxWidgets/wxWidgets/pull/2118
2020-11-19 15:44:54 +01:00
Paul Cornett
ba4df6d996 Build fixes for GTK < 2.14 2020-10-23 09:35:37 -07:00
Vadim Zeitlin
c0e3bdaab9 Merge branch 'remove-outdated-gcc-checks'
Remove vestiges of support for gcc < 4 and related checks.

See https://github.com/wxWidgets/wxWidgets/pull/2096
2020-10-20 15:49:20 +02:00
PB
6fbacb20d8 Remove checks for wxNEEDS_CHARPP
wxNEEDS_CHARPP was needed only for now unsupported GCC versions.
2020-10-19 20:07:16 +02:00
Ilya Sinitsyn
bea13d68c0 Fix memory leak in wxWebKitJavascriptResult
We need to unref the result wrapped by this object in its dtor.
2020-10-19 13:54:19 +02:00
Václav Slavík
b355e00149 Only warn about missing WebKit extension when used
Don't log failure to load the extension during initialization, because
it isn't needed for many uses of wxWebView. Instead, only report the
failure at the time when functionality depending on it is used.

Also use g_warning() for logging consistently with other failures in
this file. This doesn't interrupt the user, yet shows the problem highly
visibly in the console.
2020-10-08 19:32:49 +02:00
Paul Cornett
aef3976e13 Fix WriteText() not scrolling to bottom with GTK >= 3.14
The introduction of scrollbar animations broke scroll-to-end functionality when
large amounts of text are written, due to interactions with GtkTextView's
background layout. Work around this by scrolling after the layout has finished.
See #18864
2020-10-02 11:10:14 -07:00
Vadim Zeitlin
bcb016613e Make wxRadioButtonBase a plain class, not template
Use a dirty hack to accommodate wxUniv by deriving wxRadioButtonBase
from wxCheckBox, rather than wxControl, there. This is not pretty, but
should be addressed by refactoring wxUniv code and in the meanwhile all
the other ports don't have to bother with using a template class
unnecessarily.
2020-09-21 18:01:37 +02:00
Vadim Zeitlin
3d72c009be Add wxRadioButtonBase::{Set,Get}Value()
Now that we do have wxRadioButtonBase class, declare wxRadioButton API
methods as pure virtual in it, to force the derived classes to implement
them.

Also remove the outdated comment saying that there is no base class for
wxRadioButtons in different ports, this is not true any longer.
2020-09-21 16:13:55 +02:00
Stefan Csomor
92ea83f00b First implementation 2020-09-17 22:35:22 +02:00
Paul Cornett
85d63c3150 Add a class derived from GtkImage to support HiDPI bitmaps
And use it to get HiDPI support wherever we use GtkImage. This extends and
consolidates support for custom drawing of images which has already been added
somewhat redundantly in several places.
2020-09-15 11:52:03 -07: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
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
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
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
Vadim Zeitlin
aa2d159e8c Use more reasonable length for wxSlider in wxGTK by default
Use the same 100 DIPs as in wxMSW, to make the default behaviour more
useful.

Also update documentation to explain which size component should, and
should not, be specified when creating the slider.

Closes https://github.com/wxWidgets/wxWidgets/pull/2012
2020-08-05 00:01:50 +02:00
Vadim Zeitlin
2f450733d4 Merge branch 'dpi-scaling-factor'
Add DPI scaling factor and revert content scaling factor behaviour in
wxMSW and other ports not using logical pixels to be 3.0 compatible.

See https://github.com/wxWidgets/wxWidgets/pull/1985
2020-07-20 15:55:23 +02:00
Vadim Zeitlin
379e718a33 Remove recently added GetOpenGLScaleFactor()
It has become unnecessary after the previous commit, as now the generic
GetContentScaleFactor() can be used instead of it on all platforms, so
revert the changes of f6cc8ff52c (Add GetOpenGLScaleFactor() to abstract
OpenGL coordinates scaling, 2020-07-10).

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

See #17391.
2020-07-18 23:51:05 +02:00
Arrigo Marchiori
c86bcf962d Use wxASCII_STR() on string literals
Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
2020-07-17 17:52:16 +02:00
Arrigo Marchiori
65cbf40b7e Add wxNO_UNSAFE_WXSTRING_CONV2 macro
The macro disallows implicit conversions between wxString and const
char*
2020-07-17 17:34:38 +02:00
tm
f6cc8ff52c Add GetOpenGLScaleFactor() to abstract OpenGL coordinates scaling
The fix for OpenGL coordinates when using high DPI in b134589cbb (Fix
OpenGL samples when using HiDPI displays, 2019-08-06) did fix it for GTK
3 and macOS, but broke it for MSW and other platforms not using pixel
scaling, as window coordinates are the same as OpenGL ones there, while
GetContentScaleFactor() can still return values > 1 even on these
platforms.

Provide new GetOpenGLScaleFactor() function abstracting this platform
difference and use it in all OpenGL samples to make them work correctly
in high DPI under all platforms.

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

Closes #17391.
2020-07-12 22:28:29 +02:00
Vadim Zeitlin
a47fd95e45 Avoid overriding wxDirDialog::GetPath[s]() unnecessarily
Don't duplicate practically the same code in all ports, just add m_paths
itself to the base class. The only drawback of doing this is that it's
unused in the ports not (yet) using it, but this saves enough code in
the aggregate to be worth it.
2020-07-10 03:52:15 +02:00
Ian McInerney
f9e9b19c92 Add wxDD_MULTIPLE wxDirDialog style and implement it for GTK
Add wxDirDialog::GetPaths() similar to the existing member of
wxFileDialog with the same name and also taking, for consistency,
wxArrayString as the output parameter.
2020-07-10 03:24:42 +02:00