Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUI::FrameComponent Class Reference

Class that encapsulates information for a frame with background (9 images in total). More...

#include <CEGUIFalFrameComponent.h>

Inheritance diagram for CEGUI::FrameComponent:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::FrameComponent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FrameComponent ()
 Constructor.
VerticalFormatting getBackgroundVerticalFormatting () const
 Return the current vertical formatting setting for this FrameComponent.
void setBackgroundVerticalFormatting (VerticalFormatting fmt)
 Set the vertical formatting setting for this FrameComponent.
HorizontalFormatting getBackgroundHorizontalFormatting () const
 Return the current horizontal formatting setting for this FrameComponent.
void setBackgroundHorizontalFormatting (HorizontalFormatting fmt)
 Set the horizontal formatting setting for this FrameComponent.
const ImagegetImage (FrameImageComponent part) const
 Return the Image object that will be drawn by this FrameComponent for a specified frame part.
void setImage (FrameImageComponent part, const Image *image)
 Set the Image that will be drawn by this ImageryComponent.
void setImage (FrameImageComponent part, const String &imageset, const String &image)
 Set the Image that will be drawn by this FrameComponent.
void writeXMLToStream (OutStream &out_stream) const
 Writes an xml representation of this FrameComponent to out_stream.
void render (Window &srcWindow, float base_z, const CEGUI::ColourRect *modColours=0, const Rect *clipper=0, bool clipToDisplay=false) const
 Render this component. More correctly, the component is cached for rendering.
void render (Window &srcWindow, const Rect &baseRect, float base_z, const CEGUI::ColourRect *modColours=0, const Rect *clipper=0, bool clipToDisplay=false) const
 Render this component. More correctly, the component is cached for rendering.
const ComponentAreagetComponentArea () const
 Return the ComponentArea of this ImageryComponent.
void setComponentArea (const ComponentArea &area)
 Set the ImageryComponent's ComponentArea.
const ColourRectgetColours () const
 Return the ColourRect set for use by this ImageryComponent.
void setColours (const ColourRect &cols)
 Set the colours to be used by this ImageryComponent.
void setColoursPropertySource (const String &property)
 Set the name of the property where colour values can be obtained.
void setColoursPropertyIsColourRect (bool setting=true)
 Set whether the colours property source represents a full ColourRect.
void setVertFormattingPropertySource (const String &property)
 Set the name of the property where vertical formatting option can be obtained.
void setHorzFormattingPropertySource (const String &property)
 Set the name of the property where horizontal formatting option can be obtained.

Protected Member Functions

void render_impl (Window &srcWindow, Rect &destRect, float base_z, const CEGUI::ColourRect *modColours, const Rect *clipper, bool clipToDisplay) const
 Method to do main render caching work.
void doBackgroundRender (Window &srcWindow, Rect &destRect, float base_z, const ColourRect &colours, const Rect *clipper, bool clipToDisplay) const
void initColoursRect (const Window &wnd, const ColourRect *modCols, ColourRect &cr) const
 Helper method to initialise a ColourRect with appropriate values according to the way the ImageryComponent is set up.
bool writeColoursXML (OutStream &out_stream) const
 Writes xml for the colours to a OutStream. Will prefer property colours before explicit.
bool writeVertFormatXML (OutStream &out_stream) const
 Writes xml for the vertical formatting to a OutStream if such a property is defined.
bool writeHorzFormatXML (OutStream &out_stream) const
 Writes xml for the horizontal formatting to a OutStream if such a property is defined.

Protected Attributes

VerticalFormatting d_vertFormatting
 Vertical formatting to be applied when rendering the background for the component.
HorizontalFormatting d_horzFormatting
 Horizontal formatting to be applied when rendering the background for the component.
const Imaged_frameImages [FIC_FRAME_IMAGE_COUNT]
 Array that holds the assigned images.
ComponentArea d_area
 Destination area for this component.
ColourRect d_colours
 base colours to be applied when rendering the image component.
String d_colourPropertyName
 name of property to fetch colours from.
bool d_colourProperyIsRect
 true if the colour property will fetch a full ColourRect.
String d_vertFormatPropertyName
 name of property to fetch vertical formatting setting from.
String d_horzFormatPropertyName
 name of property to fetch horizontal formatting setting from.

Detailed Description

Class that encapsulates information for a frame with background (9 images in total).

Corner images are always drawn at their natural size, edges are stretched between the corner pieces for a particular edge, the background image will cover the inner rectangle formed by the edge images and can be stretched or tiled in either dimension.

Definition at line 40 of file CEGUIFalFrameComponent.h.


Constructor & Destructor Documentation

CEGUI::FrameComponent::FrameComponent  ) 
 

Constructor.

Definition at line 35 of file CEGUIFalFrameComponent.cpp.

References d_frameImages, and CEGUI::FIC_FRAME_IMAGE_COUNT.


Member Function Documentation

void CEGUI::FrameComponent::doBackgroundRender Window srcWindow,
Rect destRect,
float  base_z,
const ColourRect colours,
const Rect clipper,
bool  clipToDisplay
const [protected]
 

Definition at line 366 of file CEGUIFalFrameComponent.cpp.

References CEGUI::RenderCache::cacheImage(), CEGUI::Rect::d_bottom, d_frameImages, CEGUI::Size::d_height, CEGUI::FalagardComponentBase::d_horzFormatPropertyName, d_horzFormatting, CEGUI::Rect::d_left, CEGUI::Rect::d_right, CEGUI::Rect::d_top, CEGUI::FalagardComponentBase::d_vertFormatPropertyName, d_vertFormatting, CEGUI::Size::d_width, CEGUI::String::empty(), CEGUI::FIC_BACKGROUND, CEGUI::Rect::getHeight(), CEGUI::Rect::getIntersection(), CEGUI::PropertySet::getProperty(), CEGUI::Window::getRenderCache(), CEGUI::Rect::getWidth(), CEGUI::HF_CENTRE_ALIGNED, CEGUI::HF_LEFT_ALIGNED, CEGUI::HF_RIGHT_ALIGNED, CEGUI::HF_STRETCHED, CEGUI::HF_TILED, PixelAligned, CEGUI::FalagardXMLHelper::stringToHorzFormat(), CEGUI::FalagardXMLHelper::stringToVertFormat(), CEGUI::VF_BOTTOM_ALIGNED, CEGUI::VF_CENTRE_ALIGNED, CEGUI::VF_STRETCHED, CEGUI::VF_TILED, and CEGUI::VF_TOP_ALIGNED.

Referenced by render_impl().

HorizontalFormatting CEGUI::FrameComponent::getBackgroundHorizontalFormatting  )  const
 

Return the current horizontal formatting setting for this FrameComponent.

Returns:
One of the HorizontalFormatting enumerated values.

Definition at line 53 of file CEGUIFalFrameComponent.cpp.

References d_horzFormatting.

VerticalFormatting CEGUI::FrameComponent::getBackgroundVerticalFormatting  )  const
 

Return the current vertical formatting setting for this FrameComponent.

Returns:
One of the VerticalFormatting enumerated values.

Definition at line 43 of file CEGUIFalFrameComponent.cpp.

References d_vertFormatting.

const ColourRect & CEGUI::FalagardComponentBase::getColours  )  const [inherited]
 

Return the ColourRect set for use by this ImageryComponent.

Returns:
ColourRect object holding the colours currently in use by this ImageryComponent.

Definition at line 62 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_colours.

const ComponentArea & CEGUI::FalagardComponentBase::getComponentArea  )  const [inherited]
 

Return the ComponentArea of this ImageryComponent.

Returns:
ComponentArea object describing the ImageryComponent's current target area.

Definition at line 52 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_area.

const Image * CEGUI::FrameComponent::getImage FrameImageComponent  part  )  const
 

Return the Image object that will be drawn by this FrameComponent for a specified frame part.

Parameters:
part One of the FrameImageComponent enumerated values specifying the component image to be accessed.
Returns:
Image object.

Definition at line 63 of file CEGUIFalFrameComponent.cpp.

References d_frameImages, and CEGUI::FIC_FRAME_IMAGE_COUNT.

void CEGUI::FalagardComponentBase::initColoursRect const Window wnd,
const ColourRect modCols,
ColourRect cr
const [protected, inherited]
 

Helper method to initialise a ColourRect with appropriate values according to the way the ImageryComponent is set up.

This will try and get values from multiple places:

  • a property attached to wnd
  • or the integral d_colours value.

Definition at line 82 of file CEGUIFalComponentBase.cpp.

References CEGUI::ColourRect::d_bottom_left, CEGUI::ColourRect::d_bottom_right, CEGUI::FalagardComponentBase::d_colourPropertyName, CEGUI::FalagardComponentBase::d_colourProperyIsRect, CEGUI::FalagardComponentBase::d_colours, CEGUI::ColourRect::d_top_left, CEGUI::ColourRect::d_top_right, CEGUI::String::empty(), CEGUI::PropertySet::getProperty(), CEGUI::PropertyHelper::stringToColour(), and CEGUI::PropertyHelper::stringToColourRect().

Referenced by CEGUI::TextComponent::render_impl(), CEGUI::ImageryComponent::render_impl(), and render_impl().

void CEGUI::FalagardComponentBase::render Window srcWindow,
const Rect baseRect,
float  base_z,
const CEGUI::ColourRect modColours = 0,
const Rect clipper = 0,
bool  clipToDisplay = false
const [inherited]
 

Render this component. More correctly, the component is cached for rendering.

Parameters:
srcWindow Window to use as the base for translating the component's ComponentArea into pixel values.
baseRect Rect to use as the base for translating the component's ComponentArea into pixel values.
base_z The z value to use for rendering the component. Note that this is not the final z value to use, but some z offset from a currently unknown starting value.
modColours ColourRect describing colours that are to be modulated with the component's stored colour values to calculate a set of 'final' colour values to be used. May be 0.
Returns:
Nothing.

Definition at line 46 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_area, CEGUI::ComponentArea::getPixelRect(), and CEGUI::FalagardComponentBase::render_impl().

void CEGUI::FalagardComponentBase::render Window srcWindow,
float  base_z,
const CEGUI::ColourRect modColours = 0,
const Rect clipper = 0,
bool  clipToDisplay = false
const [inherited]
 

Render this component. More correctly, the component is cached for rendering.

Parameters:
srcWindow Window to use as the base for translating the component's ComponentArea into pixel values.
base_z The z value to use for rendering the component. Note that this is not the final z value to use, but some z offset from a currently unknown starting value.
modColours ColourRect describing colours that are to be modulated with the component's stored colour values to calculate a set of 'final' colour values to be used. May be 0.
Returns:
Nothing.

Definition at line 40 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_area, CEGUI::ComponentArea::getPixelRect(), and CEGUI::FalagardComponentBase::render_impl().

void CEGUI::FrameComponent::render_impl Window srcWindow,
Rect destRect,
float  base_z,
const CEGUI::ColourRect modColours,
const Rect clipper,
bool  clipToDisplay
const [protected, virtual]
 

Method to do main render caching work.

Implements CEGUI::FalagardComponentBase.

Definition at line 91 of file CEGUIFalFrameComponent.cpp.

References CEGUI::RenderCache::cacheImage(), CEGUI::Rect::d_bottom, d_frameImages, CEGUI::Size::d_height, CEGUI::Rect::d_left, CEGUI::Rect::d_right, CEGUI::Rect::d_top, CEGUI::Size::d_width, doBackgroundRender(), CEGUI::FIC_BACKGROUND, CEGUI::FIC_BOTTOM_EDGE, CEGUI::FIC_BOTTOM_LEFT_CORNER, CEGUI::FIC_BOTTOM_RIGHT_CORNER, CEGUI::FIC_LEFT_EDGE, CEGUI::FIC_RIGHT_EDGE, CEGUI::FIC_TOP_EDGE, CEGUI::FIC_TOP_LEFT_CORNER, CEGUI::FIC_TOP_RIGHT_CORNER, CEGUI::Rect::getHeight(), CEGUI::Image::getOffsetX(), CEGUI::Image::getOffsetY(), CEGUI::Window::getRenderCache(), CEGUI::Image::getSize(), CEGUI::ColourRect::getSubRectangle(), CEGUI::Rect::getWidth(), CEGUI::FalagardComponentBase::initColoursRect(), CEGUI::ColourRect::isMonochromatic(), and CEGUI::Rect::setSize().

void CEGUI::FrameComponent::setBackgroundHorizontalFormatting HorizontalFormatting  fmt  ) 
 

Set the horizontal formatting setting for this FrameComponent.

Parameters:
fmt One of the HorizontalFormatting enumerated values.
Returns:
Nothing.

Definition at line 58 of file CEGUIFalFrameComponent.cpp.

References d_horzFormatting.

void CEGUI::FrameComponent::setBackgroundVerticalFormatting VerticalFormatting  fmt  ) 
 

Set the vertical formatting setting for this FrameComponent.

Parameters:
fmt One of the VerticalFormatting enumerated values.
Returns:
Nothing.

Definition at line 48 of file CEGUIFalFrameComponent.cpp.

References d_vertFormatting.

void CEGUI::FalagardComponentBase::setColours const ColourRect cols  )  [inherited]
 

Set the colours to be used by this ImageryComponent.

Parameters:
cols ColourRect object describing the colours to be used by this ImageryComponent.

Definition at line 67 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_colours.

Referenced by CEGUI::Falagard_xmlHandler::elementStart().

void CEGUI::FalagardComponentBase::setColoursPropertyIsColourRect bool  setting = true  )  [inherited]
 

Set whether the colours property source represents a full ColourRect.

Parameters:
setting 
  • true if the colours property will access a ColourRect object.
  • false if the colours property will access a colour object.
Returns:
Nothing.

Definition at line 77 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_colourProperyIsRect.

Referenced by CEGUI::Falagard_xmlHandler::elementStart().

void CEGUI::FalagardComponentBase::setColoursPropertySource const String property  )  [inherited]
 

Set the name of the property where colour values can be obtained.

Parameters:
property String containing the name of the property.
Returns:
Nothing.

Definition at line 72 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_colourPropertyName.

Referenced by CEGUI::Falagard_xmlHandler::elementStart().

void CEGUI::FalagardComponentBase::setComponentArea const ComponentArea area  )  [inherited]
 

Set the ImageryComponent's ComponentArea.

Parameters:
area ComponentArea object describing a new target area for the ImageryComponent.
Returns:
Nothing.

Definition at line 57 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_area.

Referenced by CEGUI::Falagard_xmlHandler::elementEnd().

void CEGUI::FalagardComponentBase::setHorzFormattingPropertySource const String property  )  [inherited]
 

Set the name of the property where horizontal formatting option can be obtained.

Parameters:
property String containing the name of the property.
Returns:
Nothing.

Definition at line 120 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_horzFormatPropertyName.

Referenced by CEGUI::Falagard_xmlHandler::elementStart().

void CEGUI::FrameComponent::setImage FrameImageComponent  part,
const String imageset,
const String image
 

Set the Image that will be drawn by this FrameComponent.

Parameters:
part One of the FrameImageComponent enumerated values specifying the component image to be accessed.
imageset String holding the name of the Imagset that contains the Image to be rendered.
image String holding the name of the Image to be rendered.
Returns:
Nothing.

Definition at line 77 of file CEGUIFalFrameComponent.cpp.

References d_frameImages, CEGUI::FIC_FRAME_IMAGE_COUNT, CEGUI::Imageset::getImage(), CEGUI::ImagesetManager::getImageset(), and CEGUI::ImagesetManager::getSingleton().

void CEGUI::FrameComponent::setImage FrameImageComponent  part,
const Image image
 

Set the Image that will be drawn by this ImageryComponent.

Parameters:
part One of the FrameImageComponent enumerated values specifying the component image to be accessed.
image Pointer to the Image object to be drawn by this FrameComponent.
Returns:
Nothing.

Definition at line 70 of file CEGUIFalFrameComponent.cpp.

References d_frameImages, and CEGUI::FIC_FRAME_IMAGE_COUNT.

Referenced by CEGUI::Falagard_xmlHandler::elementStart().

void CEGUI::FalagardComponentBase::setVertFormattingPropertySource const String property  )  [inherited]
 

Set the name of the property where vertical formatting option can be obtained.

Parameters:
property String containing the name of the property.
Returns:
Nothing.

Definition at line 115 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_vertFormatPropertyName.

Referenced by CEGUI::Falagard_xmlHandler::elementStart().

bool CEGUI::FalagardComponentBase::writeColoursXML OutStream out_stream  )  const [protected, inherited]
 

Writes xml for the colours to a OutStream. Will prefer property colours before explicit.

Note:
This is intended as a helper method for sub-classes when outputting xml to a stream.
Returns:
  • true if xml element was written.
  • false if nothing was output due to the formatting not being set (sub-class may then choose to do something else.)

Definition at line 125 of file CEGUIFalComponentBase.cpp.

References CEGUI::PropertyHelper::colourToString(), CEGUI::ColourRect::d_bottom_left, CEGUI::ColourRect::d_bottom_right, CEGUI::FalagardComponentBase::d_colourPropertyName, CEGUI::FalagardComponentBase::d_colourProperyIsRect, CEGUI::FalagardComponentBase::d_colours, CEGUI::ColourRect::d_top_left, CEGUI::ColourRect::d_top_right, CEGUI::String::empty(), and CEGUI::ColourRect::isMonochromatic().

Referenced by CEGUI::TextComponent::writeXMLToStream(), CEGUI::ImageryComponent::writeXMLToStream(), and writeXMLToStream().

bool CEGUI::FalagardComponentBase::writeHorzFormatXML OutStream out_stream  )  const [protected, inherited]
 

Writes xml for the horizontal formatting to a OutStream if such a property is defined.

Note:
This is intended as a helper method for sub-classes when outputting xml to a stream.
Returns:
  • true if xml element was written.
  • false if nothing was output due to the formatting not being set (sub-class may then choose to do something else.)

Definition at line 163 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_horzFormatPropertyName, and CEGUI::String::empty().

Referenced by CEGUI::TextComponent::writeXMLToStream(), CEGUI::ImageryComponent::writeXMLToStream(), and writeXMLToStream().

bool CEGUI::FalagardComponentBase::writeVertFormatXML OutStream out_stream  )  const [protected, inherited]
 

Writes xml for the vertical formatting to a OutStream if such a property is defined.

Note:
This is intended as a helper method for sub-classes when outputting xml to a stream.
Returns:
  • true if xml element was written.
  • false if nothing was output due to the formatting not being set (sub-class may then choose to do something else.)

Definition at line 152 of file CEGUIFalComponentBase.cpp.

References CEGUI::FalagardComponentBase::d_vertFormatPropertyName, and CEGUI::String::empty().

Referenced by CEGUI::TextComponent::writeXMLToStream(), CEGUI::ImageryComponent::writeXMLToStream(), and writeXMLToStream().

void CEGUI::FrameComponent::writeXMLToStream OutStream out_stream  )  const
 

Writes an xml representation of this FrameComponent to out_stream.

Parameters:
out_stream Stream where xml data should be output.
Returns:
Nothing.

Definition at line 484 of file CEGUIFalFrameComponent.cpp.

References CEGUI::FalagardComponentBase::d_area, d_frameImages, d_horzFormatting, d_vertFormatting, CEGUI::FIC_FRAME_IMAGE_COUNT, CEGUI::FalagardXMLHelper::frameImageComponentToString(), CEGUI::Image::getImagesetName(), CEGUI::Image::getName(), CEGUI::FalagardXMLHelper::horzFormatToString(), CEGUI::FalagardXMLHelper::vertFormatToString(), CEGUI::FalagardComponentBase::writeColoursXML(), CEGUI::FalagardComponentBase::writeHorzFormatXML(), CEGUI::FalagardComponentBase::writeVertFormatXML(), and CEGUI::ComponentArea::writeXMLToStream().


Member Data Documentation

ComponentArea CEGUI::FalagardComponentBase::d_area [protected, inherited]
 

Destination area for this component.

Definition at line 242 of file CEGUIFalComponentBase.h.

Referenced by CEGUI::FalagardComponentBase::getComponentArea(), CEGUI::FalagardComponentBase::render(), CEGUI::FalagardComponentBase::setComponentArea(), CEGUI::TextComponent::writeXMLToStream(), CEGUI::ImageryComponent::writeXMLToStream(), and writeXMLToStream().

String CEGUI::FalagardComponentBase::d_colourPropertyName [protected, inherited]
 

name of property to fetch colours from.

Definition at line 244 of file CEGUIFalComponentBase.h.

Referenced by CEGUI::FalagardComponentBase::initColoursRect(), CEGUI::FalagardComponentBase::setColoursPropertySource(), and CEGUI::FalagardComponentBase::writeColoursXML().

bool CEGUI::FalagardComponentBase::d_colourProperyIsRect [protected, inherited]
 

true if the colour property will fetch a full ColourRect.

Definition at line 245 of file CEGUIFalComponentBase.h.

Referenced by CEGUI::FalagardComponentBase::initColoursRect(), CEGUI::FalagardComponentBase::setColoursPropertyIsColourRect(), and CEGUI::FalagardComponentBase::writeColoursXML().

ColourRect CEGUI::FalagardComponentBase::d_colours [protected, inherited]
 

base colours to be applied when rendering the image component.

Definition at line 243 of file CEGUIFalComponentBase.h.

Referenced by CEGUI::FalagardComponentBase::getColours(), CEGUI::FalagardComponentBase::initColoursRect(), CEGUI::FalagardComponentBase::setColours(), and CEGUI::FalagardComponentBase::writeColoursXML().

const Image* CEGUI::FrameComponent::d_frameImages[FIC_FRAME_IMAGE_COUNT] [protected]
 

Array that holds the assigned images.

Definition at line 159 of file CEGUIFalFrameComponent.h.

Referenced by doBackgroundRender(), FrameComponent(), getImage(), render_impl(), setImage(), and writeXMLToStream().

String CEGUI::FalagardComponentBase::d_horzFormatPropertyName [protected, inherited]
 

name of property to fetch horizontal formatting setting from.

Definition at line 247 of file CEGUIFalComponentBase.h.

Referenced by doBackgroundRender(), CEGUI::TextComponent::render_impl(), CEGUI::ImageryComponent::render_impl(), CEGUI::FalagardComponentBase::setHorzFormattingPropertySource(), and CEGUI::FalagardComponentBase::writeHorzFormatXML().

HorizontalFormatting CEGUI::FrameComponent::d_horzFormatting [protected]
 

Horizontal formatting to be applied when rendering the background for the component.

Definition at line 157 of file CEGUIFalFrameComponent.h.

Referenced by doBackgroundRender(), getBackgroundHorizontalFormatting(), setBackgroundHorizontalFormatting(), and writeXMLToStream().

String CEGUI::FalagardComponentBase::d_vertFormatPropertyName [protected, inherited]
 

name of property to fetch vertical formatting setting from.

Definition at line 246 of file CEGUIFalComponentBase.h.

Referenced by doBackgroundRender(), CEGUI::TextComponent::render_impl(), CEGUI::ImageryComponent::render_impl(), CEGUI::FalagardComponentBase::setVertFormattingPropertySource(), and CEGUI::FalagardComponentBase::writeVertFormatXML().

VerticalFormatting CEGUI::FrameComponent::d_vertFormatting [protected]
 

Vertical formatting to be applied when rendering the background for the component.

Definition at line 156 of file CEGUIFalFrameComponent.h.

Referenced by doBackgroundRender(), getBackgroundVerticalFormatting(), setBackgroundVerticalFormatting(), and writeXMLToStream().


The documentation for this class was generated from the following files:
Generated on Wed Sep 7 10:10:05 2005 for Crazy Eddies GUI System by  doxygen 1.4.3