kwin/scripting/s_clientgroup.h

78 lines
2.7 KiB
C
Raw Normal View History

/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2010 Rohan Prabhu <rohan@rohanprabhu.com>
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/>.
*********************************************************************/
#ifndef KWIN_SCRIPTING_S_CLIENTGROUP_H
#define KWIN_SCRIPTING_S_CLIENTGROUP_H
#include <QDebug>
#include <QScriptEngine>
#include "./../client.h"
#include "./../clientgroup.h"
namespace SWrapper
{
class ClientGroup : public QObject
2011-01-30 14:34:42 +00:00
{
Q_OBJECT
2011-01-30 14:34:42 +00:00
private:
KWin::ClientGroup* centralObject;
bool invalid;
2011-01-30 14:34:42 +00:00
public:
ClientGroup(KWin::ClientGroup*);
ClientGroup(KWin::Client*);
2011-01-30 14:34:42 +00:00
KWin::ClientGroup* getCentralObject();
2011-01-30 14:34:42 +00:00
/**
* A lot of functions for the KWin::ClientGroup* object.
* Mostly self-explanatory, works exactly like their C++
* analogues.
*/
static QScriptValue add(QScriptContext*, QScriptEngine*);
static QScriptValue remove(QScriptContext*, QScriptEngine*);
static QScriptValue clients(QScriptContext*, QScriptEngine*);
static QScriptValue setVisible(QScriptContext*, QScriptEngine*);
static QScriptValue contains(QScriptContext*, QScriptEngine*);
static QScriptValue indexOf(QScriptContext*, QScriptEngine*);
2011-01-30 14:34:42 +00:00
/** This is one weird function. It can be called like:
* move(client, client) OR move(client, index) OR move(index, client)
* move(index, index)
* NOTE: other than move(client, client), all other calls are mapped to
* move(index, index) using indexof(client)
*/
static QScriptValue move(QScriptContext*, QScriptEngine*);
static QScriptValue removeAll(QScriptContext*, QScriptEngine*);
static QScriptValue closeAll(QScriptContext*, QScriptEngine*);
static QScriptValue minSize(QScriptContext*, QScriptEngine*);
static QScriptValue maxSize(QScriptContext*, QScriptEngine*);
static QScriptValue visible(QScriptContext*, QScriptEngine*);
2011-01-30 14:34:42 +00:00
static QScriptValue construct(QScriptContext*, QScriptEngine*);
static QScriptValue generate(QScriptEngine*, SWrapper::ClientGroup*);
static QScriptValue publishClientGroupClass(QScriptEngine*);
};
}
#endif