cTheme Class Reference

#include <themes.h>

List of all members.

Public Types

enum  { MaxThemeColors = 128 }

Public Member Functions

 cTheme (void)
 Creates a new theme class.
 ~cTheme ()
const char * Name (void)
const char * Description (void)
bool Load (const char *FileName, bool OnlyDescriptions=false)
 Loads the theme data from the given file.
bool Save (const char *FileName)
int AddColor (const char *Name, tColor Color)
tColor Color (int Subject)

Private Member Functions

bool FileNameOk (const char *FileName, bool SetName=false)

Private Attributes

char * name
char * descriptions [I18nNumLanguages]
char * colorNames [MaxThemeColors]
tColor colorValues [MaxThemeColors]


Detailed Description

Definition at line 16 of file themes.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
MaxThemeColors 

Definition at line 18 of file themes.h.


Constructor & Destructor Documentation

cTheme::cTheme ( void   ) 

Creates a new theme class.

Definition at line 18 of file themes.c.

References colorNames, colorValues, descriptions, and name.

cTheme::~cTheme (  ) 

Definition at line 27 of file themes.c.

References colorNames, descriptions, I18nNumLanguages, MaxThemeColors, and name.


Member Function Documentation

bool cTheme::FileNameOk ( const char *  FileName,
bool  SetName = false 
) [private]

Definition at line 36 of file themes.c.

References esyslog, isempty(), and name.

Referenced by Load(), and Save().

Here is the call graph for this function:

const char* cTheme::Name ( void   )  [inline]

Definition at line 29 of file themes.h.

References name.

Referenced by cThemes::Load(), and cThemes::Save().

const char * cTheme::Description ( void   ) 

Returns a user visible, single line description of this theme. The actual text shouldn't be too long, so that it can be fully displayed in the Setup/OSD menu.

Definition at line 78 of file themes.c.

References descriptions, name, cSetup::OSDLanguage, and Setup.

Referenced by cMenuSetupOSD::cMenuSetupOSD(), and cThemes::Load().

bool cTheme::Load ( const char *  FileName,
bool  OnlyDescriptions = false 
)

Loads the theme data from the given file.

Definition at line 86 of file themes.c.

References colorNames, colorValues, descriptions, esyslog, FileNameOk(), I18nLanguageIndex(), isempty(), isyslog, LOG_ERROR_STR, MaxThemeColors, cReadLine::Read(), skipspace(), and stripspace().

Referenced by cThemes::Load(), and cMenuSetupOSD::ProcessKey().

Here is the call graph for this function:

bool cTheme::Save ( const char *  FileName  ) 

Saves the theme data to the given file. FileName must be in the form "<skin>-<theme>.theme", where <skin> is the name of the skin this theme applies to, and <theme> is the actual theme name, which will be used to identify this theme in the 'setup.conf', and is normally not seen by the user. It should consist of only lowercase letters and digits.

Definition at line 163 of file themes.c.

References cSafeFile::Close(), colorNames, colorValues, descriptions, FileNameOk(), I18nLanguageCode(), I18nNumLanguages, MaxThemeColors, and cSafeFile::Open().

Referenced by cThemes::Save().

Here is the call graph for this function:

int cTheme::AddColor ( const char *  Name,
tColor  Color 
)

Adds a color with the given Name to this theme, initializes it with Color and returns an index into the color array that can be used in a call to Color() later. The index returned from the first call to AddColor() is 0, and subsequent calls will return values that are incremented by 1 with every call. If a color entry with the given Name already exists, its value will be overwritten with Color and the returned index will be that of the existing entry.

Definition at line 186 of file themes.c.

References colorNames, colorValues, and MaxThemeColors.

tColor cTheme::Color ( int  Subject  ) 

Returns the color for the given Subject. Subject must be one of the values returned by a previous call to AddColor().

Definition at line 204 of file themes.c.

References colorValues, and MaxThemeColors.

Referenced by cSkinSTTNGDisplayMenu::Clear(), cSkinClassicDisplayMenu::Clear(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cSkinSTTNGDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinClassicDisplayChannel::Flush(), cSkinSTTNGDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayMenu::SetButtons(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetChannel(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinClassicDisplayReplay::SetCurrent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayMenu::SetEvent(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetEvents(), cSkinSTTNGDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinClassicDisplayTracks::SetItem(), cSkinClassicDisplayMenu::SetItem(), cSkinSTTNGDisplayReplay::SetJump(), cSkinClassicDisplayReplay::SetJump(), cSkinSTTNGDisplayMessage::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayMessage::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinSTTNGDisplayReplay::SetMode(), cSkinSTTNGDisplayReplay::SetProgress(), cSkinClassicDisplayReplay::SetProgress(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinClassicDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetScrollbar(), cSkinClassicDisplayMenu::SetScrollbar(), cSkinSTTNGDisplayMenu::SetText(), cSkinClassicDisplayMenu::SetText(), cSkinSTTNGDisplayReplay::SetTitle(), cSkinSTTNGDisplayMenu::SetTitle(), cSkinClassicDisplayReplay::SetTitle(), cSkinClassicDisplayMenu::SetTitle(), cSkinSTTNGDisplayReplay::SetTotal(), cSkinClassicDisplayReplay::SetTotal(), cSkinSTTNGDisplayVolume::SetVolume(), and cSkinClassicDisplayVolume::SetVolume().


Member Data Documentation

char* cTheme::name [private]

Definition at line 20 of file themes.h.

Referenced by cTheme(), Description(), FileNameOk(), Name(), and ~cTheme().

char* cTheme::descriptions[I18nNumLanguages] [private]

Definition at line 21 of file themes.h.

Referenced by cTheme(), Description(), Load(), Save(), and ~cTheme().

char* cTheme::colorNames[MaxThemeColors] [private]

Definition at line 22 of file themes.h.

Referenced by AddColor(), cTheme(), Load(), Save(), and ~cTheme().

tColor cTheme::colorValues[MaxThemeColors] [private]

Definition at line 23 of file themes.h.

Referenced by AddColor(), Color(), cTheme(), Load(), and Save().


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 20:30:32 2007 for VDR by  doxygen 1.5.3-20071008