kwin/plugins/colord-integration/main.cpp
Vlad Zahorodnii f037a69f1c Introduce colord integration
This change introduces basic colord integration in wayland session. It
is implemented as a binary plugin.

If an output is connected, the plugin will create the corresponding
colord device using the D-Bus API and start monitoring the device for
changes.

When a colord devices changes, the plugin will read the VCGT tag of the
current ICC color profile and apply it.
2020-11-24 17:51:32 +02:00

46 lines
1 KiB
C++

/*
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "colordintegration.h"
#include "main.h"
#include <KPluginFactory>
using namespace KWin;
class KWIN_EXPORT ColordIntegrationFactory : public PluginFactory
{
Q_OBJECT
Q_PLUGIN_METADATA(IID PluginFactory_iid FILE "metadata.json")
Q_INTERFACES(KWin::PluginFactory)
public:
explicit ColordIntegrationFactory(QObject *parent = nullptr);
Plugin *create() const override;
};
ColordIntegrationFactory::ColordIntegrationFactory(QObject *parent)
: PluginFactory(parent)
{
}
Plugin *ColordIntegrationFactory::create() const
{
switch (kwinApp()->operationMode()) {
case Application::OperationModeX11:
return nullptr;
case Application::OperationModeXwayland:
case Application::OperationModeWaylandOnly:
return new ColordIntegration();
default:
return nullptr;
}
}
K_EXPORT_PLUGIN_VERSION(KWIN_PLUGIN_API_VERSION)
#include "main.moc"