#include <window_manager.hpp>
Public Member Functions | |
| WindowManager () | |
| ~WindowManager () | |
| WindowManager (const WindowManager &)=delete | |
| WindowManager & | operator= (const WindowManager &)=delete |
| WindowId | register_window (WindowHost *host, View *root_view, WindowType type, WindowId parent_id=0) |
| Register a window with the manager. | |
| void | unregister_window (WindowId id) |
| Remove a window from the registry. | |
| const WindowRecord * | window (WindowId id) const |
| Get the record for a window (nullptr if not found). | |
| std::vector< WindowId > | window_ids () const |
| Get all active window IDs. | |
| std::vector< WindowId > | children_of (WindowId parent_id) const |
| Get children of a given window. | |
| size_t | window_count () const |
| Count of active windows. | |
| void | close_window (WindowId id) |
| Close a window and all its children (depth-first). | |
| void | set_on_window_closed (std::function< void(WindowId)> cb) |
| Set a callback invoked when a window is about to be unregistered. | |
| void | set_shared_theme (const Theme &theme) |
| Set the shared theme. | |
| const Theme & | shared_theme () const |
| Get the current shared theme. | |
| void | send_message (WindowId target, const WindowMessage &msg) |
| Send a message to a specific window. | |
| void | broadcast_message (const WindowMessage &msg) |
| Broadcast a message to all windows. | |
| void | set_message_handler (WindowId id, MessageHandler handler) |
| Register a message handler for a window. Replaces any previous handler. | |
| std::unordered_map< WindowId, WindowState > | save_all_states () const |
| Snapshot the current state of all windows (positions, sizes, screens). | |
| void | restore_state (WindowId id, const WindowState &state) |
| Restore window state from a previous snapshot. | |
| void | set_shared_gpu_device (void *device_handle) |
| Set the shared GPU device handle (Dawn wgpu::Device*). | |
| void * | shared_gpu_device () const |
| Get the shared GPU device handle. Returns nullptr if not set. | |
Static Public Member Functions | |
| static std::vector< ScreenInfo > | available_screens () |
| Enumerate available screens/monitors. Platform-specific. | |
| static ScreenInfo | primary_screen () |
| Get info for the primary screen. | |
| static bool | is_multi_window_supported () |
| Whether the current platform supports multi-window. | |
| pulp::view::WindowManager::WindowManager | ( | ) |
| pulp::view::WindowManager::~WindowManager | ( | ) |
|
delete |
|
static |
Enumerate available screens/monitors. Platform-specific.
| void pulp::view::WindowManager::broadcast_message | ( | const WindowMessage & | msg | ) |
Broadcast a message to all windows.
Get children of a given window.
| void pulp::view::WindowManager::close_window | ( | WindowId | id | ) |
Close a window and all its children (depth-first).
Calls request_close() on each WindowHost, then unregisters.
|
static |
Whether the current platform supports multi-window.
Returns false on iOS, embedded, or platforms that restrict window creation (some plugin hosts).
|
delete |
|
static |
Get info for the primary screen.
| WindowId pulp::view::WindowManager::register_window | ( | WindowHost * | host, |
| View * | root_view, | ||
| WindowType | type, | ||
| WindowId | parent_id = 0 ) |
Register a window with the manager.
Returns a unique WindowId. The caller retains ownership of host and root_view.
| void pulp::view::WindowManager::restore_state | ( | WindowId | id, |
| const WindowState & | state ) |
Restore window state from a previous snapshot.
Only applies to windows whose IDs match.
| std::unordered_map< WindowId, WindowState > pulp::view::WindowManager::save_all_states | ( | ) | const |
Snapshot the current state of all windows (positions, sizes, screens).
| void pulp::view::WindowManager::send_message | ( | WindowId | target, |
| const WindowMessage & | msg ) |
Send a message to a specific window.
| void pulp::view::WindowManager::set_message_handler | ( | WindowId | id, |
| MessageHandler | handler ) |
Register a message handler for a window. Replaces any previous handler.
| void pulp::view::WindowManager::set_on_window_closed | ( | std::function< void(WindowId)> | cb | ) |
Set a callback invoked when a window is about to be unregistered.
Useful for cleanup (e.g. saving window state before removal).
| void pulp::view::WindowManager::set_shared_gpu_device | ( | void * | device_handle | ) |
Set the shared GPU device handle (Dawn wgpu::Device*).
All windows MUST share the same device. Each window gets its own surface/swapchain on this device. Three.js/WebGPU bridge surfaces also use this shared device.
| void pulp::view::WindowManager::set_shared_theme | ( | const Theme & | theme | ) |
Set the shared theme.
Propagates to all registered windows' root views via set_theme().
| void * pulp::view::WindowManager::shared_gpu_device | ( | ) | const |
Get the shared GPU device handle. Returns nullptr if not set.
| const Theme & pulp::view::WindowManager::shared_theme | ( | ) | const |
Get the current shared theme.
| void pulp::view::WindowManager::unregister_window | ( | WindowId | id | ) |
Remove a window from the registry.
Does NOT destroy the WindowHost — that's the caller's responsibility.
| const WindowRecord * pulp::view::WindowManager::window | ( | WindowId | id | ) | const |
Get the record for a window (nullptr if not found).
| size_t pulp::view::WindowManager::window_count | ( | ) | const |
Count of active windows.
| std::vector< WindowId > pulp::view::WindowManager::window_ids | ( | ) | const |
Get all active window IDs.