Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVectorTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVectorTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVectorTagHandler.cpp (revision 899826) @@ -1,68 +1,66 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlVectorTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneLayer.h" #include "GeoSceneVector.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Vector) GeoNode* DgmlVectorTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Vector)); QString name = parser.attribute(dgmlAttr_name).trimmed(); QString feature = parser.attribute(dgmlAttr_feature).trimmed(); GeoSceneVector *vector = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); // Check parent type and make sure that the dataSet type // matches the backend of the parent layer if ( parentItem.represents(dgmlTag_Layer) && parentItem.nodeAs()->backend() == dgmlValue_vector ) { vector = new GeoSceneVector( name ); vector->setFeature( feature ); parentItem.nodeAs()->addDataset( vector ); } return vector; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlItemTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlItemTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlItemTagHandler.h (revision 899826) @@ -1,39 +1,42 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlItemTagHandler_h #define DgmlItemTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlItemTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlItemTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlInstallMapTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlInstallMapTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlInstallMapTagHandler.cpp (revision 899826) @@ -1,48 +1,48 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlInstallMapTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneTexture.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(InstallMap) GeoNode* DgmlInstallMapTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_InstallMap)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Texture)) parentItem.nodeAs()->setInstallMap( parser.readElementText().trimmed() ); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceFileTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceFileTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceFileTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlSourceFileTagHandler_h #define DgmlSourceFileTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlSourceFileTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlSourceFileTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextureTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextureTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextureTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlTextureTagHandler_h #define DgmlTextureTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlTextureTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlTextureTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMinimumTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMinimumTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMinimumTagHandler.cpp (revision 899826) @@ -1,58 +1,58 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlMinimumTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneZoom.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Minimum) GeoNode* DgmlMinimumTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Minimum)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Zoom)) { QString parsedText = parser.readElementText(); bool ok = false; int parsedInt = parsedText.toInt(&ok); if (ok) parentItem.nodeAs()->setMinimum(parsedInt); else parser.raiseWarning(QObject::tr("Could not convert child text content to integer. Was: '%1'").arg(parsedText)); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAuxillaryDictionary.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAuxillaryDictionary.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAuxillaryDictionary.h (revision 899826) @@ -1,39 +1,39 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2007 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlAuxillaryDictionary_h #define DgmlAuxillaryDictionary_h // Lists all known DGML 2.0 auxillary strings namespace Marble { -namespace GeoSceneAuxillaryDictionary +namespace dgml { extern const char* dgmlValue_true; extern const char* dgmlValue_on; extern const char* dgmlValue_texture; extern const char* dgmlValue_vector; } } #endif // DgmlAuxillaryDictionary_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLayerTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLayerTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLayerTagHandler.cpp (revision 899826) @@ -1,66 +1,64 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlLayerTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneMap.h" #include "GeoSceneLayer.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Layer) GeoNode* DgmlLayerTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Layer)); QString name = parser.attribute(dgmlAttr_name).trimmed(); QString backend = parser.attribute(dgmlAttr_backend).toLower().trimmed(); QString role = parser.attribute(dgmlAttr_role).toLower().trimmed(); GeoSceneLayer *layer = 0; // Checking for parent layer GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Map)) { layer = new GeoSceneLayer( name ); layer->setBackend( backend ); layer->setRole( role ); parentItem.nodeAs()->addLayer( layer ); } return layer; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMaximumTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMaximumTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMaximumTagHandler.cpp (revision 899826) @@ -1,57 +1,57 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlMaximumTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneZoom.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Maximum) GeoNode* DgmlMaximumTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Maximum)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Zoom)) { QString parsedText = parser.readElementText(); bool ok = false; int parsedInt = parsedText.toInt(&ok); if (ok) parentItem.nodeAs()->setMaximum(parsedInt); else parser.raiseWarning(QObject::tr("Could not convert child text content to integer. Was: '%1'").arg(parsedText)); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMapTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMapTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMapTagHandler.cpp (revision 899826) @@ -1,64 +1,63 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlMapTagHandler.h" #include #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneDocument.h" #include "GeoSceneMap.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Map) GeoNode* DgmlMapTagHandler::parse(GeoParser& parser) const { Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Map)); QColor labelColor = parser.attribute(dgmlAttr_labelColor).trimmed(); if ( !labelColor.isValid() ) labelColor = Qt::black; GeoSceneMap* map = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Document)) { map = parentItem.nodeAs()->map(); map->setBackgroundColor( QColor( parser.attribute( dgmlAttr_bgcolor ).trimmed() ) ); map->setLabelColor( labelColor ); } return map; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDocumentTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDocumentTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDocumentTagHandler.cpp (revision 899826) @@ -1,43 +1,43 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlDocumentTagHandler.h" #include #include "DgmlElementDictionary.h" #include "GeoSceneDocument.h" #include "GeoSceneParser.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Document) GeoNode* DgmlDocumentTagHandler::parse(GeoParser& parser) const { Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Document)); return geoSceneDoc(parser); } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPenTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPenTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPenTagHandler.cpp (revision 899826) @@ -1,80 +1,79 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlPenTagHandler.h" #include #include #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneVector.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Pen) GeoNode* DgmlPenTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Pen)); QString color = parser.attribute(dgmlAttr_color).trimmed(); QString style = parser.attribute(dgmlAttr_style).toLower().trimmed(); qreal width = parser.attribute(dgmlAttr_width).toDouble(); GeoSceneVector *vector = 0; QPen pen; if ( !color.isEmpty() && QColor( color ).isValid() ) { pen.setColor( QColor( color ) ); } if ( !style.isEmpty() ) { if ( style == "nopen" ) pen.setStyle( Qt::NoPen ); if ( style == "solidline" ) pen.setStyle( Qt::SolidLine ); if ( style == "dashline" ) pen.setStyle( Qt::DashLine ); if ( style == "dotline" ) pen.setStyle( Qt::DotLine ); if ( style == "dashdotline" ) pen.setStyle( Qt::DashDotLine ); if ( style == "dashdotdotline" ) pen.setStyle( Qt::DashDotDotLine ); } if ( width != 0.0 ) { pen.setWidthF( width ); } // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Vector)) { vector = parentItem.nodeAs(); vector->setPen( pen ); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDescriptionTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDescriptionTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDescriptionTagHandler.cpp (revision 899826) @@ -1,48 +1,48 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlDescriptionTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneHead.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Description) GeoNode* DgmlDescriptionTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Description)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Head)) parentItem.nodeAs()->setDescription( parser.readElementText().trimmed() ); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlNameTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlNameTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlNameTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlNameTagHandler_h #define DgmlNameTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlNameTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlNameTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPropertyTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPropertyTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPropertyTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlPropertyTagHandler_h #define DgmlPropertyTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlPropertyTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlPropertyTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPaletteTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPaletteTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPaletteTagHandler.cpp (revision 899826) @@ -1,64 +1,62 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn Copyright (C) 2008 Henry de Valence This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlPaletteTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneFilter.h" #include "GeoScenePalette.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Palette) GeoNode* DgmlPaletteTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Palette)); QString type = parser.attribute(dgmlAttr_type).toLower().trimmed(); QString file = parser.readElementText().trimmed(); GeoScenePalette *palette = 0; // Checking for parent palette GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Filter)) { palette = new GeoScenePalette( type, file ); parentItem.nodeAs()->addPalette( palette ); } return palette; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlGroupTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlGroupTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlGroupTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlGroupTagHandler_h #define DgmlGroupTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlGroupTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlGroupTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDiscreteTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDiscreteTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDiscreteTagHandler.cpp (revision 899826) @@ -1,52 +1,51 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlDiscreteTagHandler.h" #include "DgmlElementDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneZoom.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Discrete) GeoNode* DgmlDiscreteTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Discrete)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Zoom)) { QString parsedText = parser.readElementText().toLower().trimmed(); parentItem.nodeAs()->setDiscrete(parsedText == dgmlValue_true || parsedText == dgmlValue_on); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlThemeTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlThemeTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlThemeTagHandler.cpp (revision 899826) @@ -1,48 +1,48 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlThemeTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneHead.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Theme) GeoNode* DgmlThemeTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Theme)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Head)) parentItem.nodeAs()->setTheme( parser.readElementText().trimmed() ); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceDirTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceDirTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceDirTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlSourceDirTagHandler_h #define DgmlSourceDirTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlSourceDirTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlSourceDirTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSectionTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSectionTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSectionTagHandler.cpp (revision 899826) @@ -1,68 +1,66 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlSectionTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneLegend.h" #include "GeoSceneSection.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Section) GeoNode* DgmlSectionTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Section)); QString name = parser.attribute(dgmlAttr_name); QString checkable = parser.attribute(dgmlAttr_checkable).toLower().trimmed(); QString connectTo = parser.attribute(dgmlAttr_connect).trimmed(); int spacing = parser.attribute(dgmlAttr_spacing).toInt(); GeoSceneSection* section = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Legend)) { section = new GeoSceneSection( name ); section->setCheckable( checkable == dgmlValue_true || checkable == dgmlValue_on ); section->setConnectTo( connectTo ); section->setSpacing( spacing ); parentItem.nodeAs()->addSection( section ); } return section; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVectorTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVectorTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVectorTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlVectorTagHandler_h #define DgmlVectorTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlVectorTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlVectorTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlInstallMapTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlInstallMapTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlInstallMapTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlInstallMapTagHandler_h #define DgmlInstallMapTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlInstallMapTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlInstallMapTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLayerTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLayerTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLayerTagHandler.h (revision 899826) @@ -1,39 +1,42 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlLayerTagHandler_h #define DgmlLayerTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlLayerTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlLayerTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDocumentTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDocumentTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDocumentTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlDocumentTagHandler_h #define DgmlDocumentTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlDocumentTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlDocumentTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextTagHandler.cpp (revision 899826) @@ -1,48 +1,48 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlTextTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneItem.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Text) GeoNode* DgmlTextTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Text)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Item)) parentItem.nodeAs()->setText( parser.readElementText().trimmed() ); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPenTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPenTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPenTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlPenTagHandler_h #define DgmlPenTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlPenTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlPenTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDownloadUrlTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDownloadUrlTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDownloadUrlTagHandler.cpp (revision 899826) @@ -1,88 +1,87 @@ /* Copyright (C) 2008 Jens-Michael Hoffmann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Own #include "DgmlDownloadUrlTagHandler.h" // Qt #include // Marble #include "DgmlAttributeDictionary.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneTexture.h" namespace Marble { - -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(DownloadUrl) GeoNode* DgmlDownloadUrlTagHandler::parse( GeoParser& parser ) const { // Check whether the tag is valid Q_ASSERT( parser.isStartElement() && parser.isValidElement( dgmlTag_DownloadUrl )); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if ( !parentItem.represents( dgmlTag_Texture )) return 0; QUrl url; // Attribute protocol, optional? QString protocolStr = parser.attribute( dgmlAttr_protocol ).trimmed(); if ( !protocolStr.isEmpty() ) url.setScheme( protocolStr ); // Attribute user, optional const QString userStr = parser.attribute( dgmlAttr_user ).trimmed(); if ( !userStr.isEmpty() ) url.setUserName( userStr ); // Attribute password, optional const QString passwordStr = parser.attribute( dgmlAttr_password ).trimmed(); if ( !passwordStr.isEmpty() ) url.setPassword( passwordStr ); // Attribute host, mandatory const QString hostStr = parser.attribute( dgmlAttr_host ).trimmed(); if ( !hostStr.isEmpty() ) url.setHost( hostStr ); // Attribute port, optional const QString portStr = parser.attribute( dgmlAttr_port ).trimmed(); if ( !portStr.isEmpty() ) url.setPort( portStr.toInt() ); // Attribute path, mandatory const QString pathStr = parser.attribute( dgmlAttr_path ).trimmed(); if ( !pathStr.isEmpty() ) url.setPath( pathStr ); parentItem.nodeAs()->addDownloadUrl( url ); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlElementDictionary.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlElementDictionary.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlElementDictionary.h (revision 899826) @@ -1,86 +1,86 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlElementDictionary_h #define DgmlElementDictionary_h #include namespace Marble { // Lists all known DGML 2.0 tags // http://edu.kde.org/marble/apis/dgml/documentation/dgmltags.html) -namespace GeoSceneElementDictionary +namespace dgml { extern const char* dgmlTag_nameSpace20; extern const char* dgmlTag_Available; extern const char* dgmlTag_Brush; extern const char* dgmlTag_Coastline; extern const char* dgmlTag_Color; extern const char* dgmlTag_CustomPlugin; extern const char* dgmlTag_Dem; extern const char* dgmlTag_Description; extern const char* dgmlTag_Discrete; extern const char* dgmlTag_Dgml; extern const char* dgmlTag_Document; extern const char* dgmlTag_DownloadUrl; extern const char* dgmlTag_Filter; extern const char* dgmlTag_Geodata; extern const char* dgmlTag_Group; extern const char* dgmlTag_Head; extern const char* dgmlTag_Heading; extern const char* dgmlTag_Icon; extern const char* dgmlTag_InstallMap; extern const char* dgmlTag_Item; extern const char* dgmlTag_Layer; extern const char* dgmlTag_Legend; extern const char* dgmlTag_Map; extern const char* dgmlTag_Maximum; extern const char* dgmlTag_Minimum; extern const char* dgmlTag_Name; extern const char* dgmlTag_Palette; extern const char* dgmlTag_Pen; extern const char* dgmlTag_Pick; extern const char* dgmlTag_Projection; extern const char* dgmlTag_Property; extern const char* dgmlTag_Section; extern const char* dgmlTag_Settings; extern const char* dgmlTag_SourceDir; extern const char* dgmlTag_SourceFile; extern const char* dgmlTag_StorageLayout; extern const char* dgmlTag_Target; extern const char* dgmlTag_Text; extern const char* dgmlTag_Texture; extern const char* dgmlTag_Theme; extern const char* dgmlTag_Value; extern const char* dgmlTag_Vector; extern const char* dgmlTag_Visible; extern const char* dgmlTag_Zoom; } // Helper macro #define DGML_DEFINE_TAG_HANDLER(Name) GEODATA_DEFINE_TAG_HANDLER(dgml, Dgml, Name, dgmlTag_nameSpace20) } #endif // DgmlElementDictionary_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlFilterTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlFilterTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlFilterTagHandler.h (revision 899826) @@ -1,40 +1,43 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn Copyright (C) 2008 Henry de Valence This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlFilterTagHandler_h #define DgmlFilterTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlFilterTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlFilterTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLegendTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLegendTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLegendTagHandler.cpp (revision 899826) @@ -1,51 +1,51 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlLegendTagHandler.h" #include #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneDocument.h" #include "GeoSceneLegend.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Legend) GeoNode* DgmlLegendTagHandler::parse(GeoParser& parser) const { Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Legend)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Document)) return parentItem.nodeAs()->legend(); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceDirTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceDirTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceDirTagHandler.cpp (revision 899826) @@ -1,57 +1,56 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlSourceDirTagHandler.h" #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneTexture.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(SourceDir) GeoNode* DgmlSourceDirTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_SourceDir)); QString format = parser.attribute(dgmlAttr_format).trimmed(); GeoSceneTexture *texture = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Texture)) { texture = parentItem.nodeAs(); texture->setSourceDir( parser.readElementText().trimmed() ); texture->setFileFormat(format); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSettingsTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSettingsTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSettingsTagHandler.cpp (revision 899826) @@ -1,50 +1,50 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlSettingsTagHandler.h" #include #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneDocument.h" #include "GeoSceneSettings.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Settings) GeoNode* DgmlSettingsTagHandler::parse(GeoParser& parser) const { Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Settings)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Document)) return parentItem.nodeAs()->settings(); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.cpp (revision 899826) @@ -1,85 +1,84 @@ /* Copyright (C) 2008 Jens-Michael Hoffmann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlStorageLayoutTagHandler.h" #include #include "DgmlAttributeDictionary.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneTexture.h" namespace Marble { - -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(StorageLayout) GeoNode* DgmlStorageLayoutTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_StorageLayout)); // Attribute levelZeroColumns, default to value of the oldest tile themes int levelZeroColumns = 2; const QString levelZeroColumnsStr = parser.attribute(dgmlAttr_levelZeroColumns).trimmed(); if ( !levelZeroColumnsStr.isEmpty() ) { levelZeroColumns = levelZeroColumnsStr.toInt(); } // Attribute levelZeroRows, default to value of the oldest tile themes int levelZeroRows = 1; const QString levelZeroRowsStr = parser.attribute(dgmlAttr_levelZeroRows).trimmed(); if ( !levelZeroRowsStr.isEmpty() ) { levelZeroRows = levelZeroRowsStr.toInt(); } // Attribute mode GeoSceneTexture::StorageLayoutMode mode = GeoSceneTexture::Marble; const QString modeStr = parser.attribute(dgmlAttr_mode).trimmed(); if ( modeStr == "OpenStreetMap" ) mode = GeoSceneTexture::OpenStreetMap; else if ( modeStr == "Custom" ) mode = GeoSceneTexture::Custom; // custom Layout? QString customLayout; if ( mode == GeoSceneTexture::Custom ) { customLayout = parser.readElementText().trimmed(); } // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Texture)) { parentItem.nodeAs()->setLevelZeroColumns( levelZeroColumns ); parentItem.nodeAs()->setLevelZeroRows( levelZeroRows ); parentItem.nodeAs()->setStorageLayoutMode( mode ); if ( mode == GeoSceneTexture::Custom ) parentItem.nodeAs()->setCustomStorageLayout( customLayout ); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVisibleTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVisibleTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVisibleTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlVisibleTagHandler_h #define DgmlVisibleTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlVisibleTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlVisibleTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPaletteTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPaletteTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPaletteTagHandler.h (revision 899826) @@ -1,40 +1,43 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn Copyright (C) 2008 Henry de Valence This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlPaletteTagHandler_h #define DgmlPaletteTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlPaletteTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlPaletteTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAttributeDictionary.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAttributeDictionary.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAttributeDictionary.h (revision 899826) @@ -1,65 +1,65 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2007 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlAttributeDictionary_h #define DgmlAttributeDictionary_h namespace Marble { -namespace GeoSceneAttributeDictionary +namespace dgml { // Lists all known DGML 2.0 attributes // http://edu.kde.org/marble/apis/dgml/documentation/dgmltags.html) extern const char* dgmlAttr_nameSpace20; extern const char* dgmlAttr_backend; extern const char* dgmlAttr_bgcolor; extern const char* dgmlAttr_color; extern const char* dgmlAttr_checkable; extern const char* dgmlAttr_connect; extern const char* dgmlAttr_expire; extern const char* dgmlAttr_feature; extern const char* dgmlAttr_format; extern const char* dgmlAttr_host; extern const char* dgmlAttr_labelColor; extern const char* dgmlAttr_levelZeroColumns; extern const char* dgmlAttr_levelZeroRows; extern const char* dgmlAttr_mode; extern const char* dgmlAttr_name; extern const char* dgmlAttr_password; extern const char* dgmlAttr_path; extern const char* dgmlAttr_pixmap; extern const char* dgmlAttr_port; extern const char* dgmlAttr_protocol; extern const char* dgmlAttr_role; extern const char* dgmlAttr_spacing; extern const char* dgmlAttr_style; extern const char* dgmlAttr_text; extern const char* dgmlAttr_type; extern const char* dgmlAttr_user; extern const char* dgmlAttr_width; } } #endif // DgmlAttributeDictionary_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadingTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadingTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadingTagHandler.h (revision 899826) @@ -1,39 +1,42 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlHeadingTagHandler_h #define DgmlHeadingTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlHeadingTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlHeadingTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlHeadTagHandler_h #define DgmlHeadTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlHeadTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlHeadTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDiscreteTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDiscreteTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDiscreteTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlDiscreteTagHandler_h #define DgmlDiscreteTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlDiscreteTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlDiscreteTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlThemeTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlThemeTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlThemeTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlThemeTagHandler_h #define DgmlThemeTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlThemeTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlThemeTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSectionTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSectionTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSectionTagHandler.h (revision 899826) @@ -1,39 +1,42 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlSectionTagHandler_h #define DgmlSectionTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlSectionTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlSectionTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.cpp (revision 899826) @@ -1,65 +1,64 @@ /* Copyright (C) 2008 Jens-Michael Hoffmann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Own #include "DgmlProjectionTagHandler.h" // Marble #include "DgmlAttributeDictionary.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneTexture.h" namespace Marble { - -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Projection) GeoNode* DgmlProjectionTagHandler::parse( GeoParser& parser ) const { // Check whether the tag is valid Q_ASSERT( parser.isStartElement() && parser.isValidElement( dgmlTag_Projection )); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if ( !parentItem.represents( dgmlTag_Texture )) return 0; // Attribute name, default to "Equirectangular" const QString nameStr = parser.attribute( dgmlAttr_name ).trimmed(); if ( !nameStr.isEmpty() ) { GeoSceneTexture::Projection projection = GeoSceneTexture::Equirectangular; if ( nameStr == "Equirectangular" ) projection = GeoSceneTexture::Equirectangular; else if ( nameStr == "Mercator" ) projection = GeoSceneTexture::Mercator; else parser.raiseWarning( QString( "Value not allowed for attribute name: %1" ).arg( nameStr )); parentItem.nodeAs()->setProjection( projection ); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlValueTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlValueTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlValueTagHandler.cpp (revision 899826) @@ -1,54 +1,53 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlValueTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneProperty.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Value) GeoNode* DgmlValueTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Value)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Property)) { QString parsedText = parser.readElementText().toLower().trimmed(); parentItem.nodeAs()->setDefaultValue(parsedText == dgmlValue_true || parsedText == dgmlValue_on); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAvailableTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAvailableTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAvailableTagHandler.cpp (revision 899826) @@ -1,53 +1,53 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlAvailableTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneProperty.h" namespace Marble { -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Available) GeoNode* DgmlAvailableTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Available)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Property)) { QString parsedText = parser.readElementText().toLower().trimmed(); parentItem.nodeAs()->setAvailable(parsedText == dgmlValue_true || parsedText == dgmlValue_on); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlZoomTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlZoomTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlZoomTagHandler.cpp (revision 899826) @@ -1,50 +1,50 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlZoomTagHandler.h" #include #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneHead.h" #include "GeoSceneZoom.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Zoom) GeoNode* DgmlZoomTagHandler::parse(GeoParser& parser) const { Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Zoom)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Head)) return parentItem.nodeAs()->zoom(); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlElementDictionary.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlElementDictionary.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlElementDictionary.cpp (revision 899826) @@ -1,77 +1,77 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlElementDictionary.h" namespace Marble { // One static list of all tag names, to avoid string comparisons all-over-the-place -namespace GeoSceneElementDictionary +namespace dgml { const char* dgmlTag_nameSpace20 = "http://edu.kde.org/marble/dgml/2.0"; const char* dgmlTag_Available = "available"; const char* dgmlTag_Brush = "brush"; const char* dgmlTag_Coastline = "coastline"; const char* dgmlTag_Color = "color"; const char* dgmlTag_CustomPlugin = "customplugin"; const char* dgmlTag_Dem = "dem"; const char* dgmlTag_Description = "description"; const char* dgmlTag_Dgml = "dgml"; const char* dgmlTag_Discrete = "discrete"; const char* dgmlTag_Document = "document"; const char* dgmlTag_DownloadUrl = "downloadUrl"; const char* dgmlTag_Filter = "filter"; const char* dgmlTag_Geodata = "geodata"; const char* dgmlTag_Group = "group"; const char* dgmlTag_Head = "head"; const char* dgmlTag_Heading = "heading"; const char* dgmlTag_Icon = "icon"; const char* dgmlTag_InstallMap = "installmap"; const char* dgmlTag_Item = "item"; const char* dgmlTag_Layer = "layer"; const char* dgmlTag_Legend = "legend"; const char* dgmlTag_Map = "map"; const char* dgmlTag_Maximum = "maximum"; const char* dgmlTag_Minimum = "minimum"; const char* dgmlTag_Name = "name"; const char* dgmlTag_Palette = "palette"; const char* dgmlTag_Pen = "pen"; const char* dgmlTag_Pick = "pick"; const char* dgmlTag_Projection = "projection"; const char* dgmlTag_Property = "property"; const char* dgmlTag_Section = "section"; const char* dgmlTag_Settings = "settings"; const char* dgmlTag_SourceDir = "sourcedir"; const char* dgmlTag_SourceFile = "sourcefile"; const char* dgmlTag_StorageLayout = "storageLayout"; const char* dgmlTag_Target = "target"; const char* dgmlTag_Text = "text"; const char* dgmlTag_Texture = "texture"; const char* dgmlTag_Theme = "theme"; const char* dgmlTag_Value = "value"; const char* dgmlTag_Vector = "vector"; const char* dgmlTag_Visible = "visible"; const char* dgmlTag_Zoom = "zoom"; } } Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlFilterTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlFilterTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlFilterTagHandler.cpp (revision 899826) @@ -1,70 +1,68 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn Copyright (C) 2008 Henry de Valence This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlFilterTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneLayer.h" #include "GeoSceneMap.h" #include "GeoSceneFilter.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Filter) GeoNode* DgmlFilterTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Filter)); QString name = parser.attribute(dgmlAttr_name).trimmed(); QString type = parser.attribute(dgmlAttr_type).toLower().trimmed(); GeoSceneFilter *filter = 0; // Checking for parent layer GeoStackItem parentItem = parser.parentElement(); GeoStackItem grandParentItem = parser.parentElement(1); if (parentItem.represents(dgmlTag_Layer) && grandParentItem.represents(dgmlTag_Map) ) { filter = new GeoSceneFilter( name ); filter->setType( type ); parentItem.nodeAs()->addFilter( filter ); grandParentItem.nodeAs()->addFilter( filter ); } return filter; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTargetTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTargetTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTargetTagHandler.cpp (revision 899826) @@ -1,57 +1,57 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlTargetTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneHead.h" #include "GeoSceneLayer.h" #include "GeoSceneMap.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Target) GeoNode* DgmlTargetTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Target)); GeoSceneLayer *layer = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Head)) parentItem.nodeAs()->setTarget( parser.readElementText().trimmed() ); if (parentItem.represents(dgmlTag_Map)) { layer = new GeoSceneLayer( "$MARBLETARGET$" ); parentItem.nodeAs()->addLayer( layer ); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlBrushTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlBrushTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlBrushTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlBrushTagHandler_h #define DgmlBrushTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlBrushTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlBrushTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlIconTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlIconTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlIconTagHandler.cpp (revision 899826) @@ -1,73 +1,72 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Own #include "DgmlIconTagHandler.h" // Qt #include // Marble #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneHead.h" #include "GeoSceneIcon.h" #include "GeoSceneItem.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Icon) GeoNode* DgmlIconTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Icon)); QString pixmapRelativePath = parser.attribute(dgmlAttr_pixmap).trimmed(); QColor color = QColor( parser.attribute(dgmlAttr_color).trimmed() ); if ( !color.isValid() ) color = Qt::transparent; GeoSceneIcon *icon = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Head)) { icon = parentItem.nodeAs()->icon(); icon->setPixmap( pixmapRelativePath ); icon->setColor( color ); } if (parentItem.represents(dgmlTag_Item)) { icon = parentItem.nodeAs()->icon(); icon->setPixmap( pixmapRelativePath ); icon->setColor( color ); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlTextTagHandler_h #define DgmlTextTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlTextTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlTextTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVisibleTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVisibleTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlVisibleTagHandler.cpp (revision 899826) @@ -1,52 +1,51 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlVisibleTagHandler.h" #include "DgmlElementDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneHead.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Visible) GeoNode* DgmlVisibleTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Visible)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Head)) { QString parsedText = parser.readElementText().toLower().trimmed(); parentItem.nodeAs()->setVisible(parsedText == dgmlValue_true || dgmlValue_on); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlItemTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlItemTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlItemTagHandler.cpp (revision 899826) @@ -1,67 +1,65 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlItemTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneSection.h" #include "GeoSceneItem.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Item) GeoNode* DgmlItemTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Item)); QString name = parser.attribute(dgmlAttr_name).trimmed(); QString checkable = parser.attribute(dgmlAttr_checkable).toLower().trimmed(); QString connectTo = parser.attribute(dgmlAttr_connect).trimmed(); int spacing = parser.attribute(dgmlAttr_spacing).toInt(); GeoSceneItem *item = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Section)) { item = new GeoSceneItem( name ); item->setCheckable( checkable == dgmlValue_true || dgmlValue_on ); item->setConnectTo( connectTo ); item->setSpacing( spacing ); parentItem.nodeAs()->addItem( item ); } return item; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDownloadUrlTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDownloadUrlTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDownloadUrlTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Jens-Michael Hoffmann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlDownloadUrlTagHandler_h #define DgmlDownloadUrlTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlDownloadUrlTagHandler : public GeoTagHandler { public: virtual GeoNode* parse( GeoParser& ) const; }; } +} #endif // DgmlDownloadUrlTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAttributeDictionary.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAttributeDictionary.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAttributeDictionary.cpp (revision 899826) @@ -1,61 +1,61 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlAttributeDictionary.h" namespace Marble { -namespace GeoSceneAttributeDictionary +namespace dgml { // One static list of all attribute names, to avoid string comparisons all-over-the-place const char* dgmlAttr_nameSpace20 = "http://edu.kde.org/marble/dgml/2.0"; const char* dgmlAttr_backend = "backend"; const char* dgmlAttr_bgcolor = "bgcolor"; const char* dgmlAttr_color = "color"; const char* dgmlAttr_checkable = "checkable"; const char* dgmlAttr_connect = "connect"; const char* dgmlAttr_expire = "expire"; const char* dgmlAttr_feature = "feature"; const char* dgmlAttr_format = "format"; const char* dgmlAttr_host = "host"; const char* dgmlAttr_labelColor = "labelColor"; const char* dgmlAttr_levelZeroColumns = "levelZeroColumns"; const char* dgmlAttr_levelZeroRows = "levelZeroRows"; const char* dgmlAttr_mode = "mode"; const char* dgmlAttr_name = "name"; const char* dgmlAttr_password = "password"; const char* dgmlAttr_path = "path"; const char* dgmlAttr_pixmap = "pixmap"; const char* dgmlAttr_port = "port"; const char* dgmlAttr_protocol = "protocol"; const char* dgmlAttr_role = "role"; const char* dgmlAttr_spacing = "spacing"; const char* dgmlAttr_style = "style"; const char* dgmlAttr_text = "text"; const char* dgmlAttr_type = "type"; const char* dgmlAttr_user = "user"; const char* dgmlAttr_width = "width"; } } Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadingTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadingTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadingTagHandler.cpp (revision 899826) @@ -1,49 +1,49 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlHeadingTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneSection.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Heading) GeoNode* DgmlHeadingTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Heading)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Section)) parentItem.nodeAs()->setHeading(parser.readElementText().trimmed()); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceFileTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceFileTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSourceFileTagHandler.cpp (revision 899826) @@ -1,57 +1,56 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlSourceFileTagHandler.h" #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneVector.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(SourceFile) GeoNode* DgmlSourceFileTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_SourceFile)); QString format = parser.attribute(dgmlAttr_format).trimmed(); GeoSceneVector *vector = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Vector)) { vector = parentItem.nodeAs(); vector->setSourceFile( parser.readElementText().trimmed() ); vector->setFileFormat(format); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextureTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextureTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTextureTagHandler.cpp (revision 899826) @@ -1,74 +1,72 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlTextureTagHandler.h" #include #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "DgmlAuxillaryDictionary.h" #include "GeoParser.h" #include "GeoSceneLayer.h" #include "GeoSceneTexture.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; -using namespace GeoSceneAuxillaryDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Texture) GeoNode* DgmlTextureTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Texture)); const QString name = parser.attribute(dgmlAttr_name).trimmed(); const QString expireStr = parser.attribute(dgmlAttr_expire).trimmed(); int expire = std::numeric_limits::max(); if ( !expireStr.isEmpty() ) expire = expireStr.toInt(); GeoSceneTexture *texture = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); // Check parent type and make sure that the dataSet type // matches the backend of the parent layer if ( parentItem.represents(dgmlTag_Layer) && parentItem.nodeAs()->backend() == dgmlValue_texture ) { texture = new GeoSceneTexture( name ); texture->setExpire( expire ); parentItem.nodeAs()->addDataset( texture ); } return texture; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlHeadTagHandler.cpp (revision 899826) @@ -1,50 +1,50 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlHeadTagHandler.h" #include #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneDocument.h" #include "GeoSceneHead.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Head) GeoNode* DgmlHeadTagHandler::parse(GeoParser& parser) const { Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Head)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Document)) return parentItem.nodeAs()->head(); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLegendTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLegendTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlLegendTagHandler.h (revision 899826) @@ -1,39 +1,42 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlLegendTagHandler_h #define DgmlLegendTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlLegendTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlLegendTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSettingsTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSettingsTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlSettingsTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlSettingsTagHandler_h #define DgmlSettingsTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlSettingsTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlSettingsTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAuxillaryDictionary.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAuxillaryDictionary.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAuxillaryDictionary.cpp (revision 899826) @@ -1,35 +1,35 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlAuxillaryDictionary.h" // One static list of all auxillary strings, to avoid string comparisons all-over-the-place namespace Marble { -namespace GeoSceneAuxillaryDictionary +namespace dgml { const char* dgmlValue_true = "true"; const char* dgmlValue_on = "on"; const char* dgmlValue_texture = "texture"; const char* dgmlValue_vector = "vector"; } } Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlStorageLayoutTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Jens-Michael Hoffmann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlStorageLayoutTagHandler_h #define DgmlStorageLayoutTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlStorageLayoutTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlStorageLayoutTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlNameTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlNameTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlNameTagHandler.cpp (revision 899826) @@ -1,48 +1,48 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlNameTagHandler.h" #include "DgmlElementDictionary.h" #include "GeoParser.h" #include "GeoSceneHead.h" namespace Marble { - -using namespace GeoSceneElementDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Name) GeoNode* DgmlNameTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Name)); // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Head)) parentItem.nodeAs()->setName( parser.readElementText().trimmed() ); return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMinimumTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMinimumTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMinimumTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlMinimumTagHandler_h #define DgmlMinimumTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlMinimumTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlMinimumTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlProjectionTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Jens-Michael Hoffmann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlProjectionTagHandler_h #define DgmlProjectionTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlProjectionTagHandler : public GeoTagHandler { public: virtual GeoNode* parse( GeoParser& ) const; }; } +} #endif // DgmlProjectionTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlValueTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlValueTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlValueTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlValueTagHandler_h #define DgmlValueTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlValueTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlValueTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMaximumTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMaximumTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMaximumTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlMaximumTagHandler_h #define DgmlMaximumTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlMaximumTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlMaximumTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMapTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMapTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlMapTagHandler.h (revision 899826) @@ -1,39 +1,42 @@ /* Copyright (C) 2007 Nikolas Zimmermann Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlMapTagHandler_h #define DgmlMapTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlMapTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlMapTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlBrushTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlBrushTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlBrushTagHandler.cpp (revision 899826) @@ -1,65 +1,64 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlBrushTagHandler.h" #include #include #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneVector.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Brush) GeoNode* DgmlBrushTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Brush)); QString color = parser.attribute(dgmlAttr_color).trimmed(); GeoSceneVector *vector = 0; QBrush brush; if ( !color.isEmpty() && QColor( color ).isValid() ) { brush.setColor( QColor( color ) ); } // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Vector)) { vector = parentItem.nodeAs(); vector->setBrush( brush ); } return 0; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPropertyTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPropertyTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlPropertyTagHandler.cpp (revision 899826) @@ -1,64 +1,63 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlPropertyTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneSettings.h" #include "GeoSceneGroup.h" #include "GeoSceneProperty.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Property) GeoNode* DgmlPropertyTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Property)); QString name = parser.attribute(dgmlAttr_name).trimmed(); GeoSceneProperty* property = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Settings)) { property = new GeoSceneProperty( name ); parentItem.nodeAs()->addProperty( property ); } if (parentItem.represents(dgmlTag_Group)) { property = new GeoSceneProperty( name ); parentItem.nodeAs()->addProperty( property); } return property; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAvailableTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAvailableTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlAvailableTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlAvailableTagHandler_h #define DgmlAvailableTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlAvailableTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlAvailableTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDescriptionTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDescriptionTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlDescriptionTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlDescriptionTagHandler_h #define DgmlDescriptionTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlDescriptionTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlDescriptionTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlZoomTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlZoomTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlZoomTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlZoomTagHandler_h #define DgmlZoomTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlZoomTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlZoomTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTargetTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTargetTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlTargetTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlTargetTagHandler_h #define DgmlTargetTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlTargetTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlTargetTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlGroupTagHandler.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlGroupTagHandler.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlGroupTagHandler.cpp (revision 899826) @@ -1,60 +1,59 @@ /* Copyright (C) 2007 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "DgmlGroupTagHandler.h" #include #include "DgmlElementDictionary.h" #include "DgmlAttributeDictionary.h" #include "GeoParser.h" #include "GeoSceneDocument.h" #include "GeoSceneSettings.h" #include "GeoSceneGroup.h" namespace Marble { - -using namespace GeoSceneElementDictionary; -using namespace GeoSceneAttributeDictionary; - +namespace dgml +{ DGML_DEFINE_TAG_HANDLER(Group) GeoNode* DgmlGroupTagHandler::parse(GeoParser& parser) const { // Check whether the tag is valid Q_ASSERT(parser.isStartElement() && parser.isValidElement(dgmlTag_Group)); QString name = parser.attribute(dgmlAttr_name); GeoSceneGroup* group = 0; // Checking for parent item GeoStackItem parentItem = parser.parentElement(); if (parentItem.represents(dgmlTag_Settings)) { group = new GeoSceneGroup( name ); parentItem.nodeAs()->addGroup( group ); } return group; } } +} Index: trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlIconTagHandler.h =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlIconTagHandler.h (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/handlers/dgml/DgmlIconTagHandler.h (revision 899826) @@ -1,38 +1,41 @@ /* Copyright (C) 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DgmlIconTagHandler_h #define DgmlIconTagHandler_h #include "GeoTagHandler.h" namespace Marble { +namespace dgml +{ class DgmlIconTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } +} #endif // DgmlIconTagHandler_h Index: trunk/KDE/kdeedu/marble/src/lib/geodata/parser/GeoSceneParser.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/parser/GeoSceneParser.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/parser/GeoSceneParser.cpp (revision 899826) @@ -1,103 +1,101 @@ /* Copyright (C) 2007, 2008 Nikolas Zimmermann This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Own #include "GeoSceneParser.h" // Qt #include // Geodata #include "GeoDocument.h" #include "GeoSceneDocument.h" #include "GeoTagHandler.h" // DGML support #include "DgmlElementDictionary.h" namespace Marble { -using namespace GeoSceneElementDictionary; - GeoSceneParser::GeoSceneParser(GeoSceneSourceType source) : GeoParser(source) { } GeoSceneParser::~GeoSceneParser() { } bool GeoSceneParser::isValidDocumentElement() const { switch ((GeoSceneSourceType) m_source) { case GeoScene_DGML: - return isValidElement(dgmlTag_Dgml); + return isValidElement(dgml::dgmlTag_Dgml); default: Q_ASSERT(false); return false; } } void GeoSceneParser::raiseDocumentElementError() { switch ((GeoSceneSourceType) m_source) { case GeoScene_DGML: raiseError(QObject::tr("The file is not a valid DGML 2.0 file")); default: GeoParser::raiseDocumentElementError(); break; } } bool GeoSceneParser::isValidElement(const QString& tagName) const { if (!GeoParser::isValidElement(tagName)) return false; switch ((GeoSceneSourceType) m_source) { case GeoScene_DGML: - return (namespaceUri() == dgmlTag_nameSpace20); + return (namespaceUri() == dgml::dgmlTag_nameSpace20); default: break; } // Should never be reached. Q_ASSERT(false); return false; } GeoDocument* GeoSceneParser::createDocument() const { return new GeoSceneDocument; } // Global helper function for the tag handlers GeoSceneDocument* geoSceneDoc(GeoParser& parser) { GeoDocument* document = parser.activeDocument(); Q_ASSERT(document->isGeoSceneDocument()); return static_cast(document); } } Index: trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneMap.cpp =================================================================== --- trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneMap.cpp (revision 899825) +++ trunk/KDE/kdeedu/marble/src/lib/geodata/scene/GeoSceneMap.cpp (revision 899826) @@ -1,207 +1,205 @@ /* Copyright (C) 2008 Torsten Rahn This file is part of the KDE project This library is free software you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License aint with this library see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GeoSceneMap.h" #include "GeoSceneLayer.h" #include "GeoSceneFilter.h" #include "DgmlAuxillaryDictionary.h" namespace Marble { -using namespace GeoSceneAuxillaryDictionary; - // FIXME: Filters are a Dataset. class GeoSceneMapPrivate { public: GeoSceneMapPrivate() : m_backgroundColor( "" ) { } ~GeoSceneMapPrivate() { qDeleteAll( m_layers ); qDeleteAll( m_filters ); } /// The vector holding all the sections in the legend. /// (We want to preserve the order and don't care /// much about speed here), so we don't use a hash QVector m_layers; /// The vector holding all the filters in the map. QVector m_filters; QColor m_backgroundColor; QColor m_labelColor; }; GeoSceneMap::GeoSceneMap() : d ( new GeoSceneMapPrivate ) { } GeoSceneMap::~GeoSceneMap() { delete d; } void GeoSceneMap::addLayer( GeoSceneLayer* layer ) { // Remove any layer that has the same name QVector::iterator it = d->m_layers.begin(); while (it != d->m_layers.end()) { GeoSceneLayer* currentLayer = *it; if ( currentLayer->name() == layer->name() ) { delete currentLayer; it = d->m_layers.erase(it); } else { ++it; } } if ( layer ) { d->m_layers.append( layer ); } } GeoSceneLayer* GeoSceneMap::layer( const QString& name ) { GeoSceneLayer* layer = 0; QVector::const_iterator it = d->m_layers.constBegin(); for (it = d->m_layers.constBegin(); it != d->m_layers.constEnd(); ++it) { if ( (*it)->name() == name ) layer = *it; } if ( layer ) { Q_ASSERT(layer->name() == name); return layer; } layer = new GeoSceneLayer( name ); addLayer( layer ); return layer; } QVector GeoSceneMap::layers() const { return d->m_layers; } void GeoSceneMap::addFilter( GeoSceneFilter* filter ) { // Remove any filter that has the same name QVector::iterator it = d->m_filters.begin(); while (it != d->m_filters.end()) { GeoSceneFilter* currentFilter = *it; if ( currentFilter->name() == filter->name() ) { delete currentFilter; it = d->m_filters.erase(it); } else { ++it; } } if ( filter ) { d->m_filters.append( filter ); } } GeoSceneFilter* GeoSceneMap::filter( const QString& name ) { GeoSceneFilter* filter = 0; QVector::const_iterator it = d->m_filters.constBegin(); for (it = d->m_filters.constBegin(); it != d->m_filters.constEnd(); ++it) { if ( (*it)->name() == name ) filter = *it; } if ( filter ) { Q_ASSERT(filter->name() == name); return filter; } filter = new GeoSceneFilter( name ); addFilter( filter ); return filter; } QVector GeoSceneMap::filters() const { return d->m_filters; } bool GeoSceneMap::hasTextureLayers() const { QVector::const_iterator it = d->m_layers.constBegin(); for (it = d->m_layers.constBegin(); it != d->m_layers.constEnd(); ++it) { - if ( (*it)->backend() == dgmlValue_texture && (*it)->datasets().count() > 0 ) + if ( (*it)->backend() == dgml::dgmlValue_texture && (*it)->datasets().count() > 0 ) return true; } return false; } bool GeoSceneMap::hasVectorLayers() const { QVector::const_iterator it = d->m_layers.constBegin(); for (it = d->m_layers.constBegin(); it != d->m_layers.constEnd(); ++it) { - if ( (*it)->backend() == dgmlValue_vector && (*it)->datasets().count() > 0 ) + if ( (*it)->backend() == dgml::dgmlValue_vector && (*it)->datasets().count() > 0 ) return true; } return false; } QColor GeoSceneMap::backgroundColor() const { return d->m_backgroundColor; } void GeoSceneMap::setBackgroundColor( const QColor& backgroundColor ) { d->m_backgroundColor = backgroundColor; } QColor GeoSceneMap::labelColor() const { return d->m_labelColor; } void GeoSceneMap::setLabelColor( const QColor& backgroundColor ) { d->m_labelColor = backgroundColor; } }