Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
knot-holder.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * KnotHolder - Hold SPKnot list and manage signals
4 *
5 * Author:
6 * Mitsuru Oka <oka326@parkcity.ne.jp>
7 * Maximilian Albert <maximilian.albert@gmail.com>
8 *
9 * Copyright (C) 1999-2001 Lauris Kaplinski
10 * Copyright (C) 2000-2001 Ximian, Inc.
11 * Copyright (C) 2001 Mitsuru Oka
12 * Copyright (C) 2008 Maximilian Albert
13 *
14 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
15 *
16 */
17
18#include <2geom/forward.h>
19#include <2geom/affine.h>
20#include <list>
21#include <sigc++/connection.h>
22#include <sigc++/scoped_connection.h>
23
24#ifndef SEEN_SP_KNOTHOLDER_H
25#define SEEN_SP_KNOTHOLDER_H
26
27namespace Inkscape {
28
29namespace UI {
30class ShapeEditor;
31} // namespace UI
32
33namespace XML {
34class Node;
35} // namespace XML
36
37namespace LivePathEffect {
38class PowerStrokePointArrayParamKnotHolderEntity;
39class NodeSatelliteArrayParam;
40class FilletChamferKnotHolderEntity;
41} // namespace LivePathEffect
42
43} // namespace Inkscape
44
46class SPItem;
47class SPDesktop;
48class SPKnot;
49
51public:
53 virtual ~KnotHolder();
54
55 KnotHolder() = delete; // declared but not defined
56
57 void update_knots();
58 void unselect_knots();
59 void knot_mousedown_handler(SPKnot *knot, unsigned int state);
60 void knot_moved_handler(SPKnot *knot, Geom::Point const &p, unsigned int state);
61 void knot_clicked_handler(SPKnot *knot, unsigned int state);
62 void knot_grabbed_handler(SPKnot *knot, unsigned state);
63 void knot_ungrabbed_handler(SPKnot *knot, unsigned int state);
64 void transform_selected(Geom::Affine transform);
65 void add(KnotHolderEntity *e);
66 void remove(KnotHolderEntity *e);
70 void clear();
71
72 void setEditTransform(Geom::Affine edit_transform);
74
75 bool knot_selected() const;
76 bool knot_mouseover() const;
77
79 SPItem *getItem() { return item; }
80 bool is_dragging() const { return dragging; }
81
84
85 std::list<KnotHolderEntity *> entity; // TODO: convert to std::unique_ptr
86 friend class Inkscape::UI::ShapeEditor; // FIXME why?
90
91protected:
92
94 SPItem *item; // TODO: Remove this and keep the actual item (e.g., SPRect etc.) in the item-specific knotholders
96
97 bool local_change = false;
98
99 bool dragging = false;
100
102 sigc::scoped_connection _watch_fill;
103 sigc::scoped_connection _watch_stroke;
104};
105
106#endif // SEEN_SP_KNOTHOLDER_H
107
108/*
109 Local Variables:
110 mode:c++
111 c-file-style:"stroustrup"
112 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
113 indent-tabs-mode:nil
114 fill-column:99
115 End:
116*/
117// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
3x3 affine transformation matrix.
3x3 matrix representing an affine transformation.
Definition affine.h:70
Two-dimensional point that doubles as a vector.
Definition point.h:66
Interface for refcounted XML nodes.
Definition node.h:80
KnotHolderEntity definition.
SPDesktop * desktop
Definition knot-holder.h:93
void add_filter_knotholder()
SPItem * getItem()
Definition knot-holder.h:79
bool knot_selected() const
Returns true if at least one of the KnotHolderEntities is selected.
void unselect_knots()
void add_hatch_knotholder()
void knot_mousedown_handler(SPKnot *knot, unsigned int state)
virtual ~KnotHolder()
bool is_dragging() const
Definition knot-holder.h:80
Geom::Affine getEditTransform() const
Definition knot-holder.h:73
bool set_item_clickpos(Geom::Point loc)
When editing an object, this extra information tells out knots where the user has clicked on the item...
SPDesktop * getDesktop()
Definition knot-holder.h:78
void transform_selected(Geom::Affine transform)
SPItem * item
Definition knot-holder.h:94
KnotHolder()=delete
Geom::Affine _edit_transform
void knot_moved_handler(SPKnot *knot, Geom::Point const &p, unsigned int state)
void add_pattern_knotholder()
bool knot_mouseover() const
Returns true if at least one of the KnotHolderEntities has the mouse hovering above it.
void update_knots()
Inkscape::XML::Node * repr
repr of the item, for setting and releasing listeners.
Definition knot-holder.h:95
void remove(KnotHolderEntity *e)
bool local_change
if true, no need to recreate knotholder if repr was changed.
Definition knot-holder.h:97
bool dragging
Definition knot-holder.h:99
void knot_grabbed_handler(SPKnot *knot, unsigned state)
Notifies an entity that its knot has just been grabbed.
sigc::scoped_connection _watch_fill
void setEditTransform(Geom::Affine edit_transform)
void install_modification_watch()
When object being edited has some attributes changed (fill, stroke) update what objects we watch.
void knot_ungrabbed_handler(SPKnot *knot, unsigned int state)
void knot_clicked_handler(SPKnot *knot, unsigned int state)
sigc::scoped_connection _watch_stroke
std::list< KnotHolderEntity * > entity
Definition knot-holder.h:85
void add(KnotHolderEntity *e)
To do: update description of desktop.
Definition desktop.h:149
Base class for visual SVG elements.
Definition sp-item.h:109
Desktop-bound visual control object.
Definition knot.h:51
Contains forward declarations of 2geom types.
Helper class to stream background task notifications as a series of messages.