mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 21:05:59 +01:00
98a4fa2b0d
* clang-format stuff and format files
38 lines
No EOL
1 KiB
C++
38 lines
No EOL
1 KiB
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 = "";
|
|
}; |