aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.h
blob: 1afff6d2805e8ed1dd27a1a02f70bfbf419a01ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//===========================================
//  Lumina-desktop source code
//  Copyright (c) 2017, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
// This is the base C++ object that is used to pass Screen/Wallpaper info to the QML classes
//===========================================
#ifndef _LUMINA_DESKTOP_SCREEN_DESKTOP_OBJECT_H
#define _LUMINA_DESKTOP_SCREEN_DESKTOP_OBJECT_H
#include <QObject>
#include <QString>
#include <QScreen>

#include "PanelObject.h"

class ScreenObject : public QObject {
	Q_OBJECT
	Q_PROPERTY( QString name READ name )
	Q_PROPERTY( QString background READ background NOTIFY backgroundChanged)
	Q_PROPERTY( int x READ x NOTIFY geomChanged)
	Q_PROPERTY( int y READ y NOTIFY geomChanged)
	Q_PROPERTY( int width READ width NOTIFY geomChanged)
	Q_PROPERTY( int height READ height NOTIFY geomChanged)
	Q_PROPERTY( QStringList panels READ panels NOTIFY panelsChanged)

private:
	QScreen *bg_screen;
	QString bg;
	QList<PanelObject*> panel_objects;

public:
	ScreenObject(QScreen *scrn = 0, QObject *parent = 0);

	static void RegisterType();

	Q_INVOKABLE QString name();
	Q_INVOKABLE QString background();
	Q_INVOKABLE int x();
	Q_INVOKABLE int y();
	Q_INVOKABLE int width();
	Q_INVOKABLE int height();
	Q_INVOKABLE QStringList panels();
	Q_INVOKABLE PanelObject* panel(QString id);

	void setPanels(QList<PanelObject*> list);

public slots:
	void setBackground(QString fileOrColor);

signals:
	void backgroundChanged();
	void geomChanged();
	void panelsChanged();
};

#endif
bgstack15