00001 #ifndef TELETEXTSCREEN_H
00002 #define TELETEXTSCREEN_H
00003
00004 #include <QFont>
00005
00006 #include "mythscreentype.h"
00007 #include "teletextreader.h"
00008 #include "mythplayer.h"
00009
00010 class TeletextScreen: public MythScreenType
00011 {
00012 static bool InitialiseFont(void);
00013
00014 public:
00015 TeletextScreen(MythPlayer *player, const char * name, int fontStretch);
00016 virtual ~TeletextScreen();
00017
00018
00019 virtual bool Create(void);
00020 virtual void Pulse(void);
00021
00022
00023 bool KeyPress(const QString &key);
00024 void SetPage(int page, int subpage);
00025 void SetDisplaying(bool display);
00026 void Reset(void);
00027 void ClearScreen(void);
00028
00029 private:
00030 void OptimiseDisplayedArea(void);
00031 QImage* GetRowImage(int row, QRect &rect);
00032 void SetForegroundColor(int color);
00033 void SetBackgroundColor(int color);
00034 void DrawBackground(int x, int y);
00035 void DrawRect(int row, const QRect);
00036 void DrawCharacter(int x, int y, QChar ch, int doubleheight = 0);
00037 void DrawMosaic(int x, int y, int code, int doubleheight);
00038 void DrawLine(const uint8_t *page, uint row, int lang);
00039 void DrawHeader(const uint8_t *page, int lang);
00040 void DrawStatus(void);
00041 void DrawPage(void);
00042
00043 MythPlayer *m_player;
00044 TeletextReader *m_teletextReader;
00045 QRect m_safeArea;
00046 int m_colWidth;
00047 int m_rowHeight;
00048 QColor m_bgColor;
00049 bool m_displaying;
00050 QHash<int, QImage*> m_rowImages;
00051 int m_fontStretch;
00052 int m_fontHeight;
00053
00054 public:
00055 static const QColor kColorBlack;
00056 static const QColor kColorRed;
00057 static const QColor kColorGreen;
00058 static const QColor kColorYellow;
00059 static const QColor kColorBlue;
00060 static const QColor kColorMagenta;
00061 static const QColor kColorCyan;
00062 static const QColor kColorWhite;
00063 static const QColor kColorTransp;
00064 static const int kTeletextColumns;
00065 static const int kTeletextRows;
00066 };
00067
00068 #endif // TELETEXTSCREEN_H