From 8b2aa1b5301ab60368a03e36df4ff5216726e87d Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- kscreensaver/kdesavers/lines.h | 96 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 kscreensaver/kdesavers/lines.h (limited to 'kscreensaver/kdesavers/lines.h') diff --git a/kscreensaver/kdesavers/lines.h b/kscreensaver/kdesavers/lines.h new file mode 100644 index 00000000..d3f1062c --- /dev/null +++ b/kscreensaver/kdesavers/lines.h @@ -0,0 +1,96 @@ +//----------------------------------------------------------------------------- +// +// 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__ + +#include +#include + +#include +#include +#include + +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 + public: + kLinesSaver( WId id ); + virtual ~kLinesSaver(); + + void setLines(int len); + void setSpeed(int spd); + void setColor(const QColor&, const QColor&, const QColor&); + + private: + void readSettings(); + void blank(); + void initialiseLines(); + void initialiseColor(); + + protected slots: + void slotTimeout(); + + protected: + KRandomSequence rnd; + QTimer timer; + unsigned numLines; + int colorContext, speed; + QColor colors[64]; + QColor colstart, colmid, colend; + double colscale; + Lines* lines; +}; + +class kLinesSetup : public KDialogBase{ + Q_OBJECT + public: + kLinesSetup(QWidget *parent=NULL, const char *name=NULL); + ~kLinesSetup(); + + protected: + void readSettings(); + + private slots: + void slotLength(int); + void slotSpeed(int); + void slotColstart(const QColor &); + void slotColmid(const QColor &); + void slotColend(const QColor &); + void slotOk(); + void slotHelp(); + + private: + KColorButton *colorPush0, *colorPush1, *colorPush2; + QWidget *preview; + kLinesSaver *saver; + int length, speed; + QColor colstart, colmid, colend; +}; + +#endif + -- cgit v1.2.1