1pub mod layout;
2pub mod menu;
3pub mod node;
4pub mod span;
5pub mod style;
6pub mod theme;
7
8use std::collections::HashMap;
9
10pub use layout::{
11 Alignment, Breakpoint, Direction, Justification, LayoutConstraints, Length, Padding,
12};
13pub use menu::MenuPosition;
14pub use node::InterpolatedPart;
15pub use node::{AttributeValue, EventBinding, EventKind, WidgetKind, WidgetNode};
16pub use span::Span;
17pub use style::{
18 Background, Border, BorderRadius, BorderStyle, Color, Gradient, ImageFit, Shadow,
19 StyleProperties, Transform,
20};
21pub use theme::{
22 FontWeight, IcedPaletteColors, SpacingScale, StateSelector, StyleClass, Theme, ThemeDocument,
23 ThemeError, ThemeErrorKind, ThemePalette, Typography, WidgetState,
24};
25
26#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
41pub struct DampenDocument {
42 pub version: SchemaVersion,
44
45 pub root: WidgetNode,
47
48 pub themes: HashMap<String, crate::ir::theme::Theme>,
50
51 pub style_classes: HashMap<String, crate::ir::theme::StyleClass>,
53
54 pub global_theme: Option<String>,
56
57 pub follow_system: bool,
59}
60
61impl Default for DampenDocument {
62 fn default() -> Self {
64 Self {
65 version: SchemaVersion { major: 1, minor: 0 },
66 root: WidgetNode::default(),
67 themes: HashMap::new(),
68 style_classes: HashMap::new(),
69 global_theme: None,
70 follow_system: true,
71 }
72 }
73}
74
75#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
83pub struct SchemaVersion {
84 pub major: u16,
86 pub minor: u16,
88}
89
90impl Default for SchemaVersion {
91 fn default() -> Self {
93 Self { major: 1, minor: 0 }
94 }
95}