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