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