Crazy Eddie's GUI System  0.8.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ImagerySection.h
1 /***********************************************************************
2  filename: CEGUIImagerySection.h
3  created: Mon Jun 13 2005
4  author: Paul D Turner <paul@cegui.org.uk>
5 *************************************************************************/
6 /***************************************************************************
7  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining
10  * a copy of this software and associated documentation files (the
11  * "Software"), to deal in the Software without restriction, including
12  * without limitation the rights to use, copy, modify, merge, publish,
13  * distribute, sublicense, and/or sell copies of the Software, and to
14  * permit persons to whom the Software is furnished to do so, subject to
15  * the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be
18  * included in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  * OTHER DEALINGS IN THE SOFTWARE.
27  ***************************************************************************/
28 #ifndef _CEGUIFalImagerySection_h_
29 #define _CEGUIFalImagerySection_h_
30 
31 #include "./ImageryComponent.h"
32 #include "./TextComponent.h"
33 #include "./FrameComponent.h"
34 #include "../XMLSerializer.h"
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 // Start of CEGUI namespace section
42 namespace CEGUI
43 {
48  class CEGUIEXPORT ImagerySection :
49  public AllocatedObject<ImagerySection>
50  {
51  public:
57 
65  ImagerySection(const String& name);
66 
80  void render(Window& srcWindow, const CEGUI::ColourRect* modColours = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
81 
98  void render(Window& srcWindow, const Rectf& baseRect, const CEGUI::ColourRect* modColours = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
99 
110  void addImageryComponent(const ImageryComponent& img);
111  void removeImageryComponent(const ImageryComponent& img);
119  void clearImageryComponents();
120 
131  void addTextComponent(const TextComponent& text);
132  void removeTextComponent(const TextComponent& text);
140  void clearTextComponents();
141 
149  void clearFrameComponents();
150 
161  void addFrameComponent(const FrameComponent& frame);
162  void removeFrameComponent(const FrameComponent& frame);
163 
171  const ColourRect& getMasterColours() const;
172 
183  void setMasterColours(const ColourRect& cols);
184 
192  const String& getName() const;
193 
204  void setName(const String& name);
205 
213  const String& getMasterColoursPropertySource() const;
214 
225  void setMasterColoursPropertySource(const String& property);
226 
231  Rectf getBoundingRect(const Window& wnd) const;
232 
237  Rectf getBoundingRect(const Window& wnd, const Rectf& rect) const;
238 
250  void writeXMLToStream(XMLSerializer& xml_stream) const;
251 
253  bool handleFontRenderSizeChange(Window& window, const Font* font) const;
254 
255  protected:
265  void initMasterColourRect(const Window& wnd, ColourRect& cr) const;
266 
267  private:
268  typedef std::vector<ImageryComponent
269  CEGUI_VECTOR_ALLOC(ImageryComponent)> ImageryList;
270  typedef std::vector<TextComponent
271  CEGUI_VECTOR_ALLOC(TextComponent)> TextList;
272  typedef std::vector<FrameComponent
273  CEGUI_VECTOR_ALLOC(FrameComponent)> FrameList;
274 
275  CEGUI::String d_name;
276  CEGUI::ColourRect d_masterColours;
277  FrameList d_frames;
278  ImageryList d_images;
279  TextList d_texts;
280  String d_colourPropertyName;
281 
282  public:
292  ImageryComponentIterator getImageryComponentIterator() const;
299  TextComponentIterator getTextComponentIterator() const;
306  FrameComponentIterator getFrameComponentIterator() const;
307 
308  };
309 
310 } // End of CEGUI namespace section
311 
312 
313 #if defined(_MSC_VER)
314 # pragma warning(pop)
315 #endif
316 
317 #endif // end of guard _CEGUIFalImagerySection_h_