summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-10-05 00:53:12 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-10-05 00:53:12 +0000
commit995c8028b521eb7d17334e6f6d34bbb54949a48b (patch)
tree6d2e811cfbfe459d31edfd9234bdda8bab57788b /src/ui
parentupdate to trunk (diff)
parentC++ (diff)
downloadinkscape-995c8028b521eb7d17334e6f6d34bbb54949a48b.tar.gz
inkscape-995c8028b521eb7d17334e6f6d34bbb54949a48b.zip
update to trunk
(bzr r12588.1.11)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/clipboard.cpp4
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp20
-rw-r--r--src/ui/tool/path-manipulator.cpp11
-rw-r--r--src/ui/tool/path-manipulator.h2
4 files changed, 21 insertions, 16 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index ed28cabbd..da6fed86b 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -938,7 +938,7 @@ void ClipboardManagerImpl::_applyPathEffect(SPItem *item, gchar const *effectsta
{
SPLPEItem *lpeitem = SP_LPE_ITEM(item);
// for each effect in the stack, check if we need to fork it before adding it to the item
- sp_lpe_item_fork_path_effects_if_necessary(lpeitem, 1);
+ lpeitem->forkPathEffectsIfNecessary(1);
std::istringstream iss(effectstack);
std::string href;
@@ -949,7 +949,7 @@ void ClipboardManagerImpl::_applyPathEffect(SPItem *item, gchar const *effectsta
return;
}
LivePathEffectObject *lpeobj = LIVEPATHEFFECT(obj);
- sp_lpe_item_add_path_effect(lpeitem, lpeobj);
+ lpeitem->addPathEffect(lpeobj);
}
}
}
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index e96b57170..30b16cee0 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -280,7 +280,7 @@ LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel)
set_sensitize_all(true);
if ( lpeitem->hasPathEffect() ) {
- Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(lpeitem);
+ Inkscape::LivePathEffect::Effect *lpe = lpeitem->getCurrentLPE();
if (lpe) {
showParams(*lpe);
lpe_list_locked = true;
@@ -332,7 +332,7 @@ LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem)
{
effectlist_store->clear();
- PathEffectList effectlist = sp_lpe_item_get_effect_list(lpeitem);
+ PathEffectList effectlist = lpeitem->getEffectList();
PathEffectList::iterator it;
for( it = effectlist.begin() ; it!=effectlist.end(); ++it)
{
@@ -475,7 +475,7 @@ LivePathEffectEditor::onRemove()
if ( sel && !sel->isEmpty() ) {
SPItem *item = sel->singleItem();
if ( item && SP_IS_LPE_ITEM(item) ) {
- sp_lpe_item_remove_current_path_effect(SP_LPE_ITEM(item), false);
+ SP_LPE_ITEM(item)->removeCurrentPathEffect(false);
DocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Remove path effect") );
@@ -491,13 +491,13 @@ void LivePathEffectEditor::onUp()
Inkscape::Selection *sel = _getSelection();
if ( sel && !sel->isEmpty() ) {
SPItem *item = sel->singleItem();
- if ( item && SP_IS_LPE_ITEM(item) ) {
- sp_lpe_item_up_current_path_effect(SP_LPE_ITEM(item));
+ if ( SPLPEItem *lpeitem = SP_LPE_ITEM(item) ) {
+ lpeitem->upCurrentPathEffect();
DocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Move path effect up") );
- effect_list_reload(SP_LPE_ITEM(item));
+ effect_list_reload(lpeitem);
}
}
}
@@ -507,13 +507,13 @@ void LivePathEffectEditor::onDown()
Inkscape::Selection *sel = _getSelection();
if ( sel && !sel->isEmpty() ) {
SPItem *item = sel->singleItem();
- if ( item && SP_IS_LPE_ITEM(item) ) {
- sp_lpe_item_down_current_path_effect(SP_LPE_ITEM(item));
+ if ( SPLPEItem *lpeitem = SP_LPE_ITEM(item) ) {
+ lpeitem->downCurrentPathEffect();
DocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
_("Move path effect down") );
- effect_list_reload(SP_LPE_ITEM(item));
+ effect_list_reload(lpeitem);
}
}
}
@@ -530,7 +530,7 @@ void LivePathEffectEditor::on_effect_selection_changed()
if (lperef && current_lpeitem) {
if (lperef->lpeobject->get_lpe()) {
lpe_list_locked = true; // prevent reload of the list which would lose selection
- sp_lpe_item_set_current_path_effect(current_lpeitem, lperef);
+ current_lpeitem->setCurrentPathEffect(lperef);
showParams(*lperef->lpeobject->get_lpe());
}
}
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index b775c0637..d12e2958b 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -203,7 +203,7 @@ void PathManipulator::writeXML()
sp_object_ref(_path);
_path->deleteObject(true, true);
sp_object_unref(_path);
- _path = 0;
+ _path = NULL;
}
_observer->unblock();
}
@@ -1206,8 +1206,9 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE)
Geom::PathVector pathv = builder.peek() * (_edit_transform * _i2d_transform).inverse();
_spcurve->set_pathvector(pathv);
if (alert_LPE) {
- if (_path->hasPathEffect()) {
- PathEffectList effect_list = sp_lpe_item_get_effect_list(_path);
+ /// \todo note that _path can be an Inkscape::LivePathEffect::Effect* too, kind of confusing, rework member naming?
+ if (SP_IS_LPE_ITEM(_path) && _path->hasPathEffect()) {
+ PathEffectList effect_list = _path->getEffectList();
LivePathEffect::LPEPowerStroke *lpe_pwr = dynamic_cast<LivePathEffect::LPEPowerStroke*>( effect_list.front()->lpeobject->get_lpe() );
if (lpe_pwr) {
lpe_pwr->adjustForNewPath(pathv);
@@ -1309,6 +1310,10 @@ void PathManipulator::_getGeometry()
} else {
_spcurve->unref();
_spcurve = _path->get_curve_for_edit();
+ // never allow NULL to sneak in here!
+ if (_spcurve == NULL) {
+ _spcurve = new SPCurve();
+ }
}
}
diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h
index 1444272e8..e01e8617f 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -131,7 +131,7 @@ private:
SubpathList _subpaths;
MultiPathManipulator &_multi_path_manipulator;
- SPPath *_path;
+ SPPath *_path; ///< can be an SPPath or an Inkscape::LivePathEffect::Effect !!!
SPCurve *_spcurve; // in item coordinates
SPCanvasItem *_outline;
CurveDragPoint *_dragpoint; // an invisible control point hoverng over curve