ferroui_themes_winui/lib.rs
1//! ferroui-themes-winui
2//!
3//! The WinUI theme: the control styles, templates and theme resources of
4//! WinUI 3 (microsoft-ui-xaml), ported to the controls of FerroUI, in a
5//! light, a dark and a high contrast variant and in a normal and a compact
6//! density (docs/porting/winui-theme.md).
7//!
8//! The theme is markup: `WinUITheme.xaml` (the document of the
9//! [`WinUITheme`] class), `Resources/*.xaml` (one document per source
10//! document of the theme of WinUI: the colours, brushes, sizes and the other
11//! theme resources, written by `scripts/winui-theme/convert.py`, with the
12//! system colours and the outlines of the symbol glyphs),
13//! `DensityStyles/Compact.xaml`, `Controls/WinUIControls.xaml` (the list of
14//! the control themes) and one document per control under `Controls/`. The
15//! documents belong to the assembly `FerroUI.Themes.WinUI`, with the URIs
16//! `ferres://FerroUI.Themes.WinUI/<path>`. They are compiled into the crate
17//! and are not embedded as assets: a load by URI goes to the loader table of
18//! the compiled markup, which answers the public document `WinUITheme.xaml`
19//! (see `build.rs`).
20//!
21//! ```ignore
22//! application.styles().add(WinUITheme::new().as_style());
23//! ```
24//!
25//! The theme variants are the light and dark variants of FerroUI and
26//! [`WinUITheme::high_contrast`], the high contrast variant of WinUI.
27//!
28//! [`converters`] has the value converters of WinUI that the theme resources
29//! are instances of and FerroUI's control set has no counterpart of
30//! ([`converters::CornerRadiusToThicknessConverter`]); [`primitives`] has the primitives of WinUI
31//! that its templates use and FerroUI's control set has no counterpart of
32//! ([`primitives::InfoBarPanel`], [`primitives::TabViewEqualWidthPanel`]).
33
34#[path = "Accents/mod.rs"]
35pub mod accents;
36mod assets;
37#[path = "Converters/mod.rs"]
38pub mod converters;
39#[path = "Primitives/mod.rs"]
40pub mod primitives;
41// `compiled_xaml`, the compiled markup of the theme: generated by the build script of the
42// crate from the documents of [`WinUITheme`], against the type models of this crate and of
43// the crates it is built on (docs/porting/xaml.md, 9.5.13). The checked-in `compiled_xaml.rs`
44// is the reference `tests/compiled_xaml_tests.rs` compares the output of the build with, byte
45// for byte; it is not a module of the crate. (`compiled_markup`, which the same file declares,
46// is not used: the theme registers its assets and its loader table itself.)
47ferroui_markup_xaml::include_compiled_xaml!();
48mod register_types;
49mod rust_paths;
50mod winui_theme;
51
52pub use assets::{excluded_documents, ExcludedDocument};
53pub use register_types::{register_types, ASSEMBLY};
54pub use winui_theme::{DensityStyle, WinUITheme};
55
56#[cfg(test)]
57mod tests;