|
ZenitUI
Retained-mode C++20 UI framework
|
Abstract windowing, timing, input, and clipboard backend. More...
#include <UIContext.hpp>
Public Member Functions | |
| virtual Vec2 | viewportSize ()=0 |
| Return the current window/surface dimensions in logical pixels. | |
| virtual PointerState | pointer ()=0 |
| Return the current pointer position (logical pixels), scroll wheel delta, and button states. | |
| virtual double | time ()=0 |
| Return a monotonic clock timestamp in seconds. | |
| virtual ModifierState | modifiers ()=0 |
| Return the current state of modifier keys (shift, ctrl, alt, super). | |
| virtual InputEvents | pollInputEvents ()=0 |
| Drain and return keyboard events queued since the previous frame. | |
| virtual float | dpiScale ()=0 |
| Return the physical-to-logical DPI scale factor (e.g. | |
| virtual EdgeInsets | safeArea ()=0 |
| Return screen safe-area insets in logical pixels (notches, rounded corners, system bars). | |
| virtual void | setClipboardText (const std::string &text)=0 |
| Copy UTF-8 text to the operating system clipboard. | |
| virtual std::string | getClipboardText ()=0 |
| Read UTF-8 text from the operating system clipboard (empty string if unavailable). | |
| virtual void | setCursor (CursorShape) |
| Request the OS/windowing system to display the given cursor shape. | |
| virtual void | setTextInputRect (Rect, float=0.0f) |
| Inform the OS IME of the active text-input rect and caret offset (in logical window coordinates) so candidate windows appear at the caret. | |
Abstract windowing, timing, input, and clipboard backend.
Polled once per frame by UIContext::beginFrame(). See Writing a Custom Backend for invariants and Backends, TextEngine, UTF-8 & Debugging for reference implementations (RaylibPlatform, MockPlatform).
|
pure virtual |
Return the physical-to-logical DPI scale factor (e.g.
1.0f on standard displays, 2.0f on Retina).
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Read UTF-8 text from the operating system clipboard (empty string if unavailable).
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Return the current state of modifier keys (shift, ctrl, alt, super).
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Return the current pointer position (logical pixels), scroll wheel delta, and button states.
Edge-triggered fields (ButtonState::pressed, ButtonState::released, PointerState::wheelY) must fire for one frame only; ButtonState::down stays true while held.
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Drain and return keyboard events queued since the previous frame.
InputEvents::chars and InputEvents::keys are edge-triggered (one frame); InputEvents::held lists keys currently held down for repeat handling.
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Return screen safe-area insets in logical pixels (notches, rounded corners, system bars).
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Copy UTF-8 text to the operating system clipboard.
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
inlinevirtual |
Request the OS/windowing system to display the given cursor shape.
Reimplemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
inlinevirtual |
Inform the OS IME of the active text-input rect and caret offset (in logical window coordinates) so candidate windows appear at the caret.
Pass an empty rect (width <= 0 || height <= 0) when no text widget is focused.
Reimplemented in ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Return a monotonic clock timestamp in seconds.
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.
|
pure virtual |
Return the current window/surface dimensions in logical pixels.
Implemented in ZenitUI::RaylibPlatform, ZenitUI::SDL3Platform, and ZenitUI::Test::MockPlatform.