diff options
| author | Adam Malczewski <[email protected]> | 2026-06-13 17:31:27 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-13 17:31:27 +0900 |
| commit | c1dbe7494fb88ceb59bc26914e47ef38eba1cf9e (patch) | |
| tree | 0195cc431eb5b72603344bab3542b0e22e38b31e /packages/kernel/src/ui_substrate.hpp | |
| parent | 64c21337e7ccd3e158462771cd2e2886554256f0 (diff) | |
| download | unbox-c1dbe7494fb88ceb59bc26914e47ef38eba1cf9e.tar.gz unbox-c1dbe7494fb88ceb59bc26914e47ef38eba1cf9e.zip | |
Slice 10 b2: UiSurface list/container data bindings
The stage dock is one RML document rendering a variable list of slots (one per
minimized window). Adds the deferred slice-6 list-binding shape to UiSurface:
bind_list(name, count) + typed per-row fields bind_list_string/int/double/bool
(list, field, getter(row)) read as {{ row.field }} via data-for, and
bind_list_event(list, event, callback(row)) routed from data-event-*(it_index).
dirty(<list>) re-reads count + visible rows. Same error-isolation + bind-before-
first-frame contract as the scalar bindings; nested lists unsupported.
kernel suite green on build + build-asan (asan clean). Edits confined to packages/kernel/.
Diffstat (limited to 'packages/kernel/src/ui_substrate.hpp')
| -rw-r--r-- | packages/kernel/src/ui_substrate.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/kernel/src/ui_substrate.hpp b/packages/kernel/src/ui_substrate.hpp index cdba997..33dfd4e 100644 --- a/packages/kernel/src/ui_substrate.hpp +++ b/packages/kernel/src/ui_substrate.hpp @@ -97,6 +97,17 @@ public: void bind_bool(std::string_view name, std::function<bool()> getter) override; void bind_string(std::string_view name, std::function<std::string()> getter) override; void bind_event(std::string_view name, std::function<void()> callback) override; + void bind_list(std::string_view name, std::function<std::size_t()> count) override; + void bind_list_string(std::string_view list, std::string_view field, + std::function<std::string(std::size_t)> getter) override; + void bind_list_int(std::string_view list, std::string_view field, + std::function<int(std::size_t)> getter) override; + void bind_list_double(std::string_view list, std::string_view field, + std::function<double(std::size_t)> getter) override; + void bind_list_bool(std::string_view list, std::string_view field, + std::function<bool(std::size_t)> getter) override; + void bind_list_event(std::string_view list, std::string_view event, + std::function<void(std::size_t)> callback) override; void on_touch_mode_changed(std::function<void(bool)> callback) override; void dirty(std::string_view name) override; void dirty() override; @@ -178,6 +189,12 @@ public: // / out of bounds. A position-aware probe (like orientation()) so the suite // can assert a preview's known source color landed at the expected spot. [[nodiscard]] auto surface_pixel(int x, int y) const -> std::uint32_t; + // Count elements with `tag` in the first surface's loaded document (0 if no + // surface / not loaded yet). Proves a data-for list rendered N rows. + [[nodiscard]] auto element_count(const char* tag) const -> int; + // Click the index-th `tag` element in the first surface's document (fires + // its data-event-click). False if no such element. Drives a row event. + auto click_element(const char* tag, int index) -> bool; struct Impl; |
