Make List of Clients in ClientGroup accessable in scripts

For that ClientList is exported as a sequence meta type and
property is added to ClientGroup.
This commit is contained in:
Martin Gräßlin 2012-01-01 15:01:54 +01:00
parent 012bcbc2e0
commit 197658475b
3 changed files with 6 additions and 0 deletions

View file

@ -1178,5 +1178,6 @@ KWIN_COMPARE_PREDICATE(InputIdMatchPredicate, Client, Window, cl->inputId() == v
} // namespace
Q_DECLARE_METATYPE(KWin::Client*)
Q_DECLARE_METATYPE(QList<KWin::Client*>)
#endif

View file

@ -69,6 +69,10 @@ class ClientGroup : public QObject
* The index of the visible Client in this group.
**/
Q_PROPERTY(int visibleClientIndex READ indexOfVisibleClient NOTIFY visibleChanged)
/**
* The Clients in this group.
**/
Q_PROPERTY(QList<KWin::Client*> clients READ clients)
public:
/**
* Creates a new group containing \p c.

View file

@ -132,6 +132,7 @@ void KWin::MetaScripting::registration(QScriptEngine* eng)
qScriptRegisterSequenceMetaType<QStringList>(eng);
qScriptRegisterSequenceMetaType< QList<KWin::ClientGroup*> >(eng);
qScriptRegisterSequenceMetaType< QList<KWin::Client*> >(eng);
}
QScriptValue KWin::MetaScripting::configExists(QScriptContext* ctx, QScriptEngine* eng)