~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kwin/scripting/workspaceproxy.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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_WORKSPACEPROXY_H
 
22
#define KWIN_SCRIPTING_WORKSPACEPROXY_H
 
23
 
 
24
#include <QObject>
 
25
#include <QScriptValue>
 
26
 
 
27
#include <QDebug>
 
28
 
 
29
#include "../workspace.h"
 
30
#include "../client.h"
 
31
 
 
32
#define PROXYPASS1(name, param) \
 
33
    void SWrapper::WorkspaceProxy::sl_ ## name(param _param) { \
 
34
        name(_param); \
 
35
    }
 
36
 
 
37
#define PROXYPASS2(name, param1, param2) \
 
38
    void SWrapper::WorkspaceProxy::sl_ ## name(param1 _param1, param2 _param2) { \
 
39
        name(_param1, _param2); \
 
40
    }
 
41
 
 
42
#define PROXYPASS3(name, param1, param2, param3) \
 
43
    void SWrapper::WorkspaceProxy::sl_ ## name(param1 _param1, param2 _param2, param3 _param3) { \
 
44
        name(_param1, _param2, _param3); \
 
45
    }
 
46
 
 
47
typedef QPair<bool, bool> DualBool;
 
48
 
 
49
namespace SWrapper
 
50
{
 
51
/**
 
52
  * KWin::WorkspaceProxy simply allows connections from multiple clients to
 
53
  * multiple Workspace objects.
 
54
  */
 
55
class WorkspaceProxy : public QObject
 
56
{
 
57
    Q_OBJECT
 
58
 
 
59
public:
 
60
    WorkspaceProxy();
 
61
    static WorkspaceProxy* _instance;
 
62
    static WorkspaceProxy* instance();
 
63
 
 
64
public slots:
 
65
    void sl_clientManaging(KWin::Client*);
 
66
    void sl_clientMinimized(KWin::Client*);
 
67
    void sl_clientUnminimized(KWin::Client*);
 
68
    void sl_clientMaximizeSet(KWin::Client*, QPair<bool, bool>);
 
69
    void sl_killWindowCalled(KWin::Client*);
 
70
    void sl_clientFullScreenSet(KWin::Client*, bool, bool);
 
71
    void sl_clientSetKeepAbove(KWin::Client*, bool);
 
72
 
 
73
signals:
 
74
    void clientManaging(KWin::Client*);
 
75
    void clientMinimized(KWin::Client*);
 
76
    void clientUnminimized(KWin::Client*);
 
77
    void clientMaximizeSet(KWin::Client*, QPair<bool, bool>);
 
78
    void killWindowCalled(KWin::Client*);
 
79
    void clientFullScreenSet(KWin::Client*, bool, bool);
 
80
    void clientSetKeepAbove(KWin::Client*, bool);
 
81
};
 
82
 
 
83
}
 
84
 
 
85
#endif