1 /* 2 SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com> 3 SPDX-License-Identifier: GPL-2.0-or-later 4 */ 5 6 #ifndef SCREENDATA_H 7 #define SCREENDATA_H 8 9 //! local 10 #include "genericdata.h" 11 #include "generictable.h" 12 13 //! Qt 14 #include <QMetaType> 15 #include <QRect> 16 #include <QString> 17 18 namespace Latte { 19 namespace Data { 20 21 class Screen : public Generic 22 { 23 public: 24 static constexpr const char* SERIALIZESPLITTER = ":::"; 25 static const int ONPRIMARYID = 0; 26 static constexpr const char* ONPRIMARYNAME = "{primary-screen}"; 27 28 Screen(); 29 Screen(Screen &&o); 30 Screen(const Screen &o); 31 Screen(const QString &screenId, const QString &serialized); 32 33 //! Screen data 34 bool hasExplicitViews{false}; 35 bool isActive{false}; 36 bool isRemovable{false}; 37 bool isSelected{false}; 38 QRect geometry; 39 40 //! Operators 41 Screen &operator=(const Screen &rhs); 42 Screen &operator=(Screen &&rhs); 43 bool operator==(const Screen &rhs) const; 44 bool operator!=(const Screen &rhs) const; 45 46 void init(const QString &screenId, const QString &serialized); 47 QString serialize() const; 48 49 }; 50 51 typedef GenericTable<Screen> ScreensTable; 52 53 } 54 } 55 56 Q_DECLARE_METATYPE(Latte::Data::Screen) 57 Q_DECLARE_METATYPE(Latte::Data::ScreensTable) 58 59 #endif 60