Skip to main content

euv_core/scene/kind/
enum.rs

1use super::*;
2
3/// Caching strategy controlling whether a `NodeKind::Canvas` repaints every frame or can be retained in `PaintFragmentCache`.
4#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
5pub enum CanvasCaching {
6    /// Dynamic canvas repainted on every display-list pass (e.g. live 2D/3D viewports or animated charts).
7    #[default]
8    DynamicPerFrame,
9    /// Static vector canvas whose emitted draw commands remain stable for a given style and bounds (e.g. icons and brand emblems).
10    RetainedStatic,
11}
12
13/// Semantic kind of a node in the cross-platform retained scene graph.
14#[derive(Clone, Debug, Default, Eq, PartialEq)]
15pub enum NodeKind {
16    /// Generic layout and paint box container.
17    #[default]
18    View,
19    /// Text run node carrying UTF-8 content.
20    Text(String),
21    /// Decoded bitmap image node.
22    Image(ImageBuffer),
23    /// Custom vector/2D canvas surface invoking a draw callback with its caching policy.
24    Canvas(CanvasCaching),
25    /// Editable text input node with caret and IME support.
26    Input(InputNodeState),
27    /// Clipped scrollable container node.
28    ScrollView,
29    /// Overlay layer rendered above normal document flow.
30    Portal,
31    /// Logical grouping container without its own box paint.
32    Fragment,
33}