server side of new outputmanagement protocol
This implements the server part of the screen management protocol. The
protocol is implemented as a wayland protocol.
It provides the following mechanisms:
- a list of outputs, close to wl_output, with additional properties for
enabled, uuid, edid, etc.. These OutputDevices correspond to a
connected output that can be enabled by the compositor, but is not
necessarily currently used for rendering.
- a global OutputManagement, which allows creating config objects, one
per client. The client can make changes to the outputs through
setScale(outputdevice*, scale) for example.
- an OutputConfiguration resource, that can be handed to a client and
used for configuration. Changes are double buffered here. Only after
OutputConfiguration.apply() has been called, the changes are relayed
over the global OutputManagement.
The compositor is responsible to handle changes.
For a more detailed description, see the API docs in especially
outputconfiguration.h.
REVIEW:125942
2015-11-04 14:36:52 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* Copyright 2015 Sebastian Kügler <sebas@kde.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) version 3, or any
|
|
|
|
* later version accepted by the membership of KDE e.V. (or its
|
|
|
|
* successor approved by the membership of KDE e.V.), which shall
|
|
|
|
* act as a proxy defined in Section 6 of version 3 of the license.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "outputchangeset.h"
|
|
|
|
#include "outputchangeset_p.h"
|
|
|
|
|
|
|
|
namespace KWayland
|
|
|
|
{
|
|
|
|
namespace Server
|
|
|
|
{
|
|
|
|
|
|
|
|
OutputChangeSet::Private::Private(OutputDeviceInterface *outputdevice, OutputChangeSet *parent)
|
|
|
|
: q(parent)
|
|
|
|
, o(outputdevice)
|
|
|
|
, enabled(o->enabled())
|
|
|
|
, modeId(o->currentModeId())
|
|
|
|
, transform(o->transform())
|
|
|
|
, position(o->globalPosition())
|
|
|
|
, scale(o->scale())
|
2018-07-25 20:26:26 +00:00
|
|
|
, colorCurves(o->colorCurves())
|
server side of new outputmanagement protocol
This implements the server part of the screen management protocol. The
protocol is implemented as a wayland protocol.
It provides the following mechanisms:
- a list of outputs, close to wl_output, with additional properties for
enabled, uuid, edid, etc.. These OutputDevices correspond to a
connected output that can be enabled by the compositor, but is not
necessarily currently used for rendering.
- a global OutputManagement, which allows creating config objects, one
per client. The client can make changes to the outputs through
setScale(outputdevice*, scale) for example.
- an OutputConfiguration resource, that can be handed to a client and
used for configuration. Changes are double buffered here. Only after
OutputConfiguration.apply() has been called, the changes are relayed
over the global OutputManagement.
The compositor is responsible to handle changes.
For a more detailed description, see the API docs in especially
outputconfiguration.h.
REVIEW:125942
2015-11-04 14:36:52 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
OutputChangeSet::Private::~Private() = default;
|
|
|
|
|
|
|
|
OutputChangeSet::OutputChangeSet(OutputDeviceInterface *outputdevice, QObject *parent)
|
|
|
|
: QObject(parent)
|
|
|
|
, d(new Private(outputdevice, this))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
OutputChangeSet::~OutputChangeSet() = default;
|
|
|
|
|
|
|
|
OutputChangeSet::Private *OutputChangeSet::d_func() const
|
|
|
|
{
|
|
|
|
return reinterpret_cast<Private*>(d.data());
|
|
|
|
}
|
|
|
|
|
|
|
|
bool OutputChangeSet::enabledChanged() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->enabled != d->o->enabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
OutputDeviceInterface::Enablement OutputChangeSet::enabled() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool OutputChangeSet::modeChanged() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->modeId != d->o->currentModeId();
|
|
|
|
}
|
|
|
|
|
|
|
|
int OutputChangeSet::mode() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->modeId;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool OutputChangeSet::transformChanged() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->transform != d->o->transform();
|
|
|
|
}
|
|
|
|
|
|
|
|
OutputDeviceInterface::Transform OutputChangeSet::transform() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->transform;
|
|
|
|
}
|
|
|
|
bool OutputChangeSet::positionChanged() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->position != d->o->globalPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
QPoint OutputChangeSet::position() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->position;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool OutputChangeSet::scaleChanged() const
|
|
|
|
{
|
|
|
|
Q_D();
|
2018-07-25 20:14:17 +00:00
|
|
|
return !qFuzzyCompare(d->scale, d->o->scaleF());
|
server side of new outputmanagement protocol
This implements the server part of the screen management protocol. The
protocol is implemented as a wayland protocol.
It provides the following mechanisms:
- a list of outputs, close to wl_output, with additional properties for
enabled, uuid, edid, etc.. These OutputDevices correspond to a
connected output that can be enabled by the compositor, but is not
necessarily currently used for rendering.
- a global OutputManagement, which allows creating config objects, one
per client. The client can make changes to the outputs through
setScale(outputdevice*, scale) for example.
- an OutputConfiguration resource, that can be handed to a client and
used for configuration. Changes are double buffered here. Only after
OutputConfiguration.apply() has been called, the changes are relayed
over the global OutputManagement.
The compositor is responsible to handle changes.
For a more detailed description, see the API docs in especially
outputconfiguration.h.
REVIEW:125942
2015-11-04 14:36:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int OutputChangeSet::scale() const
|
2018-07-25 20:14:17 +00:00
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return qRound(d->scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
qreal OutputChangeSet::scaleF() const
|
server side of new outputmanagement protocol
This implements the server part of the screen management protocol. The
protocol is implemented as a wayland protocol.
It provides the following mechanisms:
- a list of outputs, close to wl_output, with additional properties for
enabled, uuid, edid, etc.. These OutputDevices correspond to a
connected output that can be enabled by the compositor, but is not
necessarily currently used for rendering.
- a global OutputManagement, which allows creating config objects, one
per client. The client can make changes to the outputs through
setScale(outputdevice*, scale) for example.
- an OutputConfiguration resource, that can be handed to a client and
used for configuration. Changes are double buffered here. Only after
OutputConfiguration.apply() has been called, the changes are relayed
over the global OutputManagement.
The compositor is responsible to handle changes.
For a more detailed description, see the API docs in especially
outputconfiguration.h.
REVIEW:125942
2015-11-04 14:36:52 +00:00
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->scale;
|
|
|
|
}
|
|
|
|
|
2018-07-25 20:26:26 +00:00
|
|
|
bool OutputChangeSet::colorCurvesChanged() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->colorCurves != d->o->colorCurves();
|
|
|
|
}
|
|
|
|
|
|
|
|
OutputDeviceInterface::ColorCurves OutputChangeSet::colorCurves() const
|
|
|
|
{
|
|
|
|
Q_D();
|
|
|
|
return d->colorCurves;
|
|
|
|
}
|
|
|
|
|
server side of new outputmanagement protocol
This implements the server part of the screen management protocol. The
protocol is implemented as a wayland protocol.
It provides the following mechanisms:
- a list of outputs, close to wl_output, with additional properties for
enabled, uuid, edid, etc.. These OutputDevices correspond to a
connected output that can be enabled by the compositor, but is not
necessarily currently used for rendering.
- a global OutputManagement, which allows creating config objects, one
per client. The client can make changes to the outputs through
setScale(outputdevice*, scale) for example.
- an OutputConfiguration resource, that can be handed to a client and
used for configuration. Changes are double buffered here. Only after
OutputConfiguration.apply() has been called, the changes are relayed
over the global OutputManagement.
The compositor is responsible to handle changes.
For a more detailed description, see the API docs in especially
outputconfiguration.h.
REVIEW:125942
2015-11-04 14:36:52 +00:00
|
|
|
}
|
|
|
|
}
|