Commit Graph

70342 Commits

Author SHA1 Message Date
PB
9d0aee5ee6 Fix using invalid string index in wxIsAbsolutePath()
Check if the path is at least two characters long before accessing its
second character.

Add test cases for wxIsAbsolutePath() on MS Windows.

Closes https://github.com/wxWidgets/wxWidgets/pull/2262
2021-03-02 16:00:59 +01:00
Vadim Zeitlin
9a84e0b25e Don't require X11 in CMake builds using Wayland-only GTK
X11 headers and libraries are only required if we're actually using X11
which may not be the case.

This allows to build wxGTK on the systems using Wayland-only GTK.
2021-03-01 13:32:57 +01:00
Vadim Zeitlin
a8e918727a Only include X11 headers when we actually need X11 support
These headers may not be available at all when building wxGTK with
Wayland-only GTK version.
2021-03-01 13:06:17 +01:00
Tobias Taschner
80c04e3941
Merge branch 'master' into webview_script_message 2021-03-01 09:57:13 +01:00
Vadim Zeitlin
b8f63fc7c5 Skip wxLocale wxLANGUAGE_DEFAULT test in ANSI builds
The test fails there, but we don't really care about it, Unicode is
required for any level of acceptable locale support anyhow.
2021-03-01 00:22:39 +01:00
Maarten Bent
401d547b2a Fix -Wdeprecated-copy warning when using Scintilla Window
Don't use the copy constructor, use a constructor accepting the windowID.

Closes https://github.com/wxWidgets/wxWidgets/pull/2259
2021-03-01 00:11:03 +01:00
Vadim Zeitlin
afb57182e1 Merge branch 'gcc-edge'
Make it possible to build wxWebViewEdge with gcc or clang too.

Closes https://github.com/wxWidgets/wxWidgets/pull/2245
2021-03-01 00:09:52 +01:00
Maarten Bent
7532532800 Mention GCC/Clang support in wxWebViewEdge documentation
And add a comment explaining the name of the EventRegistrationToken include guard.
2021-03-01 00:09:23 +01:00
Maarten Bent
272c903234 Silence unknown pragmas warning in the WebView2 header
Using wxGCC_WARNING_SUPPRESS(unknown-pragmas) around the webview2 header does
not work, so suppress it for the entire webview project.
2021-03-01 00:09:23 +01:00
Maarten Bent
fc3cfb67cf Add missing UUIDs for wxWebViewEdge 2021-03-01 00:09:23 +01:00
Maarten Bent
09bc566b60 Support building wxWebViewEdge with GCC or Clang
Add EventToken.h with EventRegistrationToken implementation, that can be used by the WebView2 header.
2021-03-01 00:09:23 +01:00
Maarten Bent
b43803703d Move Callback implementation to separate header file 2021-03-01 00:09:23 +01:00
Maarten Bent
66d314c232 Implement QueryInterface of wxWebViewEdge CInvokable 2021-03-01 00:09:23 +01:00
Maarten Bent
156eda92d7 Use WRL when building with MSVC 2021-03-01 00:09:23 +01:00
Maarten Bent
a8b726359b Format wxWebViewEdge Callback code 2021-03-01 00:09:23 +01:00
Maarten Bent
ad1219d0a2 Fix building with MSVC 32 bit 2021-03-01 00:09:23 +01:00
Maarten Bent
84b19a0ce0 Use the same function signature as the WebView2 SDK 2021-03-01 00:09:23 +01:00
nns52k
b465a95dcc Make it possible to compile wxWebView Edge backend with gcc
Remove the requirement to include wrl/event.h so that GNU C++ (maybe
Clang C++ as well) can compile this file without error.
2021-03-01 00:08:08 +01:00
nns52k
df20e5ec76 Fix case of WebView2.h in the #inclue directive
Using the correct case is important when using case-sensitive file
systems as when cross-compiling, for example.
2021-03-01 00:08:08 +01:00
PB
a75aa78263 Fix dragging file in DnD sample
At least on Microsoft Windows, it is possible to start dragging an unselected
wxTreeCtrl item. Therefore, in wxEVT_TREE_BEGIN_DRAG handler do not use the
path that is currently selected in the control but the one that is actually
being dragged.

Closes https://github.com/wxWidgets/wxWidgets/pull/2258
2021-03-01 00:03:21 +01:00
Vadim Zeitlin
fa3cf06273 Avoid possible "unreachable statement" warnings
Don't return unconditionally before another return. Somehow gcc doesn't
warn about it, but other compilers (and static analyzer tools)
definitely do.

No real changes.
2021-02-28 23:59:51 +01:00
Vadim Zeitlin
f11db09e9b Ad wxHAS_X11_SUPPORT helper to simplify the code
This is much more readable than the existing (and now duplicated)
__WXGTK__ || !__WXGTK20__ || GDK_WINDOWING_X11 check.

No real changes.
2021-02-28 23:58:07 +01:00
Vadim Zeitlin
810b342411 Avoid useless check for GTK_CHECK_VERSION
Just use it inside the existing check for GTK itself.

No real changes.
2021-02-28 23:53:49 +01:00
Vadim Zeitlin
d03f193719 Recognize "ll_LL" as at language "ll" in GetSystemLanguage()
If we can't find an exact match for the system locale in the database,
try to at least find the corresponding language.

This is almost certainly what the intention of the original code was, as
otherwise the entire loop was useless because it couldn't find anything
that wouldn't have been found in the loop just above.

This allows to correctly load German translations when using unsupported
locale such as "de_IT", for example.

See #19082.
2021-02-28 23:39:20 +01:00
Scott Talbert
f6a53b59b2 Fix regression in wxGetKeyState() on GTK3 w/ X11
wxGetKeyStateGTK() is intended to be used only with non-X11 GTK backends.
wxGetKeyStateX11() should still be used on GTK3 w/ X11 as the GTK
variant does not provide all key states.
2021-02-28 14:11:26 -08:00
Vadim Zeitlin
73b41dda91 Remove redundant #if/#endif in Unix locale code
Put both Unix-only functions inside the same #ifdef __UNIX__.

No real changes.
2021-02-28 22:50:35 +01:00
Vadim Zeitlin
2e8e0197d7 Add wxSetlocaleTryAll() helper to simplify Unix locale code
Define the function calling setlocale("xx_YY") first and then just
setlocale("xx") if the former failed, instead of doing the same thing
manually in 3 different places.

Also avoid attempting the second setlocale() call completely if there is
no "_YY" part in the first place.

No real changes.
2021-02-28 22:48:52 +01:00
Tobias Taschner
5e35e6c635
Clear script ids in RemoveAllUserScripts() 2021-02-28 22:38:09 +01:00
Tobias Taschner
5a30bbe38f
Apply suggestions from code review
Co-authored-by: PB <PBforDev@gmail.com>
2021-02-28 22:33:15 +01:00
Tobias Taschner
e8371824bd
Disable new methods for webkit1 2021-02-28 20:48:01 +01:00
Tobias Taschner
f419240335
Add Apple transport security to wxWebView docs 2021-02-28 20:44:38 +01:00
Tobias Taschner
ca5133fff7
Add usage documentation to wxWebView::AddScriptMessageHandler() 2021-02-28 20:41:49 +01:00
Tobias Taschner
d4a9ec2448
Define unused parameters differently to improve intellisense 2021-02-28 20:14:38 +01:00
Tobias Taschner
166d7e2c83
Fix unused warning in sample 2021-02-28 20:06:59 +01:00
Vadim Zeitlin
91ec900034 Explicitly disallow wxLANGUAGE_UNKNOWN in wxLocale::Init()
This value doesn't make here, so be upfront about it.
2021-02-28 20:04:33 +01:00
Tobias Taschner
575ae90d85
Fix trailing whitespace 2021-02-28 20:03:36 +01:00
Tobias Taschner
2a16638e2a
Fix EOL issues 2021-02-28 20:03:31 +01:00
Vadim Zeitlin
18bf718f60 Support wxLANGUAGE_DEFAULT in wxLocale even when it is unknown
Don't give an error if we can't recognize the current system language,
as we may still be able to use it even in this case.

Closes #19082.
2021-02-28 20:00:27 +01:00
Tobias Taschner
2c3d179923
Implement common web message identifier for macOS 2021-02-28 19:57:33 +01:00
Tobias Taschner
a27f73367c
Implement AddUserScript() for WKWebView backend 2021-02-28 19:55:19 +01:00
Vadim Zeitlin
3e395f9b5f Micro optimization for wxLANGUAGE_UNKNOWN in GetLanguageInfo()
Don't bother iterating over all the languages if we can be sure we're
not going to find anything anyhow.
2021-02-28 01:12:57 +01:00
Vadim Zeitlin
d029279227 Rename local variable to a more consistent name
Call the info->CanonicalName "shortName", as it's done in many other
places in the code instead of using "locale" for it here, even though we
do use it as a name of locale.

No real changes.
2021-02-28 01:11:34 +01:00
Vadim Zeitlin
5fd85d422f Add a trivial test for setting default locale
Initializing wxLocale using wxLANGUAGE_DEFAULT should work, unless
LC_ALL is explicitly set to an invalid value.
2021-02-28 01:07:47 +01:00
Vadim Zeitlin
7b6894ea41 Reuse Unix branch of wxLocale::Init() for macOS too
There doesn't seem to be any reason to partially duplicate Unix-specific
code in a separate Mac branch when we can just use the same code. Parts
of it which are not necessary under Mac, such as trying ".UTF-8" locales
in wxSetlocaleTryUTF8(), can be separately disabled there (even though
they are harmless), but other parts are probably needed, e.g. setting
Norwegian locale failed under macOS before because we didn't translate
nb_NO that we use to no_NO actually supported under macOS.
2021-02-28 01:02:59 +01:00
Vadim Zeitlin
0aba9fe112 Remove useless fallback from wxLocale::Init()
There is no need to try setting "loc.UTF-8" and "loc.UTF8" when we had
just called wxSetlocaleTryUTF8() which tried these variants and also
their lower-case equivalents already.
2021-02-27 17:52:08 +01:00
Artur Wieczorek
04ea7b552a Fix wxBitmapButon used as wxPG editor button under wxGTK2
wxBitmapButton without inner border should work better with themes
if we reduce inner border in a more GTK-compliant way by applying
a dedicated GTK style to the button.
2021-02-27 17:15:39 +01:00
Artur Wieczorek
9a29ea6e63 Fix setting wxBU_EXACTFIT style for wxButton under wxGTK2
The way wxBU_EXACTFIT is implemented in commit c1bb80987f
("Improve implementation of wxBU_EXACTFIT style for wxButton under wxGTK2",
2020-04-12) is too intrusive and disrupts button's appearance in some
themes. It should work better with themes if we reduce inner border in
a more GTK-compliant way by applying a dedicated GTK style to the button.

Closes #19081.
2021-02-27 17:08:37 +01:00
Tobias Taschner
29bfcdfd5e
Add common web message identifier 2021-02-27 11:55:50 +01:00
Tobias Taschner
c9606d7b5a
Implement AddUserScript() for GTK 2021-02-27 10:59:23 +01:00
Tobias Taschner
4d78437a77
Implement AddUserScript() for edge backend 2021-02-26 23:41:39 +01:00