1 /* Slide Show Screen Saver
2 * (C) 1999 Stefan Taferner <taferner@kde.org>
3 * (C) 2003 Sven Leiber <s.leiber@web.de>
11 #include <q3ptrlist.h>
12 #include <qstringlist.h>
17 #include <kscreensaver.h>
18 #include <kdialogbase.h>
20 #include "slideshowcfg.h"
24 //-----------------------------------------------------------------------------
25 class kSlideShowSaver
: public KScreenSaver
29 kSlideShowSaver( WId id
);
30 virtual ~kSlideShowSaver();
32 typedef int (kSlideShowSaver::*EffectMethod
)(bool);
44 /** Load list of images from directory */
45 virtual void loadDirectory();
47 /** Helper for loadDirectory() */
48 virtual void traverseDirectory(const QString
&dirName
);
50 /** Load next image from list. If the file cannot be read
51 it is automatically removed from the file list.
52 mImage contains the image after loading. */
53 virtual void loadNextImage();
55 /** Show next screen, completely, without transition. */
56 virtual void showNextScreen();
58 /** Set loaded image to next-screen buffer. */
59 virtual void createNextScreen();
61 /** Initialize next-screen buffer. */
62 virtual void initNextScreen();
64 /** Register effect methods in effect list. */
65 virtual void registerEffects();
67 /** Various effects. If adding one, do not forget to manually
68 add the effect to the list in the registerEffects() method. */
69 int effectHorizLines(bool doInit
);
70 int effectVertLines(bool doInit
);
71 int effectRandom(bool doInit
);
72 int effectGrowing(bool doInit
);
73 int effectChessboard(bool doInit
);
74 int effectIncomingEdges(bool doInit
);
75 int effectBlobs(bool doInit
);
76 int effectCircleOut(bool doInit
);
77 int effectSweep(bool doInit
);
78 int effectMeltdown(bool doInit
);
79 int effectSpiralIn(bool doInit
);
80 int effectMultiCircleOut(bool doInit
);
83 /** Init mPainter with next-screen's pixmap and call
84 mPainter.begin(&mWidget) */
85 void startPainter(Qt::PenStyle penStyle
=Qt::NoPen
);
91 QStringList mFileList
;
92 QStringList mRandomList
;
96 EffectMethod
* mEffectList
;
107 bool mRandomPosition
;
111 // values for state of various effects:
112 int mx
, my
, mw
, mh
, mdx
, mdy
, mix
, miy
, mi
, mj
, mSubType
;
113 int mx0
, my0
, mx1
, my1
, mwait
;
114 double mfx
, mfy
, mAlpha
, mfd
;
119 //-----------------------------------------------------------------------------
120 class kSlideShowSetup
: public KDialogBase
124 kSlideShowSetup(QWidget
*parent
=NULL
, const char *name
=NULL
);
133 void writeSettings();
134 void slotDirSelected(const QString
&where
);
137 kSlideShowSaver
*mSaver
;
141 #endif /*SLIDESHOW_H*/