BlueGit

ict rusty-teams

Files

rusty-teams / crates / app-base / src / notify / platform / mod.rs

mod.rs

09e74698 History
mod.rs 1.2 KiB Download Raw
1#[cfg(windows)]
2mod windows_impl;
3#[cfg(windows)]
4pub use windows_impl::*;
5
6#[cfg(any(target_os = "linux", target_os = "macos"))]
7mod linux_sound;
8#[cfg(target_os = "linux")]
9mod linux_tray;
10#[cfg(not(windows))]
11mod stub;
12#[cfg(target_os = "linux")]
13mod x11_input;
14#[cfg(target_os = "linux")]
15pub use linux_tray::Tray;
16#[cfg(not(windows))]
17pub use stub::*;
18
19pub type NativeHandle = isize;
20
21#[cfg_attr(not(windows), allow(dead_code))]
22mod stack_plan;
23
24#[derive(Debug, Clone, Copy, PartialEq)]
25pub 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)]
34pub struct ScreenRect {
35 pub left: i32,
36 pub top: i32,
37 pub right: i32,
38 pub bottom: i32,
39}
40
41impl 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)]
52pub struct ShareGeometry {
53 pub target: ScreenRect,
54 pub work: WorkArea,
55}
56
57#[derive(Debug, Clone, Copy, PartialEq, Eq)]
58pub enum TrayCommand {
59 Toggle,
60 Open,
61 ToggleSound,
62 ToggleDoNotDisturb,
63 Settings,
64 Quit,
65}