kwin/src/outputconfiguration.cpp
Vlad Zahorodnii 8e7a8c5a11 Rename AbstractOutput to Output
AbstractOutput is not so Abstract and it's common to avoid the word
"Abstract" in class names as it doesn't contribute any new information.
It also significantly reduces the line width in some places.
2022-04-15 17:49:49 +03:00

39 lines
1.1 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2021 Xaver Hugl <xaver.hugl@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "outputconfiguration.h"
namespace KWin
{
QSharedPointer<OutputChangeSet> OutputConfiguration::changeSet(Output *output)
{
const auto ptr = constChangeSet(output);
m_properties[output] = ptr;
return ptr;
}
QSharedPointer<OutputChangeSet> OutputConfiguration::constChangeSet(Output *output) const
{
if (!m_properties.contains(output)) {
auto props = QSharedPointer<OutputChangeSet>::create();
props->enabled = output->isEnabled();
props->pos = output->geometry().topLeft();
props->scale = output->scale();
props->modeSize = output->modeSize();
props->refreshRate = output->refreshRate();
props->transform = output->transform();
props->overscan = output->overscan();
props->rgbRange = output->rgbRange();
props->vrrPolicy = output->vrrPolicy();
return props;
}
return m_properties[output];
}
}