diff --git a/include/terminalpp/point.hpp b/include/terminalpp/point.hpp index 8f618189..171a375f 100644 --- a/include/terminalpp/point.hpp +++ b/include/terminalpp/point.hpp @@ -62,9 +62,9 @@ struct TERMINALPP_EXPORT point return *this; } - // ====================================================================== - // OPERATOR<(POINT,POINT) - // ====================================================================== + //* ===================================================================== + /// \brief Less-than operator + //* ===================================================================== constexpr friend bool operator<(point const &lhs, point const &rhs) { // Note: reimplemented due to std::tie not being constexpr everywhere. @@ -72,9 +72,9 @@ struct TERMINALPP_EXPORT point || (lhs.y_ == rhs.y_ && lhs.x_ < rhs.x_); } - // ====================================================================== - // OPERATOR==(POINT,POINT) - // ====================================================================== + //* ===================================================================== + /// \brief Equality operator + //* ===================================================================== constexpr friend bool operator==(point const &lhs, point const &rhs) { return lhs.x_ == rhs.x_ && lhs.y_ == rhs.y_; diff --git a/include/terminalpp/rectangle.hpp b/include/terminalpp/rectangle.hpp index 3cb701ea..15eb4201 100644 --- a/include/terminalpp/rectangle.hpp +++ b/include/terminalpp/rectangle.hpp @@ -33,18 +33,18 @@ struct TERMINALPP_EXPORT rectangle { } - // ====================================================================== - // OPERATOR<(RECTANGLE,RECTANGLE) - // ====================================================================== + //* ===================================================================== + /// \brief Less-than operator + //* ===================================================================== constexpr friend bool operator<(rectangle const &lhs, rectangle const &rhs) { return lhs.origin_ < rhs.origin_ || (lhs.origin_ == rhs.origin_ && lhs.size_ < rhs.size_); } - // ====================================================================== - // OPERATOR==(RECTANGLE,RECTANGLE) - // ====================================================================== + //* ===================================================================== + /// \brief Equality operator + //* ===================================================================== constexpr friend bool operator==(rectangle const &lhs, rectangle const &rhs) { return lhs.origin_ == rhs.origin_ && lhs.size_ == rhs.size_; diff --git a/include/terminalpp/terminal.hpp b/include/terminalpp/terminal.hpp index 93da82f9..d9cf6c98 100644 --- a/include/terminalpp/terminal.hpp +++ b/include/terminalpp/terminal.hpp @@ -94,9 +94,10 @@ class TERMINALPP_EXPORT terminal /// void read_tokens(terminalpp::tokens); /// void raw_write(terminalpp::bytes); /// terminal term{raw_write}; - /// term.read(read_tokens) << "\\x1B[13~"_tb; + /// term.read(read_tokens) >> "\\x1B[13~"_tb; /// // read_tokens was called with a collection of one token, which /// // contained the f3 virtual key. + /// \endcode //* ===================================================================== template detail::terminal_reader read(ReadContinuation &&rc) diff --git a/include/terminalpp/terminal_state.hpp b/include/terminalpp/terminal_state.hpp index 55a4dabf..8b5ce3a9 100644 --- a/include/terminalpp/terminal_state.hpp +++ b/include/terminalpp/terminal_state.hpp @@ -14,13 +14,28 @@ namespace terminalpp { //* ========================================================================= struct TERMINALPP_EXPORT terminal_state { + //* ===================================================================== + /// \brief Constructor + //* ===================================================================== terminal_state(); + /// \brief The sized of the terminal. extent terminal_size_; + + /// \brief The last element that was written to the terminal. boost::optional last_element_; + + /// \brief The current cursor position, if known. boost::optional cursor_position_; + + /// \brief The cursor position at which the last "save cursor position" + /// command was executed. boost::optional saved_cursor_position_; + + /// \brief Whether the cursor is visible or not. boost::optional cursor_visible_; + + /// \brief A parser for reading input. detail::parser input_parser_; }; diff --git a/include/terminalpp/virtual_key.hpp b/include/terminalpp/virtual_key.hpp index 2d80f95d..8a1a985e 100644 --- a/include/terminalpp/virtual_key.hpp +++ b/include/terminalpp/virtual_key.hpp @@ -176,6 +176,8 @@ enum class vk_modifier : byte //* ========================================================================= struct TERMINALPP_EXPORT virtual_key { + /// \brief A virtual key is generated from either a single character or + /// some control sequence that represents the key. using input_sequence = boost::variant; /// \brief The actual key we believe was pressed, selected from the