Skip to main content

NodeContent

Enum NodeContent 

Source
pub enum NodeContent {
    Container,
    Text(TextId),
    Edit(Key),
    Image(ImageId, ImageOpts),
    Line(LineId),
    Cells(CellsId),
    Fragment(FragmentDrawId),
    Polygon(FragmentDrawId),
    Path(PathId),
}

Variants§

§

Container

§

Text(TextId)

§

Edit(Key)

Editable text; retained state lives in the core’s EditStore.

§

Image(ImageId, ImageOpts)

A host-registered image (see Resources), drawn from the atlas or from a texture of its own as the entry’s backing says, met by its box as opts say.

§

Line(LineId)

A stroke through a run of points: one segment quad per straight piece (see crate::line). The node is a float sized to the stroke’s bounding box, so it takes no room, and its bg is the stroke colour. In its parent’s box space it paints in the parent’s layer at its place in the tree (NodeContent::drawn_in_parent).

§

Cells(CellsId)

A cell grid (see crate::cells): a terminal’s screen as one node.

§

Fragment(FragmentDrawId)

A box a registered WGSL function paints (see crate::fragment). The handle and the sixteen parameters live in the frame’s FragmentList; the node carries only where.

§

Polygon(FragmentDrawId)

A filled polygon: a float sized to its own bounding box like a line, painted by the stock polygon fragment whose draw sits in the frame’s FragmentList like any fragment’s, its bg the fill. No hit region, no access row.

§

Path(PathId)

A filled and/or stroked outline of any shape (see crate::path): a float sized to its own bounding box like a line, its ops in the frame’s PathStore, drawn as glyph-mask quads from the atlas. Its bg is the fill, its border width and colour the stroke.

Implementations§

Source§

impl NodeContent

Source

pub fn drawn_in_parent(self) -> bool

Whether this is a shape the core floats for its own reasons — a line, polygon or path, a float only so it takes no room in a row or column (ADR 0010 decision 5). Such a node is its parent’s content as a child is: the parent’s clip holds it (F78), and it paints in the parent’s layer at its place in the tree rather than opening a layer of its own (F123) — a glyph drawn into a title bar is not over a toast that opened before the bar did.

Trait Implementations§

Source§

impl Clone for NodeContent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NodeContent

Source§

impl Debug for NodeContent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for NodeContent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NodeContent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.