diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,7 +394,7 @@ decorations/decorations_logging.cpp abstract_egl_backend.cpp eglonxbackend.cpp - abstract_backend.cpp + platform.cpp shell_client.cpp wayland_server.cpp wayland_cursor_theme.cpp diff --git a/autotests/wayland/debug_console_test.cpp b/autotests/wayland/debug_console_test.cpp --- a/autotests/wayland/debug_console_test.cpp +++ b/autotests/wayland/debug_console_test.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "debug_console.h" #include "screens.h" #include "shell_client.h" diff --git a/autotests/wayland/decoration_input_test.cpp b/autotests/wayland/decoration_input_test.cpp --- a/autotests/wayland/decoration_input_test.cpp +++ b/autotests/wayland/decoration_input_test.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "cursor.h" #include "screenedge.h" diff --git a/autotests/wayland/dont_crash_cancel_animation.cpp b/autotests/wayland/dont_crash_cancel_animation.cpp --- a/autotests/wayland/dont_crash_cancel_animation.cpp +++ b/autotests/wayland/dont_crash_cancel_animation.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "client.h" #include "composite.h" diff --git a/autotests/wayland/dont_crash_glxgears.cpp b/autotests/wayland/dont_crash_glxgears.cpp --- a/autotests/wayland/dont_crash_glxgears.cpp +++ b/autotests/wayland/dont_crash_glxgears.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "client.h" #include "deleted.h" diff --git a/autotests/wayland/input_stacking_order.cpp b/autotests/wayland/input_stacking_order.cpp --- a/autotests/wayland/input_stacking_order.cpp +++ b/autotests/wayland/input_stacking_order.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "cursor.h" #include "deleted.h" diff --git a/autotests/wayland/internal_window.cpp b/autotests/wayland/internal_window.cpp --- a/autotests/wayland/internal_window.cpp +++ b/autotests/wayland/internal_window.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "cursor.h" #include "shell_client.h" #include "screens.h" diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "../../abstract_backend.h" +#include "../../platform.h" #include "../../effects.h" #include "../../wayland_server.h" #include "../../workspace.h" @@ -94,20 +94,20 @@ 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/autotests/wayland/lockscreen.cpp b/autotests/wayland/lockscreen.cpp --- a/autotests/wayland/lockscreen.cpp +++ b/autotests/wayland/lockscreen.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "cursor.h" #include "screenedge.h" diff --git a/autotests/wayland/move_resize_window_test.cpp b/autotests/wayland/move_resize_window_test.cpp --- a/autotests/wayland/move_resize_window_test.cpp +++ b/autotests/wayland/move_resize_window_test.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "cursor.h" #include "effects.h" diff --git a/autotests/wayland/platformcursor.cpp b/autotests/wayland/platformcursor.cpp --- a/autotests/wayland/platformcursor.cpp +++ b/autotests/wayland/platformcursor.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #include "kwin_wayland_test.h" #include "cursor.h" -#include "abstract_backend.h" +#include "platform.h" #include "wayland_server.h" namespace KWin diff --git a/autotests/wayland/pointer_input.cpp b/autotests/wayland/pointer_input.cpp --- a/autotests/wayland/pointer_input.cpp +++ b/autotests/wayland/pointer_input.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "cursor.h" #include "deleted.h" diff --git a/autotests/wayland/quick_tiling_test.cpp b/autotests/wayland/quick_tiling_test.cpp --- a/autotests/wayland/quick_tiling_test.cpp +++ b/autotests/wayland/quick_tiling_test.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "cursor.h" #include "screens.h" diff --git a/autotests/wayland/start_test.cpp b/autotests/wayland/start_test.cpp --- a/autotests/wayland/start_test.cpp +++ b/autotests/wayland/start_test.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" diff --git a/autotests/wayland/touch_input_test.cpp b/autotests/wayland/touch_input_test.cpp --- a/autotests/wayland/touch_input_test.cpp +++ b/autotests/wayland/touch_input_test.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "cursor.h" #include "shell_client.h" #include "screens.h" diff --git a/autotests/wayland/transient_no_input_test.cpp b/autotests/wayland/transient_no_input_test.cpp --- a/autotests/wayland/transient_no_input_test.cpp +++ b/autotests/wayland/transient_no_input_test.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "screens.h" #include "wayland_server.h" diff --git a/autotests/wayland/transient_placement.cpp b/autotests/wayland/transient_placement.cpp --- a/autotests/wayland/transient_placement.cpp +++ b/autotests/wayland/transient_placement.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" -#include "abstract_backend.h" +#include "platform.h" #include "abstract_client.h" #include "cursor.h" #include "screenedge.h" diff --git a/backends/drm/drm_backend.h b/backends/drm/drm_backend.h --- a/backends/drm/drm_backend.h +++ b/backends/drm/drm_backend.h @@ -19,7 +19,7 @@ *********************************************************************/ #ifndef KWIN_DRM_BACKEND_H #define KWIN_DRM_BACKEND_H -#include "abstract_backend.h" +#include "platform.h" #include "input.h" #include "drm_buffer.h" @@ -55,11 +55,11 @@ 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/drm/drm_backend.cpp b/backends/drm/drm_backend.cpp --- a/backends/drm/drm_backend.cpp +++ b/backends/drm/drm_backend.cpp @@ -60,7 +60,7 @@ { DrmBackend::DrmBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) , m_udev(new Udev) , m_udevMonitor(m_udev->monitor()) , m_dpmsFilter() @@ -559,7 +559,7 @@ #if HAVE_GBM return new EglGbmBackend(this); #else - return AbstractBackend::createOpenGLBackend(); + return Platform::createOpenGLBackend(); #endif } diff --git a/backends/fbdev/fb_backend.h b/backends/fbdev/fb_backend.h --- a/backends/fbdev/fb_backend.h +++ b/backends/fbdev/fb_backend.h @@ -19,19 +19,19 @@ *********************************************************************/ #ifndef KWIN_FB_BACKEND_H #define KWIN_FB_BACKEND_H -#include "abstract_backend.h" +#include "platform.h" #include #include 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/fbdev/fb_backend.cpp b/backends/fbdev/fb_backend.cpp --- a/backends/fbdev/fb_backend.cpp +++ b/backends/fbdev/fb_backend.cpp @@ -36,7 +36,7 @@ { FramebufferBackend::FramebufferBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { setSoftWareCursor(true); } diff --git a/backends/hwcomposer/hwcomposer_backend.h b/backends/hwcomposer/hwcomposer_backend.h --- a/backends/hwcomposer/hwcomposer_backend.h +++ b/backends/hwcomposer/hwcomposer_backend.h @@ -19,7 +19,7 @@ *********************************************************************/ #ifndef KWIN_HWCOMPOSER_BACKEND_H #define KWIN_HWCOMPOSER_BACKEND_H -#include "abstract_backend.h" +#include "platform.h" #include "input.h" #include @@ -44,11 +44,11 @@ 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/hwcomposer/hwcomposer_backend.cpp b/backends/hwcomposer/hwcomposer_backend.cpp --- a/backends/hwcomposer/hwcomposer_backend.cpp +++ b/backends/hwcomposer/hwcomposer_backend.cpp @@ -142,7 +142,7 @@ } HwcomposerBackend::HwcomposerBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { handleOutputs(); } diff --git a/backends/virtual/virtual_backend.h b/backends/virtual/virtual_backend.h --- a/backends/virtual/virtual_backend.h +++ b/backends/virtual/virtual_backend.h @@ -19,7 +19,7 @@ *********************************************************************/ #ifndef KWIN_VIRTUAL_BACKEND_H #define KWIN_VIRTUAL_BACKEND_H -#include "abstract_backend.h" +#include "platform.h" #include @@ -31,11 +31,11 @@ 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/virtual/virtual_backend.cpp b/backends/virtual/virtual_backend.cpp --- a/backends/virtual/virtual_backend.cpp +++ b/backends/virtual/virtual_backend.cpp @@ -31,7 +31,7 @@ { VirtualBackend::VirtualBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { if (qEnvironmentVariableIsSet("KWIN_WAYLAND_VIRTUAL_SCREENSHOTS")) { m_screenshotDir.reset(new QTemporaryDir); diff --git a/backends/wayland/wayland_backend.h b/backends/wayland/wayland_backend.h --- a/backends/wayland/wayland_backend.h +++ b/backends/wayland/wayland_backend.h @@ -20,7 +20,7 @@ #ifndef KWIN_WAYLAND_BACKEND_H #define KWIN_WAYLAND_BACKEND_H // KWin -#include "abstract_backend.h" +#include "platform.h" #include #include // Qt @@ -99,11 +99,11 @@ * 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/wayland/wayland_backend.cpp b/backends/wayland/wayland_backend.cpp --- a/backends/wayland/wayland_backend.cpp +++ b/backends/wayland/wayland_backend.cpp @@ -162,8 +162,8 @@ [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 @@ } 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/x11/x11windowed_backend.h b/backends/x11/x11windowed_backend.h --- a/backends/x11/x11windowed_backend.h +++ b/backends/x11/x11windowed_backend.h @@ -19,7 +19,7 @@ *********************************************************************/ #ifndef KWIN_X11WINDOWED_BACKEND_H #define KWIN_X11WINDOWED_BACKEND_H -#include "abstract_backend.h" +#include "platform.h" #include @@ -36,11 +36,11 @@ 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/backends/x11/x11windowed_backend.cpp b/backends/x11/x11windowed_backend.cpp --- a/backends/x11/x11windowed_backend.cpp +++ b/backends/x11/x11windowed_backend.cpp @@ -45,7 +45,7 @@ { X11WindowedBackend::X11WindowedBackend(QObject *parent) - : AbstractBackend(parent) + : Platform(parent) { setSupportsPointerWarping(true); connect(this, &X11WindowedBackend::sizeChanged, this, &X11WindowedBackend::screenSizeChanged); diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -37,7 +37,7 @@ #include "useractions.h" #include "compositingprefs.h" #include "xcbutils.h" -#include "abstract_backend.h" +#include "platform.h" #include "shell_client.h" #include "wayland_server.h" #include "decorations/decoratedclient.h" @@ -119,7 +119,7 @@ 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/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -56,7 +56,7 @@ #include #include "composite.h" #include "xcbutils.h" -#include "abstract_backend.h" +#include "platform.h" #include "shell_client.h" #include "wayland_server.h" diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -37,7 +37,7 @@ #include "libinput/connection.h" #include "virtual_terminal.h" #endif -#include "abstract_backend.h" +#include "platform.h" #include "shell_client.h" #include "wayland_server.h" #include diff --git a/main.h b/main.h --- a/main.h +++ b/main.h @@ -39,7 +39,7 @@ namespace KWin { -class AbstractBackend; +class Platform; class XcbEventFilter : public QAbstractNativeEventFilter { @@ -165,7 +165,7 @@ virtual QProcessEnvironment processStartupEnvironment() const; void initPlatform(const KPluginMetaData &plugin); - AbstractBackend *platform() const { + Platform *platform() const { return m_platform; } @@ -233,7 +233,7 @@ #ifdef KWIN_BUILD_ACTIVITIES bool m_useKActivities = true; #endif - AbstractBackend *m_platform = nullptr; + Platform *m_platform = nullptr; static int crashes; }; diff --git a/main.cpp b/main.cpp --- a/main.cpp +++ b/main.cpp @@ -22,7 +22,7 @@ #include "main.h" #include // kwin -#include "abstract_backend.h" +#include "platform.h" #include "atoms.h" #include "composite.h" #include "cursor.h" @@ -533,7 +533,7 @@ 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_wayland.cpp b/main_wayland.cpp --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -21,7 +21,7 @@ #include "workspace.h" #include // kwin -#include "abstract_backend.h" +#include "platform.h" #include "effects.h" #include "wayland_server.h" #include "xcbutils.h" @@ -130,20 +130,19 @@ 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/abstract_backend.h b/platform.h rename from abstract_backend.h rename to platform.h --- a/abstract_backend.h +++ b/platform.h @@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ -#ifndef KWIN_ABSTRACT_BACKEND_H -#define KWIN_ABSTRACT_BACKEND_H +#ifndef KWIN_PLATFORM_H +#define KWIN_PLATFORM_H #include #include #include @@ -39,11 +39,11 @@ 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 @@ 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 @@ } -Q_DECLARE_INTERFACE(KWin::AbstractBackend, "org.kde.kwin.AbstractBackend") +Q_DECLARE_INTERFACE(KWin::Platform, "org.kde.kwin.Platform") #endif diff --git a/abstract_backend.cpp b/platform.cpp rename from abstract_backend.cpp rename to platform.cpp --- a/abstract_backend.cpp +++ b/platform.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ -#include "abstract_backend.h" +#include "platform.h" #include #include "abstract_egl_backend.h" #include "composite.h" @@ -30,61 +30,61 @@ 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 @@ size.width(), size.height()); } -void AbstractBackend::markCursorAsRendered() +void Platform::markCursorAsRendered() { if (m_softWareCursor) { m_cursor.lastRenderedPosition = Cursor::pos(); @@ -106,146 +106,146 @@ } } -void AbstractBackend::keyboardKeyPressed(quint32 key, quint32 time) +void Platform::keyboardKeyPressed(quint32 key, quint32 time) { if (!input()) { return; } input()->processKeyboardKey(key, InputRedirection::KeyboardKeyPressed, time); } -void AbstractBackend::keyboardKeyReleased(quint32 key, quint32 time) +void Platform::keyboardKeyReleased(quint32 key, quint32 time) { if (!input()) { return; } 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; } 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; } input()->processKeymapChange(fd, size); } -void AbstractBackend::pointerAxisHorizontal(qreal delta, quint32 time) +void Platform::pointerAxisHorizontal(qreal delta, quint32 time) { if (!input()) { return; } input()->processPointerAxis(InputRedirection::PointerAxisHorizontal, delta, time); } -void AbstractBackend::pointerAxisVertical(qreal delta, quint32 time) +void Platform::pointerAxisVertical(qreal delta, quint32 time) { if (!input()) { return; } input()->processPointerAxis(InputRedirection::PointerAxisVertical, delta, time); } -void AbstractBackend::pointerButtonPressed(quint32 button, quint32 time) +void Platform::pointerButtonPressed(quint32 button, quint32 time) { if (!input()) { return; } input()->processPointerButton(button, InputRedirection::PointerButtonPressed, time); } -void AbstractBackend::pointerButtonReleased(quint32 button, quint32 time) +void Platform::pointerButtonReleased(quint32 button, quint32 time) { if (!input()) { return; } 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; } input()->processPointerMotion(position, time); } -void AbstractBackend::touchCancel() +void Platform::touchCancel() { if (!input()) { return; } 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; } input()->processTouchDown(id, pos, time); } -void AbstractBackend::touchFrame() +void Platform::touchFrame() { if (!input()) { return; } 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; } input()->processTouchMotion(id, pos, time); } -void AbstractBackend::touchUp(qint32 id, quint32 time) +void Platform::touchUp(qint32 id, quint32 time) { if (!input()) { return; } input()->processTouchUp(id, time); } -void AbstractBackend::repaint(const QRect &rect) +void Platform::repaint(const QRect &rect) { if (!Compositor::self()) { return; } Compositor::self()->addRepaint(rect); } -void AbstractBackend::setReady(bool ready) +void Platform::setReady(bool ready) { if (m_ready == ready) { return; } m_ready = 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 @@ 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 @@ 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/plugins/qpa/integration.cpp b/plugins/qpa/integration.cpp --- a/plugins/qpa/integration.cpp +++ b/plugins/qpa/integration.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #define WL_EGL_PLATFORM 1 #include "integration.h" -#include "abstract_backend.h" +#include "platform.h" #include "backingstore.h" #include "nativeinterface.h" #include "platformcontextwayland.h" diff --git a/plugins/qpa/sharingplatformcontext.cpp b/plugins/qpa/sharingplatformcontext.cpp --- a/plugins/qpa/sharingplatformcontext.cpp +++ b/plugins/qpa/sharingplatformcontext.cpp @@ -20,7 +20,7 @@ #include "sharingplatformcontext.h" #include "integration.h" #include "window.h" -#include "../../abstract_backend.h" +#include "../../platform.h" #include "../../wayland_server.h" #include "../../shell_client.h" diff --git a/pointer_input.cpp b/pointer_input.cpp --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -18,7 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "pointer_input.h" -#include "abstract_backend.h" +#include "platform.h" #include "effects.h" #include "screens.h" #include "shell_client.h" @@ -122,7 +122,7 @@ 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/scene_opengl.cpp b/scene_opengl.cpp --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -32,7 +32,7 @@ #include "glxbackend.h" #endif -#include "abstract_backend.h" +#include "platform.h" #include "wayland_server.h" #include diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp --- a/scene_qpainter.cpp +++ b/scene_qpainter.cpp @@ -27,7 +27,7 @@ #include "main.h" #include "screens.h" #include "toplevel.h" -#include "abstract_backend.h" +#include "platform.h" #include "wayland_server.h" #include #include diff --git a/screens.h b/screens.h --- a/screens.h +++ b/screens.h @@ -34,7 +34,7 @@ namespace KWin { class AbstractClient; -class AbstractBackend; +class Platform; class KWIN_EXPORT Screens : public QObject { @@ -157,7 +157,7 @@ { Q_OBJECT public: - BasicScreens(AbstractBackend *backend, QObject *parent = nullptr); + BasicScreens(Platform *backend, QObject *parent = nullptr); virtual ~BasicScreens(); void init() override; @@ -167,7 +167,7 @@ void updateCount() override; private: - AbstractBackend *m_backend; + Platform *m_backend; QVector m_geometries; }; diff --git a/screens.cpp b/screens.cpp --- a/screens.cpp +++ b/screens.cpp @@ -26,7 +26,7 @@ #include #include #include "screens_xrandr.h" -#include "abstract_backend.h" +#include "platform.h" #include "wayland_server.h" #ifdef KWIN_UNIT_TEST #include @@ -184,7 +184,7 @@ return cnt; } -BasicScreens::BasicScreens(AbstractBackend *backend, QObject *parent) +BasicScreens::BasicScreens(Platform *backend, QObject *parent) : Screens(parent) , m_backend(backend) { @@ -196,7 +196,7 @@ { 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/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -19,7 +19,7 @@ *********************************************************************/ #include "wayland_server.h" #include "client.h" -#include "abstract_backend.h" +#include "platform.h" #include "composite.h" #include "screens.h" #include "shell_client.h"