|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Named owner of a (Window, Layer, Context) triple - the Forma canvas. More...
#include <Surface.hpp>
Collaboration diagram for MayaFlux::Portal::Forma::Surface:Public Member Functions | |
| Layer::Slot | add (Element element) |
| Forward an Element to layer().add() and return the Slot. | |
| const Context & | ctx () const noexcept |
| Access the event router. | |
| Context & | ctx () noexcept |
| Access the event router. | |
| const std::shared_ptr< Context > & | ctx_ptr () const noexcept |
| Shared handles for callers that need to keep components alive independently of the Surface (background tasks, escapes into coroutines, etc.). | |
| const Layer & | layer () const noexcept |
| Access the spatial registry. | |
| Layer & | layer () noexcept |
| Access the spatial registry. | |
| const std::shared_ptr< Layer > & | layer_ptr () const noexcept |
| Shared handles for callers that need to keep components alive independently of the Surface (background tasks, escapes into coroutines, etc.). | |
| Surface & | operator= (const Surface &)=default |
| Surface & | operator= (Surface &&) noexcept=default |
| Surface (const Surface &)=default | |
| Surface (std::shared_ptr< Core::Window > window, std::shared_ptr< Layer > layer, std::shared_ptr< Context > ctx) | |
| Construct a Surface around a pre-built Layer and Context. | |
| Surface (Surface &&) noexcept=default | |
| const std::shared_ptr< Core::Window > & | window () const noexcept |
| Access the rendering target window. | |
| ~Surface ()=default | |
Private Attributes | |
| std::shared_ptr< Context > | m_ctx |
| std::shared_ptr< Layer > | m_layer |
| std::shared_ptr< Core::Window > | m_window |
Named owner of a (Window, Layer, Context) triple - the Forma canvas.
In Forma, three things always travel together: a Window (the rendering target and coordinate space), a Layer (the spatial registry of elements), and a Context (the event router that hit-tests against the layer). They are the three faces of one concept: the canvas. Surface names that concept and owns the triple, so that downstream construction functions accept one argument instead of three.
Surface is not a widget toolkit, not a layout engine, not an event dispatcher. It does not know what an element looks like, how a buffer is built, or where bindings are routed. Construction of FormaBuffers, Mapped<T>s, and Bridge registrations is the job of the free functions in Forma.hpp, which take a Surface& as their canvas argument and read the BufferManager, Bridge, and other module-level state from the singletons established by Portal::Forma::initialize().
The Layer and Context owned by Surface remain fully accessible through the layer() and ctx() accessors. Surface is a named owner, not a wall. Anything that worked against Layer or Context before continues to work against surface.layer() and surface.ctx().
Surface has two constructors:
Definition at line 58 of file Surface.hpp.