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
00033 #ifndef PG_THEME_H
00034 #define PG_THEME_H
00035
00036 #include "paragui.h"
00037 #include "pglabel.h"
00038 #include "pgfont.h"
00039 #include "pgdraw.h"
00040
00045 class DECLSPEC PG_Theme {
00046 public:
00047
00048 virtual ~PG_Theme() {}
00049 ;
00050
00051 virtual const std::string& FindDefaultFontName() = 0;
00052 virtual int FindDefaultFontSize() = 0;
00053 virtual PG_Font::Style FindDefaultFontStyle() = 0;
00054 virtual const std::string& FindFontName(const std::string& widgettype, const std::string& objectname) = 0;
00055 virtual int FindFontSize(const std::string& widgettype, const std::string& objectname) = 0;
00056 virtual PG_Font::Style FindFontStyle(const std::string& widgettype, const std::string& objectname) = 0;
00057 virtual SDL_Surface* FindSurface(const std::string& widgettype, const std::string& object, const std::string& name) = 0;
00058 virtual PG_Gradient* FindGradient(const std::string& widgettype, const std::string& object, const std::string& name) = 0;
00059 virtual void GetProperty(const std::string& widgettype, const std::string& object, const std::string& name, long& prop) = 0;
00060 virtual void GetProperty(const std::string& widgettype, const std::string& object, const std::string& name, Uint8& prop) = 0;
00061 virtual void GetProperty(const std::string& widgettype, const std::string& object, const std::string& name, bool& prop) = 0;
00062 virtual void GetProperty(const std::string& widgettype, const std::string& object, const std::string& name, int& prop) = 0;
00063 inline void GetProperty(const std::string& widgettype, const std::string& object, const std::string& name, Uint16& prop) {
00064 long b=-1;
00065 GetProperty(widgettype, object, name, b);
00066 if(b == -1) {
00067 return;
00068 }
00069 prop = (Uint16)b;
00070 }
00071 virtual void GetProperty(const std::string& widgettype, const std::string& object, const std::string& name, PG_Draw::BkMode& prop) = 0;
00072 virtual void GetAlignment(const std::string& widgettype, const std::string& object, const std::string& name, PG_Label::TextAlign& align) = 0;
00073 virtual void GetColor(const std::string& widgettype, const std::string& object, const std::string& name, PG_Color& color) = 0;
00074 virtual const std::string& FindString(const std::string& widgettype, const std::string& object, const std::string& name) = 0;
00075
00085 static PG_Theme* Load(const std::string& xmltheme);
00086
00089 static void Unload(PG_Theme* theme);
00090 };
00091
00092 #endif // PG_THEME_H