diff --git a/src/xml/simple-node.h b/src/xml/simple-node.h
index 0dece19b905d3866421eece35cc2f80d5b2bd112..67070d0fceb05db834f1639f4b3ee01d4d2b26ee 100644 (file)
--- a/src/xml/simple-node.h
+++ b/src/xml/simple-node.h
-/*
- * SimpleNode - generic XML node implementation
- *
- * Copyright 2004-2005 MenTaLguY <mental@rydia.net>
+/** @file
+ * @brief GC-managed XML node implementation
+ */
+/* Copyright 2004-2005 MenTaLguY <mental@rydia.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* of the License, or (at your option) any later version.
*
* See the file COPYING for details.
- *
*/
+#ifndef SEEN_INKSCAPE_XML_NODE_H
+#error You have included xml/simple-node.h in your document, which is an implementation. Chances are that you want xml/node.h. Please fix that.
+#endif
+
#ifndef SEEN_INKSCAPE_XML_SIMPLE_NODE_H
#define SEEN_INKSCAPE_XML_SIMPLE_NODE_H
namespace XML {
+/**
+ * @brief Default implementation of the XML node stored in memory.
+ *
+ * @see Inkscape::XML::Node
+ */
class SimpleNode
: virtual public Node, public Inkscape::GC::Managed<>
{
virtual SimpleNode *_duplicate(Document *doc) const=0;
-public: // ideally these should be protected somehow...
- NodeObserver &_subtreeObservers() { return _subtree_observers; }
- void _setParent(Node *parent);
- void _setNext(Node *next) { _next = next; }
-
- unsigned _childPosition(Node const &child) const;
- unsigned _cachedPosition() const { return _cached_position; }
- void _setCachedPosition(unsigned position) const {
- _cached_position = position;
- }
-
private:
void operator=(Node const &); // no assign
- Node *_parent;
- Node *_next;
+ void _setParent(SimpleNode *parent);
+ unsigned _childPosition(SimpleNode const &child) const;
+
+ SimpleNode *_parent;
+ SimpleNode *_next;
Document *_document;
mutable unsigned _cached_position;
unsigned _child_count;
mutable bool _cached_positions_valid;
- Node *_first_child;
- Node *_last_child;
+ SimpleNode *_first_child;
+ SimpleNode *_last_child;
CompositeNodeObserver _observers;
CompositeNodeObserver _subtree_observers;