Commit graph

75724 commits

Author SHA1 Message Date
Vadim Zeitlin
30c8c64e45 Allow changing wxWebViewBackendChromium data directory path
Use the value provided via wxWebViewConfiguration::SetDataPath() if any.
2024-01-06 03:20:50 +01:00
Vadim Zeitlin
416e241e6a Add wxWebViewConfigurationImplChromium scaffolding
It is perfectly useless for now, but provides place to add more things
in the upcoming commits.
2024-01-06 03:20:50 +01:00
Vadim Zeitlin
e800cb3119 Fix assert due to printing handle value using "%x"
The types of "handle" are completely different for different platforms,
so add a new "handleValue" variable just for the purpose of being able
to use it as wxLogTrace() argument.
2024-01-06 03:20:50 +01:00
Vadim Zeitlin
757ebe9e2e Don't define NDEBUG for CEF headers in MSVS debug builds
If _DEBUG is defined, we must be using debug version of CEF too, even
if wxHAVE_CEF_DEBUG is not defined by the build system.
2024-01-06 03:20:50 +01:00
Vadim Zeitlin
83d69a1cd9 Revert "Add debug postfix to libcef_dll_wrapper"
This reverts commit 3d51977acf because
it's incompatible with the library names created by CMake when building
CEF directly, and not via wx CMake files.
2024-01-06 03:20:50 +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
faec76990e Define wxHAVE_CEF_DEBUG when building CEF wrapper in debug
We need to define NDEBUG when using release build of the wrapper only,
so don't do it if it was built in debug by CMake.
2023-12-30 02:54:54 +01:00
Vadim Zeitlin
adedb499f5 Relax C++ standard requirement when using wxWebviewChromium
Although building CEF itself requires C++17, C++14 is sufficient for
building libcef_dll_wrapper, so allow using it.

Also move the error message a bit more informative.
2023-12-30 02:27:11 +01:00
Vadim Zeitlin
26025e2652 Disable -Wextra when building libcef_dll_wrapper
If it is enabled (e.g. globally because the application using wxWidgets
as a submodule enables it), it would result in a harmless warning about
not calling the base class ctor in base/cef_callback_internal.cpp.
2023-12-29 23:30:14 +01:00
Vadim Zeitlin
8a931de85d Avoid spurious -Wmissing-field-initializers in wxWebViewChromium
This warning is given when using -Wextra.
2023-12-28 19:46:33 +01:00
Vadim Zeitlin
a942fb1774 Merge remote-tracking branch 'MaartenBent/chromium' into webview-chromium
Fix CMake support.
2023-12-28 18:57:07 +01:00
Maarten Bent
3d51977acf
Add debug postfix to libcef_dll_wrapper 2023-12-24 18:06:14 +01:00
Vadim Zeitlin
4f1a249b76 Call CefDoMessageLoopWork() even more aggressively
Calling this function from OnInternalIdle() is not always enough, so
call it before processing each and every event to ensure that CEF can
really do whatever it needs to be doing internally.

This doesn't seem to noticeably slow down the program and solves weird
problems, like embedded text boxes (e.g. search zones on the web sites)
not getting focus on click.
2023-12-22 02:20:49 +01:00
Vadim Zeitlin
ed128bbe15 Use early return if CEF initialization fails
No real changes, just make the code more consistent and simpler to
extend.
2023-12-22 02:10:37 +01:00
Vadim Zeitlin
be6f046421 Remove wx/evtloop.h header which became unnecessary
wxEventLoop is not used in this file any more after the changes of
11d04389a0 (Add support for using wxWebViewChromium from non-main
thread, 2023-11-29).
2023-12-22 02:09:36 +01:00
Maarten Bent
948545ba81
Include helper ID in chromium helper plist
Same as the cefsimple example does.

CMake already has code to replace this variable.
2023-12-21 21:41:04 +01:00
Maarten Bent
5a2c45b8f7
Fix running webview sample with Chromium on macOS 2023-12-21 21:31:04 +01:00
Maarten Bent
dbf1eb91ce
CMake: Show macOS architecture in configuring summary 2023-12-21 21:31:04 +01:00
Maarten Bent
6b6c5f5378
CMake: Fix building webview sample with Chromium
The macOS code is based on the cefsimple example in the cef distribution.
2023-12-21 21:27:14 +01:00
Maarten Bent
2821fe0127
Fix building webview_chromium on macOS 2023-12-21 21:26:42 +01:00
Maarten Bent
62c6533fa7
CMake: Update webview related checks 2023-12-21 21:26:41 +01:00
Maarten Bent
3453d8c97d
CMake: Fix building libcef_dll_wrapper
Check for 'libcef_dll' instead of 'cef_paths.gypi', because the minimal distribution doesn't contain the last one.
Mark all CEF variables as advanced, so they don't show up in the default CMake GUI.
2023-12-21 21:19:16 +01:00
Maarten Bent
256b7e4046
CMake: Update CEF to latest version
Support more architectures.
2023-12-21 21:19:06 +01:00
Maarten Bent
bff7c317af
CMake: Fix CMake 3.5 deprecation warning 2023-12-21 21:18:54 +01:00
Vadim Zeitlin
cf3699bd7a Rename wxCefApp to wxCefBrowserApp
The new name is more precise, as there can be other CefApp subclasses
used in the other CEF processes too.

No real changes.
2023-12-20 18:09:45 +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
322677ad38 Replace WindowOpenDisposition with cef_window_open_disposition_t
WindowOpenDisposition is an inherited typedef from a base class and may
result in ambiguity errors if more than one base class defines it, so
use the actual type corresponding to it to preventively solve this
problem.

No real changes yet.
2023-12-20 01:35:38 +01:00
Vadim Zeitlin
fb6950a94e Replace NULL with nullptr in g_source_attach() call
Even though NULL might seem more appropriate in a call to this C
function, it doesn't pass the style check hook, so replace it with
nullptr too.

No real changes.
2023-12-12 00:21:53 +01:00
Vadim Zeitlin
0a87e112dc Make a tracing message about work scheduling more detailed
No real changes, just show the timeout with which this function is
called in this case too.
2023-12-05 01:52:15 +01:00
Vadim Zeitlin
4b540d76fa Fix event dispatching from secondary thread in wxGTK
When Chrome creates a thread-specific GMainContext, as it does whenever
it's initialized from any thread other than the main process one, we
need to ensure that events are dispatched for this context whenever the
main event loop wakes up, as otherwise it could wake up, realize that
there is nothing for it to do, and resume polling again, without giving
us a chance to dispatch the events meant for this context.

To do this, register a special dummy event source which does nothing
except calling wxWakeUpIdle() whenever its "check" function is called,
as it happens when any events are available.
2023-12-05 01:49:50 +01:00
Vadim Zeitlin
f21fff1d62 Refactor GTK thread dispatching code a bit more
Separate it into functions for starting and stopping dispatching to make
things a bit more clear.
2023-12-05 01:48:43 +01:00
Vadim Zeitlin
a91a90b8a6 Extract message loop work in a separate function
No real changes (use --color-moved --color-moved-ws=ignore-all-space
options of git-diff to see it), just move the code dispatching messages
to the thread-specific GMainContext into a separate function to make it
easier to call it from other places.
2023-12-05 01:31:16 +01:00
Vadim Zeitlin
e361ef0e01 Initialize command line arguments before running entry hooks
This fixes a crash if the application uses wide-char entry function, as
in this case the arguments wouldn't be initialized yet and any hook
checking them to decide what to do, like wxWebViewChromium one, would
crash.
2023-11-30 18:32:43 +01:00
Vadim Zeitlin
e90817930a Merge branch 'master' into webview-chromium 2023-11-30 18:30:26 +01:00
ali kettab
47bc3a8b96 Try to fix unit tests systematically failing under AppVeyor
Raise the window to ensure that it gets the expected mouse events.

See #24082.

Closes #24109.
2023-11-30 16:32:48 +01:00
Vadim Zeitlin
acdeb0b7f5 Define rich edit bullet-related constants for old MinGW
Define constants not defined in MinGW 5.x headers.
2023-11-30 16:29:45 +01:00
Vadim Zeitlin
7e2b0eea19 Merge branch 'args-init-improve'
Minor improvements to command line arguments initialization.

See #24103.
2023-11-30 02:53:44 +01:00
PB
c8c3932da6 Remove obsolete options from MSVS .props files
Remove the stuff regarding no longer supported MSVS versions,
Itanium CPU architecture, and Windows XP platform toolset.

Closes #24101.
2023-11-30 02:52:25 +01:00
Vadim Zeitlin
e4f2b1eaac Clarify description of archive contents in wxMSW binaries docs
Don't say that the directory where the archives are unpacked shouldn't
contain anything else than include and lib directories, as it can/does
contain other files, such as wxwidgets.props.

Closes #24098.

Co-Authored-By: Bill Forster <billforsternz@gmail.com>
2023-11-30 02:43:52 +01:00
Vadim Zeitlin
5318637839 Merge branch 'fix_SVG_premultiply' of https://github.com/teliseo/wxWidgets
Fix wxBitmapBundle::FromSVG(), which renders incorrectly on GTK and add
wxHAS_PREMULTIPLIED_ALPHA to make the code dealing with alpha more clear
and correct.

See #24097.
2023-11-30 02:35:20 +01:00
Lauri Nurmi
2b0ee48ef7 Fix double negatives used with 'neither'
Replace most 'neither' words introduced after 66916c74a3 (Fix double
negatives used with 'neither' in docs and comments, 2022-08-15) with
'either'.

All changes are to comments only.

Closes #24090.
2023-11-30 02:31:42 +01:00
Ian McInerney
97cba7c0ca Restore ToCDouble compatibility with leading spaces/+ and hex
The previous ToCDouble() function accepted leading spaces, a starting +
sign, and hex strings. std::from_chars() does not accept spaces or +,
and requires a special flag to convert hex strings, so handle this
manually to preserve the old behaviour of this function.

This is similar to the changes done for ToCULong() in #24022.

Closes #24089.
2023-11-30 02:29:58 +01:00
Randalphwa
b5fea3cbf6 Fix crash in wxLogGui when wxUSE_LOG_DIALOG==0
This fixes a crash when DoShowMultipleLogMessages() is called with
wxUSE_LOG_DIALOG set to 0. The code after the #else statement gets the
size of the wxArrayString but then instead of accessing that array, it
tried to access the m_aMessages array which is empty, resulting in a
crash in the C runtime. This commit simply gets the strings from the
correct array.

Closes #24087.
2023-11-30 02:24:30 +01:00
Blake-Madden
2c1cdf9c02 Fix typos and repeated words in comments and documentation
Closes #24085.
2023-11-30 02:21:34 +01:00
Stefan Csomor
bcbc31e97f Fix clipping of scrolled windows under macOS Sonoma
We need to use a native clip view for things to behave correctly under
this OS version, otherwise scrollbars can be overdrawn by the window
contents.

Closes #24067.

Closes #24073.
2023-11-30 02:16:04 +01:00
Vadim Zeitlin
8ca312b17c Use RAII helper for cleanup in wxTIFFHandler::SaveFile()
No real changes, just put cleanup code in a single place.
2023-11-30 02:08:49 +01:00
Vadim Zeitlin
70710a7656 Remove unnecessary cast of TIFFClose() return value
It doesn't have any, so explicitly casting it to "void" is useless and
misleading.
2023-11-30 01:59:48 +01:00
BrianDelalex
614135da5b Improve error checking when saving images in TIFF format
Use TIFFFlush() in wxTIFFHandler::SaveFile() in order to check for
success when saving TIFF images, as TIFFClose() doesn't have any error
code to do it.

Closes #23214.

Closes #24072.
2023-11-30 01:58:08 +01:00
Blake-Madden
49ddc51007 Add bullet number and style support to MSW wxTextCtrl
Make bullet style-related functions in wxTextAttr work for the native
(rich) text controls too.

Closes #24069.
2023-11-30 01:53:50 +01:00
Vadim Zeitlin
a4ee2563bc Use current encoding for char command line arguments if possible
This is more consistent with the conversion in the other direction, but
here we also fall back to UTF-8 if conversion fails as it seems better
than just losing the argument entirely.

Also make the conversion a bit more efficient by stealing the pointer
from wxCharBuffer instead of using strdup() to copy the string.
2023-11-30 00:44:51 +01:00