MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ inspect_events()

MAYAFLUX_API void MayaFlux::Portal::Forma::inspect_events ( )

Open or show the EventManager inspection window.

First call creates a dedicated window, builds the InspectResult, and schedules tap_all() via Bridge. Subsequent calls show() the existing window.

Definition at line 261 of file Forma.cpp.

262{
263 auto& atelier = internal::atelier();
264
265 if (g_inspect_events_surface && g_inspect_events_surface->window()
266 && !g_inspect_events_surface->window()->should_close()) {
267 g_inspect_events_surface->window()->show();
268 return;
269 }
270
271 if (g_inspect_events_surface) {
272 LayoutCursor cursor;
273 atelier.inspector().destroy(
274 atelier.inspector().event_manager(*g_inspect_events_surface, cursor));
275 discard_inspect_surface(g_inspect_events_surface);
276 }
277
278 auto window = atelier.create_window(
279 Core::WindowCreateInfo { .title = "EventManager", .width = k_inspect_w, .height = k_inspect_h });
280
281 auto [layer, ctx] = atelier.create_layer(window, "EventManager");
282 g_inspect_events_surface.emplace(SurfaceConfig {
283 .window = std::move(window),
284 .layer = std::move(layer),
285 .ctx = std::move(ctx),
286 });
287 LayoutCursor cursor;
288 auto& result = atelier.inspector().event_manager(*g_inspect_events_surface, cursor);
289 atelier.bridge().spawn_sync(g_inspect_events_surface->layer(),
290 result.group.header.header_id, [&result] { result.tap_all(); });
291}
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
void spawn_sync(Layer &layer, uint32_t id, std::function< void()> sync_fn)
Spawn a presentation sync task scoped to a Layer.
Definition Bridge.cpp:450
InspectResult & event_manager(Surface &surface, LayoutCursor &cursor, float x_min=-0.95F, float x_max=0.95F, float row_h=0.05F)
Inspect the full EventManager state.
void destroy(InspectResult &result)
Destroy an InspectResult and release its resources.
Definition Inspector.cpp:42
std::shared_ptr< Core::Window > create_window(const Core::WindowCreateInfo &info)
Create a window through the stored WindowManager and show it.
Definition Atelier.cpp:104
Inspector & inspector()
Inspector instance constructed during initialize.
Definition Atelier.cpp:90
Bridge & bridge()
Bridge instance constructed during initialize.
Definition Atelier.cpp:80
std::pair< std::shared_ptr< Layer >, std::shared_ptr< Context > > create_layer(const std::shared_ptr< Core::Window > &window, std::string name)
Construct a Layer and a Context wired to window.
Definition Atelier.cpp:150
Atelier & atelier()
Accessor for the process-wide Atelier.
Definition Atelier.hpp:304
std::string title
Window title/identifier.
Configuration for creating a single window instance.

References MayaFlux::Portal::Forma::internal::atelier(), MayaFlux::Portal::Forma::internal::Atelier::bridge(), MayaFlux::Portal::Forma::internal::Atelier::create_layer(), MayaFlux::Portal::Forma::internal::Atelier::create_window(), MayaFlux::Portal::Forma::Inspector::destroy(), MayaFlux::Portal::Forma::Inspector::event_manager(), MayaFlux::Portal::Forma::internal::Atelier::inspector(), MayaFlux::Portal::Forma::Bridge::spawn_sync(), MayaFlux::Core::WindowCreateInfo::title, window, and MayaFlux::Portal::Forma::SurfaceConfig::window.

+ Here is the call graph for this function: