euv-core 0.41.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::*;

/// Available layout space passed down during a layout pass and cached for clean-subtree skipping.
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct AvailableSpace {
    /// Available horizontal extent in logical pixels.
    #[get(type(copy))]
    pub(crate) width: f32,
    /// Available vertical extent in logical pixels.
    #[get(type(copy))]
    pub(crate) height: f32,
    /// Root viewport size for `vw`/`vh` length resolution.
    #[get(type(copy))]
    pub(crate) viewport: Size,
    /// Origin X coordinate where this node is placed.
    #[get(type(copy))]
    pub(crate) origin_x: f32,
    /// Origin Y coordinate where this node is placed.
    #[get(type(copy))]
    pub(crate) origin_y: f32,
    /// Whether the parent stretched this node's width to fill `width` when its declared width is `Length::Auto`.
    #[get(type(copy))]
    #[new(skip)]
    pub(crate) stretch_width: bool,
    /// Whether the parent stretched this node's height to fill `height` when its declared height is `Length::Auto`.
    #[get(type(copy))]
    #[new(skip)]
    pub(crate) stretch_height: bool,
}

/// Internal container constraint bundle passed to child layout solvers.
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub(crate) struct ContainerFrame {
    /// Parent layout properties.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) parent_layout: LayoutStyle,
    /// Inner available dimensions inside padding and border.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) inner_avail: Size,
    /// Root viewport logical size.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) viewport: Size,
    /// Content origin in root coordinates.
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) content_origin: Point,
    /// Whether the container's outer width is definite (explicit length, aspect ratio, or parent stretch).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) definite_width: bool,
    /// Whether the container's outer height is definite (explicit length, aspect ratio, or parent stretch).
    #[get(pub(crate), type(copy))]
    #[get_mut(pub(crate))]
    #[set(pub(crate))]
    pub(crate) definite_height: bool,
}

/// Telemetry counters recorded per layout pass.
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, New, Ord, PartialEq, PartialOrd)]
pub struct LayoutStats {
    /// Number of nodes laid out during this pass.
    #[get(type(copy))]
    pub(crate) nodes_computed: usize,
    /// Number of clean subtrees skipped in O(1) via constraint caching.
    #[get(type(copy))]
    pub(crate) subtrees_skipped: usize,
}