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