Commit Graph

1106 Commits

Author SHA1 Message Date
Vadim Zeitlin
86d1a25624 Merge branch 'winsock-2'
Use WinSock 2 rather than 1.1 by default and also enable IPv6 support,
requiring WinSock 2, by default now that it can be done.

See https://github.com/wxWidgets/wxWidgets/pull/2335

Closes #15562.
2021-04-26 15:07:13 +01:00
Vadim Zeitlin
bf5090bcf3 Enable Winsock 2 and IPv6 build options by default
In addition to linking with Winsock 2, also use winsock2.h.

This allows to turn on IPv6 support on by default under MSW, so turn it
on under Unix too for consistency.

Predefine _WINSOCK_DEPRECATED_NO_WARNINGS to avoid warnings about
deprecated (but still available and very unlikely to be ever removed)
Winsock 1 functions that we still use.
2021-04-24 18:06:43 +01:00
Vadim Zeitlin
db22d12a47 Merge branch 'osx-dataview-native-key'
Implement wxEVT_CHAR generation for wxDataViewCtrl under Mac.

Closes https://github.com/wxWidgets/wxWidgets/pull/2324
2021-04-24 00:40:15 +02:00
Vadim Zeitlin
16ba1daebf Use wxOVERRIDE in wx/osx/cocoa/dataview.h
No real changes, just add wxOVERRIDE.
2021-04-24 00:38:29 +02:00
Vadim Zeitlin
e46b6d7758 Also remove useless wxDataViewCtrl::OnMouse() from Mac version
This empty event handler doesn't do anything useful.
2021-04-24 00:32:14 +02:00
Vadim Zeitlin
ccdfd28b48 Remove empty wxDataViewCtrl::OnChar() added in the parent commit
This is not really useful to have, so just remove it.
2021-04-24 00:31:17 +02:00
Stefan Csomor
26d6f82a81 Implement EVT_CHAR generation for wxDataViewCtrl under Mac
This requires manually sending the original key event back to the native
control because NSOutlineView doesn't implement the NSTextInputClient
protocol and so doesn't allow handling the keys in the usual way.
2021-04-24 00:30:30 +02:00
Stefan Csomor
18c45321f4 Return bool from wxWidgetCocoaImpl::doCommandBySelector()
This allows to determine whether the event was handled by wx code and
perform further processing by feeding things back to native code if not.
2021-04-24 00:27:26 +02:00
Vadim Zeitlin
72500faf7c Add wxCursor ctor from XPM data to all ports
This just uses the existing wxImage ctor from XPM data and wxCursor ctor
from wxImage, but will allow the code creating cursors from XPM to still
work even when wxImage ctor from XPM is made explicit.

Add a trivial test just to check that the new ctor can be used.
2021-04-18 01:14:36 +01:00
Vadim Zeitlin
9c6e67cac0 Rename Mac wxCursor::CreateFromImage() to InitFromImage()
Use the same name as in the other ports for the function doing the same
thing, there doesn't seem to be any good reason to name it differently.

Also avoid declaring it when wxUSE_IMAGE==0 as it's not defined in this
case (again, consistently with the other ports).
2021-04-18 00:59:52 +01:00
Vadim Zeitlin
b26fd44c77 Consistently declare wxCursor(wxImage) ctor when wxUSE_IMAGE==1
wxGTK already did it like this, but also only declared ctor not taking
wxImage in this case, while wxMSW and wxMac declared this ctor in any
case, even when wxUSE_IMAGE==0, but didn't define it then.

This doesn't matter much anyhow, as the build with wxUSE_IMAGE==0 is
clearly broken and these changes are not enough to fix it, but be at
least somewhat consistent and:

1. Don't declare methods using a class which is not available at all.
2. Do define methods using wxImage only internally, even if they do
   nothing when it's not available.

No real changes.
2021-04-18 00:59:52 +01:00
Václav Slavík
db3e54b3dc macOS: Don't interfere with native views' drag and drop
wxWidgetCocoaImpl injects implementation of several
NSDraggingDestination protocol methods, but never called their base
implementations, presumably on the assumption that drag and drop is
explicitly supported and not builtin into native NSView-derived
controls.

This prevented native builtin d'n'd in e.g. NSTextView (text can be
copied and inserted by dragging it to the insertion point) from
working. Fixed by always calling base implementation.

Closes https://github.com/wxWidgets/wxWidgets/pull/2320
2021-04-14 17:59:28 +02:00
Vadim Zeitlin
dc5f1711f2 Upgrade version to 3.1.6
Run misc/scripts/inc_release, bakefile_gen and autoconf.
2021-04-14 17:57:27 +02:00
Vadim Zeitlin
b671d230f2 Merge remote-tracking branch 'MaartenBent/bitmap_cursor_osx'
Add wxBitmap(const wxCursor &cursor) constructor to wxOSX.

See https://github.com/wxWidgets/wxWidgets/pull/2314
2021-04-11 16:46:58 +02:00
Igor Korot
9394d26c40 Implement wxBitmap(const wxCursor&) constructor for OSX 2021-04-10 14:17:27 +02:00
Vadim Zeitlin
a02690f957 Merge branch 'mac-dvc-autosize'
Fixes for wxDVC columns autosizing under Mac.

See https://github.com/wxWidgets/wxWidgets/pull/2305
2021-04-08 01:39:21 +02:00
Stefan Csomor
26bc2c015b remove obsolete macOS SDK guards
we need SDK 10.11 now
2021-04-07 16:37:58 +02:00
Tobias Taschner
0ff1bdec09 Add wxFullScreenEvent for macOS
Send a wxFullScreenEvent when the user enters or exits full screen on
macOS. EnableFullScreenView() has to be used to enable the native
full screen API.

Closes https://github.com/wxWidgets/wxWidgets/pull/2284
2021-04-06 19:01:25 +02:00
Andreas Falkenhahn
c9221fd538 Fix sizing of temporarily last columns in macOS wxDataViewCtrl
Update the column width if it used to be the last one but isn't last one
any longer.

Closes #14939.
2021-04-04 17:48:25 +02:00
Vadim Zeitlin
802c81fff7 Merge branch 'mac-search-menu-check'
Fix check items state in wxSearchCtrl menu under macOS.

See https://github.com/wxWidgets/wxWidgets/pull/2304
2021-04-04 17:04:18 +02:00
Vadim Zeitlin
9c1c4817db Remove unused senderWindow argument of wxMenu::HandleCommandXXX()
This parameter isn't used anywhere, so just remove it to simplify the
code.
2021-04-04 14:29:34 +02:00
Vadim Zeitlin
0f1d1d2ae9 Update wxSearchCtrl popup menu state after showing it
Fix the state of the check/radio items in the menu by updating the
template used by macOS to create the actual menu after showing it and
possibly changing the items state.

This is not ideal because changing the state from the program, e.g.
using wxMenuItem::Check(), still doesn't work correctly, i.e. isn't
reflected in the menu when it's shown, but better than nothing until a
better solution (which ideally would update the menu just before showing
it, but it's not clear how exactly can we do it, knowing that we don't
get wxEVT_MENU_OPEN for this menu neither) can be found.
2021-04-04 14:21:27 +02:00
Vadim Zeitlin
5f482e15ab Merge branch 'osx-set-color-without-font'
Set colour without changing font in wxOSX.

See https://github.com/wxWidgets/wxWidgets/pull/2278
2021-04-04 14:19:39 +02:00
Tobias Taschner
e63fd03611 macOS: Improve wxWebView::Paste()
The default (javascript) implementation presents the user with a popup
menu containing a single 'Paste' menu item.
Send this action to directly paste as expected.
2021-03-26 10:28:48 +01:00
Stefan Csomor
d1c0d3b18c keeping the OSX specific use of origin for non-native borders
fixes #19108
2021-03-20 22:09:31 +01:00
Tobias Taschner
18f5b01cc6 Implement user agent access for macOS 2021-03-17 09:42:01 +01:00
Stefan Csomor
0afd3143d8 support building against iOS 12 SDK
where UIMenuElement is not present yet
2021-03-15 08:43:15 +01:00
Vadim Zeitlin
ac4634b294 Update just the colour, not font, in wxOSX SetForegroundColour()
Calling wxWindow::SetForegroundColour() also changed the window font,
which was unexpected and unnecessary.

Add a separate peer SetForegroundColour() method and implement it to
change just the colour in Cocoa version (and leave unimplemented, just
as it was before, for iOS) and use it in wxWindow to avoid the font
change.
2021-03-13 23:03:28 +01:00
Vadim Zeitlin
ede4ff9490 Factor out wxWidgetCocoaImpl::GetViewWithText()
Extract this function from wxWidgetCocoaImpl::SetFont() to allow its
reuse.

No changes, this is a pure refactoring.
2021-03-13 23:01:21 +01:00
Václav Slavík
aa2a291891 Support underline and strikethrough in wxMarkupToAttrString
Honor wxFont's strikethrough and underline attributes when converting
label markup to NSAttributedString. On macOS, strikethrough and
underline are properties of (rich) text, not of fonts, so a conversion
like this is necessary.
2021-03-13 19:38:16 +01:00
Tobias Taschner
4ab9ee32a8 macOS: Implement access to dev tools for wxWebView 2021-03-08 12:32:53 +01:00
Tobias Taschner
a27f73367c Implement AddUserScript() for WKWebView backend 2021-02-28 19:55:19 +01:00
Tobias Taschner
04d22cc9f6 Add RemoveScriptMessage handler and return bool 2021-02-26 16:59:57 +01:00
Tobias Taschner
a7ff7a8012 Implement script message for WKWebView backend 2021-02-26 16:59:56 +01:00
Tobias Taschner
e0c705648f Add missing wxOVERRIDE to wxWebViewFactoryWebKit 2021-02-08 09:20:53 +01:00
Tobias Taschner
8a9db461ff Implement wxWebView::GetVersionInfo() for macOS
Return the operating system version as the WebKit
version used by WKWebView is bound to the OS.
(Also works for iOS)
2021-02-07 22:14:18 +01:00
Vadim Zeitlin
67fc7c5508 Merge branch 'remove-setup0.h'
Drop wx/setup0.h files hack and just use wx/setup.h.

See https://github.com/wxWidgets/wxWidgets/pull/2205
2021-02-06 14:26:25 +01:00
Tobias Taschner
d17e8978a6 Make wxWebView::RunScript() const 2021-02-05 22:18:31 +01:00
Tobias Taschner
b351e7762d Move common wxWebView code to base class
Removes duplicate code in the various webview backends
2021-02-05 22:18:29 +01:00
Vadim Zeitlin
d1810b0dce Remove setup0.h files
Simplify things by putting setup.h files themselves under version
control and getting rid of setup0.h ones.

The initial motivation for using separate setup0.h files was to allow
having local changes to setup.h, but with Git there is a simple way to
do it by using "git update-index --skip-worktree include/wx/msw/setup.h"
for example, so we don't really need setup0.h any more and dropping them
makes things simpler.
2021-01-31 19:02:56 +01:00
Stefan Csomor
f8af2601c2 Add wxOSX_VERIFY_NOERR macro and use it in wxOSX code
This macro replaces the deprecated __Verify_noErr defined in the SDK.

It is different from assert, as the expression given to the macro is
always evaluated and then, if the result is not zero, and asserts are
on, an assert containing a human readable message with the description
of the error code is triggered.

Closes https://github.com/wxWidgets/wxWidgets/pull/1973

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2021-01-17 23:57:38 +01:00
Vadim Zeitlin
febd185fc6 Merge branch 'web-request'
Add wxWebViewRequest and related classes allowing to use HTTPS and
HTTP/2.

See https://github.com/wxWidgets/wxWidgets/pull/977
2021-01-17 18:19:47 +01:00
Vadim Zeitlin
9c66a9a8db Merge branch 'macos-native-statusbar' of https://github.com/vslavik/wxWidgets
Improve macOS status bar appearance and simplify code.

See https://github.com/wxWidgets/wxWidgets/pull/2160
2021-01-16 18:57:23 +01:00
Václav Slavík
634f60ff23 Remove redundant code from wxStatusBarMac
Remove a lot of Mac-specific code from wxStatusBarMac in favour of using
shared wxStatusBarGeneric:

- Now that wxFRAME_EX_METAL aka NSWindowStyleMaskTexturedBackground
  doesn’t affect text placement, there’s no reason for customized
  DrawFieldText(). As a side effect of this removal, ellipsizing fields
  is now supported.

- Remove customized DoUpdateStatusText() code that is no longer needed.

See https://github.com/wxWidgets/wxWidgets/pull/2160#pullrequestreview-563916013
2021-01-16 18:30:55 +01:00
Vadim Zeitlin
717e6590bd Merge branch 'macos_wkwebview' of https://github.com/TcT2k/wxWidgets
Use WKWebView for wxWebView Implementation under Apple systems.

See https://github.com/wxWidgets/wxWidgets/pull/2113
2021-01-16 16:20:58 +01:00
Vadim Zeitlin
508a4f6ca8 Fix Cancel() semantics under MSW and other improvements to it
Under MSW, don't set the state to State_Cancelled as soon as Cancel()
was called, as the request was still used from the other threads
afterwards, resulting in race conditions and crashes.

Fix this by just removing the SetState(State_Cancelled) call from the
main thread, as it was redundant anyhow. This also makes the behaviour
correspond to the documentation, which indicates that Cancel() works
asynchronously.

Also ensure, for all backends, that we actually cancel the request only
once, even if public Cancel() is called multiple times. This required
renaming the existing wxWebRequestImpl::Cancel() to DoCancel().
2021-01-16 13:50:29 +01:00
Vadim Zeitlin
65aad890e3 Add GetNativeHandle() to wxWebSession and wxWebRequest
This allows to retrieve the handles used internally in order to do
something not supported by the public API yet.
2021-01-16 00:21:00 +01:00
Vadim Zeitlin
70e7861a7d Implement authentication support for wxWebRequest under Mac
Add wxWebAuthChallengeURLSession and use the appropriate delegate
callback to create it.
2021-01-15 00:46:45 +01:00
Vadim Zeitlin
d0f56b1d04 Document wxWebResponse::GetContentLength()
Also change its return type from wxInt64 to wxFileOffset for consistency
with all the other length/progress-related functions in wxWebRequest.
2021-01-12 03:25:16 +01:00
Václav Slavík
e687d0c4f6 Render statusbar natively on macOS
Instead of trying to mimic native statusbar background rendering in our
own code, use NSWindow setContentBorderThickness:forEdge: to extend the
border that is drawn by the system. This is the canonical way of doing
statusbars ("bottom bar") in AppKit.

The text is still drawn generically, but that's a much smaller issue
than trying to match the border gradient.
2020-12-31 18:51:46 +01:00