| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | // cSpell: ignore sharedvector textlayout |
| 5 | |
| 6 | #![doc = include_str!("README.md" )] |
| 7 | #![doc (html_logo_url = "https://slint.dev/logo/slint-logo-square-light.svg" )] |
| 8 | #![deny (unsafe_code)] |
| 9 | #![no_std ] |
| 10 | |
| 11 | extern crate alloc; |
| 12 | #[cfg (feature = "std" )] |
| 13 | extern crate std; |
| 14 | |
| 15 | #[cfg (all(not(feature = "std" ), feature = "unsafe-single-threaded" ))] |
| 16 | pub(crate) mod unsafe_single_threaded; |
| 17 | #[cfg (all(not(feature = "std" ), not(feature = "unsafe-single-threaded" )))] |
| 18 | compile_error!( |
| 19 | "At least one of the following feature need to be enabled: `std` or `unsafe-single-threaded`" |
| 20 | ); |
| 21 | #[cfg (all(not(feature = "std" ), feature = "unsafe-single-threaded" ))] |
| 22 | use crate::unsafe_single_threaded::thread_local; |
| 23 | #[cfg (feature = "std" )] |
| 24 | use std::thread_local; |
| 25 | |
| 26 | pub mod accessibility; |
| 27 | pub mod animations; |
| 28 | pub mod api; |
| 29 | pub mod callbacks; |
| 30 | pub mod component_factory; |
| 31 | pub mod context; |
| 32 | pub mod date_time; |
| 33 | pub mod future; |
| 34 | pub mod graphics; |
| 35 | pub mod input; |
| 36 | pub mod item_focus; |
| 37 | pub mod item_rendering; |
| 38 | pub mod item_tree; |
| 39 | pub mod items; |
| 40 | pub mod layout; |
| 41 | pub mod lengths; |
| 42 | pub mod menus; |
| 43 | pub mod model; |
| 44 | pub mod platform; |
| 45 | pub mod properties; |
| 46 | pub mod renderer; |
| 47 | #[cfg (feature = "rtti" )] |
| 48 | pub mod rtti; |
| 49 | pub mod sharedvector; |
| 50 | pub mod slice; |
| 51 | #[cfg (feature = "software-renderer" )] |
| 52 | pub mod software_renderer; |
| 53 | pub mod string; |
| 54 | pub mod tests; |
| 55 | pub mod textlayout; |
| 56 | pub mod timers; |
| 57 | pub mod translations; |
| 58 | pub mod window; |
| 59 | |
| 60 | #[doc (inline)] |
| 61 | pub use string::SharedString; |
| 62 | |
| 63 | #[doc (inline)] |
| 64 | pub use sharedvector::SharedVector; |
| 65 | |
| 66 | #[doc (inline)] |
| 67 | pub use graphics::{ImageInner, StaticTextures}; |
| 68 | |
| 69 | #[doc (inline)] |
| 70 | pub use properties::Property; |
| 71 | |
| 72 | #[doc (inline)] |
| 73 | pub use callbacks::Callback; |
| 74 | |
| 75 | #[doc (inline)] |
| 76 | pub use graphics::Color; |
| 77 | |
| 78 | #[doc (inline)] |
| 79 | pub use graphics::Brush; |
| 80 | |
| 81 | #[doc (inline)] |
| 82 | pub use graphics::RgbaColor; |
| 83 | |
| 84 | #[cfg (feature = "std" )] |
| 85 | #[doc (inline)] |
| 86 | pub use graphics::PathData; |
| 87 | |
| 88 | #[doc (inline)] |
| 89 | pub use graphics::BorderRadius; |
| 90 | |
| 91 | pub use context::{with_global_context, SlintContext}; |
| 92 | |
| 93 | #[cfg (not(slint_int_coord))] |
| 94 | pub type Coord = f32; |
| 95 | #[cfg (slint_int_coord)] |
| 96 | pub type Coord = i32; |
| 97 | |
| 98 | /// This type is not exported from the public API crate, so function having this |
| 99 | /// parameter cannot be called from the public API without naming it |
| 100 | pub struct InternalToken; |
| 101 | |