summaryrefslogtreecommitdiff
path: root/src/protocols/RelativePointer.cpp
diff options
context:
space:
mode:
authordavc0n <dconti.dev@gmail.com>2025-05-04 19:21:36 +0200
committerGitHub <noreply@github.com>2025-05-04 19:21:36 +0200
commit2626f89ea6fe0df585df28052bf1fcca2c50fe8e (patch)
tree6dd030f42e065e1a927ab907222e1efaf21b0bc1 /src/protocols/RelativePointer.cpp
parentadbae0f74d951e06c575bad3c81a944027dfe413 (diff)
protocols: refactor class member vars (n-t) (#10273)
Diffstat (limited to 'src/protocols/RelativePointer.cpp')
-rw-r--r--src/protocols/RelativePointer.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/protocols/RelativePointer.cpp b/src/protocols/RelativePointer.cpp
index 9876852f..67bff46e 100644
--- a/src/protocols/RelativePointer.cpp
+++ b/src/protocols/RelativePointer.cpp
@@ -3,27 +3,27 @@
#include "core/Seat.hpp"
#include <algorithm>
-CRelativePointer::CRelativePointer(SP<CZwpRelativePointerV1> resource_) : resource(resource_) {
+CRelativePointer::CRelativePointer(SP<CZwpRelativePointerV1> resource_) : m_resource(resource_) {
if UNLIKELY (!resource_->resource())
return;
- pClient = resource->client();
+ m_client = m_resource->client();
- resource->setDestroy([this](CZwpRelativePointerV1* pMgr) { PROTO::relativePointer->destroyRelativePointer(this); });
- resource->setOnDestroy([this](CZwpRelativePointerV1* pMgr) { PROTO::relativePointer->destroyRelativePointer(this); });
+ m_resource->setDestroy([this](CZwpRelativePointerV1* pMgr) { PROTO::relativePointer->destroyRelativePointer(this); });
+ m_resource->setOnDestroy([this](CZwpRelativePointerV1* pMgr) { PROTO::relativePointer->destroyRelativePointer(this); });
}
bool CRelativePointer::good() {
- return resource->resource();
+ return m_resource->resource();
}
wl_client* CRelativePointer::client() {
- return pClient;
+ return m_client;
}
void CRelativePointer::sendRelativeMotion(uint64_t time, const Vector2D& delta, const Vector2D& deltaUnaccel) {
- resource->sendRelativeMotion(time >> 32, time & 0xFFFFFFFF, wl_fixed_from_double(delta.x), wl_fixed_from_double(delta.y), wl_fixed_from_double(deltaUnaccel.x),
- wl_fixed_from_double(deltaUnaccel.y));
+ m_resource->sendRelativeMotion(time >> 32, time & 0xFFFFFFFF, wl_fixed_from_double(delta.x), wl_fixed_from_double(delta.y), wl_fixed_from_double(deltaUnaccel.x),
+ wl_fixed_from_double(deltaUnaccel.y));
}
CRelativePointerProtocol::CRelativePointerProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
@@ -31,7 +31,7 @@ CRelativePointerProtocol::CRelativePointerProtocol(const wl_interface* iface, co
}
void CRelativePointerProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
- const auto RESOURCE = m_vManagers.emplace_back(makeUnique<CZwpRelativePointerManagerV1>(client, ver, id)).get();
+ const auto RESOURCE = m_managers.emplace_back(makeUnique<CZwpRelativePointerManagerV1>(client, ver, id)).get();
RESOURCE->setOnDestroy([this](CZwpRelativePointerManagerV1* p) { this->onManagerResourceDestroy(p->resource()); });
RESOURCE->setDestroy([this](CZwpRelativePointerManagerV1* pMgr) { this->onManagerResourceDestroy(pMgr->resource()); });
@@ -39,20 +39,20 @@ void CRelativePointerProtocol::bindManager(wl_client* client, void* data, uint32
}
void CRelativePointerProtocol::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 CRelativePointerProtocol::destroyRelativePointer(CRelativePointer* pointer) {
- std::erase_if(m_vRelativePointers, [&](const auto& other) { return other.get() == pointer; });
+ std::erase_if(m_relativePointers, [&](const auto& other) { return other.get() == pointer; });
}
void CRelativePointerProtocol::onGetRelativePointer(CZwpRelativePointerManagerV1* pMgr, uint32_t id, wl_resource* pointer) {
const auto CLIENT = pMgr->client();
- const auto RESOURCE = m_vRelativePointers.emplace_back(makeUnique<CRelativePointer>(makeShared<CZwpRelativePointerV1>(CLIENT, pMgr->version(), id))).get();
+ const auto RESOURCE = m_relativePointers.emplace_back(makeUnique<CRelativePointer>(makeShared<CZwpRelativePointerV1>(CLIENT, pMgr->version(), id))).get();
if UNLIKELY (!RESOURCE->good()) {
pMgr->noMemory();
- m_vRelativePointers.pop_back();
+ m_relativePointers.pop_back();
return;
}
}
@@ -64,7 +64,7 @@ void CRelativePointerProtocol::sendRelativeMotion(uint64_t time, const Vector2D&
const auto FOCUSED = g_pSeatManager->m_state.pointerFocusResource->client();
- for (auto const& rp : m_vRelativePointers) {
+ for (auto const& rp : m_relativePointers) {
if (FOCUSED != rp->client())
continue;