5#include <portals/detail/ui_event_access.hpp>
6#include <portals/detail/ui_recipe_access.hpp>
7#include <portals/ui_key_info.hpp>
12namespace portals::ui {
19template <detail::DescriptionInput Child>
20Description<Border> border(Child &&child, BorderOptions options = {}, ControlStyle style = {});
29template <detail::DescriptionInput Child>
31 std::shared_ptr<ScrollController> controller = {}, ControlStyle style = {});
39 std::function<bool(std::string_view)>
validate{};
71 detail::freezeControlDocumentSettings(patch);
72 state_->controlPatch = std::move(patch);
73 state_->settingsRequested =
true;
75 if constexpr (std::same_as<T, Grid>) {
76 if (state_->layout && state_->layout->gridContainer) {
77 gridControl().patch = state_->controlPatch;
78 gridControl().settingsRequested =
true;
83 return std::move(*
this);
88 requires std::same_as<T, DocumentView>
91 auto document = std::make_shared<ControlDocumentSettings>();
93 document->mode =
value;
94 patch.
document = std::move(document);
96 return std::move(*this).scalarSettings(std::move(patch));
101 requires std::same_as<T, DocumentView>
104 auto document = std::make_shared<ControlDocumentSettings>();
107 document->hexBytesPerRow = options.bytesPerRow;
108 document->hexGroupSize = options.groupSize;
109 document->hexUppercase = options.uppercase;
110 document->hexShowAscii = options.showAscii;
111 document->hexAutoFit = options.autoFit;
112 patch.
document = std::move(document);
114 return std::move(*this).scalarSettings(std::move(patch));
121 requires std::same_as<T, DocumentView>
124 auto document = std::make_shared<ControlDocumentSettings>();
125 document->language =
value;
126 patch.
document = std::move(document);
128 return std::move(*this).scalarSettings(std::move(patch));
135 requires std::same_as<T, DocumentView>
144 requires std::same_as<T, DocumentView>
147 auto document = std::make_shared<ControlDocumentSettings>();
148 document->syntax =
value;
149 patch.
document = std::move(document);
151 return std::move(*this).scalarSettings(std::move(patch));
156 requires std::same_as<T, DocumentView>
159 return setDocumentLineNumbers(scene, node, enabled);
168 key::Modifier wheel = key::ALT) &&
169 requires std::same_as<T, DocumentView>
172 auto document = std::make_shared<ControlDocumentSettings>();
173 document->fastScroll =
step;
174 document->fastKeyModifier = keyboard;
175 document->fastWheelModifier = wheel;
176 patch.
document = std::move(document);
178 return std::move(*this).scalarSettings(std::move(patch));
185 requires std::same_as<T, DocumentView>
187 return std::move(*
this)
188 .scalarSettings({.wheelStep =
static_cast<double>(
rows), .
keyStep =
rows})
190 if (
rows >
static_cast<std::uint64_t
>(std::numeric_limits<std::int64_t>::max())) {
199 requires std::same_as<T, DocumentView>
202 return setDocumentWrap(scene, node, enabled);
208 requires std::same_as<T, DocumentView>
211 return setDocumentEncoding(scene, node, value);
219 requires std::same_as<T, CheckBox>
221 return std::move(*this).scalarSettings({.cycle = CheckCycle::THREE_STATE});
228 requires std::same_as<T, Button>
230 return std::move(*this).scalarSettings({.chrome = value});
237 requires std::derived_from<T, SizedWidget>
239 return std::move(*this).scalarSettings({.glyphProfile = value});
246 requires std::derived_from<T, SizedWidget>
248 return std::move(*this).glyphProfile(detail::glyphProfile(
value));
255 requires std::derived_from<T, SizedWidget>
257 return std::move(*this).scalarSettings({.glyphFallback = value});
262 requires std::derived_from<T, SizedWidget>
264 return std::move(*this).glyphFallback(detail::glyphFallback(
value));
271 requires(std::same_as<T, Border> || std::same_as<T, Gauge> || std::same_as<T, Spinner> ||
272 std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
274 return std::move(*this).scalarSettings({.glyphs = value});
281 requires(std::same_as<T, Border> || std::same_as<T, Gauge> || std::same_as<T, Spinner> ||
282 std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
284 return std::move(*this).scalarSettings({.maxPaintCells = cells});
291 requires(std::same_as<T, Gauge> || std::same_as<T, Slider> || std::same_as<T, SpinBox>)
293 return std::move(*this).scalarSettings({.value = value});
300 requires(std::same_as<T, Gauge> || std::same_as<T, Slider> || std::same_as<T, SpinBox>)
302 return std::move(*this).scalarSettings({.minimum = value});
309 requires(std::same_as<T, Gauge> || std::same_as<T, Slider> || std::same_as<T, SpinBox>)
311 return std::move(*this).scalarSettings({.maximum = value});
319 requires(std::same_as<T, Gauge> || std::same_as<T, Slider> || std::same_as<T, SpinBox>)
321 return std::move(*this).scalarSettings({.minimum = minimum, .maximum = maximum});
328 requires(std::same_as<T, Gauge> || std::same_as<T, Slider> || std::same_as<T, SpinBox>)
330 return std::move(*this).scalarSettings({.preferredWidth = cells});
337 requires(std::same_as<T, Slider> || std::same_as<T, SpinBox>)
339 return std::move(*this).scalarSettings({.step = amount});
346 requires(std::same_as<T, Slider> || std::same_as<T, SpinBox>)
348 return std::move(*this).scalarSettings({.sliderSkin = std::string(name)});
355 requires std::same_as<T, Slider>
357 constexpr std::array<std::string_view, 4> SKIN_NAMES{
"ascii",
"line",
"rounded",
"blocks"};
358 const auto index =
static_cast<std::size_t
>(
value);
359 return std::move(*this).skin(index < SKIN_NAMES.size() ? SKIN_NAMES[index] : std::string_view{});
366 requires std::same_as<T, SpinBox>
368 constexpr std::array<std::string_view, 3> SKIN_NAMES{
"standard",
"compact",
"arrows"};
369 const auto index =
static_cast<std::size_t
>(
value);
371 return std::move(*this).skin(index < SKIN_NAMES.size() ? SKIN_NAMES[index] : std::string_view{});
378 requires std::same_as<T, Slider>
380 return std::move(*this).scalarSettings({.sliderTrack = std::move(value.track),
381 .sliderFill = std::move(value.fill),
382 .sliderThumb = std::move(value.thumb)});
389 requires(std::same_as<T, Slider> || std::same_as<T, SpinBox>)
391 return std::move(*this).scalarSettings({.pageSteps = count});
398 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
400 return std::move(*this).scalarSettings({.wheelStep = cells});
407 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
409 return std::move(*this).scalarSettings({.keyStep = cells});
416 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar> || std::same_as<T, DocumentView>)
418 return std::move(*this).scalarSettings({.pageOverlap = cells});
425 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
427 return std::move(*this).scalarSettings({.arrows = enabled});
434 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
436 return std::move(*this).scalarSettings({.minimumThumb = cells});
443 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
445 return std::move(*this).scalarSettings({.focusable = value});
452 requires(std::same_as<T, LineEdit> || std::same_as<T, Password> || std::same_as<T, ScrollArea> ||
453 std::same_as<T, ScrollBar> || std::same_as<T, Slider> || std::same_as<T, RadioGroup> ||
454 std::same_as<T, SpinBox>)
456 return std::move(*this).scalarSettings({.readOnly = value});
461 requires std::same_as<T, RadioGroup>
463 return std::move(*this).scalarSettings({.radioSelectionMode = value});
470 requires std::same_as<T, RadioGroup>
479 requires std::derived_from<T, ComboBox>
481 return std::move(*this).scalarSettings(
482 {.searchStrategy = enabled ? SearchStrategy::FUZZY_PREFIX : SearchStrategy::PREFIX});
487 requires std::derived_from<T, ComboBox>
489 return std::move(*this).fuzzy(
false);
496 requires(std::same_as<T, LineEdit> || std::same_as<T, Password> || std::same_as<T, SpinBox>)
502 return std::move(*this).scalarSettings({.displayMode = mode});
507 requires(std::same_as<T, LineEdit> || std::same_as<T, Password> || std::same_as<T, SpinBox>)
509 return std::move(*this).scalarSettings({.editMode = value});
515 requires(std::same_as<T, LineEdit> || std::same_as<T, Password> || std::same_as<T, SpinBox>)
517 return std::move(*this).scalarSettings({.placeholder = std::move(value)});
522 requires(std::same_as<T, LineEdit> || std::same_as<T, Password> || std::same_as<T, SpinBox>)
531 requires std::same_as<T, ScrollArea>
533 return std::move(*this).scalarSettings({.horizontal = policy});
540 requires std::same_as<T, ScrollArea>
542 return std::move(*this).scalarSettings({.vertical = policy});
549 requires std::same_as<T, ScrollArea>
551 return std::move(*this).scalarSettings({.placement = placement});
558 requires std::same_as<T, ScrollArea>
567 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
569 return std::move(*this).scrollbar(detail::scrollbarPattern(pattern));
576 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
578 return std::move(*this).scalarSettings({.scrollbar = {.pattern = pattern}});
585 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
587 return std::move(*this).scrollTrack(detail::scrollbarPattern(pattern));
592 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
594 return std::move(*this).scalarSettings({.scrollbar = {.trackPattern = pattern}});
601 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
603 return std::move(*this).scrollThumb(detail::scrollbarThumbPattern(pattern));
608 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
610 return std::move(*this).scalarSettings({.scrollbar = {.thumbPattern = pattern}});
617 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
619 return std::move(*this).scrollArrows(detail::scrollbarArrowPattern(pattern));
624 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
626 return std::move(*this).scalarSettings({.scrollbar = {.arrowPattern = pattern}});
634 requires(std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar>)
636 return std::move(*this).scalarSettings({.scrollbar = {.pattern = skin.pattern,
638 .maxGlyphBytes = skin.maxGlyphBytes,
639 .horizontal = skin.horizontal,
640 .vertical = skin.vertical,
641 .corner = skin.corner,
642 .trackPattern = skin.trackPattern,
643 .thumbPattern = skin.thumbPattern,
644 .arrowPattern = skin.arrowPattern},
645 .glyphProfile =
skin.glyphSelection.profile,
646 .glyphFallback =
skin.glyphSelection.fallback});
653 requires std::same_as<T, ScrollArea>
655 return std::move(*this).scalarSettings({.frame = {.enabled = enabled}});
662 requires std::same_as<T, ScrollArea>
664 return std::move(*this).scalarSettings({.frame = {.glyphs = glyphs}});
671 requires std::same_as<T, ScrollArea>
673 return std::move(*this).scalarSettings({.frame = {.maxPaintCells = cells}});
680 requires std::same_as<T, ScrollBar>
682 return std::move(*this).scalarSettings({.axis = axis});
691 return std::move(*this).scalarSettings({.rowHeight = value});
698 requires requires {
typename T::VirtualRow; }
701 return setVirtualRowsAutoRowHeight(scene, node, enabled);
711 return std::move(*this).scalarSettings({.overscanRows = value});
720 return std::move(*this).scalarSettings({.maxColumns = value});
729 return std::move(*this).scalarSettings({.maxPreparedCells = value});
738 return std::move(*this).scalarSettings({.maxPreparedTextBytes = value});
747 return std::move(*this).scalarSettings({.mode = value});
756 return std::move(*this).scalarSettings({.chartGlyphSet = value});
765 return std::move(*this).scalarSettings({.candleGap = cells});
781 return std::move(*this).scalarSettings({.yRange = patch});
788 requires std::same_as<T, DataStateView>
790 return std::move(*this).scalarSettings({.showStatus = value});
797 requires std::same_as<T, DataStateView>
799 return std::move(*this).scalarSettings({.statusRows = value});
806 requires std::same_as<T, DataStateView>
808 return std::move(*this).scalarSettings({.contentPolicy = value});
815 requires std::same_as<T, DataStateView>
817 return std::move(*this).scalarSettings({.spinnerInterval = value});
824 requires std::same_as<T, DataStateView>
826 return std::move(*this).scalarSettings({.labels = std::move(values)});
833 requires std::same_as<T, OverlayHost>
835 return std::move(*this).scalarSettings({.maxLayers = value});
842 requires std::same_as<T, Dialog>
844 return std::move(*this).scalarSettings({.title = std::move(value)});
851 requires std::same_as<T, Dialog>
860 requires std::same_as<T, Dialog>
862 return std::move(*this).scalarSettings({.dialog = {.mode = value}});
871 requires std::same_as<T, Dialog>
880 requires std::same_as<T, Dialog>
882 return std::move(*this).scalarSettings({.dialog = {.placement = value}});
889 requires std::same_as<T, Dialog>
891 return std::move(*this).scalarSettings({.dialog = {.viewportMargin = value}});
898 requires std::same_as<T, Dialog>
900 return std::move(*this).scalarSettings({.dialog = {.anchorGap = value}});
907 requires std::same_as<T, Dialog>
909 return std::move(*this).scalarSettings({.dialog = {.closeOnEscape = value}});
916 requires std::same_as<T, Dialog>
918 return std::move(*this).scalarSettings(
920 .closeButton = {.enabled = options.enabled, .placement = options.placement, .focusable = options.focusable}}});
927 requires std::same_as<T, Dialog>
929 return std::move(*this).scalarSettings(
930 {.dialog = {.maximumPanelSize = {.width = caps.width, .height = caps.height}}});
937 requires std::same_as<T, Dialog>
939 return std::move(*this).scalarSettings(
940 {.dialog = {.frame = {.glyphs = options.glyphs, .maxPaintCells = options.maxPaintCells}}});
947 requires std::same_as<T, Dialog>
949 return std::move(*this).scalarSettings({.dialog = values});
956 requires std::same_as<T, Dialog>
958 return std::move(*this).scalarSettings({.body = std::move(value)});
963 requires std::same_as<T, Dialog>
972 requires std::same_as<T, Dialog>
975 state_->messageSettingsRequested =
true;
978 return std::move(*this).scalarSettings({.message = std::move(values)});
985 requires std::same_as<T, Dialog>
988 state_->themeCatalogSettingsRequested =
true;
990 return std::move(*this).scalarSettings({.themeCatalog = std::move(values)});
997 requires std::same_as<T, Dialog>
1000 state_->themeSelectorSettingsRequested =
true;
1003 return std::move(*this).scalarSettings({.themeSelector = std::move(values)});
1010 requires std::same_as<T, Overlay>
1013 state_->notificationSettingsRequested =
true;
1016 return std::move(*this).scalarSettings({.notification = values});
1023 requires std::same_as<T, HelpView>
1025 return std::move(*this).scalarSettings({.initiallyOpen = opened});
1032 requires(std::same_as<T, HelpView> || std::same_as<T, KeyHints>)
1034 return std::move(*this).scalarSettings({.format = std::move(values)});
1041 requires(std::same_as<T, HelpView> || std::same_as<T, KeyHints>)
1043 return std::move(*this).scalarSettings({.emptyText = std::move(value)});
1050 requires(std::same_as<T, HelpView> || std::same_as<T, KeyHints>)
1052 return std::move(*this).scalarSettings({.unavailableText = std::move(value)});
1059 requires std::same_as<T, KeyHints>
1061 return std::move(*this).scalarSettings({.entrySeparator = std::move(value)});
1068 requires std::same_as<T, KeyHints>
1070 return std::move(*this).scalarSettings({.overflowMarker = std::move(value)});
1077 requires std::same_as<T, Overlay>
1079 return std::move(*this).scalarSettings({.grid = {.paddingLeft = insets.left,
1080 .paddingTop = insets.top,
1081 .paddingRight = insets.right,
1082 .paddingBottom = insets.bottom}});
1089 requires std::same_as<T, Spinner>
1091 return std::move(*this).scalarSettings({.spinnerPreset = value});
1098 template <
typename Name>
1099 requires(std::same_as<T, Spinner> && std::convertible_to<Name, std::string_view>)
1108 requires std::same_as<T, Spinner>
1110 return std::move(*this).frames(::portals::detail::spinnerFrames(values));
1117 requires std::same_as<T, Spinner>
1119 return std::move(*this).scalarSettings({.spinnerFrames = std::string(value)});
1126 requires std::same_as<T, Spinner>
1128 return std::move(*this).scalarSettings({.spinnerTick = value});
1135 requires std::same_as<T, Spinner>
1137 return std::move(*this).scalarSettings({.spinnerDirection = value});
1144 requires std::same_as<T, Spinner>
1146 return std::move(*this).scalarSettings({.spinnerAlignment = value});
1153 requires std::same_as<T, Spinner>
1155 return std::move(*this).scalarSettings({.spinnerActive = value});
1162 requires std::same_as<T, Spinner>
1164 return std::move(*this).scalarSettings({.spinnerReducedMotion = value});
1171 requires std::same_as<T, Spinner>
1180 requires std::same_as<T, Spinner>
1182 return std::move(*this).scalarSettings({.spinnerLabel = std::move(value)});
1189 requires std::same_as<T, Spinner>
1191 return std::move(*this).scalarSettings({.spinnerMaxFrames = value});
1198 requires std::same_as<T, Spinner>
1200 return std::move(*this).scalarSettings({.spinnerMaxFrameBytes = value});
1207 requires std::same_as<T, Spinner>
1209 return std::move(*this).scalarSettings({.spinnerMaxFrameCells = value});
1216 requires std::same_as<T, Overlay>
1218 return std::move(*this).scalarSettings({.horizontalAlign = align});
1225 requires std::same_as<T, Overlay>
1227 return std::move(*this).scalarSettings({.verticalAlign = align});
1236 state_->controlVariant.emplace(type);
1238 if constexpr (std::same_as<T, Grid>) {
1239 if (state_->layout && state_->layout->gridContainer) {
1240 gridControl().variant.emplace(type);
1241 declarativeOptions();
1245 return std::move(*
this);
1252 return std::move(*this).storeReference(std::move(
reference));
1262 requires std::same_as<T, Dialog>
1267 state_->anchorRequested =
true;
1269 return std::move(*
this);
1276 template <
class Callback>
1278 requires std::same_as<T, Dialog>
1280 return std::move(*this).setup([callback = std::move(callback)](
ManagedScene &scene,
Node<T> node)
mutable {
1281 return scene.onDismiss(node, std::move(callback));
1289 if (state_ && state_->id) {
1290 if (target.id.empty()) {
1291 target.id = *state_->id;
1292 }
else if (!target.id.empty()) {
1293 state_->id = target.id;
1297 return std::move(*this).setup([target = std::move(target)](
ManagedScene &scene,
Node<T> node)
mutable {
1298 return scene.style(node, std::move(target));
1308 state_->id.emplace(
value);
1312 return scene.id(node, detail::captionView(value));
1322 return scene.classes(node, values.values);
1330 template <
class Callback = detail::QuitCommand>
1333 if constexpr (std::same_as<Callback, ActionRef>) {
1334 return std::move(*this).setup([declaration = detail::retainAction(callback),
1338 return scene.onClick(node, std::move(callback));
1342 return std::move(*this).setup([callback = std::move(callback)](
ManagedScene &scene,
Node<T> node)
mutable {
1343 return scene.onClick(node, std::move(callback));
1353 template <std::equality_comparable Value,
class Callback>
1354 requires std::copy_constructible<Callback> &&
1355 (std::same_as<std::invoke_result_t<Callback &, const Value &>,
void> ||
1356 std::same_as<std::invoke_result_t<Callback &, const Value &>, std::expected<void, TreeError>>)
1358 return std::move(*this).setup([model, callback = std::move(callback)](
ManagedScene &scene,
Node<T> node)
mutable {
1359 return scene.observe(node, model, std::move(callback));
1370 template <std::equality_comparable Value,
class Callback>
1371 requires std::copy_constructible<Callback> &&
1372 (std::same_as<std::invoke_result_t<Callback &, const Value &>,
void> ||
1373 std::same_as<std::invoke_result_t<Callback &, const Value &>, std::expected<void, TreeError>>)
1375 return std::move(*this).setup([source, callback = std::move(callback)](
ManagedScene &scene,
Node<T> node)
mutable {
1376 return scene.observe(node, source, std::move(callback));
1384 return std::move(*this).setup([callback = std::move(callback)](
ManagedScene &scene,
Node<T> node)
mutable {
1385 return scene.onEvent(node, std::move(callback));
1393 return std::move(*this).setup([callback = std::move(callback)](
ManagedScene &scene,
Node<T> node)
mutable {
1394 return scene.onPrepare(node, std::move(callback));
1402 template <
class Callback>
1403 requires std::copy_constructible<Callback> &&
1405 (!std::same_as<std::invoke_result_t<Callback &, T &, Node<Widget>>, std::expected<void, TreeError>>)
1408 bool present =
true;
1410 if constexpr (std::is_pointer_v<Callback> ||
requires { callback.operator bool(); }) {
1411 present =
static_cast<bool>(callback);
1415 normalized = [callback = std::move(callback)](T &widget,
Node<Widget> focused)
mutable {
1416 return portals::detail::invokeIgnoringValue(callback, widget, focused);
1420 return std::move(*this).onPrepare(std::move(normalized));
1428 state_->visible =
value;
1431 return std::move(*
this);
1439 state_->enabled =
value;
1442 return std::move(*
this);
1451 requires std::derived_from<T, SizedWidget>
1454 auto &frame = frameRecipe();
1456 frame.options = std::move(options);
1457 frame.hasOptions =
true;
1458 frame.invalidPattern =
false;
1459 frame.titleBinding = {};
1462 return std::move(*
this);
1469 requires std::derived_from<T, SizedWidget>
1472 auto &
frame = frameRecipe();
1473 frame.hasOptions =
true;
1474 frame.options.titleDecoration = decoration;
1475 frame.options.customTitleDecoration.reset();
1478 return std::move(*
this);
1485 requires std::derived_from<T, SizedWidget>
1487 return std::move(*this).titleDecoration(detail::titleDecorationPreset(name));
1494 requires std::derived_from<T, SizedWidget>
1497 auto &
frame = frameRecipe();
1498 frame.hasOptions =
true;
1499 frame.options.customTitleDecoration = decoration;
1502 return std::move(*
this);
1509 requires std::derived_from<T, SizedWidget>
1512 auto &
frame = frameRecipe();
1513 const auto selected = detail::framePattern(pattern);
1516 frame.hasOptions =
true;
1517 frame.invalidPattern = !selected;
1518 frame.titleBinding = {};
1521 frame.options.pattern = *selected;
1525 return std::move(*
this);
1533 requires std::derived_from<T, SizedWidget>
1535 (void)std::move(*this).framed(pattern);
1538 frameRecipe().options.title =
title;
1541 return std::move(*
this);
1550 template <
class Title>
1551 requires std::same_as<Title, ValueText>
1553 requires(std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>);
1559 template <
class Value>
1560 requires std::formattable<Value, char> && std::equality_comparable<Value> &&
1561 std::copy_constructible<Value>
1563 requires(std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>);
1571 requires(std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>)
1573 (void)std::move(*this).
framed(std::move(options));
1576 frameRecipe().reference = std::move(outer);
1579 return std::move(*
this);
1587 requires(std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>)
1589 (void)std::move(*this).framed(pattern);
1592 frameRecipe().reference = std::move(outer);
1595 return std::move(*
this);
1604 requires(std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>)
1606 (void)std::move(*this).framed(std::move(outer), pattern);
1609 frameRecipe().options.title =
title;
1612 return std::move(*
this);
1620 template <
class Title>
1621 requires std::same_as<Title, ValueText>
1623 requires(std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>);
1630 template <
class Value>
1631 requires std::formattable<Value, char> && std::equality_comparable<Value> &&
1632 std::copy_constructible<Value>
1634 requires(std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>);
1640 requires std::derived_from<T, SizedWidget>
1642 return std::move(*this).resize({detail::SizeDimension::WIDTH, cells});
1649 requires std::derived_from<T, SizedWidget>
1651 return std::move(*this).resize({detail::SizeDimension::HEIGHT, cells});
1656 requires std::derived_from<T, SizedWidget>
1658 return std::move(*this).constrainSize({detail::SizeDimension::FIT_WIDTH});
1663 requires std::derived_from<T, SizedWidget>
1665 return std::move(*this).constrainSize({detail::SizeDimension::FIT_HEIGHT});
1672 requires std::derived_from<T, SizedWidget>
1674 return std::move(*this).constrainSize({detail::SizeDimension::MIN_WIDTH, cells});
1681 requires std::derived_from<T, SizedWidget>
1683 return std::move(*this).constrainSize({detail::SizeDimension::MAX_WIDTH, cells});
1690 requires std::derived_from<T, SizedWidget>
1692 return std::move(*this).constrainSize({detail::SizeDimension::MIN_HEIGHT, cells});
1699 requires std::derived_from<T, SizedWidget>
1701 return std::move(*this).constrainSize({detail::SizeDimension::MAX_HEIGHT, cells});
1708 requires std::same_as<T, Grid>
1711 declarativeOptions().columns = count;
1712 gridControl().arguments.grid.columns = count;
1715 return std::move(*
this);
1722 requires std::same_as<T, Grid>
1725 declarativeOptions().rows = count;
1726 gridControl().arguments.grid.rows = count;
1729 return std::move(*
this);
1736 requires std::same_as<T, Grid>
1739 declarativeOptions().flow =
value;
1740 gridControl().arguments.grid.flow =
value;
1743 return std::move(*
this);
1750 requires std::same_as<T, Grid>
1753 declarativeOptions().columnGap = cells;
1754 gridControl().arguments.grid.columnGap = cells;
1757 return std::move(*
this);
1764 requires std::same_as<T, Grid>
1767 declarativeOptions().rowGap = cells;
1768 gridControl().arguments.grid.rowGap = cells;
1771 return std::move(*
this);
1778 requires std::same_as<T, Grid>
1781 declarativeOptions() = options;
1782 auto &arguments = gridControl().arguments.grid;
1784 arguments.columns = options.columns;
1785 arguments.rows = options.rows;
1786 arguments.flow = options.flow;
1787 arguments.columnGap = options.columnGap;
1788 arguments.rowGap = options.rowGap;
1789 arguments.paddingLeft = options.padding.left;
1790 arguments.paddingTop = options.padding.top;
1791 arguments.paddingRight = options.padding.right;
1792 arguments.paddingBottom = options.padding.bottom;
1793 arguments.maxTracksPerAxis = options.maxTracksPerAxis;
1794 arguments.maxPlacements = options.maxPlacements;
1795 arguments.maxPlacementWork = options.maxPlacementWork;
1798 return std::move(*
this);
1805 requires std::same_as<T, Grid>
1811 return std::move(*
this);
1818 requires std::same_as<T, Grid>
1821 declarativeOptions();
1822 layoutMetadata().columnSizes = std::make_unique<std::vector<AxisSize>>(policies);
1825 return std::move(*
this);
1833 requires std::same_as<T, Grid>
1836 declarativeOptions();
1837 layoutMetadata().rowSizes = std::make_unique<std::vector<AxisSize>>(policies);
1840 return std::move(*
this);
1847 requires std::same_as<T, Grid>
1850 declarativeOptions();
1851 auto &layout = layoutMetadata();
1853 if (!layout.scroll) {
1854 layout.scroll.emplace();
1858 layout.scroll->controller = std::move(controller);
1861 gridControl().arguments.grid.scroll =
true;
1864 return std::move(*
this);
1871 requires std::same_as<T, Grid>
1874 declarativeOptions();
1875 auto &layout = layoutMetadata();
1877 if (!layout.scroll) {
1878 layout.scroll.emplace();
1881 layout.scroll->area = options;
1882 gridControl().arguments.grid.scroll =
true;
1885 return std::move(*
this);
1893 layoutMetadata().item = options;
1894 state_->layout->itemRequested =
true;
1897 return std::move(*
this);
1905 layoutMetadata().item.row = index;
1906 state_->layout->itemRequested =
true;
1909 return std::move(*
this);
1917 layoutMetadata().item.column = index;
1918 state_->layout->itemRequested =
true;
1921 return std::move(*
this);
1929 layoutMetadata().item.rowSpan = count;
1930 state_->layout->itemRequested =
true;
1933 return std::move(*
this);
1941 layoutMetadata().item.columnSpan = count;
1942 state_->layout->itemRequested =
true;
1945 return std::move(*
this);
1953 requires std::derived_from<T, SizedWidget>
1955 return std::move(*this).resize({detail::SizeDimension::FLEX_X, 0, weight});
1963 requires std::derived_from<T, SizedWidget>
1965 return std::move(*this).resize({detail::SizeDimension::FLEX_Y, 0, weight});
1972 requires std::derived_from<T, SizedWidget>
1974 return std::move(*this).resize({detail::SizeDimension::FLEX, 0, weight});
1983 state_->setup.push_back(std::move(callback));
1986 return std::move(*
this);
1994 state_->focusScope =
true;
1997 return std::move(*
this);
2006 state_->focusDefault =
true;
2009 return std::move(*
this);
2014 friend struct detail::ResourceAccess;
2019 detail::applyFluentControlOrigins(patch, state_->controlPatch);
2021 state_->settingsRequested =
true;
2024 return std::move(*
this);
2027 template <detail::DescriptionInput Child>
2028 friend Description<ScrollArea> scrollArea(Child &&, ScrollAreaOptions, std::shared_ptr<ScrollController>,
2031 template <
class U,
class... Args>
friend Description<U> custom(Args &&...args);
2032 template <
class U>
friend Description<U> control(std::string_view, ControlStyle, SizePolicy);
2033 template <
class U, detail::DescriptionInput... Children>
friend Description<U> linear(LinearOptions, Children &&...);
2034 template <
class U, detail::DescriptionRange R>
friend Description<U> linear(LinearOptions, R &&);
2035 template <detail::DescriptionInput... Children>
2036 friend Description<Overlay> overlay(OverlayOptions, SizePolicy, Children &&...);
2037 template <detail::GridInput... Children>
friend Description<Grid> grid(Children &&...);
2038 friend Description<LineEdit> lineEdit(ManagedState<std::string>, LineEditConfig);
2040 using State = detail::RecipeState<T>;
2041 using Factory =
typename State::Factory;
2042 using Child =
typename State::Child;
2043 using FrameRecipe =
typename State::FrameRecipe;
2051 template <
class Create>
2052 requires std::invocable<Create &, ManagedScene &, Node<Widget> &>
2053 explicit Description(Create create) : state_(std::make_unique<State>()) {
2054 state_->create = [create = std::move(create)](ManagedScene &scene, Node<Widget> parent,
2055 detail::MountContext &)
mutable {
2056 return create(scene, parent);
2060 detail::RecipeLayout &layoutMetadata() {
2061 if (!state_->layout) {
2062 state_->layout = std::make_shared<detail::RecipeLayout>();
2065 return *state_->layout;
2068 detail::GridRecipeControl &gridControl()
2069 requires std::same_as<T, Grid>
2071 auto &layout = layoutMetadata();
2073 if (!layout.control) {
2074 layout.control = std::make_unique<detail::GridRecipeControl>();
2077 return *layout.control;
2080 DeclarativeGridOptions &declarativeOptions()
2081 requires std::same_as<T, Grid>
2083 auto &layout = layoutMetadata();
2086 layout.grid.emplace();
2089 layout.hasDeclaredGrid =
true;
2091 return *layout.grid;
2097 Description &&resize(detail::SizeChange change) &&
2098 requires std::derived_from<T, SizedWidget>
2100 auto *state = state_.get();
2102 if (state && state->sizing) {
2103 state->sizing->stage(change,
false);
2108 return std::move(*this).setup([change, state](ManagedScene &scene, Node<T> node) {
2109 const Node<SizedWidget> target = state && state->frame && state->frame->mounted != Node<Border>{}
2110 ? Node<SizedWidget>(state->frame->mounted)
2111 : Node<SizedWidget>(node);
2113 return detail::Access::resize(scene, target, change);
2118 Description &&constrainSize(detail::SizeChange change) &&
2119 requires std::derived_from<T, SizedWidget>
2122 if (!state_->sizing) {
2123 state_->sizing = std::make_unique<detail::RecipeSizing>();
2126 state_->sizing->stage(change,
true);
2129 return std::move(*
this);
2133 FrameRecipe &frameRecipe() {
2134 if (!state_->frame) {
2135 state_->frame = std::make_unique<FrameRecipe>();
2138 return *state_->
frame;
2146 Description &&storeReference(NodeRef<T> reference) && {
2148 state_->references.push_back(std::move(reference));
2151 return std::move(*
this);
2157 static std::expected<void, ManagedError> prepareSemanticControl(State &state, Node<Widget> parent) {
2158 const auto kind = state.semanticConstruction ? state.semanticConstruction->kind : detail::ControlFactoryKind::USER;
2160 if ((state.messageSettingsRequested && kind != detail::ControlFactoryKind::MESSAGE_BINDING) ||
2161 (state.notificationSettingsRequested && kind != detail::ControlFactoryKind::NOTIFICATION_BINDING) ||
2162 (state.themeSelectorSettingsRequested && kind != detail::ControlFactoryKind::THEME_SELECTOR_BINDING &&
2163 kind != detail::ControlFactoryKind::THEME_CATALOG_BINDING) ||
2164 (state.themeCatalogSettingsRequested && kind != detail::ControlFactoryKind::THEME_CATALOG_BINDING)) {
2165 return std::unexpected(detail::controlContextError({ControlContextErrorCode::UNSUPPORTED_PROPERTY, {}}, parent));
2168 if (state.semanticConstruction && state.semanticConstruction->prepared) {
2169 const auto &source = state.semanticConstruction->source;
2170 auto merged = detail::Access::mergeControlSettings(state.controlPatch, source);
2174 merged.origin = state.controlPatch.origin;
2175 merged.origins = state.controlPatch.origins;
2177 for (
const auto &origin : source.origins) {
2178 auto found = std::ranges::find(merged.origins, origin.path, &ControlPropertyOrigin::path);
2180 if (found == merged.origins.end()) {
2181 merged.origins.push_back(origin);
2183 found->source = origin.source;
2187 state.controlPatch = std::move(merged);
2188 state.controlPrepared =
true;
2189 state.materializedSettings = state.semanticConstruction->materialized;
2190 state.settingsRequested =
true;
2197 static std::expected<void, ControlContextError> installControlSchema(
const State &state, ControlContext &controls) {
2198 if constexpr (std::same_as<T, Border> || std::same_as<T, Gauge> || std::same_as<T, Spinner>) {
2199 return detail::ControlContextAccess::installPrimitiveSchema(controls, *state.controlType);
2200 }
else if constexpr (std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar> || std::same_as<T, LogView> ||
2201 std::same_as<T, DocumentView>) {
2202 return detail::ControlContextAccess::installScrollSchema(controls, *state.controlType);
2203 }
else if constexpr (std::same_as<T, DataStateView>) {
2204 return detail::ControlContextAccess::installDataStateSchema(controls);
2205 }
else if constexpr (std::same_as<T, OverlayHost> || std::same_as<T, Dialog>) {
2206 if (!state.semanticConstruction) {
2207 return detail::ControlContextAccess::installDialogSchema(controls, *state.controlType);
2210 if (state.semanticConstruction->kind == detail::ControlFactoryKind::THEME_CATALOG_BINDING) {
2211 return detail::ControlContextAccess::installThemeCatalogSchema(controls,
true);
2214 if (state.semanticConstruction->kind == detail::ControlFactoryKind::THEME_SELECTOR_BINDING) {
2215 return detail::ControlContextAccess::installThemeSelectorSchema(controls);
2218 return detail::ControlContextAccess::installMessageSchema(controls);
2219 }
else if constexpr (std::same_as<T, Overlay>) {
2220 return state.semanticConstruction ? detail::ControlContextAccess::installNotificationSchema(controls)
2221 : detail::ControlContextAccess::installOverlaySchema(controls);
2222 }
else if constexpr (std::same_as<T, HelpView> || std::same_as<T, KeyHints>) {
2223 return detail::ControlContextAccess::installKeyHelpSchema(controls, *state.controlType);
2224 }
else if constexpr (detail::IsVirtualList<T>::value || detail::IsVirtualTable<T>::value ||
2225 detail::IsChart<T>::value) {
2226 return detail::ControlContextAccess::installVirtualViewSchema(controls, *state.controlType);
2233 static bool matchesControlFactory(
const State &state,
const ResolvedControl &effective) {
2234 if constexpr (std::same_as<T, Border> || std::same_as<T, Gauge> || std::same_as<T, Spinner>) {
2235 return effective.factoryKind == detail::ControlFactoryKind::PRIMITIVE_FALLBACK;
2236 }
else if constexpr (std::same_as<T, ScrollArea> || std::same_as<T, ScrollBar> || std::same_as<T, LogView> ||
2237 std::same_as<T, DocumentView>) {
2238 return effective.factoryKind == detail::ControlFactoryKind::SCROLL_FALLBACK;
2239 }
else if constexpr (std::same_as<T, DataStateView>) {
2240 return effective.factoryKind == detail::ControlFactoryKind::DATA_STATE_FALLBACK;
2241 }
else if constexpr (std::same_as<T, OverlayHost> || std::same_as<T, Dialog>) {
2242 const auto expectedKind =
2243 state.semanticConstruction ? state.semanticConstruction->kind : detail::ControlFactoryKind::DIALOG_FALLBACK;
2245 return effective.factoryKind == expectedKind;
2246 }
else if constexpr (std::same_as<T, Overlay>) {
2247 const auto expectedKind = state.semanticConstruction ? detail::ControlFactoryKind::NOTIFICATION_BINDING
2248 : detail::ControlFactoryKind::OVERLAY_FALLBACK;
2250 return effective.factoryKind == expectedKind;
2251 }
else if constexpr (std::same_as<T, HelpView> || std::same_as<T, KeyHints>) {
2252 return effective.factoryKind == detail::ControlFactoryKind::KEY_HELP_FALLBACK;
2253 }
else if constexpr (detail::IsVirtualList<T>::value || detail::IsVirtualTable<T>::value ||
2254 detail::IsChart<T>::value) {
2255 return effective.factoryKind == detail::ControlFactoryKind::VIRTUAL_VIEW_FALLBACK;
2262 static std::expected<void, ManagedError> validateControlIdentity(
const State &state, ResolvedControl &effective,
2263 const ControlContext &controls, Node<Widget> parent,
2264 bool restoreVariant) {
2265 if (restoreVariant && state.controlVariant) {
2266 const auto identity = controls.resolve(*state.controlVariant);
2269 return std::unexpected(detail::controlContextError(identity.error(), parent));
2272 effective.type = identity->type;
2273 effective.base = identity->base;
2274 effective.lineage = identity->lineage;
2277 if (effective.base != *state.controlType) {
2278 return std::unexpected(detail::controlContextError({ControlContextErrorCode::INVALID_VALUE, {}}, parent));
2281 if (!matchesControlFactory(state, effective)) {
2282 return std::unexpected(detail::controlContextError({ControlContextErrorCode::INVALID_VALUE, {}}, parent));
2291 static std::expected<void, ManagedError>
2292 retainControlSettings(State &state, ResolvedControl &effective,
2293 const std::optional<ResolvedControl> ¬ificationStyle, Node<Widget> parent,
2294 detail::MountContext &context) {
2295 const auto addedLeaves =
2296 state.controlPrepared
2297 ? (detail::controlSettingsPresenceSet(effective.settings) & ~state.materializedSettings).count()
2298 : effective.materializedLeaves;
2299 const auto limit = context.controls.limits().maxMaterializedLeaves;
2301 if (context.controlLeaves > limit || addedLeaves > limit - context.controlLeaves) {
2302 return std::unexpected(
2303 detail::controlContextError({ControlContextErrorCode::MATERIALIZED_LEAF_LIMIT, {}}, parent));
2306 context.controlLeaves += addedLeaves;
2308 if (state.controlVariant) {
2309 const auto &identity = notificationStyle ? *notificationStyle : effective;
2311 state.intrinsicStyle = StyleTarget{.type = identity.type,
2312 .control = std::same_as<T, RadioGroup> || std::derived_from<T, Control> ||
2313 std::same_as<T, LineEdit> || std::same_as<T, Password>,
2314 .baseTypes = identity.lineage};
2316 if constexpr (std::same_as<T, Row> || std::same_as<T, Column>) {
2317 constexpr std::string_view NATURAL = std::same_as<T, Row> ?
"Row" :
"Column";
2319 if (state.intrinsicStyle->type != NATURAL &&
2320 std::ranges::find(state.intrinsicStyle->baseTypes, NATURAL) == state.intrinsicStyle->baseTypes.end()) {
2321 state.intrinsicStyle->baseTypes.emplace_back(NATURAL);
2326 state.resolvedControl = std::make_unique<ResolvedControl>(std::move(effective));
2332 static std::expected<void, ManagedError> prepareControlSettings(State &state, Node<Widget> parent,
2333 detail::MountContext &context) {
2334 std::optional<ResolvedControl> notificationStyle;
2336 if constexpr (std::same_as<T, Overlay>) {
2337 if (state.semanticConstruction && state.controlVariant &&
2338 state.semanticConstruction->kind == detail::ControlFactoryKind::NOTIFICATION_BINDING) {
2339 auto identity = context.controls.resolve(*state.controlVariant);
2342 return std::unexpected(detail::controlContextError(identity.error(), parent));
2345 if (identity->base ==
"Overlay" && identity->factoryKind == detail::ControlFactoryKind::OVERLAY_FALLBACK) {
2348 notificationStyle.emplace(std::move(*identity));
2353 const bool inheritControlSettings = state.inheritControlSettings && !notificationStyle;
2355 !inheritControlSettings || (state.controlPrepared && !state.controlVariant && !state.inheritPreparedDefaults)
2356 ? ControlContext(context.controls.limits())
2358 auto installed = installControlSchema(state, controls);
2361 return std::unexpected(detail::controlContextError(installed.error(), parent));
2364 const auto type = inheritControlSettings && state.controlVariant ? std::string_view(*state.controlVariant)
2365 : std::string_view(*state.controlType);
2366 const auto numericCandidates = [&] {
2367 if constexpr ((std::derived_from<T, Slider> || std::same_as<T, SpinBox>)) {
2368 return std::array{state.controlPatch.value ? state.controlPatch.value : state.controlArguments.value,
2369 state.controlPatch.minimum ? state.controlPatch.minimum : state.controlArguments.minimum,
2370 state.controlPatch.maximum ? state.controlPatch.maximum : state.controlArguments.maximum,
2371 state.controlPatch.step ? state.controlPatch.step : state.controlArguments.step};
2373 return std::array<std::optional<double>, 0>{};
2376 auto effective = inheritControlSettings
2377 ? controls.resolve(type, detail::Access::mergeControlSettings(std::move(state.controlArguments),
2378 state.controlPatch))
2379 : controls.resolve(type, state.controlPatch);
2382 auto failure = detail::controlContextError(effective.error(), parent);
2384 if constexpr ((std::derived_from<T, Slider> || std::same_as<T, SpinBox>)) {
2385 const auto &original = effective.error();
2387 if (original.code == ControlContextErrorCode::INVALID_VALUE && original.diagnostic) {
2388 constexpr std::array<std::string_view, 4> LEAVES{
".value",
".minimum",
".maximum",
".step"};
2390 for (std::size_t index = 0; index < LEAVES.size(); ++index) {
2391 const auto candidate = numericCandidates[index];
2393 if (candidate && original.diagnostic->path.ends_with(LEAVES[index])) {
2394 if (!std::isfinite(*candidate)) {
2395 failure.numeric = NumericError::NOT_FINITE;
2396 }
else if (LEAVES[index] ==
".step" && *candidate <= 0) {
2397 failure.numeric = NumericError::INVALID_STEP;
2404 return std::unexpected(std::move(failure));
2407 auto validated = validateControlIdentity(state, *effective, context.controls, parent,
2408 !inheritControlSettings && !notificationStyle);
2414 return retainControlSettings(state, *effective, notificationStyle, parent, context);
2423 static std::expected<void, ManagedError> prepareControl(State &state, Node<Widget> parent,
2424 detail::MountContext &context) {
2425 if constexpr (std::same_as<T, Dialog> || std::same_as<T, Overlay>) {
2426 auto prepared = prepareSemanticControl(state, parent);
2433 if constexpr (std::same_as<T, Grid>) {
2434 if (state.layout && state.layout->gridContainer && state.layout->control && state.layout->control->prepared) {
2435 state.resolvedControl = std::move(state.layout->control->resolved);
2437 if (state.controlVariant && state.resolvedControl) {
2438 state.intrinsicStyle =
2439 StyleTarget{.type = state.resolvedControl->type, .baseTypes = state.resolvedControl->lineage};
2446 if ((state.settingsRequested || state.controlVariant) && !state.controlType) {
2447 return std::unexpected(detail::controlContextError({ControlContextErrorCode::UNSUPPORTED_PROPERTY, {}}, parent));
2450 const bool builtinOnly = context.controls.empty() && !state.settingsRequested && !state.controlVariant;
2452 if (state.controlType && (!state.controlPrepared || state.settingsRequested || state.controlVariant) &&
2454 return prepareControlSettings(state, parent, context);
2469 std::expected<Node<T>, ManagedError> mountInto(ManagedScene &scene, Node<Widget> parent,
2470 detail::MountContext &context) && {
2471 auto state = std::move(state_);
2474 return std::unexpected(detail::error(parent, TreeError::INVALID_ARGUMENT));
2477 if (state->prerequisiteFailure) {
2478 auto admitted = detail::Access::check(scene, parent);
2481 return std::unexpected(admitted.error());
2484 return std::unexpected(*state->prerequisiteFailure);
2487 if (!state->create) {
2488 return std::unexpected(detail::error(parent, TreeError::INVALID_ARGUMENT));
2491 auto gridPrepared = detail::prepareGridLayouts(state->layout, context, parent);
2493 if (!gridPrepared) {
2494 return std::unexpected(gridPrepared.error());
2497 auto layoutChecked = detail::preflightLayout(state->layout);
2499 if (!layoutChecked) {
2500 return std::unexpected(detail::error(parent, layoutChecked.error()));
2503 auto prepared = prepareControl(*state, parent, context);
2505 return std::unexpected(prepared.error());
2507 const auto *resolved = state->resolvedControl.get();
2509 auto mountParent = parent;
2511 if constexpr (std::derived_from<T, SizedWidget> && !std::derived_from<T, ScrollArea>) {
2512 const auto &settings = resolved ? resolved->settings : state->controlArguments;
2513 const bool configuredFrame = detail::hasFrameSettings(settings.frame);
2515 if (state->frame || configuredFrame) {
2516 if (state->frame && state->frame->invalidPattern) {
2517 return std::unexpected(
2518 detail::frameContextError(ControlContextErrorCode::INVALID_VALUE,
"frame.pattern", parent));
2521 auto effective = detail::controlFrameOptions(
2522 settings, state->frame && state->frame->hasOptions ? std::optional(state->frame->options) : std::nullopt,
2523 scene.widthPolicy());
2526 return std::unexpected(effective.error());
2529 if (state->frame && state->frame->source) {
2530 effective = detail::controlFrameOptions(*state->frame->source, std::move(*effective), scene.widthPolicy());
2533 return std::unexpected(effective.error());
2538 if (!state->frame) {
2539 state->frame = std::make_unique<FrameRecipe>();
2542 state->frame->options = std::move(**effective);
2543 state->frame->hasOptions =
true;
2545 state->frame.reset();
2551 if (state->frame->invalidPattern) {
2552 return std::unexpected(
2553 detail::frameContextError(ControlContextErrorCode::INVALID_VALUE,
"frame.pattern", parent));
2556 const auto valid = Border::validateFrame(state->frame->options);
2559 return std::unexpected(detail::error(parent, valid.error()));
2562 if constexpr (std::derived_from<T, ScrollArea>) {
2564 if (!state->controlType || (*state->controlType !=
"ScrollArea" && *state->controlType !=
"LogView" &&
2565 *state->controlType !=
"DocumentView")) {
2566 return std::unexpected(detail::error(parent, TreeError::INVALID_ARGUMENT));
2569 auto frame = detail::Access::framedControl(std::move(state->frame->options), {});
2571 if (state->frame->reference) {
2572 (void)std::move(frame).reference(*state->frame->reference);
2575 auto mounted = detail::Access::mount(std::move(frame), scene, parent, context);
2578 return std::unexpected(mounted.error());
2581 state->frame->mounted = *mounted;
2582 mountParent = *mounted;
2583 if (state->frame->titleBinding) {
2584 auto bound = state->frame->titleBinding(scene, *mounted, context);
2586 return std::unexpected(bound.error());
2592 context.mountedOuter = {};
2596 detail::MountContext &context;
2598 const ControlSettings *settings;
2599 const FrameOptions *frame;
2600 const ControlSettings *frameSettings;
2601 Description<Widget> *body;
2603 context.controlPrepared = previous;
2604 context.controlSettings = settings;
2605 context.frameOptions = frame;
2606 context.frameSettings = frameSettings;
2607 context.messageBody = body;
2610 context.controlPrepared,
2611 context.controlSettings,
2612 context.frameOptions,
2613 context.frameSettings,
2614 context.messageBody};
2616 context.controlPrepared = state->controlPrepared;
2617 context.controlSettings = resolved ? &resolved->settings : &state->controlArguments;
2618 context.frameOptions =
2619 std::derived_from<T, ScrollArea> && state->frame && state->frame->hasOptions ? &state->frame->options :
nullptr;
2620 context.frameSettings = std::derived_from<T, ScrollArea> && state->frame ? state->frame->source.get() :
nullptr;
2622 context.messageBody = state->semanticConstruction ? state->semanticConstruction->body.get() :
nullptr;
2624 return state->create(scene, mountParent, context);
2631 const Node<Widget> outer = state->frame && state->frame->mounted != Node<Border>{}
2632 ? Node<Widget>(state->frame->mounted)
2633 : state->forwardsOuter && context.mountedOuter != Node<Widget>{} ? context.mountedOuter
2634 : Node<Widget>(*node);
2636 if (context.root == Node<Widget>{}) {
2637 context.root = *node;
2640 context.nodes.push_back(*node);
2642 if (state->visible || state->enabled) {
2643 auto configured = detail::Access::instanceState(scene, outer, state->visible, state->enabled);
2646 return std::unexpected(configured.error());
2650 if (state->intrinsicStyle) {
2652 if constexpr (std::same_as<T, Dialog> || std::same_as<T, OverlayHost>) {
2654 return detail::Access::finalizeStyleIdentity(scene, *node, *state->intrinsicStyle);
2655 }
else if constexpr (std::same_as<T, Overlay>) {
2656 return state->semanticConstruction
2657 ? detail::Access::finalizeStyleIdentity(scene, *node, *state->intrinsicStyle)
2658 : scene.style(*node, *state->intrinsicStyle);
2660 return scene.
style(*node, *state->intrinsicStyle);
2665 return std::unexpected(styled.error());
2669 if (state->controlSetup) {
2670 auto configured = state->controlSetup(scene, *node, resolved ? resolved->settings : state->controlArguments);
2672 return std::unexpected(configured.error());
2676 if constexpr (std::derived_from<T, SizedWidget>) {
2678 const auto &settings = resolved->settings;
2679 const auto *sourceSizing =
2680 state->semanticConstruction && state->semanticConstruction->prepared &&
2681 state->semanticConstruction->kind == detail::ControlFactoryKind::NOTIFICATION_BINDING
2682 ? &state->semanticConstruction->source
2685 const auto sizing = detail::controlSizing(settings, sourceSizing);
2686 const Node<SizedWidget> target = state->frame && state->frame->mounted != Node<Border>{}
2687 ? Node<SizedWidget>(state->frame->mounted)
2688 : Node<SizedWidget>(*node);
2689 auto resized = detail::Access::finishSizing(scene, target, target, &sizing);
2692 return std::unexpected(resized.error());
2697 Node<LineEdit> fieldDraft;
2699 if constexpr (std::same_as<T, FormField> || std::same_as<T, FindBar> || std::same_as<T, SpinBox> ||
2700 std::derived_from<T, ComboBox>) {
2701 auto editor = detail::NamedAccess::fieldDraft(scene, *node);
2704 return std::unexpected(editor.error());
2707 fieldDraft = *editor;
2710 for (
auto &reference : state->references) {
2713 if (slot && slot->fluent && slot->target.owner != std::this_thread::get_id()) {
2714 return std::unexpected(detail::error(*node, TreeError::WRONG_THREAD));
2717 if (!slot || slot->node != Node<T>{} || slot->pending) {
2718 return std::unexpected(detail::error(*node, TreeError::INVALID_ARGUMENT));
2723 context.release.push_back([slot] {
2724 slot->pending =
false;
2726 context.publish.push_back(
2727 [slot, value = *node, owner = &scene, lifetime = detail::Access::lifetime(scene), fieldDraft] {
2729 slot->target.node = value;
2730 slot->target.scene = owner;
2731 slot->target.lifetime = lifetime;
2733 if constexpr (std::derived_from<T, Control>) {
2734 slot->target.caption = value;
2735 }
else if constexpr (std::same_as<T, LineEdit>) {
2736 slot->target.draft = value;
2737 }
else if constexpr (std::same_as<T, FormField> || std::same_as<T, FindBar> || std::same_as<T, SpinBox> ||
2738 std::derived_from<T, ComboBox>) {
2739 slot->target.draft = fieldDraft;
2740 }
else if constexpr (std::same_as<T, Password>) {
2741 slot->target.secret = value;
2744 detail::RefTarget pending;
2745 pending.node = *node;
2746 pending.scene = &scene;
2747 pending.lifetime = detail::Access::lifetime(scene);
2748 if constexpr (std::derived_from<T, Control>) {
2749 pending.caption = *node;
2750 }
else if constexpr (std::same_as<T, LineEdit>) {
2751 pending.draft = *node;
2752 }
else if constexpr (std::same_as<T, FormField> || std::same_as<T, FindBar> || std::same_as<T, SpinBox> ||
2753 std::derived_from<T, ComboBox>) {
2754 pending.draft = fieldDraft;
2755 }
else if constexpr (std::same_as<T, Password>) {
2756 pending.secret = *node;
2758 context.pending.push_back({&slot->target, std::move(pending)});
2759 slot->pending =
true;
2762 if (state->focusScope) {
2763 auto registered = scene.focusScope(*node);
2766 return std::unexpected(registered.error());
2770 if (state->focusDefault) {
2771 auto configured = scene.focusDefault(*node);
2774 return std::unexpected(configured.error());
2778 for (
auto &setup : state->setup) {
2780 return std::unexpected(detail::error(*node, TreeError::INVALID_ARGUMENT));
2783 auto configured = setup(scene, *node);
2786 return std::unexpected(configured.error());
2790 if constexpr (std::same_as<T, Overlay>) {
2791 if (state->semanticConstruction && state->semanticConstruction->prepared &&
2792 state->semanticConstruction->kind == detail::ControlFactoryKind::NOTIFICATION_BINDING) {
2794 const auto &source = state->semanticConstruction->source;
2796 const auto sizing = detail::controlSizing(source);
2797 auto resized = detail::Access::finishSizing(scene, *node, *node, &sizing);
2800 return std::unexpected(resized.error());
2803 if (state->sizing) {
2804 state->sizing->overlay(sizing);
2809 if constexpr (std::derived_from<T, SizedWidget>) {
2810 if (state->sizing || (state->frame && state->frame->mounted != Node<Border>{})) {
2811 const auto target = state->frame && state->frame->mounted != Node<Border>{}
2812 ? Node<SizedWidget>(state->frame->mounted)
2813 : Node<SizedWidget>(*node);
2814 auto sized = detail::Access::finishSizing(scene, *node, target, state->sizing.get());
2817 return std::unexpected(sized.error());
2822 if (state->intrinsicStyle) {
2823 auto styled = detail::Access::finalizeStyleIdentity(scene, *node, *state->intrinsicStyle);
2826 return std::unexpected(styled.error());
2830 for (
auto &child : state->children) {
2831 auto mounted = child(scene, *node, context);
2834 return std::unexpected(mounted.error());
2838 if constexpr (std::same_as<T, Grid>) {
2839 if (state->layout && state->layout->grid) {
2840 if (state->layout->mounted.size() != state->layout->children.size()) {
2841 return std::unexpected(detail::error(*node, TreeError::INVALID_ARGUMENT));
2844 auto configured = detail::Access::gridOptions(scene, *node, detail::resolvedGridOptions(*state->layout));
2847 return std::unexpected(configured.error());
2852 if constexpr (std::same_as<T, Dialog>) {
2853 if (state->anchorRequested) {
2854 context.finalize.push_back([&scene, &context, node = *node, target = state->anchor,
2855 placement = state->placement]() -> std::expected<void, ManagedError> {
2856 const auto *resolved = target.get();
2858 return std::unexpected(detail::error(node, TreeError::CLOSED));
2860 for (
const auto &pending : context.pending) {
2861 if (pending.identity == target.get()) {
2862 resolved = &pending.target;
2866 if (resolved->owner != std::this_thread::get_id()) {
2867 return std::unexpected(detail::error(node, TreeError::WRONG_THREAD));
2869 if (resolved->failure) {
2870 return std::unexpected(*resolved->failure);
2872 if (resolved->lifetime.expired()) {
2873 return std::unexpected(detail::error(node, TreeError::CLOSED));
2875 return scene.dialogAnchor(node, resolved->node, placement);
2880 context.mountedOuter = outer;
2885 std::unique_ptr<State> state_;
2893 : region_(other.region_), sticky_(other.sticky_), valid_(other.valid_), style_(other.style_), rows_(other.rows_) {
2894 children_.swap(other.children_);
2895 other.valid_ =
false;
2900 if (
this == &other) {
2904 children_.swap(other.children_);
2905 region_ = other.region_;
2906 sticky_ = other.sticky_;
2907 valid_ = other.valid_;
2908 style_ = other.style_;
2909 rows_ = other.rows_;
2910 other.valid_ =
false;
2925 return std::move(*
this);
2934 return std::move(*
this);
2944 return std::move(*
this);
2958 std::optional<CellStyle> style_;
2959 std::optional<GridRowStyles> rows_;
2960 std::vector<Description<Widget>> children_ = std::vector<Description<Widget>>(0);
2964inline std::expected<void, ManagedError> prepareGridLayouts(
const std::shared_ptr<RecipeLayout> &root,
2965 MountContext &context, Node<Widget> parent) {
2966 if (!root || root->validated) {
2970 std::vector<std::shared_ptr<RecipeLayout>> pending(0);
2971 std::size_t addedLeaves{};
2972 const auto limit = context.controls.limits().maxMaterializedLeaves;
2974 pending.push_back(root);
2976 while (!pending.empty()) {
2977 auto layout = std::move(pending.back());
2981 for (
const auto &child : layout->children) {
2982 pending.push_back(child);
2985 if (!layout->gridContainer || !layout->grid) {
2989 if (!layout->control) {
2990 layout->control = std::make_unique<GridRecipeControl>();
2993 auto &control = *layout->control;
2995 if (control.prepared) {
2999 auto identityControls = context.controls;
3000 auto installed = ControlContextAccess::installFallbackSchema(identityControls);
3003 return std::unexpected(controlContextError(installed.error(), parent));
3006 auto identity = identityControls.resolve(control.variant ? std::string_view(*control.variant) :
"Grid");
3009 return std::unexpected(controlContextError(identity.error(), parent));
3012 if (identity->factoryKind != ControlFactoryKind::DECLARATIVE_GRID_FALLBACK) {
3013 return std::unexpected(controlContextError({ControlContextErrorCode::INVALID_VALUE, {}}, parent));
3016 if (control.materialized && !control.settingsRequested && !control.variant) {
3017 control.prepared =
true;
3023 control.materialized && !control.variant ? ControlContext(context.controls.limits()) : identityControls;
3024 installed = ControlContextAccess::installFallbackSchema(controls);
3027 return std::unexpected(controlContextError(installed.error(), parent));
3030 auto effective = controls.resolve(control.variant ? std::string_view(*control.variant) :
"Grid",
3031 Access::mergeControlSettings(control.arguments, control.patch));
3034 return std::unexpected(controlContextError(effective.error(), parent));
3037 const auto leaves = control.materialized
3038 ? (controlSettingsPresenceSet(effective->settings) & ~control.materializedSettings).count()
3039 : effective->materializedLeaves;
3041 if (context.controlLeaves > limit || addedLeaves > limit - context.controlLeaves ||
3042 leaves > limit - context.controlLeaves - addedLeaves) {
3043 return std::unexpected(controlContextError({ControlContextErrorCode::MATERIALIZED_LEAF_LIMIT, {}}, parent));
3046 addedLeaves += leaves;
3048 const auto &grid = effective->settings.grid;
3049 auto &options = *layout->grid;
3050 const auto apply = [](
auto &target,
const auto &source) {
3056 apply(options.columns, grid.columns);
3057 apply(options.rows, grid.rows);
3058 apply(options.flow, grid.flow);
3059 apply(options.columnGap, grid.columnGap);
3060 apply(options.rowGap, grid.rowGap);
3061 apply(options.padding.left, grid.paddingLeft);
3062 apply(options.padding.top, grid.paddingTop);
3063 apply(options.padding.right, grid.paddingRight);
3064 apply(options.padding.bottom, grid.paddingBottom);
3065 apply(options.maxTracksPerAxis, grid.maxTracksPerAxis);
3066 apply(options.maxPlacements, grid.maxPlacements);
3067 apply(options.maxPlacementWork, grid.maxPlacementWork);
3070 if (*grid.scroll && !layout->scroll) {
3071 layout->scroll.emplace();
3072 }
else if (!*grid.scroll) {
3073 layout->scroll.reset();
3077 control.resolved = std::make_unique<ResolvedControl>(std::move(*effective));
3078 control.prepared =
true;
3081 context.controlLeaves += addedLeaves;
3087 return description.state_ && description.state_->layout && description.state_->layout->hasDeclaredGrid;
3091template <
class T>
bool Access::needsChoiceHost(
const Description<T> &description) {
3092 const auto *layout = description.state_ ? description.state_->layout.get() :
nullptr;
3094 return layout && layout->needsChoiceHost && !layout->hasOverlayHost;
3098 description.layoutMetadata().
choiceProbe = std::move(probe);
3103std::expected<bool, ManagedError> Access::prepareChoiceHost(Description<T> &description, ControlContext controls) {
3104 auto root = description.state_ ? description.state_->layout :
nullptr;
3108 std::vector<std::shared_ptr<RecipeLayout>> pending(0);
3109 pending.push_back(root);
3110 bool needed = root->needsChoiceHost, hosted = root->hasOverlayHost;
3111 for (std::size_t index = 0; index < pending.size(); ++index) {
3112 const auto layout = pending[index];
3116 needed = needed || layout->needsChoiceHost;
3117 hosted = hosted || layout->hasOverlayHost;
3118 if (layout->choiceProbe) {
3119 auto result = layout->choiceProbe(controls);
3121 return std::unexpected(result.error());
3123 needed = needed || result->first;
3124 hosted = hosted || result->second;
3126 pending.insert(pending.end(), layout->children.begin(), layout->children.end());
3128 return needed && !hosted;
3131template <
class T> Description<T> Access::choiceHost(Description<T> description,
bool explicitHost) {
3132 auto &layout = description.layoutMetadata();
3133 layout.needsChoiceHost = !explicitHost;
3134 layout.hasOverlayHost = explicitHost;
3142 if (description.state_) {
3143 description.state_->deferredControlValidation =
true;
3150 return description.state_ && description.state_->deferredControlValidation;
3153template <
class Child>
3157 if (region && child.state_) {
3158 child.state_->layout->item.region = *region;
3161 auto layout = parent.state_->layout;
3163 parent.state_->children.push_back(
3165 MountContext &context)
mutable -> std::expected<void, ManagedError> {
3166 auto mounted =
Access::mount(std::move(child), scene, owner, context);
3169 return std::unexpected(mounted.error());
3182 auto &layout = parent.layoutMetadata();
3184 parent.declarativeOptions();
3185 layout.validSections = layout.validSections && section.valid_;
3188 ++layout.headerSections;
3189 layout.stickyHeader = section.sticky_;
3190 layout.headerStyle = section.style_;
3192 ++layout.bodySections;
3193 layout.bodyStyle = section.style_;
3194 layout.rowStyles = section.rows_;
3197 for (
auto &child : section.children_) {
3198 gridChild(parent, std::move(child), section.region_);
3203 std::shared_ptr<RecipeLayout> layout;
3204 const auto append = [&](
auto &child) {
3205 if (!child.state_ || child.state_->layout) {
3207 layout = std::make_shared<RecipeLayout>();
3211 layout->children.push_back(child.state_->layout);
3212 layout->hasDeclaredGrid = layout->hasDeclaredGrid || child.state_->layout->hasDeclaredGrid;
3213 layout->needsChoiceHost = layout->needsChoiceHost || child.state_->layout->needsChoiceHost;
3214 layout->hasOverlayHost = layout->hasOverlayHost || child.state_->layout->hasOverlayHost;
3216 auto empty = std::make_shared<RecipeLayout>();
3218 empty->validRecipe =
false;
3219 layout->children.push_back(std::move(empty));
3224 (append(children), ...);
3230 if (description.state_) {
3231 description.state_->layout = std::move(layout);
3237template <
class Parent,
class Child>
3239 if (!parent.state_) {
3243 if (!child.state_) {
3244 auto empty = std::make_shared<RecipeLayout>();
3246 empty->validRecipe =
false;
3247 parent.layoutMetadata().
children.push_back(std::move(empty));
3253 child.layoutMetadata();
3256 if (child.state_->layout) {
3257 parent.layoutMetadata().
children.push_back(child.state_->layout);
3258 parent.state_->layout->hasDeclaredGrid =
3259 parent.state_->layout->hasDeclaredGrid || child.state_->layout->hasDeclaredGrid;
3260 parent.state_->layout->needsChoiceHost =
3261 parent.state_->layout->needsChoiceHost || child.state_->layout->needsChoiceHost;
3262 parent.state_->layout->hasOverlayHost =
3263 parent.state_->layout->hasOverlayHost || child.state_->layout->hasOverlayHost;
3272 if constexpr (std::derived_from<T, SizedWidget>) {
3273 if (!description.state_ || (!sizing.width && !sizing.height)) {
3277 if (!description.state_->sizing) {
3278 description.state_->sizing = std::make_unique<RecipeSizing>();
3281 description.state_->sizing->overlay(sizing);
3287 if (description.state_) {
3288 description.state_->controlPrepared =
true;
3289 description.state_->materializedSettings = alreadyMaterialized;
3291 if constexpr (std::same_as<T, Grid>) {
3292 if (description.state_->layout && description.state_->layout->gridContainer && description.state_->layout->grid) {
3293 auto &control = description.gridControl();
3296 control.materializedSettings = alreadyMaterialized;
3305 materialized.
text = title;
3308 if (description.state_) {
3309 description.state_->inheritPreparedDefaults =
true;
3314 static_assert(std::same_as<T, Label> || std::same_as<T, Button>);
3317 settings.
text = caption;
3320 if (description.state_) {
3321 description.state_->inheritPreparedDefaults =
true;
3322 description.state_->settingsRequested =
true;
3327 if (description.state_) {
3328 description.state_->semanticConstruction = std::make_shared<SemanticConstruction>();
3329 description.state_->semanticConstruction->kind = ControlFactoryKind::THEME_CATALOG_BINDING;
3335 return description.state_ && description.state_->semanticConstruction &&
3336 description.state_->semanticConstruction->kind == ControlFactoryKind::THEME_CATALOG_BINDING;
3340 if (description.state_) {
3341 description.state_->semanticConstruction = std::make_shared<SemanticConstruction>();
3342 description.state_->semanticConstruction->kind = ControlFactoryKind::THEME_SELECTOR_BINDING;
3349 if (description.state_) {
3350 description.state_->semanticConstruction = std::make_shared<SemanticConstruction>();
3357 if (description.state_) {
3358 description.state_->semanticConstruction = std::make_shared<SemanticConstruction>();
3359 description.state_->semanticConstruction->kind = ControlFactoryKind::NOTIFICATION_BINDING;
3367 ControlPropertyPresence materialized, ControlFactoryKind kind) {
3368 if (!description.state_ || !description.state_->semanticConstruction ||
3369 (description.state_->semanticConstruction->kind != kind &&
3371 return std::unexpected(controlContextError({ControlContextErrorCode::INVALID_VALUE, {}}));
3374 auto &construction = *description.state_->semanticConstruction;
3376 construction.source = settings;
3377 construction.materialized = materialized;
3378 construction.prepared =
true;
3385 if (!description.state_ || !description.state_->semanticConstruction ||
3386 description.state_->semanticConstruction->kind != ControlFactoryKind::MESSAGE_BINDING) {
3390 description.state_->semanticConstruction->body = std::make_shared<Description<Widget>>(std::move(body));
3397 if (prechargedTitle) {
3400 settings.
title = *prechargedTitle;
3402 (void)std::move(description).settings(std::move(settings));
3410 if (description.state_ && !type.empty()) {
3411 description.state_->controlType.emplace(type);
3412 description.state_->inheritControlSettings = inherit;
3418 if (description.state_) {
3419 description.state_->controlArguments = std::move(arguments);
3427 description.state_ = std::make_unique<typename Description<T>::State>();
3428 description.state_->prerequisiteFailure = std::make_unique<ManagedError>(std::move(failure));
3434 if (!description.state_ || description.state_->prerequisiteFailure ||
3439 auto &state = *description.state_;
3443 merged.origin = state.controlPatch.origin;
3444 merged.origins = state.controlPatch.origins;
3446 for (
const auto &origin : patch.
origins) {
3449 if (found == merged.origins.end()) {
3450 merged.origins.push_back(origin);
3452 found->source = origin.source;
3456 state.controlPatch = std::move(merged);
3457 state.settingsRequested =
true;
3461 if (description.state_) {
3462 description.state_->controlSetup = std::move(callback);
3472 if (description.state_) {
3473 description.state_->intrinsicStyle.emplace(std::move(identity));
3480template <
class T,
class Factory>
Description<T> Access::cold(Factory factory) {
3482 description.state_ = std::make_unique<typename Description<T>::State>();
3483 description.state_->create = std::move(factory);
3492 description.state_ = std::make_unique<Description<Widget>::State>();
3493 description.state_->create = std::move(factory);
3499 if (description.state_) {
3500 description.state_->forwardsOuter =
true;
3507 static_assert(std::derived_from<T, Slider> || std::same_as<T, SpinBox>);
3509 if (!description.state_ || description.state_->prerequisiteFailure ||
3510 detail::controlSettingsPresenceSet(patch).count() == 0) {
3514 auto &state = *description.state_;
3517 merged.origin = state.controlPatch.origin;
3518 merged.origins = state.controlPatch.origins;
3520 for (
const auto &origin : patch.
origins) {
3523 if (found == merged.origins.end()) {
3524 merged.origins.push_back(origin);
3526 found->source = origin.source;
3530 state.controlPatch = std::move(merged);
3531 state.settingsRequested =
true;
3537 erased.state_ = std::make_unique<Description<Widget>::State>();
3538 erased.state_->forwardsOuter =
true;
3539 if (description.state_) {
3540 erased.state_->prerequisiteFailure = std::move(description.state_->prerequisiteFailure);
3541 erased.state_->layout = description.state_->layout;
3542 erased.state_->semanticConstruction = description.state_->semanticConstruction;
3544 erased.state_->create =
3547 auto result =
mount(std::move(description), scene, parent, context);
3550 return std::unexpected(result.error());
3562 return std::move(description).mountInto(scene, parent, context);
3573template <
class T>
auto own(T &&value) {
3574 if constexpr (std::convertible_to<T, std::string_view>) {
3575 return std::string(std::string_view(value));
3577 return std::decay_t<T>(std::forward<T>(value));
3586template <
class T>
decltype(
auto) constructionArgument(T &&value) {
3587 if constexpr (std::convertible_to<T, std::string_view>) {
3588 return std::string_view(value);
3590 return std::forward<T>(value);
Additive lifecycle owner over one existing Application subtree. UI affine and nonmovable....
Definition managed.hpp:530
Read-only weak scene-owned derived value; no writable alias or subscription escapes.
Definition managed.hpp:484
Weak UI handle to a scene-owned Property, never an owning alias. Copies and destruction of the handle...
Definition managed.hpp:367
Copyable typed observer; never owns or exposes an unchecked widget pointer.
Definition widget.hpp:92
Owning literal bytes or a resource key, measured only at resolution.
Definition text_value.hpp:42
Single-use owning construction recipe; no mounted widget ownership.
Definition ui_description.hpp:48
Description && framed(Ref< Border > outer, std::string_view pattern, Model< Value > title) &&
Description && rowGap(std::int32_t cells) &&
Definition ui_description.hpp:1763
Description && emptyText(std::string value) &&
Definition ui_description.hpp:1040
Description && interval(SchedulerTime value) &&
Definition ui_description.hpp:1125
Description && closeOnEscape(bool value=true) &&
Definition ui_description.hpp:906
Description && hex(DocumentHexOptions options={}) &&
Definition ui_description.hpp:100
Description && syntax(DocumentSyntaxPolicy value) &&
Definition ui_description.hpp:143
Description && mode(ChartMode value) &&
Definition ui_description.hpp:744
Description && placeholder(std::string_view value) &&
Definition ui_description.hpp:521
Description && verticalAlign(LayoutAlign align) &&
Definition ui_description.hpp:1224
Description && scrollStep(std::uint64_t rows) &&
Definition ui_description.hpp:184
Description && scroll(std::shared_ptr< ScrollController > controller={}) &&
Definition ui_description.hpp:1846
Description && immediate(bool enabled=true) &&
Definition ui_description.hpp:469
Description && glyphs(PrimitiveGlyphs value) &&
Definition ui_description.hpp:270
Description && scrollTrack(ScrollbarPattern pattern) &&
Definition ui_description.hpp:591
Description && glyphFallback(std::string_view value) &&
Definition ui_description.hpp:261
Description && framed(FrameOptions options={}) &&
Definition ui_description.hpp:1450
Description && style(StyleTarget target) &&
Definition ui_description.hpp:1288
Description && gridOptions(DeclarativeGridOptions options) &&
Definition ui_description.hpp:1777
Description && lineNumbers(bool enabled=true) &&
Definition ui_description.hpp:155
Description && glyphs(SliderGlyphs value) &&
Definition ui_description.hpp:377
Description && scrollbar(std::string_view pattern) &&
Definition ui_description.hpp:566
Description && id(std::string_view value) &&
Definition ui_description.hpp:1306
Description && selectionMode(RadioSelectionMode value) &&
Definition ui_description.hpp:460
Description && viewportMargin(std::int32_t value) &&
Definition ui_description.hpp:888
Description && placeholder(TextValue value) &&
Definition ui_description.hpp:514
Description && skin(SpinBoxSkin value) &&
Definition ui_description.hpp:365
Description && format(ControlKeyFormatSettings values) &&
Definition ui_description.hpp:1031
Description && maxFrameBytes(std::size_t value) &&
Definition ui_description.hpp:1197
Description && placement(ScrollPlacement placement) &&
Definition ui_description.hpp:548
Description && horizontal(ScrollBarPolicy policy) &&
Definition ui_description.hpp:530
Description && glyphFallback(GlyphFallback value) &&
Definition ui_description.hpp:254
Description && scrollTrack(std::string_view pattern) &&
Definition ui_description.hpp:584
Description && unavailableText(std::string value) &&
Definition ui_description.hpp:1049
Description && scrollArrows(std::string_view pattern) &&
Definition ui_description.hpp:616
Description && framed(std::string_view pattern, std::string_view title) &&
Definition ui_description.hpp:1532
Description && arrows(bool enabled=true) &&
Definition ui_description.hpp:424
Description()=default
Construct an empty recipe; mounting it returns INVALID_ARGUMENT.
Description && glyphProfile(GlyphProfile value) &&
Definition ui_description.hpp:236
Description && fitWidth() &&
Definition ui_description.hpp:1655
Description && overscanRows(std::size_t value) &&
Definition ui_description.hpp:708
Description && language(std::string_view name) &&
Definition ui_description.hpp:134
Description && range(double minimum, double maximum) &&
Definition ui_description.hpp:318
Description && wheelStep(double cells) &&
Definition ui_description.hpp:397
Description && flexY(std::uint32_t weight=1) &&
Definition ui_description.hpp:1962
Description && showStatus(bool value=true) &&
Definition ui_description.hpp:787
Description && minWidth(std::int32_t cells) &&
Definition ui_description.hpp:1671
Description && preset(SpinnerPreset value) &&
Definition ui_description.hpp:1088
Description && scrollbar(ScrollbarSkin skin) &&
Definition ui_description.hpp:633
Description && chrome(ButtonChrome value) &&
Definition ui_description.hpp:227
Description && prefix() &&
Definition ui_description.hpp:486
Description && anchorGap(std::int32_t value) &&
Definition ui_description.hpp:897
Description && enabled(bool value=true) &&
Definition ui_description.hpp:1437
Description && readOnly(bool value=true) &&
Definition ui_description.hpp:451
Description && preferredWidth(std::int32_t cells) &&
Definition ui_description.hpp:327
Description && noEcho(bool enabled=true) &&
Definition ui_description.hpp:495
Description && fastScroll(std::uint64_t step=8, key::Modifier keyboard=key::CTRL, key::Modifier wheel=key::ALT) &&
Definition ui_description.hpp:167
Description && yRange(std::optional< ChartRange > range) &&
Definition ui_description.hpp:771
Description && candleGap(std::int32_t cells) &&
Definition ui_description.hpp:762
Description && scrollbar(ScrollbarPattern pattern) &&
Definition ui_description.hpp:575
Description && columns(std::size_t count) &&
Definition ui_description.hpp:1707
Description && settings(ControlSettings patch) &&
Definition ui_description.hpp:69
Description && anchor(const Ref< U > &reference, DialogPlacement placement=DialogPlacement::BELOW_START) &&
Definition ui_description.hpp:1261
Description && vertical(ScrollBarPolicy policy) &&
Definition ui_description.hpp:539
Description && active(bool value) &&
Definition ui_description.hpp:1152
Description && maxFrames(std::size_t value) &&
Definition ui_description.hpp:1188
Description && frameEnabled(bool enabled=true) &&
Definition ui_description.hpp:652
Description && onDismiss(Callback callback) &&
Definition ui_description.hpp:1277
Description && scrollThumb(ScrollbarThumbPattern pattern) &&
Definition ui_description.hpp:607
Description && minHeight(std::int32_t cells) &&
Definition ui_description.hpp:1689
Description && framed(Ref< Border > outer, std::string_view pattern, std::string_view title) &&
Definition ui_description.hpp:1603
Description && focusable(bool value=true) &&
Definition ui_description.hpp:442
Description && labels(ControlDataStateLabelSettings values) &&
Definition ui_description.hpp:823
Description && themeCatalogSettings(ControlThemeCatalogSettings values) &&
Definition ui_description.hpp:984
Description && rowSpan(std::size_t count) &&
Definition ui_description.hpp:1927
Description && scrollArrows(ScrollbarArrowPattern pattern) &&
Definition ui_description.hpp:623
Description && classes(std::string_view value) &&
Definition ui_description.hpp:1320
Description && reference(NodeRef< T > reference) &&
Definition ui_description.hpp:1251
Description && axis(ScrollAxis axis) &&
Definition ui_description.hpp:679
Description && observe(ManagedSource< Value > source, Callback callback) &&
Definition ui_description.hpp:1374
Description && width(std::int32_t cells) &&
Definition ui_description.hpp:1639
Description && chartGlyphSet(ChartGlyphSet value) &&
Definition ui_description.hpp:753
Description && horizontalAlign(LayoutAlign align) &&
Definition ui_description.hpp:1215
Description && keyStep(std::uint64_t cells) &&
Definition ui_description.hpp:406
Description && focusScope() &&
Declare this subtree as a nested focus scope, with scene-owned lifetime.
Definition ui_description.hpp:1992
Description && padding(LayoutPadding insets) &&
Definition ui_description.hpp:1076
Description && titleDecoration(TitleDecoration decoration) &&
Definition ui_description.hpp:1468
Description && row(std::size_t index) &&
Definition ui_description.hpp:1903
Description && label(TextValue value) &&
Definition ui_description.hpp:1179
Description && autoRowHeight(bool enabled=true) &&
Definition ui_description.hpp:697
Description && direction(SpinnerDirection value) &&
Definition ui_description.hpp:1134
Description && glyphProfile(std::string_view value) &&
Definition ui_description.hpp:245
Description && themeSelectorSettings(ControlThemeSelectorSettings values) &&
Definition ui_description.hpp:996
Description && rowHeight(std::int32_t value) &&
Definition ui_description.hpp:688
Description && column(std::size_t index) &&
Definition ui_description.hpp:1915
Description && title(TextValue value) &&
Definition ui_description.hpp:841
Description && maximumPanelSize(CellSize caps) &&
Definition ui_description.hpp:926
Description && contentPolicy(DataContentPolicy value) &&
Definition ui_description.hpp:805
Description && flow(GridFlow value) &&
Definition ui_description.hpp:1735
Description && flex(std::uint32_t weight=1) &&
Definition ui_description.hpp:1971
Description && fitHeight() &&
Definition ui_description.hpp:1662
Description && scrollThumb(std::string_view pattern) &&
Definition ui_description.hpp:600
Description && dialogSettings(ControlDialogSettings values) &&
Definition ui_description.hpp:946
Description && minimum(double value) &&
Definition ui_description.hpp:299
Description && scrollOptions(ScrollAreaOptions options) &&
Definition ui_description.hpp:1870
Description && minimumThumb(std::int32_t cells) &&
Definition ui_description.hpp:433
Description && columnSpan(std::size_t count) &&
Definition ui_description.hpp:1939
Description && gridItem(GridItemOptions options) &&
Definition ui_description.hpp:1891
Description && frames(std::string_view value) &&
Definition ui_description.hpp:1116
Description && rows(std::size_t count) &&
Definition ui_description.hpp:1721
Description && setup(Setup< T > callback) &&
Definition ui_description.hpp:1981
Description && frames(std::initializer_list< std::string_view > values) &&
Definition ui_description.hpp:1107
Description && alignment(LayoutAlign value) &&
Definition ui_description.hpp:1143
Description && columnGap(std::int32_t cells) &&
Definition ui_description.hpp:1749
Description && onClick(Callback callback) &&
Definition ui_description.hpp:1332
Description && framed(std::string_view pattern) &&
Definition ui_description.hpp:1508
Description && flexX(std::uint32_t weight=1) &&
Definition ui_description.hpp:1952
Description && framed(Ref< Border > outer, std::string_view pattern, Title title) &&
Description && height(std::int32_t cells) &&
Definition ui_description.hpp:1648
Description && frame(BorderOptions options) &&
Definition ui_description.hpp:936
Description && spinnerInterval(SchedulerTime value) &&
Definition ui_description.hpp:814
Description && maxColumns(std::size_t value) &&
Definition ui_description.hpp:717
Description && framed(Ref< Border > outer, std::string_view pattern) &&
Definition ui_description.hpp:1586
Description && mode(DialogMode value) &&
Definition ui_description.hpp:859
Description && preset(Name &&value) &&
Definition ui_description.hpp:1100
Description && maxLayers(std::size_t value) &&
Definition ui_description.hpp:832
Description && columnSizes(const std::vector< AxisSize > &policies) &&
Definition ui_description.hpp:1817
Description && visible(bool value=true) &&
Definition ui_description.hpp:1426
Description && pageSteps(std::uint64_t count) &&
Definition ui_description.hpp:388
Description && step(double amount) &&
Definition ui_description.hpp:336
Description && mode(DocumentViewMode value) &&
Definition ui_description.hpp:87
Description && nonModal() &&
Keep the main form available while this dialog is open.
Definition ui_description.hpp:870
Description && variant(std::string_view type) &&
Definition ui_description.hpp:1234
Description && encoding(DocumentEncoding value) &&
Definition ui_description.hpp:207
Description && value(double value) &&
Definition ui_description.hpp:290
Description && closeButton(DialogCloseOptions options={}) &&
Definition ui_description.hpp:915
Description && onPrepare(Callback callback) &&
Definition ui_description.hpp:1406
Description && messageSettings(ControlMessageSettings values) &&
Definition ui_description.hpp:971
Description && maxWidth(std::int32_t cells) &&
Definition ui_description.hpp:1680
Description && frameMaxPaintCells(std::size_t cells) &&
Definition ui_description.hpp:670
Description && maxPreparedTextBytes(std::size_t value) &&
Definition ui_description.hpp:735
Description && skin(SliderSkin value) &&
Definition ui_description.hpp:354
Description && initiallyOpen(bool opened=true) &&
Definition ui_description.hpp:1022
Description && scrollOnFrame() &&
Definition ui_description.hpp:557
Description && onPrepare(ManagedPrepareHandler< T > callback) &&
Definition ui_description.hpp:1392
Description && label(std::string_view value) &&
Definition ui_description.hpp:1170
Description && entrySeparator(std::string value) &&
Definition ui_description.hpp:1058
Description && reducedMotion(bool value) &&
Definition ui_description.hpp:1161
Description && body(TextValue value) &&
Definition ui_description.hpp:955
Description && presentation(GridPresentation presentation) &&
Definition ui_description.hpp:1804
Description && observe(ManagedState< Value > model, Callback callback) &&
Definition ui_description.hpp:1357
Description && wrap(bool enabled=true) &&
Definition ui_description.hpp:198
Description && titleDecoration(std::string_view name) &&
Definition ui_description.hpp:1484
Description && focusDefault() &&
Prefer this node when entering its nearest scope without eligible history.
Definition ui_description.hpp:2004
Description && frameGlyphs(PrimitiveGlyphs glyphs) &&
Definition ui_description.hpp:661
Description && statusRows(std::int32_t value) &&
Definition ui_description.hpp:796
Description && framed(std::string_view pattern, Model< Value > title) &&
Description && placement(DialogPlacement value) &&
Definition ui_description.hpp:879
Description && titleDecoration(CustomTitleDecoration decoration) &&
Definition ui_description.hpp:1493
Description && maximum(double value) &&
Definition ui_description.hpp:308
Description && maxPaintCells(std::size_t cells) &&
Definition ui_description.hpp:280
Description && framed(Ref< Border > outer, FrameOptions options={}) &&
Definition ui_description.hpp:1570
Description && fuzzy(bool enabled=true) &&
Definition ui_description.hpp:478
Description && maxHeight(std::int32_t cells) &&
Definition ui_description.hpp:1698
Description && notificationSettings(ControlNotificationSettings values) &&
Definition ui_description.hpp:1009
Description && editMode(EditMode value) &&
Definition ui_description.hpp:506
Description && threeState() &&
Definition ui_description.hpp:218
Description && pageOverlap(std::uint64_t cells) &&
Definition ui_description.hpp:415
Description && onEvent(ManagedEventHandler< T > callback) &&
Definition ui_description.hpp:1383
Description && language(DocumentLanguage value) &&
Definition ui_description.hpp:120
Description && rowSizes(const std::vector< AxisSize > &policies) &&
Definition ui_description.hpp:1832
Description && skin(std::string_view name) &&
Definition ui_description.hpp:345
Description && maxFrameCells(std::size_t value) &&
Definition ui_description.hpp:1206
Description && overflowMarker(std::string value) &&
Definition ui_description.hpp:1067
Description && title(std::string_view value) &&
Definition ui_description.hpp:850
Description && framed(std::string_view pattern, Title title) &&
Description && body(std::string_view value) &&
Definition ui_description.hpp:962
Description && maxPreparedCells(std::size_t value) &&
Definition ui_description.hpp:726
Description(Description &&) noexcept=default
Transfer the unnamed recipe; its source becomes empty.
Single-use semantic Grid section; owns recipes and never mounts a placeholder Widget.
Definition ui_description.hpp:2889
GridSection && style(CellStyle value) &&
Definition ui_description.hpp:2931
GridSection(GridSection &&other)
Definition ui_description.hpp:2892
GridSection & operator=(GridSection &&other)
Definition ui_description.hpp:2899
GridSection && sticky(bool value=true) &&
Definition ui_description.hpp:2921
GridSection && rowStyles(GridRowStyles value) &&
Definition ui_description.hpp:2940
Owning cold model declaration; copies share one single-scene registration. Construction does not read...
Definition ui_model.hpp:129
Shared observing slot published only after a complete successful description mount.
Definition ui_ref.hpp:724
Typed Widget observation; explicit composite specializations reuse their existing weak facades.
Definition ui_ref.hpp:761
Scene & style(const StyleStage &stage, std::source_location origin=std::source_location::current()) &
A compact action optionally receives owning event parameters.
Definition managed.hpp:239
Exact checked TreeError result, including owning success values.
Definition managed.hpp:201
consteval auto type(StyleState state=StyleState::ANY, bool readOnly=false)
Definition style_static.hpp:876
auto reference(ui::Ref< T > value)
Definition ui_static.hpp:572
DocumentSyntaxPolicy
Recovery policy; the language still selects the lexical rules.
Definition document_highlight_types.hpp:31
ScrollBarPolicy
Presence policy, independent of whether the content can scroll.
Definition scroll_geometry.hpp:21
RadioSelectionMode
User selection publication policy; active navigation remains local to the group.
Definition radio_group.hpp:80
@ ON_ACTIVATION
Arrows move active; Space/Enter selects.
Definition radio_group.hpp:81
@ IMMEDIATE
Eligible keyboard movement also selects.
Definition radio_group.hpp:82
SpinBoxSkin
Immutable presentation of the two numeric step buttons.
Definition spin_box.hpp:9
@ NORMAL
Render the draft using its actual grapheme widths; copying and cutting retain normal behavior.
Definition line_edit.hpp:35
@ NO_ECHO
Render no value or selection, with a fixed-origin caret and intrinsic width one; suppress copy/cut.
Definition line_edit.hpp:37
@ PASSWORD
Render one ASCII '*' per grapheme, revealing its count; suppress outbound copy/cut.
Definition line_edit.hpp:36
ChartMode
Retained chart rendering mode.
Definition chart.hpp:49
GridFlow
Direction in which declarative placement searches for the next free origin.
Definition grid.hpp:53
PrimitiveGlyphs
One-cell decoration selection under the complete receiving WidthPolicy.
Definition primitives.hpp:20
ScrollbarThumbPattern
Independent thumb source; all choices are opt-in.
Definition scrollbar_skin.hpp:24
DocumentViewMode
Projection of the same original source bytes.
Definition document_view.hpp:37
@ HEX
Project raw fixed-width byte rows without decoding.
Definition document_view.hpp:39
std::function< std::expected< EventReply, TreeError >(T &, const RoutedEvent &)> ManagedEventHandler
Owning, copyable custom input adapter; arguments are borrowed for one invocation.
Definition managed.hpp:326
DataContentPolicy
Explicit content policy; automatic range wrappers always keep their request-owning body live.
Definition data_presentation.hpp:63
SliderSkin
Built-in one-cell slider glyph sets.
Definition slider.hpp:11
DocumentLanguage
Explicit lexical profiles; unknown names resolve to PLAIN.
Definition document_highlight_types.hpp:11
constexpr SizePolicy DEFAULT_EDITOR_POLICY
Single-line editors retain one cell even during shortage; text length is not a flex basis.
Definition layout.hpp:50
DialogMode
Input policy applied by the managed dialog owner.
Definition dialog.hpp:15
@ NON_MODAL
Let input outside the panel reach the scene.
Definition dialog.hpp:17
ScrollPlacement
Explicit relationship between bars, content and an optional frame.
Definition scroll_geometry.hpp:28
@ ON_FRAME
Bars occupy the right/bottom frame lines, excluding corners.
Definition scroll_geometry.hpp:31
TitleDecoration
Optional top-title break decoration; NONE preserves literal legacy titles.
Definition frame.hpp:39
ScrollbarPattern
Opt-in scrollbar glyph presets; legacy calls retain their original appearance.
Definition scrollbar_skin.hpp:15
SpinnerDirection
Traversal of the finite owning frame sequence.
Definition spinner.hpp:81
LayoutAlign
Alignment; center assigns floor(free/2) before the child/group.
Definition layout.hpp:172
ChartGlyphSet
Candle brushes; Unicode falls back to ASCII when the width policy requires wide symbols.
Definition chart.hpp:55
SpinnerPreset
Original single-row indeterminate animation sequences.
Definition spinner.hpp:16
GlyphProfile
Explicit glyph map, independent of colors and geometry. NF maps use Nerd Fonts 3 Powerline codepoints...
Definition glyph_profile.hpp:12
ScrollAxis
Logical scrolling axis; X increases right and Y increases down.
Definition scroll_geometry.hpp:15
DocumentLanguage documentLanguageFromName(std::string_view name) noexcept
std::uint64_t SchedulerTime
Monotonic milliseconds; the clock must not move backwards.
Definition scheduler.hpp:18
SpinnerPreset spinnerPreset(std::string_view name) noexcept
Definition spinner.hpp:39
GlyphFallback
Portable replacement when the selected map fails one-cell admission.
Definition glyph_profile.hpp:23
DialogPlacement
Preferred panel position within the owning host.
Definition dialog.hpp:21
@ BELOW_START
Prefer below the body anchor, aligned to its leading edge.
Definition dialog.hpp:23
ButtonChrome
Button caption decoration; action routing and identity remain unchanged.
Definition controls.hpp:155
ScrollbarArrowPattern
Independent functional-arrow source; selecting it never enables buttons.
Definition scrollbar_skin.hpp:32
std::function< std::expected< void, TreeError >(T &, Node< Widget >)> ManagedPrepareHandler
Owning, copyable custom presentation adapter at the dirty-frame boundary.
Definition managed.hpp:331
GridRegion
Independent local row coordinate space sharing the grid's columns.
Definition grid.hpp:22
@ BODY
Ordinary content rows, optionally below a header.
Definition grid.hpp:23
@ HEADER
Independent heading rows sharing the horizontal tracks.
Definition grid.hpp:24
@ INVALID_ARGUMENT
An option, enum value or operation argument is invalid.
Definition widget_types.hpp:27
DocumentEncoding
Resolved byte encoding, or an unresolved selection.
Definition document_encoding.hpp:14
EditMode
When an accepted editing candidate is validated and published to its model.
Definition line_edit.hpp:27
Owning frame decoration and finite paint-work policy.
Definition primitives.hpp:27
An owning available extent in terminal columns/rows.
Definition geometry.hpp:44
Small owning paint value, independent of themes and text metrics.
Definition cell_buffer.hpp:35
Owning paint values; no theme engine or behavior is encoded here.
Definition controls.hpp:24
Owning title ends; each holds at most 64 UTF-8 bytes and 16 printable one-cell graphemes.
Definition primitives.hpp:53
Owning automatic-placement settings; counts are distinct from GridOptions track policies.
Definition grid.hpp:76
Optional finite close chrome settings; the glyph occupies three terminal cells.
Definition dialog.hpp:40
Fixed raw-byte rows; auto-fit may choose a smaller row at preparation time.
Definition document_view.hpp:43
Owning advanced frame settings; legacy BorderOptions remains a literal value type.
Definition primitives.hpp:62
Owning parent-child relationship; omitted coordinates request automatic placement.
Definition grid.hpp:65
Backgrounds only; these values never inherit into child control state styles.
Definition grid.hpp:35
Optional owning row backgrounds; logical row zero is even.
Definition grid.hpp:28
Owning nonnegative padding in terminal cells.
Definition layout.hpp:185
Owning bounds and appearances for a one-line editor.
Definition line_edit.hpp:175
Exact editing or confirmation result delivered on the UI thread.
Definition line_edit.hpp:104
Original error plus independent runner/restoration and cleanup failures.
Definition managed_diagnostics.hpp:62
Owning independent policies for width and height.
Definition layout.hpp:35
Owning custom one-cell printable graphemes used for slider parts. Each value is at most 64 UTF-8 byte...
Definition slider.hpp:21
Owned subject metadata, supplied explicitly for built-in or custom widget types.
Definition style.hpp:40
Sparse explicit chart scale; disabling leaves inherited bounds inactive.
Definition ui_control_context.hpp:195
std::optional< double > maximum
Finite upper endpoint; active ranges must not be reversed.
Definition ui_control_context.hpp:198
std::optional< double > minimum
Finite lower endpoint; requires an effective explicit range.
Definition ui_control_context.hpp:197
Sparse owning status expressions; unused labels remain native construction concerns.
Definition ui_control_context.hpp:202
Sparse native dialog geometry/input options, merged per leaf.
Definition ui_control_context.hpp:342
Sparse native MessageBox options, preserving captured values and kind-specific checks.
Definition ui_control_context.hpp:252
Sparse immutable notification-center construction options; runtime posts stay code-owned.
Definition ui_control_context.hpp:318
std::string path
Canonical relative path, e.g. history.maxBytes.
Definition ui_control_context.hpp:70
Owning sparse literals only; never contains IDs, models, handlers or live history.
Definition ui_control_context.hpp:391
std::optional< TextValue > text
Caption/value expression, resolved by receiving scene.
Definition ui_control_context.hpp:394
std::optional< CheckCycle > cycle
CheckBox cycle; ThreeState is fixed THREE_STATE.
Definition ui_control_context.hpp:400
std::optional< bool > readOnly
User-mutation policy for supporting controls.
Definition ui_control_context.hpp:402
std::vector< ControlPropertyOrigin > origins
Per-property overrides.
Definition ui_control_context.hpp:408
std::optional< TextValue > title
Owning Dialog caption expression; unspecified keeps the actual caption.
Definition ui_control_context.hpp:452
std::shared_ptr< const ControlDocumentSettings > document
Cold immutable document settings.
Definition ui_control_context.hpp:505
std::optional< CheckState > state
CheckBox/ThreeState/Switch initial state; Switch is boolean only.
Definition ui_control_context.hpp:399
Constructor-only scalars for a real owning default catalog recipe.
Definition ui_control_context.hpp:299
Native ThemeSelector view settings, independent of model/catalog construction.
Definition ui_control_context.hpp:311
Owning optional editor customization and confirmation policy.
Definition ui_description.hpp:34
LineEditOptions options
Editor limits and appearances; scene width policy overrides options.widthPolicy.
Definition ui_description.hpp:36
std::function< std::expected< void, TreeError >(LineEditResult)> result
Optional callback after standard editing.
Definition ui_description.hpp:35
std::function< bool(std::string_view)> validate
Optional publication validator; false retains visible draft.
Definition ui_description.hpp:39
std::shared_ptr< Clipboard > clipboard
Optional UI-owned clipboard adapter retained by the binding.
Definition ui_description.hpp:38
SizePolicy policy
Owning layout constraints validated by the existing layout engine.
Definition ui_description.hpp:37
Internal bridge for checked access to managed scene and recipe state.
Definition ui_recipe_access.hpp:28
static void preparedControl(Description< T > &description, std::uint32_t alreadyMaterialized=0)
Mark resource-resolved settings without budgeting the same fields twice.
Definition ui_description.hpp:3267
static Description< Overlay > notificationControl(Description< Overlay > description)
Definition ui_description.hpp:3356
static Description< T > describe(Factory factory)
Wrap a checked managed factory without exposing recipe construction publicly.
Definition ui_description.hpp:3467
static Description< Widget > deferControlValidation(Description< Widget > description)
Definition ui_description.hpp:3141
static Description< T > withLayout(Description< T > description, std::shared_ptr< RecipeLayout > layout)
Definition ui_description.hpp:3229
static Description< Dialog > themeSelectorControl(Description< Dialog > description)
Definition ui_description.hpp:3339
static std::expected< Node< T >, ManagedError > mount(Description< T > &&description, ManagedScene &scene, Node< Widget > parent, MountContext &context)
Mount a root or child inside the same transaction.
Definition ui_description.hpp:3560
static ControlSettings mergeControlSettings(ControlSettings base, const ControlSettings &patch)
Definition ui_recipe_access.hpp:879
static Description< T > controlSetup(Description< T > description, Callback callback)
Attach binding setup after node creation within the mount transaction.
Definition ui_description.hpp:3460
static void gridSection(Description< Grid > &parent, GridSection section)
Definition ui_description.hpp:3181
static Description< Dialog > themeCatalogControl(Description< Dialog > description)
Definition ui_description.hpp:3326
static Description< T > controlArguments(Description< T > description, ControlSettings arguments)
Retain explicit constructor properties above inherited defaults.
Definition ui_description.hpp:3417
static Description< T > intrinsicStyle(Description< T > description, StyleTarget identity)
Definition ui_description.hpp:3471
static std::expected< void, ManagedError > messageBody(Description< T > &description, Description< Widget > body)
Attach an owning custom body to a resultful dialog recipe.
Definition ui_description.hpp:3384
static Description< Widget > forwardOuter(Description< Widget > description)
Definition ui_description.hpp:3498
static std::shared_ptr< RecipeLayout > captureLayouts(Children &...children)
Definition ui_description.hpp:3202
static Description< Dialog > internalDialog(Description< Dialog > description, const TextValue *prechargedTitle=nullptr)
Definition ui_description.hpp:3395
static void preparedDialogHeading(Description< Label > &description, const TextValue &title)
Definition ui_description.hpp:3302
static void preparedThemeSelectorCaption(Description< T > &description, const TextValue &caption)
Definition ui_description.hpp:3313
static void layoutChild(Description< Parent > &parent, Description< Child > &child, bool structural=false)
Definition ui_description.hpp:3238
static void preparedControlPresence(Description< T > &description, ControlPropertyPresence alreadyMaterialized)
Mark all resource-resolved fields without truncating the canonical vocabulary.
Definition ui_description.hpp:3286
static void numericSettings(Description< T > &description, ControlSettings patch)
Definition ui_description.hpp:3506
static Description< Dialog > messageControl(Description< Dialog > description)
Definition ui_description.hpp:3348
static Description< T > configuredControl(Description< T > description, std::string_view type, bool inherit=true)
Attach a builtin configuration identity to an owning recipe.
Definition ui_description.hpp:3409
static Description< Widget > erase(Description< T > description)
Erase only the observer type while preserving one mount transaction.
Definition ui_description.hpp:3534
static bool themeCatalogRecipient(const Description< T > &description) noexcept
Definition ui_description.hpp:3334
static Description< T > failed(ManagedError failure)
Definition ui_description.hpp:3424
static bool defersControlValidation(const Description< T > &description)
Definition ui_description.hpp:3149
static std::expected< void, ManagedError > messageSource(Description< T > &description, const ControlSettings &settings, ControlPropertyPresence materialized, ControlFactoryKind kind=ControlFactoryKind::MESSAGE_BINDING)
Definition ui_description.hpp:3366
static Description< Widget > transaction(Factory factory)
Definition ui_description.hpp:3489
static void switchSettings(Description< Switch > &description, ControlSettings patch)
Definition ui_description.hpp:3433
static void gridChild(Description< Grid > &parent, Child &&child, std::optional< GridRegion > region={})
Definition ui_description.hpp:3154
static bool needsGridContext(const Description< T > &description)
Definition ui_description.hpp:3086
static void sizingSettings(Description< T > &description, const RecipeSizing &sizing)
Stage sizing.
Definition ui_description.hpp:3271
bool materialized
Resource properties already supplied materialized grid settings.
Definition ui_recipe_context.hpp:349
Recognize exact native chart recipes without admitting arbitrary subclasses.
Definition ui_recipe_context.hpp:61
Recognize exact provider-bound list recipes, excluding arbitrary derived controls.
Definition ui_recipe_context.hpp:45
Recognize exact provider-bound table recipes, excluding arbitrary derived controls.
Definition ui_recipe_context.hpp:53
Stack-owned transaction bookkeeping, discarded after one description mount.
Definition ui_recipe_context.hpp:554
Node< Widget > mountedOuter
Last synchronous mount's actual layout root, including through type erasure.
Definition ui_recipe_context.hpp:566
std::function< std::expected< std::pair< bool, bool >, ManagedError >(ControlContext)> choiceProbe
Owning cold metadata probe; never mounts nodes or invokes application factories.
Definition ui_recipe_context.hpp:365
std::vector< std::shared_ptr< RecipeLayout > > children
Cold child metadata in insertion order.
Definition ui_recipe_context.hpp:368