TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tui.hpp File Reference
#include <functional>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  tmk::app::tui::Field
 One command-line option as the screen shows it. More...
struct  tmk::app::tui::Entry
 One line of an options file: name = value. More...
struct  tmk::app::tui::Span
struct  tmk::app::tui::Line
 One screen line: text is the plain text (what a test or a monochrome terminal sees), spans the same in pieces with their styles. More...
class  tmk::app::tui::Model

Namespaces

namespace  tmk
namespace  tmk::app
namespace  tmk::app::tui
namespace  tmk::app::tui::key

Enumerations

enum class  tmk::app::tui::Scope { tmk::app::tui::run = 0 , tmk::app::tui::global = 1 , tmk::app::tui::project = 2 , tmk::app::tui::file = 3 }
 Where a value comes from, lowest precedence first. More...
enum class  tmk::app::tui::Action {
  tmk::app::tui::none , tmk::app::tui::quit , tmk::app::tui::run , tmk::app::tui::print ,
  tmk::app::tui::save
}
enum class  tmk::app::tui::Style {
  tmk::app::tui::plain , tmk::app::tui::frame , tmk::app::tui::title , tmk::app::tui::heading ,
  tmk::app::tui::dim , tmk::app::tui::label , tmk::app::tui::key , tmk::app::tui::code ,
  tmk::app::tui::ok , tmk::app::tui::warn , tmk::app::tui::error , tmk::app::tui::accent ,
  tmk::app::tui::global , tmk::app::tui::project , tmk::app::tui::file , tmk::app::tui::run ,
  tmk::app::tui::tag_global , tmk::app::tui::tag_project , tmk::app::tui::tag_file , tmk::app::tui::tag_run
}
 How a piece of text is painted. More...

Functions

const char * tmk::app::tui::scope_name (Scope s)
 "this run", "global", "project", "file"
std::vector< Entry > tmk::app::tui::parse_options (const std::string &text)
int tmk::app::tui::truth (const std::string &value)
 A flag's value in an options file: 1 for true/on/yes/1, 0 for false/off/no/0, -1 for anything else.
std::size_t tmk::app::tui::display_width (const std::string &s)
 Columns the text takes (UTF-8 characters count one each, which is right for the box-drawing characters).
void tmk::app::tui::save_options (Model &m)
 Writes the target scope's options to its file (creating the folder) and reports the outcome in the status line.
Action tmk::app::tui::run_terminal (Model &m)
 Runs the model on the controlling terminal (/dev/tty, so standard output stays free for print) until the user quits, runs or prints.
Action tmk::app::tui::run_keys (Model &m, const std::string &keys)
 The same for a scripted key sequence (tests): characters stand for themselves, and <up> <down> <pgup> <pgdn> <home> <end> <enter> <space> <esc> <bs> <del> <lt> name the others.

Variables

constexpr int tmk::app::tui::kScopes = 4
constexpr int tmk::app::tui::key::ctrl_c = 3
constexpr int tmk::app::tui::key::tab = 9
constexpr int tmk::app::tui::key::enter = 13
constexpr int tmk::app::tui::key::ctrl_u = 21
constexpr int tmk::app::tui::key::esc = 27
constexpr int tmk::app::tui::key::backspace = 127
constexpr int tmk::app::tui::key::up = 0x1000
constexpr int tmk::app::tui::key::down = 0x1001
constexpr int tmk::app::tui::key::page_up = 0x1002
constexpr int tmk::app::tui::key::page_down = 0x1003
constexpr int tmk::app::tui::key::home = 0x1004
constexpr int tmk::app::tui::key::end = 0x1005
constexpr int tmk::app::tui::key::del = 0x1006
constexpr int tmk::app::tui::key::shift_tab = 0x1007