Skip to main content

euv_core/scene/kind/
struct.rs

1use super::*;
2
3/// Decoded RGBA8 image buffer rendered uniformly by software and hardware backends.
4#[derive(Clone, Debug, Default, Getter)]
5pub struct ImageBuffer {
6    /// Monotonic unique identifier assigned on construction for O(1) texture caching.
7    #[get(type(copy))]
8    pub(crate) id: u64,
9    /// Image width in pixels.
10    #[get(type(copy))]
11    pub(crate) width: u32,
12    /// Image height in pixels.
13    #[get(type(copy))]
14    pub(crate) height: u32,
15    /// Shared zero-copy packed RGBA8 pixel bytes (`width * height * 4`).
16    #[get(skip)]
17    pub(crate) pixels: Arc<[u8]>,
18}
19
20/// Interactive text input state stored on `NodeKind::Input`.
21#[derive(Clone, Data, Debug, Default, Eq, PartialEq)]
22pub struct InputNodeState {
23    /// Current UTF-8 value entered by the user.
24    #[set(skip)]
25    pub(crate) value: String,
26    /// Placeholder text displayed when `value` is empty.
27    pub(crate) placeholder: String,
28    /// Byte offset of the caret inside `value`.
29    #[get(type(copy))]
30    pub(crate) caret: usize,
31    /// Optional byte offset of the selection anchor inside `value` (`None` when collapsed).
32    #[get(type(copy))]
33    pub(crate) selection_anchor: Option<usize>,
34    /// Whether characters should be masked as a password field.
35    #[get(type(copy))]
36    pub(crate) password: bool,
37    /// Whether multi-line input is enabled.
38    #[get(type(copy))]
39    pub(crate) multiline: bool,
40    /// Whether input is disabled.
41    #[get(type(copy))]
42    pub(crate) disabled: bool,
43}