Ocular Engine
WindowManager.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_RENDERER_WINDOW_MANAGER__H__
19 #define __H__OCULAR_RENDERER_WINDOW_MANAGER__H__
20 
21 #include "WindowDisplay.hpp"
22 #include "WindowDescriptor.hpp"
23 #include "Window.hpp"
24 
25 #include <memory>
26 #include <list>
27 
28 //------------------------------------------------------------------------------------------
29 
34 namespace Ocular
35 {
40  namespace Core
41  {
42  class AWindow;
43 
51  {
52  public:
53 
54  WindowManager();
55  ~WindowManager();
56 
66  std::shared_ptr<AWindow> openWindow(WindowDescriptor const& descriptor);
67 
74  std::shared_ptr<AWindow> connectWindow(WindowDescriptor const& descriptor, void* windowID);
75 
80  void closeWindow(UUID const& uuid);
81 
85  void closeAllWindows();
86 
90  std::list<std::shared_ptr<AWindow>> listWindows() const;
91 
95  uint32_t getNumWindows() const;
96 
106  std::shared_ptr<AWindow> getWindow(UUID const& uuid);
107 
117  std::shared_ptr<AWindow> getWindow(void* osPointer);
118 
123  std::shared_ptr<AWindow> getMainWindow();
124 
130  void setMainWindow(UUID const& uuid);
131 
138  void updateWindows(int64_t time);
139 
140  protected:
141 
142  private:
143 
144  std::shared_ptr<AWindow> openWindowWin32(WindowDescriptor const& descriptor);
145  std::shared_ptr<AWindow> openWindowOSX(WindowDescriptor const& descriptor);
146  std::shared_ptr<AWindow> openWindowLinux(WindowDescriptor const& descriptor);
147 
148  std::shared_ptr<AWindow> connectWindowWin32(WindowDescriptor const& descriptor, void* windowID);
149  std::shared_ptr<AWindow> connectWindowOSX(WindowDescriptor const& descriptor, void* windowID);
150  std::shared_ptr<AWindow> connectWindowLinux(WindowDescriptor const& descriptor, void* windowID);
151 
152  std::list<std::shared_ptr<AWindow>> m_Windows;
153  std::shared_ptr<AWindow> m_MainWindow;
154  };
155  }
159 }
164 //------------------------------------------------------------------------------------------
165 
166 #endif
Definition: WindowManager.hpp:50
std::shared_ptr< AWindow > openWindow(WindowDescriptor const &descriptor)
Definition: WindowManager.cpp:48
std::shared_ptr< AWindow > getMainWindow()
Definition: WindowManager.cpp:173
std::shared_ptr< AWindow > connectWindow(WindowDescriptor const &descriptor, void *windowID)
Definition: WindowManager.cpp:59
Definition: WindowDescriptor.hpp:78
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
void updateWindows(int64_t time)
Definition: WindowManager.cpp:183
std::list< std::shared_ptr< AWindow > > listWindows() const
Definition: WindowManager.cpp:128
std::shared_ptr< AWindow > getWindow(UUID const &uuid)
Definition: WindowManager.cpp:138
void setMainWindow(UUID const &uuid)
Definition: WindowManager.cpp:178
void closeWindow(UUID const &uuid)
Definition: WindowManager.cpp:70
Definition: UUID.hpp:45
void closeAllWindows()
Definition: WindowManager.cpp:120
uint32_t getNumWindows() const
Definition: WindowManager.cpp:133