1/********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>.
20*********************************************************************/
21
22#ifndef KWIN_GROUP_H
23#define KWIN_GROUP_H
24
25#include "utils.h"
26#include <X11/X.h>
27#include <netwm.h>
28
29namespace KWin
30{
31
32class Client;
33class EffectWindowGroupImpl;
34
35class Group
36{
37public:
38 Group(Window leader);
39 ~Group();
40 Window leader() const;
41 const Client* leaderClient() const;
42 Client* leaderClient();
43 const ClientList& members() const;
44 QPixmap icon() const;
45 QPixmap miniIcon() const;
46 QPixmap bigIcon() const;
47 QPixmap hugeIcon() const;
48 void addMember(Client* member);
49 void removeMember(Client* member);
50 void gotLeader(Client* leader);
51 void lostLeader();
52 bool groupEvent(XEvent* e);
53 void updateUserTime(Time time = CurrentTime);
54 Time userTime() const;
55 void ref();
56 void deref();
57 EffectWindowGroupImpl* effectGroup();
58private:
59 void startupIdChanged();
60 ClientList _members;
61 Client* leader_client;
62 Window leader_wid;
63 NETWinInfo2* leader_info;
64 Time user_time;
65 int refcount;
66 EffectWindowGroupImpl* effect_group;
67};
68
69inline Window Group::leader() const
70{
71 return leader_wid;
72}
73
74inline const Client* Group::leaderClient() const
75{
76 return leader_client;
77}
78
79inline Client* Group::leaderClient()
80{
81 return leader_client;
82}
83
84inline const ClientList& Group::members() const
85{
86 return _members;
87}
88
89inline Time Group::userTime() const
90{
91 return user_time;
92}
93
94inline
95EffectWindowGroupImpl* Group::effectGroup()
96{
97 return effect_group;
98}
99
100} // namespace
101
102#endif
103