| 1 | #[cfg(windows)] |
| 2 | mod windows_impl; |
| 3 | #[cfg(windows)] |
| 4 | pub use windows_impl::*; |
| 5 | |
| 6 | #[cfg(target_os = "linux")] |
| 7 | mod x11_input; |
| 8 | #[cfg(not(windows))] |
| 9 | mod stub; |
| 10 | #[cfg(not(windows))] |
| 11 | pub use stub::*; |
| 12 | |
| 13 | pub type NativeHandle = isize; |
| 14 | |
| 15 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 16 | pub struct WorkArea { |
| 17 | pub left: i32, |
| 18 | pub top: i32, |
| 19 | pub right: i32, |
| 20 | pub bottom: i32, |
| 21 | pub scale: f32, |
| 22 | } |
| 23 | |
| 24 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 25 | pub struct ScreenRect { |
| 26 | pub left: i32, |
| 27 | pub top: i32, |
| 28 | pub right: i32, |
| 29 | pub bottom: i32, |
| 30 | } |
| 31 | |
| 32 | impl ScreenRect { |
| 33 | pub fn width(&self) -> i32 { |
| 34 | self.right - self.left |
| 35 | } |
| 36 | |
| 37 | pub fn height(&self) -> i32 { |
| 38 | self.bottom - self.top |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 43 | pub struct ShareGeometry { |
| 44 | pub target: ScreenRect, |
| 45 | pub work: WorkArea, |
| 46 | } |
| 47 | |
| 48 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 49 | pub enum TrayCommand { |
| 50 | Toggle, |
| 51 | Open, |
| 52 | ToggleSound, |
| 53 | ToggleDoNotDisturb, |
| 54 | Settings, |
| 55 | Quit, |
| 56 | } |