]> git.tdb.fi Git - libs/gltk.git/blob - source/style.h
bc210a23fd7ff00a251a9d58c91caa840bea782f
[libs/gltk.git] / source / style.h
1 #ifndef MSP_GLTK_STYLE_H_
2 #define MSP_GLTK_STYLE_H_
3
4 #include <msp/gl/color.h>
5 #include <msp/gl/font.h>
6 #include <msp/datafile/loader.h>
7 #include "part.h"
8
9 namespace Msp {
10 namespace GLtk {
11
12 class Resources;
13
14 class Style
15 {
16 public:
17         class Loader: public DataFile::Loader
18         {
19         private:
20                 Style &style;
21                 Resources &res;
22
23         public:
24                 typedef Resources Collection;
25
26                 Loader(Style &, Resources &);
27                 Style &get_object() const { return style; }
28                 Resources &get_collection() const { return res; }
29         private:
30                 void font(const std::string &);
31                 void font_color(float, float, float);
32                 void part(const std::string &);
33         };
34
35         Style();
36         const GL::Font *get_font() const  { return font; }
37         const GL::Color &get_font_color() const { return font_color; }
38         const PartSeq &get_parts() const { return parts; }
39 private:
40         const GL::Font *font;
41         GL::Color font_color;
42         PartSeq parts;
43 };
44
45 } // namespace GLtk
46 } // namespace Msp
47
48 #endif