diff options
| author | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | 2010-06-29 18:05:42 +0000 |
|---|---|---|
| committer | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | 2010-06-29 18:05:42 +0000 |
| commit | 8867de5daf309e4cdd3fce177b408618490be4f3 (patch) | |
| tree | 19a528d472e7a63f9cab97daa5c979d977db821b /src/sp-shape.cpp | |
| parent | minor fix in Dutch translation of win32 installer (diff) | |
| download | inkscape-8867de5daf309e4cdd3fce177b408618490be4f3.tar.gz inkscape-8867de5daf309e4cdd3fce177b408618490be4f3.zip | |
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)
Diffstat (limited to 'src/sp-shape.cpp')
| -rw-r--r-- | src/sp-shape.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index 3064341b6..4de6aeb80 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -297,7 +297,7 @@ sp_shape_update (SPObject *object, SPCtx *ctx, unsigned int flags) /* Dimension marker views */ for (SPItemView *v = item->display; v != NULL; v = v->next) { if (!v->arenaitem->key) { - NR_ARENA_ITEM_SET_KEY (v->arenaitem, sp_item_display_key_new (SP_MARKER_LOC_QTY)); + NR_ARENA_ITEM_SET_KEY (v->arenaitem, SPItem::display_key_new (SP_MARKER_LOC_QTY)); } for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) { if (shape->marker[i]) { @@ -609,7 +609,7 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const & // get bbox of the marker with that transform NRRect marker_bbox; - sp_item_invoke_bbox (marker_item, &marker_bbox, from_2geom(tr), true); + marker_item->invoke_bbox ( &marker_bbox, from_2geom(tr), true); // union it with the shape bbox nr_rect_d_union (&cbbox, &cbbox, &marker_bbox); } @@ -637,7 +637,7 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const & } tr = marker_item->transform * marker->c2p * tr * transform; NRRect marker_bbox; - sp_item_invoke_bbox (marker_item, &marker_bbox, from_2geom(tr), true); + marker_item->invoke_bbox ( &marker_bbox, from_2geom(tr), true); nr_rect_d_union (&cbbox, &cbbox, &marker_bbox); } // MID position @@ -664,7 +664,7 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const & } tr = marker_item->transform * marker->c2p * tr * transform; NRRect marker_bbox; - sp_item_invoke_bbox (marker_item, &marker_bbox, from_2geom(tr), true); + marker_item->invoke_bbox ( &marker_bbox, from_2geom(tr), true); nr_rect_d_union (&cbbox, &cbbox, &marker_bbox); } @@ -685,7 +685,7 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const & } tr = marker_item->transform * marker->c2p * tr * transform; NRRect marker_bbox; - sp_item_invoke_bbox (marker_item, &marker_bbox, tr, true); + marker_item->invoke_bbox ( &marker_bbox, tr, true); nr_rect_d_union (&cbbox, &cbbox, &marker_bbox); } } @@ -720,7 +720,7 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const & // get bbox of the marker with that transform NRRect marker_bbox; - sp_item_invoke_bbox (marker_item, &marker_bbox, tr, true); + marker_item->invoke_bbox ( &marker_bbox, tr, true); // union it with the shape bbox nr_rect_d_union (&cbbox, &cbbox, &marker_bbox); } @@ -749,7 +749,7 @@ sp_shape_print_invoke_marker_printing(SPObject* obj, Geom::Matrix tr, SPStyle* s Geom::Matrix old_tr = marker_item->transform; marker_item->transform = tr; - sp_item_invoke_print (marker_item, ctx); + marker_item->invoke_print (ctx); marker_item->transform = old_tr; } /** @@ -777,13 +777,13 @@ sp_shape_print (SPItem *item, SPPrintContext *ctx) } /* fixme: Think (Lauris) */ - sp_item_invoke_bbox(item, &pbox, Geom::identity(), TRUE); + item->invoke_bbox( &pbox, Geom::identity(), TRUE); dbox.x0 = 0.0; dbox.y0 = 0.0; dbox.x1 = sp_document_width (SP_OBJECT_DOCUMENT (item)); dbox.y1 = sp_document_height (SP_OBJECT_DOCUMENT (item)); - sp_item_bbox_desktop (item, &bbox); - Geom::Matrix const i2d(sp_item_i2d_affine(item)); + item->getBboxDesktop (&bbox); + Geom::Matrix const i2d(item->i2d_affine()); SPStyle* style = SP_OBJECT_STYLE (item); @@ -899,7 +899,7 @@ sp_shape_show (SPItem *item, NRArena *arena, unsigned int /*key*/, unsigned int /* provide key and dimension the marker views */ if (!arenaitem->key) { - NR_ARENA_ITEM_SET_KEY (arenaitem, sp_item_display_key_new (SP_MARKER_LOC_QTY)); + NR_ARENA_ITEM_SET_KEY (arenaitem, SPItem::display_key_new (SP_MARKER_LOC_QTY)); } for (int i = 0; i < SP_MARKER_LOC_QTY; i++) { @@ -1197,10 +1197,10 @@ static void sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::SnapCa if (pathv.empty()) return; - Geom::Matrix const i2d (sp_item_i2d_affine (item)); + Geom::Matrix const i2d (item->i2d_affine ()); if (snapprefs->getSnapObjectMidpoints()) { - Geom::OptRect bbox = item->getBounds(sp_item_i2d_affine(item)); + Geom::OptRect bbox = item->getBounds(item->i2d_affine()); if (bbox) { p.push_back(Inkscape::SnapCandidatePoint(bbox->midpoint(), Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_OBJECT_MIDPOINT)); } |
