2023-07-18 15:30:28 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
|
|
|
|
2024-04-19 23:16:35 +02:00
|
|
|
#include <functional>
|
|
|
|
|
2023-08-21 19:36:09 +02:00
|
|
|
#define RESOURCE_OR_BAIL(resname) \
|
|
|
|
const auto resname = (CWaylandResource*)wl_resource_get_user_data(resource); \
|
|
|
|
if (!resname) \
|
|
|
|
return;
|
|
|
|
|
2024-04-19 23:16:35 +02:00
|
|
|
#define SP std::shared_ptr
|
|
|
|
#define UP std::unique_ptr
|
|
|
|
|
|
|
|
#define PROTO NProtocols
|
|
|
|
|
2023-08-07 13:35:19 +02:00
|
|
|
class IWaylandProtocol {
|
2023-07-18 15:30:28 +02:00
|
|
|
public:
|
|
|
|
IWaylandProtocol(const wl_interface* iface, const int& ver, const std::string& name);
|
|
|
|
~IWaylandProtocol();
|
|
|
|
|
|
|
|
virtual void onDisplayDestroy();
|
|
|
|
|
2023-08-07 13:35:19 +02:00
|
|
|
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) = 0;
|
2023-07-18 15:30:28 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
wl_global* m_pGlobal = nullptr;
|
|
|
|
wl_listener m_liDisplayDestroy;
|
|
|
|
};
|