TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::SwatchStyles< Data > Class Template Reference

Swatches' color styles, by swatch ID: each kept while it's claimed every frame, and destroyed the frame after one goes unclaimed. More...

#include <gui_controls/subsystems/gui_swatch_styles.h>

Classes

struct  Entry

Public Member Functions

Entry & Claim (ID id)
 id's entry, kept this frame: a new one has no style yet.
Entry * Find (ID id)
 id's entry as last claimed, or null.
void KeepAlive (ID id)
 Keeps id's entry this frame without claiming it anew (a cached scope replays its swatches without building them): only one claimed last frame is still there.
template<class StyleManagerT>
void NextFrame (StyleManagerT &styleManager)
 At the start of a frame: the styles of the swatches not claimed in the last one go.
void Forget ()
 Drops every entry without destroying its style (a theme reload freed them all).

Detailed Description

template<class Data = NoSwatchData>
class tachyon::SwatchStyles< Data >

Swatches' color styles, by swatch ID: each kept while it's claimed every frame, and destroyed the frame after one goes unclaimed.

One map, each entry stamped with the frame it was last claimed in, so a frame like the last allocates nothing. Data is what a swatch keeps besides its style.

Member Function Documentation

◆ Claim()

template<class Data = NoSwatchData>
Entry & tachyon::SwatchStyles< Data >::Claim ( ID id)
inline

id's entry, kept this frame: a new one has no style yet.

◆ Find()

template<class Data = NoSwatchData>
Entry * tachyon::SwatchStyles< Data >::Find ( ID id)
inline

id's entry as last claimed, or null.

◆ KeepAlive()

template<class Data = NoSwatchData>
void tachyon::SwatchStyles< Data >::KeepAlive ( ID id)
inline

Keeps id's entry this frame without claiming it anew (a cached scope replays its swatches without building them): only one claimed last frame is still there.

◆ NextFrame()

template<class Data = NoSwatchData>
template<class StyleManagerT>
void tachyon::SwatchStyles< Data >::NextFrame ( StyleManagerT & styleManager)
inline

At the start of a frame: the styles of the swatches not claimed in the last one go.

◆ Forget()

template<class Data = NoSwatchData>
void tachyon::SwatchStyles< Data >::Forget ( )
inline

Drops every entry without destroying its style (a theme reload freed them all).


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