PlatformRouter class
Public types
- struct Window
Public static variables
- static float MinUserScale constexpr
- static float MaxUserScale constexpr
Public functions
- void AddWindow(PlatformWindowID id, PlatformWindowID parent = 0)
- Register a window. The first one is the main window.
- auto RemoveWindow(PlatformWindowID id) -> PlatformWindowID
- void Clear()
- auto Find(PlatformWindowID id) -> Window*
- auto Find(PlatformWindowID id) const -> const Window*
- auto GetMainWindow() const -> PlatformWindowID
- auto HasChildren(PlatformWindowID id) const -> bool
- auto SetUserScale(float scale) -> bool
- Clamped to MinUserScale..MaxUserScale. True if the value changed.
- auto GetUserScale() const -> float
- void FillScale(const Window& window, PlatformEvent& event) const
- Scale, DisplayScale, and PixelDensity of
windowintoevent. - void Route(PlatformEvent&& event, std::vector<PlatformEvent>& out)
- Route one event: appends it to
out, unless it targets a window the router doesn't know. - void EndComposition(Window& window, std::vector<PlatformEvent>& out)
- An empty TextEditing if
windowhad a composition in progress. - void PushCloseRequested(PlatformWindowID id, std::vector<PlatformEvent>& out) const
- WindowCloseRequested for a window's popups (deepest first), then the window itself.
- auto GetKeyboardFocus() const -> PlatformWindowID
- The window that receives key and text events (0 = none). Any thread.
- auto GetPointerWindow() const -> PlatformWindowID
- The window under the pointer (0 = none). Any thread.
Function documentation
PlatformWindowID PlatformRouter:: RemoveWindow(PlatformWindowID id)
Forget a window (clears focus and pointer window if they were it). Returns its parent if that parent was waiting on its last popup to close and can be closed now, else 0.