4#include <core/tui/MouseTracking.hpp>
5#include <core/tui/Terminal.hpp>
6#include <core/tui/runtime/InputSource.hpp>
30using ShellFactory = std::function<std::unique_ptr<ui::MountedShell>(
41 ::core::tui::runtime::InputSource*
input =
nullptr;
45 ::core::tui::MouseTracking
mouse = ::core::tui::MouseTracking::Drag;
65 [[nodiscard]] std::string_view
name()
const override;
std::string_view name() const override
The name --ui= and MORPH_UI select this frontend by.
int run(ui::AppSource &source) override
Runs the application the source opens on the calling thread until it quits or the input ends.
Frontend(FrontendConfig config={})
What a frontend lends the source it opens and the screens it mounts.
Where the screens and the models are: a server (remote) or the application linked in-process (local).
A frontend: owns an event loop and a renderer, and runs one source's screens.
Makes widgets. Each factory appends the new widget to parent, or makes a root when it is null,...
What a tui::Frontend runs on.
::core::tui::Terminal * terminal
The terminal to draw on; null means the process's terminal. Either way the frontend sets its mouse mo...
ShellFactory mountShell
Mounts the shell when the source is ready; it must not be empty.
::core::tui::runtime::InputSource * input
Where input comes from; null means the terminal's own input. A test passes a scripted source.
::core::tui::MouseTracking mouse
How much mouse input to ask the terminal for: Drag reports presses, releases and motion while a butto...
One frontend a binary was built with.
std::function< std::unique_ptr< ui::MountedShell >( ui::AppContext &context, ui::IViewBackend &backend, std::expected< ui::Bundle, ui::ConnectError > opened)> ShellFactory
Mounts the application's shell for what the source delivered, on the terminal's widgets.
ui::FrontendOption frontendOption(FrontendConfig config={})
The TUI's entry for ui::selectFrontend.
constexpr int kInterruptExitCode
The exit code Frontend::run returns when Ctrl+C ended the run: the shell's 128 + SIGINT,...
The backend contract: the retained widgets a mount drives, and the factory that makes them.
The frontend seam: main picks a frontend at runtime, and the frontend runs whatever an AppSource open...