skin_parser.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef SKIN_PARSER_HPP
00025 #define SKIN_PARSER_HPP
00026
00027 #include "xmlparser.hpp"
00028 #include "builder_data.hpp"
00029 #include <set>
00030
00031
00032
00033 class SkinParser: public XMLParser
00034 {
00035 public:
00036 SkinParser( intf_thread_t *pIntf, const string &rFileName,
00037 const string &rPath, bool useDTD = true,
00038 BuilderData *pData = NULL );
00039 virtual ~SkinParser();
00040
00041 const BuilderData &getData() const { return *m_pData; }
00042
00043 static int convertColor( const char *transcolor );
00044
00045 private:
00046
00047 const string m_path;
00048
00049 BuilderData *m_pData;
00050
00051 bool m_ownData;
00052
00053 string m_curBitmapId;
00054 string m_curWindowId;
00055 string m_curLayoutId;
00056 string m_curPopupId;
00057 string m_curListId;
00058 string m_curTreeId;
00059
00060 list<int> m_popupPosList;
00061
00062 int m_xOffset, m_yOffset;
00063 list<int> m_xOffsetList, m_yOffsetList;
00064
00065 list<string> m_panelStack;
00066
00067 int m_curLayer;
00068
00069 set<string> m_idSet;
00070
00071
00072 virtual void handleBeginElement( const string &rName,
00073 AttrList_t &attr );
00074 virtual void handleEndElement( const string &rName );
00075
00076
00077
00078 bool convertBoolean( const char *value ) const;
00079
00080
00081 int convertInRange( const char *value, int minValue, int maxValue,
00082 const string &rAttribute ) const;
00083
00084
00085
00086 const string generateId() const;
00087
00088
00089 const string uniqueId( const string &id );
00090
00091
00092 static void DefaultAttr( AttrList_t &attr, const char *a, const char *b )
00093 {
00094 if( attr.find(a) == attr.end() ) attr[strdup(a)] = strdup(b);
00095 }
00096
00097 bool MissingAttr( AttrList_t &attr, const string &name, const char *a );
00098
00099 };
00100
00101 #endif