5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 16:40:41 +08:00
wails/v3/pkg/application/webview_window_darwin.h
2023-06-18 12:24:44 +10:00

36 lines
1.1 KiB
Objective-C

//go:build darwin
#ifndef WebviewWindowDelegate_h
#define WebviewWindowDelegate_h
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface WebviewWindow : NSWindow
- (BOOL) canBecomeKeyWindow;
- (BOOL) canBecomeMainWindow;
- (BOOL) acceptsFirstResponder;
- (BOOL) becomeFirstResponder;
- (BOOL) resignFirstResponder;
- (WebviewWindow*) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation;
@property (assign) WKWebView* webView; // We already retain WKWebView since it's part of the Window.
@end
@interface WebviewWindowDelegate : NSObject <NSWindowDelegate, WKScriptMessageHandler, WKNavigationDelegate, WKURLSchemeHandler, NSDraggingDestination>
@property unsigned int windowId;
@property (retain) NSEvent* leftMouseEvent;
@property unsigned int invisibleTitleBarHeight;
@property NSWindowStyleMask previousStyleMask; // Used to restore the window style mask when using frameless
- (void)handleLeftMouseUp:(NSWindow *)window;
- (void)handleLeftMouseDown:(NSEvent*)event;
- (void)startDrag:(WebviewWindow*)window;
@end
#endif /* WebviewWindowDelegate_h */