Commit Graph

71396 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
89946d1fc7 Update version in @since comments for wxWebRequest to 3.1.5
Hopefully this is the last update.
2020-12-13 00:50:03 +01:00
Vadim Zeitlin
204645a47c Initialize all fields in wxWebRequestEvent default ctor
Default ctor was leaving pointers uninitialized which was dangerous, so
merge it with the other ctor to ensure that we always set them to NULL.

Also make m_response const as it can't be changed after creating the
event.
2020-12-13 00:48:23 +01:00
Vadim Zeitlin
0c9f4ababa Document wxWebResponse pointers as being non-owning
wxWebResponse objects belong to wxWebRequest itself.
2020-12-13 00:47:53 +01:00
Vadim Zeitlin
3a5f5006fb Fix typo in wxWebRequest documentation 2020-12-13 00:43:36 +01:00
Stefan Csomor
0d8616881d Fix over-releasing NSStrings obtained from native API
Use wxCFStringRefFromGet() instead of just using plain wxCFStringRef
ctor as the latter takes ownership of the object.
2020-12-13 00:39:07 +01:00
Vadim Zeitlin
700d6ddea6 Minor code formatting changes
No real changes at all, just improve layout, consistency etc.
2020-12-13 00:35:24 +01:00
Vadim Zeitlin
f02f8cc8a1 Remove unnecessary use of "explicit"
It's not used anywhere else with constructors taking more than one
(non-optional) argument and is not really useful with them (and not
useful at all until C++17), so don't use it here neither for
consistency.

No real changes.
2020-12-13 00:35:24 +01:00
Vadim Zeitlin
727b590814 Pass wxSharedPtr argument of RegisterFactory() by const reference
Avoid extra copies from passing it by value.
2020-12-13 00:19:03 +01:00
Vadim Zeitlin
e3382b6e93 Minor improvements to wxCredentialEntryDialog documentation
Add Create() description and, more importantly, explain why could
SetXXX() be useful.
2020-12-13 00:18:27 +01:00
Vadim Zeitlin
92dfef9083 Use HorzBorder() in wxGenericCredentialEntryDialog code
No real changes, just a tiny simplification.
2020-12-13 00:11:42 +01:00
Vadim Zeitlin
5c3db1574e Fix typo and slightly improve wxUSE_WEBREQUEST_CURL comment 2020-12-13 00:10:28 +01:00
Vadim Zeitlin
2ddf8705af Make wxGenericCredentialEntryDialog non-copyable
No real changes, just a bit of extra safety.
2020-12-13 00:09:22 +01:00
Vadim Zeitlin
b48c72ed22 Document wxUSE_CREDENTIALDLG in the options list too
Just add the new option to the manual.
2020-12-13 00:08:20 +01:00
Vadim Zeitlin
56e58efcaa Replace --enable-webrequest-xxx configure options with --with-xxx
Using --with is more appropriate for libcurl and WinHTTP as they
introduce dependencies on external libraries and is done for
NSURLSession too for consistency.

And there doesn't seem to be any real reason to make these options names
longer by including "webrequest" in their names, they're clear and
unambiguous enough even without it.
2020-12-13 00:07:10 +01:00
Vadim Zeitlin
efbfa321d6 Add --with-winhttp configure option
This is mostly useful for disabling the use of WinHTTP, e.g. because
only libcurl-based backend will be used or because WinHTTP headers or
libraries are not available and so using it would fail in any case.
2020-12-13 00:07:10 +01:00
Vadim Zeitlin
f35c2d9e58 Use PKG_CHECK_MODULES() to test for libcurl in configure
This is simpler and better (supports cross-compiling, manual override,
...) than doing it manually.

Also disable wxWebRequest completely under Unix if libcurl was not
found, as it's the only backend which can be used on non-MSW/Mac
platforms.
2020-12-13 00:07:08 +01:00
Vadim Zeitlin
64a3801160 Tweaks to wxWebRequest::SetData() overload taking stream
Check that the stream is valid, if specified at all, and return false if
it isn't -- or if no size was specified and determining stream size
failed.

Check for SetData() success in the test to provide better diagnostics in
case the file it uses is not found (as is the case when running the test
from another directory, for example).

Also pass wxSharedPtr<> by const reference instead of by value to avoid
unnecessary copies.
2020-12-12 18:46:28 +01:00
Vadim Zeitlin
92e41a7477 Improve reporting test failures due to assert failures
Show the condition which failed for wxASSERT() (as opposed to
wxASSERT_MSG()), as otherwise the error message didn't show any
information at all, making diagnosing the problem impossible.

Also show the assert location, as this can be useful too and there
doesn't seem to be any reason not to do it.
2020-12-12 18:13:25 +01:00
Vadim Zeitlin
fcaccbf12c Avoid -Wswitch warnings in wxWebRequest test
No real changes, just suppress the warnings about not handling all
states in a switch.
2020-12-12 18:12:44 +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
15c3ce6710 Add wxPlatformInfo::GetCpuArchitectureName()
This provides the same information as wxGetCpuArchitectureName(), but is
consistent with the other wxPlatformInfo accessors, which also
correspond to the existing wxGetXXX() functions, and makes it more
convenient to use this information in the application code as now
everything is available via wxPlatformInfo instead of having to use
different functions for different pieces.
2020-12-12 15:23:17 +01:00
Vadim Zeitlin
5c4461a154 Return "" and not "Unknown" from wxMSW wxGetCpuArchitectureName()
This is more consistent with the Unix version, and easier to test for
in the application code.
2020-12-12 15:18:29 +01:00
Artur Wieczorek
0c939ae727 Implement reading 16 and 32-bit color-mapped TGA images
Currently only 24-bit color-mapped images can be read.

Closes #18966.

Co-authored-by: Muster128 <Muster128@trac.wxwidgets.org>
2020-12-11 21:51:54 +01:00
Satya Das
86a3578a11 Fix syntax error in interface headers
Although these headers are not supposed to be compiled, it's still
better to avoid at least the obvious typos in them.

Closes https://github.com/wxWidgets/wxWidgets/pull/2140
2020-12-10 22:53:11 +01:00
Vadim Zeitlin
e99992b42d Fix crash when using list or tree control in ANSI build of wxMSW
Calling SystemParametersInfoForDpi() with LOGFONTA parameter corrupted
the stack because this function only accepts LOGFONTW, i.e. it wrote
twice as much data into the provided buffer as the caller expected.

This could be fixed by allocating a temporary wide buffer and converting
back, but this doesn't seem to be worth it, so just disable the use of
the DPI-specific function in the ANSI build.

Closes #19002.
2020-12-09 14:57:21 +01:00
Vadim Zeitlin
6b488723a8 Merge branch 'update-platform-details-overview'
Remove obsolete and irrelevant parts of the platform details overview in
the manual.

See https://github.com/wxWidgets/wxWidgets/pull/2139/
2020-12-08 23:28:24 +01:00
Vadim Zeitlin
143142c045 Simplify links to all the other GTK libraries too
There is no good reason to point to the latest unstable version.
2020-12-08 23:26:52 +01:00
Paul Cornett
8cc18853f0 Avoid -Wsign-compare warnings 2020-12-08 10:18:42 -08:00
Vadim Zeitlin
b4e1da1d6a Add wxWindow::GetAutoLayout() documentation
This function is not really useful for the application developers, but
should still be documented.

Closes #18917.
2020-12-08 18:47:38 +01:00
Vadim Zeitlin
938e493456 Merge branch 'osx-fixes'
Miscellaneous macOS bug fixes.

See https://github.com/wxWidgets/wxWidgets/pull/2136
2020-12-08 18:43:05 +01:00
Vadim Zeitlin
45eda0ff75 Warn about using XIM as input method with wxGTK
This results in various problems, including both the problems with
handling keyboard input (see #16840) and, even less expectedly,
graphical issues with flickering (see #18462).

Fixing or working around these issues doesn't seem to be easily
possible, but we can at least warn people about the problem.

Closes https://github.com/wxWidgets/wxWidgets/pull/2138
2020-12-08 18:41:35 +01:00
PB
688baa1097 Remove the '+' from "GTK+" everywhere 2020-12-08 17:32:39 +01:00
PB
d4b84dbb35 Update as requested in review 2020-12-08 17:24:53 +01:00
Vadim Zeitlin
8bf8cf4aae Fix link error due to StrCmpLogicalW() when using MSVC
Add the #pragma to link with shlwapi in the same object file which uses
this function, as even though the same pragma was already present in
other files, they could be completely discarded by the linker resulting
in link errors about unresolved StrCmpLogicalW() later.

Also move the MinGW-specific function declaration to the top of the
file, near the inclusion of the header which would normally declare it.
2020-12-08 16:43:33 +01:00
PB
415f16b22e Update Platform Details overview
Remove information that is no longer relevant or important.
Replace "http" with "https" everywhere.
2020-12-08 15:57:54 +01:00
Dimitri Schoolwerth
534445f14b Another fix for splitter rectangle calculation under macOS
The rect offset was correctly changed in 04a7a3f150 (Fix drawing outside
of the splitter sash under macOS, 2020-12-05), but its size was not. Fix
it too now.

See #18861.
2020-12-08 04:22:29 +01:00
Julian Smart
27d6dce48d Fix appearance of inactive wxAuiNotebook tabs under macOS
As we don't use any special value for the inactive caption background,
use the same value as for normal caption text for inactive caption text
too.

This is almost certainly not ideal, but at least allows the tab labels
to be readable.

Closes #18988.
2020-12-08 04:20:34 +01:00