summaryrefslogtreecommitdiffstats
path: root/src/live_effects/effect.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-06-08 17:56:04 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-06-08 17:56:04 +0000
commit175ad5319a1f62fb7b8a56cc99d4586ce5b10b98 (patch)
tree02702faafa4d4755c5bb90c3f6b57021d472b6d3 /src/live_effects/effect.cpp
parentMake knotholders for LPE items finally work; each effect can now overload the... (diff)
downloadinkscape-175ad5319a1f62fb7b8a56cc99d4586ce5b10b98.tar.gz
inkscape-175ad5319a1f62fb7b8a56cc99d4586ce5b10b98.zip
Better way to add LPE knotholder handles; now it happens semi-automatically in a similar way as adding LPE parameters.
(bzr r5856)
Diffstat (limited to 'src/live_effects/effect.cpp')
-rw-r--r--src/live_effects/effect.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index db395c81b..b08077e79 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -321,14 +321,26 @@ Effect::registerParameter(Parameter * param)
param_vector.push_back(param);
}
-// TODO: Does it still make sense to use this? E.g., should we keep a list of knotholder entities
-// in the effect itself and add them here in a semi-automatic manner (similarly to how it is
-// done with parameters) instead of adding each one separately in the overloaded function
-// addKnotHolderHandles()?
+// TODO: should we provide a way to alter the handle's appearance?
void
-Effect::registerKnotHolderHandle(SPKnotHolderSetFunc set_func, SPKnotHolderGetFunc get_func)
+Effect::registerKnotHolderHandle(KnotHolderEntity* entity, const char* descr)
{
- //knotholder_func_vector.push_back(std::make_pair(set_func, get_func));
+ kh_entity_vector.push_back(std::make_pair(entity, descr));
+}
+
+/**
+ * Add all registered LPE knotholder handles to the knotholder
+ */
+void
+Effect::addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
+ std::vector<std::pair<KnotHolderEntity*, const char*> >::iterator i;
+ for (i = kh_entity_vector.begin(); i != kh_entity_vector.end(); ++i) {
+ KnotHolderEntity *entity = i->first;
+ const char *descr = i->second;
+
+ entity->create(desktop, item, knotholder, descr);
+ knotholder->add(entity);
+ }
}
void
@@ -347,14 +359,6 @@ Effect::addPointParamHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem
}
/**
- * Virtual method to add knotholder handles for LPE items
- */
-void
-Effect::addKnotHolderHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item)
-{
-}
-
-/**
* This *creates* a new widget, management of deletion should be done by the caller
*/
Gtk::Widget *