21PROMEKI_NAMESPACE_BEGIN
116 _screen.setColorMode(mode);
124 Terminal::ColorSupport
colorMode()
const {
return _screen.colorMode(); }
173 EventLoop *_eventLoop =
nullptr;
178 AnsiStream _ansiStream;
194 int _stdinSourceHandle = -1;
195 int _winchSubscription = -1;
196 Atomic<bool> _repaintQueued;
199 using Clock = std::chrono::steady_clock;
200 using TimePoint = Clock::time_point;
201 static constexpr int DoubleClickIntervalMs = 400;
202 TimePoint _lastClickTime{};
203 Point2Di32 _lastClickPos{-1, -1};
204 MouseEvent::Button _lastClickButton = MouseEvent::NoButton;
206 void setupEventSources();
207 void teardownEventSources();
211 void paintWidget(TuiWidget *widget);
213 void dispatchKeyEvent(
const TuiInputParser::ParsedEvent &ev);
214 void dispatchMouseEvent(
const TuiInputParser::ParsedEvent &ev);
215 void collectFocusable(TuiWidget *widget, List<TuiWidget *> &list);
216 TuiWidget *widgetAt(TuiWidget *widget,
const Point2Di32 &globalPos);
Style palette for TUI widgets.
Definition palette.h:41
Double-buffered character cell grid for TUI rendering.
Definition screen.h:68
TUI subsystem installed alongside an Application.
Definition tuisubsystem.h:57
void releaseMouse()
Releases the mouse grab.
Definition tuisubsystem.h:168
const TuiPalette & palette() const
Returns the palette.
Definition tuisubsystem.h:96
void setColorMode(Terminal::ColorSupport mode)
Sets the color mode for the TUI screen.
Definition tuisubsystem.h:115
void setRootWidget(TuiWidget *widget)
Sets the top-level (root) widget.
void setFocusWidget(TuiWidget *widget)
Sets the focused widget.
void grabMouse(TuiWidget *widget)
Grabs mouse events for a widget.
Definition tuisubsystem.h:163
TuiScreen & screen()
Returns the screen.
Definition tuisubsystem.h:90
TuiSubsystem()
Installs the TUI on the current Application.
void updateAll()
Forces a full screen repaint.
void setPalette(const TuiPalette &palette)
Sets the palette.
Definition tuisubsystem.h:102
static TuiSubsystem * instance()
Returns the active TuiSubsystem instance.
Definition tuisubsystem.h:78
TuiWidget * focusWidget() const
Returns the currently focused widget.
Definition tuisubsystem.h:138
void focusNext(bool reverse=false)
Cycles focus to the next focusable widget.
~TuiSubsystem()
Destructor. Restores terminal state and releases I/O sources.
void markNeedsRepaint()
Marks the screen as needing a repaint.
Terminal::ColorSupport colorMode() const
Returns the current color mode.
Definition tuisubsystem.h:124
TuiPalette & palette()
Returns the palette for modification.
Definition tuisubsystem.h:99
Terminal & terminal()
Returns the terminal.
Definition tuisubsystem.h:93
TuiWidget * rootWidget() const
Returns the root widget.
Definition tuisubsystem.h:87