MythTV  master
myththemebase.cpp
Go to the documentation of this file.
1 #include "myththemebase.h"
2 #include "mythuiimage.h"
3 #include "mythmainwindow.h"
4 #include "mythscreentype.h"
5 #include "xmlparsebase.h"
6 #include "mythfontproperties.h"
7 #include "mythfontmanager.h"
8 
9 #include "mythdirs.h"
10 #include "mythuihelper.h"
11 
13 {
14  public:
17 };
18 
19 
21 {
22  d = new MythThemeBasePrivate();
23 
24  Init();
25 }
26 
28 {
33  delete d;
34 }
35 
37 {
41  GetGlobalFontManager()->LoadFonts(GetMythUI()->GetThemeDir(), "UI");
43 
44  d->m_background->PopScreen(nullptr, false, true);
45 
46  d->m_backgroundscreen = new MythScreenType(d->m_background, "backgroundscreen");
47 
48  if (!XMLParseBase::CopyWindowFromBase("backgroundwindow",
50  {
51  // Nada. All themes should use the MythUI code now.
52  }
53 
55 }
56 
58 {
59  MythMainWindow *mainWindow = GetMythMainWindow();
60 
61  d->m_background = new MythScreenStack(mainWindow, "background");
63 
65  GetGlobalFontManager()->LoadFonts(GetMythUI()->GetThemeDir(), "UI");
67  d->m_backgroundscreen = new MythScreenType(d->m_background, "backgroundscreen");
68 
69  if (!XMLParseBase::CopyWindowFromBase("backgroundwindow",
71  {
72  // Nada. All themes should use the MythUI code now.
73  }
74 
76 
77  new MythScreenStack(mainWindow, "main stack", true);
78 
79  new MythScreenStack(mainWindow, "popup stack");
80 }
GetGlobalFontMap
FontMap * GetGlobalFontMap(void)
Definition: mythfontproperties.cpp:572
XMLParseBase::LoadBaseTheme
static bool LoadBaseTheme(void)
Definition: xmlparsebase.cpp:843
MythScreenStack::DisableEffects
void DisableEffects(void)
Definition: mythscreenstack.h:36
XMLParseBase::ClearGlobalObjectStore
static void ClearGlobalObjectStore(void)
Definition: xmlparsebase.cpp:358
MythScreenStack
Definition: mythscreenstack.h:16
GetFontsDir
QString GetFontsDir(void)
Definition: mythdirs.cpp:309
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
mythdirs.h
MythThemeBasePrivate::m_background
MythScreenStack * m_background
Definition: myththemebase.cpp:15
mythuiimage.h
mythfontmanager.h
MythThemeBase::Reload
void Reload(void)
Definition: myththemebase.cpp:36
FontMap::Clear
void Clear(void)
Definition: mythfontproperties.cpp:542
MythThemeBasePrivate
Definition: myththemebase.cpp:13
mythfontproperties.h
MythThemeBasePrivate::m_backgroundscreen
MythScreenType * m_backgroundscreen
Definition: myththemebase.cpp:16
MythThemeBase::~MythThemeBase
~MythThemeBase()
Definition: myththemebase.cpp:27
XMLParseBase::CopyWindowFromBase
static bool CopyWindowFromBase(const QString &windowname, MythScreenType *win)
Definition: xmlparsebase.cpp:917
GetGlobalFontManager
MythFontManager * GetGlobalFontManager(void)
Definition: mythfontmanager.cpp:274
xmlparsebase.h
MythThemeBase::d
MythThemeBasePrivate * d
Definition: myththemebase.h:19
mythuihelper.h
MythFontManager::LoadFonts
void LoadFonts(const QString &directory, const QString &registeredFor)
Loads the fonts in font files within the given directory structure.
Definition: mythfontmanager.cpp:28
myththemebase.h
MythScreenStack::PopScreen
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
Definition: mythscreenstack.cpp:83
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
MythThemeBase::Init
void Init(void)
Definition: myththemebase.cpp:57
MythFontManager::ReleaseFonts
void ReleaseFonts(const QString &registeredFor)
Removes the font references for registeredFor, and unloads the application font if it's no longer in ...
Definition: mythfontmanager.cpp:102
MythThemeBase::MythThemeBase
MythThemeBase()
Definition: myththemebase.cpp:20
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:81
mythmainwindow.h
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
MythMainWindow
Definition: mythmainwindow.h:33
mythscreentype.h