From 6d66d5675d0fb78827bc47c49f9d4a1852c7255d Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 8 Jun 2022 18:31:58 +0200 Subject: feat: implement command mode --- src/interfaces/cursor.hpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/interfaces') diff --git a/src/interfaces/cursor.hpp b/src/interfaces/cursor.hpp index 377fe25..b09f06f 100644 --- a/src/interfaces/cursor.hpp +++ b/src/interfaces/cursor.hpp @@ -5,18 +5,21 @@ #include -enum CursorEvent +enum class CursorStyle { - POSITION_CHANGE + BlinkingBlock = 0, + BlinkingBlockDefault = 1, + SteadyBlock = 2, + BlinkingUnderline = 3, + SteadyUnderline = 4, + BlinkingBar = 5, + SteadyBar = 6 }; // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class ICursorController { public: - using Event = CursorEvent; - using Context = Vector2; - virtual ~ICursorController() noexcept = default; virtual void move(const Vector2 &direction, const uint32_t &amount) noexcept = 0; @@ -28,9 +31,18 @@ public: virtual void ensure_position() noexcept = 0; + /** + * Updates the stored cursor position. + * + * This will NOT change the position of the actual cursor! + */ + virtual void update_position(const Vector2 &position) noexcept = 0; + virtual void hide() noexcept = 0; virtual void show() noexcept = 0; + virtual void set_cursor_style(CursorStyle cursor_style) noexcept = 0; + virtual void set_bounds(const Bounds &bounds) noexcept = 0; }; -- cgit v1.2.3-18-g5258