diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
| commit | 5a4fb2325f60d292b47330f540b26a3279341c90 (patch) | |
| tree | d2aa7967be25450b83e625025366c618101ae49f /src/draw-anchor.cpp | |
| parent | The Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff) | |
| parent | Remove Snap menu item and improve grid menu item text (diff) | |
| download | inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip | |
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/draw-anchor.cpp')
| -rw-r--r-- | src/draw-anchor.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/draw-anchor.cpp b/src/draw-anchor.cpp index 62a091608..00db936e1 100644 --- a/src/draw-anchor.cpp +++ b/src/draw-anchor.cpp @@ -16,8 +16,8 @@ #include "draw-anchor.h" #include "desktop.h" #include "desktop-handles.h" -#include "event-context.h" -#include "lpe-tool-context.h" +#include "ui/tools/tool-base.h" +#include "ui/tools/lpe-tool.h" #include "display/sodipodi-ctrl.h" #include "display/curve.h" #include "ui/control-manager.h" @@ -30,15 +30,13 @@ using Inkscape::ControlManager; /** * Creates an anchor object and initializes it. */ -SPDrawAnchor *sp_draw_anchor_new(SPDrawContext *dc, SPCurve *curve, gboolean start, Geom::Point delta) +SPDrawAnchor *sp_draw_anchor_new(Inkscape::UI::Tools::FreehandBase *dc, SPCurve *curve, gboolean start, Geom::Point delta) { if (SP_IS_LPETOOL_CONTEXT(dc)) { // suppress all kinds of anchors in LPEToolContext return NULL; } - SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(dc); - SPDrawAnchor *a = g_new(SPDrawAnchor, 1); a->dc = dc; @@ -47,7 +45,7 @@ SPDrawAnchor *sp_draw_anchor_new(SPDrawContext *dc, SPCurve *curve, gboolean sta a->start = start; a->active = FALSE; a->dp = delta; - a->ctrl = ControlManager::getManager().createControl(sp_desktop_controls(dt), Inkscape::CTRL_TYPE_ANCHOR); + a->ctrl = ControlManager::getManager().createControl(sp_desktop_controls(&dc->getDesktop()), Inkscape::CTRL_TYPE_ANCHOR); SP_CTRL(a->ctrl)->moveto(delta); @@ -65,7 +63,7 @@ SPDrawAnchor *sp_draw_anchor_destroy(SPDrawAnchor *anchor) anchor->curve->unref(); } if (anchor->ctrl) { - gtk_object_destroy(GTK_OBJECT(anchor->ctrl)); + sp_canvas_item_destroy(anchor->ctrl); } g_free(anchor); return NULL; @@ -77,19 +75,18 @@ SPDrawAnchor *sp_draw_anchor_destroy(SPDrawAnchor *anchor) */ SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, Geom::Point w, gboolean activate) { - SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(anchor->dc); SPCtrl *ctrl = SP_CTRL(anchor->ctrl); - if ( activate && ( Geom::LInfty( w - dt->d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) { + if ( activate && ( Geom::LInfty( w - anchor->dc->getDesktop().d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) { if (!anchor->active) { - sp_canvas_item_set((GtkObject *) anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_MOUSEOVER, NULL); anchor->active = TRUE; } return anchor; } if (anchor->active) { - sp_canvas_item_set((GtkObject *) anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, NULL); + g_object_set(anchor->ctrl, "fill_color", FILL_COLOR_NORMAL, NULL); anchor->active = FALSE; } return NULL; |
