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 (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, 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 &filename)
 
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 (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 (QString dirname)
 Remove all files in the cache that haven't been accessed in a user configurable number of days. More...
 

Private Attributes

MythUIHelperPrivated
 
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 431 of file mythuihelper.cpp.

Referenced by getMythUI().

◆ ~MythUIHelper()

MythUIHelper::~MythUIHelper ( )
protected

Definition at line 436 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 458 of file mythuihelper.cpp.

◆ GetMenuCBs()

MythUIMenuCallbacks * MythUIHelper::GetMenuCBs ( void  )

Definition at line 463 of file mythuihelper.cpp.

Referenced by MythThemedMenu::handleAction().

◆ LoadQtConfig()

void MythUIHelper::LoadQtConfig ( void  )

◆ UpdateImageCache()

void MythUIHelper::UpdateImageCache ( void  )

Definition at line 538 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 561 of file mythuihelper.cpp.

Referenced by LoadCacheImage().

◆ CacheImage()

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

Definition at line 608 of file mythuihelper.cpp.

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

◆ RemoveFromCacheByURL()

void MythUIHelper::RemoveFromCacheByURL ( const QString &  url)

Definition at line 721 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 782 of file mythuihelper.cpp.

◆ GetThemeCacheDir()

QString MythUIHelper::GetThemeCacheDir ( void  )

Definition at line 795 of file mythuihelper.cpp.

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

◆ GetCacheDirByUrl()

QString MythUIHelper::GetCacheDirByUrl ( 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 821 of file mythuihelper.cpp.

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

◆ IncludeInCacheSize()

void MythUIHelper::IncludeInCacheSize ( MythImage im)

Definition at line 588 of file mythuihelper.cpp.

Referenced by MythImage::DecrRef().

◆ ExcludeFromCacheSize()

void MythUIHelper::ExcludeFromCacheSize ( MythImage im)

Definition at line 598 of file mythuihelper.cpp.

Referenced by MythImage::IncrRef().

◆ IsScreenSetup()

bool MythUIHelper::IsScreenSetup ( void  )

◆ IsTopScreenInitialized()

bool MythUIHelper::IsTopScreenInitialized ( void  )

Definition at line 473 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 1008 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 1018 of file mythuihelper.cpp.

◆ GetScreenBounds()

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

Definition at line 992 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 1040 of file mythuihelper.cpp.

Referenced by main().

◆ IsGeometryOverridden()

bool MythUIHelper::IsGeometryOverridden ( void  )

Definition at line 1136 of file mythuihelper.cpp.

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

◆ LoadCacheImage()

MythImage * MythUIHelper::LoadCacheImage ( QString  srcfile,
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 1405 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 1155 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 1223 of file mythuihelper.cpp.

Referenced by LoadQtConfig().

◆ GetThemeDir()

QString MythUIHelper::GetThemeDir ( void  )

◆ GetThemeName()

QString MythUIHelper::GetThemeName ( void  )

Definition at line 1271 of file mythuihelper.cpp.

Referenced by NetworkControl::processTheme().

◆ GetThemeSearchPath()

QStringList MythUIHelper::GetThemeSearchPath ( void  )

◆ GetMenuThemeDir()

QString MythUIHelper::GetMenuThemeDir ( void  )

Definition at line 1261 of file mythuihelper.cpp.

Referenced by MythThemedMenu::findMenuFile().

◆ GetThemes()

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

Definition at line 1334 of file mythuihelper.cpp.

Referenced by GetThemeSearchPath(), and MenuTheme().

◆ FindThemeFile()

bool MythUIHelper::FindThemeFile ( QString &  filename)

Definition at line 1367 of file mythuihelper.cpp.

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

◆ GetBigFont()

QFont MythUIHelper::GetBigFont ( void  )

Definition at line 1543 of file mythuihelper.cpp.

Referenced by MythDialog::MythDialog().

◆ GetMediumFont()

QFont MythUIHelper::GetMediumFont ( void  )

Definition at line 1552 of file mythuihelper.cpp.

Referenced by VisualBase::drawWarning(), and MythDialog::MythDialog().

◆ GetSmallFont()

QFont MythUIHelper::GetSmallFont ( void  )

Definition at line 1561 of file mythuihelper.cpp.

Referenced by MythDialog::MythDialog().

◆ 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 1618 of file mythuihelper.cpp.

Referenced by MythMainWindow::customEvent().

◆ GetScreensaverEnabled()

bool MythUIHelper::GetScreensaverEnabled ( void  )

Definition at line 1627 of file mythuihelper.cpp.

◆ GetScreenIsAsleep()

bool MythUIHelper::GetScreenIsAsleep ( void  )

Definition at line 1632 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 1642 of file mythuihelper.cpp.

Referenced by main().

◆ GetX11Display()

QString MythUIHelper::GetX11Display ( void  )
static

Definition at line 1647 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 ( 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 1723 of file mythuihelper.cpp.

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

◆ GetPixelAspectRatio()

double MythUIHelper::GetPixelAspectRatio ( void  ) const

Definition at line 1728 of file mythuihelper.cpp.

Referenced by GalleryUtil::ScaleToDest().

◆ GetBaseSize()

QSize MythUIHelper::GetBaseSize ( void  ) const

◆ SetFontStretch()

void MythUIHelper::SetFontStretch ( int  stretch)

Definition at line 1738 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 828 of file mythuihelper.cpp.

Referenced by UpdateImageCache().

◆ RemoveCacheDir()

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

Definition at line 879 of file mythuihelper.cpp.

Referenced by ClearOldImageCache().

◆ PruneCacheDir()

void MythUIHelper::PruneCacheDir ( 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 923 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
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: