protocols: refactor class member vars (core) (#10259)

This commit is contained in:
davc0n 2025-05-03 16:02:49 +02:00 committed by GitHub
parent 0c736217a7
commit d9cad5e1b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 1160 additions and 1158 deletions

View file

@ -19,7 +19,7 @@ CContentTypeManager::CContentTypeManager(SP<CWpContentTypeManagerV1> resource) :
return;
}
if (SURF->colorManagement) {
if (SURF->m_colorManagement) {
r->error(WP_CONTENT_TYPE_MANAGER_V1_ERROR_ALREADY_CONSTRUCTED, "CT manager already exists");
return;
}
@ -33,7 +33,7 @@ CContentTypeManager::CContentTypeManager(SP<CWpContentTypeManagerV1> resource) :
RESOURCE->self = RESOURCE;
SURF->contentType = RESOURCE;
SURF->m_contentType = RESOURCE;
});
}
@ -42,7 +42,7 @@ bool CContentTypeManager::good() {
}
CContentType::CContentType(WP<CWLSurfaceResource> surface) {
destroy = surface->events.destroy.registerListener([this](std::any d) { PROTO::contentType->destroyResource(this); });
destroy = surface->m_events.destroy.registerListener([this](std::any d) { PROTO::contentType->destroyResource(this); });
}
CContentType::CContentType(SP<CWpContentTypeV1> resource) : m_resource(resource) {
@ -80,8 +80,8 @@ void CContentTypeProtocol::bindManager(wl_client* client, void* data, uint32_t v
}
SP<CContentType> CContentTypeProtocol::getContentType(WP<CWLSurfaceResource> surface) {
if (surface->contentType.valid())
return surface->contentType.lock();
if (surface->m_contentType.valid())
return surface->m_contentType.lock();
return m_vContentTypes.emplace_back(makeShared<CContentType>(surface));
}