Changeset View
Changeset View
Standalone View
Standalone View
colorcorrection/colorcorrectdbusinterface.cpp
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright 2017 Roman Gilg <subdiff@gmail.com> | ||||
6 | | ||||
7 | This program is free software; you can redistribute it and/or modify | ||||
8 | it under the terms of the GNU General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or | ||||
10 | (at your option) any later version. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | | ||||
21 | #include "colorcorrectdbusinterface.h" | ||||
22 | #include "colorcorrectadaptor.h" | ||||
23 | | ||||
24 | #include "nightcolor.h" | ||||
25 | | ||||
26 | namespace KWin { | ||||
27 | namespace ColorCorrect { | ||||
28 | | ||||
29 | ColorCorrectDBusInterface::ColorCorrectDBusInterface(Manager *parent) | ||||
30 | : QObject(parent) | ||||
31 | , m_manager(parent) | ||||
32 | { | ||||
33 | connect(m_manager, &Manager::configChange, this, &ColorCorrectDBusInterface::nightColorConfigChanged); | ||||
34 | new ColorCorrectAdaptor(this); | ||||
35 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/ColorCorrect"), this); | ||||
36 | } | ||||
37 | | ||||
38 | QHash<QString, QVariant> ColorCorrectDBusInterface::nightColorInfo() | ||||
39 | { | ||||
40 | return m_manager->info(); | ||||
41 | } | ||||
42 | | ||||
43 | bool ColorCorrectDBusInterface::setNightColorConfig(QHash<QString, QVariant> data) | ||||
44 | { | ||||
45 | return m_manager->changeConfiguration(data); | ||||
46 | } | ||||
47 | | ||||
48 | void ColorCorrectDBusInterface::nightColorAutoLocationUpdate(double latitude, double longitude) | ||||
49 | { | ||||
50 | m_manager->autoLocationUpdate(latitude, longitude); | ||||
51 | } | ||||
52 | | ||||
53 | } | ||||
54 | } |