ShishGL  1.0
A simple modular cross-platform graphics library
WindowManager.hpp
Go to the documentation of this file.
1 /*============================================================================*/
2 #ifndef SHISHGL_LAYOUT_MANAGER_HPP
3 #define SHISHGL_LAYOUT_MANAGER_HPP
4 /*============================================================================*/
5 #include <list>
6 #include <unordered_set>
7 #include <string_view>
8 /*============================================================================*/
9 namespace Sh {
10 
11  class Window;
12 
13  class WindowManager {
14  public:
15 
16  WindowManager() = delete;
17 
18  static void init();
19 
20  template <typename SomeWindow, typename... Args>
21  static SomeWindow* create(Args&&... args);
22 
23  static void destroy(Window* window);
24 
25  static Window* Root();
26 
27  static void dump(const std::string_view& file_name);
28 
29  virtual ~WindowManager() = default;
30 
31  private:
32 
33  static void refresh();
34 
35  static void clear();
36 
37  static void dump(FILE* file, Window* root);
38 
39  using WindowPool = std::unordered_set<Window*>;
40 
41  static WindowPool& Pool();
42  static WindowPool& ToDestroy();
43 
44  /*----------------------------------------------*/
45  static Window* ROOT;
46  /*----------------------------------------------*/
47 
48  friend class Window;
49  friend class CoreApplication;
50 
51  };
52 
53 }
54 /*============================================================================*/
55 #include "WindowManager.ipp"
56 /*============================================================================*/
57 #endif //SHISHGL_LAYOUT_MANAGER_HPP
58 /*============================================================================*/
Sh::WindowManager::Root
static Window * Root()
Definition: WindowManager.cpp:23
Sh::WindowManager
Definition: WindowManager.hpp:13
Sh::CoreApplication
Definition: CoreApplication.hpp:15
Sh::Window
Definition: Window.hpp:16
Sh::WindowManager::create
static SomeWindow * create(Args &&... args)
Definition: WindowManager.ipp:8
Sh::WindowManager::~WindowManager
virtual ~WindowManager()=default
Sh::WindowManager::init
static void init()
Definition: WindowManager.cpp:40
Sh
Definition: CoreApplication.hpp:10
WindowManager.ipp
Sh::WindowManager::destroy
static void destroy(Window *window)
Definition: WindowManager.cpp:29
Sh::WindowManager::WindowManager
WindowManager()=delete
Sh::WindowManager::dump
static void dump(const std::string_view &file_name)
Definition: WindowManager.cpp:64