// Copyright (C) 2000-2007, Luca Padovani . // // This file is part of GtkMathView, a flexible, high-quality rendering // engine for MathML documents. // // GtkMathView is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published // by the Free Software Foundation; either version 3 of the License, or // (at your option) any later version. // // GtkMathView 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 // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . #include #include "AbstractLogger.hh" #include "Configuration.hh" #include "custom_reader_MathView.hh" #include "custom_reader_Builder.hh" custom_reader_MathView::custom_reader_MathView(const SmartPtr& logger) : View(logger), data(0) { setBuilder(custom_reader_Builder::create()); } custom_reader_MathView::~custom_reader_MathView() { } SmartPtr custom_reader_MathView::create(const SmartPtr& logger) { return new custom_reader_MathView(logger); } void custom_reader_MathView::unload() { } bool custom_reader_MathView::loadReader(const c_customXmlReader* reader, c_customModelUserData data) { if (SmartPtr builder = smart_cast(getBuilder())) { resetRootElement(); builder->setReader(customXmlReader::create(reader, data)); return true; } unload(); return false; } SmartPtr custom_reader_MathView::elementOfModelElement(c_customModelElementId el) const { if (SmartPtr builder = smart_cast(getBuilder())) return builder->findElement(el); else return 0; } c_customModelElementId custom_reader_MathView::modelElementOfElement(const SmartPtr& elem) const { if (SmartPtr builder = smart_cast(getBuilder())) return builder->findSelfOrAncestorModelElement(elem); else return 0; } bool custom_reader_MathView::notifyStructureChanged(c_customModelElementId) const { return false; } bool custom_reader_MathView::notifyAttributeChanged(c_customModelElementId, const char*) const { return false; }