diff options
author | crupest <crupest@outlook.com> | 2021-09-28 17:49:09 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-09-28 17:49:09 +0800 |
commit | f626ebce8fcbe8f06bd7d459efbc0c21ba6477c7 (patch) | |
tree | 74dfd06b70dc650c5fc756f6efb693cd0a2058cd /include | |
parent | 9a42f6fd709feaa9e9e3cc4530c67e2a237d5bee (diff) | |
download | cru-f626ebce8fcbe8f06bd7d459efbc0c21ba6477c7.tar.gz cru-f626ebce8fcbe8f06bd7d459efbc0c21ba6477c7.tar.bz2 cru-f626ebce8fcbe8f06bd7d459efbc0c21ba6477c7.zip |
...
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/osx/gui/UiApplication.hpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/include/cru/osx/gui/UiApplication.hpp b/include/cru/osx/gui/UiApplication.hpp index e69de29b..abe5780a 100644 --- a/include/cru/osx/gui/UiApplication.hpp +++ b/include/cru/osx/gui/UiApplication.hpp @@ -0,0 +1,49 @@ +#pragma once +#include "Resource.hpp" +#include "cru/platform/gui/UiApplication.hpp" + +#include <functional> +#include <memory> + +namespace cru::platform::gui::osx { +namespace details { +class OsxUiApplicationPrivate; +} + +class OsxUiApplication : public OsxGuiResource, public virtual IUiApplication { + friend details::OsxUiApplicationPrivate; + + public: + OsxUiApplication(); + + CRU_DELETE_COPY(OsxUiApplication) + CRU_DELETE_MOVE(OsxUiApplication) + + ~OsxUiApplication() override; + + public: + int Run() override; + + void RequestQuit(int quit_code) override; + void AddOnQuitHandler(std::function<void()> handler) override; + + 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(INativeWindow* parent, + CreateWindowFlag flags) override; + + cru::platform::graphics::IGraphicsFactory* GetGraphFactory() override; + + ICursorManager* GetCursorManager() override; + + private: + std::unique_ptr<details::OsxUiApplicationPrivate> p_; +}; +} // namespace cru::platform::gui::osx |