Commit 441266c4 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

wayland/outputinterface: use the same enums as core KWin

parent 4c05db3c
Pipeline #177689 passed with stage
in 13 minutes and 4 seconds
......@@ -79,7 +79,7 @@ void TestWaylandOutput::init()
QCOMPARE(m_serverOutput->pixelSize(), QSize(1024, 768));
QCOMPARE(m_serverOutput->refreshRate(), 60000);
QCOMPARE(m_serverOutput->isDpmsSupported(), false);
QCOMPARE(m_serverOutput->dpmsMode(), OutputInterface::DpmsMode::Off);
QCOMPARE(m_serverOutput->dpmsMode(), KWin::Output::DpmsMode::Off);
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
......@@ -278,22 +278,22 @@ void TestWaylandOutput::testSubPixel_data()
using namespace KWayland::Client;
using namespace KWaylandServer;
QTest::addColumn<KWayland::Client::Output::SubPixel>("expected");
QTest::addColumn<KWaylandServer::OutputInterface::SubPixel>("actual");
QTest::addColumn<KWin::Output::SubPixel>("actual");
QTest::newRow("none") << Output::SubPixel::None << OutputInterface::SubPixel::None;
QTest::newRow("horizontal/rgb") << Output::SubPixel::HorizontalRGB << OutputInterface::SubPixel::HorizontalRGB;
QTest::newRow("horizontal/bgr") << Output::SubPixel::HorizontalBGR << OutputInterface::SubPixel::HorizontalBGR;
QTest::newRow("vertical/rgb") << Output::SubPixel::VerticalRGB << OutputInterface::SubPixel::VerticalRGB;
QTest::newRow("vertical/bgr") << Output::SubPixel::VerticalBGR << OutputInterface::SubPixel::VerticalBGR;
QTest::newRow("none") << Output::SubPixel::None << KWin::Output::SubPixel::None;
QTest::newRow("horizontal/rgb") << Output::SubPixel::HorizontalRGB << KWin::Output::SubPixel::Horizontal_RGB;
QTest::newRow("horizontal/bgr") << Output::SubPixel::HorizontalBGR << KWin::Output::SubPixel::Horizontal_BGR;
QTest::newRow("vertical/rgb") << Output::SubPixel::VerticalRGB << KWin::Output::SubPixel::Vertical_RGB;
QTest::newRow("vertical/bgr") << Output::SubPixel::VerticalBGR << KWin::Output::SubPixel::Vertical_BGR;
}
void TestWaylandOutput::testSubPixel()
{
using namespace KWayland::Client;
using namespace KWaylandServer;
QFETCH(OutputInterface::SubPixel, actual);
QCOMPARE(m_serverOutput->subPixel(), OutputInterface::SubPixel::Unknown);
QSignalSpy serverSubPixelChangedSpy(m_serverOutput, &OutputInterface::subPixelChanged);
QFETCH(KWin::Output::SubPixel, actual);
QCOMPARE(m_serverOutput->subPixel(), KWin::Output::SubPixel::Unknown);
QSignalSpy serverSubPixelChangedSpy(m_serverOutput, &KWaylandServer::OutputInterface::subPixelChanged);
QVERIFY(serverSubPixelChangedSpy.isValid());
m_serverOutput->setSubPixel(actual);
QCOMPARE(m_serverOutput->subPixel(), actual);
......@@ -323,8 +323,8 @@ void TestWaylandOutput::testSubPixel()
// change back to unknown
outputChanged.clear();
m_serverOutput->setSubPixel(OutputInterface::SubPixel::Unknown);
QCOMPARE(m_serverOutput->subPixel(), OutputInterface::SubPixel::Unknown);
m_serverOutput->setSubPixel(KWin::Output::SubPixel::Unknown);
QCOMPARE(m_serverOutput->subPixel(), KWin::Output::SubPixel::Unknown);
m_serverOutput->done();
QCOMPARE(serverSubPixelChangedSpy.count(), 2);
if (outputChanged.isEmpty()) {
......@@ -338,24 +338,24 @@ void TestWaylandOutput::testTransform_data()
using namespace KWayland::Client;
using namespace KWaylandServer;
QTest::addColumn<KWayland::Client::Output::Transform>("expected");
QTest::addColumn<KWaylandServer::OutputInterface::Transform>("actual");
QTest::newRow("90") << Output::Transform::Rotated90 << OutputInterface::Transform::Rotated90;
QTest::newRow("180") << Output::Transform::Rotated180 << OutputInterface::Transform::Rotated180;
QTest::newRow("270") << Output::Transform::Rotated270 << OutputInterface::Transform::Rotated270;
QTest::newRow("Flipped") << Output::Transform::Flipped << OutputInterface::Transform::Flipped;
QTest::newRow("Flipped 90") << Output::Transform::Flipped90 << OutputInterface::Transform::Flipped90;
QTest::newRow("Flipped 180") << Output::Transform::Flipped180 << OutputInterface::Transform::Flipped180;
QTest::newRow("Flipped 280") << Output::Transform::Flipped270 << OutputInterface::Transform::Flipped270;
QTest::addColumn<KWin::Output::Transform>("actual");
QTest::newRow("90") << Output::Transform::Rotated90 << KWin::Output::Transform::Rotated90;
QTest::newRow("180") << Output::Transform::Rotated180 << KWin::Output::Transform::Rotated180;
QTest::newRow("270") << Output::Transform::Rotated270 << KWin::Output::Transform::Rotated270;
QTest::newRow("Flipped") << Output::Transform::Flipped << KWin::Output::Transform::Flipped;
QTest::newRow("Flipped 90") << Output::Transform::Flipped90 << KWin::Output::Transform::Flipped90;
QTest::newRow("Flipped 180") << Output::Transform::Flipped180 << KWin::Output::Transform::Flipped180;
QTest::newRow("Flipped 280") << Output::Transform::Flipped270 << KWin::Output::Transform::Flipped270;
}
void TestWaylandOutput::testTransform()
{
using namespace KWayland::Client;
using namespace KWaylandServer;
QFETCH(OutputInterface::Transform, actual);
QCOMPARE(m_serverOutput->transform(), OutputInterface::Transform::Normal);
QSignalSpy serverTransformChangedSpy(m_serverOutput, &OutputInterface::transformChanged);
QFETCH(KWin::Output::Transform, actual);
QCOMPARE(m_serverOutput->transform(), KWin::Output::Transform::Normal);
QSignalSpy serverTransformChangedSpy(m_serverOutput, &KWaylandServer::OutputInterface::transformChanged);
QVERIFY(serverTransformChangedSpy.isValid());
m_serverOutput->setTransform(actual);
QCOMPARE(m_serverOutput->transform(), actual);
......@@ -384,8 +384,8 @@ void TestWaylandOutput::testTransform()
// change back to normal
outputChanged.clear();
m_serverOutput->setTransform(OutputInterface::Transform::Normal);
QCOMPARE(m_serverOutput->transform(), OutputInterface::Transform::Normal);
m_serverOutput->setTransform(KWin::Output::Transform::Normal);
QCOMPARE(m_serverOutput->transform(), KWin::Output::Transform::Normal);
m_serverOutput->done();
QCOMPARE(serverTransformChangedSpy.count(), 2);
if (outputChanged.isEmpty()) {
......@@ -400,11 +400,11 @@ void TestWaylandOutput::testDpms_data()
using namespace KWaylandServer;
QTest::addColumn<KWayland::Client::Dpms::Mode>("client");
QTest::addColumn<KWaylandServer::OutputInterface::DpmsMode>("server");
QTest::addColumn<KWin::Output::DpmsMode>("server");
QTest::newRow("Standby") << Dpms::Mode::Standby << OutputInterface::DpmsMode::Standby;
QTest::newRow("Suspend") << Dpms::Mode::Suspend << OutputInterface::DpmsMode::Suspend;
QTest::newRow("On") << Dpms::Mode::On << OutputInterface::DpmsMode::On;
QTest::newRow("Standby") << Dpms::Mode::Standby << KWin::Output::DpmsMode::Standby;
QTest::newRow("Suspend") << Dpms::Mode::Suspend << KWin::Output::DpmsMode::Suspend;
QTest::newRow("On") << Dpms::Mode::On << KWin::Output::DpmsMode::On;
}
void TestWaylandOutput::testDpms()
......@@ -454,13 +454,13 @@ void TestWaylandOutput::testDpms()
QCOMPARE(dpms->isSupported(), true);
// and let's change to suspend
QSignalSpy serverDpmsModeChangedSpy(m_serverOutput, &OutputInterface::dpmsModeChanged);
QSignalSpy serverDpmsModeChangedSpy(m_serverOutput, &KWaylandServer::OutputInterface::dpmsModeChanged);
QVERIFY(serverDpmsModeChangedSpy.isValid());
QSignalSpy clientDpmsModeChangedSpy(dpms, &Dpms::modeChanged);
QVERIFY(clientDpmsModeChangedSpy.isValid());
QCOMPARE(m_serverOutput->dpmsMode(), OutputInterface::DpmsMode::Off);
QFETCH(OutputInterface::DpmsMode, server);
QCOMPARE(m_serverOutput->dpmsMode(), KWin::Output::DpmsMode::Off);
QFETCH(KWin::Output::DpmsMode, server);
m_serverOutput->setDpmsMode(server);
QCOMPARE(m_serverOutput->dpmsMode(), server);
QCOMPARE(serverDpmsModeChangedSpy.count(), 1);
......@@ -482,7 +482,7 @@ void TestWaylandOutput::testDpms()
QVERIFY(dpms->isSupported());
// and switch back to off
m_serverOutput->setDpmsMode(OutputInterface::DpmsMode::Off);
m_serverOutput->setDpmsMode(KWin::Output::DpmsMode::Off);
QVERIFY(clientDpmsModeChangedSpy.wait());
QCOMPARE(clientDpmsModeChangedSpy.count(), 2);
QCOMPARE(dpms->mode(), Dpms::Mode::Off);
......@@ -494,12 +494,12 @@ void TestWaylandOutput::testDpmsRequestMode_data()
using namespace KWaylandServer;
QTest::addColumn<KWayland::Client::Dpms::Mode>("client");
QTest::addColumn<KWaylandServer::OutputInterface::DpmsMode>("server");
QTest::addColumn<KWin::Output::DpmsMode>("server");
QTest::newRow("Standby") << Dpms::Mode::Standby << OutputInterface::DpmsMode::Standby;
QTest::newRow("Suspend") << Dpms::Mode::Suspend << OutputInterface::DpmsMode::Suspend;
QTest::newRow("Off") << Dpms::Mode::Off << OutputInterface::DpmsMode::Off;
QTest::newRow("On") << Dpms::Mode::On << OutputInterface::DpmsMode::On;
QTest::newRow("Standby") << Dpms::Mode::Standby << KWin::Output::DpmsMode::Standby;
QTest::newRow("Suspend") << Dpms::Mode::Suspend << KWin::Output::DpmsMode::Suspend;
QTest::newRow("Off") << Dpms::Mode::Off << KWin::Output::DpmsMode::Off;
QTest::newRow("On") << Dpms::Mode::On << KWin::Output::DpmsMode::On;
}
void TestWaylandOutput::testDpmsRequestMode()
......@@ -541,13 +541,13 @@ void TestWaylandOutput::testDpmsRequestMode()
Dpms *dpms = dpmsManager->getDpms(output, &registry);
// and test request mode
QSignalSpy modeRequestedSpy(m_serverOutput, &OutputInterface::dpmsModeRequested);
QSignalSpy modeRequestedSpy(m_serverOutput, &KWaylandServer::OutputInterface::dpmsModeRequested);
QVERIFY(modeRequestedSpy.isValid());
QFETCH(Dpms::Mode, client);
dpms->requestMode(client);
QVERIFY(modeRequestedSpy.wait());
QTEST(modeRequestedSpy.last().first().value<OutputInterface::DpmsMode>(), "server");
QTEST(modeRequestedSpy.last().first().value<KWin::Output::DpmsMode>(), "server");
}
QTEST_GUILESS_MAIN(TestWaylandOutput)
......
......@@ -50,7 +50,7 @@ DpmsInterface::DpmsInterface(OutputInterface *output, wl_resource *resource)
sendSupported();
sendDone();
});
connect(output, &OutputInterface::dpmsModeChanged, this, [this] {
connect(output, &KWaylandServer::OutputInterface::dpmsModeChanged, this, [this] {
sendMode();
sendDone();
});
......@@ -72,19 +72,19 @@ void DpmsInterface::org_kde_kwin_dpms_destroy_resource(Resource *resource)
void DpmsInterface::org_kde_kwin_dpms_set(Resource *resource, uint32_t mode)
{
Q_UNUSED(resource)
OutputInterface::DpmsMode dpmsMode;
KWin::Output::DpmsMode dpmsMode;
switch (mode) {
case ORG_KDE_KWIN_DPMS_MODE_ON:
dpmsMode = OutputInterface::DpmsMode::On;
dpmsMode = KWin::Output::DpmsMode::On;
break;
case ORG_KDE_KWIN_DPMS_MODE_STANDBY:
dpmsMode = OutputInterface::DpmsMode::Standby;
dpmsMode = KWin::Output::DpmsMode::Standby;
break;
case ORG_KDE_KWIN_DPMS_MODE_SUSPEND:
dpmsMode = OutputInterface::DpmsMode::Suspend;
dpmsMode = KWin::Output::DpmsMode::Suspend;
break;
case ORG_KDE_KWIN_DPMS_MODE_OFF:
dpmsMode = OutputInterface::DpmsMode::Off;
dpmsMode = KWin::Output::DpmsMode::Off;
break;
default:
return;
......@@ -102,16 +102,16 @@ void DpmsInterface::sendMode()
const auto mode = output->dpmsMode();
org_kde_kwin_dpms_mode wlMode;
switch (mode) {
case OutputInterface::DpmsMode::On:
case KWin::Output::DpmsMode::On:
wlMode = ORG_KDE_KWIN_DPMS_MODE_ON;
break;
case OutputInterface::DpmsMode::Standby:
case KWin::Output::DpmsMode::Standby:
wlMode = ORG_KDE_KWIN_DPMS_MODE_STANDBY;
break;
case OutputInterface::DpmsMode::Suspend:
case KWin::Output::DpmsMode::Suspend:
wlMode = ORG_KDE_KWIN_DPMS_MODE_SUSPEND;
break;
case OutputInterface::DpmsMode::Off:
case KWin::Output::DpmsMode::Off:
wlMode = ORG_KDE_KWIN_DPMS_MODE_OFF;
break;
default:
......
......@@ -34,13 +34,13 @@ class DpmsManagerInterfacePrivate;
* @code
* // We have our OutputInterface called output.
* output->setDpmsSupported(true);
* output->setDpmsMode(OutputInterface::DpmsMode::On);
* output->setDpmsMode(KWin::Output::DpmsMode::On);
* @endcode
*
* To connect to Dpms change requests use:
* @code
* connect(output, &OutputInterface::dpmsModeRequested,
* [] (KWaylandServer::OutputInterface::DpmsMode requestedMode) { qDebug() << "Mode change requested"; });
* connect(output, &KWin::Output::DpmsModeRequested,
* [] (KWaylandServer::KWin::Output::DpmsMode requestedMode) { qDebug() << "Mode change requested"; });
* @endcode
*
* @see Display
......
......@@ -37,12 +37,12 @@ public:
QString manufacturer = QStringLiteral("org.kde.kwin");
QString model = QStringLiteral("none");
int scale = 1;
OutputInterface::SubPixel subPixel = OutputInterface::SubPixel::Unknown;
OutputInterface::Transform transform = OutputInterface::Transform::Normal;
KWin::Output::SubPixel subPixel = KWin::Output::SubPixel::Unknown;
KWin::Output::Transform transform = KWin::Output::Transform::Normal;
OutputInterface::Mode mode;
struct
{
OutputInterface::DpmsMode mode = OutputInterface::DpmsMode::Off;
KWin::Output::DpmsMode mode = KWin::Output::DpmsMode::Off;
bool supported = false;
} dpms;
......@@ -71,44 +71,44 @@ void OutputInterfacePrivate::sendScale(Resource *resource)
}
}
static quint32 kwaylandServerTransformToWaylandTransform(OutputInterface::Transform transform)
static quint32 kwaylandServerTransformToWaylandTransform(KWin::Output::Transform transform)
{
switch (transform) {
case OutputInterface::Transform::Normal:
case KWin::Output::Transform::Normal:
return OutputInterfacePrivate::transform_normal;
case OutputInterface::Transform::Rotated90:
case KWin::Output::Transform::Rotated90:
return OutputInterfacePrivate::transform_90;
case OutputInterface::Transform::Rotated180:
case KWin::Output::Transform::Rotated180:
return OutputInterfacePrivate::transform_180;
case OutputInterface::Transform::Rotated270:
case KWin::Output::Transform::Rotated270:
return OutputInterfacePrivate::transform_270;
case OutputInterface::Transform::Flipped:
case KWin::Output::Transform::Flipped:
return OutputInterfacePrivate::transform_flipped;
case OutputInterface::Transform::Flipped90:
case KWin::Output::Transform::Flipped90:
return OutputInterfacePrivate::transform_flipped_90;
case OutputInterface::Transform::Flipped180:
case KWin::Output::Transform::Flipped180:
return OutputInterfacePrivate::transform_flipped_180;
case OutputInterface::Transform::Flipped270:
case KWin::Output::Transform::Flipped270:
return OutputInterfacePrivate::transform_flipped_270;
default:
Q_UNREACHABLE();
}
}
static quint32 kwaylandServerSubPixelToWaylandSubPixel(OutputInterface::SubPixel subPixel)
static quint32 kwaylandServerSubPixelToWaylandSubPixel(KWin::Output::SubPixel subPixel)
{
switch (subPixel) {
case OutputInterface::SubPixel::Unknown:
case KWin::Output::SubPixel::Unknown:
return OutputInterfacePrivate::subpixel_unknown;
case OutputInterface::SubPixel::None:
case KWin::Output::SubPixel::None:
return OutputInterfacePrivate::subpixel_none;
case OutputInterface::SubPixel::HorizontalRGB:
case KWin::Output::SubPixel::Horizontal_RGB:
return OutputInterfacePrivate::subpixel_horizontal_rgb;
case OutputInterface::SubPixel::HorizontalBGR:
case KWin::Output::SubPixel::Horizontal_BGR:
return OutputInterfacePrivate::subpixel_horizontal_bgr;
case OutputInterface::SubPixel::VerticalRGB:
case KWin::Output::SubPixel::Vertical_RGB:
return OutputInterfacePrivate::subpixel_vertical_rgb;
case OutputInterface::SubPixel::VerticalBGR:
case KWin::Output::SubPixel::Vertical_BGR:
return OutputInterfacePrivate::subpixel_vertical_bgr;
default:
Q_UNREACHABLE();
......@@ -312,12 +312,12 @@ void OutputInterface::setScale(int scale)
Q_EMIT scaleChanged(d->scale);
}
OutputInterface::SubPixel OutputInterface::subPixel() const
KWin::Output::SubPixel OutputInterface::subPixel() const
{
return d->subPixel;
}
void OutputInterface::setSubPixel(SubPixel subPixel)
void OutputInterface::setSubPixel(KWin::Output::SubPixel subPixel)
{
if (d->subPixel == subPixel) {
return;
......@@ -327,12 +327,12 @@ void OutputInterface::setSubPixel(SubPixel subPixel)
Q_EMIT subPixelChanged(d->subPixel);
}
OutputInterface::Transform OutputInterface::transform() const
KWin::Output::Transform OutputInterface::transform() const
{
return d->transform;
}
void OutputInterface::setTransform(Transform transform)
void OutputInterface::setTransform(KWin::Output::Transform transform)
{
if (d->transform == transform) {
return;
......@@ -342,7 +342,7 @@ void OutputInterface::setTransform(Transform transform)
Q_EMIT transformChanged(d->transform);
}
void OutputInterface::setDpmsMode(OutputInterface::DpmsMode mode)
void OutputInterface::setDpmsMode(KWin::Output::DpmsMode mode)
{
if (d->dpms.mode == mode) {
return;
......@@ -360,7 +360,7 @@ void OutputInterface::setDpmsSupported(bool supported)
Q_EMIT dpmsSupportedChanged();
}
OutputInterface::DpmsMode OutputInterface::dpmsMode() const
KWin::Output::DpmsMode OutputInterface::dpmsMode() const
{
return d->dpms.mode;
}
......@@ -388,7 +388,7 @@ bool OutputInterface::isEnabled() const
if (!d->dpms.supported) {
return true;
}
return d->dpms.mode == DpmsMode::On;
return d->dpms.mode == KWin::Output::DpmsMode::On;
}
void OutputInterface::done()
......
......@@ -7,6 +7,7 @@
#pragma once
#include "kwin_export.h"
#include "output.h"
#include <QObject>
#include <QPoint>
......@@ -36,35 +37,11 @@ class KWIN_EXPORT OutputInterface : public QObject
Q_PROPERTY(int refreshRate READ refreshRate NOTIFY refreshRateChanged)
Q_PROPERTY(int scale READ scale WRITE setScale NOTIFY scaleChanged)
public:
enum class SubPixel {
Unknown,
None,
HorizontalRGB,
HorizontalBGR,
VerticalRGB,
VerticalBGR,
};
enum class Transform {
Normal,
Rotated90,
Rotated180,
Rotated270,
Flipped,
Flipped90,
Flipped180,
Flipped270,
};
struct Mode
{
QSize size = QSize();
int refreshRate = 60000;
};
enum class DpmsMode {
On,
Standby,
Suspend,
Off,
};
explicit OutputInterface(Display *display, QObject *parent = nullptr);
~OutputInterface() override;
......@@ -78,19 +55,19 @@ public:
QSize pixelSize() const;
int refreshRate() const;
int scale() const;
SubPixel subPixel() const;
Transform transform() const;
KWin::Output::SubPixel subPixel() const;
KWin::Output::Transform transform() const;
Mode mode() const;
bool isDpmsSupported() const;
DpmsMode dpmsMode() const;
KWin::Output::DpmsMode dpmsMode() const;
void setPhysicalSize(const QSize &size);
void setGlobalPosition(const QPoint &pos);
void setManufacturer(const QString &manufacturer);
void setModel(const QString &model);
void setScale(int scale);
void setSubPixel(SubPixel subPixel);
void setTransform(Transform transform);
void setSubPixel(KWin::Output::SubPixel subPixel);
void setTransform(KWin::Output::Transform transform);
void setMode(const Mode &mode);
void setMode(const QSize &size, int refreshRate = 60000);
......@@ -103,7 +80,7 @@ public:
* Sets the currently used dpms mode.
* Default is @c DpmsMode::On.
*/
void setDpmsMode(DpmsMode mode);
void setDpmsMode(KWin::Output::DpmsMode mode);
/**
* @returns all wl_resources bound for the @p client
......@@ -135,8 +112,8 @@ Q_SIGNALS:
void pixelSizeChanged(const QSize &);
void refreshRateChanged(int);
void scaleChanged(int);
void subPixelChanged(SubPixel);
void transformChanged(Transform);
void subPixelChanged(KWin::Output::SubPixel);
void transformChanged(KWin::Output::Transform);
void modeChanged();
void dpmsModeChanged();
void dpmsSupportedChanged();
......@@ -146,7 +123,7 @@ Q_SIGNALS:
* Change of dpms @p mode is requested.
* A server is free to ignore this request.
*/
void dpmsModeRequested(KWaylandServer::OutputInterface::DpmsMode mode);
void dpmsModeRequested(KWin::Output::DpmsMode mode);
/**
* Emitted when a client binds to a given output
......@@ -159,7 +136,3 @@ private:
};
} // namespace KWaylandServer
Q_DECLARE_METATYPE(KWaylandServer::OutputInterface::SubPixel)
Q_DECLARE_METATYPE(KWaylandServer::OutputInterface::Transform)
Q_DECLARE_METATYPE(KWaylandServer::OutputInterface::DpmsMode)
......@@ -313,7 +313,7 @@ void SurfaceInterfacePrivate::surface_set_buffer_transform(Resource *resource, i
wl_resource_post_error(resource->handle, error_invalid_transform, "buffer transform must be a valid transform (%d specified)", transform);
return;
}
pending.bufferTransform = OutputInterface::Transform(transform);
pending.bufferTransform = KWin::Output::Transform(transform);
pending.bufferTransformIsSet = true;
}
......@@ -409,34 +409,34 @@ QMatrix4x4 SurfaceInterfacePrivate::buildSurfaceToBufferMatrix()
surfaceToBufferMatrix.scale(current.bufferScale, current.bufferScale);
switch (current.bufferTransform) {
case OutputInterface::Transform::Normal:
case OutputInterface::Transform::Flipped:
case KWin::Output::Transform::Normal:
case KWin::Output::Transform::Flipped:
break;
case OutputInterface::Transform::Rotated90:
case OutputInterface::Transform::Flipped90:
case KWin::Output::Transform::Rotated90:
case KWin::Output::Transform::Flipped90:
surfaceToBufferMatrix.translate(0, bufferSize.height() / current.bufferScale);
surfaceToBufferMatrix.rotate(-90, 0, 0, 1);
break;
case OutputInterface::Transform::Rotated180:
case OutputInterface::Transform::Flipped180:
case KWin::Output::Transform::Rotated180:
case KWin::Output::Transform::Flipped180:
surfaceToBufferMatrix.translate(bufferSize.width() / current.bufferScale, bufferSize.height() / current.bufferScale);
surfaceToBufferMatrix.rotate(-180, 0, 0, 1);
break;
case OutputInterface::Transform::Rotated270:
case OutputInterface::Transform::Flipped270:
case KWin::Output::Transform::Rotated270:
case KWin::Output::Transform::Flipped270:
surfaceToBufferMatrix.translate(bufferSize.width() / current.bufferScale, 0);
surfaceToBufferMatrix.rotate(-270, 0, 0, 1);
break;
}
switch (current.bufferTransform) {
case OutputInterface::Transform::Flipped:
case OutputInterface::Transform::Flipped180:
case KWin::Output::Transform::Flipped:
case KWin::Output::Transform::Flipped180:
surfaceToBufferMatrix.translate(bufferSize.width() / current.bufferScale, 0);
surfaceToBufferMatrix.scale(-1, 1);
break;
case OutputInterface::Transform::Flipped90:
case OutputInterface::Transform::Flipped270:
case KWin::Output::Transform::Flipped90:
case KWin::Output::Transform::Flipped270:
surfaceToBufferMatrix.translate(bufferSize.height() / current.bufferScale, 0);
surfaceToBufferMatrix.scale(-1, 1);
break;
......@@ -570,16 +570,16 @@ void SurfaceInterfacePrivate::applyState(SurfaceState *next)
implicitSurfaceSize = current.buffer->size() / current.bufferScale;
switch (current.bufferTransform) {
case OutputInterface::Transform::Rotated90:
case OutputInterface::Transform::Rotated270:
case OutputInterface::Transform::Flipped90:
case OutputInterface::Transform::Flipped270:
case KWin::Output::Transform::Rotated90:
case KWin::Output::Transform::Rotated270:
case KWin::Output::Transform::Flipped90:
case KWin::Output::Transform::Flipped270:
implicitSurfaceSize.transpose();
break;
case OutputInterface::Transform::Normal:
case OutputInterface::Transform::Rotated180:
case OutputInterface::Transform::Flipped:
case OutputInterface::Transform::Flipped180:
case KWin::Output::Transform::Normal:
case KWin::Output::Transform::Rotated180:
case KWin::Output::Transform::Flipped:
case KWin::Output::Transform::Flipped180:
break;
}
......@@ -753,7 +753,7 @@ qint32 SurfaceInterface::bufferScale() const
return d->current.bufferScale;
}
OutputInterface::Transform SurfaceInterface::bufferTransform() const
KWin::Output::Transform SurfaceInterface::bufferTransform() const
{
return d->current.bufferTransform;
}
......
......@@ -69,7 +69,7 @@ class KWIN_EXPORT SurfaceInterface : public QObject
*/
Q_PROPERTY(QRegion input READ input NOTIFY inputChanged)
Q_PROPERTY(qint32 bufferScale READ bufferScale NOTIFY bufferScaleChanged)
Q_PROPERTY(KWaylandServer::OutputInterface::Transform bufferTransform READ bufferTransform NOTIFY bufferTransformChanged)
Q_PROPERTY(KWin::Output::Transform bufferTransform READ bufferTransform NOTIFY bufferTransformChanged)
Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
public:
explicit SurfaceInterface(CompositorInterface *compositor, wl_resource *resource);
......@@ -169,7 +169,7 @@ public:
* If the surface is on an output that is rotated 90 degrees clockwise, the buffer will
* be rotated 90 degrees counter clockwise.
*/