You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
1.8 KiB
99 lines
1.8 KiB
15 years ago
|
//-----------------------------------------------------------------------------
|
||
|
//
|
||
|
// klines 0.1.1 - Basic screen saver for KDE
|
||
|
// by Dirk Staneker 1997
|
||
|
// based on kpolygon 0.3 by Martin R. Jones 1996
|
||
|
//
|
||
|
|
||
|
#ifndef __LINES_H__
|
||
|
#define __LINES_H__
|
||
|
|
||
15 years ago
|
#include <tqtimer.h>
|
||
|
#include <tqptrlist.h>
|
||
15 years ago
|
|
||
|
#include <kdialogbase.h>
|
||
|
#include <krandomsequence.h>
|
||
12 years ago
|
#include <tdescreensaver.h>
|
||
15 years ago
|
|
||
|
class KColorButton;
|
||
|
|
||
|
class Lines{
|
||
|
private:
|
||
|
struct Ln{
|
||
|
Ln* next;
|
||
|
int x1, y1, x2, y2;
|
||
|
};
|
||
|
Ln *start, *end, *akt;
|
||
|
int offx1, offy1, offx2, offy2;
|
||
|
uint numLn;
|
||
|
public:
|
||
|
Lines(int);
|
||
|
~Lines();
|
||
|
inline void reset();
|
||
|
inline void getKoord(int&, int&, int&, int&);
|
||
|
inline void setKoord(const int&, const int&, const int&, const int&);
|
||
|
inline void next(void);
|
||
|
void turn(const int&, const int&);
|
||
|
};
|
||
|
|
||
|
class kLinesSaver:public KScreenSaver{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
|
kLinesSaver( WId id );
|
||
|
virtual ~kLinesSaver();
|
||
|
|
||
|
void setLines(int len);
|
||
|
void setSpeed(int spd);
|
||
15 years ago
|
void setColor(const TQColor&, const TQColor&, const TQColor&);
|
||
15 years ago
|
|
||
|
private:
|
||
|
void readSettings();
|
||
|
void blank();
|
||
|
void initialiseLines();
|
||
|
void initialiseColor();
|
||
|
|
||
|
protected slots:
|
||
|
void slotTimeout();
|
||
|
|
||
|
protected:
|
||
|
KRandomSequence rnd;
|
||
15 years ago
|
TQTimer timer;
|
||
15 years ago
|
unsigned numLines;
|
||
|
int colorContext, speed;
|
||
15 years ago
|
TQColor colors[64];
|
||
|
TQColor colstart, colmid, colend;
|
||
15 years ago
|
double colscale;
|
||
|
Lines* lines;
|
||
|
};
|
||
|
|
||
|
class kLinesSetup : public KDialogBase{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
15 years ago
|
kLinesSetup(TQWidget *parent=NULL, const char *name=NULL);
|
||
15 years ago
|
~kLinesSetup();
|
||
|
|
||
|
protected:
|
||
|
void readSettings();
|
||
|
|
||
|
private slots:
|
||
|
void slotLength(int);
|
||
|
void slotSpeed(int);
|
||
15 years ago
|
void slotColstart(const TQColor &);
|
||
|
void slotColmid(const TQColor &);
|
||
|
void slotColend(const TQColor &);
|
||
15 years ago
|
void slotOk();
|
||
|
void slotHelp();
|
||
|
|
||
|
private:
|
||
|
KColorButton *colorPush0, *colorPush1, *colorPush2;
|
||
15 years ago
|
TQWidget *preview;
|
||
15 years ago
|
kLinesSaver *saver;
|
||
|
int length, speed;
|
||
15 years ago
|
TQColor colstart, colmid, colend;
|
||
15 years ago
|
};
|
||
|
|
||
|
#endif
|
||
|
|