aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/host/WindowHost.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-03-29 12:24:06 +0800
committercrupest <crupest@outlook.com>2022-03-29 12:24:06 +0800
commit7a564d98db0b7c7be5b3bfac955cb88998a472ac (patch)
tree891abaf06a4e011a798c8daf5f063230ec67f995 /include/cru/ui/host/WindowHost.h
parent91695b78f565239223fc6f3a10b0219b8dc1b6f8 (diff)
downloadcru-7a564d98db0b7c7be5b3bfac955cb88998a472ac.tar.gz
cru-7a564d98db0b7c7be5b3bfac955cb88998a472ac.tar.bz2
cru-7a564d98db0b7c7be5b3bfac955cb88998a472ac.zip
...
Diffstat (limited to 'include/cru/ui/host/WindowHost.h')
-rw-r--r--include/cru/ui/host/WindowHost.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/cru/ui/host/WindowHost.h b/include/cru/ui/host/WindowHost.h
index d88482c4..0d2e0341 100644
--- a/include/cru/ui/host/WindowHost.h
+++ b/include/cru/ui/host/WindowHost.h
@@ -21,6 +21,14 @@ class CRU_UI_API WindowHost : public Object, public SelfResolvable<WindowHost> {
friend controls::Control;
CRU_DEFINE_CLASS_LOG_TAG(u"WindowHost")
+ private:
+ static int event_handling_depth_;
+
+ public:
+ static bool IsInEventHandling() { return event_handling_depth_ > 0; }
+ static void EnterEventHandling();
+ static void LeaveEventHandling();
+
public:
explicit WindowHost(controls::Control* root_control);
@@ -139,6 +147,8 @@ class CRU_UI_API WindowHost : public Object, public SelfResolvable<WindowHost> {
const Point& point, bool no_leave,
bool no_enter);
+ void OnControlDetach(controls::Control* control);
+
private:
controls::Control* root_control_ = nullptr;
render::RenderObject* root_render_object_ = nullptr;