MythTV  master
mythuiguidegrid.cpp
Go to the documentation of this file.
1 
2 #include "mythuiguidegrid.h"
3 
4 // ANSI C headers
5 #include <cmath>
6 
7 // C++ headers
8 #include <algorithm>
9 
10 // Qt headers
11 #include <QFile>
12 #include <QDomElement>
13 
14 // myth
15 #include "libmythbase/mythdb.h"
17 
18 #include "mythfontproperties.h"
19 #include "mythuihelper.h"
20 #include "x11colors.h"
21 #include "mythimage.h"
22 #include "mythuitype.h"
23 #include "mythuiimage.h"
24 #include "mythmainwindow.h"
25 
26 #define LOC QString("MythUIGuideGrid: ")
27 
28 MythUIGuideGrid::MythUIGuideGrid(MythUIType *parent, const QString &name)
29  : MythUIType(parent, name)
30 {
31  m_font = new MythFontProperties();
32 
33  QMap<QString, QString> catColors;
34  parseDefaultCategoryColors(catColors);
35  SetCategoryColors(catColors);
36 }
37 
39 {
41 
42  m_allData = new QList<UIGTCon *>[m_rowCount];
43 
45 }
46 
48 {
49  for (int i = 0; i < m_rowCount; i++)
50  ResetRow(i);
51 
52  delete [] m_allData;
53 
54  delete m_font;
55  m_font = nullptr;
56 
57  // The m_recImages and m_arrowImages images are now children of
58  // the MythGuiGuideGrid widget and should be automatically deleted
59  // when it is deleted.
60 }
61 
63  const QString &filename, QDomElement &element, bool showWarnings)
64 {
65  if (element.tagName() == "layout")
66  {
67  QString layout = getFirstText(element).toLower();
68  m_verticalLayout = (layout == "vertical");
69  }
70  else if (element.tagName() == "channels")
71  {
72  m_channelCount = getFirstText(element).toInt();
73  m_channelCount = std::max(m_channelCount, 1);
75  }
76  else if (element.tagName() == "timeslots")
77  {
78  m_timeCount = getFirstText(element).toInt();
79  m_timeCount = std::max(m_timeCount, 1);
80  m_timeCount = std::min(m_timeCount, MAX_DISPLAY_TIMES / 6);
81  }
82  else if (element.tagName() == "solidcolor")
83  {
84  QString color = getFirstText(element);
85  m_solidColor = QColor(color);
86  }
87  else if (element.tagName() == "selector")
88  {
89  m_selType = element.attribute("type");
90  QString lineColor = element.attribute("linecolor", "");
91  QString fillColor = element.attribute("fillcolor", "");
92 
93  if (!lineColor.isEmpty())
94  {
95  m_drawSelLine = QPen(QColor(lineColor));
96  m_drawSelLine.setWidth(2);
97  }
98  else
99  {
100  m_drawSelLine = QPen(Qt::NoPen);
101  }
102 
103  if (!fillColor.isEmpty())
104  {
105  m_drawSelFill = QBrush(QColor(fillColor));
106  }
107  else
108  {
109  m_drawSelFill = QBrush(Qt::NoBrush);
110  }
111  }
112  else if (element.tagName() == "recordingcolor")
113  {
114  QString color = getFirstText(element);
115  m_recordingColor = QColor(color);
116  }
117  else if (element.tagName() == "conflictingcolor")
118  {
119  QString color = getFirstText(element);
120  m_conflictingColor = QColor(color);
121  }
122  else if (element.tagName() == "categoryalpha")
123  {
124  m_categoryAlpha = getFirstText(element).toInt();
125  m_categoryAlpha = std::max(m_categoryAlpha, 1);
126  m_categoryAlpha = std::min(m_categoryAlpha, 255);
127  }
128  else if (element.tagName() == "showcategories")
129  {
130  m_drawCategoryText = parseBool(element);
131  }
132  else if (element.tagName() == "showcategorycolors")
133  {
134  m_drawCategoryColors = parseBool(element);
135  }
136  else if (element.tagName() == "cutdown")
137  {
138  m_cutdown = parseBool(element);
139  }
140  else if (element.tagName() == "multiline")
141  {
142  SetMultiLine(parseBool(element));
143  }
144  else if (element.tagName() == "textoffset")
145  {
146  m_textOffset = parsePoint(element);
147  }
148  else if (element.tagName() == "font")
149  {
150  QString fontname = getFirstText(element);
151  MythFontProperties *font = GetFont(fontname);
152 
153  if (!font)
154  font = GetGlobalFontMap()->GetFont(fontname);
155 
156  if (font)
157  {
158  MythFontProperties fontcopy = *font;
159  MythMainWindow* window = GetMythMainWindow();
160  fontcopy.Rescale(window->GetUIScreenRect().height());
161  fontcopy.AdjustStretch(window->GetFontStretch());
162  *m_font = fontcopy;
163  }
164  else
165  {
166  LOG(VB_GENERAL, LOG_ERR, LOC + "Unknown font: " + fontname);
167  }
168  }
169  else if (element.tagName() == "recordstatus")
170  {
171  int inttype = 0;
172  QString typ = element.attribute("type");
173  QString img = element.attribute("image");
174 
175  if (typ == "SingleRecord")
176  inttype = 1;
177  else if (typ == "TimeslotRecord")
178  inttype = 2;
179  else if (typ == "ChannelRecord")
180  inttype = 3;
181  else if (typ == "AllRecord")
182  inttype = 4;
183  else if (typ == "WeekslotRecord")
184  inttype = 5;
185  else if (typ == "FindOneRecord")
186  inttype = 6;
187  else if (typ == "OverrideRecord")
188  inttype = 7;
189 
190  LoadImage(inttype, img);
191  }
192  else if (element.tagName() == "arrow")
193  {
194  QString dir = element.attribute("direction");
195  QString image = element.attribute("image");
196 
197  if (dir == "left")
198  SetArrow(0, image);
199  else if (dir == "right")
200  SetArrow(1, image);
201  else if (dir == "up")
202  SetArrow(2, image);
203  else if (dir == "down")
204  SetArrow(3, image);
205  }
206  else
207  {
208  return MythUIType::ParseElement(filename, element, showWarnings);
209  }
210 
211  return true;
212 }
213 
215 {
216  auto *gg = dynamic_cast<MythUIGuideGrid *>(base);
217 
218  if (!gg)
219  {
220  LOG(VB_GENERAL, LOG_ERR, LOC + "bad parsing");
221  return;
222  }
223 
224  m_channelCount = gg->m_channelCount;
225  m_timeCount = gg->m_timeCount;
226  m_verticalLayout = gg->m_verticalLayout;
227  m_categoryAlpha = gg->m_categoryAlpha;
228  m_textOffset = gg->m_textOffset;
229  m_justification = gg->m_justification;
230  m_multilineText = gg->m_multilineText;
231  *m_font = *gg->m_font;
232  m_solidColor = gg->m_solidColor;
233 
234  m_selType = gg->m_selType;
235  m_drawSelLine = gg->m_drawSelLine;
236  m_drawSelFill = gg->m_drawSelFill;
237 
238  m_recordingColor = gg->m_recordingColor;
239  m_conflictingColor = gg->m_conflictingColor;
240 
241  m_fillType = gg->m_fillType;
242  m_cutdown = gg->m_cutdown;
243  m_drawCategoryColors = gg->m_drawCategoryColors;
244  m_drawCategoryText = gg->m_drawCategoryText;
245 
246  MythUIType::CopyFrom(base);
247 }
248 
250 {
251  auto *gg = new MythUIGuideGrid(parent, objectName());
252  gg->CopyFrom(this);
253 }
254 
255 QColor MythUIGuideGrid::calcColor(const QColor &color, int alphaMod)
256 {
257  QColor newColor(color);
258  newColor.setAlpha((int)(color.alpha() *(alphaMod / 255.0)));
259  return newColor;
260 }
261 
286 void MythUIGuideGrid::DrawSelf(MythPainter *p, int xoffset, int yoffset,
287  int alphaMod, QRect clipRect)
288 {
289  p->SetClipRect(clipRect);
290  for (int i = 0; i < m_rowCount; i++)
291  {
292  for (auto *data : std::as_const(m_allData[i]))
293  {
294  if (data->m_recStat == 0)
295  drawBackground(p, xoffset, yoffset, data, alphaMod);
296  else if (data->m_recStat == 1)
297  drawBox(p, xoffset, yoffset, data, m_recordingColor, alphaMod);
298  else
299  drawBox(p, xoffset, yoffset, data, m_conflictingColor, alphaMod);
300  drawText(p, xoffset, yoffset, data, alphaMod);
301  }
302  }
303 
304  drawCurrent(p, xoffset, yoffset, &m_selectedItem, alphaMod);
305  // Redraw the current selection's text in case it was clobbered by the above call.
306  drawText(p, xoffset, yoffset, &m_selectedItem, alphaMod);
307 
308  for (int i = 0; i < m_rowCount; i++)
309  {
310  for (auto *data : std::as_const(m_allData[i]))
311  {
312  drawRecDecoration(p, xoffset, yoffset, data, alphaMod);
313  }
314  }
315 }
316 
335 void MythUIGuideGrid::drawCurrent(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
336 {
337  int breakin = 2;
338  QRect area = data->m_drawArea;
339  area.translate(m_area.x(), m_area.y()); // Adjust within parent
340  area.translate(xoffset, yoffset); // Convert to global coordinates
341  area.adjust(breakin, breakin, -breakin, -breakin);
342  int status = data->m_recStat;
343 
344  if (m_selType == "roundbox")
345  {
346  QPen pen = m_drawSelLine;
347 
348  if (status == 1)
349  pen.setColor(m_recordingColor);
350  else if (status == 2)
351  pen.setColor(m_conflictingColor);
352 
353  p->DrawRoundRect(area, 10, m_drawSelFill, pen, alphaMod);
354  }
355  else if (m_selType == "highlight")
356  {
357  QBrush brush = m_drawSelFill;
358  QPen pen = m_drawSelLine;
359 
360  if (m_drawCategoryColors && data->m_categoryColor.isValid())
361  brush.setColor(calcColor(data->m_categoryColor, m_categoryAlpha));
362  else
363  brush.setColor(calcColor(m_solidColor, m_categoryAlpha));
364 
365  if (status == 1)
366  pen.setColor(m_recordingColor);
367  else if (status == 2)
368  pen.setColor(m_conflictingColor);
369 
370  brush.setColor(brush.color().lighter());
371  p->DrawRect(area, brush, pen, alphaMod);
372  }
373  else
374  {
375  // default to "box" selection type
376  QPen pen = m_drawSelLine;
377 
378  if (status == 1)
379  pen.setColor(m_recordingColor);
380  else if (status == 2)
381  pen.setColor(m_conflictingColor);
382 
383  p->DrawRect(area, m_drawSelFill, pen, alphaMod);
384  }
385 }
386 
405 void MythUIGuideGrid::drawRecDecoration(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
406 {
407  int breakin = 1;
408  QRect area = data->m_drawArea;
409  area.translate(m_area.x(), m_area.y()); // Adjust within parent
410  area.translate(xoffset, yoffset); // Convert to global coordinates
411  area.adjust(breakin, breakin, -breakin, -breakin);
412 
413  // draw arrows
414  if (data->m_arrow != GridTimeNormal)
415  {
416  if (data->m_arrow & GridTimeStartsBefore)
417  {
418  if (m_verticalLayout)
419  {
420  if (m_arrowImages[2]) { // UP
421  MythUIImage *arrow = m_arrowImages[2];
422  MythRect arrowarea = arrow->GetArea();
423  arrow->DrawSelf(p, area.center().x() - (arrowarea.width() / 2),
424  area.top(), alphaMod, area);
425  }
426  }
427  else
428  {
429  if (m_arrowImages[0]) { // LEFT
430  MythUIImage *arrow = m_arrowImages[0];
431  MythRect arrowarea = arrow->GetArea();
432  arrow->DrawSelf(p, area.left(),
433  area.center().y() - (arrowarea.height() / 2),
434  alphaMod, area);
435  }
436  }
437  }
438 
439  if (data->m_arrow & GridTimeEndsAfter)
440  {
441  if (m_verticalLayout)
442  {
443  if (m_arrowImages[3]) { // BOTTOM
444  MythUIImage *arrow = m_arrowImages[3];
445  MythRect arrowarea = arrow->GetArea();
446  arrow->DrawSelf(p, area.center().x() - (arrowarea.width() / 2),
447  area.top() + area.height() - arrowarea.height(),
448  alphaMod, area);
449  }
450  }
451  else
452  {
453  if (m_arrowImages[1]) { // RIGHT
454  MythUIImage *arrow = m_arrowImages[1];
455  MythRect arrowarea = arrow->GetArea();
456  arrow->DrawSelf(p,
457  area.right() - arrowarea.width(),
458  area.center().y() - (arrowarea.height() / 2),
459  alphaMod, area);
460  }
461  }
462  }
463  }
464 
465  // draw recording status
466  if (data->m_recType != 0 && m_recImages[data->m_recType])
467  {
468  MythUIImage *image = m_recImages[data->m_recType];
469  MythRect imagearea = image->GetArea();
470  image->DrawSelf(p, area.right() - imagearea.width(),
471  area.bottom() - imagearea.height(),
472  alphaMod, area);
473  }
474 }
475 
494 void MythUIGuideGrid::drawBox(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, const QColor &color, int alphaMod)
495 {
496  int breakin = 1;
497  QRect area = data->m_drawArea;
498  area.translate(m_area.x(), m_area.y()); // Adjust within parent
499  area.translate(xoffset, yoffset); // Convert to global coordinates
500  area.adjust(breakin, breakin, -breakin, -breakin);
501 
502  static const QPen kNoPen(Qt::NoPen);
503  p->DrawRect(area, QBrush(calcColor(color, m_categoryAlpha)), kNoPen, alphaMod);
504 }
505 
524 void MythUIGuideGrid::drawBackground(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
525 {
526  QColor overColor;
527  QRect overArea;
528 
529  int breakin = 1;
530  QRect area = data->m_drawArea;
531  area.translate(m_area.x(), m_area.y()); // Adjust within parent
532  QColor fillColor;
533 
534  if (m_drawCategoryColors && data->m_categoryColor.isValid())
535  fillColor = calcColor(data->m_categoryColor, m_categoryAlpha);
536  else
537  fillColor = calcColor(m_solidColor, m_categoryAlpha);
538 
539  // These calculations are in the parents local coordinates
540  if (m_verticalLayout)
541  {
542  if (m_progPastCol && area.top() < m_progPastCol)
543  {
544  if (area.bottom() < m_progPastCol)
545  {
546  fillColor = fillColor.darker();
547  area.adjust(breakin, breakin, -breakin, -breakin);
548  }
549  else
550  {
551  overColor = fillColor.darker();
552  int first = m_progPastCol - area.top();
553  int second = area.height() - first;
554  overArea = area;
555  overArea.setHeight(first);
556  area.translate(0, first);
557  area.setHeight(second);
558 
559  area.adjust(0, -breakin, -breakin, -breakin);
560  overArea.adjust(0, breakin, -breakin, -breakin);
561  }
562  }
563  else
564  area.adjust(breakin, breakin, -breakin, -breakin);
565  }
566  else
567  {
568  if (m_progPastCol && area.left() < m_progPastCol)
569  {
570  if (area.right() < m_progPastCol)
571  {
572  fillColor = fillColor.darker();
573  area.adjust(breakin, breakin, -breakin, -breakin);
574  }
575  else
576  {
577  overColor = fillColor.darker();
578  int first = m_progPastCol - area.left();
579  int second = area.width() - first;
580  overArea = area;
581  overArea.setWidth(first);
582  area.translate(first, 0);
583  area.setWidth(second);
584 
585  area.adjust(0, breakin, -breakin, -breakin);
586  overArea.adjust(breakin, breakin, 0, -breakin);
587  }
588  }
589  else
590  area.adjust(breakin, breakin, -breakin, -breakin);
591  }
592 
593  if (area.width() <= 1)
594  area.setWidth(2);
595 
596  if (area.height() <= 1)
597  area.setHeight(2);
598 
599  static const QPen kNoPen(Qt::NoPen);
600  area.translate(xoffset, yoffset); // Convert to global coordinates
601  p->DrawRect(area, QBrush(fillColor), kNoPen, alphaMod);
602 
603  if (overArea.width() > 0) {
604  overArea.translate(xoffset, yoffset); // Convert to global coordinates
605  p->DrawRect(overArea, QBrush(overColor), kNoPen, alphaMod);
606  }
607 }
608 
625 void MythUIGuideGrid::drawText(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
626 {
627  QString msg = data->m_title;
628 
629  if (m_drawCategoryText && !data->m_category.isEmpty())
630  msg += QString(" (%1)").arg(data->m_category);
631 
632  QRect area = data->m_drawArea;
633  area.translate(m_area.x(), m_area.y()); // Adjust within parent
634  area.translate(xoffset, yoffset); // Convert to global coordinates
635  area.adjust(m_textOffset.x(), m_textOffset.y(),
636  -m_textOffset.x(), -m_textOffset.y());
637 
638  if (m_verticalLayout)
639  {
640  if ((data->m_arrow & GridTimeStartsBefore) && m_arrowImages[2])
641  area.setTop(area.top() + m_arrowImages[2]->GetArea().height());
642 
643  if ((data->m_arrow & GridTimeEndsAfter) && m_arrowImages[3])
644  area.setBottom(area.bottom() - m_arrowImages[3]->GetArea().height());
645  }
646  else
647  {
648  if ((data->m_arrow & GridTimeStartsBefore) && m_arrowImages[0])
649  area.setLeft(area.left() + m_arrowImages[0]->GetArea().width());
650 
651  if ((data->m_arrow & GridTimeEndsAfter) && m_arrowImages[1])
652  area.setRight(area.right() - m_arrowImages[1]->GetArea().width());
653  }
654 
655  if (area.width() <= 0 || area.height() <= 0)
656  return;
657 
658  p->DrawText(area, msg, m_justification, *m_font, alphaMod, area);
659 }
660 
661 QPoint MythUIGuideGrid::GetRowAndColumn(QPoint position)
662 {
663  for (int i = 0; i < m_rowCount; i++)
664  {
665  QList<UIGTCon *>::iterator it = m_allData[i].begin();
666 
667  for (int col = 0; it != m_allData[i].end(); ++it, ++col)
668  {
669  UIGTCon *data = *it;
670 
671  if (data->m_drawArea.contains(position))
672  {
673  return {col, i};
674  }
675  }
676  }
677  return {-1,-1};
678 }
679 
681  [[maybe_unused]] int col, const QRect area,
682  const QString &title, const QString &genre,
683  int arrow, int recType, int recStat,
684  bool selected)
685 {
686  auto *data = new UIGTCon(area, title, genre, arrow, recType, recStat);
687  m_allData[row].append(data);
688 
690  {
691  data->m_categoryColor = m_categoryColors[data->m_category.toLower()];
692 
693  if (!data->m_categoryColor.isValid())
694  data->m_categoryColor = m_categoryColors["none"];
695  }
696 
697  if (selected)
698  m_selectedItem = *data;
699 }
700 
701 bool MythUIGuideGrid::parseDefaultCategoryColors(QMap<QString, QString> &catColors)
702 {
703  QFile f;
704  QStringList searchpath = GetMythUI()->GetThemeSearchPath();
705 
706  for (const auto & path : std::as_const(searchpath))
707  {
708  f.setFileName(path + "categories.xml");
709 
710  if (f.open(QIODevice::ReadOnly))
711  break;
712  }
713 
714 #ifndef Q_OS_ANDROID // Android does not get a file handle for assets file system
715  if (f.handle() == -1)
716  {
717  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Unable to open '%1'")
718  .arg(f.fileName()));
719  return false;
720  }
721 #endif
722 
723  QDomDocument doc;
724  QString errorMsg;
725  int errorLine = 0;
726  int errorColumn = 0;
727 
728  if (!doc.setContent(&f, false, &errorMsg, &errorLine, &errorColumn))
729  {
730  LOG(VB_GENERAL, LOG_ERR, LOC +
731  QString("Parsing colors: %1 at line: %2 column: %3")
732  .arg(f.fileName()).arg(errorLine).arg(errorColumn) +
733  QString("\n\t\t\t%1").arg(errorMsg));
734  f.close();
735  return false;
736  }
737 
738  f.close();
739 
740  QDomElement element = doc.documentElement();
741 
742  for (QDomNode child = element.firstChild(); !child.isNull();
743  child = child.nextSibling())
744  {
745  QDomElement info = child.toElement();
746 
747  if (!info.isNull() && info.tagName() == "catcolor")
748  {
749  QString cat = info.attribute("category");
750  QString col = info.attribute("color");
751 
752  catColors[cat.toLower()] = col;
753  }
754  }
755 
756  return true;
757 }
758 
759 void MythUIGuideGrid::SetCategoryColors(const QMap<QString, QString> &catC)
760 {
761  for (QMap<QString, QString>::const_iterator it = catC.begin();
762  it != catC.end(); ++it)
763  {
764  m_categoryColors[it.key()] = createColor(*it);
765  }
766 }
767 
768 void MythUIGuideGrid::LoadImage(int recType, const QString &file)
769 {
770  auto *uiimage = new MythUIImage(file, this, "guidegrid image");
771  uiimage->m_imageProperties.m_isThemeImage = true;
772  uiimage->SetVisible(false);
773  uiimage->Load(false);
774 
775  MythUIImage *tmp = m_recImages[recType];
776  m_recImages[recType] = uiimage;
777  delete tmp;
778 }
779 
780 void MythUIGuideGrid::SetArrow(int direction, const QString &file)
781 {
782  auto *uiimage = new MythUIImage(file, this, "guidegrid arrow");
783  uiimage->m_imageProperties.m_isThemeImage = true;
784  uiimage->SetVisible(false);
785  uiimage->Load(false);
786 
787  MythUIImage *tmp = m_arrowImages[direction];
788  m_arrowImages[direction] = uiimage;
789  delete tmp;
790 }
791 
793 {
794  for (int i = 0; i < m_rowCount; i++)
795  ResetRow(i);
796 }
797 
799 {
800  while (!m_allData[row].empty())
801  {
802  delete m_allData[row].back();
803  m_allData[row].pop_back();
804  }
805 }
806 
808 {
809  if (m_verticalLayout)
810  m_progPastCol = m_area.y() + (m_area.height() * ppast / 100);
811  else
812  m_progPastCol = m_area.x() + (m_area.width() * ppast / 100);
813 
814  SetRedraw();
815 }
816 
817 void MythUIGuideGrid::SetMultiLine(bool multiline)
818 {
819  m_multilineText = multiline;
820 
821  if (m_multilineText)
822  m_justification |= Qt::TextWordWrap;
823  else
824  m_justification &= ~Qt::TextWordWrap;
825 }
GetGlobalFontMap
FontMap * GetGlobalFontMap(void)
Definition: mythfontproperties.cpp:601
MythUIGuideGrid::GetRowAndColumn
QPoint GetRowAndColumn(QPoint position)
Definition: mythuiguidegrid.cpp:661
MythUIGuideGrid::UIGTCon
Definition: mythuiguidegrid.h:85
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:274
MythUIGuideGrid::m_cutdown
bool m_cutdown
Definition: mythuiguidegrid.h:137
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
XMLParseBase::parsePoint
static MythPoint parsePoint(const QString &text, bool normalize=true)
Definition: xmlparsebase.cpp:75
x11colors.h
MythUIGuideGrid::~MythUIGuideGrid
~MythUIGuideGrid() override
Definition: mythuiguidegrid.cpp:47
MythUIScreenBounds::GetUIScreenRect
QRect GetUIScreenRect()
Definition: mythuiscreenbounds.cpp:198
MythUIGuideGrid::UIGTCon::m_drawArea
QRect m_drawArea
Definition: mythuiguidegrid.h:99
mythdb.h
MythUIGuideGrid::calcColor
static QColor calcColor(const QColor &color, int alpha)
Definition: mythuiguidegrid.cpp:255
MythUIGuideGrid::m_textOffset
QPoint m_textOffset
Definition: mythuiguidegrid.h:131
MythUIGuideGrid::UIGTCon::m_title
QString m_title
Definition: mythuiguidegrid.h:100
MythUIGuideGrid::m_fillType
int m_fillType
Definition: mythuiguidegrid.h:147
MythUIGuideGrid::drawText
void drawText(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws text strings for a GuideGrid item.
Definition: mythuiguidegrid.cpp:625
MythUIGuideGrid::SetProgPast
void SetProgPast(int ppast)
Definition: mythuiguidegrid.cpp:807
MythUIGuideGrid::m_conflictingColor
QColor m_conflictingColor
Definition: mythuiguidegrid.h:145
MythUIGuideGrid::m_categoryAlpha
int m_categoryAlpha
Definition: mythuiguidegrid.h:154
MythUIGuideGrid::drawRecDecoration
void drawRecDecoration(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws decoration items for a GuideGrid item.
Definition: mythuiguidegrid.cpp:405
hardwareprofile.devicelist.cat
def cat(file_name)
Definition: devicelist.py:95
MythUIGuideGrid::m_justification
int m_justification
Definition: mythuiguidegrid.h:134
MythUIGuideGrid::DrawSelf
void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect) override
Draws an entire GuideGrid.
Definition: mythuiguidegrid.cpp:286
MythUIGuideGrid::m_drawSelLine
QPen m_drawSelLine
Definition: mythuiguidegrid.h:140
MythUIGuideGrid::UIGTCon::m_recStat
int m_recStat
Definition: mythuiguidegrid.h:105
MythUIGuideGrid::m_drawCategoryText
bool m_drawCategoryText
Definition: mythuiguidegrid.h:153
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MAX_DISPLAY_TIMES
static constexpr int MAX_DISPLAY_TIMES
Definition: mythuiguidegrid.h:27
build_compdb.file
file
Definition: build_compdb.py:55
MythUIGuideGrid
A narrow purpose widget used to show television programs and the timeslots they occupy on channels....
Definition: mythuiguidegrid.h:43
MythUIGuideGrid::CreateCopy
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
Definition: mythuiguidegrid.cpp:249
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
GridTimeStartsBefore
static constexpr uint8_t GridTimeStartsBefore
Definition: mythuiguidegrid.h:31
mythuiimage.h
MythUIGuideGrid::ResetData
void ResetData()
Definition: mythuiguidegrid.cpp:792
mythuiguidegrid.h
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
MythUIGuideGrid::m_font
MythFontProperties * m_font
Definition: mythuiguidegrid.h:133
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:886
LOC
#define LOC
Definition: mythuiguidegrid.cpp:26
MythUIGuideGrid::SetArrow
void SetArrow(int direction, const QString &file)
Definition: mythuiguidegrid.cpp:780
MythUIGuideGrid::UIGTCon::m_recType
int m_recType
Definition: mythuiguidegrid.h:104
MythUIGuideGrid::m_recordingColor
QColor m_recordingColor
Definition: mythuiguidegrid.h:144
mythfontproperties.h
MythFontProperties::Rescale
void Rescale(void)
Definition: mythfontproperties.cpp:133
mythlogging.h
MythUIGuideGrid::m_multilineText
bool m_multilineText
Definition: mythuiguidegrid.h:136
MythUIGuideGrid::m_drawCategoryColors
bool m_drawCategoryColors
Definition: mythuiguidegrid.h:152
MythUIGuideGrid::ResetRow
void ResetRow(int row)
Definition: mythuiguidegrid.cpp:798
hardwareprofile.config.p
p
Definition: config.py:33
MythUIGuideGrid::m_channelCount
int m_channelCount
Definition: mythuiguidegrid.h:128
MythUIGuideGrid::parseDefaultCategoryColors
static bool parseDefaultCategoryColors(QMap< QString, QString > &catColors)
Definition: mythuiguidegrid.cpp:701
MythUIGuideGrid::drawBackground
void drawBackground(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws the background for a GuideGrid item that will not be recorded.
Definition: mythuiguidegrid.cpp:524
MythFontProperties
Definition: mythfontproperties.h:13
MythUIGuideGrid::ParseElement
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuiguidegrid.cpp:62
MythUIGuideGrid::m_drawSelFill
QBrush m_drawSelFill
Definition: mythuiguidegrid.h:141
MythUIScreenBounds::GetFontStretch
int GetFontStretch() const
Definition: mythuiscreenbounds.cpp:254
MythUIGuideGrid::m_verticalLayout
bool m_verticalLayout
Definition: mythuiguidegrid.h:130
MythUIGuideGrid::m_rowCount
int m_rowCount
Definition: mythuiguidegrid.h:149
XMLParseBase::getFirstText
static QString getFirstText(QDomElement &element)
Definition: xmlparsebase.cpp:52
MythUIGuideGrid::Finalize
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
Definition: mythuiguidegrid.cpp:38
MythUIGuideGrid::m_arrowImages
std::array< MythUIImage *, ARROWIMAGESIZE > m_arrowImages
Definition: mythuiguidegrid.h:125
MythUIGuideGrid::UIGTCon::m_arrow
int m_arrow
Definition: mythuiguidegrid.h:103
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1176
MythUIThemeHelper::GetThemeSearchPath
QStringList GetThemeSearchPath()
Definition: mythuithemehelper.cpp:151
MythUIGuideGrid::SetMultiLine
void SetMultiLine(bool multiline)
Definition: mythuiguidegrid.cpp:817
MythUIGuideGrid::CopyFrom
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
Definition: mythuiguidegrid.cpp:214
MythUIGuideGrid::UIGTCon::m_category
QString m_category
Definition: mythuiguidegrid.h:101
GridTimeNormal
static constexpr uint8_t GridTimeNormal
Definition: mythuiguidegrid.h:30
FontMap::GetFont
MythFontProperties * GetFont(const QString &text)
Definition: mythfontproperties.cpp:524
MythUIGuideGrid::m_solidColor
QColor m_solidColor
Definition: mythuiguidegrid.h:143
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
GridTimeEndsAfter
static constexpr uint8_t GridTimeEndsAfter
Definition: mythuiguidegrid.h:32
MythUIGuideGrid::drawCurrent
void drawCurrent(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws selection indication for a GuideGrid item.
Definition: mythuiguidegrid.cpp:335
mythuihelper.h
MythUIGuideGrid::UIGTCon::m_categoryColor
QColor m_categoryColor
Definition: mythuiguidegrid.h:102
mythimage.h
MythUIGuideGrid::drawBox
void drawBox(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, const QColor &color, int alphaMod)
Draws the background for a GuideGrid item to be recorded.
Definition: mythuiguidegrid.cpp:494
MythUIGuideGrid::m_categoryColors
QMap< QString, QColor > m_categoryColors
Definition: mythuiguidegrid.h:156
MythUIGuideGrid::SetCategoryColors
void SetCategoryColors(const QMap< QString, QString > &catColors)
Definition: mythuiguidegrid.cpp:759
MythUIGuideGrid::m_selType
QString m_selType
Definition: mythuiguidegrid.h:139
MythUIGuideGrid::MythUIGuideGrid
MythUIGuideGrid(MythUIType *parent, const QString &name)
Definition: mythuiguidegrid.cpp:28
MythUIGuideGrid::m_recImages
std::array< MythUIImage *, RECSTATUSSIZE > m_recImages
Definition: mythuiguidegrid.h:124
MythPainter
Definition: mythpainter.h:34
MythUIGuideGrid::SetProgramInfo
void SetProgramInfo(int row, int col, QRect area, const QString &title, const QString &genre, int arrow, int recType, int recStat, bool selected)
Definition: mythuiguidegrid.cpp:680
MythUIGuideGrid::LoadImage
void LoadImage(int recType, const QString &file)
Definition: mythuiguidegrid.cpp:768
createColor
QColor createColor(const QString &color)
Definition: x11colors.cpp:16
MAX_DISPLAY_CHANS
static constexpr int MAX_DISPLAY_CHANS
Definition: mythuiguidegrid.h:24
MythUIGuideGrid::m_progPastCol
int m_progPastCol
Definition: mythuiguidegrid.h:150
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
MythUIGuideGrid::m_selectedItem
UIGTCon m_selectedItem
Definition: mythuiguidegrid.h:122
MythUIType::GetFont
MythFontProperties * GetFont(const QString &text) const
Definition: mythuitype.cpp:1322
MythFontProperties::AdjustStretch
void AdjustStretch(int stretch)
Definition: mythfontproperties.cpp:139
MythUIType::ParseElement
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuitype.cpp:1242
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:66
build_compdb.filename
filename
Definition: build_compdb.py:21
MythUIGuideGrid::m_timeCount
int m_timeCount
Definition: mythuiguidegrid.h:129
mythmainwindow.h
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:310
XMLParseBase::parseBool
static bool parseBool(const QString &text)
Definition: xmlparsebase.cpp:64
MythUIGuideGrid::m_allData
QList< UIGTCon * > * m_allData
Definition: mythuiguidegrid.h:121
MythMainWindow
Definition: mythmainwindow.h:28
MythUIType::Finalize
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
Definition: mythuitype.cpp:1318
mythuitype.h
MythUIImage::DrawSelf
void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect) override
Definition: mythuiimage.cpp:1205