Hyprland/src/helpers/WLListener.hpp

30 lines
636 B
C++
Raw Normal View History

2022-03-28 22:31:39 +02:00
#pragma once
#include "../includes.hpp"
#include <functional>
class CHyprWLListener {
public:
CHyprWLListener(wl_signal*, std::function<void(void*, void*)>, void* owner);
CHyprWLListener();
~CHyprWLListener();
void initCallback(wl_signal*, std::function<void(void*, void*)>, void* owner, std::string author = "");
void removeCallback();
bool isConnected();
wl_listener m_sListener;
void emit(void*);
private:
bool m_bIsConnected = false;
void* m_pOwner = nullptr;
std::function<void(void*, void*)> m_pCallback = nullptr;
std::string m_szAuthor = "";
};