summaryrefslogtreecommitdiff
path: root/src/desktop/Subsurface.hpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-29 13:03:38 +0000
committerVaxry <vaxry@vaxry.net>2024-02-29 13:03:38 +0000
commitb39dcfa497f84486569bf862092dfcfadbfd8747 (patch)
treec9f7a99c04ed6091ef79eea41a61d53dd04cc7cb /src/desktop/Subsurface.hpp
parent4bff762d9733ba7334cd37b995cf51552cc80be0 (diff)
refactor: move a few things to desktop/
Diffstat (limited to 'src/desktop/Subsurface.hpp')
-rw-r--r--src/desktop/Subsurface.hpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/desktop/Subsurface.hpp b/src/desktop/Subsurface.hpp
new file mode 100644
index 00000000..22692192
--- /dev/null
+++ b/src/desktop/Subsurface.hpp
@@ -0,0 +1,53 @@
+#pragma once
+
+#include "../defines.hpp"
+#include <vector>
+#include "WLSurface.hpp"
+
+class CWindow;
+struct SXDGPopup;
+
+class CSubsurface {
+ public:
+ // root dummy nodes
+ CSubsurface(CWindow* pOwner);
+
+ // real nodes
+ CSubsurface(wlr_subsurface* pSubsurface, CWindow* pOwner);
+
+ ~CSubsurface();
+
+ Vector2D coordsRelativeToParent();
+ Vector2D coordsGlobal();
+
+ void onCommit();
+ void onDestroy();
+ void onNewSubsurface(wlr_subsurface* pSubsurface);
+ void onMap();
+ void onUnmap();
+
+ void recheckDamageForSubsurfaces();
+
+ private:
+
+ DYNLISTENER(destroySubsurface);
+ DYNLISTENER(commitSubsurface);
+ DYNLISTENER(newSubsurface);
+ DYNLISTENER(mapSubsurface);
+ DYNLISTENER(unmapSubsurface);
+
+ wlr_subsurface* m_pSubsurface = nullptr;
+ CWLSurface m_sWLSurface;
+ Vector2D m_vLastSize = {};
+
+ // if nullptr, means it's a dummy node
+ CSubsurface* m_pParent = nullptr;
+
+ CWindow* m_pWindowParent = nullptr;
+
+ std::vector<std::unique_ptr<CSubsurface>> m_vChildren;
+
+ void initSignals();
+ void initExistingSubsurfaces();
+ void checkSiblingDamage();
+}; \ No newline at end of file