Commit Graph

69883 Commits

Author SHA1 Message Date
Maarten Bent
32a0c57f7a CMake: mark WEBKIT2_JS_LIBRARY as advanced 2020-12-23 17:03:07 +01:00
Maarten Bent
ea4368317f Fix suggest-override warning 2020-12-23 17:03:07 +01:00
Maarten Bent
e889924bc1 Fix sign-compare warning 2020-12-23 17:03:06 +01:00
Maarten Bent
da455f3c0b Fix extra-semi-stmt warning 2020-12-23 17:03:06 +01:00
Maarten Bent
bdfe77c23f Fix redundant-parens warning 2020-12-23 17:03:06 +01:00
Maarten Bent
a6d309447a Fix unreachable-code-return and unreachable-code-break warning 2020-12-23 17:03:06 +01:00
Maarten Bent
0438ca19c1 Fix implicit-fallthrough warning 2020-12-23 17:03:05 +01:00
Maarten Bent
062147ff1c Fix conditional-uninitialized warning 2020-12-23 17:03:05 +01:00
Maarten Bent
037fd6649c Fix unused-parameter warning 2020-12-23 17:03:03 +01:00
Dimitri Schoolwerth
f6a43a6074 configure: Fix failing libpng and zlib detection
Since Apple clang version 12 implicit function declarations by default
are (rightfully) an error resulting in failure to compile the configure
tests for libpng and zlib, which make implicit use of exit.

Fix by using return statements (another solution is including stdlib.h).
2020-12-23 01:53:25 +01:00
Andreas Falkenhahn
d2fc88c03d Mac: Fix truncation of images in wxDataViewCtrl
Take into account a cell's height and adjust the row height accordingly.

See #18868.

Closes #19003.
2020-12-22 02:13:24 +01:00
Dimitri Schoolwerth
4bf117aabd Mac: Adjust wxDataViewCtrl column width calculator
Slightly improve the maximum column width calculator by rounding up
the (non-integer) width of cells using ceil() instead of adding 1
unconditionally.

See #19003.
2020-12-22 02:09:21 +01:00
Andreas Falkenhahn
9ee866551f Mac: Update column width when expanding/collapsing
Adjust autosizing columns of wxDataViewCtrl when items are expanded
or collapsed through the UI as well.

Complements commit e89e76bb82.

See #14939.

See #19003.
2020-12-22 02:04:32 +01:00
Andreas Falkenhahn
9a78bfb553 Mac: Add wxDataViewCtrl::AdjustAutosizedColumns()
Refactor common code and also for upcoming accessibility from
wxCocoaOutlineView.

Part of #19003.

Co-Authored-By: Dimitri Schoolwerth <dimitri@schoolwerth.com>
2020-12-22 02:03:38 +01:00
Dimitri Schoolwerth
1324b5122b Fix missing MAC_OS_VERSION_11_0 with pre-11.0 SDKs
Fix typos preventing MAC_OS_VERSION_11_0 from being defined when using
MacOSX SDK 10.15 or earlier.
2020-12-16 23:56:09 +01:00
Tobias Taschner
a0848c2a45 WebView Edge: Disable status bar
No other webview backend shows it's own integrated status bar
it's safe to assume applications would not expect it.
2020-12-16 15:11:48 +01:00
Vadim Zeitlin
a5c2276965 Remove unused retain count variable in wxOSX font code
This fixes a -Wunused-variable which broke the CI builds.
2020-12-15 15:22:51 +01:00
Stefan Csomor
8fa54ec09a Fixing Memory Leaking CTFontDescriptor Bug
see https://trac.wxwidgets.org/ticket/19012
2020-12-15 08:01:27 +01:00
Artur Wieczorek
9bbaab6e56 Fix converting wxBitmap to wxImage
wxBitmap can have both alpha channel and a mask so alpha channel values
should be passed to the target wxImage even if mask exists.

Closes #19010.
2020-12-14 20:06:35 +01:00
Tobias Taschner
10398b8f72 macOS: Document missing wxWebView features and don't test for them 2020-12-14 13:40:32 +01:00
Tobias Taschner
b509b0d687 macOS: Implement javascript panels for wxWebView
Implement UI callbacks of WKWebView to enable javascript triggered
dialogs for alert(), confirm(), prompt() and file upload dialogs.
2020-12-14 10:18:13 +01:00
Tobias Taschner
4c35689b9d Use two step creation for WKWebView on macOS 2020-12-14 10:18:13 +01:00
Tobias Taschner
bde4a45e9c Remove assert in webview sample
Not all backends return IsBusy() during this callback
2020-12-14 10:18:13 +01:00
Tobias Taschner
4df334cec4 macOS/iOS: Use WKWebView for wxWebView Implementation
WKWebView replaces
WebView on macOS (available since 10.10, deprecated since 10.14) and
UIWebView on iOS (available since 8.0 deprecated since 10.0).
Using WKWebView ensures future compatiblity and unifies the interface
used for iOS and macOS.
2020-12-14 10:18:01 +01:00
Tobias Taschner
6d7f35090d Removed macOS only wxWebKitCtrl
This macOS only class duplicated functionality and code of wxWebView.
2020-12-14 10:17:35 +01:00
Vadim Zeitlin
1b18b1ad5c Merge branch 'platform-info-cpu-arch'
Improvements related to getting the CPU architecture name.

See https://github.com/wxWidgets/wxWidgets/pull/2141
2020-12-13 22:46:39 +01:00
Vadim Zeitlin
889e974700 Fix typo in wxWebSessionDelegate name
No real changes, just add the missing "a".
2020-12-13 20:45:18 +01:00
Maarten Bent
2f77cbcdcd Remove accidental empty statement in wxWebRequest curl backend
No real changes, just avoid a warning.
2020-12-13 17:38:30 +01:00
Vadim Zeitlin
373a3f8c57 Remove obsolete Borland hdrstop pragmas from the new code
See f57f214122 (Remove BCC-specific hdrstop pragma from everywhere,
2020-10-12).
2020-12-13 17:29:05 +01:00
Vadim Zeitlin
edd45bd5a1 Disable wxUSE_WEBREQUEST when using MinGW32
We can't compile it with this compiler using WinHTTP backend.
2020-12-13 17:17:06 +01:00
Vadim Zeitlin
76499a3e8b Check curl_multi_init() return value
Return NULL wxWebRequest if this function fails.

Also get rid of another unnecessary Initialize() function.
2020-12-13 17:07:11 +01:00
Vadim Zeitlin
77d25edce2 Translate the error message given in case libcurl init failure
This message is user-visible and so should be translated.
2020-12-13 16:58:57 +01:00
Vadim Zeitlin
7027f66a9a Simplify code by folding {Initialize,Cleanu[}CURL() in the caller
There doesn't seem to be any need to have separate functions when they
are just trivial wrappers.
2020-12-13 16:58:47 +01:00
Vadim Zeitlin
9cc35c54d2 Simplify libcurl initialization by using CURL_GLOBAL_ALL
Using anything else is not recommended by libcurl documentation and it's
not clear why would we need it, so just follow the official advice and
pass CURL_GLOBAL_ALL.
2020-12-13 16:46:24 +01:00
Maarten Bent
ab795fa68c Check for winhttp.h presence in CMake too 2020-12-13 16:35:34 +01:00
Vadim Zeitlin
c6b83194f1 Fix configure wxWebRequest detection and warning logic
Only use wxUSE_WEBREQUEST_{URLSESSION,WINHTTP} under the platforms where
they make sense.

Turn wxUSE_WEBREQUEST off if no backends are available and warn about
it, even under MSW/macOS platforms where this wasn't done previously.
2020-12-13 16:34:47 +01: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
Maarten Bent
b7450f52ff Fixes to CMake build files for wxWebRequest
Fix wrong library name in wx_add_sample() for webrequest.

Also prefer to disable wxWebRequest if no backends for it are available,
for consistency with the other libraries.
2020-12-13 14:36:31 +01:00
Vadim Zeitlin
ff57081ff2 Fix --with-winhttp configure option
It was never defined because USE_WIN32 wasn't set at the time it was
tested. Fix this by just always defining this option, even though it
only makes sense for MSW.

Also fix the test for winhttp.h, it needs to include windows.h first, as
otherwise compiling the header would always fail.
2020-12-13 14:34:28 +01:00
Vadim Zeitlin
893ebbab0c Disable use of build system pkg-config files when cross-compiling
Using build system libraries for a different host doesn't make sense and
can be actively harmful, so set PKG_CONFIG_LIBDIR to prevent pkg-config
from finding them (it, or PKG_CONFIG_PATH, can still be set to some
host-appropriate directory manually before/when running configure).

This obviates the need for the changes in the previous commit, so revert
it.
2020-12-13 14:24:47 +01:00
Vadim Zeitlin
0db857a460 Disable libcurl test when building wxiOS
It's not really useful in this case and somehow breaks Travis CI build.
2020-12-13 03:18:01 +01:00
Vadim Zeitlin
59bc7e59d7 Get rid of public wxWebSession::GetHeaders()
This is unnecessary, it can be protected and we can initialize
wxWebRequest::m_headers directly in its ctor instead of using this
function (which also simplifies code and makes it impossible to forget
to do this).
2020-12-13 03:09:55 +01:00
Vadim Zeitlin
7b7f9fa6c0 Simplify header-parsing code in wxWebResponseCURL
Use BeforeFirst() when we only need to find the first colon instead of
wxSplit().

No real changes (except for pathological case when there is no colon at
all, which wasn't handled correctly by the original code and still
isn't, but in a slightly different way).
2020-12-13 02:53:07 +01:00
Vadim Zeitlin
b37c7417f6 Don't make wxWebRequest::SplitParameters() public
They're not necessary to use this class and we may consider exporting
them later, possibly with a better API and more tests, if really needed.

Also do change their API slightly by leaving only a single function and
returning the value instead of using an out parameter for it to make it
simpler to use.
2020-12-13 02:41:01 +01:00
Vadim Zeitlin
be3eb334f6 Add file with wxWebRequest unit tests to MSVS project too
This file is not generated and so needs to be updated manually.
2020-12-13 02:39:23 +01:00
Vadim Zeitlin
ea71cf3984 Include wx/hashmap.h from wx/webrequest.h explicitly
This header was already implicitly included, but make it explicit.

No real changes.
2020-12-13 02:28:25 +01:00
Vadim Zeitlin
fc633f5aae Move wxStringWebSessionFactoryMap out of the header
Define wxWebSession::ms_defaultSession and ms_factoryMap in the
implementation file to avoid having to make the otherwise unnecessary
wxStringWebSessionFactoryMap type public.

No real changes.
2020-12-13 02:24:43 +01:00
Vadim Zeitlin
8ea4f38689 Make wxWebResponse::Init() and Finalize() non-public
The former can be called from the derived class ctors while the latter
only needs to be called from wxWebRequest itself, so just make it a
friend: this is not ideal, but still better than leaving this public and
simpler than any alternatives.
2020-12-13 01:33:01 +01:00
Vadim Zeitlin
1c61fe6baf Remove wxWebResponse::AsString() conversion parameter
It doesn't make much sense to specify the conversion here, it would
ideally be taken from the response Content-Type header itself and
currently is just assumed to be UTF-8 anyhow.

Also implement fallback to Latin-1 to avoid losing the data entirely if
it's not in UTF-8.
2020-12-13 01:16:41 +01:00
Vadim Zeitlin
fd040b702d Remove trailing spaces from webrequest sample
No real changes.
2020-12-13 01:07:55 +01:00