summaryrefslogtreecommitdiffstats
path: root/kscreensaver/kdesavers/polygon.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/polygon.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/polygon.h')
-rw-r--r--kscreensaver/kdesavers/polygon.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/kscreensaver/kdesavers/polygon.h b/kscreensaver/kdesavers/polygon.h
new file mode 100644
index 00000000..bfaac8a4
--- /dev/null
+++ b/kscreensaver/kdesavers/polygon.h
@@ -0,0 +1,79 @@
+//-----------------------------------------------------------------------------
+//
+// kpolygon - Basic screen saver for KDE
+//
+// Copyright (c) Martin R. Jones 1996
+//
+
+#ifndef __POLYGON_H__
+#define __POLYGON_H__
+
+#include <qtimer.h>
+#include <qptrlist.h>
+
+#include <kdialogbase.h>
+#include <kscreensaver.h>
+#include <krandomsequence.h>
+
+class kPolygonSaver : public KScreenSaver
+{
+ Q_OBJECT
+public:
+ kPolygonSaver( WId id );
+ virtual ~kPolygonSaver();
+
+ void setPolygon( int len, int ver );
+ void setSpeed( int spd );
+
+private:
+ void readSettings();
+ void blank();
+ void initialisePolygons();
+ void moveVertices();
+ void initialiseColor();
+ void nextColor();
+
+protected slots:
+ void slotTimeout();
+
+protected:
+ QTimer timer;
+ unsigned numLines;
+ int numVertices;
+ int colorContext;
+ int speed;
+ QColor colors[64];
+ int currentColor;
+ QPtrList<QPointArray> polygons;
+ QMemArray<QPoint> directions;
+ KRandomSequence rnd;
+};
+
+class kPolygonSetup : public KDialogBase
+{
+ Q_OBJECT
+public:
+ kPolygonSetup( QWidget *parent = 0, const char *name = 0 );
+ ~kPolygonSetup();
+
+protected:
+ void readSettings();
+
+private slots:
+ void slotLength( int );
+ void slotVertices( int );
+ void slotSpeed( int );
+ void slotOk();
+ void slotHelp();
+
+private:
+ QWidget *preview;
+ kPolygonSaver *saver;
+
+ int length;
+ int vertices;
+ int speed;
+};
+
+#endif
+