diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2016-10-24 22:58:43 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2016-10-24 22:58:43 +0000 |
| commit | 532f77b14a76fc04e6bdeca3625f9a55b5f11bdf (patch) | |
| tree | b70df28300f24edde9b04d0c7704c11c295c4c62 /src/ui/dialog | |
| parent | [Bug #1636086] Update Catalan translation for Inkscape 0.92. (diff) | |
| download | inkscape-532f77b14a76fc04e6bdeca3625f9a55b5f11bdf.tar.gz inkscape-532f77b14a76fc04e6bdeca3625f9a55b5f11bdf.zip | |
CPPification: almost all sp_object_set_whatever and sp_selection_whatever global functions are now methods of ObjectSet*, with these additional benefits:
- They can now act on any SelectionSet, not just the current selection;
- Whenever possible, they don't need a desktop anymore and can run if called from GUI.
I hope I did not break too many things in the process.
*: So instead of callink sp_selection_move(desktop,x,y), you call myobjectset->move(x,y)
(bzr r15189)
Diffstat (limited to 'src/ui/dialog')
| -rw-r--r-- | src/ui/dialog/export.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/layer-properties.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-editor.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/transformation.cpp | 20 |
4 files changed, 13 insertions, 15 deletions
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 64a5d9866..98ecf6db7 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -785,7 +785,7 @@ void Export::onAreaToggled () case SELECTION_SELECTION: if ((SP_ACTIVE_DESKTOP->getSelection())->isEmpty() == false) { - sp_object_set_get_export_hints(SP_ACTIVE_DESKTOP->getSelection(), filename, &xdpi, &ydpi); + SP_ACTIVE_DESKTOP->getSelection()->getExportHints(filename, &xdpi, &ydpi); /* If we still don't have a filename -- let's build one that's nice */ diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index 4aa86cc48..f28f8336a 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -384,7 +384,7 @@ void LayerPropertiesDialog::Move::setup(LayerPropertiesDialog &dialog) { void LayerPropertiesDialog::Move::perform(LayerPropertiesDialog &dialog) { SPObject *moveto = dialog._selectedLayer(); - sp_selection_to_layer(dialog._desktop, moveto, false); + dialog._desktop->selection->toLayer(moveto); } void LayerPropertiesDialog::_setDesktop(SPDesktop *desktop) { diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 73f8debd6..b97b0e63a 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -419,7 +419,7 @@ LivePathEffectEditor::onAdd() // If item is a SPRect, convert it to path first: if ( dynamic_cast<SPRect *>(item) ) { - sp_selected_path_to_curves(sel, current_desktop, false); + sel->toCurves(); item = sel->singleItem(); // get new item } @@ -451,7 +451,7 @@ LivePathEffectEditor::onAdd() item = NULL; // run sp_selection_clone_original_path_lpe - sp_selection_clone_original_path_lpe(current_desktop); + sel->cloneOriginalPathLPE(); SPItem *new_item = sel->singleItem(); // Check that the cloning was successful. We don't want to change the ID of the original referenced path! diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 7f1492cd7..5ec47b0dc 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -617,12 +617,11 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) if (!prefs->getBool("/dialogs/transformation/applyseparately")) { // move selection as a whole if (_check_move_relative.get_active()) { - sp_object_set_move_relative(selection, x, y); + selection->moveRelative(x, y); } else { Geom::OptRect bbox = selection->preferredBounds(); if (bbox) { - sp_object_set_move_relative(selection, - x - bbox->min()[Geom::X], y - bbox->min()[Geom::Y]); + selection->moveRelative(x - bbox->min()[Geom::X], y - bbox->min()[Geom::Y]); } } } else { @@ -685,8 +684,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) } else { Geom::OptRect bbox = selection->preferredBounds(); if (bbox) { - sp_object_set_move_relative(selection, - x - bbox->min()[Geom::X], y - bbox->min()[Geom::Y]); + selection->moveRelative(x - bbox->min()[Geom::X], y - bbox->min()[Geom::Y]); } } } @@ -750,7 +748,7 @@ void Transformation::applyPageScale(Inkscape::Selection *selection) double y1 = bbox_pref->midpoint()[Geom::Y] + new_height/2; Geom::Affine scaler = get_scale_transform_for_variable_stroke (*bbox_pref, *bbox_geom, transform_stroke, preserve, x0, y0, x1, y1); - sp_object_set_apply_affine(selection, scaler); + selection->applyAffine(scaler); } } @@ -776,7 +774,7 @@ void Transformation::applyPageRotate(Inkscape::Selection *selection) } else { boost::optional<Geom::Point> center = selection->center(); if (center) { - sp_object_set_rotate_relative(selection, *center, angle); + selection->rotateRelative(*center, angle); } } @@ -843,7 +841,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); return; } - sp_object_set_skew_relative(selection, *center, 0.01 * skewX, 0.01 * skewY); + selection->skewRelative(*center, 0.01 * skewX, 0.01 * skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); @@ -856,7 +854,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) } double skewX = tan(-angleX); double skewY = tan(angleY); - sp_object_set_skew_relative(selection, *center, skewX, skewY); + selection->skewRelative(*center, skewX, skewY); } else { // absolute displacement double skewX = _scalar_skew_horizontal.getValue("px"); double skewY = _scalar_skew_vertical.getValue("px"); @@ -864,7 +862,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); return; } - sp_object_set_skew_relative(selection, *center, skewX / height, skewY / width); + selection->skewRelative(*center, skewX / height, skewY / width); } } } @@ -897,7 +895,7 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection) item->updateRepr(); } } else { - sp_object_set_apply_affine(selection, displayed); // post-multiply each object's transform + selection->applyAffine(displayed); // post-multiply each object's transform } DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM, |
