Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::OverlayHost Class Reference

Transparent overlay with exact body identity and body-only intrinsic measurement. The managed owner binds the body before layout. Unbound hosts return INVALID_ARGUMENT. Hidden body contributes no intrinsic extent. Existing Overlay placement and sibling order apply. Pure layout methods borrow their spans only for the call and never access the tree. More...

#include <dialog.hpp>

Inheritance diagram for portals::OverlayHost:
portals::OverlayHostportals::OverlayHost portals::Overlay portals::SizedWidget portals::Layout portals::Widget portals::LayoutItem

Public Member Functions

 OverlayHost (OverlayHostOptions options={}, SizePolicy policy={})
OverlayHostOptions hostOptions () const
std::expected< CellSize, TreeError > childAvailable (CellSize available) const override
std::expected< CellSize, TreeError > measureChildren (std::span< const MeasuredChild > children) const override
std::expected< std::vector< CellRect >, TreeError > arrangeChildren (std::span< const MeasuredChild > children, CellSize available) const override
Public Member Functions inherited from portals::Overlay
 Overlay (OverlayOptions options={}, SizePolicy policy={})
 Own settings and size policies.
OverlayOptions options () const
 Owning UI-thread copy.
Public Member Functions inherited from portals::SizedWidget
 SizedWidget (SizePolicy policy={})
 Own the supplied policies; checked by layout.
SizePolicy sizePolicy () const override
 Copy current policy without borrowing storage.
Public Member Functions inherited from portals::Widget
virtual ~Widget ()=default
 Destroy on UI after the last active tree borrow.
virtual void mount ()
 Called exactly once after attachment; exceptions are reported.
virtual void unmount ()
 Called once before destruction, children first; cleanup continues on exceptions.
virtual std::expected< CellSize, TreeError > measure (CellSize available)
 Default desired size is empty.
virtual std::expected< void, TreeError > arrange (CellRect local)
 Default accepts the owning rectangle.
virtual std::expected< void, TreeError > paint (PaintContext &context)
 Default emits no commands.
virtual ComputedStyle styleDefaults () const
 Read manual presentation defaults during style staging on UI.
virtual bool styleReadOnly () const noexcept
 Read actual view-only state during style staging; false by default.
const std::shared_ptr< const StyleSnapshot > & computedStyle () const noexcept
 Inspect the last atomically installed theme inside tree.read/frame.
std::uint64_t styleRevision () const noexcept
Public Member Functions inherited from portals::LayoutItem
virtual ~LayoutItem ()=default
 Destroy with the implementing widget.
Public Member Functions inherited from portals::Layout
virtual ~Layout ()=default
 Destroy with the implementing widget.
virtual std::expected< CellRect, TreeError > childClip (CellSize available) const
 Clip descendants within this container without changing allocation.
virtual std::expected< LayoutChildPolicy, TreeError > childLayoutFor (NodeId child, CellSize available) const
 Describe one child's clip and reveal policy after arrangeChildren.

Friends

struct detail::DialogAccess

Detailed Description

Transparent overlay with exact body identity and body-only intrinsic measurement. The managed owner binds the body before layout. Unbound hosts return INVALID_ARGUMENT. Hidden body contributes no intrinsic extent. Existing Overlay placement and sibling order apply. Pure layout methods borrow their spans only for the call and never access the tree.

Constructor & Destructor Documentation

◆ OverlayHost()

portals::OverlayHost::OverlayHost ( OverlayHostOptions options = {},
SizePolicy policy = {} )
explicit
Parameters
optionsOwning positive layer-registration budget, validated during layout.
policyOwning host size policy within its parent.

Member Function Documentation

◆ arrangeChildren()

std::expected< std::vector< CellRect >, TreeError > portals::OverlayHost::arrangeChildren ( std::span< const MeasuredChild > children,
CellSize available ) const
overridevirtual
Parameters
childrenVisible body and dialog roots in sibling paint order.
availableFull host allocation in cells.
Returns
Existing overlay placements, or unchanged validation/geometry/allocation errors.

Reimplemented from portals::Overlay.

◆ childAvailable()

std::expected< CellSize, TreeError > portals::OverlayHost::childAvailable ( CellSize available) const
overridevirtual
Parameters
availableOffered host extent, normalized before use.
Returns
Existing overlay child bounds, or INVALID_ARGUMENT for unbound/invalid host settings.

Reimplemented from portals::Overlay.

◆ hostOptions()

OverlayHostOptions portals::OverlayHost::hostOptions ( ) const
Returns
Owning copy of the host registration budget.

◆ measureChildren()

std::expected< CellSize, TreeError > portals::OverlayHost::measureChildren ( std::span< const MeasuredChild > children) const
overridevirtual
Parameters
childrenVisible measurements with exact owning node identities.
Returns
Only the bound body's intrinsic extent, or validation/geometry errors.

Reimplemented from portals::Overlay.


The documentation for this class was generated from the following file: