group.h
00001 /***************************************************************** 00002 KWin - the KDE window manager 00003 This file is part of the KDE project. 00004 00005 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org> 00006 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> 00007 00008 You can Freely distribute this program under the GNU General Public 00009 License. See the file "COPYING" for the exact licensing terms. 00010 ******************************************************************/ 00011 00012 #ifndef KWIN_GROUP_H 00013 #define KWIN_GROUP_H 00014 00015 #include "utils.h" 00016 #include <X11/X.h> 00017 #include <netwm.h> 00018 00019 namespace KWinInternal 00020 { 00021 00022 class Client; 00023 class Workspace; 00024 00025 class Group 00026 { 00027 public: 00028 Group( Window leader, Workspace* workspace ); 00029 ~Group(); 00030 Window leader() const; 00031 const Client* leaderClient() const; 00032 Client* leaderClient(); 00033 const ClientList& members() const; 00034 QPixmap icon() const; 00035 QPixmap miniIcon() const; 00036 void addMember( Client* member ); 00037 void removeMember( Client* member ); 00038 void gotLeader( Client* leader ); 00039 void lostLeader(); 00040 Workspace* workspace(); 00041 bool groupEvent( XEvent* e ); 00042 void updateUserTime( Time time = CurrentTime ); 00043 Time userTime() const; 00044 void ref(); 00045 void deref(); 00046 private: 00047 void getIcons(); 00048 void startupIdChanged(); 00049 ClientList _members; 00050 Client* leader_client; 00051 Window leader_wid; 00052 Workspace* _workspace; 00053 NETWinInfo* leader_info; 00054 Time user_time; 00055 int refcount; 00056 }; 00057 00058 inline Window Group::leader() const 00059 { 00060 return leader_wid; 00061 } 00062 00063 inline const Client* Group::leaderClient() const 00064 { 00065 return leader_client; 00066 } 00067 00068 inline Client* Group::leaderClient() 00069 { 00070 return leader_client; 00071 } 00072 00073 inline const ClientList& Group::members() const 00074 { 00075 return _members; 00076 } 00077 00078 inline Workspace* Group::workspace() 00079 { 00080 return _workspace; 00081 } 00082 00083 inline Time Group::userTime() const 00084 { 00085 return user_time; 00086 } 00087 00088 } // namespace 00089 00090 #endif