Owning immutable identities and local sizes from one completed layout pass. Copies share immutable value storage, without widgets, tree owners or borrowed text. Captured values remain readable after tree invalidation, removal or destruction. Concurrent const reads are safe; assignment requires caller synchronization.
More...
#include <layout_snapshot.hpp>
|
| static std::expected< LayoutSnapshot, TreeError > | capture (WidgetTree &tree, Node< Widget > node) |
| | Copy every live node in a subtree, including effectively hidden descendants. Call on the tree's UI thread after successful layout, preferably inside its frame. No layout, callbacks, mutation or frame request consumption is performed.
|
| static std::expected< LayoutSnapshot, TreeError > | capture (WidgetTree &tree, Node< Widget > node, LayoutSnapshotProfile profile) |
| | Opt into geometry capture without changing the original overload's allocation path.
|
|
|
struct | detail::LayoutTraversalAccess |
|
struct | detail::ScrollSnapshotAccess |
|
struct | detail::ScrollSnapshotTestAccess |
Owning immutable identities and local sizes from one completed layout pass. Copies share immutable value storage, without widgets, tree owners or borrowed text. Captured values remain readable after tree invalidation, removal or destruction. Concurrent const reads are safe; assignment requires caller synchronization.
◆ capture() [1/2]
Copy every live node in a subtree, including effectively hidden descendants. Call on the tree's UI thread after successful layout, preferably inside its frame. No layout, callbacks, mutation or frame request consumption is performed.
- Parameters
-
| tree | Live UI tree borrowed only during this call. |
| node | Checked root of the subtree to capture; ancestor visibility is respected. |
- Returns
- Owning snapshot, a tree access error, NO_MEMORY, or INVALID_GEOMETRY when an effectively visible node has no valid arranged geometry. Hidden nodes need no valid geometry and receive zero size; disabled nodes retain their arranged size.
◆ capture() [2/2]
Opt into geometry capture without changing the original overload's allocation path.
- Parameters
-
| tree | UI tree after successful complete layout, inside its frame. |
| node | Root identity; ancestor visibility is respected. |
| profile | DIMENSIONS delegates the old overload; GEOMETRY owns optional parallel storage. |
- Returns
- Owning snapshot or original tree/allocation/geometry/clip error; unknown profile is INVALID_ARGUMENT. Extra O(nodes) work/storage applies only to GEOMETRY. Existing pure childClip runs under tree.read; no controller publication, invalidation or user notification occurs.
◆ geometry()
- Parameters
-
| node | Captured full session/slot/generation identity. |
- Returns
- Owning geometry, INVALID_ARGUMENT without GEOMETRY, or WRONG_SESSION/STALE_NODE. No live tree is consulted; copies and concurrent const reads are safe.
◆ geometryRevision()
| std::expected< std::uint64_t, TreeError > portals::LayoutSnapshot::geometryRevision |
( |
| ) |
const |
|
nodiscardnoexcept |
- Returns
- Nonzero tree revision at capture, or INVALID_ARGUMENT without GEOMETRY profile. A completed-pass identity does not grant permission to read later live geometry.
◆ viewport()
Read a captured local extent without consulting the current tree.
- Parameters
-
| node | Observer identifying the captured session, slot and generation. |
- Returns
- Captured width/height in cells, zero for an effectively hidden node, WRONG_SESSION for another tree, or STALE_NODE for an empty/absent identity or a moved-from snapshot. Removal after capture does not invalidate captured identities.
- Note
- No allocation, tree affinity, mutation or exceptions; clipping does not reduce this extent.
The documentation for this class was generated from the following file: