MythTV  master
teletextscreen.h
Go to the documentation of this file.
1 #ifndef TELETEXTSCREEN_H
2 #define TELETEXTSCREEN_H
3 
4 #include <QFont>
5 
6 #include "mythscreentype.h"
8 #include "mythplayer.h"
9 
11 {
12  static bool InitialiseFont(void);
13 
14  public:
15  TeletextScreen(MythPlayer *player, const char * name, int fontStretch);
16  ~TeletextScreen() override;
17 
18  // MythScreenType methods
19  bool Create(void) override; // MythScreenType
20  void Pulse(void) override; // MythUIType
21 
22  // TeletextViewer interface methods
23  bool KeyPress(const QString &key);
24  void SetPage(int page, int subpage);
25  void SetDisplaying(bool display);
26  void Reset(void) override; // MythUIType
27  void ClearScreen(void);
28 
29  private:
30  void OptimiseDisplayedArea(void);
31  QImage* GetRowImage(int row, QRect &rect);
32  static void SetForegroundColor(int color);
33  void SetBackgroundColor(int color);
34  void DrawBackground(int x, int y);
35  void DrawRect(int row, QRect rect);
36  void DrawCharacter(int x, int y, QChar ch, bool doubleheight = false);
37  void DrawMosaic(int x, int y, int code, bool doubleheight);
38  void DrawLine(const uint8_t *page, uint row, int lang);
39  void DrawHeader(const uint8_t *page, int lang);
40  void DrawStatus(void);
41  void DrawPage(void);
42 
43  MythPlayer *m_player {nullptr};
45  QRect m_safeArea;
46  int m_colWidth {10};
47  int m_rowHeight {10};
49  bool m_displaying {false};
50  QHash<int, QImage*> m_rowImages;
52  int m_fontHeight {10};
53 
54  public:
55  static const QColor kColorBlack;
56  static const QColor kColorRed;
57  static const QColor kColorGreen;
58  static const QColor kColorYellow;
59  static const QColor kColorBlue;
60  static const QColor kColorMagenta;
61  static const QColor kColorCyan;
62  static const QColor kColorWhite;
63  static const QColor kColorTransp;
64  static const int kTeletextColumns;
65  static const int kTeletextRows;
66 };
67 
68 #endif // TELETEXTSCREEN_H
TeletextScreen::m_fontHeight
int m_fontHeight
Definition: teletextscreen.h:52
TeletextScreen::SetDisplaying
void SetDisplaying(bool display)
Definition: teletextscreen.cpp:243
TeletextScreen::DrawCharacter
void DrawCharacter(int x, int y, QChar ch, bool doubleheight=false)
Definition: teletextscreen.cpp:515
TeletextScreen::kColorWhite
static const QColor kColorWhite
Definition: teletextscreen.h:62
TeletextScreen::m_fontStretch
int m_fontStretch
Definition: teletextscreen.h:51
TeletextScreen::SetPage
void SetPage(int page, int subpage)
Definition: teletextscreen.cpp:237
TeletextScreen::DrawLine
void DrawLine(const uint8_t *page, uint row, int lang)
Definition: teletextscreen.cpp:320
TeletextScreen::kTeletextColumns
static const int kTeletextColumns
Definition: teletextscreen.h:64
TeletextScreen::DrawMosaic
void DrawMosaic(int x, int y, int code, bool doubleheight)
Definition: teletextscreen.cpp:588
TeletextScreen::kColorRed
static const QColor kColorRed
Definition: teletextscreen.h:56
TeletextScreen::kTeletextRows
static const int kTeletextRows
Definition: teletextscreen.h:65
TeletextScreen::m_displaying
bool m_displaying
Definition: teletextscreen.h:49
TeletextScreen::TeletextScreen
TeletextScreen(MythPlayer *player, const char *name, int fontStretch)
Definition: teletextscreen.cpp:42
teletextreader.h
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
mythplayer.h
MythPlayer
Definition: mythplayer.h:164
TeletextScreen::SetBackgroundColor
void SetBackgroundColor(int color)
Definition: teletextscreen.cpp:310
TeletextScreen::m_rowImages
QHash< int, QImage * > m_rowImages
Definition: teletextscreen.h:50
TeletextScreen::m_bgColor
QColor m_bgColor
Definition: teletextscreen.h:48
TeletextScreen::m_player
MythPlayer * m_player
Definition: teletextscreen.h:43
TeletextReader
Definition: teletextreader.h:73
TeletextScreen::m_rowHeight
int m_rowHeight
Definition: teletextscreen.h:47
TeletextScreen::kColorCyan
static const QColor kColorCyan
Definition: teletextscreen.h:61
TeletextScreen::kColorTransp
static const QColor kColorTransp
Definition: teletextscreen.h:63
TeletextScreen::DrawStatus
void DrawStatus(void)
Definition: teletextscreen.cpp:612
TeletextScreen::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: teletextscreen.cpp:250
TeletextScreen::Create
bool Create(void) override
Definition: teletextscreen.cpp:55
TeletextScreen::SetForegroundColor
static void SetForegroundColor(int color)
Definition: teletextscreen.cpp:302
TeletextScreen::Pulse
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: teletextscreen.cpp:145
TeletextScreen::~TeletextScreen
~TeletextScreen() override
Definition: teletextscreen.cpp:50
TeletextScreen::m_colWidth
int m_colWidth
Definition: teletextscreen.h:46
TeletextScreen::m_safeArea
QRect m_safeArea
Definition: teletextscreen.h:45
uint
unsigned int uint
Definition: compat.h:140
TeletextScreen
Definition: teletextscreen.h:10
TeletextScreen::kColorGreen
static const QColor kColorGreen
Definition: teletextscreen.h:57
TeletextScreen::DrawHeader
void DrawHeader(const uint8_t *page, int lang)
Definition: teletextscreen.cpp:256
TeletextScreen::DrawRect
void DrawRect(int row, QRect rect)
Definition: teletextscreen.cpp:574
TeletextScreen::DrawBackground
void DrawBackground(int x, int y)
Definition: teletextscreen.cpp:566
TeletextScreen::InitialiseFont
static bool InitialiseFont(void)
Definition: teletextscreen.cpp:667
TeletextScreen::kColorBlue
static const QColor kColorBlue
Definition: teletextscreen.h:59
TeletextScreen::kColorMagenta
static const QColor kColorMagenta
Definition: teletextscreen.h:60
TeletextScreen::KeyPress
bool KeyPress(const QString &key)
Definition: teletextscreen.cpp:230
TeletextScreen::m_teletextReader
TeletextReader * m_teletextReader
Definition: teletextscreen.h:44
TeletextScreen::GetRowImage
QImage * GetRowImage(int row, QRect &rect)
Definition: teletextscreen.cpp:71
TeletextScreen::kColorBlack
static const QColor kColorBlack
Definition: teletextscreen.h:55
TeletextScreen::OptimiseDisplayedArea
void OptimiseDisplayedArea(void)
Definition: teletextscreen.cpp:90
TeletextScreen::kColorYellow
static const QColor kColorYellow
Definition: teletextscreen.h:58
mythscreentype.h
TeletextScreen::DrawPage
void DrawPage(void)
TeletextScreen::ClearScreen
void ClearScreen(void)
Definition: teletextscreen.cpp:62