MythTV  master
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MythUIHelper Class Reference

#include <mythuihelper.h>

Collaboration diagram for MythUIHelper:
Collaboration graph
[legend]

Public Member Functions

void Init (MythUIMenuCallbacks &cbs)
 
void Init (void)
 
MythUIMenuCallbacksGetMenuCBs (void)
 
void LoadQtConfig (void)
 
void UpdateImageCache (void)
 
MythImageGetImageFromCache (const QString &url)
 Returns a reference counted image base on the URL. More...
 
MythImageCacheImage (const QString &url, MythImage *im, bool nodisk=false)
 
void RemoveFromCacheByURL (const QString &url)
 
void RemoveFromCacheByFile (const QString &fname)
 
bool IsImageInCache (const QString &url)
 
QString GetThemeCacheDir (void)
 
QString GetCacheDirByUrl (const QString &url)
 Look at the url being read and decide whether the cached version should go into the theme cache or the thumbnail cache. More...
 
void IncludeInCacheSize (MythImage *im)
 
void ExcludeFromCacheSize (MythImage *im)
 
bool IsScreenSetup (void)
 
bool IsTopScreenInitialized (void)
 
void GetScreenSettings (float &wmult, float &hmult)
 
void GetScreenSettings (int &width, float &wmult, int &height, float &hmult)
 
void GetScreenSettings (int &xbase, int &width, float &wmult, int &ybase, int &height, float &hmult)
 
void GetScreenBounds (int &xbase, int &ybase, int &width, int &height)
 
bool IsGeometryOverridden (void)
 
MythImageLoadCacheImage (QString srcfile, const QString &label, MythPainter *painter, ImageCacheMode cacheMode=kCacheNormal)
 Returns a reference counted image from the cache. More...
 
QString FindThemeDir (const QString &themename, bool doFallback=true)
 Returns the full path to the theme denoted by themename. More...
 
QString FindMenuThemeDir (const QString &menuname)
 Returns the full path to the menu theme denoted by menuname. More...
 
QString GetThemeDir (void)
 
QString GetThemeName (void)
 
QStringList GetThemeSearchPath (void)
 
QString GetMenuThemeDir (void)
 
QList< ThemeInfoGetThemes (ThemeType type)
 
bool FindThemeFile (QString &path)
 
QFont GetBigFont (void)
 
QFont GetMediumFont (void)
 
QFont GetSmallFont (void)
 
void DisableScreensaver (void)
 
void RestoreScreensaver (void)
 
void ResetScreensaver (void)
 
void DoDisableScreensaver (void)
 
void DoRestoreScreensaver (void)
 
void DoResetScreensaver (void)
 
bool GetScreensaverEnabled (void)
 
bool GetScreenIsAsleep (void)
 
void AddCurrentLocation (const QString &location)
 
QString RemoveCurrentLocation (void)
 
QString GetCurrentLocation (bool fullPath=false, bool mainStackOnly=true)
 
MThreadPoolGetImageThreadPool (void)
 
double GetPixelAspectRatio (void) const
 
QSize GetBaseSize (void) const
 
void SetFontStretch (int stretch)
 
int GetFontStretch (void) const
 

Static Public Member Functions

static void ParseGeometryOverride (const QString &geometry)
 Parse an X11 style command line geometry string. More...
 
static void SetX11Display (const QString &display)
 This needs to be set before MythUIHelper is initialized so that the MythUIHelper::Init() can detect Xinerama setups. More...
 
static QString GetX11Display (void)
 
static MythUIHelpergetMythUI (void)
 
static void destroyMythUI (void)
 

Static Public Attributes

static QString x11_display
 

Protected Member Functions

 MythUIHelper ()
 
 ~MythUIHelper ()
 

Private Member Functions

void InitializeScreenSettings (void)
 
void ClearOldImageCache (void)
 
void RemoveCacheDir (const QString &dirname)
 
void PruneCacheDir (const QString &dirname)
 Remove all files in the cache that haven't been accessed in a user configurable number of days. More...
 

Private Attributes

MythUIHelperPrivated {nullptr}
 
QMutex m_locationLock
 
QStringList m_currentLocation
 

Detailed Description

Definition at line 41 of file mythuihelper.h.

Constructor & Destructor Documentation

◆ MythUIHelper()

MythUIHelper::MythUIHelper ( )
protected

Definition at line 408 of file mythuihelper.cpp.

Referenced by getMythUI().

◆ ~MythUIHelper()

MythUIHelper::~MythUIHelper ( )
protected

Definition at line 413 of file mythuihelper.cpp.

Member Function Documentation

◆ Init() [1/2]

void MythUIHelper::Init ( MythUIMenuCallbacks cbs)

◆ Init() [2/2]

void MythUIHelper::Init ( void  )

Definition at line 435 of file mythuihelper.cpp.

◆ GetMenuCBs()

MythUIMenuCallbacks * MythUIHelper::GetMenuCBs ( void  )

Definition at line 440 of file mythuihelper.cpp.

Referenced by MythThemedMenu::handleAction().

◆ LoadQtConfig()

void MythUIHelper::LoadQtConfig ( void  )

◆ UpdateImageCache()

void MythUIHelper::UpdateImageCache ( void  )

Definition at line 515 of file mythuihelper.cpp.

Referenced by MythMainWindow::Init().

◆ GetImageFromCache()

MythImage * MythUIHelper::GetImageFromCache ( const QString &  url)

Returns a reference counted image base on the URL.

Note
The reference count is set for one use call DecrRef() to delete.

Definition at line 538 of file mythuihelper.cpp.

Referenced by LoadCacheImage().

◆ CacheImage()

MythImage * MythUIHelper::CacheImage ( const QString &  url,
MythImage im,
bool  nodisk = false 
)

Definition at line 585 of file mythuihelper.cpp.

Referenced by LoadCacheImage(), and ImageLoader::LoadImage().

◆ RemoveFromCacheByURL()

void MythUIHelper::RemoveFromCacheByURL ( const QString &  url)

Definition at line 698 of file mythuihelper.cpp.

Referenced by LoadCacheImage(), and RemoveFromCacheByFile().

◆ RemoveFromCacheByFile()

void MythUIHelper::RemoveFromCacheByFile ( const QString &  fname)

◆ IsImageInCache()

bool MythUIHelper::IsImageInCache ( const QString &  url)

Definition at line 759 of file mythuihelper.cpp.

◆ GetThemeCacheDir()

QString MythUIHelper::GetThemeCacheDir ( void  )

Definition at line 772 of file mythuihelper.cpp.

Referenced by ClearOldImageCache(), GetCacheDirByUrl(), and RemoveFromCacheByFile().

◆ GetCacheDirByUrl()

QString MythUIHelper::GetCacheDirByUrl ( const QString &  url)

Look at the url being read and decide whether the cached version should go into the theme cache or the thumbnail cache.

Parameters
urlThe resource being read.
Returns
The path name of the appropriate cache directory.

Definition at line 798 of file mythuihelper.cpp.

Referenced by CacheImage(), LoadCacheImage(), and RemoveFromCacheByURL().

◆ IncludeInCacheSize()

void MythUIHelper::IncludeInCacheSize ( MythImage im)

Definition at line 565 of file mythuihelper.cpp.

Referenced by MythImage::DecrRef().

◆ ExcludeFromCacheSize()

void MythUIHelper::ExcludeFromCacheSize ( MythImage im)

Definition at line 575 of file mythuihelper.cpp.

Referenced by MythImage::IncrRef().

◆ IsScreenSetup()

bool MythUIHelper::IsScreenSetup ( void  )

◆ IsTopScreenInitialized()

bool MythUIHelper::IsTopScreenInitialized ( void  )

Definition at line 450 of file mythuihelper.cpp.

Referenced by Frontend::PlayRecording(), and NetworkControl::processPlay().

◆ GetScreenSettings() [1/3]

void MythUIHelper::GetScreenSettings ( float &  wmult,
float &  hmult 
)

◆ GetScreenSettings() [2/3]

void MythUIHelper::GetScreenSettings ( int &  width,
float &  wmult,
int &  height,
float &  hmult 
)

Definition at line 985 of file mythuihelper.cpp.

◆ GetScreenSettings() [3/3]

void MythUIHelper::GetScreenSettings ( int &  xbase,
int &  width,
float &  wmult,
int &  ybase,
int &  height,
float &  hmult 
)

Definition at line 995 of file mythuihelper.cpp.

◆ GetScreenBounds()

void MythUIHelper::GetScreenBounds ( int &  xbase,
int &  ybase,
int &  width,
int &  height 
)

Definition at line 969 of file mythuihelper.cpp.

Referenced by TV::Init().

◆ ParseGeometryOverride()

void MythUIHelper::ParseGeometryOverride ( const QString &  geometry)
static

Parse an X11 style command line geometry string.

Accepts strings like -geometry 800x600 or -geometry 800x600+112+22 to override the fullscreen and user default screen dimensions

Definition at line 1017 of file mythuihelper.cpp.

Referenced by main().

◆ IsGeometryOverridden()

bool MythUIHelper::IsGeometryOverridden ( void  )

Definition at line 1113 of file mythuihelper.cpp.

Referenced by MythMainWindow::Init(), and MythMainWindow::Show().

◆ LoadCacheImage()

MythImage * MythUIHelper::LoadCacheImage ( QString  srcfile,
const QString &  label,
MythPainter painter,
ImageCacheMode  cacheMode = kCacheNormal 
)

Returns a reference counted image from the cache.

Note
The reference count is set for one use call DecrRef() to delete.

Definition at line 1382 of file mythuihelper.cpp.

Referenced by MythUIImage::Load(), and ImageLoader::LoadImage().

◆ FindThemeDir()

QString MythUIHelper::FindThemeDir ( const QString &  themename,
bool  doFallback = true 
)

Returns the full path to the theme denoted by themename.

If the theme cannot be found falls back to the DEFAULT_UI_THEME. If the DEFAULT_UI_THEME doesn't exist then returns an empty string.

Parameters
themenameThe theme name.
doFallbackIf true and the theme isn't found, allow fallback to the default theme. If false and the theme isn't found, then return an empty string.
Returns
Path to theme or empty string.

Definition at line 1132 of file mythuihelper.cpp.

Referenced by GetThemeSearchPath(), LoadQtConfig(), main(), reloadTheme(), and resetTheme().

◆ FindMenuThemeDir()

QString MythUIHelper::FindMenuThemeDir ( const QString &  menuname)

Returns the full path to the menu theme denoted by menuname.

If the theme cannot be found falls back to the default menu. If the default menu theme doesn't exist then returns an empty string.

Parameters
menunameThe menutheme name.
Returns
Path to theme or empty string.

Definition at line 1200 of file mythuihelper.cpp.

Referenced by LoadQtConfig().

◆ GetThemeDir()

QString MythUIHelper::GetThemeDir ( void  )

◆ GetThemeName()

QString MythUIHelper::GetThemeName ( void  )

Definition at line 1248 of file mythuihelper.cpp.

Referenced by NetworkControl::processTheme().

◆ GetThemeSearchPath()

QStringList MythUIHelper::GetThemeSearchPath ( void  )

◆ GetMenuThemeDir()

QString MythUIHelper::GetMenuThemeDir ( void  )

Definition at line 1238 of file mythuihelper.cpp.

Referenced by MythThemedMenu::findMenuFile().

◆ GetThemes()

QList< ThemeInfo > MythUIHelper::GetThemes ( ThemeType  type)

Definition at line 1311 of file mythuihelper.cpp.

Referenced by GetThemeSearchPath(), and MenuTheme().

◆ FindThemeFile()

bool MythUIHelper::FindThemeFile ( QString &  path)

Definition at line 1344 of file mythuihelper.cpp.

Referenced by MythUIWebBrowser::Init(), MythImage::Load(), and LoadCacheImage().

◆ GetBigFont()

QFont MythUIHelper::GetBigFont ( void  )

Definition at line 1520 of file mythuihelper.cpp.

◆ GetMediumFont()

QFont MythUIHelper::GetMediumFont ( void  )

Definition at line 1529 of file mythuihelper.cpp.

Referenced by VisualBase::drawWarning().

◆ GetSmallFont()

QFont MythUIHelper::GetSmallFont ( void  )

Definition at line 1538 of file mythuihelper.cpp.

◆ DisableScreensaver()

void MythUIHelper::DisableScreensaver ( void  )

◆ RestoreScreensaver()

void MythUIHelper::RestoreScreensaver ( void  )

◆ ResetScreensaver()

void MythUIHelper::ResetScreensaver ( void  )

◆ DoDisableScreensaver()

void MythUIHelper::DoDisableScreensaver ( void  )

◆ DoRestoreScreensaver()

void MythUIHelper::DoRestoreScreensaver ( void  )

◆ DoResetScreensaver()

void MythUIHelper::DoResetScreensaver ( void  )

Definition at line 1595 of file mythuihelper.cpp.

Referenced by MythMainWindow::customEvent().

◆ GetScreensaverEnabled()

bool MythUIHelper::GetScreensaverEnabled ( void  )

Definition at line 1604 of file mythuihelper.cpp.

◆ GetScreenIsAsleep()

bool MythUIHelper::GetScreenIsAsleep ( void  )

Definition at line 1609 of file mythuihelper.cpp.

◆ SetX11Display()

void MythUIHelper::SetX11Display ( const QString &  display)
static

This needs to be set before MythUIHelper is initialized so that the MythUIHelper::Init() can detect Xinerama setups.

Definition at line 1619 of file mythuihelper.cpp.

Referenced by main().

◆ GetX11Display()

QString MythUIHelper::GetX11Display ( void  )
static

Definition at line 1624 of file mythuihelper.cpp.

Referenced by MythXDisplay::Open().

◆ getMythUI()

MythUIHelper * MythUIHelper::getMythUI ( void  )
static

Definition at line 50 of file mythuihelper.cpp.

Referenced by GetMythUI(), and OSD::OverrideUIScale().

◆ destroyMythUI()

void MythUIHelper::destroyMythUI ( void  )
static

Definition at line 72 of file mythuihelper.cpp.

Referenced by DestroyMythUI().

◆ AddCurrentLocation()

void MythUIHelper::AddCurrentLocation ( const QString &  location)

◆ RemoveCurrentLocation()

QString MythUIHelper::RemoveCurrentLocation ( void  )

◆ GetCurrentLocation()

QString MythUIHelper::GetCurrentLocation ( bool  fullPath = false,
bool  mainStackOnly = true 
)

◆ GetImageThreadPool()

MThreadPool * MythUIHelper::GetImageThreadPool ( void  )

Definition at line 1700 of file mythuihelper.cpp.

Referenced by MythUIImage::Load(), and MythUIImage::~MythUIImage().

◆ GetPixelAspectRatio()

double MythUIHelper::GetPixelAspectRatio ( void  ) const

Definition at line 1705 of file mythuihelper.cpp.

◆ GetBaseSize()

QSize MythUIHelper::GetBaseSize ( void  ) const

◆ SetFontStretch()

void MythUIHelper::SetFontStretch ( int  stretch)

Definition at line 1715 of file mythuihelper.cpp.

Referenced by OSD::OverrideUIScale(), and OSD::RevertUIScale().

◆ GetFontStretch()

int MythUIHelper::GetFontStretch ( void  ) const

◆ InitializeScreenSettings()

void MythUIHelper::InitializeScreenSettings ( void  )
private

◆ ClearOldImageCache()

void MythUIHelper::ClearOldImageCache ( void  )
private

Definition at line 805 of file mythuihelper.cpp.

Referenced by UpdateImageCache().

◆ RemoveCacheDir()

void MythUIHelper::RemoveCacheDir ( const QString &  dirname)
private

Definition at line 856 of file mythuihelper.cpp.

Referenced by ClearOldImageCache().

◆ PruneCacheDir()

void MythUIHelper::PruneCacheDir ( const QString &  dirname)
private

Remove all files in the cache that haven't been accessed in a user configurable number of days.

The default number of days is seven.

Parameters
dirnameThe directory to prune.

Definition at line 900 of file mythuihelper.cpp.

Referenced by destroyMythUI(), and UpdateImageCache().

Member Data Documentation

◆ x11_display

QString MythUIHelper::x11_display
static

Definition at line 122 of file mythuihelper.h.

Referenced by GetX11Display(), and SetX11Display().

◆ d

MythUIHelperPrivate* MythUIHelper::d {nullptr}
private

◆ m_locationLock

QMutex MythUIHelper::m_locationLock
private

Definition at line 152 of file mythuihelper.h.

Referenced by AddCurrentLocation(), GetCurrentLocation(), and RemoveCurrentLocation().

◆ m_currentLocation

QStringList MythUIHelper::m_currentLocation
private

Definition at line 153 of file mythuihelper.h.

Referenced by AddCurrentLocation(), GetCurrentLocation(), and RemoveCurrentLocation().


The documentation for this class was generated from the following files: