aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/native/ui_application.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-12 23:26:04 +0800
committercrupest <crupest@outlook.com>2019-12-12 23:26:04 +0800
commitf2aa96fba0b72eeeadf5160ea5df2c8143ec8aa0 (patch)
treeb045d35bb2cf7281ab69abbd51302c85ea9ec3ef /include/cru/platform/native/ui_application.hpp
parent02f46ada9ef85165759f5e58d665510077149ef3 (diff)
downloadcru-f2aa96fba0b72eeeadf5160ea5df2c8143ec8aa0.tar.gz
cru-f2aa96fba0b72eeeadf5160ea5df2c8143ec8aa0.tar.bz2
cru-f2aa96fba0b72eeeadf5160ea5df2c8143ec8aa0.zip
...
Diffstat (limited to 'include/cru/platform/native/ui_application.hpp')
-rw-r--r--include/cru/platform/native/ui_application.hpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/include/cru/platform/native/ui_application.hpp b/include/cru/platform/native/ui_application.hpp
index 6d2ab659..c1f10d15 100644
--- a/include/cru/platform/native/ui_application.hpp
+++ b/include/cru/platform/native/ui_application.hpp
@@ -1,30 +1,21 @@
#pragma once
-#include "../native_resource.hpp"
+#include "../resource.hpp"
#include <chrono>
#include <functional>
#include <vector>
+namespace cru::platform::graph {
+struct IGraphFactory;
+}
+
namespace cru::platform::native {
struct INativeWindow;
struct ICursorManager;
// The entry point of a ui application.
-// It will call IGraphFactory::CreateInstance during its creation
-// and set graph factory to be auto deleted. If you want to keep
-// the graph factory then you should manually set it to false after
-// creating the ui application.
struct IUiApplication : public virtual INativeResource {
public:
- // Create a platform-specific instance and save it as the global instance.
- // Do not create the instance twice. Implements should assert for that.
- // After creating, get the instance by GetInstance.
- static IUiApplication* CreateInstance();
-
- // Get the global instance. If it is not created, then return nullptr.
- static IUiApplication* GetInstance();
-
- public:
// Block current thread and run the message loop. Return the exit code when
// message loop gets a quit message (possibly posted by method RequestQuit).
virtual int Run() = 0;
@@ -44,6 +35,8 @@ struct IUiApplication : public virtual INativeResource {
virtual std::vector<INativeWindow*> GetAllWindow() = 0;
virtual INativeWindow* CreateWindow(INativeWindow* parent) = 0;
+ virtual cru::platform::graph::IGraphFactory* GetGraphFactory() = 0;
+
virtual ICursorManager* GetCursorManager() = 0;
};
} // namespace cru::platform::native