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 }
static bool LoadBaseTheme(void)
MythScreenType * m_backgroundscreen
void LoadFonts(const QString &directory, const QString &registeredFor)
Loads the fonts in font files within the given directory structure.
static void ClearGlobalObjectStore(void)
void ReleaseFonts(const QString &registeredFor)
Removes the font references for registeredFor, and unloads the application font if it's no longer in ...
FontMap * GetGlobalFontMap(void)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
static bool CopyWindowFromBase(const QString &windowname, MythScreenType *win)
MythFontManager * GetGlobalFontManager(void)
MythUIHelper * GetMythUI()
MythScreenStack * m_background
MythMainWindow * GetMythMainWindow(void)
void Reload(void)
void Init(void)
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
QString GetFontsDir(void)
Definition: mythdirs.cpp:309
void DisableEffects(void)
void Clear(void)
MythThemeBasePrivate * d
Definition: myththemebase.h:19
Screen in which all other widgets are contained and rendered.