From 10632f09ca49593d5c7a2e5ff358a00106e41c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 7 Apr 2016 09:18:10 +0200 Subject: [PATCH] Rename AbstractBackend to Platform --- abstract_backend.cpp | 70 +++++++++++----------- abstract_backend.h | 8 +-- autotests/wayland/kwin_wayland_test.cpp | 10 ++-- backends/drm/drm_backend.cpp | 4 +- backends/drm/drm_backend.h | 6 +- backends/fbdev/fb_backend.cpp | 2 +- backends/fbdev/fb_backend.h | 6 +- backends/hwcomposer/hwcomposer_backend.cpp | 2 +- backends/hwcomposer/hwcomposer_backend.h | 6 +- backends/virtual/virtual_backend.cpp | 2 +- backends/virtual/virtual_backend.h | 6 +- backends/wayland/wayland_backend.cpp | 6 +- backends/wayland/wayland_backend.h | 6 +- backends/x11/x11windowed_backend.cpp | 2 +- backends/x11/x11windowed_backend.h | 6 +- composite.cpp | 2 +- main.cpp | 2 +- main.h | 6 +- main_wayland.cpp | 9 ++- pointer_input.cpp | 2 +- screens.cpp | 4 +- screens.h | 6 +- 22 files changed, 86 insertions(+), 87 deletions(-) diff --git a/abstract_backend.cpp b/abstract_backend.cpp index 59fa327b79..b9f37db880 100644 --- a/abstract_backend.cpp +++ b/abstract_backend.cpp @@ -30,61 +30,61 @@ along with this program. If not, see . namespace KWin { -AbstractBackend::AbstractBackend(QObject *parent) +Platform::Platform(QObject *parent) : QObject(parent) { } -AbstractBackend::~AbstractBackend() +Platform::~Platform() { } -QImage AbstractBackend::softwareCursor() const +QImage Platform::softwareCursor() const { return input()->pointer()->cursorImage(); } -QPoint AbstractBackend::softwareCursorHotspot() const +QPoint Platform::softwareCursorHotspot() const { return input()->pointer()->cursorHotSpot(); } -Screens *AbstractBackend::createScreens(QObject *parent) +Screens *Platform::createScreens(QObject *parent) { Q_UNUSED(parent) return nullptr; } -OpenGLBackend *AbstractBackend::createOpenGLBackend() +OpenGLBackend *Platform::createOpenGLBackend() { return nullptr; } -QPainterBackend *AbstractBackend::createQPainterBackend() +QPainterBackend *Platform::createQPainterBackend() { return nullptr; } -void AbstractBackend::configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *config) +void Platform::configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *config) { Q_UNUSED(config) qCWarning(KWIN_CORE) << "This backend does not support configuration changes."; } -void AbstractBackend::setSoftWareCursor(bool set) +void Platform::setSoftWareCursor(bool set) { if (m_softWareCursor == set) { return; } m_softWareCursor = set; if (m_softWareCursor) { - connect(Cursor::self(), &Cursor::posChanged, this, &AbstractBackend::triggerCursorRepaint); + connect(Cursor::self(), &Cursor::posChanged, this, &Platform::triggerCursorRepaint); } else { - disconnect(Cursor::self(), &Cursor::posChanged, this, &AbstractBackend::triggerCursorRepaint); + disconnect(Cursor::self(), &Cursor::posChanged, this, &Platform::triggerCursorRepaint); } } -void AbstractBackend::triggerCursorRepaint() +void Platform::triggerCursorRepaint() { if (!Compositor::self()) { return; @@ -96,7 +96,7 @@ void AbstractBackend::triggerCursorRepaint() size.width(), size.height()); } -void AbstractBackend::markCursorAsRendered() +void Platform::markCursorAsRendered() { if (m_softWareCursor) { m_cursor.lastRenderedPosition = Cursor::pos(); @@ -106,7 +106,7 @@ void AbstractBackend::markCursorAsRendered() } } -void AbstractBackend::keyboardKeyPressed(quint32 key, quint32 time) +void Platform::keyboardKeyPressed(quint32 key, quint32 time) { if (!input()) { return; @@ -114,7 +114,7 @@ void AbstractBackend::keyboardKeyPressed(quint32 key, quint32 time) input()->processKeyboardKey(key, InputRedirection::KeyboardKeyPressed, time); } -void AbstractBackend::keyboardKeyReleased(quint32 key, quint32 time) +void Platform::keyboardKeyReleased(quint32 key, quint32 time) { if (!input()) { return; @@ -122,7 +122,7 @@ void AbstractBackend::keyboardKeyReleased(quint32 key, quint32 time) input()->processKeyboardKey(key, InputRedirection::KeyboardKeyReleased, time); } -void AbstractBackend::keyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) +void Platform::keyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) { if (!input()) { return; @@ -130,7 +130,7 @@ void AbstractBackend::keyboardModifiers(uint32_t modsDepressed, uint32_t modsLat input()->processKeyboardModifiers(modsDepressed, modsLatched, modsLocked, group); } -void AbstractBackend::keymapChange(int fd, uint32_t size) +void Platform::keymapChange(int fd, uint32_t size) { if (!input()) { return; @@ -138,7 +138,7 @@ void AbstractBackend::keymapChange(int fd, uint32_t size) input()->processKeymapChange(fd, size); } -void AbstractBackend::pointerAxisHorizontal(qreal delta, quint32 time) +void Platform::pointerAxisHorizontal(qreal delta, quint32 time) { if (!input()) { return; @@ -146,7 +146,7 @@ void AbstractBackend::pointerAxisHorizontal(qreal delta, quint32 time) input()->processPointerAxis(InputRedirection::PointerAxisHorizontal, delta, time); } -void AbstractBackend::pointerAxisVertical(qreal delta, quint32 time) +void Platform::pointerAxisVertical(qreal delta, quint32 time) { if (!input()) { return; @@ -154,7 +154,7 @@ void AbstractBackend::pointerAxisVertical(qreal delta, quint32 time) input()->processPointerAxis(InputRedirection::PointerAxisVertical, delta, time); } -void AbstractBackend::pointerButtonPressed(quint32 button, quint32 time) +void Platform::pointerButtonPressed(quint32 button, quint32 time) { if (!input()) { return; @@ -162,7 +162,7 @@ void AbstractBackend::pointerButtonPressed(quint32 button, quint32 time) input()->processPointerButton(button, InputRedirection::PointerButtonPressed, time); } -void AbstractBackend::pointerButtonReleased(quint32 button, quint32 time) +void Platform::pointerButtonReleased(quint32 button, quint32 time) { if (!input()) { return; @@ -170,7 +170,7 @@ void AbstractBackend::pointerButtonReleased(quint32 button, quint32 time) input()->processPointerButton(button, InputRedirection::PointerButtonReleased, time); } -void AbstractBackend::pointerMotion(const QPointF &position, quint32 time) +void Platform::pointerMotion(const QPointF &position, quint32 time) { if (!input()) { return; @@ -178,7 +178,7 @@ void AbstractBackend::pointerMotion(const QPointF &position, quint32 time) input()->processPointerMotion(position, time); } -void AbstractBackend::touchCancel() +void Platform::touchCancel() { if (!input()) { return; @@ -186,7 +186,7 @@ void AbstractBackend::touchCancel() input()->cancelTouch(); } -void AbstractBackend::touchDown(qint32 id, const QPointF &pos, quint32 time) +void Platform::touchDown(qint32 id, const QPointF &pos, quint32 time) { if (!input()) { return; @@ -194,7 +194,7 @@ void AbstractBackend::touchDown(qint32 id, const QPointF &pos, quint32 time) input()->processTouchDown(id, pos, time); } -void AbstractBackend::touchFrame() +void Platform::touchFrame() { if (!input()) { return; @@ -202,7 +202,7 @@ void AbstractBackend::touchFrame() input()->touchFrame(); } -void AbstractBackend::touchMotion(qint32 id, const QPointF &pos, quint32 time) +void Platform::touchMotion(qint32 id, const QPointF &pos, quint32 time) { if (!input()) { return; @@ -210,7 +210,7 @@ void AbstractBackend::touchMotion(qint32 id, const QPointF &pos, quint32 time) input()->processTouchMotion(id, pos, time); } -void AbstractBackend::touchUp(qint32 id, quint32 time) +void Platform::touchUp(qint32 id, quint32 time) { if (!input()) { return; @@ -218,7 +218,7 @@ void AbstractBackend::touchUp(qint32 id, quint32 time) input()->processTouchUp(id, time); } -void AbstractBackend::repaint(const QRect &rect) +void Platform::repaint(const QRect &rect) { if (!Compositor::self()) { return; @@ -226,7 +226,7 @@ void AbstractBackend::repaint(const QRect &rect) Compositor::self()->addRepaint(rect); } -void AbstractBackend::setReady(bool ready) +void Platform::setReady(bool ready) { if (m_ready == ready) { return; @@ -235,17 +235,17 @@ void AbstractBackend::setReady(bool ready) emit readyChanged(m_ready); } -void AbstractBackend::warpPointer(const QPointF &globalPos) +void Platform::warpPointer(const QPointF &globalPos) { Q_UNUSED(globalPos) } -bool AbstractBackend::supportsQpaContext() const +bool Platform::supportsQpaContext() const { return hasGLExtension(QByteArrayLiteral("EGL_KHR_surfaceless_context")); } -EGLDisplay AbstractBackend::sceneEglDisplay() const +EGLDisplay Platform::sceneEglDisplay() const { if (Compositor *c = Compositor::self()) { if (SceneOpenGL *s = dynamic_cast(c->scene())) { @@ -255,7 +255,7 @@ EGLDisplay AbstractBackend::sceneEglDisplay() const return EGL_NO_DISPLAY; } -EGLContext AbstractBackend::sceneEglContext() const +EGLContext Platform::sceneEglContext() const { if (Compositor *c = Compositor::self()) { if (SceneOpenGL *s = dynamic_cast(c->scene())) { @@ -265,12 +265,12 @@ EGLContext AbstractBackend::sceneEglContext() const return EGL_NO_CONTEXT; } -QSize AbstractBackend::screenSize() const +QSize Platform::screenSize() const { return QSize(); } -QVector AbstractBackend::screenGeometries() const +QVector Platform::screenGeometries() const { return QVector({QRect(QPoint(0, 0), screenSize())}); } diff --git a/abstract_backend.h b/abstract_backend.h index d597ad9e4f..7a9bfaa590 100644 --- a/abstract_backend.h +++ b/abstract_backend.h @@ -39,11 +39,11 @@ class QPainterBackend; class Screens; class WaylandCursorTheme; -class KWIN_EXPORT AbstractBackend : public QObject +class KWIN_EXPORT Platform : public QObject { Q_OBJECT public: - virtual ~AbstractBackend(); + virtual ~Platform(); virtual void init() = 0; virtual Screens *createScreens(QObject *parent = nullptr); @@ -149,7 +149,7 @@ Q_SIGNALS: void screenSizeChanged(); protected: - explicit AbstractBackend(QObject *parent = nullptr); + explicit Platform(QObject *parent = nullptr); void setSoftWareCursor(bool set); void handleOutputs() { m_handlesOutputs = true; @@ -183,6 +183,6 @@ private: } -Q_DECLARE_INTERFACE(KWin::AbstractBackend, "org.kde.kwin.AbstractBackend") +Q_DECLARE_INTERFACE(KWin::Platform, "org.kde.kwin.Platform") #endif diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index 0d12834a53..d5f5386bbe 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -94,20 +94,20 @@ void WaylandTestApplication::performStartup() void WaylandTestApplication::createBackend() { - AbstractBackend *backend = kwinApp()->platform(); - connect(backend, &AbstractBackend::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens); - connect(backend, &AbstractBackend::initFailed, this, + Platform *platform = kwinApp()->platform(); + connect(platform, &Platform::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens); + connect(platform, &Platform::initFailed, this, [] () { std::cerr << "FATAL ERROR: backend failed to initialize, exiting now" << std::endl; ::exit(1); } ); - backend->init(); + platform->init(); } void WaylandTestApplication::continueStartupWithScreens() { - disconnect(kwinApp()->platform(), &AbstractBackend::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens); + disconnect(kwinApp()->platform(), &Platform::screensQueried, this, &WaylandTestApplication::continueStartupWithScreens); createScreens(); waylandServer()->initOutputs(); diff --git a/backends/drm/drm_backend.cpp b/backends/drm/drm_backend.cpp index 01addb3a7d..15310c866e 100644 --- a/backends/drm/drm_backend.cpp +++ b/backends/drm/drm_backend.cpp @@ -60,7 +60,7 @@ namespace KWin { DrmBackend::DrmBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) , m_udev(new Udev) , m_udevMonitor(m_udev->monitor()) , m_dpmsFilter() @@ -559,7 +559,7 @@ OpenGLBackend *DrmBackend::createOpenGLBackend() #if HAVE_GBM return new EglGbmBackend(this); #else - return AbstractBackend::createOpenGLBackend(); + return Platform::createOpenGLBackend(); #endif } diff --git a/backends/drm/drm_backend.h b/backends/drm/drm_backend.h index 3aec6137ee..1fa9d1a523 100644 --- a/backends/drm/drm_backend.h +++ b/backends/drm/drm_backend.h @@ -55,11 +55,11 @@ class UdevMonitor; class DrmOutput; -class KWIN_EXPORT DrmBackend : public AbstractBackend +class KWIN_EXPORT DrmBackend : public Platform { Q_OBJECT - Q_INTERFACES(KWin::AbstractBackend) - Q_PLUGIN_METADATA(IID "org.kde.kwin.AbstractBackend" FILE "drm.json") + Q_INTERFACES(KWin::Platform) + Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "drm.json") public: explicit DrmBackend(QObject *parent = nullptr); virtual ~DrmBackend(); diff --git a/backends/fbdev/fb_backend.cpp b/backends/fbdev/fb_backend.cpp index f5efe8b859..95b0925e6c 100644 --- a/backends/fbdev/fb_backend.cpp +++ b/backends/fbdev/fb_backend.cpp @@ -36,7 +36,7 @@ namespace KWin { FramebufferBackend::FramebufferBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { setSoftWareCursor(true); } diff --git a/backends/fbdev/fb_backend.h b/backends/fbdev/fb_backend.h index ef0232f49e..afdd88ff3e 100644 --- a/backends/fbdev/fb_backend.h +++ b/backends/fbdev/fb_backend.h @@ -27,11 +27,11 @@ along with this program. If not, see . namespace KWin { -class KWIN_EXPORT FramebufferBackend : public AbstractBackend +class KWIN_EXPORT FramebufferBackend : public Platform { Q_OBJECT - Q_INTERFACES(KWin::AbstractBackend) - Q_PLUGIN_METADATA(IID "org.kde.kwin.AbstractBackend" FILE "fbdev.json") + Q_INTERFACES(KWin::Platform) + Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "fbdev.json") public: explicit FramebufferBackend(QObject *parent = nullptr); virtual ~FramebufferBackend(); diff --git a/backends/hwcomposer/hwcomposer_backend.cpp b/backends/hwcomposer/hwcomposer_backend.cpp index 720ac1d736..1e74840940 100644 --- a/backends/hwcomposer/hwcomposer_backend.cpp +++ b/backends/hwcomposer/hwcomposer_backend.cpp @@ -142,7 +142,7 @@ void BacklightInputEventFilter::toggleBacklight() } HwcomposerBackend::HwcomposerBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { handleOutputs(); } diff --git a/backends/hwcomposer/hwcomposer_backend.h b/backends/hwcomposer/hwcomposer_backend.h index 5c8fc24e5e..c94f6cfc5e 100644 --- a/backends/hwcomposer/hwcomposer_backend.h +++ b/backends/hwcomposer/hwcomposer_backend.h @@ -44,11 +44,11 @@ namespace KWin class HwcomposerWindow; class BacklightInputEventFilter; -class HwcomposerBackend : public AbstractBackend +class HwcomposerBackend : public Platform { Q_OBJECT - Q_INTERFACES(KWin::AbstractBackend) - Q_PLUGIN_METADATA(IID "org.kde.kwin.AbstractBackend" FILE "hwcomposer.json") + Q_INTERFACES(KWin::Platform) + Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "hwcomposer.json") public: explicit HwcomposerBackend(QObject *parent = nullptr); virtual ~HwcomposerBackend(); diff --git a/backends/virtual/virtual_backend.cpp b/backends/virtual/virtual_backend.cpp index df5c764aa0..b231fbb5e5 100644 --- a/backends/virtual/virtual_backend.cpp +++ b/backends/virtual/virtual_backend.cpp @@ -31,7 +31,7 @@ namespace KWin { VirtualBackend::VirtualBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { if (qEnvironmentVariableIsSet("KWIN_WAYLAND_VIRTUAL_SCREENSHOTS")) { m_screenshotDir.reset(new QTemporaryDir); diff --git a/backends/virtual/virtual_backend.h b/backends/virtual/virtual_backend.h index 254d7d4fcf..f0d1e2c7d2 100644 --- a/backends/virtual/virtual_backend.h +++ b/backends/virtual/virtual_backend.h @@ -31,11 +31,11 @@ class QTemporaryDir; namespace KWin { -class KWIN_EXPORT VirtualBackend : public AbstractBackend +class KWIN_EXPORT VirtualBackend : public Platform { Q_OBJECT - Q_INTERFACES(KWin::AbstractBackend) - Q_PLUGIN_METADATA(IID "org.kde.kwin.AbstractBackend" FILE "virtual.json") + Q_INTERFACES(KWin::Platform) + Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "virtual.json") Q_PROPERTY(QSize size READ size NOTIFY sizeChanged) public: VirtualBackend(QObject *parent = nullptr); diff --git a/backends/wayland/wayland_backend.cpp b/backends/wayland/wayland_backend.cpp index 28dac65891..c70bd00cbb 100644 --- a/backends/wayland/wayland_backend.cpp +++ b/backends/wayland/wayland_backend.cpp @@ -162,8 +162,8 @@ WaylandSeat::WaylandSeat(wl_seat *seat, WaylandBackend *backend) [this] (bool hasTouch) { if (hasTouch && !m_touch) { m_touch = m_seat->createTouch(this); - connect(m_touch, &Touch::sequenceCanceled, m_backend, &AbstractBackend::touchCancel); - connect(m_touch, &Touch::frameEnded, m_backend, &AbstractBackend::touchFrame); + connect(m_touch, &Touch::sequenceCanceled, m_backend, &Platform::touchCancel); + connect(m_touch, &Touch::frameEnded, m_backend, &Platform::touchFrame); connect(m_touch, &Touch::sequenceStarted, this, [this] (TouchPoint *tp) { m_backend->touchDown(tp->id(), tp->position(), tp->time()); @@ -262,7 +262,7 @@ void WaylandSeat::setInstallCursor(bool install) } WaylandBackend::WaylandBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) , m_display(nullptr) , m_eventQueue(new EventQueue(this)) , m_registry(new Registry(this)) diff --git a/backends/wayland/wayland_backend.h b/backends/wayland/wayland_backend.h index 4b2052d568..36ac9f5dfd 100644 --- a/backends/wayland/wayland_backend.h +++ b/backends/wayland/wayland_backend.h @@ -99,11 +99,11 @@ private: * It creates the connection to the Wayland Compositor, sets up the registry and creates * the Wayland surface and its shell mapping. */ -class KWIN_EXPORT WaylandBackend : public AbstractBackend +class KWIN_EXPORT WaylandBackend : public Platform { Q_OBJECT - Q_INTERFACES(KWin::AbstractBackend) - Q_PLUGIN_METADATA(IID "org.kde.kwin.AbstractBackend" FILE "wayland.json") + Q_INTERFACES(KWin::Platform) + Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "wayland.json") public: explicit WaylandBackend(QObject *parent = nullptr); virtual ~WaylandBackend(); diff --git a/backends/x11/x11windowed_backend.cpp b/backends/x11/x11windowed_backend.cpp index 971f5e0d3d..3fe5c6297b 100644 --- a/backends/x11/x11windowed_backend.cpp +++ b/backends/x11/x11windowed_backend.cpp @@ -45,7 +45,7 @@ namespace KWin { X11WindowedBackend::X11WindowedBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { setSupportsPointerWarping(true); connect(this, &X11WindowedBackend::sizeChanged, this, &X11WindowedBackend::screenSizeChanged); diff --git a/backends/x11/x11windowed_backend.h b/backends/x11/x11windowed_backend.h index cfa3400b3d..559289185f 100644 --- a/backends/x11/x11windowed_backend.h +++ b/backends/x11/x11windowed_backend.h @@ -36,11 +36,11 @@ class NETWinInfo; namespace KWin { -class KWIN_EXPORT X11WindowedBackend : public AbstractBackend +class KWIN_EXPORT X11WindowedBackend : public Platform { Q_OBJECT - Q_INTERFACES(KWin::AbstractBackend) - Q_PLUGIN_METADATA(IID "org.kde.kwin.AbstractBackend" FILE "x11.json") + Q_INTERFACES(KWin::Platform) + Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "x11.json") Q_PROPERTY(QSize size READ screenSize NOTIFY sizeChanged) public: X11WindowedBackend(QObject *parent = nullptr); diff --git a/composite.cpp b/composite.cpp index 5648c8e760..0b9d33f912 100644 --- a/composite.cpp +++ b/composite.cpp @@ -119,7 +119,7 @@ Compositor::Compositor(QObject* workspace) if (kwinApp()->platform()->isReady()) { QMetaObject::invokeMethod(this, "setup", Qt::QueuedConnection); } - connect(kwinApp()->platform(), &AbstractBackend::readyChanged, this, + connect(kwinApp()->platform(), &Platform::readyChanged, this, [this] (bool ready) { if (ready) { setup(); diff --git a/main.cpp b/main.cpp index 5de2e78668..409015ac26 100644 --- a/main.cpp +++ b/main.cpp @@ -533,7 +533,7 @@ QProcessEnvironment Application::processStartupEnvironment() const void Application::initPlatform(const KPluginMetaData &plugin) { Q_ASSERT(!m_platform); - m_platform = qobject_cast(plugin.instantiate()); + m_platform = qobject_cast(plugin.instantiate()); if (m_platform) { m_platform->setParent(this); #if HAVE_INPUT diff --git a/main.h b/main.h index e7b928ac1e..83fbfb9f40 100644 --- a/main.h +++ b/main.h @@ -39,7 +39,7 @@ class QCommandLineParser; namespace KWin { -class AbstractBackend; +class Platform; class XcbEventFilter : public QAbstractNativeEventFilter { @@ -165,7 +165,7 @@ public: virtual QProcessEnvironment processStartupEnvironment() const; void initPlatform(const KPluginMetaData &plugin); - AbstractBackend *platform() const { + Platform *platform() const { return m_platform; } @@ -233,7 +233,7 @@ private: #ifdef KWIN_BUILD_ACTIVITIES bool m_useKActivities = true; #endif - AbstractBackend *m_platform = nullptr; + Platform *m_platform = nullptr; static int crashes; }; diff --git a/main_wayland.cpp b/main_wayland.cpp index 13de72373a..2f3d851308 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -130,20 +130,19 @@ void ApplicationWayland::setupCrashHandler() void ApplicationWayland::createBackend() { - AbstractBackend *backend = kwinApp()->platform(); - connect(backend, &AbstractBackend::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); - connect(backend, &AbstractBackend::initFailed, this, + connect(platform(), &Platform::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); + connect(platform(), &Platform::initFailed, this, [] () { std::cerr << "FATAL ERROR: backend failed to initialize, exiting now" << std::endl; ::exit(1); } ); - backend->init(); + platform()->init(); } void ApplicationWayland::continueStartupWithScreens() { - disconnect(kwinApp()->platform(), &AbstractBackend::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); + disconnect(kwinApp()->platform(), &Platform::screensQueried, this, &ApplicationWayland::continueStartupWithScreens); createScreens(); waylandServer()->initOutputs(); diff --git a/pointer_input.cpp b/pointer_input.cpp index c9acb9ad9e..8fe569f42f 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -122,7 +122,7 @@ void PointerInputRedirection::init() Q_ASSERT(!m_inited); m_cursor = new CursorImage(this); m_inited = true; - connect(m_cursor, &CursorImage::changed, kwinApp()->platform(), &AbstractBackend::cursorChanged); + connect(m_cursor, &CursorImage::changed, kwinApp()->platform(), &Platform::cursorChanged); emit m_cursor->changed(); connect(workspace(), &Workspace::stackingOrderChanged, this, &PointerInputRedirection::update); connect(screens(), &Screens::changed, this, &PointerInputRedirection::updateAfterScreenChange); diff --git a/screens.cpp b/screens.cpp index b4d6a46bf5..77243761e0 100644 --- a/screens.cpp +++ b/screens.cpp @@ -184,7 +184,7 @@ int Screens::intersecting(const QRect &r) const return cnt; } -BasicScreens::BasicScreens(AbstractBackend *backend, QObject *parent) +BasicScreens::BasicScreens(Platform *backend, QObject *parent) : Screens(parent) , m_backend(backend) { @@ -196,7 +196,7 @@ void BasicScreens::init() { KWin::Screens::init(); #ifndef KWIN_UNIT_TEST - connect(m_backend, &AbstractBackend::screenSizeChanged, + connect(m_backend, &Platform::screenSizeChanged, this, &BasicScreens::startChangedTimer); #endif updateCount(); diff --git a/screens.h b/screens.h index 859ed3cbe1..1fb983d9c3 100644 --- a/screens.h +++ b/screens.h @@ -34,7 +34,7 @@ along with this program. If not, see . namespace KWin { class AbstractClient; -class AbstractBackend; +class Platform; class KWIN_EXPORT Screens : public QObject { @@ -157,7 +157,7 @@ class KWIN_EXPORT BasicScreens : public Screens { Q_OBJECT public: - BasicScreens(AbstractBackend *backend, QObject *parent = nullptr); + BasicScreens(Platform *backend, QObject *parent = nullptr); virtual ~BasicScreens(); void init() override; @@ -167,7 +167,7 @@ public: void updateCount() override; private: - AbstractBackend *m_backend; + Platform *m_backend; QVector m_geometries; };