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

Borrowed synchronous command sink supplied by the frame owner. submit must consume commands immediately or retain their text only until the enclosing WidgetTree::frame callback returns. The frame owner must render before leaving that callback. No command/text/context borrow may survive the frame. No terminal I/O here. More...

#include <widget_types.hpp>

Public Member Functions

virtual ~PaintContext ()=default
 Destroy the caller-owned sink.
virtual std::expected< void, TreeError > submit (std::span< const RenderCommand > commands)=0
 Borrow commands.

Detailed Description

Borrowed synchronous command sink supplied by the frame owner. submit must consume commands immediately or retain their text only until the enclosing WidgetTree::frame callback returns. The frame owner must render before leaving that callback. No command/text/context borrow may survive the frame. No terminal I/O here.

Member Function Documentation

◆ submit()

virtual std::expected< void, TreeError > portals::PaintContext::submit ( std::span< const RenderCommand > commands)
pure virtual

Borrow commands.

Parameters
commandsCommands and text borrowed until the enclosing frame callback returns; consume before then.
Returns
Success when accepted by the concrete sink, or its TreeError on failure.

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