Crazy Eddie's GUI System  0.8.7
ImagerySection.h
1 /***********************************************************************
2  created: Mon Jun 13 2005
3  author: Paul D Turner <paul@cegui.org.uk>
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIFalImagerySection_h_
28 #define _CEGUIFalImagerySection_h_
29 
30 #include "./ImageryComponent.h"
31 #include "./TextComponent.h"
32 #include "./FrameComponent.h"
33 #include "../XMLSerializer.h"
34 
35 #if defined(_MSC_VER)
36 # pragma warning(push)
37 # pragma warning(disable : 4251)
38 #endif
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
47  class CEGUIEXPORT ImagerySection :
48  public AllocatedObject<ImagerySection>
49  {
50  public:
52  typedef std::vector<ImageryComponent* CEGUI_VECTOR_ALLOC(ImageryComponent*)> ImageryComponentPointerList;
54  typedef std::vector<TextComponent* CEGUI_VECTOR_ALLOC(TextComponent*)> TextComponentPointerList;
56  typedef std::vector<FrameComponent* CEGUI_VECTOR_ALLOC(FrameComponent*)> FrameComponentPointerList;
57 
58 
65 
73  ImagerySection(const String& name);
74 
88  void render(Window& srcWindow, const CEGUI::ColourRect* modColours = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
89 
106  void render(Window& srcWindow, const Rectf& baseRect, const CEGUI::ColourRect* modColours = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
107 
115  void addImageryComponent(const ImageryComponent& imageryComponent);
116 
126  void removeImageryComponent(const ImageryComponent& imageryComponent);
127 
136 
144  void addTextComponent(const TextComponent& textComponent);
145 
155  void removeTextComponent(const TextComponent& textComponent);
156 
165 
174 
182  void addFrameComponent(const FrameComponent& frameComponent);
183 
193  void removeFrameComponent(const FrameComponent& frameComponent);
194 
202  const ColourRect& getMasterColours() const;
203 
214  void setMasterColours(const ColourRect& cols);
215 
223  const String& getName() const;
224 
235  void setName(const String& name);
236 
245 
256  void setMasterColoursPropertySource(const String& property);
257 
262  Rectf getBoundingRect(const Window& wnd) const;
263 
268  Rectf getBoundingRect(const Window& wnd, const Rectf& rect) const;
269 
281  void writeXMLToStream(XMLSerializer& xml_stream) const;
282 
284  bool handleFontRenderSizeChange(Window& window, const Font* font) const;
285 
296 
307 
318 
319  protected:
329  void initMasterColourRect(const Window& wnd, ColourRect& cr) const;
330 
331  private:
332  typedef std::vector<ImageryComponent
333  CEGUI_VECTOR_ALLOC(ImageryComponent)> ImageryList;
334  typedef std::vector<TextComponent
335  CEGUI_VECTOR_ALLOC(TextComponent)> TextList;
336  typedef std::vector<FrameComponent
337  CEGUI_VECTOR_ALLOC(FrameComponent)> FrameList;
338 
339  CEGUI::String d_name;
340  CEGUI::ColourRect d_masterColours;
341  FrameList d_frames;
342  ImageryList d_images;
343  TextList d_texts;
344  String d_colourPropertyName;
345 
346  public:
353 
387 
388  };
389 
390 } // End of CEGUI namespace section
391 
392 
393 #if defined(_MSC_VER)
394 # pragma warning(pop)
395 #endif
396 
397 #endif // end of guard _CEGUIFalImagerySection_h_
CEGUI::ImagerySection::FrameComponentIterator
ConstVectorIterator< FrameList > FrameComponentIterator
Definition: ImagerySection.h:352
CEGUI::Font
Class that encapsulates a typeface.
Definition: Font.h:62
CEGUI::ImagerySection::getBoundingRect
Rectf getBoundingRect(const Window &wnd, const Rectf &rect) const
Return smallest Rect that could contain all imagery within this section.
CEGUI::ImagerySection::clearTextComponents
void clearTextComponents()
Clear all TextComponents from this ImagerySection.
CEGUI::ImagerySection::addImageryComponent
void addImageryComponent(const ImageryComponent &imageryComponent)
Add an ImageryComponent to this ImagerySection.
CEGUI::FrameComponent
Class that encapsulates information for a frame with background (9 images in total)
Definition: FrameComponent.h:52
CEGUI::ImagerySection::handleFontRenderSizeChange
bool handleFontRenderSizeChange(Window &window, const Font *font) const
perform any processing required due to the given font having changed.
CEGUI::ImagerySection::setName
void setName(const String &name)
Sets the name of this ImagerySection.
CEGUI::ImagerySection::render
void render(Window &srcWindow, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
Render the ImagerySection.
CEGUI::ImagerySection::TextComponentIterator
ConstVectorIterator< TextList > TextComponentIterator
Definition: ImagerySection.h:350
CEGUI::TextComponent
Class that encapsulates information for a text component.
Definition: TextComponent.h:49
CEGUI::ImagerySection::getTextComponentIterator
TextComponentIterator getTextComponentIterator() const
Return a ImagerySection::TextComponentIterator object to iterate over the TextComponent elements curr...
CEGUI::ImagerySection::getBoundingRect
Rectf getBoundingRect(const Window &wnd) const
Return smallest Rect that could contain all imagery within this section.
CEGUI::ImagerySection::getImageryComponentPointers
ImageryComponentPointerList getImageryComponentPointers()
Returns a vector of pointers to the ImageryComponents that are currently added to this ImagerySection...
CEGUI::XMLSerializer
Class used to create XML Document.
Definition: XMLSerializer.h:87
CEGUI::ImageryComponent
Class that encapsulates information for a single image component.
Definition: ImageryComponent.h:47
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::ImagerySection::setMasterColoursPropertySource
void setMasterColoursPropertySource(const String &property)
Set the name of the property where master colour values can be obtained.
CEGUI::ImagerySection::setMasterColours
void setMasterColours(const ColourRect &cols)
Set the master colours to be used for this ImagerySection.
CEGUI::ImagerySection::removeTextComponent
void removeTextComponent(const TextComponent &textComponent)
Removes an TextComponent from this ImagerySection. The supplied TextComponent reference should be ret...
CEGUI::ImagerySection::ImageryComponentIterator
ConstVectorIterator< ImageryList > ImageryComponentIterator
Definition: ImagerySection.h:348
CEGUI::AllocatedObject
Definition: MemoryAllocatedObject.h:110
CEGUI::ImagerySection::clearImageryComponents
void clearImageryComponents()
Clear all ImageryComponents from this ImagerySection.
CEGUI::ColourRect
Class that holds details of colours for the four corners of a rectangle.
Definition: ColourRect.h:45
CEGUI::ImagerySection::getFrameComponentPointers
FrameComponentPointerList getFrameComponentPointers()
Returns a vector of pointers to the FrameComponents that are currently added to this ImagerySection....
CEGUI::ImagerySection::removeFrameComponent
void removeFrameComponent(const FrameComponent &frameComponent)
Removes an FrameComponent from this ImagerySection. The supplied FrameComponent reference should be r...
CEGUI::ImagerySection::clearFrameComponents
void clearFrameComponents()
Clear all FrameComponents from this ImagerySection.
CEGUI::ImagerySection::ImagerySection
ImagerySection()
Constructor.
CEGUI::ImagerySection::getFrameComponentIterator
FrameComponentIterator getFrameComponentIterator() const
Return a ImagerySection::FrameComponentIterator object to iterate over the FrameComponent elements cu...
CEGUI::ConstVectorIterator
iterator for vectors
Definition: IteratorBase.h:288
CEGUI::ImagerySection::render
void render(Window &srcWindow, const Rectf &baseRect, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
Render the ImagerySection.
CEGUI::ImagerySection::addFrameComponent
void addFrameComponent(const FrameComponent &frameComponent)
Add a FrameComponent to this ImagerySection.
CEGUI::ImagerySection::getImageryComponentIterator
ImageryComponentIterator getImageryComponentIterator() const
Return a ImagerySection::ImageryComponentIterator object to iterate over the ImageryComponent element...
CEGUI::ImagerySection::removeImageryComponent
void removeImageryComponent(const ImageryComponent &imageryComponent)
Removes an ImageryComponent from this ImagerySection. The supplied ImagerySection reference should be...
CEGUI::ImagerySection::ImagerySection
ImagerySection(const String &name)
ImagerySection constructor. Name must be supplied, masterColours are set to 0xFFFFFFFF by default.
CEGUI::Window
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
CEGUI::ImagerySection::getName
const String & getName() const
Return the name of this ImagerySection.
CEGUI::ImagerySection::ImageryComponentPointerList
std::vector< ImageryComponent *CEGUI_VECTOR_ALLOC(ImageryComponent *)> ImageryComponentPointerList
Vector of ImageryComponent Pointers.
Definition: ImagerySection.h:52
CEGUI::ImagerySection::writeXMLToStream
void writeXMLToStream(XMLSerializer &xml_stream) const
Writes an xml representation of this ImagerySection to out_stream.
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::Rect< float >
CEGUI::ImagerySection::TextComponentPointerList
std::vector< TextComponent *CEGUI_VECTOR_ALLOC(TextComponent *)> TextComponentPointerList
Vector of TextComponent Pointers.
Definition: ImagerySection.h:54
CEGUI::ImagerySection::FrameComponentPointerList
std::vector< FrameComponent *CEGUI_VECTOR_ALLOC(FrameComponent *)> FrameComponentPointerList
Vector of FrameComponent Pointers.
Definition: ImagerySection.h:56
CEGUI::ImagerySection::getMasterColours
const ColourRect & getMasterColours() const
Return the current master colours set for this ImagerySection.
CEGUI::ImagerySection
Class that encapsulates a re-usable collection of imagery specifications.
Definition: ImagerySection.h:49
CEGUI::ImagerySection::getTextComponentPointers
TextComponentPointerList getTextComponentPointers()
Returns a vector of pointers to the TextComponents that are currently added to this ImagerySection....
CEGUI::ImagerySection::initMasterColourRect
void initMasterColourRect(const Window &wnd, ColourRect &cr) const
Helper method to initialise a ColourRect with appropriate values according to the way the ImagerySect...
CEGUI::ImagerySection::addTextComponent
void addTextComponent(const TextComponent &textComponent)
Add a TextComponent to this ImagerySection.
CEGUI::ImagerySection::getMasterColoursPropertySource
const String & getMasterColoursPropertySource() const
Get the name of the property where master colour values can be obtained.