1pub mod layout;
2pub mod node;
3pub mod span;
4pub mod style;
5pub mod theme;
6
7use std::collections::HashMap;
8
9pub use layout::{
10 Alignment, Breakpoint, Direction, Justification, LayoutConstraints, Length, Padding,
11};
12pub use node::InterpolatedPart;
13pub use node::{AttributeValue, EventBinding, EventKind, WidgetKind, WidgetNode};
14pub use span::Span;
15pub use style::{
16 Background, Border, BorderRadius, BorderStyle, Color, Gradient, ImageFit, Shadow,
17 StyleProperties, Transform,
18};
19pub use theme::{
20 FontWeight, IcedPaletteColors, SpacingScale, StateSelector, StyleClass, Theme, ThemeDocument,
21 ThemeError, ThemeErrorKind, ThemePalette, Typography, WidgetState,
22};
23
24#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
39pub struct DampenDocument {
40 pub version: SchemaVersion,
42
43 pub root: WidgetNode,
45
46 pub themes: HashMap<String, crate::ir::theme::Theme>,
48
49 pub style_classes: HashMap<String, crate::ir::theme::StyleClass>,
51
52 pub global_theme: Option<String>,
54}
55
56impl Default for DampenDocument {
57 fn default() -> Self {
59 Self {
60 version: SchemaVersion { major: 1, minor: 0 },
61 root: WidgetNode::default(),
62 themes: HashMap::new(),
63 style_classes: HashMap::new(),
64 global_theme: None,
65 }
66 }
67}
68
69#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
77pub struct SchemaVersion {
78 pub major: u16,
80 pub minor: u16,
82}
83
84impl Default for SchemaVersion {
85 fn default() -> Self {
87 Self { major: 1, minor: 0 }
88 }
89}