1 | /* This file is part of the KDE project |
2 | Copyright (C) 2001 Lubos Lunak <l.lunak@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef __startup_h__ |
21 | #define __startup_h__ |
22 | |
23 | #include <sys/types.h> |
24 | |
25 | #include <QWidget> |
26 | #include <QPixmap> |
27 | |
28 | #include <QTimer> |
29 | #include <QMap> |
30 | #include <kstartupinfo.h> |
31 | |
32 | class KSelectionWatcher; |
33 | |
34 | class StartupId |
35 | : public QWidget |
36 | { |
37 | Q_OBJECT |
38 | public: |
39 | explicit StartupId( QWidget* parent = 0, const char* name = 0 ); |
40 | virtual ~StartupId(); |
41 | void configure(); |
42 | protected: |
43 | virtual bool x11Event( XEvent* e ); |
44 | void start_startupid( const QString& icon ); |
45 | void stop_startupid(); |
46 | protected Q_SLOTS: |
47 | void update_startupid(); |
48 | void gotNewStartup( const KStartupInfoId& id, const KStartupInfoData& data ); |
49 | void gotStartupChange( const KStartupInfoId& id, const KStartupInfoData& data ); |
50 | void gotRemoveStartup( const KStartupInfoId& id ); |
51 | void finishKDEStartup(); |
52 | void newOwner(); |
53 | void lostOwner(); |
54 | protected: |
55 | KStartupInfo startup_info; |
56 | WId startup_window; |
57 | QTimer update_timer; |
58 | QMap< KStartupInfoId, QString > startups; // QString == pixmap |
59 | KStartupInfoId current_startup; |
60 | bool blinking; |
61 | bool bouncing; |
62 | unsigned int color_index; |
63 | unsigned int frame; |
64 | enum { NUM_BLINKING_PIXMAPS = 5 }; |
65 | QPixmap pixmaps[ NUM_BLINKING_PIXMAPS ]; |
66 | KSelectionWatcher* selection_watcher; |
67 | bool active_selection; |
68 | }; |
69 | |
70 | #endif |
71 | |