Owning catalog input; legacy factories run synchronously once per explicit preview attempt on UI. Legacy factories must not block. The preparedTheme factory explicitly opts into worker preparation; captured input, closure copying and deletion must then be worker-safe. Borrowed captures must outlive their use, including eventual worker return after cancellation. UI captures are never moved implicitly.
More...
#include <theme_selection.hpp>
|
template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<StyleSheet, StyleError>>) |
| | ThemeChoice (std::string_view id, TextValue label, Factory factory, std::optional< TextValue > description={}) |
template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<StyleSheet, StyleError>>) |
| | ThemeChoice (std::string_view id, std::string_view label, Factory factory, std::optional< TextValue > description={}) |
|
| ~ThemeChoice ()=default |
| | Retain fallible ordinary copies of the owning catalog input.
|
|
|
class | portals::ManagedScene |
|
struct | detail::PreparedThemeAccess |
Owning catalog input; legacy factories run synchronously once per explicit preview attempt on UI. Legacy factories must not block. The preparedTheme factory explicitly opts into worker preparation; captured input, closure copying and deletion must then be worker-safe. Borrowed captures must outlive their use, including eventual worker return after cancellation. UI captures are never moved implicitly.
◆ ThemeChoice() [1/2]
template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<
StyleSheet,
StyleError>>)
| portals::ui::ThemeChoice::ThemeChoice |
( |
std::string_view | id, |
|
|
TextValue | label, |
|
|
Factory | factory, |
|
|
std::optional< TextValue > | description = {} ) |
|
inline |
- Template Parameters
-
| Factory | Copyable nullary callable returning StyleSheet or exactly expected<StyleSheet,StyleError>. |
- Parameters
-
| id | Nonempty unique application ID, copied immediately. |
| label | Owning literal/resource expression, resolved during setup. |
| factory | Owning synchronous candidate producer; construction may allocate. |
| description | Optional owning expression resolved during setup. |
◆ ThemeChoice() [2/2]
template<class Factory>
requires std::copy_constructible<Factory> && std::invocable<Factory &> && (std::same_as<std::invoke_result_t<Factory &>,
StyleSheet> || std::same_as<std::invoke_result_t<Factory &>, std::expected<
StyleSheet,
StyleError>>)
| portals::ui::ThemeChoice::ThemeChoice |
( |
std::string_view | id, |
|
|
std::string_view | label, |
|
|
Factory | factory, |
|
|
std::optional< TextValue > | description = {} ) |
|
inline |
- Template Parameters
-
| Factory | Same synchronous factory contract as the owning-text overload. |
- Parameters
-
| id | Application ID copied immediately. |
| label | Literal bytes copied immediately. |
| factory | Owning candidate producer. |
| description | Optional owning explanation. |
The documentation for this class was generated from the following file: