#pragma once #include "xdg-output-unstable-v1.hpp" #include "WaylandProtocol.hpp" #include class CMonitor; class CXDGOutputProtocol; class CXDGOutput { public: CXDGOutput(SP resource, CMonitor* monitor_); void sendDetails(); private: CMonitor* monitor = nullptr; SP resource; std::optional overridePosition; wl_client* client = nullptr; bool isXWayland = false; friend class CXDGOutputProtocol; }; class CXDGOutputProtocol : public IWaylandProtocol { public: CXDGOutputProtocol(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); void onManagerResourceDestroy(wl_resource* res); void onOutputResourceDestroy(wl_resource* res); void onManagerGetXDGOutput(CZxdgOutputManagerV1* mgr, uint32_t id, wl_resource* outputResource); private: void updateAllOutputs(); std::vector> m_vManagerResources; std::vector> m_vXDGOutputs; }; namespace PROTO { inline UP xdgOutput; };