2024-02-29 01:03:28 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
|
|
|
#include <vector>
|
|
|
|
#include "WLSurface.hpp"
|
|
|
|
|
2024-02-29 15:26:02 +01:00
|
|
|
class CPopup;
|
2024-02-29 01:03:28 +01:00
|
|
|
|
|
|
|
class CSubsurface {
|
|
|
|
public:
|
|
|
|
// root dummy nodes
|
2024-04-27 13:43:12 +02:00
|
|
|
CSubsurface(PHLWINDOW pOwner);
|
2024-02-29 15:26:02 +01:00
|
|
|
CSubsurface(CPopup* pOwner);
|
2024-02-29 01:03:28 +01:00
|
|
|
|
|
|
|
// real nodes
|
2024-04-27 13:43:12 +02:00
|
|
|
CSubsurface(wlr_subsurface* pSubsurface, PHLWINDOW pOwner);
|
2024-02-29 15:26:02 +01:00
|
|
|
CSubsurface(wlr_subsurface* pSubsurface, CPopup* pOwner);
|
2024-02-29 01:03:28 +01:00
|
|
|
|
|
|
|
~CSubsurface();
|
|
|
|
|
|
|
|
Vector2D coordsRelativeToParent();
|
|
|
|
Vector2D coordsGlobal();
|
|
|
|
|
2024-02-29 16:07:11 +01:00
|
|
|
Vector2D size();
|
|
|
|
|
2024-02-29 01:03:28 +01:00
|
|
|
void onCommit();
|
|
|
|
void onDestroy();
|
|
|
|
void onNewSubsurface(wlr_subsurface* pSubsurface);
|
|
|
|
void onMap();
|
|
|
|
void onUnmap();
|
|
|
|
|
2024-05-05 00:46:10 +02:00
|
|
|
bool visible();
|
|
|
|
|
2024-02-29 01:03:28 +01:00
|
|
|
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;
|
|
|
|
|
2024-04-27 13:43:12 +02:00
|
|
|
PHLWINDOWREF m_pWindowParent;
|
|
|
|
CPopup* m_pPopupParent = nullptr;
|
2024-02-29 01:03:28 +01:00
|
|
|
|
|
|
|
std::vector<std::unique_ptr<CSubsurface>> m_vChildren;
|
|
|
|
|
2024-02-29 15:26:02 +01:00
|
|
|
bool m_bInert = false;
|
|
|
|
|
2024-02-29 01:03:28 +01:00
|
|
|
void initSignals();
|
2024-04-06 04:09:20 +02:00
|
|
|
void initExistingSubsurfaces(wlr_surface* pSurface);
|
2024-02-29 01:03:28 +01:00
|
|
|
void checkSiblingDamage();
|
|
|
|
};
|