]> git.tdb.fi Git - libs/gltk.git/blob - source/style.h
Reorder class members
[libs/gltk.git] / source / style.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GLTK_STYLE_H_
9 #define MSP_GLTK_STYLE_H_
10
11 #include <msp/gl/color.h>
12 #include <msp/gl/font.h>
13 #include <msp/datafile/loader.h>
14 #include "part.h"
15
16 namespace Msp {
17 namespace GLtk {
18
19 class Resources;
20
21 /**
22 Styles define what wigets look like.  They are made up of Parts and some
23 generic properties.
24 */
25 class Style
26 {
27 public:
28         class Loader: public DataFile::Loader
29         {
30         private:
31                 Style &style;
32                 Resources &res;
33
34         public:
35                 typedef Resources Collection;
36
37                 Loader(Style &, Resources &);
38                 Style &get_object() const { return style; }
39                 Resources &get_collection() const { return res; }
40         private:
41                 void font(const std::string &);
42                 void font_color(float, float, float);
43                 void part(const std::string &);
44         };
45
46 private:
47         const GL::Font *font;
48         GL::Color font_color;
49         PartSeq parts;
50
51 public:
52         Style();
53         const GL::Font *get_font() const  { return font; }
54         const GL::Color &get_font_color() const { return font_color; }
55         const PartSeq &get_parts() const { return parts; }
56 };
57
58 } // namespace GLtk
59 } // namespace Msp
60
61 #endif