aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/statusline.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-07 19:45:17 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:57:01 +0200
commit8805b1fe27344e8086cebabf869b7a02d2376f05 (patch)
treea90a2e2dda1bcb98fb4de5cd983138e5441c2222 /src/interfaces/statusline.hpp
parentf778317bae709f397345a2d5e04e23864c6391b3 (diff)
refactor: decouple statusline from scene & cursor controller
Might be slightly slower than previously though...
Diffstat (limited to 'src/interfaces/statusline.hpp')
-rw-r--r--src/interfaces/statusline.hpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/interfaces/statusline.hpp b/src/interfaces/statusline.hpp
index a71699e..ae25fd9 100644
--- a/src/interfaces/statusline.hpp
+++ b/src/interfaces/statusline.hpp
@@ -1,7 +1,8 @@
#pragma once
-#include "interfaces/cursor.hpp"
-#include "interfaces/scene.hpp"
+#include "interfaces/component.hpp"
+
+#include "engine/data/bounds.hpp"
#include <yacppdic/factory.hpp>
@@ -20,22 +21,18 @@ enum StatusLineSection
};
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
-class IStatusLine
+class IStatusLine : public IComponent
{
public:
- virtual ~IStatusLine() noexcept = default;
-
- virtual void initialize_background() noexcept = 0;
-
+ // NOLINTNEXTLINE(google-default-arguments)
virtual void set_status(
- const StatusLineSection &section,
+ StatusLineSection section,
const std::string_view &status,
- std::size_t start = 1UL) noexcept = 0;
+ int32_t start = 1) noexcept = 0;
virtual void
- set_section_length(const StatusLineSection &section, uint32_t length) noexcept = 0;
+ set_section_length(StatusLineSection section, int32_t length) noexcept = 0;
};
-using IStatusLineFactory = yacppdic::Factory<std::unique_ptr<IStatusLine>(
- const std::shared_ptr<ICursorController> &cursor_controller,
- const std::shared_ptr<IScene> &scene)>;
+using IStatusLineFactory =
+ yacppdic::Factory<std::unique_ptr<IStatusLine>(const Bounds &size)>;