ui namespace
Namespaces
- namespace detail
Classes
- struct OutputMessage
- struct OutputPublisher
- struct ProcessContext
- class ProcessHandle
- class ProcessState
- class SignalPipe
- class TerminalCompositor
- Double-buffered terminal compositor with HUD/scroll region support.
- class UIRuntime
- class yard
- A yard is a drawable process scope context, or something.
Typedefs
Functions
-
template <typename WorkerBody, typename CompanionBody, typename Layout>auto accompany(const yard& self, WorkerBody worker_body, CompanionBody companion_body, Layout layout) → nxt::
task -
auto is_character(const nxt::
input:: KeyEvent& event, char ch) → bool -
auto is_escape(const nxt::
input:: KeyEvent& event) → bool -
auto is_quit_key(const nxt::
input:: KeyEvent& event) → bool -
template <typename Predicate>auto next_key_press(const yard& self, Predicate predicate) → nxt::
task<std:: optional<nxt:: input:: KeyEvent>> -
auto next_key_press(const yard& self) → nxt::
task<std:: optional<nxt:: input:: KeyEvent>> -
template <typename State, typename BuildUI, typename Update>auto run(State initial_state, BuildUI build_ui, Update update) → int
-
template <typename Body>auto run2(Body body) → int
-
template <typename State, typename Update>auto run_headless(State initial_state, Update update, bool read_input = false) → int
- auto runtime_output(UIRuntime& runtime) → OutputPublisher
-
template <typename Body>auto spawn(const yard& parent, Body body) → ProcessHandle
- Spawn a child process within
parent's cancellation scope. -
auto spinner(std::
chrono:: milliseconds interval = std:: chrono:: milliseconds{80}, tui:: Style style = tui:: bold|tui:: fg(Rgba8:: black())|tui:: bg(Rgba8:: white())) → auto -
template <typename WorkerBody>auto spintag(const yard& self, WorkerBody worker_body) → nxt::
task
Typedef documentation
using nxt:: ui:: TermSize = nxt:: Size
#include <nxtio/app.hpp>
Terminal dimensions in nxt cell units.
Function documentation
#include <nxtio/process.hpp>
template <typename WorkerBody, typename CompanionBody, typename Layout>
nxt:: task nxt:: ui:: accompany(const yard& self,
WorkerBody worker_body,
CompanionBody companion_body,
Layout layout)
bool nxt:: ui:: is_character(const nxt:: input:: KeyEvent& event,
char ch)
#include <nxtio/process.hpp>
bool nxt:: ui:: is_escape(const nxt:: input:: KeyEvent& event)
#include <nxtio/process.hpp>
bool nxt:: ui:: is_quit_key(const nxt:: input:: KeyEvent& event)
#include <nxtio/process.hpp>
#include <nxtio/process.hpp>
template <typename Predicate>
nxt:: task<std:: optional<nxt:: input:: KeyEvent>> nxt:: ui:: next_key_press(const yard& self,
Predicate predicate)
nxt:: task<std:: optional<nxt:: input:: KeyEvent>> nxt:: ui:: next_key_press(const yard& self)
#include <nxtio/process.hpp>
#include <nxtio/app.hpp>
template <typename State, typename BuildUI, typename Update>
int nxt:: ui:: run(State initial_state,
BuildUI build_ui,
Update update)
Run a TUI application.
- initial_state: the starting state
- build_ui: (const State&) → Layout
- update: (UIRuntime&, State&) → nxt::
task<> (should call request_shutdown)
#include <nxtio/process.hpp>
template <typename Body>
int nxt:: ui:: run2(Body body)
Run a TUI application Proact-style: the body coroutine owns the whole UI lifecycle. Its surface is mounted as the screen root, and the program exits when the body returns.
#include <nxtio/app.hpp>
template <typename State, typename Update>
int nxt:: ui:: run_headless(State initial_state,
Update update,
bool read_input = false)
Run the UI runtime without a rendered HUD. This still gives callers the scheduler, signal handling, and scroll output helpers.
OutputPublisher nxt:: ui:: runtime_output(UIRuntime& runtime)
#include <nxtio/process.hpp>
#include <nxtio/process.hpp>
template <typename Body>
ProcessHandle nxt:: ui:: spawn(const yard& parent,
Body body)
Spawn a child process within parent's cancellation scope.