diff options
author | crupest <crupest@outlook.com> | 2022-02-08 16:53:51 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-08 16:53:51 +0800 |
commit | 74bb9cd27242b9320f99ff4d2b50c3051576cc14 (patch) | |
tree | 744bac5799c593d1d6f81e7b09581bea626f2cde /include/cru/win/gui/UiApplication.hpp | |
parent | b90c398de829d1ba5329651d75bae82f5e4085fe (diff) | |
download | cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.gz cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.bz2 cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.zip |
...
Diffstat (limited to 'include/cru/win/gui/UiApplication.hpp')
-rw-r--r-- | include/cru/win/gui/UiApplication.hpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/include/cru/win/gui/UiApplication.hpp b/include/cru/win/gui/UiApplication.hpp deleted file mode 100644 index 1280e7a6..00000000 --- a/include/cru/win/gui/UiApplication.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once -#include "Resource.hpp" - -#include "cru/platform/gui/Base.hpp" -#include "cru/platform/gui/UiApplication.hpp" - -#include <memory> - -namespace cru::platform::graphics::win::direct { -class DirectGraphicsFactory; -} - -namespace cru::platform::gui::win { -class CRU_WIN_GUI_API WinUiApplication : public WinNativeResource, - public virtual IUiApplication { - public: - static WinUiApplication* GetInstance() { return instance; } - - private: - static WinUiApplication* instance; - - public: - WinUiApplication(); - - CRU_DELETE_COPY(WinUiApplication) - CRU_DELETE_MOVE(WinUiApplication) - - ~WinUiApplication() override; - - public: - int Run() override; - void RequestQuit(int quit_code) override; - - void AddOnQuitHandler(std::function<void()> handler) override; - - bool IsQuitOnAllWindowClosed() override { - return is_quit_on_all_window_closed_; - } - void SetQuitOnAllWindowClosed(bool quit_on_all_window_closed) override { - is_quit_on_all_window_closed_ = quit_on_all_window_closed; - } - - long long SetImmediate(std::function<void()> action) override; - long long SetTimeout(std::chrono::milliseconds milliseconds, - std::function<void()> action) override; - long long SetInterval(std::chrono::milliseconds milliseconds, - std::function<void()> action) override; - void CancelTimer(long long id) override; - - std::vector<INativeWindow*> GetAllWindow() override; - INativeWindow* CreateWindow() override; - - cru::platform::graphics::IGraphicsFactory* GetGraphicsFactory() override; - - cru::platform::graphics::win::direct::DirectGraphicsFactory* - GetDirectFactory() { - return graph_factory_.get(); - } - - ICursorManager* GetCursorManager() override; - - IClipboard* GetClipboard() override; - - HINSTANCE GetInstanceHandle() const { return instance_handle_; } - - GodWindow* GetGodWindow() const { return god_window_.get(); } - TimerManager* GetTimerManager() const { return timer_manager_.get(); } - WindowManager* GetWindowManager() const { return window_manager_.get(); } - - private: - HINSTANCE instance_handle_; - - bool is_quit_on_all_window_closed_ = true; - - std::unique_ptr<cru::platform::graphics::win::direct::DirectGraphicsFactory> - graph_factory_; - - std::unique_ptr<GodWindow> god_window_; - std::unique_ptr<TimerManager> timer_manager_; - std::unique_ptr<WindowManager> window_manager_; - - std::unique_ptr<WinCursorManager> cursor_manager_; - std::unique_ptr<WinClipboard> clipboard_; - - std::vector<std::function<void()>> quit_handlers_; -}; -} // namespace cru::platform::gui::win |