Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 360729 | Differences between
and this patch

Collapse All | Expand All

(-)kdebase-workspace-4.6.1.orig/kwin/scripting/meta.cpp (-1 / +1 lines)
Lines 20-26 Link Here
20
20
21
#include "meta.h"
21
#include "meta.h"
22
#include "qmetatype_swrapper_clientgroup.h"
22
23
23
Q_DECLARE_METATYPE(SWrapper::Client*)
24
Q_DECLARE_METATYPE(SWrapper::Client*)
24
Q_DECLARE_METATYPE(SWrapper::ClientGroup*)
25
25
26
using namespace KWin::MetaScripting;
26
using namespace KWin::MetaScripting;
(-)kdebase-workspace-4.6.1.orig/kwin/scripting/qmetatype_swrapper_clientgroup.h (+26 lines)
Line 0 Link Here
1
/********************************************************************
2
 KWin - the KDE window manager
3
 This file is part of the KDE project.
4
5
Copyright (C) 2010 Rohan Prabhu <rohan@rohanprabhu.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
#ifndef KWIN_SCRIPTING_WINDOWINFO_H
22
#define KWIN_SCRIPTING_WINDOWINFO_H
23
24
Q_DECLARE_METATYPE(SWrapper::ClientGroup*)
25
26
#endif
(-)kdebase-workspace-4.6.1.orig/kwin/scripting/s_clientgroup.cpp (-2 / +1 lines)
Lines 20-25 Link Here
20
20
21
#include "s_clientgroup.h"
21
#include "s_clientgroup.h"
22
22
#include "qmetatype_swrapper_clientgroup.h"
23
Q_DECLARE_METATYPE(SWrapper::ClientGroup*)
24
23
25
SWrapper::ClientGroup::ClientGroup(KWin::ClientGroup* group)
24
SWrapper::ClientGroup::ClientGroup(KWin::ClientGroup* group)
(-)kdebase-workspace-4.6.1.orig/kwin/scripting/toplevel.cpp (+12 lines)
Lines 41-44 Link Here
41
    }
41
    }
42
42
43
#undef MAP_GET
44
#define MAP_GET(type, method) \
45
QScriptValue SWrapper::Toplevel::method(QScriptContext* ctx, QScriptEngine* eng) { \
46
    KWin::Toplevel* central = extractClient(ctx->thisObject()); \
47
    \
48
    if(central == 0) { \
49
	return QScriptValue(); \
50
    } else { \
51
	return eng->toScriptValue<type>(central->method()); \
52
    } \
53
}
54
43
MAP_GET(int, x)
55
MAP_GET(int, x)
44
MAP_GET(int, y)
56
MAP_GET(int, y)
(-)kdebase-workspace-4.6.1.orig/kwin/scripting/toplevel.h (-12 lines)
Lines 26-41 Link Here
26
#include <QScriptEngine>
26
#include <QScriptEngine>
27
27
28
#undef MAP_GET
29
#define MAP_GET(type, method) \
30
QScriptValue SWrapper::Toplevel::method(QScriptContext* ctx, QScriptEngine* eng) { \
31
    KWin::Toplevel* central = extractClient(ctx->thisObject()); \
32
    \
33
    if(central == 0) { \
34
	return QScriptValue(); \
35
    } else { \
36
	return eng->toScriptValue<type>(central->method()); \
37
    } \
38
}
39
40
#define MAP_PROTO(method) static QScriptValue method(QScriptContext* ctx, QScriptEngine* eng);
28
#define MAP_PROTO(method) static QScriptValue method(QScriptContext* ctx, QScriptEngine* eng);
41
29
(-)kdebase-workspace-4.6.1.orig/kwin/scripting/windowinfo.cpp (+24 lines)
Lines 28-31 Link Here
28
    }
28
    }
29
29
30
// The following two extremely helpful functions are taken
31
// from the KWin Scripting proof-of-concept submitted by
32
// Lubos Lunak <l.lunak@kde.org>. Copyrights belong with
33
// original author (Lubos Lunak).
34
35
#undef MAP_GET
36
#undef MAP_SET
37
38
#define MAP_GET2(name, type2) \
39
type2 SWrapper::WindowInfo::name() const { \
40
    return type2(infoClass.name()); \
41
}
42
43
#define MAP_GET(name, type) \
44
type SWrapper::WindowInfo::name() const { \
45
    return infoClass.name(); \
46
}
47
48
#define MAP_SET(name, type) \
49
void SWrapper::Toplevel::name(type value) { \
50
    subObject->name(value); \
51
}
52
53
30
MAP_GET(valid, bool)
54
MAP_GET(valid, bool)
31
MAP_GET(state, int)
55
MAP_GET(state, int)
(-)kdebase-workspace-4.6.1.orig/kwin/scripting/windowinfo.h (-24 lines)
Lines 31-58 Link Here
31
#include <QScriptEngine>
31
#include <QScriptEngine>
32
32
33
// The following two extremely helpful functions are taken
34
// from the KWin Scripting proof-of-concept submitted by
35
// Lubos Lunak <l.lunak@kde.org>. Copyrights belong with
36
// original author (Lubos Lunak).
37
38
#undef MAP_GET
39
#undef MAP_SET
40
41
#define MAP_GET2(name, type2) \
42
type2 SWrapper::WindowInfo::name() const { \
43
    return type2(infoClass.name()); \
44
}
45
46
#define MAP_GET(name, type) \
47
type SWrapper::WindowInfo::name() const { \
48
    return infoClass.name(); \
49
}
50
51
#define MAP_SET(name, type) \
52
void SWrapper::Toplevel::name(type value) { \
53
    subObject->name(value); \
54
}
55
56
57
namespace SWrapper
33
namespace SWrapper
58
{
34
{

Return to bug 360729