#ifndef Global_H
#define Global_H
#include "BackEnd/BackEnd.h"
#include "Renderive/architecture/export.h"
#include <QApplication>
#include <QDebug>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QPainter>
#include <QVBoxLayout>
#include <QWidget>
#include <QWindow>
#include <QtWidgets>
#include <QtWidgetsDepends>
#include <functional>
#include <vector>
#include "psc_global_include/Singleton.hpp"
class Global : public Psc::Singleton<Global> {
public:
    explicit Global();
    int adapt_height(int full_screen_height);
    int adapt_width(int full_screen_width);
};
QVBoxLayout* create_vbox_layout(const std::vector<QWidget*>& children = {}, QWidget* parent = nullptr);
QHBoxLayout* create_hbox_layout(const std::vector<QWidget*>& children = {}, QWidget* parent = nullptr);
QRect get_max_rect(const QRect& rect, double WHRate);
int calculate_optimal_font_size(const QString& text, const QSize& space_size, const QFont& font);
int calculate_optimal_font_size(const std::vector<QString>& text_list, const QSize& space_size, const QFont& font);
QPushButton* create_button(const QString& text, int font_size, const std::function<void(void)>& func = nullptr);
namespace renderive {
template <typename T>
class Roll_Object;
}
class Base_Widget_Menu;
void init_click_button(QPushButton* button, const QString& text, int font_size, const std::function<void(void)>& func, renderive::Roll_Object<QPushButton>*);
QPushButton* create_click_button(const QString& text, int font_size, const std::function<void(void)>& func, renderive::Roll_Object<QPushButton>*);
QPushButton* create_normal(const QString& text, int font_size, const std::function<void(void)>& func = nullptr);
#endif
