summaryrefslogtreecommitdiff
path: root/src/protocols/XDGDecoration.cpp
diff options
context:
space:
mode:
authordavc0n <dconti.dev@gmail.com>2025-05-04 23:39:00 +0200
committerGitHub <noreply@github.com>2025-05-04 23:39:00 +0200
commit9cd5b257459a6b4c5d5d4d1026df85f0ecbe5a93 (patch)
treec1ec209a122a10ab637ba62da5eabb0fea0d1568 /src/protocols/XDGDecoration.cpp
parent78ff20ddf03166c7fa769419b7c2861db89f412b (diff)
protocols: refactor class member vars (u-z) (#10282)
* protocols: refactor class member vars (u-z) * protocols: fix clang format
Diffstat (limited to 'src/protocols/XDGDecoration.cpp')
-rw-r--r--src/protocols/XDGDecoration.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/protocols/XDGDecoration.cpp b/src/protocols/XDGDecoration.cpp
index f9dbf411..b093fbb8 100644
--- a/src/protocols/XDGDecoration.cpp
+++ b/src/protocols/XDGDecoration.cpp
@@ -1,14 +1,14 @@
#include "XDGDecoration.hpp"
#include <algorithm>
-CXDGDecoration::CXDGDecoration(SP<CZxdgToplevelDecorationV1> resource_, wl_resource* toplevel) : resource(resource_), pToplevelResource(toplevel) {
- if UNLIKELY (!resource->resource())
+CXDGDecoration::CXDGDecoration(SP<CZxdgToplevelDecorationV1> resource_, wl_resource* toplevel) : m_resource(resource_), m_toplevelResource(toplevel) {
+ if UNLIKELY (!m_resource->resource())
return;
- resource->setDestroy([this](CZxdgToplevelDecorationV1* pMgr) { PROTO::xdgDecoration->destroyDecoration(this); });
- resource->setOnDestroy([this](CZxdgToplevelDecorationV1* pMgr) { PROTO::xdgDecoration->destroyDecoration(this); });
+ m_resource->setDestroy([this](CZxdgToplevelDecorationV1* pMgr) { PROTO::xdgDecoration->destroyDecoration(this); });
+ m_resource->setOnDestroy([this](CZxdgToplevelDecorationV1* pMgr) { PROTO::xdgDecoration->destroyDecoration(this); });
- resource->setSetMode([this](CZxdgToplevelDecorationV1*, zxdgToplevelDecorationV1Mode mode) {
+ m_resource->setSetMode([this](CZxdgToplevelDecorationV1*, zxdgToplevelDecorationV1Mode mode) {
std::string modeString;
switch (mode) {
case ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE: modeString = "MODE_CLIENT_SIDE"; break;
@@ -17,23 +17,23 @@ CXDGDecoration::CXDGDecoration(SP<CZxdgToplevelDecorationV1> resource_, wl_resou
}
LOGM(LOG, "setMode: {}. {} MODE_SERVER_SIDE as reply.", modeString, (mode == ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE ? "Sending" : "Ignoring and sending"));
- resource->sendConfigure(ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
+ m_resource->sendConfigure(ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
});
- resource->setUnsetMode([this](CZxdgToplevelDecorationV1*) {
+ m_resource->setUnsetMode([this](CZxdgToplevelDecorationV1*) {
LOGM(LOG, "unsetMode. Sending MODE_SERVER_SIDE.");
- resource->sendConfigure(ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
+ m_resource->sendConfigure(ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
});
- resource->sendConfigure(ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
+ m_resource->sendConfigure(ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
}
bool CXDGDecoration::good() {
- return resource->resource();
+ return m_resource->resource();
}
wl_resource* CXDGDecoration::toplevelResource() {
- return pToplevelResource;
+ return m_toplevelResource;
}
CXDGDecorationProtocol::CXDGDecorationProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
@@ -41,7 +41,7 @@ CXDGDecorationProtocol::CXDGDecorationProtocol(const wl_interface* iface, const
}
void CXDGDecorationProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
- const auto RESOURCE = m_vManagers.emplace_back(makeUnique<CZxdgDecorationManagerV1>(client, ver, id)).get();
+ const auto RESOURCE = m_managers.emplace_back(makeUnique<CZxdgDecorationManagerV1>(client, ver, id)).get();
RESOURCE->setOnDestroy([this](CZxdgDecorationManagerV1* p) { this->onManagerResourceDestroy(p->resource()); });
RESOURCE->setDestroy([this](CZxdgDecorationManagerV1* pMgr) { this->onManagerResourceDestroy(pMgr->resource()); });
@@ -49,26 +49,26 @@ void CXDGDecorationProtocol::bindManager(wl_client* client, void* data, uint32_t
}
void CXDGDecorationProtocol::onManagerResourceDestroy(wl_resource* res) {
- std::erase_if(m_vManagers, [&](const auto& other) { return other->resource() == res; });
+ std::erase_if(m_managers, [&](const auto& other) { return other->resource() == res; });
}
void CXDGDecorationProtocol::destroyDecoration(CXDGDecoration* decoration) {
- m_mDecorations.erase(decoration->toplevelResource());
+ m_decorations.erase(decoration->toplevelResource());
}
void CXDGDecorationProtocol::onGetDecoration(CZxdgDecorationManagerV1* pMgr, uint32_t id, wl_resource* xdgToplevel) {
- if UNLIKELY (m_mDecorations.contains(xdgToplevel)) {
+ if UNLIKELY (m_decorations.contains(xdgToplevel)) {
pMgr->error(ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ALREADY_CONSTRUCTED, "Decoration object already exists");
return;
}
const auto CLIENT = pMgr->client();
const auto RESOURCE =
- m_mDecorations.emplace(xdgToplevel, makeUnique<CXDGDecoration>(makeShared<CZxdgToplevelDecorationV1>(CLIENT, pMgr->version(), id), xdgToplevel)).first->second.get();
+ m_decorations.emplace(xdgToplevel, makeUnique<CXDGDecoration>(makeShared<CZxdgToplevelDecorationV1>(CLIENT, pMgr->version(), id), xdgToplevel)).first->second.get();
if UNLIKELY (!RESOURCE->good()) {
pMgr->noMemory();
- m_mDecorations.erase(xdgToplevel);
+ m_decorations.erase(xdgToplevel);
return;
}
} \ No newline at end of file