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.
82 lines
1.3 KiB
82 lines
1.3 KiB
15 years ago
|
//-----------------------------------------------------------------------------
|
||
|
//
|
||
|
// kpolygon - Basic screen saver for KDE
|
||
|
//
|
||
|
// Copyright (c) Martin R. Jones 1996
|
||
|
//
|
||
|
|
||
|
#ifndef __POLYGON_H__
|
||
|
#define __POLYGON_H__
|
||
|
|
||
15 years ago
|
#include <tqtimer.h>
|
||
|
#include <tqptrlist.h>
|
||
15 years ago
|
|
||
|
#include <kdialogbase.h>
|
||
12 years ago
|
#include <tdescreensaver.h>
|
||
15 years ago
|
#include <krandomsequence.h>
|
||
|
|
||
|
class kPolygonSaver : public KScreenSaver
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
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:
|
||
14 years ago
|
TQTimer timer;
|
||
15 years ago
|
unsigned numLines;
|
||
|
int numVertices;
|
||
|
int colorContext;
|
||
|
int speed;
|
||
14 years ago
|
TQColor colors[64];
|
||
15 years ago
|
int currentColor;
|
||
15 years ago
|
TQPtrList<TQPointArray> polygons;
|
||
|
TQMemArray<TQPoint> directions;
|
||
15 years ago
|
KRandomSequence rnd;
|
||
|
};
|
||
|
|
||
|
class kPolygonSetup : public KDialogBase
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
15 years ago
|
kPolygonSetup( TQWidget *parent = 0, const char *name = 0 );
|
||
15 years ago
|
~kPolygonSetup();
|
||
|
|
||
|
protected:
|
||
|
void readSettings();
|
||
|
|
||
|
private slots:
|
||
|
void slotLength( int );
|
||
|
void slotVertices( int );
|
||
|
void slotSpeed( int );
|
||
|
void slotOk();
|
||
|
void slotHelp();
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQWidget *preview;
|
||
15 years ago
|
kPolygonSaver *saver;
|
||
|
|
||
|
int length;
|
||
|
int vertices;
|
||
|
int speed;
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|