summaryrefslogtreecommitdiff
path: root/src/desktop/Subsurface.hpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-01-26 12:54:32 +0000
committerVaxry <vaxry@vaxry.net>2025-01-26 12:54:38 +0000
commit0a28e13787a83a48cbca9641a02b8ea4857c733c (patch)
tree3bcb22dd6d477e62748727a246e97c24de524003 /src/desktop/Subsurface.hpp
parent3cd6e3960f0cbf500786497017ff3084cc9deb17 (diff)
desktop: move desktop types to memory-safe pointers
Diffstat (limited to 'src/desktop/Subsurface.hpp')
-rw-r--r--src/desktop/Subsurface.hpp30
1 files changed, 16 insertions, 14 deletions
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<CPopup> pOwner);
// real nodes
CSubsurface(SP<CWLSubsurfaceResource> pSubsurface, PHLWINDOW pOwner);
- CSubsurface(SP<CWLSubsurfaceResource> pSubsurface, CPopup* pOwner);
+ CSubsurface(SP<CWLSubsurfaceResource> pSubsurface, WP<CPopup> pOwner);
~CSubsurface();
- Vector2D coordsRelativeToParent();
- Vector2D coordsGlobal();
+ Vector2D coordsRelativeToParent();
+ Vector2D coordsGlobal();
- Vector2D size();
+ Vector2D size();
- void onCommit();
- void onDestroy();
- void onNewSubsurface(SP<CWLSubsurfaceResource> pSubsurface);
- void onMap();
- void onUnmap();
+ void onCommit();
+ void onDestroy();
+ void onNewSubsurface(SP<CWLSubsurfaceResource> pSubsurface);
+ void onMap();
+ void onUnmap();
- bool visible();
+ bool visible();
- void recheckDamageForSubsurfaces();
+ void recheckDamageForSubsurfaces();
+
+ WP<CSubsurface> 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<CSubsurface> m_pParent;
PHLWINDOWREF m_pWindowParent;
- CPopup* m_pPopupParent = nullptr;
+ WP<CPopup> m_pPopupParent;
std::vector<UP<CSubsurface>> m_vChildren;