Skip to content

ludus::platform::WindowBase

Ludus Wiki · API overview · Browse API

Class

Declared in modules/platform/include/ludus/platform/base/window.h

#include <ludus/platform/base/window.h>
class ludus::platform::WindowBase

Methods

~WindowBase

virtual ludus::platform::WindowBase::~WindowBase()=default

Declared in modules/platform/include/ludus/platform/base/window.h

HandleEvent

virtual bool ludus::platform::WindowBase::HandleEvent(const Event &event) noexcept=0
Pumps native events; false means the window closed or the call cannot proceed. Cocoa pumps the shared application queue and may deliver input to other windows. Create, pump, query and destroy Cocoa windows on the main thread; sinks must not destroy them during dispatch.

Related types: Event

Declared in modules/platform/include/ludus/platform/base/window.h

GetBrowserState

virtual bool ludus::platform::WindowBase::GetBrowserState(browser::WindowState &) const noexcept
Browser snapshots/events are copied into caller-owned storage.
Native backends return false. Call HandleEvent once per animation frame to refresh CSS size/DPR/DOM attachment; callbacks also update state between frames.

Related types: browser::WindowState

Declared in modules/platform/include/ludus/platform/base/window.h

PollBrowserInput

virtual bool ludus::platform::WindowBase::PollBrowserInput(browser::InputEvent &) noexcept

Related types: browser::InputEvent

Declared in modules/platform/include/ludus/platform/base/window.h

SetBrowserFramebufferLimit

virtual bool ludus::platform::WindowBase::SetBrowserFramebufferLimit(ludus::foundation::uint32) noexcept
Supply the actual device texture-dimension limit after GPU startup.

Related types: ludus::foundation::uint32

Declared in modules/platform/include/ludus/platform/base/window.h

GetNativeWindowInfo

LUDUS_INLINE NativeWindowInfo ludus::platform::WindowBase::GetNativeWindowInfo() const noexcept
Returns borrowed backend handles and current dimensions; Cocoa dimensions are backing pixels. Cocoa snapshots must be queried on the main thread and refreshed after pumping events.

Related types: NativeWindowInfo

Declared in modules/platform/include/ludus/platform/base/window.h

GetVisibility

LUDUS_INLINE WindowVisibility ludus::platform::WindowBase::GetVisibility() const noexcept
Return the visibility observed by the latest HandleEvent().
Cocoa reports Minimized for a miniaturized window and Occluded while AppKit's occlusion state says no part is visible; it is refreshed by HandleEvent() and window-delegate notifications, on the main thread. Browser windows report Occluded while the canvas is hidden, detached or zero-sized, matching browser::WindowState::Visible. Wayland windows report Occluded while the compositor's latest xdg_toplevel configure carries the suspended state (xdg_wm_base version 6: minimized, fully covered or on a switched-off output) and after close; the protocol does not distinguish minimization, and a compositor bound below version 6 never suspends. Headless windows always report Visible because that backend does not observe occlusion.

Note

Occlusion is a power hint, not a guarantee: partial or translucent cover still reports Visible, and AppKit delivers changes asynchronously, so a newly opened window may report Occluded until the window server has placed it.

Related types: WindowVisibility

Declared in modules/platform/include/ludus/platform/base/window.h

AttachKeyboardSink

LUDUS_INLINE void ludus::platform::WindowBase::AttachKeyboardSink(const KeyboardSink &sink) noexcept
Attach a normalized keyboard sink to THIS window (K10).
The sink and its user data are borrowed: detach (or destroy the window) before the sink's user data goes away. Backends that deliver keyboard transitions (Wayland) route native events to the sink of the attached gameplay window; backends without keyboard delivery (headless) simply retain it. Attaching replaces any previous sink. This does not synthesize events by itself.

Related types: KeyboardSink

Declared in modules/platform/include/ludus/platform/base/window.h

DetachKeyboardSink

LUDUS_INLINE void ludus::platform::WindowBase::DetachKeyboardSink() noexcept

Declared in modules/platform/include/ludus/platform/base/window.h

GetKeyboardSink

LUDUS_INLINE const KeyboardSink & ludus::platform::WindowBase::GetKeyboardSink() const noexcept

Related types: KeyboardSink

Declared in modules/platform/include/ludus/platform/base/window.h