From: cilix42 Date: Thu, 14 Aug 2008 21:30:51 +0000 (+0000) Subject: Remove further instances of SP_ACTIVE_DESKTOP X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1abf95e8668076028170f6f5cbd92806f3306322;p=inkscape.git Remove further instances of SP_ACTIVE_DESKTOP --- diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index f8f2f57bd..cf133407a 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -48,12 +48,12 @@ BlurEdge::load (Inkscape::Extension::Extension */*module*/) /** \brief This actually blurs the edge. \param module The effect that was called (unused) - \param document What should be edited. + \param desktop What should be edited. */ void -BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) +BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *desktop, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - Inkscape::Selection * selection = ((SPDesktop *)document)->selection; + Inkscape::Selection * selection = static_cast(desktop)->selection; float width = module->get_param_float("blur-width"); int steps = module->get_param_int("num-steps"); @@ -71,7 +71,7 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View SPItem * spitem = *item; std::vector new_items(steps); - Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document->doc()); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc()); Inkscape::XML::Node * new_group = xml_doc->createElement("svg:g"); (SP_OBJECT_REPR(spitem)->parent())->appendChild(new_group); @@ -91,16 +91,16 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View new_group->appendChild(new_items[i]); selection->add(new_items[i]); - sp_selected_path_to_curves(); + sp_selected_path_to_curves(static_cast(desktop)); if (offset < 0.0) { /* Doing an inset here folks */ offset *= -1.0; prefs_set_double_attribute("options.defaultoffsetwidth", "value", offset); - sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_INSET)->get_action(document), NULL); + sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_INSET)->get_action(desktop), NULL); } else if (offset > 0.0) { prefs_set_double_attribute("options.defaultoffsetwidth", "value", offset); - sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_OFFSET)->get_action(document), NULL); + sp_action_perform(Inkscape::Verb::get(SP_VERB_SELECTION_OFFSET)->get_action(desktop), NULL); } selection->clear(); diff --git a/src/node-context.cpp b/src/node-context.cpp index 96b562a3f..b205b86d5 100644 --- a/src/node-context.cpp +++ b/src/node-context.cpp @@ -539,7 +539,7 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_r: if (MOD__SHIFT_ONLY) { // FIXME: add top panel button - sp_selected_path_reverse(); + sp_selected_path_reverse(desktop); ret = TRUE; } break; diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index c4855e7d3..4c459ba64 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -30,7 +30,6 @@ #include "libnr/nr-path.h" #include "text-editing.h" #include "style.h" -#include "inkscape.h" #include "desktop.h" #include "document.h" #include "message-stack.h" @@ -41,7 +40,7 @@ #include "path-chemistry.h" /* Helper functions for sp_selected_path_to_curves */ -static void sp_selected_path_to_curves0(gboolean do_document_done, guint32 text_grouping_policy); +static void sp_selected_path_to_curves0(SPDesktop *desktop, bool do_document_done, guint32 text_grouping_policy); static bool sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_select); enum { @@ -53,9 +52,8 @@ enum { }; void -sp_selected_path_combine(void) +sp_selected_path_combine(SPDesktop *desktop) { - SPDesktop *desktop = SP_ACTIVE_DESKTOP; Inkscape::Selection *selection = sp_desktop_selection(desktop); SPDocument *doc = sp_desktop_document(desktop); @@ -180,10 +178,8 @@ sp_selected_path_combine(void) } void -sp_selected_path_break_apart(void) +sp_selected_path_break_apart(SPDesktop *desktop) { - SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Inkscape::Selection *selection = sp_desktop_selection(desktop); if (selection->isEmpty()) { @@ -285,20 +281,14 @@ sp_selected_path_break_apart(void) /* This function is an entry point from GUI */ void -sp_selected_path_to_curves(bool interactive) +sp_selected_path_to_curves(SPDesktop *desktop, bool interactive) { - if (interactive) { - sp_selected_path_to_curves0(TRUE, SP_TOCURVE_INTERACTIVE); - } else { - sp_selected_path_to_curves0(false, 0); - } + sp_selected_path_to_curves0(desktop, interactive, interactive ? SP_TOCURVE_INTERACTIVE : 0); } static void -sp_selected_path_to_curves0(gboolean interactive, guint32 /*text_grouping_policy*/) +sp_selected_path_to_curves0(SPDesktop *desktop, bool interactive, guint32 /*text_grouping_policy*/) { - SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Inkscape::Selection *selection = sp_desktop_selection(desktop); if (selection->isEmpty()) { @@ -476,10 +466,8 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) // FIXME: THIS DOES NOT REVERSE THE NODETYPES ORDER! void -sp_selected_path_reverse() +sp_selected_path_reverse(SPDesktop *desktop) { - SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Inkscape::Selection *selection = sp_desktop_selection(desktop); GSList *items = (GSList *) selection->itemList(); diff --git a/src/path-chemistry.h b/src/path-chemistry.h index a715833d0..27c3b8680 100644 --- a/src/path-chemistry.h +++ b/src/path-chemistry.h @@ -15,11 +15,11 @@ #include "forward.h" -void sp_selected_path_combine (void); -void sp_selected_path_break_apart (void); -void sp_selected_path_to_curves (bool interactive = true); +void sp_selected_path_combine (SPDesktop *desktop); +void sp_selected_path_break_apart (SPDesktop *desktop); +void sp_selected_path_to_curves (SPDesktop *desktop, bool interactive = true); Inkscape::XML::Node *sp_selected_item_to_curved_repr(SPItem *item, guint32 text_grouping_policy); -void sp_selected_path_reverse (); +void sp_selected_path_reverse (SPDesktop *desktop); #endif diff --git a/src/verbs.cpp b/src/verbs.cpp index f96d0a4f0..c60ba6a5f 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1084,7 +1084,7 @@ SelectionVerb::perform(SPAction *action, void *data, void */*pdata*/) sp_selected_path_simplify(); break; case SP_VERB_SELECTION_REVERSE: - sp_selected_path_reverse(); + sp_selected_path_reverse(dt); break; case SP_VERB_SELECTION_TRACE: inkscape_dialogs_unhide(); @@ -1095,10 +1095,10 @@ SelectionVerb::perform(SPAction *action, void *data, void */*pdata*/) break; case SP_VERB_SELECTION_COMBINE: - sp_selected_path_combine(); + sp_selected_path_combine(dt); break; case SP_VERB_SELECTION_BREAK_APART: - sp_selected_path_break_apart(); + sp_selected_path_break_apart(dt); break; case SP_VERB_SELECTION_GRIDTILE: inkscape_dialogs_unhide(); @@ -1332,7 +1332,7 @@ ObjectVerb::perform( SPAction *action, void *data, void */*pdata*/ ) sp_selection_remove_transform(); break; case SP_VERB_OBJECT_TO_CURVE: - sp_selected_path_to_curves(); + sp_selected_path_to_curves(dt); break; case SP_VERB_OBJECT_FLOW_TEXT: text_flow_into_shape();