Changeset View
Changeset View
Standalone View
Standalone View
kcm/output_model.h
Show All 35 Lines | 31 | enum OutputRoles { | |||
---|---|---|---|---|---|
36 | PositionRole, | 36 | PositionRole, | ||
37 | /** Position for backend relative to most northwest display corner. */ | 37 | /** Position for backend relative to most northwest display corner. */ | ||
38 | NormalizedPositionRole, | 38 | NormalizedPositionRole, | ||
39 | RotationRole, | 39 | RotationRole, | ||
40 | ScaleRole, | 40 | ScaleRole, | ||
41 | ResolutionIndexRole, | 41 | ResolutionIndexRole, | ||
42 | ResolutionsRole, | 42 | ResolutionsRole, | ||
43 | RefreshRateIndexRole, | 43 | RefreshRateIndexRole, | ||
44 | RefreshRatesRole | 44 | RefreshRatesRole, | ||
45 | ReplicationSourceModelRole, | ||||
46 | ReplicationSourceIndexRole, | ||||
47 | ReplicasModelRole | ||||
45 | }; | 48 | }; | ||
46 | 49 | | |||
47 | explicit OutputModel (ConfigHandler *configHandler); | 50 | explicit OutputModel (ConfigHandler *configHandler); | ||
48 | ~OutputModel() override = default; | 51 | ~OutputModel() override = default; | ||
49 | 52 | | |||
50 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 53 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | ||
51 | QVariant data(const QModelIndex &index, | 54 | QVariant data(const QModelIndex &index, | ||
52 | int role = Qt::DisplayRole) const override; | 55 | int role = Qt::DisplayRole) const override; | ||
Show All 29 Lines | 83 | Output(const Output &output) | |||
82 | , pos(output.pos) | 85 | , pos(output.pos) | ||
83 | {} | 86 | {} | ||
84 | Output(KScreen::OutputPtr _ptr, const QPoint &_pos) | 87 | Output(KScreen::OutputPtr _ptr, const QPoint &_pos) | ||
85 | : ptr(_ptr) | 88 | : ptr(_ptr) | ||
86 | , pos(_pos) | 89 | , pos(_pos) | ||
87 | {} | 90 | {} | ||
88 | KScreen::OutputPtr ptr; | 91 | KScreen::OutputPtr ptr; | ||
89 | QPoint pos; | 92 | QPoint pos; | ||
93 | QPoint replicaReset; | ||||
90 | }; | 94 | }; | ||
91 | 95 | | |||
92 | void roleChanged(int outputId, OutputRoles role); | 96 | void roleChanged(int outputId, OutputRoles role); | ||
93 | void reposition(); | 97 | void reposition(); | ||
94 | void updatePositions(); | 98 | void updatePositions(); | ||
95 | void updateOrder(); | 99 | void updateOrder(); | ||
96 | QPoint originDelta() const; | 100 | QPoint originDelta() const; | ||
97 | 101 | | |||
Show All 10 Lines | |||||
108 | int resolutionIndex(const KScreen::OutputPtr &output) const; | 112 | int resolutionIndex(const KScreen::OutputPtr &output) const; | ||
109 | int refreshRateIndex(const KScreen::OutputPtr &output) const; | 113 | int refreshRateIndex(const KScreen::OutputPtr &output) const; | ||
110 | QVariantList resolutionsStrings(const KScreen::OutputPtr &output) const; | 114 | QVariantList resolutionsStrings(const KScreen::OutputPtr &output) const; | ||
111 | QVector<QSize> resolutions(const KScreen::OutputPtr &output) const; | 115 | QVector<QSize> resolutions(const KScreen::OutputPtr &output) const; | ||
112 | QVector<float> refreshRates(const KScreen::OutputPtr &output) const; | 116 | QVector<float> refreshRates(const KScreen::OutputPtr &output) const; | ||
113 | 117 | | |||
114 | bool positionable(const Output &output) const; | 118 | bool positionable(const Output &output) const; | ||
115 | 119 | | |||
120 | QStringList replicationSourceModel(const KScreen::OutputPtr &output) const; | ||||
121 | bool setReplicationSourceIndex(int outputIndex, int sourceIndex); | ||||
122 | int replicationSourceIndex(int outputIndex, int sourceId) const; | ||||
123 | | ||||
124 | QVariantList replicasModel(const KScreen::OutputPtr &output) const; | ||||
125 | | ||||
116 | QVector<Output> m_outputs; | 126 | QVector<Output> m_outputs; | ||
117 | 127 | | |||
118 | ConfigHandler *m_config; | 128 | ConfigHandler *m_config; | ||
119 | }; | 129 | }; |