]> git.tdb.fi Git - libs/gltk.git/blob - source/resources.h
Reorder class members
[libs/gltk.git] / source / resources.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_RESOURCES_H_
9 #define MSP_GLTK_RESOURCES_H_
10
11 #include <msp/gl/font.h>
12 #include <msp/gl/texture.h>
13 #include <msp/datafile/collection.h>
14 #include <msp/path/path.h>
15 #include "graphic.h"
16 #include "style.h"
17
18 namespace Msp {
19 namespace GLtk {
20
21 /**
22 Stores resources such as styles and graphics.  All widgets require a Resources
23 instance in constructor.
24 */
25 class Resources: public DataFile::Collection
26 {
27 private:
28         Path path;
29         GL::Font *default_font;
30
31 public:
32         class Loader: public Collection::Loader
33         {
34         private:
35                 Resources &res;
36
37         public:
38                 Loader(Resources &);
39         private:
40                 void default_font(const std::string &);
41                 void font(const std::string &);
42         };
43
44         Resources();
45
46         void set_path(const Path &);
47         const GL::Font &get_default_font() const;
48 private:
49         GL::Font *create_font(const std::string &);
50         GL::Texture2D *create_texture(const std::string &);
51 };
52
53 } // namespace GLtk
54 } // namespace Msp
55
56 #endif