#[cfg(not(any(feature = "gtk", feature = "edge2")))]
pub mod c;
#[cfg(feature = "edge2")]
mod edge2;
#[cfg(feature = "gtk")]
mod webkit;
use std::borrow::Cow;
use browser_window_c::*;
#[cfg(not(any(feature = "gtk", feature = "edge2")))]
pub use c::{BrowserWindowImpl, JsEvaluationError};
#[cfg(feature = "edge2")]
pub use edge2::{BrowserWindowImpl, JsEvaluationError};
#[cfg(feature = "gtk")]
pub use webkit::{BrowserWindowImpl, JsEvaluationError};
use super::{
application::ApplicationImpl,
cookie::CookieJarImpl,
window::{WindowImpl, WindowOptions},
};
use crate::{browser::Source, prelude::JsValue};
pub type BrowserWindowOptions = cbw_BrowserWindowOptions;
pub type CreationCallbackFn = fn(bw: BrowserWindowImpl, data: *mut ());
pub type EvalJsCallbackFn =
fn(bw: BrowserWindowImpl, data: *mut (), result: Result<JsValue, JsEvaluationError>);
pub type ExternalInvocationHandlerFn = fn(bw: BrowserWindowImpl, cmd: &str, args: Vec<JsValue>);
pub trait BrowserWindowExt: Clone {
fn cookie_jar(&self) -> Option<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 free(&self);
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;
}