]> git.tdb.fi Git - poefilter.git/blob - source/theme.h
7e296ae44c799027d949ebca64f98959b493cb64
[poefilter.git] / source / theme.h
1 #ifndef THEME_H_
2 #define THEME_H_
3
4 #include <map>
5 #include <string>
6 #include <msp/datafile/objectloader.h>
7
8 struct Color
9 {
10         unsigned r;
11         unsigned g;
12         unsigned b;
13
14         Color();
15         Color(unsigned, unsigned, unsigned);
16 };
17
18
19 class Theme
20 {
21 public:
22         class Loader: public Msp::DataFile::ObjectLoader<Theme>
23         {
24         public:
25                 Loader(Theme &);
26
27         private:
28                 void color(const std::string &, unsigned, unsigned, unsigned);
29         };
30
31 private:
32         typedef std::map<std::string, Color> ColorMap;
33
34         ColorMap colors;
35         unsigned base_font_size;
36
37 public:
38         Theme();
39
40         void set_color(const std::string &, const Color &);
41         const Color &get_color(const std::string &) const;
42
43         void set_base_font_size(unsigned);
44         unsigned get_base_font_size() const { return base_font_size; }
45 };
46
47 #endif