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.
139 lines
3.5 KiB
139 lines
3.5 KiB
15 years ago
|
/* This file is part of the KDE libraries
|
||
|
|
||
|
Copyright (c) 2001 Martin R. Jones <mjones@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef KSCREENSAVER_H
|
||
|
#define KSCREENSAVER_H
|
||
|
|
||
15 years ago
|
#include <tqwidget.h>
|
||
15 years ago
|
|
||
13 years ago
|
#include <tdelibs_export.h>
|
||
15 years ago
|
|
||
14 years ago
|
class TQTimer;
|
||
15 years ago
|
class KScreenSaverPrivate;
|
||
|
class KBlankEffectPrivate;
|
||
|
|
||
|
/**
|
||
15 years ago
|
* Provides a TQWidget for a screensaver to draw into.
|
||
15 years ago
|
*
|
||
|
* You should derive from this widget and implement your screensaver's
|
||
|
* functionality. To use libkss, provide the following constants and
|
||
|
* functions:
|
||
|
*
|
||
|
* extern "C"
|
||
|
* {
|
||
|
* const char *kss_applicationName = "yourappname";
|
||
|
* const char *kss_description = I18N_NOOP( "Your screensaver" );
|
||
|
* const char *kss_version = "1.0";
|
||
|
*
|
||
|
* KScreenSaver *kss_create( WId d )
|
||
|
* {
|
||
|
* // return your KScreenSaver derived screensaver
|
||
|
* }
|
||
|
*
|
||
15 years ago
|
* TQDialog *kss_setup()
|
||
15 years ago
|
* {
|
||
|
* // return your modal setup dialog
|
||
|
* }
|
||
|
* }
|
||
|
*
|
||
15 years ago
|
* @short Provides a TQWidget for a screensaver to draw into.
|
||
15 years ago
|
* @author Martin R. Jones <mjones@kde.org>
|
||
|
*/
|
||
14 years ago
|
class KDE_EXPORT KScreenSaver : public TQWidget
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
/**
|
||
|
* @param id The winId() of the widget to draw the screensaver into.
|
||
|
*/
|
||
|
KScreenSaver( WId id=0 );
|
||
|
~KScreenSaver();
|
||
|
|
||
|
protected:
|
||
|
/**
|
||
|
* You cannot create a new widget with this widget as parent, since this
|
||
|
* widget may not be owned by your application. In order to create
|
||
|
* widgets with a KScreenSaver as parent, create the widget with no parent,
|
||
|
* call embed(), and then show() the widget.
|
||
|
*
|
||
|
* @param widget The widget to embed in the screensaver widget.
|
||
|
*/
|
||
15 years ago
|
void embed( TQWidget *widget );
|
||
15 years ago
|
|
||
15 years ago
|
bool eventFilter( TQObject *o, TQEvent * );
|
||
15 years ago
|
|
||
|
private:
|
||
|
KScreenSaverPrivate *d;
|
||
|
};
|
||
|
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* Blanks a widget using various effects.
|
||
|
*
|
||
|
* @short Blanks a widget using various effects.
|
||
|
* @author Martin R. Jones <mjones@kde.org>
|
||
|
*/
|
||
14 years ago
|
class KBlankEffect : public TQObject
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
15 years ago
|
KBlankEffect( TQObject *parent=0 );
|
||
15 years ago
|
~KBlankEffect();
|
||
|
|
||
|
enum Effect { Random=-1, Blank=0, SweepRight, SweepDown, Blocks,
|
||
|
MaximumEffects };
|
||
|
|
||
|
/**
|
||
|
* Blank a widget using the specified effect.
|
||
|
* Some blanking effects take some time, so you should connect to
|
||
|
* doneBlank() to know when the blanking is complete.
|
||
|
*
|
||
|
* @param w The widget to blank.
|
||
|
* @param effect The type of effect to use.
|
||
|
*/
|
||
15 years ago
|
void blank( TQWidget *w, Effect effect=Random );
|
||
15 years ago
|
|
||
|
typedef void (KBlankEffect::*BlankEffect)();
|
||
|
|
||
|
signals:
|
||
|
/**
|
||
|
* emitted when a blanking effect has completed.
|
||
|
*/
|
||
|
void doneBlank();
|
||
|
|
||
|
protected slots:
|
||
|
void timeout();
|
||
|
|
||
|
protected:
|
||
|
void finished();
|
||
|
|
||
|
void blankNormal();
|
||
|
void blankSweepRight();
|
||
|
void blankSweepDown();
|
||
|
void blankBlocks();
|
||
|
|
||
|
protected:
|
||
|
static BlankEffect effects[];
|
||
|
KBlankEffectPrivate *d;
|
||
|
};
|
||
|
#endif
|
||
|
|