add more spacing
[personal-kdebase.git] / workspace / kdm / kfrontend / krootimage.h
bloba5265318d3d09a9d8c12c5caa87b6ef24d3518ad
1 /*
3 Copyright (C) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
4 Copyright (C) 2002,2004 Oswald Buddenhagen <ossi@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
23 #ifndef __KDM_KROOTIMAGE_H__
24 #define __KDM_KROOTIMAGE_H__
26 #include <bgrender.h>
28 #include <QApplication>
29 #include <QTimer>
31 /**
32 * In xinerama mode, each screen is rendered separately by KBackgroundRenderer.
33 * This class controls a set of renderers for a desktop, and collates the
34 * images. Usage is similar to KBackgroundRenderer: connect to the imageDone
35 * signal.
37 class KVirtualBGRenderer : public QObject
39 Q_OBJECT
40 public:
41 explicit KVirtualBGRenderer(const KSharedConfigPtr &config);
42 ~KVirtualBGRenderer();
44 KBackgroundRenderer * renderer( unsigned screen );
45 unsigned numRenderers() const { return m_numRenderers; }
47 QPixmap pixmap();
49 bool needProgramUpdate();
50 void programUpdate();
52 bool needWallpaperChange();
53 void changeWallpaper();
55 void desktopResized();
57 void load( bool reparseConfig = true );
58 void start();
59 void stop();
60 void cleanup();
61 void saveCacheFile();
62 void enableTiling( bool enable );
64 signals:
65 void imageDone();
67 private slots:
68 void screenDone( int screen );
70 private:
71 QSize renderSize( int screen ); // the size the renderer should be
72 void initRenderers();
74 KSharedConfigPtr m_pConfig;
75 float m_scaleX;
76 float m_scaleY;
77 int m_numRenderers;
78 bool m_bDrawBackgroundPerScreen;
79 bool m_bCommonScreen;
80 QSize m_size;
82 QVector<bool> m_bFinished;
83 QVector<KBackgroundRenderer *> m_renderer;
84 QPixmap *m_pPixmap;
87 class MyApplication : public QApplication
89 Q_OBJECT
91 public:
92 MyApplication( const char *conf, int argc, char **argv );
94 private Q_SLOTS:
95 void renderDone();
96 void slotTimeout();
98 private:
99 KVirtualBGRenderer renderer;
100 QTimer timer;
103 #endif // __KDM_KROOTIMAGE_H__