1 #ifndef __SP_KNOTHOLDER_H__
2 #define __SP_KNOTHOLDER_H__
4 /*
5 * KnotHolder - Hold SPKnot list and manage signals
6 *
7 * Author:
8 * Mitsuru Oka <oka326@parkcity.ne.jp>
9 * Maximilian Albert <maximilian.albert@gmail.com>
10 *
11 * Copyright (C) 1999-2001 Lauris Kaplinski
12 * Copyright (C) 2000-2001 Ximian, Inc.
13 * Copyright (C) 2001 Mitsuru Oka
14 * Copyright (C) 2008 Maximilian Albert
15 *
16 * Released under GNU GPL
17 *
18 */
20 #include <glib/gtypes.h>
21 #include "knot-enums.h"
22 #include "forward.h"
23 #include "libnr/nr-forward.h"
24 #include <2geom/forward.h>
25 #include "knot-holder-entity.h"
26 #include <list>
28 namespace Inkscape {
29 namespace XML {
30 class Node;
31 }
32 }
34 class KnotHolder {
35 public:
36 KnotHolder() {} // do nothing in the default constructor
37 KnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderReleasedFunc relhandler);
38 virtual ~KnotHolder();
40 void update_knots();
42 void knot_moved_handler(SPKnot *knot, Geom::Point const &p, guint state);
43 void knot_clicked_handler(SPKnot *knot, guint state);
44 void knot_ungrabbed_handler(SPKnot *knot);
46 void add(KnotHolderEntity *e);
48 void add_pattern_knotholder();
50 const SPItem *getItem() { return item; }
52 friend class ShapeEditor;
54 protected:
55 SPDesktop *desktop;
56 SPItem *item; // TODO: Remove this and keep the actual item (e.g., SPRect etc.) in the item-specific knotholders
57 Inkscape::XML::Node *repr; ///< repr of the item, for setting and releasing listeners.
58 std::list<KnotHolderEntity *> entity;
60 SPKnotHolderReleasedFunc released;
62 gboolean local_change; ///< if true, no need to recreate knotholder if repr was changed.
64 bool dragging;
65 };
67 /**
68 void knot_clicked_handler(SPKnot *knot, guint state, gpointer data);
69 void knot_moved_handler(SPKnot *knot, Geom::Point const *p, guint state, gpointer data);
70 void knot_ungrabbed_handler(SPKnot *knot, unsigned int state, KnotHolder *kh);
71 **/
73 #endif /* !__SP_KNOTHOLDER_H__ */
75 /*
76 Local Variables:
77 mode:c++
78 c-file-style:"stroustrup"
79 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
80 indent-tabs-mode:nil
81 fill-column:99
82 End:
83 */
84 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :