2021-07-23 14:12:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2021 Méven Car <meven.car@enioka.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2022-04-22 09:27:33 +00:00
|
|
|
#include "kwin_export.h"
|
2021-07-23 14:12:28 +00:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QSize>
|
|
|
|
#include <QUuid>
|
|
|
|
#include <QVector>
|
2022-08-01 21:29:02 +00:00
|
|
|
#include <memory>
|
2021-07-23 14:12:28 +00:00
|
|
|
|
|
|
|
struct wl_resource;
|
|
|
|
|
2022-08-16 15:35:19 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
class Output;
|
|
|
|
class OutputMode;
|
|
|
|
}
|
|
|
|
|
2021-07-23 14:12:28 +00:00
|
|
|
namespace KWaylandServer
|
|
|
|
{
|
|
|
|
|
|
|
|
class Display;
|
|
|
|
class OutputDeviceV2InterfacePrivate;
|
|
|
|
class OutputDeviceModeV2Interface;
|
|
|
|
class OutputDeviceModeV2InterfacePrivate;
|
|
|
|
|
|
|
|
/** @class OutputDeviceV2Interface
|
|
|
|
*
|
|
|
|
* Represents an output device, the difference to Output is that this output can be disabled,
|
|
|
|
* so not currently used to display content.
|
|
|
|
*
|
|
|
|
* @see OutputManagementV2Interface
|
|
|
|
*/
|
2022-04-22 09:27:33 +00:00
|
|
|
class KWIN_EXPORT OutputDeviceV2Interface : public QObject
|
2021-07-23 14:12:28 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2022-08-18 09:19:40 +00:00
|
|
|
public:
|
2022-08-16 15:35:19 +00:00
|
|
|
explicit OutputDeviceV2Interface(Display *display, KWin::Output *handle, QObject *parent = nullptr);
|
2021-07-23 14:12:28 +00:00
|
|
|
~OutputDeviceV2Interface() override;
|
|
|
|
|
|
|
|
void remove();
|
|
|
|
|
2022-08-16 15:35:19 +00:00
|
|
|
KWin::Output *handle() const;
|
2022-08-18 09:19:40 +00:00
|
|
|
|
2021-07-23 14:12:28 +00:00
|
|
|
static OutputDeviceV2Interface *get(wl_resource *native);
|
|
|
|
|
|
|
|
private:
|
2022-08-18 09:19:40 +00:00
|
|
|
void updatePhysicalSize();
|
|
|
|
void updateGlobalPosition();
|
|
|
|
void updateManufacturer();
|
|
|
|
void updateModel();
|
|
|
|
void updateSerialNumber();
|
|
|
|
void updateEisaId();
|
|
|
|
void updateName();
|
|
|
|
void updateScale();
|
|
|
|
void updateSubPixel();
|
|
|
|
void updateTransform();
|
|
|
|
void updateModes();
|
|
|
|
void updateCurrentMode();
|
|
|
|
void updateEdid();
|
|
|
|
void updateEnabled();
|
|
|
|
void updateUuid();
|
|
|
|
void updateCapabilities();
|
|
|
|
void updateOverscan();
|
|
|
|
void updateVrrPolicy();
|
|
|
|
void updateRgbRange();
|
|
|
|
void updateGeometry();
|
|
|
|
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<OutputDeviceV2InterfacePrivate> d;
|
2021-07-23 14:12:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2021-09-07 20:40:22 +00:00
|
|
|
* @class OutputDeviceModeV2Interface
|
2021-07-23 14:12:28 +00:00
|
|
|
*
|
|
|
|
* Represents an output device mode.
|
|
|
|
*
|
2022-04-19 10:14:26 +00:00
|
|
|
* @see OutputDeviceV2Interface
|
2021-07-23 14:12:28 +00:00
|
|
|
*/
|
2022-04-22 09:27:33 +00:00
|
|
|
class KWIN_EXPORT OutputDeviceModeV2Interface : public QObject
|
2021-07-23 14:12:28 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2022-08-18 09:19:40 +00:00
|
|
|
public:
|
|
|
|
OutputDeviceModeV2Interface(std::shared_ptr<KWin::OutputMode> handle, QObject *parent = nullptr);
|
2021-07-23 14:12:28 +00:00
|
|
|
~OutputDeviceModeV2Interface() override;
|
|
|
|
|
2022-08-16 15:35:19 +00:00
|
|
|
std::weak_ptr<KWin::OutputMode> handle() const;
|
2021-07-23 14:12:28 +00:00
|
|
|
|
|
|
|
static OutputDeviceModeV2Interface *get(wl_resource *native);
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class OutputDeviceModeV2InterfacePrivate;
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<OutputDeviceModeV2InterfacePrivate> d;
|
2021-07-23 14:12:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|