00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __ICONS_H__
00031 #define __ICONS_H__
00032
00034
00035 #include <string>
00036 #include <map>
00037
00038
00039
00040
00041
00087
00088
00089
00090
00091 #define IconActive 1
00092 #define IconClicked 2
00093 #define IconSelected 4
00094 #define IconDisabled 8
00095 #define IconAutoCast 16
00096
00097
00098
00099
00100
00101 class CGraphic;
00102 class CPlayer;
00103 class ButtonStyle;
00104
00106 class CIcon {
00107 public:
00108 CIcon(const std::string &ident);
00109 ~CIcon();
00110
00111 static CIcon *New(const std::string &ident);
00112 static CIcon *Get(const std::string &ident);
00113
00115 void DrawIcon(const CPlayer &player, int x, int y) const;
00117 void DrawUnitIcon(const CPlayer *player, ButtonStyle *style,
00118 unsigned flags, int x, int y, const std::string &text) const;
00119
00120 inline const std::string &GetIdent() { return this->Ident; }
00121
00122 CGraphic *G;
00123 int Frame;
00124 private:
00125 std::string Ident;
00126 };
00127
00129 class IconConfig {
00130 public:
00131 IconConfig() : Icon(NULL) {}
00132
00133 void Load();
00134
00135 std::string Name;
00136 CIcon *Icon;
00137 };
00138
00139 extern std::map<std::string, CIcon *> Icons;
00140
00141
00142
00143
00144
00145 extern void InitIcons();
00146 extern void LoadIcons();
00147 extern void CleanIcons();
00148
00150 extern void IconCclRegister();
00151
00153
00154 #endif // !__ICONS_H__