PlatformTypes.h file
Classes
- struct PlatformRect
- Window-local rectangle in logical pixels.
- struct PlatformWindowDesc
- struct PlatformEvent
- struct PlatformRequest
- struct PlatformWindowMetrics
- struct PlatformNativeHandles
Enums
- enum class PlatformWindowStyle: uint8_t { Standard, CustomChrome }
- enum class PlatformWindowKind: uint8_t { Normal, PopupMenu, Tooltip }
- enum class PlatformCursor: uint8_t { Arrow, Text, Wait, Crosshair, Progress, ResizeNWSE, ResizeNESW, ResizeEW, ResizeNS, Move, NotAllowed, Hand, Hidden, Count }
- System cursor shapes. Per window; shown while the pointer is over that window.
- enum class PlatformGamepadButton: uint8_t { South, East, West, North, Back, Start, LeftShoulder, RightShoulder, DpadUp, DpadDown, DpadLeft, DpadRight, Other }
- enum class PlatformGamepadFamily: uint8_t { Generic, Xbox, PlayStation, Nintendo }
- How a gamepad labels its buttons.
- enum class PlatformClipboard: uint8_t { Clipboard, Selection }
- enum class PlatformEventType: uint8_t { Quit, WindowOpened, WindowMoved, WindowResized, WindowPixelSizeChanged, WindowScaleChanged, WindowCloseRequested, WindowOpenFailed, WindowFocusGained, WindowFocusLost, PointerEnter, PointerLeave, PointerMove, PointerButton, PointerWheel, Key, GamepadButton, TextInput, TextEditing, DropBegin, DropPosition, DropFile, DropText, DropComplete, ClipboardChanged, ClipboardText, FileChosen }
- enum class PlatformRequestType: uint8_t { OpenWindow, CloseWindow, Minimize, ToggleMaximize, MoveBy, SetRelativeMouse, Focus, SetUserScale, SetTitle, StartTextInput, StopTextInput, SetTextInputArea, SetPosition, SetSize, SetCursor, SetClipboard, GetClipboard, SetOwner, ShowFileDialog, FileDialogDone }
- enum PlatformFileDialog: int32_t { FileDialogMany = 1 << 0, FileDialogSave = 1 << 1, FileDialogFolder = 1 << 2 }
- What kind of file dialog (PlatformRequestType::ShowFileDialog, A).
Typedefs
- using PlatformWindowID = uint32_t
- 0 = no window
Enum documentation
enum class PlatformWindowStyle: uint8_t
| Enumerators | |
|---|---|
| Standard |
OS title bar and borders. |
| CustomChrome |
the app draws its title bar: no OS chrome; edges resize, the top strip drags |
enum class PlatformWindowKind: uint8_t
| Enumerators | |
|---|---|
| Normal |
top-level window |
| PopupMenu |
child popup that takes keyboard focus (menus, dropdowns, combo lists) |
| Tooltip |
child popup that never takes focus or input |
enum class PlatformGamepadButton: uint8_t
A gamepad's buttons, named by where they are (South is the bottom face button), whatever is printed on them.
enum class PlatformClipboard: uint8_t
| Enumerators | |
|---|---|
| Clipboard |
the system clipboard (copy / paste) |
| Selection |
X11 / Wayland primary selection (middle-click paste); empty elsewhere. |
enum class PlatformEventType: uint8_t
| Enumerators | |
|---|---|
| Quit |
|
| WindowOpened |
a window opened by request; Tag echoes the request's tag; scale fields as below; X/Y: where it is on the screen |
| WindowMoved |
X/Y: where the window is on the screen now, logical pixels (not sent where the platform does not say). |
| WindowResized |
Width/Height in logical pixels. |
| WindowPixelSizeChanged |
Width/Height in physical pixels (swapchain size). |
| WindowScaleChanged |
Scale, DisplayScale, PixelDensity; Width/Height in physical pixels. |
| WindowCloseRequested |
the user, the OS, or a request wants it closed; its popups are asked first |
| WindowOpenFailed |
an OpenWindow request failed; Tag echoes the request's tag (Window = parent or 0) |
| WindowFocusGained |
the window now has keyboard focus |
| WindowFocusLost |
preceded by an empty TextEditing if a composition was in progress |
| PointerEnter |
the pointer entered the window |
| PointerLeave |
the pointer left the window (not sent while a button holds the capture) |
| PointerMove |
X/Y, PX/PY; DX/DY relative motion; Mods. |
| PointerButton |
X/Y, PX/PY, Button (1 = left, 2 = middle, 3 = right), bDown, Clicks, Mods. |
| PointerWheel |
DX/DY scroll; X/Y, PX/PY pointer position; Mods. |
| Key |
Scancode, Keycode, Mods, bDown, bRepeat. |
| GamepadButton |
Button (PlatformGamepadButton), bDown. Sent to the window with keyboard focus. |
| TextInput |
Text: committed UTF-8; ends any composition. |
| TextEditing |
Text: IME composition (empty = ended); TextCursor/TextLength: selection within it. |
| DropBegin |
a drag entered the window carrying something droppable |
| DropPosition |
X/Y, PX/PY: where the drag hovers (drop-target feedback). |
| DropFile |
Text: dropped file path; X/Y, PX/PY (one event per file). |
| DropText |
Text: dropped text; X/Y, PX/PY. |
| DropComplete |
the drop finished, or the drag left the window |
| ClipboardChanged |
the system clipboard's contents changed (no window) |
| ClipboardText |
Text: the answer to a GetClipboard request; Tag echoes it. |
| FileChosen |
Text: what was chosen in a file dialog, a path a line; empty if none was. Tag echoes the request's. |
enum class PlatformRequestType: uint8_t
| Enumerators | |
|---|---|
| OpenWindow |
A/B: logical size; Title; Tag echoed in WindowOpened. Popups: Kind, Window = parent, C/D = position. |
| CloseWindow |
arrives as WindowCloseRequested, so the owner releases GPU resources first |
| Minimize |
|
| ToggleMaximize |
|
| MoveBy |
A/B: delta in logical pixels (custom-chrome title bar drags). |
| SetRelativeMouse |
A: 0/1. |
| Focus |
raise the window and give it keyboard focus (the OS may refuse) |
| SetUserScale |
A: user UI scale in thousandths (1000 = 1.0); applies to every window. |
| SetTitle |
Title. |
| StartTextInput |
the window accepts text: TextInput / TextEditing events, on-screen keyboard, IME |
| StopTextInput |
ends a composition in progress (an empty TextEditing follows) |
| SetTextInputArea |
A/B/C/D: x, y, w, h in window-local logical pixels (IME candidate placement). |
| SetPosition |
A/B: logical pixels; popups: relative to the parent. |
| SetSize |
A/B: logical pixels. |
| SetCursor |
A: PlatformCursor, shown while the pointer is over the window. |
| SetClipboard |
Payload: text (see Platform:: |
| GetClipboard |
A: PlatformClipboard; answered by a ClipboardText event carrying Tag. |
| SetOwner |
A: the window this one stays above (and goes away with), or 0 for none. |
| ShowFileDialog |
Payload: what is asked (see Platform:: |
| FileDialogDone |
the platform's own: what a dialog came back with, on its way to being an event |
enum PlatformFileDialog: int32_t
What kind of file dialog (PlatformRequestType::ShowFileDialog, A).
| Enumerators | |
|---|---|
| FileDialogMany |
more than one may be chosen |
| FileDialogSave |
a file to write |
| FileDialogFolder |
a folder |