MythTV  master
Go to the documentation of this file.
4 #include <QFont>
6 #include "mythscreentype.h"
7 #include "teletextreader.h"
8 #include "mythplayer.h"
11 {
12  static bool InitialiseFont(void);
14  public:
15  TeletextScreen(MythPlayer *player, const char * name, int fontStretch);
16  ~TeletextScreen() override;
18  // MythScreenType methods
19  bool Create(void) override; // MythScreenType
20  void Pulse(void) override; // MythUIType
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);
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);
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};
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 };
static const int kTeletextColumns
static const QColor kColorTransp
static void SetForegroundColor(int color)
TeletextScreen(MythPlayer *player, const char *name, int fontStretch)
void DrawRect(int row, QRect rect)
void SetDisplaying(bool display)
void OptimiseDisplayedArea(void)
static const int kTeletextRows
void Pulse(void) override
Pulse is called 70 times a second to trigger a single frame of an animation.
void SetBackgroundColor(int color)
QHash< int, QImage * > m_rowImages
void DrawLine(const uint8_t *page, uint row, int lang)
static const QColor kColorRed
MythPlayer * m_player
unsigned int uint
Definition: compat.h:140
void SetPage(int page, int subpage)
static const QColor kColorCyan
void DrawStatus(void)
static bool InitialiseFont(void)
static const QColor kColorWhite
QImage * GetRowImage(int row, QRect &rect)
void ClearScreen(void)
~TeletextScreen() override
bool Create(void) override
static const QColor kColorYellow
static const QColor kColorMagenta
static const QColor kColorBlue
void DrawBackground(int x, int y)
void DrawPage(void)
static const QColor kColorGreen
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Screen in which all other widgets are contained and rendered.
bool KeyPress(const QString &key)
TeletextReader * m_teletextReader
static const QColor kColorBlack
void DrawHeader(const uint8_t *page, int lang)
void DrawMosaic(int x, int y, int code, bool doubleheight)
void DrawCharacter(int x, int y, QChar ch, bool doubleheight=false)