Add manufacturer, model, and serialNumber properties to AbstractOutput

This can be useful for the colord integration plugin.
This commit is contained in:
Vlad Zahorodnii 2020-11-24 19:31:06 +02:00
parent b186f86786
commit 27e2e85144
4 changed files with 47 additions and 0 deletions

View file

@ -103,4 +103,19 @@ bool AbstractOutput::setGammaRamp(const GammaRamp &gamma)
return false;
}
QString AbstractOutput::manufacturer() const
{
return QString();
}
QString AbstractOutput::model() const
{
return QString();
}
QString AbstractOutput::serialNumber() const
{
return QString();
}
} // namespace KWin

View file

@ -164,6 +164,19 @@ public:
/** Returns the resolution of the output. */
virtual QSize pixelSize() const = 0;
/**
* Returns the manufacturer of the screen.
*/
virtual QString manufacturer() const;
/**
* Returns the model of the screen.
*/
virtual QString model() const;
/**
* Returns the serial number of the screen.
*/
virtual QString serialNumber() const;
Q_SIGNALS:
/**
* This signal is emitted when the geometry of this output has changed.

View file

@ -85,6 +85,21 @@ void AbstractWaylandOutput::setGlobalPos(const QPoint &pos)
m_xdgOutputV1->done();
}
QString AbstractWaylandOutput::manufacturer() const
{
return m_waylandOutputDevice->manufacturer();
}
QString AbstractWaylandOutput::model() const
{
return m_waylandOutputDevice->model();
}
QString AbstractWaylandOutput::serialNumber() const
{
return m_waylandOutputDevice->serialNumber();
}
QSize AbstractWaylandOutput::modeSize() const
{
return m_waylandOutputDevice->pixelSize();

View file

@ -92,6 +92,10 @@ public:
return m_internal;
}
QString manufacturer() const override;
QString model() const override;
QString serialNumber() const override;
void setGlobalPos(const QPoint &pos);
void setScale(qreal scale);