#pragma once #include "../defines.hpp" #include #include "WLSurface.hpp" class CPopup; class CWLSubsurfaceResource; class CSubsurface { public: // root dummy nodes CSubsurface(PHLWINDOW pOwner); CSubsurface(CPopup* pOwner); // real nodes CSubsurface(SP pSubsurface, PHLWINDOW pOwner); CSubsurface(SP pSubsurface, CPopup* pOwner); ~CSubsurface(); Vector2D coordsRelativeToParent(); Vector2D coordsGlobal(); Vector2D size(); void onCommit(); void onDestroy(); void onNewSubsurface(SP pSubsurface); void onMap(); void onUnmap(); bool visible(); void recheckDamageForSubsurfaces(); private: 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 CSubsurface* m_pParent = nullptr; PHLWINDOWREF m_pWindowParent; CPopup* m_pPopupParent = nullptr; std::vector> m_vChildren; bool m_bInert = false; void initSignals(); void initExistingSubsurfaces(SP pSurface); void checkSiblingDamage(); };