@@ -29,8 +29,16 @@ Screens::Screens(QObject *parent) :
2929 bool ok = false;
3030 int screenCount = qEnvironmentVariableIntValue("UNITY_MOCK_SCREEN_COUNT", &ok);
3131 if (!ok) screenCount = 1;
32+ QPoint lastPoint(0,0);
3233 for (int i = 0; i < screenCount; ++i) {
33− m_screenList.append(new Screen());
34+ auto screen = new Screen();
35+ screen->enabled = i == 0;
36+ screen->name = QString("Monitor %1").arg(i);
37+ screen->sizes = { QSize(640,480), QSize(1024,748), QSize(1280,1024), QSize(1440,900), QSize(1920,1080) };
38+ screen->geometry = QRect(lastPoint.x(), lastPoint.y(), 1024, 786 );
39+ m_screenList.append(screen);
40+
41+ lastPoint.rx() += screen->geometry.width();
3442 }
3543}
3644
@@ -45,6 +53,12 @@ QHash<int, QByteArray> Screens::roleNames() const
4553 QHash<int, QByteArray> roles;
4654 roles[ScreenRole] = "screen";
4755 roles[OutputTypeRole] = "outputType";
56+ roles[EnabledRole] = "enabled";
57+ roles[NameRole] = "name";
58+ roles[ScaleRole] = "scale";
59+ roles[FormFactorRole] = "formFactor";
60+ roles[GeometryRole] = "geometry";
61+ roles[SizesRole] = "sizes";
4862 return roles;
4963}
5064
@@ -59,6 +73,25 @@ QVariant Screens::data(const QModelIndex &index, int role) const
5973 return QVariant::fromValue(m_screenList.at(index.row())->qScreen);
6074 case OutputTypeRole:
6175 return m_screenList.at(index.row())->outputTypes;
76+ case EnabledRole:
77+ return m_screenList.at(index.row())->enabled;
78+ case NameRole:
79+ return m_screenList.at(index.row())->name;
80+ case ScaleRole:
81+ return m_screenList.at(index.row())->scale;
82+ case FormFactorRole:
83+ return m_screenList.at(index.row())->formFactor;
84+ case GeometryRole:
85+ return m_screenList.at(index.row())->geometry;
86+ case SizesRole:
87+ {
88+ QVariantList sizes;
89+ auto availableSizes = m_screenList.at(index.row())->sizes;
90+ Q_FOREACH(auto size, availableSizes) {
91+ sizes.append(QVariant(size));
92+ }
93+ return sizes;
94+ }
6295 }
6396
6497 return QVariant();