Explicit owning allowlist; builtins include VBox/HBox/Label/LineEdit/FormField/Password/Button/CheckBox/ThreeState. Construction and copying may allocate. Captured services remain explicit borrows and must outlive prepare; registry callbacks are released with the consumed scene recipe.
More...
#include <ui_scene_resource.hpp>
|
| std::expected< void, SceneResourceErrorCode > | popupMenu (std::string_view name, Ref< PopupMenu > reference, std::initializer_list< PopupEntry > entries, PopupMenuOptions options={}) |
| | Bind a named loaded popup to an owning code-defined action tree.
|
|
| SceneResourceRegistry () |
| | Register the safe builtin recipe adapters without mounting anything.
|
|
| ~SceneResourceRegistry ()=default |
| | Release owning adapters; copying remains fallible instead of a noexcept debug-vector move.
|
template<class T, class Factory>
requires detail::ResourceFactory<T, Factory> |
| std::expected< void, SceneResourceErrorCode > | add (std::string_view name, Factory factory, bool children=false) |
| | Register an explicitly typed custom recipe; existing names cannot be replaced.
|
template<class T, class Factory, class Schema>
requires detail::ResourceFactory<T, Factory> && std::same_as<std::remove_cvref_t<Schema>, std::span<const ControlPropertyDescriptor>> |
| std::expected< void, SceneResourceErrorCode > | add (std::string_view name, Factory factory, Schema &&schema) |
| | Explicitly bind the existing native MessageBox/Notifications/ThemeSelector/ThemeSelectorCatalog semantic schema to a real code-owned factory.
|
|
|
struct | detail::ResourceAccess |
Explicit owning allowlist; builtins include VBox/HBox/Label/LineEdit/FormField/Password/Button/CheckBox/ThreeState. Construction and copying may allocate. Captured services remain explicit borrows and must outlive prepare; registry callbacks are released with the consumed scene recipe.
◆ add() [1/2]
template<class T, class Factory>
requires detail::ResourceFactory<T, Factory>
| std::expected< void, SceneResourceErrorCode > portals::ui::SceneResourceRegistry::add |
( |
std::string_view | name, |
|
|
Factory | factory, |
|
|
bool | children = false ) |
|
inline |
Register an explicitly typed custom recipe; existing names cannot be replaced.
- Template Parameters
-
- Parameters
-
| name | ASCII identifier copied now; case-sensitive and unique, including builtin names. |
| factory | Invoked once per node at prepare, after complete syntax/schema/id validation. External side effects are not rolled back; exceptions use the existing checked mount boundary. In CONFIGURATION, exact VirtualList/VirtualTable/Chart registrations accept their applicable scalar settings; these are staged after the factory, like common size properties. Models and formatters remain code captures. |
| children | Whether this custom type accepts child resource nodes; defaults to a leaf. |
- Returns
- Success, UNKNOWN_TYPE for an invalid name, or DUPLICATE_TYPE for a registered name. Allocation/capture construction before and during registration may throw.
◆ add() [2/2]
template<class T, class Factory, class Schema>
requires detail::ResourceFactory<T, Factory> && std::same_as<std::remove_cvref_t<Schema>, std::span<const
ControlPropertyDescriptor>>
| std::expected< void, SceneResourceErrorCode > portals::ui::SceneResourceRegistry::add |
( |
std::string_view | name, |
|
|
Factory | factory, |
|
|
Schema && | schema ) |
|
inline |
Explicitly bind the existing native MessageBox/Notifications/ThemeSelector/ThemeSelectorCatalog semantic schema to a real code-owned factory.
- Template Parameters
-
| T | Public Widget result type. |
| Factory | Existing owning resource callable. |
| Schema | Exactly the metadata span returned by controlPropertySchema; deduction preserves old bool calls. |
- Parameters
-
| name | Unique owning registration name. |
| factory | Actual code-owned native composite recipe producer. |
| schema | Complete canonical MessageBox, Notifications, ThemeSelector or ThemeSelectorCatalog descriptors, read only during this call and never retained. |
- Returns
- Checked registration, or INVALID_VALUE for empty/foreign/modified metadata. A returned ordinary/wrong native recipe is rejected during prepare. Message dialogs accept one owning custom-body child; other semantic nodes remain leaves.
◆ popupMenu()
Bind a named loaded popup to an owning code-defined action tree.
- Parameters
-
| name | Unique resource type name. |
| reference | Unified observing popup slot. |
| entries | Owning finite entries copied now; resources never deserialize ActionRefs. |
| options | Code-owned finite budgets and plane caps. |
- Returns
- Registration result; loaded common sizing/classes/visible/enabled remain scalar data.
The documentation for this class was generated from the following file: