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"
7 #include "teletextreader.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  virtual ~TeletextScreen();
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  void SetForegroundColor(int color);
33  void SetBackgroundColor(int color);
34  void DrawBackground(int x, int y);
35  void DrawRect(int row, const QRect);
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
void DrawRect(int row, const QRect)
static const int kTeletextColumns
static const QColor kColorTransp
void SetForegroundColor(int color)
TeletextScreen(MythPlayer *player, const char *name, int fontStretch)
void SetDisplaying(bool display)
virtual ~TeletextScreen()
unsigned int uint
Definition: compat.h:140
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
void SetPage(int page, int subpage)
const char * name
Definition: ParseText.cpp:328
static const QColor kColorCyan
void DrawStatus(void)
static bool InitialiseFont(void)
static const QColor kColorWhite
QImage * GetRowImage(int row, QRect &rect)
void ClearScreen(void)
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)