Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::style::ct::LiveTheme< S > Class Template Reference

Copyable UI-affine observer with owned rules and current scalar parameter values. Copies share values but never extend scene lifetime. One handle owns no subscription or callback. Destruction and copies are thread-independent; operations require the scene's UI thread. In layered mode this controller observes reserved THEME authority; external theme() revokes it. In legacy mode only this controller's changes are tracked: external theme() replacement supersedes its sheet until the next unequal parameter update. An equal update deliberately does not reinstall it. More...

#include <style_static.hpp>

Public Member Functions

 LiveTheme ()=default
 Construct an empty observer; operations return CLOSED.
template<detail::Literal Name>
auto get () const
template<detail::Literal Name, class T>
std::expected< bool, ManagedError > set (T value) const
template<class... C>
std::expected< bool, ManagedError > apply (C... changes) const

Static Public Member Functions

static std::expected< LiveTheme, ManagedError > attach (ManagedScene &scene, const S &description)

Detailed Description

template<class S>
requires detail::IsSheet<S>::value
class portals::style::ct::LiveTheme< S >

Copyable UI-affine observer with owned rules and current scalar parameter values. Copies share values but never extend scene lifetime. One handle owns no subscription or callback. Destruction and copies are thread-independent; operations require the scene's UI thread. In layered mode this controller observes reserved THEME authority; external theme() revokes it. In legacy mode only this controller's changes are tracked: external theme() replacement supersedes its sheet until the next unequal parameter update. An equal update deliberately does not reinstall it.

Template Parameters
SValidated owning static stylesheet type.

Member Function Documentation

◆ apply()

template<class S>
template<class... C>
std::expected< bool, ManagedError > portals::style::ct::LiveTheme< S >::apply ( C... changes) const
inline
Template Parameters
CNamed update pack; names are known, unique, and values have exact parameter types.
Parameters
changesCandidates committed together only after the existing engine accepts the complete sheet.
Returns
True after a committed batch, false for equal values, or original managed/style error. Equal batches still check scene authority. Without pending layered metadata they allocate nothing and request no invalidation; pending metadata is materialized and committed in the same transaction. A rejected batch leaves both current values and installed widget styles unchanged.

◆ attach()

template<class S>
std::expected< LiveTheme, ManagedError > portals::style::ct::LiveTheme< S >::attach ( ManagedScene & scene,
const S & description )
inlinestatic
Parameters
sceneExisting managed owner, observed through its weak lifetime and UI identity.
descriptionOwning immutable sheet copied into this handle's shared state.
Returns
Observer after installation, or exact managed/style error with no controller published. Allocations precede installation. No user callback is retained by this controller.

◆ get()

template<class S>
template<detail::Literal Name>
auto portals::style::ct::LiveTheme< S >::get ( ) const
inline
Template Parameters
NameKnown parameter name.
Returns
Current scalar value or CLOSED, WRONG_THREAD, or the existing managed boundary error.

◆ set()

template<class S>
template<detail::Literal Name, class T>
std::expected< bool, ManagedError > portals::style::ct::LiveTheme< S >::set ( T value) const
inline
Template Parameters
NameKnown parameter name.
TExact parameter value type.
Parameters
valueCandidate value; negative runtime metrics are rejected by the existing style engine.
Returns
True after a committed value change, false for an equal value, or original managed/style error.

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