Public Member Functions | Protected Member Functions | Private Attributes | Friends

SkinPart Class Reference

Contains images used for drawing skin parts. More...

#include <Skin.h>

List of all members.

Public Member Functions

 SkinPart (SkinPartType type, ControlState state=STATE_NORMAL)
 ~SkinPart ()
ImageListgetImageList ()
ControlState getState () const
SkinPartType getPartType () const
Color4ub getForeground () const
Color4ub getBackground () const
Color4ub getBorder () const
const TextOffsetsgetCaptionOffsets () const
Uint getMinimumWidth () const
Uint getMinimumHeight () const

Protected Member Functions

void addImage (ImageRegion region, Image *image)
void setForeground (Uint r, Uint g, Uint b)
void setBackground (Uint r, Uint g, Uint b)
void setBorder (Uint r, Uint g, Uint b)
void setCaptionOffsets (const TextOffsets &tO)

Private Attributes

ImageList mImageList
SkinPartType mPartType
ControlState mState
TextOffsets mCaptionOffsets
Color4ub mBg
Color4ub mFg
Color4ub mBr

Friends

class Skin

Detailed Description

Contains images used for drawing skin parts.

SkinPart contains all of the information and handling functions to properly draw different skin parts.


Constructor & Destructor Documentation

SkinPart::SkinPart ( SkinPartType  type,
ControlState  state = STATE_NORMAL 
)

Constructor.

Parameters:
type Type of part this is. Valid values are PART_MONAD, PART_TRIAD and PART_ENNEAD.
SkinPart::~SkinPart (  ) 

Cleans up all Image objects associated with this part.


Member Function Documentation

void SkinPart::addImage ( ImageRegion  region,
Image image 
) [protected]

Adds an image to a specified region.

Which region an image is associated to is dependant on the type of part this is.

Monad parts only have a single image which is drawn across an entire Gui. Control. Triad parts have three parts; the left, right and center images which are drawn accordingly. Finally, ennead types includ nine parts, one for each corner of a square, for each edge of a square and for the center of a square.

Note:
Once an Image is added, it is owned by, managed and handled by SkinPart. When SkinPart is destroyed it also frees any memory allocated for the Image.
Color4ub SkinPart::getBackground (  )  const

Get foreground color.

Color4ub SkinPart::getBorder (  )  const

Get foreground color.

const TextOffsets& SkinPart::getCaptionOffsets (  )  const [inline]
Color4ub SkinPart::getForeground (  )  const

Get foreground color.

ImageList & SkinPart::getImageList (  ) 

Returns a reference to the internal ImageList.

Uint SkinPart::getMinimumHeight (  )  const

Gets the minimum height this part can be to draw properly.

Returns:
0 if this is a PART_COLORONLY part.
Uint SkinPart::getMinimumWidth (  )  const

Gets the minimum width this part can be to draw properly.

Returns:
0 if this is a PART_COLORONLY part.
SkinPartType SkinPart::getPartType (  )  const

Returns the type of part this is.

See SkinPartType for additional details.

ControlState SkinPart::getState (  )  const

Returns the state of a Control that this this part represents.

void SkinPart::setBackground ( Uint  r,
Uint  g,
Uint  b 
) [protected]

Set background color.

void SkinPart::setBorder ( Uint  r,
Uint  g,
Uint  b 
) [protected]

Set border color.

void SkinPart::setCaptionOffsets ( const TextOffsets tO  )  [protected]

Set border color.

void SkinPart::setForeground ( Uint  r,
Uint  g,
Uint  b 
) [protected]

SGet foreground color.


Friends And Related Function Documentation

friend class Skin [friend]

Member Data Documentation

A list of Images. Used for every other part type.

The type of part this is.

The state of a Control that this part represents.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines