X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flogic.cpp;h=e9542a6dfb26815f7d4e371911ae65775e991b8b;hb=754751fd474c6eac073fa7e89a18142fc89cb4fb;hp=85ec710def369c7b6764e0cb69f0e628f03e8af6;hpb=0af3c2393bd00f39db3bfaf5b78a7a44f0fd5ff1;p=libs%2Fgltk.git diff --git a/source/logic.cpp b/source/logic.cpp index 85ec710..e9542a6 100644 --- a/source/logic.cpp +++ b/source/logic.cpp @@ -1,10 +1,4 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - +#include #include "logic.h" using namespace std; @@ -13,7 +7,7 @@ namespace Msp { namespace GLtk { Logic::Loader::Loader(Logic &l, const map &w): - logic(l), + DataFile::ObjectLoader(l), widgets(w) { add("bind", &Loader::bind); @@ -21,17 +15,14 @@ Logic::Loader::Loader(Logic &l, const map &w): void Logic::Loader::bind(const string &wdg, const string &data) { - map::const_iterator i = widgets.find(wdg); - if(i==widgets.end()) - throw KeyError("Unknown widget", wdg); + WidgetBinding act; + act.wdg = get_item(widgets, wdg); string::size_type colon = data.find(':'); - WidgetBinding act; - act.wdg = i->second; act.type = data.substr(0, colon); if(colon!=string::npos) act.data = data.substr(colon+1); - logic.bindings.push_back(act); + obj.bindings.push_back(act); } } // namespace GLtk