diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2023-07-18 15:30:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-18 15:30:28 +0200 |
| commit | 8370a7fcc4627e6f21395cc8b81298369be5cdaf (patch) | |
| tree | 6be17dc7ba367ea7322d81f20b89b5cdf7defc4d /src/protocols/WaylandProtocol.hpp | |
| parent | 629e61c7a56561ee5d565dda6d0d8b7c41dbe9c7 (diff) | |
internal: Protocol C++ Wraps + XDGOutput impl (#2733)
move to our own xdgoutput impl instead of wlr's
Diffstat (limited to 'src/protocols/WaylandProtocol.hpp')
| -rw-r--r-- | src/protocols/WaylandProtocol.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/protocols/WaylandProtocol.hpp b/src/protocols/WaylandProtocol.hpp new file mode 100644 index 00000000..04a58387 --- /dev/null +++ b/src/protocols/WaylandProtocol.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include "../defines.hpp" + +class CWaylandResource { + public: + CWaylandResource(wl_client* client, const wl_interface* wlInterface, uint32_t version, uint32_t id, bool destroyInDestructor = false); + ~CWaylandResource(); + + bool good(); + wl_resource* resource(); + uint32_t version(); + + void setImplementation(const void* impl, void* data, wl_resource_destroy_func_t df); + + private: + bool m_bDestroyInDestructor = false; + bool m_bImplementationSet = false; + wl_client* m_pWLClient = nullptr; + wl_resource* m_pWLResource = nullptr; +}; + +interface IWaylandProtocol { + public: + IWaylandProtocol(const wl_interface* iface, const int& ver, const std::string& name); + ~IWaylandProtocol(); + + virtual void onDisplayDestroy(); + + virtual void bindManager(wl_client * client, void* data, uint32_t ver, uint32_t id) = 0; + + private: + wl_global* m_pGlobal = nullptr; + wl_listener m_liDisplayDestroy; +};
\ No newline at end of file |
