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