summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/transformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog/transformation.cpp')
-rw-r--r--src/ui/dialog/transformation.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp
index 2c6692777..233d99750 100644
--- a/src/ui/dialog/transformation.cpp
+++ b/src/ui/dialog/transformation.cpp
@@ -25,7 +25,8 @@
#include "document.h"
#include "document-undo.h"
-#include "desktop-handles.h"
+#include "desktop.h"
+
#include "transformation.h"
#include "align-and-distribute.h"
#include "inkscape.h"
@@ -205,7 +206,7 @@ void Transformation::layoutPageMove()
// Setting default unit to document unit
SPDesktop *dt = getDesktop();
- SPNamedView *nv = sp_desktop_namedview(dt);
+ SPNamedView *nv = dt->getNamedView();
if (nv->display_units) {
_units_move.setUnit(nv->display_units->abbr);
}
@@ -578,7 +579,7 @@ void Transformation::onSwitchPage(Gtk::Widget * /*page*/, guint pagenum)
void Transformation::onSwitchPage(GtkNotebookPage * /*page*/, guint pagenum)
#endif
{
- updateSelection((PageType)pagenum, sp_desktop_selection(getDesktop()));
+ updateSelection((PageType)pagenum, getDesktop()->getSelection());
}
@@ -801,7 +802,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection)
}
}
- DocumentUndo::done( sp_desktop_document(selection->desktop()) , SP_VERB_DIALOG_TRANSFORM,
+ DocumentUndo::done( selection->desktop()->getDocument() , SP_VERB_DIALOG_TRANSFORM,
_("Move"));
}
@@ -863,7 +864,7 @@ void Transformation::applyPageScale(Inkscape::Selection *selection)
}
}
- DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+ DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM,
_("Scale"));
}
@@ -888,7 +889,7 @@ void Transformation::applyPageRotate(Inkscape::Selection *selection)
}
}
- DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+ DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM,
_("Rotate"));
}
@@ -903,7 +904,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
double skewX = _scalar_skew_horizontal.getValue("%");
double skewY = _scalar_skew_vertical.getValue("%");
if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) {
- sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
}
sp_item_skew_rel (item, 0.01*skewX, 0.01*skewY);
@@ -914,7 +915,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
|| (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON)
|| (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON)
|| (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) {
- sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
}
double skewX = tan(-angleX);
@@ -928,7 +929,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
double width = bbox->dimensions()[Geom::X];
double height = bbox->dimensions()[Geom::Y];
if (fabs(skewX*skewY - width*height) < Geom::EPSILON) {
- sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
}
sp_item_skew_rel (item, skewX/height, skewY/width);
@@ -947,7 +948,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
double skewX = _scalar_skew_horizontal.getValue("%");
double skewY = _scalar_skew_vertical.getValue("%");
if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) {
- sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
}
sp_selection_skew_relative(selection, *center, 0.01*skewX, 0.01*skewY);
@@ -958,7 +959,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
|| (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON)
|| (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON)
|| (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) {
- sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
}
double skewX = tan(-angleX);
@@ -968,7 +969,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
double skewX = _scalar_skew_horizontal.getValue("px");
double skewY = _scalar_skew_vertical.getValue("px");
if (fabs(skewX*skewY - width*height) < Geom::EPSILON) {
- sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
}
sp_selection_skew_relative(selection, *center, skewX/height, skewY/width);
@@ -976,7 +977,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
}
}
- DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+ DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM,
_("Skew"));
}
@@ -992,7 +993,7 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection)
Geom::Affine displayed(a, b, c, d, e, f);
if (displayed.isSingular()) {
- sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ getDesktop()->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
return;
}
@@ -1006,7 +1007,7 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection)
sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform
}
- DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+ DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM,
_("Edit transformation matrix"));
}