Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::detail::SceneAccess Struct Reference

Internal bridge from consuming recipes to one stable facade owner. More...

#include <ui_scene.hpp>

Static Public Member Functions

static std::weak_ptr< SceneAnchor > callbackContext (ManagedScene &owner) noexcept
static std::expected< void, ManagedError > requireBackground (ManagedScene &owner)
static std::expected< void, ManagedError > admitActivity (ManagedScene &owner, std::shared_ptr< SceneActivity > activity)
static std::expected< void, ManagedError > factoryResultChecked (const Scene &owner)
static std::size_t applyFactoryCleanup (Scene &owner, const FactoryCleanup &cleanup, std::source_location origin)
static bool deliverFactoryReport (Scene &owner, const SceneReport &report, std::shared_ptr< SceneReportHandler > sink)
static int runApp (Scene &owner, const RunAppOptions &options, std::shared_ptr< SceneReportHandler > sink, std::source_location origin, std::size_t droppedErrors)
static std::expected< void, ManagedError > attachThemeSelector (ManagedScene &owner, const std::optional< ManagedError > *setupFailure=nullptr)
static Application & application (ManagedScene &owner) noexcept
static std::expected< StyleRoleRegistration, ManagedError > registerPreparedRoles (ManagedScene &owner, Node< Widget > node, std::initializer_list< std::string_view > names)
 Register SDK-owned parts only after style metadata has been flushed.
static std::expected< StyleRoleRegistration, ManagedError > replaceDocumentRoles (ManagedScene &owner, Node< Widget > node, const StyleRoleRegistration &registration, std::initializer_list< std::string_view > names)
static void beforeClose (ManagedScene &owner, void *context, std::expected< void, ManagedError >(*callback)(void *)) noexcept
static void retainCloseFailure (ManagedScene &owner)
static void currentOwner (ManagedScene &owner, std::weak_ptr< SceneAnchor > anchor) noexcept
static SceneRef currentRef () noexcept
static CurrentSceneScope currentScope (Scene &owner) noexcept
static SetupFailureScope setupScope (Scene &owner) noexcept
static bool shortReported (const ManagedScene &owner, const ManagedError &failure) noexcept
template<SceneConfiguration Callback>
static void onClick (Scene &owner, Callback &callback, std::source_location origin)
template<SceneConfiguration Callback>
static void onEditing (Scene &owner, Callback &callback, std::source_location origin)
template<SceneConfiguration Callback>
static void onLayout (Scene &owner, Callback &callback, std::source_location origin)
static void live (Scene &owner, std::shared_ptr< LiveFactory > factory, std::source_location origin)
static void setupFailure (Scene &owner, ManagedError failure, std::source_location origin)
static void theme (Scene &owner, const StyleSheet &sheet, std::source_location origin)
static void styleLayer (Scene &owner, StyleTier tier, const std::string &name, const StyleSheet &sheet, std::source_location origin)
template<detail::SceneConfiguration Callback>
static void configure (Scene &owner, Callback &callback, std::source_location origin)
template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
static void onKey (Scene &owner, KeyEvent chord, Callback &callback, std::source_location origin)
template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
static void onSelection (Scene &owner, const KeySelection &selection, Callback &callback, std::source_location origin)
template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
static void onShortcut (Scene &owner, std::expected< Shortcut, ShortcutError > &shortcut, Callback &callback, ShortcutBehavior behavior, ShortcutOptions options, std::source_location origin)
template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
static void onShortcut (Scene &owner, std::expected< std::shared_ptr< Shortcut >, ShortcutError > &shortcut, Callback &callback, ShortcutBehavior behavior, ShortcutOptions options, std::source_location origin)
static bool notifyingRunFailure (const ManagedScene &owner) noexcept
static bool primaryRecorded (const ManagedScene &owner) noexcept
static bool runFailureNotified (const ManagedScene &owner) noexcept
static std::pair< std::size_t, std::size_t > reportCounts (const ManagedScene &owner) noexcept
static Scene create (portals::detail::MoveOnlyFunction< std::expected< void, ManagedError >(ManagedScene &)> recipe, SceneOptions options, std::source_location origin)

Detailed Description

Internal bridge from consuming recipes to one stable facade owner.

Member Function Documentation

◆ admitActivity()

std::expected< void, ManagedError > portals::ui::detail::SceneAccess::admitActivity ( ManagedScene & owner,
std::shared_ptr< SceneActivity > activity )
inlinestatic
Parameters
ownerExisting UI-affine managed owner.
activityWeakly retained active-cycle work, bounded by the existing node budget.
Returns
Checked admission; inactive records are pruned without scanning idle controls.

◆ application()

Application & portals::ui::detail::SceneAccess::application ( ManagedScene & owner)
inlinestaticnoexcept
Parameters
ownerUI-admitted managed owner borrowed by an internal synchronous bridge.
Returns
Its existing application; no new runner or ownership is created.

◆ applyFactoryCleanup()

std::size_t portals::ui::detail::SceneAccess::applyFactoryCleanup ( Scene & owner,
const FactoryCleanup & cleanup,
std::source_location origin )
inlinestatic
Parameters
ownerStationary returned facade, whose primary error is preserved through cleanup.
cleanupFirst exact abandoned-local cleanup failure and bounded overflow.
originUpper invocation site.
Returns
Saturating count of failures that do not fit the existing primary/cleanup envelope.

◆ attachThemeSelector()

std::expected< void, ManagedError > portals::ui::detail::SceneAccess::attachThemeSelector ( ManagedScene & owner,
const std::optional< ManagedError > * setupFailure = nullptr )
inlinestatic
Parameters
ownerPrepared managed owner whose configurations have completed.
setupFailureOptional stable facade failure slot, borrowed only through this synchronous call. The initial factory may latch it through the existing setup collector; it is never retained by the view.
Returns
Checked attachment of its optional ready theme-selector view.

◆ beforeClose()

void portals::ui::detail::SceneAccess::beforeClose ( ManagedScene & owner,
void * context,
std::expected< void, ManagedError >(* callback )(void *) )
inlinestaticnoexcept
Parameters
ownerManaged owner whose close entry must first stop facade-owned external work.
contextStable facade State, outliving its managed owner.
callbackUI-only checked shutdown bridge, consumed before first close attempt.

◆ callbackContext()

std::weak_ptr< SceneAnchor > portals::ui::detail::SceneAccess::callbackContext ( ManagedScene & owner)
inlinestaticnoexcept
Parameters
ownerLive managed owner.
Returns
Weak callback attribution, never owning the facade.

◆ configure()

template<detail::SceneConfiguration Callback>
void portals::ui::detail::SceneAccess::configure ( Scene & owner,
Callback & callback,
std::source_location origin )
inlinestatic
Template Parameters
CallbackConfiguration action accepted by the facade.
Parameters
ownerExisting facade receiving its stored stage callback.
callbackStage storage transferred inside the checked implementation.
originStage registration call site.

◆ create()

Scene portals::ui::detail::SceneAccess::create ( portals::detail::MoveOnlyFunction< std::expected< void, ManagedError >(ManagedScene &)> recipe,
SceneOptions options,
std::source_location origin )
inlinestatic
Parameters
recipeOwning once-only mount action, constructed before entry.
optionsExisting runtime and finite facade policies.
originScene construction call site.
Returns
UI-affine lazy owner; storage allocation may throw before preparation.

◆ currentOwner()

void portals::ui::detail::SceneAccess::currentOwner ( ManagedScene & owner,
std::weak_ptr< SceneAnchor > anchor )
inlinestaticnoexcept
Parameters
ownerExisting managed owner attached to the stationary facade.
anchorWeak identity shared with Ref observation, revoked by facade cleanup.

◆ currentRef()

SceneRef portals::ui::detail::SceneAccess::currentRef ( )
inlinestaticnoexcept
Returns
One weak UI-thread snapshot; an absent scene stays CLOSED through the existing checked API.

◆ currentScope()

CurrentSceneScope portals::ui::detail::SceneAccess::currentScope ( Scene & owner)
inlinestaticnoexcept
Parameters
ownerStationary facade whose user code is executing on its UI thread.
Returns
Weak synchronous publication, or an empty mask for an unavailable owner.

◆ deliverFactoryReport()

bool portals::ui::detail::SceneAccess::deliverFactoryReport ( Scene & owner,
const SceneReport & report,
std::shared_ptr< SceneReportHandler > sink )
inlinestatic
Parameters
ownerRejected returned facade, already given its existing close attempt.
reportComplete owning rejection diagnostic, borrowed only through guarded delivery.
sinkOptional pinned explicit override; empty preserves an available configured Scene sink.
Returns
True after guarded delivery; false when the moved-from/foreign facade has no admitted state.

◆ factoryResultChecked()

std::expected< void, ManagedError > portals::ui::detail::SceneAccess::factoryResultChecked ( const Scene & owner)
inlinestatic
Parameters
ownerReturned owning facade, admitted only when cold or prepared but not yet completed.
Returns
Exact retained failure for a retired failed facade, CLOSED for retired/empty, or WOULD_BLOCK if active. Existing eager entry points retain their own repeated-run policy.

◆ live()

void portals::ui::detail::SceneAccess::live ( Scene & owner,
std::shared_ptr< LiveFactory > factory,
std::source_location origin )
inlinestatic
Parameters
ownerStationary facade retaining an existing concrete live controller.
factoryOwning descriptor factory, invoked under facade admission before attaching a controller.
originStage registration site.

◆ notifyingRunFailure()

bool portals::ui::detail::SceneAccess::notifyingRunFailure ( const ManagedScene & owner)
inlinestaticnoexcept
Parameters
ownerManaged owner currently invoking its observer on UI.
Returns
True only for the exact primary-run diagnostic being notified; nested reports restore this marker.

◆ onClick()

template<SceneConfiguration Callback>
void portals::ui::detail::SceneAccess::onClick ( Scene & owner,
Callback & callback,
std::source_location origin )
inlinestatic
Template Parameters
CallbackOwning checked click registration against the existing managed scene.
Parameters
ownerFacade receiving the deferred or runtime registration.
callbackOwning configuration, transferred only after UI admission.
originOriginal pipe registration site retained in diagnostics.

◆ onEditing()

template<SceneConfiguration Callback>
void portals::ui::detail::SceneAccess::onEditing ( Scene & owner,
Callback & callback,
std::source_location origin )
inlinestatic
Template Parameters
CallbackOwning checked editor event registration against the existing scene.
Parameters
ownerFacade receiving the deferred or runtime registration.
callbackConfiguration transferred only after UI admission.
originOriginal pipe registration site retained in diagnostics.

◆ onKey()

template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
void portals::ui::detail::SceneAccess::onKey ( Scene & owner,
KeyEvent chord,
Callback & callback,
std::source_location origin )
inlinestatic
Template Parameters
CallbackExisting compact key action accepted by the facade.
Parameters
ownerExisting facade receiving its stored stage callback.
chordExisting exact admitted chord.
callbackStage storage transferred inside the checked implementation.
originStage registration call site.

◆ onLayout()

template<SceneConfiguration Callback>
void portals::ui::detail::SceneAccess::onLayout ( Scene & owner,
Callback & callback,
std::source_location origin )
inlinestatic
Template Parameters
CallbackOwning checked layout registration against the existing managed scene.
Parameters
ownerFacade receiving the deferred or runtime registration.
callbackOwning configuration transferred only after UI admission.
originOriginal registration site retained in diagnostics.

◆ onSelection()

template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
void portals::ui::detail::SceneAccess::onSelection ( Scene & owner,
const KeySelection & selection,
Callback & callback,
std::source_location origin )
inlinestatic
Template Parameters
CallbackExisting owning compact action.
Parameters
ownerFacade receiving checked selected registration.
selectionImmutable owning alternatives and exact action set.
callbackStored callback transferred only inside the configuration catch.
originOriginal onKey registration call site.

◆ onShortcut() [1/2]

template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
void portals::ui::detail::SceneAccess::onShortcut ( Scene & owner,
std::expected< Shortcut, ShortcutError > & shortcut,
Callback & callback,
ShortcutBehavior behavior,
ShortcutOptions options,
std::source_location origin )
inlinestatic
Template Parameters
CallbackExisting owning compact key action.
Parameters
ownerFacade receiving the stored registration.
shortcutOwned parsed alternatives or allocation-free syntax error.
callbackStored action transferred after admission.
behaviorExplicit repeat policy.
optionsOriginal finite parser budgets.
originOriginal stage registration call site.

◆ onShortcut() [2/2]

template<class Callback>
requires portals::detail::ManagedAction<Callback, KeyEvent>
void portals::ui::detail::SceneAccess::onShortcut ( Scene & owner,
std::expected< std::shared_ptr< Shortcut >, ShortcutError > & shortcut,
Callback & callback,
ShortcutBehavior behavior,
ShortcutOptions options,
std::source_location origin )
inlinestatic
Template Parameters
CallbackExisting owning compact key action.
Parameters
ownerFacade receiving checked pending stage storage.
shortcutShared owning transfer receipt or allocation-free syntax error.
callbackStored action transferred after admission.
behaviorExplicit repeat policy.
optionsOriginal finite parser budgets.
originOriginal stage registration call site.

◆ primaryRecorded()

bool portals::ui::detail::SceneAccess::primaryRecorded ( const ManagedScene & owner)
inlinestaticnoexcept
Parameters
ownerManaged owner retaining its first admitted full-error primary.
Returns
Whether admission already handled collection, independently of observer notification.

◆ registerPreparedRoles()

std::expected< StyleRoleRegistration, ManagedError > portals::ui::detail::SceneAccess::registerPreparedRoles ( ManagedScene & owner,
Node< Widget > node,
std::initializer_list< std::string_view > names )
inlinestatic

Register SDK-owned parts only after style metadata has been flushed.

Parameters
ownerUI owner inside its prepared-layout activity phase.
nodeChecked managed recipient.
namesBorrowed names copied by the existing engine.
Returns
Owning registration or exact STYLE failure, without invoking the collector.

◆ replaceDocumentRoles()

std::expected< StyleRoleRegistration, ManagedError > portals::ui::detail::SceneAccess::replaceDocumentRoles ( ManagedScene & owner,
Node< Widget > node,
const StyleRoleRegistration & registration,
std::initializer_list< std::string_view > names )
inlinestatic
Parameters
ownerUI owner outside callbacks.
nodeLive viewer.
registrationExisting role participation.
namesReplacement names copied by the engine.
Returns
Atomically replaced palette registration, without invoking the collector.

◆ reportCounts()

std::pair< std::size_t, std::size_t > portals::ui::detail::SceneAccess::reportCounts ( const ManagedScene & owner)
inlinestaticnoexcept
Parameters
ownerClosed managed owner; no mutable storage or diagnostic borrow escapes.
Returns
Retained and dropped report counts from the existing bounded history, without allocation.

◆ requireBackground()

std::expected< void, ManagedError > portals::ui::detail::SceneAccess::requireBackground ( ManagedScene & owner)
inlinestatic
Parameters
ownerUI-affine managed owner before entering its application session.
Returns
Checked opt-in to the existing native-owned or host-borrowed executor.

◆ retainCloseFailure()

void portals::ui::detail::SceneAccess::retainCloseFailure ( ManagedScene & owner)
inlinestatic
Parameters
ownerManaged collector retaining an exact shutdown error independently of an earlier primary. Repeated calls do not duplicate the diagnostic; no widget or callback reference escapes.

◆ runApp()

int portals::ui::detail::SceneAccess::runApp ( Scene & owner,
const RunAppOptions & options,
std::shared_ptr< SceneReportHandler > sink,
std::source_location origin,
std::size_t droppedErrors )
inlinestatic
Parameters
ownerStationary facade retained through synchronous final reporting.
optionsBorrowed upper transport and cancellation policies.
sinkOwning upper sink prepared before factory invocation; empty preserves the configured Scene sink.
originUpper runner invocation site.
droppedErrorsOverflow from abandoned local factory cleanup, retained in the final report.
Returns
The existing final runner status, with terminal restoration and cleanup before reporting.

◆ runFailureNotified()

bool portals::ui::detail::SceneAccess::runFailureNotified ( const ManagedScene & owner)
inlinestaticnoexcept
Parameters
ownerExisting managed scene whose completed run returned a failure.
Returns
Exact receipt that an observer was invoked for that returned first primary failure. No diagnostic equality, allocation, capacity index or mutable collector access is involved.

◆ setupFailure()

void portals::ui::detail::SceneAccess::setupFailure ( Scene & owner,
ManagedError failure,
std::source_location origin )
inlinestatic
Parameters
ownerFacade retaining the first typed setup failure.
failureExact checked setup cause.
originSetup invocation site.

◆ setupScope()

SetupFailureScope portals::ui::detail::SceneAccess::setupScope ( Scene & owner)
inlinestaticnoexcept
Parameters
ownerStationary facade executing checked setup on its owning thread.
Returns
Synchronous setup attribution scope, restored before callback captures retire.

◆ shortReported()

bool portals::ui::detail::SceneAccess::shortReported ( const ManagedScene & owner,
const ManagedError & failure )
inlinestaticnoexcept
Parameters
ownerLive collector whose identity must match the returned error's internal receipt.
failureCopied exact short result; equal freshly constructed causes have no receipt.
Returns
True only when that short error entered this collector.

◆ styleLayer()

void portals::ui::detail::SceneAccess::styleLayer ( Scene & owner,
StyleTier tier,
const std::string & name,
const StyleSheet & sheet,
std::source_location origin )
inlinestatic
Parameters
ownerExisting facade receiving the checked configuration.
tierAPPLICATION or USER cascade tier.
nameOwning stage name, copied at the checked boundary.
sheetOwning stage rules, copied at the checked boundary.
originStage registration call site.

◆ theme()

void portals::ui::detail::SceneAccess::theme ( Scene & owner,
const StyleSheet & sheet,
std::source_location origin )
inlinestatic
Parameters
ownerExisting facade receiving its stored pipe theme.
sheetOwning stage storage borrowed only for the checked copy.
originStage registration call site.

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