diff options
author | Michaล Lach <m.lach2003@gmail.com> | 2022-05-12 22:52:14 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-06-22 12:12:00 +0100 |
commit | e2b0f6795faf72f187b484ef2b5bd5df6c3461e9 (patch) | |
tree | b70cb56f0d346af764d0a9d31a0bb4c0670eba5c /Userland/Libraries/LibVT/Terminal.h | |
parent | 1950e79d484a4bb7a629aca7add1b0d4896b1ea4 (diff) | |
download | serenity-e2b0f6795faf72f187b484ef2b5bd5df6c3461e9.zip |
LibVT+Kernel: Separate the caret shapes and its steadiness
Currently CursorStyle enum handles both the styles and the steadiness or
blinking of the terminal caret, which doubles the amount of its entries.
This commit changes CursorStyle to CursorShape and moves the blinking
option to a seperate boolean value.
Diffstat (limited to 'Userland/Libraries/LibVT/Terminal.h')
-rw-r--r-- | Userland/Libraries/LibVT/Terminal.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Userland/Libraries/LibVT/Terminal.h b/Userland/Libraries/LibVT/Terminal.h index b3760b0106..65794d54e1 100644 --- a/Userland/Libraries/LibVT/Terminal.h +++ b/Userland/Libraries/LibVT/Terminal.h @@ -29,14 +29,11 @@ class VirtualConsole; namespace VT { -enum CursorStyle { +enum class CursorShape { None, - BlinkingBlock, - SteadyBlock, - BlinkingUnderline, - SteadyUnderline, - BlinkingBar, - SteadyBar + Block, + Underline, + Bar, }; enum CursorKeysMode { @@ -54,7 +51,8 @@ public: virtual void terminal_did_resize(u16 columns, u16 rows) = 0; virtual void terminal_history_changed(int delta) = 0; virtual void emit(u8 const*, size_t) = 0; - virtual void set_cursor_style(CursorStyle) = 0; + virtual void set_cursor_shape(CursorShape) = 0; + virtual void set_cursor_blinking(bool) = 0; }; class Terminal : public EscapeSequenceExecutor { @@ -428,8 +426,9 @@ protected: bool m_swallow_current { false }; bool m_stomp { false }; - CursorStyle m_cursor_style { BlinkingBlock }; - CursorStyle m_saved_cursor_style { BlinkingBlock }; + CursorShape m_cursor_shape { VT::CursorShape::Block }; + CursorShape m_saved_cursor_shape { VT::CursorShape::Block }; + bool m_cursor_is_blinking_set { true }; bool m_needs_bracketed_paste { false }; |