summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39e454b)
raw | patch | inline | side by side (parent: 39e454b)
author | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Mon, 12 Jul 2010 16:36:46 +0000 (22:06 +0530) | ||
committer | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Mon, 12 Jul 2010 16:36:46 +0000 (22:06 +0530) |
82 files changed:
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp
index 69bae53d93b696fb1f362d85b7ac2bee9650a1f3..be6d47db736e205109651a2f317c977fbb5bdd4d 100644 (file)
--- a/src/box3d-side.cpp
+++ b/src/box3d-side.cpp
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build (object, document, repr);
- sp_object_read_attr(object, "inkscape:box3dsidetype");
+ object->readAttr( "inkscape:box3dsidetype");
}
static Inkscape::XML::Node *
if (((SPObjectClass *) parent_class)->update)
((SPObjectClass *) parent_class)->update (object, ctx, flags);
}
+/*
+ * Function which return the type attribute for Box3D.
+ * Acts as a replacement for directly accessing the XML Tree directly.
+ */
+long long int Box3DSide::getFaceId()
+{
+ return this->getIntAttribute("inkscape:box3dsidetype", -1);
+}
void
box3d_side_position_set (Box3DSide *side) {
diff --git a/src/box3d-side.h b/src/box3d-side.h
index d40e64b7524311b3f981108783ea26d77f5235ae..ba1431fabb9923edab389acd0f0ae7446738a820 100644 (file)
--- a/src/box3d-side.h
+++ b/src/box3d-side.h
Box3D::Axis dir1;
Box3D::Axis dir2;
Box3D::FrontOrRear front_or_rear;
+ long long int getFaceId();
};
struct Box3DSideClass {
diff --git a/src/box3d.cpp b/src/box3d.cpp
index 7985640cdfcd9845b96db2c34e52efaf386d1c25..1facf2c0c3500841a54972dcde1d68a4a825045d 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
box->persp_ref->changedSignal().connect(sigc::bind(sigc::ptr_fun(box3d_ref_changed), box));
- sp_object_read_attr(object, "inkscape:perspectiveID");
- sp_object_read_attr(object, "inkscape:corner0");
- sp_object_read_attr(object, "inkscape:corner7");
+ object->readAttr( "inkscape:perspectiveID");
+ object->readAttr( "inkscape:corner0");
+ object->readAttr( "inkscape:corner7");
}
/**
}
-static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Document *xml_doc, 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);
@@ -290,11 +290,13 @@ static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Documen
repr->setAttribute("inkscape:perspectiveID", uri_string);
g_free(uri_string);
} else {
- Inkscape::XML::Node *persp_repr = SP_OBJECT_REPR(doc->getCurrentPersp3D());
- const gchar *persp_id = persp_repr->attribute("id");
- gchar *href = g_strdup_printf("#%s", persp_id);
- repr->setAttribute("inkscape:perspectiveID", href);
- g_free(href);
+ //Inkscape::XML::Node *persp_repr = SP_OBJECT_REPR(doc->getCurrentPersp3D());
+ //const gchar *persp_id = persp_repr->attribute("id");
+ //gchar *href = g_strdup_printf("#%s", persp_id);
+ Glib::ustring href = "#";
+ href += doc->getCurrentPersp3D()->getId();
+ repr->setAttribute("inkscape:perspectiveID", href.c_str());
+ //g_free(href);
}
}
box3d_get_sides (SPBox3D *box) {
std::map<int, Box3DSide *> sides;
for (SPObject *side = box->first_child(); side != NULL; side = SP_OBJECT_NEXT(side)) {
- if (SP_IS_BOX3D_SIDE(side))
- sides[Box3D::face_to_int(sp_repr_get_int_attribute(SP_OBJECT_REPR(side),
- "inkscape:box3dsidetype", -1))] = SP_BOX3D_SIDE(side);
+
+ if (SP_IS_BOX3D_SIDE(side)){
+ Box3DSide *bside = SP_BOX3D_SIDE(side);
+ sides[Box3D::face_to_int(bside->getFaceId())] = bside;
+ }
}
sides.erase(-1);
return sides;
@@ -1328,9 +1332,12 @@ box3d_switch_perspectives(SPBox3D *box, Persp3D *old_persp, Persp3D *new_persp,
persp3d_remove_box (old_persp, box);
persp3d_add_box (new_persp, box);
- gchar *href = g_strdup_printf("#%s", SP_OBJECT_REPR(new_persp)->attribute("id"));
- SP_OBJECT_REPR(box)->setAttribute("inkscape:perspectiveID", href);
- g_free(href);
+ //gchar *href = g_strdup_printf("#%s", SP_OBJECT_REPR(new_persp)->attribute("id"));
+ Glib::ustring href = "#";
+ href += new_persp->getId();
+ //SP_OBJECT_REPR(box)->setAttribute("inkscape:perspectiveID", href.c_str());
+ static_cast<SPObject *>(box)->setAttribute("inkscape:perspectiveID", href.c_str());
+ //g_free(href);
}
/* Converts the 3D box to an ordinary SPGroup, adds it to the XML tree at the same position as
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
// remember position of the box
- int pos = SP_OBJECT_REPR(box)->position();
+ int pos = static_cast<SPObject *>(box)->getPosition();
// remember important attributes
- Inkscape::XML::Node *repr_source = SP_OBJECT_REPR(box);
- gchar const *id = repr_source->attribute("id");
- gchar const *style = repr_source->attribute("style");
- gchar const *mask = repr_source->attribute("mask");
- gchar const *clip_path = repr_source->attribute("clip-path");
+ //Inkscape::XML::Node *repr_source = SP_OBJECT_REPR(box);
+ gchar const *id = static_cast<SPObject *>(box)->getAttribute("id");
+ gchar const *style = static_cast<SPObject *>(box)->getAttribute("style");
+ gchar const *mask = static_cast<SPObject *>(box)->getAttribute("mask");
+ gchar const *clip_path = static_cast<SPObject *>(box)->getAttribute("clip-path");
// create a new group and add the sides (converted to ordinary paths) as its children
Inkscape::XML::Node *grepr = xml_doc->createElement("svg:g");
// add the new group to the box's parent and set remembered position
SPObject *parent = SP_OBJECT_PARENT(box);
- SP_OBJECT_REPR(parent)->appendChild(grepr);
+ parent->appendChild(grepr);
grepr->setPosition(pos);
grepr->setAttribute("style", style);
if (mask)
diff --git a/src/box3d.h b/src/box3d.h
index 9f2e1d78e8ac33210b80d30c5abaa56969600911..182a312e13b9ffdcb989302cfdff2b5bb73358df 100644 (file)
--- a/src/box3d.h
+++ b/src/box3d.h
class Persp3D;
class Persp3DReference;
-struct SPBox3D : public SPGroup {
+class SPBox3D : public SPGroup {
+ public:
gint z_orders[6]; // z_orders[i] holds the ID of the face at position #i in the group (from top to bottom)
gchar *persp_href;
gint my_counter; // for debugging only
};
-struct SPBox3DClass {
+class SPBox3DClass {
+ public:
SPGroupClass parent_class;
};
index c479f78c05947e876822c9d5d4edc9238d1754e4..4da3c579a8b221eee6c966f59a69098c23826deb 100644 (file)
--- a/src/color-profile-test.h
+++ b/src/color-profile-test.h
for ( size_t i = 0; i < G_N_ELEMENTS( cases ); i++ ) {
std::string descr(cases[i].attr);
- sp_object_set(SP_OBJECT(prof), SP_ATTR_RENDERING_INTENT, cases[i].attr);
+ SP_OBJECT(prof)->setKeyValue( SP_ATTR_RENDERING_INTENT, cases[i].attr);
TSM_ASSERT_EQUALS( descr, prof->rendering_intent, (guint)cases[i].intVal );
}
SP_OBJECT(prof)->document = _doc;
for ( size_t i = 0; i < G_N_ELEMENTS( cases ); i++ ) {
- sp_object_set(SP_OBJECT(prof), SP_ATTR_LOCAL, cases[i]);
+ SP_OBJECT(prof)->setKeyValue( SP_ATTR_LOCAL, cases[i]);
TS_ASSERT( prof->local );
if ( prof->local ) {
TS_ASSERT_EQUALS( std::string(prof->local), std::string(cases[i]) );
}
}
- sp_object_set(SP_OBJECT(prof), SP_ATTR_LOCAL, NULL);
+ SP_OBJECT(prof)->setKeyValue( SP_ATTR_LOCAL, NULL);
TS_ASSERT_EQUALS( prof->local, (gchar*)0 );
g_object_unref(prof);
SP_OBJECT(prof)->document = _doc;
for ( size_t i = 0; i < G_N_ELEMENTS( cases ); i++ ) {
- sp_object_set(SP_OBJECT(prof), SP_ATTR_NAME, cases[i]);
+ SP_OBJECT(prof)->setKeyValue( SP_ATTR_NAME, cases[i]);
TS_ASSERT( prof->name );
if ( prof->name ) {
TS_ASSERT_EQUALS( std::string(prof->name), std::string(cases[i]) );
}
}
- sp_object_set(SP_OBJECT(prof), SP_ATTR_NAME, NULL);
+ SP_OBJECT(prof)->setKeyValue( SP_ATTR_NAME, NULL);
TS_ASSERT_EQUALS( prof->name, (gchar*)0 );
g_object_unref(prof);
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index bda4e6e2377e582147217b4ae5d38d572a582b53..ee4118e4f0b625b09ad6b00914096cd1e6837cba 100644 (file)
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
@@ -247,10 +247,10 @@ void ColorProfile::build( SPObject *object, SPDocument *document, Inkscape::XML:
if (cprof_parent_class->build) {
(* cprof_parent_class->build)(object, document, repr);
}
- sp_object_read_attr( object, "xlink:href" );
- sp_object_read_attr( object, "local" );
- sp_object_read_attr( object, "name" );
- sp_object_read_attr( object, "rendering-intent" );
+ object->readAttr( "xlink:href" );
+ object->readAttr( "local" );
+ object->readAttr( "name" );
+ object->readAttr( "rendering-intent" );
// Register
if ( document ) {
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index a6ac2387a89c9eed7a91832fd619574fe6066dc2..ed2aceb82575c916e420955b12a33f5776149a59 100644 (file)
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -194,7 +194,7 @@ void SPAvoidRef::setConnectionPointsAttrUndoable(const gchar* value, const gchar
{
SPDocument* doc = SP_OBJECT_DOCUMENT(item);
- sp_object_setAttribute( SP_OBJECT(item), "inkscape:connection-points", value, 0 );
+ SP_OBJECT(item)->setAttribute( "inkscape:connection-points", value, 0 );
item->updateRepr();
doc->ensure_up_to_date();
SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR, action);
index ff19c77499879137b5c0d79950e7c781cfcc342e..a419af44aea6b6b03437cafea56125548dac4eeb 100644 (file)
@@ -1286,15 +1286,15 @@ cc_connector_rerouting_finish(SPConnectorContext *const cc, Geom::Point *const p
if (found) {
if (cc->clickedhandle == cc->endpt_handle[0]) {
- sp_object_setAttribute(cc->clickeditem,
+ (cc->clickeditem)->setAttribute(
"inkscape:connection-start", shape_label, false);
- sp_object_setAttribute(cc->clickeditem,
+ (cc->clickeditem)->setAttribute(
"inkscape:connection-start-point", cpid, false);
}
else {
- sp_object_setAttribute(cc->clickeditem,
+ (cc->clickeditem)->setAttribute(
"inkscape:connection-end", shape_label, false);
- sp_object_setAttribute(cc->clickeditem,
+ (cc->clickeditem)->setAttribute(
"inkscape:connection-end-point", cpid, false);
}
g_free(shape_label);
cc->newconn->transform = SP_ITEM(desktop->currentLayer())->i2doc_affine().inverse();
bool connection = false;
- sp_object_setAttribute(cc->newconn, "inkscape:connector-type",
+ (cc->newconn)->setAttribute( "inkscape:connector-type",
cc->isOrthogonal ? "orthogonal" : "polyline", false);
- sp_object_setAttribute(cc->newconn, "inkscape:connector-curvature",
+ (cc->newconn)->setAttribute( "inkscape:connector-curvature",
Glib::Ascii::dtostr(cc->curvature).c_str(), false);
if (cc->shref)
{
- sp_object_setAttribute(cc->newconn, "inkscape:connection-start",
+ (cc->newconn)->setAttribute( "inkscape:connection-start",
cc->shref, false);
if (cc->scpid)
- sp_object_setAttribute(cc->newconn, "inkscape:connection-start-point",
+ (cc->newconn)->setAttribute( "inkscape:connection-start-point",
cc->scpid, false);
connection = true;
}
if (cc->ehref)
{
- sp_object_setAttribute(cc->newconn, "inkscape:connection-end",
+ (cc->newconn)->setAttribute( "inkscape:connection-end",
cc->ehref, false);
if (cc->ecpid)
- sp_object_setAttribute(cc->newconn, "inkscape:connection-end-point",
+ (cc->newconn)->setAttribute( "inkscape:connection-end-point",
cc->ecpid, false);
connection = true;
}
char const *value = (set_avoid) ? "true" : NULL;
if (cc_item_is_shape(item)) {
- sp_object_setAttribute(item, "inkscape:connector-avoid",
+ item->setAttribute("inkscape:connector-avoid",
value, false);
item->avoidRef->handleSettingChange();
changes++;
index 8d2b15e4402e6dcfc864a7d9f3736029634c63f6..d96b364ef4fdb82ab43bbef07b7bf7dbc34ac922 100644 (file)
SPException ex;
gtk_label_set_markup_with_mnemonic (GTK_LABEL (id_label), _("_Id"));
SP_EXCEPTION_INIT (&ex);
- sp_object_setAttribute (SP_OBJECT (item), "id", id, &ex);
+ SP_OBJECT (item)->setAttribute ("id", id, &ex);
SPDocumentUndo::done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
_("Set object ID"));
}
index 1988865d10c98b88221d875eb5292d5b1c6ba92b..a25205db9f5c8df55305a9a5e2943f9a109bfd65 100644 (file)
--- a/src/document-subset.cpp
+++ b/src/document-subset.cpp
while ( first != last ) {
Siblings::const_iterator mid = first + ( last - first + 1 ) / 2;
- int pos = sp_object_compare_position(*mid, obj);
+ int pos = sp_object_compare_position(*mid,obj);
if ( pos < 0 ) {
first = mid;
} else if ( pos > 0 ) {
if ( first == last ) {
// compare to the single possiblity left
- int pos = sp_object_compare_position(*last, obj);
+ int pos = sp_object_compare_position(*last,obj);
if ( pos < 0 ) {
last++;
}
diff --git a/src/filters/blend.cpp b/src/filters/blend.cpp
index 3cec422915b2ccbad7ff6a977ffb5cdd4a333341..f297ac199a6e309c8d848ea8ccc9e3ec0dde62fb 100644 (file)
--- a/src/filters/blend.cpp
+++ b/src/filters/blend.cpp
@@ -103,8 +103,8 @@ sp_feBlend_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *re
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "mode");
- sp_object_read_attr(object, "in2");
+ object->readAttr( "mode");
+ object->readAttr( "in2");
/* Unlike normal in, in2 is required attribute. Make sure, we can call
* it by some name. */
SPFeBlend *blend = SP_FEBLEND(object);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
- sp_object_read_attr(object, "mode");
- sp_object_read_attr(object, "in2");
+ object->readAttr( "mode");
+ object->readAttr( "in2");
}
/* Unlike normal in, in2 is required attribute. Make sure, we can call
index 3f60ea05cc778c0147cca5e59d77f6f7d49c0d0f..1b189ef377ea5e933b6253137a95e72fbc4ae1e9 100644 (file)
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "type");
- sp_object_read_attr(object, "values");
+ object->readAttr( "type");
+ object->readAttr( "values");
}
/**
diff --git a/src/filters/componenttransfer-funcnode.cpp b/src/filters/componenttransfer-funcnode.cpp
index 1dbf07dd51b59428ca8ace2382143c29c52db4fa..a45716e08e8f3551a22f103b827b3f9441291aac 100644 (file)
@@ -168,13 +168,13 @@ sp_fefuncnode_build(SPObject *object, SPDocument *document, Inkscape::XML::Node
}
//Read values of key attributes from XML nodes into object.
- sp_object_read_attr(object, "type");
- sp_object_read_attr(object, "tableValues");
- sp_object_read_attr(object, "slope");
- sp_object_read_attr(object, "intercept");
- sp_object_read_attr(object, "amplitude");
- sp_object_read_attr(object, "exponent");
- sp_object_read_attr(object, "offset");
+ object->readAttr( "type");
+ object->readAttr( "tableValues");
+ object->readAttr( "slope");
+ object->readAttr( "intercept");
+ object->readAttr( "amplitude");
+ object->readAttr( "exponent");
+ object->readAttr( "offset");
//is this necessary?
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
//TODO
- //sp_object_read_attr(object, "azimuth");
- //sp_object_read_attr(object, "elevation");
+ //object->readAttr( "azimuth");
+ //object->readAttr( "elevation");
}
if (((SPObjectClass *) feFuncNode_parent_class)->update) {
index 761115850df86cb6ce4434b39a07c871dae36ea0..ae5be1a81be5a889d1eada458c8e486a465b3022 100644 (file)
@@ -101,14 +101,14 @@ sp_feComposite_build(SPObject *object, SPDocument *document, Inkscape::XML::Node
SPFeComposite *comp = SP_FECOMPOSITE(object);
- sp_object_read_attr(object, "operator");
+ object->readAttr( "operator");
if (comp->composite_operator == COMPOSITE_ARITHMETIC) {
- sp_object_read_attr(object, "k1");
- sp_object_read_attr(object, "k2");
- sp_object_read_attr(object, "k3");
- sp_object_read_attr(object, "k4");
+ object->readAttr( "k1");
+ object->readAttr( "k2");
+ object->readAttr( "k3");
+ object->readAttr( "k4");
}
- sp_object_read_attr(object, "in2");
+ object->readAttr( "in2");
/* Unlike normal in, in2 is required attribute. Make sure, we can call
* it by some name. */
index 6440f340aad7a84fc32e9e70858148d36483d44f..2f91c9db5daef7437263f773ec534fae9a550c9f 100644 (file)
@@ -110,15 +110,15 @@ sp_feConvolveMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML:
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "order");
- sp_object_read_attr(object, "kernelMatrix");
- sp_object_read_attr(object, "divisor");
- sp_object_read_attr(object, "bias");
- sp_object_read_attr(object, "targetX");
- sp_object_read_attr(object, "targetY");
- sp_object_read_attr(object, "edgeMode");
- sp_object_read_attr(object, "kernelUnitLength");
- sp_object_read_attr(object, "preserveAlpha");
+ object->readAttr( "order");
+ object->readAttr( "kernelMatrix");
+ object->readAttr( "divisor");
+ object->readAttr( "bias");
+ object->readAttr( "targetX");
+ object->readAttr( "targetY");
+ object->readAttr( "edgeMode");
+ object->readAttr( "kernelUnitLength");
+ object->readAttr( "preserveAlpha");
}
/**
index bdc569083564712f170bc94d0b69e72105db86cc..5681bddc1ff0ece0b478d0160efeea354ebbb3c9 100644 (file)
@@ -118,10 +118,10 @@ sp_feDiffuseLighting_build(SPObject *object, SPDocument *document, Inkscape::XML
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "surfaceScale");
- sp_object_read_attr(object, "diffuseConstant");
- sp_object_read_attr(object, "kernelUnitLength");
- sp_object_read_attr(object, "lighting-color");
+ object->readAttr( "surfaceScale");
+ object->readAttr( "diffuseConstant");
+ object->readAttr( "kernelUnitLength");
+ object->readAttr( "lighting-color");
}
sp_feDiffuseLighting_update(SPObject *object, SPCtx *ctx, guint flags)
{
if (flags & (SP_OBJECT_MODIFIED_FLAG)) {
- sp_object_read_attr(object, "surfaceScale");
- sp_object_read_attr(object, "diffuseConstant");
- sp_object_read_attr(object, "kernelUnit");
- sp_object_read_attr(object, "lighting-color");
+ object->readAttr( "surfaceScale");
+ object->readAttr( "diffuseConstant");
+ object->readAttr( "kernelUnit");
+ object->readAttr( "lighting-color");
}
if (((SPObjectClass *) feDiffuseLighting_parent_class)->update) {
index ea2535f3e06a35bb9495c61e194249ee0d9b1aec..ded7aab4520a4902d8d54b6638276de2752209ea 100644 (file)
@@ -97,10 +97,10 @@ sp_feDisplacementMap_build(SPObject *object, SPDocument *document, Inkscape::XML
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "scale");
- sp_object_read_attr(object, "in2");
- sp_object_read_attr(object, "xChannelSelector");
- sp_object_read_attr(object, "yChannelSelector");
+ object->readAttr( "scale");
+ object->readAttr( "in2");
+ object->readAttr( "xChannelSelector");
+ object->readAttr( "yChannelSelector");
/* Unlike normal in, in2 is required attribute. Make sure, we can call
* it by some name. */
index 55c51aa0e395e6985a8203e0cf55389ac02b9924..3a56f682b418b24689098d25626dfd324fb22f29 100644 (file)
@@ -101,8 +101,8 @@ sp_fedistantlight_build(SPObject *object, SPDocument *document, Inkscape::XML::N
}
//Read values of key attributes from XML nodes into object.
- sp_object_read_attr(object, "azimuth");
- sp_object_read_attr(object, "elevation");
+ object->readAttr( "azimuth");
+ object->readAttr( "elevation");
//is this necessary?
document->add_resource("fedistantlight", object);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
- sp_object_read_attr(object, "azimuth");
- sp_object_read_attr(object, "elevation");
+ object->readAttr( "azimuth");
+ object->readAttr( "elevation");
}
if (((SPObjectClass *) feDistantLight_parent_class)->update) {
diff --git a/src/filters/flood.cpp b/src/filters/flood.cpp
index 221b0daf22b84aa31ac1203329fa3ff5834e65bc..f5179cb41a2e330e7984330d55c71260131396ff 100644 (file)
--- a/src/filters/flood.cpp
+++ b/src/filters/flood.cpp
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "flood-opacity");
- sp_object_read_attr(object, "flood-color");
+ object->readAttr( "flood-opacity");
+ object->readAttr( "flood-color");
}
/**
diff --git a/src/filters/image.cpp b/src/filters/image.cpp
index eb6dfc22a906aed44076d2a96c264437b613d959..1180799f4c677ad3fd14cbe730bdb24be5b1a5bc 100644 (file)
--- a/src/filters/image.cpp
+++ b/src/filters/image.cpp
@@ -100,11 +100,11 @@ static void sp_feImage_build(SPObject *object, SPDocument *document, Inkscape::X
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "width");
- sp_object_read_attr(object, "height");
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "width");
+ object->readAttr( "height");
+ object->readAttr( "xlink:href");
}
index 8a4e0dd0ac179691fbb754e3cfeae9ab056cd514..c135c06fb5e06c3fa5c021c2ac30bc62181789eb 100644 (file)
static void
sp_feMergeNode_build(SPObject *object, SPDocument */*document*/, Inkscape::XML::Node */*repr*/)
{
- sp_object_read_attr(object, "in");
+ object->readAttr( "in");
}
/**
index 1530dae8c33ffb7ce784c0bc6b6dae7e40af55f2..2724dc5b634f9f882c61408af4392b714ce42a54 100644 (file)
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "operator");
- sp_object_read_attr(object, "radius");
+ object->readAttr( "operator");
+ object->readAttr( "radius");
}
/**
diff --git a/src/filters/offset.cpp b/src/filters/offset.cpp
index 61ea45ff2a5549b1f1cf365b9af41e46719f1970..64f6661fe4af4167b835272f1adbaedc66ef8081 100644 (file)
--- a/src/filters/offset.cpp
+++ b/src/filters/offset.cpp
((SPObjectClass *) feOffset_parent_class)->build(object, document, repr);
}
- sp_object_read_attr(object, "dx");
- sp_object_read_attr(object, "dy");
+ object->readAttr( "dx");
+ object->readAttr( "dy");
}
/**
sp_feOffset_update(SPObject *object, SPCtx *ctx, guint flags)
{
if (flags & SP_OBJECT_MODIFIED_FLAG) {
- sp_object_read_attr(object, "dx");
- sp_object_read_attr(object, "dy");
+ object->readAttr( "dx");
+ object->readAttr( "dy");
}
if (((SPObjectClass *) feOffset_parent_class)->update) {
index fed07ecf366e079802cdc76c8b452546f6c08084..55513ccb83a9ab8b160212608d55b349c0065514 100644 (file)
@@ -104,9 +104,9 @@ sp_fepointlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Nod
}
//Read values of key attributes from XML nodes into object.
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "z");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "z");
//is this necessary?
document->add_resource("fepointlight", object);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "z");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "z");
}
if (((SPObjectClass *) fePointLight_parent_class)->update) {
index 03a0c7f9687d2f844ed4629086c4f7ed8c1d586e..fcc6c697a559db9dd3d326064a36c5e104d90e36 100644 (file)
@@ -120,11 +120,11 @@ sp_feSpecularLighting_build(SPObject *object, SPDocument *document, Inkscape::XM
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "surfaceScale");
- sp_object_read_attr(object, "specularConstant");
- sp_object_read_attr(object, "specularExponent");
- sp_object_read_attr(object, "kernelUnitLength");
- sp_object_read_attr(object, "lighting-color");
+ object->readAttr( "surfaceScale");
+ object->readAttr( "specularConstant");
+ object->readAttr( "specularExponent");
+ object->readAttr( "kernelUnitLength");
+ object->readAttr( "lighting-color");
}
sp_feSpecularLighting_update(SPObject *object, SPCtx *ctx, guint flags)
{
if (flags & (SP_OBJECT_MODIFIED_FLAG)) {
- sp_object_read_attr(object, "surfaceScale");
- sp_object_read_attr(object, "specularConstant");
- sp_object_read_attr(object, "specularExponent");
- sp_object_read_attr(object, "kernelUnitLength");
- sp_object_read_attr(object, "lighting-color");
+ object->readAttr( "surfaceScale");
+ object->readAttr( "specularConstant");
+ object->readAttr( "specularExponent");
+ object->readAttr( "kernelUnitLength");
+ object->readAttr( "lighting-color");
}
if (((SPObjectClass *) feSpecularLighting_parent_class)->update) {
index 613763751874f05a3e7e6b9be51c5b45e60e4a76..6e0c0cbd09d4543d7ddb3f24e4898e522c4fb902 100644 (file)
@@ -114,14 +114,14 @@ sp_fespotlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node
}
//Read values of key attributes from XML nodes into object.
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "z");
- sp_object_read_attr(object, "pointsAtX");
- sp_object_read_attr(object, "pointsAtY");
- sp_object_read_attr(object, "pointsAtZ");
- sp_object_read_attr(object, "specularExponent");
- sp_object_read_attr(object, "limitingConeAngle");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "z");
+ object->readAttr( "pointsAtX");
+ object->readAttr( "pointsAtY");
+ object->readAttr( "pointsAtZ");
+ object->readAttr( "specularExponent");
+ object->readAttr( "limitingConeAngle");
//is this necessary?
document->add_resource("fespotlight", object);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "z");
- sp_object_read_attr(object, "pointsAtX");
- sp_object_read_attr(object, "pointsAtY");
- sp_object_read_attr(object, "pointsAtZ");
- sp_object_read_attr(object, "specularExponent");
- sp_object_read_attr(object, "limitingConeAngle");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "z");
+ object->readAttr( "pointsAtX");
+ object->readAttr( "pointsAtY");
+ object->readAttr( "pointsAtZ");
+ object->readAttr( "specularExponent");
+ object->readAttr( "limitingConeAngle");
}
if (((SPObjectClass *) feSpotLight_parent_class)->update) {
index eed056eccc4ad5ce4100457d061b5e07f5170b17..8c2d0387e73e58a2fd6dc0d9f6b83f18620f3593 100644 (file)
@@ -100,11 +100,11 @@ sp_feTurbulence_build(SPObject *object, SPDocument *document, Inkscape::XML::Nod
}
/*LOAD ATTRIBUTES FROM REPR HERE*/
- sp_object_read_attr(object, "baseFrequency");
- sp_object_read_attr(object, "numOctaves");
- sp_object_read_attr(object, "seed");
- sp_object_read_attr(object, "stitchTiles");
- sp_object_read_attr(object, "type");
+ object->readAttr( "baseFrequency");
+ object->readAttr( "numOctaves");
+ object->readAttr( "seed");
+ object->readAttr( "stitchTiles");
+ object->readAttr( "type");
}
/**
diff --git a/src/forward.h b/src/forward.h
index 0388f8f631f5f0a0499d3a88c6a991c5275d1d2a..41365611a71f4fa9711e55dde034e6327cfbcb69 100644 (file)
--- a/src/forward.h
+++ b/src/forward.h
/* Objects */
-class SPObject;
-class SPObjectClass;
+//class SPObject;
+//class SPObjectClass;
-#define SP_TYPE_OBJECT (sp_object_get_type ())
-#define SP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_OBJECT, SPObject))
-#define SP_OBJECT_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST((clazz), SP_TYPE_OBJECT, SPObjectClass))
-#define SP_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_OBJECT))
+//#define SP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_OBJECT, SPObject))
+//#define SP_OBJECT_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST((clazz), SP_TYPE_OBJECT, SPObjectClass))
+//#define SP_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_OBJECT))
-GType sp_object_get_type ();
+//GType sp_object_get_type ();
//class SPItem;
//class SPItemClass;
diff --git a/src/interface.cpp b/src/interface.cpp
index a535ed1bd722dcab0d244f5791b1f0860d7a9e49..4b95e8de6660575d76c39bd9a5a4511c035acbfc 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
g_free(str);
str = 0;
- sp_object_setAttribute( SP_OBJECT(item),
+ SP_OBJECT(item)->setAttribute(
fillnotstroke ? "inkscape:x-fill-tag":"inkscape:x-stroke-tag",
palName.c_str(),
false );
index aa916318d8da70ab7586da2aa859837d5194633c..a77b9817a84494e6b60a1e49d540f4fd1b42530b 100644 (file)
@@ -104,7 +104,7 @@ LivePathEffectObject::livepatheffect_build(SPObject *object, SPDocument *documen
if (((SPObjectClass *) livepatheffect_parent_class)->build)
(* ((SPObjectClass *) livepatheffect_parent_class)->build)(object, document, repr);
- sp_object_read_attr(object, "effect");
+ object->readAttr( "effect");
if (repr) {
repr->addListener (&livepatheffect_repr_events, object);
diff --git a/src/marker.cpp b/src/marker.cpp
index 979ca301155f22b1f3152a37ac5369648f969289..376b4fa28ca08ee27fa7dd19d828dad58023e14d 100644 (file)
--- a/src/marker.cpp
+++ b/src/marker.cpp
@@ -141,14 +141,14 @@ sp_marker_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *re
group = (SPGroup *) object;
marker = (SPMarker *) object;
- sp_object_read_attr (object, "markerUnits");
- sp_object_read_attr (object, "refX");
- sp_object_read_attr (object, "refY");
- sp_object_read_attr (object, "markerWidth");
- sp_object_read_attr (object, "markerHeight");
- sp_object_read_attr (object, "orient");
- sp_object_read_attr (object, "viewBox");
- sp_object_read_attr (object, "preserveAspectRatio");
+ object->readAttr( "markerUnits");
+ object->readAttr( "refX");
+ object->readAttr( "refY");
+ object->readAttr( "markerWidth");
+ object->readAttr( "markerHeight");
+ object->readAttr( "orient");
+ object->readAttr( "viewBox");
+ object->readAttr( "preserveAspectRatio");
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build (object, document, repr);
diff --git a/src/persp3d.cpp b/src/persp3d.cpp
index 4b2e55b9d250fc9f7562490a5085fa583dc5503b..60bfa765aa9a9517a033497b15d061d9b6d56a32 100644 (file)
--- a/src/persp3d.cpp
+++ b/src/persp3d.cpp
@@ -116,10 +116,10 @@ static void persp3d_build(SPObject *object, SPDocument *document, Inkscape::XML:
/* calls sp_object_set for the respective attributes */
// The transformation matrix is updated according to the values we read for the VPs
- sp_object_read_attr(object, "inkscape:vp_x");
- sp_object_read_attr(object, "inkscape:vp_y");
- sp_object_read_attr(object, "inkscape:vp_z");
- sp_object_read_attr(object, "inkscape:persp3d-origin");
+ object->readAttr( "inkscape:vp_x");
+ object->readAttr( "inkscape:vp_y");
+ object->readAttr( "inkscape:vp_z");
+ object->readAttr( "inkscape:persp3d-origin");
if (repr) {
repr->addListener (&persp3d_repr_events, object);
index 7b0f353ab4e5611c30c53b8348109e5a8ab2eb26..8b4db3e25a1f7d4cb14ac3fa26f6d5a06f1819ba 100644 (file)
@@ -1374,7 +1374,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Matrix cons
* Same for linked offset if we are also moving its source: do not move it. */
if (transform_textpath_with_path || transform_offset_with_source) {
// Restore item->transform field from the repr, in case it was changed by seltrans.
- sp_object_read_attr(SP_OBJECT(item), "transform");
+ SP_OBJECT(item)->readAttr( "transform");
} else if (transform_flowtext_with_frame) {
// apply the inverse of the region's transform to the <use> so that the flow remains
// the same (even though the output itself gets transformed)
@@ -1392,7 +1392,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Matrix cons
// transform and its move compensation are both cancelled out.
// restore item->transform field from the repr, in case it was changed by seltrans
- sp_object_read_attr(SP_OBJECT(item), "transform");
+ SP_OBJECT(item)->readAttr( "transform");
// calculate the matrix we need to apply to the clone to cancel its induced transform from its original
Geom::Matrix parent2dt = SP_ITEM(SP_OBJECT_PARENT(item))->i2d_affine();
diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp
index 379ddbb7c6065cc02c27d39828536b7808951fa6..9a5e8b1c1c758b453ee9cabe1693c98ef5ae888c 100644 (file)
--- a/src/sp-anchor.cpp
+++ b/src/sp-anchor.cpp
@@ -89,14 +89,14 @@ static void sp_anchor_build(SPObject *object, SPDocument *document, Inkscape::XM
((SPObjectClass *) (parent_class))->build(object, document, repr);
}
- sp_object_read_attr(object, "xlink:type");
- sp_object_read_attr(object, "xlink:role");
- sp_object_read_attr(object, "xlink:arcrole");
- sp_object_read_attr(object, "xlink:title");
- sp_object_read_attr(object, "xlink:show");
- sp_object_read_attr(object, "xlink:actuate");
- sp_object_read_attr(object, "xlink:href");
- sp_object_read_attr(object, "target");
+ object->readAttr( "xlink:type");
+ object->readAttr( "xlink:role");
+ object->readAttr( "xlink:arcrole");
+ object->readAttr( "xlink:title");
+ object->readAttr( "xlink:show");
+ object->readAttr( "xlink:actuate");
+ object->readAttr( "xlink:href");
+ object->readAttr( "target");
}
static void sp_anchor_release(SPObject *object)
diff --git a/src/sp-animation.cpp b/src/sp-animation.cpp
index 2d9f2e94191478e4377bc9267025da0b1b63739e..85fa615deca839d6bda218e52d89f785fe041443 100644 (file)
--- a/src/sp-animation.cpp
+++ b/src/sp-animation.cpp
@@ -89,18 +89,18 @@ sp_animation_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *
if (((SPObjectClass *) animation_parent_class)->build)
((SPObjectClass *) animation_parent_class)->build(object, document, repr);
- sp_object_read_attr(object, "xlink:href");
- sp_object_read_attr(object, "attributeName");
- sp_object_read_attr(object, "attributeType");
- sp_object_read_attr(object, "begin");
- sp_object_read_attr(object, "dur");
- sp_object_read_attr(object, "end");
- sp_object_read_attr(object, "min");
- sp_object_read_attr(object, "max");
- sp_object_read_attr(object, "restart");
- sp_object_read_attr(object, "repeatCount");
- sp_object_read_attr(object, "repeatDur");
- sp_object_read_attr(object, "fill");
+ object->readAttr( "xlink:href");
+ object->readAttr( "attributeName");
+ object->readAttr( "attributeType");
+ object->readAttr( "begin");
+ object->readAttr( "dur");
+ object->readAttr( "end");
+ object->readAttr( "min");
+ object->readAttr( "max");
+ object->readAttr( "restart");
+ object->readAttr( "repeatCount");
+ object->readAttr( "repeatDur");
+ object->readAttr( "fill");
}
static void
@@ -176,15 +176,15 @@ sp_ianimation_build(SPObject *object, SPDocument *document, Inkscape::XML::Node
if (((SPObjectClass *) ianimation_parent_class)->build)
((SPObjectClass *) ianimation_parent_class)->build(object, document, repr);
- sp_object_read_attr(object, "calcMode");
- sp_object_read_attr(object, "values");
- sp_object_read_attr(object, "keyTimes");
- sp_object_read_attr(object, "keySplines");
- sp_object_read_attr(object, "from");
- sp_object_read_attr(object, "to");
- sp_object_read_attr(object, "by");
- sp_object_read_attr(object, "additive");
- sp_object_read_attr(object, "accumulate");
+ object->readAttr( "calcMode");
+ object->readAttr( "values");
+ object->readAttr( "keyTimes");
+ object->readAttr( "keySplines");
+ object->readAttr( "from");
+ object->readAttr( "to");
+ object->readAttr( "by");
+ object->readAttr( "additive");
+ object->readAttr( "accumulate");
}
static void
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index a36d9b44330f01a56e937b3c4ed4c4ebdf46f0a3..63e6175515a8931ba736d0e8598f0f5a7c0c9e09 100644 (file)
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
@@ -104,7 +104,7 @@ sp_clippath_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *r
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build(object, document, repr);
- sp_object_read_attr(object, "clipPathUnits");
+ object->readAttr( "clipPathUnits");
/* Register ourselves */
document->add_resource("clipPath", object);
index 24c7e7e5c314c2e9e5a24aa4c1fab754fba94d25..21ecf6b43028c24d26d61422b9b411759c951a90 100644 (file)
--- a/src/sp-conn-end-pair.cpp
+++ b/src/sp-conn-end-pair.cpp
void
sp_conn_end_pair_build(SPObject *object)
{
- sp_object_read_attr(object, "inkscape:connector-type");
- sp_object_read_attr(object, "inkscape:connection-start");
- sp_object_read_attr(object, "inkscape:connection-start-point");
- sp_object_read_attr(object, "inkscape:connection-end");
- sp_object_read_attr(object, "inkscape:connection-end-point");
- sp_object_read_attr(object, "inkscape:connector-curvature");
+ object->readAttr( "inkscape:connector-type");
+ object->readAttr( "inkscape:connection-start");
+ object->readAttr( "inkscape:connection-start-point");
+ object->readAttr( "inkscape:connection-end");
+ object->readAttr( "inkscape:connection-end-point");
+ object->readAttr( "inkscape:connector-curvature");
}
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index 86b6106c5a95d68ceb620826a858809a6c49f387..b5f0bdab62564e45015b3413760a4887eb526531 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
@@ -433,10 +433,10 @@ sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *re
if (((SPObjectClass *) ellipse_parent_class)->build)
(* ((SPObjectClass *) ellipse_parent_class)->build) (object, document, repr);
- sp_object_read_attr(object, "cx");
- sp_object_read_attr(object, "cy");
- sp_object_read_attr(object, "rx");
- sp_object_read_attr(object, "ry");
+ object->readAttr( "cx");
+ object->readAttr( "cy");
+ object->readAttr( "rx");
+ object->readAttr( "ry");
}
static Inkscape::XML::Node *
@@ -581,9 +581,9 @@ sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
if (((SPObjectClass *) circle_parent_class)->build)
(* ((SPObjectClass *) circle_parent_class)->build)(object, document, repr);
- sp_object_read_attr(object, "cx");
- sp_object_read_attr(object, "cy");
- sp_object_read_attr(object, "r");
+ object->readAttr( "cx");
+ object->readAttr( "cy");
+ object->readAttr( "r");
}
static Inkscape::XML::Node *
@@ -706,14 +706,14 @@ sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
if (((SPObjectClass *) arc_parent_class)->build)
(* ((SPObjectClass *) arc_parent_class)->build) (object, document, repr);
- sp_object_read_attr(object, "sodipodi:cx");
- sp_object_read_attr(object, "sodipodi:cy");
- sp_object_read_attr(object, "sodipodi:rx");
- sp_object_read_attr(object, "sodipodi:ry");
+ object->readAttr( "sodipodi:cx");
+ object->readAttr( "sodipodi:cy");
+ object->readAttr( "sodipodi:rx");
+ object->readAttr( "sodipodi:ry");
- sp_object_read_attr(object, "sodipodi:start");
- sp_object_read_attr(object, "sodipodi:end");
- sp_object_read_attr(object, "sodipodi:open");
+ object->readAttr( "sodipodi:start");
+ object->readAttr( "sodipodi:end");
+ object->readAttr( "sodipodi:open");
}
/*
index 7cf0a38bb07f72732a963498a642458ec5a0b3f8..4ce0e133d2d63ce233eb519e7a5f4532a8635390 100644 (file)
((SPObjectClass *) filter_primitive_parent_class)->build(object, document, repr);
}
- sp_object_read_attr(object, "in");
- sp_object_read_attr(object, "result");
+ object->readAttr( "in");
+ object->readAttr( "result");
}
/**
//SPFilterPrimitive *filter_primitive = SP_FILTER_PRIMITIVE(object);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
- sp_object_read_attr(object, "in");
- sp_object_read_attr(object, "result");
+ object->readAttr( "in");
+ object->readAttr( "result");
}
if (((SPObjectClass *) filter_primitive_parent_class)->update) {
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp
index 2464b73a56d1cf83dabd71d33cec18dc46642416..e65a7be0552b51ab35f05267fd5f3d75dc00fae1 100644 (file)
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
@@ -136,14 +136,14 @@ sp_filter_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
}
//Read values of key attributes from XML nodes into object.
- sp_object_read_attr(object, "filterUnits");
- sp_object_read_attr(object, "primitiveUnits");
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "width");
- sp_object_read_attr(object, "height");
- sp_object_read_attr(object, "filterRes");
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "filterUnits");
+ object->readAttr( "primitiveUnits");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "width");
+ object->readAttr( "height");
+ object->readAttr( "filterRes");
+ object->readAttr( "xlink:href");
//is this necessary?
document->add_resource("filter", object);
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index 2d1f61a297c11eb7c596c8b79eed8bf87239beef..4c3cc8a6c5fba18e885cfadc6923db7ed423e2b1 100644 (file)
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
@@ -230,7 +230,7 @@ sp_flowtext_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *r
(* ((SPObjectClass *) (parent_class))->build)(object, document, repr);
}
- sp_object_read_attr(object, "inkscape:layoutOptions"); // must happen after css has been read
+ object->readAttr( "inkscape:layoutOptions"); // must happen after css has been read
}
static void
diff --git a/src/sp-font-face.cpp b/src/sp-font-face.cpp
index 20419a8e5977b19aaf67053e31116abd538a7ed6..a5894f83a23cfbaf34aac0fe30f9bf93d99e0cf5 100644 (file)
--- a/src/sp-font-face.cpp
+++ b/src/sp-font-face.cpp
@@ -403,39 +403,39 @@ static void sp_fontface_build(SPObject *object, SPDocument *document, Inkscape::
((SPObjectClass *) (parent_class))->build(object, document, repr);
}
- sp_object_read_attr(object, "font-family");
- sp_object_read_attr(object, "font-style");
- sp_object_read_attr(object, "font-variant");
- sp_object_read_attr(object, "font-weight");
- sp_object_read_attr(object, "font-stretch");
- sp_object_read_attr(object, "font-size");
- sp_object_read_attr(object, "unicode-range");
- sp_object_read_attr(object, "units-per-em");
- sp_object_read_attr(object, "panose-1");
- sp_object_read_attr(object, "stem-v");
- sp_object_read_attr(object, "stem-h");
- sp_object_read_attr(object, "slope");
- sp_object_read_attr(object, "cap-height");
- sp_object_read_attr(object, "x-height");
- sp_object_read_attr(object, "accent-height");
- sp_object_read_attr(object, "ascent");
- sp_object_read_attr(object, "descent");
- sp_object_read_attr(object, "widths");
- sp_object_read_attr(object, "bbox");
- sp_object_read_attr(object, "ideographic");
- sp_object_read_attr(object, "alphabetic");
- sp_object_read_attr(object, "mathematical");
- sp_object_read_attr(object, "ranging");
- sp_object_read_attr(object, "v-ideogaphic");
- sp_object_read_attr(object, "v-alphabetic");
- sp_object_read_attr(object, "v-mathematical");
- sp_object_read_attr(object, "v-hanging");
- sp_object_read_attr(object, "underline-position");
- sp_object_read_attr(object, "underline-thickness");
- sp_object_read_attr(object, "strikethrough-position");
- sp_object_read_attr(object, "strikethrough-thickness");
- sp_object_read_attr(object, "overline-position");
- sp_object_read_attr(object, "overline-thickness");
+ object->readAttr( "font-family");
+ object->readAttr( "font-style");
+ object->readAttr( "font-variant");
+ object->readAttr( "font-weight");
+ object->readAttr( "font-stretch");
+ object->readAttr( "font-size");
+ object->readAttr( "unicode-range");
+ object->readAttr( "units-per-em");
+ object->readAttr( "panose-1");
+ object->readAttr( "stem-v");
+ object->readAttr( "stem-h");
+ object->readAttr( "slope");
+ object->readAttr( "cap-height");
+ object->readAttr( "x-height");
+ object->readAttr( "accent-height");
+ object->readAttr( "ascent");
+ object->readAttr( "descent");
+ object->readAttr( "widths");
+ object->readAttr( "bbox");
+ object->readAttr( "ideographic");
+ object->readAttr( "alphabetic");
+ object->readAttr( "mathematical");
+ object->readAttr( "ranging");
+ object->readAttr( "v-ideogaphic");
+ object->readAttr( "v-alphabetic");
+ object->readAttr( "v-mathematical");
+ object->readAttr( "v-hanging");
+ object->readAttr( "underline-position");
+ object->readAttr( "underline-thickness");
+ object->readAttr( "strikethrough-position");
+ object->readAttr( "strikethrough-thickness");
+ object->readAttr( "overline-position");
+ object->readAttr( "overline-thickness");
}
static void sp_fontface_children_modified(SPFontFace */*sp_fontface*/)
sp_fontface_update(SPObject *object, SPCtx *ctx, guint flags)
{
if (flags & (SP_OBJECT_MODIFIED_FLAG)) {
- sp_object_read_attr(object, "font-family");
- sp_object_read_attr(object, "font-style");
- sp_object_read_attr(object, "font-variant");
- sp_object_read_attr(object, "font-weight");
- sp_object_read_attr(object, "font-stretch");
- sp_object_read_attr(object, "font-size");
- sp_object_read_attr(object, "unicode-range");
- sp_object_read_attr(object, "units-per-em");
- sp_object_read_attr(object, "panose-1");
- sp_object_read_attr(object, "stemv");
- sp_object_read_attr(object, "stemh");
- sp_object_read_attr(object, "slope");
- sp_object_read_attr(object, "cap-height");
- sp_object_read_attr(object, "x-height");
- sp_object_read_attr(object, "accent-height");
- sp_object_read_attr(object, "ascent");
- sp_object_read_attr(object, "descent");
- sp_object_read_attr(object, "widths");
- sp_object_read_attr(object, "bbox");
- sp_object_read_attr(object, "ideographic");
- sp_object_read_attr(object, "alphabetic");
- sp_object_read_attr(object, "mathematical");
- sp_object_read_attr(object, "hanging");
- sp_object_read_attr(object, "v-ideographic");
- sp_object_read_attr(object, "v-alphabetic");
- sp_object_read_attr(object, "v-mathematical");
- sp_object_read_attr(object, "v-hanging");
- sp_object_read_attr(object, "underline-position");
- sp_object_read_attr(object, "underline-thickness");
- sp_object_read_attr(object, "strikethrough-position");
- sp_object_read_attr(object, "strikethrough-thickness");
- sp_object_read_attr(object, "overline-position");
- sp_object_read_attr(object, "overline-thickness");
+ object->readAttr( "font-family");
+ object->readAttr( "font-style");
+ object->readAttr( "font-variant");
+ object->readAttr( "font-weight");
+ object->readAttr( "font-stretch");
+ object->readAttr( "font-size");
+ object->readAttr( "unicode-range");
+ object->readAttr( "units-per-em");
+ object->readAttr( "panose-1");
+ object->readAttr( "stemv");
+ object->readAttr( "stemh");
+ object->readAttr( "slope");
+ object->readAttr( "cap-height");
+ object->readAttr( "x-height");
+ object->readAttr( "accent-height");
+ object->readAttr( "ascent");
+ object->readAttr( "descent");
+ object->readAttr( "widths");
+ object->readAttr( "bbox");
+ object->readAttr( "ideographic");
+ object->readAttr( "alphabetic");
+ object->readAttr( "mathematical");
+ object->readAttr( "hanging");
+ object->readAttr( "v-ideographic");
+ object->readAttr( "v-alphabetic");
+ object->readAttr( "v-mathematical");
+ object->readAttr( "v-hanging");
+ object->readAttr( "underline-position");
+ object->readAttr( "underline-thickness");
+ object->readAttr( "strikethrough-position");
+ object->readAttr( "strikethrough-thickness");
+ object->readAttr( "overline-position");
+ object->readAttr( "overline-thickness");
}
if (((SPObjectClass *) parent_class)->update) {
diff --git a/src/sp-font.cpp b/src/sp-font.cpp
index 4f8bbef6e381a897e93dbf7c8df7a0e587c6154a..a1a2c425f3ce0c3d0b8f0853c3d8971f0bd18f0c 100644 (file)
--- a/src/sp-font.cpp
+++ b/src/sp-font.cpp
@@ -101,12 +101,12 @@ static void sp_font_build(SPObject *object, SPDocument *document, Inkscape::XML:
((SPObjectClass *) (parent_class))->build(object, document, repr);
}
- sp_object_read_attr(object, "horiz-origin-x");
- sp_object_read_attr(object, "horiz-origin-y");
- sp_object_read_attr(object, "horiz-adv-x");
- sp_object_read_attr(object, "vert-origin-x");
- sp_object_read_attr(object, "vert-origin-y");
- sp_object_read_attr(object, "vert-adv-y");
+ object->readAttr( "horiz-origin-x");
+ object->readAttr( "horiz-origin-y");
+ object->readAttr( "horiz-adv-x");
+ object->readAttr( "vert-origin-x");
+ object->readAttr( "vert-origin-y");
+ object->readAttr( "vert-adv-y");
document->add_resource("font", object);
}
sp_font_update(SPObject *object, SPCtx *ctx, guint flags)
{
if (flags & (SP_OBJECT_MODIFIED_FLAG)) {
- sp_object_read_attr(object, "horiz-origin-x");
- sp_object_read_attr(object, "horiz-origin-y");
- sp_object_read_attr(object, "horiz-adv-x");
- sp_object_read_attr(object, "vert-origin-x");
- sp_object_read_attr(object, "vert-origin-y");
- sp_object_read_attr(object, "vert-adv-y");
+ object->readAttr( "horiz-origin-x");
+ object->readAttr( "horiz-origin-y");
+ object->readAttr( "horiz-adv-x");
+ object->readAttr( "vert-origin-x");
+ object->readAttr( "vert-origin-y");
+ object->readAttr( "vert-adv-y");
}
if (((SPObjectClass *) parent_class)->update) {
index e6eab5032264c454b762b7029d827e2c2bf4b719..7182e5ce9dd8c7899495cd8cad25038de26c9f59 100644 (file)
--- a/src/sp-gaussian-blur.cpp
+++ b/src/sp-gaussian-blur.cpp
@@ -100,7 +100,7 @@ sp_gaussianBlur_build(SPObject *object, SPDocument *document, Inkscape::XML::Nod
((SPObjectClass *) gaussianBlur_parent_class)->build(object, document, repr);
}
- sp_object_read_attr(object, "stdDeviation");
+ object->readAttr( "stdDeviation");
}
sp_gaussianBlur_update(SPObject *object, SPCtx *ctx, guint flags)
{
if (flags & SP_OBJECT_MODIFIED_FLAG) {
- sp_object_read_attr(object, "stdDeviation");
+ object->readAttr( "stdDeviation");
}
if (((SPObjectClass *) gaussianBlur_parent_class)->update) {
index 93996d8bcd84f93abbbff622e5741e8ebc955b64..2efdedf7a6de38e69699eb35e039d829fc8371ef 100644 (file)
--- a/src/sp-glyph-kerning.cpp
+++ b/src/sp-glyph-kerning.cpp
@@ -110,11 +110,11 @@ static void sp_glyph_kerning_build(SPObject *object, SPDocument *document, Inksc
((SPObjectClass *) (parent_class))->build(object, document, repr);
}
- sp_object_read_attr(object, "u1");
- sp_object_read_attr(object, "g1");
- sp_object_read_attr(object, "u2");
- sp_object_read_attr(object, "g2");
- sp_object_read_attr(object, "k");
+ object->readAttr( "u1");
+ object->readAttr( "g1");
+ object->readAttr( "u2");
+ object->readAttr( "g2");
+ object->readAttr( "k");
}
static void sp_glyph_kerning_release(SPObject *object)
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
- sp_object_read_attr(object, "u1");
- sp_object_read_attr(object, "u2");
- sp_object_read_attr(object, "g2");
- sp_object_read_attr(object, "k");
+ object->readAttr( "u1");
+ object->readAttr( "u2");
+ object->readAttr( "g2");
+ object->readAttr( "k");
}
if (((SPObjectClass *) parent_class)->update) {
diff --git a/src/sp-glyph.cpp b/src/sp-glyph.cpp
index 203163b291b5226e8b1b780400306dea2918d0f0..a2a5c7fcd8fc2f56e6b084cd098d158b0694eb42 100644 (file)
--- a/src/sp-glyph.cpp
+++ b/src/sp-glyph.cpp
@@ -90,16 +90,16 @@ static void sp_glyph_build(SPObject *object, SPDocument *document, Inkscape::XML
((SPObjectClass *) (parent_class))->build(object, document, repr);
}
- sp_object_read_attr(object, "unicode");
- sp_object_read_attr(object, "glyph-name");
- sp_object_read_attr(object, "d");
- sp_object_read_attr(object, "orientation");
- sp_object_read_attr(object, "arabic-form");
- sp_object_read_attr(object, "lang");
- sp_object_read_attr(object, "horiz-adv-x");
- sp_object_read_attr(object, "vert-origin-x");
- sp_object_read_attr(object, "vert-origin-y");
- sp_object_read_attr(object, "vert-adv-y");
+ object->readAttr( "unicode");
+ object->readAttr( "glyph-name");
+ object->readAttr( "d");
+ object->readAttr( "orientation");
+ object->readAttr( "arabic-form");
+ object->readAttr( "lang");
+ object->readAttr( "horiz-adv-x");
+ object->readAttr( "vert-origin-x");
+ object->readAttr( "vert-origin-y");
+ object->readAttr( "vert-adv-y");
}
static void sp_glyph_release(SPObject *object)
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
- sp_object_read_attr(object, "unicode");
- sp_object_read_attr(object, "glyph-name");
- sp_object_read_attr(object, "d");
- sp_object_read_attr(object, "orientation");
- sp_object_read_attr(object, "arabic-form");
- sp_object_read_attr(object, "lang");
- sp_object_read_attr(object, "horiz-adv-x");
- sp_object_read_attr(object, "vert-origin-x");
- sp_object_read_attr(object, "vert-origin-y");
- sp_object_read_attr(object, "vert-adv-y");
+ object->readAttr( "unicode");
+ object->readAttr( "glyph-name");
+ object->readAttr( "d");
+ object->readAttr( "orientation");
+ object->readAttr( "arabic-form");
+ object->readAttr( "lang");
+ object->readAttr( "horiz-adv-x");
+ object->readAttr( "vert-origin-x");
+ object->readAttr( "vert-origin-y");
+ object->readAttr( "vert-adv-y");
}
if (((SPObjectClass *) parent_class)->update) {
diff --git a/src/sp-gradient-test.h b/src/sp-gradient-test.h
index 209bc7efb2bd3cfac3defe054869ec42b80d7de5..62c0ac8c2a8ef377599611e158125bd7e544096e 100644 (file)
--- a/src/sp-gradient-test.h
+++ b/src/sp-gradient-test.h
SPGradient *gr = static_cast<SPGradient *>(g_object_new(SP_TYPE_GRADIENT, NULL));
SP_OBJECT(gr)->document = _doc;
- sp_object_set(SP_OBJECT(gr), SP_ATTR_GRADIENTTRANSFORM, "translate(5, 8)");
+ SP_OBJECT(gr)->setKeyValue( SP_ATTR_GRADIENTTRANSFORM, "translate(5, 8)");
TS_ASSERT_EQUALS( gr->gradientTransform, Geom::Matrix(Geom::Translate(5, 8)) );
- sp_object_set(SP_OBJECT(gr), SP_ATTR_GRADIENTTRANSFORM, "");
+ SP_OBJECT(gr)->setKeyValue( SP_ATTR_GRADIENTTRANSFORM, "");
TS_ASSERT_EQUALS( gr->gradientTransform, Geom::identity() );
- sp_object_set(SP_OBJECT(gr), SP_ATTR_GRADIENTTRANSFORM, "rotate(90)");
+ SP_OBJECT(gr)->setKeyValue( SP_ATTR_GRADIENTTRANSFORM, "rotate(90)");
TS_ASSERT_EQUALS( gr->gradientTransform, Geom::Matrix(rotate_degrees(90)) );
g_object_unref(gr);
SPGradient *gr = static_cast<SPGradient *>(g_object_new(SP_TYPE_GRADIENT, NULL));
SP_OBJECT(gr)->document = _doc;
- sp_object_set(SP_OBJECT(gr), SP_ATTR_GRADIENTTRANSFORM, "matrix(0, 1, -1, 0, 0, 0)");
+ SP_OBJECT(gr)->setKeyValue( SP_ATTR_GRADIENTTRANSFORM, "matrix(0, 1, -1, 0, 0, 0)");
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(_doc);
Inkscape::XML::Node *repr = xml_doc->createElement("svg:radialGradient");
SP_OBJECT(gr)->updateRepr(repr, SP_OBJECT_WRITE_ALL);
sp_gradient_set_gs2d_matrix(gr, funny, larger_rect, gs2d);
TS_ASSERT( Geom::matrix_equalp(gr->gradientTransform, grXform, 1e-12) );
- sp_object_set(SP_OBJECT(gr), SP_ATTR_GRADIENTUNITS, "userSpaceOnUse");
+ SP_OBJECT(gr)->setKeyValue( SP_ATTR_GRADIENTUNITS, "userSpaceOnUse");
Geom::Matrix const user_g2d(sp_gradient_get_g2d_matrix(gr, funny, larger_rect));
Geom::Matrix const user_gs2d(sp_gradient_get_gs2d_matrix(gr, funny, larger_rect));
TS_ASSERT_EQUALS( user_g2d, funny );
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index 604da3b7cfffb5c4337750ac8efd40d91ba681ab..56ddd09d956d23dfb5f1b002c635b31fd35be0e3 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
@@ -141,10 +141,10 @@ static void sp_stop_build(SPObject *object, SPDocument *document, Inkscape::XML:
if (((SPObjectClass *) stop_parent_class)->build)
(* ((SPObjectClass *) stop_parent_class)->build)(object, document, repr);
- sp_object_read_attr(object, "offset");
- sp_object_read_attr(object, "stop-color");
- sp_object_read_attr(object, "stop-opacity");
- sp_object_read_attr(object, "style");
+ object->readAttr( "offset");
+ object->readAttr( "stop-color");
+ object->readAttr( "stop-opacity");
+ object->readAttr( "style");
}
/**
* stop-color and stop-opacity properties.
*/
{
- gchar const *p = sp_object_get_style_property(object, "stop-color", "black");
+ gchar const *p = object->getStyleProperty( "stop-color", "black");
if (streq(p, "currentColor")) {
stop->currentColor = true;
} else {
}
}
{
- gchar const *p = sp_object_get_style_property(object, "stop-opacity", "1");
+ gchar const *p = object->getStyleProperty( "stop-opacity", "1");
gdouble opacity = sp_svg_read_percentage(p, stop->opacity);
stop->opacity = opacity;
}
}
case SP_PROP_STOP_COLOR: {
{
- gchar const *p = sp_object_get_style_property(object, "stop-color", "black");
+ gchar const *p = object->getStyleProperty( "stop-color", "black");
if (streq(p, "currentColor")) {
stop->currentColor = true;
} else {
}
case SP_PROP_STOP_OPACITY: {
{
- gchar const *p = sp_object_get_style_property(object, "stop-opacity", "1");
+ gchar const *p = object->getStyleProperty( "stop-opacity", "1");
gdouble opacity = sp_svg_read_percentage(p, stop->opacity);
stop->opacity = opacity;
}
* value depends on user agent, and don't give any further restrictions that I can
* see.) */
if (stop->currentColor) {
- char const *str = sp_object_get_style_property(stop, "color", NULL);
+ char const *str = stop->getStyleProperty( "color", NULL);
if (str) {
rgb0 = sp_svg_read_color(str, rgb0);
}
sp_stop_get_color(SPStop const *const stop)
{
if (stop->currentColor) {
- char const *str = sp_object_get_style_property(stop, "color", NULL);
+ char const *str = stop->getStyleProperty( "color", NULL);
guint32 const dfl = 0;
/* Default value: arbitrarily black. (SVG1.1 and CSS2 both say that the initial
* value depends on user agent, and don't give any further restrictions that I can
@@ -433,10 +433,10 @@ void SPGradientImpl::build(SPObject *object, SPDocument *document, Inkscape::XML
}
}
- sp_object_read_attr(object, "gradientUnits");
- sp_object_read_attr(object, "gradientTransform");
- sp_object_read_attr(object, "spreadMethod");
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "gradientUnits");
+ object->readAttr( "gradientTransform");
+ object->readAttr( "spreadMethod");
+ object->readAttr( "xlink:href");
/* Register ourselves */
document->add_resource("gradient", object);
if (((SPObjectClass *) lg_parent_class)->build)
(* ((SPObjectClass *) lg_parent_class)->build)(object, document, repr);
- sp_object_read_attr(object, "x1");
- sp_object_read_attr(object, "y1");
- sp_object_read_attr(object, "x2");
- sp_object_read_attr(object, "y2");
+ object->readAttr( "x1");
+ object->readAttr( "y1");
+ object->readAttr( "x2");
+ object->readAttr( "y2");
}
/**
@@ -1769,11 +1769,11 @@ sp_radialgradient_build(SPObject *object, SPDocument *document, Inkscape::XML::N
if (((SPObjectClass *) rg_parent_class)->build)
(* ((SPObjectClass *) rg_parent_class)->build)(object, document, repr);
- sp_object_read_attr(object, "cx");
- sp_object_read_attr(object, "cy");
- sp_object_read_attr(object, "r");
- sp_object_read_attr(object, "fx");
- sp_object_read_attr(object, "fy");
+ object->readAttr( "cx");
+ object->readAttr( "cy");
+ object->readAttr( "r");
+ object->readAttr( "fx");
+ object->readAttr( "fy");
}
/**
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 955d4fedcee4d457da285d57277dc091690f45f0..e43c3056d4ad635b5f2566b8e4e93ec5d65fd9b5 100644 (file)
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -158,8 +158,8 @@ static void sp_guide_build(SPObject *object, SPDocument *document, Inkscape::XML
(* ((SPObjectClass *) (parent_class))->build)(object, document, repr);
}
- sp_object_read_attr(object, "orientation");
- sp_object_read_attr(object, "position");
+ object->readAttr( "orientation");
+ object->readAttr( "position");
}
static void sp_guide_release(SPObject *object)
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 33038d73ca11104a951295bc96fd0e49875c7049..ae7ac6fa34972652dd67622d8969435797dbd2cb 100644 (file)
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -637,13 +637,13 @@ sp_image_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
((SPObjectClass *) parent_class)->build (object, document, repr);
}
- sp_object_read_attr (object, "xlink:href");
- sp_object_read_attr (object, "x");
- sp_object_read_attr (object, "y");
- sp_object_read_attr (object, "width");
- sp_object_read_attr (object, "height");
- sp_object_read_attr (object, "preserveAspectRatio");
- sp_object_read_attr (object, "color-profile");
+ object->readAttr( "xlink:href");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "width");
+ object->readAttr( "height");
+ object->readAttr( "preserveAspectRatio");
+ object->readAttr( "color-profile");
/* Register */
document->add_resource ("image", object);
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 79a673e053b1da9b9c20f56256ac62e7bcd00d77..5b15ca326c068f04ac31f63b64b9975704bdc8ea 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
static void sp_group_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- sp_object_read_attr(object, "inkscape:groupmode");
+ object->readAttr( "inkscape:groupmode");
if (((SPObjectClass *)parent_class)->build) {
((SPObjectClass *)parent_class)->build(object, document, repr);
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 7f67caee830d326447f7b750b0d6019fad307fe9..ae77f9d8420003b4e3920a186883e4538cfaf3eb 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
void
SPItem::sp_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- sp_object_read_attr(object, "style");
- sp_object_read_attr(object, "transform");
- sp_object_read_attr(object, "clip-path");
- sp_object_read_attr(object, "mask");
- sp_object_read_attr(object, "sodipodi:insensitive");
- sp_object_read_attr(object, "sodipodi:nonprintable");
- sp_object_read_attr(object, "inkscape:transform-center-x");
- sp_object_read_attr(object, "inkscape:transform-center-y");
- sp_object_read_attr(object, "inkscape:connector-avoid");
- sp_object_read_attr(object, "inkscape:connection-points");
+ object->readAttr( "style");
+ object->readAttr( "transform");
+ object->readAttr( "clip-path");
+ object->readAttr( "mask");
+ object->readAttr( "sodipodi:insensitive");
+ object->readAttr( "sodipodi:nonprintable");
+ object->readAttr( "inkscape:transform-center-x");
+ object->readAttr( "inkscape:transform-center-y");
+ object->readAttr( "inkscape:connector-avoid");
+ object->readAttr( "inkscape:connection-points");
if (((SPObjectClass *) (SPItemClass::static_parent_class))->build) {
(* ((SPObjectClass *) (SPItemClass::static_parent_class))->build)(object, document, repr);
void
SPItem::doWriteTransform(Inkscape::XML::Node *repr, Geom::Matrix const &transform, Geom::Matrix const *adv, bool compensate)
{
- g_return_if_fail(this != NULL);
- g_return_if_fail(SP_IS_ITEM(this));
+ //g_return_if_fail(this != NULL);
+ //g_return_if_fail(SP_IS_ITEM(this));
g_return_if_fail(repr != NULL);
// calculate the relative transform, if not given by the adv attribute
diff --git a/src/sp-line.cpp b/src/sp-line.cpp
index 878fceb6736ddddbc4834d26b3c81bf795786a16..6d3d2aea7ffcea8c199a1cc71eb878b2a6d3213f 100644 (file)
--- a/src/sp-line.cpp
+++ b/src/sp-line.cpp
@@ -104,10 +104,10 @@ SPLine::sp_line_build (SPObject * object, SPDocument * document, Inkscape::XML::
((SPObjectClass *) SPLineClass::static_parent_class)->build (object, document, repr);
}
- sp_object_read_attr (object, "x1");
- sp_object_read_attr (object, "y1");
- sp_object_read_attr (object, "x2");
- sp_object_read_attr (object, "y2");
+ object->readAttr( "x1");
+ object->readAttr( "y1");
+ object->readAttr( "x2");
+ object->readAttr( "y2");
}
void
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 6c49b79c15cb14af20535b8188332767ec341585..655c4b27e1653980d7908fd1511446b61c23d841 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
static void
sp_lpe_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- sp_object_read_attr(object, "inkscape:path-effect");
+ object->readAttr( "inkscape:path-effect");
if (((SPObjectClass *) parent_class)->build) {
((SPObjectClass *) parent_class)->build(object, document, repr);
diff --git a/src/sp-mask.cpp b/src/sp-mask.cpp
index 0c28cd014f7fd121f2a4c3fe10959190a41dbfc5..26ddfa0093884cdc9913587c7e2833e653f90a0d 100644 (file)
--- a/src/sp-mask.cpp
+++ b/src/sp-mask.cpp
@@ -104,8 +104,8 @@ sp_mask_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr
((SPObjectClass *) parent_class)->build (object, document, repr);
}
- sp_object_read_attr (object, "maskUnits");
- sp_object_read_attr (object, "maskContentUnits");
+ object->readAttr( "maskUnits");
+ object->readAttr( "maskContentUnits");
/* Register ourselves */
document->add_resource ("mask", object);
index d15000fcb3f5fd06e7630a79dba4b09863293c4c..9833a699593e019ba472fd94408dc2a7daae23d2 100644 (file)
--- a/src/sp-missing-glyph.cpp
+++ b/src/sp-missing-glyph.cpp
@@ -82,11 +82,11 @@ static void sp_missing_glyph_build(SPObject *object, SPDocument *document, Inksc
((SPObjectClass *) (parent_class))->build(object, document, repr);
}
- sp_object_read_attr(object, "d");
- sp_object_read_attr(object, "horiz-adv-x");
- sp_object_read_attr(object, "vert-origin-x");
- sp_object_read_attr(object, "vert-origin-y");
- sp_object_read_attr(object, "vert-adv-y");
+ object->readAttr( "d");
+ object->readAttr( "horiz-adv-x");
+ object->readAttr( "vert-origin-x");
+ object->readAttr( "vert-origin-y");
+ object->readAttr( "vert-adv-y");
}
static void sp_missing_glyph_release(SPObject *object)
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 52c42866ea14c45a69d6dd40e960de1a6ce33438..7c974802ea0e90411e29e18db842ae25c92b40eb 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -217,53 +217,53 @@ static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape:
(* ((SPObjectClass *) (parent_class))->build)(object, document, repr);
}
- sp_object_read_attr(object, "inkscape:document-units");
- sp_object_read_attr(object, "viewonly");
- sp_object_read_attr(object, "showguides");
- sp_object_read_attr(object, "showgrid");
- sp_object_read_attr(object, "gridtolerance");
- sp_object_read_attr(object, "guidetolerance");
- sp_object_read_attr(object, "objecttolerance");
- sp_object_read_attr(object, "guidecolor");
- sp_object_read_attr(object, "guideopacity");
- sp_object_read_attr(object, "guidehicolor");
- sp_object_read_attr(object, "guidehiopacity");
- sp_object_read_attr(object, "showborder");
- sp_object_read_attr(object, "inkscape:showpageshadow");
- sp_object_read_attr(object, "borderlayer");
- sp_object_read_attr(object, "bordercolor");
- sp_object_read_attr(object, "borderopacity");
- sp_object_read_attr(object, "pagecolor");
- sp_object_read_attr(object, "inkscape:pageopacity");
- sp_object_read_attr(object, "inkscape:pageshadow");
- sp_object_read_attr(object, "inkscape:zoom");
- sp_object_read_attr(object, "inkscape:cx");
- sp_object_read_attr(object, "inkscape:cy");
- sp_object_read_attr(object, "inkscape:window-width");
- sp_object_read_attr(object, "inkscape:window-height");
- sp_object_read_attr(object, "inkscape:window-x");
- sp_object_read_attr(object, "inkscape:window-y");
- sp_object_read_attr(object, "inkscape:window-maximized");
- sp_object_read_attr(object, "inkscape:snap-global");
- sp_object_read_attr(object, "inkscape:snap-bbox");
- sp_object_read_attr(object, "inkscape:snap-nodes");
- sp_object_read_attr(object, "inkscape:snap-from-guide");
- sp_object_read_attr(object, "inkscape:snap-center");
- sp_object_read_attr(object, "inkscape:snap-smooth-nodes");
- sp_object_read_attr(object, "inkscape:snap-midpoints");
- sp_object_read_attr(object, "inkscape:snap-object-midpoints");
- sp_object_read_attr(object, "inkscape:snap-bbox-edge-midpoints");
- sp_object_read_attr(object, "inkscape:snap-bbox-midpoints");
- sp_object_read_attr(object, "inkscape:snap-to-guides");
- sp_object_read_attr(object, "inkscape:snap-grids");
- sp_object_read_attr(object, "inkscape:snap-intersection-paths");
- sp_object_read_attr(object, "inkscape:object-paths");
- sp_object_read_attr(object, "inkscape:object-nodes");
- sp_object_read_attr(object, "inkscape:bbox-paths");
- sp_object_read_attr(object, "inkscape:bbox-nodes");
- sp_object_read_attr(object, "inkscape:snap-page");
- sp_object_read_attr(object, "inkscape:current-layer");
- sp_object_read_attr(object, "inkscape:connector-spacing");
+ object->readAttr( "inkscape:document-units");
+ object->readAttr( "viewonly");
+ object->readAttr( "showguides");
+ object->readAttr( "showgrid");
+ object->readAttr( "gridtolerance");
+ object->readAttr( "guidetolerance");
+ object->readAttr( "objecttolerance");
+ object->readAttr( "guidecolor");
+ object->readAttr( "guideopacity");
+ object->readAttr( "guidehicolor");
+ object->readAttr( "guidehiopacity");
+ object->readAttr( "showborder");
+ object->readAttr( "inkscape:showpageshadow");
+ object->readAttr( "borderlayer");
+ object->readAttr( "bordercolor");
+ object->readAttr( "borderopacity");
+ object->readAttr( "pagecolor");
+ object->readAttr( "inkscape:pageopacity");
+ object->readAttr( "inkscape:pageshadow");
+ object->readAttr( "inkscape:zoom");
+ object->readAttr( "inkscape:cx");
+ object->readAttr( "inkscape:cy");
+ object->readAttr( "inkscape:window-width");
+ object->readAttr( "inkscape:window-height");
+ object->readAttr( "inkscape:window-x");
+ object->readAttr( "inkscape:window-y");
+ object->readAttr( "inkscape:window-maximized");
+ object->readAttr( "inkscape:snap-global");
+ object->readAttr( "inkscape:snap-bbox");
+ object->readAttr( "inkscape:snap-nodes");
+ object->readAttr( "inkscape:snap-from-guide");
+ object->readAttr( "inkscape:snap-center");
+ object->readAttr( "inkscape:snap-smooth-nodes");
+ object->readAttr( "inkscape:snap-midpoints");
+ object->readAttr( "inkscape:snap-object-midpoints");
+ object->readAttr( "inkscape:snap-bbox-edge-midpoints");
+ object->readAttr( "inkscape:snap-bbox-midpoints");
+ object->readAttr( "inkscape:snap-to-guides");
+ object->readAttr( "inkscape:snap-grids");
+ object->readAttr( "inkscape:snap-intersection-paths");
+ object->readAttr( "inkscape:object-paths");
+ object->readAttr( "inkscape:object-nodes");
+ object->readAttr( "inkscape:bbox-paths");
+ object->readAttr( "inkscape:bbox-nodes");
+ object->readAttr( "inkscape:snap-page");
+ object->readAttr( "inkscape:current-layer");
+ object->readAttr( "inkscape:connector-spacing");
/* Construct guideline list */
for (SPObject *o = SP_OBJECT(og)->first_child() ; o != NULL; o = SP_OBJECT_NEXT(o) ) {
{
SPException ex;
SP_EXCEPTION_INIT(&ex);
- return sp_object_getAttribute(SP_OBJECT(this), "id", &ex);
+ return SP_OBJECT(this)->getAttribute("id", &ex);
}
guint SPNamedView::getViewCount()
diff --git a/src/sp-object-repr.h b/src/sp-object-repr.h
index f3a80f83c77a1259279d1f3b99dfd85b08a3828c..d1501fe3e9664918822fe59fb1b7e054f548449a 100644 (file)
--- a/src/sp-object-repr.h
+++ b/src/sp-object-repr.h
*/
#include "forward.h"
-
+#include "sp-object.h"
namespace Inkscape {
namespace XML {
class Node;
}
-SPObject *sp_object_repr_build_tree (SPDocument *document, Inkscape::XML::Node *repr);
+SPObject * sp_object_repr_build_tree (SPDocument *document, Inkscape::XML::Node *repr);
GType sp_repr_type_lookup (Inkscape::XML::Node *repr);
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index f81d5bdb59897b5d5a1ce18c452d5b267367ea5c..f23f374d47f030284bd43cd7231ff682a158807c 100644 (file)
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
# define debug(f, a...) /**/
#endif
-static void sp_object_class_init(SPObjectClass *klass);
+/*static void sp_object_class_init(SPObjectClass *klass);
static void sp_object_init(SPObject *object);
static void sp_object_finalize(GObject *object);
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::Document *doc, Inkscape::XML::Node *repr, guint flags);
-/* Real handlers of repr signals */
+* Real handlers of repr signals */
-static void sp_object_repr_attr_changed(Inkscape::XML::Node *repr, gchar const *key, gchar const *oldval, gchar const *newval, bool is_interactive, gpointer data);
+/*static void sp_object_repr_attr_changed(Inkscape::XML::Node *repr, gchar const *key, gchar const *oldval, gchar const *newval, bool is_interactive, gpointer data);
static void sp_object_repr_content_changed(Inkscape::XML::Node *repr, gchar const *oldcontent, gchar const *newcontent, gpointer data);
@@ -100,16 +100,16 @@ static void sp_object_repr_child_removed(Inkscape::XML::Node *repr, Inkscape::XM
static void sp_object_repr_order_changed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data);
-static gchar *sp_object_get_unique_id(SPObject *object, gchar const *defid);
+static gchar *sp_object_get_unique_id(SPObject *object, gchar const *defid);*/
guint update_in_progress = 0; // guard against update-during-update
Inkscape::XML::NodeEventVector object_event_vector = {
- sp_object_repr_child_added,
- sp_object_repr_child_removed,
- sp_object_repr_attr_changed,
- sp_object_repr_content_changed,
- sp_object_repr_order_changed
+ SPObject::sp_object_repr_child_added,
+ SPObject::sp_object_repr_child_removed,
+ SPObject::sp_object_repr_attr_changed,
+ SPObject::sp_object_repr_content_changed,
+ SPObject::sp_object_repr_order_changed
};
// A friend class used to set internal members on SPObject so as to not expose settors in SPObject's public API
};
-static GObjectClass *parent_class;
+//static GObjectClass *parent_class;
+
+GObjectClass * SPObjectClass::static_parent_class = 0;
/**
* Registers the SPObject class with Gdk and returns its type number.
*/
GType
-sp_object_get_type(void)
+SPObject::sp_object_get_type()
{
static GType type = 0;
if (!type) {
GTypeInfo info = {
sizeof(SPObjectClass),
NULL, NULL,
- (GClassInitFunc) sp_object_class_init,
+ (GClassInitFunc) SPObjectClass::sp_object_class_init,
NULL, NULL,
sizeof(SPObject),
16,
/**
* Initializes the SPObject vtable.
*/
-static void
-sp_object_class_init(SPObjectClass *klass)
+void
+SPObjectClass::sp_object_class_init(SPObjectClass *klass)
{
GObjectClass *object_class;
object_class = (GObjectClass *) klass;
- parent_class = (GObjectClass *) g_type_class_ref(G_TYPE_OBJECT);
+ static_parent_class = (GObjectClass *) g_type_class_ref(G_TYPE_OBJECT);
- object_class->finalize = sp_object_finalize;
+ object_class->finalize = SPObject::sp_object_finalize;
- klass->child_added = sp_object_child_added;
- klass->remove_child = sp_object_remove_child;
- klass->order_changed = sp_object_order_changed;
+ klass->child_added = SPObject::sp_object_child_added;
+ klass->remove_child = SPObject::sp_object_remove_child;
+ klass->order_changed = SPObject::sp_object_order_changed;
- klass->release = sp_object_release;
+ klass->release = SPObject::sp_object_release;
- klass->build = sp_object_build;
+ klass->build = SPObject::sp_object_build;
- klass->set = sp_object_private_set;
- klass->write = sp_object_private_write;
+ klass->set = SPObject::sp_object_private_set;
+ klass->write = SPObject::sp_object_private_write;
}
/**
* Callback to initialize the SPObject object.
*/
-static void
-sp_object_init(SPObject *object)
+void
+SPObject::sp_object_init(SPObject *object)
{
debug("id=%x, typename=%s",object, g_type_name_from_instance((GTypeInstance*)object));
/**
* Callback to destroy all members and connections of object and itself.
*/
-static void
-sp_object_finalize(GObject *object)
+void
+SPObject::sp_object_finalize(GObject *object)
{
SPObject *spobject = (SPObject *)object;
spobject->_successor = NULL;
}
- if (((GObjectClass *) (parent_class))->finalize) {
- (* ((GObjectClass *) (parent_class))->finalize)(object);
+ if (((GObjectClass *) (SPObjectClass::static_parent_class))->finalize) {
+ (* ((GObjectClass *) (SPObjectClass::static_parent_class))->finalize)(object);
}
spobject->_release_signal.~signal();
* Callback for child_added event.
* Invoked whenever the given mutation event happens in the XML tree.
*/
-static void
-sp_object_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
+void
+SPObject::sp_object_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
{
GType type = sp_repr_type_lookup(child);
if (!type) {
@@ -780,7 +782,7 @@ sp_object_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XM
* SPRoot destroys the whole document tree.
* \see sp_object_build()
*/
-static void sp_object_release(SPObject *object)
+void SPObject::sp_object_release(SPObject *object)
{
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
while (object->children) {
* tree, BEFORE removal from the XML tree happens, so grouping
* objects can safely release the child data.
*/
-static void
-sp_object_remove_child(SPObject *object, Inkscape::XML::Node *child)
+void
+SPObject::sp_object_remove_child(SPObject *object, Inkscape::XML::Node *child)
{
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
SPObject *ochild = object->get_child_by_repr(child);
* Invoked whenever the given mutation event happens in the XML tree.
* \param old_ref Ignored
*/
-static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node */*old_ref*/,
+void SPObject::sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node */*old_ref*/,
Inkscape::XML::Node *new_ref)
{
SPObject *ochild = object->get_child_by_repr(child);
@@ -833,15 +835,15 @@ static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child
* SPDocument does after the creation of the XML tree).
* \see sp_object_release()
*/
-static void
-sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
+void
+SPObject::sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
/* Nothing specific here */
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
- sp_object_read_attr(object, "xml:space");
- sp_object_read_attr(object, "inkscape:label");
- sp_object_read_attr(object, "inkscape:collect");
+ object->readAttr("xml:space");
+ object->readAttr("inkscape:label");
+ object->readAttr("inkscape:collect");
for (Inkscape::XML::Node *rchild = repr->firstChild() ; rchild != NULL; rchild = rchild->next()) {
GType type = sp_repr_type_lookup(rchild);
@@ -918,6 +920,23 @@ void SPObject::invoke_build(SPDocument *document, Inkscape::XML::Node *repr, uns
sp_repr_add_listener(repr, &object_event_vector, this);
}
+long long int SPObject::getIntAttribute(char const *key, long long int def)
+{
+ return sp_repr_get_int_attribute(getRepr(),key,def);
+}
+
+unsigned SPObject::getPosition(){
+ g_assert(this->repr);
+
+ return repr->position();
+}
+
+void SPObject::appendChild(Inkscape::XML::Node *child) {
+ g_assert(this->repr);
+
+ repr->appendChild(child);
+}
+
void SPObject::releaseReferences() {
g_assert(this->document);
g_assert(this->repr);
SPObject *SPObject::getPrev()
{
- return sp_object_prev(this);
+ return this->prev();
}
/**
* Callback for child_added node event.
*/
-static void
-sp_object_repr_child_added(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data)
+void
+SPObject::sp_object_repr_child_added(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -984,8 +1003,8 @@ sp_object_repr_child_added(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *c
/**
* Callback for remove_child node event.
*/
-static void
-sp_object_repr_child_removed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node */*ref*/, gpointer data)
+void
+SPObject::sp_object_repr_child_removed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node */*ref*/, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -999,8 +1018,8 @@ sp_object_repr_child_removed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node
*
* \todo fixme:
*/
-static void
-sp_object_repr_order_changed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data)
+void
+SPObject::sp_object_repr_order_changed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data)
{
SPObject *object = SP_OBJECT(data);
@@ -1012,8 +1031,8 @@ sp_object_repr_order_changed(Inkscape::XML::Node */*repr*/, Inkscape::XML::Node
/**
* Callback for set event.
*/
-static void
-sp_object_private_set(SPObject *object, unsigned int key, gchar const *value)
+void
+SPObject::sp_object_private_set(SPObject *object, unsigned int key, gchar const *value)
{
g_assert(key != SP_ATTR_INVALID);
@@ -1102,13 +1121,13 @@ sp_object_private_set(SPObject *object, unsigned int key, gchar const *value)
* Call virtual set() function of object.
*/
void
-sp_object_set(SPObject *object, unsigned int key, gchar const *value)
+SPObject::setKeyValue(unsigned int key, gchar const *value)
{
- g_assert(object != NULL);
- g_assert(SP_IS_OBJECT(object));
+ //g_assert(object != NULL);
+ //g_assert(SP_IS_OBJECT(object));
- if (((SPObjectClass *) G_OBJECT_GET_CLASS(object))->set) {
- ((SPObjectClass *) G_OBJECT_GET_CLASS(object))->set(object, key, value);
+ if (((SPObjectClass *) G_OBJECT_GET_CLASS(this))->set) {
+ ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->set(this, key, value);
}
}
* Read value of key attribute from XML node into object.
*/
void
-sp_object_read_attr(SPObject *object, gchar const *key)
+SPObject::readAttr(gchar const *key)
{
- g_assert(object != NULL);
- g_assert(SP_IS_OBJECT(object));
+ //g_assert(object != NULL);
+ //g_assert(SP_IS_OBJECT(object));
g_assert(key != NULL);
//XML Tree being used here.
- g_assert(object->getRepr() != NULL);
+ g_assert(this->getRepr() != NULL);
unsigned int keyid = sp_attribute_lookup(key);
if (keyid != SP_ATTR_INVALID) {
/* Retrieve the 'key' attribute from the object's XML representation */
- gchar const *value = object->getRepr()->attribute(key);
+ gchar const *value = getRepr()->attribute(key);
- sp_object_set(object, keyid, value);
+ setKeyValue(keyid, value);
}
}
/**
* Callback for attr_changed node event.
*/
-static void
-sp_object_repr_attr_changed(Inkscape::XML::Node */*repr*/, gchar const *key, gchar const */*oldval*/, gchar const */*newval*/, bool is_interactive, gpointer data)
+void
+SPObject::sp_object_repr_attr_changed(Inkscape::XML::Node */*repr*/, gchar const *key, gchar const */*oldval*/, gchar const */*newval*/, bool is_interactive, gpointer data)
{
SPObject *object = SP_OBJECT(data);
- sp_object_read_attr(object, key);
+ object->readAttr(key);
// manual changes to extension attributes require the normal
// attributes, which depend on them, to be updated immediately
@@ -1154,8 +1173,8 @@ sp_object_repr_attr_changed(Inkscape::XML::Node */*repr*/, gchar const *key, gch
/**
* Callback for content_changed node event.
*/
-static void
-sp_object_repr_content_changed(Inkscape::XML::Node */*repr*/, gchar const */*oldcontent*/, gchar const */*newcontent*/, gpointer data)
+void
+SPObject::sp_object_repr_content_changed(Inkscape::XML::Node */*repr*/, gchar const */*oldcontent*/, gchar const */*newcontent*/, gpointer data)
{
SPObject *object = SP_OBJECT(data);
/**
* Callback for write event.
*/
-static Inkscape::XML::Node *
-sp_object_private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
+Inkscape::XML::Node *
+SPObject::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(doc);
}
gchar const *
-sp_object_tagName_get(SPObject const *object, SPException *ex)
+SPObject::getTagName(SPException *ex) const
{
+ g_assert(repr != NULL);
/* If exception is not clear, return */
if (!SP_EXCEPTION_IS_OK(ex)) {
return NULL;
/// \todo fixme: Exception if object is NULL? */
//XML Tree being used here.
- return object->getRepr()->name();
+ return getRepr()->name();
}
gchar const *
-sp_object_getAttribute(SPObject const *object, gchar const *key, SPException *ex)
+SPObject::getAttribute(gchar const *key, SPException *ex) const
{
+ g_assert(this->repr != NULL);
/* If exception is not clear, return */
if (!SP_EXCEPTION_IS_OK(ex)) {
return NULL;
@@ -1470,35 +1491,36 @@ sp_object_getAttribute(SPObject const *object, gchar const *key, SPException *ex
/// \todo fixme: Exception if object is NULL? */
//XML Tree being used here.
- return (gchar const *) object->getRepr()->attribute(key);
+ return (gchar const *) getRepr()->attribute(key);
}
void
-sp_object_setAttribute(SPObject *object, gchar const *key, gchar const *value, SPException *ex)
+SPObject::setAttribute(gchar const *key, gchar const *value, SPException *ex)
{
+ g_assert(this->repr != NULL);
/* If exception is not clear, return */
g_return_if_fail(SP_EXCEPTION_IS_OK(ex));
/// \todo fixme: Exception if object is NULL? */
//XML Tree being used here.
- object->getRepr()->setAttribute(key, value, false);
+ getRepr()->setAttribute(key, value, false);
}
void
-sp_object_removeAttribute(SPObject *object, gchar const *key, SPException *ex)
+SPObject::removeAttribute(gchar const *key, SPException *ex)
{
/* If exception is not clear, return */
g_return_if_fail(SP_EXCEPTION_IS_OK(ex));
/// \todo fixme: Exception if object is NULL? */
//XML Tree being used here.
- object->getRepr()->setAttribute(key, NULL, false);
+ getRepr()->setAttribute(key, NULL, false);
}
/* Helper */
-static gchar *
-sp_object_get_unique_id(SPObject *object, gchar const *id)
+gchar *
+SPObject::sp_object_get_unique_id(SPObject *object, gchar const *id)
{
static unsigned long count = 0;
* responsible for ascending the repr tree as necessary.
*/
gchar const *
-sp_object_get_style_property(SPObject const *object, gchar const *key, gchar const *def)
+SPObject::getStyleProperty(gchar const *key, gchar const *def) const
{
- g_return_val_if_fail(object != NULL, NULL);
- g_return_val_if_fail(SP_IS_OBJECT(object), NULL);
+ //g_return_val_if_fail(object != NULL, NULL);
+ //g_return_val_if_fail(SP_IS_OBJECT(object), NULL);
g_return_val_if_fail(key != NULL, NULL);
//XML Tree being used here.
- gchar const *style = object->getRepr()->attribute("style");
+ gchar const *style = getRepr()->attribute("style");
if (style) {
size_t const len = strlen(key);
char const *p;
@@ -1595,12 +1617,12 @@ sp_object_get_style_property(SPObject const *object, gchar const *key, gchar con
}
//XML Tree being used here.
- gchar const *val = object->getRepr()->attribute(key);
+ gchar const *val = getRepr()->attribute(key);
if (val && !streq(val, "inherit")) {
return val;
}
- if (object->parent) {
- return sp_object_get_style_property(object->parent, key, def);
+ if (this->parent) {
+ return (this->parent)->getStyleProperty(key, def);
}
return def;
* Returns previous object in sibling list or NULL.
*/
SPObject *
-sp_object_prev(SPObject *child)
+SPObject::prev()
{
- SPObject *parent = SP_OBJECT_PARENT(child);
+ SPObject *parent = SP_OBJECT_PARENT(this);
for ( SPObject *i = parent->first_child(); i; i = SP_OBJECT_NEXT(i) ) {
- if (SP_OBJECT_NEXT(i) == child)
+ if (SP_OBJECT_NEXT(i) == this)
return i;
}
return NULL;
diff --git a/src/sp-object.h b/src/sp-object.h
index e1d49b041429a16fc9729eddc1c6472edb7a4575..61c69c3aa0177c875b40fdd99024b16e7d19d9ea 100644 (file)
--- a/src/sp-object.h
+++ b/src/sp-object.h
/* SPObject flags */
+class SPObject;
+class SPObjectClass;
+
+#define SP_TYPE_OBJECT (SPObject::sp_object_get_type ())
+#define SP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_OBJECT, SPObject))
+#define SP_OBJECT_CLASS(clazz) (G_TYPE_CHECK_CLASS_CAST((clazz), SP_TYPE_OBJECT, SPObjectClass))
+#define SP_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_OBJECT))
+
/* Async modification flags */
#define SP_OBJECT_MODIFIED_FLAG (1 << 0)
#define SP_OBJECT_CHILD_MODIFIED_FLAG (1 << 1)
#define SP_OBJECT_DOCUMENT(o) (((SPObject *) (o))->document)
#define SP_OBJECT_PARENT(o) (((SPObject *) (o))->parent)
#define SP_OBJECT_NEXT(o) (((SPObject *) (o))->next)
-#define SP_OBJECT_PREV(o) (sp_object_prev((SPObject *) (o)))
+#define SP_OBJECT_PREV(o) (((SPObject *) (o))->prev())
#define SP_OBJECT_HREFCOUNT(o) (((SPObject *) (o))->hrefcount)
#define SP_OBJECT_STYLE(o) (((SPObject *) (o))->style)
-
#include <glib-object.h>
#include <sigc++/connection.h>
#include <sigc++/functors/slot.h>
* Returns the XML representation of tree
*/
//Inkscape::XML::Node const* getRepr() const;
+//protected:
Inkscape::XML::Node * getRepr();
/**
* Returns the XML representation of tree
*/
Inkscape::XML::Node const* getRepr() const;
+public:
/** @brief cleans up an SPObject, releasing its references and
* requesting that references to it be released
return firstChild();
}
void invoke_build(SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned);
+ long long int getIntAttribute(char const *key, long long int def);
+ unsigned getPosition();
+ gchar const * getAttribute(gchar const *name,SPException *ex=0) const;
+ void appendChild(Inkscape::XML::Node *child);
+ void setKeyValue(unsigned int key, gchar const *value);
+ void setAttribute(gchar const *key, gchar const *value, SPException *ex=0);
+ void readAttr(gchar const *key);
+ gchar const *getTagName(SPException *ex) const;
+ void removeAttribute(gchar const *key, SPException *ex=0);
+ gchar const *getStyleProperty(gchar const *key, gchar const *def) const;
+ SPObject *prev();
private:
// Private member functions used in the definitions of setTitle(),
SPObject * findFirstChild(gchar const *tagname) const;
GString * textualContent() const;
+ static void sp_object_init(SPObject *object);
+ static void sp_object_finalize(GObject *object);
+
+ static void sp_object_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
+ static void sp_object_remove_child(SPObject *object, Inkscape::XML::Node *child);
+ static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref);
+
+ static void sp_object_release(SPObject *object);
+ 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::Document *doc, Inkscape::XML::Node *repr, guint flags);
+ static gchar *sp_object_get_unique_id(SPObject *object, gchar const *defid);
+
+ /* Real handlers of repr signals */
+
+ public:
+ static GType sp_object_get_type();
+ static void sp_object_repr_attr_changed(Inkscape::XML::Node *repr, gchar const *key, gchar const *oldval, gchar const *newval, bool is_interactive, gpointer data);
+
+ static void sp_object_repr_content_changed(Inkscape::XML::Node *repr, gchar const *oldcontent, gchar const *newcontent, gpointer data);
+
+ static void sp_object_repr_child_added(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data);
+ static void sp_object_repr_child_removed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, void *data);
+
+ static void sp_object_repr_order_changed(Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data);
+
+
+ friend class SPObjectClass;
friend class SPObjectImpl;
};
/// The SPObject vtable.
-struct SPObjectClass {
+class SPObjectClass {
+ public:
GObjectClass parent_class;
void (* build) (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr);
void (* modified) (SPObject *object, unsigned int flags);
Inkscape::XML::Node * (* write) (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags);
+
+ private:
+ static GObjectClass *static_parent_class;
+ static void sp_object_class_init(SPObjectClass *klass);
+
+ friend class SPObject;
};
//void sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned);
-void sp_object_set(SPObject *object, unsigned int key, gchar const *value);
+//void sp_object_set(SPObject *object, unsigned int key, gchar const *value);
-void sp_object_read_attr(SPObject *object, gchar const *key);
+//void sp_object_read_attr(SPObject *object, gchar const *key);
/* Public */
-gchar const *sp_object_tagName_get(SPObject const *object, SPException *ex);
-gchar const *sp_object_getAttribute(SPObject const *object, gchar const *key, SPException *ex);
-void sp_object_setAttribute(SPObject *object, gchar const *key, gchar const *value, SPException *ex);
-void sp_object_removeAttribute(SPObject *object, gchar const *key, SPException *ex);
+//gchar const *sp_object_tagName_get(SPObject const *object, SPException *ex);
+//gchar const *sp_object_getAttribute(SPObject const *object, gchar const *key, SPException *ex);
+//void sp_object_setAttribute(SPObject *object, gchar const *key, gchar const *value, SPException *ex);
+//void sp_object_removeAttribute(SPObject *object, gchar const *key, SPException *ex);
/* Style */
-gchar const *sp_object_get_style_property(SPObject const *object,
- gchar const *key, gchar const *def);
+//gchar const *sp_object_get_style_property(SPObject const *object,
+// gchar const *key, gchar const *def);
int sp_object_compare_position(SPObject const *first, SPObject const *second);
-SPObject *sp_object_prev(SPObject *child);
+//SPObject *sp_object_prev(SPObject *child);
#endif // SP_OBJECT_H_SEEN
diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index ff915c92f2b39e0657b7cd286c81a15796970347..fdff5d7b6f377de3e47b04eca43f9b44dcb8e570 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
@@ -219,7 +219,7 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
//XML Tree being used directly here while it shouldn't be.
if (object->getRepr()->attribute("inkscape:radius")) {
- sp_object_read_attr (object, "inkscape:radius");
+ object->readAttr( "inkscape:radius");
} else {
@@ -229,19 +229,19 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
object->getRepr()->setAttribute("inkscape:radius",oldA);
object->getRepr()->setAttribute("sodipodi:radius",NULL);
- sp_object_read_attr (object, "inkscape:radius");
+ object->readAttr( "inkscape:radius");
}
if (object->getRepr()->attribute("inkscape:original")) {
- sp_object_read_attr (object, "inkscape:original");
+ object->readAttr( "inkscape:original");
} else {
gchar const *oldA = object->getRepr()->attribute("sodipodi:original");
object->getRepr()->setAttribute("inkscape:original",oldA);
object->getRepr()->setAttribute("sodipodi:original",NULL);
- sp_object_read_attr (object, "inkscape:original");
+ object->readAttr( "inkscape:original");
}
if (object->getRepr()->attribute("xlink:href")) {
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "xlink:href");
} else {
gchar const *oldA = object->getRepr()->attribute("inkscape:href");
if (oldA) {
@@ -254,7 +254,7 @@ sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
free(nA);
object->getRepr()->setAttribute("inkscape:href",NULL);
}
- sp_object_read_attr (object, "xlink:href");
+ object->readAttr( "xlink:href");
}
}
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 39ed4c657be656ab7fec923f3cc2b7f78dd75859..5a0ff7c08ad247c712b666ca53f469543712a640 100644 (file)
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
/* Are these calls actually necessary? */
- sp_object_read_attr(object, "marker");
- sp_object_read_attr(object, "marker-start");
- sp_object_read_attr(object, "marker-mid");
- sp_object_read_attr(object, "marker-end");
+ object->readAttr( "marker");
+ object->readAttr( "marker-start");
+ object->readAttr( "marker-mid");
+ object->readAttr( "marker-end");
sp_conn_end_pair_build(object);
@@ -225,13 +225,13 @@ sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
((SPObjectClass *) parent_class)->build(object, document, repr);
}
- sp_object_read_attr(object, "inkscape:original-d");
- sp_object_read_attr(object, "d");
+ object->readAttr( "inkscape:original-d");
+ object->readAttr( "d");
/* d is a required attribute */
- gchar const *d = sp_object_getAttribute(object, "d", NULL);
+ gchar const *d = object->getAttribute("d", NULL);
if (d == NULL) {
- sp_object_set(object, sp_attribute_lookup("d"), "");
+ object->setKeyValue( sp_attribute_lookup("d"), "");
}
}
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp
index 3958da66a9579e7e09d9999cd67ee390f8d19cb4..779edc3e83d3e7a6788c6f5dd1025700592da231 100644 (file)
--- a/src/sp-pattern.cpp
+++ b/src/sp-pattern.cpp
@@ -156,15 +156,15 @@ sp_pattern_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *r
if (((SPObjectClass *) pattern_parent_class)->build)
(* ((SPObjectClass *) pattern_parent_class)->build) (object, document, repr);
- sp_object_read_attr (object, "patternUnits");
- sp_object_read_attr (object, "patternContentUnits");
- sp_object_read_attr (object, "patternTransform");
- sp_object_read_attr (object, "x");
- sp_object_read_attr (object, "y");
- sp_object_read_attr (object, "width");
- sp_object_read_attr (object, "height");
- sp_object_read_attr (object, "viewBox");
- sp_object_read_attr (object, "xlink:href");
+ object->readAttr( "patternUnits");
+ object->readAttr( "patternContentUnits");
+ object->readAttr( "patternTransform");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "width");
+ object->readAttr( "height");
+ object->readAttr( "viewBox");
+ object->readAttr( "xlink:href");
/* Register ourselves */
document->add_resource ("pattern", object);
diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp
index 014c68c9b75652ba8af992a904325b2c0daca8db..b947e45ec0016cfeb50be080a1d0f154e2a547c9 100644 (file)
--- a/src/sp-polygon.cpp
+++ b/src/sp-polygon.cpp
((SPObjectClass *) parent_class)->build(object, document, repr);
}
- sp_object_read_attr(object, "points");
+ object->readAttr( "points");
}
diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp
index 110fb4d019626b19846f1d38271409217b42040b..b5eb81a110d9863d0b31da3f53d7fd42e4e82e69 100644 (file)
--- a/src/sp-polyline.cpp
+++ b/src/sp-polyline.cpp
if (((SPObjectClass *) SPPolyLineClass::static_parent_class)->build)
((SPObjectClass *) SPPolyLineClass::static_parent_class)->build (object, document, repr);
- sp_object_read_attr (object, "points");
+ object->readAttr( "points");
}
void
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index f4993cdc96d762e405687ce37481a023f470cccf..4e417f35b63711458111cdfea54224a66fefdd7b 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
@@ -113,12 +113,12 @@ sp_rect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build(object, document, repr);
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "width");
- sp_object_read_attr(object, "height");
- sp_object_read_attr(object, "rx");
- sp_object_read_attr(object, "ry");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "width");
+ object->readAttr( "height");
+ object->readAttr( "rx");
+ object->readAttr( "ry");
}
static void
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index e73e83a7f27156428c8fd8cbde6c8d1b057acceb..ad43bb3db1d3f42e52c26a29e45c287176b55066 100644 (file)
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
@@ -151,16 +151,16 @@ sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
repr->setAttribute("version", SVG_VERSION);
}
- sp_object_read_attr(object, "version");
- sp_object_read_attr(object, "inkscape:version");
+ object->readAttr( "version");
+ object->readAttr( "inkscape:version");
/* It is important to parse these here, so objects will have viewport build-time */
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "width");
- sp_object_read_attr(object, "height");
- sp_object_read_attr(object, "viewBox");
- sp_object_read_attr(object, "preserveAspectRatio");
- sp_object_read_attr(object, "onload");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "width");
+ object->readAttr( "height");
+ object->readAttr( "viewBox");
+ object->readAttr( "preserveAspectRatio");
+ object->readAttr( "onload");
if (((SPObjectClass *) parent_class)->build)
(* ((SPObjectClass *) parent_class)->build) (object, document, repr);
diff --git a/src/sp-script.cpp b/src/sp-script.cpp
index 61418701307492253635f24fb63be43d1daba580..6cf120a6578672fa736f916119115f0da356de40 100644 (file)
--- a/src/sp-script.cpp
+++ b/src/sp-script.cpp
}
//Read values of key attributes from XML nodes into object.
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "xlink:href");
document->add_resource("script", object);
}
diff --git a/src/sp-skeleton.cpp b/src/sp-skeleton.cpp
index ec6c9b437534b6b30bdb96f57200f613eb270b36..f67341826f54262f7e221cd188ea3fe058e33154 100644 (file)
--- a/src/sp-skeleton.cpp
+++ b/src/sp-skeleton.cpp
@@ -110,18 +110,18 @@ sp_skeleton_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *r
/*
Pay attention to certain settings here
- sp_object_read_attr(object, "xlink:href");
- sp_object_read_attr(object, "attributeName");
- sp_object_read_attr(object, "attributeType");
- sp_object_read_attr(object, "begin");
- sp_object_read_attr(object, "dur");
- sp_object_read_attr(object, "end");
- sp_object_read_attr(object, "min");
- sp_object_read_attr(object, "max");
- sp_object_read_attr(object, "restart");
- sp_object_read_attr(object, "repeatCount");
- sp_object_read_attr(object, "repeatDur");
- sp_object_read_attr(object, "fill");
+ object->readAttr( "xlink:href");
+ object->readAttr( "attributeName");
+ object->readAttr( "attributeType");
+ object->readAttr( "begin");
+ object->readAttr( "dur");
+ object->readAttr( "end");
+ object->readAttr( "min");
+ object->readAttr( "max");
+ object->readAttr( "restart");
+ object->readAttr( "repeatCount");
+ object->readAttr( "repeatDur");
+ object->readAttr( "fill");
*/
}
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index fd44cc4ba05435dd16af32b0c69da1030371be97..3acc34d2ab64d63f9c99130fa9a0480088357908 100644 (file)
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
@@ -129,13 +129,13 @@ sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node *
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build (object, document, repr);
- sp_object_read_attr (object, "sodipodi:cx");
- sp_object_read_attr (object, "sodipodi:cy");
- sp_object_read_attr (object, "sodipodi:expansion");
- sp_object_read_attr (object, "sodipodi:revolution");
- sp_object_read_attr (object, "sodipodi:radius");
- sp_object_read_attr (object, "sodipodi:argument");
- sp_object_read_attr (object, "sodipodi:t0");
+ object->readAttr( "sodipodi:cx");
+ object->readAttr( "sodipodi:cy");
+ object->readAttr( "sodipodi:expansion");
+ object->readAttr( "sodipodi:revolution");
+ object->readAttr( "sodipodi:radius");
+ object->readAttr( "sodipodi:argument");
+ object->readAttr( "sodipodi:t0");
}
/**
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index 618d4520ee86d5229849caef307a2eb68c0c2400..0d74cf780e6eb9cd23663049a265ee1f4d37e67f 100644 (file)
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
@@ -118,16 +118,16 @@ sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * r
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build (object, document, repr);
- sp_object_read_attr (object, "sodipodi:cx");
- sp_object_read_attr (object, "sodipodi:cy");
- sp_object_read_attr (object, "sodipodi:sides");
- sp_object_read_attr (object, "sodipodi:r1");
- sp_object_read_attr (object, "sodipodi:r2");
- sp_object_read_attr (object, "sodipodi:arg1");
- sp_object_read_attr (object, "sodipodi:arg2");
- sp_object_read_attr (object, "inkscape:flatsided");
- sp_object_read_attr (object, "inkscape:rounded");
- sp_object_read_attr (object, "inkscape:randomized");
+ object->readAttr( "sodipodi:cx");
+ object->readAttr( "sodipodi:cy");
+ object->readAttr( "sodipodi:sides");
+ object->readAttr( "sodipodi:r1");
+ object->readAttr( "sodipodi:r2");
+ object->readAttr( "sodipodi:arg1");
+ object->readAttr( "sodipodi:arg2");
+ object->readAttr( "inkscape:flatsided");
+ object->readAttr( "inkscape:rounded");
+ object->readAttr( "inkscape:randomized");
}
static Inkscape::XML::Node *
index 38dc1d367a68feb62abbbabd63ad204684a88306..9b096c86100851aed3031880927651d2759240ec 100644 (file)
--- a/src/sp-style-elem-test.h
+++ b/src/sp-style-elem-test.h
SPStyleElem *style_elem = static_cast<SPStyleElem *>(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
SP_OBJECT(style_elem)->document = _doc;
- sp_object_set(SP_OBJECT(style_elem), SP_ATTR_TYPE, "something unrecognized");
+ SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "something unrecognized");
TS_ASSERT( !style_elem->is_css );
- sp_object_set(SP_OBJECT(style_elem), SP_ATTR_TYPE, "text/css");
+ SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "text/css");
TS_ASSERT( style_elem->is_css );
- sp_object_set(SP_OBJECT(style_elem), SP_ATTR_TYPE, "atext/css");
+ SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "atext/css");
TS_ASSERT( !style_elem->is_css );
- sp_object_set(SP_OBJECT(style_elem), SP_ATTR_TYPE, "text/cssx");
+ SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "text/cssx");
TS_ASSERT( !style_elem->is_css );
g_object_unref(style_elem);
SPStyleElem *style_elem = SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
SP_OBJECT(style_elem)->document = _doc;
- sp_object_set(SP_OBJECT(style_elem), SP_ATTR_TYPE, "text/css");
+ SP_OBJECT(style_elem)->setKeyValue( SP_ATTR_TYPE, "text/css");
Inkscape::XML::Node *repr = sp_document_repr_doc(_doc)->createElement("svg:style");
SP_OBJECT(style_elem)->updateRepr(sp_document_repr_doc(_doc), repr, SP_OBJECT_WRITE_ALL);
{
diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp
index bb4ccb2e1d380df52489cb8018564a23efda2b7b..68d8e88703900acb0b922ef31cfffd50c5546703 100644 (file)
--- a/src/sp-style-elem.cpp
+++ b/src/sp-style-elem.cpp
{
sp_style_elem_read_content(object);
- sp_object_read_attr(object, "type");
- sp_object_read_attr(object, "media");
+ object->readAttr( "type");
+ object->readAttr( "media");
static Inkscape::XML::NodeEventVector const nodeEventVector = {
child_add_rm_cb, // child_added
diff --git a/src/sp-symbol.cpp b/src/sp-symbol.cpp
index 0dab82bc99edb73e4a32ae9cc99c9d6a843e750a..262cfa6a062caed964319b38baffdb2cda7c269e 100644 (file)
--- a/src/sp-symbol.cpp
+++ b/src/sp-symbol.cpp
@@ -110,8 +110,8 @@ sp_symbol_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *re
group = (SPGroup *) object;
symbol = (SPSymbol *) object;
- sp_object_read_attr (object, "viewBox");
- sp_object_read_attr (object, "preserveAspectRatio");
+ object->readAttr( "viewBox");
+ object->readAttr( "preserveAspectRatio");
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build (object, document, repr);
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index e3e919796c882cf05f18738a5594e7768df3c6d0..dcf9160ff134af85f67a111d193c4783a33261e1 100644 (file)
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
static void
sp_text_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
{
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "dx");
- sp_object_read_attr(object, "dy");
- sp_object_read_attr(object, "rotate");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "dx");
+ object->readAttr( "dy");
+ object->readAttr( "rotate");
if (((SPObjectClass *) text_parent_class)->build)
((SPObjectClass *) text_parent_class)->build(object, doc, repr);
- sp_object_read_attr(object, "sodipodi:linespacing"); // has to happen after the styles are read
+ object->readAttr( "sodipodi:linespacing"); // has to happen after the styles are read
}
static void
diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp
index 850ebbd423bdbf2ef7f3d25755c46ae74804c0e6..ef9c8948609bdb3686638c50fa4a85614fbbff2b 100644 (file)
--- a/src/sp-tref.cpp
+++ b/src/sp-tref.cpp
@@ -154,12 +154,12 @@ sp_tref_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
((SPObjectClass *) tref_parent_class)->build(object, document, repr);
}
- sp_object_read_attr(object, "xlink:href");
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "dx");
- sp_object_read_attr(object, "dy");
- sp_object_read_attr(object, "rotate");
+ object->readAttr( "xlink:href");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "dx");
+ object->readAttr( "dy");
+ object->readAttr( "rotate");
}
/**
diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp
index a7391ac9862eb901a0cc507ee6852024ee57e07b..8cddc6e5e36837d2e04fddd8181a02069ef4826d 100644 (file)
--- a/src/sp-tspan.cpp
+++ b/src/sp-tspan.cpp
{
//SPTSpan *tspan = SP_TSPAN(object);
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "dx");
- sp_object_read_attr(object, "dy");
- sp_object_read_attr(object, "rotate");
- sp_object_read_attr(object, "sodipodi:role");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "dx");
+ object->readAttr( "dy");
+ object->readAttr( "rotate");
+ object->readAttr( "sodipodi:role");
if (((SPObjectClass *) tspan_parent_class)->build)
((SPObjectClass *) tspan_parent_class)->build(object, doc, repr);
@@ -392,13 +392,13 @@ sp_textpath_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr)
{
//SPTextPath *textpath = SP_TEXTPATH(object);
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "dx");
- sp_object_read_attr(object, "dy");
- sp_object_read_attr(object, "rotate");
- sp_object_read_attr(object, "startOffset");
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "dx");
+ object->readAttr( "dy");
+ object->readAttr( "rotate");
+ object->readAttr( "startOffset");
+ object->readAttr( "xlink:href");
bool no_content=true;
for (Inkscape::XML::Node* rch = repr->firstChild() ; rch != NULL; rch = rch->next()) {
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index 3770b2324b95340c14406e51d8de403d426e9c72..075c7f8044d52f9a0c09ab4bd9248f1624caabb4 100644 (file)
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
@@ -160,11 +160,11 @@ sp_use_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
(* ((SPObjectClass *) parent_class)->build)(object, document, repr);
}
- sp_object_read_attr(object, "x");
- sp_object_read_attr(object, "y");
- sp_object_read_attr(object, "width");
- sp_object_read_attr(object, "height");
- sp_object_read_attr(object, "xlink:href");
+ object->readAttr( "x");
+ object->readAttr( "y");
+ object->readAttr( "width");
+ object->readAttr( "height");
+ object->readAttr( "xlink:href");
// We don't need to create child here:
// reading xlink:href will attach ref, and that will cause the changed signal to be emitted,
@@ -492,7 +492,7 @@ sp_use_move_compensate(Geom::Matrix const *mp, SPItem */*original*/, SPUse *self
return;
// restore item->transform field from the repr, in case it was changed by seltrans
- sp_object_read_attr (SP_OBJECT (self), "transform");
+ SP_OBJECT (self)->readAttr ("transform");
Geom::Matrix t = sp_use_get_parent_transform(self);
Geom::Matrix clone_move = t.inverse() * m * t;
diff --git a/src/ui/context-menu.h b/src/ui/context-menu.h
index 571698fd240de0f6d7f49e58d335676feaf32742..46a1e8941ce19eed97f9fca8978e0bc17e8fc4ce 100644 (file)
--- a/src/ui/context-menu.h
+++ b/src/ui/context-menu.h
#include <gtk/gtkmenu.h>
#include "forward.h"
-
+#include "sp-object.h"
/* Append object-specific part to context menu */
void sp_object_menu (SPObject *object, SPDesktop *desktop, GtkMenu *menu);
diff --git a/src/uri-references.h b/src/uri-references.h
index a98c84153bf382603295d212b2f69444a4a2690d..e6399bfd97fa8c5a2f9d452ee70f01a62f4b940b 100644 (file)
--- a/src/uri-references.h
+++ b/src/uri-references.h
#include "bad-uri-exception.h"
#include "forward.h"
+#include "sp-object.h"
namespace Inkscape {
index 33f2a6ae717586c686b1f95efb8cb689ef365ed2..6aa2a1ed5e038fb62db7e67cf51285ec24a38568 100644 (file)
#include "display/display-forward.h"
#include "libnr/nr-point.h"
#include "forward.h"
+#include "sp-object.h"
#include "message.h"
#include "ui/view/view-widget.h"
#include "ui/view/edit-widget-interface.h"
index 29e7355365004d4ce173b60ee2681efd4321dbe9..6da23a69635e1fb4510481b2082a1ec8eaf719c6 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -7893,7 +7893,7 @@ static void sp_connector_orthogonal_toggled( GtkToggleAction* act, GObject *tbl
SPItem *item = (SPItem *) l->data;
if (cc_item_is_connector(item)) {
- sp_object_setAttribute(item, "inkscape:connector-type",
+ item->setAttribute( "inkscape:connector-type",
value, false);
item->avoidRef->handleSettingChange();
modmade = true;
SPItem *item = (SPItem *) l->data;
if (cc_item_is_connector(item)) {
- sp_object_setAttribute(item, "inkscape:connector-curvature",
+ item->setAttribute( "inkscape:connector-curvature",
value, false);
item->avoidRef->handleSettingChange();
modmade = true;