Portals 0.7.0 · dev0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ApplicationScene Class Reference
Borrowed scene extension; bindings/models/providers belong to the caller. Construct the Application first, then the scene; destroy the scene before Application. The scene and application must survive every callback and run. No hook may destroy either owner or reenter run. Hooks execute on the creating UI thread; thrown exceptions become explicit failures followed by cleanup.
More...
Synchronize controls and pin each model once for a dirty frame. Called only when a dirty frame can be submitted, outside tree.frame. Retained view preparations own pins; custom widgets retain any other borrowed render data until rendering completes. Opt-in scenes retain the same pins through every prepareViews pass and final rendering.
Prepare views from one owning layout snapshot; default is a no-op. Called only for opt-in scenes, on UI outside tree.frame, after prepare has pinned models once. Use those same pins for all views and repeated passes; do not dispatch the scheduler or replace pins here. Snapshot reads survive invalidations caused by earlier views. A new LAYOUT request repeats layout and this hook up to ApplicationOptions::maxPreparationPasses; PAINT does not.
Borrowed scene extension; bindings/models/providers belong to the caller. Construct the Application first, then the scene; destroy the scene before Application. The scene and application must survive every callback and run. No hook may destroy either owner or reenter run. Hooks execute on the creating UI thread; thrown exceptions become explicit failures followed by cleanup.
Publish owning observations of the successful final frame, outside tree.frame.
Parameters
application
Borrowed UI services after final layout, paint and owning render.
Returns
Success or original scene failure; the default does nothing. This is not a terminal flush notification. User callbacks must be deferred through the scheduler.
True only while this scene owns pending final-layout notifications to drain at EOF. The default is false; unrelated scheduler DATA never extends the original EOF policy.
Synchronize controls and pin each model once for a dirty frame. Called only when a dirty frame can be submitted, outside tree.frame. Retained view preparations own pins; custom widgets retain any other borrowed render data until rendering completes. Opt-in scenes retain the same pins through every prepareViews pass and final rendering.
Parameters
application
Borrowed UI services.
size
Terminal viewport for this frame; legacy scenes prepare views with their final sizes here, while opt-in scenes obtain sizes in prepareViews.
Returns
Success or preparation error; no frame is submitted on failure.
Prepare views from one owning layout snapshot; default is a no-op. Called only for opt-in scenes, on UI outside tree.frame, after prepare has pinned models once. Use those same pins for all views and repeated passes; do not dispatch the scheduler or replace pins here. Snapshot reads survive invalidations caused by earlier views. A new LAYOUT request repeats layout and this hook up to ApplicationOptions::maxPreparationPasses; PAINT does not.
Parameters
application
Borrowed UI services, available for checked view mutation.
snapshot
Immutable owning geometry for this pass, borrowed for the call; copy it if retention is needed. Hidden subtree viewports are zero.
Returns
Success or the original view error; failure submits no frame. Exhausting the pass budget returns WOULD_BLOCK in PREPARE. Hook exceptions also fail PREPARE.
True when the scene requires background work; default false. Synchronous run creates a default pool before native open. A ready host must inject its own executor. The requirement is sampled before scene callbacks and does not change mid-session.
True when mounted controls require held-button motion; default false without allocation or tree walks. Sampled once after checked mount, immediately before native open. This requirement does not override ApplicationOptions::nativeMouseReporting=false or dynamically change an already opened transport.
True to capture owning geometry/visibility/child clips for preparation; default false. The existing dimensions-only capture and its cost remain unchanged when false.