27 #ifndef _CEGUIImage_h_
28 #define _CEGUIImage_h_
30 #include "CEGUI/ChainedXMLHandler.h"
31 #include "CEGUI/String.h"
32 #include "CEGUI/ColourRect.h"
33 #include "CEGUI/Rect.h"
77 typedef return_type safe_method_return_type;
79 typedef String string_return_type;
81 static const String& getDataTypeName()
83 static String type(
"AutoScaledMode");
88 static return_type fromString(
const String& str)
90 if (str ==
"vertical")
94 else if (str ==
"horizontal")
98 else if (str ==
"min")
102 else if (str ==
"max")
106 else if (str ==
"true" || str ==
"True")
116 static string_return_type toString(pass_type val)
144 assert(
false &&
"Invalid auto scaled mode");
158 class CEGUIEXPORT Image :
159 public AllocatedObject<Image>,
160 public ChainedXMLHandler
165 virtual const String& getName()
const = 0;
167 virtual const Sizef& getRenderedSize()
const = 0;
168 virtual const Vector2f& getRenderedOffset()
const = 0;
170 virtual void render(GeometryBuffer& buffer,
171 const Rectf& dest_area,
172 const Rectf* clip_area,
173 const ColourRect& colours)
const = 0;
175 virtual void notifyDisplaySizeChanged(
const Sizef& size) = 0;
178 void render(GeometryBuffer& buffer,
179 const Vector2f& position,
180 const Rectf* clip_area = 0)
const
183 render(buffer,
Rectf(position, getRenderedSize()), clip_area, colours);
188 const Rectf* clip_area,
191 render(buffer,
Rectf(position, getRenderedSize()), clip_area, colours);
194 void render(GeometryBuffer& buffer,
195 const Vector2f& position,
197 const Rectf* clip_area = 0)
const
199 const ColourRect colours(0XFFFFFFFF);
200 render(buffer, Rectf(position, size), clip_area, colours);
203 void render(GeometryBuffer& buffer,
204 const Vector2f& position,
206 const Rectf* clip_area,
207 const ColourRect& colours)
const
209 render(buffer, Rectf(position, size), clip_area, colours);
221 const Sizef& display_size,
222 const Sizef& native_display_size,
228 void elementStartLocal(
const String& element,
229 const XMLAttributes& attributes);
230 void elementEndLocal(
const String& element);
235 #endif // end of guard _CEGUIImage_h_