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.
153 lines
3.4 KiB
153 lines
3.4 KiB
15 years ago
|
/* Slide Show Screen Saver
|
||
|
* (C) 1999 Stefan Taferner <taferner@kde.org>
|
||
|
* (C) 2003 Sven Leiber <s.leiber@web.de>
|
||
|
*/
|
||
|
|
||
|
|
||
|
#ifndef SLIDESHOW_H
|
||
|
#define SLIDESHOW_H
|
||
|
|
||
15 years ago
|
#include <tqtimer.h>
|
||
|
#include <tqptrlist.h>
|
||
|
#include <tqstringlist.h>
|
||
|
#include <tqpixmap.h>
|
||
|
#include <tqpainter.h>
|
||
|
#include <tqimage.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdescreensaver.h>
|
||
15 years ago
|
#include <kdialogbase.h>
|
||
|
|
||
|
#include "slideshowcfg.h"
|
||
|
|
||
|
class SlideShowCfg;
|
||
|
|
||
|
//-----------------------------------------------------------------------------
|
||
|
class kSlideShowSaver: public KScreenSaver
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
|
kSlideShowSaver( WId id );
|
||
|
virtual ~kSlideShowSaver();
|
||
|
|
||
|
typedef int (kSlideShowSaver::*EffectMethod)(bool);
|
||
|
|
||
|
void readConfig();
|
||
|
|
||
|
void restart();
|
||
|
|
||
|
protected slots:
|
||
|
void slotTimeout();
|
||
|
|
||
|
protected:
|
||
|
void blank();
|
||
|
|
||
|
/** Load list of images from directory */
|
||
|
virtual void loadDirectory();
|
||
|
|
||
|
/** Helper for loadDirectory() */
|
||
15 years ago
|
virtual void traverseDirectory(const TQString &dirName);
|
||
15 years ago
|
|
||
|
/** Load next image from list. If the file cannot be read
|
||
|
it is automatically removed from the file list.
|
||
|
mImage contains the image after loading. */
|
||
|
virtual void loadNextImage();
|
||
|
|
||
|
/** Show next screen, completely, without transition. */
|
||
|
virtual void showNextScreen();
|
||
|
|
||
|
/** Set loaded image to next-screen buffer. */
|
||
|
virtual void createNextScreen();
|
||
|
|
||
|
/** Initialize next-screen buffer. */
|
||
|
virtual void initNextScreen();
|
||
|
|
||
|
/** Register effect methods in effect list. */
|
||
|
virtual void registerEffects();
|
||
|
|
||
|
/** Various effects. If adding one, do not forget to manually
|
||
|
add the effect to the list in the registerEffects() method. */
|
||
|
int effectHorizLines(bool doInit);
|
||
|
int effectVertLines(bool doInit);
|
||
|
int effectRandom(bool doInit);
|
||
|
int effectGrowing(bool doInit);
|
||
|
int effectChessboard(bool doInit);
|
||
|
int effectIncomingEdges(bool doInit);
|
||
|
int effectBlobs(bool doInit);
|
||
|
int effectCircleOut(bool doInit);
|
||
|
int effectSweep(bool doInit);
|
||
|
int effectMeltdown(bool doInit);
|
||
|
int effectSpiralIn(bool doInit);
|
||
|
int effectMultiCircleOut(bool doInit);
|
||
|
|
||
|
protected:
|
||
|
/** Init mPainter with next-screen's pixmap and call
|
||
|
mPainter.begin(&mWidget) */
|
||
13 years ago
|
void startPainter(TQt::PenStyle penStyle=NoPen);
|
||
15 years ago
|
|
||
|
protected:
|
||
|
struct mScreenGeo {
|
||
|
mScreenGeo(int w, int h, int x, int y) : mW(w), mH(h), mXorg(x), mYorg(y) {};
|
||
|
int mW;
|
||
|
int mH;
|
||
|
int mXorg;
|
||
|
int mYorg;
|
||
|
};
|
||
15 years ago
|
TQPtrList<mScreenGeo> mGeoList;
|
||
15 years ago
|
bool mEffectRunning;
|
||
15 years ago
|
TQTimer mTimer;
|
||
15 years ago
|
int mColorContext;
|
||
15 years ago
|
TQStringList mFileList;
|
||
|
TQStringList mRandomList;
|
||
15 years ago
|
int mFileIdx;
|
||
15 years ago
|
TQImage mImage;
|
||
|
TQPixmap mNextScreen;
|
||
15 years ago
|
EffectMethod* mEffectList;
|
||
|
EffectMethod mEffect;
|
||
|
int mNumEffects;
|
||
15 years ago
|
TQPainter mPainter;
|
||
|
TQString mImageName;
|
||
15 years ago
|
|
||
|
// config settings:
|
||
|
bool mShowRandom;
|
||
|
bool mZoomImages;
|
||
|
bool mPrintName;
|
||
|
bool mSubdirectory;
|
||
|
bool mRandomPosition;
|
||
|
int mDelay;
|
||
15 years ago
|
TQString mDirectory;
|
||
15 years ago
|
|
||
|
// values for state of various effects:
|
||
|
int mx, my, mw, mh, mdx, mdy, mix, miy, mi, mj, mSubType;
|
||
|
int mx0, my0, mx1, my1, mwait;
|
||
|
double mfx, mfy, mAlpha, mfd;
|
||
|
int* mIntArray;
|
||
|
};
|
||
|
|
||
|
|
||
|
//-----------------------------------------------------------------------------
|
||
|
class kSlideShowSetup : public KDialogBase
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
15 years ago
|
kSlideShowSetup(TQWidget *parent=NULL, const char *name=NULL);
|
||
15 years ago
|
~kSlideShowSetup();
|
||
|
|
||
|
protected:
|
||
|
void readSettings();
|
||
|
|
||
|
protected slots:
|
||
|
void slotOk();
|
||
|
void slotHelp();
|
||
|
void writeSettings();
|
||
15 years ago
|
void slotDirSelected(const TQString &where);
|
||
15 years ago
|
|
||
|
private:
|
||
|
kSlideShowSaver *mSaver;
|
||
|
SlideShowCfg *cfg;
|
||
|
};
|
||
|
|
||
|
#endif /*SLIDESHOW_H*/
|
||
|
|