2022-03-27 17:25:20 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
struct SSubsurface;
|
2022-05-31 22:16:13 +02:00
|
|
|
class CWindow;
|
2022-03-27 17:25:20 +02:00
|
|
|
|
|
|
|
typedef void (*applyGlobalOffsetFn)(void *, int *, int *);
|
|
|
|
|
|
|
|
struct SSurfaceTreeNode {
|
|
|
|
wlr_surface* pSurface = nullptr;
|
|
|
|
|
2022-03-28 22:31:39 +02:00
|
|
|
DYNLISTENER(newSubsurface);
|
|
|
|
DYNLISTENER(commit);
|
|
|
|
DYNLISTENER(destroy);
|
2022-03-27 17:25:20 +02:00
|
|
|
|
|
|
|
SSurfaceTreeNode* pParent = nullptr;
|
|
|
|
SSubsurface* pSubsurface = nullptr;
|
|
|
|
|
|
|
|
std::list<SSubsurface> childSubsurfaces;
|
|
|
|
|
|
|
|
applyGlobalOffsetFn offsetfn;
|
|
|
|
void *globalOffsetData;
|
2022-05-31 22:16:13 +02:00
|
|
|
CWindow* pWindowOwner = nullptr;
|
2022-03-27 17:25:20 +02:00
|
|
|
|
|
|
|
bool operator==(const SSurfaceTreeNode& rhs) {
|
|
|
|
return pSurface == rhs.pSurface;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SSubsurface {
|
|
|
|
wlr_subsurface* pSubsurface = nullptr;
|
|
|
|
|
|
|
|
SSurfaceTreeNode* pParent = nullptr;
|
|
|
|
SSurfaceTreeNode* pChild = nullptr;
|
|
|
|
|
2022-03-28 22:31:39 +02:00
|
|
|
DYNLISTENER(map);
|
|
|
|
DYNLISTENER(unmap);
|
|
|
|
DYNLISTENER(destroy);
|
2022-03-27 17:25:20 +02:00
|
|
|
|
2022-05-31 22:16:13 +02:00
|
|
|
CWindow* pWindowOwner = nullptr;
|
|
|
|
|
2022-03-27 17:25:20 +02:00
|
|
|
bool operator==(const SSubsurface& rhs) {
|
|
|
|
return pSubsurface == rhs.pSubsurface;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace SubsurfaceTree {
|
2022-05-31 22:16:13 +02:00
|
|
|
SSurfaceTreeNode* createTreeRoot(wlr_surface*, applyGlobalOffsetFn, void*, CWindow* pWindow = nullptr);
|
2022-03-27 17:25:20 +02:00
|
|
|
void destroySurfaceTree(SSurfaceTreeNode*);
|
|
|
|
|
|
|
|
inline std::list<SSurfaceTreeNode> surfaceTreeNodes;
|
|
|
|
};
|