CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csSkin Class Reference
[Skin support]

This class defines the interface for a container of skins. More...

#include <csskin.h>

Inheritance diagram for csSkin:

csVector csBasicVector List of all members.

Public Methods

 csSkin ()
 Create the skin repository object. More...

virtual ~csSkin ()
 Destroy all skins in this repository. More...

virtual bool FreeItem (void *Item)
 Free a skin from this repository. More...

virtual int CompareKey (void *Item, const void *Key, int) const
 Compare a item from this array with some key. More...

virtual int Compare (void *Item1, void *Item2, int) const
 Compare two items from this array. More...

csSkinSliceGet (int iIndex)
 Get a skin from this array. More...

void Apply (csComponent *iComp)
 Apply this skin to some component and all components inserted into it. More...

virtual void Initialize (csApp *iApp)
 Initialize all skin slices with given application object. More...

virtual void Deinitialize ()
 Free any resources allocated by the skin slices. More...

const char * GetConfigStr (const char *iSection, const char *iKey, const char *iDefault)
 Utility function: get a skin-specific string from csws config file. More...

bool GetConfigYesNo (const char *iSection, const char *iKey, bool iDefault)
 Same but get a boolean value. More...

void Load (csBackground &oBack, const char *iSection, const char *iPrefix)
 Utility function: read background from given section with given key prefix. More...


Public Attributes

const char * Prefix
 This is the prefix for section names in CSWS' configuration file. More...


Detailed Description

This class defines the interface for a container of skins.

Most of the functionality you will want is already here; the only method that you will sometimes want to override is the constructor and the Initialize() method. In constructor you should assign the appropiate value to the "Prefix" member variable which is used to find the sections that refer to the respective theme. Initialize() used to query all kinds of resources from the application object when a skin is initialized.

Generally there should be only one object of this class, which is stored into the csApp object. However, you can use a skin for some component and all his children if you wish, but you will have to store the respective skin container somewhere inside that component (and override his GetSkin() method so that child components can use the skin when initialized).

The repository contains a number of objects that are responsible for the exterior of the respective components (and which are called `skins'). These objects are identified by a text string. After you change the skin repository, you should call the Apply() method of the repository so that the given objects and all components which are inserted into that component (note that this does NOT have to do anything with class hierarchy!) will receive the cscmdSkinChanged broadcast.

Definition at line 70 of file csskin.h.


Constructor & Destructor Documentation

csSkin::csSkin   [inline]
 

Create the skin repository object.

Definition at line 80 of file csskin.h.

References Prefix.

virtual csSkin::~csSkin   [virtual]
 

Destroy all skins in this repository.


Member Function Documentation

void csSkin::Apply csComponent   iComp
 

Apply this skin to some component and all components inserted into it.

virtual int csSkin::Compare void *    Item1,
void *    Item2,
int   
const [virtual]
 

Compare two items from this array.

Reimplemented from csVector.

virtual int csSkin::CompareKey void *    Item,
const void *    Key,
int   
const [virtual]
 

Compare a item from this array with some key.

Reimplemented from csVector.

virtual void csSkin::Deinitialize   [virtual]
 

Free any resources allocated by the skin slices.

virtual bool csSkin::FreeItem void *    Item [virtual]
 

Free a skin from this repository.

Reimplemented from csVector.

csSkinSlice* csSkin::Get int    iIndex [inline]
 

Get a skin from this array.

Definition at line 95 of file csskin.h.

References csBasicVector::Get.

const char* csSkin::GetConfigStr const char *    iSection,
const char *    iKey,
const char *    iDefault
 

Utility function: get a skin-specific string from csws config file.

bool csSkin::GetConfigYesNo const char *    iSection,
const char *    iKey,
bool    iDefault
 

Same but get a boolean value.

virtual void csSkin::Initialize csApp   iApp [virtual]
 

Initialize all skin slices with given application object.

void csSkin::Load csBackground   oBack,
const char *    iSection,
const char *    iPrefix
 

Utility function: read background from given section with given key prefix.


Member Data Documentation

const char* csSkin::Prefix
 

This is the prefix for section names in CSWS' configuration file.

Definition at line 77 of file csskin.h.

Referenced by csSkin.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14