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 52 Lines • ▼ Show 20 Line(s) | |||||
189 | /** | 197 | /** | ||
190 | * Transform that maps framebuffer to OutputDevice. | 198 | * Transform that maps framebuffer to OutputDevice. | ||
191 | * | 199 | * | ||
192 | * The purpose is mainly to allow clients render accordingly and tell the compositor, | 200 | * The purpose is mainly to allow clients render accordingly and tell the compositor, | ||
193 | * so that for fullscreen surfaces, the compositor will still be able to scan out | 201 | * so that for fullscreen surfaces, the compositor will still be able to scan out | ||
194 | * directly from client surfaces. | 202 | * directly from client surfaces. | ||
195 | **/ | 203 | **/ | ||
196 | Transform transform() const; | 204 | Transform transform() const; | ||
205 | /** | ||||
206 | * Color curves. | ||||
207 | **/ | ||||
208 | ColorCurves colorCurves() const; | ||||
197 | 209 | | |||
198 | /** | 210 | /** | ||
199 | * @returns The Modes of this OutputDevice. | 211 | * @returns The Modes of this OutputDevice. | ||
200 | **/ | 212 | **/ | ||
201 | QList<Mode> modes() const; | 213 | QList<Mode> modes() const; | ||
202 | 214 | | |||
203 | KWayland::Client::OutputDevice::Mode currentMode() const; | 215 | KWayland::Client::OutputDevice::Mode currentMode() const; | ||
204 | 216 | | |||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 254 | Q_SIGNALS: | |||
266 | void modeAdded(const KWayland::Client::OutputDevice::Mode &mode); | 278 | void modeAdded(const KWayland::Client::OutputDevice::Mode &mode); | ||
267 | /** | 279 | /** | ||
268 | * Emitted whenever a Mode changes. | 280 | * Emitted whenever a Mode changes. | ||
269 | * This normally means that the @c Mode::Flag::Current is added or removed. | 281 | * This normally means that the @c Mode::Flag::Current is added or removed. | ||
270 | * @param mode The changed Mode | 282 | * @param mode The changed Mode | ||
271 | **/ | 283 | **/ | ||
272 | void modeChanged(const KWayland::Client::OutputDevice::Mode &mode); | 284 | void modeChanged(const KWayland::Client::OutputDevice::Mode &mode); | ||
273 | /** | 285 | /** | ||
286 | * Emitted whenever the color curves changed. | ||||
287 | * | ||||
288 | * @since 5.TODO | ||||
289 | **/ | ||||
290 | void colorCurvesChanged(); | ||||
291 | /** | ||||
274 | * The corresponding global for this interface on the Registry got removed. | 292 | * The corresponding global for this interface on the Registry got removed. | ||
275 | * | 293 | * | ||
276 | * This signal gets only emitted if the OutputDevice got created by | 294 | * This signal gets only emitted if the OutputDevice got created by | ||
277 | * Registry::createOutputDevice | 295 | * Registry::createOutputDevice | ||
278 | * | 296 | * | ||
279 | * @since 5.5 | 297 | * @since 5.5 | ||
280 | **/ | 298 | **/ | ||
281 | void removed(); | 299 | void removed(); | ||
282 | 300 | | |||
283 | private: | 301 | private: | ||
284 | class Private; | 302 | class Private; | ||
285 | QScopedPointer<Private> d; | 303 | QScopedPointer<Private> d; | ||
286 | }; | 304 | }; | ||
287 | 305 | | |||
288 | } | 306 | } | ||
289 | } | 307 | } | ||
290 | 308 | | |||
291 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::SubPixel) | 309 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::SubPixel) | ||
292 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Transform) | 310 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Transform) | ||
293 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Enablement) | 311 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Enablement) | ||
294 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Mode) | 312 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::Mode) | ||
313 | Q_DECLARE_METATYPE(KWayland::Client::OutputDevice::ColorCurves) | ||||
295 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::OutputDevice::Mode::Flags) | 314 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWayland::Client::OutputDevice::Mode::Flags) | ||
296 | 315 | | |||
297 | #endif | 316 | #endif |