cTheme Class Reference

#include <themes.h>

Collaboration diagram for cTheme:

Collaboration graph
[legend]

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
cStringList descriptions
char * colorNames [MaxThemeColors]
tColor colorValues [MaxThemeColors]


Detailed Description

Definition at line 17 of file themes.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
MaxThemeColors 

Definition at line 19 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 26 of file themes.c.

References colorNames, MaxThemeColors, and name.


Member Function Documentation

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

Definition at line 33 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 30 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 75 of file themes.c.

References descriptions, I18nCurrentLanguage(), and name.

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

Here is the call graph for this function:

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

Loads the theme data from the given file.

Definition at line 83 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 160 of file themes.c.

References cSafeFile::Close(), colorNames, colorValues, descriptions, FileNameOk(), I18nLanguageCode(), I18nLanguages(), MaxThemeColors, cSafeFile::Open(), and cVector< T >::Size().

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 183 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 201 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::DrawScrollbar(), cSkinClassicDisplayMenu::DrawScrollbar(), 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::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 21 of file themes.h.

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

Definition at line 22 of file themes.h.

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

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

Definition at line 23 of file themes.h.

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

tColor cTheme::colorValues[MaxThemeColors] [private]

Definition at line 24 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 Jan 13 14:33:02 2009 for VDR by  doxygen 1.5.6