morph::ui::Mounted: builds a view tree's widgets through a backend once, and keeps them current through reactive bindings.
More...
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <functional>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <optional>
#include <ranges>
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <variant>
#include <vector>
#include "../attributes.hpp"
#include "../reactive/runtime.hpp"
#include "../reactive/scope.hpp"
#include "../reactive/signal.hpp"
#include "../ui/backend.hpp"
#include "view.hpp"
Go to the source code of this file.
|
| namespace | morph::ui::detail::site |
| | The site names a misuse in this layer is reported under, through the runtime's owner probe.
|
|
| enum class | morph::ui::detail::RowWidgetState : std::uint8_t { Realized
, Dewindowed
, NullView
} |
| | Whether a row's widget is realized, and if not, why – so the windowing pass of reconcile never confuses a row that has no widget by design (its view was a null node) with one whose widget is simply not realized right now, which it should realize the next time the row enters the visible range. More...
|
morph::ui::Mounted: builds a view tree's widgets through a backend once, and keeps them current through reactive bindings.
Specified in docs/spec/ui/view_tree.md, "Mount".
Definition in file mount.hpp.
◆ RowHook
Called for each newly mounted row with its widget and key; a Table tells its widget the row's key.
Definition at line 51 of file mount.hpp.
◆ RowWidgetState
Whether a row's widget is realized, and if not, why – so the windowing pass of reconcile never confuses a row that has no widget by design (its view was a null node) with one whose widget is simply not realized right now, which it should realize the next time the row enters the visible range.
| Enumerator |
|---|
| Realized | widgetScope/widget are set.
|
| Dewindowed | The row's view is not null, but its widget is not realized: out of the visible range.
|
| NullView | The row's view is a null node; it never had a widget and never will while that stays true.
|
Definition at line 56 of file mount.hpp.
◆ stableTargets()
| std::vector< bool > morph::ui::detail::stableTargets |
( |
std::vector< std::size_t > const & | sequence | ) |
|
|
inlinenodiscard |
Which entries of a permutation lie on one longest increasing run.
sequence holds, in current order, each widget's target position; the widgets on the run are already in order relative to each other and stay where they are, and every other one is moved once.
- Parameters
-
| sequence | A permutation of 0 .. n-1. |
- Returns
- Indexed by target position: whether that widget stays.
Definition at line 129 of file mount.hpp.
◆ reorderChildren()
| void morph::ui::detail::reorderChildren |
( |
ContainerWidget & | container, |
|
|
std::vector< Widget * > & | current, |
|
|
std::vector< Widget * > const & | target ) |
|
inline |
Brings a container's children from their current order into the target order with moveChild, moving only the children outside a longest run already in order.
- Parameters
-
| container | The container. |
| current | Its children, in their current order. Kept equal to the container's order after every move, so it is still that order when a move throws. |
| target | The same children, in the order wanted. |
Definition at line 159 of file mount.hpp.