summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/select-tool.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2016-10-24 22:58:43 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2016-10-24 22:58:43 +0000
commit532f77b14a76fc04e6bdeca3625f9a55b5f11bdf (patch)
treeb70df28300f24edde9b04d0c7704c11c295c4c62 /src/ui/tools/select-tool.cpp
parent[Bug #1636086] Update Catalan translation for Inkscape 0.92. (diff)
downloadinkscape-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/tools/select-tool.cpp')
-rw-r--r--src/ui/tools/select-tool.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp
index 0cdeda0b6..6c450b3dc 100644
--- a/src/ui/tools/select-tool.cpp
+++ b/src/ui/tools/select-tool.cpp
@@ -902,15 +902,15 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (MOD__ALT(event)) { // alt
if (MOD__SHIFT(event)) {
- sp_selection_move_screen(desktop->getSelection(), mul*-10, 0); // shift
+ desktop->getSelection()->moveScreen(mul*-10, 0); // shift
} else {
- sp_selection_move_screen(desktop->getSelection(), mul*-1, 0); // no shift
+ desktop->getSelection()->moveScreen(mul*-1, 0); // no shift
}
} else { // no alt
if (MOD__SHIFT(event)) {
- sp_selection_move(desktop->getSelection(), mul*-10*nudge, 0); // shift
+ desktop->getSelection()->move(mul*-10*nudge, 0); // shift
} else {
- sp_selection_move(desktop->getSelection(), mul*-nudge, 0); // no shift
+ desktop->getSelection()->move(mul*-nudge, 0); // no shift
}
}
@@ -925,15 +925,15 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (MOD__ALT(event)) { // alt
if (MOD__SHIFT(event)) {
- sp_selection_move_screen(desktop->getSelection(), 0, mul*10); // shift
+ desktop->getSelection()->moveScreen(0, mul*10); // shift
} else {
- sp_selection_move_screen(desktop->getSelection(), 0, mul*1); // no shift
+ desktop->getSelection()->moveScreen(0, mul*1); // no shift
}
} else { // no alt
if (MOD__SHIFT(event)) {
- sp_selection_move(desktop->getSelection(), 0, mul*10*nudge); // shift
+ desktop->getSelection()->move(0, mul*10*nudge); // shift
} else {
- sp_selection_move(desktop->getSelection(), 0, mul*nudge); // no shift
+ desktop->getSelection()->move(0, mul*nudge); // no shift
}
}
@@ -948,15 +948,15 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (MOD__ALT(event)) { // alt
if (MOD__SHIFT(event)) {
- sp_selection_move_screen(desktop->getSelection(), mul*10, 0); // shift
+ desktop->getSelection()->moveScreen(mul*10, 0); // shift
} else {
- sp_selection_move_screen(desktop->getSelection(), mul*1, 0); // no shift
+ desktop->getSelection()->moveScreen(mul*1, 0); // no shift
}
} else { // no alt
if (MOD__SHIFT(event)) {
- sp_selection_move(desktop->getSelection(), mul*10*nudge, 0); // shift
+ desktop->getSelection()->move(mul*10*nudge, 0); // shift
} else {
- sp_selection_move(desktop->getSelection(), mul*nudge, 0); // no shift
+ desktop->getSelection()->move(mul*nudge, 0); // no shift
}
}
@@ -971,15 +971,15 @@ bool SelectTool::root_handler(GdkEvent* event) {
if (MOD__ALT(event)) { // alt
if (MOD__SHIFT(event)) {
- sp_selection_move_screen(desktop->getSelection(), 0, mul*-10); // shift
+ desktop->getSelection()->moveScreen(0, mul*-10); // shift
} else {
- sp_selection_move_screen(desktop->getSelection(), 0, mul*-1); // no shift
+ desktop->getSelection()->moveScreen(0, mul*-1); // no shift
}
} else { // no alt
if (MOD__SHIFT(event)) {
- sp_selection_move(desktop->getSelection(), 0, mul*-10*nudge); // shift
+ desktop->getSelection()->move(0, mul*-10*nudge); // shift
} else {
- sp_selection_move(desktop->getSelection(), 0, mul*-nudge); // no shift
+ desktop->getSelection()->move(0, mul*-nudge); // no shift
}
}
@@ -1023,11 +1023,11 @@ bool SelectTool::root_handler(GdkEvent* event) {
case GDK_KEY_bracketleft:
if (MOD__ALT(event)) {
gint mul = 1 + gobble_key_events(get_group0_keyval(&event->key), 0); // with any mask
- sp_selection_rotate_screen(selection, mul*1);
+ selection->rotateScreen(mul*1);
} else if (MOD__CTRL(event)) {
- sp_selection_rotate(selection, 90);
+ selection->rotate(90);
} else if (snaps) {
- sp_selection_rotate(selection, 180.0/snaps);
+ selection->rotate(180.0/snaps);
}
ret = TRUE;
@@ -1036,11 +1036,11 @@ bool SelectTool::root_handler(GdkEvent* event) {
case GDK_KEY_bracketright:
if (MOD__ALT(event)) {
gint mul = 1 + gobble_key_events(get_group0_keyval(&event->key), 0); // with any mask
- sp_selection_rotate_screen(selection, -1*mul);
+ selection->rotateScreen(-1*mul);
} else if (MOD__CTRL(event)) {
- sp_selection_rotate(selection, -90);
+ selection->rotate(-90);
} else if (snaps) {
- sp_selection_rotate(selection, -180.0/snaps);
+ selection->rotate(-180.0/snaps);
}
ret = TRUE;
@@ -1084,7 +1084,7 @@ bool SelectTool::root_handler(GdkEvent* event) {
case GDK_KEY_g:
case GDK_KEY_G:
if (MOD__SHIFT_ONLY(event)) {
- sp_selection_to_guides(desktop);
+ desktop->selection->toGuides();
ret = true;
}
break;