Weak UI-affine observation of the one scene-owned catalog/model. Copying/destroying observations never cancels a preview. The first successful preview explicitly revokes a previous LiveTheme controller; cancel restores appearance, not that controller or legacy engine mode. Commands are checked and do not report on destruction. Return them from a managed action to use its existing error boundary. A failed transition preserves prior model/style state, apart from independent external operations. Factories are never retried automatically.
More...
#include <theme_selection.hpp>
|
|
| ThemeSelectionRef () |
| | Construct a cold observation on the UI thread; allocation may throw before an owner exists.
|
| std::expected< void, ManagedError > | preview (std::string_view id, std::source_location origin=std::source_location::current()) const |
| std::expected< void, ManagedError > | commit (std::source_location origin=std::source_location::current()) const |
| std::expected< void, ManagedError > | cancel (std::source_location origin=std::source_location::current()) const |
| std::expected< std::shared_ptr< const ThemeSelectionSnapshot >, ManagedError > | snapshot () const |
|
|
class | portals::ManagedScene |
|
struct | detail::ThemeSelectionAccess |
|
struct | detail::ThemeSelectorAccess |
Weak UI-affine observation of the one scene-owned catalog/model. Copying/destroying observations never cancels a preview. The first successful preview explicitly revokes a previous LiveTheme controller; cancel restores appearance, not that controller or legacy engine mode. Commands are checked and do not report on destruction. Return them from a managed action to use its existing error boundary. A failed transition preserves prior model/style state, apart from independent external operations. Factories are never retried automatically.
◆ cancel()
| std::expected< void, ManagedError > portals::ui::ThemeSelectionRef::cancel |
( |
std::source_location | origin = std::source_location::current() | ) |
const |
- Parameters
-
| origin | Original command site. |
- Returns
- Allocation-free success from IDLE, or atomic restore from ACTIVE. SUPERSEDED returns STYLE/StyleError/INVALID_ARGUMENT without overwriting the external theme or historical IDs.
◆ commit()
| std::expected< void, ManagedError > portals::ui::ThemeSelectionRef::commit |
( |
std::source_location | origin = std::source_location::current() | ) |
const |
- Parameters
-
| origin | Original command site. |
- Returns
- Success only after promoting an ACTIVE installed candidate; IDLE/SUPERSEDED returns STYLE/StyleError/INVALID_ARGUMENT and produces no new committed result. A pending/failed newer intent returns WOULD_BLOCK instead of committing the older installed preview. No persistence callback runs.
◆ preview()
| std::expected< void, ManagedError > portals::ui::ThemeSelectionRef::preview |
( |
std::string_view | id, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| id | Exact application catalog ID, borrowed for this synchronous operation. |
| origin | Original command site retained in full managed errors. |
- Returns
- Synchronous candidate installation, or acceptance of one latest prepared intent, or a typed error. A prepared intent remains observable through requestedId/preparing/preparationError until completion. Factory invocation/build/parse runs on the existing background executor; installation, copying, resolution and layout still occur on UI under the existing finite style budgets. Explicit preview after SUPERSEDED starts a fresh session from the current external theme.
◆ snapshot()
- Returns
- Independent owning metadata/selection, or exact affinity/lifetime/allocation failure. Read-only; snapshots retain no factory, resolver, scene or widget pointer. Transition reentry is WOULD_BLOCK.
The documentation for this class was generated from the following file: