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