From 0a28e13787a83a48cbca9641a02b8ea4857c733c Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 26 Jan 2025 12:54:32 +0000 Subject: desktop: move desktop types to memory-safe pointers --- src/desktop/Subsurface.hpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/desktop/Subsurface.hpp') diff --git a/src/desktop/Subsurface.hpp b/src/desktop/Subsurface.hpp index aacbad91..f16a11ea 100644 --- a/src/desktop/Subsurface.hpp +++ b/src/desktop/Subsurface.hpp @@ -11,28 +11,30 @@ class CSubsurface { public: // root dummy nodes CSubsurface(PHLWINDOW pOwner); - CSubsurface(CPopup* pOwner); + CSubsurface(WP pOwner); // real nodes CSubsurface(SP pSubsurface, PHLWINDOW pOwner); - CSubsurface(SP pSubsurface, CPopup* pOwner); + CSubsurface(SP pSubsurface, WP pOwner); ~CSubsurface(); - Vector2D coordsRelativeToParent(); - Vector2D coordsGlobal(); + Vector2D coordsRelativeToParent(); + Vector2D coordsGlobal(); - Vector2D size(); + Vector2D size(); - void onCommit(); - void onDestroy(); - void onNewSubsurface(SP pSubsurface); - void onMap(); - void onUnmap(); + void onCommit(); + void onDestroy(); + void onNewSubsurface(SP pSubsurface); + void onMap(); + void onUnmap(); - bool visible(); + bool visible(); - void recheckDamageForSubsurfaces(); + void recheckDamageForSubsurfaces(); + + WP m_pSelf; private: struct { @@ -48,10 +50,10 @@ class CSubsurface { Vector2D m_vLastSize = {}; // if nullptr, means it's a dummy node - CSubsurface* m_pParent = nullptr; + WP m_pParent; PHLWINDOWREF m_pWindowParent; - CPopup* m_pPopupParent = nullptr; + WP m_pPopupParent; std::vector> m_vChildren; -- cgit v1.2.3