MythTV  master
interactivescreen.cpp
Go to the documentation of this file.
2 
4  const QString &name) :
5  MythScreenType((MythScreenType*)nullptr, name),
6  m_player(player)
7 {
8  UpdateArea();
9 }
10 
12 {
13  if (m_player)
14  m_player->SetVideoResize(QRect());
15 }
16 
18 {
19  if (m_ChildrenList.isEmpty())
20  {
21  m_safeArea = QRect();
22  }
23  else if (m_player && m_player->GetVideoOutput())
24  {
25  float tmp = 0.0;
26  QRect dummy;
28  }
30 }
31 
33 {
34  UpdateArea();
35 
36  QRegion visible;
37  QListIterator<MythUIType *> i(m_ChildrenList);
38  while (i.hasNext())
39  {
40  MythUIType *img = i.next();
41  visible = visible.united(img->GetArea());
42  }
43 
44  if (visible.isEmpty())
45  return;
46 
47  QRect bounding = visible.boundingRect();
48  bounding = bounding.translated(m_safeArea.topLeft());
49  bounding = m_safeArea.intersected(bounding);
50  int left = m_safeArea.left() - bounding.left();
51  int top = m_safeArea.top() - bounding.top();
52  SetArea(MythRect(bounding));
53 
54  i.toFront();;
55  while (i.hasNext())
56  {
57  MythUIType *img = i.next();
58  img->SetArea(img->GetArea().translated(left, top));
59  }
60 }
MythVideoOutput::GetOSDBounds
virtual void GetOSDBounds(QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const
Definition: mythvideoout.cpp:458
MythPlayer::GetVideoOutput
MythVideoOutput * GetVideoOutput(void)
Definition: mythplayer.h:281
MythUIType::m_ChildrenList
QList< MythUIType * > m_ChildrenList
Definition: mythuitype.h:228
MythPlayer::SetVideoResize
void SetVideoResize(const QRect &videoRect)
Definition: mythplayer.cpp:5193
MythUIType::SetArea
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:589
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
MythPlayer
Definition: mythplayer.h:164
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
InteractiveScreen::Close
void Close() override
Definition: interactivescreen.cpp:11
tmp
static guint32 * tmp
Definition: goom_core.cpp:30
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:864
InteractiveScreen::InteractiveScreen
InteractiveScreen(MythPlayer *player, const QString &name)
Definition: interactivescreen.cpp:3
interactivescreen.h
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
InteractiveScreen::m_player
MythPlayer * m_player
Definition: interactivescreen.h:24
InteractiveScreen::UpdateArea
void UpdateArea(void)
Definition: interactivescreen.cpp:17
InteractiveScreen::m_safeArea
QRect m_safeArea
Definition: interactivescreen.h:25
InteractiveScreen::OptimiseDisplayedArea
void OptimiseDisplayedArea(void)
Definition: interactivescreen.cpp:32