diff -rNU2 -Xi kdebase-workspace-4.6.5.orig/kwin/scripting/meta.cpp kdebase-workspace-4.6.5/kwin/scripting/meta.cpp --- kdebase-workspace-4.6.5.orig/kwin/scripting/meta.cpp 2011-09-11 17:29:21.932011279 +0200 +++ kdebase-workspace-4.6.5/kwin/scripting/meta.cpp 2011-09-11 21:11:37.754290557 +0200 @@ -20,7 +20,7 @@ #include "meta.h" +#include "qmetatype_swrapper_clientgroup.h" Q_DECLARE_METATYPE(SWrapper::Client*) -Q_DECLARE_METATYPE(SWrapper::ClientGroup*) using namespace KWin::MetaScripting; diff -rNU2 -Xi kdebase-workspace-4.6.5.orig/kwin/scripting/qmetatype_swrapper_clientgroup.h kdebase-workspace-4.6.5/kwin/scripting/qmetatype_swrapper_clientgroup.h --- kdebase-workspace-4.6.5.orig/kwin/scripting/qmetatype_swrapper_clientgroup.h 1970-01-01 01:00:00.000000000 +0100 +++ kdebase-workspace-4.6.5/kwin/scripting/qmetatype_swrapper_clientgroup.h 2011-09-11 21:13:50.345632937 +0200 @@ -0,0 +1,26 @@ +/******************************************************************** + KWin - the KDE window manager + This file is part of the KDE project. + +Copyright (C) 2010 Rohan Prabhu + +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 . +*********************************************************************/ + +#ifndef KWIN_QMETATYPE_SWRAPPER_CLIENTGROUP_H +#define KWIN_QMETATYPE_SWRAPPER_CLIENTGROUP_H + +Q_DECLARE_METATYPE(SWrapper::ClientGroup*) + +#endif diff -rNU2 -Xi kdebase-workspace-4.6.5.orig/kwin/scripting/s_clientgroup.cpp kdebase-workspace-4.6.5/kwin/scripting/s_clientgroup.cpp --- kdebase-workspace-4.6.5.orig/kwin/scripting/s_clientgroup.cpp 2011-09-11 17:29:21.932011279 +0200 +++ kdebase-workspace-4.6.5/kwin/scripting/s_clientgroup.cpp 2011-09-11 21:14:49.618891920 +0200 @@ -20,6 +20,5 @@ #include "s_clientgroup.h" - -Q_DECLARE_METATYPE(SWrapper::ClientGroup*) +#include "qmetatype_swrapper_clientgroup.h" SWrapper::ClientGroup::ClientGroup(KWin::ClientGroup* group) diff -rNU2 -Xi kdebase-workspace-4.6.5.orig/kwin/scripting/toplevel.cpp kdebase-workspace-4.6.5/kwin/scripting/toplevel.cpp --- kdebase-workspace-4.6.5.orig/kwin/scripting/toplevel.cpp 2011-09-11 17:29:21.932011279 +0200 +++ kdebase-workspace-4.6.5/kwin/scripting/toplevel.cpp 2011-09-11 20:45:49.761643129 +0200 @@ -41,4 +41,16 @@ } +#undef MAP_GET +#define MAP_GET(type, method) \ +QScriptValue SWrapper::Toplevel::method(QScriptContext* ctx, QScriptEngine* eng) { \ + KWin::Toplevel* central = extractClient(ctx->thisObject()); \ + \ + if(central == 0) { \ + return QScriptValue(); \ + } else { \ + return eng->toScriptValue(central->method()); \ + } \ +} + MAP_GET(int, x) MAP_GET(int, y) diff -rNU2 -Xi kdebase-workspace-4.6.5.orig/kwin/scripting/toplevel.h kdebase-workspace-4.6.5/kwin/scripting/toplevel.h --- kdebase-workspace-4.6.5.orig/kwin/scripting/toplevel.h 2011-09-11 17:29:21.932011279 +0200 +++ kdebase-workspace-4.6.5/kwin/scripting/toplevel.h 2011-09-11 20:45:34.754830739 +0200 @@ -26,16 +26,4 @@ #include -#undef MAP_GET -#define MAP_GET(type, method) \ -QScriptValue SWrapper::Toplevel::method(QScriptContext* ctx, QScriptEngine* eng) { \ - KWin::Toplevel* central = extractClient(ctx->thisObject()); \ - \ - if(central == 0) { \ - return QScriptValue(); \ - } else { \ - return eng->toScriptValue(central->method()); \ - } \ -} - #define MAP_PROTO(method) static QScriptValue method(QScriptContext* ctx, QScriptEngine* eng); diff -rNU2 -Xi kdebase-workspace-4.6.5.orig/kwin/scripting/windowinfo.cpp kdebase-workspace-4.6.5/kwin/scripting/windowinfo.cpp --- kdebase-workspace-4.6.5.orig/kwin/scripting/windowinfo.cpp 2011-09-11 17:29:21.932011279 +0200 +++ kdebase-workspace-4.6.5/kwin/scripting/windowinfo.cpp 2011-09-11 20:49:27.178925039 +0200 @@ -28,4 +28,28 @@ } +// The following two extremely helpful functions are taken +// from the KWin Scripting proof-of-concept submitted by +// Lubos Lunak . Copyrights belong with +// original author (Lubos Lunak). + +#undef MAP_GET +#undef MAP_SET + +#define MAP_GET2(name, type2) \ +type2 SWrapper::WindowInfo::name() const { \ + return type2(infoClass.name()); \ +} + +#define MAP_GET(name, type) \ +type SWrapper::WindowInfo::name() const { \ + return infoClass.name(); \ +} + +#define MAP_SET(name, type) \ +void SWrapper::Toplevel::name(type value) { \ + subObject->name(value); \ +} + + MAP_GET(valid, bool) MAP_GET(state, int) diff -rNU2 -Xi kdebase-workspace-4.6.5.orig/kwin/scripting/windowinfo.h kdebase-workspace-4.6.5/kwin/scripting/windowinfo.h --- kdebase-workspace-4.6.5.orig/kwin/scripting/windowinfo.h 2011-09-11 17:29:21.932011279 +0200 +++ kdebase-workspace-4.6.5/kwin/scripting/windowinfo.h 2011-09-11 20:49:32.341860492 +0200 @@ -31,28 +31,4 @@ #include -// The following two extremely helpful functions are taken -// from the KWin Scripting proof-of-concept submitted by -// Lubos Lunak . Copyrights belong with -// original author (Lubos Lunak). - -#undef MAP_GET -#undef MAP_SET - -#define MAP_GET2(name, type2) \ -type2 SWrapper::WindowInfo::name() const { \ - return type2(infoClass.name()); \ -} - -#define MAP_GET(name, type) \ -type SWrapper::WindowInfo::name() const { \ - return infoClass.name(); \ -} - -#define MAP_SET(name, type) \ -void SWrapper::Toplevel::name(type value) { \ - subObject->name(value); \ -} - - namespace SWrapper {