Context for the "About" label
[inkscape.git] / src / ui / tool / curve-drag-point.h
blobada9fd2b7b7db916ef350d4d94729db03d17675f
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* Authors:
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.
8 */
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"
16 class SPDesktop;
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
25 /**
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
33 public:
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;
42 protected:
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;
50 private:
51 double _t;
52 PathManipulator &_pm;
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
66 Local Variables:
67 mode:c++
68 c-file-style:"stroustrup"
69 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
70 indent-tabs-mode:nil
71 fill-column:99
72 End:
74 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :