|
ZenitUI
Retained-mode C++20 UI framework
|
Reference IPlatform backed by SDL3 window, input, IME, and clipboard APIs. More...
#include <SDL3Platform.hpp>
Public Member Functions | |
| SDL3Platform (SDL_Window *window) | |
| SDL3Platform (const SDL3Platform &)=delete | |
| SDL3Platform & | operator= (const SDL3Platform &)=delete |
| Vec2 | viewportSize () override |
| Return the current window/surface dimensions in logical pixels. | |
| PointerState | pointer () override |
| Return the current pointer position (logical pixels), scroll wheel delta, and button states. | |
| double | time () override |
| Return a monotonic clock timestamp in seconds. | |
| ModifierState | modifiers () override |
| Return the current state of modifier keys (shift, ctrl, alt, super). | |
| InputEvents | pollInputEvents () override |
| Drain and return keyboard events queued since the previous frame. | |
| float | dpiScale () override |
| Return the physical-to-logical DPI scale factor (e.g. | |
| EdgeInsets | safeArea () override |
| Return screen safe-area insets in logical pixels (notches, rounded corners, system bars). | |
| void | setClipboardText (const std::string &text) override |
| Copy UTF-8 text to the operating system clipboard. | |
| std::string | getClipboardText () override |
| Read UTF-8 text from the operating system clipboard (empty string if unavailable). | |
| void | setCursor (CursorShape cursor) override |
| Request the OS/windowing system to display the given cursor shape. | |
| void | setTextInputRect (Rect inputRect, float cursorXOffset=0.0f) override |
| Inform the OS IME of the active text-input rect and caret offset (in logical window coordinates) so candidate windows appear at the caret. | |
Reference IPlatform backed by SDL3 window, input, IME, and clipboard APIs.
|
overridevirtual |
Return the physical-to-logical DPI scale factor (e.g.
1.0f on standard displays, 2.0f on Retina).
Implements ZenitUI::IPlatform.
|
overridevirtual |
Read UTF-8 text from the operating system clipboard (empty string if unavailable).
Implements ZenitUI::IPlatform.
|
overridevirtual |
Return the current state of modifier keys (shift, ctrl, alt, super).
Implements ZenitUI::IPlatform.
|
overridevirtual |
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.
Implements ZenitUI::IPlatform.
|
overridevirtual |
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.
Implements ZenitUI::IPlatform.
|
overridevirtual |
Return screen safe-area insets in logical pixels (notches, rounded corners, system bars).
Implements ZenitUI::IPlatform.
|
overridevirtual |
Copy UTF-8 text to the operating system clipboard.
Implements ZenitUI::IPlatform.
|
overridevirtual |
Request the OS/windowing system to display the given cursor shape.
Reimplemented from ZenitUI::IPlatform.
|
overridevirtual |
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 from ZenitUI::IPlatform.
|
overridevirtual |
Return a monotonic clock timestamp in seconds.
Implements ZenitUI::IPlatform.
|
overridevirtual |
Return the current window/surface dimensions in logical pixels.
Implements ZenitUI::IPlatform.