Skip to content

Commit

Permalink
Corrected errors in document generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
KazDragon committed Mar 8, 2021
1 parent 826486a commit 51da084
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
12 changes: 6 additions & 6 deletions include/terminalpp/point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ 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.
return lhs.y_ < rhs.y_
|| (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_;
Expand Down
12 changes: 6 additions & 6 deletions include/terminalpp/rectangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
3 changes: 2 additions & 1 deletion include/terminalpp/terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class ReadContinuation>
detail::terminal_reader<ReadContinuation> read(ReadContinuation &&rc)
Expand Down
15 changes: 15 additions & 0 deletions include/terminalpp/terminal_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<element> last_element_;

/// \brief The current cursor position, if known.
boost::optional<point> cursor_position_;

/// \brief The cursor position at which the last "save cursor position"
/// command was executed.
boost::optional<point> saved_cursor_position_;

/// \brief Whether the cursor is visible or not.
boost::optional<bool> cursor_visible_;

/// \brief A parser for reading input.
detail::parser input_parser_;
};

Expand Down
2 changes: 2 additions & 0 deletions include/terminalpp/virtual_key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<byte, control_sequence>;

/// \brief The actual key we believe was pressed, selected from the
Expand Down

0 comments on commit 51da084

Please sign in to comment.