diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index 48e1536385ec22daf26cea4f15734a1a98f28930..0b0aad79e563890d2fcea8120b8a992e920f0593 100644 (file)
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
#include "desktop-handles.h"
#include "snap.h"
#include "pixmaps/cursor-ellipse.xpm"
+#include "pixmaps/cursor-ellipse.pixbuf"
#include "sp-metrics.h"
#include "xml/repr.h"
#include "xml/node-event-vector.h"
#include "desktop.h"
#include "desktop-style.h"
#include "context-fns.h"
+#include "verbs.h"
#include "arc-context.h"
SPEventContext *event_context = SP_EVENT_CONTEXT(arc_context);
event_context->cursor_shape = cursor_ellipse_xpm;
+ event_context->cursor_pixbuf = gdk_pixbuf_new_from_inline(
+ -1,
+ cursor_ellipse_pixbuf,
+ FALSE,
+ NULL);
event_context->hot_x = 4;
event_context->hot_y = 4;
event_context->xp = 0;
ec->shape_repr = shape_repr;
Inkscape::GC::anchor(shape_repr);
sp_repr_add_listener(shape_repr, &ec_shape_repr_events, ec);
- sp_repr_synthesize_events(shape_repr, &ec_shape_repr_events, ec);
}
}
}
static void sp_arc_context_setup(SPEventContext *ec)
{
SPArcContext *ac = SP_ARC_CONTEXT(ec);
- Inkscape::Selection *selection = SP_DT_SELECTION(ec->desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(ec->desktop);
if (((SPEventContextClass *) parent_class)->setup) {
((SPEventContextClass *) parent_class)->setup(ec);
ec->shape_repr = shape_repr;
Inkscape::GC::anchor(shape_repr);
sp_repr_add_listener(shape_repr, &ec_shape_repr_events, ec);
- sp_repr_synthesize_events(shape_repr, &ec_shape_repr_events, ec);
}
}
static bool dragging;
SPDesktop *desktop = event_context->desktop;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
SPArcContext *ac = SP_ARC_CONTEXT(event_context);
event_context->tolerance = prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100);
dragging = true;
ac->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
- SnapManager const m(desktop->namedview);
+ SnapManager const &m = desktop->namedview->snap_manager;
ac->center = m.freeSnap(Inkscape::Snapper::SNAP_POINT, ac->center, ac->item).getPoint();
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
GDK_KEY_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
}
break;
case GDK_Escape:
- SP_DT_SELECTION(desktop)->clear();
+ sp_desktop_selection(desktop)->clear();
//TODO: make dragging escapable by Esc
default:
break;
SP_OBJECT(ac->item)->updateRepr();
- SP_DT_SELECTION(desktop)->set(ac->item);
- sp_document_done(SP_DT_DOCUMENT(desktop));
+ sp_desktop_selection(desktop)->set(ac->item);
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC,
+ _("Create ellipse"));
ac->item = NULL;
}