|
| | ElementStorage (StyleManager &styleManager, ElementDataStore *dataStore=nullptr) |
| const StyleManager & | GetStyleManager () const noexcept |
| | ElementStorage (ElementStorage &&) noexcept=default |
| ElementStorage & | operator= (ElementStorage &&)=delete |
| | holds a StyleManager reference
|
| | ElementStorage (const ElementStorage &)=delete |
| ElementStorage & | operator= (const ElementStorage &)=delete |
| ElementStorageResult | BeginConstruction () |
| | Starts building a new tree, clearing the previous one.
|
| ElementStorageResult | EndConstruction () |
| | Finishes the tree; NotConstructing if not constructing.
|
| AddResult | Add (Element &&element, LayoutOverride &&constraints={}) |
| | Adds element after the previous one at the current nesting level.
|
| ElementStorageResult | AddCustomDraw (const ElementRef &ref, CustomDrawCallback callback) |
| | Draws callback before ref's children render.
|
| ElementStorageResult | AddCustomDrawAfter (const ElementRef &ref, CustomDrawCallback callback) |
| | Draws callback after ref's whole subtree, in the same space as AddCustomDraw.
|
| ElementStorageResult | AddPostLayout (const ElementRef &ref, PostLayoutCallback callback) |
| | Runs callback after layout, before rendering, with read-only final geometry.
|
| ElementStorageResult | BeginChildren () |
| | Begins adding children to the last added element; elements without BeginChildren are leaves.
|
| ElementStorageResult | EndChildren () |
| | Closes the innermost BeginChildren. Fails outside construction or without one open.
|
| ElementStorageResult | MoveChild (uint32_t childDepth, uint32_t rangeBegin, uint32_t fromLocal, uint32_t toLocal, ElementMove *outMove=nullptr) |
| | Moves a child (with its subtree) to another sibling position, during construction.
|
| bool | Empty () const |
| uint32_t | ElementCount () const |
| ID | GetLastAddedID () const |
| ID | GetLastItemID () const |
| | The element last added at the level being built, its children done: after a control with parts, the control's outer element rather than its last part.
|
| ElementRef | GetLastAddedRef () const |
| uint32_t | GetCurrentNestingDepth () const |
| uint32_t | NumberOfDepthLevels () const |
| uint32_t | DepthSizeOf (uint32_t depth) const |
| const ID | GetElementIDAt (ElementRef root, int2 position, ID *disabledHit=nullptr) const |
| | The element at position that takes input, or Invalid.
|
| int2 | ScreenToElementSpace (int2 screenPos, ElementRef ref) const |
| | Converts a screen point into the space ref's own rect is stored in, applying each ancestor's inverse contentTransform like hit-testing does.
|
| IntRect | ElementRectOnScreen (ElementRef ref) const |
| | ref's border box on the screen: through its ancestors' contentTransforms (a canvas's pan and zoom), the box around it when it's turned.
|
| ElementRef | FindElementRefByID (ID id) const |
| | The element with id; Invalid when not found (always for ID::Invalid).
|
| bool | IsValidRef (const ElementRef &ref) const |
| ElementRef | GetFirstElementRef () const |
| bool | HasChildren (const ElementRef &ref) const |
| uint32_t | GetChildCount (const ElementRef &ref) const |
| ElementRef | GetParentRef (const ElementRef &ref) const |
| ElementRef | GetNextSiblingRef (const ElementRef &ref) const |
| Element * | GetElementPtr (const ElementRef &elementRef) |
| | The element, or nullptr for an invalid ref.
|
| const Element * | GetElementPtr (const ElementRef &elementRef) const |
| Element & | GetElementUnsafe (const ElementRef &elementRef) |
| const Element & | GetElementUnsafe (const ElementRef &elementRef) const |
| ElementRect * | GetElementRectPtr (const ElementRef &elementRef) |
| const ElementRect * | GetElementRectPtr (const ElementRef &elementRef) const |
| ElementRect & | GetElementRectUnsafe (const ElementRef &elementRef) |
| const ElementRect & | GetElementRectUnsafe (const ElementRef &elementRef) const |
| bool | SetContentTransform (const ElementRef &ref, const float3x2 &transform) |
| | Sets the transform applied to ref's children at render / hit-test time (pan, zoom).
|
| const ElementCustomDraw * | GetCustomDraw (const ElementRef &elementRef) const |
| const std::vector< PostLayoutEntry > & | GetPostLayoutEntries () const |
| ElementCustomDraw & | GetElementCustomDrawUnsafe (const ElementRef &elementRef) |
| PostDrawEntry & | GetPostDrawEntryUnsafe (uint32_t index) |
| std::span< Element > | GetChildrenSpan (const ElementRef &parentRef) |
| | Valid until the next BeginConstruction. Empty on invalid ref or no children.
|
| std::span< Element > | GetChildrenSpanUnsafe (int depth, const IndexRange range) |
| | Unchecked. Valid until the next BeginConstruction.
|
| std::span< const Element > | GetChildrenSpanUnsafe (int depth, const IndexRange range) const |
| | Unchecked. Valid until the next BeginConstruction.
|
| std::span< ElementRect > | GetChildRectSpanUnsafe (int depth, const IndexRange range) |
| std::span< const ElementRect > | GetChildRectSpanUnsafe (int depth, const IndexRange range) const |
| std::span< const Element > | GetChildrenSpan (const ElementRef &parentRef) const |
| | Valid until the next BeginConstruction. Empty on invalid ref or no children.
|
| IndexRange | GetChildRange (const ElementRef &parentRef) const |
| | The indices of parentRef's children at the next depth; empty on invalid ref or no children.
|
| TopDownDepthScanIterator | TopDownDepthScanBegin () const |
| TopDownDepthScanIterator | TopDownDepthScanEnd () const |
| BottomUpDepthScanIterator | BottomUpDepthScanBegin () const |
| BottomUpDepthScanIterator | BottomUpDepthScanEnd () const |
| TopDownDepthScanRangeIterator | TopDownDepthScanRange () const |
| BottomUpDepthScanRangeIterator | BottomUpDepthScanRange () const |
The frame's element tree.
Not thread safe. Elements are added per frame, in order, between BeginConstruction/EndConstruction. Afterwards elements can be queried and modified, but the structure is immutable until the next BeginConstruction resets it. Elements are never removed.
All children of parents at depth D are stored contiguously at depth D+1, in the same order as their parents.
Depth-scan iterators (top-down / bottom-up) are const-only and valid only after EndConstruction.
Example:
storage.BeginConstruction();
storage.Add(root);
storage.BeginChildren();
storage.Add(leaf);
storage.Add(elementWithChildren);
storage.BeginChildren();
storage.Add(leaf);
storage.Add(leaf);
storage.EndChildren();
storage.Add(leaf);
storage.EndChildren();
storage.Add(secondRoot);
storage.EndConstruction();