You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
803 B

use std::{sync::mpsc::Receiver};
#[cfg_attr(unix, path = "linux/mod.rs")]
#[cfg_attr(windows, path = "windows/mod.rs")]
#[cfg_attr(mac, path = "windows/mod.rs")]
pub mod platform_impl;
#[derive(Debug, Clone, Copy)]
pub struct Bounds {
pub x: i32,
pub y: i32,
pub width: i32,
pub height: i32,
}
#[derive(Debug, Clone, Copy)]
pub enum UnderlayEvent {
Attach {
bounds: Bounds,
has_access: bool,
is_fullscreen: Option<bool>,
},
Detach,
MoveResize(Bounds),
Focus,
Blur,
X11FullscreenEvent{ is_fullscreen: bool }
}
pub fn register<T: Into<String>>(window_title: T) -> Receiver<UnderlayEvent> {
let (tx,rx) = std::sync::mpsc::channel();
platform_impl::init(window_title.into(), tx).expect("Catastrophe");
return rx;
}