Fix them
[kdeartwork.git] / kscreensaver / kdesavers / lines.h
blob3db3a3876c72cb6893228cca8ac3c1c604508038
1 //-----------------------------------------------------------------------------
2 //
3 // klines 0.1.1 - Basic screen saver for KDE
4 // by Dirk Staneker 1997
5 // based on kpolygon 0.3 by Martin R. Jones 1996
6 //
8 #ifndef __LINES_H__
9 #define __LINES_H__
11 #include <qtimer.h>
12 #include <q3ptrlist.h>
14 #include <kdialog.h>
15 #include <krandomsequence.h>
16 #include <kscreensaver.h>
18 class KColorButton;
20 class Lines{
21 private:
22 struct Ln{
23 Ln* next;
24 int x1, y1, x2, y2;
26 Ln *start, *end, *akt;
27 int offx1, offy1, offx2, offy2;
28 uint numLn;
29 public:
30 Lines(int);
31 ~Lines();
32 inline void reset();
33 inline void getKoord(int&, int&, int&, int&);
34 inline void setKoord(const int&, const int&, const int&, const int&);
35 inline void next(void);
36 void turn(const int&, const int&);
39 class kLinesSaver:public KScreenSaver{
40 Q_OBJECT
41 public:
42 kLinesSaver( WId id );
43 virtual ~kLinesSaver();
45 void setLines(int len);
46 void setSpeed(int spd);
47 void setColor(const QColor&, const QColor&, const QColor&);
49 private:
50 void readSettings();
51 void blank();
52 void initialiseLines();
53 void initialiseColor();
55 protected slots:
56 void slotTimeout();
57 protected:
58 void paintEvent(QPaintEvent *event);
60 protected:
61 KRandomSequence rnd;
62 QTimer timer;
63 unsigned numLines;
64 int speed;
65 QColor colors[64];
66 QColor colstart, colmid, colend;
67 double colscale;
68 Lines* lines;
71 class kLinesSetup : public KDialog{
72 Q_OBJECT
73 public:
74 kLinesSetup(QWidget *parent=NULL, const char *name=NULL);
75 ~kLinesSetup();
77 protected:
78 void readSettings();
80 private slots:
81 void slotLength(int);
82 void slotSpeed(int);
83 void slotColstart(const QColor &);
84 void slotColmid(const QColor &);
85 void slotColend(const QColor &);
86 void slotOk();
87 void slotHelp();
89 private:
90 KColorButton *colorPush0, *colorPush1, *colorPush2;
91 QWidget *preview;
92 kLinesSaver *saver;
93 int length, speed;
94 QColor colstart, colmid, colend;
97 #endif