/* * Copyright (C) 2020-2022 The opuntiaOS Project Authors. * + Contributed by Nikita Melekhin * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #pragma once #include "../../Devices/Screen.h" #include #include #include namespace WinServer { template class AfterComponentLoadProgress { public: static const int cost = Cost; static const size_t progress; }; static size_t total_cost = 0; template inline size_t __calc_total_cost() { return total_cost += Cost; } template const size_t AfterComponentLoadProgress::progress = __calc_total_cost(); class LoadingScreen { public: inline static LoadingScreen& the() { extern LoadingScreen* s_WinServer_LoadingScreen_the; return *s_WinServer_LoadingScreen_the; } inline static void destroy_the() { extern LoadingScreen* s_WinServer_LoadingScreen_the; delete s_WinServer_LoadingScreen_the; s_WinServer_LoadingScreen_the = nullptr; } LoadingScreen(); ~LoadingScreen() = default; template inline void move_progress() { display_status_bar(AfterComponentLoadProgress::progress, total_cost); } private: static constexpr int progress_line_height() { return 4; } static constexpr int progress_line_width() { return 128; } void display_status_bar(int current_progress, int max_progress); Screen& m_screen; int m_progress_line_min_x { 0 }; int m_progress_line_min_y { 0 }; LG::PixelBitmap m_logo; }; } // namespace WinServer