blob: 5b143f79258e488cd9252bcc5cc59980c6d94489 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#pragma once
#include <vector>
#include <unordered_map>
#include "WaylandProtocol.hpp"
#include "fifo-v1.hpp"
#include "../helpers/signal/Signal.hpp"
class CWLSurfaceResource;
class CFifoResource {
public:
CFifoResource(UP<CWpFifoV1>&& resource_, SP<CWLSurfaceResource> surface);
~CFifoResource();
bool good();
private:
UP<CWpFifoV1> m_resource;
WP<CWLSurfaceResource> m_surface;
struct {
CHyprSignalListener surfaceStateCommit;
} m_listeners;
void presented();
bool checkMonitors(bool needsSchedule = false);
friend class CFifoProtocol;
friend class CFifoManagerResource;
};
class CFifoManagerResource {
public:
CFifoManagerResource(UP<CWpFifoManagerV1>&& resource_);
~CFifoManagerResource();
bool good();
private:
UP<CWpFifoManagerV1> m_resource;
};
class CFifoProtocol : public IWaylandProtocol {
public:
CFifoProtocol(const wl_interface* iface, const int& ver, const std::string& name);
virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id);
private:
void destroyResource(CFifoManagerResource* resource);
void destroyResource(CFifoResource* resource);
void onMonitorPresent(PHLMONITOR m);
//
std::vector<UP<CFifoManagerResource>> m_managers;
std::vector<UP<CFifoResource>> m_fifos;
friend class CFifoManagerResource;
friend class CFifoResource;
};
namespace PROTO {
inline UP<CFifoProtocol> fifo;
};
|