1 | /******************************************************************** |
2 | KWin - the KDE window manager |
3 | This file is part of the KDE project. |
4 | |
5 | Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org> |
6 | Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> |
7 | |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 2 of the License, or |
11 | (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along 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 | |
29 | namespace KWin |
30 | { |
31 | |
32 | class Client; |
33 | class EffectWindowGroupImpl; |
34 | |
35 | class Group |
36 | { |
37 | public: |
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(); |
58 | private: |
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 | |
69 | inline Window Group::leader() const |
70 | { |
71 | return leader_wid; |
72 | } |
73 | |
74 | inline const Client* Group::leaderClient() const |
75 | { |
76 | return leader_client; |
77 | } |
78 | |
79 | inline Client* Group::leaderClient() |
80 | { |
81 | return leader_client; |
82 | } |
83 | |
84 | inline const ClientList& Group::members() const |
85 | { |
86 | return _members; |
87 | } |
88 | |
89 | inline Time Group::userTime() const |
90 | { |
91 | return user_time; |
92 | } |
93 | |
94 | inline |
95 | EffectWindowGroupImpl* Group::effectGroup() |
96 | { |
97 | return effect_group; |
98 | } |
99 | |
100 | } // namespace |
101 | |
102 | #endif |
103 | |