mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-05 14:45:58 +01:00
38 lines
No EOL
921 B
C++
38 lines
No EOL
921 B
C++
#pragma once
|
|
|
|
#include "../includes.hpp"
|
|
#include <functional>
|
|
|
|
class CHyprWLListener {
|
|
public:
|
|
CHyprWLListener(wl_signal*, std::function<void(void*, void*)>, void* owner);
|
|
CHyprWLListener();
|
|
~CHyprWLListener();
|
|
|
|
CHyprWLListener(const CHyprWLListener&) = delete;
|
|
CHyprWLListener(CHyprWLListener&&) = delete;
|
|
CHyprWLListener& operator=(const CHyprWLListener&) = delete;
|
|
CHyprWLListener& operator=(CHyprWLListener&&) = delete;
|
|
|
|
void initCallback(wl_signal*, std::function<void(void*, void*)>, void* owner, std::string author = "");
|
|
|
|
void removeCallback();
|
|
|
|
bool isConnected();
|
|
|
|
struct SWrapper {
|
|
wl_listener m_sListener;
|
|
CHyprWLListener* m_pSelf;
|
|
};
|
|
|
|
void emit(void*);
|
|
|
|
private:
|
|
SWrapper m_swWrapper;
|
|
|
|
void* m_pOwner = nullptr;
|
|
|
|
std::function<void(void*, void*)> m_pCallback = nullptr;
|
|
|
|
std::string m_szAuthor = "";
|
|
}; |