X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fxml%2Fsimple-document.cpp;h=2807133affe68a5bc4951ca352dba6be3d816cc7;hb=1ef3c8b1b935901dd133c337031a7300334db424;hp=e8c652b2deaa45eeb2098e6443bfa96ed1fc273b;hpb=7d2b4e2210e760fd3a93e563d03f5eb820e480e8;p=inkscape.git diff --git a/src/xml/simple-document.cpp b/src/xml/simple-document.cpp index e8c652b2d..2807133af 100644 --- a/src/xml/simple-document.cpp +++ b/src/xml/simple-document.cpp @@ -1,7 +1,7 @@ -/* - * Inkscape::XML::SimpleDocument - generic XML document implementation - * - * Copyright 2004-2005 MenTaLguY +/** @file + * @brief Garbage collected XML document implementation + */ +/* Copyright 2004-2005 MenTaLguY * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +12,19 @@ * */ +#include // g_assert() + #include "xml/simple-document.h" #include "xml/event-fns.h" #include "xml/element-node.h" #include "xml/text-node.h" #include "xml/comment-node.h" +#include "xml/pi-node.h" namespace Inkscape { namespace XML { -void SimpleDocument::_initBindings() { - _bindDocument(*this); -} - void SimpleDocument::beginTransaction() { g_assert(!_in_transaction); _in_transaction = true; @@ -51,16 +50,20 @@ Inkscape::XML::Event *SimpleDocument::commitUndoable() { return _log_builder.detach(); } -Node *SimpleDocument::createElementNode(char const *name) { - return new ElementNode(g_quark_from_string(name)); +Node *SimpleDocument::createElement(char const *name) { + return new ElementNode(g_quark_from_string(name), this); } Node *SimpleDocument::createTextNode(char const *content) { - return new TextNode(Util::share_string(content)); + return new TextNode(Util::share_string(content), this); +} + +Node *SimpleDocument::createComment(char const *content) { + return new CommentNode(Util::share_string(content), this); } -Node *SimpleDocument::createCommentNode(char const *content) { - return new CommentNode(Util::share_string(content)); +Node *SimpleDocument::createPI(char const *target, char const *content) { + return new PINode(g_quark_from_string(target), Util::share_string(content), this); } void SimpleDocument::notifyChildAdded(Node &parent, @@ -123,4 +126,4 @@ void SimpleDocument::notifyAttributeChanged(Node &node, fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :