MythTV  0.27pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
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)
MythUIMenuCallbacksGetMenuCBs (void)
void LoadQtConfig (void)
void UpdateImageCache (void)
MythImageGetImageFromCache (const QString &url)
 Returns a reference counted image base on the URL.
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)
void IncludeInCacheSize (MythImage *im)
void ExcludeFromCacheSize (MythImage *im)
Settingsqtconfig (void)
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)
QPixmap * LoadScalePixmap (QString filename, bool fromcache=true)
QImage * LoadScaleImage (QString filename, bool fromcache=true)
MythImageLoadCacheImage (QString srcfile, QString label, MythPainter *painter, ImageCacheMode cacheMode=kCacheNormal)
 Returns a reference counted image from the cache.
void ThemeWidget (QWidget *widget)
QString FindThemeDir (const QString &themename)
 Returns the full path to the theme denoted by themename.
QString FindMenuThemeDir (const QString &menuname)
 Returns the full path to the menu theme denoted by menuname.
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.
static void SetX11Display (const QString &display)
 This needs to be set before MythUIHelper is initialized so that the MythUIHelper::Init() can detect Xinerama setups.
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 SetPalette (QWidget *widget)
void InitializeScreenSettings (void)
void ClearOldImageCache (void)
void RemoveCacheDir (const QString &dirname)

Private Attributes

MythUIHelperPrivated
QMutex m_locationLock
QStringList m_currentLocation

Detailed Description

Definition at line 42 of file mythuihelper.h.

Constructor & Destructor Documentation

MythUIHelper::MythUIHelper ( )
protected

Definition at line 386 of file mythuihelper.cpp.

Referenced by getMythUI().

MythUIHelper::~MythUIHelper ( )
protected

Definition at line 391 of file mythuihelper.cpp.

Member Function Documentation

void MythUIHelper::Init ( MythUIMenuCallbacks cbs)

Definition at line 396 of file mythuihelper.cpp.

Referenced by MythContextPrivate::Init().

MythUIMenuCallbacks * MythUIHelper::GetMenuCBs ( void  )

Definition at line 409 of file mythuihelper.cpp.

Referenced by MythThemedMenu::handleAction().

void MythUIHelper::LoadQtConfig ( void  )
void MythUIHelper::UpdateImageCache ( void  )

Definition at line 491 of file mythuihelper.cpp.

Referenced by MythMainWindow::Init().

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

Referenced by LoadCacheImage().

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

Definition at line 547 of file mythuihelper.cpp.

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

void MythUIHelper::RemoveFromCacheByURL ( const QString &  url)

Definition at line 641 of file mythuihelper.cpp.

Referenced by LoadCacheImage(), and RemoveFromCacheByFile().

void MythUIHelper::RemoveFromCacheByFile ( const QString &  fname)
bool MythUIHelper::IsImageInCache ( const QString &  url)

Definition at line 702 of file mythuihelper.cpp.

QString MythUIHelper::GetThemeCacheDir ( void  )
void MythUIHelper::IncludeInCacheSize ( MythImage im)

Definition at line 535 of file mythuihelper.cpp.

Referenced by MythImage::DecrRef().

void MythUIHelper::ExcludeFromCacheSize ( MythImage im)

Definition at line 541 of file mythuihelper.cpp.

Referenced by MythImage::IncrRef().

Settings * MythUIHelper::qtconfig ( void  )

Definition at line 486 of file mythuihelper.cpp.

Referenced by MythThemeBase::Init(), and MythThemeBase::Reload().

bool MythUIHelper::IsScreenSetup ( void  )
bool MythUIHelper::IsTopScreenInitialized ( void  )

Definition at line 419 of file mythuihelper.cpp.

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

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

Definition at line 845 of file mythuihelper.cpp.

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

Definition at line 855 of file mythuihelper.cpp.

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

Definition at line 829 of file mythuihelper.cpp.

Referenced by TV::Init().

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

Referenced by main().

bool MythUIHelper::IsGeometryOverridden ( void  )

Definition at line 975 of file mythuihelper.cpp.

QPixmap * MythUIHelper::LoadScalePixmap ( QString  filename,
bool  fromcache = true 
)
QImage * MythUIHelper::LoadScaleImage ( QString  filename,
bool  fromcache = true 
)
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 1475 of file mythuihelper.cpp.

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

void MythUIHelper::ThemeWidget ( QWidget *  widget)
QString MythUIHelper::FindThemeDir ( const QString &  themename)

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.
Returns
Path to theme or empty string.

Definition at line 991 of file mythuihelper.cpp.

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

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

Referenced by LoadQtConfig().

QString MythUIHelper::GetThemeDir ( void  )
QString MythUIHelper::GetThemeName ( void  )

Definition at line 1104 of file mythuihelper.cpp.

QStringList MythUIHelper::GetThemeSearchPath ( void  )
QString MythUIHelper::GetMenuThemeDir ( void  )

Definition at line 1094 of file mythuihelper.cpp.

Referenced by MythThemedMenu::findMenuFile().

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

Definition at line 1123 of file mythuihelper.cpp.

Referenced by MenuTheme().

bool MythUIHelper::FindThemeFile ( QString &  filename)
QFont MythUIHelper::GetBigFont ( void  )

Definition at line 1572 of file mythuihelper.cpp.

Referenced by MythDialog::MythDialog().

QFont MythUIHelper::GetMediumFont ( void  )

Definition at line 1581 of file mythuihelper.cpp.

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

QFont MythUIHelper::GetSmallFont ( void  )

Definition at line 1590 of file mythuihelper.cpp.

Referenced by MythDialog::MythDialog().

void MythUIHelper::DisableScreensaver ( void  )
void MythUIHelper::RestoreScreensaver ( void  )
void MythUIHelper::ResetScreensaver ( void  )
void MythUIHelper::DoDisableScreensaver ( void  )
void MythUIHelper::DoRestoreScreensaver ( void  )
void MythUIHelper::DoResetScreensaver ( void  )

Definition at line 1647 of file mythuihelper.cpp.

Referenced by MythMainWindow::customEvent().

bool MythUIHelper::GetScreensaverEnabled ( void  )

Definition at line 1656 of file mythuihelper.cpp.

bool MythUIHelper::GetScreenIsAsleep ( void  )

Definition at line 1661 of file mythuihelper.cpp.

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

Referenced by main().

QString MythUIHelper::GetX11Display ( void  )
static

Definition at line 1677 of file mythuihelper.cpp.

Referenced by MythXDisplay::Open().

MythUIHelper * MythUIHelper::getMythUI ( void  )
static

Definition at line 45 of file mythuihelper.cpp.

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

void MythUIHelper::destroyMythUI ( void  )
static

Definition at line 60 of file mythuihelper.cpp.

Referenced by DestroyMythUI().

void MythUIHelper::AddCurrentLocation ( QString  location)
QString MythUIHelper::RemoveCurrentLocation ( void  )
QString MythUIHelper::GetCurrentLocation ( bool  fullPath = false,
bool  mainStackOnly = true 
)
MThreadPool * MythUIHelper::GetImageThreadPool ( void  )

Definition at line 1755 of file mythuihelper.cpp.

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

double MythUIHelper::GetPixelAspectRatio ( void  ) const

Definition at line 1760 of file mythuihelper.cpp.

Referenced by GalleryUtil::ScaleToDest().

QSize MythUIHelper::GetBaseSize ( void  ) const

Definition at line 1765 of file mythuihelper.cpp.

Referenced by OSD::OverrideUIScale(), and MythFontProperties::SetPixelSize().

void MythUIHelper::SetFontStretch ( int  stretch)

Definition at line 1770 of file mythuihelper.cpp.

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

int MythUIHelper::GetFontStretch ( void  ) const
void MythUIHelper::SetPalette ( QWidget *  widget)
private

Definition at line 1156 of file mythuihelper.cpp.

Referenced by ThemeWidget().

void MythUIHelper::InitializeScreenSettings ( void  )
private
void MythUIHelper::ClearOldImageCache ( void  )
private

Definition at line 727 of file mythuihelper.cpp.

Referenced by UpdateImageCache().

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

Definition at line 791 of file mythuihelper.cpp.

Referenced by ClearOldImageCache().

Member Data Documentation

QString MythUIHelper::x11_display
static

Definition at line 127 of file mythuihelper.h.

Referenced by GetX11Display(), and SetX11Display().

MythUIHelperPrivate* MythUIHelper::d
private
QMutex MythUIHelper::m_locationLock
private

Definition at line 157 of file mythuihelper.h.

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

QStringList MythUIHelper::m_currentLocation
private

Definition at line 158 of file mythuihelper.h.

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


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