StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.
| 1 | pub mod app; |
| 2 | #[cfg(target_os = "linux")] |
| 3 | pub mod linux; |
| 4 | #[cfg(target_os = "macos")] |
| 5 | pub mod mac; |
| 6 | #[cfg(target_family = "wasm")] |
| 7 | pub mod wasm; |
| 8 | #[cfg(target_os = "windows")] |
| 9 | pub mod windows; |
| 10 | |
| 11 | pub mod headless; |
| 12 | |
| 13 | pub mod current { |
| 14 | cfg_if::cfg_if! { |
| 15 | if #[cfg(target_family = "wasm")] { |
| 16 | pub use super::wasm::*; |
| 17 | } else if #[cfg(target_os = "linux")] { |
| 18 | pub use super::linux::*; |
| 19 | } else if #[cfg(target_os = "macos")] { |
| 20 | pub use super::mac::*; |
| 21 | } else if #[cfg(target_os = "windows")] { |
| 22 | pub use super::windows::*; |
| 23 | } else { |
| 24 | pub use strato_ui_core::platform::test::*; |
| 25 | } |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | pub use strato_ui_core::platform::*; |
| 30 | |
| 31 | pub use app::AppBuilder; |
| 32 | |
| 33 | /// Returns whether the current device is a mobile device with touch input. |
| 34 | /// |
| 35 | /// This is a cross-platform wrapper around the platform-specific implementation. |
| 36 | pub fn is_mobile_device() -> bool { |
| 37 | #[cfg(target_family = "wasm")] |
| 38 | { |
| 39 | wasm::is_mobile_device() |
| 40 | } |
| 41 | #[cfg(not(target_family = "wasm"))] |
| 42 | { |
| 43 | false |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /// A trait for accessing internal per-platform concrete implementations |
| 48 | /// through a wrapper type. |
| 49 | #[allow(dead_code)] |
| 50 | trait AsInnerMut<Inner: ?Sized> { |
| 51 | fn as_inner_mut(&mut self) -> &mut Inner; |
| 52 | } |
| 53 |