summaryrefslogtreecommitdiff
path: root/styledpixmap.h
blob: 82af25c097828c7fc9358ccb3eee693b13fb58fe (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
#ifndef __TVGUIDE_STYLEDPIXMAP_H
#define __TVGUIDE_STYLEDPIXMAP_H

#include <vdr/osd.h>
#include <vdr/epg.h>
#include "timer.h"
#include "config.h"

enum eBackgroundType {
    bgGrid,
    bgStatusHeaderFull,
    bgStatusHeaderWindowed,
    bgChannelHeader,
    bgChannelGroup,
    bgClock,
    bgButton,
    bgRecMenuBack,
    bgChannelJump,
};

// --- cStyledPixmap -------------------------------------------------------------

class cStyledPixmap {
private:
    void drawVerticalLine(int x, int yStart, int yStop, tColor col);
    void drawHorizontalLine(int y, int xStart, int xStop, tColor col);
    void drawBackgroundButton(bool active);
protected:
    cPixmap *pixmap;
    tColor color;
    tColor colorBlending;
    void setPixmap(cPixmap *pixmap);
public:
    cStyledPixmap(void);
    cStyledPixmap(cPixmap *pixmap);
    virtual ~cStyledPixmap(void);
    void drawBackground();
    void drawBackgroundGraphical(eBackgroundType type, bool active = false);
    void drawBlendedBackground();
    void drawSparsedBackground();
    void drawBorder();
    void drawBoldBorder();
    void drawDefaultBorder(int width, int height);
    void drawRoundedCorners(int width, int height, int radius);
    void setColor(tColor color, tColor colorBlending) {this->color = color; this->colorBlending = colorBlending;};
    void SetAlpha(int alpha) {pixmap->SetAlpha(alpha);};
    void SetLayer(int layer) {pixmap->SetLayer(layer);};
    void Fill(tColor clr) {pixmap->Fill(clr);};
    void DrawText(const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font);
    void DrawImage(const cPoint &Point, const cImage &Image);
    void DrawRectangle(const cRect &Rect, tColor Color);
    void DrawEllipse(const cRect &Rect, tColor Color, int Quadrant);
    void SetViewPort(const cRect &Rect);
    int Width() {return pixmap->ViewPort().Width();};
    int Height() {return pixmap->ViewPort().Height();};
};

#endif //__TVGUIDE_STYLEDPIXMAP_H