#[macro_use]
extern crate lazy_static;
pub mod event;
pub mod prelude;
pub mod window_adapter;
pub use orbtk_utils::prelude as utils;
#[cfg(all(not(target_arch = "wasm32"), feature = "pfinder"))]
#[path = "glutin/mod.rs"]
pub mod platform;
#[cfg(all(
not(target_arch = "wasm32"),
feature = "default",
not(feature = "pfinder")
))]
#[path = "minifb/mod.rs"]
pub mod platform;
#[cfg(not(target_arch = "wasm32"))]
pub mod native;
#[cfg(target_arch = "wasm32")]
#[path = "web/mod.rs"]
pub mod platform;
pub use orbtk_render::prelude as render;
use std::{collections::HashMap, sync::mpsc};
#[derive(Clone, Debug)]
pub enum WindowRequest {
Redraw,
Close,
ChangeTitle(String),
}
pub enum ShellRequest<W>
where
W: window_adapter::WindowAdapter,
{
CreateWindow(W, WindowSettings, mpsc::Receiver<WindowRequest>),
None,
}
impl<W> Default for ShellRequest<W>
where
W: window_adapter::WindowAdapter,
{
fn default() -> Self {
ShellRequest::None
}
}
#[derive(Clone, Debug, Default)]
pub struct WindowSettings {
pub title: String,
pub borderless: bool,
pub resizeable: bool,
pub always_on_top: bool,
pub position: (f64, f64),
pub size: (f64, f64),
pub fonts: HashMap<String, &'static [u8]>,
}