Changeset View
Changeset View
Standalone View
Standalone View
src/client/outputdevice.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | Copyright 2013 Martin Gräßlin <mgraesslin@kde.org> | 2 | Copyright 2013 Martin Gräßlin <mgraesslin@kde.org> | ||
3 | Copyright 2018 Roman Gilg <subdiff@gmail.com> | ||||
3 | 4 | | |||
4 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or | ||
5 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public | ||
6 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either | ||
7 | version 2.1 of the License, or (at your option) version 3, or any | 8 | version 2.1 of the License, or (at your option) version 3, or any | ||
8 | later version accepted by the membership of KDE e.V. (or its | 9 | later version accepted by the membership of KDE e.V. (or its | ||
9 | successor approved by the membership of KDE e.V.), which shall | 10 | successor approved by the membership of KDE e.V.), which shall | ||
10 | act as a proxy defined in Section 6 of version 3 of the license. | 11 | act as a proxy defined in Section 6 of version 3 of the license. | ||
11 | 12 | | |||
12 | This library is distributed in the hope that it will be useful, | 13 | This library is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | Lesser General Public License for more details. | 16 | Lesser General Public License for more details. | ||
16 | 17 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 18 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 19 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 20 | *********************************************************************/ | ||
20 | #ifndef WAYLAND_OUTPUTDEVICE_H | 21 | #ifndef WAYLAND_OUTPUTDEVICE_H | ||
21 | #define WAYLAND_OUTPUTDEVICE_H | 22 | #define WAYLAND_OUTPUTDEVICE_H | ||
22 | 23 | | |||
23 | #include <QObject> | 24 | #include <QObject> | ||
24 | #include <QPointer> | 25 | #include <QPointer> | ||
25 | #include <QSize> | 26 | #include <QSize> | ||
27 | #include <QVector> | ||||
26 | 28 | | |||
27 | #include <KWayland/Client/kwaylandclient_export.h> | 29 | #include <KWayland/Client/kwaylandclient_export.h> | ||
28 | 30 | | |||
29 | struct org_kde_kwin_outputdevice; | 31 | struct org_kde_kwin_outputdevice; | ||
30 | class QPoint; | 32 | class QPoint; | ||
31 | class QRect; | 33 | class QRect; | ||
32 | 34 | | |||
33 | namespace KWayland | 35 | namespace KWayland | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 98 | struct Mode { | |||
121 | * The id of this mode, unique per OutputDevice. This id can be used to call | 123 | * The id of this mode, unique per OutputDevice. This id can be used to call | ||
122 | * OutputConfiguration->setMode(); | 124 | * OutputConfiguration->setMode(); | ||
123 | * @see OutputConfiguration::setMode | 125 | * @see OutputConfiguration::setMode | ||
124 | **/ | 126 | **/ | ||
125 | int id; | 127 | int id; | ||
126 | 128 | | |||
127 | bool operator==(const Mode &m) const; | 129 | bool operator==(const Mode &m) const; | ||
128 | }; | 130 | }; | ||
131 | struct ColorCurves { | ||||
132 | QVector<quint16> red, green, blue; | ||||
133 | | ||||
134 | bool operator==(const ColorCurves &cc) const; | ||||
135 | bool operator!=(const ColorCurves &cc) const; | ||||
136 | }; | ||||
129 | explicit OutputDevice(QObject *parent = nullptr); | 137 | explicit OutputDevice(QObject *parent = nullptr); | ||
130 | virtual ~OutputDevice(); | 138 | virtual ~OutputDevice(); | ||
131 | 139 | | |||
132 | /** | 140 | /** | ||
133 | * Setup this Compositor to manage the @p output. | 141 | * Setup this Compositor to manage the @p output. | ||
134 | * When using Registry::createOutputDevice there is no need to call this | 142 | * When using Registry::createOutputDevice there is no need to call this | ||
135 | * method. | 143 | * method. | ||
136 | **/ | 144 | **/ | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
200 | /** | 208 | /** | ||
201 | * Transform that maps framebuffer to OutputDevice. | 209 | * Transform that maps framebuffer to OutputDevice. | ||
202 | * | 210 | * | ||
203 | * The purpose is mainly to allow clients render accordingly and tell the compositor, | 211 | * The purpose is mainly to allow clients render accordingly and tell the compositor, | ||
204 | * so that for fullscreen surfaces, the compositor will still be able to scan out | 212 | * so that for fullscreen surfaces, the compositor will still be able to scan out | ||
205 | * directly from client surfaces. | 213 | * directly from client surfaces. | ||
206 | **/ | 214 | **/ | ||
207 | Transform transform() const; | 215 | Transform transform() const; | ||
216 | /** | ||||
217 | * Color curves. | ||||
218 | * @since 5.50 | ||||
219 | **/ | ||||
220 | ColorCurves colorCurves() const; | ||||
208 | 221 | | |||
209 | /** | 222 | /** | ||
210 | * @returns The Modes of this OutputDevice. | 223 | * @returns The Modes of this OutputDevice. | ||
211 | **/ | 224 | **/ | ||
212 | QList<Mode> modes() const; | 225 | QList<Mode> modes() const; | ||
213 | 226 | | |||
214 | KWayland::Client::OutputDevice::Mode currentMode() const; | 227 | KWayland::Client::OutputDevice::Mode currentMode() const; | ||
215 | 228 | | |||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 266 | Q_SIGNALS: | |||
277 | void modeAdded(const KWayland::Client::OutputDevice::Mode &mode); | 290 | void modeAdded(const KWayland::Client::OutputDevice::Mode &mode); | ||
278 | /** | 291 | /** | ||
279 | * Emitted whenever a Mode changes. | 292 | * Emitted whenever a Mode changes. | ||
280 | * This normally means that the @c Mode::Flag::Current is added or removed. | 293 | * This normally means that the @c Mode::Flag::Current is added or removed. | ||
281 | * @param mode The changed Mode | 294 | * @param mode The changed Mode | ||
282 | **/ | 295 | **/ | ||
283 | void modeChanged(const KWayland::Client::OutputDevice::Mode &mode); | 296 | void modeChanged(const KWayland::Client::OutputDevice::Mode &mode); | ||
284 | /** | 297 | /** | ||
298 | * Emitted whenever the color curves changed. | ||||
299 | * | ||||
300 | * @since 5.TODO | ||||
301 | **/ | ||||
302 | void colorCurvesChanged(); | ||||
303 | /** | ||||
285 | * The corresponding global for this interface on the Registry got removed. | 304 | * The corresponding global for this interface on the Registry got removed. | ||
286 | * | 305 | * | ||
287 | * This signal gets only emitted if the OutputDevice got created by | 306 | * This signal gets only emitted if the OutputDevice got created by | ||
288 | * Registry::createOutputDevice | 307 | * Registry::createOutputDevice | ||
289 | * | 308 | * | ||
290 | * @since 5.5 | 309 | * @since 5.5 | ||
291 | **/ | 310 | **/ | ||
292 | void removed(); | 311 | void removed(); | ||
293 | 312 | | |||
294 | private: | 313 | private: | ||
295 | class Private; | 314 | class Private; | ||
296 | QScopedPointer<Private> d; | 315 | QScopedPointer<Private> d; | ||
297 | }; | 316 | }; | ||
298 | 317 | | |||
299 | } | 318 | } | ||
300 | } | 319 | } | ||
301 | 320 | | |||
302 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::SubPixel) | 321 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::SubPixel) | ||
303 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Transform) | 322 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Transform) | ||
304 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Enablement) | 323 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Enablement) | ||
305 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Mode) | 324 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Mode) | ||
325 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::ColorCurves) | ||||
306 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::OutputDevice::Mode::Flags) | 326 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::OutputDevice::Mode::Flags) | ||
307 | 327 | | |||
308 | #endif | 328 | #endif |