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 using namespace std;
10 
11 // Qt headers
12 #include <QFile>
13 #include <QDomElement>
14 
15 // myth
16 #include "mythfontproperties.h"
17 #include "mythuihelper.h"
18 #include "x11colors.h"
19 #include "mythlogging.h"
20 #include "mythimage.h"
21 #include "mythuitype.h"
22 #include "mythuiimage.h"
23 #include "mythmainwindow.h"
24 #include "mythdb.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();
75  }
76  else if (element.tagName() == "timeslots")
77  {
78  m_timeCount = getFirstText(element).toInt();
79  m_timeCount = max(m_timeCount, 1);
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();
126  m_categoryAlpha = 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  int screenHeight = GetMythMainWindow()->GetUIScreenRect().height();
160  fontcopy.Rescale(screenHeight);
161  int fontStretch = GetMythUI()->GetFontStretch();
162  fontcopy.AdjustStretch(fontStretch);
163  *m_font = fontcopy;
164  }
165  else
166  LOG(VB_GENERAL, LOG_ERR, LOC + "Unknown font: " + fontname);
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 (QStringList::const_iterator ii = searchpath.begin();
706  ii != searchpath.end(); ++ii)
707  {
708  f.setFileName(*ii + "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:572
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:250
MythUIGuideGrid::m_cutdown
bool m_cutdown
Definition: mythuiguidegrid.h:134
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:98
XMLParseBase::parsePoint
static MythPoint parsePoint(const QString &text, bool normalize=true)
Definition: xmlparsebase.cpp:76
x11colors.h
MythUIGuideGrid::~MythUIGuideGrid
~MythUIGuideGrid() override
Definition: mythuiguidegrid.cpp:47
MythUIGuideGrid::UIGTCon::m_drawArea
QRect m_drawArea
Definition: mythuiguidegrid.h:96
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:128
doc
QDomDocument doc("MYTHARCHIVEITEM")
MAX_DISPLAY_CHANS
#define MAX_DISPLAY_CHANS
Definition: mythuiguidegrid.h:23
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:633
MythUIGuideGrid::UIGTCon::m_title
QString m_title
Definition: mythuiguidegrid.h:97
MythUIGuideGrid::m_fillType
int m_fillType
Definition: mythuiguidegrid.h:144
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:807
MythUIGuideGrid::m_conflictingColor
QColor m_conflictingColor
Definition: mythuiguidegrid.h:142
MythUIGuideGrid::m_categoryAlpha
int m_categoryAlpha
Definition: mythuiguidegrid.h:151
MythUIHelper::GetThemeSearchPath
QStringList GetThemeSearchPath(void)
Definition: mythuihelper.cpp:1074
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:131
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:137
MythUIGuideGrid::UIGTCon::m_recStat
int m_recStat
Definition: mythuiguidegrid.h:102
MythUIGuideGrid::m_drawCategoryText
bool m_drawCategoryText
Definition: mythuiguidegrid.h:150
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:42
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:18
mythuiimage.h
MythUIGuideGrid::ResetData
void ResetData()
Definition: mythuiguidegrid.cpp:792
mythuiguidegrid.h
tmp
static guint32 * tmp
Definition: goom_core.cpp:30
MythUIGuideGrid::m_font
MythFontProperties * m_font
Definition: mythuiguidegrid.h:130
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:869
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:101
MAX_DISPLAY_TIMES
#define MAX_DISPLAY_TIMES
Definition: mythuiguidegrid.h:26
MythUIGuideGrid::m_recordingColor
QColor m_recordingColor
Definition: mythuiguidegrid.h:141
mythfontproperties.h
MythFontProperties::Rescale
void Rescale(void)
Definition: mythfontproperties.cpp:131
mythlogging.h
MythUIGuideGrid::m_multilineText
bool m_multilineText
Definition: mythuiguidegrid.h:133
MythUIGuideGrid::m_drawCategoryColors
bool m_drawCategoryColors
Definition: mythuiguidegrid.h:149
MythUIGuideGrid::ResetRow
void ResetRow(int row)
Definition: mythuiguidegrid.cpp:798
GridTimeStartsBefore
#define GridTimeStartsBefore
Definition: mythuiguidegrid.h:29
hardwareprofile.config.p
p
Definition: config.py:33
MythUIGuideGrid::m_channelCount
int m_channelCount
Definition: mythuiguidegrid.h:125
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:14
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:138
MythUIGuideGrid::m_verticalLayout
bool m_verticalLayout
Definition: mythuiguidegrid.h:127
MythUIGuideGrid::m_rowCount
int m_rowCount
Definition: mythuiguidegrid.h:146
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:38
MythUIGuideGrid::m_arrowImages
std::array< MythUIImage *, ARROWIMAGESIZE > m_arrowImages
Definition: mythuiguidegrid.h:122
MythUIGuideGrid::UIGTCon::m_arrow
int m_arrow
Definition: mythuiguidegrid.h:100
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:634
MythUIHelper::GetFontStretch
int GetFontStretch(void) const
Definition: mythuihelper.cpp:1516
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:600
MythUIGuideGrid::SetMultiLine
void SetMultiLine(bool multiline)
Definition: mythuiguidegrid.cpp:817
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:98
FontMap::GetFont
MythFontProperties * GetFont(const QString &text)
Definition: mythfontproperties.cpp:495
MythUIGuideGrid::m_solidColor
QColor m_solidColor
Definition: mythuiguidegrid.h:140
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:64
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:99
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:153
MythUIGuideGrid::SetCategoryColors
void SetCategoryColors(const QMap< QString, QString > &catColors)
Definition: mythuiguidegrid.cpp:759
MythUIGuideGrid::m_selType
QString m_selType
Definition: mythuiguidegrid.h:136
MythUIGuideGrid::MythUIGuideGrid
MythUIGuideGrid(MythUIType *parent, const QString &name)
Definition: mythuiguidegrid.cpp:28
MythUIGuideGrid::SetProgramInfo
void SetProgramInfo(int row, int col, const QRect &area, const QString &title, const QString &genre, int arrow, int recType, int recStat, bool selected)
Definition: mythuiguidegrid.cpp:679
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1171
MythUIGuideGrid::m_recImages
std::array< MythUIImage *, RECSTATUSSIZE > m_recImages
Definition: mythuiguidegrid.h:121
MythPainter
Definition: mythpainter.h:33
MythUIGuideGrid::LoadImage
void LoadImage(int recType, const QString &file)
Definition: mythuiguidegrid.cpp:768
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:147
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
MythUIGuideGrid::m_selectedItem
UIGTCon m_selectedItem
Definition: mythuiguidegrid.h:119
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:81
MythUIGuideGrid::m_timeCount
int m_timeCount
Definition: mythuiguidegrid.h:126
mythmainwindow.h
MythUIType::SetRedraw
void SetRedraw(void)
Definition: mythuitype.cpp:293
XMLParseBase::parseBool
static bool parseBool(const QString &text)
Definition: xmlparsebase.cpp:65
MythMainWindow::GetUIScreenRect
QRect GetUIScreenRect()
Definition: mythmainwindow.cpp:2252
MythUIGuideGrid::m_allData
QList< UIGTCon * > * m_allData
Definition: mythuiguidegrid.h:118
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:1206