5#include <portals/scroll_controls.hpp>
6#include <portals/widget.hpp>
14enum class ScrollSnapshotAdmission;
15struct ScrollSnapshotAccess;
16struct ScrollSnapshotTestAccess;
81 [[nodiscard]] std::expected<std::uint64_t, TreeError>
geometryRevision() const noexcept;
84 friend struct detail::LayoutTraversalAccess;
85 friend struct detail::ScrollSnapshotAccess;
86 friend struct detail::ScrollSnapshotTestAccess;
87 std::expected<detail::ScrollSnapshotAdmission,
TreeError> admitScrollSnapshot(
WidgetTree &tree) const;
94 struct GeometryRecord {
99 LayoutSnapshot(std::uint64_t session, std::shared_ptr<
const std::vector<Record>> records);
100 LayoutSnapshot(std::uint64_t session, std::shared_ptr<
const std::vector<Record>> records,
101 std::shared_ptr<
const std::vector<GeometryRecord>>
geometry, std::uint64_t revision,
102 std::uint64_t inputGeneration);
103 std::uint64_t session_;
104 std::shared_ptr<const std::vector<Record>> records_;
105 std::shared_ptr<const std::vector<GeometryRecord>> geometry_;
106 std::uint64_t geometryRevision_{};
107 std::uint64_t inputGeneration_{};
An owning, invariant-preserving half-open cell rectangle.
Definition geometry.hpp:81
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 th...
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.
std::expected< std::uint64_t, TreeError > geometryRevision() const noexcept
std::expected< LayoutGeometrySnapshot, TreeError > geometry(Node< Widget > node) const noexcept
std::expected< CellSize, TreeError > viewport(Node< Widget > node) const noexcept
Read a captured local extent without consulting the current tree.
Copyable typed observer; never owns or exposes an unchecked widget pointer.
Definition widget.hpp:92
Public Portals API.
Definition action.hpp:8
LayoutSnapshotProfile
Explicit capture cost profile; dimension-only scenes keep their original path.
Definition layout_snapshot.hpp:19
@ GEOMETRY
Copy geometry, visibility and pure descendant clips for scroll preparation.
Definition layout_snapshot.hpp:21
@ DIMENSIONS
Original size records, without optional geometry storage.
Definition layout_snapshot.hpp:20
TreeError
Checked tree failures; rejected operations never start the requested callback.
Definition widget_types.hpp:26
An owning available extent in terminal columns/rows.
Definition geometry.hpp:44
Owning geometry independent of later live invalidation or widget destruction. descendantClip precedes...
Definition layout_snapshot.hpp:28
bool visible
Effective visibility; visible zero differs from hidden.
Definition layout_snapshot.hpp:32
std::optional< ScrollAreaLayoutSnapshot > scrollArea
Copied derived values for an initialized area.
Definition layout_snapshot.hpp:33
Node< Widget > parent
Captured full parent identity, without ownership.
Definition layout_snapshot.hpp:29
std::optional< std::uint64_t > geometryEpoch
Nonreused stamp of this child's arrangement.
Definition layout_snapshot.hpp:35
CellRect descendantClip
Pure childClip translated to surface coordinates.
Definition layout_snapshot.hpp:31
NodeGeometry geometry
Full local/surface bounds and cumulative paint clip.
Definition layout_snapshot.hpp:30
std::optional< ParentLayoutEdge > parentLayoutEdge
Specialized edge, before ancestor intersection.
Definition layout_snapshot.hpp:34
Owning arranged geometry; invalid geometry must never be used for hit-testing.
Definition widget_types.hpp:48
Owning identity, independent of addresses; zero is never a live identity.
Definition widget_types.hpp:15