diff options
author | crupest <crupest@outlook.com> | 2020-11-09 18:28:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-11-09 18:28:33 +0800 |
commit | ddc6d6478f849ef10b832bc8b1d8ab7fe9454601 (patch) | |
tree | fe1fd08653d97a625d75040d5451081079f404f5 /include/cru/ui/host | |
parent | 349b26d350d46fd6c48c6895ee9d8ef81add1315 (diff) | |
download | cru-ddc6d6478f849ef10b832bc8b1d8ab7fe9454601.tar.gz cru-ddc6d6478f849ef10b832bc8b1d8ab7fe9454601.tar.bz2 cru-ddc6d6478f849ef10b832bc8b1d8ab7fe9454601.zip |
...
Diffstat (limited to 'include/cru/ui/host')
-rw-r--r-- | include/cru/ui/host/WindowHost.hpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/cru/ui/host/WindowHost.hpp b/include/cru/ui/host/WindowHost.hpp index 6d338df1..9fc24eb2 100644 --- a/include/cru/ui/host/WindowHost.hpp +++ b/include/cru/ui/host/WindowHost.hpp @@ -28,8 +28,7 @@ class WindowHost : public Object { CRU_DEFINE_CLASS_LOG_TAG(u"cru::ui::host::WindowHost") public: - WindowHost(controls::Control* root_control, - CreateWindowParams create_window_params = {}); + WindowHost(controls::Control* root_control); CRU_DELETE_COPY(WindowHost) CRU_DELETE_MOVE(WindowHost) @@ -39,6 +38,10 @@ class WindowHost : public Object { public: platform::gui::INativeWindow* GetNativeWindow() { return native_window_; } + // Do nothing if native window is already created. + gsl::not_null<platform::gui::INativeWindow*> CreateNativeWindow( + CreateWindowParams create_window_params = {}); + // Mark the layout as invalid, and arrange a re-layout later. // This method could be called more than one times in a message cycle. But // layout only takes place once. @@ -102,6 +105,10 @@ class WindowHost : public Object { void UpdateCursor(); + IEvent<platform::gui::INativeWindow*>* NativeWindowChangeEvent() { + return &native_window_change_event_; + } + private: //*************** region: native messages *************** void OnNativeDestroy(platform::gui::INativeWindow* window, std::nullptr_t); @@ -152,5 +159,7 @@ class WindowHost : public Object { controls::Control* mouse_captured_control_ = nullptr; bool layout_prefer_to_fill_window_ = true; + + Event<platform::gui::INativeWindow*> native_window_change_event_; }; } // namespace cru::ui::host |