10#include <unordered_map>
185 std::unordered_map<WindowId, WindowRecord> windows_;
186 std::unordered_map<WindowId, MessageHandler> handlers_;
189 void* shared_gpu_device_ =
nullptr;
191 std::function<void(
WindowId)> on_window_closed_;
194 void collect_descendants(
WindowId id, std::vector<WindowId>& out)
const;
Definition window_host.hpp:113
void set_on_window_closed(std::function< void(WindowId)> cb)
Set a callback invoked when a window is about to be unregistered.
void restore_state(WindowId id, const WindowState &state)
Restore window state from a previous snapshot.
WindowManager(const WindowManager &)=delete
WindowManager & operator=(const WindowManager &)=delete
std::vector< WindowId > children_of(WindowId parent_id) const
Get children of a given window.
void set_message_handler(WindowId id, MessageHandler handler)
Register a message handler for a window. Replaces any previous handler.
void * shared_gpu_device() const
Get the shared GPU device handle. Returns nullptr if not set.
void unregister_window(WindowId id)
Remove a window from the registry.
void send_message(WindowId target, const WindowMessage &msg)
Send a message to a specific window.
WindowId register_window(WindowHost *host, View *root_view, WindowType type, WindowId parent_id=0)
Register a window with the manager.
void set_shared_theme(const Theme &theme)
Set the shared theme.
const Theme & shared_theme() const
Get the current shared theme.
std::vector< WindowId > window_ids() const
Get all active window IDs.
static bool is_multi_window_supported()
Whether the current platform supports multi-window.
size_t window_count() const
Count of active windows.
void close_window(WindowId id)
Close a window and all its children (depth-first).
const WindowRecord * window(WindowId id) const
Get the record for a window (nullptr if not found).
static std::vector< ScreenInfo > available_screens()
Enumerate available screens/monitors. Platform-specific.
void set_shared_gpu_device(void *device_handle)
Set the shared GPU device handle (Dawn wgpu::Device*).
void broadcast_message(const WindowMessage &msg)
Broadcast a message to all windows.
static ScreenInfo primary_screen()
Get info for the primary screen.
std::unordered_map< WindowId, WindowState > save_all_states() const
Snapshot the current state of all windows (positions, sizes, screens).
Bounded event contracts shared by host ingress and graph-authored nodes.
Definition anticipation_eligibility.hpp:9
SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the ...
Definition audio_device_manager.hpp:48
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
std::function< void(const WindowMessage &)> MessageHandler
Definition window_manager.hpp:68
WindowType
Definition window_manager.hpp:17
@ palette
Floating palette (stays on top, no taskbar entry).
Definition window_manager.hpp:19
@ inspector
Resizable inspector panel.
Definition window_manager.hpp:20
@ popup
Ephemeral popup/dropdown (auto-dismiss on focus loss).
Definition window_manager.hpp:21
@ dialog
Modal or modeless dialog.
Definition window_manager.hpp:22
@ main
Primary editor window.
Definition window_manager.hpp:18
@ type
Built-in / common type name (e.g. int, Number).
Definition code_editor_tokenizer.hpp:39
uint32_t WindowId
Definition window_manager.hpp:48
Definition window_manager.hpp:27
float scale_factor
HiDPI scale (e.g. 2.0 for Retina).
Definition window_manager.hpp:32
float y
Origin in global coordinates.
Definition window_manager.hpp:29
float width
Logical width.
Definition window_manager.hpp:30
float height
Logical height.
Definition window_manager.hpp:31
bool is_primary
Whether this is the main/primary screen.
Definition window_manager.hpp:33
std::string name
Human-readable name (e.g. "Built-in Retina Display").
Definition window_manager.hpp:34
float x
Definition window_manager.hpp:29
Definition window_manager.hpp:62
WindowId source
Sender window (0 = broadcast).
Definition window_manager.hpp:65
std::string type
Message type identifier.
Definition window_manager.hpp:63
std::string payload
JSON or string payload.
Definition window_manager.hpp:64
Definition window_manager.hpp:50
WindowId parent_id
0 = no parent (root window)
Definition window_manager.hpp:53
WindowType type
Definition window_manager.hpp:52
WindowState state
Definition window_manager.hpp:56
bool alive
Definition window_manager.hpp:57
View * root_view
Root view for this window.
Definition window_manager.hpp:55
WindowHost * host
Non-owning — caller owns the WindowHost.
Definition window_manager.hpp:54
Definition window_manager.hpp:39
float y
Definition window_manager.hpp:40
int screen_id
Which screen the window was on.
Definition window_manager.hpp:42
float x
Definition window_manager.hpp:40
bool is_visible
Definition window_manager.hpp:43
float width
Definition window_manager.hpp:41
float height
Definition window_manager.hpp:41