/
teletextscreen.h
68 lines (58 loc) · 1.95 KB
/
teletextscreen.h
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
#ifndef TELETEXTSCREEN_H
#define TELETEXTSCREEN_H
#include <QFont>
#include "mythscreentype.h"
#include "teletextreader.h"
#include "mythplayer.h"
class TeletextScreen: public MythScreenType
{
static bool InitialiseFont(void);
public:
TeletextScreen(MythPlayer *player, const char * name, int fontStretch);
virtual ~TeletextScreen();
// MythScreenType methods
virtual bool Create(void);
virtual void Pulse(void);
// TeletextViewer interface methods
bool KeyPress(const QString &key);
void SetPage(int page, int subpage);
void SetDisplaying(bool display);
void Reset(void);
void ClearScreen(void);
private:
void OptimiseDisplayedArea(void);
QImage* GetRowImage(int row, QRect &rect);
void SetForegroundColor(int color);
void SetBackgroundColor(int color);
void DrawBackground(int x, int y);
void DrawRect(int row, const QRect);
void DrawCharacter(int x, int y, QChar ch, int doubleheight = 0);
void DrawMosaic(int x, int y, int code, int doubleheight);
void DrawLine(const uint8_t *page, uint row, int lang);
void DrawHeader(const uint8_t *page, int lang);
void DrawStatus(void);
void DrawPage(void);
MythPlayer *m_player;
TeletextReader *m_teletextReader;
QRect m_safeArea;
int m_colWidth;
int m_rowHeight;
QColor m_bgColor;
bool m_displaying;
QHash<int, QImage*> m_rowImages;
int m_fontStretch;
int m_fontHeight;
public:
static const QColor kColorBlack;
static const QColor kColorRed;
static const QColor kColorGreen;
static const QColor kColorYellow;
static const QColor kColorBlue;
static const QColor kColorMagenta;
static const QColor kColorCyan;
static const QColor kColorWhite;
static const QColor kColorTransp;
static const int kTeletextColumns;
static const int kTeletextRows;
};
#endif // TELETEXTSCREEN_H