diff --git a/src/select-context.cpp b/src/select-context.cpp
index bda4012c7b832aa956b121898c206f1967d8870d..32eee593dc2645cd1ae578c944fd2c1c9f0299ae 100644 (file)
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
} else {
sc->_seltrans->setShow(Inkscape::SelTrans::SHOW_CONTENT);
}
- }
+ }
}
static bool
if (sc->item) {
// only undo if the item is still valid
if (SP_OBJECT_DOCUMENT( SP_OBJECT(sc->item))) {
- sp_document_undo(SP_DT_DOCUMENT(desktop));
+ sp_document_undo(sp_desktop_document(desktop));
}
sp_object_unref( SP_OBJECT(sc->item), NULL);
// NOTE: This is a workaround to a bug.
// When the ctrl key is held, sc->item is not defined
// so in this case (only), we skip the object doc check
- sp_document_undo(SP_DT_DOCUMENT(desktop));
+ sp_document_undo(sp_desktop_document(desktop));
}
sc->item = NULL;
rb_escaped = 1;
SP_EVENT_CONTEXT(sc)->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Selection canceled."));
return true;
- }
+ }
}
return false;
}
-bool
+bool
key_is_a_modifier (guint key) {
return (key == GDK_Alt_L ||
key == GDK_Alt_R ||
{
desktop->setCurrentLayer(parent);
if (SP_IS_GROUP(current_layer) && SPGroup::LAYER != SP_GROUP(current_layer)->layerMode())
- SP_DT_SELECTION(desktop)->set(current_layer);
+ sp_desktop_selection(desktop)->set(current_layer);
}
}
}
@@ -319,7 +319,7 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE
sc->moved = FALSE;
// remember the clicked item in sc->item:
- sc->item = sp_event_context_find_item (desktop,
+ sc->item = sp_event_context_find_item (desktop,
NR::Point(event->button.x, event->button.y), event->button.state & GDK_MOD1_MASK, FALSE);
sp_object_ref(sc->item, NULL);
@@ -342,13 +342,13 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE
case GDK_ENTER_NOTIFY:
{
GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR);
- gdk_window_set_cursor(GTK_WIDGET(SP_DT_CANVAS(desktop))->window, cursor);
+ gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, cursor);
gdk_cursor_destroy(cursor);
break;
}
case GDK_LEAVE_NOTIFY:
- gdk_window_set_cursor(GTK_WIDGET(SP_DT_CANVAS(desktop))->window, event_context->cursor);
+ gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
break;
case GDK_KEY_PRESS:
SPDesktop *desktop = event_context->desktop;
SPSelectContext *sc = SP_SELECT_CONTEXT(event_context);
Inkscape::SelTrans *seltrans = sc->_seltrans;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
gdouble const nudge = prefs_get_double_attribute_limited("options.nudgedistance", "value", 2, 0, 1000); // in px
gdouble const offset = prefs_get_double_attribute_limited("options.defaultscale", "value", 2, 0, 1000);
tolerance = prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100);
SPItem *clicked_item = (SPItem *) selection->itemList()->data;
if (SP_IS_GROUP (clicked_item)) { // enter group
desktop->setCurrentLayer(reinterpret_cast<SPObject *>(clicked_item));
- SP_DT_SELECTION(desktop)->clear();
+ sp_desktop_selection(desktop)->clear();
sc->dragging = false;
} else { // switch tool
tools_switch_by_item (desktop, clicked_item);
item_at_point = desktop->item_at_point(NR::Point(event->button.x, event->button.y), FALSE);
if (!item_at_point) // if no item at this point, try at the click point (bug 1012200)
item_at_point = desktop->item_at_point(NR::Point(xp, yp), FALSE);
- if (item_at_point || sc->moved || sc->button_press_alt) {
+ if (item_at_point || sc->moved || sc->button_press_alt) {
// drag only if starting from an item, or if something is already grabbed, or if alt-dragging
if (!sc->moved) {
item_in_group = desktop->item_at_point(NR::Point(event->button.x, event->button.y), TRUE);
Inkscape::Rubberband::get()->stop();
seltrans->resetState();
// find out affected items:
- GSList *items = sp_document_items_in_box(SP_DT_DOCUMENT(desktop), desktop->dkey, b.assume());
+ GSList *items = sp_document_items_in_box(sp_desktop_document(desktop), desktop->dkey, b.assume());
if (event->button.state & GDK_SHIFT_MASK) {
// with shift, add to selection
selection->addList (items);
@@ -564,12 +564,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
if (sc->button_press_ctrl) {
// go into groups, honoring Alt
- item = sp_event_context_find_item (desktop,
+ item = sp_event_context_find_item (desktop,
NR::Point(event->button.x, event->button.y), event->button.state & GDK_MOD1_MASK, TRUE);
sc->button_press_ctrl = FALSE;
} else {
// don't go into groups, honoring Alt
- item = sp_event_context_find_item (desktop,
+ item = sp_event_context_find_item (desktop,
NR::Point(event->button.x, event->button.y), event->button.state & GDK_MOD1_MASK, FALSE);
}
sc->button_press_ctrl = FALSE;
- item = sp_event_context_find_item (desktop,
+ item = sp_event_context_find_item (desktop,
NR::Point(event->button.x, event->button.y), event->button.state & GDK_MOD1_MASK, TRUE);
if (item) {
SPItem *clicked_item = selection->singleItem();
if (SP_IS_GROUP (clicked_item)) { // enter group
desktop->setCurrentLayer(reinterpret_cast<SPObject *>(clicked_item));
- SP_DT_SELECTION(desktop)->clear();
+ sp_desktop_selection(desktop)->clear();
} else {
SP_EVENT_CONTEXT(sc)->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Selected object is not a group. Cannot enter."));
}