diff --git a/src/star-context.cpp b/src/star-context.cpp
index 9d5d16684f7cfea8dc0deec0bc33f629a959932a..74b252860ee13c083eec82d085e8abb5f9573f9b 100644 (file)
--- a/src/star-context.cpp
+++ b/src/star-context.cpp
#include "desktop-style.h"
#include "message-context.h"
#include "pixmaps/cursor-star.xpm"
+#include "pixmaps/cursor-star.pixbuf"
#include "sp-metrics.h"
#include <glibmm/i18n.h>
#include "prefs-utils.h"
SPEventContext *event_context = SP_EVENT_CONTEXT (star_context);
event_context->cursor_shape = cursor_star_xpm;
+ event_context->cursor_pixbuf = gdk_pixbuf_new_from_inline(
+ -1,
+ cursor_star_pixbuf,
+ FALSE,
+ NULL);
event_context->hot_x = 4;
event_context->hot_y = 4;
event_context->xp = 0;
sp_event_context_read (ec, "rounded");
sp_event_context_read (ec, "randomized");
- Inkscape::Selection *selection = SP_DT_SELECTION(ec->desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(ec->desktop);
SPItem *item = selection->singleItem();
if (item) {
@@ -259,7 +265,7 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
static gboolean dragging;
SPDesktop *desktop = event_context->desktop;
- Inkscape::Selection *selection = SP_DT_SELECTION (desktop);
+ Inkscape::Selection *selection = sp_desktop_selection (desktop);
SPStarContext *sc = SP_STAR_CONTEXT (event_context);
@@ -275,7 +281,7 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
sc->center = Inkscape::setup_for_drag_start(desktop, event_context, event);
- SnapManager const m(desktop->namedview);
+ SnapManager const &m = desktop->namedview->snap_manager;
sc->center = m.freeSnap(Inkscape::Snapper::SNAP_POINT, sc->center, sc->item).getPoint();
sp_canvas_item_grab(SP_CANVAS_ITEM(desktop->acetate),
@@ -358,7 +364,7 @@ static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent
}
break;
case GDK_Escape:
- SP_DT_SELECTION(desktop)->clear();
+ sp_desktop_selection(desktop)->clear();
//TODO: make dragging escapable by Esc
default:
break;
NR::Point p1 = sp_desktop_dt2root_xy_point(desktop, p);
/* Snap corner point with no constraints */
- SnapManager const m(desktop->namedview);;
+ SnapManager const &m = desktop->namedview->snap_manager;
p1 = m.freeSnap(Inkscape::Snapper::SNAP_POINT, p1, sc->item).getPoint();
SPStar *star = SP_STAR(sc->item);
object->updateRepr(NULL, SP_OBJECT_WRITE_EXT);
- SP_DT_SELECTION(desktop)->set(sc->item);
- sp_document_done(SP_DT_DOCUMENT(desktop));
+ sp_desktop_selection(desktop)->set(sc->item);
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
+ /* TODO: annotate */ "star-context.cpp:474");
sc->item = NULL;
}