summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorroot <root@jtx.marker.es>2013-10-05 00:49:20 +0000
committerroot <root@jtx.marker.es>2013-10-05 00:49:20 +0000
commit0de4a7013187366efbeeb5887191b6ea57445899 (patch)
tree4403a23f086824c3f43a0d60853e625f5ce5c635 /src/ui
parentupdate to trunk (diff)
parentC++ (diff)
downloadinkscape-0de4a7013187366efbeeb5887191b6ea57445899.tar.gz
inkscape-0de4a7013187366efbeeb5887191b6ea57445899.zip
update to trunk
(bzr r11950.1.159)
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.cpp9
-rw-r--r--src/ui/tool/path-manipulator.h2
4 files changed, 20 insertions, 15 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 10e50a970..f72313315 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -222,7 +222,7 @@ void PathManipulator::writeXML()
sp_object_ref(_path);
_path->deleteObject(true, true);
sp_object_unref(_path);
- _path = 0;
+ _path = NULL;
}
_observer->unblock();
}
@@ -1317,8 +1317,9 @@ void PathManipulator::_createGeometryFromControlPoints(bool alert_LPE)
Geom::PathVector pathv = builder.peek() * (_edit_transform * _i2d_transform).inverse();
_spcurve->set_pathvector(pathv);
if (alert_LPE) {
+ /// \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 = sp_lpe_item_get_effect_list(_path);
+ 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);
@@ -1419,6 +1420,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 2fc0b90da..8bf228a54 100644
--- a/src/ui/tool/path-manipulator.h
+++ b/src/ui/tool/path-manipulator.h
@@ -144,7 +144,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