KWayland

outputchangeset.cpp
1 /*
2  SPDX-FileCopyrightText: 2015 Sebastian Kügler <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #include "outputchangeset.h"
8 #include "outputchangeset_p.h"
9 
10 namespace KWayland
11 {
12 namespace Server
13 {
14 
15 OutputChangeSet::Private::Private(OutputDeviceInterface *outputdevice, OutputChangeSet *parent)
16  : q(parent)
17  , o(outputdevice)
18  , enabled(o->enabled())
19  , modeId(o->currentModeId())
20  , transform(o->transform())
21  , position(o->globalPosition())
22  , scale(o->scaleF())
23  , colorCurves(o->colorCurves())
24 {
25 }
26 
27 OutputChangeSet::Private::~Private() = default;
28 
29 OutputChangeSet::OutputChangeSet(OutputDeviceInterface *outputdevice, QObject *parent)
30  : QObject(parent)
31  , d(new Private(outputdevice, this))
32 {
33 }
34 
35 OutputChangeSet::~OutputChangeSet() = default;
36 
37 OutputChangeSet::Private *OutputChangeSet::d_func() const
38 {
39  return reinterpret_cast<Private*>(d.data());
40 }
41 
43 {
44  Q_D();
45  return d->enabled != d->o->enabled();
46 }
47 
48 OutputDeviceInterface::Enablement OutputChangeSet::enabled() const
49 {
50  Q_D();
51  return d->enabled;
52 }
53 
55 {
56  Q_D();
57  return d->modeId != d->o->currentModeId();
58 }
59 
61 {
62  Q_D();
63  return d->modeId;
64 }
65 
67 {
68  Q_D();
69  return d->transform != d->o->transform();
70 }
71 
72 OutputDeviceInterface::Transform OutputChangeSet::transform() const
73 {
74  Q_D();
75  return d->transform;
76 }
78 {
79  Q_D();
80  return d->position != d->o->globalPosition();
81 }
82 
84 {
85  Q_D();
86  return d->position;
87 }
88 
90 {
91  Q_D();
92  return !qFuzzyCompare(d->scale, d->o->scaleF());
93 }
94 
96 {
97  Q_D();
98  return qRound(d->scale);
99 }
100 
102 {
103  Q_D();
104  return d->scale;
105 }
106 
108 {
109  Q_D();
110  return d->colorCurves != d->o->colorCurves();
111 }
112 
113 OutputDeviceInterface::ColorCurves OutputChangeSet::colorCurves() const
114 {
115  Q_D();
116  return d->colorCurves;
117 }
118 
119 }
120 }
OutputDeviceInterface::Transform transform() const
The new value for transform.
qreal scaleF() const
The new value for scale.
bool scaleChanged() const
Whether the scale() property of the outputdevice changed.
KDOCTOOLS_EXPORT QString transform(const QString &file, const QString &stylesheet, const QVector< const char * > &params=QVector< const char * >())
OutputDeviceInterface::ColorCurves colorCurves() const
The new value for colorCurves.
bool enabledChanged() const
Whether the enabled() property of the outputdevice changed.
OutputDeviceInterface::Enablement enabled() const
The new value for enabled.
T * data() const const
bool colorCurvesChanged() const
Whether the colorCurves() property of the outputdevice changed.
int scale() const
The new value for scale.
int mode() const
The new mode id.
bool positionChanged() const
Whether the globalPosition() property of the outputdevice changed.
bool modeChanged() const
Whether the currentModeId() property of the outputdevice changed.
QObject * parent() const const
bool transformChanged() const
Whether the currentModeId() property of the outputdevice changed.
QPoint position() const
The new value for globalPosition.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:18 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.