Crazy Eddies GUI System  0.7.0
CEGUIFalImagerySection.h
1 /***********************************************************************
2  filename: CEGUIFalImagerySection.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 "CEGUIFalImageryComponent.h"
32 #include "CEGUIFalTextComponent.h"
33 #include "CEGUIFalFrameComponent.h"
34 #include "../CEGUIXMLSerializer.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  {
50  public:
56 
64  ImagerySection(const String& name);
65 
79  void render(Window& srcWindow, const CEGUI::ColourRect* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = false) const;
80 
97  void render(Window& srcWindow, const Rect& baseRect, const CEGUI::ColourRect* modColours = 0, const Rect* clipper = 0, bool clipToDisplay = false) const;
98 
109  void addImageryComponent(const ImageryComponent& img);
110 
118  void clearImageryComponents();
119 
130  void addTextComponent(const TextComponent& text);
131 
139  void clearTextComponents();
140 
148  void clearFrameComponents();
149 
160  void addFrameComponent(const FrameComponent& frame);
161 
169  const ColourRect& getMasterColours() const;
170 
181  void setMasterColours(const ColourRect& cols);
182 
190  const String& getName() const;
191 
202  void setMasterColoursPropertySource(const String& property);
203 
215  void setMasterColoursPropertyIsColourRect(bool setting = true);
216 
221  Rect getBoundingRect(const Window& wnd) const;
222 
227  Rect getBoundingRect(const Window& wnd, const Rect& rect) const;
228 
240  void writeXMLToStream(XMLSerializer& xml_stream) const;
241 
242  protected:
252  void initMasterColourRect(const Window& wnd, ColourRect& cr) const;
253 
254  private:
255  typedef std::vector<ImageryComponent> ImageryList;
256  typedef std::vector<TextComponent> TextList;
257  typedef std::vector<FrameComponent> FrameList;
258 
259  CEGUI::String d_name;
260  CEGUI::ColourRect d_masterColours;
261  FrameList d_frames;
262  ImageryList d_images;
263  TextList d_texts;
264  String d_colourPropertyName;
265  bool d_colourProperyIsRect;
266  };
267 
268 } // End of CEGUI namespace section
269 
270 
271 #if defined(_MSC_VER)
272 # pragma warning(pop)
273 #endif
274 
275 #endif // end of guard _CEGUIFalImagerySection_h_