ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
InputController.hpp
Go to the documentation of this file.
1#pragma once
2
27
28#include "Common.hpp"
29#include "UIEnums.hpp"
30
31namespace ZenitUI
32{
33
37
38 class Layout;
39
45 {
56 void updateFlags(Layout &node, bool selfBlocked, bool scrolling);
57
63 UIState computeNextState(const Layout &node) const;
64
68 void fireCallbacks(Layout &node, UIState prev, UIState next, bool changed);
69
75 };
76
78} // namespace ZenitUI
Centralized standard library includes used throughout ZenitUI.
Small enumerations describing layout strategy and interaction state.
The base node type: tree, style, layout, input, scroll, render.
Definition Layout.hpp:154
UIState
Interaction state computed per node and consumed by the style resolver to select pseudo-class overlay...
Definition UIEnums.hpp:49
Stateless per-node input dispatcher.
Definition InputController.hpp:45
void handleKeyInput(Layout &node)
Fire onClick on Enter or Space for the focused, keyboard- activatable node.
void updateFlags(Layout &node, bool selfBlocked, bool scrolling)
Recompute the node's hovered / pressed / focused flags.
UIState computeNextState(const Layout &node) const
Derive the UIState enum from the node's current state flags.
void fireCallbacks(Layout &node, UIState prev, UIState next, bool changed)
Fire callbacks for state transitions and pointer events.