TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::WindowRegistry Class Reference

Per-window lists of ElementRefs in addition (render) order, driven during ElementStorage construction: More...

#include <gui_core/windows/gui_window_registry.h>

Classes

struct  RenderNode
 One entry in a window's flat pre-order render list. More...
struct  WindowEntry
 A window of this frame and its render list. More...

Public Member Functions

 WindowRegistry ()
void Clear ()
 Forgets all windows, keeping capacity; call at BeginConstruction.
uint32_t WindowCount () const
 The number of registered windows.
const ID GetWindowID (uint32_t windowIndex) const
 The ID of the window at windowIndex; Invalid when out of range.
ElementRef GetWindowRef (uint32_t windowIndex) const
 The element of the window at windowIndex; Invalid when out of range.
ElementRef GetWindowRef (ID id) const
 The element of the window with id; Invalid when unknown.
uint32_t GetWindowIndex (ID id) const
 The index of the window with id; kInvalidIndex when unknown.
bool Contains (ID id) const
 True when a window with id is registered.
const std::vector< RenderNode > * GetWindowMembers (uint32_t windowIndex) const
 A window's render list (nullptr for an invalid index), for building its render data.
uint32_t GetWindowStackDepth () const
 How many window scopes are open.
ID GetCurrentWindowID () const
 The window being built (innermost window scope); Invalid outside one.
bool HasActiveWindow () const
 True inside a window scope.
RegistryResult BeginWindowScope (ID id, const ElementRef &ref)
 Registers a window element just added to the ElementStorage and opens its scope: following Adds go to it until EndWindowScope.
RegistryResult Add (const ElementRef &ref)
 Adds a non-window element to the innermost window scope's render list.
void MoveSubtreeToEnd (const ElementRef &nodeRef)
 Moves an element's subtree, in the innermost window scope, to render last among its siblings (on top).
void ApplyElementMove (const ElementMove &move)
 Follows the elements an ElementStorage::MoveChild moved: remaps every ref, then reorders the moved siblings' subtrees so the list stays pre-order.
void BuildRenderSkipLinks ()
 Computes subtreeSkip for every RenderNode in every window.
RegistryResult EndWindowScope ()
 Closes the innermost window scope; NoActiveWindow when none is open.

Static Public Attributes

static constexpr uint32_t kInvalidIndex = ~(uint32_t)0
auto begin () const
 The windows, in registration order.
auto end () const
 The windows, in registration order.
const std::vector< WindowEntry > & Windows () const
 The windows, in registration order.

Detailed Description

Per-window lists of ElementRefs in addition (render) order, driven during ElementStorage construction:

  • Clear() at BeginConstruction
  • BeginWindowScope(id, windowRef) when a window element is added
  • Add(elementRef) for every other element
  • EndWindowScope() after the window's BeginChildren/EndChildren Nested windows are the active target until their scope ends. Kept out of ElementStorage so that stays a general-purpose element store.

Constructor & Destructor Documentation

◆ WindowRegistry()

tachyon::WindowRegistry::WindowRegistry ( )
inline

Member Function Documentation

◆ Clear()

void tachyon::WindowRegistry::Clear ( )
inline

Forgets all windows, keeping capacity; call at BeginConstruction.

◆ WindowCount()

uint32_t tachyon::WindowRegistry::WindowCount ( ) const
inline

The number of registered windows.

◆ GetWindowID()

const ID tachyon::WindowRegistry::GetWindowID ( uint32_t windowIndex) const
inline

The ID of the window at windowIndex; Invalid when out of range.

◆ GetWindowRef() [1/2]

ElementRef tachyon::WindowRegistry::GetWindowRef ( uint32_t windowIndex) const
inline

The element of the window at windowIndex; Invalid when out of range.

◆ GetWindowRef() [2/2]

ElementRef tachyon::WindowRegistry::GetWindowRef ( ID id) const
inline

The element of the window with id; Invalid when unknown.

◆ GetWindowIndex()

uint32_t tachyon::WindowRegistry::GetWindowIndex ( ID id) const
inline

The index of the window with id; kInvalidIndex when unknown.

◆ Contains()

bool tachyon::WindowRegistry::Contains ( ID id) const
inline

True when a window with id is registered.

◆ GetWindowMembers()

const std::vector< RenderNode > * tachyon::WindowRegistry::GetWindowMembers ( uint32_t windowIndex) const
inline

A window's render list (nullptr for an invalid index), for building its render data.

Valid until Clear(), another window is added, or the registry moves.

◆ GetWindowStackDepth()

uint32_t tachyon::WindowRegistry::GetWindowStackDepth ( ) const
inline

How many window scopes are open.

◆ GetCurrentWindowID()

ID tachyon::WindowRegistry::GetCurrentWindowID ( ) const
inline

The window being built (innermost window scope); Invalid outside one.

◆ HasActiveWindow()

bool tachyon::WindowRegistry::HasActiveWindow ( ) const
inline

True inside a window scope.

◆ BeginWindowScope()

RegistryResult tachyon::WindowRegistry::BeginWindowScope ( ID id,
const ElementRef & ref )
inline

Registers a window element just added to the ElementStorage and opens its scope: following Adds go to it until EndWindowScope.

◆ Add()

RegistryResult tachyon::WindowRegistry::Add ( const ElementRef & ref)
inline

Adds a non-window element to the innermost window scope's render list.

◆ MoveSubtreeToEnd()

void tachyon::WindowRegistry::MoveSubtreeToEnd ( const ElementRef & nodeRef)
inline

Moves an element's subtree, in the innermost window scope, to render last among its siblings (on top).

Call during construction; BuildRenderSkipLinks updates subtreeSkip.

◆ ApplyElementMove()

void tachyon::WindowRegistry::ApplyElementMove ( const ElementMove & move)
inline

Follows the elements an ElementStorage::MoveChild moved: remaps every ref, then reorders the moved siblings' subtrees so the list stays pre-order.

◆ BuildRenderSkipLinks()

void tachyon::WindowRegistry::BuildRenderSkipLinks ( )
inline

Computes subtreeSkip for every RenderNode in every window.

Call once after construction and layout, before rendering. O(n) per window, allocation-free once warm.

◆ EndWindowScope()

RegistryResult tachyon::WindowRegistry::EndWindowScope ( )
inline

Closes the innermost window scope; NoActiveWindow when none is open.

◆ begin()

auto tachyon::WindowRegistry::begin ( ) const
inline

The windows, in registration order.

◆ end()

auto tachyon::WindowRegistry::end ( ) const
inline

The windows, in registration order.

◆ Windows()

const std::vector< WindowEntry > & tachyon::WindowRegistry::Windows ( ) const
inline

The windows, in registration order.

Member Data Documentation

◆ kInvalidIndex

uint32_t tachyon::WindowRegistry::kInvalidIndex = ~(uint32_t)0
staticconstexpr

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