MythTV  master
teletextscreen.cpp
Go to the documentation of this file.
1 #include <QFontMetrics>
2 #include <QPainter>
3 
6 #include "libmythui/mythimage.h"
10 #include "libmythui/mythuitext.h"
11 
14 #include "vbilut.h"
15 
16 #define LOC QString("TeletextScreen: ")
17 
18 const QColor TeletextScreen::kColorBlack = QColor( 0, 0, 0,255);
19 const QColor TeletextScreen::kColorRed = QColor(255, 0, 0,255);
20 const QColor TeletextScreen::kColorGreen = QColor( 0,255, 0,255);
21 const QColor TeletextScreen::kColorYellow = QColor(255,255, 0,255);
22 const QColor TeletextScreen::kColorBlue = QColor( 0, 0,255,255);
23 const QColor TeletextScreen::kColorMagenta = QColor(255, 0,255,255);
24 const QColor TeletextScreen::kColorCyan = QColor( 0,255,255,255);
25 const QColor TeletextScreen::kColorWhite = QColor(255,255,255,255);
27 const int TeletextScreen::kTeletextRows = 26;
28 
30 static int gTTBackgroundAlpha;
31 
32 static QChar cvt_char(char ch, int lang)
33 {
34  for (int j = 0; j < 14; j++)
35  {
36  int c = ch & 0x7F;
37  if (c == lang_chars[0][j])
38  ch = lang_chars[lang + 1][j];
39  }
40  return QLatin1Char(ch);
41 }
42 
43 TeletextScreen::TeletextScreen(MythPlayer* Player, MythPainter *Painter, const QString& Name, int FontStretch)
44  : MythScreenType(static_cast<MythScreenType*>(nullptr), Name),
45  m_player(Player),
46  m_fontStretch(FontStretch)
47 {
48  m_painter = Painter;
49 }
50 
52 {
53  ClearScreen();
54 }
55 
57 {
58  if (m_player)
60  return m_player && m_teletextReader;
61 }
62 
64 {
66  for (const auto & img : std::as_const(m_rowImages))
67  delete img;
68  m_rowImages.clear();
69  SetRedraw();
70 }
71 
72 QImage* TeletextScreen::GetRowImage(int row, QRect &rect)
73 {
74  int y = row & ~1;
75  rect.translate(0, -(y * m_rowHeight));
76  if (!m_rowImages.contains(y))
77  {
78  auto* img = new QImage(m_safeArea.width(), m_rowHeight * 2,
79  QImage::Format_ARGB32);
80  if (img)
81  {
82  img->fill(0);
83  m_rowImages.insert(y, img);
84  }
85  else
86  return nullptr;
87  }
88  return m_rowImages.value(y);
89 }
90 
92 {
93  QHashIterator<int, QImage*> it(m_rowImages);
94  while (it.hasNext())
95  {
96  it.next();
98  if (!image || !it.value())
99  continue;
100 
101  int row = it.key();
102  image->Assign(*(it.value()));
103  auto *uiimage = new MythUIImage(this, QString("ttrow%1").arg(row));
104  if (uiimage)
105  {
106  uiimage->SetImage(image);
107  uiimage->SetArea(MythRect(0, row * m_rowHeight, m_safeArea.width(), m_rowHeight * 2));
108  }
109  image->DecrRef();
110  }
111 
112  QRegion visible;
113  QListIterator<MythUIType *> i(m_childrenList);
114  while (i.hasNext())
115  {
116  MythUIType *img = i.next();
117  visible = visible.united(img->GetArea());
118  }
119 
120  if (visible.isEmpty())
121  return;
122 
123  QRect bounding = visible.boundingRect();
124  bounding = bounding.translated(m_safeArea.topLeft());
125  bounding = m_safeArea.intersected(bounding);
126  int left = m_safeArea.left() - bounding.left();
127  int top = m_safeArea.top() - bounding.top();
128  SetArea(MythRect(bounding));
129 
130  i.toFront();;
131  while (i.hasNext())
132  {
133  MythUIType *img = i.next();
134  img->SetArea(MythRect(img->GetArea().translated(left, top)));
135  }
136 }
137 
139 {
140  if (!InitialiseFont() || !m_displaying)
141  return;
142 
143  if (m_player && m_player->GetVideoOutput())
144  {
145  static const float kTextPadding = 0.96F;
146  QRect oldsafe = m_safeArea;
148  m_colWidth = (int)((float)m_safeArea.width() / (float)kTeletextColumns);
149  m_rowHeight = (int)((float)m_safeArea.height() / (float)kTeletextRows);
150 
151  if (oldsafe != m_safeArea)
152  {
154 
155  int max_width = (int)((float)m_colWidth * kTextPadding);
156  m_fontHeight = (int)((float)m_rowHeight * kTextPadding);
157  if (max_width > (m_colWidth - 2))
158  max_width = m_colWidth -2;
159  if (m_fontHeight > (m_rowHeight - 2))
161  gTTFont->GetFace()->setPixelSize(m_fontHeight);
162 
163  m_fontStretch = 200;
164  bool ok = false;
165  while (!ok && m_fontStretch > 50)
166  {
167  gTTFont->GetFace()->setStretch(m_fontStretch);
168  QFontMetrics font(*(gTTFont->GetFace()));
169  if (font.averageCharWidth() <= max_width || m_fontStretch < 50)
170  ok = true;
171  else
172  m_fontStretch -= 10;
173  }
174  }
175  }
176  else
177  {
178  return;
179  }
180 
182  return;
183 
184  ClearScreen();
185 
186  const TeletextSubPage *ttpage = m_teletextReader->FindSubPage();
187 
188  if (!ttpage)
189  {
190  // no page selected so show the header and a list of available pages
191  DrawHeader({}, 0);
194  return;
195  }
196 
198 
199  int a = 0;
200  if ((ttpage->subtitle) ||
202  {
203  a = 1; // when showing subtitles we don't want to see the teletext
204  // header line, so we skip that line...
207  }
208  else
209  {
214  }
215 
216  for (int y = kTeletextRows - a; y >= 2; y--)
217  DrawLine(ttpage->data[y-1], y, ttpage->lang);
218 
221 }
222 
223 bool TeletextScreen::KeyPress(const QString& Key, bool& Exit)
224 {
225  if (m_teletextReader)
226  return m_teletextReader->KeyPress(Key, Exit);
227  return false;
228 }
229 
230 void TeletextScreen::SetPage(int page, int subpage)
231 {
232  if (m_teletextReader)
233  m_teletextReader->SetPage(page, subpage);
234 }
235 
237 {
238  m_displaying = display;
239  if (!m_displaying)
240  ClearScreen();
241 }
242 
244 {
245  if (m_teletextReader)
247 }
248 
249 void TeletextScreen::DrawHeader(const tt_line_array& page, int lang)
250 {
251  if (!m_displaying)
252  return;
253 
254  if (!page.empty())
255  DrawLine(page, 1, lang);
256 
257  DrawStatus();
258 }
259 
260 static QColor ttcolortoqcolor(int ttcolor)
261 {
262  QColor color;
263 
264  switch (ttcolor & ~kTTColorTransparent)
265  {
266  case kTTColorBlack: color = TeletextScreen::kColorBlack; break;
267  case kTTColorRed: color = TeletextScreen::kColorRed; break;
268  case kTTColorGreen: color = TeletextScreen::kColorGreen; break;
269  case kTTColorYellow: color = TeletextScreen::kColorYellow; break;
270  case kTTColorBlue: color = TeletextScreen::kColorBlue; break;
271  case kTTColorMagenta: color = TeletextScreen::kColorMagenta; break;
272  case kTTColorCyan: color = TeletextScreen::kColorCyan; break;
273  case kTTColorWhite: color = TeletextScreen::kColorWhite; break;
274  }
275 
276  return color;
277 }
278 
279 static QString TTColorToString(int ttcolor)
280 {
281  switch (ttcolor & ~kTTColorTransparent)
282  {
283  case kTTColorBlack: return "Black";
284  case kTTColorRed: return "Red";
285  case kTTColorGreen: return "Green";
286  case kTTColorYellow: return "Yellow";
287  case kTTColorBlue: return "Blue";
288  case kTTColorMagenta: return "Magenta";
289  case kTTColorCyan: return "Cyan";
290  case kTTColorWhite: return "White";
291  default: return "Unknown";
292  }
293 }
294 
296 {
297  LOG(VB_VBI, LOG_DEBUG, QString("SetForegroundColor(%1)")
298  .arg(TTColorToString(ttcolor)));
299 
300  gTTFont->SetColor(ttcolortoqcolor(ttcolor));
301 }
302 
304 {
305  LOG(VB_VBI, LOG_DEBUG, QString("SetBackgroundColor(%1)")
306  .arg(TTColorToString(ttcolor)));
307 
308  m_bgColor = ttcolortoqcolor(ttcolor);
309  m_bgColor.setAlpha((ttcolor & kTTColorTransparent) ?
310  0x00 : gTTBackgroundAlpha);
311 }
312 
313 void TeletextScreen::DrawLine(const tt_line_array& page, uint row, int lang)
314 {
315  unsigned char last_ch = ' ';
316 
317  uint fgcolor = kTTColorWhite;
318  uint bgcolor = kTTColorBlack;
319 
321  {
322  bgcolor = kTTColorTransparent;
323 
324  bool isBlank = true;
325  for (uint i = (row == 1 ? 8 : 0); i < (uint) kTeletextColumns; i++)
326  {
327  unsigned char ch = page[i] & 0x7F;
328  if (ch != ' ')
329  {
330  isBlank = false;
331  break;
332  }
333  }
334 
335  if (isBlank)
336  return;
337  }
338 
339  SetForegroundColor(fgcolor);
340  SetBackgroundColor(bgcolor);
341 
342  bool mosaic = false;
343  [[maybe_unused]] bool seperation = false;
344  bool conceal = false;
345  [[maybe_unused]] bool flash = false;
346  bool doubleheight = false;
347  [[maybe_unused]] bool blink = false;
348  bool hold = false;
349  bool endbox = false;
350  bool startbox = false;
351  bool withinbox = false;
352  uint flof_link_count = 0;
353  uint old_bgcolor = bgcolor;
354 
355  if (row == 1)
356  {
357  for (uint x = 0; x < 8; x++)
358  DrawBackground(x, 1);
359  }
360 
361  for (uint x = (row == 1 ? 8 : 0); x < (uint)kTeletextColumns; ++x)
362  {
363  if (startbox)
364  {
365  old_bgcolor = bgcolor;
366  if (kTTColorTransparent & bgcolor)
367  bgcolor = bgcolor & ~kTTColorTransparent;
368  startbox = false;
369  withinbox = true;
370  }
371 
372  if (endbox)
373  {
374  bgcolor = old_bgcolor;
375  endbox = false;
376  withinbox = false;
377  }
378 
379  SetForegroundColor(fgcolor);
380  SetBackgroundColor(bgcolor);
381 
382  unsigned char ch = page[x] & 0x7F;
383  switch (ch)
384  {
385  case 0x00: case 0x01: case 0x02: case 0x03:
386  case 0x04: case 0x05: case 0x06: case 0x07: // alpha + foreground color
387  fgcolor = ch & 7;
388  mosaic = false;
389  conceal = false;
390  // increment FLOF/FastText count if menu item detected
391  flof_link_count += (row == 25) ? 1 : 0;
392  goto ctrl;
393  case 0x08: // flash
394  // XXX
395  goto ctrl;
396  case 0x09: // steady
397  flash = false;
398  goto ctrl;
399  case 0x0a: // end box
400  endbox = true;
401  goto ctrl;
402  case 0x0b: // start box
403  if (x < kTeletextColumns - 1 && ((page[x + 1] & 0x7F) == 0x0b))
404  startbox = true;
405  goto ctrl;
406  case 0x0c: // normal height
407  doubleheight = false;
408  goto ctrl;
409  case 0x0d: // double height
410  doubleheight = (row < (kTeletextRows-1)) && (x < (kTeletextColumns - 1));
411  goto ctrl;
412 
413  case 0x10: case 0x11: case 0x12: case 0x13:
414  case 0x14: case 0x15: case 0x16: case 0x17: // graphics + foreground color
415  fgcolor = ch & 7;
416  mosaic = true;
417  conceal = false;
418  goto ctrl;
419  case 0x18: // conceal display
420  conceal = true;
421  goto ctrl;
422  case 0x19: // contiguous graphics
423  seperation = false;
424  goto ctrl;
425  case 0x1a: // separate graphics
426  seperation = true;
427  goto ctrl;
428  case 0x1c: // black background
429  bgcolor = kTTColorBlack;
430  goto ctrl;
431  case 0x1d: // new background
432  bgcolor = fgcolor;
433  goto ctrl;
434  case 0x1e: // hold graphics
435  hold = true;
436  goto ctrl;
437  case 0x1f: // release graphics
438  hold = false;
439  goto ctrl;
440  case 0x0e: // SO (reserved, double width)
441  case 0x0f: // SI (reserved, double size)
442  case 0x1b: // ESC (reserved)
443  ch = ' ';
444  break;
445  ctrl:
446  ch = ' ';
447  if (hold && mosaic)
448  ch = last_ch;
449  break;
450 
451  default:
452  if ((ch >= 0x80) && (ch <=0x9f)) // these aren't used
453  ch = ' '; // BAD_CHAR;
454  else
455  {
456  if (conceal && !m_teletextReader->RevealHidden())
457  ch = ' ';
458  }
459  break;
460  }
461 
462  // Hide FastText/FLOF menu characters if not available
463  if (flof_link_count && (flof_link_count <= 6))
464  {
465  const TeletextSubPage *ttpage = m_teletextReader->FindSubPage();
466 
467  if (ttpage)
468  {
469  bool has_flof = ttpage->floflink[flof_link_count - 1] != 0;
470  ch = (has_flof) ? ch : ' ';
471  }
472  }
473 
474  uint newfgcolor = fgcolor;
475  uint newbgcolor = bgcolor;
476 
477  SetForegroundColor(newfgcolor);
478  SetBackgroundColor(newbgcolor);
479  if ((row != 0) || (x > 7))
480  {
483 
484  if (withinbox || !m_teletextReader->IsSubtitle())
485  {
486  DrawBackground(x, row);
487  if (doubleheight && row < (uint)kTeletextRows)
488  DrawBackground(x, row + 1);
489 
490  if ((mosaic) && (ch < 0x40 || ch > 0x5F))
491  {
492  SetBackgroundColor(newfgcolor);
493  DrawMosaic(x, row, ch, doubleheight);
494  }
495  else
496  {
497  QChar c2 = cvt_char(ch, lang);
498  DrawCharacter(x, row, c2, doubleheight);
499  }
500  }
501  }
502  }
503 }
504 
505 void TeletextScreen::DrawCharacter(int x, int y, QChar ch, bool doubleheight)
506 {
507  QString line = ch;
508  if (line == " ")
509  return;
510 
511  int row = y;
512  x *= m_colWidth;
513  y *= m_rowHeight;
514  int height = m_rowHeight * (doubleheight ? 2 : 1);
515  QRect rect(x, y, m_colWidth, height);
516 
517  if (doubleheight)
518  {
519  gTTFont->GetFace()->setPixelSize(m_fontHeight * 2);
520  gTTFont->GetFace()->setStretch(m_fontStretch / 2);
521  }
522 
523  QImage* image = GetRowImage(row, rect);
524  if (image)
525  {
526  QPainter painter(image);
527  painter.setFont(gTTFont->face());
528  painter.setPen(gTTFont->color());
529  painter.drawText(rect, Qt::AlignCenter, line);
530  painter.end();
531  }
532 
533  if (row & 1)
534  {
535  row++;
536  rect = QRect(x, y + m_rowHeight, m_colWidth, height);
537  rect.translate(0, -m_rowHeight);
538  image = GetRowImage(row, rect);
539  if (image)
540  {
541  QPainter painter(image);
542  painter.setFont(gTTFont->face());
543  painter.setPen(gTTFont->color());
544  painter.drawText(rect, Qt::AlignCenter, line);
545  painter.end();
546  }
547  }
548 
549  if (doubleheight)
550  {
551  gTTFont->GetFace()->setPixelSize(m_fontHeight);
552  gTTFont->GetFace()->setStretch(m_fontStretch);
553  }
554 }
555 
557 {
558  int row = y;
559  x *= m_colWidth;
560  y *= m_rowHeight;
561  DrawRect(row, QRect(x, y, m_colWidth, m_rowHeight));
562 }
563 
564 void TeletextScreen::DrawRect(int row, QRect rect)
565 {
566  QImage* image = GetRowImage(row, rect);
567  if (!image)
568  return;
569 
570  QBrush bgfill = QBrush(m_bgColor, Qt::SolidPattern);
571  QPainter painter(image);
572  painter.setBrush(bgfill);
573  painter.setPen(QPen(Qt::NoPen));
574  painter.drawRect(rect);
575  painter.end();
576 }
577 
578 void TeletextScreen::DrawMosaic(int x, int y, int code, bool doubleheight)
579 {
580  int row = y;
581  x *= m_colWidth;
582  y *= m_rowHeight;
583 
584  int dx = (int)round((double)m_colWidth / 2) + 1;
585  int dy = (int)round((double)m_rowHeight / 3) + 1;
586  dy = (doubleheight) ? (2 * dy) : dy;
587 
588  if (code & 0x10)
589  DrawRect(row, QRect(x, y + 2*dy, dx, dy));
590  if (code & 0x40)
591  DrawRect(row, QRect(x + dx, y + 2*dy, dx, dy));
592  if (code & 0x01)
593  DrawRect(row, QRect(x, y, dx, dy));
594  if (code & 0x02)
595  DrawRect(row, QRect(x + dx, y, dx, dy));
596  if (code & 0x04)
597  DrawRect(row, QRect(x, y + dy, dx, dy));
598  if (code & 0x08)
599  DrawRect(row, QRect(x + dx, y + dy, dx, dy));
600 }
601 
603 {
606 
608  for (int i = 0; i < 40; ++i)
609  DrawBackground(i, 0);
610 
611  DrawCharacter(1, 0, 'P', false);
612  DrawCharacter(2, 0, QChar(m_teletextReader->GetPageInput(0)), false);
613  DrawCharacter(3, 0, QChar(m_teletextReader->GetPageInput(1)), false);
614  DrawCharacter(4, 0, QChar(m_teletextReader->GetPageInput(2)), false);
615 
616  const TeletextSubPage *ttpage = m_teletextReader->FindSubPage();
617 
618  if (!ttpage)
619  {
620  QString str = QObject::tr("Page Not Available",
621  "Requested Teletext page not available");
622  for (int i = 0; (i < 30) && i < str.length(); i++)
623  DrawCharacter(i+10, 0, str[i], false);
624 
625  return;
626  }
627 
628  QString str = m_teletextReader->GetPage();
629  if (str.isEmpty())
630  return;
631 
633  for (int x = 0; x < 11; x++)
634  {
637  else
639 
640  DrawBackground(x * 3 + 7, 0);
641 
642  if (str[x * 3] == '*')
643  {
644  str[x * 3] = ' ';
646  }
647 
648  DrawBackground(x * 3 + 8, 0);
649  DrawBackground(x * 3 + 9, 0);
650 
651  DrawCharacter(x * 3 + 7, 0, str[x * 3], false);
652  DrawCharacter(x * 3 + 8, 0, str[x * 3 + 1], false);
653  DrawCharacter(x * 3 + 9, 0, str[x * 3 + 2], false);
654  }
655 }
656 
658 {
659  static bool s_initialised = false;
660  //QString font = gCoreContext->GetSetting("DefaultSubtitleFont", "FreeMono");
661  if (s_initialised)
662  {
663  return true;
664 #if 0
665  if (gTTFont->face().family() == font)
666  return true;
667  delete gTTFont;
668 #endif // 0
669  }
670 
671  auto *mythfont = new MythFontProperties();
672  QString font = SubtitleScreen::GetTeletextFontName();
673  if (mythfont)
674  {
675  QFont newfont(font);
676  mythfont->SetFace(newfont);
677  gTTFont = mythfont;
678  }
679  else
680  return false;
681 
683 
684  s_initialised = true;
685  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Loaded main subtitle font '%1'")
686  .arg(font));
687  return true;
688 }
MythPlayer::GetTeletextReader
virtual TeletextReader * GetTeletextReader(uint=0)
Definition: mythplayer.h:198
TeletextSubPage::lang
int lang
language code
Definition: teletextreader.h:43
kTTColorRed
@ kTTColorRed
Definition: teletextreader.h:17
TeletextScreen::m_fontHeight
int m_fontHeight
Definition: teletextscreen.h:54
TeletextReader::GetPage
QString GetPage(void)
Definition: teletextreader.cpp:194
TeletextReader::SetHeaderChanged
void SetHeaderChanged(bool changed)
Definition: teletextreader.h:90
LOC
#define LOC
Definition: teletextscreen.cpp:16
TeletextScreen::SetDisplaying
void SetDisplaying(bool display)
Definition: teletextscreen.cpp:236
TeletextReader::IsSubtitle
bool IsSubtitle(void) const
Definition: teletextreader.h:91
MythPlayer::GetVideoOutput
MythVideoOutput * GetVideoOutput(void)
Definition: mythplayer.h:166
mythuitext.h
TeletextReader::IsTransparent
bool IsTransparent(void) const
Definition: teletextreader.h:93
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
TeletextScreen::DrawCharacter
void DrawCharacter(int x, int y, QChar ch, bool doubleheight=false)
Definition: teletextscreen.cpp:505
TeletextScreen::KeyPress
bool KeyPress(const QString &Key, bool &Exit)
Definition: teletextscreen.cpp:223
TeletextSubPage::flags
int flags
misc flags
Definition: teletextreader.h:44
kTTColorTransparent
@ kTTColorTransparent
Definition: teletextreader.h:24
TeletextSubPage::floflink
std::array< int, 6 > floflink
FastText links (FLOF)
Definition: teletextreader.h:47
TeletextScreen::kColorWhite
static const QColor kColorWhite
Definition: teletextscreen.h:64
TeletextScreen::m_fontStretch
int m_fontStretch
Definition: teletextscreen.h:53
SubtitleScreen::GetTeletextBackgroundAlpha
static int GetTeletextBackgroundAlpha(void)
Definition: subtitlescreen.cpp:1707
TeletextScreen::SetPage
void SetPage(int page, int subpage)
Definition: teletextscreen.cpp:230
TeletextScreen::DrawStatus
void DrawStatus()
Definition: teletextscreen.cpp:602
teletextscreen.h
gTTBackgroundAlpha
static int gTTBackgroundAlpha
Definition: teletextscreen.cpp:30
TeletextScreen::kTeletextColumns
static const int kTeletextColumns
Definition: teletextscreen.h:66
TeletextScreen::DrawMosaic
void DrawMosaic(int x, int y, int code, bool doubleheight)
Definition: teletextscreen.cpp:578
MythPainter::GetFormatImage
MythImage * GetFormatImage()
Returns a blank reference counted image in the format required for the Draw functions for this painte...
Definition: mythpainter.cpp:528
TeletextScreen::ClearScreen
void ClearScreen()
Definition: teletextscreen.cpp:63
TeletextScreen::Pulse
void Pulse() override
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: teletextscreen.cpp:138
TeletextScreen::kColorRed
static const QColor kColorRed
Definition: teletextscreen.h:58
kTTColorBlack
@ kTTColorBlack
Definition: teletextreader.h:16
lang_chars
const std::array< const std::array< const uint8_t, 16 >, 1+8+8 > lang_chars
Definition: vbilut.cpp:4
MythFontProperties::GetFace
QFont * GetFace(void)
Definition: mythfontproperties.h:18
TeletextScreen::kTeletextRows
static const int kTeletextRows
Definition: teletextscreen.h:67
TeletextSubPage::subtitle
bool subtitle
page is subtitle page
Definition: teletextreader.h:48
TeletextScreen::m_displaying
bool m_displaying
Definition: teletextscreen.h:51
MythFontProperties::face
QFont face(void) const
Definition: mythfontproperties.cpp:40
TeletextSubPage
Definition: teletextreader.h:38
MythUIType::SetArea
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:609
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythFontProperties::SetColor
void SetColor(const QColor &color)
Definition: mythfontproperties.cpp:49
MythPlayer
Definition: mythplayer.h:83
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
kTTColorGreen
@ kTTColorGreen
Definition: teletextreader.h:18
mythuiimage.h
MythUIType::DeleteAllChildren
void DeleteAllChildren(void)
Delete all child widgets.
Definition: mythuitype.cpp:217
TeletextScreen::SetBackgroundColor
void SetBackgroundColor(int color)
Definition: teletextscreen.cpp:303
TeletextScreen::m_rowImages
QHash< int, QImage * > m_rowImages
Definition: teletextscreen.h:52
TeletextScreen::m_bgColor
QColor m_bgColor
Definition: teletextscreen.h:50
MythUIType::GetArea
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Definition: mythuitype.cpp:884
TeletextScreen::m_player
MythPlayer * m_player
Definition: teletextscreen.h:45
TTColorToString
static QString TTColorToString(int ttcolor)
Definition: teletextscreen.cpp:279
TeletextScreen::m_rowHeight
int m_rowHeight
Definition: teletextscreen.h:49
mythfontproperties.h
TP_NEWSFLASH
static constexpr uint8_t TP_NEWSFLASH
Definition: teletextreader.h:33
mythlogging.h
vbilut.h
subtitlescreen.h
TeletextScreen::kColorCyan
static const QColor kColorCyan
Definition: teletextscreen.h:63
kTTColorWhite
@ kTTColorWhite
Definition: teletextreader.h:23
TeletextReader::PageChanged
bool PageChanged(void) const
Definition: teletextreader.h:87
SubtitleScreen::GetTeletextFontName
static QString GetTeletextFontName(void)
Definition: subtitlescreen.cpp:1697
TeletextReader::SetShowHeader
void SetShowHeader(bool show)
Definition: teletextreader.h:89
MythFontProperties
Definition: mythfontproperties.h:13
kTTColorMagenta
@ kTTColorMagenta
Definition: teletextreader.h:21
TeletextScreen::SetForegroundColor
static void SetForegroundColor(int color)
Definition: teletextscreen.cpp:295
TeletextScreen::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: teletextscreen.cpp:243
tt_line_array
std::array< uint8_t, 40 > tt_line_array
Definition: teletextreader.h:36
TeletextReader::SetPage
void SetPage(int page, int subpage)
Definition: teletextreader.cpp:253
TeletextScreen::~TeletextScreen
~TeletextScreen() override
Definition: teletextscreen.cpp:51
MythFontProperties::color
QColor color(void) const
Definition: mythfontproperties.h:26
TeletextScreen::OptimiseDisplayedArea
void OptimiseDisplayedArea()
Definition: teletextscreen.cpp:91
MythImage::DecrRef
int DecrRef(void) override
Decrements reference count and deletes on 0.
Definition: mythimage.cpp:52
TeletextScreen::m_colWidth
int m_colWidth
Definition: teletextscreen.h:48
MythUIType::m_childrenList
QList< MythUIType * > m_childrenList
Definition: mythuitype.h:253
TeletextReader::RevealHidden
bool RevealHidden(void) const
Definition: teletextreader.h:94
mythpainter.h
TeletextScreen::DrawHeader
void DrawHeader(const tt_line_array &page, int lang)
Definition: teletextscreen.cpp:249
TeletextScreen::m_safeArea
QRect m_safeArea
Definition: teletextscreen.h:47
uint
unsigned int uint
Definition: compat.h:81
kTTColorYellow
@ kTTColorYellow
Definition: teletextreader.h:19
TeletextReader::SetIsSubtitle
void SetIsSubtitle(bool sub)
Definition: teletextreader.h:92
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
ttcolortoqcolor
static QColor ttcolortoqcolor(int ttcolor)
Definition: teletextscreen.cpp:260
mythimage.h
TeletextReader::KeyPress
bool KeyPress(const QString &Key, bool &Exit)
Definition: teletextreader.cpp:25
TeletextReader::SetPageChanged
void SetPageChanged(bool changed)
Definition: teletextreader.h:88
gTTFont
static MythFontProperties * gTTFont
Definition: teletextscreen.cpp:29
MythPainter
Definition: mythpainter.h:34
MythImage
Definition: mythimage.h:36
Name
Definition: channelsettings.cpp:71
TeletextScreen::kColorGreen
static const QColor kColorGreen
Definition: teletextscreen.h:59
cvt_char
static QChar cvt_char(char ch, int lang)
Definition: teletextscreen.cpp:32
TP_SUPPRESS_HEADER
static constexpr uint8_t TP_SUPPRESS_HEADER
Definition: teletextreader.h:27
TeletextScreen::DrawRect
void DrawRect(int row, QRect rect)
Definition: teletextscreen.cpp:564
kTTColorCyan
@ kTTColorCyan
Definition: teletextreader.h:22
MythVideoOutput::GetSafeRect
QRect GetSafeRect()
Returns a QRect describing an area of the screen on which it is 'safe' to render the On Screen Displa...
Definition: mythvideoout.cpp:376
TeletextReader::FindSubPage
TeletextSubPage * FindSubPage(void)
Definition: teletextreader.h:96
MythUIType::m_painter
MythPainter * m_painter
Definition: mythuitype.h:295
TeletextScreen::DrawBackground
void DrawBackground(int x, int y)
Definition: teletextscreen.cpp:556
TeletextScreen::kColorBlue
static const QColor kColorBlue
Definition: teletextscreen.h:61
TP_SUBTITLE
static constexpr uint8_t TP_SUBTITLE
Definition: teletextreader.h:34
TeletextScreen::kColorMagenta
static const QColor kColorMagenta
Definition: teletextscreen.h:62
TeletextScreen::InitialiseFont
static bool InitialiseFont()
Definition: teletextscreen.cpp:657
TeletextReader::Reset
void Reset(void)
Definition: teletextreader.cpp:267
TeletextScreen::TeletextScreen
TeletextScreen(MythPlayer *Player, MythPainter *Painter, const QString &Name, int FontStretch)
Definition: teletextscreen.cpp:43
TeletextSubPage::subpagenum
int subpagenum
the wanted subpage
Definition: teletextreader.h:42
TeletextScreen::m_teletextReader
TeletextReader * m_teletextReader
Definition: teletextscreen.h:46
TeletextScreen::GetRowImage
QImage * GetRowImage(int row, QRect &rect)
Definition: teletextscreen.cpp:72
Player
Definition: zmliveplayer.h:34
MythImage::Assign
void Assign(const QImage &img)
Definition: mythimage.cpp:77
kTTColorBlue
@ kTTColorBlue
Definition: teletextreader.h:20
TeletextReader::SetSubPage
void SetSubPage(int subpage)
Definition: teletextreader.h:86
TeletextScreen::DrawLine
void DrawLine(const tt_line_array &page, uint row, int lang)
Definition: teletextscreen.cpp:313
TeletextScreen::kColorBlack
static const QColor kColorBlack
Definition: teletextscreen.h:57
TeletextScreen::kColorYellow
static const QColor kColorYellow
Definition: teletextscreen.h:60
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:308
mythuishape.h
TeletextScreen::Create
bool Create() override
Definition: teletextscreen.cpp:56
TeletextReader::GetPageInput
int GetPageInput(uint num) const
Definition: teletextreader.h:95
TeletextReader::GetHeader
tt_line_array GetHeader(void)
Definition: teletextreader.h:98
TeletextSubPage::data
std::array< tt_line_array, 25 > data
page data
Definition: teletextreader.h:45