|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API void MayaFlux::Portal::Forma::destroy | ( | Surface & | surface, |
| uint32_t | id | ||
| ) |
Tear down an element and everything related to it.
The symmetric counterpart to create_element/create<T>/create_text_field: walks surface.layer().closure(id) (id plus every id transitively related via Layer::relate, e.g. a Collapsible's attached body, a Scrollable's tracked rows, or a TextField's Scrollable viewport), calls Context::unbind and Bridge::unbind on each id in that closure, then Layer::remove(id) - which itself cascades the Layer-side removal (buffer mark_for_removal, m_elements erase, m_relations cleanup) across the same closure.
This is the one call callers should use to tear down a composed Forma element. Layer::remove(id) alone is still available for callers that only need the Layer-side cascade with no Context/Bridge involvement.
| surface | Surface owning the Layer, Context, and (via the module Bridge) the bindings id may participate in. |
| id | Element id to remove, as returned by layer().add()/Slot::id(). |
Definition at line 90 of file Forma.cpp.
References bridge(), MayaFlux::Portal::Forma::Layer::closure(), MayaFlux::Portal::Forma::Surface::ctx(), MayaFlux::Portal::Forma::Surface::layer(), MayaFlux::Portal::Forma::Surface::layer_ptr(), MayaFlux::Portal::Forma::Layer::remove(), MayaFlux::Portal::Forma::Bridge::unbind(), and MayaFlux::Portal::Forma::Context::unbind().
Here is the call graph for this function: