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 
29  : MythUIType(parent, name)
30 {
31  // themeable setting defaults
32  for (uint x = 0; x < RECSTATUSSIZE; x++)
33  m_recImages[x] = nullptr;
34 
35  for (uint x = 0; x < ARROWIMAGESIZE; x++)
36  m_arrowImages[x] = nullptr;
37 
38  m_font = new MythFontProperties();
39 
40  QMap<QString, QString> catColors;
41  parseDefaultCategoryColors(catColors);
42  SetCategoryColors(catColors);
43 }
44 
46 {
48 
49  m_allData = new QList<UIGTCon *>[m_rowCount];
50 
52 }
53 
55 {
56  for (int i = 0; i < m_rowCount; i++)
57  ResetRow(i);
58 
59  delete [] m_allData;
60 
61  delete m_font;
62  m_font = nullptr;
63 
64  // The m_recImages and m_arrowImages images are now children of
65  // the MythGuiGuideGrid widget and should be automatically deleted
66  // when it is deleted.
67 }
68 
70  const QString &filename, QDomElement &element, bool showWarnings)
71 {
72  if (element.tagName() == "layout")
73  {
74  QString layout = getFirstText(element).toLower();
75  m_verticalLayout = (layout == "vertical");
76  }
77  else if (element.tagName() == "channels")
78  {
79  m_channelCount = getFirstText(element).toInt();
82  }
83  else if (element.tagName() == "timeslots")
84  {
85  m_timeCount = getFirstText(element).toInt();
86  m_timeCount = max(m_timeCount, 1);
88  }
89  else if (element.tagName() == "solidcolor")
90  {
91  QString color = getFirstText(element);
92  m_solidColor = QColor(color);
93  }
94  else if (element.tagName() == "selector")
95  {
96  m_selType = element.attribute("type");
97  QString lineColor = element.attribute("linecolor", "");
98  QString fillColor = element.attribute("fillcolor", "");
99 
100  if (!lineColor.isEmpty())
101  {
102  m_drawSelLine = QPen(QColor(lineColor));
103  m_drawSelLine.setWidth(2);
104  }
105  else
106  {
107  m_drawSelLine = QPen(Qt::NoPen);
108  }
109 
110  if (!fillColor.isEmpty())
111  {
112  m_drawSelFill = QBrush(QColor(fillColor));
113  }
114  else
115  {
116  m_drawSelFill = QBrush(Qt::NoBrush);
117  }
118  }
119  else if (element.tagName() == "recordingcolor")
120  {
121  QString color = getFirstText(element);
122  m_recordingColor = QColor(color);
123  }
124  else if (element.tagName() == "conflictingcolor")
125  {
126  QString color = getFirstText(element);
127  m_conflictingColor = QColor(color);
128  }
129  else if (element.tagName() == "categoryalpha")
130  {
131  m_categoryAlpha = getFirstText(element).toInt();
133  m_categoryAlpha = min(m_categoryAlpha, 255);
134  }
135  else if (element.tagName() == "showcategories")
136  {
137  m_drawCategoryText = parseBool(element);
138  }
139  else if (element.tagName() == "showcategorycolors")
140  {
141  m_drawCategoryColors = parseBool(element);
142  }
143  else if (element.tagName() == "cutdown")
144  {
145  m_cutdown = parseBool(element);
146  }
147  else if (element.tagName() == "multiline")
148  {
149  SetMultiLine(parseBool(element));
150  }
151  else if (element.tagName() == "textoffset")
152  {
153  m_textOffset = parsePoint(element);
154  }
155  else if (element.tagName() == "font")
156  {
157  QString fontname = getFirstText(element);
158  MythFontProperties *font = GetFont(fontname);
159 
160  if (!font)
161  font = GetGlobalFontMap()->GetFont(fontname);
162 
163  if (font)
164  {
165  MythFontProperties fontcopy = *font;
166  int screenHeight = GetMythMainWindow()->GetUIScreenRect().height();
167  fontcopy.Rescale(screenHeight);
168  int fontStretch = GetMythUI()->GetFontStretch();
169  fontcopy.AdjustStretch(fontStretch);
170  *m_font = fontcopy;
171  }
172  else
173  LOG(VB_GENERAL, LOG_ERR, LOC + "Unknown font: " + fontname);
174  }
175  else if (element.tagName() == "recordstatus")
176  {
177  int inttype = 0;
178  QString typ = element.attribute("type");
179  QString img = element.attribute("image");
180 
181  if (typ == "SingleRecord")
182  inttype = 1;
183  else if (typ == "TimeslotRecord")
184  inttype = 2;
185  else if (typ == "ChannelRecord")
186  inttype = 3;
187  else if (typ == "AllRecord")
188  inttype = 4;
189  else if (typ == "WeekslotRecord")
190  inttype = 5;
191  else if (typ == "FindOneRecord")
192  inttype = 6;
193  else if (typ == "OverrideRecord")
194  inttype = 7;
195 
196  LoadImage(inttype, img);
197  }
198  else if (element.tagName() == "arrow")
199  {
200  QString dir = element.attribute("direction");
201  QString image = element.attribute("image");
202 
203  if (dir == "left")
204  SetArrow(0, image);
205  else if (dir == "right")
206  SetArrow(1, image);
207  else if (dir == "up")
208  SetArrow(2, image);
209  else if (dir == "down")
210  SetArrow(3, image);
211  }
212  else
213  {
214  return MythUIType::ParseElement(filename, element, showWarnings);
215  }
216 
217  return true;
218 }
219 
221 {
222  MythUIGuideGrid *gg = dynamic_cast<MythUIGuideGrid *>(base);
223 
224  if (!gg)
225  {
226  LOG(VB_GENERAL, LOG_ERR, LOC + "bad parsing");
227  return;
228  }
229 
231  m_timeCount = gg->m_timeCount;
237  *m_font = *gg->m_font;
239 
240  m_selType = gg->m_selType;
243 
246 
247  m_fillType = gg->m_fillType;
248  m_cutdown = gg->m_cutdown;
251 
252  MythUIType::CopyFrom(base);
253 }
254 
256 {
257  MythUIGuideGrid *gg = new MythUIGuideGrid(parent, objectName());
258  gg->CopyFrom(this);
259 }
260 
261 QColor MythUIGuideGrid::calcColor(const QColor &color, int alphaMod)
262 {
263  QColor newColor(color);
264  newColor.setAlpha((int)(color.alpha() *(alphaMod / 255.0)));
265  return newColor;
266 }
267 
292 void MythUIGuideGrid::DrawSelf(MythPainter *p, int xoffset, int yoffset,
293  int alphaMod, QRect clipRect)
294 {
295  p->SetClipRect(clipRect);
296  for (int i = 0; i < m_rowCount; i++)
297  {
298  QList<UIGTCon *>::iterator it = m_allData[i].begin();
299 
300  for (; it != m_allData[i].end(); ++it)
301  {
302  UIGTCon *data = *it;
303 
304  if (data->m_recStat == 0)
305  drawBackground(p, xoffset, yoffset, data, alphaMod);
306  else if (data->m_recStat == 1)
307  drawBox(p, xoffset, yoffset, data, m_recordingColor, alphaMod);
308  else
309  drawBox(p, xoffset, yoffset, data, m_conflictingColor, alphaMod);
310  drawText(p, xoffset, yoffset, data, alphaMod);
311  }
312  }
313 
314  drawCurrent(p, xoffset, yoffset, &m_selectedItem, alphaMod);
315  // Redraw the current selection's text in case it was clobbered by the above call.
316  drawText(p, xoffset, yoffset, &m_selectedItem, alphaMod);
317 
318  for (int i = 0; i < m_rowCount; i++)
319  {
320  QList<UIGTCon *>::iterator it = m_allData[i].begin();
321 
322  for (; it != m_allData[i].end(); ++it)
323  {
324  UIGTCon *data = *it;
325  drawRecDecoration(p, xoffset, yoffset, data, alphaMod);
326  }
327  }
328 }
329 
348 void MythUIGuideGrid::drawCurrent(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
349 {
350  int breakin = 2;
351  QRect area = data->m_drawArea;
352  area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
353  area.translate(xoffset, yoffset); // Convert to global coordinates
354  area.adjust(breakin, breakin, -breakin, -breakin);
355  int status = data->m_recStat;
356 
357  if (m_selType == "roundbox")
358  {
359  QPen pen = m_drawSelLine;
360 
361  if (status == 1)
362  pen.setColor(m_recordingColor);
363  else if (status == 2)
364  pen.setColor(m_conflictingColor);
365 
366  p->DrawRoundRect(area, 10, m_drawSelFill, pen, alphaMod);
367  }
368  else if (m_selType == "highlight")
369  {
370  QBrush brush = m_drawSelFill;
371  QPen pen = m_drawSelLine;
372 
373  if (m_drawCategoryColors && data->m_categoryColor.isValid())
374  brush.setColor(calcColor(data->m_categoryColor, m_categoryAlpha));
375  else
376  brush.setColor(calcColor(m_solidColor, m_categoryAlpha));
377 
378  if (status == 1)
379  pen.setColor(m_recordingColor);
380  else if (status == 2)
381  pen.setColor(m_conflictingColor);
382 
383  brush.setColor(brush.color().lighter());
384  p->DrawRect(area, brush, pen, alphaMod);
385  }
386  else
387  {
388  // default to "box" selection type
389  QPen pen = m_drawSelLine;
390 
391  if (status == 1)
392  pen.setColor(m_recordingColor);
393  else if (status == 2)
394  pen.setColor(m_conflictingColor);
395 
396  p->DrawRect(area, m_drawSelFill, pen, alphaMod);
397  }
398 }
399 
418 void MythUIGuideGrid::drawRecDecoration(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
419 {
420  int breakin = 1;
421  QRect area = data->m_drawArea;
422  area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
423  area.translate(xoffset, yoffset); // Convert to global coordinates
424  area.adjust(breakin, breakin, -breakin, -breakin);
425 
426  // draw arrows
427  if (data->m_arrow != GridTimeNormal)
428  {
429  if (data->m_arrow & GridTimeStartsBefore)
430  {
431  if (m_verticalLayout)
432  {
433  if (m_arrowImages[2]) { // UP
434  MythUIImage *arrow = m_arrowImages[2];
435  MythRect arrowarea = arrow->GetArea();
436  arrow->DrawSelf(p, area.center().x() - (arrowarea.width() / 2),
437  area.top(), alphaMod, area);
438  }
439  }
440  else
441  {
442  if (m_arrowImages[0]) { // LEFT
443  MythUIImage *arrow = m_arrowImages[0];
444  MythRect arrowarea = arrow->GetArea();
445  arrow->DrawSelf(p, area.left(),
446  area.center().y() - (arrowarea.height() / 2),
447  alphaMod, area);
448  }
449  }
450  }
451 
452  if (data->m_arrow & GridTimeEndsAfter)
453  {
454  if (m_verticalLayout)
455  {
456  if (m_arrowImages[3]) { // BOTTOM
457  MythUIImage *arrow = m_arrowImages[3];
458  MythRect arrowarea = arrow->GetArea();
459  arrow->DrawSelf(p, area.center().x() - (arrowarea.width() / 2),
460  area.top() + area.height() - arrowarea.height(),
461  alphaMod, area);
462  }
463  }
464  else
465  {
466  if (m_arrowImages[1]) { // RIGHT
467  MythUIImage *arrow = m_arrowImages[1];
468  MythRect arrowarea = arrow->GetArea();
469  arrow->DrawSelf(p,
470  area.right() - arrowarea.width(),
471  area.center().y() - (arrowarea.height() / 2),
472  alphaMod, area);
473  }
474  }
475  }
476  }
477 
478  // draw recording status
479  if (data->m_recType != 0 && m_recImages[data->m_recType])
480  {
481  MythUIImage *image = m_recImages[data->m_recType];
482  MythRect imagearea = image->GetArea();
483  image->DrawSelf(p, area.right() - imagearea.width(),
484  area.bottom() - imagearea.height(),
485  alphaMod, area);
486  }
487 }
488 
507 void MythUIGuideGrid::drawBox(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, const QColor &color, int alphaMod)
508 {
509  int breakin = 1;
510  QRect area = data->m_drawArea;
511  area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
512  area.translate(xoffset, yoffset); // Convert to global coordinates
513  area.adjust(breakin, breakin, -breakin, -breakin);
514 
515  static const QPen nopen(Qt::NoPen);
516  p->DrawRect(area, QBrush(calcColor(color, m_categoryAlpha)), nopen, alphaMod);
517 }
518 
537 void MythUIGuideGrid::drawBackground(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
538 {
539  QColor overColor;
540  QRect overArea;
541 
542  int breakin = 1;
543  QRect area = data->m_drawArea;
544  area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
545  QColor fillColor;
546 
547  if (m_drawCategoryColors && data->m_categoryColor.isValid())
548  fillColor = calcColor(data->m_categoryColor, m_categoryAlpha);
549  else
550  fillColor = calcColor(m_solidColor, m_categoryAlpha);
551 
552  // These calculations are in the parents local coordinates
553  if (m_verticalLayout)
554  {
555  if (m_progPastCol && area.top() < m_progPastCol)
556  {
557  if (area.bottom() < m_progPastCol)
558  {
559  fillColor = fillColor.dark();
560  area.adjust(breakin, breakin, -breakin, -breakin);
561  }
562  else
563  {
564  overColor = fillColor.dark();
565  int first = m_progPastCol - area.top();
566  int second = area.height() - first;
567  overArea = area;
568  overArea.setHeight(first);
569  area.translate(0, first);
570  area.setHeight(second);
571 
572  area.adjust(0, -breakin, -breakin, -breakin);
573  overArea.adjust(0, breakin, -breakin, -breakin);
574  }
575  }
576  else
577  area.adjust(breakin, breakin, -breakin, -breakin);
578  }
579  else
580  {
581  if (m_progPastCol && area.left() < m_progPastCol)
582  {
583  if (area.right() < m_progPastCol)
584  {
585  fillColor = fillColor.dark();
586  area.adjust(breakin, breakin, -breakin, -breakin);
587  }
588  else
589  {
590  overColor = fillColor.dark();
591  int first = m_progPastCol - area.left();
592  int second = area.width() - first;
593  overArea = area;
594  overArea.setWidth(first);
595  area.translate(first, 0);
596  area.setWidth(second);
597 
598  area.adjust(0, breakin, -breakin, -breakin);
599  overArea.adjust(breakin, breakin, 0, -breakin);
600  }
601  }
602  else
603  area.adjust(breakin, breakin, -breakin, -breakin);
604  }
605 
606  if (area.width() <= 1)
607  area.setWidth(2);
608 
609  if (area.height() <= 1)
610  area.setHeight(2);
611 
612  static const QPen nopen(Qt::NoPen);
613  area.translate(xoffset, yoffset); // Convert to global coordinates
614  p->DrawRect(area, QBrush(fillColor), nopen, alphaMod);
615 
616  if (overArea.width() > 0) {
617  overArea.translate(xoffset, yoffset); // Convert to global coordinates
618  p->DrawRect(overArea, QBrush(overColor), nopen, alphaMod);
619  }
620 }
621 
638 void MythUIGuideGrid::drawText(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
639 {
640  QString msg = data->m_title;
641 
642  if (m_drawCategoryText && !data->m_category.isEmpty())
643  msg += QString(" (%1)").arg(data->m_category);
644 
645  QRect area = data->m_drawArea;
646  area.translate(m_Area.x(), m_Area.y()); // Adjust within parent
647  area.translate(xoffset, yoffset); // Convert to global coordinates
648  area.adjust(m_textOffset.x(), m_textOffset.y(),
649  -m_textOffset.x(), -m_textOffset.y());
650 
651  if (m_verticalLayout)
652  {
653  if ((data->m_arrow & GridTimeStartsBefore) && m_arrowImages[2])
654  area.setTop(area.top() + m_arrowImages[2]->GetArea().height());
655 
656  if ((data->m_arrow & GridTimeEndsAfter) && m_arrowImages[3])
657  area.setBottom(area.bottom() - m_arrowImages[3]->GetArea().height());
658  }
659  else
660  {
661  if ((data->m_arrow & GridTimeStartsBefore) && m_arrowImages[0])
662  area.setLeft(area.left() + m_arrowImages[0]->GetArea().width());
663 
664  if ((data->m_arrow & GridTimeEndsAfter) && m_arrowImages[1])
665  area.setRight(area.right() - m_arrowImages[1]->GetArea().width());
666  }
667 
668  if (area.width() <= 0 || area.height() <= 0)
669  return;
670 
671  p->DrawText(area, msg, m_justification, *m_font, alphaMod, area);
672 }
673 
674 QPoint MythUIGuideGrid::GetRowAndColumn(QPoint position)
675 {
676  for (int i = 0; i < m_rowCount; i++)
677  {
678  QList<UIGTCon *>::iterator it = m_allData[i].begin();
679 
680  for (int col = 0; it != m_allData[i].end(); ++it, ++col)
681  {
682  UIGTCon *data = *it;
683 
684  if (data->m_drawArea.contains(position))
685  {
686  return {col, i};
687  }
688  }
689  }
690  return {-1,-1};
691 }
692 
693 void MythUIGuideGrid::SetProgramInfo(int row, int col, const QRect &area,
694  const QString &title, const QString &genre,
695  int arrow, int recType, int recStat,
696  bool selected)
697 {
698  (void)col;
699  UIGTCon *data = new UIGTCon(area, title, genre, arrow, recType, recStat);
700  m_allData[row].append(data);
701 
703  {
704  data->m_categoryColor = m_categoryColors[data->m_category.toLower()];
705 
706  if (!data->m_categoryColor.isValid())
707  data->m_categoryColor = m_categoryColors["none"];
708  }
709 
710  if (selected)
711  m_selectedItem = *data;
712 }
713 
714 bool MythUIGuideGrid::parseDefaultCategoryColors(QMap<QString, QString> &catColors)
715 {
716  QFile f;
717  QStringList searchpath = GetMythUI()->GetThemeSearchPath();
718 
719  for (QStringList::const_iterator ii = searchpath.begin();
720  ii != searchpath.end(); ++ii)
721  {
722  f.setFileName(*ii + "categories.xml");
723 
724  if (f.open(QIODevice::ReadOnly))
725  break;
726  }
727 
728 #ifndef Q_OS_ANDROID // Android does not get a file handle for assets file system
729  if (f.handle() == -1)
730  {
731  LOG(VB_GENERAL, LOG_ERR, LOC + QString("Unable to open '%1'")
732  .arg(f.fileName()));
733  return false;
734  }
735 #endif
736 
737  QDomDocument doc;
738  QString errorMsg;
739  int errorLine = 0;
740  int errorColumn = 0;
741 
742  if (!doc.setContent(&f, false, &errorMsg, &errorLine, &errorColumn))
743  {
744  LOG(VB_GENERAL, LOG_ERR, LOC +
745  QString("Parsing colors: %1 at line: %2 column: %3")
746  .arg(f.fileName()).arg(errorLine).arg(errorColumn) +
747  QString("\n\t\t\t%1").arg(errorMsg));
748  f.close();
749  return false;
750  }
751 
752  f.close();
753 
754  QDomElement element = doc.documentElement();
755 
756  for (QDomNode child = element.firstChild(); !child.isNull();
757  child = child.nextSibling())
758  {
759  QDomElement info = child.toElement();
760 
761  if (!info.isNull() && info.tagName() == "catcolor")
762  {
763  QString cat = info.attribute("category");
764  QString col = info.attribute("color");
765 
766  catColors[cat.toLower()] = col;
767  }
768  }
769 
770  return true;
771 }
772 
773 void MythUIGuideGrid::SetCategoryColors(const QMap<QString, QString> &catC)
774 {
775  for (QMap<QString, QString>::const_iterator it = catC.begin();
776  it != catC.end(); ++it)
777  {
778  m_categoryColors[it.key()] = createColor(*it);
779  }
780 }
781 
782 void MythUIGuideGrid::LoadImage(int recType, const QString &file)
783 {
784  MythUIImage *uiimage = new MythUIImage(file, this, "guidegrid image");
785  uiimage->m_imageProperties.m_isThemeImage = true;
786  uiimage->SetVisible(false);
787  uiimage->Load(false);
788 
789  MythUIImage *tmp = m_recImages[recType];
790  m_recImages[recType] = uiimage;
791  delete tmp;
792 }
793 
794 void MythUIGuideGrid::SetArrow(int direction, const QString &file)
795 {
796  MythUIImage *uiimage = new MythUIImage(file, this, "guidegrid arrow");
797  uiimage->m_imageProperties.m_isThemeImage = true;
798  uiimage->SetVisible(false);
799  uiimage->Load(false);
800 
801  MythUIImage *tmp = m_arrowImages[direction];
802  m_arrowImages[direction] = uiimage;
803  delete tmp;
804 }
805 
807 {
808  for (int i = 0; i < m_rowCount; i++)
809  ResetRow(i);
810 }
811 
813 {
814  while (!m_allData[row].empty())
815  {
816  delete m_allData[row].back();
817  m_allData[row].pop_back();
818  }
819 }
820 
822 {
823  if (m_verticalLayout)
824  m_progPastCol = m_Area.y() + (m_Area.height() * ppast / 100);
825  else
826  m_progPastCol = m_Area.x() + (m_Area.width() * ppast / 100);
827 
828  SetRedraw();
829 }
830 
831 void MythUIGuideGrid::SetMultiLine(bool multiline)
832 {
833  m_multilineText = multiline;
834 
835  if (m_multilineText)
836  m_justification |= Qt::TextWordWrap;
837  else
838  m_justification &= ~Qt::TextWordWrap;
839 }
A narrow purpose widget used to show television programs and the timeslots they occupy on channels.
void SetCategoryColors(const QMap< QString, QString > &catColors)
#define ARROWIMAGESIZE
ImageProperties m_imageProperties
Definition: mythuiimage.h:183
void SetRedraw(void)
Definition: mythuitype.cpp:295
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
void ResetRow(int row)
void drawBackground(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws the background for a GuideGrid item that will not be recorded.
unsigned int uint
Definition: compat.h:140
virtual void DrawRoundRect(const QRect &area, int cornerRadius, const QBrush &fillBrush, const QPen &linePen, int alpha)
static guint32 * tmp
Definition: goom_core.c:35
#define GridTimeEndsAfter
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
void SetProgPast(int ppast)
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
MythUIImage * m_arrowImages[ARROWIMAGESIZE]
static MythPoint parsePoint(const QString &text, bool normalize=true)
MythUIImage * m_recImages[RECSTATUSSIZE]
FontMap * GetGlobalFontMap(void)
virtual void SetVisible(bool visible)
void drawCurrent(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws selection indication for a GuideGrid item.
QStringList GetThemeSearchPath(void)
void LoadImage(int, const QString &file)
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Definition: mythuitype.cpp:863
void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect) override
Draws an entire GuideGrid.
static QString getFirstText(QDomElement &element)
virtual void DrawRect(const QRect &area, const QBrush &fillBrush, const QPen &linePen, int alpha)
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.
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
void AdjustStretch(int stretch)
MythRect m_Area
Definition: mythuitype.h:249
int GetFontStretch(void) const
#define GridTimeNormal
virtual void DrawText(const QRect &r, const QString &msg, int flags, const MythFontProperties &font, int alpha, const QRect &boundRect)
Definition: mythpainter.cpp:78
const char * name
Definition: ParseText.cpp:328
MythUIHelper * GetMythUI()
#define GridTimeStartsBefore
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
void drawRecDecoration(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws decoration items for a GuideGrid item.
MythMainWindow * GetMythMainWindow(void)
bool parseDefaultCategoryColors(QMap< QString, QString > &catColors)
MythFontProperties * GetFont(const QString &text) const
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
QColor createColor(const QString &color)
Definition: x11colors.cpp:14
QList< UIGTCon * > * m_allData
MythFontProperties * GetFont(const QString &text)
#define MAX_DISPLAY_TIMES
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
#define LOC
void SetArrow(int, const QString &file)
void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect) override
void SetMultiLine(bool multiline)
#define RECSTATUSSIZE
void drawText(MythPainter *p, int xoffset, int yoffset, UIGTCon *data, int alphaMod)
Draws text strings for a GuideGrid item.
#define MAX_DISPLAY_CHANS
void SetProgramInfo(int row, int col, const QRect &area, const QString &title, const QString &genre, int arrow, int recType, int recStat, bool selected)
QPoint GetRowAndColumn(QPoint position)
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
static bool parseBool(const QString &text)
virtual void SetClipRect(const QRect &clipRect)
Definition: mythpainter.cpp:48
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
MythUIGuideGrid(MythUIType *parent, const QString &name)
QMap< QString, QColor > m_categoryColors
MythFontProperties * m_font
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
QColor calcColor(const QColor &color, int alpha)