From 8867de5daf309e4cdd3fce177b408618490be4f3 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Tue, 29 Jun 2010 23:35:42 +0530 Subject: This is the first c++ification commit from me. It handles sp-line, sp-polyline, sp-item and marks the onset of document c++ification as well. Users can check performace increase with [/usr/bin/time -v inkscape_binary_with_commandline_options]. (bzr r9546.1.1) --- src/knotholder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/knotholder.cpp') diff --git a/src/knotholder.cpp b/src/knotholder.cpp index 314ad807c..af11d5acb 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -83,7 +83,7 @@ KnotHolder::~KnotHolder() { void KnotHolder::update_knots() { - Geom::Matrix const i2d(sp_item_i2d_affine(item)); + Geom::Matrix const i2d(item->i2d_affine()); for(std::list::iterator i = entity.begin(); i != entity.end(); ++i) { KnotHolderEntity *e = *i; @@ -163,8 +163,8 @@ KnotHolder::knot_moved_handler(SPKnot *knot, Geom::Point const &p, guint state) for(std::list::iterator i = this->entity.begin(); i != this->entity.end(); ++i) { KnotHolderEntity *e = *i; if (e->knot == knot) { - Geom::Point const q = p * sp_item_i2d_affine(item).inverse(); - e->knot_set(q, e->knot->drag_origin * sp_item_i2d_affine(item).inverse(), state); + Geom::Point const q = p * item->i2d_affine().inverse(); + e->knot_set(q, e->knot->drag_origin * item->i2d_affine().inverse(), state); break; } } -- cgit v1.2.3 From d25a9a072143eafa4a9823b84e977c4b85d45efe Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Fri, 2 Jul 2010 18:05:42 +0530 Subject: New Class SPDocumentUndo created which takes care of c++fying some non SPDocument based methods (bzr r9546.1.3) --- src/knotholder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/knotholder.cpp') diff --git a/src/knotholder.cpp b/src/knotholder.cpp index af11d5acb..89f57da97 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -146,7 +146,7 @@ KnotHolder::knot_clicked_handler(SPKnot *knot, guint state) } // for drag, this is done by ungrabbed_handler, but for click we must do it here - sp_document_done(SP_OBJECT_DOCUMENT(item), object_verb, + SPDocumentUndo::done(SP_OBJECT_DOCUMENT(item), object_verb, _("Change handle")); } @@ -225,7 +225,7 @@ KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/) object_verb = SP_VERB_SELECTION_DYNAMIC_OFFSET; } - sp_document_done(SP_OBJECT_DOCUMENT (object), object_verb, + SPDocumentUndo::done(SP_OBJECT_DOCUMENT (object), object_verb, _("Move handle")); } } -- cgit v1.2.3 From 1aaf9a0ee3da28012bf43cfa61e2e5fa933edd2e Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Tue, 6 Jul 2010 12:52:32 +0530 Subject: C++ification of SPObject continued along with the onset of XML Privatisation. Users may checkout [grep -Ir XML Tree *] in the source code and all the places where the XML node/Tree is being used shall be reflected. (bzr r9546.1.5) --- src/knotholder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/knotholder.cpp') diff --git a/src/knotholder.cpp b/src/knotholder.cpp index 89f57da97..6778e9ad8 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -42,7 +42,8 @@ class SPDesktop; KnotHolder::KnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderReleasedFunc relhandler) { - Inkscape::XML::Node *repr = SP_OBJECT(item)->repr; + //XML Tree being used directly here while it shouldn't be... + Inkscape::XML::Node *repr = SP_OBJECT(item)->getRepr(); if (!desktop || !item || !SP_IS_ITEM(item)) { g_print ("Error! Throw an exception, please!\n"); -- cgit v1.2.3 From cde0571b44ec5b108907bda85971c49f3ceb1de8 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Public Date: Wed, 14 Jul 2010 23:40:35 +0530 Subject: SPShape c++ified to the extent it was possible and more changes done for XML privatisation. Major changes yet to come. (bzr r9546.1.7) --- src/knotholder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/knotholder.cpp') diff --git a/src/knotholder.cpp b/src/knotholder.cpp index 6778e9ad8..23d610ad0 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -122,7 +122,7 @@ KnotHolder::knot_clicked_handler(SPKnot *knot, guint state) } if (SP_IS_SHAPE(item)) { - sp_shape_set_shape(SP_SHAPE(item)); + SP_SHAPE(item)->setShape(); } knot_holder->update_knots(); @@ -171,7 +171,7 @@ KnotHolder::knot_moved_handler(SPKnot *knot, Geom::Point const &p, guint state) } if (SP_IS_SHAPE (item)) { - sp_shape_set_shape(SP_SHAPE (item)); + SP_SHAPE (item)->setShape(); } this->update_knots(); -- cgit v1.2.3