File indexing completed on 2024-10-13 07:56:39
0001 /* 0002 SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef SCREENDATA_H 0007 #define SCREENDATA_H 0008 0009 //! local 0010 #include "genericdata.h" 0011 #include "generictable.h" 0012 0013 //! Qt 0014 #include <QMetaType> 0015 #include <QRect> 0016 #include <QString> 0017 0018 namespace Latte { 0019 namespace Data { 0020 0021 class Screen : public Generic 0022 { 0023 public: 0024 static constexpr const char* SERIALIZESPLITTER = ":::"; 0025 static const int ONPRIMARYID = 0; 0026 static const int ONALLSCREENSID = -100; 0027 static const int ONALLSECONDARYSCREENSID = -101; 0028 static constexpr const char* ONPRIMARYNAME = "{primary-screen}"; 0029 static constexpr const char* ONALLSCREENSNAME = "{all-screens}"; 0030 static constexpr const char* ONALLSECONDARYSCREENSNAME = "{all-secondary-screens}"; 0031 0032 Screen(); 0033 Screen(Screen &&o); 0034 Screen(const Screen &o); 0035 Screen(const QString &screenId, const QString &serialized); 0036 0037 //! Screen data 0038 bool hasExplicitViews{false}; 0039 bool isActive{false}; 0040 bool isRemovable{false}; 0041 bool isSelected{false}; 0042 QRect geometry; 0043 0044 //! Operators 0045 Screen &operator=(const Screen &rhs); 0046 Screen &operator=(Screen &&rhs); 0047 bool operator==(const Screen &rhs) const; 0048 bool operator!=(const Screen &rhs) const; 0049 0050 bool isScreensGroup() const; 0051 0052 void init(const QString &screenId, const QString &serialized); 0053 QString serialize() const; 0054 0055 }; 0056 0057 typedef GenericTable<Screen> ScreensTable; 0058 0059 } 0060 } 0061 0062 Q_DECLARE_METATYPE(Latte::Data::Screen) 0063 Q_DECLARE_METATYPE(Latte::Data::ScreensTable) 0064 0065 #endif