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 "mythfontproperties.h"
16 #include "mythuihelper.h"
17 #include "x11colors.h"
18 #include "mythlogging.h"
19 #include "mythimage.h"
20 #include "mythuitype.h"
21 #include "mythuiimage.h"
22 #include "mythmainwindow.h"
23 #include "mythdb.h"
24 
25 #define LOC QString("MythUIGuideGrid: ")
26 
27 MythUIGuideGrid::MythUIGuideGrid(MythUIType *parent, const QString &name)
28  : MythUIType(parent, name)
29 {
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 : qAsConst(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 : qAsConst(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  area.adjust(breakin, breakin, -breakin, -breakin);
564  }
565  else
566  {
567  if (m_progPastCol && area.left() < m_progPastCol)
568  {
569  if (area.right() < m_progPastCol)
570  {
571  fillColor = fillColor.darker();
572  area.adjust(breakin, breakin, -breakin, -breakin);
573  }
574  else
575  {
576  overColor = fillColor.darker();
577  int first = m_progPastCol - area.left();
578  int second = area.width() - first;
579  overArea = area;
580  overArea.setWidth(first);
581  area.translate(first, 0);
582  area.setWidth(second);
583 
584  area.adjust(0, breakin, -breakin, -breakin);
585  overArea.adjust(breakin, breakin, 0, -breakin);
586  }
587  }
588  else
589  area.adjust(breakin, breakin, -breakin, -breakin);
590  }
591 
592  if (area.width() <= 1)
593  area.setWidth(2);
594 
595  if (area.height() <= 1)
596  area.setHeight(2);
597 
598  static const QPen kNoPen(Qt::NoPen);
599  area.translate(xoffset, yoffset); // Convert to global coordinates
600  p->DrawRect(area, QBrush(fillColor), kNoPen, alphaMod);
601 
602  if (overArea.width() > 0) {
603  overArea.translate(xoffset, yoffset); // Convert to global coordinates
604  p->DrawRect(overArea, QBrush(overColor), kNoPen, alphaMod);
605  }
606 }
607 
624 void MythUIGuideGrid::drawText(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
625 {
626  QString msg = data->m_title;
627 
628  if (m_drawCategoryText && !data->m_category.isEmpty())
629  msg += QString(" (%1)").arg(data->m_category);
630 
631  QRect area = data->m_drawArea;
632  area.translate(m_area.x(), m_area.y()); // Adjust within parent
633  area.translate(xoffset, yoffset); // Convert to global coordinates
634  area.adjust(m_textOffset.x(), m_textOffset.y(),
635  -m_textOffset.x(), -m_textOffset.y());
636 
637  if (m_verticalLayout)
638  {
639  if ((data->m_arrow & GridTimeStartsBefore) && m_arrowImages[2])
640  area.setTop(area.top() + m_arrowImages[2]->GetArea().height());
641 
642  if ((data->m_arrow & GridTimeEndsAfter) && m_arrowImages[3])
643  area.setBottom(area.bottom() - m_arrowImages[3]->GetArea().height());
644  }
645  else
646  {
647  if ((data->m_arrow & GridTimeStartsBefore) && m_arrowImages[0])
648  area.setLeft(area.left() + m_arrowImages[0]->GetArea().width());
649 
650  if ((data->m_arrow & GridTimeEndsAfter) && m_arrowImages[1])
651  area.setRight(area.right() - m_arrowImages[1]->GetArea().width());
652  }
653 
654  if (area.width() <= 0 || area.height() <= 0)
655  return;
656 
657  p->DrawText(area, msg, m_justification, *m_font, alphaMod, area);
658 }
659 
660 QPoint MythUIGuideGrid::GetRowAndColumn(QPoint position)
661 {
662  for (int i = 0; i < m_rowCount; i++)
663  {
664  QList<UIGTCon *>::iterator it = m_allData[i].begin();
665 
666  for (int col = 0; it != m_allData[i].end(); ++it, ++col)
667  {
668  UIGTCon *data = *it;
669 
670  if (data->m_drawArea.contains(position))
671  {
672  return {col, i};
673  }
674  }
675  }
676  return {-1,-1};
677 }
678 
679 void MythUIGuideGrid::SetProgramInfo(int row, int col, const QRect area,
680  const QString &title, const QString &genre,
681  int arrow, int recType, int recStat,
682  bool selected)
683 {
684  (void)col;
685  auto *data = new UIGTCon(area, title, genre, arrow, recType, recStat);
686  m_allData[row].append(data);
687 
689  {
690  data->m_categoryColor = m_categoryColors[data->m_category.toLower()];
691 
692  if (!data->m_categoryColor.isValid())
693  data->m_categoryColor = m_categoryColors["none"];
694  }
695 
696  if (selected)
697  m_selectedItem = *data;
698 }
699 
700 bool MythUIGuideGrid::parseDefaultCategoryColors(QMap<QString, QString> &catColors)
701 {
702  QFile f;
703  QStringList searchpath = GetMythUI()->GetThemeSearchPath();
704 
705  for (const auto & path : qAsConst(searchpath))
706  {
707  f.setFileName(path + "categories.xml");
708 
709  if (f.open(QIODevice::ReadOnly))
710  break;
711  }
712 
713 #ifndef Q_OS_ANDROID // Android does not get a file handle for assets file system
714  if (f.handle() == -1)
715  {
716  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Unable to open '%1'")
717  .arg(f.fileName()));
718  return false;
719  }
720 #endif
721 
722  QDomDocument doc;
723  QString errorMsg;
724  int errorLine = 0;
725  int errorColumn = 0;
726 
727  if (!doc.setContent(&f, false, &errorMsg, &errorLine, &errorColumn))
728  {
729  LOG(VB_GENERAL, LOG_ERR, LOC +
730  QString("Parsing colors: %1 at line: %2 column: %3")
731  .arg(f.fileName()).arg(errorLine).arg(errorColumn) +
732  QString("\n\t\t\t%1").arg(errorMsg));
733  f.close();
734  return false;
735  }
736 
737  f.close();
738 
739  QDomElement element = doc.documentElement();
740 
741  for (QDomNode child = element.firstChild(); !child.isNull();
742  child = child.nextSibling())
743  {
744  QDomElement info = child.toElement();
745 
746  if (!info.isNull() && info.tagName() == "catcolor")
747  {
748  QString cat = info.attribute("category");
749  QString col = info.attribute("color");
750 
751  catColors[cat.toLower()] = col;
752  }
753  }
754 
755  return true;
756 }
757 
758 void MythUIGuideGrid::SetCategoryColors(const QMap<QString, QString> &catC)
759 {
760  for (QMap<QString, QString>::const_iterator it = catC.begin();
761  it != catC.end(); ++it)
762  {
763  m_categoryColors[it.key()] = createColor(*it);
764  }
765 }
766 
767 void MythUIGuideGrid::LoadImage(int recType, const QString &file)
768 {
769  auto *uiimage = new MythUIImage(file, this, "guidegrid image");
770  uiimage->m_imageProperties.m_isThemeImage = true;
771  uiimage->SetVisible(false);
772  uiimage->Load(false);
773 
774  MythUIImage *tmp = m_recImages[recType];
775  m_recImages[recType] = uiimage;
776  delete tmp;
777 }
778 
779 void MythUIGuideGrid::SetArrow(int direction, const QString &file)
780 {
781  auto *uiimage = new MythUIImage(file, this, "guidegrid arrow");
782  uiimage->m_imageProperties.m_isThemeImage = true;
783  uiimage->SetVisible(false);
784  uiimage->Load(false);
785 
786  MythUIImage *tmp = m_arrowImages[direction];
787  m_arrowImages[direction] = uiimage;
788  delete tmp;
789 }
790 
792 {
793  for (int i = 0; i < m_rowCount; i++)
794  ResetRow(i);
795 }
796 
798 {
799  while (!m_allData[row].empty())
800  {
801  delete m_allData[row].back();
802  m_allData[row].pop_back();
803  }
804 }
805 
807 {
808  if (m_verticalLayout)
809  m_progPastCol = m_area.y() + (m_area.height() * ppast / 100);
810  else
811  m_progPastCol = m_area.x() + (m_area.width() * ppast / 100);
812 
813  SetRedraw();
814 }
815 
816 void MythUIGuideGrid::SetMultiLine(bool multiline)
817 {
818  m_multilineText = multiline;
819 
820  if (m_multilineText)
821  m_justification |= Qt::TextWordWrap;
822  else
823  m_justification &= ~Qt::TextWordWrap;
824 }
GetGlobalFontMap
FontMap * GetGlobalFontMap(void)
Definition: mythfontproperties.cpp:575
MythUIGuideGrid::GetRowAndColumn
QPoint GetRowAndColumn(QPoint position)
Definition: mythuiguidegrid.cpp:660
MythUIGuideGrid::UIGTCon
Definition: mythuiguidegrid.h:83
MythUIType::m_area
MythRect m_area
Definition: mythuitype.h:271
MythUIGuideGrid::m_cutdown
bool m_cutdown
Definition: mythuiguidegrid.h:135
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:76
x11colors.h
MythUIGuideGrid::~MythUIGuideGrid
~MythUIGuideGrid() override
Definition: mythuiguidegrid.cpp:46
MythUIScreenBounds::GetUIScreenRect
QRect GetUIScreenRect()
Definition: mythuiscreenbounds.cpp:192
MythUIGuideGrid::UIGTCon::m_drawArea
QRect m_drawArea
Definition: mythuiguidegrid.h:97
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:129
doc
QDomDocument doc("MYTHARCHIVEITEM")
MAX_DISPLAY_CHANS
#define MAX_DISPLAY_CHANS
Definition: mythuiguidegrid.h:23
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:636
MythUIGuideGrid::UIGTCon::m_title
QString m_title
Definition: mythuiguidegrid.h:98
MythUIGuideGrid::m_fillType
int m_fillType
Definition: mythuiguidegrid.h:145
MythUIGuideGrid::drawText
void drawText(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws text strings for a GuideGrid item.
Definition: mythuiguidegrid.cpp:624
MythUIGuideGrid::SetProgPast
void SetProgPast(int ppast)
Definition: mythuiguidegrid.cpp:806
MythUIGuideGrid::m_conflictingColor
QColor m_conflictingColor
Definition: mythuiguidegrid.h:143
MythUIGuideGrid::m_categoryAlpha
int m_categoryAlpha
Definition: mythuiguidegrid.h:152
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:132
arg
arg(title).arg(filename).arg(doDelete))
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:138
MythUIGuideGrid::UIGTCon::m_recStat
int m_recStat
Definition: mythuiguidegrid.h:103
MythUIGuideGrid::m_drawCategoryText
bool m_drawCategoryText
Definition: mythuiguidegrid.h:151
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
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:41
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
mythuiimage.h
MythUIGuideGrid::ResetData
void ResetData()
Definition: mythuiguidegrid.cpp:791
mythuiguidegrid.h
tmp
static guint32 * tmp
Definition: goom_core.cpp:31
MythUIGuideGrid::m_font
MythFontProperties * m_font
Definition: mythuiguidegrid.h:131
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
LOC
#define LOC
Definition: mythuiguidegrid.cpp:25
MythUIGuideGrid::SetArrow
void SetArrow(int direction, const QString &file)
Definition: mythuiguidegrid.cpp:779
MythUIGuideGrid::UIGTCon::m_recType
int m_recType
Definition: mythuiguidegrid.h:102
MAX_DISPLAY_TIMES
#define MAX_DISPLAY_TIMES
Definition: mythuiguidegrid.h:26
MythUIGuideGrid::m_recordingColor
QColor m_recordingColor
Definition: mythuiguidegrid.h:142
mythfontproperties.h
MythFontProperties::Rescale
void Rescale(void)
Definition: mythfontproperties.cpp:131
mythlogging.h
MythUIGuideGrid::m_multilineText
bool m_multilineText
Definition: mythuiguidegrid.h:134
MythUIGuideGrid::m_drawCategoryColors
bool m_drawCategoryColors
Definition: mythuiguidegrid.h:150
MythUIGuideGrid::ResetRow
void ResetRow(int row)
Definition: mythuiguidegrid.cpp:797
GridTimeStartsBefore
#define GridTimeStartsBefore
Definition: mythuiguidegrid.h:29
hardwareprofile.config.p
p
Definition: config.py:33
MythUIGuideGrid::m_channelCount
int m_channelCount
Definition: mythuiguidegrid.h:126
MythUIGuideGrid::parseDefaultCategoryColors
static bool parseDefaultCategoryColors(QMap< QString, QString > &catColors)
Definition: mythuiguidegrid.cpp:700
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:139
MythUIScreenBounds::GetFontStretch
int GetFontStretch() const
Definition: mythuiscreenbounds.cpp:248
MythUIGuideGrid::m_verticalLayout
bool m_verticalLayout
Definition: mythuiguidegrid.h:128
MythUIGuideGrid::m_rowCount
int m_rowCount
Definition: mythuiguidegrid.h:147
XMLParseBase::getFirstText
static QString getFirstText(QDomElement &element)
Definition: xmlparsebase.cpp:53
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:123
MythUIGuideGrid::UIGTCon::m_arrow
int m_arrow
Definition: mythuiguidegrid.h:101
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1152
f
QTextStream t & f
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:603
MythUIThemeHelper::GetThemeSearchPath
QStringList GetThemeSearchPath()
Definition: mythuithemehelper.cpp:150
MythUIGuideGrid::SetMultiLine
void SetMultiLine(bool multiline)
Definition: mythuiguidegrid.cpp:816
GridTimeEndsAfter
#define GridTimeEndsAfter
Definition: mythuiguidegrid.h:30
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:99
FontMap::GetFont
MythFontProperties * GetFont(const QString &text)
Definition: mythfontproperties.cpp:498
MythUIGuideGrid::m_solidColor
QColor m_solidColor
Definition: mythuiguidegrid.h:141
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:84
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:100
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:154
MythUIGuideGrid::SetCategoryColors
void SetCategoryColors(const QMap< QString, QString > &catColors)
Definition: mythuiguidegrid.cpp:758
MythUIGuideGrid::m_selType
QString m_selType
Definition: mythuiguidegrid.h:137
MythUIGuideGrid::MythUIGuideGrid
MythUIGuideGrid(MythUIType *parent, const QString &name)
Definition: mythuiguidegrid.cpp:27
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1174
MythUIGuideGrid::m_recImages
std::array< MythUIImage *, RECSTATUSSIZE > m_recImages
Definition: mythuiguidegrid.h:122
MythPainter
Definition: mythpainter.h:32
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:679
MythUIGuideGrid::LoadImage
void LoadImage(int recType, const QString &file)
Definition: mythuiguidegrid.cpp:767
createColor
QColor createColor(const QString &color)
Definition: x11colors.cpp:16
GridTimeNormal
#define GridTimeNormal
Definition: mythuiguidegrid.h:28
MythUIGuideGrid::m_progPastCol
int m_progPastCol
Definition: mythuiguidegrid.h:148
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
MythUIGuideGrid::m_selectedItem
UIGTCon m_selectedItem
Definition: mythuiguidegrid.h:120
MythUIType::GetFont
MythFontProperties * GetFont(const QString &text) const
Definition: mythuitype.cpp:1298
MythFontProperties::AdjustStretch
void AdjustStretch(int stretch)
Definition: mythfontproperties.cpp:137
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:1218
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:66
MythUIGuideGrid::m_timeCount
int m_timeCount
Definition: mythuiguidegrid.h:127
mythmainwindow.h
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:294
XMLParseBase::parseBool
static bool parseBool(const QString &text)
Definition: xmlparsebase.cpp:65
MythUIGuideGrid::m_allData
QList< UIGTCon * > * m_allData
Definition: mythuiguidegrid.h:119
MythMainWindow
Definition: mythmainwindow.h:34
MythUIType::Finalize
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
Definition: mythuitype.cpp:1294
mythuitype.h
MythUIImage::DrawSelf
void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect) override
Definition: mythuiimage.cpp:1207