Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
virtual_rows_tree.hpp
1// Copyright (c) 2026 ttldtor.
2// SPDX-License-Identifier: BSL-1.0
3#pragma once
4#include <portals/widget.hpp>
5#include <span>
6
7namespace portals {
8class EventRouter;
9}
10
11namespace portals::detail {
13// A narrow row-host publication seam. Validation precedes all allocation-free visibility
14// and sibling-order changes; ownership is neither released nor transferred to callers.
15struct RowTreeAccess {
16 // Measure a staged row without publishing its visibility or arranging geometry.
17 static std::expected<CellSize, TreeError> measure(WidgetTree &tree, Node<Widget> row, CellSize available);
18 static std::expected<CellSize, TreeError> measureWidget(WidgetTree &tree, Node<Widget> node, Node<Widget> row,
19 CellSize available);
20 static std::expected<std::uint64_t, TreeError> geometryRevision(const WidgetTree &tree);
21 static bool dispatching(const EventRouter &router) noexcept;
22 static std::uint64_t focusGeneration(const EventRouter &router) noexcept;
23 static std::expected<void, TreeError> focusScope(EventRouter &router, Node<Widget> host, Node<Widget> row = {},
24 Node<Widget> chrome = {});
25 static std::expected<Node<Widget>, TreeError> enterRow(EventRouter &router, Node<Widget> host, Node<Widget> row,
26 std::size_t column);
27 static std::expected<std::size_t, TreeError> column(EventRouter &router, Node<Widget> row, Node<Widget> focused);
28 static std::expected<void, TreeError> publish(WidgetTree &tree, Node<Widget> host,
29 std::span<const Node<Widget>> visible);
30};
31
33} // namespace portals::detail
UI-owned focus and synchronous bubbling over an existing WidgetTree. Tree and Scheduler must outlive ...
Definition action.hpp:169
Public Portals API.
Definition action.hpp:8
TreeError
Checked tree failures; rejected operations never start the requested callback.
Definition widget_types.hpp:26