From e9c3fcbb64c2df147a176052fb219f0f8a7b89ec Mon Sep 17 00:00:00 2001 From: davc0n Date: Tue, 29 Apr 2025 19:51:07 +0200 Subject: devices: refactor class member vars (#10206) --- src/devices/TouchDevice.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/devices/TouchDevice.cpp') diff --git a/src/devices/TouchDevice.cpp b/src/devices/TouchDevice.cpp index 25b7b503..c2ff4d6f 100644 --- a/src/devices/TouchDevice.cpp +++ b/src/devices/TouchDevice.cpp @@ -5,62 +5,62 @@ SP CTouchDevice::create(SP touch) { SP pTouch = SP(new CTouchDevice(touch)); - pTouch->self = pTouch; + pTouch->m_self = pTouch; return pTouch; } -CTouchDevice::CTouchDevice(SP touch_) : touch(touch_) { - if (!touch) +CTouchDevice::CTouchDevice(SP touch_) : m_touch(touch_) { + if (!m_touch) return; - listeners.destroy = touch->events.destroy.registerListener([this](std::any d) { - events.destroy.emit(); - touch.reset(); + m_listeners.destroy = m_touch->events.destroy.registerListener([this](std::any d) { + m_events.destroy.emit(); + m_touch.reset(); }); - listeners.down = touch->events.down.registerListener([this](std::any d) { + m_listeners.down = m_touch->events.down.registerListener([this](std::any d) { auto E = std::any_cast(d); - touchEvents.down.emit(SDownEvent{ + m_touchEvents.down.emit(SDownEvent{ .timeMs = E.timeMs, .touchID = E.touchID, .pos = E.pos, - .device = self.lock(), + .device = m_self.lock(), }); }); - listeners.up = touch->events.up.registerListener([this](std::any d) { + m_listeners.up = m_touch->events.up.registerListener([this](std::any d) { auto E = std::any_cast(d); - touchEvents.up.emit(SUpEvent{ + m_touchEvents.up.emit(SUpEvent{ .timeMs = E.timeMs, .touchID = E.touchID, }); }); - listeners.motion = touch->events.move.registerListener([this](std::any d) { + m_listeners.motion = m_touch->events.move.registerListener([this](std::any d) { auto E = std::any_cast(d); - touchEvents.motion.emit(SMotionEvent{ + m_touchEvents.motion.emit(SMotionEvent{ .timeMs = E.timeMs, .touchID = E.touchID, .pos = E.pos, }); }); - listeners.cancel = touch->events.cancel.registerListener([this](std::any d) { + m_listeners.cancel = m_touch->events.cancel.registerListener([this](std::any d) { auto E = std::any_cast(d); - touchEvents.cancel.emit(SCancelEvent{ + m_touchEvents.cancel.emit(SCancelEvent{ .timeMs = E.timeMs, .touchID = E.touchID, }); }); - listeners.frame = touch->events.frame.registerListener([this](std::any d) { touchEvents.frame.emit(); }); + m_listeners.frame = m_touch->events.frame.registerListener([this](std::any d) { m_touchEvents.frame.emit(); }); - deviceName = touch->getName(); + m_deviceName = m_touch->getName(); } bool CTouchDevice::isVirtual() { @@ -68,5 +68,5 @@ bool CTouchDevice::isVirtual() { } SP CTouchDevice::aq() { - return touch.lock(); + return m_touch.lock(); } -- cgit v1.2.3