index 5c273fe29a5a2918b644b62e533dac0838a0aef3..432bf5501e407f576a26c9d10833ae0e77b11604 100644 (file)
--- a/src/knot-holder-entity.h
+++ b/src/knot-holder-entity.h
#include <glib/gtypes.h>
#include "knot.h"
#include <glib/gtypes.h>
#include "knot.h"
+#include <libnr/nr-forward.h>
struct SPItem;
struct SPKnot;
struct SPItem;
struct SPKnot;
-namespace NR {
-class Point;
-}
class SPDesktop;
class KnotHolder;
class SPDesktop;
class KnotHolder;
SPKnotModeType mode = SP_KNOT_MODE_XOR,
guint32 color = 0xffffff00);
SPKnotModeType mode = SP_KNOT_MODE_XOR,
guint32 color = 0xffffff00);
+ /* derived classes used for LPE knotholder handles use this to indicate that they
+ must not be deleted when a knotholder is destroyed */
+ // TODO: it would be nice to ditch this but then we need to dynamically create instances of different
+ // KnotHolderEntity classes in Effect::addKnotHolderEntities. How to do this???
+ virtual bool isDeletable() { return true; }
+
/* the get/set/click handlers are virtual functions; each handler class for a knot
should be derived from KnotHolderEntity and override these functions */
virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state) = 0;
/* the get/set/click handlers are virtual functions; each handler class for a knot
should be derived from KnotHolderEntity and override these functions */
virtual void knot_set(NR::Point const &p, NR::Point const &origin, guint state) = 0;
void update_knot();
//private:
void update_knot();
//private:
+ NR::Point snap_knot_position(NR::Point const &p);
+
SPKnot *knot;
SPItem *item;
SPKnot *knot;
SPItem *item;
+ SPDesktop *desktop;
KnotHolder *parent_holder;
KnotHolder *parent_holder;
sigc::connection _ungrabbed_connection;
};
sigc::connection _ungrabbed_connection;
};
+// derived KnotHolderEntity class for LPEs
+class LPEKnotHolderEntity : public KnotHolderEntity {
+ virtual bool isDeletable() { return false; }
+};
+
/* pattern manipulation */
class PatternKnotHolderEntityXY : public KnotHolderEntity {
/* pattern manipulation */
class PatternKnotHolderEntityXY : public KnotHolderEntity {