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
11extern crate alloc;
12#[cfg(feature = "std")]
13extern crate std;
14
15#[cfg(all(not(feature = "std"), feature = "unsafe-single-threaded"))]
16pub(crate) mod unsafe_single_threaded;
17#[cfg(all(not(feature = "std"), not(feature = "unsafe-single-threaded")))]
18compile_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"))]
22use crate::unsafe_single_threaded::thread_local;
23#[cfg(feature = "std")]
24use std::thread_local;
25
26pub mod accessibility;
27pub mod animations;
28pub mod api;
29pub mod callbacks;
30pub mod component_factory;
31pub mod context;
32pub mod date_time;
33pub mod future;
34pub mod graphics;
35pub mod input;
36pub mod item_focus;
37pub mod item_rendering;
38pub mod item_tree;
39pub mod items;
40pub mod layout;
41pub mod lengths;
42pub mod menus;
43pub mod model;
44pub mod platform;
45pub mod properties;
46pub mod renderer;
47#[cfg(feature = "rtti")]
48pub mod rtti;
49pub mod sharedvector;
50pub mod slice;
51#[cfg(feature = "software-renderer")]
52pub mod software_renderer;
53pub mod string;
54pub mod tests;
55pub mod textlayout;
56pub mod timers;
57pub mod translations;
58pub mod window;
59
60#[doc(inline)]
61pub use string::SharedString;
62
63#[doc(inline)]
64pub use sharedvector::SharedVector;
65
66#[doc(inline)]
67pub use graphics::{ImageInner, StaticTextures};
68
69#[doc(inline)]
70pub use properties::Property;
71
72#[doc(inline)]
73pub use callbacks::Callback;
74
75#[doc(inline)]
76pub use graphics::Color;
77
78#[doc(inline)]
79pub use graphics::Brush;
80
81#[doc(inline)]
82pub use graphics::RgbaColor;
83
84#[cfg(feature = "std")]
85#[doc(inline)]
86pub use graphics::PathData;
87
88#[doc(inline)]
89pub use graphics::BorderRadius;
90
91pub use context::{with_global_context, SlintContext};
92
93#[cfg(not(slint_int_coord))]
94pub type Coord = f32;
95#[cfg(slint_int_coord)]
96pub 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
100pub struct InternalToken;
101