2010-09-21 14:31:40 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2010 Rohan Prabhu <rohan@rohanprabhu.com>
|
2011-12-23 10:52:06 +00:00
|
|
|
Copyright (C) 2011 Martin Gräßlin <mgraesslin@kde.org>
|
2010-09-21 14:31:40 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
#include "scripting.h"
|
2011-12-23 10:52:06 +00:00
|
|
|
// own
|
|
|
|
#include "meta.h"
|
2012-03-25 07:59:01 +00:00
|
|
|
#include "scriptingutils.h"
|
2012-01-22 11:38:03 +00:00
|
|
|
#include "workspace_wrapper.h"
|
2012-03-24 09:49:21 +00:00
|
|
|
#include "../client.h"
|
2012-02-19 14:43:24 +00:00
|
|
|
#include "../thumbnailitem.h"
|
2012-03-01 09:18:39 +00:00
|
|
|
#include "../options.h"
|
2012-03-01 10:29:24 +00:00
|
|
|
#include "../workspace.h"
|
2011-12-23 10:52:06 +00:00
|
|
|
// KDE
|
2011-01-01 09:37:08 +00:00
|
|
|
#include <kstandarddirs.h>
|
2012-02-18 09:34:27 +00:00
|
|
|
#include <KDE/KConfigGroup>
|
2012-01-21 09:04:47 +00:00
|
|
|
#include <KDE/KDebug>
|
2012-02-18 09:34:27 +00:00
|
|
|
#include <KDE/KPluginInfo>
|
|
|
|
#include <KDE/KServiceTypeTrader>
|
2012-02-19 14:43:24 +00:00
|
|
|
#include <kdeclarative.h>
|
2011-12-23 10:52:06 +00:00
|
|
|
// Qt
|
|
|
|
#include <QtDBus/QDBusConnection>
|
|
|
|
#include <QtCore/QSettings>
|
2012-02-19 14:43:24 +00:00
|
|
|
#include <QtDeclarative/QDeclarativeContext>
|
|
|
|
#include <QtDeclarative/QDeclarativeEngine>
|
|
|
|
#include <QtDeclarative/QDeclarativeView>
|
|
|
|
#include <QtDeclarative/qdeclarative.h>
|
2011-12-23 10:52:06 +00:00
|
|
|
#include <QtScript/QScriptEngine>
|
|
|
|
#include <QtScript/QScriptValue>
|
|
|
|
|
|
|
|
QScriptValue kwinScriptPrint(QScriptContext *context, QScriptEngine *engine)
|
|
|
|
{
|
2012-03-01 10:28:27 +00:00
|
|
|
KWin::AbstractScript *script = qobject_cast<KWin::Script*>(context->callee().data().toQObject());
|
|
|
|
if (!script) {
|
|
|
|
return engine->undefinedValue();
|
|
|
|
}
|
2011-12-23 10:52:06 +00:00
|
|
|
QString result;
|
|
|
|
for (int i = 0; i < context->argumentCount(); ++i) {
|
|
|
|
if (i > 0) {
|
|
|
|
result.append(" ");
|
|
|
|
}
|
|
|
|
result.append(context->argument(i).toString());
|
|
|
|
}
|
|
|
|
script->printMessage(result);
|
|
|
|
|
|
|
|
return engine->undefinedValue();
|
|
|
|
}
|
2010-09-21 14:31:40 +00:00
|
|
|
|
2012-02-25 10:30:45 +00:00
|
|
|
QScriptValue kwinScriptReadConfig(QScriptContext *context, QScriptEngine *engine)
|
|
|
|
{
|
|
|
|
KWin::AbstractScript *script = qobject_cast<KWin::AbstractScript*>(context->callee().data().toQObject());
|
2012-03-01 10:28:27 +00:00
|
|
|
if (!script) {
|
|
|
|
return engine->undefinedValue();
|
|
|
|
}
|
2012-02-25 10:30:45 +00:00
|
|
|
if (context->argumentCount() < 1 || context->argumentCount() > 2) {
|
|
|
|
kDebug(1212) << "Incorrect number of arguments";
|
|
|
|
return engine->undefinedValue();
|
|
|
|
}
|
|
|
|
const QString key = context->argument(0).toString();
|
|
|
|
QVariant defaultValue;
|
|
|
|
if (context->argumentCount() == 2) {
|
|
|
|
defaultValue = context->argument(1).toVariant();
|
|
|
|
}
|
|
|
|
return engine->newVariant(script->config().readEntry(key, defaultValue));
|
|
|
|
}
|
|
|
|
|
2012-03-25 07:59:01 +00:00
|
|
|
QScriptValue kwinScriptGlobalShortcut(QScriptContext *context, QScriptEngine *engine)
|
|
|
|
{
|
|
|
|
return KWin::globalShortcut<KWin::AbstractScript*>(context, engine);
|
|
|
|
}
|
|
|
|
|
2012-02-25 10:30:45 +00:00
|
|
|
KWin::AbstractScript::AbstractScript(int id, QString scriptName, QString pluginName, QObject *parent)
|
2011-12-23 07:49:28 +00:00
|
|
|
: QObject(parent)
|
2012-02-19 14:43:24 +00:00
|
|
|
, m_scriptId(id)
|
2012-02-25 10:30:45 +00:00
|
|
|
, m_pluginName(pluginName)
|
2011-12-23 10:52:06 +00:00
|
|
|
, m_running(false)
|
2012-02-19 14:43:24 +00:00
|
|
|
, m_workspace(new WorkspaceWrapper(this))
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2012-02-18 12:58:00 +00:00
|
|
|
m_scriptFile.setFileName(scriptName);
|
2012-02-25 10:30:45 +00:00
|
|
|
if (m_pluginName.isNull()) {
|
|
|
|
m_pluginName = scriptName;
|
|
|
|
}
|
2012-02-19 14:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
KWin::AbstractScript::~AbstractScript()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-02-25 10:30:45 +00:00
|
|
|
KConfigGroup KWin::AbstractScript::config() const
|
|
|
|
{
|
|
|
|
return KGlobal::config()->group("Script-" + m_pluginName);
|
|
|
|
}
|
|
|
|
|
2012-02-19 14:43:24 +00:00
|
|
|
void KWin::AbstractScript::stop()
|
|
|
|
{
|
|
|
|
deleteLater();
|
|
|
|
}
|
|
|
|
|
2012-03-01 10:28:27 +00:00
|
|
|
void KWin::AbstractScript::printMessage(const QString &message)
|
|
|
|
{
|
|
|
|
kDebug(1212) << scriptFile().fileName() << ":" << message;
|
|
|
|
emit print(message);
|
|
|
|
}
|
|
|
|
|
2012-03-25 07:59:01 +00:00
|
|
|
void KWin::AbstractScript::registerShortcut(QAction *a, QScriptValue callback)
|
|
|
|
{
|
|
|
|
m_shortcutCallbacks.insert(a, callback);
|
|
|
|
connect(a, SIGNAL(triggered(bool)), SLOT(globalShortcutTriggered()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void KWin::AbstractScript::globalShortcutTriggered()
|
|
|
|
{
|
|
|
|
callGlobalShortcutCallback<KWin::AbstractScript*>(this, sender());
|
|
|
|
}
|
|
|
|
|
2012-02-25 10:30:45 +00:00
|
|
|
void KWin::AbstractScript::installScriptFunctions(QScriptEngine* engine)
|
|
|
|
{
|
|
|
|
// add our print
|
|
|
|
QScriptValue printFunc = engine->newFunction(kwinScriptPrint);
|
|
|
|
printFunc.setData(engine->newQObject(this));
|
|
|
|
engine->globalObject().setProperty("print", printFunc);
|
|
|
|
// add read config
|
|
|
|
QScriptValue configFunc = engine->newFunction(kwinScriptReadConfig);
|
|
|
|
configFunc.setData(engine->newQObject(this));
|
|
|
|
engine->globalObject().setProperty("readConfig", configFunc);
|
2012-03-25 07:59:01 +00:00
|
|
|
// add global Shortcut
|
|
|
|
registerGlobalShortcutFunction(this, engine, kwinScriptGlobalShortcut);
|
2012-02-25 10:30:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
KWin::Script::Script(int id, QString scriptName, QString pluginName, QObject* parent)
|
|
|
|
: AbstractScript(id, scriptName, pluginName, parent)
|
2012-02-19 14:43:24 +00:00
|
|
|
, m_engine(new QScriptEngine(this))
|
|
|
|
{
|
|
|
|
QDBusConnection::sessionBus().registerObject('/' + QString::number(scriptId()), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2010-09-21 14:31:40 +00:00
|
|
|
|
2011-12-23 07:49:28 +00:00
|
|
|
KWin::Script::~Script()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2012-02-19 14:43:24 +00:00
|
|
|
QDBusConnection::sessionBus().unregisterObject('/' + QString::number(scriptId()));
|
2011-12-23 10:52:06 +00:00
|
|
|
}
|
|
|
|
|
2011-12-23 07:49:28 +00:00
|
|
|
void KWin::Script::run()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2012-02-19 14:43:24 +00:00
|
|
|
if (running()) {
|
2011-12-23 10:52:06 +00:00
|
|
|
return;
|
|
|
|
}
|
2012-02-19 14:43:24 +00:00
|
|
|
if (scriptFile().open(QIODevice::ReadOnly)) {
|
|
|
|
QScriptValue workspace = m_engine->newQObject(AbstractScript::workspace(), QScriptEngine::QtOwnership,
|
2012-01-21 16:48:07 +00:00
|
|
|
QScriptEngine::ExcludeSuperClassContents | QScriptEngine::ExcludeDeleteLater);
|
2012-03-01 09:18:39 +00:00
|
|
|
QScriptValue optionsValue = m_engine->newQObject(options, QScriptEngine::QtOwnership,
|
|
|
|
QScriptEngine::ExcludeSuperClassContents | QScriptEngine::ExcludeDeleteLater);
|
2012-01-21 16:48:07 +00:00
|
|
|
m_engine->globalObject().setProperty("workspace", workspace, QScriptValue::Undeletable);
|
2012-03-01 09:18:39 +00:00
|
|
|
m_engine->globalObject().setProperty("options", optionsValue, QScriptValue::Undeletable);
|
2011-12-23 07:49:28 +00:00
|
|
|
m_engine->globalObject().setProperty("QTimer", constructTimerClass(m_engine));
|
2012-01-26 21:56:24 +00:00
|
|
|
m_engine->globalObject().setProperty("KWin", m_engine->newQMetaObject(&WorkspaceWrapper::staticMetaObject));
|
2011-12-23 07:49:28 +00:00
|
|
|
QObject::connect(m_engine, SIGNAL(signalHandlerException(QScriptValue)), this, SLOT(sigException(QScriptValue)));
|
|
|
|
KWin::MetaScripting::registration(m_engine);
|
2012-02-18 09:34:27 +00:00
|
|
|
KWin::MetaScripting::supplyConfig(m_engine);
|
2012-02-25 10:30:45 +00:00
|
|
|
installScriptFunctions(m_engine);
|
2010-09-21 14:31:40 +00:00
|
|
|
|
2012-02-19 14:43:24 +00:00
|
|
|
QScriptValue ret = m_engine->evaluate(scriptFile().readAll());
|
2010-09-21 14:31:40 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
if (ret.isError()) {
|
2010-09-21 14:31:40 +00:00
|
|
|
sigException(ret);
|
2011-12-23 10:52:06 +00:00
|
|
|
deleteLater();
|
2010-09-21 14:31:40 +00:00
|
|
|
}
|
|
|
|
}
|
2012-02-19 14:43:24 +00:00
|
|
|
setRunning(true);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2010-09-21 14:31:40 +00:00
|
|
|
|
2011-12-23 07:49:28 +00:00
|
|
|
void KWin::Script::sigException(const QScriptValue& exception)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2010-09-21 14:31:40 +00:00
|
|
|
QScriptValue ret = exception;
|
2011-01-30 14:34:42 +00:00
|
|
|
if (ret.isError()) {
|
2011-12-23 07:49:28 +00:00
|
|
|
kDebug(1212) << "defaultscript encountered an error at [Line " << m_engine->uncaughtExceptionLineNumber() << "]";
|
2011-01-30 14:34:42 +00:00
|
|
|
kDebug(1212) << "Message: " << ret.toString();
|
|
|
|
kDebug(1212) << "-----------------";
|
2010-09-21 14:31:40 +00:00
|
|
|
|
|
|
|
QScriptValueIterator iter(ret);
|
2011-01-30 14:34:42 +00:00
|
|
|
while (iter.hasNext()) {
|
2010-09-21 14:31:40 +00:00
|
|
|
iter.next();
|
2011-01-30 14:34:42 +00:00
|
|
|
qDebug() << " " << iter.name() << ": " << iter.value().toString();
|
2010-09-21 14:31:40 +00:00
|
|
|
}
|
|
|
|
}
|
2011-12-23 10:52:06 +00:00
|
|
|
emit printError(exception.toString());
|
|
|
|
}
|
|
|
|
|
2012-02-25 10:30:45 +00:00
|
|
|
KWin::DeclarativeScript::DeclarativeScript(int id, QString scriptName, QString pluginName, QObject* parent)
|
|
|
|
: AbstractScript(id, scriptName, pluginName, parent)
|
2012-02-19 14:43:24 +00:00
|
|
|
, m_view(new QDeclarativeView())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
KWin::DeclarativeScript::~DeclarativeScript()
|
2011-12-23 10:52:06 +00:00
|
|
|
{
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2010-09-21 14:31:40 +00:00
|
|
|
|
2012-02-19 14:43:24 +00:00
|
|
|
void KWin::DeclarativeScript::run()
|
|
|
|
{
|
|
|
|
if (running()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
m_view->setAttribute(Qt::WA_TranslucentBackground);
|
|
|
|
m_view->setWindowFlags(Qt::X11BypassWindowManagerHint);
|
|
|
|
m_view->setResizeMode(QDeclarativeView::SizeViewToRootObject);
|
|
|
|
QPalette pal = m_view->palette();
|
|
|
|
pal.setColor(m_view->backgroundRole(), Qt::transparent);
|
|
|
|
m_view->setPalette(pal);
|
|
|
|
|
|
|
|
|
|
|
|
foreach (const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) {
|
|
|
|
m_view->engine()->addImportPath(importPath);
|
|
|
|
}
|
2012-02-25 10:30:45 +00:00
|
|
|
|
|
|
|
// add read config
|
2012-02-19 14:43:24 +00:00
|
|
|
KDeclarative kdeclarative;
|
|
|
|
kdeclarative.setDeclarativeEngine(m_view->engine());
|
|
|
|
kdeclarative.initialize();
|
|
|
|
kdeclarative.setupBindings();
|
2012-02-25 10:30:45 +00:00
|
|
|
installScriptFunctions(kdeclarative.scriptEngine());
|
2012-02-19 14:43:24 +00:00
|
|
|
qmlRegisterType<ThumbnailItem>("org.kde.kwin", 0, 1, "ThumbnailItem");
|
|
|
|
qmlRegisterType<WorkspaceWrapper>("org.kde.kwin", 0, 1, "KWin");
|
2012-03-24 09:49:21 +00:00
|
|
|
qmlRegisterType<KWin::Client>();
|
2012-02-19 14:43:24 +00:00
|
|
|
|
|
|
|
m_view->rootContext()->setContextProperty("workspace", workspace());
|
2012-03-01 09:18:39 +00:00
|
|
|
m_view->rootContext()->setContextProperty("options", options);
|
2012-02-19 14:43:24 +00:00
|
|
|
|
|
|
|
m_view->setSource(QUrl::fromLocalFile(scriptFile().fileName()));
|
|
|
|
setRunning(true);
|
|
|
|
}
|
2011-12-23 07:49:28 +00:00
|
|
|
|
2011-12-23 07:56:25 +00:00
|
|
|
KWin::Scripting::Scripting(QObject *parent)
|
|
|
|
: QObject(parent)
|
2011-12-23 07:49:28 +00:00
|
|
|
{
|
2011-12-23 10:52:06 +00:00
|
|
|
QDBusConnection::sessionBus().registerObject("/Scripting", this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
|
|
|
QDBusConnection::sessionBus().registerService("org.kde.kwin.Scripting");
|
2012-03-01 10:29:24 +00:00
|
|
|
connect(Workspace::self(), SIGNAL(configChanged()), SLOT(start()));
|
2011-12-23 07:49:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void KWin::Scripting::start()
|
|
|
|
{
|
2012-02-18 09:34:27 +00:00
|
|
|
KSharedConfig::Ptr _config = KGlobal::config();
|
|
|
|
KConfigGroup conf(_config, "Plugins");
|
2011-12-23 07:49:28 +00:00
|
|
|
|
2012-02-18 09:34:27 +00:00
|
|
|
KService::List offers = KServiceTypeTrader::self()->query("KWin/Script");
|
2011-12-23 07:49:28 +00:00
|
|
|
|
2012-02-18 09:34:27 +00:00
|
|
|
foreach (const KService::Ptr & service, offers) {
|
|
|
|
KPluginInfo plugininfo(service);
|
|
|
|
plugininfo.load(conf);
|
2012-02-19 14:43:24 +00:00
|
|
|
const bool javaScript = service->property("X-Plasma-API").toString() == "javascript";
|
|
|
|
const bool declarativeScript = service->property("X-Plasma-API").toString() == "declarativescript";
|
|
|
|
if (!javaScript && !declarativeScript) {
|
2012-02-18 09:34:27 +00:00
|
|
|
continue;
|
|
|
|
}
|
2011-12-23 07:49:28 +00:00
|
|
|
|
2012-02-18 09:34:27 +00:00
|
|
|
if (!plugininfo.isPluginEnabled()) {
|
2012-03-01 10:29:24 +00:00
|
|
|
if (isScriptLoaded(plugininfo.pluginName())) {
|
|
|
|
// unload the script
|
|
|
|
unloadScript(plugininfo.pluginName());
|
|
|
|
}
|
2012-02-18 09:34:27 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
const QString pluginName = service->property("X-KDE-PluginInfo-Name").toString();
|
|
|
|
const QString scriptName = service->property("X-Plasma-MainScript").toString();
|
|
|
|
const QString file = KStandardDirs::locate("data", "kwin/scripts/" + pluginName + "/contents/" + scriptName);
|
|
|
|
if (file.isNull()) {
|
|
|
|
kDebug(1212) << "Could not find script file for " << pluginName;
|
|
|
|
continue;
|
|
|
|
}
|
2012-02-19 14:43:24 +00:00
|
|
|
if (javaScript) {
|
2012-02-25 10:30:45 +00:00
|
|
|
loadScript(file, pluginName);
|
2012-02-19 14:43:24 +00:00
|
|
|
} else if (declarativeScript) {
|
2012-02-25 10:30:45 +00:00
|
|
|
loadDeclarativeScript(file, pluginName);
|
2012-02-19 14:43:24 +00:00
|
|
|
}
|
2011-12-23 07:49:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
runScripts();
|
|
|
|
}
|
|
|
|
|
2012-03-01 10:29:24 +00:00
|
|
|
bool KWin::Scripting::isScriptLoaded(const QString &pluginName) const
|
|
|
|
{
|
|
|
|
foreach (AbstractScript *script, scripts) {
|
|
|
|
if (script->pluginName() == pluginName) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool KWin::Scripting::unloadScript(const QString &pluginName)
|
|
|
|
{
|
|
|
|
foreach (AbstractScript *script, scripts) {
|
|
|
|
if (script->pluginName() == pluginName) {
|
|
|
|
script->deleteLater();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-12-23 07:49:28 +00:00
|
|
|
void KWin::Scripting::runScripts()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
|
|
|
for (int i = 0; i < scripts.size(); i++) {
|
2011-12-23 07:49:28 +00:00
|
|
|
scripts.at(i)->run();
|
2010-09-21 14:31:40 +00:00
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2011-12-23 07:49:28 +00:00
|
|
|
|
2011-12-23 10:52:06 +00:00
|
|
|
void KWin::Scripting::scriptDestroyed(QObject *object)
|
|
|
|
{
|
|
|
|
scripts.removeAll(static_cast<KWin::Script*>(object));
|
|
|
|
}
|
|
|
|
|
2012-02-25 10:30:45 +00:00
|
|
|
int KWin::Scripting::loadScript(const QString &filePath, const QString& pluginName)
|
2011-12-23 10:52:06 +00:00
|
|
|
{
|
2012-03-01 10:29:24 +00:00
|
|
|
if (isScriptLoaded(pluginName)) {
|
|
|
|
return -1;
|
|
|
|
}
|
2011-12-23 10:52:06 +00:00
|
|
|
const int id = scripts.size();
|
2012-02-25 10:30:45 +00:00
|
|
|
KWin::Script *script = new KWin::Script(id, filePath, pluginName, this);
|
2011-12-23 10:52:06 +00:00
|
|
|
connect(script, SIGNAL(destroyed(QObject*)), SLOT(scriptDestroyed(QObject*)));
|
|
|
|
scripts.append(script);
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2012-02-25 10:30:45 +00:00
|
|
|
int KWin::Scripting::loadDeclarativeScript(const QString& filePath, const QString& pluginName)
|
2012-02-19 14:43:24 +00:00
|
|
|
{
|
2012-03-01 10:29:24 +00:00
|
|
|
if (isScriptLoaded(pluginName)) {
|
|
|
|
return -1;
|
|
|
|
}
|
2012-02-19 14:43:24 +00:00
|
|
|
const int id = scripts.size();
|
2012-02-25 10:30:45 +00:00
|
|
|
KWin::DeclarativeScript *script = new KWin::DeclarativeScript(id, filePath, pluginName, this);
|
2012-02-19 14:43:24 +00:00
|
|
|
connect(script, SIGNAL(destroyed(QObject*)), SLOT(scriptDestroyed(QObject*)));
|
|
|
|
scripts.append(script);
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2011-12-23 07:49:28 +00:00
|
|
|
KWin::Scripting::~Scripting()
|
|
|
|
{
|
2011-12-23 10:52:06 +00:00
|
|
|
QDBusConnection::sessionBus().unregisterObject("/Scripting");
|
|
|
|
QDBusConnection::sessionBus().unregisterService("org.kde.kwin.Scripting");
|
2011-12-23 07:49:28 +00:00
|
|
|
}
|
2011-12-23 10:52:06 +00:00
|
|
|
|
|
|
|
#include "scripting.moc"
|