1 | /************************************************************************
|
---|
2 | filename: CEGUIFalStateImagery.h
|
---|
3 | created: Mon Jun 13 2005
|
---|
4 | author: Paul D Turner <paul@cegui.org.uk>
|
---|
5 | *************************************************************************/
|
---|
6 | /*************************************************************************
|
---|
7 | Crazy Eddie's GUI System (http://www.cegui.org.uk)
|
---|
8 | Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
|
---|
9 |
|
---|
10 | This library is free software; you can redistribute it and/or
|
---|
11 | modify it under the terms of the GNU Lesser General Public
|
---|
12 | License as published by the Free Software Foundation; either
|
---|
13 | version 2.1 of the License, or (at your option) any later version.
|
---|
14 |
|
---|
15 | This library is distributed in the hope that it will be useful,
|
---|
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
18 | Lesser General Public License for more details.
|
---|
19 |
|
---|
20 | You should have received a copy of the GNU Lesser General Public
|
---|
21 | License along with this library; if not, write to the Free Software
|
---|
22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
23 | *************************************************************************/
|
---|
24 | #ifndef _CEGUIFalStateImagery_h_
|
---|
25 | #define _CEGUIFalStateImagery_h_
|
---|
26 |
|
---|
27 | #include "falagard/CEGUIFalLayerSpecification.h"
|
---|
28 | #include "CEGUIWindow.h"
|
---|
29 | #include <set>
|
---|
30 |
|
---|
31 | #if defined(_MSC_VER)
|
---|
32 | # pragma warning(push)
|
---|
33 | # pragma warning(disable : 4251)
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | // Start of CEGUI namespace section
|
---|
37 | namespace CEGUI
|
---|
38 | {
|
---|
39 | /*!
|
---|
40 | \brief
|
---|
41 | Class the encapsulates imagery for a given widget state.
|
---|
42 | */
|
---|
43 | class CEGUIEXPORT StateImagery
|
---|
44 | {
|
---|
45 | public:
|
---|
46 | /*!
|
---|
47 | \brief
|
---|
48 | Constructor
|
---|
49 | */
|
---|
50 | StateImagery() {}
|
---|
51 |
|
---|
52 | /*!
|
---|
53 | \brief
|
---|
54 | Constructor
|
---|
55 |
|
---|
56 | \param name
|
---|
57 | Name of the state
|
---|
58 | */
|
---|
59 | StateImagery(const String& name);
|
---|
60 |
|
---|
61 | /*!
|
---|
62 | \brief
|
---|
63 | Render imagery for this state.
|
---|
64 |
|
---|
65 | \param srcWindow
|
---|
66 | Window to use when convering BaseDim values to pixels.
|
---|
67 |
|
---|
68 | \return
|
---|
69 | Nothing.
|
---|
70 | */
|
---|
71 | void render(Window& srcWindow, const ColourRect* modcols = 0, const Rect* clipper = 0) const;
|
---|
72 |
|
---|
73 | /*!
|
---|
74 | \brief
|
---|
75 | Render imagery for this state.
|
---|
76 |
|
---|
77 | \param srcWindow
|
---|
78 | Window to use when convering BaseDim values to pixels.
|
---|
79 |
|
---|
80 | \param baseRect
|
---|
81 | Rect to use when convering BaseDim values to pixels.
|
---|
82 |
|
---|
83 | \return
|
---|
84 | Nothing.
|
---|
85 | */
|
---|
86 | void render(Window& srcWindow, const Rect& baseRect, const ColourRect* modcols = 0, const Rect* clipper = 0) const;
|
---|
87 |
|
---|
88 | /*!
|
---|
89 | \brief
|
---|
90 | Add an imagery LayerSpecification to this state.
|
---|
91 |
|
---|
92 | \param layer
|
---|
93 | LayerSpecification to be added to this state (will be copied)
|
---|
94 |
|
---|
95 | \return
|
---|
96 | Nothing.
|
---|
97 | */
|
---|
98 | void addLayer(const LayerSpecification& layer);
|
---|
99 |
|
---|
100 | /*!
|
---|
101 | \brief
|
---|
102 | Removed all LayerSpecifications from this state.
|
---|
103 |
|
---|
104 | \return
|
---|
105 | Nothing.
|
---|
106 | */
|
---|
107 | void clearLayers();
|
---|
108 |
|
---|
109 | /*!
|
---|
110 | \brief
|
---|
111 | Return the name of this state.
|
---|
112 |
|
---|
113 | \return
|
---|
114 | String object holding the name of the StateImagery object.
|
---|
115 | */
|
---|
116 | const String& getName() const;
|
---|
117 |
|
---|
118 | /*!
|
---|
119 | \brief
|
---|
120 | Return whether this state imagery should be clipped to the display rather than the target window.
|
---|
121 |
|
---|
122 | Clipping to the display effectively implies that the imagery should be rendered unclipped.
|
---|
123 |
|
---|
124 | /return
|
---|
125 | - true if the imagery will be clipped to the display area.
|
---|
126 | - false if the imagery will be clipped to the target window area.
|
---|
127 | */
|
---|
128 | bool isClippedToDisplay() const;
|
---|
129 |
|
---|
130 | /*!
|
---|
131 | \brief
|
---|
132 | Set whether this state imagery should be clipped to the display rather than the target window.
|
---|
133 |
|
---|
134 | Clipping to the display effectively implies that the imagery should be rendered unclipped.
|
---|
135 |
|
---|
136 | \param setting
|
---|
137 | - true if the imagery should be clipped to the display area.
|
---|
138 | - false if the imagery should be clipped to the target window area.
|
---|
139 |
|
---|
140 | \return
|
---|
141 | Nothing.
|
---|
142 | */
|
---|
143 | void setClippedToDisplay(bool setting);
|
---|
144 |
|
---|
145 | /*!
|
---|
146 | \brief
|
---|
147 | Writes an xml representation of this StateImagery to \a out_stream.
|
---|
148 |
|
---|
149 | \param out_stream
|
---|
150 | Stream where xml data should be output.
|
---|
151 |
|
---|
152 | \return
|
---|
153 | Nothing.
|
---|
154 | */
|
---|
155 | void writeXMLToStream(OutStream& out_stream) const;
|
---|
156 |
|
---|
157 | private:
|
---|
158 | typedef std::multiset<LayerSpecification> LayersList;
|
---|
159 |
|
---|
160 | CEGUI::String d_stateName; //!< Name of this state.
|
---|
161 | LayersList d_layers; //!< Collection of LayerSpecification objects to be drawn for this state.
|
---|
162 | bool d_clipToDisplay; //!< true if Imagery for this state should be clipped to the display instead of winodw (effectively, not clipped).
|
---|
163 | };
|
---|
164 |
|
---|
165 | } // End of CEGUI namespace section
|
---|
166 |
|
---|
167 |
|
---|
168 | #if defined(_MSC_VER)
|
---|
169 | # pragma warning(pop)
|
---|
170 | #endif
|
---|
171 |
|
---|
172 | #endif // end of guard _CEGUIFalStateImagery_h_
|
---|