From 23980f31d49496262b9f0a1c37e3a68d14cd95b6 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Sun, 26 Mar 2023 16:18:54 +0200 Subject: [PATCH] feat: remove output device and management protocol support Instead of our own protocols kwinft_output_device_unstable_v1 and kwinft_output_management_unstable_v1 we now only ever more support output management through the wlr_output_management_unstable_v1 protocol. --- autotests/client/CMakeLists.txt | 30 - autotests/client/output_device.cpp | 509 ----------------- autotests/client/output_management.cpp | 520 ------------------ autotests/client/registry.cpp | 116 ---- autotests/server/display.cpp | 10 - server/CMakeLists.txt | 22 - server/display.cpp | 3 - server/display.h | 3 - server/output.cpp | 11 - server/output.h | 3 - server/output_changeset_v1.cpp | 82 --- server/output_changeset_v1.h | 56 -- server/output_changeset_v1_p.h | 45 -- server/output_configuration_v1.cpp | 225 -------- server/output_configuration_v1.h | 60 -- server/output_configuration_v1_p.h | 77 --- server/output_device_v1.cpp | 154 ------ server/output_device_v1.h | 52 -- server/output_device_v1_p.h | 54 -- server/output_management_v1.cpp | 92 ---- server/output_management_v1.h | 51 -- server/output_manager.cpp | 8 - server/output_manager.h | 3 - server/output_p.h | 2 - server/wayland/global.h | 2 - src/client/CMakeLists.txt | 17 - src/client/output_configuration_v1.cpp | 198 ------- src/client/output_configuration_v1.h | 227 -------- src/client/output_device_v1.cpp | 404 -------------- src/client/output_device_v1.h | 256 --------- src/client/output_management_v1.cpp | 106 ---- src/client/output_management_v1.h | 123 ----- .../kwinft-output-device-unstable-v1.xml | 212 ------- .../kwinft-output-management-unstable-v1.xml | 202 ------- src/client/registry.cpp | 29 - src/client/registry.h | 80 --- tests/globals.h | 1 - 37 files changed, 4045 deletions(-) delete mode 100644 autotests/client/output_device.cpp delete mode 100644 autotests/client/output_management.cpp delete mode 100644 server/output_changeset_v1.cpp delete mode 100644 server/output_changeset_v1.h delete mode 100644 server/output_changeset_v1_p.h delete mode 100644 server/output_configuration_v1.cpp delete mode 100644 server/output_configuration_v1.h delete mode 100644 server/output_configuration_v1_p.h delete mode 100644 server/output_device_v1.cpp delete mode 100644 server/output_device_v1.h delete mode 100644 server/output_device_v1_p.h delete mode 100644 server/output_management_v1.cpp delete mode 100644 server/output_management_v1.h delete mode 100644 src/client/output_configuration_v1.cpp delete mode 100644 src/client/output_configuration_v1.h delete mode 100644 src/client/output_device_v1.cpp delete mode 100644 src/client/output_device_v1.h delete mode 100644 src/client/output_management_v1.cpp delete mode 100644 src/client/output_management_v1.h delete mode 100644 src/client/protocols/kwinft-output-device-unstable-v1.xml delete mode 100644 src/client/protocols/kwinft-output-management-unstable-v1.xml diff --git a/autotests/client/CMakeLists.txt b/autotests/client/CMakeLists.txt index db4d8781..bf0f532f 100644 --- a/autotests/client/CMakeLists.txt +++ b/autotests/client/CMakeLists.txt @@ -159,36 +159,6 @@ target_link_libraries(testShmPool add_test(NAME wrapland-testShmPool COMMAND testShmPool) ecm_mark_as_test(testShmPool) -# ################################################################################################## -# Test KWin OutputManagement -# ################################################################################################## -set(testOutputManagement_SRCS output_management.cpp) -add_executable(testOutputManagement ${testOutputManagement_SRCS}) -target_link_libraries(testOutputManagement - Qt5::Test - Qt5::Gui - Wrapland::Client - Wrapland::Server - Wayland::Client -) -add_test(NAME wrapland-testOutputManagement COMMAND testOutputManagement) -ecm_mark_as_test(testOutputManagement) - -# ################################################################################################## -# Test KWin OutputDevice -# ################################################################################################## -set(testOutputDevice_SRCS output_device.cpp) -add_executable(testOutputDevice ${testOutputDevice_SRCS}) -target_link_libraries(testOutputDevice - Qt5::Test - Qt5::Gui - Wrapland::Client - Wrapland::Server - Wayland::Client -) -add_test(NAME wrapland-testOutputDevice COMMAND testOutputDevice) -ecm_mark_as_test(testOutputDevice) - # ################################################################################################## # Test wlroots based OutputManagement # ################################################################################################## diff --git a/autotests/client/output_device.cpp b/autotests/client/output_device.cpp deleted file mode 100644 index 95eb2773..00000000 --- a/autotests/client/output_device.cpp +++ /dev/null @@ -1,509 +0,0 @@ -/******************************************************************** -Copyright © 2014 Martin Gräßlin -Copyright © 2015 Sebastian Kügler -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/output_device_v1.h" -#include "../../src/client/registry.h" - -#include "../../server/display.h" -#include "../../server/output.h" -#include "../../server/output_manager.h" - -#include - -#include - -namespace Srv = Wrapland::Server; -namespace Clt = Wrapland::Client; - -class TestOutputDevice : public QObject -{ - Q_OBJECT -public: - explicit TestOutputDevice(QObject* parent = nullptr); - -private Q_SLOTS: - void init(); - void cleanup(); - - void testRegistry(); - - void testEnabled(); - void testModeChanges(); - - void testTransform_data(); - void testTransform(); - - void testDone(); - -private: - struct { - std::unique_ptr display; - std::unique_ptr output; - std::unique_ptr output_manager; - } server; - - std::string m_name = "HDMI-A"; - std::string m_make = "Foocorp"; - std::string m_model = "Barmodel"; - std::string m_description; - std::string m_serialNumber = "23498723948723"; - - Wrapland::Client::ConnectionThread* m_connection; - Wrapland::Client::EventQueue* m_queue; - QThread* m_thread; -}; - -constexpr auto socket_name{"wrapland-test-wayland-output-0"}; - -TestOutputDevice::TestOutputDevice(QObject* parent) - : QObject(parent) - , m_connection(nullptr) - , m_queue(nullptr) - , m_thread(nullptr) -{ -} - -void TestOutputDevice::init() -{ - server.display = std::make_unique(); - server.output_manager = std::make_unique(*server.display); - - server.display->set_socket_name(std::string(socket_name)); - server.display->start(); - QVERIFY(server.display->running()); - - Srv::output_metadata meta{.name = m_name, - .make = m_make, - .model = m_model, - .serial_number = m_serialNumber, - .physical_size = {200, 100}}; - server.output = std::make_unique(meta, *server.output_manager); - - Srv::output_mode m0; - m0.id = 0; - m0.size = QSize(800, 600); - m0.preferred = true; - server.output->add_mode(m0); - - Srv::output_mode m1; - m1.id = 1; - m1.size = QSize(1024, 768); - server.output->add_mode(m1); - - Srv::output_mode m2; - m2.id = 2; - m2.size = QSize(1280, 1024); - m2.refresh_rate = 90000; - server.output->add_mode(m2); - - server.output->set_mode(1); - - m_description = server.output->get_metadata().description; - QCOMPARE(m_description, m_make + " " + m_model + " (" + m_name + ")"); - - server.output->set_enabled(true); - server.output->done(); - - // setup connection - m_connection = new Wrapland::Client::ConnectionThread; - QSignalSpy connectedSpy(m_connection, &Wrapland::Client::ConnectionThread::establishedChanged); - m_connection->setSocketName(socket_name); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->establishConnection(); - QVERIFY(connectedSpy.count() || connectedSpy.wait()); - QCOMPARE(connectedSpy.count(), 1); - - m_queue = new Wrapland::Client::EventQueue(this); - QVERIFY(!m_queue->isValid()); - m_queue->setup(m_connection); - QVERIFY(m_queue->isValid()); -} - -void TestOutputDevice::cleanup() -{ - if (m_queue) { - delete m_queue; - m_queue = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - delete m_connection; - m_connection = nullptr; - - server = {}; -} - -void TestOutputDevice::testRegistry() -{ - server.output->set_geometry(QRectF(QPointF(100, 50), QSizeF(400, 200))); - server.output->done(); - - Wrapland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Wrapland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &Wrapland::Client::Registry::outputDeviceV1Announced); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - Wrapland::Client::OutputDeviceV1 output; - QVERIFY(!output.isValid()); - QCOMPARE(output.geometry(), QRectF()); - QCOMPARE(output.make(), QString()); - QCOMPARE(output.model(), QString()); - QCOMPARE(output.physicalSize(), QSize()); - QCOMPARE(output.pixelSize(), QSize()); - QCOMPARE(output.refreshRate(), 0); - QCOMPARE(output.transform(), Clt::OutputDeviceV1::Transform::Normal); - QCOMPARE(output.enabled(), Clt::OutputDeviceV1::Enablement::Enabled); - QCOMPARE(output.serialNumber(), QString()); - - QSignalSpy outputChanged(&output, &Wrapland::Client::OutputDeviceV1::done); - QVERIFY(outputChanged.isValid()); - - output.setup(registry.bindOutputDeviceV1(announced.first().first().value(), - announced.first().last().value())); - wl_display_flush(m_connection->display()); - - QVERIFY(outputChanged.wait()); - - QCOMPARE(output.geometry(), QRectF(100, 50, 400, 200)); - QCOMPARE(output.physicalSize(), QSize(200, 100)); - QCOMPARE(output.pixelSize(), QSize(1024, 768)); - QCOMPARE(output.refreshRate(), 60000); - // for xwayland transform is normal - QCOMPARE(output.transform(), Wrapland::Client::OutputDeviceV1::Transform::Normal); - - QCOMPARE(output.enabled(), Clt::OutputDeviceV1::Enablement::Enabled); - QCOMPARE(output.name(), QString::fromStdString(m_name)); - QCOMPARE(output.make(), QString::fromStdString(m_make)); - QCOMPARE(output.model(), QString::fromStdString(m_model)); - QCOMPARE(output.description(), QString::fromStdString(m_description)); - QCOMPARE(output.serialNumber(), QString::fromStdString(m_serialNumber)); -} - -void TestOutputDevice::testModeChanges() -{ - using namespace Wrapland::Client; - Wrapland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Wrapland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &Wrapland::Client::Registry::outputDeviceV1Announced); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - Wrapland::Client::OutputDeviceV1 output; - QSignalSpy outputChanged(&output, &Wrapland::Client::OutputDeviceV1::changed); - QVERIFY(outputChanged.isValid()); - QSignalSpy modeAddedSpy(&output, &Wrapland::Client::OutputDeviceV1::modeAdded); - QVERIFY(modeAddedSpy.isValid()); - QSignalSpy doneSpy(&output, &Wrapland::Client::OutputDeviceV1::done); - QVERIFY(doneSpy.isValid()); - output.setup(registry.bindOutputDeviceV1(announced.first().first().value(), - announced.first().last().value())); - wl_display_flush(m_connection->display()); - QVERIFY(doneSpy.wait()); - QCOMPARE(modeAddedSpy.count(), 3); - - QCOMPARE(modeAddedSpy.at(0).first().value().size, QSize(800, 600)); - QCOMPARE(modeAddedSpy.at(0).first().value().refreshRate, 60000); - QCOMPARE(modeAddedSpy.at(0).first().value().preferred, true); - QVERIFY(modeAddedSpy.at(0).first().value().id > -1); - - QCOMPARE(modeAddedSpy.at(1).first().value().size, QSize(1280, 1024)); - QCOMPARE(modeAddedSpy.at(1).first().value().refreshRate, 90000); - QCOMPARE(modeAddedSpy.at(1).first().value().preferred, false); - QVERIFY(modeAddedSpy.at(1).first().value().id > -1); - - QCOMPARE(modeAddedSpy.at(2).first().value().size, QSize(1024, 768)); - QCOMPARE(modeAddedSpy.at(2).first().value().refreshRate, 60000); - QCOMPARE(modeAddedSpy.at(2).first().value().id, output.currentMode().id); - - auto modes = output.modes(); - QVERIFY(modeAddedSpy.at(2).first().value().id > -1); - QCOMPARE(modes.size(), 3); - QCOMPARE(modes.at(0), modeAddedSpy.at(0).first().value()); - QCOMPARE(modes.at(1), modeAddedSpy.at(1).first().value()); - QCOMPARE(modes.at(2), modeAddedSpy.at(2).first().value()); - - QCOMPARE(output.pixelSize(), QSize(1024, 768)); - - // change the current mode - outputChanged.clear(); - QSignalSpy modeChangedSpy(&output, &Wrapland::Client::OutputDeviceV1::modeChanged); - QVERIFY(modeChangedSpy.isValid()); - server.output->set_mode(0); - server.output->done(); - QVERIFY(doneSpy.wait()); - QCOMPARE(modeChangedSpy.size(), 1); - - // the one which got the current flag - QCOMPARE(modeChangedSpy.first().first().value().size, QSize(800, 600)); - QCOMPARE(modeChangedSpy.first().first().value().refreshRate, 60000); - QCOMPARE(modeChangedSpy.first().first().value().preferred, true); - QCOMPARE(modeChangedSpy.first().first().value().id, - output.currentMode().id); - QVERIFY(!outputChanged.isEmpty()); - QCOMPARE(output.pixelSize(), QSize(800, 600)); - - auto modes2 = output.modes(); - QCOMPARE(modes2.at(0).size, QSize(800, 600)); - QCOMPARE(modes2.at(0).refreshRate, 60000); - QCOMPARE(modes2.at(0).preferred, true); - QCOMPARE(modes2.at(0).id, output.currentMode().id); - QCOMPARE(modes2.at(1).size, QSize(1280, 1024)); - QCOMPARE(modes2.at(1).refreshRate, 90000); - QCOMPARE(modes2.at(1).preferred, false); - QVERIFY(modes2.at(1).id != output.currentMode().id); - QCOMPARE(modes2.at(2).size, QSize(1024, 768)); - QCOMPARE(modes2.at(2).refreshRate, 60000); - QCOMPARE(modes2.at(2).preferred, false); - QVERIFY(modes2.at(2).id != output.currentMode().id); - - // change once more - outputChanged.clear(); - modeChangedSpy.clear(); - server.output->set_mode(2); - server.output->done(); - QVERIFY(doneSpy.wait()); - QCOMPARE(modeChangedSpy.size(), 1); - - // the one which got the current flag - QCOMPARE(modeChangedSpy.last().first().value().size, QSize(1280, 1024)); - QCOMPARE(modeChangedSpy.last().first().value().refreshRate, 90000); - QCOMPARE(modeChangedSpy.last().first().value().preferred, false); - QCOMPARE(modeChangedSpy.last().first().value().id, - output.currentMode().id); - QVERIFY(!outputChanged.isEmpty()); - QCOMPARE(output.pixelSize(), QSize(1280, 1024)); -} - -void TestOutputDevice::testTransform_data() -{ - QTest::addColumn("expected"); - QTest::addColumn("actual"); - - QTest::newRow("90") << Clt::OutputDeviceV1::Transform::Rotated90 - << Srv::output_transform::rotated_90; - QTest::newRow("180") << Clt::OutputDeviceV1::Transform::Rotated180 - << Srv::output_transform::rotated_180; - QTest::newRow("270") << Clt::OutputDeviceV1::Transform::Rotated270 - << Srv::output_transform::rotated_270; - QTest::newRow("Flipped") << Clt::OutputDeviceV1::Transform::Flipped - << Srv::output_transform::flipped; - QTest::newRow("Flipped 90") << Clt::OutputDeviceV1::Transform::Flipped90 - << Srv::output_transform::flipped_90; - QTest::newRow("Flipped 180") << Clt::OutputDeviceV1::Transform::Flipped180 - << Srv::output_transform::flipped_180; - QTest::newRow("Flipped 280") << Clt::OutputDeviceV1::Transform::Flipped270 - << Srv::output_transform::flipped_270; -} - -void TestOutputDevice::testTransform() -{ - using namespace Wrapland::Client; - using namespace Wrapland::Server; - QFETCH(Srv::output_transform, actual); - server.output->set_transform(actual); - server.output->done(); - - Wrapland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Wrapland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &Wrapland::Client::Registry::outputDeviceV1Announced); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - Wrapland::Client::OutputDeviceV1* output - = registry.createOutputDeviceV1(announced.first().first().value(), - announced.first().last().value(), - ®istry); - QSignalSpy outputChanged(output, &Wrapland::Client::OutputDeviceV1::done); - QVERIFY(outputChanged.isValid()); - wl_display_flush(m_connection->display()); - QVERIFY(outputChanged.wait()); - - QTEST(output->transform(), "expected"); - - // change back to normal - outputChanged.clear(); - server.output->set_transform(Srv::output_transform::normal); - server.output->done(); - QVERIFY(outputChanged.wait()); - QCOMPARE(output->transform(), Clt::OutputDeviceV1::Transform::Normal); -} - -void TestOutputDevice::testEnabled() -{ - Wrapland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Wrapland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &Wrapland::Client::Registry::outputDeviceV1Announced); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - Wrapland::Client::OutputDeviceV1 output; - QSignalSpy outputChanged(&output, &Wrapland::Client::OutputDeviceV1::done); - QVERIFY(outputChanged.isValid()); - output.setup(registry.bindOutputDeviceV1(announced.first().first().value(), - announced.first().last().value())); - wl_display_flush(m_connection->display()); - QVERIFY(outputChanged.wait()); - - QCOMPARE(output.enabled(), Clt::OutputDeviceV1::Enablement::Enabled); - - QSignalSpy changed(&output, &Wrapland::Client::OutputDeviceV1::changed); - QSignalSpy enabledChanged(&output, &Wrapland::Client::OutputDeviceV1::enabledChanged); - QVERIFY(changed.isValid()); - QVERIFY(enabledChanged.isValid()); - - server.output->set_enabled(false); - server.output->done(); - QVERIFY(enabledChanged.wait()); - QCOMPARE(output.enabled(), Clt::OutputDeviceV1::Enablement::Disabled); - if (changed.count() != enabledChanged.count()) { - QVERIFY(changed.wait()); - } - QCOMPARE(changed.count(), enabledChanged.count()); - - server.output->set_enabled(true); - server.output->done(); - QVERIFY(enabledChanged.wait()); - QCOMPARE(output.enabled(), Clt::OutputDeviceV1::Enablement::Enabled); - if (changed.count() != enabledChanged.count()) { - QVERIFY(changed.wait()); - } - QCOMPARE(changed.count(), enabledChanged.count()); -} -#if 0 -void TestOutputDevice::testEdid() -{ - Wrapland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Wrapland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &Wrapland::Client::Registry::outputDeviceAnnounced); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - Wrapland::Client::OutputDeviceV1 output; - - QCOMPARE(output.edid(), QByteArray()); - - QSignalSpy outputChanged(&output, &Wrapland::Client::OutputDeviceV1::done); - QVERIFY(outputChanged.isValid()); - output.setup(registry.bindOutputDeviceV1(announced.first().first().value(), - announced.first().last().value())); - wl_display_flush(m_connection->display()); - QVERIFY(outputChanged.wait()); - QCOMPARE(output.edid(), m_edid); -} - -void TestOutputDevice::testId() -{ - Wrapland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Wrapland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &Wrapland::Client::Registry::outputDeviceAnnounced); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - Wrapland::Client::OutputDeviceV1 output; - QSignalSpy outputChanged(&output, &Wrapland::Client::OutputDeviceV1::done); - QVERIFY(outputChanged.isValid()); - output.setup(registry.bindOutputDeviceV1(announced.first().first().value(), - announced.first().last().value())); - wl_display_flush(m_connection->display()); - QVERIFY(outputChanged.wait()); - - QCOMPARE(output.uuid(), QByteArray("1337")); - - QSignalSpy idChanged(&output, &Wrapland::Client::OutputDeviceV1::uuidChanged); - QVERIFY(idChanged.isValid()); - - server.output->setUuid("42"); - QVERIFY(idChanged.wait()); - QCOMPARE(idChanged.first().first().toByteArray(), QByteArray("42")); - idChanged.clear(); - QCOMPARE(output.uuid(), QByteArray("42")); - - server.output->setUuid("4711"); - QVERIFY(idChanged.wait()); - QCOMPARE(idChanged.first().first().toByteArray(), QByteArray("4711")); - idChanged.clear(); - QCOMPARE(output.uuid(), QByteArray("4711")); -} -#endif -void TestOutputDevice::testDone() -{ - Wrapland::Client::Registry registry; - QSignalSpy interfacesAnnouncedSpy(®istry, &Wrapland::Client::Registry::interfacesAnnounced); - QVERIFY(interfacesAnnouncedSpy.isValid()); - QSignalSpy announced(®istry, &Wrapland::Client::Registry::outputDeviceV1Announced); - registry.setEventQueue(m_queue); - registry.create(m_connection->display()); - QVERIFY(registry.isValid()); - registry.setup(); - wl_display_flush(m_connection->display()); - QVERIFY(interfacesAnnouncedSpy.wait()); - - Wrapland::Client::OutputDeviceV1 output; - QSignalSpy outputDone(&output, &Wrapland::Client::OutputDeviceV1::done); - QVERIFY(outputDone.isValid()); - output.setup(registry.bindOutputDeviceV1(announced.first().first().value(), - announced.first().last().value())); - wl_display_flush(m_connection->display()); - QVERIFY(outputDone.wait()); -} - -QTEST_GUILESS_MAIN(TestOutputDevice) -#include "output_device.moc" diff --git a/autotests/client/output_management.cpp b/autotests/client/output_management.cpp deleted file mode 100644 index 1113716d..00000000 --- a/autotests/client/output_management.cpp +++ /dev/null @@ -1,520 +0,0 @@ -/******************************************************************** -Copyright © 2014 Martin Gräßlin -Copyright © 2015 Sebastian Kügler -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "../../src/client/connection_thread.h" -#include "../../src/client/event_queue.h" -#include "../../src/client/output.h" -#include "../../src/client/output_configuration_v1.h" -#include "../../src/client/output_device_v1.h" -#include "../../src/client/output_management_v1.h" -#include "../../src/client/registry.h" - -#include "../../server/compositor.h" -#include "../../server/display.h" -#include "../../server/output_changeset_v1.h" -#include "../../server/output_configuration_v1.h" -#include "../../server/output_device_v1.h" -#include "../../server/output_management_v1.h" - -#include "../../tests/globals.h" - -#include -#include - -namespace Srv = Wrapland::Server; -namespace Clt = Wrapland::Client; - -class TestOutputManagement : public QObject -{ - Q_OBJECT -public: - explicit TestOutputManagement(QObject* parent = nullptr); -private Q_SLOTS: - void init(); - void cleanup(); - void createConfig(); - - void testBasicMemoryManagement(); - void testMultipleSettings(); - void testConfigFailed(); - void testApplied(); - void testFailed(); - - void testExampleConfig(); -#if 0 - void testScale(); -#endif - - void testRemoval(); - -private: - void createOutputDevices(); - void testEnable(); - void applyPendingChanges(Srv::OutputConfigurationV1* configurationInterface); - - struct { - std::unique_ptr display; - std::unique_ptr output; - Wrapland::Server::globals globals; - } server; - - Clt::Registry* m_registry = nullptr; - Clt::OutputDeviceV1* m_outputDevice = nullptr; - Clt::OutputManagementV1* m_outputManagement = nullptr; - Clt::OutputConfigurationV1* m_outputConfiguration = nullptr; - QList m_clientOutputs; - QList m_modes; - - Clt::ConnectionThread* m_connection = nullptr; - Clt::EventQueue* m_queue = nullptr; - QThread* m_thread; - - QSignalSpy* m_announcedSpy; - QSignalSpy* m_omSpy; - QSignalSpy* m_configSpy; -}; - -constexpr auto socket_name{"wrapland-test-output-0"}; - -TestOutputManagement::TestOutputManagement(QObject* parent) - : QObject(parent) - , m_connection(nullptr) - , m_queue(nullptr) - , m_thread(nullptr) - , m_announcedSpy(nullptr) -{ - qRegisterMetaType(); -} - -void TestOutputManagement::init() -{ - using namespace Wrapland::Server; - - server.display = std::make_unique(); - server.display->set_socket_name(socket_name); - server.display->start(); - QVERIFY(server.display->running()); - - server.globals.output_manager - = std::make_unique(*server.display); - server.globals.compositor - = std::make_unique(server.display.get()); - server.output = std::make_unique(*server.globals.output_manager); - - Srv::output_mode m0; - m0.id = 0; - m0.size = QSize(800, 600); - m0.preferred = true; - server.output->add_mode(m0); - - Srv::output_mode m1; - m1.id = 1; - m1.size = QSize(1024, 768); - server.output->add_mode(m1); - - Srv::output_mode m2; - m2.id = 2; - m2.size = QSize(1280, 1024); - m2.refresh_rate = 90000; - server.output->add_mode(m2); - - Srv::output_mode m3; - m3.id = 3; - m3.size = QSize(1920, 1080); - m3.refresh_rate = 100000; - server.output->add_mode(m3); - - m_modes << m0 << m1 << m2 << m3; - - server.output->set_mode(1); - server.output->set_geometry(QRectF(QPointF(0, 1920), QSizeF(1024, 768))); - server.output->set_enabled(true); - server.output->done(); - - server.globals.output_manager->management_v1 - = std::make_unique(server.display.get()); - - // setup connection - m_connection = new Clt::ConnectionThread; - QSignalSpy connectedSpy(m_connection, &Clt::ConnectionThread::establishedChanged); - m_connection->setSocketName(socket_name); - - m_thread = new QThread(this); - m_connection->moveToThread(m_thread); - m_thread->start(); - - m_connection->establishConnection(); - QVERIFY(connectedSpy.count() || connectedSpy.wait()); - QCOMPARE(connectedSpy.count(), 1); - - m_queue = new Clt::EventQueue(this); - QVERIFY(!m_queue->isValid()); - m_queue->setup(m_connection); - QVERIFY(m_queue->isValid()); - - m_registry = new Clt::Registry(); - - m_announcedSpy = new QSignalSpy(m_registry, &Clt::Registry::outputManagementV1Announced); - m_omSpy = new QSignalSpy(m_registry, &Clt::Registry::outputDeviceV1Announced); - - QVERIFY(m_announcedSpy->isValid()); - QVERIFY(m_omSpy->isValid()); - - m_registry->create(m_connection->display()); - QVERIFY(m_registry->isValid()); - m_registry->setEventQueue(m_queue); - m_registry->setup(); - wl_display_flush(m_connection->display()); - - QVERIFY(m_announcedSpy->wait()); - QCOMPARE(m_announcedSpy->count(), 1); - - m_outputManagement - = m_registry->createOutputManagementV1(m_announcedSpy->first().first().value(), - m_announcedSpy->first().last().value()); - createOutputDevices(); -} - -void TestOutputManagement::cleanup() -{ - if (m_outputConfiguration) { - delete m_outputConfiguration; - m_outputConfiguration = nullptr; - } - delete m_outputDevice; - m_clientOutputs.clear(); - if (m_outputManagement) { - delete m_outputManagement; - m_outputManagement = nullptr; - } - - delete m_announcedSpy; - delete m_omSpy; - - if (m_registry) { - delete m_registry; - m_registry = nullptr; - } - if (m_queue) { - delete m_queue; - m_queue = nullptr; - } - if (m_connection) { - m_connection->deleteLater(); - m_connection = nullptr; - } - if (m_thread) { - m_thread->quit(); - m_thread->wait(); - delete m_thread; - m_thread = nullptr; - } - - server = {}; -} - -void TestOutputManagement::createConfig() -{ - m_outputConfiguration = m_outputManagement->createConfiguration(); -} - -void TestOutputManagement::applyPendingChanges(Srv::OutputConfigurationV1* configurationInterface) -{ - auto changes = configurationInterface->changes(); - for (auto outputdevice : changes.keys()) { - auto c = changes[outputdevice]; - if (c->enabledChanged()) { - outputdevice->output()->set_enabled(c->enabled()); - } - if (c->modeChanged()) { - outputdevice->output()->set_mode(c->mode()); - } - if (c->transformChanged()) { - outputdevice->output()->set_transform(c->transform()); - } - if (c->geometryChanged()) { - outputdevice->output()->set_geometry(c->geometry()); - } - } -} - -void TestOutputManagement::createOutputDevices() -{ - QCOMPARE(m_omSpy->count(), 1); - QCOMPARE(m_registry->interfaces(Clt::Registry::Interface::OutputDeviceV1).count(), 1); - - auto output = new Clt::OutputDeviceV1(); - QVERIFY(!output->isValid()); - QCOMPARE(output->geometry(), QRect()); - QCOMPARE(output->geometry(), QRectF()); - QCOMPARE(output->make(), QString()); - QCOMPARE(output->model(), QString()); - QCOMPARE(output->physicalSize(), QSize()); - QCOMPARE(output->pixelSize(), QSize()); - QCOMPARE(output->refreshRate(), 0); - QCOMPARE(output->transform(), Clt::OutputDeviceV1::Transform::Normal); - QCOMPARE(output->enabled(), Clt::OutputDeviceV1::Enablement::Enabled); - - QSignalSpy outputChanged(output, &Clt::OutputDeviceV1::changed); - QVERIFY(outputChanged.isValid()); - - output->setup(m_registry->bindOutputDeviceV1(m_omSpy->first().first().value(), - m_omSpy->first().last().value())); - wl_display_flush(m_connection->display()); - - QVERIFY(outputChanged.wait()); - QCOMPARE(output->geometry().topLeft(), QPointF(0, 1920)); - QCOMPARE(output->enabled(), Clt::OutputDeviceV1::Enablement::Enabled); - - m_clientOutputs << output; - m_outputDevice = output; - - QVERIFY(m_outputManagement->isValid()); -} - -void TestOutputManagement::testBasicMemoryManagement() -{ - createConfig(); - - QSignalSpy serverApplySpy(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested); - Srv::OutputConfigurationV1* configurationInterface = nullptr; - connect(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested, - [=, &configurationInterface](Srv::OutputConfigurationV1* c) { - configurationInterface = c; - }); - m_outputConfiguration->apply(); - - QVERIFY(serverApplySpy.wait()); - QVERIFY(configurationInterface); - - QSignalSpy interfaceDeletedSpy(configurationInterface, - &Srv::OutputConfigurationV1::resourceDestroyed); - - delete m_outputConfiguration; - m_outputConfiguration = nullptr; - - QVERIFY(interfaceDeletedSpy.wait()); -} - -void TestOutputManagement::testRemoval() -{ - QSignalSpy outputManagementRemovedSpy(m_registry, &Clt::Registry::outputManagementV1Removed); - QVERIFY(outputManagementRemovedSpy.isValid()); - - server.globals.output_manager->management_v1.reset(); - QVERIFY(outputManagementRemovedSpy.wait(200)); - QCOMPARE(outputManagementRemovedSpy.first().first(), m_announcedSpy->first().first()); - QVERIFY(!m_registry->hasInterface(Clt::Registry::Interface::OutputManagementV1)); - QVERIFY(m_registry->interfaces(Clt::Registry::Interface::OutputManagementV1).isEmpty()); -} - -void TestOutputManagement::testApplied() -{ - createConfig(); - QVERIFY(m_outputConfiguration->isValid()); - QSignalSpy appliedSpy(m_outputConfiguration, &Clt::OutputConfigurationV1::applied); - - connect(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested, - [=](Srv::OutputConfigurationV1* configurationInterface) { - configurationInterface->setApplied(); - }); - m_outputConfiguration->apply(); - QVERIFY(appliedSpy.wait(200)); - QCOMPARE(appliedSpy.count(), 1); -} - -void TestOutputManagement::testFailed() -{ - createConfig(); - QVERIFY(m_outputConfiguration->isValid()); - QSignalSpy failedSpy(m_outputConfiguration, &Clt::OutputConfigurationV1::failed); - - connect(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested, - [=](Srv::OutputConfigurationV1* configurationInterface) { - configurationInterface->setFailed(); - }); - m_outputConfiguration->apply(); - QVERIFY(failedSpy.wait(200)); - QCOMPARE(failedSpy.count(), 1); -} - -void TestOutputManagement::testEnable() -{ - createConfig(); - auto config = m_outputConfiguration; - QVERIFY(config->isValid()); - - Clt::OutputDeviceV1* output = m_clientOutputs.first(); - QCOMPARE(output->enabled(), Clt::OutputDeviceV1::Enablement::Enabled); - - QSignalSpy enabledChanged(output, &Clt::OutputDeviceV1::enabledChanged); - QVERIFY(enabledChanged.isValid()); - - config->setEnabled(output, Clt::OutputDeviceV1::Enablement::Disabled); - - QVERIFY(!enabledChanged.wait(200)); - - QCOMPARE(enabledChanged.count(), 0); - - // Reset - config->setEnabled(output, Clt::OutputDeviceV1::Enablement::Disabled); - config->apply(); -} - -void TestOutputManagement::testMultipleSettings() -{ - createConfig(); - auto config = m_outputConfiguration; - QVERIFY(config->isValid()); - - Clt::OutputDeviceV1* output = m_clientOutputs.first(); - QSignalSpy outputChangedSpy(output, &Clt::OutputDeviceV1::changed); - - Srv::OutputConfigurationV1* configurationInterface; - connect(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested, - [=, &configurationInterface](Srv::OutputConfigurationV1* c) { - applyPendingChanges(c); - configurationInterface = c; - }); - QSignalSpy serverApplySpy(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested); - QVERIFY(serverApplySpy.isValid()); - - config->setMode(output, m_modes.first().id); - config->setTransform(output, Clt::OutputDeviceV1::Transform::Rotated90); - config->setGeometry(output, QRectF(QPoint(13, 37), output->geometry().size() / 2.0)); - config->setEnabled(output, Clt::OutputDeviceV1::Enablement::Disabled); - config->apply(); - - QVERIFY(serverApplySpy.wait(200)); - QCOMPARE(serverApplySpy.count(), 1); - - configurationInterface->setApplied(); - - QSignalSpy configAppliedSpy(config, &Clt::OutputConfigurationV1::applied); - QVERIFY(configAppliedSpy.isValid()); - QVERIFY(configAppliedSpy.wait(200)); - QCOMPARE(configAppliedSpy.count(), 1); - QCOMPARE(outputChangedSpy.count(), 0); - - config->setMode(output, m_modes.at(1).id); - config->setTransform(output, Clt::OutputDeviceV1::Transform::Normal); - config->setGeometry(output, QRectF(QPoint(0, 1920), output->geometry().size())); - config->setEnabled(output, Clt::OutputDeviceV1::Enablement::Enabled); - config->apply(); - - QVERIFY(serverApplySpy.wait(200)); - QCOMPARE(serverApplySpy.count(), 2); - - configurationInterface->setApplied(); - - QVERIFY(configAppliedSpy.wait(200)); - QCOMPARE(configAppliedSpy.count(), 2); - QCOMPARE(outputChangedSpy.count(), 0); -} - -void TestOutputManagement::testConfigFailed() -{ - createConfig(); - auto config = m_outputConfiguration; - Clt::OutputDeviceV1* output = m_clientOutputs.first(); - - QVERIFY(config->isValid()); - QVERIFY(output->isValid()); - - QSignalSpy serverApplySpy(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested); - QVERIFY(serverApplySpy.isValid()); - QSignalSpy outputChangedSpy(output, &Clt::OutputDeviceV1::changed); - QVERIFY(outputChangedSpy.isValid()); - QSignalSpy configAppliedSpy(config, &Clt::OutputConfigurationV1::applied); - QVERIFY(configAppliedSpy.isValid()); - QSignalSpy configFailedSpy(config, &Clt::OutputConfigurationV1::failed); - QVERIFY(configFailedSpy.isValid()); - - config->setMode(output, m_modes.last().id); - config->setTransform(output, Clt::OutputDeviceV1::Transform::Normal); - config->setGeometry(output, QRectF(QPoint(-1, -1), output->geometry().size())); - - config->apply(); - - connect(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested, - [=](Srv::OutputConfigurationV1* c) { c->setFailed(); }); - - QVERIFY(serverApplySpy.wait(200)); - - // Artificially make the server fail to apply the settings - // Make sure the applied signal never comes, and that failed has been received - QVERIFY(!configAppliedSpy.wait(200)); - QCOMPARE(configFailedSpy.count(), 1); - QCOMPARE(configAppliedSpy.count(), 0); -} - -void TestOutputManagement::testExampleConfig() -{ - createConfig(); - auto config = m_outputConfiguration; - Clt::OutputDeviceV1* output = m_clientOutputs.first(); - - config->setMode(output, m_clientOutputs.first()->modes().back().id); - config->setTransform(output, Clt::OutputDeviceV1::Transform::Normal); - // config->setGeometry(output, QRectF(QPoint(-1, -1), output->geometry().size())); - - QSignalSpy configAppliedSpy(config, &Clt::OutputConfigurationV1::applied); - connect(server.globals.output_manager->management_v1.get(), - &Srv::OutputManagementV1::configurationChangeRequested, - [=](Srv::OutputConfigurationV1* c) { c->setApplied(); }); - config->apply(); - - QVERIFY(configAppliedSpy.isValid()); - QVERIFY(configAppliedSpy.wait(200)); -} -#if 0 -void TestOutputManagement::testScale() -{ - createConfig(); - - auto config = m_outputConfiguration; - Clt::OutputDeviceV1 *output = m_clientOutputs.first(); - - config->setScaleF(output, 2.3); - config->apply(); - - QSignalSpy configAppliedSpy(config, &OutputConfiguration::applied); - connect(server.globals.output_manager->management_v1.get(), &Srv::OutputManagementV1::configurationChangeRequested, [=](Srv::OutputConfigurationV1 *c) { - applyPendingChanges(c); - c->setApplied(); - }); - QVERIFY(configAppliedSpy.isValid()); - QVERIFY(configAppliedSpy.wait(200)); - - QCOMPARE(wl_fixed_from_double(output->scaleF()), wl_fixed_from_double(2.3)); -} -#endif - -QTEST_GUILESS_MAIN(TestOutputManagement) -#include "output_management.moc" diff --git a/autotests/client/registry.cpp b/autotests/client/registry.cpp index fe0b5990..304c4f26 100644 --- a/autotests/client/registry.cpp +++ b/autotests/client/registry.cpp @@ -62,8 +62,6 @@ License along with this library. If not, see . #include "../../server/idle_notify_v1.h" #include "../../server/input_method_v2.h" #include "../../server/linux_dmabuf_v1.h" -#include "../../server/output_device_v1.h" -#include "../../server/output_management_v1.h" #include "../../server/plasma_activation_feedback.h" #include "../../server/presentation_time.h" #include "../../server/primary_selection.h" @@ -145,7 +143,6 @@ private Q_SLOTS: void testGlobalSync(); void testGlobalSyncThreaded(); void testAnnounceMultiple(); - void testAnnounceMultipleOutputDeviceV1s(); private: struct { @@ -184,7 +181,6 @@ void TestWaylandRegistry::init() = std::make_unique(server.display.get()); server.globals.drm_lease_device_v1 = std::make_unique(server.display.get()); - server.globals.output_manager->create_management_v1(); server.globals.output_manager->create_xdg_manager(); server.globals.output_manager->create_wlr_manager_v1(); server.globals.blur_manager @@ -550,9 +546,6 @@ void TestWaylandRegistry::testRemoval() QVERIFY(compositorAnnouncedSpy.isValid()); QSignalSpy outputAnnouncedSpy(®istry, SIGNAL(outputAnnounced(quint32, quint32))); QVERIFY(outputAnnouncedSpy.isValid()); - QSignalSpy outputDeviceAnnouncedSpy(®istry, - SIGNAL(outputDeviceV1Announced(quint32, quint32))); - QVERIFY(outputDeviceAnnouncedSpy.isValid()); QSignalSpy shellAnnouncedSpy(®istry, SIGNAL(xdgShellAnnounced(quint32, quint32))); QVERIFY(shellAnnouncedSpy.isValid()); QSignalSpy seatAnnouncedSpy(®istry, SIGNAL(seatAnnounced(quint32, quint32))); @@ -560,9 +553,6 @@ void TestWaylandRegistry::testRemoval() QSignalSpy subCompositorAnnouncedSpy(®istry, SIGNAL(subCompositorAnnounced(quint32, quint32))); QVERIFY(subCompositorAnnouncedSpy.isValid()); - QSignalSpy outputManagementAnnouncedSpy(®istry, - SIGNAL(outputManagementV1Announced(quint32, quint32))); - QVERIFY(outputManagementAnnouncedSpy.isValid()); QSignalSpy presentationAnnouncedSpy(®istry, &Registry::presentationManagerAnnounced); QVERIFY(presentationAnnouncedSpy.isValid()); QSignalSpy xdgDecorationAnnouncedSpy(®istry, @@ -583,12 +573,10 @@ void TestWaylandRegistry::testRemoval() QVERIFY(shmAnnouncedSpy.wait()); QVERIFY(!compositorAnnouncedSpy.isEmpty()); QVERIFY(!outputAnnouncedSpy.isEmpty()); - QVERIFY(!outputDeviceAnnouncedSpy.isEmpty()); QVERIFY(!presentationAnnouncedSpy.isEmpty()); QVERIFY(!shellAnnouncedSpy.isEmpty()); QVERIFY(!seatAnnouncedSpy.isEmpty()); QVERIFY(!subCompositorAnnouncedSpy.isEmpty()); - QVERIFY(!outputManagementAnnouncedSpy.isEmpty()); QVERIFY(!xdgDecorationAnnouncedSpy.isEmpty()); QVERIFY(!blurAnnouncedSpy.isEmpty()); QVERIFY(!idle_notifier_v1_spy.isEmpty()); @@ -596,14 +584,12 @@ void TestWaylandRegistry::testRemoval() QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::Compositor)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::Output)); - QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::OutputDeviceV1)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::PresentationManager)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::Seat)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::XdgShell)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::Shm)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::SubCompositor)); QVERIFY(!registry.hasInterface(Wrapland::Client::Registry::Interface::FullscreenShell)); - QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::OutputManagementV1)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::XdgDecorationUnstableV1)); QVERIFY(registry.hasInterface(Wrapland::Client::Registry::Interface::Blur)); QVERIFY( @@ -611,7 +597,6 @@ void TestWaylandRegistry::testRemoval() QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::Compositor).isEmpty()); QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::Output).isEmpty()); - QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::OutputDeviceV1).isEmpty()); QVERIFY( !registry.interfaces(Wrapland::Client::Registry::Interface::PresentationManager).isEmpty()); QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::Seat).isEmpty()); @@ -619,8 +604,6 @@ void TestWaylandRegistry::testRemoval() QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::Shm).isEmpty()); QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::SubCompositor).isEmpty()); QVERIFY(registry.interfaces(Wrapland::Client::Registry::Interface::FullscreenShell).isEmpty()); - QVERIFY( - !registry.interfaces(Wrapland::Client::Registry::Interface::OutputManagementV1).isEmpty()); QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::XdgDecorationUnstableV1) .isEmpty()); QVERIFY(!registry.interfaces(Wrapland::Client::Registry::Interface::Blur).isEmpty()); @@ -702,9 +685,6 @@ void TestWaylandRegistry::testRemoval() QSignalSpy outputRemovedSpy(®istry, SIGNAL(outputRemoved(quint32))); QVERIFY(outputRemovedSpy.isValid()); - QSignalSpy outputDeviceRemovedSpy(®istry, SIGNAL(outputDeviceV1Removed(quint32))); - QVERIFY(outputDeviceRemovedSpy.isValid()); - server.globals.outputs.clear(); QVERIFY(outputRemovedSpy.wait()); QCOMPARE(outputRemovedSpy.first().first(), outputAnnouncedSpy.first().first()); @@ -712,13 +692,6 @@ void TestWaylandRegistry::testRemoval() QVERIFY(registry.interfaces(Wrapland::Client::Registry::Interface::Output).isEmpty()); QCOMPARE(outputObjectRemovedSpy.count(), 1); - if (!outputDeviceRemovedSpy.size()) { - QVERIFY(outputDeviceRemovedSpy.wait()); - } - QCOMPARE(outputDeviceRemovedSpy.first().first(), outputDeviceAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(Wrapland::Client::Registry::Interface::OutputDeviceV1)); - QVERIFY(registry.interfaces(Wrapland::Client::Registry::Interface::OutputDeviceV1).isEmpty()); - QSignalSpy compositorRemovedSpy(®istry, SIGNAL(compositorRemoved(quint32))); QVERIFY(compositorRemovedSpy.isValid()); @@ -739,17 +712,6 @@ void TestWaylandRegistry::testRemoval() QVERIFY(registry.interfaces(Wrapland::Client::Registry::Interface::SubCompositor).isEmpty()); QCOMPARE(subcompositorObjectRemovedSpy.count(), 1); - QSignalSpy outputManagementRemovedSpy(®istry, SIGNAL(outputManagementV1Removed(quint32))); - QVERIFY(outputManagementRemovedSpy.isValid()); - - server.globals.output_manager->management_v1.reset(); - QVERIFY(outputManagementRemovedSpy.wait()); - QCOMPARE(outputManagementRemovedSpy.first().first(), - outputManagementAnnouncedSpy.first().first()); - QVERIFY(!registry.hasInterface(Wrapland::Client::Registry::Interface::OutputManagementV1)); - QVERIFY( - registry.interfaces(Wrapland::Client::Registry::Interface::OutputManagementV1).isEmpty()); - QSignalSpy xdgDecorationRemovedSpy(®istry, SIGNAL(xdgDecorationRemoved(quint32))); QVERIFY(xdgDecorationRemovedSpy.isValid()); @@ -1092,83 +1054,5 @@ void TestWaylandRegistry::testAnnounceMultiple() registry.release(); } -void TestWaylandRegistry::testAnnounceMultipleOutputDeviceV1s() -{ - using namespace Wrapland::Client; - ConnectionThread connection; - connection.setSocketName(socket_name); - QSignalSpy connectedSpy(&connection, &ConnectionThread::establishedChanged); - QVERIFY(connectedSpy.isValid()); - connection.establishConnection(); - QVERIFY(connectedSpy.count() || connectedSpy.wait()); - QCOMPARE(connectedSpy.count(), 1); - - connect(QCoreApplication::eventDispatcher(), - &QAbstractEventDispatcher::aboutToBlock, - &connection, - [&connection] { wl_display_flush(connection.display()); }); - - Registry registry; - QSignalSpy syncSpy(®istry, &Registry::interfacesAnnounced); - QVERIFY(syncSpy.isValid()); - // Most simple case: don't even use the ConnectionThread, - // just its display. - registry.create(connection.display()); - registry.setup(); - - QVERIFY(syncSpy.wait()); - QCOMPARE(syncSpy.count(), 1); - - // we should have one output now - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).count(), 1); - - QSignalSpy outputDeviceAnnouncedSpy(®istry, &Registry::outputDeviceV1Announced); - QVERIFY(outputDeviceAnnouncedSpy.isValid()); - - auto device1 = std::make_unique(*server.globals.output_manager); - QVERIFY(outputDeviceAnnouncedSpy.wait()); - - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).count(), 2); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).last().name, - outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).last().version, - outputDeviceAnnouncedSpy.first().last().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDeviceV1).name, - outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDeviceV1).version, - outputDeviceAnnouncedSpy.first().last().value()); - - auto device2 = std::make_unique(*server.globals.output_manager); - QVERIFY(outputDeviceAnnouncedSpy.wait()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).count(), 3); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).last().name, - outputDeviceAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).last().version, - outputDeviceAnnouncedSpy.last().last().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDeviceV1).name, - outputDeviceAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDeviceV1).version, - outputDeviceAnnouncedSpy.last().last().value()); - - QSignalSpy outputDeviceRemovedSpy(®istry, &Registry::outputDeviceV1Removed); - QVERIFY(outputDeviceRemovedSpy.isValid()); - - device2.reset(); - QVERIFY(outputDeviceRemovedSpy.wait()); - QCOMPARE(outputDeviceRemovedSpy.first().first().value(), - outputDeviceAnnouncedSpy.last().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).count(), 2); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).last().name, - outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interfaces(Registry::Interface::OutputDeviceV1).last().version, - outputDeviceAnnouncedSpy.first().last().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDeviceV1).name, - outputDeviceAnnouncedSpy.first().first().value()); - QCOMPARE(registry.interface(Registry::Interface::OutputDeviceV1).version, - outputDeviceAnnouncedSpy.first().last().value()); - - registry.release(); -} - QTEST_GUILESS_MAIN(TestWaylandRegistry) #include "registry.moc" diff --git a/autotests/server/display.cpp b/autotests/server/display.cpp index fcd33115..e5e96321 100644 --- a/autotests/server/display.cpp +++ b/autotests/server/display.cpp @@ -22,7 +22,6 @@ License along with this library. If not, see . #include "../../server/client.h" #include "../../server/display.h" #include "../../server/output.h" -#include "../../server/output_management_v1.h" #include "../../server/output_manager.h" #include "../../server/wl_output.h" @@ -43,7 +42,6 @@ private Q_SLOTS: void testAddRemoveOutput(); void testClientConnection(); void testConnectNoSocket(); - void testOutputManagement(); void testAutoSocketName(); }; @@ -219,14 +217,6 @@ void TestServerDisplay::testConnectNoSocket() close(sv[1]); } -void TestServerDisplay::testOutputManagement() -{ - Display display; - display.set_socket_name(std::string("wrapland-test-0")); - display.start(); - auto output_management = std::make_unique(&display); -} - void TestServerDisplay::testAutoSocketName() { QTemporaryDir runtimeDir; diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 087d3cb8..a226135d 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -27,10 +27,6 @@ set(SERVER_LIB_SRCS layer_shell_v1.cpp linux_dmabuf_v1.cpp output.cpp - output_changeset_v1.cpp - output_configuration_v1.cpp - output_device_v1.cpp - output_management_v1.cpp output_manager.cpp plasma_activation_feedback.cpp plasma_shell.cpp @@ -85,16 +81,6 @@ ecm_qt_declare_logging_category(SERVER_LIB_SRCS DEFAULT_SEVERITY Critical ) -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${Wrapland_SOURCE_DIR}/src/client/protocols/kwinft-output-management-unstable-v1.xml - BASENAME output-management-v1 -) - -ecm_add_wayland_server_protocol(SERVER_LIB_SRCS - PROTOCOL ${Wrapland_SOURCE_DIR}/src/client/protocols/kwinft-output-device-unstable-v1.xml - BASENAME output-device-v1 -) - ecm_add_wayland_server_protocol(SERVER_LIB_SRCS PROTOCOL ${Wrapland_SOURCE_DIR}/src/client/protocols/plasma-shell.xml BASENAME plasma-shell @@ -297,10 +283,6 @@ set(SERVER_GENERATED_SRCS ${CMAKE_CURRENT_BINARY_DIR}/wayland-idle-inhibit-unstable-v1-server-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-idle-server-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-linux-dmabuf-unstable-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-device-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-device-v1-server-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-management-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-management-v1-server-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-shell-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-shell-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-shell-server-protocol.h @@ -416,10 +398,6 @@ set(SERVER_LIB_HEADERS layer_shell_v1.h linux_dmabuf_v1.h output.h - output_changeset_v1.h - output_configuration_v1.h - output_device_v1.h - output_management_v1.h output_manager.h plasma_activation_feedback.h plasma_shell.h diff --git a/server/display.cpp b/server/display.cpp index 944ec3b7..0ee60c2b 100644 --- a/server/display.cpp +++ b/server/display.cpp @@ -42,9 +42,6 @@ License along with this library. If not, see . #include "keystate.h" #include "layer_shell_v1.h" #include "linux_dmabuf_v1.h" -#include "output_configuration_v1.h" -#include "output_device_v1_p.h" -#include "output_management_v1.h" #include "plasma_activation_feedback.h" #include "plasma_shell.h" #include "plasma_virtual_desktop.h" diff --git a/server/display.h b/server/display.h index b15b1f7d..6b9b830c 100644 --- a/server/display.h +++ b/server/display.h @@ -35,7 +35,6 @@ namespace Wrapland::Server class Client; class Private; -class OutputDeviceV1; class WlOutput; class AppmenuManager; @@ -56,7 +55,6 @@ class KeyState; class LayerShellV1; class linux_dmabuf_v1; class output; -class OutputManagementV1; class plasma_activation_feedback; class PlasmaShell; class PlasmaVirtualDesktopManager; @@ -141,7 +139,6 @@ class WRAPLANDSERVER_EXPORT Display : public QObject /// Graphical output management Server::XdgOutputManager* xdg_output_manager{nullptr}; Server::DpmsManager* dpms_manager{nullptr}; - Server::OutputManagementV1* output_management_v1{nullptr}; Server::wlr_output_manager_v1* wlr_output_manager_v1{nullptr}; /// Basic input diff --git a/server/output.cpp b/server/output.cpp index 079cb306..dc39fc8c 100644 --- a/server/output.cpp +++ b/server/output.cpp @@ -20,7 +20,6 @@ License along with this library. If not, see . #include "output_p.h" #include "display.h" -#include "output_device_v1_p.h" #include "output_manager.h" #include "utils.h" #include "wl_output_p.h" @@ -85,7 +84,6 @@ output_transform transform_to_output(wl_output_transform transform) output::Private::Private(output_metadata metadata, output_manager& manager, output* q_ptr) : manager{manager} - , device{new OutputDeviceV1(q_ptr, &manager.display)} , q_ptr{q_ptr} { if (metadata.description.empty()) { @@ -96,7 +94,6 @@ output::Private::Private(output_metadata metadata, output_manager& manager, outp manager.outputs.push_back(q_ptr); QObject::connect(&manager.display, &Display::destroyed, q_ptr, [this] { - device.reset(); xdg_output.reset(); wayland_output.reset(); }); @@ -137,9 +134,6 @@ void output::Private::done() wlr_head_v1 = std::make_unique(*q_ptr, *wlr_man); } } - if (device->d_ptr->broadcast()) { - device->d_ptr->done(); - } published = pending; } @@ -396,11 +390,6 @@ output_dpms_mode output::dpms_mode() const return d_ptr->dpms.mode; } -OutputDeviceV1* output::output_device_v1() const -{ - return d_ptr->device.get(); -} - WlOutput* output::wayland_output() const { return d_ptr->wayland_output.get(); diff --git a/server/output.h b/server/output.h index e51d275d..23006029 100644 --- a/server/output.h +++ b/server/output.h @@ -31,7 +31,6 @@ License along with this library. If not, see . namespace Wrapland::Server { -class OutputDeviceV1; class output_manager; class WlOutput; class XdgOutput; @@ -162,7 +161,6 @@ class WRAPLANDSERVER_EXPORT output : public QObject */ void done(); - OutputDeviceV1* output_device_v1() const; WlOutput* wayland_output() const; XdgOutput* xdg_output() const; @@ -172,7 +170,6 @@ class WRAPLANDSERVER_EXPORT output : public QObject void dpms_mode_requested(Wrapland::Server::output_dpms_mode mode); private: - friend class OutputDeviceV1; friend class WlOutput; friend class wlr_output_configuration_head_v1; friend class wlr_output_head_v1; diff --git a/server/output_changeset_v1.cpp b/server/output_changeset_v1.cpp deleted file mode 100644 index 71903bef..00000000 --- a/server/output_changeset_v1.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "output_changeset_v1_p.h" - -namespace Wrapland::Server -{ - -OutputChangesetV1::Private::Private(OutputDeviceV1* outputDevice, OutputChangesetV1* parent) - : device{outputDevice} - , enabled{device->output()->enabled()} - , modeId{device->output()->mode_id()} - , transform{device->output()->transform()} - , geometry{device->output()->geometry()} - , q_ptr{parent} -{ -} - -OutputChangesetV1::OutputChangesetV1(OutputDeviceV1* outputDevice, QObject* parent) - : QObject(parent) - , d_ptr(new Private(outputDevice, this)) -{ -} - -OutputChangesetV1::~OutputChangesetV1() = default; - -bool OutputChangesetV1::enabledChanged() const -{ - return d_ptr->enabled != d_ptr->device->output()->enabled(); -} - -bool OutputChangesetV1::enabled() const -{ - return d_ptr->enabled; -} - -bool OutputChangesetV1::modeChanged() const -{ - return d_ptr->modeId != d_ptr->device->output()->mode_id(); -} - -int OutputChangesetV1::mode() const -{ - return d_ptr->modeId; -} - -bool OutputChangesetV1::transformChanged() const -{ - return d_ptr->transform != d_ptr->device->output()->transform(); -} - -output_transform OutputChangesetV1::transform() const -{ - return d_ptr->transform; -} -bool OutputChangesetV1::geometryChanged() const -{ - return d_ptr->geometry != d_ptr->device->output()->geometry(); -} - -QRectF OutputChangesetV1::geometry() const -{ - return d_ptr->geometry; -} - -} diff --git a/server/output_changeset_v1.h b/server/output_changeset_v1.h deleted file mode 100644 index 2d942320..00000000 --- a/server/output_changeset_v1.h +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include - -#include "output.h" -#include "output_device_v1.h" - -#include -#include - -namespace Wrapland::Server -{ - -class WRAPLANDSERVER_EXPORT OutputChangesetV1 : public QObject -{ - Q_OBJECT -public: - ~OutputChangesetV1() override; - - bool enabledChanged() const; - bool transformChanged() const; - bool modeChanged() const; - bool geometryChanged() const; - bool enabled() const; - int mode() const; - output_transform transform() const; - QRectF geometry() const; - -private: - friend class OutputConfigurationV1; - explicit OutputChangesetV1(OutputDeviceV1* outputDevice, QObject* parent = nullptr); - - class Private; - std::unique_ptr d_ptr; -}; - -} diff --git a/server/output_changeset_v1_p.h b/server/output_changeset_v1_p.h deleted file mode 100644 index bc4d2632..00000000 --- a/server/output_changeset_v1_p.h +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include "output.h" -#include "output_changeset_v1.h" - -#include - -namespace Wrapland::Server -{ - -class OutputChangesetV1::Private -{ -public: - Private(OutputDeviceV1* outputDevice, OutputChangesetV1* parent); - - OutputDeviceV1* device; - - bool enabled; - int modeId; - output_transform transform; - QRectF geometry; - - OutputChangesetV1* q_ptr; -}; - -} diff --git a/server/output_configuration_v1.cpp b/server/output_configuration_v1.cpp deleted file mode 100644 index d932ea7a..00000000 --- a/server/output_configuration_v1.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "output_configuration_v1_p.h" - -#include "output_changeset_v1_p.h" -#include "output_device_v1_p.h" -#include "output_management_v1.h" - -#include "logging.h" - -#include - -namespace Wrapland::Server -{ - -const struct zkwinft_output_configuration_v1_interface OutputConfigurationV1::Private::s_interface - = { - destroyCallback, - enableCallback, - modeCallback, - transformCallback, - geometryCallback, - applyCallback, -}; - -OutputConfigurationV1::Private::Private(Client* client, - uint32_t version, - uint32_t id, - OutputManagementV1* manager, - OutputConfigurationV1* q_ptr) - : Wayland::Resource(client, - version, - id, - &zkwinft_output_configuration_v1_interface, - &s_interface, - q_ptr) - , manager{manager} -{ -} - -void OutputConfigurationV1::Private::enableCallback([[maybe_unused]] wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - int32_t wlEnable) -{ - auto priv = get_handle(wlResource)->d_ptr; - auto outputDevice = OutputDeviceV1Global::get_handle(wlOutputDevice); - - priv->pendingChanges(outputDevice)->d_ptr->enabled - = (wlEnable == ZKWINFT_OUTPUT_DEVICE_V1_ENABLEMENT_ENABLED); -} - -void OutputConfigurationV1::Private::modeCallback([[maybe_unused]] wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - int32_t mode_id) -{ - auto priv = get_handle(wlResource)->d_ptr; - auto outputDevice = OutputDeviceV1Global::get_handle(wlOutputDevice); - - bool modeValid = false; - for (auto const& mode : outputDevice->output()->modes()) { - if (mode.id == mode_id) { - modeValid = true; - break; - } - } - - if (!modeValid) { - qCWarning(WRAPLAND_SERVER, "Set invalid mode id: %d", mode_id); - return; - } - - priv->pendingChanges(outputDevice)->d_ptr->modeId = mode_id; -} - -void OutputConfigurationV1::Private::transformCallback([[maybe_unused]] wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - int32_t wlTransform) -{ - auto priv = get_handle(wlResource)->d_ptr; - auto outputDevice = OutputDeviceV1Global::get_handle(wlOutputDevice); - - auto toTransform = [](int32_t wlTransform) { - switch (wlTransform) { - case WL_OUTPUT_TRANSFORM_90: - return output_transform::rotated_90; - case WL_OUTPUT_TRANSFORM_180: - return output_transform::rotated_180; - case WL_OUTPUT_TRANSFORM_270: - return output_transform::rotated_270; - case WL_OUTPUT_TRANSFORM_FLIPPED: - return output_transform::flipped; - case WL_OUTPUT_TRANSFORM_FLIPPED_90: - return output_transform::flipped_90; - case WL_OUTPUT_TRANSFORM_FLIPPED_180: - return output_transform::flipped_180; - case WL_OUTPUT_TRANSFORM_FLIPPED_270: - return output_transform::flipped_270; - case WL_OUTPUT_TRANSFORM_NORMAL: - default: - return output_transform::normal; - } - }; - - priv->pendingChanges(outputDevice)->d_ptr->transform = toTransform(wlTransform); -} - -void OutputConfigurationV1::Private::geometryCallback([[maybe_unused]] wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - wl_fixed_t pos_x, - wl_fixed_t pos_y, - wl_fixed_t width, - wl_fixed_t height) -{ - auto priv = get_handle(wlResource)->d_ptr; - auto outputDevice = OutputDeviceV1Global::get_handle(wlOutputDevice); - - const QRectF geo(wl_fixed_to_double(pos_x), - wl_fixed_to_double(pos_y), - wl_fixed_to_double(width), - wl_fixed_to_double(height)); - - priv->pendingChanges(outputDevice)->d_ptr->geometry = geo; -} - -void OutputConfigurationV1::Private::applyCallback([[maybe_unused]] wl_client* wlClient, - wl_resource* wlResource) -{ - auto priv = get_handle(wlResource)->d_ptr; - - if (!priv->manager) { - priv->sendFailed(); - return; - } - - Q_EMIT priv->manager->configurationChangeRequested(priv->handle); -} - -QHash OutputConfigurationV1::changes() const -{ - return d_ptr->changes; -} - -void OutputConfigurationV1::setApplied() -{ - d_ptr->clearPendingChanges(); - d_ptr->sendApplied(); -} - -void OutputConfigurationV1::Private::sendApplied() -{ - send(); -} - -void OutputConfigurationV1::setFailed() -{ - d_ptr->clearPendingChanges(); - d_ptr->sendFailed(); -} - -void OutputConfigurationV1::Private::sendFailed() -{ - send(); -} - -OutputChangesetV1* OutputConfigurationV1::Private::pendingChanges(OutputDeviceV1* outputdevice) -{ - if (!changes.keys().contains(outputdevice)) { - changes[outputdevice] = new OutputChangesetV1(outputdevice, handle); - } - return changes[outputdevice]; -} - -bool OutputConfigurationV1::Private::hasPendingChanges(OutputDeviceV1* outputdevice) const -{ - if (!changes.keys().contains(outputdevice)) { - return false; - } - - auto change = changes[outputdevice]; - return change->enabledChanged() || change->modeChanged() || change->transformChanged() - || change->geometryChanged(); -} - -void OutputConfigurationV1::Private::clearPendingChanges() -{ - qDeleteAll(changes.begin(), changes.end()); - changes.clear(); -} - -OutputConfigurationV1::OutputConfigurationV1(Client* client, - uint32_t version, - uint32_t id, - OutputManagementV1* manager) - : QObject(nullptr) - , d_ptr(new Private(client, version, id, manager, this)) -{ -} - -OutputConfigurationV1::~OutputConfigurationV1() -{ - d_ptr->clearPendingChanges(); -} - -} diff --git a/server/output_configuration_v1.h b/server/output_configuration_v1.h deleted file mode 100644 index a4da0c30..00000000 --- a/server/output_configuration_v1.h +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include - -#include - -namespace Wrapland::Server -{ -class Client; -class OutputChangesetV1; -class OutputDeviceV1; -class OutputManagementV1; - -class WRAPLANDSERVER_EXPORT OutputConfigurationV1 : public QObject -{ - Q_OBJECT -public: - ~OutputConfigurationV1() override; - - QHash changes() const; - - void setApplied(); - void setFailed(); - -Q_SIGNALS: - void resourceDestroyed(); - -private: - OutputConfigurationV1(Client* client, - uint32_t version, - uint32_t id, - OutputManagementV1* manager); - friend class OutputManagementV1; - - class Private; - Private* d_ptr; -}; - -} - -Q_DECLARE_METATYPE(Wrapland::Server::OutputConfigurationV1*) diff --git a/server/output_configuration_v1_p.h b/server/output_configuration_v1_p.h deleted file mode 100644 index 0bef8611..00000000 --- a/server/output_configuration_v1_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include "output_configuration_v1.h" - -#include "wayland/global.h" -#include "wayland/resource.h" - -#include "wayland-output-device-v1-server-protocol.h" -#include "wayland-output-management-v1-server-protocol.h" - -namespace Wrapland::Server -{ - -class OutputConfigurationV1::Private : public Wayland::Resource -{ -public: - Private(Client* client, - uint32_t version, - uint32_t id, - OutputManagementV1* manager, - OutputConfigurationV1* q_ptr); - - void sendApplied(); - void sendFailed(); - void clearPendingChanges(); - - bool hasPendingChanges(OutputDeviceV1* outputdevice) const; - OutputChangesetV1* pendingChanges(OutputDeviceV1* outputdevice); - - OutputManagementV1* manager; - QHash changes; - -private: - static void enableCallback(wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - int32_t wlEnable); - static void modeCallback(wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - int32_t mode_id); - static void transformCallback(wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - int32_t wlTransform); - static void geometryCallback(wl_client* wlClient, - wl_resource* wlResource, - wl_resource* wlOutputDevice, - wl_fixed_t pos_x, - wl_fixed_t pos_y, - wl_fixed_t width, - wl_fixed_t height); - static void applyCallback(wl_client* wlClient, wl_resource* wlResource); - - static const struct zkwinft_output_configuration_v1_interface s_interface; -}; - -} diff --git a/server/output_device_v1.cpp b/server/output_device_v1.cpp deleted file mode 100644 index ca2383e4..00000000 --- a/server/output_device_v1.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "output_device_v1_p.h" - -#include "output_p.h" - -#include "display.h" - -#include "wayland-output-device-v1-server-protocol.h" - -namespace Wrapland::Server -{ - -OutputDeviceV1::Private::Private(Server::output* output, Display* display, OutputDeviceV1* q_ptr) - : OutputDeviceV1Global(q_ptr, display, &zkwinft_output_device_v1_interface, nullptr) - , output(output) -{ - create(); -} - -std::tuple -info_args(output_state const& state) -{ - return std::make_tuple(state.meta.name.c_str(), - state.meta.description.c_str(), - state.meta.make.c_str(), - state.meta.model.c_str(), - state.meta.serial_number.c_str(), - state.meta.physical_size.width(), - state.meta.physical_size.height()); -} - -std::tuple geometry_args(output_state const& state) -{ - auto const geo = state.geometry; - - return std::make_tuple(wl_fixed_from_double(geo.x()), - wl_fixed_from_double(geo.y()), - wl_fixed_from_double(geo.width()), - wl_fixed_from_double(geo.height())); -} - -void OutputDeviceV1::Private::bindInit(OutputDeviceV1Bind* bind) -{ - auto const state = output->d_ptr->published; - - send(bind, info_args(state)); - send(bind, state.enabled); - - for (auto const& mode : output->d_ptr->modes) { - if (mode != output->d_ptr->published.mode) { - sendMode(bind, mode); - } - } - sendMode(bind, output->d_ptr->published.mode); - - send(bind, output_to_transform(state.transform)); - send(bind, geometry_args(state)); - - send(bind); - bind->client->flush(); -} - -void OutputDeviceV1::Private::sendMode(OutputDeviceV1Bind* bind, output_mode const& mode) -{ - auto flags = output::Private::get_mode_flags(mode, output->d_ptr->published); - - send( - bind, flags, mode.size.width(), mode.size.height(), mode.refresh_rate, mode.id); -} - -void OutputDeviceV1::Private::sendMode(output_mode const& mode) -{ - // Only called on update. In this case we want to send the pending mode. - auto flags = output::Private::get_mode_flags(mode, output->d_ptr->pending); - - send( - flags, mode.size.width(), mode.size.height(), mode.refresh_rate, mode.id); -} - -bool OutputDeviceV1::Private::broadcast() -{ - auto const published = output->d_ptr->published; - auto const pending = output->d_ptr->pending; - - bool changed = false; - - if (published.meta.name != pending.meta.name - || published.meta.description != pending.meta.description - || published.meta.make != pending.meta.make || published.meta.model != pending.meta.model - || published.meta.serial_number != pending.meta.serial_number - || published.meta.physical_size != pending.meta.physical_size) { - send(info_args(pending)); - changed = true; - } - - if (published.enabled != pending.enabled) { - send(pending.enabled); - changed = true; - } - - if (published.mode != pending.mode) { - sendMode(pending.mode); - changed = true; - } - - if (published.transform != pending.transform) { - send(output_to_transform(pending.transform)); - changed = true; - } - - if (published.geometry != pending.geometry) { - send(geometry_args(pending)); - changed = true; - } - - return changed; -} - -void OutputDeviceV1::Private::done() -{ - send(); -} - -OutputDeviceV1::OutputDeviceV1(Server::output* output, Display* display) - : d_ptr(new Private(output, display, this)) -{ -} - -OutputDeviceV1::~OutputDeviceV1() = default; - -Server::output* OutputDeviceV1::output() const -{ - return d_ptr->output; -} - -} diff --git a/server/output_device_v1.h b/server/output_device_v1.h deleted file mode 100644 index b515bce3..00000000 --- a/server/output_device_v1.h +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include -#include - -#include - -class QRectF; - -namespace Wrapland::Server -{ -class Display; -class output; - -class WRAPLANDSERVER_EXPORT OutputDeviceV1 : public QObject -{ - Q_OBJECT -public: - ~OutputDeviceV1() override; - - Server::output* output() const; - -private: - explicit OutputDeviceV1(Server::output* output, Display* display); - - friend class Display; - friend class output; - - class Private; - std::unique_ptr d_ptr; -}; - -} diff --git a/server/output_device_v1_p.h b/server/output_device_v1_p.h deleted file mode 100644 index 04a3ff09..00000000 --- a/server/output_device_v1_p.h +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include "output.h" -#include "output_device_v1.h" - -#include "wayland/global.h" -#include "wayland/resource.h" - -namespace Wrapland::Server -{ -class Display; -class output; - -constexpr uint32_t OutputDeviceV1Version = 1; -using OutputDeviceV1Global = Wayland::Global; -using OutputDeviceV1Bind = Wayland::Bind; - -class OutputDeviceV1::Private : public OutputDeviceV1Global -{ -public: - Private(Server::output* output, Display* display, OutputDeviceV1* q_ptr); - - bool broadcast(); - void done(); - - Server::output* output; - -private: - void bindInit(OutputDeviceV1Bind* bind) override; - - void sendMode(OutputDeviceV1Bind* bind, output_mode const& mode); - void sendMode(output_mode const& mode); -}; - -} diff --git a/server/output_management_v1.cpp b/server/output_management_v1.cpp deleted file mode 100644 index acfea842..00000000 --- a/server/output_management_v1.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "output_management_v1.h" - -#include "display.h" -#include "output_configuration_v1_p.h" - -#include "wayland/global.h" - -#include "wayland-output-management-v1-server-protocol.h" - -#include - -namespace Wrapland::Server -{ - -constexpr uint32_t OutputManagementV1Version = 1; -using OutputManagementV1Global = Wayland::Global; -using OutputManagementV1Bind = Wayland::Bind; - -class OutputManagementV1::Private : public OutputManagementV1Global -{ -public: - Private(OutputManagementV1* q_ptr, Display* display); - ~Private() override; - -private: - static void createConfigurationCallback(OutputManagementV1Bind* bind, uint32_t id); - - static const struct zkwinft_output_management_v1_interface s_interface; - - std::vector m_configurations; -}; - -struct zkwinft_output_management_v1_interface const OutputManagementV1::Private::s_interface - = {cb}; - -OutputManagementV1::Private::Private(OutputManagementV1* q_ptr, Display* display) - : OutputManagementV1Global(q_ptr, - display, - &zkwinft_output_management_v1_interface, - &s_interface) -{ - create(); -} - -OutputManagementV1::Private::~Private() -{ - std::for_each(m_configurations.cbegin(), - m_configurations.cend(), - [](OutputConfigurationV1* config) { config->d_ptr->manager = nullptr; }); -} - -void OutputManagementV1::Private::createConfigurationCallback(OutputManagementV1Bind* bind, - uint32_t id) -{ - auto priv = bind->global()->handle->d_ptr.get(); - - auto config = new OutputConfigurationV1(bind->client->handle, bind->version, id, priv->handle); - priv->m_configurations.push_back(config); - - connect(config, &OutputConfigurationV1::resourceDestroyed, priv->handle, [priv, config] { - auto& configs = priv->m_configurations; - configs.erase(std::remove(configs.begin(), configs.end(), config), configs.end()); - }); -} - -OutputManagementV1::OutputManagementV1(Display* display) - : d_ptr(new Private(this, display)) -{ -} - -OutputManagementV1::~OutputManagementV1() = default; - -} diff --git a/server/output_management_v1.h b/server/output_management_v1.h deleted file mode 100644 index 626a5d63..00000000 --- a/server/output_management_v1.h +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************** -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include - -// For Qt metatype declaration. -#include "output_configuration_v1.h" - -#include - -#include - -namespace Wrapland::Server -{ -class Display; -class OutputConfigurationV1; - -class WRAPLANDSERVER_EXPORT OutputManagementV1 : public QObject -{ - Q_OBJECT -public: - explicit OutputManagementV1(Display* display); - ~OutputManagementV1() override; - -Q_SIGNALS: - void configurationChangeRequested(OutputConfigurationV1* configuration); - -private: - class Private; - std::unique_ptr d_ptr; -}; - -} diff --git a/server/output_manager.cpp b/server/output_manager.cpp index 3f97a6e4..b96e23e0 100644 --- a/server/output_manager.cpp +++ b/server/output_manager.cpp @@ -7,7 +7,6 @@ #include "display.h" #include "output.h" -#include "output_management_v1.h" #include "wlr_output_manager_v1.h" #include "xdg_output.h" @@ -41,13 +40,6 @@ XdgOutputManager& output_manager::create_xdg_manager() return *xdg_manager; } -OutputManagementV1& output_manager::create_management_v1() -{ - assert(!management_v1); - management_v1 = std::make_unique(&display); - return *management_v1; -} - wlr_output_manager_v1& output_manager::create_wlr_manager_v1() { assert(!wlr_manager_v1); diff --git a/server/output_manager.h b/server/output_manager.h index faa9fe41..0b57c7e2 100644 --- a/server/output_manager.h +++ b/server/output_manager.h @@ -15,7 +15,6 @@ namespace Wrapland::Server class output; class Display; -class OutputManagementV1; class wlr_output_manager_v1; class XdgOutputManager; @@ -28,14 +27,12 @@ class WRAPLANDSERVER_EXPORT output_manager void commit_changes() const; XdgOutputManager& create_xdg_manager(); - OutputManagementV1& create_management_v1(); wlr_output_manager_v1& create_wlr_manager_v1(); Display& display; std::vector outputs; std::unique_ptr xdg_manager; - std::unique_ptr management_v1; std::unique_ptr wlr_manager_v1; }; diff --git a/server/output_p.h b/server/output_p.h index bf730d0d..1ebc3bb0 100644 --- a/server/output_p.h +++ b/server/output_p.h @@ -26,7 +26,6 @@ License along with this library. If not, see . namespace Wrapland::Server { class Client; -class OutputDeviceV1; class WlOutput; class wlr_output_head_v1; class XdgOutput; @@ -65,7 +64,6 @@ class output::Private output_state pending; output_state published; - std::unique_ptr device; std::unique_ptr wayland_output; std::unique_ptr xdg_output; std::unique_ptr wlr_head_v1; diff --git a/server/wayland/global.h b/server/wayland/global.h index a068f4e4..5b45a3b1 100644 --- a/server/wayland/global.h +++ b/server/wayland/global.h @@ -72,8 +72,6 @@ auto& global_get_display_ref(Global& global) return globals.xdg_output_manager; } else if constexpr (std::is_same_v) { return globals.dpms_manager; - } else if constexpr (std::is_same_v) { - return globals.output_management_v1; } else if constexpr (std::is_same_v) { return globals.relative_pointer_manager_v1; } else if constexpr (std::is_same_v) { diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 5b078c11..2f11d4da 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -32,9 +32,6 @@ set(CLIENT_LIB_SRCS keyboard_shortcuts_inhibit.cpp layer_shell_v1.cpp output.cpp - output_configuration_v1.cpp - output_management_v1.cpp - output_device_v1.cpp pointer.cpp pointerconstraints.cpp pointergestures.cpp @@ -92,15 +89,6 @@ ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS BASENAME fullscreen-shell ) -ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${Wrapland_SOURCE_DIR}/src/client/protocols/kwinft-output-management-unstable-v1.xml - BASENAME output-management-v1 -) - -ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS - PROTOCOL ${Wrapland_SOURCE_DIR}/src/client/protocols/kwinft-output-device-unstable-v1.xml - BASENAME output-device-v1 -) ecm_add_wayland_client_protocol(CLIENT_LIB_SRCS PROTOCOL ${Wrapland_SOURCE_DIR}/src/client/protocols/wlr-data-control-unstable-v1.xml BASENAME wlr-data-control-v1 @@ -266,8 +254,6 @@ set(CLIENT_GENERATED_FILES ${CMAKE_CURRENT_BINARY_DIR}/wayland-drm-lease-v1-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-ext-idle-notify-v1-server-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-fullscreen-shell-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-management-v1-client-protocol.h - ${CMAKE_CURRENT_BINARY_DIR}/wayland-output-device-v1-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-wlr-data-control-unstable-v1-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-wlr-output-management-v1-client-protocol.h ${CMAKE_CURRENT_BINARY_DIR}/wayland-plasma-shell-client-protocol.h @@ -363,9 +349,6 @@ set(CLIENT_LIB_HEADERS keyboard_shortcuts_inhibit.h layer_shell_v1.h output.h - output_configuration_v1.h - output_management_v1.h - output_device_v1.h wlr_output_configuration_v1.h wlr_output_manager_v1.h pointer.h diff --git a/src/client/output_configuration_v1.cpp b/src/client/output_configuration_v1.cpp deleted file mode 100644 index 009537d6..00000000 --- a/src/client/output_configuration_v1.cpp +++ /dev/null @@ -1,198 +0,0 @@ -/******************************************************************** -Copyright © 2015 Sebastian Kügler -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "output_configuration_v1.h" - -#include "event_queue.h" -#include "output_device_v1.h" -#include "output_management_v1.h" -#include "wayland_pointer_p.h" - -#include "wayland-output-device-v1-client-protocol.h" -#include "wayland-output-management-v1-client-protocol.h" - -#include - -namespace Wrapland -{ -namespace Client -{ - -class Q_DECL_HIDDEN OutputConfigurationV1::Private -{ -public: - Private() = default; - - void setup(zkwinft_output_configuration_v1* outputConfiguration); - - WaylandPointer - outputConfiguration; - static struct zkwinft_output_configuration_v1_listener s_outputConfigurationListener; - EventQueue* queue = nullptr; - - OutputConfigurationV1* q; - -private: - static void appliedCallback(void* data, zkwinft_output_configuration_v1* config); - static void failedCallback(void* data, zkwinft_output_configuration_v1* config); -}; - -OutputConfigurationV1::OutputConfigurationV1(QObject* parent) - : QObject(parent) - , d(new Private) -{ - d->q = this; -} - -OutputConfigurationV1::~OutputConfigurationV1() -{ - release(); -} - -void OutputConfigurationV1::setup(zkwinft_output_configuration_v1* outputConfiguration) -{ - Q_ASSERT(outputConfiguration); - Q_ASSERT(!d->outputConfiguration); - d->outputConfiguration.setup(outputConfiguration); - d->setup(outputConfiguration); -} - -void OutputConfigurationV1::Private::setup(zkwinft_output_configuration_v1* outputConfiguration) -{ - zkwinft_output_configuration_v1_add_listener( - outputConfiguration, &s_outputConfigurationListener, this); -} - -void OutputConfigurationV1::release() -{ - d->outputConfiguration.release(); -} - -void OutputConfigurationV1::setEventQueue(EventQueue* queue) -{ - d->queue = queue; -} - -EventQueue* OutputConfigurationV1::eventQueue() -{ - return d->queue; -} - -OutputConfigurationV1::operator zkwinft_output_configuration_v1*() -{ - return d->outputConfiguration; -} - -OutputConfigurationV1::operator zkwinft_output_configuration_v1*() const -{ - return d->outputConfiguration; -} - -bool OutputConfigurationV1::isValid() const -{ - return d->outputConfiguration.isValid(); -} - -// Requests - -void OutputConfigurationV1::setEnabled(OutputDeviceV1* outputDevice, - OutputDeviceV1::Enablement enable) -{ - qint32 _enable = ZKWINFT_OUTPUT_DEVICE_V1_ENABLEMENT_DISABLED; - if (enable == OutputDeviceV1::Enablement::Enabled) { - _enable = ZKWINFT_OUTPUT_DEVICE_V1_ENABLEMENT_ENABLED; - } - zkwinft_output_device_v1* od = outputDevice->output(); - zkwinft_output_configuration_v1_enable(d->outputConfiguration, od, _enable); -} - -void OutputConfigurationV1::setMode(OutputDeviceV1* outputDevice, int const modeId) -{ - zkwinft_output_device_v1* od = outputDevice->output(); - zkwinft_output_configuration_v1_mode(d->outputConfiguration, od, modeId); -} - -void OutputConfigurationV1::setTransform(OutputDeviceV1* outputDevice, - OutputDeviceV1::Transform transform) -{ - auto toTransform = [transform]() { - switch (transform) { - case OutputDeviceV1::Transform::Normal: - return WL_OUTPUT_TRANSFORM_NORMAL; - case OutputDeviceV1::Transform::Rotated90: - return WL_OUTPUT_TRANSFORM_90; - case OutputDeviceV1::Transform::Rotated180: - return WL_OUTPUT_TRANSFORM_180; - case OutputDeviceV1::Transform::Rotated270: - return WL_OUTPUT_TRANSFORM_270; - case OutputDeviceV1::Transform::Flipped: - return WL_OUTPUT_TRANSFORM_FLIPPED; - case OutputDeviceV1::Transform::Flipped90: - return WL_OUTPUT_TRANSFORM_FLIPPED_90; - case OutputDeviceV1::Transform::Flipped180: - return WL_OUTPUT_TRANSFORM_FLIPPED_180; - case OutputDeviceV1::Transform::Flipped270: - return WL_OUTPUT_TRANSFORM_FLIPPED_270; - } - abort(); - }; - zkwinft_output_device_v1* od = outputDevice->output(); - zkwinft_output_configuration_v1_transform(d->outputConfiguration, od, toTransform()); -} - -void OutputConfigurationV1::setGeometry(OutputDeviceV1* outputDevice, QRectF const& geo) -{ - zkwinft_output_device_v1* od = outputDevice->output(); - zkwinft_output_configuration_v1_geometry(d->outputConfiguration, - od, - wl_fixed_from_double(geo.x()), - wl_fixed_from_double(geo.y()), - wl_fixed_from_double(geo.width()), - wl_fixed_from_double(geo.height())); -} - -void OutputConfigurationV1::apply() -{ - zkwinft_output_configuration_v1_apply(d->outputConfiguration); -} - -// Callbacks -zkwinft_output_configuration_v1_listener - OutputConfigurationV1::Private::s_outputConfigurationListener - = {appliedCallback, failedCallback}; - -void OutputConfigurationV1::Private::appliedCallback(void* data, - zkwinft_output_configuration_v1* config) -{ - Q_UNUSED(config); - auto o = reinterpret_cast(data); - Q_EMIT o->q->applied(); -} - -void OutputConfigurationV1::Private::failedCallback(void* data, - zkwinft_output_configuration_v1* config) -{ - Q_UNUSED(config); - auto o = reinterpret_cast(data); - Q_EMIT o->q->failed(); -} - -} -} diff --git a/src/client/output_configuration_v1.h b/src/client/output_configuration_v1.h deleted file mode 100644 index 5ed39758..00000000 --- a/src/client/output_configuration_v1.h +++ /dev/null @@ -1,227 +0,0 @@ -/******************************************************************** -Copyright © 2015 Sebastian Kügler -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include "output_device_v1.h" - -#include - -#include -#include -#include -// STD -#include - -class QRectF; -struct zkwinft_output_management_v1; -struct zkwinft_output_configuration_v1; - -namespace Wrapland -{ -namespace Client -{ - -class EventQueue; - -/** @class OutputConfigurationV1 - * - * OutputConfigurationV1 provides access to changing OutputDevices. The interface is async - * and atomic. An OutputConfigurationV1 is created through - OutputManagementV1::createConfiguration(). - * - * The overall mechanism is to get a new OutputConfigurationV1 from the OutputManagementV1 global - and - * apply changes through the OutputConfigurationV1::set* calls. When all changes are set, the client - * calls apply, which asks the server to look at the changes and apply them. The server will then - * signal back whether the changes have been applied successfully (@c applied()) or were rejected - * or failed to apply (@c failed()). - * - * The current settings for outputdevices can be gotten from @c Registry::outputDevices(), these - * are used in the set* calls to identify the output the setting applies to. - * - * These Wrapland classes will not apply changes to the OutputDevices, this is the compositor's - * task. As such, the configuration set through this interface can be seen as a hint what the - * compositor should set up, but whether or not the compositor does it (based on hardware or - * rendering policies, for example), is up to the compositor. The mode setting is passed on to - * the DRM subsystem through the compositor. The compositor also saves this configuration and reads - * it on startup, this interface is not involved in that process. - * - * @c apply() should only be called after changes to all output devices have been made, not after - * each change. This allows to test the new configuration as a whole, and is a lot faster since - * hardware changes can be tested in their new combination, they done in parallel.and rolled back - * as a whole. - * - * \verbatim - // We're just picking the first of our outputdevices - Wrapland::Client::OutputDevice *output = m_clientOutputs.first(); - - // Create a new configuration object - auto config = m_outputManagement.createConfiguration(); - - // handle applied and failed signals - connect(config, &OutputConfigurationV1::applied, []() { - qDebug() << "Configuration applied!"; - }); - connect(config, &OutputConfigurationV1::failed, []() { - qDebug() << "Configuration failed!"; - }); - - // Change settings - config->setMode(output, m_clientOutputs.first()->modes().last().id); - config->setTransform(output, OutputDevice::Transform::Normal); - config->setPosition(output, QPoint(0, 1920)); - config->setScale(output, 2); - - // Now ask the compositor to apply the changes - config->apply(); - // You may wait for the applied() or failed() signal here - \endverbatim - - * @see OutputDevice - * @see OutputManagementV1 - * @see OutputManagementV1::createConfiguration() - */ -class WRAPLANDCLIENT_EXPORT OutputConfigurationV1 : public QObject -{ - Q_OBJECT -public: - ~OutputConfigurationV1() override; - - /** - * Setup this OutputConfigurationV1 to manage the @p outputconfiguration. - * When using OutputManagementV1::createOutputConfiguration there is no need to call this - * method. - * @param outputconfiguration the outputconfiguration object to set up. - **/ - void setup(zkwinft_output_configuration_v1* outputconfiguration); - /** - * @returns @c true if managing a zkwinft_output_configuration_v1. - **/ - bool isValid() const; - /** - * Releases the zkwinft_output_configuration_v1 interface. - * After the interface has been released the OutputConfigurationV1 instance is no - * longer valid and can be setup with another zkwinft_output_configuration_v1 interface. - **/ - void release(); - - /** - * Sets the @p queue to use for creating a OutputConfigurationV1. - **/ - void setEventQueue(EventQueue* queue); - /** - * @returns The event queue to use for creating a OutputConfigurationV1 - **/ - EventQueue* eventQueue(); - - /** - * Enable or disable an output. Enabled means it's used by the - * compositor for rendering, Disabled means, that no wl_output - * is connected to this, and the device is sitting there unused - * by this compositor. - * The changes done in this call will be recorded in the - * OutputDevice and only applied after apply() has been called. - * - * @param outputdevice the OutputDevice this change applies to. - * @param enable new Enablement state of this output device. - */ - void setEnabled(OutputDeviceV1* outputDevice, OutputDeviceV1::Enablement enable); - - /** - * Set the mode of this output, identified by its mode id. - * The changes done in this call will be recorded in the - * OutputDevice and only applied after apply() has been called. - * - * @param outputdevice the OutputDevice this change applies to. - * @param modeId the id of the mode. - */ - void setMode(OutputDeviceV1* outputDevice, int const modeId); - /** - * Set transformation for this output, for example rotated or flipped. - * The changes done in this call will be recorded in the - * OutputDevice and only applied after apply() has been called. - * - * @param outputdevice the OutputDevice this change applies to. - * @param scale the scaling factor for this output device. - */ - void setTransform(OutputDeviceV1* outputDevice, OutputDeviceV1::Transform transform); - - /** - * Sets the geometry of this output in the global space, relative to other outputs. - * QPoint(0, 0) for top-left. The position is the top-left corner of this output. - * - * When width and height are both set to 0, no new content is posted to the output what - * implicitly disables it. - * - * The x, width and height argument must be non-negative and width must be 0 if and only if - * height is 0. - * - * The changes done in this call will be recorded in the - * OutputDevice and only applied after apply() has been called. - * - * @param outputdevice the OutputDevice this change applies to. - * @param geo the OutputDevice geometry relative to other outputs, - * - */ - void setGeometry(OutputDeviceV1* outputDevice, QRectF const& geo); - - /** - * Ask the compositor to apply the changes. - * This results in the compositor looking at all outputdevices and if they have - * pending changes from the set* calls, these changes will be tested with the - * hardware and applied if possible. The compositor will react to these changes - * with the applied() or failed() signals. Note that mode setting may take a - * while, so the interval between calling apply() and receiving the applied() - * signal may be considerable, depending on the hardware. - * - * @see applied() - * @see failed() - */ - void apply(); - - operator zkwinft_output_configuration_v1*(); - operator zkwinft_output_configuration_v1*() const; - -Q_SIGNALS: - /** - * The server has applied all settings successfully. Pending changes in the - * OutputDevices have been cleared, changed signals from the OutputDevice have - * been emitted. - */ - void applied(); - /** - * The server has failed to apply the settings or rejected them. Pending changes - * in the * OutputDevices have been cleared. No changes have been applied to the - * OutputDevices. - */ - void failed(); - -private: - friend class OutputManagementV1; - explicit OutputConfigurationV1(QObject* parent = nullptr); - class Private; - std::unique_ptr d; -}; - -} -} - -Q_DECLARE_METATYPE(Wrapland::Client::OutputConfigurationV1*) diff --git a/src/client/output_device_v1.cpp b/src/client/output_device_v1.cpp deleted file mode 100644 index 7daf091c..00000000 --- a/src/client/output_device_v1.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/******************************************************************** -Copyright © 2013 Martin Gräßlin -Copyright © 2018-2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#include "output_device_v1.h" - -#include "logging.h" -#include "wayland_pointer_p.h" - -#include -#include - -#include "wayland-output-device-v1-client-protocol.h" -#include - -namespace Wrapland -{ - -namespace Client -{ - -using Modes = std::vector; - -class Q_DECL_HIDDEN OutputDeviceV1::Private -{ -public: - Private(OutputDeviceV1* q); - void setup(zkwinft_output_device_v1* o); - - WaylandPointer output; - EventQueue* queue = nullptr; - QSize physicalSize; - QRectF geometry; - QString name; - QString description; - QString make; - QString model; - QString serialNumber; - Transform transform = Transform::Normal; - Modes modes; - Modes::iterator currentMode = modes.end(); - - OutputDeviceV1::Enablement enabled = OutputDeviceV1::Enablement::Enabled; - - bool done = false; - -private: - static void infoCallback(void* data, - zkwinft_output_device_v1* output, - char const* name, - char const* description, - char const* make, - char const* model, - char const* serial_number, - int32_t physical_width, - int32_t physical_height); - - static void enabledCallback(void* data, zkwinft_output_device_v1* output, int32_t enabled); - - static void modeCallback(void* data, - zkwinft_output_device_v1* output, - uint32_t flags, - int32_t width, - int32_t height, - int32_t refresh, - int32_t mode_id); - - static void transformCallback(void* data, zkwinft_output_device_v1* output, int32_t transform); - - static void geometryCallback(void* data, - zkwinft_output_device_v1* output, - wl_fixed_t x, - wl_fixed_t y, - wl_fixed_t width, - wl_fixed_t height); - - static void doneCallback(void* data, zkwinft_output_device_v1* output); - - void addMode(uint32_t flags, int32_t width, int32_t height, int32_t refresh, int32_t mode_id); - - OutputDeviceV1* q; - static struct zkwinft_output_device_v1_listener s_outputListener; -}; - -OutputDeviceV1::Private::Private(OutputDeviceV1* q) - : q(q) -{ -} - -void OutputDeviceV1::Private::setup(zkwinft_output_device_v1* o) -{ - Q_ASSERT(o); - Q_ASSERT(!output); - output.setup(o); - zkwinft_output_device_v1_add_listener(output, &s_outputListener, this); -} - -bool OutputDeviceV1::Mode::operator==(OutputDeviceV1::Mode const& m) const -{ - return size == m.size && refreshRate == m.refreshRate && preferred == m.preferred; -} - -zkwinft_output_device_v1_listener OutputDeviceV1::Private::s_outputListener = { - infoCallback, - enabledCallback, - modeCallback, - transformCallback, - geometryCallback, - doneCallback, -}; - -void OutputDeviceV1::Private::infoCallback(void* data, - zkwinft_output_device_v1* output, - char const* name, - char const* description, - char const* make, - char const* model, - char const* serial_number, - int32_t physical_width, - int32_t physical_height) -{ - auto out = reinterpret_cast(data); - Q_ASSERT(out->output == output); - - out->name = name; - out->description = description; - out->make = make; - out->model = model; - out->serialNumber = serial_number; - out->physicalSize = QSize(physical_width, physical_height); -} - -void OutputDeviceV1::Private::enabledCallback(void* data, - zkwinft_output_device_v1* output, - int32_t enabled) -{ - auto out = reinterpret_cast(data); - Q_ASSERT(out->output == output); - - OutputDeviceV1::Enablement _enabled = OutputDeviceV1::Enablement::Disabled; - if (enabled == ZKWINFT_OUTPUT_DEVICE_V1_ENABLEMENT_ENABLED) { - _enabled = OutputDeviceV1::Enablement::Enabled; - } - - if (out->enabled != _enabled) { - out->enabled = _enabled; - Q_EMIT out->q->enabledChanged(out->enabled); - } -} - -void OutputDeviceV1::Private::modeCallback(void* data, - zkwinft_output_device_v1* output, - uint32_t flags, - int32_t width, - int32_t height, - int32_t refresh, - int32_t mode_id) -{ - auto out = reinterpret_cast(data); - Q_ASSERT(out->output == output); - out->addMode(flags, width, height, refresh, mode_id); -} - -void OutputDeviceV1::Private::addMode(uint32_t flags, - int32_t width, - int32_t height, - int32_t refresh, - int32_t mode_id) -{ - Mode mode; - mode.refreshRate = refresh; - mode.size = QSize(width, height); - mode.id = mode_id; - if (flags & WL_OUTPUT_MODE_PREFERRED) { - mode.preferred = true; - } - - for (auto it = modes.begin(); it != modes.end(); it++) { - if ((*it).id == mode.id) { - if (flags & WL_OUTPUT_MODE_CURRENT) { - auto change = currentMode == modes.end() || (*currentMode).id != mode.id; - currentMode = it; - if (change) { - Q_EMIT q->modeChanged(mode); - } - } - // That should normally not be necessary because modes stay the same besides the - // current flag. But just to be sure when some compositors do something stupid - // and change some mode properties later on. - *it = mode; - return; - } - } - - // New mode added. - modes.push_back(mode); - if (flags & WL_OUTPUT_MODE_CURRENT) { - currentMode = modes.end() - 1; - } - - Q_EMIT q->modeAdded(mode); -} - -Wrapland::Client::OutputDeviceV1::Mode OutputDeviceV1::currentMode() const -{ - if (d->currentMode == d->modes.end()) { - qCWarning(WRAPLAND_CLIENT) << "current mode not found"; - return Mode(); - } - return *(d->currentMode); -} - -void OutputDeviceV1::Private::geometryCallback(void* data, - zkwinft_output_device_v1* output, - wl_fixed_t x, - wl_fixed_t y, - wl_fixed_t width, - wl_fixed_t height) -{ - auto out = reinterpret_cast(data); - Q_ASSERT(out->output == output); - - out->geometry = QRectF(wl_fixed_to_double(x), - wl_fixed_to_double(y), - wl_fixed_to_double(width), - wl_fixed_to_double(height)); -} - -void OutputDeviceV1::Private::transformCallback(void* data, - zkwinft_output_device_v1* output, - int32_t transform) -{ - auto out = reinterpret_cast(data); - Q_ASSERT(out->output == output); - - auto toTransform = [transform]() { - switch (transform) { - case WL_OUTPUT_TRANSFORM_90: - return Transform::Rotated90; - case WL_OUTPUT_TRANSFORM_180: - return Transform::Rotated180; - case WL_OUTPUT_TRANSFORM_270: - return Transform::Rotated270; - case WL_OUTPUT_TRANSFORM_FLIPPED: - return Transform::Flipped; - case WL_OUTPUT_TRANSFORM_FLIPPED_90: - return Transform::Flipped90; - case WL_OUTPUT_TRANSFORM_FLIPPED_180: - return Transform::Flipped180; - case WL_OUTPUT_TRANSFORM_FLIPPED_270: - return Transform::Flipped270; - case WL_OUTPUT_TRANSFORM_NORMAL: - default: - return Transform::Normal; - } - }; - out->transform = toTransform(); -} - -void OutputDeviceV1::Private::doneCallback(void* data, zkwinft_output_device_v1* output) -{ - auto out = reinterpret_cast(data); - Q_ASSERT(out->output == output); - out->done = true; - - Q_EMIT out->q->changed(); - Q_EMIT out->q->done(); -} - -void OutputDeviceV1::setup(zkwinft_output_device_v1* output) -{ - d->setup(output); -} - -EventQueue* OutputDeviceV1::eventQueue() const -{ - return d->queue; -} - -void OutputDeviceV1::setEventQueue(EventQueue* queue) -{ - d->queue = queue; -} - -OutputDeviceV1::OutputDeviceV1(QObject* parent) - : QObject(parent) - , d(new Private(this)) -{ -} - -OutputDeviceV1::~OutputDeviceV1() -{ - d->output.release(); -} - -QRectF OutputDeviceV1::geometry() const -{ - return d->geometry; -} - -QString OutputDeviceV1::name() const -{ - return d->name; -} - -QString OutputDeviceV1::description() const -{ - return d->description; -} - -QString OutputDeviceV1::make() const -{ - return d->make; -} - -QString OutputDeviceV1::model() const -{ - return d->model; -} - -QString OutputDeviceV1::serialNumber() const -{ - return d->serialNumber; -} - -zkwinft_output_device_v1* OutputDeviceV1::output() -{ - return d->output; -} - -QSize OutputDeviceV1::physicalSize() const -{ - return d->physicalSize; -} - -QSize OutputDeviceV1::pixelSize() const -{ - if (d->currentMode == d->modes.end()) { - return QSize(); - } - return (*d->currentMode).size; -} - -int OutputDeviceV1::refreshRate() const -{ - if (d->currentMode == d->modes.end()) { - return 0; - } - return (*d->currentMode).refreshRate; -} - -bool OutputDeviceV1::isValid() const -{ - return d->output.isValid(); -} - -OutputDeviceV1::Transform OutputDeviceV1::transform() const -{ - return d->transform; -} - -std::vector const& OutputDeviceV1::modes() const -{ - return d->modes; -} - -OutputDeviceV1::operator zkwinft_output_device_v1*() -{ - return d->output; -} - -OutputDeviceV1::operator zkwinft_output_device_v1*() const -{ - return d->output; -} - -OutputDeviceV1::Enablement OutputDeviceV1::enabled() const -{ - return d->enabled; -} - -void OutputDeviceV1::release() -{ - d->output.release(); -} - -} -} diff --git a/src/client/output_device_v1.h b/src/client/output_device_v1.h deleted file mode 100644 index fae0a5e3..00000000 --- a/src/client/output_device_v1.h +++ /dev/null @@ -1,256 +0,0 @@ -/******************************************************************** -Copyright © 2013 Martin Gräßlin -Copyright © 2018-2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include - -#include -#include -#include -#include -#include - -class QRectF; -struct zkwinft_output_device_v1; - -namespace Wrapland -{ -namespace Client -{ - -class EventQueue; - -/** - * @short Wrapper for the zkwinft_output_device_v1 interface. - * - * This class provides a convenient wrapper for the zkwinft_output_device_v1 interface. - * Its main purpose is to hold the information about one OutputDeviceV1. - * - * To use this class one needs to interact with the Registry. There are two - * possible ways to create an OutputDeviceV1 interface: - * @code - * OutputDeviceV1 *c = registry->createOutputDeviceV1(name, version); - * @endcode - * - * This creates the OutputDeviceV1 and sets it up directly. As an alternative this - * can also be done in a more low level way: - * @code - * OutputDeviceV1 *c = new OutputDeviceV1; - * c->setup(registry->bindOutputDeviceV1(name, version)); - * @endcode - * - * The OutputDeviceV1 can be used as a drop-in replacement for any zkwinft_output_device_v1 - * pointer as it provides matching cast operators. - * - * Please note that all properties of OutputDeviceV1 are not valid until the - * changed signal has been emitted. The wayland server is pushing the - * information in an async way to the OutputDeviceV1 instance. By emitting changed - * the OutputDeviceV1 indicates that all relevant information is available. - * - * @see Registry - **/ -class WRAPLANDCLIENT_EXPORT OutputDeviceV1 : public QObject -{ - Q_OBJECT -public: - enum class Transform { - Normal, - Rotated90, - Rotated180, - Rotated270, - Flipped, - Flipped90, - Flipped180, - Flipped270, - }; - - enum class Enablement { - Disabled = 0, - Enabled = 1, - }; - - struct Mode { - /** - * The size of this Mode in pixel space. - **/ - QSize size; - /** - * The refresh rate in mHz of this Mode. - **/ - int refreshRate = 0; - bool preferred{false}; - /** - * The id of this mode, unique per OutputDeviceV1. This id can be used to call - * OutputConfiguration->setMode(); - * @see OutputConfiguration::setMode - **/ - int id; - - bool operator==(Mode const& m) const; - }; - - explicit OutputDeviceV1(QObject* parent = nullptr); - virtual ~OutputDeviceV1(); - - /** - * Setup this Compositor to manage the @p output. - * When using Registry::createOutputDeviceV1 there is no need to call this - * method. - **/ - void setup(zkwinft_output_device_v1* output); - - /** - * @returns @c true if managing a zkwinft_output_device_v1. - **/ - bool isValid() const; - operator zkwinft_output_device_v1*(); - operator zkwinft_output_device_v1*() const; - zkwinft_output_device_v1* output(); - - /** - * Size in millimeters. - **/ - QSize physicalSize() const; - - QString name() const; - QString description() const; - - /** - * Textual description of the manufacturer. - **/ - QString make() const; - /** - * Textual description of the model. - **/ - QString model() const; - /** - * Textual representation of serial number. - */ - QString serialNumber() const; - /** - * Size in the current mode. - **/ - QSize pixelSize() const; - /** - * The geometry of this OutputDeviceV1 in pixels. - * Convenient for QRect(globalPosition(), pixelSize()). - * @see globalPosition - * @see pixelSize - **/ - QRectF geometry() const; - /** - * Refresh rate in mHz of the current mode. - **/ - int refreshRate() const; - - /** - * Transform that maps framebuffer to OutputDeviceV1. - * - * The purpose is mainly to allow clients render accordingly and tell the compositor, - * so that for fullscreen surfaces, the compositor will still be able to scan out - * directly from client surfaces. - **/ - Transform transform() const; - - /** - * @returns The Modes of this OutputDeviceV1. - **/ - std::vector const& modes() const; - - Wrapland::Client::OutputDeviceV1::Mode currentMode() const; - - /** - * Sets the @p queue to use for bound proxies. - **/ - void setEventQueue(EventQueue* queue); - /** - * @returns The event queue to use for bound proxies. - **/ - EventQueue* eventQueue() const; - - /** - * @returns Whether this output is enabled or not. - **/ - OutputDeviceV1::Enablement enabled() const; - - /** - * Releases the zkwinft_output_device_v1 interface. - * After the interface has been released the OutputDeviceV1 instance is no - * longer valid and can be setup with another zkwinft_output_device_v1 interface. - **/ - void release(); - -Q_SIGNALS: - /** - * Emitted when the output is fully initialized. - **/ - void done(); - - /** - * Emitted when the data change has been completed. - **/ - void changed(); - - /** - * Emitted whenever the enabled property changes. - **/ - void enabledChanged(OutputDeviceV1::Enablement enabled); - - /** - * Emitted whenever a new Mode is added. - * This normally only happens during the initial promoting of modes. - * Afterwards only modeChanged should be emitted. - * @param mode The newly added Mode. - * @see modeChanged - **/ - void modeAdded(Wrapland::Client::OutputDeviceV1::Mode const& mode); - - /** - * Emitted whenever a Mode changes. - * This normally means that the @c Mode::Flag::Current is added or removed. - * @param mode The changed Mode - **/ - void modeChanged(Wrapland::Client::OutputDeviceV1::Mode const& mode); - - /** - * Emitted whenever the geometry changes. - **/ - void geometryChanged(QRectF const& geometry); - - /** - * The corresponding global for this interface on the Registry got removed. - * - * This signal gets only emitted if the OutputDeviceV1 got created by - * Registry::createOutputDeviceV1 - **/ - void removed(); - -private: - class Private; - std::unique_ptr d; -}; - -} -} - -Q_DECLARE_METATYPE(Wrapland::Client::OutputDeviceV1::Transform) -Q_DECLARE_METATYPE(Wrapland::Client::OutputDeviceV1::Enablement) -Q_DECLARE_METATYPE(Wrapland::Client::OutputDeviceV1::Mode) diff --git a/src/client/output_management_v1.cpp b/src/client/output_management_v1.cpp deleted file mode 100644 index cebebe1e..00000000 --- a/src/client/output_management_v1.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * Copyright 2015 Sebastian Kügler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - ****************************************************************************/ -#include "output_management_v1.h" - -#include "event_queue.h" -#include "output_configuration_v1.h" -#include "wayland_pointer_p.h" - -#include "wayland-output-management-v1-client-protocol.h" - -namespace Wrapland -{ -namespace Client -{ - -class Q_DECL_HIDDEN OutputManagementV1::Private -{ -public: - Private() = default; - - WaylandPointer - outputManagement; - EventQueue* queue = nullptr; -}; - -OutputManagementV1::OutputManagementV1(QObject* parent) - : QObject(parent) - , d(new Private) -{ -} - -OutputManagementV1::~OutputManagementV1() -{ - d->outputManagement.release(); -} - -void OutputManagementV1::setup(zkwinft_output_management_v1* outputManagement) -{ - Q_ASSERT(outputManagement); - Q_ASSERT(!d->outputManagement); - d->outputManagement.setup(outputManagement); -} - -void OutputManagementV1::release() -{ - d->outputManagement.release(); -} - -void OutputManagementV1::setEventQueue(EventQueue* queue) -{ - d->queue = queue; -} - -EventQueue* OutputManagementV1::eventQueue() -{ - return d->queue; -} - -OutputManagementV1::operator zkwinft_output_management_v1*() -{ - return d->outputManagement; -} - -OutputManagementV1::operator zkwinft_output_management_v1*() const -{ - return d->outputManagement; -} - -bool OutputManagementV1::isValid() const -{ - return d->outputManagement.isValid(); -} - -OutputConfigurationV1* OutputManagementV1::createConfiguration(QObject* parent) -{ - Q_UNUSED(parent); - auto* config = new OutputConfigurationV1(this); - auto w = zkwinft_output_management_v1_create_configuration(d->outputManagement); - - if (d->queue) { - d->queue->addProxy(w); - } - - config->setup(w); - return config; -} - -} -} diff --git a/src/client/output_management_v1.h b/src/client/output_management_v1.h deleted file mode 100644 index fcc464ba..00000000 --- a/src/client/output_management_v1.h +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************** -Copyright © 2015 Sebastian Kügler -Copyright © 2020 Roman Gilg - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) version 3, or any -later version accepted by the membership of KDE e.V. (or its -successor approved by the membership of KDE e.V.), which shall -act as a proxy defined in Section 6 of version 3 of the license. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library. If not, see . -*********************************************************************/ -#pragma once - -#include -// STD -#include -#include - -struct zkwinft_output_configuration_v1; -struct zkwinft_output_management_v1; - -namespace Wrapland -{ -namespace Client -{ - -class EventQueue; -class OutputConfigurationV1; -class OutputDeviceV1; - -/** - * @short Wrapper for the zkwinft_output_management_v1 interface. - * - * This class provides a convenient wrapper for the zkwinft_output_management_v1 interface. - * - * To use this class one needs to interact with the Registry. There are two - * possible ways to create the OutputManagementV1 interface: - * @code - * OutputManagementV1 *c = registry->createOutputManagementV1(name, version); - * @endcode - * - * This creates the OutputManagementV1 and sets it up directly. As an alternative this - * can also be done in a more low level way: - * @code - * OutputManagementV1 *c = new OutputManagementV1; - * c->setup(registry->bindOutputManagementV1(name, version)); - * @endcode - * - * The OutputManagementV1 can be used as a drop-in replacement for any zkwinft_output_management_v1 - * pointer as it provides matching cast operators. - * - * @see Registry - * @since 5.5 - **/ -class WRAPLANDCLIENT_EXPORT OutputManagementV1 : public QObject -{ - Q_OBJECT -public: - /** - * Creates a new OutputManagementV1. - * Note: after constructing the OutputManagementV1 it is not yet valid and one needs - * to call setup. In order to get a ready to use OutputManagementV1 prefer using - * Registry::createOutputManagementV1. - **/ - explicit OutputManagementV1(QObject* parent = nullptr); - ~OutputManagementV1() override; - - /** - * Setup this OutputManagementV1 to manage the @p OutputManagementV1. - * When using Registry::createOutputManagementV1 there is no need to call this - * method. - **/ - void setup(zkwinft_output_management_v1* outputManagement); - /** - * @returns @c true if managing a zkwinft_output_management_v1. - **/ - bool isValid() const; - /** - * Releases the zkwinft_output_management_v1 interface. - * After the interface has been released the OutputManagement instance is no - * longer valid and can be setup with another zkwinft_output_management_v1 interface. - **/ - void release(); - - /** - * Sets the @p queue to use for creating objects with this OutputManagement. - **/ - void setEventQueue(EventQueue* queue); - /** - * @returns The event queue to use for creating objects with this OutputManagement. - **/ - EventQueue* eventQueue(); - - OutputConfigurationV1* createConfiguration(QObject* parent = nullptr); - - operator zkwinft_output_management_v1*(); - operator zkwinft_output_management_v1*() const; - -Q_SIGNALS: - /** - * The corresponding global for this interface on the Registry got removed. - * - * This signal gets only emitted if the OutputManagement got created by - * Registry::createOutputManagement - **/ - void removed(); - -private: - class Private; - std::unique_ptr d; -}; - -} -} diff --git a/src/client/protocols/kwinft-output-device-unstable-v1.xml b/src/client/protocols/kwinft-output-device-unstable-v1.xml deleted file mode 100644 index a9dce26d..00000000 --- a/src/client/protocols/kwinft-output-device-unstable-v1.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - Copyright © 2020 Roman Gilg - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - ]]> - - - This protocol exposes an interface for globally announced output devices. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. - - - - - An output device describes a display device available to the compositor. - output_device is similar to wl_output, but focuses on output - configuration management. - - A client can query all global output_device objects to enlist all - available display devices, even those that may currently not be - represented by the compositor as a wl_output. - - The client sends configuration changes to the server through the - output_configuration interface, and the server applies the configuration - changes to the hardware and signals changes to the output devices - accordingly. - - This object is published as global during start up for every available - display devices, or when one later becomes available, for example by - being hotplugged via a physical connector. - - - - - The info event describes some base information about the output. - - The arguments make and model should be the same as in the wl_output - interface. Together with the serial number they should be consistent - over compositor restarts such that clients are able to identify outputs - from previous sessions. - - The event is sent when binding to the output object and whenever - any of the properties change. - - - - - - - - - - - - - Describes whether a device is enabled, i.e. device is used to - display content by the compositor. This wraps a boolean around - an int to avoid a boolean trap. - - - - - - - - The enabled event notifies whether this output is currently - enabled and used for displaying content by the server. - The event is sent when binding to the output object and - whenever later on an output changes its state by becoming - enabled or disabled. - - - - - - - These flags describe properties of an output mode. They are - used in the flags bitfield of the mode event. - - - - - - - - The mode event describes an available mode for the output. - - When the client binds to the output_device object, the server sends this - event once for every available mode the output device can be operated by. - - There will always be at least one event sent out on initial binding, - which represents the current mode. - - Later on if an output changes its mode the event is sent again, whereby - this event represents the mode that has now become current. In other - words, the current mode is always represented by the latest event sent - with the current flag set. - - The size of a mode is given in physical hardware units of the output device. - This is not necessarily the same as the output size in the global compositor - space. - - The id can be used to refer to a mode when calling set_mode on an - zkwinft_output_configuration_v1 object. - - - - - - - - - - - This describes the transform, that a compositor will apply to a - surface to compensate for the rotation or mirroring of an - output device. - - The flipped values correspond to an initial flip around a - vertical axis followed by rotation. - - The purpose is mainly to allow clients to render accordingly and - tell the compositor, so that for fullscreen surfaces, the - compositor is still able to scan out directly client surfaces. - - - - - - - - - - - - - - - This event describes the current transformation of the output, which determines how - the rectangle send in the geometry will be transformed when being put out on the - physical screen. - - The event is sent when binding to the output object and whenever - the transformation changes. - - - - - - - The geometry event describes the logical position and size of the output in - compositor space. - - The width and height argument are take the current transform into account. This - means the rectangle defined by x, y, width, height will be transformed according to - the transform value before put out on the output. - - The event is sent when binding to the output object and whenever - any of the properties change. - - - - - - - - - - This event is sent after all other properties have been - sent on binding to the output object as well as after any - other output property change have been applied later on. - This allows to see changes to the output properties as atomic, - even if multiple events successively announce them. - - - - - diff --git a/src/client/protocols/kwinft-output-management-unstable-v1.xml b/src/client/protocols/kwinft-output-management-unstable-v1.xml deleted file mode 100644 index 66fde155..00000000 --- a/src/client/protocols/kwinft-output-management-unstable-v1.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - Copyright © 2020 Roman Gilg - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - ]]> - - - This protocol exposes interfaces to change the configuration of current - outputs. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. - - - - - This interface enables clients to set properties of output devices for screen - configuration purposes via the server. To this end output devices are referenced - by global zkwinft_output_device_v1 objects. - - output_management (wl_global) - -------------------------- - request: - * create_configuration -> output_configuration (wl_resource) - - output_configuration (wl_resource) - -------------------------- - requests: - * enable(output_device, bool) - * mode(output_device, mode_id) - * transformation(output_device, flag) - * position(output_device, x, y) - * apply - - events: - * applied - * failed - - The server registers one output_management object as a global object. In order - to configure outputs a client requests create_configuration, which provides a - resource referencing an output_configuration for one-time configuration. That - way the server knows which requests belong together and can group them by that. - - On the output_configuration object the client calls for each output whether the - output should be enabled, which mode should be set (by referencing the mode from - the list of announced modes) and the output's global position. Once all outputs - are configured that way, the client calls apply. - At that point and not earlier the server should try to apply the configuration. - If this succeeds the server emits the applied signal, otherwise the failed - signal, such that the configuring client is noticed about the success of its - configuration request. - - Through this design the interface enables atomic output configuration changes if - internally supported by the server. - - - - - Request an output_configuration object through which the client can configure - output devices. - - - - - - - - - output_configuration is a client-specific resource that can be used to ask - the server to apply changes to available output devices. - - The client receives a list of output devices from the registry. When it wants - to apply new settings, it creates a configuration object from the - output_management global, writes changes through this object's enable, scale, - transform and mode calls. It then asks the server to apply these settings in - an atomic fashion, for example through Linux' DRM interface. - - The server signals back whether the new settings have applied successfully - or failed to apply. output_device objects are updated after the changes have been - applied to the hardware and before the server side sends the applied event. - - - - - Informs the server that the client will no longer be using this - protocol object. Existing objects created by this object are not - affected. - - - - - - Mark the output as enabled or disabled. - - - - - - - - Sets the mode for a given output by its mode size (width and height) and refresh - rate. - - - - - - - - Sets the transformation for a given output. This transformation is applied onto the - geometry. - - As an example assume the transform is normal, the mode of the output is 3840x2160 - and the geometry is 1080x1920. - - In this case the geometry can be stretched with factor 1.125 to 1215x2160 and placed - according to the compositor's internal policy somewhere horizontally on the output. - - But if the transform is set to 90, 270 or the respective flipped values the geometry - can be stretched with factor 2 to 3840x2160 and fill the whole area sideways. - - - - - - - - - - - - - Set the rectangle this output device maps in compositor space, where (x,y) describe - the top-left corner of the rectangle and its size is described by width and height. - - When width and height are both set to 0, no new content is posted to the output what - implicitly disables it. - - The x, width and height argument must be non-negative and width must be 0 if and - only if height is 0. Otherwise the bad_value protocol error is raised. - - - - - - - - - - - Asks the server to apply property changes requested through this output_configuration - object to all outputs on the server side. - - After this request has been issued there will guaranteed either the applied or the - failed event be received but no other request must be send on this object. The - object may only be destroyed anymore. Otherwise the already_applied protocol error - will be raised. - - - - - - Sent after the server has successfully applied the changes. - - - - - - Sent if the server rejects the changes or failed to apply them. - - - - - diff --git a/src/client/registry.cpp b/src/client/registry.cpp index 405b8836..88fa139c 100644 --- a/src/client/registry.cpp +++ b/src/client/registry.cpp @@ -41,9 +41,6 @@ License along with this library. If not, see . #include "linux_dmabuf_v1.h" #include "logging.h" #include "output.h" -#include "output_configuration_v1.h" -#include "output_device_v1.h" -#include "output_management_v1.h" #include "plasma_activation_feedback.h" #include "plasmashell.h" #include "plasmavirtualdesktop.h" @@ -89,8 +86,6 @@ License along with this library. If not, see . #include #include #include -#include -#include #include #include #include @@ -332,26 +327,6 @@ static QMap const s_interfaces = { &Registry::layerShellV1Removed, }, }, - { - Registry::Interface::OutputManagementV1, - { - 1, - QByteArrayLiteral("zkwinft_output_management_v1"), - &zkwinft_output_management_v1_interface, - &Registry::outputManagementV1Announced, - &Registry::outputManagementV1Removed, - }, - }, - { - Registry::Interface::OutputDeviceV1, - { - 1, - QByteArrayLiteral("zkwinft_output_device_v1"), - &zkwinft_output_device_v1_interface, - &Registry::outputDeviceV1Announced, - &Registry::outputDeviceV1Removed, - }, - }, { Registry::Interface::WlrOutputManagerV1, { @@ -925,8 +900,6 @@ BIND(IdleNotifierV1, ext_idle_notifier_v1) BIND(InputMethodManagerV2, zwp_input_method_manager_v2) BIND(FakeInput, org_kde_kwin_fake_input) BIND(LayerShellV1, zwlr_layer_shell_v1) -BIND(OutputManagementV1, zkwinft_output_management_v1) -BIND(OutputDeviceV1, zkwinft_output_device_v1) BIND(WlrOutputManagerV1, zwlr_output_manager_v1) BIND(TextInputManagerV2, zwp_text_input_manager_v2) BIND(TextInputManagerV3, zwp_text_input_manager_v3) @@ -999,8 +972,6 @@ CREATE(PrimarySelectionDeviceManager) CREATE(Idle) CREATE(FakeInput) CREATE(LayerShellV1) -CREATE(OutputManagementV1) -CREATE(OutputDeviceV1) CREATE(WlrOutputManagerV1) CREATE(ShadowManager) CREATE(BlurManager) diff --git a/src/client/registry.h b/src/client/registry.h index 55984d89..00d18877 100644 --- a/src/client/registry.h +++ b/src/client/registry.h @@ -63,8 +63,6 @@ struct xdg_activation_v1; struct xdg_shell; struct xdg_wm_base; struct zwp_input_method_manager_v2; -struct zkwinft_output_management_v1; -struct zkwinft_output_device_v1; struct zwlr_data_control_manager_v1; struct zwlr_layer_shell_v1; struct zwlr_output_manager_v1; @@ -96,8 +94,6 @@ class drm_lease_device_v1; class EventQueue; class FakeInput; class FullscreenShell; -class OutputManagementV1; -class OutputDeviceV1; class WlrOutputManagerV1; class Idle; class IdleInhibitManager; @@ -197,8 +193,6 @@ class WRAPLANDCLIENT_EXPORT Registry : public QObject Contrast, ///< refers to org_kde_kwin_contrast_manager interface Slide, ///< refers to org_kde_kwin_slide_manager Dpms, ///< Refers to org_kde_kwin_dpms_manager interface - OutputManagementV1, ///< Refers to the zkwinft_output_management_v1 interface - OutputDeviceV1, ///< Refers to the zkwinft_output_device_v1 interface WlrOutputManagerV1, ///< Refers to the zwlr_output_manager_v1 interface TextInputManagerV2, ///< Refers to zwp_text_input_manager_v2, @since 0.0.523 TextInputManagerV3, ///< Refers to zwp_text_input_manager_v3, @since 0.523.0 @@ -363,15 +357,6 @@ class WRAPLANDCLIENT_EXPORT Registry : public QObject * @see createShmPool **/ wl_shm* bindShm(uint32_t name, uint32_t version) const; - /** - * Binds the zkwinft_output_management_v1 with @p name and @p version. - * If the @p name does not exist or is not for the output management interface, - * @c null will be returned. - * - * Prefer using createOutputManagementV1 instead. - * @see createOutputManagementV1 - **/ - zkwinft_output_management_v1* bindOutputManagementV1(uint32_t name, uint32_t version) const; /** * Binds the zwlr_output_manager_v1 with @p name and @p version. * If the @p name does not exist or is not for the output manager interface, @@ -399,16 +384,6 @@ class WRAPLANDCLIENT_EXPORT Registry : public QObject * @see createSubCompositor **/ wl_subcompositor* bindSubCompositor(uint32_t name, uint32_t version) const; - /** - * Binds the zkwinft_output_device_v1 with @p name and @p version. - * If the @p name does not exist or is not for the output interface, - * @c null will be returned. - * - * Prefer using createOutputDeviceV1 instead. - * @see createOutputDeviceV1 - **/ - zkwinft_output_device_v1* bindOutputDeviceV1(uint32_t name, uint32_t version) const; - /** * Binds the _wl_fullscreen_shell with @p name and @p version. * If the @p name does not exist or is not for the fullscreen shell interface, @@ -925,37 +900,6 @@ class WRAPLANDCLIENT_EXPORT Registry : public QObject * @returns The created Output. **/ Output* createOutput(quint32 name, quint32 version, QObject* parent = nullptr); - /** - * Creates an OutputManagementV1 and sets it up to manage the interface identified - * by @p name and @p version. - * - * Note: in case @p name is invalid or isn't for the zkwinft_output_management_v1 interface, - * the returned OutputManagementV1 will not be valid. Therefore it's recommended to call - * isValid on the created instance. - * - * @param name The name of the zkwinft_output_management_v1 interface to bind - * @param version The version or the zkwinft_output_management_v1 interface to use - * @param parent The parent for OutputManagementV1 - * - * @returns The created OutputManagementV1. - **/ - OutputManagementV1* - createOutputManagementV1(quint32 name, quint32 version, QObject* parent = nullptr); - /** - * Creates an OutputDeviceV1 and sets it up to manage the interface identified by - * @p name and @p version. - * - * Note: in case @p name is invalid or isn't for the zkwinft_output_device_v1 interface, - * the returned OutputDeviceV1 will not be valid. Therefore it's recommended to call - * isValid on the created instance. - * - * @param name The name of the zkwinft_output_device_v1 interface to bind - * @param version The version or the zkwinft_output_device_v1 interface to use - * @param parent The parent for OutputDeviceV1 - * - * @returns The created OutputDeviceV1. - **/ - OutputDeviceV1* createOutputDeviceV1(quint32 name, quint32 version, QObject* parent = nullptr); /** * Creates an OutputManagementV1 and sets it up to manage the interface identified * by @p name and @p version. @@ -1754,20 +1698,6 @@ class WRAPLANDCLIENT_EXPORT Registry : public QObject * @since 0.522.0 **/ void layerShellV1Announced(quint32 name, quint32 version); - - /** - * Emitted whenever a zkwinft_output_management_v1 interface gets announced. - * @param name The name for the announced interface - * @param version The maximum supported version of the announced interface - **/ - void outputManagementV1Announced(quint32 name, quint32 version); - /** - * Emitted whenever a zkwinft_output_device_v1 interface gets announced. - * @param name The name for the announced interface - * @param version The maximum supported version of the announced interface - **/ - void outputDeviceV1Announced(quint32 name, quint32 version); - /** * Emitted whenever a zwlr_output_manager_v1 interface gets announced. * @param name The name for the announced interface @@ -2074,16 +2004,6 @@ class WRAPLANDCLIENT_EXPORT Registry : public QObject * @since 0.523.0 **/ void drmLeaseDeviceV1Removed(quint32 name); - /** - * Emitted whenever a zkwinft_output_management_v1 interface gets removed. - * @param name The name for the removed interface - **/ - void outputManagementV1Removed(quint32 name); - /** - * Emitted whenever a zkwinft_output_device_v1 interface gets removed. - * @param name The name for the removed interface - **/ - void outputDeviceV1Removed(quint32 name); /** * Emitted whenever a zwlr_output_manager_v1 interface gets removed. diff --git a/tests/globals.h b/tests/globals.h index 65daebf9..4f3b46c0 100644 --- a/tests/globals.h +++ b/tests/globals.h @@ -22,7 +22,6 @@ #include "../../server/keystate.h" #include "../../server/layer_shell_v1.h" #include "../../server/linux_dmabuf_v1.h" -#include "../../server/output_management_v1.h" #include "../../server/output_manager.h" #include "../../server/plasma_activation_feedback.h" #include "../../server/plasma_shell.h"