#pragma once #include #include #include #include "WaylandProtocol.hpp" #include "alpha-modifier-v1.hpp" #include "../helpers/signal/Signal.hpp" class CWLSurfaceResource; class CAlphaModifier { public: CAlphaModifier(SP resource_, SP surface); ~CAlphaModifier(); bool good(); SP getSurface(); void onSurfaceDestroy(); private: SP resource; WP pSurface; void setSurfaceAlpha(float a); struct { CHyprSignalListener destroySurface; } listeners; }; class CAlphaModifierProtocol : public IWaylandProtocol { public: CAlphaModifierProtocol(const wl_interface* iface, const int& ver, const std::string& name); virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id); private: void onManagerResourceDestroy(wl_resource* res); void destroyModifier(CAlphaModifier* decoration); void onGetSurface(CWpAlphaModifierV1* pMgr, uint32_t id, SP surface); // std::vector> m_vManagers; std::unordered_map, UP> m_mAlphaModifiers; // xdg_toplevel -> deco friend class CAlphaModifier; }; namespace PROTO { inline UP alphaModifier; };