forked from Ausbxuse/LightlyShaders2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbus.h
35 lines (30 loc) · 906 Bytes
/
dbus.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef LIGHTLYSHADERS_ADAPTOR_H
#define LIGHTLYSHADERS_ADAPTOR_H
#include <QtDBus/QDBusAbstractAdaptor>
#include "lightlyshaders.h"
#include <KConfigGroup>
namespace KWin
{
class EffectAdaptor : public QDBusAbstractAdaptor
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin")
private:
LightlyShadersEffect *m_effect;
public:
EffectAdaptor(LightlyShadersEffect *effect) : QDBusAbstractAdaptor(effect), m_effect(effect) { }
public slots:
Q_NOREPLY void setRoundness(int r)
{
KConfigGroup conf = KSharedConfig::openConfig("lightlyshaders.conf")->group("General");
if (conf.readEntry("dsp", false))
{
conf.writeEntry("roundness", r);
conf.sync();
m_effect->setRoundness(r);
}
}
Q_NOREPLY void configure() { m_effect->reconfigure(KWin::Effect::ReconfigureAll); }
};
}
#endif //LIGHTLYSHADERS_ADAPTOR_H