#pragma once #include "interfaces/cursor.hpp" #include "interfaces/statusline.hpp" #include "interfaces/window.hpp" #include "engine/data/vector2.hpp" #include #include #include #include #include constexpr uint32_t STATUSBAR_COLOR = 0x1A1A1AU; class StatusLine : public IStatusLine { public: StatusLine( std::shared_ptr cursor_controller, std::shared_ptr window ) noexcept; void initialize_background() noexcept override; void set_status( StatusLineSection section, const std::string_view &status_str ) noexcept override; private: std::unordered_map _sections_lengths; std::shared_ptr _cursor_controller; std::shared_ptr _window; auto _move_to_statusline(int32_t x) noexcept -> Vector2; void _move_back(Vector2 previous_position) noexcept; [[nodiscard]] auto _get_section_start_x(StatusLineSection section) const noexcept -> int32_t; void _clear_section(StatusLineSection section) noexcept; };