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"
22 //-----------------------------------------------------------------------------
23 class kSlideShowSaver
: public KScreenSaver
27 kSlideShowSaver( WId id
);
28 virtual ~kSlideShowSaver();
30 typedef int (kSlideShowSaver::*EffectMethod
)(bool);
42 /** Load list of images from directory */
43 virtual void loadDirectory();
45 /** Helper for loadDirectory() */
46 virtual void traverseDirectory(const QString
&dirName
);
48 /** Load next image from list. If the file cannot be read
49 it is automatically removed from the file list.
50 mImage contains the image after loading. */
51 virtual void loadNextImage();
53 /** Show next screen, completely, without transition. */
54 virtual void showNextScreen();
56 /** Set loaded image to next-screen buffer. */
57 virtual void createNextScreen();
59 /** Initialize next-screen buffer. */
60 virtual void initNextScreen();
62 /** Register effect methods in effect list. */
63 virtual void registerEffects();
65 /** Various effects. If adding one, do not forget to manually
66 add the effect to the list in the registerEffects() method. */
67 int effectHorizLines(bool doInit
);
68 int effectVertLines(bool doInit
);
69 int effectRandom(bool doInit
);
70 int effectGrowing(bool doInit
);
71 int effectChessboard(bool doInit
);
72 int effectIncomingEdges(bool doInit
);
73 int effectBlobs(bool doInit
);
74 int effectCircleOut(bool doInit
);
75 int effectSweep(bool doInit
);
76 int effectMeltdown(bool doInit
);
77 int effectSpiralIn(bool doInit
);
78 int effectMultiCircleOut(bool doInit
);
81 /** Init mPainter with next-screen's pixmap and call
82 mPainter.begin(&mWidget) */
83 void startPainter(Qt::PenStyle penStyle
=Qt::NoPen
);
88 QStringList mFileList
;
89 QStringList mRandomList
;
93 EffectMethod
* mEffectList
;
104 bool mRandomPosition
;
108 // values for state of various effects:
109 int mx
, my
, mw
, mh
, mdx
, mdy
, mix
, miy
, mi
, mj
, mSubType
;
110 int mx0
, my0
, mx1
, my1
, mwait
;
111 double mfx
, mfy
, mAlpha
, mfd
;
116 //-----------------------------------------------------------------------------
117 class kSlideShowSetup
: public KDialogBase
121 kSlideShowSetup(QWidget
*parent
=NULL
, const char *name
=NULL
);
130 void writeSettings();
131 void slotDirSelected(const QString
&where
);
134 kSlideShowSaver
*mSaver
;
135 Ui_SlideShowCfg
*cfg
;
138 #endif /*SLIDESHOW_H*/