2024-02-26 07:47:17 +00:00
|
|
|
#include <qguiapplication.h>
|
|
|
|
#include <qqml.h>
|
|
|
|
|
|
|
|
#include "../core/plugin.hpp"
|
2024-02-26 11:13:55 +00:00
|
|
|
#include "wlr_layershell.hpp"
|
2024-02-26 07:47:17 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
class WaylandPlugin: public QuickshellPlugin {
|
|
|
|
bool applies() override { return QGuiApplication::platformName() == "wayland"; }
|
|
|
|
|
|
|
|
void registerTypes() override {
|
2024-02-26 08:57:47 +00:00
|
|
|
qmlRegisterType<WaylandPanelInterface>("Quickshell._WaylandOverlay", 1, 0, "PanelWindow");
|
2024-02-26 08:08:30 +00:00
|
|
|
|
|
|
|
// If any types are defined inside a module using QML_ELEMENT then all QML_ELEMENT types
|
|
|
|
// will not be registered. This can be worked around with a module import which makes
|
|
|
|
// the QML_ELMENT module import the old register-type style module.
|
2024-02-26 11:13:55 +00:00
|
|
|
|
|
|
|
qmlRegisterModuleImport(
|
|
|
|
"Quickshell.Wayland",
|
|
|
|
QQmlModuleImportModuleAny,
|
|
|
|
"Quickshell.Wayland._WlrLayerShell",
|
|
|
|
QQmlModuleImportLatest
|
|
|
|
);
|
|
|
|
|
2024-02-26 08:08:30 +00:00
|
|
|
qmlRegisterModuleImport(
|
2024-02-26 08:57:47 +00:00
|
|
|
"Quickshell",
|
2024-02-26 08:08:30 +00:00
|
|
|
QQmlModuleImportModuleAny,
|
2024-02-26 08:57:47 +00:00
|
|
|
"Quickshell._WaylandOverlay",
|
2024-02-26 08:08:30 +00:00
|
|
|
QQmlModuleImportLatest
|
|
|
|
);
|
2024-02-26 07:47:17 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
QS_REGISTER_PLUGIN(WaylandPlugin);
|
|
|
|
|
|
|
|
} // namespace
|