Code

Conditionally disable per-document "auto" palette
[inkscape.git] / src / xml / simple-document.h
index ca130e62bcf80bdd2fa61ae87b57a2efde5c6edf..0a20f121ed2e5db505d75475a8f21aaa120c423c 100644 (file)
@@ -29,16 +29,12 @@ class SimpleDocument : public SimpleNode,
                        public NodeObserver
 {
 public:
-    explicit SimpleDocument(int code)
-    : SimpleNode(code), _in_transaction(false)
-    {
-        _initBindings();
-    }
+    explicit SimpleDocument()
+    : SimpleNode(g_quark_from_static_string("xml"), this),
+      _in_transaction(false) {}
 
     NodeType type() const { return Inkscape::XML::DOCUMENT_NODE; }
 
-    NodeObserver *logger() { return this; }
-
     bool inTransaction() { return _in_transaction; }
 
     void beginTransaction();
@@ -46,9 +42,10 @@ public:
     void commit();
     Inkscape::XML::Event *commitUndoable();
 
-    Node *createElementNode(char const *name);
+    Node *createElement(char const *name);
     Node *createTextNode(char const *content);
-    Node *createCommentNode(char const *content);
+    Node *createComment(char const *content);
+    Node *createPI(char const *target, char const *content);
 
     void notifyChildAdded(Node &parent, Node &child, Node *prev);
 
@@ -68,16 +65,15 @@ public:
 protected:
     SimpleDocument(SimpleDocument const &doc)
     : Node(), SimpleNode(doc), Document(), NodeObserver(),
-      _in_transaction(false)
+      _in_transaction(false) {}
+
+    SimpleNode *_duplicate(Document* /*doc*/) const
     {
-        _initBindings();
+        return new SimpleDocument(*this);
     }
-
-    SimpleNode *_duplicate() const { return new SimpleDocument(*this); }
+    NodeObserver *logger() { return this; }
 
 private:
-    void _initBindings();
-
     bool _in_transaction;
     LogBuilder _log_builder;
 };