]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/style.cpp
Add UserInterface class
[libs/gltk.git] / source / style.cpp
index b4ee82d10eff5d1e454ebf767430d0edd941ed17..0d6e424e2163b048d65c3c76af46b7792cb87acc 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspgltk
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include "resources.h"
 #include "style.h"
 
@@ -6,8 +13,8 @@ using namespace std;
 namespace Msp {
 namespace GLtk {
 
-Style::Style():
-       font(0)
+Style::Style(Resources &r):
+       font(&r.get_default_font())
 { }
 
 
@@ -18,6 +25,7 @@ Style::Loader::Loader(Style &s, Resources &r):
        add("font",       &Style::font);
        add("font_color", &Loader::font_color);
        add("part",       &Loader::part);
+       add("special",    &Loader::special);
 }
 
 void Style::Loader::font_color(float r, float g, float b)
@@ -25,7 +33,14 @@ void Style::Loader::font_color(float r, float g, float b)
        style.font_color=GL::Color(r, g, b);
 }
 
-void Style::Loader::part(const string &n)
+void Style::Loader::part()
+{
+       Part p((string()));
+       load_sub(p, res);
+       style.parts.push_back(p);
+}
+
+void Style::Loader::special(const string &n)
 {
        Part p(n);
        load_sub(p, res);