Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::StyleSnapshot Class Reference

Immutable resident presentation with independently sparse extension blocks. Widget bindings share equal values. Construction can allocate; all read access and flattening are allocation-free. Retain the owning shared pointer to keep borrowed block references alive across a style publication or destruction of the originating widget. More...

#include <style_types.hpp>

Public Member Functions

 StyleSnapshot (const ComputedStyle &value)
 Prepare the complete immutable value; may throw std::bad_alloc.
const std::array< FrameAppearance, 6 > & frame () const noexcept
const std::array< ScrollbarAppearance, 6 > & scrollbar () const noexcept
const std::array< ScrollbarThumbAppearance, 6 > * scrollbarThumbSegments () const noexcept
const std::array< SliderAppearance, 6 > * sliderParts () const noexcept
const std::array< GlyphAppearance, 6 > & glyphs () const noexcept
const StyleSizing * sizing () const noexcept
bool hasFrame () const noexcept
bool hasScrollbar () const noexcept
bool hasThumbSegments () const noexcept
bool hasGlyphs () const noexcept
ComputedStyle flatten () const noexcept
bool operator== (const ComputedStyle &other) const noexcept
bool operator== (const StyleSnapshot &other) const noexcept
std::size_t contentHash () const noexcept

Static Public Member Functions

static std::size_t contentHash (const ComputedStyle &value) noexcept

Public Attributes

CellStyle normal
 Ordinary text and fill.
CellStyle focused
 Focused control text and fill.
CellStyle disabled
 Disabled control text and fill.
CellStyle selected
 Selected row or editor range.
CellStyle header
 Fixed table heading.
CellStyle caret
 Editor software caret.
std::int32_t minWidth {}
 Nonnegative hard column minimum.

Friends

class StyleEngine

Detailed Description

Immutable resident presentation with independently sparse extension blocks. Widget bindings share equal values. Construction can allocate; all read access and flattening are allocation-free. Retain the owning shared pointer to keep borrowed block references alive across a style publication or destruction of the originating widget.

Constructor & Destructor Documentation

◆ StyleSnapshot()

portals::StyleSnapshot::StyleSnapshot ( const ComputedStyle & value)
explicit

Prepare the complete immutable value; may throw std::bad_alloc.

Parameters
valueOwning resolved value to copy into sparse storage.

Member Function Documentation

◆ contentHash() [1/2]

std::size_t portals::StyleSnapshot::contentHash ( ) const
noexcept
Returns
Content hash used by bounded transaction-local sharing indexes.

◆ contentHash() [2/2]

std::size_t portals::StyleSnapshot::contentHash ( const ComputedStyle & value)
staticnoexcept
Parameters
valueComplete owning value to hash.
Returns
The same hash as its snapshot.

◆ flatten()

ComputedStyle portals::StyleSnapshot::flatten ( ) const
noexcept
Returns
Complete owning flat value without allocation.

◆ frame()

const std::array< FrameAppearance, 6 > & portals::StyleSnapshot::frame ( ) const
noexcept
Returns
Frame states, or shared constant absent states.

◆ glyphs()

const std::array< GlyphAppearance, 6 > & portals::StyleSnapshot::glyphs ( ) const
noexcept
Returns
Logical glyph states, or shared constant absent states.

◆ hasFrame()

bool portals::StyleSnapshot::hasFrame ( ) const
noexcept
Returns
Whether this value owns a frame extension.

◆ hasGlyphs()

bool portals::StyleSnapshot::hasGlyphs ( ) const
noexcept
Returns
Whether this value owns logical glyph states.

◆ hasScrollbar()

bool portals::StyleSnapshot::hasScrollbar ( ) const
noexcept
Returns
Whether this value owns a scrollbar extension.

◆ hasThumbSegments()

bool portals::StyleSnapshot::hasThumbSegments ( ) const
noexcept
Returns
Whether this value owns complete thumb segment states.

◆ operator==() [1/2]

bool portals::StyleSnapshot::operator== ( const ComputedStyle & other) const
noexcept
Parameters
otherComplete owning value to compare.
Returns
Full semantic equality.

◆ operator==() [2/2]

bool portals::StyleSnapshot::operator== ( const StyleSnapshot & other) const
noexcept
Parameters
otherImmutable value to compare.
Returns
Full semantic equality.

◆ scrollbar()

const std::array< ScrollbarAppearance, 6 > & portals::StyleSnapshot::scrollbar ( ) const
noexcept
Returns
Scrollbar states, or shared constant absent states.

◆ scrollbarThumbSegments()

const std::array< ScrollbarThumbAppearance, 6 > * portals::StyleSnapshot::scrollbarThumbSegments ( ) const
noexcept
Returns
Complete thumb states, or null when no segment override exists.

◆ sizing()

const StyleSizing * portals::StyleSnapshot::sizing ( ) const
noexcept
Returns
Immutable additional sizing, or null; borrow ends with this snapshot's lifetime.

◆ sliderParts()

const std::array< SliderAppearance, 6 > * portals::StyleSnapshot::sliderParts ( ) const
noexcept
Returns
Complete Slider states, or null; borrow ends with this snapshot's lifetime.

The documentation for this class was generated from the following file: