mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-15 18:18:45 +00:00
C++: Improve type-safety of NativeWindowHandle API on macOS
Replace void* with forward-declared NSView/NSWindow in NativeWindowHandle::from_appkit
This commit is contained in:
parent
d0903adcaf
commit
7893ec3fd4
2 changed files with 15 additions and 3 deletions
|
|
@ -15,6 +15,16 @@ struct xcb_connection_t;
|
|||
struct wl_surface;
|
||||
struct wl_display;
|
||||
|
||||
# if defined(__APPLE__) && !defined(_WIN32) && !defined(_WIN64)
|
||||
# ifdef __OBJC__
|
||||
@class NSView;
|
||||
@class NSWindow;
|
||||
# else
|
||||
typedef struct objc_object NSView;
|
||||
typedef struct objc_object NSWindow;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
namespace slint {
|
||||
|
||||
/// This namespace contains experimental API.
|
||||
|
|
@ -378,7 +388,7 @@ public:
|
|||
|
||||
# elif defined(__APPLE__) && !defined(_WIN32) && !defined(_WIN64)
|
||||
|
||||
static NativeWindowHandle from_appkit(void *nsview, void *nswindow)
|
||||
static NativeWindowHandle from_appkit(NSView *nsview, NSWindow *nswindow)
|
||||
{
|
||||
|
||||
return { cbindgen_private::slint_new_raw_window_handle_appkit(nsview, nswindow) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue