X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstyle.cpp;fp=source%2Fstyle.cpp;h=3f276ed409add4799212373abbfd2c45202b0deb;hb=c1f038acb91eb3bfaa34dfd4729d19ed3f871a42;hp=0000000000000000000000000000000000000000;hpb=1b5097c11b1226e14e23a0827c5238ba5d3ba444;p=libs%2Fgltk.git diff --git a/source/style.cpp b/source/style.cpp new file mode 100644 index 0000000..3f276ed --- /dev/null +++ b/source/style.cpp @@ -0,0 +1,43 @@ +#include "resources.h" +#include "style.h" + +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::Loader::Loader(Style &s): + style(s) +{ + add("font", &Loader::font); + add("font_color", &Loader::font_color); + add("part", &Loader::part); +} + +void Style::Loader::font(const string &f) +{ + style.font=&style.res.get_font(f); +} + +void Style::Loader::font_color(float r, float g, float b) +{ + style.font_color=Color(r, g, b); +} + +void Style::Loader::part(const string &n) +{ + Part p(style.res, n); + load_sub(p); + style.parts.push_back(p); +} + +} // namespace GLtk +} // namespace Msp