BlueGit

ict rusty-teams

Files

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

mod.rs

mod.rs 1.4 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_notifications;
10#[cfg(target_os = "linux")]
11mod linux_tray;
12#[cfg(not(windows))]
13mod stub;
14#[cfg(target_os = "linux")]
15mod x11_input;
16#[cfg(target_os = "linux")]
17pub use linux_notifications::{
18 BusNotification, DesktopNotifications, NotificationEvent, NotificationImage,
19 notifications_inhibited,
20};
21#[cfg(target_os = "linux")]
22pub use linux_tray::Tray;
23#[cfg(not(windows))]
24pub use stub::*;
25
26pub type NativeHandle = isize;
27
28#[cfg_attr(not(windows), allow(dead_code))]
29mod stack_plan;
30
31#[derive(Debug, Clone, Copy, PartialEq)]
32pub struct WorkArea {
33 pub left: i32,
34 pub top: i32,
35 pub right: i32,
36 pub bottom: i32,
37 pub scale: f32,
38}
39
40#[derive(Debug, Clone, Copy, PartialEq, Eq)]
41pub struct ScreenRect {
42 pub left: i32,
43 pub top: i32,
44 pub right: i32,
45 pub bottom: i32,
46}
47
48impl ScreenRect {
49 pub fn width(&self) -> i32 {
50 self.right - self.left
51 }
52
53 pub fn height(&self) -> i32 {
54 self.bottom - self.top
55 }
56}
57
58#[derive(Debug, Clone, Copy, PartialEq)]
59pub struct ShareGeometry {
60 pub target: ScreenRect,
61 pub work: WorkArea,
62}
63
64#[derive(Debug, Clone, Copy, PartialEq, Eq)]
65pub enum TrayCommand {
66 Toggle,
67 Open,
68 ToggleSound,
69 ToggleDoNotDisturb,
70 Settings,
71 Quit,
72}