MythTV  master
mythuitype.cpp
Go to the documentation of this file.
1 
2 // Own header
3 #include "mythuitype.h"
4 
5 // QT headers
6 #include <QEvent>
7 #include <QKeyEvent>
8 #include <QDomDocument>
9 
10 // XML headers
11 #include "xmlparsebase.h"
12 
13 // Mythbase headers
14 #include "mythlogging.h"
15 #include "mythmedia.h"
16 
17 // MythUI headers
18 #include "mythgesture.h"
19 #include "mythimage.h"
20 #include "mythpainter.h"
21 #include "mythmainwindow.h"
22 #include "mythfontproperties.h"
23 #include "mythuitext.h"
24 #include "mythuiimage.h"
25 #include "mythuibutton.h"
26 #include "mythuicheckbox.h"
27 #include "mythuibuttonlist.h"
28 #include "mythuitextedit.h"
29 #include "mythuiprogressbar.h"
30 #include "mythuispinbox.h"
31 #include "mythuigroup.h"
32 #include "mythgesture.h"
33 
34 #ifdef _MSC_VER
35 # include "compat.h" // random
36 #endif
37 
38 #define LOC QString("MythUIType: ")
39 
40 MythUIType::MythUIType(QObject *parent, const QString &name)
41  : QObject(parent)
42 {
43  setObjectName(name);
44 
45  m_Visible = true;
46  m_Enabled = true;
47  m_EnableInitiator = false;
48  m_Initiator = false;
49  m_Vanish = false;
50  m_Vanished = false;
51  m_CanHaveFocus = m_HasFocus = false;
52  m_Area = MythRect(0, 0, 0, 0);
53  m_MinArea = MythRect(0, 0, 0, 0);
54  m_NeedsRedraw = false;
56  m_AlphaMax = 255;
57  m_Moving = false;
58  m_XYDestination = QPoint(0, 0);
59  m_XYSpeed = QPoint(0, 0);
60  m_deferload = false;
61  m_IsDependDefault = false;
62 
63  m_Parent = nullptr;
64 
65  if (parent)
66  {
67  m_Parent = dynamic_cast<MythUIType *>(parent);
68 
69  if (m_Parent)
70  m_Parent->AddChild(this);
71  }
72 
73  m_DirtyRegion = QRegion(QRect(0, 0, 0, 0));
74 
75  m_Fonts = new FontMap();
76  m_focusOrder = 0;
77  m_Painter = nullptr;
78 
79  m_BorderColor = QColor(random() % 255, random() % 255, random() % 255);
80 }
81 
83 {
84  delete m_Fonts;
85  qDeleteAll(m_animations);
86 }
87 
93 {
94  // Reset all children
95  QMutableListIterator<MythUIType *> it(m_ChildrenList);
96 
97  while (it.hasNext())
98  {
99  it.next();
100  MythUIType *type = it.value();
101  type->Reset();
102  }
103 }
104 
109 {
110  if (!child)
111  return;
112 
113  m_ChildrenList.push_back(child);
114 }
115 
116 static QObject *qChildHelper(const char *objName, const char *inheritsClass,
117  bool recursiveSearch, const QObjectList &children)
118 {
119  if (children.isEmpty())
120  return nullptr;
121 
122  bool onlyWidgets = (inheritsClass
123  && qstrcmp(inheritsClass, "QWidget") == 0);
124  const QLatin1String oName(objName);
125 
126  for (int i = 0; i < children.size(); ++i)
127  {
128  QObject *obj = children.at(i);
129 
130  if (onlyWidgets)
131  {
132  if (obj->isWidgetType() && (!objName || obj->objectName() == oName))
133  return obj;
134  }
135  else if ((!inheritsClass || obj->inherits(inheritsClass))
136  && (!objName || obj->objectName() == oName))
137  return obj;
138 
139  if (recursiveSearch && (dynamic_cast<MythUIGroup *>(obj) != nullptr)
140  && (obj = qChildHelper(objName, inheritsClass,
141  recursiveSearch,
142  obj->children())))
143  return obj;
144  }
145 
146  return nullptr;
147 }
148 
155 MythUIType *MythUIType::GetChild(const QString &name) const
156 {
157  QObject *ret = qChildHelper(name.toLatin1().constData(), nullptr, true, children());
158 
159  if (ret)
160  return dynamic_cast<MythUIType *>(ret);
161 
162  return nullptr;
163 }
164 
170 void MythUIType::DeleteChild(const QString &name)
171 {
172  QMutableListIterator<MythUIType *> it(m_ChildrenList);
173 
174  while (it.hasNext())
175  {
176  it.next();
177  MythUIType *type = it.value();
178 
179  if (type->objectName() == name)
180  {
181  delete type;
182  it.remove();
183  return;
184  }
185  }
186 }
187 
195 {
196  if (!child)
197  return;
198 
199  QMutableListIterator<MythUIType *> it(m_ChildrenList);
200 
201  while (it.hasNext())
202  {
203  it.next();
204  MythUIType *type = it.value();
205 
206  if (type == child)
207  {
208  delete type;
209  it.remove();
210  child = nullptr;
211  return;
212  }
213  }
214 }
215 
219 QList<MythUIType *> *MythUIType::GetAllChildren(void)
220 {
221  return &m_ChildrenList;
222 }
223 
228 {
229  QList<MythUIType *>::iterator it;
230 
231  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
232  if (*it)
233  delete *it;
234 
235  m_ChildrenList.clear();
236 }
237 
246 MythUIType *MythUIType::GetChildAt(const QPoint &p, bool recursive,
247  bool focusable) const
248 {
249  if (GetArea().contains(p))
250  {
251  if (!IsVisible() || !IsEnabled())
252  return nullptr;
253 
254  if (m_ChildrenList.isEmpty())
255  return nullptr;
256 
257  /* check all children */
258  QList<MythUIType *>::const_iterator it;
259 
260  for (it = m_ChildrenList.end() - 1; it != m_ChildrenList.begin() - 1; --it)
261  {
262  if (!(*it))
263  continue;
264 
265  // If this point doesn't fall within the child's area then move on
266  // This requires that the area is actually accurate and in some
267  // cases this still isn't true
268  if (!(*it)->GetArea().contains(p - GetArea().topLeft()))
269  continue;
270 
271 
272  MythUIType *child = *it;
273 
274  if (recursive && (focusable && !child->CanTakeFocus()))
275  child = child->GetChildAt(p - GetArea().topLeft(), recursive,
276  focusable);
277 
278  if (child)
279  {
280  // NOTE: Assumes no selectible ui type will contain another
281  // selectible ui type.
282  if (focusable && !child->CanTakeFocus())
283  continue;
284 
285  return child;
286  }
287  }
288  }
289 
290  return nullptr;
291 }
292 
294 {
295  foreach (MythUIAnimation* animation, m_animations)
296  if (animation->GetTrigger() == trigger)
297  animation->Activate();
298 
299  foreach (MythUIType* uiType, m_ChildrenList)
300  uiType->ActivateAnimations(trigger);
301 }
302 
303 bool MythUIType::NeedsRedraw(void) const
304 {
305  return m_NeedsRedraw;
306 }
307 
309 {
310  m_NeedsRedraw = false;
311 
312  QList<MythUIType *>::Iterator it;
313 
314  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
315  (*it)->ResetNeedsRedraw();
316 }
317 
319 {
320  if (m_Area.width() == 0 || m_Area.height() == 0)
321  return;
322 
323  m_NeedsRedraw = true;
324 
325  if (m_DirtyRegion.isEmpty())
326  m_DirtyRegion = QRegion(m_Area.toQRect());
327  else
328  m_DirtyRegion = m_DirtyRegion.united(QRegion(m_Area.toQRect()));
329 
330  if (m_Parent)
332 }
333 
335 {
336  QRegion childRegion = child->GetDirtyArea();
337 
338  if (childRegion.isEmpty())
339  return;
340 
341  childRegion.translate(m_Area.x(), m_Area.y());
342 
343  childRegion = childRegion.intersected(m_Area.toQRect());
344 
345  m_NeedsRedraw = true;
346 
347  if (m_DirtyRegion.isEmpty())
348  m_DirtyRegion = childRegion;
349  else
350  m_DirtyRegion = m_DirtyRegion.united(childRegion);
351 
352  if (m_Parent)
354 }
355 
359 bool MythUIType::CanTakeFocus(void) const
360 {
361  return m_CanHaveFocus;
362 }
363 
368 {
369  m_CanHaveFocus = set;
370 }
371 
378 {
379  if (!GetPainter()->SupportsAnimation())
380  return;
381 
382  if (!m_Moving)
383  return;
384 
385  QPoint curXY = m_Area.topLeft().toQPoint();
387 
388  int xdir = m_XYDestination.x() - curXY.x();
389  int ydir = m_XYDestination.y() - curXY.y();
390 
391  curXY.setX(curXY.x() + m_XYSpeed.x());
392  curXY.setY(curXY.y() + m_XYSpeed.y());
393 
394  if ((xdir > 0 && curXY.x() >= m_XYDestination.x()) ||
395  (xdir < 0 && curXY.x() <= m_XYDestination.x()) ||
396  (xdir == 0))
397  {
398  m_XYSpeed.setX(0);
399  }
400 
401  if ((ydir > 0 && curXY.y() >= m_XYDestination.y()) ||
402  (ydir <= 0 && curXY.y() <= m_XYDestination.y()) ||
403  (ydir == 0))
404  {
405  m_XYSpeed.setY(0);
406  }
407 
408  SetRedraw();
409 
410  if (m_XYSpeed.x() == 0 && m_XYSpeed.y() == 0)
411  {
412  m_Moving = false;
413  emit FinishedMoving();
414  }
415 
416  m_Area.moveTopLeft(curXY);
417 }
418 
425 {
426  if (!GetPainter()->SupportsAlpha() ||
427  !GetPainter()->SupportsAnimation())
428  return;
429 
430  if (m_AlphaChangeMode == 0)
431  return;
432 
434 
435  if (m_Effects.alpha > m_AlphaMax)
437 
438  if (m_Effects.alpha < m_AlphaMin)
440 
441  // Reached limits so change direction
443  {
444  if (m_AlphaChangeMode == 2)
445  {
446  m_AlphaChange *= -1;
447  }
448  else
449  {
450  m_AlphaChangeMode = 0;
451  m_AlphaChange = 0;
452  emit FinishedFading();
453  }
454  }
455 
456  SetRedraw();
457 }
458 
466 {
467  if (!m_Visible || m_Vanished)
468  return;
469 
472 
473  QList<MythUIAnimation*>::Iterator i;
474  for (i = m_animations.begin(); i != m_animations.end(); ++i)
475  (*i)->IncrementCurrentTime();
476 
477  QList<MythUIType *>::Iterator it;
478 
479  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
480  (*it)->Pulse();
481 }
482 
483 int MythUIType::CalcAlpha(int alphamod)
484 {
485  return (int)(m_Effects.alpha * (alphamod / 255.0));
486 }
487 
488 void MythUIType::DrawSelf(MythPainter *, int, int, int, QRect)
489 {
490 }
491 
492 void MythUIType::Draw(MythPainter *p, int xoffset, int yoffset, int alphaMod,
493  QRect clipRect)
494 {
495  // NB m_DirtyRegion may be extended by HandleMovementPulse, SetRedraw
496  // or SetChildNeedsRedraw etc _AFTER_ GetDirtyArea is called.
497  // So clipRect may not include the whole of m_DirtyRegion
498  m_DirtyRegion -= QRegion(clipRect); // NB Qt >= 4.2
499 
500  if (!m_Visible || m_Vanished)
501  return;
502 
503  QRect realArea = m_Area.toQRect();
504  realArea.translate(xoffset, yoffset);
505 
506  if (!realArea.intersects(clipRect))
507  return;
508 
509  p->PushTransformation(m_Effects, m_Effects.GetCentre(m_Area, xoffset, yoffset));
510 
511  DrawSelf(p, xoffset, yoffset, alphaMod, clipRect);
512 
513  QList<MythUIType *>::Iterator it;
514 
515  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
516  {
517  (*it)->Draw(p, xoffset + m_Area.x(), yoffset + m_Area.y(),
518  CalcAlpha(alphaMod), clipRect);
519  }
520 
521  if (p->ShowBorders())
522  {
523  static const QBrush nullbrush(Qt::NoBrush);
524  QPen pen(m_BorderColor);
525  pen.setWidth(1);
526  p->DrawRect(realArea, nullbrush, pen, 255);
527 
528  if (p->ShowTypeNames())
529  {
530  MythFontProperties font;
531  font.SetFace(QFont("Droid Sans"));
532  font.SetColor(m_BorderColor);
533  font.SetPointSize(8);
534  p->DrawText(realArea, objectName(), 0, font, 255, realArea);
535  }
536  }
537 
538  p->PopTransformation();
539 }
540 
541 void MythUIType::SetPosition(int x, int y)
542 {
543  SetPosition(MythPoint(x, y));
544 }
545 
547 {
548  MythPoint pos(point);
549 
550  if (m_Parent)
552  else
553  pos.CalculatePoint(GetMythMainWindow()->GetUIScreenRect());
554 
555  if (m_Area.topLeft() == pos)
556  return;
557 
558  m_DirtyRegion = QRegion(m_Area.toQRect());
559 
560  m_Area.moveTopLeft(pos);
561 
562  RecalculateArea(false);
563 
564  SetRedraw();
565 }
566 
568 {
569  return m_Area.topLeft();
570 }
571 
572 void MythUIType::SetSize(const QSize &size)
573 {
574  if (size == m_Area.size())
575  return;
576 
577  m_DirtyRegion = QRegion(m_Area.toQRect());
578 
579  m_Area.setSize(size);
580  RecalculateArea();
581 
582  if (m_Parent)
584 
585  SetRedraw();
586 }
587 
593 void MythUIType::SetMinSize(const MythPoint &minsize)
594 {
595  MythPoint point(minsize);
596 
597  if (m_Parent)
599 
600  m_MinSize = point;
601 
602  SetRedraw();
603 }
604 
605 QSize MythUIType::GetMinSize(void) const
606 {
607  if (!m_MinSize.isValid())
608  return m_Area.size();
609 
610  return QSize(m_MinSize.x(), m_MinSize.y());
611 }
612 
613 void MythUIType::SetArea(const MythRect &rect)
614 {
615  if (rect == m_Area)
616  return;
617 
618  m_DirtyRegion = QRegion(m_Area.toQRect());
619 
620  m_Area = rect;
621  RecalculateArea();
622 
623  if (m_Parent)
625 
626  SetRedraw();
627 }
628 
632 void MythUIType::AdjustMinArea(int delta_x, int delta_y,
633  int delta_w, int delta_h)
634 {
635  // If a minsize is not set, don't use MinArea
636  if (!m_MinSize.isValid())
637  return;
638 
639  // Delta's are negative values; knock down the area
640  QRect bounded(m_Area.x() - delta_x,
641  m_Area.y() - delta_y,
642  m_Area.width() + delta_w,
643  m_Area.height() + delta_h);
644 
645  // Make sure we have not violated the min size
646  if (!bounded.isNull() || !m_Vanish)
647  {
648  QPoint center = bounded.center();
649 
650  if (bounded.isNull())
651  bounded.setSize(GetMinSize());
652  else
653  bounded.setSize(bounded.size().expandedTo(GetMinSize()));
654 
655  bounded.moveCenter(center);
656  }
657 
658  if (bounded.x() + bounded.width() > m_Area.x() + m_Area.width())
659  bounded.moveRight(m_Area.x() + m_Area.width());
660  if (bounded.y() + bounded.height() > m_Area.y() + m_Area.height())
661  bounded.moveBottom(m_Area.y() + m_Area.height());
662  if (bounded.x() < m_Area.x())
663  {
664  bounded.moveLeft(m_Area.x());
665  if (bounded.width() > m_Area.width())
666  bounded.setWidth(m_Area.width());
667  }
668  if (bounded.y() < m_Area.y())
669  {
670  bounded.moveTop(m_Area.y());
671  if (bounded.height() > m_Area.height())
672  bounded.setHeight(m_Area.height());
673  }
674 
675  m_MinArea = bounded;
676  m_Vanished = false;
677 
678  QList<MythUIType *>::iterator it;
679 
680  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
681  {
682  if (!(*it)->m_Initiator)
683  (*it)->AdjustMinArea(delta_x, delta_y, delta_w, delta_h);
684  }
685 }
686 
688 {
689  if (!m_MinSize.isValid() || !m_Vanish)
690  return;
691 
692  m_MinArea.moveLeft(0);
693  m_MinArea.moveTop(0);
694  m_MinArea.setWidth(0);
695  m_MinArea.setHeight(0);
696  m_Vanished = true;
697 
698  QList<MythUIType *>::iterator it;
699 
700  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
701  {
702  if (!(*it)->m_Initiator)
703  (*it)->VanishSibling();
704  }
705 }
706 
710 void MythUIType::SetMinAreaParent(MythRect actual_area, MythRect allowed_area,
711  MythUIType *calling_child)
712 {
713  int delta_x = 0, delta_y = 0, delta_w = 0, delta_h = 0;
714  MythRect area;
715 
716  // If a minsize is not set, don't use MinArea
717  if (!m_MinSize.isValid())
718  return;
719 
720  if (calling_child->m_Vanished)
721  {
722  actual_area.moveLeft(0);
723  actual_area.moveTop(0);
724  allowed_area.moveLeft(0);
725  allowed_area.moveTop(0);
726  }
727 
728  actual_area.translate(m_Area.x(), m_Area.y());
729  allowed_area.translate(m_Area.x(), m_Area.y());
730 
731  QList<MythUIType *>::iterator it;
732 
733  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
734  {
735  if (*it == calling_child || !(*it)->m_Initiator)
736  continue;
737 
738  if (!(*it)->m_Vanished)
739  {
740  // Find union of area(s)
741  area = (*it)->GetArea();
742  area.translate(m_Area.x(), m_Area.y());
743  actual_area = actual_area.united(area);
744 
745  area = (*it)->m_Area;
746  area.translate(m_Area.x(), m_Area.y());
747  allowed_area = allowed_area.united(area);
748  }
749  }
750 
751  // Make sure it is not larger than the area allowed
752  actual_area = actual_area.intersected(m_Area);
753  allowed_area = allowed_area.intersected(m_Area);
754 
755  if (m_Vanish && actual_area.size().isNull())
756  {
757  m_Vanished = true;
758  }
759  else
760  {
761  if (calling_child->m_Vanished)
762  {
763  delta_x = m_Area.x() - actual_area.x();
764  delta_y = m_Area.y() - actual_area.y();
765  delta_w = actual_area.width() - m_Area.width();
766  delta_h = actual_area.height() - m_Area.height();
767  }
768  else
769  {
770  delta_x = allowed_area.x() - actual_area.x();
771  delta_y = allowed_area.y() - actual_area.y();
772  delta_w = actual_area.width() - allowed_area.width();
773  delta_h = actual_area.height() - allowed_area.height();
774  }
775 
776  m_Vanished = false;
777  }
778 
779  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
780  {
781  if (*it == calling_child)
782  continue;
783 
784  if (!(*it)->m_Initiator)
785  {
786  if (m_Vanished)
787  (*it)->VanishSibling();
788  else
789  (*it)->AdjustMinArea(delta_x, delta_y, delta_w, delta_h);
790  }
791 
792  area = (*it)->GetArea();
793  area.translate(m_Area.topLeft());
794  actual_area = actual_area.united(area);
795  }
796 
797  if (m_Vanished)
798  {
799  m_MinArea.setRect(0, 0, 0, 0);
800  actual_area.setRect(0, 0, 0, 0);
801  }
802  else
803  {
804  QSize bound(actual_area.width(), actual_area.height());
805 
806  bound = bound.expandedTo(GetMinSize());
807  m_MinArea.setRect(actual_area.x(),
808  actual_area.y(),
809  actual_area.x() + bound.width(),
810  actual_area.y() + bound.height());
811  }
812 
813  if (m_Parent)
814  m_Parent->SetMinAreaParent(actual_area, m_Area, this);
815 }
816 
821 {
822  // If a minsize is not set, don't use MinArea
823  if (!m_Initiator || !m_MinSize.isValid())
824  return;
825 
826  QRect bounded(rect);
827  bool vanish = (m_Vanish && rect.isNull());
828 
829  if (vanish)
830  {
831  bounded.moveLeft(0);
832  bounded.moveTop(0);
833  }
834  else
835  {
836  QPoint center = bounded.center();
837 
838  if (bounded.isNull())
839  bounded.setSize(GetMinSize());
840  else
841  bounded.setSize(bounded.size().expandedTo(GetMinSize()));
842 
843  bounded.moveCenter(center);
844  if (bounded.x() + bounded.width() > m_Area.x() + m_Area.width())
845  bounded.moveRight(m_Area.x() + m_Area.width());
846  if (bounded.y() + bounded.height() > m_Area.y() + m_Area.height())
847  bounded.moveBottom(m_Area.y() + m_Area.height());
848  if (bounded.x() < m_Area.x())
849  {
850  bounded.moveLeft(m_Area.x());
851  if (bounded.width() > m_Area.width())
852  bounded.setWidth(m_Area.width());
853  }
854  if (bounded.y() < m_Area.y())
855  {
856  bounded.moveTop(m_Area.y());
857  if (bounded.height() > m_Area.height())
858  bounded.setHeight(m_Area.height());
859  }
860  }
861 
862  m_MinArea = bounded;
863  m_Vanished = vanish;
864 
865  if (m_Parent)
867 }
868 
870 {
871  QSize childSize = rect.size();
872  QSize size = m_Area.size();
873 
874  if (childSize == size)
875  return;
876 
877  SetSize(size.expandedTo(childSize));
878  SetRedraw();
879 }
880 
886 {
887  if (m_Vanished || m_MinArea.isValid())
888  return m_MinArea;
889 
890  return m_Area;
891 }
892 
894 {
895  return m_Area;
896 }
897 
898 QRegion MythUIType::GetDirtyArea(void) const
899 {
900  return m_DirtyRegion;
901 }
902 
903 bool MythUIType::IsVisible(bool recurse) const
904 {
905  if (recurse)
906  {
907  if (m_Parent && !m_Parent->IsVisible(recurse))
908  return false;
909  }
910 
911  return m_Visible;
912 }
913 
914 void MythUIType::MoveTo(QPoint destXY, QPoint speedXY)
915 {
916  if (!GetPainter()->SupportsAnimation())
917  return;
918 
919  if (destXY.x() == m_Area.x() && destXY.y() == m_Area.y())
920  return;
921 
922  m_Moving = true;
923 
924  m_XYDestination = destXY;
925  m_XYSpeed = speedXY;
926 }
927 
928 void MythUIType::AdjustAlpha(int mode, int alphachange, int minalpha,
929  int maxalpha)
930 {
931  if (!GetPainter()->SupportsAlpha())
932  return;
933 
934  m_AlphaChangeMode = mode;
935  m_AlphaChange = alphachange;
936  m_AlphaMin = minalpha;
937  m_AlphaMax = maxalpha;
938 
939  if (m_Effects.alpha > m_AlphaMax)
941 
942  if (m_Effects.alpha < m_AlphaMin)
944 }
945 
946 void MythUIType::SetAlpha(int newalpha)
947 {
948  if (m_Effects.alpha == newalpha)
949  return;
950 
951  m_Effects.alpha = newalpha;
952  SetRedraw();
953 }
954 
955 int MythUIType::GetAlpha(void) const
956 {
957  return m_Effects.alpha;
958 }
959 
961 {
962  m_Effects.centre = centre;
963 }
964 
965 void MythUIType::SetZoom(float zoom)
966 {
967  SetHorizontalZoom(zoom);
968  SetVerticalZoom(zoom);
969 }
970 
972 {
973  m_Effects.hzoom = zoom;
974  SetRedraw();
975 }
976 
978 {
979  m_Effects.vzoom = zoom;
980  SetRedraw();
981 }
982 
983 void MythUIType::SetAngle(float angle)
984 {
985  m_Effects.angle = angle;
986  SetRedraw();
987 }
988 
993 bool MythUIType::keyPressEvent(QKeyEvent * /*event*/)
994 {
995  return false;
996 }
997 
998 
999 void MythUIType::customEvent(QEvent * /*event*/)
1000 {
1001  return;
1002 }
1003 
1010 {
1011  return false;
1012 }
1013 
1019 {
1020  return;
1021 }
1022 
1024 {
1025  if (!m_CanHaveFocus || !m_HasFocus)
1026  return;
1027 
1028  emit LosingFocus();
1029  m_HasFocus = false;
1030  Refresh();
1031 }
1032 
1034 {
1035  if (!m_CanHaveFocus || m_HasFocus)
1036  return false;
1037 
1038  m_HasFocus = true;
1039  Refresh();
1040  emit TakingFocus();
1041  return true;
1042 }
1043 
1045 {
1046 }
1047 
1049 {
1050  SetRedraw();
1051 }
1052 
1053 void MythUIType::UpdateDependState(MythUIType *dependee, bool isDefault)
1054 {
1055  bool visible = false;
1056 
1057  if (dependee)
1058  {
1059  bool reverse = m_ReverseDepend[dependee];
1060  visible = reverse ? !isDefault : isDefault;
1061  for (int i = 0; i < m_dependsValue.size(); i++)
1062  {
1063  if (m_dependsValue[i].first != dependee)
1064  continue;
1065  m_dependsValue[i].second = visible;
1066  break;
1067  }
1068  }
1069 
1070  if (m_dependsValue.size() > 0)
1071  visible = m_dependsValue[0].second;
1072  for (int i = 1; i < m_dependsValue.size(); i++)
1073  {
1074  bool v = m_dependsValue[i].second;
1075 
1076  if (((i-1) < m_dependOperator.size()) &&
1077  m_dependOperator[i-1] == 1)
1078  {
1079  // OR operator
1080  visible = visible && v;
1081  }
1082  else
1083  {
1084  // AND operator
1085  visible = visible || v;
1086  }
1087  }
1088 
1089  m_IsDependDefault = visible;
1090 
1092 }
1093 
1094 void MythUIType::UpdateDependState(bool isDefault)
1095 {
1096  MythUIType *dependee = static_cast<MythUIType*>(sender());
1097 
1098  UpdateDependState(dependee, isDefault);
1099 }
1100 
1101 void MythUIType::SetVisible(bool visible)
1102 {
1103  if (visible == m_Visible)
1104  return;
1105 
1106  if (visible && m_IsDependDefault)
1107  return;
1108 
1109  m_Visible = visible;
1110  SetRedraw();
1111 
1112  if (m_Visible)
1113  emit Showing();
1114  else
1115  emit Hiding();
1116 }
1117 
1119 {
1120  m_IsDependDefault = isDefault;
1121 }
1122 
1123 void MythUIType::SetEnabled(bool enable)
1124 {
1125  if (m_Enabled != enable)
1126  m_Enabled = enable;
1127 
1128  if (enable)
1129  emit Enabling();
1130  else
1131  emit Disabling();
1132 }
1133 
1135 {
1136  SetVisible(false);
1137 }
1138 
1140 {
1141  SetVisible(true);
1142 }
1143 
1144 void MythUIType::AddFocusableChildrenToList(QMap<int, MythUIType *> &focusList)
1145 {
1146  if (m_CanHaveFocus)
1147  focusList.insertMulti(m_focusOrder, this);
1148 
1149  QList<MythUIType *>::Iterator it;
1150 
1151  for (it = m_ChildrenList.end() - 1; it != m_ChildrenList.begin() - 1; --it)
1152  (*it)->AddFocusableChildrenToList(focusList);
1153 }
1154 
1155 int MythUIType::NormX(const int x)
1156 {
1157  return GetMythMainWindow()->NormX(x);
1158 }
1159 
1160 int MythUIType::NormY(const int y)
1161 {
1162  return GetMythMainWindow()->NormY(y);
1163 }
1164 
1169 {
1170  m_xmlName = base->m_xmlName;
1171  m_xmlLocation = base->m_xmlLocation;
1172  m_Visible = base->m_Visible;
1173  m_Enabled = base->m_Enabled;
1175  m_focusOrder = base->m_focusOrder;
1176 
1177  m_Area = base->m_Area;
1178  RecalculateArea();
1179 
1181  m_MinSize = base->m_MinSize;
1182  m_Vanish = base->m_Vanish;
1183  m_Vanished = false;
1184  m_Effects = base->m_Effects;
1186  m_AlphaChange = base->m_AlphaChange;
1187  m_AlphaMin = base->m_AlphaMin;
1188  m_AlphaMax = base->m_AlphaMax;
1189 
1190  m_Moving = base->m_Moving;
1192  m_XYSpeed = base->m_XYSpeed;
1193  m_deferload = base->m_deferload;
1194 
1195  QList<MythUIAnimation*>::Iterator i;
1196  for (i = base->m_animations.begin(); i != base->m_animations.end(); ++i)
1197  {
1198  MythUIAnimation* animation = new MythUIAnimation(this);
1199  animation->CopyFrom(*i);
1200  m_animations.push_back(animation);
1201  }
1202 
1203  QList<MythUIType *>::Iterator it;
1204 
1205  for (it = base->m_ChildrenList.begin(); it != base->m_ChildrenList.end();
1206  ++it)
1207  {
1208  MythUIType *child = GetChild((*it)->objectName());
1209 
1210  if (child)
1211  child->CopyFrom(*it);
1212  else
1213  (*it)->CreateCopy(this);
1214  }
1215 
1216  m_dependsMap = base->m_dependsMap;
1217 
1218  SetMinArea(base->m_MinArea);
1219 }
1220 
1226 {
1227  // Calling CreateCopy on base type is not valid
1228 }
1229 
1235  const QString &filename, QDomElement &element, bool showWarnings)
1236 {
1237  //FIXME add movement etc.
1238 
1239  if (element.tagName() == "position")
1240  SetPosition(parsePoint(element));
1241  else if (element.tagName() == "area")
1242  {
1243  SetArea(parseRect(element));
1244  }
1245  else if (element.tagName() == "minsize")
1246  {
1247  // Use parsePoint so percentages can be used
1248  if (element.hasAttribute("initiator"))
1249  m_EnableInitiator = parseBool(element.attribute("initiator"));
1250 
1251  if (element.hasAttribute("vanish"))
1252  m_Vanish = parseBool(element.attribute("vanish"));
1253 
1254  SetMinSize(parsePoint(element));
1255  }
1256  else if (element.tagName() == "alpha")
1257  {
1258  m_Effects.alpha = getFirstText(element).toInt();
1259  m_AlphaChangeMode = 0;
1260  }
1261  else if (element.tagName() == "alphapulse")
1262  {
1263  m_AlphaChangeMode = 2;
1264  m_AlphaMin = element.attribute("min", "0").toInt();
1265  m_Effects.alpha = m_AlphaMax = element.attribute("max", "255").toInt();
1266 
1267  if (m_AlphaMax > 255)
1268  m_Effects.alpha = m_AlphaMax = 255;
1269 
1270  if (m_AlphaMin < 0)
1271  m_AlphaMin = 0;
1272 
1273  m_AlphaChange = element.attribute("change", "5").toInt();
1274  }
1275  else if (element.tagName() == "focusorder")
1276  {
1277  int order = getFirstText(element).toInt();
1278  SetFocusOrder(order);
1279  }
1280  else if (element.tagName() == "loadondemand")
1281  {
1282  SetDeferLoad(parseBool(element));
1283  }
1284  else if (element.tagName() == "helptext")
1285  {
1286  m_helptext = getFirstText(element);
1287  }
1288  else if (element.tagName() == "animation")
1289  {
1290  MythUIAnimation::ParseElement(element, this);
1291  }
1292  else {
1293  if (showWarnings) {
1294  VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
1295  QString("Unknown widget type '%1'").arg(element.tagName()));
1296  }
1297  return false;
1298  }
1299 
1300  return true;
1301 }
1302 
1311 {
1312 }
1313 
1314 MythFontProperties *MythUIType::GetFont(const QString &text) const
1315 {
1316  MythFontProperties *ret = m_Fonts->GetFont(text);
1317 
1318  if (!ret && m_Parent)
1319  return m_Parent->GetFont(text);
1320 
1321  return ret;
1322 }
1323 
1325 {
1326  return m_Fonts->AddFont(text, fontProp);
1327 }
1328 
1330 {
1331  if (m_Parent)
1333  else
1334  m_Area.CalculateArea(GetMythMainWindow()->GetUIScreenRect());
1335 
1336  if (recurse)
1337  {
1338  QList<MythUIType *>::iterator it;
1339 
1340  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
1341  {
1342  (*it)->RecalculateArea(recurse);
1343  }
1344  }
1345 }
1346 
1348 {
1349  m_focusOrder = order;
1350 }
1351 
1353 {
1354  if (!child)
1355  return false;
1356 
1357  int i = m_ChildrenList.indexOf(child);
1358 
1359  if (i != -1 || i != m_ChildrenList.size() - 1)
1360  {
1361  m_ChildrenList.removeAt(i);
1362  m_ChildrenList.append(child);
1363  child->SetRedraw();
1364  return true;
1365  }
1366 
1367  return false;
1368 }
1369 
1370 
1372 {
1373  if (m_Parent)
1374  {
1375  return m_Parent->MoveChildToTop(this);
1376  }
1377 
1378  return false;
1379 }
1380 
1381 bool MythUIType::IsDeferredLoading(bool recurse) const
1382 {
1383  if (m_deferload)
1384  return true;
1385 
1386  if (recurse && m_Parent)
1387  return m_Parent->IsDeferredLoading(recurse);
1388 
1389  return false;
1390 }
1391 
1398 {
1399  QList<MythUIType *>::Iterator it;
1400 
1401  for (it = m_ChildrenList.begin(); it != m_ChildrenList.end(); ++it)
1402  (*it)->LoadNow();
1403 }
1404 
1410 bool MythUIType::ContainsPoint(const QPoint &point) const
1411 {
1412  if (m_Area.contains(point))
1413  return true;
1414 
1415  return false;
1416 }
1417 
1419 {
1420  if (m_Painter)
1421  return m_Painter;
1422 
1423  if (m_Parent)
1424  return m_Parent->GetPainter();
1425 
1426  return GetMythPainter();
1427 }
1428 
1429 void MythUIType::SetDependsMap(QMap<QString, QString> dependsMap)
1430 {
1431  m_dependsMap = dependsMap;
1432 }
1433 
1434 void MythUIType::SetReverseDependence(MythUIType *dependee, bool reverse)
1435 {
1436  m_ReverseDepend.insert(dependee, reverse);
1437 }
1438 
1440 {
1441  QMapIterator<QString, QString> it(m_dependsMap);
1442  while(it.hasNext())
1443  {
1444  it.next();
1445 
1446  // build list of operators and dependeees.
1447  QStringList dependees;
1448  QList<int> operators;
1449  QString name = it.value();
1450  QStringList tmp1 = name.split("&");
1451  for (int i = 0; i < tmp1.size(); i++)
1452  {
1453  QStringList tmp2 = tmp1[i].split("|");
1454 
1455  dependees.append(tmp2[0]);
1456  for (int j = 1; j < tmp2.size(); j++)
1457  {
1458  dependees.append(tmp2[j]);
1459  operators.append(1); // 1 is OR
1460  }
1461  operators.append(2); // 2 is AND
1462  }
1463 
1464  MythUIType *dependant = GetChild(it.key());
1465  if (dependant)
1466  {
1467  dependant->m_dependOperator = operators;
1468  foreach (QString dependeeName, dependees)
1469  {
1470  bool reverse = false;
1471  if (dependeeName.startsWith('!'))
1472  {
1473  reverse = true;
1474  dependeeName.remove(0,1);
1475  }
1476  MythUIType *dependee = GetChild(dependeeName);
1477 
1478  if (dependee)
1479  {
1480  QObject::connect(dependee, SIGNAL(DependChanged(bool)),
1481  dependant, SLOT(UpdateDependState(bool)));
1482  dependant->SetReverseDependence(dependee, reverse);
1483  dependant->m_dependsValue.append(QPair<MythUIType *, bool>(dependee, false));
1484  dependant->UpdateDependState(dependee, true);
1485  }
1486  else
1487  {
1488  dependant->m_dependsValue.append(QPair<MythUIType *, bool>(dependee, !reverse));
1489  dependant->UpdateDependState(dependee, reverse);
1490  }
1491  }
1492  }
1493  }
1494 
1495  if (recurse)
1496  {
1497  QList<MythUIType *>::iterator child;
1498  for (child = m_ChildrenList.begin(); child != m_ChildrenList.end(); ++child)
1499  {
1500  if (*child)
1501  (*child)->ConnectDependants(recurse);
1502  }
1503  }
1504 }
#define VERBOSE_XML(type, level, filename, element, msg)
Definition: xmlparsebase.h:14
QPoint toQPoint(void) const
Definition: mythrect.cpp:569
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
Definition: mythuitype.cpp:219
void FinishedMoving()
void CalculateArea(const MythRect &parentArea)
Definition: mythrect.cpp:59
QList< QPair< MythUIType *, bool > > m_dependsValue
Definition: mythuitype.h:233
QString m_helptext
Definition: mythuitype.h:274
void setHeight(const QString &sHeight)
Definition: mythrect.cpp:260
int NormX(const int width)
QMap< QString, QString > m_dependsMap
Definition: mythuitype.h:229
void Show(void)
void FinishedFading()
bool AddFont(const QString &text, MythFontProperties *fontProp)
virtual MythPainter * GetPainter(void)
void SetDependsMap(QMap< QString, QString > dependsMap)
virtual bool keyPressEvent(QKeyEvent *event)
Key event handler.
Definition: mythuitype.cpp:993
void SetVerticalZoom(float zoom)
Definition: mythuitype.cpp:977
void LosingFocus()
void SetEnabled(bool enable)
virtual ~MythUIType()
Definition: mythuitype.cpp:82
QPoint m_XYDestination
Definition: mythuitype.h:265
void customEvent(QEvent *event) override
Definition: mythuitype.cpp:999
void ResetNeedsRedraw(void)
Definition: mythuitype.cpp:308
void SetAlpha(int newalpha)
Definition: mythuitype.cpp:946
void SetRedraw(void)
Definition: mythuitype.cpp:318
void DeleteChild(const QString &name)
Delete a named child of this UIType.
Definition: mythuitype.cpp:170
MythRect m_MinArea
Definition: mythuitype.h:250
virtual bool gestureEvent(MythGestureEvent *event)
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
bool IsVisible(bool recurse=false) const
Definition: mythuitype.cpp:903
void LoseFocus()
void Enabling()
bool m_IsDependDefault
Definition: mythuitype.h:244
void HandleAlphaPulse()
Handle one frame of an alpha (transparency) change animation.
Definition: mythuitype.cpp:424
virtual void SetMinAreaParent(MythRect actual_area, MythRect full_area, MythUIType *child)
Adjust the size of sibling objects within the button.
Definition: mythuitype.cpp:710
void SetHorizontalZoom(float zoom)
Definition: mythuitype.cpp:971
MythPainter * GetMythPainter(void)
int NormX(const int x)
FontMap * m_Fonts
Definition: mythuitype.h:268
void SetReverseDependence(MythUIType *dependee, bool reverse)
int CalcAlpha(int alphamod)
Definition: mythuitype.cpp:483
bool AddFont(const QString &text, MythFontProperties *fontProp)
QPointF GetCentre(const QRect &rect, int xoff, int yoff)
void SetColor(const QColor &color)
void DeleteAllChildren(void)
Delete all child widgets.
Definition: mythuitype.cpp:227
UIEffects m_Effects
Definition: mythuitype.h:257
virtual void DrawText(const QRect &dest, const QString &msg, int flags, const MythFontProperties &font, int alpha, const QRect &boundRect)
Definition: mythpainter.cpp:80
void UpdateDependState(bool isDefault)
void ConnectDependants(bool recurse=false)
int m_focusOrder
Definition: mythuitype.h:247
QColor m_BorderColor
Definition: mythuitype.h:281
int m_AlphaMax
Definition: mythuitype.h:262
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
MythUIType(QObject *parent, const QString &name)
Definition: mythuitype.cpp:40
void CalculatePoint(const MythRect &parentArea)
Definition: mythrect.cpp:423
void SetPosition(int x, int y)
Convenience method, calls SetPosition(const MythPoint&) Override that instead to change functionality...
Definition: mythuitype.cpp:541
QList< MythUIAnimation * > m_animations
Definition: mythuitype.h:273
static MythPoint parsePoint(const QString &text, bool normalize=true)
void AddFocusableChildrenToList(QMap< int, MythUIType * > &focusList)
bool ShowTypeNames(void)
Definition: mythpainter.h:97
virtual void CreateCopy(MythUIType *parent)
Copy the state of this widget to the one given, it must be of the same type.
bool m_NeedsRedraw
Definition: mythuitype.h:255
void CopyFrom(const MythUIAnimation *animation)
virtual QRegion GetDirtyArea(void) const
Definition: mythuitype.cpp:898
void Hide(void)
virtual void SetVisible(bool visible)
void TakingFocus()
QRect toQRect(void) const
Definition: mythrect.cpp:381
int m_AlphaChange
Definition: mythuitype.h:260
void setRect(const QString &sX, const QString &sY, const QString &sWidth, const QString &sHeight, const QString &baseRes=QString())
Definition: mythrect.cpp:122
virtual void mediaEvent(MythMediaEvent *event)
Media/Device status event handler, received from MythMediaMonitor.
static void ParseElement(const QDomElement &element, MythUIType *parent)
Centre centre
virtual void PushTransformation(const UIEffects &zoom, QPointF center=QPointF())
bool MoveToTop(void)
A C++ ripoff of the stroke library for MythTV.
int NormY(const int height)
void Refresh(void)
virtual void VanishSibling(void)
Definition: mythuitype.cpp:687
void Activate()
virtual void SetMinArea(const MythRect &rect)
Set the minimum area based on the given size.
Definition: mythuitype.cpp:820
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
void DependChanged(bool isDefault)
static QString getFirstText(QDomElement &element)
int m_AlphaMin
Definition: mythuitype.h:261
virtual void SetSize(const QSize &size)
Definition: mythuitype.cpp:572
static QObject * qChildHelper(const char *objName, const char *inheritsClass, bool recursiveSearch, const QObjectList &children)
Definition: mythuitype.cpp:116
bool m_CanHaveFocus
Definition: mythuitype.h:238
virtual void DrawRect(const QRect &area, const QBrush &fillBrush, const QPen &linePen, int alpha)
void SetFocusOrder(int)
virtual void Pulse(void)
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: mythuitype.cpp:465
bool m_Initiator
Definition: mythuitype.h:241
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
void MoveTo(QPoint destXY, QPoint speedXY)
Definition: mythuitype.cpp:914
bool MoveChildToTop(MythUIType *child)
virtual void SetMinSize(const MythPoint &size)
Set the minimum size of this widget, for widgets which can be rescaled.
Definition: mythuitype.cpp:593
void moveLeft(const QString &sX)
Definition: mythrect.cpp:285
MythRect m_Area
Definition: mythuitype.h:249
MythUIType * GetChildAt(const QPoint &p, bool recursive=true, bool focusable=true) const
Return the first MythUIType at the given coordinates.
Definition: mythuitype.cpp:246
void SetPointSize(uint size)
virtual void RecalculateArea(bool recurse=true)
void ExpandArea(const MythRect &rect)
Definition: mythuitype.cpp:869
virtual void AdjustMinArea(int delta_x, int delta_y, int delta_w, int delta_h)
Adjust the size of a sibling.
Definition: mythuitype.cpp:632
void setWidth(const QString &sWidth)
Definition: mythrect.cpp:249
virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect)
Definition: mythuitype.cpp:488
A custom event that represents a mouse gesture.
Definition: mythgesture.h:39
QRegion m_DirtyRegion
Definition: mythuitype.h:254
const char * name
Definition: ParseText.cpp:339
MythPainter * m_Painter
Definition: mythuitype.h:271
bool m_Visible
Definition: mythuitype.h:236
bool m_Vanish
Definition: mythuitype.h:242
QPoint m_XYSpeed
Definition: mythuitype.h:266
virtual QSize GetMinSize(void) const
Definition: mythuitype.cpp:605
int m_AlphaChangeMode
Definition: mythuitype.h:259
void AdjustAlpha(int mode, int alphachange, int minalpha=0, int maxalpha=255)
Definition: mythuitype.cpp:928
void HandleMovementPulse()
Handle one frame of a movement animation.
Definition: mythuitype.cpp:377
virtual void LoadNow(void)
Cause images in this and child widgets to be loaded.
MythMainWindow * GetMythMainWindow(void)
void Showing()
MythFontProperties * GetFont(const QString &text) const
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:613
bool CanTakeFocus(void) const
Return if this widget can accept input focus.
Definition: mythuitype.cpp:359
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitype.cpp:92
void SetDeferLoad(bool defer)
Definition: mythuitype.h:161
bool isValid(void) const
Definition: mythrect.h:94
bool ShowBorders(void)
Definition: mythpainter.h:96
bool IsDeferredLoading(bool recurse=false) const
void SetFace(const QFont &face)
virtual MythPoint GetPosition(void) const
Definition: mythuitype.cpp:567
MythFontProperties * GetFont(const QString &text)
virtual MythRect GetFullArea(void) const
Definition: mythuitype.cpp:893
MythPoint m_MinSize
Definition: mythuitype.h:251
QMap< MythUIType *, bool > m_ReverseDepend
Definition: mythuitype.h:245
bool m_Enabled
Definition: mythuitype.h:239
MythPoint topLeft(void) const
Definition: mythrect.cpp:271
bool m_Vanished
Definition: mythuitype.h:243
void moveTopLeft(const MythPoint &point)
Definition: mythrect.cpp:279
Trigger GetTrigger(void) const
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
bool NeedsRedraw(void) const
Definition: mythuitype.cpp:303
bool IsEnabled(void) const
Definition: mythuitype.h:94
MythUIType * m_Parent
Definition: mythuitype.h:270
int NormY(const int y)
static MythRect parseRect(const QString &text, bool normalize=true)
Wrapper around QPoint allowing us to handle percentage and other relative values for positioning in m...
Definition: mythrect.h:84
void SetChildNeedsRedraw(MythUIType *child)
Definition: mythuitype.cpp:334
static long int random(void)
Definition: compat.h:147
bool TakeFocus()
bool m_EnableInitiator
Definition: mythuitype.h:240
void SetDependIsDefault(bool isDefault)
void Draw(MythPainter *p, int xoffset, int yoffset, int alphaMod=255, QRect clipRect=QRect())
Definition: mythuitype.cpp:492
bool ContainsPoint(const QPoint &point) const
Check if the given point falls within this widgets area.
void moveTop(const QString &sX)
Definition: mythrect.cpp:295
void ActivateAnimations(MythUIAnimation::Trigger trigger)
Definition: mythuitype.cpp:293
void Disabling()
bool m_deferload
Definition: mythuitype.h:279
void SetAngle(float angle)
Definition: mythuitype.cpp:983
void Hiding()
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:155
QList< int > m_dependOperator
Definition: mythuitype.h:234
bool m_Moving
Definition: mythuitype.h:264
static bool parseBool(const QString &text)
void SetCanTakeFocus(bool set=true)
Set whether this widget can take focus.
Definition: mythuitype.cpp:367
QList< MythUIType * > m_ChildrenList
Definition: mythuitype.h:228
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
QString m_xmlLocation
Definition: mythuitype.h:277
void SetCentre(UIEffects::Centre centre)
Definition: mythuitype.cpp:960
QString m_xmlName
Definition: mythuitype.h:276
void AddChild(MythUIType *child)
Add a child UIType.
Definition: mythuitype.cpp:108
void SetZoom(float zoom)
Definition: mythuitype.cpp:965
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
bool m_HasFocus
Definition: mythuitype.h:237
virtual void PopTransformation(void)
Definition: mythpainter.h:82
int GetAlpha(void) const
Definition: mythuitype.cpp:955