From aefa71a6be76ea47fb4205dcc0d6b49c13aa274b Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Sat, 31 Dec 2022 01:29:38 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20remove=20unused=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 1 - meson.build | 1 - src/screen_service.cpp | 22 --------------------- src/screen_service.hpp | 44 ------------------------------------------ 4 files changed, 68 deletions(-) delete mode 100644 src/screen_service.cpp delete mode 100644 src/screen_service.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c4d565..f8dbba0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,7 +93,6 @@ target_compile_features(project_options INTERFACE cxx_std_20) add_executable(${PROJECT_NAME} src/view.hpp src/definitions.hpp - src/screen_service.hpp src/screen_service.cpp src/config.cpp src/config.hpp src/utils.cpp src/utils.hpp src/cpu.cpp src/cpu.hpp diff --git a/meson.build b/meson.build index d457b77..d1572c5 100644 --- a/meson.build +++ b/meson.build @@ -60,7 +60,6 @@ endif src_files = files( 'src/view.hpp', 'src/definitions.hpp', - 'src/screen_service.hpp', 'src/screen_service.cpp', 'src/config.cpp', 'src/config.hpp', 'src/utils.cpp', 'src/utils.hpp', 'src/cpu.cpp', 'src/cpu.hpp', diff --git a/src/screen_service.cpp b/src/screen_service.cpp deleted file mode 100644 index aebe039..0000000 --- a/src/screen_service.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "screen_service.hpp" -#include "definitions.hpp" - -#include - -namespace tui { -static std::unique_ptr s_screen = nullptr; - -bool screen_service::initialize() noexcept { - if (s_screen != nullptr) { - error_inter("You should only initialize it once!\n"); - return false; - } - s_screen = std::make_unique(); - return s_screen.get(); -} - -auto screen_service::instance() -> screen_service* { - return s_screen.get(); -} - -} // namespace tui diff --git a/src/screen_service.hpp b/src/screen_service.hpp deleted file mode 100644 index a128388..0000000 --- a/src/screen_service.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// taken from https://github.com/adrianoviana87/ltuiny -#ifndef SCREEN_SERVICE_HPP -#define SCREEN_SERVICE_HPP - -//#include "view.hpp" - -/* clang-format off */ -//#include -#include // for ScreenInteractive -/* clang-format on */ - -namespace tui { -class screen_service final { - public: - using value_type = ftxui::ScreenInteractive; - using reference = value_type&; - using const_reference = const value_type&; - - screen_service() noexcept = default; - virtual ~screen_service() noexcept = default; - - static bool initialize() noexcept; - [[gnu::pure]] static screen_service* instance(); - - /* clang-format off */ - - // Element access. - auto data() noexcept -> reference - { return m_screen; } - auto data() const noexcept -> const_reference - { return m_screen; } - - /* clang-format on */ - - screen_service(const screen_service&) noexcept = delete; - screen_service& operator=(const screen_service&) noexcept = delete; - - private: - value_type m_screen = ftxui::ScreenInteractive::Fullscreen(); - // std::shared_ptr m_current_view{}; -}; -} // namespace tui - -#endif // SCREEN_SERVICE_HPP