summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 976fd15)
raw | patch | inline | side by side (parent: 976fd15)
author | mental <mental@users.sourceforge.net> | |
Wed, 11 Jun 2008 15:56:11 +0000 (15:56 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Wed, 11 Jun 2008 15:56:11 +0000 (15:56 +0000) |
77 files changed:
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp
index fba61e12914b4bc58714ae0cb9b1cea17577eb4b..0086d110158d6681e03fe3482c7cd8265f47d2ab 100644 (file)
--- a/src/box3d-side.cpp
+++ b/src/box3d-side.cpp
static void box3d_side_init (Box3DSide *side);
static void box3d_side_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
-static Inkscape::XML::Node *box3d_side_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *box3d_side_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void box3d_side_set (SPObject *object, unsigned int key, const gchar *value);
static void box3d_side_update (SPObject *object, SPCtx *ctx, guint flags);
@@ -103,14 +103,13 @@ box3d_side_build (SPObject * object, SPDocument * document, Inkscape::XML::Node
}
static Inkscape::XML::Node *
-box3d_side_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+box3d_side_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
Box3DSide *side = SP_BOX3D_SIDE (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
// this is where we end up when saving as plain SVG (also in other circumstances?)
// thus we don' set "sodipodi:type" so that the box is only saved as an ordinary svg:path
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:path");
}
g_free (d);
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/box3d.cpp b/src/box3d.cpp
index db06359ecf92dbea9e4cc258f0a73e95c7dfc68d..f4921bc1a31dcf6b930abc9e3521f4cef1595de4 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
static void box3d_release(SPObject *object);
static void box3d_set(SPObject *object, unsigned int key, const gchar *value);
static void box3d_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar *box3d_description(SPItem *item);
static NR::Matrix box3d_set_transform(SPItem *item, NR::Matrix const &xform);
}
-static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPBox3D *box = SP_BOX3D(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
// this is where we end up when saving as plain SVG (also in other circumstances?)
// thus we don' set "sodipodi:type" so that the box is only saved as an ordinary svg:g
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:g");
}
@@ -302,7 +301,7 @@ static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Node *r
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index 6f78699907fbcd093767b784ee9a04dc67ee70a9..876280f298555f394b90c9413a5dd2f604e32283 100644 (file)
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
/**
* Callback: write attributes to associated repr.
*/
-Inkscape::XML::Node* ColorProfile::write( SPObject *object, Inkscape::XML::Node *repr, guint flags )
+Inkscape::XML::Node* ColorProfile::write( SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags )
{
ColorProfile *cprof = COLORPROFILE(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:color-profile");
}
}
if (cprof_parent_class->write) {
- (* cprof_parent_class->write)(object, repr, flags);
+ (* cprof_parent_class->write)(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/color-profile.h b/src/color-profile.h
index 03b7e072bdff2f5f13a61cc2c3caef03088173eb..7fbc7812e5bbec1d8e75539cafacaa98f2be3a79 100644 (file)
--- a/src/color-profile.h
+++ b/src/color-profile.h
static void release( SPObject *object );
static void build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr );
static void set( SPObject *object, unsigned key, gchar const *value );
- static Inkscape::XML::Node *write( SPObject *object, Inkscape::XML::Node *repr, guint flags );
+ static Inkscape::XML::Node *write( SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags );
#if ENABLE_LCMS
static DWORD _getInputFormat( icColorSpaceSignature space );
void _clearProfile();
index e851ed8ed15920581056d2431121b181a1ccde21..289d42c8093de8fc8d78ef01771e71347e494d34 100644 (file)
NR::Matrix const &affine = NR::Matrix(NR::translate(move));
sp_item_set_i2d_affine(item, sp_item_i2d_affine(item) * affine);
sp_item_write_transform(item, repr, item->transform, NULL);
- SP_OBJECT (current_row->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT (current_row->data)->updateRepr();
cnt +=1;
}
g_slist_free (current_row);
index 19d770af0af04e968ff483607fcc11b86fb521da..5afb62d25f0456d6f789c564bd5404b7842ce407 100644 (file)
} else {
rdoc = sp_repr_document_new ("svg:svg");
repr = rdoc->root();
- repr = sp_document_root (doc)->updateRepr(repr, SP_OBJECT_WRITE_BUILD);
+ repr = sp_document_root (doc)->updateRepr(rdoc, repr, SP_OBJECT_WRITE_BUILD);
}
Inkscape::IO::fixupHrefs( doc, save_path, spns );
index 303db88495cb2b48a879e17aa802d2aac696b912..3e6a70174b8702dd78de5f2397c19b386fec86ad 100644 (file)
/* If gr hrefs some other gradient, remove the href */
if (gr->ref->getObject()) {
/* We are hrefing someone, so require flattening */
- SP_OBJECT(gr)->updateRepr(((SPObject *) gr)->repr, SP_OBJECT_WRITE_EXT | SP_OBJECT_WRITE_ALL);
+ SP_OBJECT(gr)->updateRepr(SP_OBJECT_WRITE_EXT | SP_OBJECT_WRITE_ALL);
sp_gradient_repr_set_link(SP_OBJECT_REPR(gr), NULL);
}
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index f78198275ee83bf6bdf5075d2818306b4a427f88..781d5a3bca0f0ea5396378a3a64d1e883a785a52 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
this->released(this->item);
} else {
SPObject *object = (SPObject *) this->item;
- object->updateRepr(object->repr, SP_OBJECT_WRITE_EXT);
+ object->updateRepr();
/* do cleanup tasks (e.g., for LPE items write the parameter values
* that were changed by dragging the handle to SVG)
index 432a484ee831bdd63c1a5b1705991feee405ac37..a73f9ccd6ff1e0c610a3915e2d398922d216402c 100644 (file)
static void livepatheffect_release(SPObject *object);
static void livepatheffect_set(SPObject *object, unsigned key, gchar const *value);
-static Inkscape::XML::Node *livepatheffect_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *livepatheffect_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void livepatheffect_on_repr_attr_changed (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive, void * data);
* Virtual write: write object attributes to repr.
*/
static Inkscape::XML::Node *
-livepatheffect_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+livepatheffect_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
#ifdef LIVEPATHEFFECT_VERBOSE
g_print("Write livepatheffect");
LivePathEffectObject *lpeobj = LIVEPATHEFFECT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("inkscape:path-effect");
}
lpeobj->lpe->writeParamsToSVG();
if (((SPObjectClass *) livepatheffect_parent_class)->write)
- (* ((SPObjectClass *) livepatheffect_parent_class)->write)(object, repr, flags);
+ (* ((SPObjectClass *) livepatheffect_parent_class)->write)(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/main.cpp b/src/main.cpp
index 83170931ffec51b5f9de5951bae9257c5b66ce64..6eae51c0c2855fa465e5ba3434aced2e41710ef5 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
Inkscape::XML::Node *repr;
rdoc = sp_repr_document_new("svg:svg");
repr = rdoc->root();
- repr = sp_document_root(doc)->updateRepr(repr, SP_OBJECT_WRITE_BUILD);
+ repr = sp_document_root(doc)->updateRepr(rdoc, repr, SP_OBJECT_WRITE_BUILD);
sp_repr_save_file(repr->document(), sp_export_svg, SP_SVG_NS_URI);
}
if (sp_export_ps) {
diff --git a/src/marker.cpp b/src/marker.cpp
index aacbee87531af918f955c9392d2ae67de25af2bb..5d2b501f539b8552b4fea643794703a5f2b012b2 100644 (file)
--- a/src/marker.cpp
+++ b/src/marker.cpp
static void sp_marker_release (SPObject *object);
static void sp_marker_set (SPObject *object, unsigned int key, const gchar *value);
static void sp_marker_update (SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_marker_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_marker_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static NRArenaItem *sp_marker_private_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
static void sp_marker_private_hide (SPItem *item, unsigned int key);
* Writes the object's properties into its repr object.
*/
static Inkscape::XML::Node *
-sp_marker_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_marker_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPMarker *marker;
marker = SP_MARKER (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:marker");
}
repr->setAttribute("preserveAspectRatio", object->repr->attribute("preserveAspectRatio"));
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/persp3d.cpp b/src/persp3d.cpp
index a2da34e7ae65dee5ac349507b9b0ef7d48f199da..4c2c620be0dce1f0234b53f55b0f9cd0a7993000 100644 (file)
--- a/src/persp3d.cpp
+++ b/src/persp3d.cpp
static void persp3d_release(SPObject *object);
static void persp3d_set(SPObject *object, unsigned key, gchar const *value);
static void persp3d_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *persp3d_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *persp3d_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void persp3d_on_repr_attr_changed (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive, void * data);
* Virtual write: write object attributes to repr.
*/
static Inkscape::XML::Node *
-persp3d_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+persp3d_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
Persp3D *persp = SP_PERSP3D(object);
if ((flags & SP_OBJECT_WRITE_BUILD & SP_OBJECT_WRITE_EXT) && !repr) {
// this is where we end up when saving as plain SVG (also in other circumstances?);
// hence we don't set the sodipodi:type attribute
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("inkscape:perspective");
}
}
if (((SPObjectClass *) persp3d_parent_class)->write)
- (* ((SPObjectClass *) persp3d_parent_class)->write)(object, repr, flags);
+ (* ((SPObjectClass *) persp3d_parent_class)->write)(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp
index e168369577eb0bce1c8d2cb87365a9dda09a2f37..aabefdfdb4cfe14d87607bd310b746fcad061e11 100644 (file)
--- a/src/sp-anchor.cpp
+++ b/src/sp-anchor.cpp
static void sp_anchor_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_anchor_release(SPObject *object);
static void sp_anchor_set(SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_anchor_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_anchor_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar *sp_anchor_description(SPItem *item);
static gint sp_anchor_event(SPItem *item, SPEvent *event);
@@ -143,12 +143,11 @@ static void sp_anchor_set(SPObject *object, unsigned int key, const gchar *value
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
-static Inkscape::XML::Node *sp_anchor_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_anchor_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPAnchor *anchor = SP_ANCHOR(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:a");
}
@@ -165,7 +164,7 @@ static Inkscape::XML::Node *sp_anchor_write(SPObject *object, Inkscape::XML::Nod
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index 7a0d3ed5b9fc95b266ea7e716ace8319251f98a9..f56564cbee6a4712212c94d42084e87ab6184fb7 100644 (file)
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
static void sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static void sp_clippath_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_clippath_modified(SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_clippath_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_clippath_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
SPClipPathView *sp_clippath_view_new_prepend(SPClipPathView *list, unsigned int key, NRArenaItem *arenaitem);
SPClipPathView *sp_clippath_view_list_remove(SPClipPathView *list, SPClipPathView *view);
}
static Inkscape::XML::Node *
-sp_clippath_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_clippath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:clipPath");
}
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-defs.cpp b/src/sp-defs.cpp
index 35324c62f15809818d8f5028d913f0d498b7eb4a..aa0cb0be7643f285f71af3c052fa78cb4596c24e 100644 (file)
--- a/src/sp-defs.cpp
+++ b/src/sp-defs.cpp
static void sp_defs_release(SPObject *object);
static void sp_defs_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_defs_modified(SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_defs_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_defs_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *parent_class;
}
}
-static Inkscape::XML::Node *sp_defs_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_defs_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if (flags & SP_OBJECT_WRITE_BUILD) {
if (!repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:defs");
}
GSList *l = NULL;
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
- Inkscape::XML::Node *crepr = child->updateRepr(NULL, flags);
+ Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
}
if (((SPObjectClass *) (parent_class))->write) {
- (* ((SPObjectClass *) (parent_class))->write)(object, repr, flags);
+ (* ((SPObjectClass *) (parent_class))->write)(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 4b68a2ca6b14094e9cbf4294dcb1c1af40377e41..d2750b76580bb7807e6ed499b3181c385af46a33 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
static void sp_genericellipse_set_shape(SPShape *shape);
static void sp_genericellipse_update_patheffect (SPLPEItem *lpeitem, bool write);
-static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape::XML::Node *repr,
+static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr,
guint flags);
static gboolean sp_arc_set_elliptical_path_attribute(SPArc *arc, Inkscape::XML::Node *repr);
/* Now we keep: 0 <= start < end <= 2*PI */
}
-static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPGenericEllipse *ellipse = SP_GENERICELLIPSE(object);
if (flags & SP_OBJECT_WRITE_EXT) {
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:path");
}
@@ -362,7 +361,7 @@ static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape::
}
if (((SPObjectClass *) ge_parent_class)->write)
- ((SPObjectClass *) ge_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) ge_parent_class)->write(object, xml_doc, repr, flags);
return repr;
}
static void sp_ellipse_init(SPEllipse *ellipse);
static void sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
-static Inkscape::XML::Node *sp_ellipse_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_ellipse_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_ellipse_set(SPObject *object, unsigned int key, gchar const *value);
static gchar *sp_ellipse_description(SPItem *item);
@@ -434,14 +433,13 @@ sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *re
}
static Inkscape::XML::Node *
-sp_ellipse_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_ellipse_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPGenericEllipse *ellipse;
ellipse = SP_GENERICELLIPSE(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:ellipse");
}
sp_repr_set_svg_double(repr, "ry", ellipse->ry.computed);
if (((SPObjectClass *) ellipse_parent_class)->write)
- (* ((SPObjectClass *) ellipse_parent_class)->write) (object, repr, flags);
+ (* ((SPObjectClass *) ellipse_parent_class)->write) (object, xml_doc, repr, flags);
return repr;
}
static void sp_circle_init(SPCircle *circle);
static void sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
-static Inkscape::XML::Node *sp_circle_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_circle_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_circle_set(SPObject *object, unsigned int key, gchar const *value);
static gchar *sp_circle_description(SPItem *item);
@@ -582,14 +580,13 @@ sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
}
static Inkscape::XML::Node *
-sp_circle_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_circle_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPGenericEllipse *ellipse;
ellipse = SP_GENERICELLIPSE(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:circle");
}
sp_repr_set_svg_double(repr, "r", ellipse->rx.computed);
if (((SPObjectClass *) circle_parent_class)->write)
- ((SPObjectClass *) circle_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) circle_parent_class)->write(object, xml_doc, repr, flags);
return repr;
}
static void sp_arc_init(SPArc *arc);
static void sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
-static Inkscape::XML::Node *sp_arc_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_arc_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_arc_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_arc_modified(SPObject *object, guint flags);
}
static Inkscape::XML::Node *
-sp_arc_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_arc_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPGenericEllipse *ge = SP_GENERICELLIPSE(object);
SPArc *arc = SP_ARC(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:path");
}
sp_arc_set_elliptical_path_attribute(arc, repr);
if (((SPObjectClass *) arc_parent_class)->write)
- ((SPObjectClass *) arc_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) arc_parent_class)->write(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-feblend.cpp b/src/sp-feblend.cpp
index 1c560e81bdc96c31a3b37599d31ba183f3dad624..0522a38e32965234a1bb6f7ec29b1f4009209907 100644 (file)
--- a/src/sp-feblend.cpp
+++ b/src/sp-feblend.cpp
static void sp_feBlend_release(SPObject *object);
static void sp_feBlend_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feBlend_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feBlend_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feBlend_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feBlend_build_renderer(SPFilterPrimitive *sp_prim, NR::Filter *filter);
static SPFilterPrimitiveClass *feBlend_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feBlend_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feBlend_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
// is this sane?
// repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feBlend_parent_class)->write) {
- ((SPObjectClass *) feBlend_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feBlend_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 4f4ca5f37efa0243f5826874a3968587fbc23617..181b7cd03aa6d9e54280944d94edf6c3785dabd1 100644 (file)
--- a/src/sp-fecolormatrix.cpp
+++ b/src/sp-fecolormatrix.cpp
static void sp_feColorMatrix_release(SPObject *object);
static void sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feColorMatrix_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feColorMatrix_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -194,12 +194,12 @@ sp_feColorMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feColorMatrix_parent_class)->write) {
- ((SPObjectClass *) feColorMatrix_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feColorMatrix_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 8b506a45e002e3d2ace79b6c7f73786fb0373145..91194a31a7b17d7c13f956e9d2752b84995ace74 100644 (file)
static void sp_fefuncnode_release(SPObject *object);
static void sp_fefuncnode_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_fefuncnode_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_fefuncnode_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_fefuncnode_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *feFuncNode_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_fefuncnode_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_fefuncnode_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
SPFeFuncNode *fefuncnode = SP_FEFUNCNODE(object);
if (!repr) {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
(void)fefuncnode;
sp_repr_set_css_double(repr, "elevation", fefuncnode->elevation);*/
if (((SPObjectClass *) feFuncNode_parent_class)->write) {
- ((SPObjectClass *) feFuncNode_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feFuncNode_parent_class)->write(object, doc, repr, flags);
}
return repr;
index d8ee639e44e3677008d9bbe2be534211e05b7bd2..e11f5ab3f45c7cd654cf68d21f975209324be370 100644 (file)
static void sp_feComponentTransfer_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static void sp_feComponentTransfer_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_feComponentTransfer_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
-static Inkscape::XML::Node *sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPFilterPrimitiveClass *feComponentTransfer_parent_class;
GType
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -216,12 +216,12 @@ sp_feComponentTransfer_write(SPObject *object, Inkscape::XML::Node *repr, guint
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feComponentTransfer_parent_class)->write) {
- ((SPObjectClass *) feComponentTransfer_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feComponentTransfer_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-fecomposite.cpp b/src/sp-fecomposite.cpp
index cb1726be79b3be2744a7f28da5546fad2716ce8e..11d101bd63b75b6eb8b7ba8151806b589312e676 100644 (file)
--- a/src/sp-fecomposite.cpp
+++ b/src/sp-fecomposite.cpp
static void sp_feComposite_release(SPObject *object);
static void sp_feComposite_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feComposite_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feComposite_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feComposite_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feComposite_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feComposite_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feComposite_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feComposite_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -238,12 +238,12 @@ sp_feComposite_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feComposite_parent_class)->write) {
- ((SPObjectClass *) feComposite_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feComposite_parent_class)->write(object, doc, repr, flags);
}
return repr;
index cc9073407d0f2af5874af1b7120b0c073efca314..816c793e1deb9a1dd6f4d5e7f5a408a291e9de7a 100644 (file)
static void sp_feConvolveMatrix_release(SPObject *object);
static void sp_feConvolveMatrix_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feConvolveMatrix_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feConvolveMatrix_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feConvolveMatrix_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -292,12 +292,12 @@ sp_feConvolveMatrix_write(SPObject *object, Inkscape::XML::Node *repr, guint fla
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feConvolveMatrix_parent_class)->write) {
- ((SPObjectClass *) feConvolveMatrix_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feConvolveMatrix_parent_class)->write(object, doc, repr, flags);
}
return repr;
index a44ac5894204a7c3cdd3bbe6434d970b6ea57c8c..96dee569b80c3dc716100109ad21b4f67e1c2a1c 100644 (file)
Inkscape::XML::Node *ref);
static void sp_feDiffuseLighting_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_feDiffuseLighting_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
-static Inkscape::XML::Node *sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feDiffuseLighting_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static void sp_feDiffuseLighting_children_modified(SPFeDiffuseLighting *sp_diffuselighting);
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
SPFeDiffuseLighting *fediffuselighting = SP_FEDIFFUSELIGHTING(object);
@@ -249,7 +249,7 @@ sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint fl
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
@@ -270,7 +270,7 @@ sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint fl
repr->setAttribute("lighting-color", NULL);
if (((SPObjectClass *) feDiffuseLighting_parent_class)->write) {
- ((SPObjectClass *) feDiffuseLighting_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feDiffuseLighting_parent_class)->write(object, doc, repr, flags);
}
return repr;
index b53238093f91e216c49977d733a716f90f086cd3..a30dd2f9b2dc35df1d584ae74623f08c7506d714 100644 (file)
static void sp_feDisplacementMap_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feDisplacementMap_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_feDisplacementMap_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
-static Inkscape::XML::Node *sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPFilterPrimitiveClass *feDisplacementMap_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -216,12 +216,12 @@ sp_feDisplacementMap_write(SPObject *object, Inkscape::XML::Node *repr, guint fl
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feDisplacementMap_parent_class)->write) {
- ((SPObjectClass *) feDisplacementMap_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feDisplacementMap_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 7125b50abb375fff2623c046f89eec09f0cc64fa..3ac3a50161e3e1d5fb1b6e72caa4fc8d49b5f053 100644 (file)
static void sp_fedistantlight_release(SPObject *object);
static void sp_fedistantlight_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_fedistantlight_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_fedistantlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_fedistantlight_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *feDistantLight_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_fedistantlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_fedistantlight_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
SPFeDistantLight *fedistantlight = SP_FEDISTANTLIGHT(object);
if (!repr) {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
if (fedistantlight->azimuth_set)
@@ -216,7 +216,7 @@ sp_fedistantlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags
sp_repr_set_css_double(repr, "elevation", fedistantlight->elevation);
if (((SPObjectClass *) feDistantLight_parent_class)->write) {
- ((SPObjectClass *) feDistantLight_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feDistantLight_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-feflood.cpp b/src/sp-feflood.cpp
index 685859c632f00e22abc3bda77bc2e8c761f3d7bf..75cc377344b0d809542be82878f2a207fc785e95 100644 (file)
--- a/src/sp-feflood.cpp
+++ b/src/sp-feflood.cpp
static void sp_feFlood_release(SPObject *object);
static void sp_feFlood_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feFlood_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feFlood_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feFlood_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feFlood_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feFlood_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feFlood_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feFlood_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feFlood_parent_class)->write) {
- ((SPObjectClass *) feFlood_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feFlood_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-feimage.cpp b/src/sp-feimage.cpp
index 2628d397c61e8a2c405c9aaaa8f7235d8d5c5d4b..117e9ffca51cd8084cc7269ac4f26354f2cf2a4a 100644 (file)
--- a/src/sp-feimage.cpp
+++ b/src/sp-feimage.cpp
static void sp_feImage_release(SPObject *object);
static void sp_feImage_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feImage_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feImage_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feImage_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feImage_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feImage_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feImage_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feImage_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feImage_parent_class)->write) {
- ((SPObjectClass *) feImage_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feImage_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-femerge.cpp b/src/sp-femerge.cpp
index 3cf5ea31225bf24a2a1126ed0f53dd7da9f6063a..9e45d44ab29821707d83c353aac9ef1042a6b908 100644 (file)
--- a/src/sp-femerge.cpp
+++ b/src/sp-femerge.cpp
static void sp_feMerge_release(SPObject *object);
static void sp_feMerge_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feMerge_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feMerge_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feMerge_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feMerge_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feMerge_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feMerge_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feMerge_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feMerge_parent_class)->write) {
- ((SPObjectClass *) feMerge_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feMerge_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-femergenode.cpp b/src/sp-femergenode.cpp
index b886295a848b30f3644ef3cd15a854fb084970b5..153a6198851e3f0a70c8762bbc9e03e18eeb0b6a 100644 (file)
--- a/src/sp-femergenode.cpp
+++ b/src/sp-femergenode.cpp
static void sp_feMergeNode_release(SPObject *object);
static void sp_feMergeNode_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feMergeNode_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feMergeNode_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feMergeNode_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *feMergeNode_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feMergeNode_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feMergeNode_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
//SPFeMergeNode *feMergeNode = SP_FEMERGENODE(object);
@@ -153,12 +153,12 @@ sp_feMergeNode_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feMergeNode_parent_class)->write) {
- ((SPObjectClass *) feMergeNode_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feMergeNode_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 33ab626217c552b6d18e0a668d56a172b1da6616..01290391f68b98aaeee43b2b6ab28d34a6d5fab2 100644 (file)
--- a/src/sp-femorphology.cpp
+++ b/src/sp-femorphology.cpp
static void sp_feMorphology_release(SPObject *object);
static void sp_feMorphology_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feMorphology_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feMorphology_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feMorphology_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feMorphology_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feMorphology_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feMorphology_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feMorphology_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -188,12 +188,12 @@ sp_feMorphology_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feMorphology_parent_class)->write) {
- ((SPObjectClass *) feMorphology_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feMorphology_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-feoffset.cpp b/src/sp-feoffset.cpp
index 67a8b99e2749b46cf90d56f115a4f6a4fe4f6914..228424c70297539ca24be6e671866861ae463396 100644 (file)
--- a/src/sp-feoffset.cpp
+++ b/src/sp-feoffset.cpp
static void sp_feOffset_release(SPObject *object);
static void sp_feOffset_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feOffset_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feOffset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feOffset_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feOffset_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feOffset_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feOffset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feOffset_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
// Not. Causes coredumps.
// repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feOffset_parent_class)->write) {
- ((SPObjectClass *) feOffset_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feOffset_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 211fb726b55d6d0d655c9f547a87daed58469c3d..5317b96fce21de6dfd5521d184e52ff61458a6df 100644 (file)
--- a/src/sp-fepointlight.cpp
+++ b/src/sp-fepointlight.cpp
static void sp_fepointlight_release(SPObject *object);
static void sp_fepointlight_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_fepointlight_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_fepointlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_fepointlight_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *fePointLight_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_fepointlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_fepointlight_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
SPFePointLight *fepointlight = SP_FEPOINTLIGHT(object);
if (!repr) {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
if (fepointlight->x_set)
sp_repr_set_css_double(repr, "z", fepointlight->z);
if (((SPObjectClass *) fePointLight_parent_class)->write) {
- ((SPObjectClass *) fePointLight_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) fePointLight_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 3a21d9844db187e1fa548a66a2d2cfd082c2ae27..c4e2902d6116d5f43689bdc5157421204db403b6 100644 (file)
Inkscape::XML::Node *ref);
static void sp_feSpecularLighting_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_feSpecularLighting_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
-static Inkscape::XML::Node *sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feSpecularLighting_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static void sp_feSpecularLighting_children_modified(SPFeSpecularLighting *sp_specularlighting);
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
SPFeSpecularLighting *fespecularlighting = SP_FESPECULARLIGHTING(object);
@@ -276,7 +276,7 @@ sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint f
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (fespecularlighting->surfaceScale_set)
@@ -292,7 +292,7 @@ sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint f
repr->setAttribute("lighting-color", c);
}
if (((SPObjectClass *) feSpecularLighting_parent_class)->write) {
- ((SPObjectClass *) feSpecularLighting_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feSpecularLighting_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-fespotlight.cpp b/src/sp-fespotlight.cpp
index e45b123edf84ee5ff3152f9c249d4b350acc79fa..b66912468ce8d5efa5606f7f6adc5cffa39d4e6a 100644 (file)
--- a/src/sp-fespotlight.cpp
+++ b/src/sp-fespotlight.cpp
static void sp_fespotlight_release(SPObject *object);
static void sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_fespotlight_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_fespotlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_fespotlight_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *feSpotLight_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_fespotlight_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_fespotlight_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
SPFeSpotLight *fespotlight = SP_FESPOTLIGHT(object);
if (!repr) {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
if (fespotlight->x_set)
sp_repr_set_css_double(repr, "limitingConeAngle", fespotlight->limitingConeAngle);
if (((SPObjectClass *) feSpotLight_parent_class)->write) {
- ((SPObjectClass *) feSpotLight_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feSpotLight_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-fetile.cpp b/src/sp-fetile.cpp
index 61cb68bdafb73028a661bbfa04ab9fbf64f27b58..598ccdb84bd5b98108b08366039198369c7ef102 100644 (file)
--- a/src/sp-fetile.cpp
+++ b/src/sp-fetile.cpp
static void sp_feTile_release(SPObject *object);
static void sp_feTile_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feTile_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feTile_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feTile_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feTile_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feTile_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feTile_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feTile_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feTile_parent_class)->write) {
- ((SPObjectClass *) feTile_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feTile_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 5d351884cdcfb8c3f232d4aaa457da62e7125f52..fcaf6c56f3937ad46a59857cf8ea8ca5bcdf7525 100644 (file)
--- a/src/sp-feturbulence.cpp
+++ b/src/sp-feturbulence.cpp
static void sp_feTurbulence_release(SPObject *object);
static void sp_feTurbulence_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_feTurbulence_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_feTurbulence_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_feTurbulence_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_feTurbulence_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *feTurbulence_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_feTurbulence_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_feTurbulence_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
if (flags & SP_OBJECT_WRITE_EXT) {
@@ -238,12 +238,12 @@ sp_feTurbulence_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) feTurbulence_parent_class)->write) {
- ((SPObjectClass *) feTurbulence_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) feTurbulence_parent_class)->write(object, doc, repr, flags);
}
return repr;
index 39661788e9d8ecb91da974369bebae83976de3f0..ccde93889d0c0a4b85a302d67c7bb668c58994bf 100644 (file)
static void sp_filter_primitive_release(SPObject *object);
static void sp_filter_primitive_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_filter_primitive_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_filter_primitive_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_filter_primitive_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *filter_primitive_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_filter_primitive_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_filter_primitive_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
//SPFilterPrimitive *filterPrimitive = SP_FILTER_PRIMITIVE(object);
@@ -187,13 +187,12 @@ sp_filter_primitive_write(SPObject *object, Inkscape::XML::Node *repr, guint fla
// is this sane?
//repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- /// \todo FIXME: Plumb an appropriate XML::Document into this
- repr = SP_OBJECT_REPR(object)->duplicate(NULL);
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) filter_primitive_parent_class)->write) {
- ((SPObjectClass *) filter_primitive_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) filter_primitive_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp
index b76bc553bab1edb295921f051b6f1f15a02686bb..e075087d3af3d6bd84899348e6181678e8ea90aa 100644 (file)
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
Inkscape::XML::Node *child,
Inkscape::XML::Node *ref);
static void sp_filter_remove_child(SPObject *object, Inkscape::XML::Node *child);
-static Inkscape::XML::Node *sp_filter_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void filter_ref_changed(SPObject *old_ref, SPObject *ref, SPFilter *filter);
static void filter_ref_modified(SPObject *href, guint flags, SPFilter *filter);
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_filter_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
SPFilter *filter = SP_FILTER(object);
if (!repr) {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
if ((flags & SP_OBJECT_WRITE_ALL) || filter->filterUnits_set) {
}
if (((SPObjectClass *) filter_parent_class)->write) {
- ((SPObjectClass *) filter_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) filter_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp
index 308831d28f033087703b96f90cd5ab81230921ab..6d679701fdc098836244aa32d3a4be38644d7c79 100644 (file)
--- a/src/sp-flowdiv.cpp
+++ b/src/sp-flowdiv.cpp
static void sp_flowdiv_class_init (SPFlowdivClass *klass);
static void sp_flowdiv_init (SPFlowdiv *group);
static void sp_flowdiv_release (SPObject *object);
-static Inkscape::XML::Node *sp_flowdiv_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowdiv_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_flowdiv_update (SPObject *object, SPCtx *ctx, unsigned int flags);
static void sp_flowdiv_modified (SPObject *object, guint flags);
static void sp_flowdiv_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
static void sp_flowtspan_class_init (SPFlowtspanClass *klass);
static void sp_flowtspan_init (SPFlowtspan *group);
static void sp_flowtspan_release (SPObject *object);
-static Inkscape::XML::Node *sp_flowtspan_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowtspan_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_flowtspan_update (SPObject *object, SPCtx *ctx, unsigned int flags);
static void sp_flowtspan_modified (SPObject *object, guint flags);
static void sp_flowtspan_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
static void sp_flowpara_class_init (SPFlowparaClass *klass);
static void sp_flowpara_init (SPFlowpara *group);
static void sp_flowpara_release (SPObject *object);
-static Inkscape::XML::Node *sp_flowpara_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowpara_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_flowpara_update (SPObject *object, SPCtx *ctx, unsigned int flags);
static void sp_flowpara_modified (SPObject *object, guint flags);
static void sp_flowpara_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
@@ -47,13 +47,13 @@ static void sp_flowpara_set (SPObject *object, unsigned int key, const gchar *va
static void sp_flowline_class_init (SPFlowlineClass *klass);
static void sp_flowline_release (SPObject *object);
static void sp_flowline_init (SPFlowline *group);
-static Inkscape::XML::Node *sp_flowline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowline_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_flowline_modified (SPObject *object, guint flags);
static void sp_flowregionbreak_class_init (SPFlowregionbreakClass *klass);
static void sp_flowregionbreak_release (SPObject *object);
static void sp_flowregionbreak_init (SPFlowregionbreak *group);
-static Inkscape::XML::Node *sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_flowregionbreak_modified (SPObject *object, guint flags);
static SPItemClass * flowdiv_parent_class;
}
static Inkscape::XML::Node *
-sp_flowdiv_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowdiv_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
// SPFlowdiv *group = SP_FLOWDIV (object);
if ( flags&SP_OBJECT_WRITE_BUILD ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowDiv");
GSList *l = NULL;
for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_FLOWTSPAN (child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_FLOWPARA(child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_STRING(child) ) {
c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
}
}
if (((SPObjectClass *) (flowdiv_parent_class))->write)
- ((SPObjectClass *) (flowdiv_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (flowdiv_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
(((SPObjectClass *) flowtspan_parent_class)->set) (object, key, value);
}
static Inkscape::XML::Node *
-sp_flowtspan_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowtspan_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if ( flags&SP_OBJECT_WRITE_BUILD ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowSpan");
GSList *l = NULL;
for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_FLOWTSPAN (child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_FLOWPARA (child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_STRING(child) ) {
c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
}
}
if (((SPObjectClass *) (flowtspan_parent_class))->write)
- ((SPObjectClass *) (flowtspan_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (flowtspan_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
(((SPObjectClass *) flowpara_parent_class)->set) (object, key, value);
}
static Inkscape::XML::Node *
-sp_flowpara_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowpara_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
// SPFlowpara *group = SP_FLOWPARA (object);
if ( flags&SP_OBJECT_WRITE_BUILD ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowPara");
GSList *l = NULL;
for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_FLOWTSPAN (child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_FLOWPARA (child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_STRING(child) ) {
c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
}
}
if (((SPObjectClass *) (flowpara_parent_class))->write)
- ((SPObjectClass *) (flowpara_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (flowpara_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
}
static Inkscape::XML::Node *
-sp_flowline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowline_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if ( flags&SP_OBJECT_WRITE_BUILD ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowLine");
} else {
}
if (((SPObjectClass *) (flowline_parent_class))->write)
- ((SPObjectClass *) (flowline_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (flowline_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
}
static Inkscape::XML::Node *
-sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowregionbreak_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if ( flags&SP_OBJECT_WRITE_BUILD ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowLine");
} else {
}
if (((SPObjectClass *) (flowregionbreak_parent_class))->write)
- ((SPObjectClass *) (flowregionbreak_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (flowregionbreak_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp
index b989b52fb1b4a5ed3f02d1a302371e38379b33eb..3a6cdeee3bd880a673f987880d786b1a7cbc04c7 100644 (file)
--- a/src/sp-flowregion.cpp
+++ b/src/sp-flowregion.cpp
static void sp_flowregion_remove_child (SPObject * object, Inkscape::XML::Node * child);
static void sp_flowregion_update (SPObject *object, SPCtx *ctx, guint flags);
static void sp_flowregion_modified (SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_flowregion_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowregion_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar * sp_flowregion_description (SPItem * item);
static void sp_flowregionexclude_remove_child (SPObject * object, Inkscape::XML::Node * child);
static void sp_flowregionexclude_update (SPObject *object, SPCtx *ctx, guint flags);
static void sp_flowregionexclude_modified (SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar * sp_flowregionexclude_description (SPItem * item);
}
static Inkscape::XML::Node *
-sp_flowregion_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowregion_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if (flags & SP_OBJECT_WRITE_BUILD) {
if ( repr == NULL ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:flowRegion");
}
GSList *l = NULL;
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
- Inkscape::XML::Node *crepr = child->updateRepr(NULL, flags);
+ Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
}
if (((SPObjectClass *) (flowregion_parent_class))->write)
- ((SPObjectClass *) (flowregion_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (flowregion_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
}
static Inkscape::XML::Node *
-sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if (flags & SP_OBJECT_WRITE_BUILD) {
if ( repr == NULL ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:flowRegionExclude");
}
GSList *l = NULL;
for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
- Inkscape::XML::Node *crepr = child->updateRepr(NULL, flags);
+ Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
@@ -475,7 +473,7 @@ sp_flowregionexclude_write (SPObject *object, Inkscape::XML::Node *repr, guint f
}
if (((SPObjectClass *) (flowregionexclude_parent_class))->write)
- ((SPObjectClass *) (flowregionexclude_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (flowregionexclude_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index 552adb36eb37a0fe8a00281c8bc09e6ca5d8cc53..d47d52dbefa2864a923f9a0483f05aa1edac6a20 100644 (file)
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
static void sp_flowtext_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_flowtext_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_flowtext_modified(SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_flowtext_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_flowtext_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_flowtext_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_flowtext_set(SPObject *object, unsigned key, gchar const *value);
}
static Inkscape::XML::Node *
-sp_flowtext_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_flowtext_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if ( flags & SP_OBJECT_WRITE_BUILD ) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowRoot");
GSList *l = NULL;
for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node *c_repr = NULL;
if ( SP_IS_FLOWDIV(child) || SP_IS_FLOWPARA(child) || SP_IS_FLOWREGION(child) || SP_IS_FLOWREGIONEXCLUDE(child)) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
}
if ( c_repr ) l = g_slist_prepend(l, c_repr);
}
}
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-font-face.cpp b/src/sp-font-face.cpp
index ad4d586fc2e8f3f3d6d9ab1ed527090b5efbe574..31886b718522d0252ed0f9e6ef08e3c8d46ca567 100644 (file)
--- a/src/sp-font-face.cpp
+++ b/src/sp-font-face.cpp
static void sp_fontface_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_fontface_release(SPObject *object);
static void sp_fontface_set(SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_fontface_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static void sp_fontface_remove_child(SPObject *object, Inkscape::XML::Node *child);
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
-static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPFontFace *face = SP_FONTFACE(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:font-face");
}
@@ -528,7 +527,7 @@ static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::N
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-font.cpp b/src/sp-font.cpp
index 528aabaab18f7d2853c06357642f5032018abc5e..fe6bf282ae8e918ae7a7186a2890783df7edc726 100644 (file)
--- a/src/sp-font.cpp
+++ b/src/sp-font.cpp
static void sp_font_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_font_release(SPObject *object);
static void sp_font_set(SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_font_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_font_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_font_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static void sp_font_remove_child(SPObject *object, Inkscape::XML::Node *child);
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
-static Inkscape::XML::Node *sp_font_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_font_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPFont *font = SP_FONT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:font");
}
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
index 4d1c37880a7bf3bc27d1c767efe99bbc6ed0d8f3..94efc5727d447e0709390e31e8dcb7cfb1b906ea 100644 (file)
--- a/src/sp-gaussian-blur.cpp
+++ b/src/sp-gaussian-blur.cpp
static void sp_gaussianBlur_release(SPObject *object);
static void sp_gaussianBlur_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_gaussianBlur_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_gaussianBlur_build_renderer(SPFilterPrimitive *primitive, NR::Filter *filter);
static SPFilterPrimitiveClass *gaussianBlur_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
// Inkscape-only object, not copied during an "plain SVG" dump:
@@ -164,12 +164,12 @@ sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
// is this sane?
// repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc); // FIXME
}
}
if (((SPObjectClass *) gaussianBlur_parent_class)->write) {
- ((SPObjectClass *) gaussianBlur_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) gaussianBlur_parent_class)->write(object, doc, repr, flags);
}
return repr;
index b8a2bb1edd0e1db17dc768b6e4cb3911c71ad564..173747af3a7ecf1d132e04e39b61e8f13bbffc63 100644 (file)
--- a/src/sp-glyph-kerning.cpp
+++ b/src/sp-glyph-kerning.cpp
static void sp_glyph_kerning_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_glyph_kerning_release(SPObject *object);
static void sp_glyph_kerning_set(SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_glyph_kerning_update(SPObject *object, SPCtx *ctx, guint flags);
static SPObjectClass *parent_class;
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
-static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
// SPGlyphKerning *glyph = SP_GLYPH_KERNING(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:glyphkerning");//fix this!
}
@@ -226,7 +225,7 @@ static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::X
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-glyph.cpp b/src/sp-glyph.cpp
index 4860b42ed2a804026bde95b62c30a23aa63488b9..719d1d25b552a9e281f5e64dc0e159cb7e9f4bb3 100644 (file)
--- a/src/sp-glyph.cpp
+++ b/src/sp-glyph.cpp
static void sp_glyph_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_glyph_release(SPObject *object);
static void sp_glyph_set(SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_glyph_update(SPObject *object, SPCtx *ctx, guint flags);
static SPObjectClass *parent_class;
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
-static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
// SPGlyph *glyph = SP_GLYPH(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:glyph");
}
@@ -292,7 +291,7 @@ static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Node
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index b9ed10cbc00f9a03de9e270df0e5e103fd690a3c..82724303fcf03e12769f933342ad20239a169dfc 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
static void sp_stop_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_stop_set(SPObject *object, unsigned key, gchar const *value);
-static Inkscape::XML::Node *sp_stop_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_stop_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *stop_parent_class;
* Virtual write: write object attributes to repr.
*/
static Inkscape::XML::Node *
-sp_stop_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_stop_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPStop *stop = SP_STOP(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:stop");
}
gfloat opacity = stop->opacity;
if (((SPObjectClass *) stop_parent_class)->write)
- (* ((SPObjectClass *) stop_parent_class)->write)(object, repr, flags);
+ (* ((SPObjectClass *) stop_parent_class)->write)(object, xml_doc, repr, flags);
// Since we do a hackish style setting here (because SPStyle does not support stop-color and
// stop-opacity), we must do it AFTER calling the parent write method; otherwise
Inkscape::XML::Node *ref);
static void sp_gradient_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_gradient_modified(SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_gradient_write(SPObject *object, Inkscape::XML::Node *repr,
+static Inkscape::XML::Node *sp_gradient_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr,
guint flags);
static void gradient_ref_modified(SPObject *href, guint flags, SPGradient *gradient);
* Write gradient attributes to repr.
*/
static Inkscape::XML::Node *
-sp_gradient_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_gradient_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPGradient *gr = SP_GRADIENT(object);
if (((SPObjectClass *) gradient_parent_class)->write)
- (* ((SPObjectClass *) gradient_parent_class)->write)(object, repr, flags);
+ (* ((SPObjectClass *) gradient_parent_class)->write)(object, xml_doc, repr, flags);
if (flags & SP_OBJECT_WRITE_BUILD) {
GSList *l = NULL;
for (SPObject *child = sp_object_first_child(object); child; child = SP_OBJECT_NEXT(child)) {
Inkscape::XML::Node *crepr;
- crepr = child->updateRepr(NULL, flags);
+ crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
while (l) {
SPDocument *document,
Inkscape::XML::Node *repr);
static void sp_lineargradient_set(SPObject *object, unsigned key, gchar const *value);
-static Inkscape::XML::Node *sp_lineargradient_write(SPObject *object, Inkscape::XML::Node *repr,
+static Inkscape::XML::Node *sp_lineargradient_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr,
guint flags);
static SPPainter *sp_lineargradient_painter_new(SPPaintServer *ps,
* Callback: write attributes to associated repr.
*/
static Inkscape::XML::Node *
-sp_lineargradient_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_lineargradient_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPLinearGradient *lg = SP_LINEARGRADIENT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:linearGradient");
}
@@ -1448,7 +1446,7 @@ sp_lineargradient_write(SPObject *object, Inkscape::XML::Node *repr, guint flags
sp_repr_set_svg_double(repr, "y2", lg->y2.computed);
if (((SPObjectClass *) lg_parent_class)->write)
- (* ((SPObjectClass *) lg_parent_class)->write)(object, repr, flags);
+ (* ((SPObjectClass *) lg_parent_class)->write)(object, xml_doc, repr, flags);
return repr;
}
SPDocument *document,
Inkscape::XML::Node *repr);
static void sp_radialgradient_set(SPObject *object, unsigned key, gchar const *value);
-static Inkscape::XML::Node *sp_radialgradient_write(SPObject *object, Inkscape::XML::Node *repr,
+static Inkscape::XML::Node *sp_radialgradient_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr,
guint flags);
static SPPainter *sp_radialgradient_painter_new(SPPaintServer *ps,
* Write radial gradient attributes to associated repr.
*/
static Inkscape::XML::Node *
-sp_radialgradient_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_radialgradient_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPRadialGradient *rg = SP_RADIALGRADIENT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:radialGradient");
}
@@ -1744,7 +1741,7 @@ sp_radialgradient_write(SPObject *object, Inkscape::XML::Node *repr, guint flags
if ((flags & SP_OBJECT_WRITE_ALL) || rg->fy._set) sp_repr_set_svg_double(repr, "fy", rg->fy.computed);
if (((SPObjectClass *) rg_parent_class)->write)
- (* ((SPObjectClass *) rg_parent_class)->write)(object, repr, flags);
+ (* ((SPObjectClass *) rg_parent_class)->write)(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 7a1d3534d2863207be4891111b1f819e1a2aa622..44479de128c394b38d1f56370eeae05f09302494 100644 (file)
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
static void sp_image_release (SPObject * object);
static void sp_image_set (SPObject *object, unsigned int key, const gchar *value);
static void sp_image_update (SPObject *object, SPCtx *ctx, unsigned int flags);
-static Inkscape::XML::Node *sp_image_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_image_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_image_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
static void sp_image_print (SPItem * item, SPPrintContext *ctx);
}
static Inkscape::XML::Node *
-sp_image_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_image_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPImage *image;
image = SP_IMAGE (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:image");
}
#endif // ENABLE_LCMS
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 109b55eb76331c426f7e8dd8d2ab2a41bc20f8e3..556a349ed836a40557d4ecd78790222cada043d9 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
static void sp_group_order_changed (SPObject * object, Inkscape::XML::Node * child, Inkscape::XML::Node * old_ref, Inkscape::XML::Node * new_ref);
static void sp_group_update (SPObject *object, SPCtx *ctx, guint flags);
static void sp_group_modified (SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_group_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_group_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_group_set(SPObject *object, unsigned key, char const *value);
static void sp_group_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
}
static Inkscape::XML::Node *
-sp_group_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_group_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPGroup *group;
SPObject *child;
if (flags & SP_OBJECT_WRITE_BUILD) {
GSList *l;
if (!repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:g");
}
l = NULL;
for (child = sp_object_first_child(object); child != NULL; child = SP_OBJECT_NEXT(child) ) {
- crepr = child->updateRepr(NULL, flags);
+ crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend (l, crepr);
}
while (l) {
}
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 566ff8cb887645fcdccb8054f40b3927e283fea2..0784d404c39745243c71be65fd5e4f90c95c7014 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
static void sp_item_release(SPObject *object);
static void sp_item_set(SPObject *object, unsigned key, gchar const *value);
static void sp_item_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_item_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_item_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar *sp_item_private_description(SPItem *item);
static void sp_item_private_snappoints(SPItem const *item, SnapPointsIter p);
}
static Inkscape::XML::Node *
-sp_item_write(SPObject *const object, Inkscape::XML::Node *repr, guint flags)
+sp_item_write(SPObject *const object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPItem *item = SP_ITEM(object);
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-line.cpp b/src/sp-line.cpp
index 5fed6a62ea1aff7e5c019ae675a5c40f7a4583c4..1f5c1b181da6356b8277de3c1ea87ac2f60e4297 100644 (file)
--- a/src/sp-line.cpp
+++ b/src/sp-line.cpp
static void sp_line_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr);
static void sp_line_set (SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_line_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_line_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar *sp_line_description (SPItem * item);
static NR::Matrix sp_line_set_transform(SPItem *item, NR::Matrix const &xform);
static Inkscape::XML::Node *
-sp_line_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_line_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPLine *line = SP_LINE (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:line");
}
sp_repr_set_svg_double(repr, "y2", line->y2.computed);
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 7a18c10b5928538e2dba1378b83072c0ae7744bc..3bf5a28ee755ff88ec077be3d8d9c5ba8d46e1bc 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
static void sp_lpe_item_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_lpe_item_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_lpe_item_modified (SPObject *object, unsigned int flags);
-static Inkscape::XML::Node *sp_lpe_item_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_lpe_item_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags);
static void sp_lpe_item_child_added (SPObject * object, Inkscape::XML::Node * child, Inkscape::XML::Node * ref);
static void sp_lpe_item_remove_child (SPObject * object, Inkscape::XML::Node * child);
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_lpe_item_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_lpe_item_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPLPEItem *lpeitem = (SPLPEItem *) object;
}
if (((SPObjectClass *)(parent_class))->write) {
- ((SPObjectClass *)(parent_class))->write(object, repr, flags);
+ ((SPObjectClass *)(parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-mask.cpp b/src/sp-mask.cpp
index 4bdf1d40ea17caba2fb2fc615e27ab6c92aea6f9..c6febeb40280c9204a5d6d48b969e48be68b5958 100644 (file)
--- a/src/sp-mask.cpp
+++ b/src/sp-mask.cpp
static void sp_mask_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static void sp_mask_update (SPObject *object, SPCtx *ctx, guint flags);
static void sp_mask_modified (SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_mask_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_mask_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
SPMaskView *sp_mask_view_new_prepend (SPMaskView *list, unsigned int key, NRArenaItem *arenaitem);
SPMaskView *sp_mask_view_list_remove (SPMaskView *list, SPMaskView *view);
}
static Inkscape::XML::Node *
-sp_mask_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_mask_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:mask");
}
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-metadata.cpp b/src/sp-metadata.cpp
index 9fb67feb41048b395c356da9f46e967b05a4b314..920b7d64dbb5458a1ef4d8f731c6748d3175bd07 100644 (file)
--- a/src/sp-metadata.cpp
+++ b/src/sp-metadata.cpp
static void sp_metadata_release (SPObject *object);
static void sp_metadata_set (SPObject *object, unsigned int key, const gchar *value);
static void sp_metadata_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_metadata_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_metadata_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *metadata_parent_class;
* \brief Writes it's settings to an incoming repr object, if any
*/
static Inkscape::XML::Node *
-sp_metadata_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_metadata_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
debug("0x%08x",(unsigned int)object);
//SPMetadata *metadata = SP_METADATA(object);
if (repr) {
repr->mergeFrom(SP_OBJECT_REPR (object), "id");
} else {
- repr = SP_OBJECT_REPR (object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR (object)->duplicate(doc);
}
}
if (((SPObjectClass *) metadata_parent_class)->write)
- ((SPObjectClass *) metadata_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) metadata_parent_class)->write(object, doc, repr, flags);
return repr;
}
index 7cd75b3b810292b3d4719c3659d7adf81b1b615c..23a8a08a17cafc2f30ca262a6fcf19deaea1b79d 100644 (file)
--- a/src/sp-missing-glyph.cpp
+++ b/src/sp-missing-glyph.cpp
static void sp_missing_glyph_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_missing_glyph_release(SPObject *object);
static void sp_missing_glyph_set(SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_missing_glyph_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_missing_glyph_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *parent_class;
#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key));
-static Inkscape::XML::Node *sp_missing_glyph_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_missing_glyph_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
// SPMissingGlyph *glyph = SP_MISSING_GLYPH(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:glyph");
}
@@ -175,7 +174,7 @@ static Inkscape::XML::Node *sp_missing_glyph_write(SPObject *object, Inkscape::X
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 9851e146af4b119c9d1d1cc69479f5c29d76849c..54e84927a768c73995bdbc3529042aa6e91d6314 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *value);
static void sp_namedview_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static void sp_namedview_remove_child(SPObject *object, Inkscape::XML::Node *child);
-static Inkscape::XML::Node *sp_namedview_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_namedview_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_namedview_setup_guides(SPNamedView * nv);
@@ -687,7 +687,7 @@ static void sp_namedview_remove_child(SPObject *object, Inkscape::XML::Node *chi
}
}
-static Inkscape::XML::Node *sp_namedview_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_namedview_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
if ( ( flags & SP_OBJECT_WRITE_EXT ) &&
repr != SP_OBJECT_REPR(object) )
@@ -695,8 +695,7 @@ static Inkscape::XML::Node *sp_namedview_write(SPObject *object, Inkscape::XML::
if (repr) {
repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- /// \todo FIXME: Plumb an appropriate XML::Document into this
- repr = SP_OBJECT_REPR(object)->duplicate(NULL);
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
index 888fe2d8ed8d4a8f050dbc17c021e410289ac93d..1d5c0433974a67fdccfd647864aa3886e2920e07 100644 (file)
--- a/src/sp-object-group.cpp
+++ b/src/sp-object-group.cpp
static void sp_objectgroup_child_added (SPObject * object, Inkscape::XML::Node * child, Inkscape::XML::Node * ref);
static void sp_objectgroup_remove_child (SPObject * object, Inkscape::XML::Node * child);
static void sp_objectgroup_order_changed (SPObject * object, Inkscape::XML::Node * child, Inkscape::XML::Node * old_ref, Inkscape::XML::Node * new_ref);
-static Inkscape::XML::Node *sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_objectgroup_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *parent_class;
}
static Inkscape::XML::Node *
-sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_objectgroup_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPObjectGroup *group;
SPObject *child;
@@ -109,12 +109,11 @@ sp_objectgroup_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
if (flags & SP_OBJECT_WRITE_BUILD) {
GSList *l;
if (!repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:g");
}
l = NULL;
for ( child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
- crepr = child->updateRepr(NULL, flags);
+ crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend (l, crepr);
}
while (l) {
}
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index d260792608a50e288064ab8f1a136baa04de8dbc..d7cdd5b92ada2e60073726584f60dee35a3080e7 100644 (file)
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
static void sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_object_private_set(SPObject *object, unsigned int key, gchar const *value);
-static Inkscape::XML::Node *sp_object_private_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_object_private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
/* Real handlers of repr signals */
@@ -1076,7 +1076,7 @@ sp_object_repr_attr_changed(Inkscape::XML::Node *repr, gchar const *key, gchar c
// manual changes to extension attributes require the normal
// attributes, which depend on them, to be updated immediately
if (is_interactive) {
- object->updateRepr(repr, 0);
+ object->updateRepr(0);
}
}
* Callback for write event.
*/
static Inkscape::XML::Node *
-sp_object_private_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_object_private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
if (!repr && (flags & SP_OBJECT_WRITE_BUILD)) {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
if (!( flags & SP_OBJECT_WRITE_EXT )) {
repr->setAttribute("inkscape:collect", NULL);
}
if (!SP_OBJECT_IS_CLONED(this)) {
Inkscape::XML::Node *repr=SP_OBJECT_REPR(this);
if (repr) {
- return updateRepr(repr, flags);
+ return updateRepr(repr->document(), repr, flags);
} else {
g_critical("Attempt to update non-existent repr");
return NULL;
* saving as "Plain SVG"
*/
Inkscape::XML::Node *
-SPObject::updateRepr(Inkscape::XML::Node *repr, unsigned int flags) {
+SPObject::updateRepr(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags) {
+ g_assert(doc != NULL);
+
if (SP_OBJECT_IS_CLONED(this)) {
/* cloned objects have no repr */
return NULL;
if (!(flags & SP_OBJECT_WRITE_BUILD) && !repr) {
repr = SP_OBJECT_REPR(this);
}
- return ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->write(this, repr, flags);
+ return ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->write(this, doc, repr, flags);
} else {
g_warning("Class %s does not implement ::write", G_OBJECT_TYPE_NAME(this));
if (!repr) {
if (flags & SP_OBJECT_WRITE_BUILD) {
- /// \todo FIXME: Plumb an appropriate XML::Document into this
- repr = SP_OBJECT_REPR(this)->duplicate(NULL);
+ repr = SP_OBJECT_REPR(this)->duplicate(doc);
}
/// \todo FIXME: else probably error (Lauris) */
} else {
diff --git a/src/sp-object.h b/src/sp-object.h
index 5d22e33e4290c41dbb38256c9121d1616c024ced..ccc063d5f1d688ab323bc609aa8b36867861881a 100644 (file)
--- a/src/sp-object.h
+++ b/src/sp-object.h
namespace Inkscape {
namespace XML {
class Node;
+class Document;
}
}
/** @brief Updates the object's repr based on the object's state.
*
* This method updates the the repr attached to the object to reflect the object's current
- * state; see the two-argument version for details.
+ * state; see the three-argument version for details.
*
* @param flags object write flags that apply to this update
*
*
* @return the updated repr
*/
- Inkscape::XML::Node *updateRepr(Inkscape::XML::Node *repr, unsigned int flags);
+ Inkscape::XML::Node *updateRepr(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags);
/** @brief Queues an deferred update of this object's display.
*
/* Modification handler */
void (* modified) (SPObject *object, unsigned int flags);
- Inkscape::XML::Node * (* write) (SPObject *object, Inkscape::XML::Node *repr, unsigned int flags);
+ Inkscape::XML::Node * (* write) (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags);
};
diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index f3c5cfada5988841997575d936d56327c678c9f9..d3711a9f6d01e26d60c1d7de3643e3a8a4e9df47 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
static void sp_offset_build (SPObject * object, SPDocument * document,
Inkscape::XML::Node * repr);
-static Inkscape::XML::Node *sp_offset_write (SPObject * object, Inkscape::XML::Node * repr,
+static Inkscape::XML::Node *sp_offset_write (SPObject * object, Inkscape::XML::Document *doc, Inkscape::XML::Node * repr,
guint flags);
static void sp_offset_set (SPObject * object, unsigned int key,
const gchar * value);
@@ -259,12 +259,11 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
* Virtual write: write offset attributes to corresponding repr.
*/
static Inkscape::XML::Node *
-sp_offset_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_offset_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPOffset *offset = SP_OFFSET (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = SP_OBJECT_REPR(object)->document();
repr = xml_doc->createElement("svg:path");
}
g_free (d);
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr,
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr,
flags | SP_SHAPE_WRITE_PATH);
return repr;
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index e16147b120ad0ef3d304564fbd7d251aaece2ba9..173e44440288135c1e1efd2409a83fe913cf8c7d 100644 (file)
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
static void sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_path_set(SPObject *object, unsigned key, gchar const *value);
-static Inkscape::XML::Node *sp_path_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_path_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static NR::Matrix sp_path_set_transform(SPItem *item, NR::Matrix const &xform);
static gchar * sp_path_description(SPItem *item);
static void sp_path_convert_to_guides(SPItem *item);
* Writes the path object into a Inkscape::XML::Node
*/
static Inkscape::XML::Node *
-sp_path_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_path_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPShape *shape = (SPShape *) object;
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:path");
}
SP_PATH(shape)->connEndPair.writeRepr(repr);
if (((SPObjectClass *)(parent_class))->write) {
- ((SPObjectClass *)(parent_class))->write(object, repr, flags);
+ ((SPObjectClass *)(parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp
index d90f829b943e292c53a8c1ae636fc5ac73197bf6..9b9c91c5544828ab5019ee773d9c65cbc689cd06 100644 (file)
--- a/src/sp-polygon.cpp
+++ b/src/sp-polygon.cpp
static void sp_polygon_init(SPPolygon *polygon);
static void sp_polygon_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
-static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar *sp_polygon_description(SPItem *item);
return g_strdup(os.str().c_str());
}
-static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPShape *shape = SP_SHAPE(object);
// Tolerable workaround: we need to update the object's curve before we set points=
@@ -122,7 +122,6 @@ static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::No
sp_shape_set_shape(shape);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:polygon");
}
@@ -133,7 +132,7 @@ static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::No
g_free(str);
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp
index 4a39afd1be3fa4ccbdb37702e90511206573e995..08f446d6124a5685c228de1c09e218ba46f2e33b 100644 (file)
--- a/src/sp-polyline.cpp
+++ b/src/sp-polyline.cpp
static void sp_polyline_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr);
static void sp_polyline_set (SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_polyline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_polyline_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar * sp_polyline_description (SPItem * item);
}
static Inkscape::XML::Node *
-sp_polyline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_polyline_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPPolyLine *polyline;
polyline = SP_POLYLINE (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:polyline");
}
}
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index b02f52f1e311514739fee4bc42bcffbd07bd7ca9..072c52199701d8b8e41c9a61a92015501cf0e170 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
static void sp_rect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_rect_set(SPObject *object, unsigned key, gchar const *value);
static void sp_rect_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_rect_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_rect_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static gchar *sp_rect_description(SPItem *item);
static NR::Matrix sp_rect_set_transform(SPItem *item, NR::Matrix const &xform);
}
static Inkscape::XML::Node *
-sp_rect_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_rect_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPRect *rect = SP_RECT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:rect");
}
sp_repr_set_svg_double(repr, "y", rect->y.computed);
if (((SPObjectClass *) parent_class)->write)
- ((SPObjectClass *) parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) parent_class)->write(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index c3fdeb24bb4bd4792a1464bd33527f49e8456728..94b561bcce3c3433a09c443afa01e01035c1aa49 100644 (file)
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
static void sp_root_remove_child(SPObject *object, Inkscape::XML::Node *child);
static void sp_root_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_root_modified(SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_root_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_root_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static NRArenaItem *sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
static void sp_root_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
* Writes the object into the repr object, then calls the parent's write routine.
*/
static Inkscape::XML::Node *
-sp_root_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_root_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPRoot *root = SP_ROOT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:svg");
}
}
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index 99e4ed485940b0cca5bf586ca3f388e2efaf8d2c..2ed92c5f51d36f44dad23f3edebae150609868e7 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
static void sp_shape_set(SPObject *object, unsigned key, gchar const *value);
static void sp_shape_update (SPObject *object, SPCtx *ctx, unsigned int flags);
static void sp_shape_modified (SPObject *object, unsigned int flags);
-static Inkscape::XML::Node *sp_shape_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_shape_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_shape_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
void sp_shape_print (SPItem * item, SPPrintContext * ctx);
}
static Inkscape::XML::Node *
-sp_shape_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_shape_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
if (((SPObjectClass *)(parent_class))->write) {
- ((SPObjectClass *)(parent_class))->write(object, repr, flags);
+ ((SPObjectClass *)(parent_class))->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-skeleton.cpp b/src/sp-skeleton.cpp
index ee0c9626b9623695732aea3987f84ce584e0730c..ec6c9b437534b6b30bdb96f57200f613eb270b36 100644 (file)
--- a/src/sp-skeleton.cpp
+++ b/src/sp-skeleton.cpp
static void sp_skeleton_release(SPObject *object);
static void sp_skeleton_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_skeleton_update(SPObject *object, SPCtx *ctx, guint flags);
-static Inkscape::XML::Node *sp_skeleton_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_skeleton_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *skeleton_parent_class;
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_skeleton_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_skeleton_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
debug("0x%p",object);
//SPSkeleton *skeleton = SP_SKELETON(object);
// is this sane?
repr->mergeFrom(SP_OBJECT_REPR(object), "id");
} else {
- repr = SP_OBJECT_REPR(object)->duplicate(NULL); // FIXME
+ repr = SP_OBJECT_REPR(object)->duplicate(doc);
}
}
if (((SPObjectClass *) skeleton_parent_class)->write) {
- ((SPObjectClass *) skeleton_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) skeleton_parent_class)->write(object, doc, repr, flags);
}
return repr;
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index 1d4723641f3893f2755b8e028e5707827497bddc..3a37a8da278805f91880d93e5d48805f007fdf41 100644 (file)
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
static void sp_spiral_init (SPSpiral *spiral);
static void sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr);
-static Inkscape::XML::Node *sp_spiral_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_spiral_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_spiral_set (SPObject *object, unsigned int key, const gchar *value);
static void sp_spiral_update (SPObject *object, SPCtx *ctx, guint flags);
@@ -141,12 +141,11 @@ sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node *
* Virtual write: write spiral attributes to corresponding repr.
*/
static Inkscape::XML::Node *
-sp_spiral_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_spiral_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPSpiral *spiral = SP_SPIRAL (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:path");
}
g_free (d);
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags | SP_SHAPE_WRITE_PATH);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags | SP_SHAPE_WRITE_PATH);
return repr;
}
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index cf6f1140395a465d243eea7af1e585893a0a9061..96bc9180a9f9ff197411ee0b3f939470ae48ea97 100644 (file)
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
static void sp_star_init (SPStar *star);
static void sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr);
-static Inkscape::XML::Node *sp_star_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_star_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_star_set (SPObject *object, unsigned int key, const gchar *value);
static void sp_star_update (SPObject *object, SPCtx *ctx, guint flags);
@@ -129,12 +129,11 @@ sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * r
}
static Inkscape::XML::Node *
-sp_star_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_star_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPStar *star = SP_STAR (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:path");
}
g_free (d);
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp
index fa756242cab2dc53ba362d438b608dcd509241c0..46c311920708dd6cebf0c3cbd87854efc3675c3b 100644 (file)
--- a/src/sp-style-elem.cpp
+++ b/src/sp-style-elem.cpp
static void sp_style_elem_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
static void sp_style_elem_set(SPObject *object, unsigned const key, gchar const *const value);
static void sp_style_elem_read_content(SPObject *);
-static Inkscape::XML::Node *sp_style_elem_write(SPObject *, Inkscape::XML::Node *, guint flags);
+static Inkscape::XML::Node *sp_style_elem_write(SPObject *, Inkscape::XML::Document *, Inkscape::XML::Node *, guint flags);
static SPObjectClass *parent_class;
}
static Inkscape::XML::Node *
-sp_style_elem_write(SPObject *const object, Inkscape::XML::Node *repr, guint const flags)
+sp_style_elem_write(SPObject *const object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint const flags)
{
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:style");
}
@@ -140,7 +139,7 @@ sp_style_elem_write(SPObject *const object, Inkscape::XML::Node *repr, guint con
/* todo: media */
if (((SPObjectClass *) parent_class)->write)
- ((SPObjectClass *) parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) parent_class)->write(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-symbol.cpp b/src/sp-symbol.cpp
index 943257c8bbc4cad39efa298bae9c281c98cf2d48..7420f660eddc0c2694e297f70f47d1353cd2ef4d 100644 (file)
--- a/src/sp-symbol.cpp
+++ b/src/sp-symbol.cpp
static void sp_symbol_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static void sp_symbol_update (SPObject *object, SPCtx *ctx, guint flags);
static void sp_symbol_modified (SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_symbol_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_symbol_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static NRArenaItem *sp_symbol_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
static void sp_symbol_hide (SPItem *item, unsigned int key);
}
static Inkscape::XML::Node *
-sp_symbol_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_symbol_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPSymbol *symbol;
symbol = SP_SYMBOL (object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:symbol");
}
repr->setAttribute("preserveAspectRatio", object->repr->attribute("preserveAspectRatio"));
if (((SPObjectClass *) (parent_class))->write)
- ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index 810df25307da1ddc6ba06cb249e62ab7cee6baa6..ceb8dc5a5639dec86a57cd233217b7daabb7e817 100644 (file)
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
static void sp_text_remove_child (SPObject *object, Inkscape::XML::Node *rch);
static void sp_text_update (SPObject *object, SPCtx *ctx, guint flags);
static void sp_text_modified (SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_text_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_text_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_text_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
static NRArenaItem *sp_text_show (SPItem *item, NRArena *arena, unsigned key, unsigned flags);
}
static Inkscape::XML::Node *
-sp_text_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_text_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPText *text = SP_TEXT (object);
if (flags & SP_OBJECT_WRITE_BUILD) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
if (!repr)
repr = xml_doc->createElement("svg:text");
GSList *l = NULL;
if (SP_IS_STRING(child)) {
crepr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
} else {
- crepr = child->updateRepr(NULL, flags);
+ crepr = child->updateRepr(xml_doc, NULL, flags);
}
if (crepr) l = g_slist_prepend (l, crepr);
}
SP_OBJECT_REPR(text)->setAttribute("sodipodi:linespacing", NULL);
if (((SPObjectClass *) (text_parent_class))->write)
- ((SPObjectClass *) (text_parent_class))->write (object, repr, flags);
+ ((SPObjectClass *) (text_parent_class))->write (object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp
index 0c6da351812f0c30659c40e37264d7cf3c4c56bd..ad85b4d85d3419103dd947272558ae93ff46c93d 100644 (file)
--- a/src/sp-tref.cpp
+++ b/src/sp-tref.cpp
static void sp_tref_set(SPObject *object, unsigned int key, gchar const *value);
static void sp_tref_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_tref_modified(SPObject *object, guint flags);
-static Inkscape::XML::Node *sp_tref_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_tref_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_tref_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
static gchar *sp_tref_description(SPItem *item);
* Writes its settings to an incoming repr object, if any.
*/
static Inkscape::XML::Node *
-sp_tref_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_tref_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
debug("0x%p",object);
SPTRef *tref = SP_TREF(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:tref");
}
}
if (((SPObjectClass *) tref_parent_class)->write) {
- ((SPObjectClass *) tref_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) tref_parent_class)->write(object, xml_doc, repr, flags);
}
return repr;
diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp
index 7d56e177b93da20e91596e8afdd99a50da5f4135..c86c852d7eb14d3316e1b72774dc4595e6f87192 100644 (file)
--- a/src/sp-tspan.cpp
+++ b/src/sp-tspan.cpp
static void sp_tspan_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_tspan_modified(SPObject *object, unsigned flags);
static void sp_tspan_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
-static Inkscape::XML::Node *sp_tspan_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_tspan_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static char *sp_tspan_description (SPItem *item);
static SPItemClass *tspan_parent_class;
@@ -230,11 +230,10 @@ static void sp_tspan_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &tr
}
static Inkscape::XML::Node *
-sp_tspan_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_tspan_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPTSpan *tspan = SP_TSPAN(object);
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
-
+
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
repr = xml_doc->createElement("svg:tspan");
}
for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_TEXTPATH(child) ) {
- //c_repr = child->updateRepr(NULL, flags); // shouldn't happen
+ //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen
} else if ( SP_IS_STRING(child) ) {
c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
}
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
child->updateRepr(flags);
} else if ( SP_IS_TEXTPATH(child) ) {
- //c_repr = child->updateRepr(NULL, flags); // shouldn't happen
+ //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen
} else if ( SP_IS_STRING(child) ) {
SP_OBJECT_REPR(child)->setContent(SP_STRING(child)->string.c_str());
}
}
if (((SPObjectClass *) tspan_parent_class)->write)
- ((SPObjectClass *) tspan_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) tspan_parent_class)->write(object, xml_doc, repr, flags);
return repr;
}
static void sp_textpath_set(SPObject *object, unsigned key, gchar const *value);
static void sp_textpath_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_textpath_modified(SPObject *object, unsigned flags);
-static Inkscape::XML::Node *sp_textpath_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_textpath_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static SPItemClass *textpath_parent_class;
}
}
static Inkscape::XML::Node *
-sp_textpath_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_textpath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPTextPath *textpath = SP_TEXTPATH(object);
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
-
+
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
repr = xml_doc->createElement("svg:textPath");
}
for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
- c_repr = child->updateRepr(NULL, flags);
+ c_repr = child->updateRepr(xml_doc, NULL, flags);
} else if ( SP_IS_TEXTPATH(child) ) {
- //c_repr = child->updateRepr(NULL, flags); // shouldn't happen
+ //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen
} else if ( SP_IS_STRING(child) ) {
c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
}
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
child->updateRepr(flags);
} else if ( SP_IS_TEXTPATH(child) ) {
- //c_repr = child->updateRepr(NULL, flags); // shouldn't happen
+ //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen
} else if ( SP_IS_STRING(child) ) {
SP_OBJECT_REPR(child)->setContent(SP_STRING(child)->string.c_str());
}
}
if (((SPObjectClass *) textpath_parent_class)->write)
- ((SPObjectClass *) textpath_parent_class)->write(object, repr, flags);
+ ((SPObjectClass *) textpath_parent_class)->write(object, xml_doc, repr, flags);
return repr;
}
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index ec37ef3913d6519a454cec3011a8bd143b769485..2af7e1394569c5d34cba2eaf686e016f52b9ad9c 100644 (file)
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
static void sp_use_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static void sp_use_release(SPObject *object);
static void sp_use_set(SPObject *object, unsigned key, gchar const *value);
-static Inkscape::XML::Node *sp_use_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_use_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
static void sp_use_update(SPObject *object, SPCtx *ctx, guint flags);
static void sp_use_modified(SPObject *object, guint flags);
}
static Inkscape::XML::Node *
-sp_use_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_use_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
SPUse *use = SP_USE(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
repr = xml_doc->createElement("svg:use");
}
if (((SPObjectClass *) (parent_class))->write) {
- ((SPObjectClass *) (parent_class))->write(object, repr, flags);
+ ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags);
}
sp_repr_set_svg_double(repr, "x", use->x.computed);
diff --git a/src/text-editing.cpp b/src/text-editing.cpp
index 4b115f3747cb65e9bf8ced25628d53d8409be2e7..a225c1a00e205b3ce8bb07667e685dd77fa3fbf9 100644 (file)
--- a/src/text-editing.cpp
+++ b/src/text-editing.cpp
@@ -398,7 +398,7 @@ Inkscape::Text::Layout::iterator sp_te_insert_line (SPItem *item, Inkscape::Text
// TODO
// I think the only case to put here is arbitrary gaps, which nobody uses yet
}
- item->updateRepr(SP_OBJECT_REPR(item),SP_OBJECT_WRITE_EXT);
+ item->updateRepr();
unsigned char_index = layout->iteratorToCharIndex(position);
te_update_layout_now(item);
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
@@ -520,7 +520,7 @@ sp_te_insert(SPItem *item, Inkscape::Text::Layout::iterator const &position, gch
}
}
- item->updateRepr(SP_OBJECT_REPR(item),SP_OBJECT_WRITE_EXT);
+ item->updateRepr();
unsigned char_index = layout->iteratorToCharIndex(position);
te_update_layout_now(item);
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
index 76ca4e02e0a6879f9733742c2eeb6e7b0e403b97..ee65e73abbebdfd485b6a127084c929a60b6bbb8 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -1680,7 +1680,7 @@ static void sp_stb_magnitude_value_changed( GtkAdjustment *adj, GObject *dataKlu
sp_repr_set_svg_double(repr, "sodipodi:arg2",
(sp_repr_get_double_attribute(repr, "sodipodi:arg1", 0.5)
+ M_PI / (gint)adj->value));
- SP_OBJECT((SPItem *) items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT((SPItem *) items->data)->updateRepr();
modmade = true;
}
}
@@ -1721,7 +1721,7 @@ static void sp_stb_proportion_value_changed( GtkAdjustment *adj, GObject *dataKl
sp_repr_set_svg_double(repr, "sodipodi:r1", r2*adj->value);
}
- SP_OBJECT((SPItem *) items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT((SPItem *) items->data)->updateRepr();
modmade = true;
}
}
@@ -1763,7 +1763,7 @@ static void sp_stb_sides_flat_state_changed( EgeSelectOneAction *act, GObject *d
if (SP_IS_STAR((SPItem *) items->data)) {
Inkscape::XML::Node *repr = SP_OBJECT_REPR((SPItem *) items->data);
repr->setAttribute("inkscape:flatsided", flat ? "true" : "false" );
- SP_OBJECT((SPItem *) items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT((SPItem *) items->data)->updateRepr();
modmade = true;
}
}
@@ -1800,7 +1800,7 @@ static void sp_stb_rounded_value_changed( GtkAdjustment *adj, GObject *dataKludg
if (SP_IS_STAR((SPItem *) items->data)) {
Inkscape::XML::Node *repr = SP_OBJECT_REPR((SPItem *) items->data);
sp_repr_set_svg_double(repr, "inkscape:rounded", (gdouble) adj->value);
- SP_OBJECT(items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT(items->data)->updateRepr();
modmade = true;
}
}
@@ -1834,7 +1834,7 @@ static void sp_stb_randomized_value_changed( GtkAdjustment *adj, GObject *dataKl
if (SP_IS_STAR((SPItem *) items->data)) {
Inkscape::XML::Node *repr = SP_OBJECT_REPR((SPItem *) items->data);
sp_repr_set_svg_double(repr, "inkscape:randomized", (gdouble) adj->value);
- SP_OBJECT(items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT(items->data)->updateRepr();
modmade = true;
}
}
@@ -2871,7 +2871,7 @@ sp_spl_tb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const *value_nam
if (SP_IS_SPIRAL((SPItem *) items->data)) {
Inkscape::XML::Node *repr = SP_OBJECT_REPR((SPItem *) items->data);
sp_repr_set_svg_double( repr, namespaced_name, adj->value );
- SP_OBJECT((SPItem *) items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT((SPItem *) items->data)->updateRepr();
modmade = true;
}
}
@@ -3999,7 +3999,7 @@ static void sp_arctb_open_state_changed( EgeSelectOneAction *act, GObject *tbl )
if (SP_IS_ARC((SPItem *) items->data)) {
Inkscape::XML::Node *repr = SP_OBJECT_REPR((SPItem *) items->data);
repr->setAttribute("sodipodi:open", "true");
- SP_OBJECT((SPItem *) items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT((SPItem *) items->data)->updateRepr();
modmade = true;
}
}
@@ -4011,7 +4011,7 @@ static void sp_arctb_open_state_changed( EgeSelectOneAction *act, GObject *tbl )
if (SP_IS_ARC((SPItem *) items->data)) {
Inkscape::XML::Node *repr = SP_OBJECT_REPR((SPItem *) items->data);
repr->setAttribute("sodipodi:open", NULL);
- SP_OBJECT((SPItem *) items->data)->updateRepr(repr, SP_OBJECT_WRITE_EXT);
+ SP_OBJECT((SPItem *) items->data)->updateRepr();
modmade = true;
}
}