Commit graph

30 commits

Author SHA1 Message Date
Vadim Zeitlin
5ca49dc56c Allow specifying a custom CefClient to use with wxWebViewChromium
This opens many customization possibilities beyond those provided by
wxWebView API and also allows to process CEF IPC messages much more
efficiently than what is possible using wxEvents.

Closes #24336.
2024-02-29 03:05:44 +01:00
Vadim Zeitlin
a766ed9f21 Fix CMake sandbox option in libcef build instructions
This option is called USE_SANDBOX and not CEF_USE_SANDBOX.
2024-02-29 03:05:10 +01:00
Vadim Zeitlin
b3c1a6adfd Document CEF_RUNTIME_LIBRARY_FLAG switch for building CEF
This must match the options used when building wx itself.

Also mention CEF_USE_SANDBOX while discussing CEF build options.
2024-01-20 00:58:39 +01:00
Vadim Zeitlin
fae1f35e08 Allow customizing CEF log file and log level
Add new wxWebViewConfigurationChromium class which corresponds to the
"native" configuration used in the other backends and contains (some)
fields of CefSettings in this one.
2024-01-17 01:16:06 +01:00
Vadim Zeitlin
8655d7bb95 Add wxEVT_WEBVIEW_CHROMIUM_MESSAGE_RECEIVED
This allows to handle IPC messages from custom JS functions in the code
using wxWebViewChromium.
2024-01-05 01:43:32 +01:00
Vadim Zeitlin
6f130c121f Add wxWebViewChromium::SetRoot()
This allows to define a prefix for all the files used by the application
in the browser.
2023-12-20 01:39:02 +01:00
Vadim Zeitlin
0d2d8e77f9 Use appname_cef_helper as CEF helper if it exists
This allows to use a helper process different from the main one on all
platforms, not just macOS, and can be preferable if the initialization
of the main process is too complicated to be easily short-circuited.
2023-09-21 21:53:37 +02:00
Vadim Zeitlin
4816448cff Assume release CEF build by default under Unix
This prevents wxWebViewChromium from referencing debug-only functions
that are not defined in the release build of libcef_dll_wrapper.

Unfortunately, CEF build doesn't provide any way to detect if the
wrappers were built in debug or in release mode, so just assume the
latter and add --enable-cef-debug configure option to build with a debug
build of CEF wrapper if necessary.
2023-09-19 00:36:07 +02:00
Vadim Zeitlin
ae8619b6dd Don't build separate webview_chromium library
Just include wxWebViewChromium in the webview library if it's enabled
during the build.

There doesn't seem to be any reason to build a separate library for it,
it's not really different from the other disabled by default wxWebView
backend (Edge).

And now that we don't need to link with an extra library, there is also
no need to have a separate webview_chromium sample, so just add a
possibility to run webview sample itself using Chromium backend by
setting WX_WEBVIEW_BACKEND environment variable.
2023-09-15 01:56:08 +02:00
Vadim Zeitlin
05a8dfa555 Implement availability check for wxWebviewChromium under GTK
Return false when using Wayland as the backend creation can only fail in
this case.
2023-09-14 19:19:59 +02:00
Vadim Zeitlin
285b75bcd4 Remove extra whitespace documentation 2023-09-06 18:52:43 +02:00
Vadim Zeitlin
61bc16fa25 Update CEF-related build instructions
Moslty document that 5 helper applications are now needed under Mac and
not just a single one.
2023-09-06 18:49:57 +02:00
Vadim Zeitlin
08d6fe059b Update CEF requirements for the current version
Also don't use "CEF3" any more as "CEF1" doesn't really exist by now any
longer and there is only a single version of CEF.
2023-09-06 03:50:05 +02:00
Vadim Zeitlin
f5e2af9a28 Make wxWebViewChromium work with wxGTK3 and X11
Make browser creation actually work by postponing it until the host
window is realized and so has a valid X11 Window.

Remove unnecessary code manually creating GTK widget and just use the
standard wxGTK wxWindow instead.

Add code for setting the visual compatible with CEF to avoid X11 errors,
see https://github.com/chromiumembedded/cef/issues/3564, with many
thanks to Jiří Janoušek for finding and solving this problem originally.

Adjust the sample to handle wxWebView::Create() failure (not very
gracefully, but still better than just crashing) and to avoid using it
until it is fully created.

Update documentation to mention GTK limitations.
2023-09-06 03:50:05 +02:00
Vadim Zeitlin
d3cc4678d5 Add entry hook mechanism and use it for Chromium helper processes
At least when using wxGTK Chromium helper process can't be executed once
GTK is initialized because doing this creates background threads and
Chromium code aborts if there are any threads running.

As we don't want to initialize CEF unconditionally before initializing
GTK in all applications (even those not using CEF), the only solution is
to detect if we need to run a Chromium helper process ourselves before
GTK initialization, i.e. before wxApp creation, which means that it
can't be done via the existing wxModule mechanism because modules are
initialized after creating the global application instance.

So add a way to hijack wxWidgets initialization entirely if some special
command line option (such as Chromium "--type=xxx") is specified and use
it in wxWebViewChromium to call CefExecuteProcess() before initializing
GTK or even wxWidgets itself -- as it won't be needed in a CEF helper
process anyhow.
2023-09-06 03:50:05 +02:00
Vadim Zeitlin
6ee4a4a88c Update the version since which Chromium backend is available 2023-08-30 02:04:05 +02:00
PB
cbe528def6 Correct two more typos 2018-03-11 16:03:41 +01:00
PB
687343f6d6 Update wxWebViewChromium documentation 2018-03-11 15:50:31 +01:00
Tobias Taschner
6b03c0aea7
Remove tabs from webview chromium source files 2018-02-21 11:09:26 +01:00
Tobias Taschner
8d5ca40151
Update CEF documentation 2018-02-20 20:50:33 +01:00
Tobias Taschner
eca584e719
Integrate all CEF initialization and message loop work into implementation
Handle Startup and Shutdown of CEF in a wxModule and don't require the
user to implement a timer to handle the CEF work loop
2018-02-20 18:33:20 +01:00
Steven Lamerton
919aeed16c
Typo fixes in wxWebViewChromium docs. 2018-02-20 18:33:06 +01:00
Steven Lamerton
8e52ae6a91
Update wxWebViewChromium documentation.
- Add supported CEF versions.
- Clarify required runtime files.
2018-02-20 18:33:04 +01:00
Steven Lamerton
bce2c1d82d
Documentation updates for wxWebViewChromium. 2018-02-20 18:33:01 +01:00
Steven Lamerton
8a0bb51f80
Tidy up wxWebViewChromium documentation. 2018-02-20 18:32:59 +01:00
Haojian Wu
90f2c9f9e7
Update docs. 2018-02-20 18:32:51 +01:00
Haojian Wu
9903f0bbbb
Update docs. 2018-02-20 18:32:50 +01:00
Haojian Wu
36b3740e55
Update docs: Add required libraries on Linux. 2018-02-20 18:32:47 +01:00
Haojian Wu
d30ee47cb4
Add wxWebViewFactoryChromium docs and API differences section. 2018-02-20 18:32:42 +01:00
Haojian Wu
3ffdd81f45
Add wxWebViewChromium interface document. 2018-02-20 18:32:41 +01:00