MythTV master
teletextscreen.h
Go to the documentation of this file.
1#ifndef TELETEXTSCREEN_H
2#define TELETEXTSCREEN_H
3
4#include <QFont>
5
7
9#include "mythplayer.h"
10
12{
13 Q_OBJECT
14
15 static bool InitialiseFont();
16
17 public:
18 TeletextScreen(MythPlayer* Player, MythPainter* Painter, const QString& Name, int FontStretch);
19 ~TeletextScreen() override;
20
21 bool Create() override;
22 void Pulse() override;
23
24 // TeletextViewer interface methods
25 bool KeyPress(const QString& Key, bool& Exit);
26 void SetPage(int page, int subpage);
27 void SetDisplaying(bool display);
28 void Reset() override;
29 void ClearScreen();
30
31 private:
33 QImage* GetRowImage(int row, QRect &rect);
34 static void SetForegroundColor(int color);
35 void SetBackgroundColor(int color);
36 void DrawBackground(int x, int y);
37 void DrawRect(int row, QRect rect);
38 void DrawCharacter(int x, int y, QChar ch, bool doubleheight = false);
39 void DrawMosaic(int x, int y, int code, bool doubleheight);
40 void DrawLine(const tt_line_array& page, uint row, int lang);
41 void DrawHeader(const tt_line_array &page, int lang);
42 void DrawStatus();
43 void DrawPage();
44
45 MythPlayer* m_player {nullptr};
48 int m_colWidth {10};
49 int m_rowHeight {10};
51 bool m_displaying {false};
52 QHash<int, QImage*> m_rowImages;
54 int m_fontHeight {10};
55
56 public:
57 static const QColor kColorBlack;
58 static const QColor kColorRed;
59 static const QColor kColorGreen;
60 static const QColor kColorYellow;
61 static const QColor kColorBlue;
62 static const QColor kColorMagenta;
63 static const QColor kColorCyan;
64 static const QColor kColorWhite;
65 static const QColor kColorTransp;
66 static const int kTeletextColumns;
67 static const int kTeletextRows;
68};
69
70#endif // TELETEXTSCREEN_H
Screen in which all other widgets are contained and rendered.
MythPlayer * m_player
void DrawLine(const tt_line_array &page, uint row, int lang)
static void SetForegroundColor(int color)
static const QColor kColorRed
static const QColor kColorMagenta
static const QColor kColorGreen
void SetPage(int page, int subpage)
static bool InitialiseFont()
bool KeyPress(const QString &Key, bool &Exit)
static const QColor kColorBlack
static const int kTeletextRows
void DrawHeader(const tt_line_array &page, int lang)
~TeletextScreen() override
TeletextScreen(MythPlayer *Player, MythPainter *Painter, const QString &Name, int FontStretch)
void Pulse() override
Pulse is called 70 times a second to trigger a single frame of an animation.
static const QColor kColorTransp
bool Create() override
void DrawRect(int row, QRect rect)
void OptimiseDisplayedArea()
QHash< int, QImage * > m_rowImages
void DrawMosaic(int x, int y, int code, bool doubleheight)
void SetDisplaying(bool display)
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
void DrawBackground(int x, int y)
void DrawCharacter(int x, int y, QChar ch, bool doubleheight=false)
void SetBackgroundColor(int color)
TeletextReader * m_teletextReader
static const QColor kColorYellow
static const QColor kColorWhite
static const QColor kColorCyan
static const int kTeletextColumns
QImage * GetRowImage(int row, QRect &rect)
static const QColor kColorBlue
unsigned int uint
Definition: freesurround.h:24
std::array< uint8_t, 40 > tt_line_array