From 78b970a0a036f78cfd491553b49ffa00214f7a64 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Tue, 29 Jul 2008 14:51:39 +0000 Subject: Rename isLPEParam() to isDeletable(), create new class LPEKnotHolderEntity and make inheritance from it a bit less clumsy (bzr r6448) --- src/knot-holder-entity.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/knot-holder-entity.h') diff --git a/src/knot-holder-entity.h b/src/knot-holder-entity.h index 9cdc908de..e0d0ca8e8 100644 --- a/src/knot-holder-entity.h +++ b/src/knot-holder-entity.h @@ -41,10 +41,11 @@ public: SPKnotModeType mode = SP_KNOT_MODE_XOR, guint32 color = 0xffffff00); - /* derived classes like PointParam for LPEs use this, e.g., to indicate that we must not call - delete on their pointer when a knotholder is destroyed */ - // TODO: purge this now that PointParams are not KnotHolderEntities any more! - virtual bool isLPEParam() { return false; } + /* 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 */ @@ -75,6 +76,11 @@ public: sigc::connection _ungrabbed_connection; }; +// derived KnotHolderEntity class for LPEs +class LPEKnotHolderEntity : public KnotHolderEntity { + virtual bool isDeletable() { return false; } +}; + /* pattern manipulation */ class PatternKnotHolderEntityXY : public KnotHolderEntity { -- cgit v1.2.3