# CEGUIScheme.h

    00001 /************************************************************************
    00002         filename:       CEGUIScheme.h
    00003         created:        21/2/2004
    00004         author:         Paul D Turner
    00005
    00006         purpose:        Defines abstract base class for the GUI Scheme object.
    00007 *************************************************************************/
    00008 /*************************************************************************
    00009     Crazy Eddie's GUI System (http://www.cegui.org.uk)
    00010     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
    00011
    00012     This library is free software; you can redistribute it and/or
    00013     modify it under the terms of the GNU Lesser General Public
    00014     License as published by the Free Software Foundation; either
    00015     version 2.1 of the License, or (at your option) any later version.
    00016
    00017     This library is distributed in the hope that it will be useful,
    00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00020     Lesser General Public License for more details.
    00021
    00022     You should have received a copy of the GNU Lesser General Public
    00023     License along with this library; if not, write to the Free Software
    00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00025 *************************************************************************/
    00026 #ifndef _CEGUIScheme_h_
    00027 #define _CEGUIScheme_h_
    00028
    00029 #include "CEGUIBase.h"
    00030 #include "CEGUIString.h"
    00031 #include "CEGUISchemeManager.h"
    00032
    00033 #include <vector>
    00034
    00035
    00036 #if defined(_MSC_VER)
    00037 #       pragma warning(push)
    00038 #       pragma warning(disable : 4251)
    00039 #endif
    00040
    00041
    00042 // Start of CEGUI namespace section
    00043 namespace CEGUI
    00044 {
    00054 class CEGUIEXPORT Scheme
    00055 {
    00056         friend class Scheme_xmlHandler;
    00057 public:
    00065         void    loadResources(void);
    00066
    00067
    00075         void    unloadResources(void);
    00076
    00077
    00085         bool    resourcesLoaded(void) const;
    00086
    00087
    00095         const String& getName(void) const               {return d_name;}
    00096
    00097 private:
    00098         /*************************************************************************
    00099                 Implementation Constants
    00100         *************************************************************************/
    00101         static const char       GUISchemeSchemaName[];
    00102
    00103         /*************************************************************************
    00104                 Friends
    00105         *************************************************************************/
    00106         friend  Scheme* SchemeManager::loadScheme(const String& scheme_filename, const String& resourceGroup);
    00107         friend  void    SchemeManager::unloadScheme(const String& scheme_name);
    00108
    00109
    00110         /*************************************************************************
    00111                 Construction and Destruction
    00112         *************************************************************************/
    00127         Scheme(const String& filename, const String& resourceGroup);
    00128
    00129
    00130 public:         // for luabind compatibility
    00138         ~Scheme(void);
    00139
    00140
    00141 private:
    00142         /*************************************************************************
    00143                 Structs used to hold scheme information
    00144         *************************************************************************/
    00145         struct LoadableUIElement
    00146         {
    00147                 String  name;
    00148                 String  filename;
    00149         String  resourceGroup;
    00150         };
    00151
    00152         struct  UIElementFactory
    00153         {
    00154                 String name;
    00155         };
    00156
    00157         struct  UIModule
    00158         {
    00159                 String name;
    00160                 FactoryModule*  module;
    00161                 std::vector<UIElementFactory>   factories;
    00162         };
    00163
    00164         struct AliasMapping
    00165         {
    00166                 String aliasName;
    00167                 String targetName;
    00168         };
    00169
    00170     struct FalagardMapping
    00171     {
    00172         String windowName;
    00173         String targetName;
    00174         String lookName;
    00175     };
    00176
    00177         /*************************************************************************
    00178                 Implementation Data
    00179         *************************************************************************/
    00180         String  d_name;
    00181
    00182         std::vector<LoadableUIElement>          d_imagesets;
    00183         std::vector<LoadableUIElement>          d_imagesetsFromImages;
    00184         std::vector<LoadableUIElement>          d_fonts;
    00185         std::vector<UIModule>                           d_widgetModules;
    00186         std::vector<AliasMapping>                       d_aliasMappings;
    00187     std::vector<LoadableUIElement>              d_looknfeels;
    00188     std::vector<FalagardMapping>        d_falagardMappings;
    00189 };
    00190
    00191 } // End of  CEGUI namespace section
    00192
    00193 #if defined(_MSC_VER)
    00194 #       pragma warning(pop)
    00195 #endif
    00196
    00197 #endif  // end of guard _CEGUIScheme_h_