pub extern crate wasm_bindgen; pub extern crate web_sys; extern crate xloop_types as types; pub mod app; pub mod error; pub mod win; pub mod prelude {} #[derive(Debug)] pub struct Platform; impl types::Platform for Platform { type Error = error::Error; type AppRef<'a> = app::AppRef<'a>; type AppHandle = app::AppHandle; type AppProxy = app::AppProxy; type WinRef<'a> = win::WinRef<'a>; type WinHandle = win::WinHandle; type WinRaw = win::WinRaw; type EvtMouse<'a> = win::WinMouse<'a>; type EvtWheel<'a> = win::WinWheel<'a>; type EvtKey<'a> = win::WinKey<'a>; type EvtTouch<'a> = win::WinTouch<'a>; type EvtCommit<'a> = &'a types::EvtCommit; fn run(delegate: impl types::AppDelegate + 'static) -> Result, Self::Error> { app::with_app(Some(std::rc::Rc::new(delegate)), |_| {}); use types::AppHandle as _; app::AppHandle::singleton().ok_or(error::Error)?.run(); Ok(None) } fn win(_key: impl AsRef, delegate: impl types::WinDelegate + 'static) -> Result { unsafe { win::WinHandle::new(_key, delegate).ok_or(error::Error) } } fn log(level: log::LevelFilter) { console_log::init_with_level(level.to_level().unwrap_or(log::Level::Info)).ok(); } fn read(_path: impl AsRef) -> Option> { None } }