X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstar-context.cpp;h=74b252860ee13c083eec82d085e8abb5f9573f9b;hb=761a541468cc0b8a7fcfb8c65784c0896f0f80f4;hp=9d5d16684f7cfea8dc0deec0bc33f629a959932a;hpb=7d1f87e5fe8f470b9e734264d803a5c3a51f05d4;p=inkscape.git diff --git a/src/star-context.cpp b/src/star-context.cpp index 9d5d16684..74b252860 100644 --- a/src/star-context.cpp +++ b/src/star-context.cpp @@ -31,6 +31,7 @@ #include "desktop-style.h" #include "message-context.h" #include "pixmaps/cursor-star.xpm" +#include "pixmaps/cursor-star.pixbuf" #include "sp-metrics.h" #include #include "prefs-utils.h" @@ -95,6 +96,11 @@ sp_star_context_init (SPStarContext * star_context) 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; @@ -205,7 +211,7 @@ sp_star_context_setup (SPEventContext *ec) 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; @@ -421,7 +427,7 @@ static void sp_star_drag(SPStarContext *sc, NR::Point p, guint state) 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); @@ -463,8 +469,9 @@ sp_star_finish (SPStarContext * sc) 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; }