euv-core 0.47.1

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Caching strategy controlling whether a `NodeKind::Canvas` repaints every frame or can be retained in `PaintFragmentCache`.
#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum CanvasCaching {
    /// Dynamic canvas repainted on every display-list pass (e.g. live 2D/3D viewports or animated charts).
    #[default]
    DynamicPerFrame,
    /// Static vector canvas whose emitted draw commands remain stable for a given style and bounds (e.g. icons and brand emblems).
    RetainedStatic,
}

/// Semantic kind of a node in the cross-platform retained scene graph.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub enum NodeKind {
    /// Generic layout and paint box container.
    #[default]
    View,
    /// Text run node carrying UTF-8 content.
    Text(String),
    /// Decoded bitmap image node.
    Image(ImageBuffer),
    /// Custom vector/2D canvas surface invoking a draw callback with its caching policy.
    Canvas(CanvasCaching),
    /// Editable text input node with caret and IME support.
    Input(InputNodeState),
    /// Clipped scrollable container node.
    ScrollView,
    /// Overlay layer rendered above normal document flow.
    Portal,
    /// Logical grouping container without its own box paint.
    Fragment,
}