mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-10-21 01:11:51 +00:00
@@ -2,11 +2,18 @@
|
||||
|
||||
#include "../defines.hpp"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#define RESOURCE_OR_BAIL(resname) \
|
||||
const auto resname = (CWaylandResource*)wl_resource_get_user_data(resource); \
|
||||
if (!resname) \
|
||||
return;
|
||||
|
||||
#define SP std::shared_ptr
|
||||
#define UP std::unique_ptr
|
||||
|
||||
#define PROTO NProtocols
|
||||
|
||||
class CWaylandResource {
|
||||
public:
|
||||
CWaylandResource(wl_client* client, const wl_interface* wlInterface, uint32_t version, uint32_t id);
|
||||
@@ -24,12 +31,15 @@ class CWaylandResource {
|
||||
void* data();
|
||||
void setData(void* data);
|
||||
|
||||
void setOnDestroyHandler(std::function<void(CWaylandResource* res)> fn);
|
||||
|
||||
private:
|
||||
bool m_bImplementationSet = false;
|
||||
bool m_bDefunct = false; // m_liResourceDestroy fired
|
||||
wl_client* m_pWLClient = nullptr;
|
||||
wl_resource* m_pWLResource = nullptr;
|
||||
void* m_pData = nullptr;
|
||||
bool m_bImplementationSet = false;
|
||||
bool m_bDefunct = false; // m_liResourceDestroy fired
|
||||
wl_client* m_pWLClient = nullptr;
|
||||
wl_resource* m_pWLResource = nullptr;
|
||||
void* m_pData = nullptr;
|
||||
std::function<void(CWaylandResource* res)> m_fOnDestroyHandler;
|
||||
};
|
||||
|
||||
class IWaylandProtocol {
|
||||
|
Reference in New Issue
Block a user