diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-27 17:25:20 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-27 17:25:20 +0200 |
| commit | ad36a9dc9ed032e6e34c06f78995bca0045f85b0 (patch) | |
| tree | 933cfc71255a9cfbe1211f187d7d101a4e30ffc8 /src/helpers/SubsurfaceTree.hpp | |
| parent | 4c3b9ae207967bf06b973cc6b49db58887f1af6b (diff) | |
rework popups completely
Diffstat (limited to 'src/helpers/SubsurfaceTree.hpp')
| -rw-r--r-- | src/helpers/SubsurfaceTree.hpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/helpers/SubsurfaceTree.hpp b/src/helpers/SubsurfaceTree.hpp new file mode 100644 index 00000000..df92033a --- /dev/null +++ b/src/helpers/SubsurfaceTree.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "../defines.hpp" +#include <list> + +struct SSubsurface; + +typedef void (*applyGlobalOffsetFn)(void *, int *, int *); + +struct SSurfaceTreeNode { + wlr_surface* pSurface = nullptr; + + DYNMULTILISTENER(newSubsurface); + DYNMULTILISTENER(commit); + DYNMULTILISTENER(destroy); + + SSurfaceTreeNode* pParent = nullptr; + SSubsurface* pSubsurface = nullptr; + + std::list<SSubsurface> childSubsurfaces; + + applyGlobalOffsetFn offsetfn; + void *globalOffsetData; + + bool operator==(const SSurfaceTreeNode& rhs) { + return pSurface == rhs.pSurface; + } +}; + +struct SSubsurface { + wlr_subsurface* pSubsurface = nullptr; + + SSurfaceTreeNode* pParent = nullptr; + SSurfaceTreeNode* pChild = nullptr; + + DYNMULTILISTENER(map); + DYNMULTILISTENER(unmap); + DYNMULTILISTENER(destroy); + + bool operator==(const SSubsurface& rhs) { + return pSubsurface == rhs.pSubsurface; + } +}; + +namespace SubsurfaceTree { + SSurfaceTreeNode* createTreeRoot(wlr_surface*, applyGlobalOffsetFn, void*); + void destroySurfaceTree(SSurfaceTreeNode*); + + inline std::list<SSurfaceTreeNode> surfaceTreeNodes; +}; |
