summaryrefslogtreecommitdiff
path: root/views/animation.h
blob: 743c0024889e3dd78d0373f1e8c110a08ecbc93f (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
#ifndef __ANIMATION_H
#define __ANIMATION_H

#include "string"
#include "../libcore/pixmapcontainer.h"
#include "../libtemplate/template.h"

using namespace std;

class cAnimation : public cPixmapContainer {
    int delay;
protected:
    eAnimType animType;
    int animFreq;
    cRect pos;
    int layer;
    bool blinkOn;
    virtual void DrawBlink(void) {};
    virtual void Action(void);
public:
    cAnimation(eAnimType animType, int animFreq, cRect &pos, int layer);
    virtual ~cAnimation();
    void SetDelay(int delay) { this->delay = delay; };
    virtual void Stop(void);
};

class cAnimatedImage : public cAnimation {
private:
    cImage *image;
protected:
    void DrawBlink(void);
public:
    cAnimatedImage(eAnimType animType, int animFreq, cRect &pos, int layer);
    virtual ~cAnimatedImage();
    void SetImage(cImage *i) { image = i; };
};

class cAnimatedText : public cAnimation {
private:
    string text;
    string fontName;
    int fontSize;
    tColor fontColor;
protected:
    void DrawBlink(void);
public:
    cAnimatedText(eAnimType animType, int animFreq, cRect &pos, int layer);
    virtual ~cAnimatedText();
    void SetText(string &t) { text = t; };
    void SetFont(string &font) { fontName = font; };
    void SetFontSize(int size) { fontSize = size; };
    void SetFontColor(tColor col) { fontColor = col; };
};

class cAnimatedOsdObject : public cAnimation {
private:
    eFuncType type;
    tColor color;
    int quadrant;
protected:
    void DrawBlink(void);
public:
    cAnimatedOsdObject(eFuncType type, eAnimType animType, int animFreq, cRect &pos, int layer);
    virtual ~cAnimatedOsdObject();
    void SetColor(tColor col) { color = col; };
    void SetQuadrant(int q) { quadrant = q; };
};

#endif //__ANIMATION_H