summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a32c46f)
raw | patch | inline | side by side (parent: a32c46f)
author | johnce <johnce@users.sourceforge.net> | |
Wed, 5 Aug 2009 18:32:38 +0000 (18:32 +0000) | ||
committer | johnce <johnce@users.sourceforge.net> | |
Wed, 5 Aug 2009 18:32:38 +0000 (18:32 +0000) |
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index e689c93db186669b3768243e8d755cb40536aa6a..835e43a2664c32508514f86fe6fee4c1399c253a 100644 (file)
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
#include "display/sp-canvas.h"
#include "sp-ellipse.h"
#include "document.h"
+#include "xml/document.h"
#include "sp-namedview.h"
#include "selection.h"
#include "desktop-handles.h"
}
/* Create object */
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
+ Inkscape::XML::DocumentTree *xml_doc = sp_document_repr_doc(desktop->doc());
Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
repr->setAttribute("sodipodi:type", "arc");
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index 7e6eaaa22e80adef8ceb0c22d3682cb97f1e5d35..4146ec30df4e2afcca52c28a0c800ba6c1bfb3fc 100644 (file)
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
}
/* Create object */
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc));
+ Inkscape::XML::DocumentTree *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc));
Inkscape::XML::Node *repr = xml_doc->createElement("svg:g");
repr->setAttribute("sodipodi:type", "inkscape:box3d");
diff --git a/src/document.h b/src/document.h
index 45b82815593c559ef4c40998cd9fd83e66a7c806..cb83c4d0d811f79efeaca03672aa8aaacd7a33e3 100644 (file)
--- a/src/document.h
+++ b/src/document.h
#include <vector>
#include <set>
+#include "xml/document.h"
+
namespace Avoid {
class Router;
}
unsigned int virgin : 1; ///< Has the document never been touched?
unsigned int modified_since_save : 1;
- Inkscape::XML::Document *rdoc; ///< Our Inkscape::XML::Document
+ Inkscape::XML::DocumentTree *rdoc; ///< Our Inkscape::XML::Document
Inkscape::XML::Node *rroot; ///< Root element of Inkscape::XML::Document
SPObject *root; ///< Our SPRoot
CRCascade *style_cascade;
diff --git a/src/xml/document.h b/src/xml/document.h
index 2b9ea5cc3c8ebd12648af2d8cdbfbd51ff1747c7..a5f457fe89f8738635fd69918cf4c95d5ceb2491 100644 (file)
--- a/src/xml/document.h
+++ b/src/xml/document.h
*
*/
-#ifndef SEEN_INKSCAPE_XML_SP_REPR_DOC_H
-#define SEEN_INKSCAPE_XML_SP_REPR_DOC_H
+#ifndef SEEN_INKSCAPE_XML_SP_REPR_DOCTREE_H
+#define SEEN_INKSCAPE_XML_SP_REPR_DOCTREE_H
#include "xml/xml-forward.h"
#include "xml/node.h"
* "restore point" by calling beginTransaction() again. There can be only one active
* transaction at a time for a given document.
*/
-struct Document : virtual public Node {
+class DocumentTree : virtual public Node {
public:
/**
* @name Document transactions
index 8d771fef2d597c8eb4a4a722135abe01ed07ce9a..0fa5c03373b0ec29d82b94aff0a037398026c410 100644 (file)
--- a/src/xml/rebase-hrefs.cpp
+++ b/src/xml/rebase-hrefs.cpp
#include "xml/rebase-hrefs.h"
#include "dir-util.h"
-#include "../document.h" /* Unfortunately there's a separate xml/document.h. */
+#include "document.h" /* Unfortunately there's a separate xml/document.h. */
#include "io/sys.h"
#include "sp-object.h"
#include "streq.h"
*
* \param spns True iff doc should contain sodipodi:absref attributes.
*/
-void Inkscape::XML::rebase_hrefs(Document *const doc, gchar const *const new_base, bool const spns)
+void Inkscape::XML::rebase_hrefs(Inkscape::XML::Document *doc, gchar const *const new_base, bool const spns)
{
- gchar *const old_abs_base = calc_abs_doc_base(doc->base);
+ gchar *const old_abs_base = calc_abs_doc_base((Inkscape::XML::Document *)(doc)->base);
gchar *const new_abs_base = calc_abs_doc_base(new_base);
/* TODO: Should handle not just image but also:
@@ -224,7 +224,7 @@ void Inkscape::XML::rebase_hrefs(Document *const doc, gchar const *const new_bas
*
* Note also that Inkscape only supports fragment hrefs (href="#pattern257") for many of these
* cases. */
- GSList const *images = sp_document_get_resource_list(doc, "image");
+ GSList const *images = sp_document_get_resource_list((Inkscape::XML::Document *)doc, "image");
for (GSList const *l = images; l != NULL; l = l->next) {
Inkscape::XML::Node *ir = SP_OBJECT_REPR(l->data);
diff --git a/src/xml/rebase-hrefs.h b/src/xml/rebase-hrefs.h
index 2f82a55879a0e8d153ea2d08dab52628d0d474fe..36de6ba6e2e102153016a2ee23106f76b7856904 100644 (file)
--- a/src/xml/rebase-hrefs.h
+++ b/src/xml/rebase-hrefs.h
#include <glib/gtypes.h>
#include "util/list.h"
#include "xml/attribute-record.h"
-struct Document;
+#include "document.h"
namespace Inkscape {
namespace XML {
+//struct Document;
gchar *calc_abs_doc_base(gchar const *doc_base);
-void rebase_hrefs(Document *doc, gchar const *new_base, bool spns);
+void rebase_hrefs(Inkscape::XML::Document *doc, gchar const *new_base, bool spns);
Inkscape::Util::List<AttributeRecord const> rebase_href_attrs(
gchar const *old_abs_base,
diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp
index 172cfa6f3f68694d47f99e24b963adf1e5c387b0..a7e9138532f4eafe4feedf75165387cba47e6686 100644 (file)
--- a/src/xml/repr-css.cpp
+++ b/src/xml/repr-css.cpp
struct SPCSSAttrImpl : public SimpleNode, public SPCSSAttr {
public:
- SPCSSAttrImpl(Document *doc)
+ SPCSSAttrImpl(Inkscape::XML::Document *doc)
: SimpleNode(g_quark_from_static_string("css"), doc) {}
- SPCSSAttrImpl(SPCSSAttrImpl const &other, Document *doc)
- : SimpleNode(other, doc) {}
+ SPCSSAttrImpl(SPCSSAttrImpl const &other, Inkscape::XML::Document *doc)
+ : SimpleNode(other, (Inkscape::XML::Document *)doc) {}
NodeType type() const { return Inkscape::XML::ELEMENT_NODE; }
protected:
- SimpleNode *_duplicate(Inkscape::XML::Document* doc) const { return new SPCSSAttrImpl(*this, doc); }
+ SimpleNode *_duplicate(Inkscape::XML::Document* doc) const { return new SPCSSAttrImpl(*this, (Inkscape::XML::Document *)doc); }
};
static void sp_repr_css_add_components(SPCSSAttr *css, Node *repr, gchar const *attr);
diff --git a/src/xml/repr.h b/src/xml/repr.h
index 549822e4e1a4c82e7509d51eb2ec805ee3ffe965..b40fe63a9876a1582c38cdacec3340e1ea8abf1b 100644 (file)
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
gchar const *value);
-inline Inkscape::XML::Node *sp_repr_document_first_child(Inkscape::XML::Document const *doc) {
+inline Inkscape::XML::Node *sp_repr_document_first_child(Inkscape::XML::DocumentTree const *doc) {
return const_cast<Inkscape::XML::Node *>(doc->firstChild());
}