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