|
Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
|
UI-owned extension object. Hooks borrow their arguments for one call. Models are separate explicit owners chosen by the application. Hooks must not block, perform terminal I/O, or retain contexts. Measure/arrange/paint cannot mutate the tree. More...
#include <widget.hpp>
Public Member Functions | |
| 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 |
Friends | |
| class | StyleEngine |
UI-owned extension object. Hooks borrow their arguments for one call. Models are separate explicit owners chosen by the application. Hooks must not block, perform terminal I/O, or retain contexts. Measure/arrange/paint cannot mutate the tree.
Default accepts the owning rectangle.
| local | Parent-relative rectangle selected by the layout owner. |
Reimplemented in portals::Border, portals::Chart< T >, portals::Control, portals::Gauge, portals::Grid, portals::KeyHints, portals::LineEdit, portals::Menu, portals::Password, portals::PopupMenu, portals::RadioGroup, portals::ScrollArea, portals::ScrollBar, portals::Slider, portals::Spinner, portals::StatusBar, portals::VirtualList< T >, portals::VirtualRows< T >, and portals::VirtualTable< T >.
|
noexcept |
Inspect the last atomically installed theme inside tree.read/frame.
Default desired size is empty.
| available | Normalized cell-space constraints supplied by WidgetTree. |
Reimplemented in portals::Border, portals::Button, portals::Chart< T >, portals::Control, portals::Gauge, portals::KeyHints, portals::LineEdit, portals::LogView, portals::Menu, portals::Password, portals::PopupMenu, portals::RadioGroup, portals::ScrollArea, portals::ScrollBar, portals::Slider, portals::SpinBox, portals::Spinner, portals::Switch, portals::VirtualList< T >, and portals::VirtualTable< T >.
|
virtual |
Default emits no commands.
| context | Borrowed synchronous sink; neither it nor frame text may escape the frame. |
Reimplemented in portals::Border, portals::Button, portals::Chart< T >, portals::Control, portals::DocumentView, portals::Gauge, portals::Grid, portals::KeyHints, portals::LineEdit, portals::LogView, portals::Menu, portals::Password, portals::PopupMenu, portals::RadioGroup, portals::ScrollArea, portals::ScrollBar, portals::Slider, portals::Spinner, portals::StatusBar, portals::VirtualList< T >, portals::VirtualRows< T >, and portals::VirtualTable< T >.
|
virtual |
Read manual presentation defaults during style staging on UI.
Reimplemented in portals::Border, portals::Chart< T >, portals::Control, portals::Gauge, portals::Grid, portals::LineEdit, portals::Password, portals::RadioGroup, portals::ScrollArea, portals::ScrollBar, portals::Spinner, portals::StatusBar, portals::VirtualList< T >, and portals::VirtualTable< T >.
|
virtualnoexcept |
Read actual view-only state during style staging; false by default.
Reimplemented in portals::DocumentView, portals::RadioGroup, and portals::Slider.
|
noexcept |
|
virtual |
Called once before destruction, children first; cleanup continues on exceptions.
Reimplemented in portals::Grid, portals::ScrollArea, and portals::ScrollBar.