This implementation is based on javascript 'window.find()'
https://developer.mozilla.org/en-US/docs/Web/API/Window/find
It's not standard, but implemented in most browsers.
It's not a complete implementation as it can't determine how
many search results can be found.
If the backends API provides a native find interface it should be
used instead of this implementation, but it's good fallback.
Send EVT_WEBVIEW_NAVIGATING, EVT_WEBVIEW_NAVIGATED and EVT_WEBVIEW_LOADED
when an anchor is clicked within a document. This kind of navigation
cannot be vetoed.
Fixes: #19074
A number wxRIBBON_ART_TOOOL_XXX constants were not taken into account by
GetColour() and SetColour() for some reason, even though the class did
have the corresponding member colour variables.
Fix this by simply adding cases for them to the existing switch.
Closes https://github.com/wxWidgets/wxWidgets/pull/2225
If source wxImage has a mask we need to create ARGB32 Cairo surface (even
for RGB image) and based on the mask values set the alpha values to fully
transparent or retain original values.
Automatically download the WebView2 SDK from nuget (official repo for the SDK)
when enabling wxUSE_WEBVIEW_EDGE to simplify usage.
Copying to 3rdparty/webview2 is still supported optionally.
If a wxWebRequestCURL object is canceled or deleted before its transfer
is complete, we need to manually close its active socket. Record each
transfer’s active socket in wxWebSessionCURL::SocketCallback so can use
it if needed.
Previously, this was done using curl_easy_getinfo, but this required
some compile time and run time checks and could fail in some specific
cases. Recording the socket ourselves significantly simplifies the code
and should always work.
For internal purposes wxBitmap with mask should be converted to CGImage
with alpha values only (with no mask). This is i.a. needed to assure
compatibility of wxGraphicsBitmap format with other ports where these
bitmaps are in pure ARGB format.
No real changes, ignore the huge diff which is due to reordering of all
the strings in this file after the changes of 87c56c7c1d (Do not sort
content of generated POT files alphabetically, 2021-01-23).
See https://github.com/wxWidgets/wxWidgets/pull/2214
Remove platform-specific translations.
This is unnecessarily complicated for the single string that we
currently use this for, so just handle it specially.
Also some other minor translation-related improvements.
See https://github.com/wxWidgets/wxWidgets/pull/2213
When using the socket poller implementation using wxEventLoopSource
objects to monitor sockets, the operation
wxEventLoopBase::AddSourceForFD(... can sometimes return NULL. In these
cases the socket will not be monitored as needed. The only option seems
to be to cancel the transfer and report a failure
On windows and systems where wxUSE_EVENTLOOP_SOURCE is 1, it is
possible to monitor socket descriptors for activity from the main
thread. The SocketPoller class used with wxWebSessionCURL is modified
to use an implementation class that does so.
On windows, the implementation uses the winsock1 function
WSAAsyncSelect to send events to wxWebSessionCURL when activity is
detected. When wxUSE_EVENTLOOP_SOURCE is 1, a wxEventLoopSource is used
to monitor for socket activity. The event loop source is given a custom
wxEventLoopSourceHandler object to send the necessary event.
Previously wxWebRequestCURL objects were canceled by removing their
CURL easy handle from the CURLM multihandle. Unfortunately the really
only pauses the connection and does not truly cancel it. This commit
tries to stop the transfer by retrieving the active socket from the CURL
handle for the transfer and closing it.
There are some complications in doing this because the option curl uses
to get the socket have changed over the years. A combination of compile
time and run time checks are used to use the appropriate options to get
the socket. However in the case of 64bit windows using a curl version
older than 7.45.0 simply won’t have an usable option. In this case,
it seems nothing can be done.
At various points in a transfer being managed by the wxWebSessionCURL
class we need to perform operations on a wxWebRequestCURL object.
However it’s possible for the request object to be deleted while the
transfer is in progress.
To ensure that the request objects are valid, keep track of the request
objects with a hash map. Objects are added to the map when a transfer is
started and removed when the transfer is complete or in the request’s
destructor.
Currently for wxWebRequestCURL objects using memory storage, a download
is processed by appending to a wxMemoryBuffer each time the write
callback is called. For a large transfer, this can result in many, many
reallocation calls and can block the main application.
This commit uses the progress callback for wxWebRequestCURL objects
added in a previous commit to set a minimum size for the buffer as soon
as it is known.
This commit adds a progress callback for use with wxWebRequestCURL
objects. This has some complications because over the years curl has
changed the signature of the callback.
A combination of compile-time and run-time checks is used to make sure
the appropriate callback and preferred return value are used.
Since the parent commit multicells work correctly when deleting (and
inserting) rows (or columns) intersecting with them and the comment
warning about it resulting in a crash is no longer needed.
This reverts commit 4d8e8355b4 (Added a warning about multi-cells in
wxGrid::DeleteRows() docs., 2011-12-25).
See #4238.
Deal with possible size changes of a multicell (both main and inside
cells) when inserting or deleting rows or columns and, in the case of
deletion only, the disappearing of a multicell's main cell.
Closes#4238.
Multicells currently don't get any special treatment when inserting
or deleting rows or columns so neither a multicell's main size nor
inside cells' sizes (which are offsets to the main cell) are updated.
Most tests fail and will be fixed by the next commit.
See #4238.
Only single insertions of rows and columns were supported, allow N
insertions provided the row/column selection is consecutive.
Do the same for deletions: while deleting selected rows and columns
already works it's useful to test deleting multiple positions at once.
Do some simple sanity checks with attributes, particularly overwriting
a cell with NULL attribute (as was already checked very usefully in
the grid sample for ref count reasons), and their total count in a grid
when inserting and deleting rows and columns.
While the tests are not particularly useful for the next intended grid
change, they do contain some functions that also work for upcoming tests
so these (harmless) tests are included as well.
Put each benchmark application in a sub-directory instead of specifying all in one
file, because cotire cannot create PCH targets for the same file twice (bench.cpp).
Instead of having wxWebSessionCURL run a worker thread that uses curl
to monitor and process network activity, set up a separate socket
poller class to monitor socket activity. The socket poller class will
throw an event back to wxWebSessionCURL when it detects activity on the
sockets so that it can tell curl to process the activity in the main
thread.