14#include <KConfigGroup>
15#include <KLocalizedString>
16#include <KSharedConfig>
23 QDebugStateSaver saver(debug);
26 debug << output->metaObject()->className() <<
'(' <<
static_cast<const void *
>(output);
27 debug <<
", name=" << output->
name();
28 debug <<
", geometry=" << output->
geometry();
29 debug <<
", scale=" << output->
scale();
30 if (debug.verbosity() > 2) {
32 debug <<
", model=" << output->
model();
37 debug <<
"Output(0x0)";
44 , m_refreshRate(refreshRate)
96 return QRectF(rect.y(),
97 bounds.width() - (rect.x() + rect.width()),
101 return QRectF(bounds.width() - (rect.x() + rect.width()),
102 bounds.height() - (rect.y() + rect.height()),
106 return QRectF(bounds.height() - (rect.y() + rect.height()),
111 return QRectF(bounds.width() - (rect.x() + rect.width()),
116 return QRectF(rect.y(),
121 return QRectF(rect.x(),
122 bounds.height() - (rect.y() + rect.height()),
126 return QRectF(bounds.height() - (rect.y() + rect.height()),
127 bounds.width() - (rect.x() + rect.width()),
141 return QRect(rect.y(),
142 bounds.width() - (rect.x() + rect.width()),
146 return QRect(bounds.width() - (rect.x() + rect.width()),
147 bounds.height() - (rect.y() + rect.height()),
151 return QRect(bounds.height() - (rect.y() + rect.height()),
156 return QRect(bounds.width() - (rect.x() + rect.width()),
161 return QRect(rect.y(),
166 return QRect(rect.x(),
167 bounds.height() - (rect.y() + rect.height()),
171 return QRect(bounds.height() - (rect.y() + rect.height()),
172 bounds.width() - (rect.x() + rect.width()),
186 return QPointF(point.y(),
187 bounds.width() - point.x());
189 return QPointF(bounds.width() - point.x(),
190 bounds.height() - point.y());
192 return QPointF(bounds.height() - point.y(),
195 return QPointF(bounds.width() - point.x(),
198 return QPointF(point.y(),
201 return QPointF(point.x(),
202 bounds.height() - point.y());
204 return QPointF(bounds.height() - point.y(),
205 bounds.width() - point.x());
217 return QPoint(point.y(),
218 bounds.width() - point.x());
220 return QPoint(bounds.width() - point.x(),
221 bounds.height() - point.y());
223 return QPoint(bounds.height() - point.y(),
226 return QPoint(bounds.width() - point.x(),
229 return QPoint(point.y(),
232 return QPoint(point.x(),
233 bounds.height() - point.y());
235 return QPoint(bounds.height() - point.y(),
236 bounds.width() - point.x());
251 return size.transposed();
264 return size.transposed();
290 const int flip = (m_kind ^ other.m_kind) & 0x4;
292 if (other.m_kind & 0x4) {
293 rotate = (other.m_kind - m_kind) & 0x3;
295 rotate = (m_kind + other.m_kind) & 0x3;
307 matrix.rotate(-90, 0, 0, 1);
310 matrix.rotate(-180, 0, 0, 1);
313 matrix.rotate(-270, 0, 0, 1);
319 matrix.rotate(-90, 0, 0, 1);
323 matrix.rotate(-180, 0, 0, 1);
327 matrix.rotate(-270, 0, 0, 1);
422 return std::chrono::milliseconds(KSharedConfig::openConfig()->group(QStringLiteral(
"Effect-Kscreen")).readEntry(
"Duration", 250));
526 if (props->iccProfilePath) {
546static QUuid generateOutputId(
const QString &eisaId,
const QString &model,
547 const QString &serialNumber,
const QString &name)
549 static const QUuid urlNs = QUuid(
"6ba7b811-9dad-11d1-80b4-00c04fd430c8");
550 static const QUuid kwinNs = QUuid::createUuidV5(urlNs, QStringLiteral(
"https://kwin.kde.org/o/"));
552 const QString payload = QStringList{name, eisaId, model, serialNumber}.join(
':');
553 return QUuid::createUuidV5(kwinNs, payload);
564 const QRect oldGeometry =
geometry();
637 return size.transposed();
773#include "moc_output.cpp"
static std::unique_ptr< IccProfile > load(const QString &path)
std::shared_ptr< OutputChangeSet > constChangeSet(Output *output) const
void inhibitDirectScanout()
VrrPolicy vrrPolicy() const
std::shared_ptr< OutputMode > currentMode() const
virtual void setDpmsMode(DpmsMode mode)
bool isPlaceholder() const
QSize orientateSize(const QSize &size) const
double sdrGamutWideness() const
QString description() const
void colorDescriptionChanged()
QList< std::shared_ptr< OutputMode > > modes() const
uint32_t overscan() const
OutputTransform panelOrientation() const
uint32_t refreshRate() const
void setInformation(const Information &information)
virtual bool setGammaRamp(const std::shared_ptr< ColorTransformation > &transformation)
double minBrightness() const
void setState(const State &state)
void currentModeChanged()
bool highDynamicRange() const
std::optional< double > maxAverageBrightnessOverride() const
void highDynamicRangeChanged()
const ColorDescription & colorDescription() const
RgbRange rgbRange() const
OutputTransform transform() const
void autoRotationPolicyChanged()
void sdrBrightnessChanged()
bool directScanoutInhibited() const
QRect mapFromGlobal(const QRect &rect) const
QRectF mapToGlobal(const QRectF &rect) const
AutoRotationPolicy autoRotationPolicy() const
void iccProfilePathChanged()
static std::chrono::milliseconds dimAnimationTime()
SubPixel subPixel() const
std::optional< double > maxAverageBrightness() const
QString iccProfilePath() const
QByteArray mstPath() const
void aboutToChange(OutputChangeSet *changeSet)
uint32_t sdrBrightness() const
const Edid & edid() const
std::optional< double > maxPeakBrightness() const
void applyChanges(const OutputConfiguration &config)
OutputTransform manualTransform() const
bool wideColorGamut() const
void sdrGamutWidenessChanged()
void brightnessMetadataChanged()
std::optional< double > minBrightnessOverride() const
std::shared_ptr< IccProfile > iccProfile() const
virtual bool setChannelFactors(const QVector3D &rgb)
void wideColorGamutChanged()
Information m_information
Output(QObject *parent=nullptr)
virtual bool updateCursorLayer()
Capabilities capabilities() const
void uninhibitDirectScanout()
bool isNonDesktop() const
std::optional< double > maxPeakBrightnessOverride() const
DpmsMode dpmsMode() const
QSize physicalSize() const
uint32_t refreshRate() const
OutputMode(const QSize &size, uint32_t refreshRate, Flags flags={})
QDebug & operator<<(QDebug &s, const KWin::DrmConnector *obj)
std::shared_ptr< OutputMode > currentMode
QList< std::shared_ptr< OutputMode > > modes
ColorDescription colorDescription
OutputTransform manualTransform
std::shared_ptr< IccProfile > iccProfile
std::optional< double > maxAverageBrightnessOverride
OutputTransform transform
std::optional< double > minBrightnessOverride
AutoRotationPolicy autoRotatePolicy
std::optional< double > maxPeakBrightnessOverride