webview_official_sys/
lib.rs

1use std::os::raw::{c_char, c_int, c_void};
2
3pub type DispatchFn = extern "C" fn(webview: webview_t, arg: *mut c_void);
4pub type BindFn = extern "C" fn(seq: *const c_char, req: *const c_char, arg: *mut c_void);
5
6#[allow(non_camel_case_types)]
7pub type webview_t = *mut c_void;
8
9extern "C" {
10    pub fn webview_create(debug: c_int, window: *mut c_void) -> webview_t;
11
12    pub fn webview_destroy(w: webview_t);
13
14    pub fn webview_run(w: webview_t);
15
16    pub fn webview_terminate(w: webview_t);
17
18    pub fn webview_dispatch(w: webview_t, fn_: Option<DispatchFn>, arg: *mut c_void);
19
20    pub fn webview_get_window(w: webview_t) -> *mut c_void;
21
22    pub fn webview_set_title(w: webview_t, title: *const c_char);
23
24    pub fn webview_set_size(w: webview_t, width: c_int, height: c_int, hints: c_int);
25
26    pub fn webview_navigate(w: webview_t, url: *const c_char);
27
28    pub fn webview_init(w: webview_t, js: *const c_char);
29
30    pub fn webview_eval(w: webview_t, js: *const c_char);
31
32    pub fn webview_bind(w: webview_t, name: *const c_char, fn_: Option<BindFn>, arg: *mut c_void);
33
34    pub fn webview_return(w: webview_t, seq: *const c_char, status: c_int, result: *const c_char);
35}