diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 8b2aa1b5301ab60368a03e36df4ff5216726e87d (patch) | |
tree | 36163d4ee667c23b5cf232df2f3004cd0a76202a /kscreensaver/kdesavers/SolarWinds.h | |
download | tdeartwork-8b2aa1b5301ab60368a03e36df4ff5216726e87d.tar.gz tdeartwork-8b2aa1b5301ab60368a03e36df4ff5216726e87d.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeartwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kscreensaver/kdesavers/SolarWinds.h')
-rw-r--r-- | kscreensaver/kdesavers/SolarWinds.h | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/kscreensaver/kdesavers/SolarWinds.h b/kscreensaver/kdesavers/SolarWinds.h new file mode 100644 index 00000000..8831c015 --- /dev/null +++ b/kscreensaver/kdesavers/SolarWinds.h @@ -0,0 +1,138 @@ +#ifndef __SOLARWINDS_H__ +#define __SOLARWINDS_H__ +//============================================================================ +// +// Terence Welsh Screensaver - Solar Winds +// http://www.reallyslick.com/ +// +// Ported to KDE by Karl Robillard +// +//============================================================================ + + +#include <qgl.h> + + +#define LIGHTSIZE 64 + + +class wind; +class QTimer; + +class SWindsWidget : public QGLWidget +{ + Q_OBJECT + +public: + + enum eDefault + { + Regular, + CosmicStrings, + ColdPricklies, + SpaceFur, + Jiggly, + Undertow, + + DefaultModes + }; + + SWindsWidget( QWidget* parent=0, const char* name=0 ); + ~SWindsWidget(); + + void updateParameters(); + void setDefaults( int which ); + +protected: + + void paintGL(); + void resizeGL( int w, int h ); + void initializeGL(); +#ifdef UNIT_TEST + void keyPressEvent( QKeyEvent* ); +#endif + +private slots: + + void nextFrame(); + +private: + + wind* _winds; + unsigned char lightTexture[LIGHTSIZE][LIGHTSIZE]; + + int dWinds; + int dEmitters; + int dParticles; + int dGeometry; + float dSize; + int dParticlespeed; + int dEmitterspeed; + int dWindspeed; + int dBlur; + + + // Using QTimer rather than timerEvent() to avoid getting locked out of + // the QEvent loop on lower-end systems. Ian Geiser <geiseri@kde.org> + // says this is the way to go. + QTimer* _timer; + int _frameTime; + + friend class wind; +}; + + +#ifndef UNIT_TEST +#include <kdialogbase.h> +#include <kscreensaver.h> + + +class KSWindsScreenSaver : public KScreenSaver +{ + Q_OBJECT + +public: + + KSWindsScreenSaver( WId id ); + virtual ~KSWindsScreenSaver(); + + int mode() const { return _mode; } + +public slots: + + void setMode( int ); + +private: + + void readSettings(); + + SWindsWidget* _flux; + int _mode; +}; + + +class QComboBox; + +class KSWindsSetup : public KDialogBase +{ + Q_OBJECT + +public: + + KSWindsSetup( QWidget* parent = 0, const char* name = 0 ); + ~KSWindsSetup(); + +private slots: + + void slotHelp(); + void slotOk(); + +private: + + QComboBox* modeW; + KSWindsScreenSaver* _saver; +}; +#endif + + +#endif //__SOLARWINDS_H__ |