3 This file declares the WeaverThreadGrid class.
5 $ Author: Mirko Boehm $
6 $ Copyright: (C) 2005, Mirko Boehm $
7 $ Contact: mirko@kde.org
9 http://www.hackerbuero.org $
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Library General Public
13 License as published by the Free Software Foundation; either
14 version 2 of the License, or (at your option) any later version.
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Library General Public License for more details.
21 You should have received a copy of the GNU Library General Public License
22 along with this library; see the file COPYING.LIB. If not, write to
23 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
26 $Id: ThreadWeaver.h 32 2005-08-17 08:38:01Z mirko $
29 #ifndef WEAVERTHREADGRID_H
30 #define WEAVERTHREADGRID_H
32 #include <QtCore/QMap>
33 #include <QtCore/QSize>
34 #include <QtGui/QFrame>
36 #include <WeaverObserver.h>
37 #include <ThreadWeaver.h>
38 #include <threadweaver_export.h>
40 namespace ThreadWeaver
{
42 class THREADWEAVER_EXPORT WeaverThreadGrid
: public QFrame
46 WeaverThreadGrid ( QWidget
*parent
= 0 );
48 // attach this object to a Weaver to visualize its activity:
49 void attach (Weaver
*weaver
);
51 // rewrite the paintEvent handler:
52 void paintEvent ( QPaintEvent
* event
);
53 QSize
minimumSize () const;
54 QSize
minimumSizeHint () const;
55 QSize
sizeHint () const;
56 // the WeaverObserver:
57 WeaverObserver m_observer
;
58 // the cells (one for each thread):
59 QMap
<Thread
*, bool> m_cells
;
60 QColor m_colorBusyFrame
;
62 QColor m_colorIdleFrame
;
65 void threadStarted ( ThreadWeaver::Thread
* );
66 void threadBusy ( ThreadWeaver::Thread
*, ThreadWeaver::Job
* );
67 void threadSuspended ( ThreadWeaver::Thread
* );