diff --git a/src/select-context.cpp b/src/select-context.cpp
index bda4012c7b832aa956b121898c206f1967d8870d..7027de1efc66ea9a5d1aa09e5bab7f25209b7c7f 100644 (file)
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
#include "selection.h"
#include "seltrans-handles.h"
#include "sp-cursor.h"
-#include "pixmaps/cursor-select-m.xpm"
-#include "pixmaps/cursor-select-d.xpm"
+//#include "pixmaps/cursor-select-m.xpm" // These aren't used
+//#include "pixmaps/cursor-select-d.xpm"
#include "pixmaps/handles.xpm"
#include <glibmm/i18n.h>
event_context_class->item_handler = sp_select_context_item_handler;
// cursors in select context
- CursorSelectMouseover = sp_cursor_new_from_xpm(cursor_select_m_xpm , 1, 1);
- CursorSelectDragging = sp_cursor_new_from_xpm(cursor_select_d_xpm , 1, 1);
+// CursorSelectMouseover = sp_cursor_new_from_xpm(cursor_select_m_xpm , 1, 1);
+// CursorSelectDragging = sp_cursor_new_from_xpm(cursor_select_d_xpm , 1, 1);
// selection handles
handles[0] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_nw_xpm);
handles[1] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_ne_xpm);
} 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);
@@ -327,7 +327,7 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->drawing),
GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK |
- GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK,
+ GDK_POINTER_MOTION_MASK,
NULL, event->button.time);
sc->grabbed = SP_CANVAS_ITEM(desktop->drawing);
@@ -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."));
}