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

Native bounded plain-text log with whole-grapheme wrap and a stable reading anchor. The rolling mode exclusively owns records and prepared visible-row text. External-source recipes retain bounded immutable prepared windows and node-scoped application work; paint never reads a source or parses text. Use checked tree commands between frames on UI. Construct through ManagedScene::logView or ui::logView: managed preparation and its scoped scroll-intent observation are required. Raw WidgetTree emplacement alone is not a usable log; commands and measurement return INVALID_ARGUMENT until managed initialization is present. The native frame requires right and bottom sides for its scrollbar and status/tail action. CRLF, CR and LF separate complete records; a final separator adds no phantom empty record. More...

#include <log_view.hpp>

Inheritance diagram for portals::LogView:
portals::LogViewportals::LogView portals::ScrollArea portals::SizedWidget portals::Layout portals::Widget portals::LayoutItem

Public Member Functions

 LogView (WidthPolicy width={}, LogViewConfig config={}, ControlStyle style={}, SizePolicy policy=DEFAULT_LOG_VIEW_POLICY)
 LogView (WidthPolicy width, LogViewConfig config, ControlStyle style, SizePolicy policy, FrameOptions frame)
 ~LogView () override
 Destroy bounded owning content on UI after the last tree borrow.
std::expected< CellSize, TreeError > measure (CellSize available) override
std::expected< CellSize, TreeError > measureChildren (std::span< const MeasuredChild > children) const override
std::expected< void, TreeError > paint (PaintContext &context) override
Public Member Functions inherited from portals::ScrollArea
 ScrollArea (std::shared_ptr< ScrollController > controller={}, WidthPolicy width={}, ScrollAreaOptions options={}, ControlStyle style={}, SizePolicy policy={})
 ScrollArea (std::shared_ptr< ScrollController > controller, WidthPolicy width, ScrollAreaOptions options, ControlStyle style, SizePolicy policy, FrameOptions frame, std::in_place_t advanced)
 Construct an area with an owning advanced frame, compiled before initialization.
 ~ScrollArea () override
 Release owning values; no user callback or terminal operation occurs.
void unmount () override
 Retire this node's lease and pointer token before destruction.
std::expected< CellSize, TreeError > measure (CellSize available) override
std::expected< CellSize, TreeError > childAvailable (CellSize available) const override
std::expected< CellSize, TreeError > measureChildren (std::span< const MeasuredChild > children) const override
std::expected< void, TreeError > arrange (CellRect local) override
std::expected< CellRect, TreeError > childClip (CellSize available) const override
std::expected< std::vector< CellRect >, TreeError > arrangeChildren (std::span< const MeasuredChild > children, CellSize available) const override
std::expected< void, TreeError > paint (PaintContext &context) override
ComputedStyle styleDefaults () const override
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 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< LayoutChildPolicy, TreeError > childLayoutFor (NodeId child, CellSize available) const
 Describe one child's clip and reveal policy after arrangeChildren.

Friends

struct detail::LogViewAccess

Detailed Description

Native bounded plain-text log with whole-grapheme wrap and a stable reading anchor. The rolling mode exclusively owns records and prepared visible-row text. External-source recipes retain bounded immutable prepared windows and node-scoped application work; paint never reads a source or parses text. Use checked tree commands between frames on UI. Construct through ManagedScene::logView or ui::logView: managed preparation and its scoped scroll-intent observation are required. Raw WidgetTree emplacement alone is not a usable log; commands and measurement return INVALID_ARGUMENT until managed initialization is present. The native frame requires right and bottom sides for its scrollbar and status/tail action. CRLF, CR and LF separate complete records; a final separator adds no phantom empty record.

Constructor & Destructor Documentation

◆ LogView() [1/2]

portals::LogView::LogView ( WidthPolicy width = {},
LogViewConfig config = {},
ControlStyle style = {},
SizePolicy policy = DEFAULT_LOG_VIEW_POLICY )
explicit
Parameters
widthComplete immutable text policy.
configBounded retention and navigation settings.
styleManual appearances beneath the existing theme.
policyExisting layout constraints.
Exceptions
std::bad_allocOn construction allocation; tree emplacement translates it.

◆ LogView() [2/2]

portals::LogView::LogView ( WidthPolicy width,
LogViewConfig config,
ControlStyle style,
SizePolicy policy,
FrameOptions frame )
Parameters
widthImmutable text policy.
configResource/navigation bounds.
styleManual appearances.
policyLayout constraints.
frameOwning native frame options; right and bottom sides must remain enabled.
Exceptions
std::bad_allocOn allocation before mounting.

Member Function Documentation

◆ measure()

std::expected< CellSize, TreeError > portals::LogView::measure ( CellSize available)
overridevirtual
Parameters
availableOffered outer extent.
Returns
Cached prepared extent with existing frame minimum.

Reimplemented from portals::Widget.

◆ measureChildren()

std::expected< CellSize, TreeError > portals::LogView::measureChildren ( std::span< const MeasuredChild > children) const
overridevirtual
Parameters
childrenMust be empty: the log paints its own bounded rows.
Returns
Cached content extent or INVALID_ARGUMENT for externally inserted children.

Implements portals::Layout.

◆ paint()

std::expected< void, TreeError > portals::LogView::paint ( PaintContext & context)
overridevirtual
Parameters
contextSynchronous sink; all text was prepared before paint.
Returns
Existing frame/renderer error; no allocation, mutation or callback is performed here.

Reimplemented from portals::Widget.


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