summaryrefslogtreecommitdiffstats
path: root/src/effectwidget.h
blob: 91a3a6595d806d2573a960d241bed56e91d66611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/***************************************************************************
 *   Copyright Sean Meiners 2004 <[email protected]>            *
 *   Copyright (C) by                                                      *
 *     - 2005: Christian Leh <[email protected]>                             *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License (version 2) as   *
 *   published by the Free Software Foundation. (The original KSplash/ML   *
 *   codebase (upto version 0.95.3) is BSD-licensed.)                      *
 *                                                                         *
 ***************************************************************************/

#ifndef FADEWIDGET_H
#define FADEWIDGET_H

#include <tqwidget.h>
#include <tqptrlist.h>
#include <tqpixmap.h>
#include <tqimage.h>

#include <kimageeffect.h>

class TQTimer;

class EffectWidget : public TQWidget
{
  Q_OBJECT
  TQ_OBJECT

 public:
  EffectWidget(TQWidget *parent = 0,const char *name = 0);

  static void setBackgroundImage(TQImage *image) { bgImage = image; }

  void setImage(TQImage *i);
  void setDelay(int delayInMS);
  void setLoop(bool loop);
  void setSteps(int steps);
  void setStart(float begin, float end = 1.0, bool reverse = false);

  void start();
  void stop();
  void rewind();

  void paintEvent(TQPaintEvent *);
  void resizeEvent(TQResizeEvent *);
  void moveEvent(TQMoveEvent *);

  void updateCache();

 public slots:
  void timerTick();

 private:
  static TQImage *bgImage;

  TQTimer *timer;
  TQImage *image;
  TQImage background;
  unsigned int delayMS;
  unsigned int currentStep;
  unsigned int totalSteps;
  bool playing;
  bool loop;
  float
    beginOpacity,
    endOpacity;
};

#endif