summaryrefslogtreecommitdiffstats
path: root/kscreensaver/kdesavers/blob.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit8b2aa1b5301ab60368a03e36df4ff5216726e87d (patch)
tree36163d4ee667c23b5cf232df2f3004cd0a76202a /kscreensaver/kdesavers/blob.h
downloadtdeartwork-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/blob.h')
-rw-r--r--kscreensaver/kdesavers/blob.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/kscreensaver/kdesavers/blob.h b/kscreensaver/kdesavers/blob.h
new file mode 100644
index 00000000..93a02998
--- /dev/null
+++ b/kscreensaver/kdesavers/blob.h
@@ -0,0 +1,117 @@
+//-----------------------------------------------------------------------------
+//
+// kblob - Basic screen saver for KDE
+//
+// Copyright (c) Tiaan Wessels, 1997
+//
+
+#ifndef __BLOB_H__
+#define __BLOB_H__
+
+#include <qtimer.h>
+#include <qptrlist.h>
+
+#include <kdialogbase.h>
+#include <kscreensaver.h>
+
+#define RAMP 64
+#define SPEED 10
+
+enum blob_alg {
+ ALG_LINEAR,
+ ALG_HSINE,
+ ALG_CIRB,
+ ALG_POLARC,
+ ALG_LAST,
+ ALG_RANDOM = ALG_LAST };
+
+class KBlobSaver : public KScreenSaver
+{
+ Q_OBJECT
+
+public:
+ KBlobSaver( WId id );
+ virtual ~KBlobSaver();
+
+ void setDimension(int d)
+ { dim = d; }
+ void setShowlen(time_t s)
+ { showlen = s; }
+ void setColorInc(int c)
+ { colorInc = c; }
+
+public slots:
+ void setAlgorithm(int);
+
+public:
+ typedef void (KBlobSaver::*AlgFunc)();
+ struct KBSAlg
+ {
+ QString Name;
+ AlgFunc Init;
+ AlgFunc NextFrame;
+ };
+private:
+
+ QTimer timer;
+ uint colors[RAMP];
+ uint lookup[256];
+ int colorContext, colorInc;
+ int tx, ty;
+ int dim;
+ int xhalf, yhalf;
+ int alg, newalg, newalgp;
+ time_t showlen, start;
+ KBSAlg Algs[ALG_LAST];
+ int ln_xinc, ln_yinc;
+ float hs_radians, hs_rinc, hs_flip, hs_per;
+ float cb_radians, cb_rinc, cb_sradians, cb_radius, cb_devradinc;
+ float cb_deviate;
+ float pc_angle, pc_radius, pc_inc, pc_crot, pc_div;
+
+ void lnSetup();
+ void hsSetup();
+ void cbSetup();
+ void pcSetup();
+
+ void lnNextFrame();
+ void hsNextFrame();
+ void cbNextFrame();
+ void pcNextFrame();
+
+ void blank();
+ void box(int, int);
+ void readSettings();
+
+protected slots:
+ void slotTimeout();
+};
+
+class QListBox;
+class KIntNumInput;
+
+class KBlobSetup : public KDialogBase
+{
+ Q_OBJECT
+
+ int showtime;
+ int alg;
+ QListBox *algs;
+ KIntNumInput *stime;
+
+public:
+ KBlobSetup( QWidget *parent = NULL, const char *name = NULL );
+
+protected:
+ void readSettings();
+
+private slots:
+ void slotOk();
+ void slotHelp();
+
+private:
+ KBlobSaver *saver;
+};
+
+#endif
+