summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-03-19 08:54:26 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-03-19 08:54:26 +0000
commit6a9cf3b81e83a1ed4483e7dd51a3daae6e30647f (patch)
treeef3001a0feb5643be3dc1afb2ac8e96feff8fbaf /src
parentrecurse into groups when pasting lpe (diff)
downloadinkscape-6a9cf3b81e83a1ed4483e7dd51a3daae6e30647f.tar.gz
inkscape-6a9cf3b81e83a1ed4483e7dd51a3daae6e30647f.zip
add delete lpe verb, rearrange menu to collect all lpe commands under path
(bzr r5120)
Diffstat (limited to 'src')
-rw-r--r--src/menus-skeleton.h7
-rw-r--r--src/selection-chemistry.cpp38
-rw-r--r--src/selection-chemistry.h1
-rw-r--r--src/verbs.cpp7
-rw-r--r--src/verbs.h1
5 files changed, 51 insertions, 3 deletions
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index ced61031e..6e4285311 100644
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
@@ -56,7 +56,6 @@ static char const menus_skeleton[] =
" <verb verb-id=\"EditPaste\" />\n"
" <verb verb-id=\"EditPasteInPlace\" />\n"
" <verb verb-id=\"EditPasteStyle\" />\n"
-" <verb verb-id=\"EditPasteLivePathEffect\" />\n"
" <submenu name=\"" N_("Paste Si_ze") "\">\n"
" <verb verb-id=\"EditPasteSize\" />\n"
" <verb verb-id=\"EditPasteWidth\" />\n"
@@ -215,7 +214,11 @@ static char const menus_skeleton[] =
" <verb verb-id=\"SelectionSimplify\" />\n"
" <verb verb-id=\"SelectionReverse\" />\n"
" <separator/>\n"
-" <verb verb-id=\"DialogLivePathEffect\" />\n"
+" <submenu name=\"" N_("Path Effects") "\">\n"
+" <verb verb-id=\"DialogLivePathEffect\" />\n"
+" <verb verb-id=\"PasteLivePathEffect\" />\n"
+" <verb verb-id=\"RemoveLivePathEffect\" />\n"
+" </submenu>\n"
" </submenu>\n"
" <submenu name=\"" N_("_Text") "\">\n"
" <verb verb-id=\"DialogText\" />\n"
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 3a7956595..501f334a2 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -1382,6 +1382,44 @@ void sp_selection_paste_livepatheffect()
_("Paste live path effect"));
}
+
+void sp_selection_remove_livepatheffect_impl(SPItem *item)
+{
+ if ( item && SP_IS_SHAPE(item) ) {
+ sp_shape_remove_path_effect(SP_SHAPE(item));
+ } else if (item && SP_IS_GROUP (item)) {
+ for (SPObject *child = sp_object_first_child(SP_OBJECT(item)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ if (!SP_IS_ITEM (child))
+ continue;
+ sp_selection_remove_livepatheffect_impl (SP_ITEM(child));
+ }
+ }
+}
+
+void sp_selection_remove_livepatheffect()
+{
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ if (desktop == NULL) return;
+
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
+
+ // check if something is selected
+ if (selection->isEmpty()) {
+ desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to remove live path effects from."));
+ return;
+ }
+
+ for ( GSList const *itemlist = selection->itemList(); itemlist != NULL; itemlist = g_slist_next(itemlist) ) {
+ SPItem *item = reinterpret_cast<SPItem*>(itemlist->data);
+
+ sp_selection_remove_livepatheffect_impl(item);
+
+ }
+
+ sp_document_done(sp_desktop_document (desktop), SP_VERB_EDIT_PASTE_LIVEPATHEFFECT,
+ _("Remove live path effect"));
+}
+
void sp_selection_paste_size (bool apply_x, bool apply_y)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h
index 9307fe5c0..86edc9091 100644
--- a/src/selection-chemistry.h
+++ b/src/selection-chemistry.h
@@ -63,6 +63,7 @@ void sp_selection_copy_lpe_pathparam(Inkscape::LivePathEffect::PathParam * pathp
void sp_selection_paste(bool in_place);
void sp_selection_paste_style();
void sp_selection_paste_livepatheffect();
+void sp_selection_remove_livepatheffect();
void sp_set_style_clipboard (SPCSSAttr *css);
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 7bd175755..060f6aae3 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -879,6 +879,9 @@ EditVerb::perform(SPAction *action, void *data, void */*pdata*/)
case SP_VERB_EDIT_PASTE_LIVEPATHEFFECT:
sp_selection_paste_livepatheffect();
break;
+ case SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT:
+ sp_selection_remove_livepatheffect();
+ break;
case SP_VERB_EDIT_DELETE:
sp_selection_delete();
break;
@@ -2201,8 +2204,10 @@ Verb *Verb::_base_verbs[] = {
N_("Scale each selected object vertically to match the height of the copied object"), NULL),
new EditVerb(SP_VERB_EDIT_PASTE_IN_PLACE, "EditPasteInPlace", N_("Paste _In Place"),
N_("Paste objects from clipboard to the original location"), "selection_paste_in_place"),
- new EditVerb(SP_VERB_EDIT_PASTE_LIVEPATHEFFECT, "EditPasteLivePathEffect", N_("Paste Path _Effect"),
+ new EditVerb(SP_VERB_EDIT_PASTE_LIVEPATHEFFECT, "PasteLivePathEffect", N_("Paste Path _Effect"),
N_("Apply the path effect of the copied object to selection"), NULL),
+ new EditVerb(SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT, "RemoveLivePathEffect", N_("Remove Path _Effect"),
+ N_("Remove any path effects from selected objects"), NULL),
new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
N_("Delete selection"), GTK_STOCK_DELETE),
new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
diff --git a/src/verbs.h b/src/verbs.h
index 6924a4bfd..dc09636f6 100644
--- a/src/verbs.h
+++ b/src/verbs.h
@@ -64,6 +64,7 @@ enum {
SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y,
SP_VERB_EDIT_PASTE_IN_PLACE,
SP_VERB_EDIT_PASTE_LIVEPATHEFFECT,
+ SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT,
SP_VERB_EDIT_DELETE,
SP_VERB_EDIT_DUPLICATE,
SP_VERB_EDIT_CLONE,