feat: add layershell support

This commit is contained in:
outfoxxed 2024-02-04 04:58:58 -08:00
parent 56502b79f6
commit d76100781f
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
12 changed files with 677 additions and 11 deletions

34
src/cpp/qmlglobal.hpp Normal file
View file

@ -0,0 +1,34 @@
#pragma once
#include <qcontainerfwd.h>
#include <qobject.h>
#include <qqmlintegration.h>
#include <qqmllist.h>
#include <qtmetamacros.h>
#include <qtypes.h>
#include "qmlscreen.hpp"
class QtShellGlobal: public QObject {
Q_OBJECT;
Q_PROPERTY(QQmlListProperty<QtShellScreenInfo> screens READ screens NOTIFY screensChanged);
QML_SINGLETON;
QML_ELEMENT;
public:
QtShellGlobal(QObject* parent = nullptr);
QQmlListProperty<QtShellScreenInfo> screens();
signals:
void screensChanged();
public slots:
void updateScreens();
private:
static qsizetype screensCount(QQmlListProperty<QtShellScreenInfo>* prop);
static QtShellScreenInfo* screenAt(QQmlListProperty<QtShellScreenInfo>* prop, qsizetype i);
QVector<QtShellScreenInfo*> mScreens;
};