Skip to content

Commit

Permalink
Add WebKit protocol bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboris committed Oct 12, 2024
1 parent c301314 commit 2561ec5
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
23 changes: 23 additions & 0 deletions WebKit/WKNavigationDelegate.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(* auto-generated, do not modify *)

[@@@ocaml.warning "-33"]
open Runtime
open Objc

open CoreFoundation
open CoreGraphics

let webView'decidePolicyForNavigationAction'decisionHandler' imp = Define.method_spec ~cmd:(selector "webView:decidePolicyForNavigationAction:decisionHandler:") ~typ:(id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v40@0:8@16@24@?32" ~imp
let webView'decidePolicyForNavigationAction'preferences'decisionHandler' imp = Define.method_spec ~cmd:(selector "webView:decidePolicyForNavigationAction:preferences:decisionHandler:") ~typ:(id @-> id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v48@0:8@16@24@32@?40" ~imp
let webView'decidePolicyForNavigationResponse'decisionHandler' imp = Define.method_spec ~cmd:(selector "webView:decidePolicyForNavigationResponse:decisionHandler:") ~typ:(id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v40@0:8@16@24@?32" ~imp
let webView'didStartProvisionalNavigation' imp = Define.method_spec ~cmd:(selector "webView:didStartProvisionalNavigation:") ~typ:(id @-> id @-> returning (void)) ~enc:"v32@0:8@16@24" ~imp
let webView'didReceiveServerRedirectForProvisionalNavigation' imp = Define.method_spec ~cmd:(selector "webView:didReceiveServerRedirectForProvisionalNavigation:") ~typ:(id @-> id @-> returning (void)) ~enc:"v32@0:8@16@24" ~imp
let webView'didFailProvisionalNavigation'withError' imp = Define.method_spec ~cmd:(selector "webView:didFailProvisionalNavigation:withError:") ~typ:(id @-> id @-> id @-> returning (void)) ~enc:"v40@0:8@16@24@32" ~imp
let webView'didCommitNavigation' imp = Define.method_spec ~cmd:(selector "webView:didCommitNavigation:") ~typ:(id @-> id @-> returning (void)) ~enc:"v32@0:8@16@24" ~imp
let webView'didFinishNavigation' imp = Define.method_spec ~cmd:(selector "webView:didFinishNavigation:") ~typ:(id @-> id @-> returning (void)) ~enc:"v32@0:8@16@24" ~imp
let webView'didFailNavigation'withError' imp = Define.method_spec ~cmd:(selector "webView:didFailNavigation:withError:") ~typ:(id @-> id @-> id @-> returning (void)) ~enc:"v40@0:8@16@24@32" ~imp
let webView'didReceiveAuthenticationChallenge'completionHandler' imp = Define.method_spec ~cmd:(selector "webView:didReceiveAuthenticationChallenge:completionHandler:") ~typ:(id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v40@0:8@16@24@?32" ~imp
let webViewWebContentProcessDidTerminate' imp = Define.method_spec ~cmd:(selector "webViewWebContentProcessDidTerminate:") ~typ:(id @-> returning (void)) ~enc:"v24@0:8@16" ~imp
let webView'authenticationChallenge'shouldAllowDeprecatedTLS' imp = Define.method_spec ~cmd:(selector "webView:authenticationChallenge:shouldAllowDeprecatedTLS:") ~typ:(id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v40@0:8@16@24@?32" ~imp
let webView'navigationAction'didBecomeDownload' imp = Define.method_spec ~cmd:(selector "webView:navigationAction:didBecomeDownload:") ~typ:(id @-> id @-> id @-> returning (void)) ~enc:"v40@0:8@16@24@32" ~imp
let webView'navigationResponse'didBecomeDownload' imp = Define.method_spec ~cmd:(selector "webView:navigationResponse:didBecomeDownload:") ~typ:(id @-> id @-> id @-> returning (void)) ~enc:"v40@0:8@16@24@32" ~imp
17 changes: 17 additions & 0 deletions WebKit/WKUIDelegate.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(* auto-generated, do not modify *)

[@@@ocaml.warning "-33"]
open Runtime
open Objc

open CoreFoundation
open CoreGraphics

let webView'createWebViewWithConfiguration'forNavigationAction'windowFeatures' imp = Define.method_spec ~cmd:(selector "webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:") ~typ:(id @-> id @-> id @-> id @-> returning (id)) ~enc:"@48@0:8@16@24@32@40" ~imp
let webViewDidClose' imp = Define.method_spec ~cmd:(selector "webViewDidClose:") ~typ:(id @-> returning (void)) ~enc:"v24@0:8@16" ~imp
let webView'runJavaScriptAlertPanelWithMessage'initiatedByFrame'completionHandler' imp = Define.method_spec ~cmd:(selector "webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:") ~typ:(id @-> id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v48@0:8@16@24@32@?40" ~imp
let webView'runJavaScriptConfirmPanelWithMessage'initiatedByFrame'completionHandler' imp = Define.method_spec ~cmd:(selector "webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:") ~typ:(id @-> id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v48@0:8@16@24@32@?40" ~imp
let webView'runJavaScriptTextInputPanelWithPrompt'defaultText'initiatedByFrame'completionHandler' imp = Define.method_spec ~cmd:(selector "webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:") ~typ:(id @-> id @-> id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v56@0:8@16@24@32@40@?48" ~imp
let webView'requestMediaCapturePermissionForOrigin'initiatedByFrame'type'decisionHandler' imp = Define.method_spec ~cmd:(selector "webView:requestMediaCapturePermissionForOrigin:initiatedByFrame:type:decisionHandler:") ~typ:(id @-> id @-> id @-> llong @-> (ptr void) @-> returning (void)) ~enc:"v56@0:8@16@24@32q40@?48" ~imp
let webView'requestDeviceOrientationAndMotionPermissionForOrigin'initiatedByFrame'decisionHandler' imp = Define.method_spec ~cmd:(selector "webView:requestDeviceOrientationAndMotionPermissionForOrigin:initiatedByFrame:decisionHandler:") ~typ:(id @-> id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v48@0:8@16@24@32@?40" ~imp
let webView'runOpenPanelWithParameters'initiatedByFrame'completionHandler' imp = Define.method_spec ~cmd:(selector "webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:") ~typ:(id @-> id @-> id @-> (ptr void) @-> returning (void)) ~enc:"v48@0:8@16@24@32@?40" ~imp
2 changes: 2 additions & 0 deletions WebKit/WebKit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module WKNSURLRequest = WKNSURLRequest
module WKNavigation = WKNavigation
module WKNavigationAction = WKNavigationAction
module WKNavigationData = WKNavigationData
module WKNavigationDelegate = WKNavigationDelegate
module WKNavigationResponse = WKNavigationResponse
module WKNetworkSessionDelegate = WKNetworkSessionDelegate
module WKNetworkSessionDelegateAllowingOnlyNonRedirectedJSON = WKNetworkSessionDelegateAllowingOnlyNonRedirectedJSON
Expand Down Expand Up @@ -143,6 +144,7 @@ module WKTextInputWindowControllerClass = WKTextInputWindowControllerClass
module WKTextListTouchBarViewController = WKTextListTouchBarViewController
module WKTextTouchBarItemController = WKTextTouchBarItemController
module WKTypeRefWrapper = WKTypeRefWrapper
module WKUIDelegate = WKUIDelegate
module WKURLSchemeTaskImpl = WKURLSchemeTaskImpl
module WKUserContentController = WKUserContentController
module WKUserContentControllerClass = WKUserContentControllerClass
Expand Down
3 changes: 3 additions & 0 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ open AppKit
let win_width = 400.
let win_height = 300.

let m = NSTableViewDelegate.tableViewSelectionDidChange' (fun _self _cmd _tv -> ())
let _ = Class.define ~methods: [m] "Hola"

let app_window () =
let win =
alloc NSWindow.self
Expand Down

0 comments on commit 2561ec5

Please sign in to comment.