ferroui_themes_macos/lib.rs
1//! A separately selectable macOS 26 theme for FerroUI.
2//!
3//! The compiled-XAML control foundation is copied from `ferroui-themes-winui`;
4//! the macOS package owns its resources, control templates, namespace and loader.
5//! It has no dependency on the WinUI theme crate. The original input, binding,
6//! template-part and accessibility contracts remain in FerroUI controls.
7//!
8//! ```ignore
9//! use ferroui_themes_macos::{ControlSize, MacOSTheme};
10//! let theme = MacOSTheme::new();
11//! theme.set_control_size(ControlSize::Regular);
12//! application.styles().add(theme.as_style());
13//! ```
14//!
15//! `ReduceMotion`, `ReduceTransparency`, `IncreaseContrast`, `WindowActive`,
16//! `AccentColor` and `ControlSize` are live properties usable in Rust and XAML.
17//! Glass surfaces use the existing composition material contract, with an opaque
18//! fallback on unsupported backends. Exact AppKit optical and animation fidelity
19//! requires the native comparison procedure in `docs/porting/macos26-theme.md`.
20//! SF Pro is resolved from the host; Apple fonts and symbols are not bundled.
21
22#[path = "Accents/mod.rs"]
23pub mod accents;
24mod assets;
25#[path = "Converters/mod.rs"]
26pub mod converters;
27#[path = "Primitives/mod.rs"]
28pub mod primitives;
29// `compiled_xaml`, the compiled markup of the theme: generated by the build script of the
30// crate from the documents of [`MacOSTheme`], against the type models of this crate and of
31// the crates it is built on (docs/porting/xaml.md, 9.5.13). The checked-in `compiled_xaml.rs`
32// is the reference `tests/compiled_xaml_tests.rs` compares the output of the build with, byte
33// for byte; it is not a module of the crate. (`compiled_markup`, which the same file declares,
34// is not used: the theme registers its assets and its loader table itself.)
35ferroui_markup_xaml::include_compiled_xaml!();
36mod register_types;
37mod rust_paths;
38mod macos_theme;
39mod settings_resources;
40
41pub use assets::{excluded_documents, ExcludedDocument};
42pub use register_types::{register_types, ASSEMBLY};
43pub use macos_theme::{ControlSize, DensityStyle, MacOSTheme};
44
45#[cfg(test)]
46mod tests;