X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fgtkmathview-bonobo%2Fsrc%2Faux.cc;h=4ef5312399dc3b3356dc6923a5af6f8de0448300;hb=97c2d258a5c524eb5c4b85208899d80751a2c82f;hp=6fe151bc1035141ae88bb739e80da7e3ff4f93e6;hpb=e03554e83a734994353488594810b5c32bfc46af;p=helm.git diff --git a/helm/gtkmathview-bonobo/src/aux.cc b/helm/gtkmathview-bonobo/src/aux.cc index 6fe151bc1..4ef531239 100644 --- a/helm/gtkmathview-bonobo/src/aux.cc +++ b/helm/gtkmathview-bonobo/src/aux.cc @@ -1,24 +1,25 @@ -// Copyright (C) 2000-2002, Luca Padovani . -// -// This file is part of GtkMathView, a Gtk widget for MathML. -// -// GtkMathView is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// 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 General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with GtkMathView; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -// For details, see the GtkMathView World-Wide-Web page, -// http://www.cs.unibo.it/helm/mml-widget, or send a mail to -// +/* This file is part of GtkMathView-Bonobo, a Bonobo wrapper for GtkMathView. + * Copyright (C) 2003 Luca Padovani + * Pouria Masoudi + * + * This library 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 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * For more information, please visit the project's home page + * http://helm.cs.unibo.it/gtkmathview-bonobo + * or send an email to + */ #include @@ -212,7 +213,7 @@ find_common_ancestor(GdomeElement* first, GdomeElement* last) } extern "C" GdomeElement* -find_self_or_ancestor(GdomeElement* elem, const char* uri, const char* name) +find_self_or_ancestor(GdomeElement* elem, const gchar* uri, const gchar* name) { DOM::Element el(elem); @@ -270,9 +271,14 @@ findElementWithAttributeNS(const DOM::Element& elem, const std::string& ns_uri, } extern "C" GdomeElement* -find_xref_element(GdomeElement* elem) +find_element_with_id(GdomeElement* elem, GdomeDOMString* ns_uri, GdomeDOMString* name) { - DOM::Element el = findElementWithAttribute(DOM::Element(elem), "xref"); + assert(name != NULL); + DOM::Element el; + if (ns_uri != NULL) + el = findElementWithAttributeNS(DOM::Element(elem), DOM::GdomeString(ns_uri), DOM::GdomeString(name)); + else + el = findElementWithAttribute(DOM::Element(elem), DOM::GdomeString(name)); return gdome_cast_el(el.gdome_object()); } @@ -286,10 +292,11 @@ find_hyperlink(GdomeElement* elem) extern "C" GdomeElement* find_element_by_id(GdomeElement* root, GdomeDOMString* ns_uri, GdomeDOMString* name, - const char* id) + const gchar* id) { DOM::Element el = findElementById(DOM::Element(root), DOM::GdomeString(ns_uri), DOM::GdomeString(name), DOM::GdomeString(id)); return gdome_cast_el(el.gdome_object()); } +