14 const GL::Font &Style::get_font() const
17 throw logic_error("!font");
21 const GL::Color &Style::get_font_color(State s) const
24 throw invalid_argument("Style::get_font_color");
29 const Part *Style::get_part(const string &name) const
31 for(PartSeq::const_iterator i=parts.begin(); i!=parts.end(); ++i)
32 if(i->get_name()==name)
39 Style::Loader::Loader(Style &s, Resources &r):
40 DataFile::CollectionObjectLoader<Style, Resources>(s, &r)
44 obj.font = &get_collection().get_default_font();
45 obj.font_size = obj.font->get_native_size();
48 add("font", &Loader::font);
49 add("font_color", &Loader::font_color_normal);
50 add("font_color", &Loader::font_color);
51 add("font_size", &Style::font_size);
52 add("part", &Loader::part);
53 add("part", &Loader::unnamed_part);
56 void Style::Loader::font(const string &n)
58 obj.font = &get_collection().get<GL::Font>(n);
59 obj.font_size = obj.font->get_native_size();
62 void Style::Loader::font_color_normal(float r, float g, float b)
64 font_color(NORMAL, r, g, b);
67 void Style::Loader::font_color(State s, float r, float g, float b)
69 for(unsigned i=0; i<N_STATES_; ++i)
71 obj.font_color[i] = GL::Color(r, g, b);
74 void Style::Loader::part(const string &n)
77 load_sub(p, get_collection());
78 obj.parts.push_back(p);
81 void Style::Loader::unnamed_part()