MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Portal::Forma::Tend< T > Struct Template Reference

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.
 

Detailed Description

template<typename T>
struct MayaFlux::Portal::Forma::Tend< T >

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:

auto fader = Tend<float>{
.initial = 0.5F,
}.place(surface)
.bridge().write(vega.Constant(0.5) | Audio[0]);
Form< float > horizontal_fader(Kinesis::AABB2D bounds, float handle_w, glm::vec3 track_color, glm::vec3 handle_color, const std::function< glm::vec2()> &live_offset)
Geometry function for a horizontal fader in NDC space.
Creator vega
Global Creator instance.
Definition Creator.cpp:28
static constexpr DomainSpec Audio
Domain constant for Audio domain.
Definition Creator.hpp:435
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.
Definition Tend.hpp:288
Geometry::Form< T > form
Geometry, topology, capacity, and interaction. Consumed by place().
Definition Tend.hpp:222
std::optional< Surface > surface
Populated by place() with a copy of the Surface it was given, so ctx()/layer()/window() stay reachabl...
Definition Tend.hpp:236
The fourth member of the Collapsible/Scrollable/TextField family, for a bare Form<T> control.
Definition Tend.hpp:220
Template Parameters
TMappedState value type.

Definition at line 220 of file Tend.hpp.


The documentation for this struct was generated from the following file: