00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
00093
00094
00095
00096
00097
00098 typedef list<INFO>::iterator infoIter;
00099 list<INFO> lInfos;
00100
00101 UiTranslator *translator;
00102
00103 bool bLoaded;
00104 };
00105
00106 #endif