shift-shell/components/windowplugin/windowplugin.cpp
Devin Lin 0775c56153 windowplugin: Extract out windowutil from mobileshell to separate plugin
This allows us in the future to use mobileshell without having the WindowUtil singleton loaded (which does a bunch of wayland calls that aren't necessary for most applications).
2023-03-15 15:12:23 +00:00

17 lines
516 B
C++

// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "windowplugin.h"
#include "windowutil.h"
#include <QQmlContext>
#include <QQuickItem>
void WindowPlugin::registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.windowplugin"));
qmlRegisterSingletonType<WindowUtil>(uri, 1, 0, "WindowUtil", [](QQmlEngine *, QJSEngine *) -> QObject * {
return WindowUtil::instance();
});
}