helpers: refactor class member vars (#10218)
This commit is contained in:
parent
b8a204c21d
commit
50e1bec85f
63 changed files with 1770 additions and 1769 deletions
|
|
@ -271,21 +271,21 @@ void CWLSurfaceResource::enter(PHLMONITOR monitor) {
|
|||
if (std::find(enteredOutputs.begin(), enteredOutputs.end(), monitor) != enteredOutputs.end())
|
||||
return;
|
||||
|
||||
if UNLIKELY (!PROTO::outputs.contains(monitor->szName)) {
|
||||
if UNLIKELY (!PROTO::outputs.contains(monitor->m_name)) {
|
||||
// can happen on unplug/replug
|
||||
LOGM(ERR, "enter() called on a non-existent output global");
|
||||
return;
|
||||
}
|
||||
|
||||
if UNLIKELY (PROTO::outputs.at(monitor->szName)->isDefunct()) {
|
||||
if UNLIKELY (PROTO::outputs.at(monitor->m_name)->isDefunct()) {
|
||||
LOGM(ERR, "enter() called on a defunct output global");
|
||||
return;
|
||||
}
|
||||
|
||||
auto output = PROTO::outputs.at(monitor->szName)->outputResourceFrom(pClient);
|
||||
auto output = PROTO::outputs.at(monitor->m_name)->outputResourceFrom(pClient);
|
||||
|
||||
if UNLIKELY (!output || !output->getResource() || !output->getResource()->resource()) {
|
||||
LOGM(ERR, "Cannot enter surface {:x} to {}, client hasn't bound the output", (uintptr_t)this, monitor->szName);
|
||||
LOGM(ERR, "Cannot enter surface {:x} to {}, client hasn't bound the output", (uintptr_t)this, monitor->m_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -298,10 +298,10 @@ void CWLSurfaceResource::leave(PHLMONITOR monitor) {
|
|||
if UNLIKELY (std::find(enteredOutputs.begin(), enteredOutputs.end(), monitor) == enteredOutputs.end())
|
||||
return;
|
||||
|
||||
auto output = PROTO::outputs.at(monitor->szName)->outputResourceFrom(pClient);
|
||||
auto output = PROTO::outputs.at(monitor->m_name)->outputResourceFrom(pClient);
|
||||
|
||||
if UNLIKELY (!output) {
|
||||
LOGM(ERR, "Cannot leave surface {:x} from {}, client hasn't bound the output", (uintptr_t)this, monitor->szName);
|
||||
LOGM(ERR, "Cannot leave surface {:x} from {}, client hasn't bound the output", (uintptr_t)this, monitor->m_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -809,7 +809,7 @@ void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, const Time::steady_tp
|
|||
|
||||
surfacePos += dnd.dndSurface->current.offset;
|
||||
|
||||
CBox box = CBox{surfacePos, dnd.dndSurface->current.size}.translate(-pMonitor->vecPosition).scale(pMonitor->scale);
|
||||
CBox box = CBox{surfacePos, dnd.dndSurface->current.size}.translate(-pMonitor->m_position).scale(pMonitor->m_scale);
|
||||
|
||||
CTexPassElement::SRenderData data;
|
||||
data.tex = dnd.dndSurface->current.texture;
|
||||
|
|
|
|||
|
|
@ -15,17 +15,17 @@ CWLOutputResource::CWLOutputResource(SP<CWlOutput> resource_, PHLMONITOR pMonito
|
|||
return;
|
||||
|
||||
resource->setOnDestroy([this](CWlOutput* r) {
|
||||
if (monitor && PROTO::outputs.contains(monitor->szName))
|
||||
PROTO::outputs.at(monitor->szName)->destroyResource(this);
|
||||
if (monitor && PROTO::outputs.contains(monitor->m_name))
|
||||
PROTO::outputs.at(monitor->m_name)->destroyResource(this);
|
||||
});
|
||||
resource->setRelease([this](CWlOutput* r) {
|
||||
if (monitor && PROTO::outputs.contains(monitor->szName))
|
||||
PROTO::outputs.at(monitor->szName)->destroyResource(this);
|
||||
if (monitor && PROTO::outputs.contains(monitor->m_name))
|
||||
PROTO::outputs.at(monitor->m_name)->destroyResource(this);
|
||||
});
|
||||
|
||||
if (resource->version() >= 4) {
|
||||
resource->sendName(monitor->szName.c_str());
|
||||
resource->sendDescription(monitor->szDescription.c_str());
|
||||
resource->sendName(monitor->m_name.c_str());
|
||||
resource->sendDescription(monitor->m_description.c_str());
|
||||
}
|
||||
|
||||
updateState();
|
||||
|
|
@ -72,21 +72,21 @@ void CWLOutputResource::updateState() {
|
|||
return;
|
||||
|
||||
if (resource->version() >= 2)
|
||||
resource->sendScale(std::ceil(monitor->scale));
|
||||
resource->sendScale(std::ceil(monitor->m_scale));
|
||||
|
||||
resource->sendMode((wl_output_mode)(WL_OUTPUT_MODE_CURRENT), monitor->vecPixelSize.x, monitor->vecPixelSize.y, monitor->refreshRate * 1000.0);
|
||||
resource->sendMode((wl_output_mode)(WL_OUTPUT_MODE_CURRENT), monitor->m_pixelSize.x, monitor->m_pixelSize.y, monitor->m_refreshRate * 1000.0);
|
||||
|
||||
resource->sendGeometry(0, 0, monitor->output->physicalSize.x, monitor->output->physicalSize.y, (wl_output_subpixel)monitor->output->subpixel, monitor->output->make.c_str(),
|
||||
monitor->output->model.c_str(), monitor->transform);
|
||||
resource->sendGeometry(0, 0, monitor->m_output->physicalSize.x, monitor->m_output->physicalSize.y, (wl_output_subpixel)monitor->m_output->subpixel,
|
||||
monitor->m_output->make.c_str(), monitor->m_output->model.c_str(), monitor->m_transform);
|
||||
|
||||
if (resource->version() >= 2)
|
||||
resource->sendDone();
|
||||
}
|
||||
|
||||
CWLOutputProtocol::CWLOutputProtocol(const wl_interface* iface, const int& ver, const std::string& name, PHLMONITOR pMonitor) :
|
||||
IWaylandProtocol(iface, ver, name), monitor(pMonitor), szName(pMonitor->szName) {
|
||||
IWaylandProtocol(iface, ver, name), monitor(pMonitor), szName(pMonitor->m_name) {
|
||||
|
||||
listeners.modeChanged = monitor->events.modeChanged.registerListener([this](std::any d) {
|
||||
listeners.modeChanged = monitor->m_events.modeChanged.registerListener([this](std::any d) {
|
||||
for (auto const& o : m_vOutputs) {
|
||||
o->updateState();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue