/** \file
* Anchors implementation.
*/
/*
* Authors:
* Copyright (C) 2000 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
* Copyright (C) 2002 Lauris Kaplinski
* Copyright (C) 2004 Monash University
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "ui/draw-anchor.h"
#include "desktop.h"
#include "ui/tools/tool-base.h"
#include "ui/tools/lpe-tool.h"
#include "display/sodipodi-ctrl.h"
#include "ui/control-manager.h"
using Inkscape::ControlManager;
/**
* Creates an anchor object and initializes it.
*/
SPDrawAnchor *sp_draw_anchor_new(Inkscape::UI::Tools::FreehandBase *dc, SPCurve *curve, bool start, Geom::Point delta)
{
if (SP_IS_LPETOOL_CONTEXT(dc)) {
// suppress all kinds of anchors in LPEToolContext
return NULL;
}
a->ctrl = ControlManager::getManager().createControl(dc->getDesktop().getControls(), Inkscape::CTRL_TYPE_ANCHOR);
return a;
}
/**
* Destroys the anchor's canvas item and frees the anchor object.
*/
{
}
}
return NULL;
}
/**
* Test if point is near anchor, if so fill anchor on canvas and return
* pointer to it or NULL.
*/
{
if ( activate && ( Geom::LInfty( w - anchor->dc->getDesktop().d2w(anchor->dp) ) <= (ctrl->box.width() / 2.0) ) ) {
}
return anchor;
}
}
return NULL;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :