Crazy Eddie's GUI System  0.8.7
StateImagery.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 _CEGUIFalStateImagery_h_
28 #define _CEGUIFalStateImagery_h_
29 
30 #include "./LayerSpecification.h"
31 #include "../Window.h"
32 #include <set>
33 
34 #if defined(_MSC_VER)
35 # pragma warning(push)
36 # pragma warning(disable : 4251)
37 #endif
38 
39 // Start of CEGUI namespace section
40 namespace CEGUI
41 {
46  class CEGUIEXPORT StateImagery :
47  public AllocatedObject<StateImagery>
48  {
49  public:
51  typedef std::vector<LayerSpecification*
53 
59  d_clipToDisplay(false)
60  {}
61 
69  StateImagery(const String& name);
70 
81  void render(Window& srcWindow, const ColourRect* modcols = 0, const Rectf* clipper = 0) const;
82 
96  void render(Window& srcWindow, const Rectf& baseRect, const ColourRect* modcols = 0, const Rectf* clipper = 0) const;
97 
108  void addLayer(const LayerSpecification& layer);
109 
115  void sort();
116 
124  void clearLayers();
125 
133  const String& getName() const;
134 
142  void setName(const String& name);
143 
154  bool isClippedToDisplay() const;
155 
169  void setClippedToDisplay(bool setting);
170 
182  void writeXMLToStream(XMLSerializer& xml_stream) const;
183 
184 
198  LayerSpecificationPointerList getLayerSpecificationPointers();
199 
200  private:
207  typedef std::multiset<LayerSpecification> LayersList;
208 
209  CEGUI::String d_stateName;
210  LayersList d_layers;
211  bool d_clipToDisplay;
212  public:
215 
217  LayerIterator getLayerIterator() const;
218 
219  };
220 
221 } // End of CEGUI namespace section
222 
223 
224 #if defined(_MSC_VER)
225 # pragma warning(pop)
226 #endif
227 
228 #endif // end of guard _CEGUIFalStateImagery_h_
Class that encapsulates a single layer of imagery.
Definition: LayerSpecification.h:45
Definition: MemoryAllocatedObject.h:109
ConstVectorIterator< LayersList > LayerIterator
Definition: StateImagery.h:214
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
iterator for vectors
Definition: IteratorBase.h:287
Class that holds details of colours for the four corners of a rectangle.
Definition: ColourRect.h:43
Class the encapsulates imagery for a given widget state.
Definition: StateImagery.h:46
std::vector< LayerSpecification *CEGUI_VECTOR_ALLOC(LayerSpecification *)> LayerSpecificationPointerList
Container type for LayerSpecification pointers.
Definition: StateImagery.h:52
StateImagery()
Constructor.
Definition: StateImagery.h:58
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
Class used to create XML Document.
Definition: XMLSerializer.h:85
String class used within the GUI system.
Definition: String.h:62