#pragma once #include "../defines.hpp" #include #include "WLSurface.hpp" class CPopup; class CWLSubsurfaceResource; class CSubsurface { public: // root dummy nodes static UP create(PHLWINDOW pOwner); static UP create(WP pOwner); // real nodes static UP create(SP pSubsurface, PHLWINDOW pOwner); static UP create(SP pSubsurface, WP pOwner); ~CSubsurface() = default; Vector2D coordsRelativeToParent(); Vector2D coordsGlobal(); Vector2D size(); void onCommit(); void onDestroy(); void onNewSubsurface(SP pSubsurface); void onMap(); void onUnmap(); bool visible(); void recheckDamageForSubsurfaces(); WP m_pSelf; private: CSubsurface() = default; struct { CHyprSignalListener destroySubsurface; CHyprSignalListener commitSubsurface; CHyprSignalListener mapSubsurface; CHyprSignalListener unmapSubsurface; CHyprSignalListener newSubsurface; } listeners; WP m_pSubsurface; SP m_pWLSurface; Vector2D m_vLastSize = {}; // if nullptr, means it's a dummy node WP m_pParent; PHLWINDOWREF m_pWindowParent; WP m_pPopupParent; std::vector> m_vChildren; bool m_bInert = false; void initSignals(); void initExistingSubsurfaces(SP pSurface); void checkSiblingDamage(); };