Crazy Eddie's GUI System 0.8.7
Loading...
Searching...
No Matches
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
41namespace 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
203
214 void setMasterColours(const ColourRect& cols);
215
223 const String& getName() const;
224
235 void setName(const String& name);
236
245
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_
Definition MemoryAllocatedObject.h:110
Class that holds details of colours for the four corners of a rectangle.
Definition ColourRect.h:45
iterator for vectors
Definition IteratorBase.h:288
Class that encapsulates a typeface.
Definition Font.h:62
Class that encapsulates information for a frame with background (9 images in total)
Definition FrameComponent.h:52
Class that encapsulates information for a single image component.
Definition ImageryComponent.h:47
Class that encapsulates a re-usable collection of imagery specifications.
Definition ImagerySection.h:49
TextComponentIterator getTextComponentIterator() const
Return a ImagerySection::TextComponentIterator object to iterate over the TextComponent elements curr...
void removeImageryComponent(const ImageryComponent &imageryComponent)
Removes an ImageryComponent from this ImagerySection. The supplied ImagerySection reference should be...
void initMasterColourRect(const Window &wnd, ColourRect &cr) const
Helper method to initialise a ColourRect with appropriate values according to the way the ImagerySect...
TextComponentPointerList getTextComponentPointers()
Returns a vector of pointers to the TextComponents that are currently added to this ImagerySection....
void setMasterColours(const ColourRect &cols)
Set the master colours to be used for this ImagerySection.
void setMasterColoursPropertySource(const String &property)
Set the name of the property where master colour values can be obtained.
const String & getName() const
Return the name of this ImagerySection.
ImageryComponentIterator getImageryComponentIterator() const
Return a ImagerySection::ImageryComponentIterator object to iterate over the ImageryComponent element...
std::vector< ImageryComponent *CEGUI_VECTOR_ALLOC(ImageryComponent *)> ImageryComponentPointerList
Vector of ImageryComponent Pointers.
Definition ImagerySection.h:52
void clearFrameComponents()
Clear all FrameComponents from this ImagerySection.
std::vector< FrameComponent *CEGUI_VECTOR_ALLOC(FrameComponent *)> FrameComponentPointerList
Vector of FrameComponent Pointers.
Definition ImagerySection.h:56
void addTextComponent(const TextComponent &textComponent)
Add a TextComponent to this ImagerySection.
ImageryComponentPointerList getImageryComponentPointers()
Returns a vector of pointers to the ImageryComponents that are currently added to this ImagerySection...
void writeXMLToStream(XMLSerializer &xml_stream) const
Writes an xml representation of this ImagerySection to out_stream.
bool handleFontRenderSizeChange(Window &window, const Font *font) const
perform any processing required due to the given font having changed.
void render(Window &srcWindow, const Rectf &baseRect, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
Render the ImagerySection.
void setName(const String &name)
Sets the name of this ImagerySection.
void addFrameComponent(const FrameComponent &frameComponent)
Add a FrameComponent to this ImagerySection.
Rectf getBoundingRect(const Window &wnd) const
Return smallest Rect that could contain all imagery within this section.
void removeTextComponent(const TextComponent &textComponent)
Removes an TextComponent from this ImagerySection. The supplied TextComponent reference should be ret...
void removeFrameComponent(const FrameComponent &frameComponent)
Removes an FrameComponent from this ImagerySection. The supplied FrameComponent reference should be r...
Rectf getBoundingRect(const Window &wnd, const Rectf &rect) const
Return smallest Rect that could contain all imagery within this section.
const ColourRect & getMasterColours() const
Return the current master colours set for this ImagerySection.
ImagerySection()
Constructor.
void render(Window &srcWindow, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
Render the ImagerySection.
std::vector< TextComponent *CEGUI_VECTOR_ALLOC(TextComponent *)> TextComponentPointerList
Vector of TextComponent Pointers.
Definition ImagerySection.h:54
void clearImageryComponents()
Clear all ImageryComponents from this ImagerySection.
ConstVectorIterator< ImageryList > ImageryComponentIterator
Definition ImagerySection.h:348
FrameComponentIterator getFrameComponentIterator() const
Return a ImagerySection::FrameComponentIterator object to iterate over the FrameComponent elements cu...
ConstVectorIterator< TextList > TextComponentIterator
Definition ImagerySection.h:350
ConstVectorIterator< FrameList > FrameComponentIterator
Definition ImagerySection.h:352
void addImageryComponent(const ImageryComponent &imageryComponent)
Add an ImageryComponent to this ImagerySection.
void clearTextComponents()
Clear all TextComponents from this ImagerySection.
ImagerySection(const String &name)
ImagerySection constructor. Name must be supplied, masterColours are set to 0xFFFFFFFF by default.
FrameComponentPointerList getFrameComponentPointers()
Returns a vector of pointers to the FrameComponents that are currently added to this ImagerySection....
const String & getMasterColoursPropertySource() const
Get the name of the property where master colour values can be obtained.
String class used within the GUI system.
Definition String.h:64
Class that encapsulates information for a text component.
Definition TextComponent.h:49
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition Window.h:151
Class used to create XML Document.
Definition XMLSerializer.h:87
Main namespace for Crazy Eddie's GUI Library.
Definition arch_overview.dox:1