fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / threadweaver / WeaverGui / WeaverThreadGrid.h
blob0c6d020d39e5f979386f364b29d601ddf41563bc
1 /* -*- C++ -*-
3 This file declares the WeaverThreadGrid class.
5 $ Author: Mirko Boehm $
6 $ Copyright: (C) 2005, Mirko Boehm $
7 $ Contact: mirko@kde.org
8 http://www.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
44 Q_OBJECT
45 public:
46 WeaverThreadGrid ( QWidget *parent = 0 );
47 ~WeaverThreadGrid ();
48 // attach this object to a Weaver to visualize its activity:
49 void attach (Weaver *weaver);
50 protected:
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;
61 QColor m_colorBusy;
62 QColor m_colorIdleFrame;
63 QColor m_colorIdle;
64 protected Q_SLOTS:
65 void threadStarted ( ThreadWeaver::Thread* );
66 void threadBusy ( ThreadWeaver::Thread*, ThreadWeaver::Job* );
67 void threadSuspended ( ThreadWeaver::Thread* );
68 private:
69 class Private;
70 Private * const d;
74 #endif