2014-08-26 14:07:39 +00:00
|
|
|
/********************************************************************
|
2014-09-17 13:57:56 +00:00
|
|
|
Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
|
2014-08-26 14:07:39 +00:00
|
|
|
|
2014-09-17 13:57:56 +00:00
|
|
|
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.
|
2014-08-26 14:07:39 +00:00
|
|
|
|
2014-09-17 13:57:56 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
2014-08-26 14:07:39 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2014-09-17 13:57:56 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2014-08-26 14:07:39 +00:00
|
|
|
|
2014-09-17 13:57:56 +00:00
|
|
|
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/>.
|
2014-08-26 14:07:39 +00:00
|
|
|
*********************************************************************/
|
|
|
|
#include "output_interface.h"
|
2014-11-13 14:07:31 +00:00
|
|
|
#include "global_p.h"
|
2014-08-26 14:07:39 +00:00
|
|
|
#include "display.h"
|
|
|
|
|
|
|
|
#include <wayland-server.h>
|
|
|
|
|
2014-09-17 14:10:38 +00:00
|
|
|
namespace KWayland
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-09-17 14:10:38 +00:00
|
|
|
namespace Server
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
static const quint32 s_version = 2;
|
|
|
|
|
2014-11-13 14:07:31 +00:00
|
|
|
class OutputInterface::Private : public Global::Private
|
2014-09-18 14:00:21 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct ResourceData {
|
|
|
|
wl_resource *resource;
|
|
|
|
uint32_t version;
|
|
|
|
};
|
|
|
|
Private(OutputInterface *q, Display *d);
|
2014-11-13 14:07:31 +00:00
|
|
|
void create() override;
|
2014-09-18 14:00:21 +00:00
|
|
|
void sendMode(wl_resource *resource, const Mode &mode);
|
|
|
|
void sendDone(const ResourceData &data);
|
|
|
|
void updateGeometry();
|
|
|
|
void updateScale();
|
|
|
|
|
|
|
|
QSize physicalSize;
|
|
|
|
QPoint globalPosition;
|
|
|
|
QString manufacturer = QStringLiteral("org.kde.kwin");
|
|
|
|
QString model = QStringLiteral("none");
|
|
|
|
int scale = 1;
|
|
|
|
SubPixel subPixel = SubPixel::Unknown;
|
|
|
|
Transform transform = Transform::Normal;
|
|
|
|
QList<Mode> modes;
|
|
|
|
QList<ResourceData> resources;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static void bind(wl_client *client, void *data, uint32_t version, uint32_t id);
|
|
|
|
static void unbind(wl_resource *resource);
|
|
|
|
void bind(wl_client *client, uint32_t version, uint32_t id);
|
|
|
|
int32_t toTransform() const;
|
|
|
|
int32_t toSubPixel() const;
|
|
|
|
void sendGeometry(wl_resource *resource);
|
|
|
|
void sendScale(const ResourceData &data);
|
|
|
|
|
|
|
|
OutputInterface *q;
|
|
|
|
};
|
|
|
|
|
|
|
|
OutputInterface::Private::Private(OutputInterface *q, Display *d)
|
2014-11-13 14:07:31 +00:00
|
|
|
: Global::Private(d)
|
2014-09-18 14:00:21 +00:00
|
|
|
, q(q)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void OutputInterface::Private::create()
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_ASSERT(!global);
|
|
|
|
global = wl_global_create(*display, &wl_output_interface, s_version, this, bind);
|
2014-09-18 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
2014-08-26 14:07:39 +00:00
|
|
|
OutputInterface::OutputInterface(Display *display, QObject *parent)
|
2014-11-13 14:07:31 +00:00
|
|
|
: Global(new Private(this, display), parent)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-08-26 14:07:39 +00:00
|
|
|
connect(this, &OutputInterface::currentModeChanged, this,
|
2014-11-13 14:07:31 +00:00
|
|
|
[this, d] {
|
2014-09-18 14:00:21 +00:00
|
|
|
auto currentModeIt = std::find_if(d->modes.constBegin(), d->modes.constEnd(), [](const Mode &mode) { return mode.flags.testFlag(ModeFlag::Current); });
|
|
|
|
if (currentModeIt == d->modes.constEnd()) {
|
2014-08-26 14:07:39 +00:00
|
|
|
return;
|
|
|
|
}
|
2014-09-18 14:00:21 +00:00
|
|
|
for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) {
|
|
|
|
d->sendMode((*it).resource, *currentModeIt);
|
|
|
|
d->sendDone(*it);
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2014-11-13 14:07:31 +00:00
|
|
|
connect(this, &OutputInterface::subPixelChanged, this, [this, d] { d->updateGeometry(); });
|
|
|
|
connect(this, &OutputInterface::transformChanged, this, [this, d] { d->updateGeometry(); });
|
|
|
|
connect(this, &OutputInterface::globalPositionChanged, this, [this, d] { d->updateGeometry(); });
|
|
|
|
connect(this, &OutputInterface::modelChanged, this, [this, d] { d->updateGeometry(); });
|
|
|
|
connect(this, &OutputInterface::manufacturerChanged, this, [this, d] { d->updateGeometry(); });
|
|
|
|
connect(this, &OutputInterface::scaleChanged, this, [this, d] { d->updateScale(); });
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
|
2014-11-13 14:07:31 +00:00
|
|
|
OutputInterface::~OutputInterface() = default;
|
2014-08-26 14:07:39 +00:00
|
|
|
|
|
|
|
QSize OutputInterface::pixelSize() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
auto it = std::find_if(d->modes.begin(), d->modes.end(),
|
2014-08-26 14:07:39 +00:00
|
|
|
[](const Mode &mode) {
|
|
|
|
return mode.flags.testFlag(ModeFlag::Current);
|
|
|
|
}
|
|
|
|
);
|
2014-09-18 14:00:21 +00:00
|
|
|
if (it == d->modes.end()) {
|
2014-08-26 14:07:39 +00:00
|
|
|
return QSize();
|
|
|
|
}
|
|
|
|
return (*it).size;
|
|
|
|
}
|
|
|
|
|
|
|
|
int OutputInterface::refreshRate() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
auto it = std::find_if(d->modes.begin(), d->modes.end(),
|
2014-08-26 14:07:39 +00:00
|
|
|
[](const Mode &mode) {
|
|
|
|
return mode.flags.testFlag(ModeFlag::Current);
|
|
|
|
}
|
|
|
|
);
|
2014-09-18 14:00:21 +00:00
|
|
|
if (it == d->modes.end()) {
|
2014-08-26 14:07:39 +00:00
|
|
|
return 60000;
|
|
|
|
}
|
|
|
|
return (*it).refreshRate;
|
|
|
|
}
|
|
|
|
|
|
|
|
void OutputInterface::addMode(const QSize &size, OutputInterface::ModeFlags flags, int refreshRate)
|
|
|
|
{
|
|
|
|
Q_ASSERT(!isValid());
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-08-26 14:07:39 +00:00
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(),
|
2014-08-26 14:07:39 +00:00
|
|
|
[](const Mode &mode) {
|
|
|
|
return mode.flags.testFlag(ModeFlag::Current);
|
|
|
|
}
|
|
|
|
);
|
2014-09-18 14:00:21 +00:00
|
|
|
if (currentModeIt == d->modes.end() && !flags.testFlag(ModeFlag::Current)) {
|
2014-08-26 14:07:39 +00:00
|
|
|
// no mode with current flag - enforce
|
|
|
|
flags |= ModeFlag::Current;
|
|
|
|
}
|
2014-09-18 14:00:21 +00:00
|
|
|
if (currentModeIt != d->modes.end() && flags.testFlag(ModeFlag::Current)) {
|
2014-08-26 14:07:39 +00:00
|
|
|
// another mode has the current flag - remove
|
|
|
|
(*currentModeIt).flags &= ~uint(ModeFlag::Current);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags.testFlag(ModeFlag::Preferred)) {
|
|
|
|
// remove from existing Preferred mode
|
2014-09-18 14:00:21 +00:00
|
|
|
auto preferredIt = std::find_if(d->modes.begin(), d->modes.end(),
|
2014-08-26 14:07:39 +00:00
|
|
|
[](const Mode &mode) {
|
|
|
|
return mode.flags.testFlag(ModeFlag::Preferred);
|
|
|
|
}
|
|
|
|
);
|
2014-09-18 14:00:21 +00:00
|
|
|
if (preferredIt != d->modes.end()) {
|
2014-08-26 14:07:39 +00:00
|
|
|
(*preferredIt).flags &= ~uint(ModeFlag::Preferred);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(),
|
2014-08-26 14:07:39 +00:00
|
|
|
[size,refreshRate](const Mode &mode) {
|
|
|
|
return mode.size == size && mode.refreshRate == refreshRate;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
auto emitChanges = [this,flags,size,refreshRate] {
|
|
|
|
emit modesChanged();
|
|
|
|
if (flags.testFlag(ModeFlag::Current)) {
|
|
|
|
emit refreshRateChanged(refreshRate);
|
|
|
|
emit pixelSizeChanged(size);
|
|
|
|
emit currentModeChanged();
|
|
|
|
}
|
|
|
|
};
|
2014-09-18 14:00:21 +00:00
|
|
|
if (existingModeIt != d->modes.end()) {
|
2014-08-26 14:07:39 +00:00
|
|
|
if ((*existingModeIt).flags == flags) {
|
|
|
|
// nothing to do
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
(*existingModeIt).flags = flags;
|
|
|
|
emitChanges();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Mode mode;
|
|
|
|
mode.size = size;
|
|
|
|
mode.refreshRate = refreshRate;
|
|
|
|
mode.flags = flags;
|
2014-09-18 14:00:21 +00:00
|
|
|
d->modes << mode;
|
2014-08-26 14:07:39 +00:00
|
|
|
emitChanges();
|
|
|
|
}
|
|
|
|
|
|
|
|
void OutputInterface::setCurrentMode(const QSize &size, int refreshRate)
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(),
|
2014-08-26 14:07:39 +00:00
|
|
|
[](const Mode &mode) {
|
|
|
|
return mode.flags.testFlag(ModeFlag::Current);
|
|
|
|
}
|
|
|
|
);
|
2014-09-18 14:00:21 +00:00
|
|
|
if (currentModeIt != d->modes.end()) {
|
2014-08-26 14:07:39 +00:00
|
|
|
// another mode has the current flag - remove
|
|
|
|
(*currentModeIt).flags &= ~uint(ModeFlag::Current);
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(),
|
2014-08-26 14:07:39 +00:00
|
|
|
[size,refreshRate](const Mode &mode) {
|
|
|
|
return mode.size == size && mode.refreshRate == refreshRate;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
Q_ASSERT(existingModeIt != d->modes.end());
|
2014-08-26 14:07:39 +00:00
|
|
|
(*existingModeIt).flags |= ModeFlag::Current;
|
|
|
|
emit modesChanged();
|
|
|
|
emit refreshRateChanged((*existingModeIt).refreshRate);
|
|
|
|
emit pixelSizeChanged((*existingModeIt).size);
|
|
|
|
emit currentModeChanged();
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::bind(wl_client *client, void *data, uint32_t version, uint32_t id)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-09-18 14:00:21 +00:00
|
|
|
auto output = reinterpret_cast<OutputInterface::Private*>(data);
|
2014-08-26 14:07:39 +00:00
|
|
|
output->bind(client, version, id);
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
int32_t OutputInterface::Private::toTransform() const
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-09-18 14:00:21 +00:00
|
|
|
switch (transform) {
|
2014-08-26 14:07:39 +00:00
|
|
|
case Transform::Normal:
|
|
|
|
return WL_OUTPUT_TRANSFORM_NORMAL;
|
|
|
|
case Transform::Rotated90:
|
|
|
|
return WL_OUTPUT_TRANSFORM_90;
|
|
|
|
case Transform::Rotated180:
|
|
|
|
return WL_OUTPUT_TRANSFORM_180;
|
|
|
|
case Transform::Rotated270:
|
|
|
|
return WL_OUTPUT_TRANSFORM_270;
|
|
|
|
case Transform::Flipped:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED;
|
|
|
|
case Transform::Flipped90:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED_90;
|
|
|
|
case Transform::Flipped180:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED_180;
|
|
|
|
case Transform::Flipped270:
|
|
|
|
return WL_OUTPUT_TRANSFORM_FLIPPED_270;
|
|
|
|
}
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
int32_t OutputInterface::Private::toSubPixel() const
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-09-18 14:00:21 +00:00
|
|
|
switch (subPixel) {
|
2014-08-26 14:07:39 +00:00
|
|
|
case SubPixel::Unknown:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_UNKNOWN;
|
|
|
|
case SubPixel::None:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_NONE;
|
|
|
|
case SubPixel::HorizontalRGB:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB;
|
|
|
|
case SubPixel::HorizontalBGR:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR;
|
|
|
|
case SubPixel::VerticalRGB:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB;
|
|
|
|
case SubPixel::VerticalBGR:
|
|
|
|
return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR;
|
|
|
|
}
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
|
|
|
wl_resource *resource = wl_resource_create(client, &wl_output_interface, qMin(version, s_version), id);
|
|
|
|
if (!resource) {
|
|
|
|
wl_client_post_no_memory(client);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
wl_resource_set_user_data(resource, this);
|
2014-09-18 14:00:21 +00:00
|
|
|
wl_resource_set_destructor(resource, unbind);
|
2014-08-26 14:07:39 +00:00
|
|
|
ResourceData r;
|
|
|
|
r.resource = resource;
|
|
|
|
r.version = version;
|
2014-09-18 14:00:21 +00:00
|
|
|
resources << r;
|
2014-08-26 14:07:39 +00:00
|
|
|
|
|
|
|
sendGeometry(resource);
|
|
|
|
sendScale(r);
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
auto currentModeIt = modes.constEnd();
|
|
|
|
for (auto it = modes.constBegin(); it != modes.constEnd(); ++it) {
|
2014-08-26 14:07:39 +00:00
|
|
|
const Mode &mode = *it;
|
|
|
|
if (mode.flags.testFlag(ModeFlag::Current)) {
|
|
|
|
// needs to be sent as last mode
|
|
|
|
currentModeIt = it;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
sendMode(resource, mode);
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
if (currentModeIt != modes.constEnd()) {
|
2014-08-26 14:07:39 +00:00
|
|
|
sendMode(resource, *currentModeIt);
|
|
|
|
}
|
|
|
|
|
|
|
|
sendDone(r);
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::unbind(wl_resource *resource)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-09-18 14:00:21 +00:00
|
|
|
auto o = reinterpret_cast<OutputInterface::Private*>(wl_resource_get_user_data(resource));
|
|
|
|
auto it = std::find_if(o->resources.begin(), o->resources.end(), [resource](const ResourceData &r) { return r.resource == resource; });
|
|
|
|
if (it != o->resources.end()) {
|
|
|
|
o->resources.erase(it);
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::sendMode(wl_resource *resource, const Mode &mode)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
|
|
|
int32_t flags = 0;
|
|
|
|
if (mode.flags.testFlag(ModeFlag::Current)) {
|
|
|
|
flags |= WL_OUTPUT_MODE_CURRENT;
|
|
|
|
}
|
|
|
|
if (mode.flags.testFlag(ModeFlag::Preferred)) {
|
|
|
|
flags |= WL_OUTPUT_MODE_PREFERRED;
|
|
|
|
}
|
|
|
|
wl_output_send_mode(resource,
|
|
|
|
flags,
|
|
|
|
mode.size.width(),
|
|
|
|
mode.size.height(),
|
|
|
|
mode.refreshRate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::sendGeometry(wl_resource *resource)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
|
|
|
wl_output_send_geometry(resource,
|
2014-09-18 14:00:21 +00:00
|
|
|
globalPosition.x(),
|
|
|
|
globalPosition.y(),
|
|
|
|
physicalSize.width(),
|
|
|
|
physicalSize.height(),
|
2014-08-26 14:07:39 +00:00
|
|
|
toSubPixel(),
|
2014-09-18 14:00:21 +00:00
|
|
|
qPrintable(manufacturer),
|
|
|
|
qPrintable(model),
|
2014-08-26 14:07:39 +00:00
|
|
|
toTransform());
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::sendScale(const ResourceData &data)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
|
|
|
if (data.version < 2) {
|
|
|
|
return;
|
|
|
|
}
|
2014-09-18 14:00:21 +00:00
|
|
|
wl_output_send_scale(data.resource, scale);
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::sendDone(const ResourceData &data)
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
|
|
|
if (data.version < 2) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
wl_output_send_done(data.resource);
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::updateGeometry()
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-09-18 14:00:21 +00:00
|
|
|
for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
|
2014-08-26 14:07:39 +00:00
|
|
|
sendGeometry((*it).resource);
|
|
|
|
sendDone(*it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
void OutputInterface::Private::updateScale()
|
2014-08-26 14:07:39 +00:00
|
|
|
{
|
2014-09-18 14:00:21 +00:00
|
|
|
for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
|
2014-08-26 14:07:39 +00:00
|
|
|
sendScale(*it);
|
|
|
|
sendDone(*it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#define SETTER(setterName, type, argumentName) \
|
|
|
|
void OutputInterface::setterName(type arg) \
|
|
|
|
{ \
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D(); \
|
2014-09-18 14:00:21 +00:00
|
|
|
if (d->argumentName == arg) { \
|
2014-08-26 14:07:39 +00:00
|
|
|
return; \
|
|
|
|
} \
|
2014-09-18 14:00:21 +00:00
|
|
|
d->argumentName = arg; \
|
|
|
|
emit argumentName##Changed(d->argumentName); \
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SETTER(setPhysicalSize, const QSize&, physicalSize)
|
|
|
|
SETTER(setGlobalPosition, const QPoint&, globalPosition)
|
|
|
|
SETTER(setManufacturer, const QString&, manufacturer)
|
|
|
|
SETTER(setModel, const QString&, model)
|
|
|
|
SETTER(setScale, int, scale)
|
|
|
|
SETTER(setSubPixel, SubPixel, subPixel)
|
|
|
|
SETTER(setTransform, Transform, transform)
|
|
|
|
|
|
|
|
#undef SETTER
|
|
|
|
|
2014-09-18 14:00:21 +00:00
|
|
|
QSize OutputInterface::physicalSize() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->physicalSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
QPoint OutputInterface::globalPosition() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->globalPosition;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString OutputInterface::manufacturer() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->manufacturer;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString OutputInterface::model() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->model;
|
|
|
|
}
|
|
|
|
|
|
|
|
int OutputInterface::scale() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->scale;
|
|
|
|
}
|
|
|
|
|
|
|
|
OutputInterface::SubPixel OutputInterface::subPixel() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->subPixel;
|
|
|
|
}
|
|
|
|
|
|
|
|
OutputInterface::Transform OutputInterface::transform() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->transform;
|
|
|
|
}
|
|
|
|
|
|
|
|
QList< OutputInterface::Mode > OutputInterface::modes() const
|
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
Q_D();
|
2014-09-18 14:00:21 +00:00
|
|
|
return d->modes;
|
|
|
|
}
|
|
|
|
|
2014-11-13 14:07:31 +00:00
|
|
|
OutputInterface::Private *OutputInterface::d_func() const
|
2014-09-18 14:00:21 +00:00
|
|
|
{
|
2014-11-13 14:07:31 +00:00
|
|
|
return reinterpret_cast<Private*>(d.data());
|
2014-09-18 14:00:21 +00:00
|
|
|
}
|
|
|
|
|
2014-08-26 14:07:39 +00:00
|
|
|
}
|
|
|
|
}
|