]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/style.cpp
Fix HSlider
[libs/gltk.git] / source / style.cpp
index 3f276ed409add4799212373abbfd2c45202b0deb..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,36 +13,37 @@ using namespace std;
 namespace Msp {
 namespace GLtk {
 
-Style::Style(const Resources &r, const string &w, const string &n):
-       res(r),
-       widget(w),
-       name(n),
-       font(&res.get_default_font())
+Style::Style(Resources &r):
+       font(&r.get_default_font())
 { }
 
 
-Style::Loader::Loader(Style &s):
-       style(s)
+Style::Loader::Loader(Style &s, Resources &r):
+       style(s),
+       res(r)
 {
-       add("font", &Loader::font);
+       add("font",       &Style::font);
        add("font_color", &Loader::font_color);
-       add("part", &Loader::part);
+       add("part",       &Loader::part);
+       add("special",    &Loader::special);
 }
 
-void Style::Loader::font(const string &f)
+void Style::Loader::font_color(float r, float g, float b)
 {
-       style.font=&style.res.get_font(f);
+       style.font_color=GL::Color(r, g, b);
 }
 
-void Style::Loader::font_color(float r, float g, float b)
+void Style::Loader::part()
 {
-       style.font_color=Color(r, g, b);
+       Part p((string()));
+       load_sub(p, res);
+       style.parts.push_back(p);
 }
 
-void Style::Loader::part(const string &n)
+void Style::Loader::special(const string &n)
 {
-       Part p(style.res, n);
-       load_sub(p);
+       Part p(n);
+       load_sub(p, res);
        style.parts.push_back(p);
 }