|
Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
|
Pure container interface; callbacks run inside tree.read and an enclosing tree.frame. No callback may call tree operations, recurse into layout, mutate models, retain spans, or perform I/O. Independent algorithms for Grid/Overlay can implement this interface without changing Widget. More...
#include <layout.hpp>
Public Member Functions | |
| virtual | ~Layout ()=default |
| Destroy with the implementing widget. | |
| virtual std::expected< CellSize, TreeError > | childAvailable (CellSize available) const =0 |
| Measurement bounds. | |
| 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. | |
| virtual std::expected< CellSize, TreeError > | measureChildren (std::span< const MeasuredChild > children) const =0 |
| Own aggregate. | |
| virtual std::expected< std::vector< CellRect >, TreeError > | arrangeChildren (std::span< const MeasuredChild > children, CellSize available) const =0 |
| Own parent-local rectangles in child order. | |
Pure container interface; callbacks run inside tree.read and an enclosing tree.frame. No callback may call tree operations, recurse into layout, mutate models, retain spans, or perform I/O. Independent algorithms for Grid/Overlay can implement this interface without changing Widget.
|
pure virtual |
Own parent-local rectangles in child order.
| children | Borrowed measured children in the same order as the resulting rectangles. |
| available | Container-local extent available for arrangement. |
Implemented in portals::Border, portals::Dialog, portals::Grid, portals::LinearLayout, portals::Overlay, portals::OverlayHost, portals::ScrollArea, and portals::VirtualRows< T >.
|
pure virtual |
Measurement bounds.
| available | Normalized cell extent offered to this container. |
Implemented in portals::Border, portals::Dialog, portals::Grid, portals::LinearLayout, portals::Overlay, portals::OverlayHost, portals::ScrollArea, and portals::VirtualRows< T >.
|
virtual |
Clip descendants within this container without changing allocation.
| available | Allocated normalized container extent in cells. |
Reimplemented in portals::Border, portals::Grid, and portals::ScrollArea.
|
virtual |
Describe one child's clip and reveal policy after arrangeChildren.
| child | Exact identity of a measured direct child. |
| available | Allocated normalized parent extent. |
Reimplemented in portals::Grid.
|
pure virtual |
Own aggregate.
| children | Borrowed visible children in sibling order, including stable identities and copied policies. |
Implemented in portals::Border, portals::Dialog, portals::DocumentView, portals::Grid, portals::LinearLayout, portals::LogView, portals::Overlay, portals::OverlayHost, portals::ScrollArea, and portals::VirtualRows< T >.