lincity-ng-2.0/0000755000175000017500000000000011137144710013621 5ustar wolfgangwolfganglincity-ng-2.0/Jamfile0000644000175000017500000000103511137144627015121 0ustar wolfgangwolfgangSubDir TOP ; TRANSLATABLE_SOURCES = ; # Decend into subdirs SubInclude TOP src ; SubInclude TOP data ; SubInclude TOP doc ; UseAutoconf ; # run xgettext on sources if $(XGETTEXT) != "" { DoXGetText data/locale/messages.pot : $(TRANSLATABLE_SOURCES) ; } # add some additional files to package Package README RELNOTES TODO COPYING COPYING-fonts.txt COPYING-data.txt CREDITS ; InstallDoc README RELNOTES TODO COPYING COPYING-fonts.txt COPYING-data.txt CREDITS ; InstallDesktop lincity-ng.desktop ; InstallPixmap data/lincity-ng.png ; lincity-ng-2.0/src/0000755000175000017500000000000011137144634014415 5ustar wolfgangwolfganglincity-ng-2.0/src/Jamfile0000644000175000017500000000030711137144627015711 0ustar wolfgangwolfgangSubDir TOP src ; SubInclude TOP src gui ; SubInclude TOP src PhysfsStream ; SubInclude TOP src tinygettext ; SubInclude TOP src lincity ; SubInclude TOP src lincity-ng ; SubInclude TOP src tools ; lincity-ng-2.0/src/gui/0000755000175000017500000000000011137144631015176 5ustar wolfgangwolfganglincity-ng-2.0/src/gui/Jamfile0000644000175000017500000000054111137144627016475 0ustar wolfgangwolfgangSubDir TOP src gui ; SOURCES = [ Wildcard *.cpp *.hpp ] [ Wildcard callback : *.cpp *.hpp ] [ Wildcard PainterGL : *.cpp *.hpp ] [ Wildcard PainterSDL : *.cpp *.hpp ] ; Library lincity_gui : $(SOURCES) : noinstall ; ExternalLibs lincity_gui : LIBXML SDL SDLIMAGE PHYSFS GL ICONV ; TRANSLATABLE_SOURCES += [ SearchSource $(SOURCES) ] ; lincity-ng-2.0/src/gui/Filter.cpp0000644000175000017500000000375011137144627017141 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file Filter.hpp */ #include #include "Filter.hpp" #include #include void color2Grey(SDL_Surface* surface) { if(surface->format->BitsPerPixel != 32) throw std::runtime_error("Can only convert 32 bit images to greyscale"); SDL_LockSurface(surface); uint8_t* p = (uint8_t*) surface->pixels; for(int y = 0; y < surface->h; ++y) { uint32_t* pixel = (uint32_t*) p; for(int x = 0; x < surface->w; ++x) { float red = (*pixel & surface->format->Rmask) >> surface->format->Rshift; float green = (*pixel & surface->format->Gmask) >> surface->format->Gshift; float blue = (*pixel & surface->format->Bmask) >> surface->format->Bshift; float greyvalf = 0.3 * red + 0.59 * green + 0.11 * blue; uint32_t greyval = (uint32_t) greyvalf; *pixel = (*pixel & surface->format->Amask) | (greyval << surface->format->Rshift) | (greyval << surface->format->Gshift) | (greyval << surface->format->Bshift); pixel++; } p += surface->pitch; } SDL_UnlockSurface(surface); } lincity-ng-2.0/src/gui/TextureManager.hpp0000644000175000017500000000522511137144627020653 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file TextureManager.hpp */ #ifndef __TEXTUREMANAGER_HPP__ #define __TEXTUREMANAGER_HPP__ #include #include #include #include "Texture.hpp" /** * @class TextureManager * @brief This handles the creation and sharing of textures. * * A texture is a wrapper around a pixmaps. Using a wrapper allows to make use * of hardware acceleration in some scenarios (for example in opengl where the * pixmaps can get uploaded into the gfx cards memory). */ class TextureManager { public: virtual ~TextureManager(); enum Filter { NO_FILTER = 0, /// Turn image into a greyscale image FILTER_GREY }; /** * Load an image file from disk and create a texture. The texture will be * cached so don't delete it. */ Texture* load(const std::string& filename, Filter filter = NO_FILTER); /** * Create a texture from an SDL_Surface. This function takes ownership of * the SDL_Surface and will free it. */ virtual Texture* create(SDL_Surface* surface) = 0; private: struct TextureInfo { std::string filename; Filter filter; TextureInfo() : filter(NO_FILTER) { } TextureInfo(const TextureInfo& other) : filename(other.filename), filter(other.filter) { } bool operator < (const TextureInfo& other) const { if(filename < other.filename) return true; if(filename > other.filename) return false; if((int) filter < (int) other.filter) return true; return false; } bool operator== (const TextureInfo& other) const { return filename == other.filename && filter == other.filter; } }; typedef std::map Textures; Textures textures; }; extern TextureManager* texture_manager; #endif lincity-ng-2.0/src/gui/ScrollView.hpp0000644000175000017500000000254011137144627020006 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file ScrollView.hpp */ #ifndef __SCROLLVIEW_HPP__ #define __SCROLLVIEW_HPP__ #include "Component.hpp" class XmlReader; class ScrollBar; /** * @class ScrollView */ class ScrollView : public Component { public: ScrollView(); virtual ~ScrollView(); void parse(XmlReader& reader); void resize(float width, float height); void event(const Event& event); void replaceContents(Component* component); private: void scrollBarChanged(ScrollBar* bar, float newvalue); Child& contents() { return childs[0]; } Child& scrollBar() { return childs[1]; } }; #endif lincity-ng-2.0/src/gui/FontManager.cpp0000644000175000017500000000454011137144627020113 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file FontManager.cpp */ #include #include "FontManager.hpp" #include #include #include #include "tinygettext/gettext.hpp" #include "PhysfsStream/PhysfsSDL.hpp" FontManager* fontManager = 0; FontManager::FontManager() { } FontManager::~FontManager() { for(Fonts::iterator i = fonts.begin(); i != fonts.end(); ++i) TTF_CloseFont(i->second); } TTF_Font* FontManager::getFont(Style style) { FontInfo info; info.name = style.font_family; info.fontsize = (int) style.font_size; info.fontstyle = 0; if(style.italic) info.fontstyle |= TTF_STYLE_ITALIC; if(style.bold) info.fontstyle |= TTF_STYLE_BOLD; Fonts::iterator i = fonts.find(info); if(i != fonts.end()) return i->second; TTF_Font* font = 0; // If there a special font for the current language use it. std::string fontfile = "fonts/" + info.name + "-" + dictionaryManager->get_language() + ".ttf"; try{ font = TTF_OpenFontRW(getPhysfsSDLRWops(fontfile), 1, info.fontsize); } catch(std::exception& ){ // No special font found? Use default font then. fontfile = "fonts/" + info.name + ".ttf"; font = TTF_OpenFontRW(getPhysfsSDLRWops(fontfile), 1, info.fontsize); } if(!font) { std::stringstream msg; msg << "Error opening font '" << fontfile << "': " << SDL_GetError(); throw std::runtime_error(msg.str()); } if(info.fontstyle != 0) TTF_SetFontStyle(font, info.fontstyle); fonts.insert(std::make_pair(info, font)); return font; } lincity-ng-2.0/src/gui/Style.cpp0000644000175000017500000001454211137144627017015 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file Style.cpp */ #include #include "Style.hpp" #include "XmlReader.hpp" #include #include #include std::map styleRegistry; Style::Style() : italic(false), bold(false), font_size(20), alignment(ALIGN_LEFT), margin_left(0), margin_right(0), margin_top(0), margin_bottom(0), width(-1), height(-1), min_width(-1), min_height(-1) { font_family = "sans"; background.a = 0; } Style::~Style() { } void Style::parseAttributes(XmlReader& reader) { XmlReader::AttributeIterator iter(reader); while(iter.next()) { const char* attribute = (const char*) iter.getName(); const char* value = (const char*) iter.getValue(); if(!parseAttribute(attribute, value)) { std::cerr << "Skipping unknown style attribute '" << attribute << "'.\n"; } } } bool Style::parseAttribute(const char* attribute, const char* value) { if(strcmp(attribute, "style") == 0) { std::map::iterator i = styleRegistry.find(value); if(i == styleRegistry.end()) { std::stringstream msg; msg << "No style with name '" << value << "' defined."; throw std::runtime_error(msg.str()); } *this = i->second; } else if(strcmp(attribute, "font-size") == 0) { if(sscanf(value, "%f", &font_size) != 1) { std::cerr << "Warning problem parsing size '" << value << "'\n"; } } else if(strcmp(attribute, "font-family") == 0) { font_family = value; } else if(strcmp(attribute, "font-style") == 0) { if(strcmp(value, "normal") == 0) { italic = false; } else if(strcmp(value, "italic") == 0) { italic = true; } else { std::cerr << "Invalid value for font-style " << "(only 'normal' and 'italic' allowed)\n"; } } else if(strcmp(attribute, "font-weight") == 0) { if(strcmp(value, "normal") == 0) { bold = false; } else if(strcmp(value, "bold") == 0) { bold = true; } else { std::cerr << "Invalid value for font-weight " << "(only 'normal' and 'bold' allowed)\n"; } } else if(strcmp(attribute, "halign") == 0) { if(strcmp(value, "left") == 0) { alignment = Style::ALIGN_LEFT; } else if(strcmp(value, "center") == 0) { alignment = Style::ALIGN_CENTER; } else if(strcmp(value, "right") == 0) { alignment = Style::ALIGN_RIGHT; } else { std::cerr << "Invalid value for halign attribute " << "(only 'left', 'center' and 'right' allowed)\n"; } } else if(strcmp(attribute, "width") == 0) { if(sscanf(value, "%f", &width) != 1) { std::cerr << "Couldn't parse value for width: '" << value << "'\n"; } } else if(strcmp(attribute, "height") == 0) { if(sscanf(value, "%f", &height) != 1) { std::cerr << "Couldn't parse value for height: '" << value << "'\n"; } } else if(strcmp(attribute, "min-width") == 0) { if(sscanf(value, "%f", &min_width) != 1) { std::cerr << "Couldn't parse value for min-width: '" << value << "'\n"; } } else if(strcmp(attribute, "min-height") == 0) { if(sscanf(value, "%f", &min_height) != 1) { std::cerr << "Couldn't parse value for min-height: '" << value << "'\n"; } } else if(strcmp(attribute, "margin-left") == 0) { if(sscanf(value, "%f", &margin_left) != 1) { std::cerr << "Couldn't parse value for margin-left: '" << value << "'\n"; } } else if(strcmp(attribute, "margin-right") == 0) { if(sscanf(value, "%f", &margin_right) != 1) { std::cerr << "Couldn't parse value for margin-right: '" << value << "'\n"; } } else if(strcmp(attribute, "margin-top") == 0) { if(sscanf(value, "%f", &margin_top) != 1) { std::cerr << "Couldn't parse value for margin-top: '" << value << "'\n"; } } else if(strcmp(attribute, "margin-bottom") == 0) { if(sscanf(value, "%f", &margin_bottom) != 1) { std::cerr << "Couldn't parse value for argin-bottom: '" << value << "'\n"; } } else if(strcmp(attribute, "color") == 0) { text_color.parse(value); } else if(strcmp(attribute, "background") == 0) { background.parse(value); } else if(strcmp(attribute, "href") == 0) { href = value; } else if(strncmp(attribute, "xmlns", 5) == 0) { // simply ignore xmlns attributes return true; } else { return false; } return true; } void parseStyleDef(XmlReader& reader) { Style style; std::string name; XmlReader::AttributeIterator iter(reader); while(iter.next()) { const char* attribute = (const char*) iter.getName(); const char* value = (const char*) iter.getValue(); if(style.parseAttribute(attribute, value)) { continue; } else if(strcmp(attribute, "name") == 0) { name = value; } else { std::cerr << "Unknown attribute '" << attribute << "' in style definition.\n"; } } reader.nextNode(); if(name == "") throw std::runtime_error("Missing name in style definition"); styleRegistry.insert(std::make_pair(name, style)); } lincity-ng-2.0/src/gui/ComponentLoader.cpp0000644000175000017500000000604711137144627021007 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file ComponentLoader.cpp */ #include #include "ComponentLoader.hpp" #include "ComponentFactory.hpp" #include "XmlReader.hpp" #include "Desktop.hpp" #include "Style.hpp" #include #include #include #include void initFactories(); Component* createComponent(const std::string& type, XmlReader& reader) { initFactories(); if(component_factories == 0) throw std::runtime_error("No component factories registered"); ComponentFactories::iterator i = component_factories->find(type); if(i == component_factories->end()) { std::stringstream msg; msg << "Couldn't find a component factory for '" << type << "'"; throw std::runtime_error(msg.str()); } try { return i->second->createComponent(reader); } catch(std::exception& e) { std::stringstream msg; msg << "Error while parsing component '" << type << "': " << e.what(); throw std::runtime_error(msg.str()); } catch(...) { throw; } } Component* loadGUIFile(const std::string& filename) { XmlReader reader(filename); std::string componentName = (const char*) reader.getName(); if(componentName == "gui") { std::auto_ptr desktop (new Desktop()); desktop->parse(reader); return desktop.release(); } std::auto_ptr component (createComponent(componentName, reader)); return component.release(); } Component* parseEmbeddedComponent(XmlReader& reader) { Component* component = 0; try { int depth = reader.getDepth(); while(reader.read() && reader.getDepth() > depth) { if(reader.getNodeType() == XML_READER_TYPE_ELEMENT) { const char* name = (const char*) reader.getName(); if(strcmp(name, "DefineStyle") == 0) { parseStyleDef(reader); } else if(component == 0) { component = createComponent(name, reader); } else { std::cerr << "Multiple components specified." << " Skipping '" << name << "'.\n"; continue; } } } } catch(...) { delete component; throw; } return component; } lincity-ng-2.0/src/gui/Component.cpp0000644000175000017500000001153111137144627017652 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file Component.cpp * @author Matthias Braun */ #include #include #include #include "Component.hpp" #include "Painter.hpp" #include "Event.hpp" Component::Component() : parent(0), flags(0), width(0), height(0) { } Component::~Component() { } bool Component::parseAttribute(const char* attribute, const char* value) { if(strcmp(attribute, "name") == 0) { name = value; return true; } else if(strncmp(attribute, "xmlns", 5) == 0) { // can be ignored for now return true; } return false; } void Component::drawChild(Child& child, Painter& painter) { assert(child.getComponent() != 0); if(child.useClipRect) { painter.setClipRectangle(child.clipRect); } if(child.position != Vector2(0, 0)) { painter.pushTransform(); painter.translate(child.position); } child.component->draw(painter); if(child.position != Vector2(0, 0)) { painter.popTransform(); } if(child.useClipRect) { painter.clearClipRectangle(); } } void Component::draw(Painter& painter) { for(Childs::iterator i = childs.begin(); i != childs.end(); ++i) { Child& child = *i; if(!child.enabled) continue; drawChild(child, painter); } } bool Component::eventChild(Child& child, const Event& event, bool visible) { assert(child.getComponent() != 0); Event ev = event; if(event.type == Event::MOUSEMOTION || event.type == Event::MOUSEBUTTONDOWN || event.type == Event::MOUSEBUTTONUP) { ev.mousepos -= child.position; if(visible && child.component->opaque(ev.mousepos)) ev.inside = true; else ev.inside = false; } child.component->event(ev); return ev.inside; } void Component::event(const Event& event) { bool visible = event.inside; for(Childs::reverse_iterator i = childs.rbegin(); i != childs.rend(); ++i) { Child& child = *i; if(!child.enabled) continue; if(eventChild(child, event, visible)) visible = false; } } void Component::reLayout() { if(getFlags() & FLAG_RESIZABLE) { resize(getWidth(), getHeight()); } } Component* Component::findComponent(const std::string& name) { if(getName() == name) return this; for(Childs::const_iterator i = childs.begin(); i != childs.end(); ++i) { const Child& child = *i; if(!child.getComponent()) continue; Component* component = child.component->findComponent(name); if(component) return component; } return 0; } Vector2 Component::relative2Global(const Vector2& pos) { if(!parent) return pos; Child& me = parent->findChild(this); return parent->relative2Global(me.getPos() + pos); } Child& Component::addChild(Component* component) { assert(component->parent == 0); childs.push_back(Child(component)); component->parent = this; component->setDirty(); return childs.back(); } void Component::resetChild(Child& child, Component* component) { assert(child.component != component); delete child.component; child.component = component; if(component != 0) { component->parent = this; component->setDirty(); child.enabled = true; } } void Component::resize(float , float ) { } void Component::setDirty(const Rect2D& rect) { if(parent) parent->setChildDirty(this, rect); } Child& Component::findChild(Component* component) { for(Childs::iterator i = childs.begin(); i != childs.end(); ++i) { Child& child = *i; if(child.getComponent() == component) return child; } throw std::runtime_error("Child not found"); } void Component::setChildDirty(Component* childComponent, const Rect2D& area) { for(Childs::const_iterator i = childs.begin(); i != childs.end(); ++i) { const Child& child = *i; if(child.getComponent() != childComponent) continue; Rect2D rect = area; rect.move(child.position); setDirty(rect); return; } assert(false); } lincity-ng-2.0/src/gui/Texture.hpp0000644000175000017500000000216011137144627017353 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file Texture.hpp */ #ifndef __TEXTURE_HPP__ #define __TEXTURE_HPP__ #include /** * @class Texture * @brief Wrapper around a pixmap. * * Texture have to be created by the TextureManager class. */ class Texture { public: virtual ~Texture() { } virtual float getWidth() const = 0; virtual float getHeight() const = 0; }; #endif lincity-ng-2.0/src/gui/Paragraph.cpp0000644000175000017500000004143311137144627017621 0ustar wolfgangwolfgang/* Copyright (C) 2005 Matthias Braun This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @author Matthias Braun * @file Paragraph.cpp */ #include #include "Paragraph.hpp" #include #include #include #include #include #include #include #include "Event.hpp" #include "FontManager.hpp" #include "TextureManager.hpp" #include "Painter.hpp" #include "XmlReader.hpp" #include "ComponentFactory.hpp" #include "Document.hpp" #include "tinygettext/TinyGetText.hpp" Paragraph::Paragraph() : texture(0) { setFlags(FLAG_RESIZABLE); } Paragraph::~Paragraph() { for(TextSpans::iterator i = textspans.begin(); i != textspans.end(); ++i) delete *i; delete texture; } void Paragraph::parse(XmlReader& reader) { parse(reader, style); } void Paragraph::parseList(XmlReader& reader, const Style& ) { // query for "list" style std::map::iterator i = styleRegistry.find("list"); if(i == styleRegistry.end()) { throw std::runtime_error("
  • element used but no" " list style defined"); } // add a bullet char at the front of the text TextSpan* currentspan = new TextSpan(); currentspan->style = i->second; currentspan->text = " \342\200\242 "; textspans.push_back(currentspan); parse(reader, i->second); } void Paragraph::parse(XmlReader& reader, const Style& parentstyle) { bool translatable = false; style = parentstyle; XmlReader::AttributeIterator iter(reader); while(iter.next()) { const char* attribute = (const char*) iter.getName(); const char* value = (const char*) iter.getValue(); if(parseAttribute(attribute, value)) { continue; } else if(style.parseAttribute(attribute, value)) { continue; } else if(strcmp(attribute, "translatable") == 0) { translatable = true; } else { std::cerr << "Skipping unknown attribut '" << attribute << "'.\n"; } } std::vector