From c988905add09cf8baf46dc61279528f6f39f7a1a Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 10 Mar 2022 20:16:14 +0100 Subject: feat: add status bar --- src/engine/graphics/scene.hpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/engine/graphics/scene.hpp') diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp index c4c217f..3d05cd9 100644 --- a/src/engine/graphics/scene.hpp +++ b/src/engine/graphics/scene.hpp @@ -1,29 +1,37 @@ #pragma once -#include "DI/auto_wirable.hpp" +#include "interfaces/cursor.hpp" #include "interfaces/matrix.hpp" #include "interfaces/scene.hpp" +#include "interfaces/window.hpp" #include +#include #include constexpr fmt::string_view ENABLE_ALT_BUFFER = "{esc}[?1049h"; constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l"; -class Scene : public IScene, - public AutoWirable> +constexpr fmt::string_view ERASE_ENTIRE_LINE = "{esc}[2K"; + +class Scene : public IScene { public: - explicit Scene(IMatrixFactory matrix_factory); + explicit Scene(IMatrixFactory matrix_factory, + std::shared_ptr cursor_controller, + std::shared_ptr window) noexcept; - void enter() override; + void enter() noexcept override; - void leave() override; + void leave() noexcept override; - // void do_in_statusbar(const std::function &routine); + void write_status(const std::string_view &str) noexcept override; private: bool _is_shown; IMatrixFactory _matrix_factory; + + std::shared_ptr _cursor_controller; + std::shared_ptr _window; }; -- cgit v1.2.3-18-g5258