00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _CEGUIWindowRenderer_h_
00031 #define _CEGUIWindowRenderer_h_
00032
00033 #include "CEGUIWindow.h"
00034 #include "CEGUIProperty.h"
00035 #include <vector>
00036 #include <utility>
00037
00038 #if defined(_MSC_VER)
00039 # pragma warning(push)
00040 # pragma warning(disable : 4251)
00041 #endif
00042
00043
00044
00045 namespace CEGUI
00046 {
00051 class CEGUIEXPORT WindowRenderer
00052 {
00053 public:
00054
00055
00056
00068 WindowRenderer(const String& name, const String& class_name="Window");
00069
00074 virtual ~WindowRenderer();
00075
00076
00077
00078
00087 virtual void render() = 0;
00088
00093 const String& getName() const {return d_name;}
00094
00099 Window* getWindow() const {return d_window;}
00100
00105 const String& getClass() const {return d_class;}
00106
00111 const WidgetLookFeel& getLookNFeel() const;
00112
00118 virtual Rect getUnclippedInnerRect() const;
00119
00125 virtual void performChildWindowLayout() {}
00126
00132 virtual void getRenderingContext(RenderingContext& ctx) const;
00133
00135 virtual void update(float ) {}
00136
00137 protected:
00138
00139
00140
00155 void registerProperty(Property* property, const bool ban_from_xml);
00156
00166 void registerProperty(Property* property);
00167
00172 virtual void onAttach();
00173
00178 virtual void onDetach();
00179
00184 virtual void onLookNFeelAssigned() {}
00185
00190 virtual void onLookNFeelUnassigned() {}
00191
00192 void operator=(const WindowRenderer&) {}
00193
00194
00195
00196
00197 Window* d_window;
00198 const String d_name;
00199 const String d_class;
00200
00202 typedef std::pair<Property*, bool> PropertyEntry;
00204 typedef std::vector<PropertyEntry> PropertyList;
00205 PropertyList d_properties;
00206
00207
00208
00209 friend class Window;
00210 };
00211
00216 class CEGUIEXPORT WindowRendererFactory
00217 {
00218 public:
00226 WindowRendererFactory(const String& name) : d_factoryName(name) {}
00227
00232 virtual ~WindowRendererFactory() {}
00233
00238 const String& getName() const {return d_factoryName;}
00239
00244 virtual WindowRenderer* create() = 0;
00245
00250 virtual void destroy(WindowRenderer* wr) = 0;
00251
00252 protected:
00253 String d_factoryName;
00254 };
00255
00256 }
00257
00258 #if defined(_MSC_VER)
00259 # pragma warning(pop)
00260 #endif
00261
00262 #endif // _CEGUIWindowRenderer_h_