Changeset View
Changeset View
Standalone View
Standalone View
src/server/outputdevice_interface.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 72 | enum class Transform { | |||
---|---|---|---|---|---|
78 | Flipped90, | 78 | Flipped90, | ||
79 | Flipped180, | 79 | Flipped180, | ||
80 | Flipped270 | 80 | Flipped270 | ||
81 | }; | 81 | }; | ||
82 | enum class Enablement { | 82 | enum class Enablement { | ||
83 | Disabled = 0, | 83 | Disabled = 0, | ||
84 | Enabled = 1 | 84 | Enabled = 1 | ||
85 | }; | 85 | }; | ||
86 | enum class TriggerReason { | ||||
87 | None = 0, | ||||
88 | Explicit = 1 << 0, | ||||
89 | Hotplug = 1 << 1, | ||||
90 | Dpms = 1 << 2, | ||||
91 | Enablement = 1 << 3 | ||||
92 | }; | ||||
93 | enum class TriggerDirection { | ||||
94 | None = 0, | ||||
95 | Up = 1 << 0, | ||||
96 | Down = 1 << 1 | ||||
97 | }; | ||||
86 | enum class ModeFlag { | 98 | enum class ModeFlag { | ||
87 | Current = 1, | 99 | Current = 1, | ||
88 | Preferred = 2 | 100 | Preferred = 2 | ||
89 | }; | 101 | }; | ||
90 | Q_DECLARE_FLAGS(ModeFlags, ModeFlag) | 102 | Q_DECLARE_FLAGS(ModeFlags, ModeFlag) | ||
91 | struct Mode { | 103 | struct Mode { | ||
92 | QSize size = QSize(); | 104 | QSize size = QSize(); | ||
93 | int refreshRate = 60000; | 105 | int refreshRate = 60000; | ||
94 | ModeFlags flags; | 106 | ModeFlags flags; | ||
95 | int id = -1; | 107 | int id = -1; | ||
96 | }; | 108 | }; | ||
97 | struct ColorCurves { | 109 | struct ColorCurves { | ||
98 | QVector<quint16> red, green, blue; | 110 | QVector<quint16> red, green, blue; | ||
99 | bool operator==(const ColorCurves &cc) const; | 111 | bool operator==(const ColorCurves &cc) const; | ||
100 | bool operator!=(const ColorCurves &cc) const; | 112 | bool operator!=(const ColorCurves &cc) const; | ||
101 | }; | 113 | }; | ||
102 | virtual ~OutputDeviceInterface(); | 114 | virtual ~OutputDeviceInterface(); | ||
103 | 115 | | |||
104 | QSize physicalSize() const; | 116 | QSize physicalSize() const; | ||
117 | | ||||
118 | /** | ||||
119 | * Last explicitly set position in compositor space on this interface. In case the output is | ||||
120 | * a replica this position is not the current actual position in compositor space, but if | ||||
121 | * a replication goes away the compositor can fall back to this one. | ||||
122 | * | ||||
123 | * @return last explicitly set position in compositor space | ||||
124 | */ | ||||
105 | QPoint globalPosition() const; | 125 | QPoint globalPosition() const; | ||
126 | | ||||
127 | /** | ||||
128 | * This describes the current position in compositor space factoring in the globalPosition() and | ||||
129 | * if this output is a replica of another output. | ||||
130 | * | ||||
131 | * @return current position in compositor space | ||||
132 | * | ||||
133 | * @since 5.62 | ||||
134 | */ | ||||
135 | QPoint logicalPosition() const; | ||||
136 | | ||||
137 | /** | ||||
138 | * Current size in compositor space factoring in the globalPosition() and if this output is a | ||||
139 | * replica of another output. | ||||
140 | * @return | ||||
141 | * | ||||
142 | * @see globalSize | ||||
143 | * @see replicationSource | ||||
144 | * | ||||
145 | * @since 5.62 | ||||
146 | */ | ||||
147 | QSize logicalSize() const; | ||||
148 | | ||||
149 | /** | ||||
150 | * Describes the optimal placement of the presented output view in relation to the | ||||
151 | * pixel/mode size. Takes into account the aspect ratio and centers the view. | ||||
152 | * | ||||
153 | * @return view geometry in mode size coordinates | ||||
154 | * | ||||
155 | * @see pixelSize | ||||
156 | * | ||||
157 | * @since 5.62 | ||||
158 | */ | ||||
159 | QRect viewGeometry() const; | ||||
160 | | ||||
106 | QString manufacturer() const; | 161 | QString manufacturer() const; | ||
107 | QString model() const; | 162 | QString model() const; | ||
108 | QString serialNumber() const; | 163 | QString serialNumber() const; | ||
109 | QString eisaId() const; | 164 | QString eisaId() const; | ||
110 | QSize pixelSize() const; | 165 | QSize pixelSize() const; | ||
111 | int refreshRate() const; | 166 | int refreshRate() const; | ||
112 | int scale() const; | 167 | int scale() const; | ||
113 | qreal scaleF() const; | 168 | qreal scaleF() const; | ||
169 | | ||||
170 | /** | ||||
171 | * While scale() and scaleF() only depend on the scale explicity set this provides the | ||||
172 | * calculated scale that clients should orientate their rendering at. | ||||
173 | * | ||||
174 | * It takes into account the value set through setScale(int) and setScale(qreal) as well as the | ||||
175 | * replication status of the output such that a sharp image is produced on all replicas and the | ||||
176 | * replication source. | ||||
177 | * | ||||
178 | * @return calculated minimum clients scale on output to produce sharp images. | ||||
179 | * | ||||
180 | * @since 5.62 | ||||
181 | */ | ||||
182 | int clientsScale() const; | ||||
183 | | ||||
114 | SubPixel subPixel() const; | 184 | SubPixel subPixel() const; | ||
115 | Transform transform() const; | 185 | Transform transform() const; | ||
116 | ColorCurves colorCurves() const; | 186 | ColorCurves colorCurves() const; | ||
117 | QList<Mode> modes() const; | 187 | QList<Mode> modes() const; | ||
118 | int currentModeId() const; | 188 | int currentModeId() const; | ||
189 | quint32 cloneGroupId() const; | ||||
190 | OutputDeviceInterface* replicationSource() const; | ||||
119 | 191 | | |||
120 | QByteArray edid() const; | 192 | QByteArray edid() const; | ||
121 | OutputDeviceInterface::Enablement enabled() const; | 193 | OutputDeviceInterface::Enablement enabled() const; | ||
122 | QByteArray uuid() const; | 194 | QByteArray uuid() const; | ||
123 | 195 | | |||
124 | void setPhysicalSize(const QSize &size); | 196 | void setPhysicalSize(const QSize &size); | ||
125 | void setGlobalPosition(const QPoint &pos); | 197 | void setGlobalPosition(const QPoint &pos); | ||
126 | void setManufacturer(const QString &manufacturer); | 198 | void setManufacturer(const QString &manufacturer); | ||
Show All 9 Lines | |||||
136 | /** | 208 | /** | ||
137 | * Add an additional mode to this output device. This is only allowed before create() is called | 209 | * Add an additional mode to this output device. This is only allowed before create() is called | ||
138 | * on the object. | 210 | * on the object. | ||
139 | * | 211 | * | ||
140 | * @param mode must have a valid size and non-negative id. | 212 | * @param mode must have a valid size and non-negative id. | ||
141 | */ | 213 | */ | ||
142 | void addMode(Mode &mode); | 214 | void addMode(Mode &mode); | ||
143 | void setCurrentMode(const int modeId); | 215 | void setCurrentMode(const int modeId); | ||
216 | void setCloneGroupId(const quint32 groupId); | ||||
217 | void setReplicationSource(OutputDeviceInterface *source, TriggerReason trigger); | ||||
144 | 218 | | |||
145 | void setEdid(const QByteArray &edid); | 219 | void setEdid(const QByteArray &edid); | ||
146 | void setEnabled(OutputDeviceInterface::Enablement enabled); | 220 | void setEnabled(OutputDeviceInterface::Enablement enabled); | ||
147 | void setUuid(const QByteArray &uuid); | 221 | void setUuid(const QByteArray &uuid); | ||
148 | 222 | | |||
149 | static OutputDeviceInterface *get(wl_resource *native); | 223 | static OutputDeviceInterface *get(wl_resource *native); | ||
150 | static QList<OutputDeviceInterface *>list(); | 224 | static QList<OutputDeviceInterface *>list(); | ||
151 | 225 | | |||
152 | Q_SIGNALS: | 226 | Q_SIGNALS: | ||
153 | void physicalSizeChanged(const QSize&); | 227 | void physicalSizeChanged(const QSize&); | ||
228 | void viewGeometryChanged(const QRect&); | ||||
229 | | ||||
154 | void globalPositionChanged(const QPoint&); | 230 | void globalPositionChanged(const QPoint&); | ||
231 | void logicalPositionChanged(const QPoint&); | ||||
232 | | ||||
155 | void manufacturerChanged(const QString&); | 233 | void manufacturerChanged(const QString&); | ||
156 | void modelChanged(const QString&); | 234 | void modelChanged(const QString&); | ||
157 | void serialNumberChanged(const QString&); | 235 | void serialNumberChanged(const QString&); | ||
158 | void eisaIdChanged(const QString &); | 236 | void eisaIdChanged(const QString &); | ||
159 | void pixelSizeChanged(const QSize&); | 237 | void pixelSizeChanged(const QSize&); | ||
238 | | ||||
239 | void globalSizeChanged(const QSize&); | ||||
240 | void logicalSizeChanged(const QSize&); | ||||
241 | | ||||
160 | void refreshRateChanged(int); | 242 | void refreshRateChanged(int); | ||
243 | void cloneGroupIdChanged(quint32); | ||||
244 | void replicationSourceChanged(OutputDeviceInterface*, TriggerReason trigger, | ||||
245 | TriggerDirection direction); | ||||
161 | //@deprecated see scaleChanged(real) | 246 | //@deprecated see scaleChanged(real) | ||
162 | void scaleChanged(int); | 247 | void scaleChanged(int); | ||
163 | void scaleFChanged(qreal); | 248 | void scaleFChanged(qreal); | ||
249 | void clientsScaleChanged(int); | ||||
164 | void subPixelChanged(SubPixel); | 250 | void subPixelChanged(SubPixel); | ||
165 | void transformChanged(Transform); | 251 | void transformChanged(Transform); | ||
166 | void colorCurvesChanged(ColorCurves); | 252 | void colorCurvesChanged(ColorCurves); | ||
167 | void modesChanged(); | 253 | void modesChanged(); | ||
168 | void currentModeChanged(); | 254 | void currentModeChanged(); | ||
169 | 255 | | |||
170 | void edidChanged(); | 256 | void edidChanged(); | ||
171 | void enabledChanged(); | 257 | void enabledChanged(); | ||
Show All 19 Lines |