BlueGit

ict rusty-teams

Files

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

stub.rs

09e74698 History
stub.rs 3.3 KiB Download Raw
1#[cfg(not(target_os = "linux"))]
2use std::sync::Arc;
3#[cfg(not(target_os = "linux"))]
4use std::sync::atomic::AtomicBool;
5
6use gpui_kit::Window;
7
8use calling::ShareKind;
9
10#[cfg(not(target_os = "linux"))]
11use super::TrayCommand;
12use super::{NativeHandle, ScreenRect, ShareGeometry, WorkArea};
13use crate::notify::badge::Badge;
14
15pub fn native_handle(_window: &Window) -> Option<NativeHandle> {
16 None
17}
18
19pub fn prepare_toast_window(_handle: NativeHandle) {}
20
21pub fn set_activatable(_handle: NativeHandle, _activatable: bool) {}
22
23pub fn work_area(_handle: NativeHandle) -> Option<WorkArea> {
24 None
25}
26
27pub fn work_area_at(_x: i32, _y: i32) -> Option<WorkArea> {
28 None
29}
30
31pub fn place(_handle: NativeHandle, _x: i32, _y: i32, _width: i32, _height: i32) {}
32
33pub fn place_rect(_handle: NativeHandle, _x: i32, _y: i32, _width: i32, _height: i32) {}
34
35pub fn stack_group_above(_shared: NativeHandle, _group: &[NativeHandle]) {}
36
37pub fn show_window_inactive(_handle: NativeHandle) {}
38
39pub fn exclude_from_capture(_handle: NativeHandle) {}
40
41#[cfg(target_os = "linux")]
42pub fn make_window_click_through(window: &Window) {
43 super::x11_input::make_input_transparent(window);
44}
45
46#[cfg(target_os = "linux")]
47pub fn window_transparency_available(window: &Window) -> bool {
48 super::x11_input::window_transparency_available(window)
49}
50
51#[cfg(not(target_os = "linux"))]
52pub fn window_transparency_available(_window: &Window) -> bool {
53 true
54}
55
56#[cfg(not(target_os = "linux"))]
57pub fn make_window_click_through(_window: &Window) {}
58
59#[cfg(target_os = "linux")]
60pub fn set_window_icon(window: &Window, png: &[u8]) {
61 super::x11_input::set_window_icon(window, png);
62}
63
64#[cfg(not(target_os = "linux"))]
65pub fn set_window_icon(_window: &Window, _png: &[u8]) {}
66
67pub fn window_minimized(_handle: NativeHandle) -> bool {
68 false
69}
70
71pub fn window_rect(_handle: NativeHandle) -> Option<ScreenRect> {
72 None
73}
74
75pub fn share_geometry(_kind: ShareKind, _id: u64) -> Option<ShareGeometry> {
76 None
77}
78
79pub fn system_quiet() -> bool {
80 false
81}
82
83pub fn restore_and_raise(_handle: NativeHandle) {}
84
85pub fn hide_window(_handle: NativeHandle) {}
86
87pub fn flash(_handle: NativeHandle) {}
88
89pub fn stop_flash(_handle: NativeHandle) {}
90
91pub fn set_badge(_handle: NativeHandle, _badge: Option<&Badge>) {}
92
93#[cfg(any(target_os = "linux", target_os = "macos"))]
94pub use super::linux_sound::{play_mp3, play_mp3_until, play_sound, set_sound_output};
95
96#[cfg(not(any(target_os = "linux", target_os = "macos")))]
97pub fn play_sound() {}
98
99#[cfg(not(any(target_os = "linux", target_os = "macos")))]
100pub fn set_sound_output(_device_key: Option<String>) {}
101
102#[cfg(not(any(target_os = "linux", target_os = "macos")))]
103pub fn play_mp3(_bytes: Vec<u8>) {}
104
105#[cfg(not(any(target_os = "linux", target_os = "macos")))]
106pub fn play_mp3_until(_bytes: Vec<u8>, _looped: bool, _stop: Arc<AtomicBool>) {}
107
108#[cfg(not(target_os = "linux"))]
109pub struct Tray;
110
111#[cfg(not(target_os = "linux"))]
112impl Tray {
113 pub fn new(_sound_on: bool, _do_not_disturb: bool, _icon_png: &[u8]) -> Option<Self> {
114 None
115 }
116
117 pub fn set_app_icon(&mut self, _icon_png: &[u8], _mention: bool) {}
118
119 pub fn poll(&self) -> Vec<TrayCommand> {
120 Vec::new()
121 }
122
123 pub fn sync(&self, _sound_on: bool, _do_not_disturb: bool, _mention: bool) {}
124
125 pub fn relocalize(&self) {}
126}
127
128pub fn animations_enabled() -> bool {
129 true
130}