diff options
author | crupest <crupest@outlook.com> | 2020-10-28 21:28:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-10-28 21:28:15 +0800 |
commit | df4df679e157f974773dad7776b204e9d4f3009e (patch) | |
tree | bbc1e939a6e7cf38c2b982ad071e145e3f583caa /include/cru/ui/WindowHost.hpp | |
parent | 6ce70ed4b08c7db20b6b384be26c7fc4e11c98de (diff) | |
download | cru-df4df679e157f974773dad7776b204e9d4f3009e.tar.gz cru-df4df679e157f974773dad7776b204e9d4f3009e.tar.bz2 cru-df4df679e157f974773dad7776b204e9d4f3009e.zip |
...
Diffstat (limited to 'include/cru/ui/WindowHost.hpp')
-rw-r--r-- | include/cru/ui/WindowHost.hpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/include/cru/ui/WindowHost.hpp b/include/cru/ui/WindowHost.hpp index 64116590..83ef2f64 100644 --- a/include/cru/ui/WindowHost.hpp +++ b/include/cru/ui/WindowHost.hpp @@ -8,30 +8,6 @@ namespace cru::ui { struct AfterLayoutEventArgs {}; - -// The host of all controls and render objects. -// -// 3 situations on destroy: -// 1. Native window destroyed, IsRetainAfterDestroy: false: -// OnNativeDestroy(set native_window_destroyed_ to true, call ~Window due to -// deleting_ is false and IsRetainAfterDestroy is false) -> ~Window -> -// ~WindowHost(not destroy native window repeatedly due to native_window_destroyed_ -// is true) -// 2. Native window destroyed, IsRetainAfterDestroy: true: -// OnNativeDestroy(set native_window_destroyed_ to true, not call ~Window -// because deleting_ is false and IsRetainAfterDestroy is true) -// then, ~Window -> ~WindowHost(not destroy native window repeatedly due to -// native_window_destroyed_ is true) -// 3. Native window not destroyed, ~Window is called: -// ~Window -> ~WindowHost(set deleting_ to true, destroy native window -// due to native_window_destroyed is false) -> OnNativeDestroy(not call ~Window -// due to deleting_ is true and IsRetainAfterDestroy is whatever) -// In conclusion: -// 1. Set native_window_destroyed_ to true at the beginning of OnNativeDestroy. -// 2. Set deleting_ to true at the beginning of ~WindowHost. -// 3. Destroy native window when native_window_destroy_ is false in ~Window. -// 4. Delete Window when deleting_ is false and IsRetainAfterDestroy is false in -// OnNativeDestroy. class WindowHost : public Object, public SelfResolvable<WindowHost> { CRU_DEFINE_CLASS_LOG_TAG(u"cru::ui::WindowHost") |