uifiletheme.h

Go to the documentation of this file.
00001 /********************************************************************************/
00002 /*                                                                              */
00003 /*  Netrinjo-Engine - a library for game-development                            */
00004 /*  Copyright (C) 2005 by Tobias Nadler                                         */
00005 /*                                                                              */
00006 /*  This library is free software; you can redistribute it and/or               */
00007 /*  modify it under the terms of the GNU Lesser General Public                  */
00008 /*  License as published by the Free Software Foundation; either                */
00009 /*  version 2.1 of the License, or (at your option) any later version.          */
00010 /*                                                                              */
00011 /*  This library is distributed in the hope that it will be useful,             */
00012 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of              */
00013 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU           */
00014 /*  Lesser General Public License for more details.                             */
00015 /*                                                                              */
00016 /*  You should have received a copy of the GNU Lesser General Public            */
00017 /*  License along with this library; if not, write to the Free Software         */
00018 /*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   */
00019 /*                                                                              */
00020 /********************************************************************************/
00021 
00022 #ifndef UIFILETHEME_H
00023 #define UIFILETHEME_H
00024 
00025 #include "uitheme.h"
00026 #include <list>
00027 
00028 using namespace std;
00029 
00030 class UiTranslator;
00031 
00052 class DECLSPEC UiFileTheme : public UiTheme
00053 {
00054 public:
00061     DECLSPEC UiFileTheme( const char *fn, const char *name = 0 );
00062     virtual DECLSPEC ~UiFileTheme();
00063 
00064     virtual DECLSPEC const char *getString( const char *usage, int *length = 0 );
00065     virtual DECLSPEC Uint32 getUint32( const char *usage, bool *found = 0 );
00066     virtual DECLSPEC bool getBool( const char *usage, bool *found = 0 );
00067     virtual DECLSPEC SDL_Rect getRect( const char *usage );
00068     virtual DECLSPEC const char *translate( const char *text );
00069 
00070 protected:
00071     virtual DECLSPEC Uint32 onLoad(bool hidden);
00072     virtual DECLSPEC Uint32 onActivate();
00073     virtual DECLSPEC Uint32 onDeactivate();
00074     virtual bool isLoaded() { return bLoaded; }
00075 
00076 private:
00077     static unsigned int extractSubStrings( char *line, char **subs, unsigned int max );
00078     char *chFileName;
00079 
00080     struct INFO
00081     {
00082         char *usage;
00083         char *content;
00084         int lenght;
00085     };
00086     struct FONTINFO
00087     {
00088         int n;
00089         Uint32 cLight, cDark;
00090         char *chLightBmps, *chDarkBmps, *fnChars;
00091     };
00092 /*  struct FONTSURFS
00093     {
00094         char chTTF[256], chChars[256], chName[256], chBgBmp[256];
00095         int nSize;
00096         SDL_Color color;
00097     };*/
00098     typedef list<INFO>::iterator infoIter;
00099     list<INFO> lInfos;
00100 
00101     UiTranslator *translator;
00102 
00103     bool bLoaded;
00104 };
00105 
00106 #endif

Generated on Wed May 9 17:35:55 2007 for netrinjo by  doxygen 1.5.1