diff options
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/effect.cpp | 10 | ||||
| -rw-r--r-- | src/live_effects/lpe-knot.cpp | 7 | ||||
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpegroupbbox.cpp | 5 | ||||
| -rw-r--r-- | src/live_effects/lpeobject.cpp | 16 | ||||
| -rw-r--r-- | src/live_effects/parameter/path-reference.h | 2 | ||||
| -rw-r--r-- | src/live_effects/parameter/path.cpp | 15 |
7 files changed, 28 insertions, 31 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 9dbd27b50..3ea57de23 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -1,7 +1,6 @@ -#define INKSCAPE_LIVEPATHEFFECT_CPP - /* * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl> + * Abhishek Sharma * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -256,11 +255,10 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) return neweffect; } -void -Effect::createAndApply(const char* name, SPDocument *doc, SPItem *item) +void Effect::createAndApply(const char* name, SPDocument *doc, SPItem *item) { // Path effect definition - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); + Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *repr = xml_doc->createElement("inkscape:path-effect"); repr->setAttribute("effect", name); @@ -524,7 +522,7 @@ Effect::getHelperPaths(SPLPEItem *lpeitem) // rather than copying PathVectors all over the place if (show_orig_path) { // add original path to helperpaths - SPCurve* curve = sp_shape_get_curve (SP_SHAPE(lpeitem)); + SPCurve* curve = SP_SHAPE(lpeitem)->getCurve (); hp_vec.push_back(curve->get_pathvector()); } diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index 86d0907a1..fef4e1f87 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -3,6 +3,7 @@ */ /* Authors: * Jean-Francois Barraud <jf.barraud@gmail.com> + * Abhishek Sharma * * Copyright (C) 2007 Authors * @@ -509,7 +510,7 @@ void collectPathsAndWidths (SPLPEItem const *lpeitem, std::vector<Geom::Path> &p if (SP_IS_PATH(lpeitem)) { c = sp_path_get_curve_for_edit(SP_PATH(lpeitem)); } else { - c = sp_shape_get_curve(SP_SHAPE(lpeitem)); + c = SP_SHAPE(lpeitem)->getCurve(); } if (c) { Geom::PathVector subpaths = c->get_pathvector(); @@ -647,8 +648,8 @@ KnotHolderEntityCrossingSwitcher::knot_click(guint state) //std::cout<<"crossing set to"<<lpe->crossing_points[s].sign<<".\n"; } lpe->crossing_points_vector.param_set_and_write_new_value(lpe->crossing_points.to_vector()); - sp_document_done(lpe->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, /// @todo Is this the right verb? - _("Change knot crossing")); + DocumentUndo::done(lpe->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, /// @todo Is this the right verb? + _("Change knot crossing")); // FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating. // sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true); diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index a3a0faf37..1af2ed6ca 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -1,4 +1,3 @@ -#define INKSCAPE_LPE_MIRROR_SYMMETRY_CPP /** \file * LPE <mirror_symmetry> implementation: mirrors a path with respect to a given line. */ @@ -6,6 +5,7 @@ * Authors: * Maximilian Albert * Johan Engelen + * Abhishek Sharma * * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl> * Copyright (C) Maximilin Albert 2008 <maximilian.albert@gmail.com> @@ -46,7 +46,7 @@ LPEMirrorSymmetry::doOnApply (SPLPEItem *lpeitem) using namespace Geom; SPItem *item = SP_ITEM(lpeitem); - Geom::Matrix t = sp_item_i2d_affine(item); + Geom::Matrix t = item->i2d_affine(); Geom::Rect bbox = *item->getBounds(t); // fixme: what happens if getBounds does not return a valid rect? Point A(bbox.left(), bbox.bottom()); diff --git a/src/live_effects/lpegroupbbox.cpp b/src/live_effects/lpegroupbbox.cpp index 3820b5ba7..e6fc95f86 100644 --- a/src/live_effects/lpegroupbbox.cpp +++ b/src/live_effects/lpegroupbbox.cpp @@ -1,7 +1,6 @@ -#define INKSCAPE_LPEGROUPBBOX_CPP - /* * Copyright (C) Steren Giannini 2008 <steren.giannini@gmail.com> + * Abhishek Sharma * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -31,7 +30,7 @@ GroupBBoxEffect::original_bbox(SPLPEItem *lpeitem, bool absolute) Geom::Matrix transform; if (absolute) { - transform = sp_item_i2doc_affine(item); + transform = item->i2doc_affine(); } else { transform = Geom::identity(); diff --git a/src/live_effects/lpeobject.cpp b/src/live_effects/lpeobject.cpp index aa916318d..389e18d20 100644 --- a/src/live_effects/lpeobject.cpp +++ b/src/live_effects/lpeobject.cpp @@ -1,7 +1,6 @@ -#define INKSCAPE_LIVEPATHEFFECT_OBJECT_CPP - /* * Copyright (C) Johan Engelen 2007-2008 <j.b.c.engelen@utwente.nl> + * Abhishek Sharma * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -104,14 +103,14 @@ 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); } /* Register ourselves, is this necessary? */ -// sp_document_add_resource(document, "path-effect", object); +// document->addResource("path-effect", object); } /** @@ -132,7 +131,7 @@ LivePathEffectObject::livepatheffect_release(SPObject *object) /* if (SP_OBJECT_DOCUMENT(object)) { // Unregister ourselves - sp_document_remove_resource(SP_OBJECT_DOCUMENT(object), "livepatheffect", SP_OBJECT(object)); + sp_document_removeResource(SP_OBJECT_DOCUMENT(object), "livepatheffect", SP_OBJECT(object)); } if (gradient->ref) { @@ -247,12 +246,11 @@ livepatheffect_on_repr_attr_changed ( Inkscape::XML::Node * /*repr*/, * returns 'this' when no forking was necessary (and therefore no duplicate was made) * Check out sp_lpe_item_fork_path_effects_if_necessary ! */ -LivePathEffectObject * -LivePathEffectObject::fork_private_if_necessary(unsigned int nr_of_allowed_users) +LivePathEffectObject *LivePathEffectObject::fork_private_if_necessary(unsigned int nr_of_allowed_users) { - if (SP_OBJECT_HREFCOUNT(this) > nr_of_allowed_users) { + if (hrefcount > nr_of_allowed_users) { SPDocument *doc = SP_OBJECT_DOCUMENT(this); - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); + Inkscape::XML::Document *xml_doc = doc->getReprDoc(); Inkscape::XML::Node *dup_repr = SP_OBJECT_REPR (this)->duplicate(xml_doc); SP_OBJECT_REPR (SP_DOCUMENT_DEFS (doc))->addChild(dup_repr, NULL); diff --git a/src/live_effects/parameter/path-reference.h b/src/live_effects/parameter/path-reference.h index 67508e531..3bedecccb 100644 --- a/src/live_effects/parameter/path-reference.h +++ b/src/live_effects/parameter/path-reference.h @@ -5,11 +5,13 @@ * The reference corresponding to href of LPE PathParam. * * Copyright (C) 2008 Johan Engelen + * Abhishek Sharma * * Released under GNU GPL, read the file 'COPYING' for more information. */ #include <forward.h> +#include "sp-item.h" #include <uri-references.h> #include <sigc++/sigc++.h> diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index d8d5b0a7c..8d9b2376f 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -1,7 +1,6 @@ -#define INKSCAPE_LIVEPATHEFFECT_PARAMETER_PATH_CPP - /* * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl> + * Abhishek Sharma * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -209,7 +208,7 @@ PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt) ShapeRecord r; r.role = SHAPE_ROLE_LPE_PARAM; - r.edit_transform = sp_item_i2d_affine(item); // TODO is it right? + r.edit_transform = item->i2d_affine(); // TODO is it right? if (!href) { r.item = reinterpret_cast<SPItem*>(param_effect->getLPEObj()); r.lpe_key = param_key; @@ -366,7 +365,7 @@ PathParam::linked_modified(SPObject *linked_obj, guint /*flags*/) { SPCurve *curve = NULL; if (SP_IS_SHAPE(linked_obj)) { - curve = sp_shape_get_curve(SP_SHAPE(linked_obj)); + curve = SP_SHAPE(linked_obj)->getCurve(); } if (SP_IS_TEXT(linked_obj)) { curve = SP_TEXT(linked_obj)->getNormalizedBpath(); @@ -414,8 +413,8 @@ PathParam::on_paste_button_click() Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); Glib::ustring svgd = cm->getPathParameter(SP_ACTIVE_DESKTOP); paste_param_path(svgd.data()); - sp_document_done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, - _("Paste path parameter")); + DocumentUndo::done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + _("Paste path parameter")); } void @@ -446,8 +445,8 @@ PathParam::on_link_button_click() // check if linking to object to which LPE is applied (maybe delegated to PathReference param_write_to_repr(pathid.c_str()); - sp_document_done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, - _("Link path parameter to path")); + DocumentUndo::done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + _("Link path parameter to path")); } } |
