1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Krzysztof KosiĆski <tweenk.pl@gmail.com>
4 * Jon A. Cruz <jon@joncruz.org>
6 * Copyright (C) 2009 Authors
7 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
10 #ifndef INKSCAPE_UI_TOOL_CURVE_DRAG_POINT_H
11 #define INKSCAPE_UI_TOOL_CURVE_DRAG_POINT_H
13 #include "ui/tool/control-point.h"
14 #include "ui/tool/node.h"
17 namespace Inkscape::UI
{
19 class PathManipulator
;
20 struct PathSharedData
;
22 // This point should be invisible to the user
23 // TODO make some methods from path-manipulator.cpp public so that this point doesn't have
24 // to be declared as a friend
26 * An invisible point used to drag curves. This point is used by PathManipulator to allow editing
27 * of path segments by dragging them. It is defined in a separate file so that the node tool
28 * can check if the mouseovered control point is a curve drag point and update the cursor
29 * accordingly, without the need to drag in the full PathManipulator header.
31 class CurveDragPoint
: public ControlPoint
34 CurveDragPoint(PathManipulator
&pm
);
35 void setSize(double sz
) { _setSize(sz
); }
36 void setTimeValue(double t
) { _t
= t
; }
37 double getTimeValue() { return _t
; }
38 void setIterator(NodeList::iterator i
) { first
= i
; }
39 NodeList::iterator
getIterator() { return first
; }
40 bool _eventHandler(Inkscape::UI::Tools::ToolBase
*event_context
, CanvasEvent
const &event
) override
;
43 Glib::ustring
_getTip(unsigned state
) const override
;
44 void dragged(Geom::Point
&, MotionEvent
const &) override
;
45 bool grabbed(MotionEvent
const &) override
;
46 void ungrabbed(ButtonReleaseEvent
const *) override
;
47 bool clicked(ButtonReleaseEvent
const &) override
;
48 bool doubleclicked(ButtonReleaseEvent
const &) override
;
53 NodeList::iterator first
;
55 static bool _drags_stroke
;
56 static bool _segment_was_degenerate
;
57 static Geom::Point _stroke_drag_origin
;
58 void _insertNode(bool take_selection
);
61 } // namespace Inkscape::UI
63 #endif // INKSCAPE_UI_TOOL_CURVE_DRAG_POINT_H
68 c-file-style:"stroustrup"
69 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
74 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :