EN
RU
Portals
0.7.0 · dev
0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Toggle main menu visibility
Loading...
Searching...
No Matches
scroll_preparation.hpp
1
// Copyright (c) 2026 ttldtor.
2
// SPDX-License-Identifier: BSL-1.0
3
#pragma once
4
5
#include <portals/layout_snapshot.hpp>
6
7
namespace
portals
{
12
struct
ScrollRevealTarget
{
13
Node<Widget>
target
;
14
Node<Widget>
root
;
15
};
16
18
struct
ScrollPreparationResult
{
19
bool
layoutChanged
{};
20
bool
revealMoved
{};
21
};
22
37
std::expected<ScrollPreparationResult, TreeError>
prepareScrollAreas
(
WidgetTree
&tree,
38
std::span<
const
Node<ScrollArea>
> areas,
39
const
LayoutSnapshot
&snapshot,
40
std::optional<ScrollRevealTarget> reveal = {});
41
}
// namespace portals
portals::LayoutSnapshot
Owning immutable identities and local sizes from one completed layout pass. Copies share immutable va...
Definition
layout_snapshot.hpp:43
portals::Node
Copyable typed observer; never owns or exposes an unchecked widget pointer.
Definition
widget.hpp:92
portals::WidgetTree
Exclusive parent/child ownership on Scheduler's UI thread. Scheduler must outlive this object....
Definition
widget.hpp:179
portals
Public Portals API.
Definition
action.hpp:8
portals::prepareScrollAreas
std::expected< ScrollPreparationResult, TreeError > prepareScrollAreas(WidgetTree &tree, std::span< const Node< ScrollArea > > areas, const LayoutSnapshot &snapshot, std::optional< ScrollRevealTarget > reveal={})
Prepare all ordinary scroll areas against one immutable geometry profile.
portals::ScrollPreparationResult
Owning result; successful preparation does not imply successful final rendering.
Definition
scroll_preparation.hpp:18
portals::ScrollPreparationResult::revealMoved
bool revealMoved
At least one integral reveal position differed from the clamped plan.
Definition
scroll_preparation.hpp:20
portals::ScrollPreparationResult::layoutChanged
bool layoutChanged
Metrics/raster adoption requested another existing layout pass.
Definition
scroll_preparation.hpp:19
portals::ScrollRevealTarget
Owning one-shot reveal input for an explicit low-level scene preparation. Managed scenes retain their...
Definition
scroll_preparation.hpp:12
portals::ScrollRevealTarget::target
Node< Widget > target
Full live identity whose available footprint should become visible.
Definition
scroll_preparation.hpp:13
portals::ScrollRevealTarget::root
Node< Widget > root
Optional ancestor limiting reveal; empty includes all captured ancestors.
Definition
scroll_preparation.hpp:14
include
portals
scroll_preparation.hpp