diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-08-13 12:48:54 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-13 12:56:10 +0200 |
commit | 4fb02c78a9ed12e73c39266767c81b585d9d4788 (patch) | |
tree | 0d9374221324475faa1d9f032e758803c8a2e25e /Applications/Terminal | |
parent | e8eadd19a5ef589d7d8eb73aa89915bc9643b40c (diff) | |
download | serenity-4fb02c78a9ed12e73c39266767c81b585d9d4788.zip |
LibVT: Rename VT::BufferPosition to VT::Position and move to own file
Diffstat (limited to 'Applications/Terminal')
-rw-r--r-- | Applications/Terminal/Terminal.cpp | 8 | ||||
-rw-r--r-- | Applications/Terminal/Terminal.h | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Applications/Terminal/Terminal.cpp b/Applications/Terminal/Terminal.cpp index 5fd56b25a2..924ba3f748 100644 --- a/Applications/Terminal/Terminal.cpp +++ b/Applications/Terminal/Terminal.cpp @@ -279,14 +279,14 @@ void Terminal::set_opacity(u8 new_opacity) force_repaint(); } -VT::BufferPosition Terminal::normalized_selection_start() const +VT::Position Terminal::normalized_selection_start() const { if (m_selection_start < m_selection_end) return m_selection_start; return m_selection_end; } -VT::BufferPosition Terminal::normalized_selection_end() const +VT::Position Terminal::normalized_selection_end() const { if (m_selection_start < m_selection_end) return m_selection_end; @@ -298,7 +298,7 @@ bool Terminal::has_selection() const return m_selection_start.is_valid() && m_selection_end.is_valid(); } -bool Terminal::selection_contains(const VT::BufferPosition& position) const +bool Terminal::selection_contains(const VT::Position& position) const { if (!has_selection()) return false; @@ -306,7 +306,7 @@ bool Terminal::selection_contains(const VT::BufferPosition& position) const return position >= normalized_selection_start() && position <= normalized_selection_end(); } -VT::BufferPosition Terminal::buffer_position_at(const Point& position) const +VT::Position Terminal::buffer_position_at(const Point& position) const { auto adjusted_position = position.translated(-(frame_thickness() + m_inset), -(frame_thickness() + m_inset)); int row = adjusted_position.y() / m_line_height; diff --git a/Applications/Terminal/Terminal.h b/Applications/Terminal/Terminal.h index 3d985c56e4..4bcdbf3c79 100644 --- a/Applications/Terminal/Terminal.h +++ b/Applications/Terminal/Terminal.h @@ -31,11 +31,11 @@ public: RefPtr<CConfigFile> config() const { return m_config; } bool has_selection() const; - bool selection_contains(const VT::BufferPosition&) const; + bool selection_contains(const VT::Position&) const; String selected_text() const; - VT::BufferPosition buffer_position_at(const Point&) const; - VT::BufferPosition normalized_selection_start() const; - VT::BufferPosition normalized_selection_end() const; + VT::Position buffer_position_at(const Point&) const; + VT::Position normalized_selection_start() const; + VT::Position normalized_selection_end() const; private: // ^GWidget @@ -61,8 +61,8 @@ private: VT::Terminal m_terminal; - VT::BufferPosition m_selection_start; - VT::BufferPosition m_selection_end; + VT::Position m_selection_start; + VT::Position m_selection_end; bool m_should_beep { false }; bool m_belling { false }; |