summaryrefslogtreecommitdiff
path: root/src/protocols/XWaylandShell.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/XWaylandShell.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/XWaylandShell.cpp')
-rw-r--r--src/protocols/XWaylandShell.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/protocols/XWaylandShell.cpp b/src/protocols/XWaylandShell.cpp
index b4615e19..9bb75a3e 100644
--- a/src/protocols/XWaylandShell.cpp
+++ b/src/protocols/XWaylandShell.cpp
@@ -2,24 +2,24 @@
#include "core/Compositor.hpp"
#include <algorithm>
-CXWaylandSurfaceResource::CXWaylandSurfaceResource(SP<CXwaylandSurfaceV1> resource_, SP<CWLSurfaceResource> surface_) : surface(surface_), resource(resource_) {
+CXWaylandSurfaceResource::CXWaylandSurfaceResource(SP<CXwaylandSurfaceV1> resource_, SP<CWLSurfaceResource> surface_) : m_surface(surface_), m_resource(resource_) {
if UNLIKELY (!good())
return;
- resource->setDestroy([this](CXwaylandSurfaceV1* r) {
+ m_resource->setDestroy([this](CXwaylandSurfaceV1* r) {
events.destroy.emit();
PROTO::xwaylandShell->destroyResource(this);
});
- resource->setOnDestroy([this](CXwaylandSurfaceV1* r) {
+ m_resource->setOnDestroy([this](CXwaylandSurfaceV1* r) {
events.destroy.emit();
PROTO::xwaylandShell->destroyResource(this);
});
- pClient = resource->client();
+ m_client = m_resource->client();
- resource->setSetSerial([this](CXwaylandSurfaceV1* r, uint32_t lo, uint32_t hi) {
- serial = (((uint64_t)hi) << 32) + lo;
- PROTO::xwaylandShell->events.newSurface.emit(self.lock());
+ m_resource->setSetSerial([this](CXwaylandSurfaceV1* r, uint32_t lo, uint32_t hi) {
+ m_serial = (((uint64_t)hi) << 32) + lo;
+ PROTO::xwaylandShell->m_events.newSurface.emit(m_self.lock());
});
}
@@ -28,36 +28,36 @@ CXWaylandSurfaceResource::~CXWaylandSurfaceResource() {
}
bool CXWaylandSurfaceResource::good() {
- return resource->resource();
+ return m_resource->resource();
}
wl_client* CXWaylandSurfaceResource::client() {
- return pClient;
+ return m_client;
}
-CXWaylandShellResource::CXWaylandShellResource(SP<CXwaylandShellV1> resource_) : resource(resource_) {
+CXWaylandShellResource::CXWaylandShellResource(SP<CXwaylandShellV1> resource_) : m_resource(resource_) {
if UNLIKELY (!good())
return;
- resource->setDestroy([this](CXwaylandShellV1* r) { PROTO::xwaylandShell->destroyResource(this); });
- resource->setOnDestroy([this](CXwaylandShellV1* r) { PROTO::xwaylandShell->destroyResource(this); });
+ m_resource->setDestroy([this](CXwaylandShellV1* r) { PROTO::xwaylandShell->destroyResource(this); });
+ m_resource->setOnDestroy([this](CXwaylandShellV1* r) { PROTO::xwaylandShell->destroyResource(this); });
- resource->setGetXwaylandSurface([](CXwaylandShellV1* r, uint32_t id, wl_resource* surface) {
- const auto RESOURCE = PROTO::xwaylandShell->m_vSurfaces.emplace_back(
+ m_resource->setGetXwaylandSurface([](CXwaylandShellV1* r, uint32_t id, wl_resource* surface) {
+ const auto RESOURCE = PROTO::xwaylandShell->m_surfaces.emplace_back(
makeShared<CXWaylandSurfaceResource>(makeShared<CXwaylandSurfaceV1>(r->client(), r->version(), id), CWLSurfaceResource::fromResource(surface)));
if UNLIKELY (!RESOURCE->good()) {
r->noMemory();
- PROTO::xwaylandShell->m_vSurfaces.pop_back();
+ PROTO::xwaylandShell->m_surfaces.pop_back();
return;
}
- RESOURCE->self = RESOURCE;
+ RESOURCE->m_self = RESOURCE;
});
}
bool CXWaylandShellResource::good() {
- return resource->resource();
+ return m_resource->resource();
}
CXWaylandShellProtocol::CXWaylandShellProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
@@ -65,19 +65,19 @@ CXWaylandShellProtocol::CXWaylandShellProtocol(const wl_interface* iface, const
}
void CXWaylandShellProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
- const auto RESOURCE = m_vManagers.emplace_back(makeShared<CXWaylandShellResource>(makeShared<CXwaylandShellV1>(client, ver, id)));
+ const auto RESOURCE = m_managers.emplace_back(makeShared<CXWaylandShellResource>(makeShared<CXwaylandShellV1>(client, ver, id)));
if UNLIKELY (!RESOURCE->good()) {
wl_client_post_no_memory(client);
- m_vManagers.pop_back();
+ m_managers.pop_back();
return;
}
}
void CXWaylandShellProtocol::destroyResource(CXWaylandShellResource* resource) {
- std::erase_if(m_vManagers, [&](const auto& other) { return other.get() == resource; });
+ std::erase_if(m_managers, [&](const auto& other) { return other.get() == resource; });
}
void CXWaylandShellProtocol::destroyResource(CXWaylandSurfaceResource* resource) {
- std::erase_if(m_vSurfaces, [&](const auto& other) { return other.get() == resource; });
+ std::erase_if(m_surfaces, [&](const auto& other) { return other.get() == resource; });
}