2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2021-03-10 16:08:30 +00:00
|
|
|
#pragma once
|
2015-09-03 14:27:20 +00:00
|
|
|
|
2022-04-22 09:27:33 +00:00
|
|
|
#include "kwin_export.h"
|
|
|
|
|
2021-07-06 01:34:06 +00:00
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
#include <QColor>
|
2015-09-03 14:27:20 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
2020-07-09 07:59:41 +00:00
|
|
|
struct wl_resource;
|
|
|
|
|
2020-04-29 14:56:38 +00:00
|
|
|
namespace KWaylandServer
|
2015-09-03 14:27:20 +00:00
|
|
|
{
|
|
|
|
class Display;
|
2020-07-09 07:59:41 +00:00
|
|
|
class ContrastManagerInterfacePrivate;
|
|
|
|
class ContrastInterfacePrivate;
|
2015-09-03 14:27:20 +00:00
|
|
|
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @brief Represents the Global for org_kde_kwin_contrast_manager interface.
|
|
|
|
*
|
|
|
|
* This class creates ContrastInterfaces and attaches them to SurfaceInterfaces.
|
|
|
|
*
|
|
|
|
* @see ContrastInterface
|
|
|
|
* @see SurfaceInterface
|
2021-03-16 08:17:36 +00:00
|
|
|
*/
|
2022-04-22 09:27:33 +00:00
|
|
|
class KWIN_EXPORT ContrastManagerInterface : public QObject
|
2015-09-03 14:27:20 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2020-12-09 20:13:19 +00:00
|
|
|
|
2015-09-03 14:27:20 +00:00
|
|
|
public:
|
2020-12-09 20:13:19 +00:00
|
|
|
explicit ContrastManagerInterface(Display *display, QObject *parent = nullptr);
|
2020-07-09 07:59:41 +00:00
|
|
|
~ContrastManagerInterface() override;
|
2015-09-03 14:27:20 +00:00
|
|
|
|
2021-05-02 14:46:13 +00:00
|
|
|
void remove();
|
|
|
|
|
2015-09-03 14:27:20 +00:00
|
|
|
private:
|
2020-07-09 07:59:41 +00:00
|
|
|
QScopedPointer<ContrastManagerInterfacePrivate> d;
|
2015-09-03 14:27:20 +00:00
|
|
|
};
|
|
|
|
|
2015-09-10 11:36:42 +00:00
|
|
|
/**
|
|
|
|
* @brief Represents the Resource for the org_kde_kwin_contrast interface.
|
|
|
|
*
|
|
|
|
* Instances of this class are only generated by the ContrastManagerInterface.
|
|
|
|
* The ContrastInterface gets attached to a SurfaceInterface and can be assessed
|
|
|
|
* from there using @link SurfaceInterface::contrast() @endlink. Please note that
|
|
|
|
* the ContrastInterface is only available on the SurfaceInterface after it has been
|
|
|
|
* committed.
|
|
|
|
*
|
|
|
|
* @see ContrastManagerInterface
|
|
|
|
* @see SurfaceInterface
|
2021-03-16 08:17:36 +00:00
|
|
|
*/
|
2022-04-22 09:27:33 +00:00
|
|
|
class KWIN_EXPORT ContrastInterface : public QObject
|
2015-09-03 14:27:20 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-07-09 07:59:41 +00:00
|
|
|
~ContrastInterface() override;
|
2015-09-03 14:27:20 +00:00
|
|
|
|
|
|
|
QRegion region() const;
|
|
|
|
qreal contrast() const;
|
|
|
|
qreal intensity() const;
|
|
|
|
qreal saturation() const;
|
2021-07-06 01:34:06 +00:00
|
|
|
QColor frost() const;
|
2015-09-03 14:27:20 +00:00
|
|
|
|
|
|
|
private:
|
2020-07-09 07:59:41 +00:00
|
|
|
explicit ContrastInterface(wl_resource *resource);
|
|
|
|
friend class ContrastManagerInterfacePrivate;
|
2015-09-03 14:27:20 +00:00
|
|
|
|
2020-07-09 07:59:41 +00:00
|
|
|
QScopedPointer<ContrastInterfacePrivate> d;
|
2015-09-03 14:27:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|