diff options
author | Vaxry <[email protected]> | 2023-07-18 15:30:28 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-07-18 15:30:28 +0200 |
commit | 8370a7fcc4627e6f21395cc8b81298369be5cdaf (patch) | |
tree | 6be17dc7ba367ea7322d81f20b89b5cdf7defc4d /src/protocols/XDGOutput.hpp | |
parent | 629e61c7a56561ee5d565dda6d0d8b7c41dbe9c7 (diff) | |
download | Hyprland-8370a7fcc4627e6f21395cc8b81298369be5cdaf.tar.gz Hyprland-8370a7fcc4627e6f21395cc8b81298369be5cdaf.zip |
internal: Protocol C++ Wraps + XDGOutput impl (#2733)
move to our own xdgoutput impl instead of wlr's
Diffstat (limited to 'src/protocols/XDGOutput.hpp')
-rw-r--r-- | src/protocols/XDGOutput.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/protocols/XDGOutput.hpp b/src/protocols/XDGOutput.hpp new file mode 100644 index 00000000..13b7029c --- /dev/null +++ b/src/protocols/XDGOutput.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include "WaylandProtocol.hpp" + +class CMonitor; + +struct SXDGOutput { + CMonitor* monitor = nullptr; + std::unique_ptr<CWaylandResource> resource; + + wl_client* client = nullptr; + bool isXWayland = false; +}; + +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(wl_client* client, wl_resource* resource, uint32_t id, wl_resource* outputResource); + + private: + void updateOutputDetails(SXDGOutput* pOutput); + void updateAllOutputs(); + + std::vector<std::unique_ptr<CWaylandResource>> m_vManagerResources; + std::vector<std::unique_ptr<SXDGOutput>> m_vXDGOutputs; +};
\ No newline at end of file |