blob: 33a9b6630c6082bef0a1fd6623b7c37ba232cdf6 (
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
|
#pragma once
#include <vector>
#include <unordered_map>
#include "WaylandProtocol.hpp"
#include "xdg-decoration-unstable-v1.hpp"
class CXDGDecoration {
public:
CXDGDecoration(SP<CZxdgToplevelDecorationV1> resource_, wl_resource* toplevel);
bool good();
wl_resource* toplevelResource();
private:
SP<CZxdgToplevelDecorationV1> resource;
wl_resource* pToplevelResource = nullptr; // READ-ONLY.
};
class CXDGDecorationProtocol : public IWaylandProtocol {
public:
CXDGDecorationProtocol(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 onManagerResourceDestroy(wl_resource* res);
void destroyDecoration(CXDGDecoration* decoration);
void onGetDecoration(CZxdgDecorationManagerV1* pMgr, uint32_t id, wl_resource* xdgToplevel);
//
std::vector<UP<CZxdgDecorationManagerV1>> m_vManagers;
std::unordered_map<wl_resource*, UP<CXDGDecoration>> m_mDecorations; // xdg_toplevel -> deco
friend class CXDGDecoration;
};
namespace PROTO {
inline UP<CXDGDecorationProtocol> xdgDecoration;
};
|