1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
pub mod c;
use std::borrow::Cow;
pub use c::BrowserWindowImpl;
pub use c::JsEvaluationError;
use super::{
application::ApplicationImpl,
cookie::CookieJarImpl,
window::{WindowImpl, WindowOptions}
};
use browser_window_c::*;
pub type BrowserWindowOptions = cbw_BrowserWindowOptions;
pub type Source = cbw_BrowserWindowSource;
pub type CreationCallbackFn = unsafe fn( bw: BrowserWindowImpl, data: *mut () );
pub type EvalJsCallbackFn = unsafe fn( bw: BrowserWindowImpl, data: *mut (), result: Result<String, JsEvaluationError> );
pub type ExternalInvocationHandlerFn = unsafe fn( bw: BrowserWindowImpl, cmd: &str, args: Vec<String> );
pub trait BrowserWindowExt: Copy {
fn cookie_jar(&self) -> CookieJarImpl;
fn eval_js( &self, js: &str, callback: EvalJsCallbackFn, callback_data: *mut () );
fn eval_js_threadsafe( &self, js: &str, callback: EvalJsCallbackFn, callback_data: *mut () );
fn navigate( &self, uri: &str );
fn new(
app: ApplicationImpl,
parent: WindowImpl,
source: Source,
title: &str,
width: Option<u32>,
height: Option<u32>,
window_options: &WindowOptions,
browser_window_options: &BrowserWindowOptions,
handler: ExternalInvocationHandlerFn,
user_data: *mut (),
creation_callback: CreationCallbackFn,
callback_data: *mut ()
);
fn user_data( &self ) -> *mut ();
fn url<'a>(&'a self) -> Cow<'a, str>;
fn window( &self ) -> WindowImpl;
}