Back to index

kdeartwork  4.3.2
swarm.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //
00003 // kswarm - port of "swarm" from xlock
00004 //
00005 
00006 #ifndef __SWARM_H__
00007 #define __SWARM_H__
00008 #include <fixx11h.h>
00009 #include <qtimer.h>
00010 
00011 #include <kdialog.h>
00012 #include "saver.h"
00013 
00014 
00015 class kSwarmSaver : public kScreenSaver
00016 {
00017        Q_OBJECT
00018 public:
00019        kSwarmSaver( Drawable drawable );
00020        virtual ~kSwarmSaver();
00021 
00022        void setSpeed( int spd );
00023        void setLevels( int l );
00024 
00025 protected:
00026        void readSettings();
00027 
00028 protected slots:
00029        void slotTimeout();
00030 
00031 protected:
00032        KRandomSequence rnd;
00033        QTimer      timer;
00034        int         colorContext;
00035 
00036        int         speed;
00037        int                  maxLevels;
00038 };
00039 
00040 class kSwarmSetup : public KDialog
00041 {
00042        Q_OBJECT
00043 public:
00044        kSwarmSetup( QWidget *parent = NULL, const char *name = NULL );
00045 
00046 protected:
00047        void readSettings();
00048 
00049 private slots:
00050        void slotSpeed( int );
00051        void slotLevels( int );
00052 
00053        void slotOk();
00054        void slotHelp();
00055 
00056 private:
00057        QWidget *preview;
00058        kSwarmSaver *saver;
00059 
00060        int                  speed;
00061        int                  maxLevels;
00062 };
00063 
00064 #endif
00065