Crazy Eddie's GUI System  0.8.4
ImagerySection.h
00001 /***********************************************************************
00002     created:    Mon Jun 13 2005
00003     author:     Paul D Turner <paul@cegui.org.uk>
00004 *************************************************************************/
00005 /***************************************************************************
00006  *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
00007  *
00008  *   Permission is hereby granted, free of charge, to any person obtaining
00009  *   a copy of this software and associated documentation files (the
00010  *   "Software"), to deal in the Software without restriction, including
00011  *   without limitation the rights to use, copy, modify, merge, publish,
00012  *   distribute, sublicense, and/or sell copies of the Software, and to
00013  *   permit persons to whom the Software is furnished to do so, subject to
00014  *   the following conditions:
00015  *
00016  *   The above copyright notice and this permission notice shall be
00017  *   included in all copies or substantial portions of the Software.
00018  *
00019  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00020  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00021  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00022  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00023  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00024  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00025  *   OTHER DEALINGS IN THE SOFTWARE.
00026  ***************************************************************************/
00027 #ifndef _CEGUIFalImagerySection_h_
00028 #define _CEGUIFalImagerySection_h_
00029 
00030 #include "./ImageryComponent.h"
00031 #include "./TextComponent.h"
00032 #include "./FrameComponent.h"
00033 #include "../XMLSerializer.h"
00034 
00035 #if defined(_MSC_VER)
00036 #       pragma warning(push)
00037 #       pragma warning(disable : 4251)
00038 #endif
00039 
00040 // Start of CEGUI namespace section
00041 namespace CEGUI
00042 {
00047     class CEGUIEXPORT ImagerySection :
00048         public AllocatedObject<ImagerySection>
00049     {
00050     public:
00055         ImagerySection();
00056 
00064         ImagerySection(const String& name);
00065 
00079         void render(Window& srcWindow, const CEGUI::ColourRect* modColours = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
00080 
00097         void render(Window& srcWindow, const Rectf& baseRect, const CEGUI::ColourRect* modColours = 0, const Rectf* clipper = 0, bool clipToDisplay = false) const;
00098 
00109         void addImageryComponent(const ImageryComponent& img);
00110         void removeImageryComponent(const ImageryComponent& img);
00118         void clearImageryComponents();
00119 
00130         void addTextComponent(const TextComponent& text);
00131         void removeTextComponent(const TextComponent& text);
00139         void clearTextComponents();
00140 
00148         void clearFrameComponents();
00149 
00160         void addFrameComponent(const FrameComponent& frame);
00161         void removeFrameComponent(const FrameComponent& frame);
00162 
00170         const ColourRect& getMasterColours() const;
00171 
00182         void setMasterColours(const ColourRect& cols);
00183 
00191         const String& getName() const;
00192 
00203         void setName(const String& name);
00204 
00212         const String& getMasterColoursPropertySource() const;
00213 
00224         void setMasterColoursPropertySource(const String& property);
00225 
00230         Rectf getBoundingRect(const Window& wnd) const;
00231 
00236         Rectf getBoundingRect(const Window& wnd, const Rectf& rect) const;
00237 
00249         void writeXMLToStream(XMLSerializer& xml_stream) const;
00250 
00252         bool handleFontRenderSizeChange(Window& window, const Font* font) const;
00253 
00254     protected:
00264         void initMasterColourRect(const Window& wnd, ColourRect& cr) const;
00265 
00266     private:
00267         typedef std::vector<ImageryComponent
00268             CEGUI_VECTOR_ALLOC(ImageryComponent)> ImageryList;
00269         typedef std::vector<TextComponent
00270             CEGUI_VECTOR_ALLOC(TextComponent)> TextList;
00271         typedef std::vector<FrameComponent
00272             CEGUI_VECTOR_ALLOC(FrameComponent)> FrameList;
00273 
00274         CEGUI::String       d_name;             
00275         CEGUI::ColourRect   d_masterColours;    
00276         FrameList           d_frames;           
00277         ImageryList         d_images;           
00278         TextList            d_texts;            
00279         String              d_colourPropertyName;   
00280 
00281     public:
00282         typedef ConstVectorIterator<ImageryList> ImageryComponentIterator;
00283         typedef ConstVectorIterator<TextList> TextComponentIterator;
00284         typedef ConstVectorIterator<FrameList> FrameComponentIterator;
00291         ImageryComponentIterator getImageryComponentIterator() const;
00298         TextComponentIterator getTextComponentIterator() const;
00305         FrameComponentIterator getFrameComponentIterator() const;
00306 
00307     };
00308 
00309 } // End of  CEGUI namespace section
00310 
00311 
00312 #if defined(_MSC_VER)
00313 #       pragma warning(pop)
00314 #endif
00315 
00316 #endif  // end of guard _CEGUIFalImagerySection_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends