diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules) include(FeatureSummary) -include(GenerateExportHeader) +include(ECMGenerateExportHeader) include(CMakePackageConfigHelpers) include(ECMSetupVersion) include(ECMGenerateHeaders) diff --git a/autotests/client/test_plasma_window_model.cpp b/autotests/client/test_plasma_window_model.cpp --- a/autotests/client/test_plasma_window_model.cpp +++ b/autotests/client/test_plasma_window_model.cpp @@ -46,6 +46,8 @@ Q_DECLARE_METATYPE(ServerWindowQuint32Setter) typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowVoidSetter)(); Q_DECLARE_METATYPE(ServerWindowVoidSetter) +typedef void (KWayland::Server::PlasmaWindowInterface::*ServerWindowIconSetter)(const QIcon&); +Q_DECLARE_METATYPE(ServerWindowIconSetter) class PlasmaWindowModelTest : public QObject { @@ -881,7 +883,10 @@ QTest::newRow("onallDesktop") << &PlasmaWindow::onAllDesktopsChanged << QVariant::fromValue(&PlasmaWindowInterface::setOnAllDesktops) << QVariant(true); QTest::newRow("title") << &PlasmaWindow::titleChanged << QVariant::fromValue(&PlasmaWindowInterface::setTitle) << QVariant(QStringLiteral("foo")); QTest::newRow("appId") << &PlasmaWindow::appIdChanged << QVariant::fromValue(&PlasmaWindowInterface::setAppId) << QVariant(QStringLiteral("foo")); - QTest::newRow("icon" ) << &PlasmaWindow::iconChanged << QVariant::fromValue(&PlasmaWindowInterface::setThemedIconName) << QVariant(QStringLiteral("foo")); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 28) + QTest::newRow("iconname" ) << &PlasmaWindow::iconChanged << QVariant::fromValue(&PlasmaWindowInterface::setThemedIconName) << QVariant(QStringLiteral("foo")); +#endif + QTest::newRow("icon" ) << &PlasmaWindow::iconChanged << QVariant::fromValue(&PlasmaWindowInterface::setIcon) << QVariant::fromValue(QIcon::fromTheme(QStringLiteral("foo"))); QTest::newRow("vd") << &PlasmaWindow::virtualDesktopChanged << QVariant::fromValue(&PlasmaWindowInterface::setVirtualDesktop) << QVariant(2u); QTest::newRow("unmapped") << &PlasmaWindow::unmapped << QVariant::fromValue(&PlasmaWindowInterface::unmap) << QVariant(); } diff --git a/autotests/client/test_wayland_outputdevice.cpp b/autotests/client/test_wayland_outputdevice.cpp --- a/autotests/client/test_wayland_outputdevice.cpp +++ b/autotests/client/test_wayland_outputdevice.cpp @@ -44,7 +44,9 @@ void testRegistry(); void testModeChanges(); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) void testScaleChange_legacy(); +#endif void testScaleChange(); void testColorCurvesChange(); @@ -207,7 +209,10 @@ QCOMPARE(output.physicalSize(), QSize()); QCOMPARE(output.pixelSize(), QSize()); QCOMPARE(output.refreshRate(), 0); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) QCOMPARE(output.scale(), 1); +#endif + QCOMPARE(output.scaleF(), 1.0); QCOMPARE(output.colorCurves().red, QVector()); QCOMPARE(output.colorCurves().green, QVector()); QCOMPARE(output.colorCurves().blue, QVector()); @@ -233,7 +238,10 @@ QCOMPARE(output.physicalSize(), QSize(200, 100)); QCOMPARE(output.pixelSize(), QSize(1024, 768)); QCOMPARE(output.refreshRate(), 60000); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) QCOMPARE(output.scale(), 1); +#endif + QCOMPARE(output.scaleF(), 1.0); QCOMPARE(output.colorCurves().red, m_initColorCurves.red); QCOMPARE(output.colorCurves().green, m_initColorCurves.green); QCOMPARE(output.colorCurves().blue, m_initColorCurves.blue); @@ -346,6 +354,7 @@ QCOMPARE(output.pixelSize(), QSize(1280, 1024)); } +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) void TestWaylandOutputDevice::testScaleChange_legacy() { KWayland::Client::Registry registry; @@ -366,6 +375,7 @@ wl_display_flush(m_connection->display()); QVERIFY(outputChanged.wait()); QCOMPARE(output.scale(), 1); + QCOMPARE(output.scaleF(), 1.0); // change the scale outputChanged.clear(); @@ -382,6 +392,7 @@ QCOMPARE(output.scale(), 4); QCOMPARE(output.scaleF(), 4.0); } +#endif void TestWaylandOutputDevice::testScaleChange() { @@ -408,14 +419,18 @@ outputChanged.clear(); m_serverOutputDevice->setScaleF(2.2); QVERIFY(outputChanged.wait()); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) QCOMPARE(output.scale(), 2); //check backwards compatibility works +#endif QCOMPARE(wl_fixed_from_double(output.scaleF()), wl_fixed_from_double(2.2)); // change once more outputChanged.clear(); m_serverOutputDevice->setScaleF(4.9); QVERIFY(outputChanged.wait()); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) QCOMPARE(output.scale(), 5); +#endif QCOMPARE(wl_fixed_from_double(output.scaleF()), wl_fixed_from_double(4.9)); } diff --git a/autotests/client/test_wayland_outputmanagement.cpp b/autotests/client/test_wayland_outputmanagement.cpp --- a/autotests/client/test_wayland_outputmanagement.cpp +++ b/autotests/client/test_wayland_outputmanagement.cpp @@ -270,7 +270,10 @@ QCOMPARE(output->physicalSize(), QSize()); QCOMPARE(output->pixelSize(), QSize()); QCOMPARE(output->refreshRate(), 0); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) QCOMPARE(output->scale(), 1); +#endif + QCOMPARE(output->scaleF(), 1.0); QCOMPARE(output->colorCurves().red, QVector()); QCOMPARE(output->colorCurves().green, QVector()); QCOMPARE(output->colorCurves().blue, QVector()); @@ -410,7 +413,7 @@ config->setMode(output, m_modes.first().id); config->setTransform(output, OutputDevice::Transform::Rotated90); config->setPosition(output, QPoint(13, 37)); - config->setScale(output, 2); + config->setScaleF(output, 2.0); const auto zeroVector = QVector(256, 0); config->setColorCurves(output, zeroVector, zeroVector, zeroVector); config->setEnabled(output, OutputDevice::Enablement::Disabled); @@ -430,7 +433,7 @@ config->setMode(output, m_modes.at(1).id); config->setTransform(output, OutputDevice::Transform::Normal); config->setPosition(output, QPoint(0, 1920)); - config->setScale(output, 1); + config->setScaleF(output, 1.0); const auto oneVector = QVector(256, 1); config->setColorCurves(output, oneVector, oneVector, oneVector); config->setEnabled(output, OutputDevice::Enablement::Enabled); @@ -525,9 +528,12 @@ QVERIFY(configAppliedSpy.isValid()); QVERIFY(configAppliedSpy.wait(200)); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) QCOMPARE(output->scale(), 2); //test backwards compatibility +#endif QCOMPARE(wl_fixed_from_double(output->scaleF()), wl_fixed_from_double(2.3)); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) config->setScale(output, 3); config->apply(); @@ -538,6 +544,7 @@ QCOMPARE(output->scale(), 3); QCOMPARE(output->scaleF(), 3.0); //test forward compatibility +#endif } diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -231,13 +231,20 @@ ) add_library(KF5WaylandClient ${CLIENT_LIB_SRCS}) -generate_export_header(KF5WaylandClient +add_library(KF5::WaylandClient ALIAS KF5WaylandClient) +ecm_generate_export_header(KF5WaylandClient BASE_NAME KWaylandClient EXPORT_FILE_NAME KWayland/Client/kwaylandclient_export.h + GROUP_BASE_NAME KF + VERSION ${KF5_VERSION} + DEPRECATED_BASE_VERSION 0 + DEPRECATION_VERSIONS 5.49 5.50 5.52 5.53 ) -add_library(KF5::WaylandClient ALIAS KF5WaylandClient) +# TODO: add support for EXCLUDE_DEPRECATED_BEFORE_AND_AT to all KWayland libs +# needs fixing of undeprecated API being still implemented using own deprecated API + target_include_directories(KF5WaylandClient INTERFACE "$") diff --git a/src/client/outputconfiguration.h b/src/client/outputconfiguration.h --- a/src/client/outputconfiguration.h +++ b/src/client/outputconfiguration.h @@ -188,16 +188,19 @@ */ void setPosition(OutputDevice *outputdevice, const QPoint &pos); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 50) /** * Scale rendering of this output. * The changes done in this call will be recorded in the * OutputDevice and only applied after apply() has been called. - * @deprecated see setScaleF(qreal) * * @param scale the scaling factor for this output device. * @param outputdevice the OutputDevice this change applies to. + * @deprecated Since 5.50, use setScaleF(OutputDevice *, qreal) */ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 50, "Use OutputConfiguration::setScaleF(OutputDevice *, qreal)") void setScale(OutputDevice *outputdevice, qint32 scale); +#endif /** * Scale rendering of this output. diff --git a/src/client/outputdevice.h b/src/client/outputdevice.h --- a/src/client/outputdevice.h +++ b/src/client/outputdevice.h @@ -190,15 +190,19 @@ * Refresh rate in mHz of the current mode. **/ int refreshRate() const; + +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 50) /** * Scaling factor of this output. * * A scale larger than 1 means that the compositor will automatically scale surface buffers * by this amount when rendering. This is used for very high resolution displays where * applications rendering at the native resolution would be too small to be legible. - * @deprecated see scaleF + * @deprecated Since 5.50, use scaleF() **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 50, "Use OutputDevice::scaleF()") int scale() const; +#endif /** * Scaling factor of this output. diff --git a/src/client/plasmawindowmanagement.h b/src/client/plasmawindowmanagement.h --- a/src/client/plasmawindowmanagement.h +++ b/src/client/plasmawindowmanagement.h @@ -272,13 +272,15 @@ * @see appIdChanged **/ QString appId() const; +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52) /** - * @deprecated: use plasmaVirtualDesktops instead - * @see plasmaVirtualDesktops * @returns the id of the virtual desktop this PlasmaWindow is on * @see virtualDesktopChanged + * @deprecated: Since 5.52, use plasmaVirtualDesktops instead **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::plasmaVirtualDesktops()") quint32 virtualDesktop() const; +#endif /** * @returns Whether the window is currently the active Window. * @see activeChanged @@ -411,11 +413,14 @@ * @since 5.22 */ void requestResize(); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52) /** - * @deprecated: use requestEnterVirtualDesktop instead * Requests to send the window to virtual @p desktop. + * @deprecated: Since 5.52, use requestEnterVirtualDesktop instead **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::requestEnterVirtualDesktop(const QString &)") void requestVirtualDesktop(quint32 desktop); +#endif /** * Requests the window at this model row index have its keep above state toggled. @@ -529,11 +534,14 @@ * @see appId **/ void appIdChanged(); +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 52) /** - * @deprecated use plasmaVirtualDesktopEntered and plasmaVirtualDesktopLeft instead * The virtual desktop changed. + * @deprecated Since 5.52, use plasmaVirtualDesktopEntered and plasmaVirtualDesktopLeft instead **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 52, "Use PlasmaWindow::plasmaVirtualDesktopEntered(const QString &) and PlasmaWindow::plasmaVirtualDesktopLeft(const QString &)") void virtualDesktopChanged(); +#endif /** * The window became active or inactive. * @see isActive diff --git a/src/client/plasmawindowmodel.h b/src/client/plasmawindowmodel.h --- a/src/client/plasmawindowmodel.h +++ b/src/client/plasmawindowmodel.h @@ -70,10 +70,14 @@ IsMinimized, IsKeepAbove, IsKeepBelow, +#if KWAYLANDCLIENT_ENABLE_DEPRECATED_SINCE(5, 53) /** - @deprecated @see VirtualDesktops + @deprecated Since 5.53, use VirtualDesktops */ VirtualDesktop, +#else + VirtualDesktop_DEPRECATED_DO_NOT_USE, +#endif IsOnAllDesktops, IsDemandingAttention, SkipTaskbar, @@ -114,7 +118,7 @@ */ SkipSwitcher, /** - * @since 5.55 + * @since 5.53 */ VirtualDesktops }; diff --git a/src/client/xdgshell.h b/src/client/xdgshell.h --- a/src/client/xdgshell.h +++ b/src/client/xdgshell.h @@ -530,8 +530,9 @@ * When using XdgShell::createXdgShellPopup there is no need to call this * method. * - * This was for XDGShellV5, this is now deprecated + * @deprecated Since 5.49. This was for XDGShellV5, this is now deprecated **/ + KWAYLANDCLIENT_DEPRECATED_VERSION(5, 49, "Use XDGShell version >5") void setup(xdg_popup *xdgpopupv5); /** diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -282,16 +282,21 @@ set_source_files_properties(${SERVER_GENERATED_SRCS} PROPERTIES SKIP_AUTOMOC ON) add_library(KF5WaylandServer ${SERVER_LIB_SRCS}) -generate_export_header(KF5WaylandServer +add_library(KF5::WaylandServer ALIAS KF5WaylandServer) +ecm_generate_export_header(KF5WaylandServer BASE_NAME KWaylandServer EXPORT_FILE_NAME KWayland/Server/kwaylandserver_export.h + GROUP_BASE_NAME KF + VERSION ${KF5_VERSION} + DEPRECATED_BASE_VERSION 0 + DEPRECATION_VERSIONS 5.5 5.28 5.50 5.52 ) +# TODO: add support for EXCLUDE_DEPRECATED_BEFORE_AND_AT to all KWayland libs +# needs fixing of undeprecated API being still implemented using own deprecated API -add_library(KF5::WaylandServer ALIAS KF5WaylandServer) - target_include_directories(KF5WaylandServer INTERFACE "$") target_link_libraries(KF5WaylandServer diff --git a/src/server/outputchangeset.h b/src/server/outputchangeset.h --- a/src/server/outputchangeset.h +++ b/src/server/outputchangeset.h @@ -82,12 +82,15 @@ OutputDeviceInterface::Transform transform() const; /** The new value for globalPosition. */ QPoint position() const; +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) /** The new value for scale. - @deprecated see scaleF + @deprecated Since 5.50, use scaleF */ + KWAYLANDSERVER_DEPRECATED_VERSION(5, 50, "Use OutputChangeSet::scaleF()") int scale() const; +#endif /** The new value for scale. - * @since 5.XX + * @since 5.50 */ qreal scaleF() const; /** The new value for colorCurves. diff --git a/src/server/outputdevice_interface.h b/src/server/outputdevice_interface.h --- a/src/server/outputdevice_interface.h +++ b/src/server/outputdevice_interface.h @@ -109,7 +109,12 @@ QString eisaId() const; QSize pixelSize() const; int refreshRate() const; +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) + /// @deprecated Since 5.50, use scaleF() + KWAYLANDSERVER_DEPRECATED_VERSION(5, 50, "Use OutputDeviceInterface::scaleF()") int scale() const; +#endif + /// @since 5.50 qreal scaleF() const; SubPixel subPixel() const; Transform transform() const; @@ -127,7 +132,12 @@ void setModel(const QString &model); void setSerialNumber(const QString &serialNumber); void setEisaId(const QString &eisaId); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) + /// @deprecated Since 5.50, use setScale(qreal) + KWAYLANDSERVER_DEPRECATED_VERSION(5, 50, "Use OutputDeviceInterface::setScale(qreal)") void setScale(int scale); +#endif + /// @since 5.50 void setScaleF(qreal scale); void setSubPixel(SubPixel subPixel); void setTransform(Transform transform); @@ -158,8 +168,12 @@ void eisaIdChanged(const QString &); void pixelSizeChanged(const QSize&); void refreshRateChanged(int); - //@deprecated see scaleChanged(real) +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 50) + /// @deprecated Since 5.50, use scaleFChanged(qreal) + KWAYLANDSERVER_DEPRECATED_VERSION(5, 50, "Use OutputDeviceInterface::scaleFChanged(qreal)") void scaleChanged(int); +#endif + /// @since 5.50 void scaleFChanged(qreal); void subPixelChanged(SubPixel); void transformChanged(Transform); diff --git a/src/server/plasmawindowmanagement_interface.h b/src/server/plasmawindowmanagement_interface.h --- a/src/server/plasmawindowmanagement_interface.h +++ b/src/server/plasmawindowmanagement_interface.h @@ -109,11 +109,12 @@ void setTitle(const QString &title); void setAppId(const QString &appId); void setPid(quint32 pid); -#ifndef KWAYLANDSERVER_NO_DEPRECATED +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 52) /** - * @deprecated use addPlasmaVirtualDesktop and removePlasmaVirtualDesktop + * @deprecated Since 5.52, use addPlasmaVirtualDesktop and removePlasmaVirtualDesktop */ - void KWAYLANDSERVER_DEPRECATED setVirtualDesktop(quint32 desktop); + KWAYLANDSERVER_DEPRECATED_VERSION(5, 52, "Use PlasmaWindowManagementInterface::addPlasmaVirtualDesktop(const QString&) and PlasmaWindowManagementInterface::removePlasmaVirtualDesktop(const QString&)") + void setVirtualDesktop(quint32 desktop); #endif void setActive(bool set); void setMinimized(bool set); @@ -129,12 +130,12 @@ void setFullscreenable(bool set); void setSkipTaskbar(bool skip); void setSkipSwitcher(bool skip); +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 28) /** * @deprecated since 5.28 use setIcon - * @see setIcon **/ -#ifndef KWAYLANDSERVER_NO_DEPRECATED - void KWAYLANDSERVER_DEPRECATED setThemedIconName(const QString &iconName); + KWAYLANDSERVER_DEPRECATED_VERSION(5, 28, "Use PlasmaWindowManagementInterface::setIcon(const QIcon&)") + void setThemedIconName(const QString &iconName); #endif /** * @since 5.22 @@ -237,11 +238,12 @@ * @since 5.22 */ void resizeRequested(); -#ifndef KWAYLANDSERVER_NO_DEPRECATED +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 52) /** - * @deprecated use enterPlasmaVirtualDesktopRequested and leavePlasmaVirtualDesktopRequested instead + * @deprecated Since 5.52, use enterPlasmaVirtualDesktopRequested and leavePlasmaVirtualDesktopRequested instead */ - void KWAYLANDSERVER_DEPRECATED virtualDesktopRequested(quint32 desktop); + KWAYLANDSERVER_DEPRECATED_VERSION(5, 52, "Use PlasmaWindowManagementInterface::enterPlasmaVirtualDesktopRequested(const QString&) and PlasmaWindowManagementInterface::leavePlasmaVirtualDesktopRequested(const QString&)") + void virtualDesktopRequested(quint32 desktop); #endif void activeRequested(bool set); void minimizedRequested(bool set); diff --git a/src/server/plasmawindowmanagement_interface.cpp b/src/server/plasmawindowmanagement_interface.cpp --- a/src/server/plasmawindowmanagement_interface.cpp +++ b/src/server/plasmawindowmanagement_interface.cpp @@ -738,12 +738,10 @@ d->setTitle(title); } -#ifndef KWAYLANDSERVER_NO_DEPRECATED void PlasmaWindowInterface::setVirtualDesktop(quint32 desktop) { d->setVirtualDesktop(desktop); } -#endif void PlasmaWindowInterface::unmap() { @@ -857,12 +855,10 @@ d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPSWITCHER, skip); } -#ifndef KWAYLANDSERVER_NO_DEPRECATED void PlasmaWindowInterface::setThemedIconName(const QString &iconName) { d->setThemedIconName(iconName); } -#endif void PlasmaWindowInterface::setIcon(const QIcon &icon) { diff --git a/src/server/seat_interface.h b/src/server/seat_interface.h --- a/src/server/seat_interface.h +++ b/src/server/seat_interface.h @@ -132,7 +132,7 @@ Q_PROPERTY(bool keyboard READ hasKeyboard WRITE setHasKeyboard NOTIFY hasKeyboardChanged) /** * Whether the SeatInterface supports a touch device. - * @deprecated use touch + * @deprecated Since 5.5, use touch **/ Q_PROPERTY(bool tourch READ hasTouch WRITE setHasTouch NOTIFY hasTouchChanged) /** diff --git a/src/server/surface_interface.h b/src/server/surface_interface.h --- a/src/server/surface_interface.h +++ b/src/server/surface_interface.h @@ -99,12 +99,14 @@ QRegion damage() const; QRegion opaque() const; QRegion input() const; +#if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 5) /** * Use Surface::inputIsInfinite instead. - * @deprecated - * @see inputIsInfinite + * @deprecated Since 5.5, use inputIsInfinite */ + KWAYLANDSERVER_DEPRECATED_VERSION(5, 5, "Use SurfaceInterface::inputIsInfinite()") bool inputIsInfitine() const; +#endif /** * Replaces Surface::inputIsInfitine instead. * @since 5.5