|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
The fourth member of the Collapsible/Scrollable/TextField family, for a bare Form<T> control. More...
#include <Tend.hpp>
Collaboration diagram for MayaFlux::Portal::Forma::Tend< T >:Public Member Functions | |
| Bridge::Binding | bridge () |
| Bridge::Binding handle for result's element. | |
| Tend & | place (Surface &target) |
Realize form on target. | |
| Tend & | track (Scrollable &panel, Layer &layer, Kinesis::AABB2D base_bounds, std::function< void(Kinesis::AABB2D)> reposition={}) |
Register result's element for scroll reflow in panel. | |
Public Attributes | |
| std::shared_ptr< Buffers::FormaBuffer > | batch |
| Optional shared buffer from create_buffer(). | |
| Geometry::Form< T > | form |
| Geometry, topology, capacity, and interaction. Consumed by place(). | |
| T | initial {} |
| Starting value written into MappedState. Consumed by place(). | |
| std::optional< Mapped< T > > | result |
| Populated by place(). The real, fully wired element. | |
| std::optional< Surface > | surface |
| Populated by place() with a copy of the Surface it was given, so ctx()/layer()/window() stay reachable afterward. | |
The fourth member of the Collapsible/Scrollable/TextField family, for a bare Form<T> control.
Configure with form/initial, then place(Surface&) - same as all three siblings, Tend never builds a Surface itself, it only ever wraps one the caller already has. place() can only call Portal::Forma::create(), never create_element(), so the wire-dropping mistake create_element<T>'s bare-GeometryFn overload allows is structurally unreachable through Tend.
place() retains a copy of the Surface it was given in the surface member (cheap - Surface's own three fields are shared_ptrs, so the copy shares the same Layer/Context/window as the original), so ctx()/layer()/window() stay reachable afterward without holding a separate reference of your own.
Accepting a SurfaceConfig or a window description directly, so a caller with nothing yet does not need to call create_surface() themselves first, is deliberately not this struct's job - that escalation belongs to a higher-level composer (a future Creator-level tend_forma), which can resolve either shape into a Surface via Atelier::create_surface's own two overloads and hand the result to place() same as any other caller would.
place() alone stops at construction. bridge() and track() are what keep going without falling out of the chain into a separate statement:
| T | MappedState value type. |