diff options
Diffstat (limited to 'src/extension')
| -rw-r--r-- | src/extension/implementation/implementation.cpp | 17 | ||||
| -rw-r--r-- | src/extension/internal/bitmap/imagemagick.cpp | 5 | ||||
| -rw-r--r-- | src/extension/internal/bluredge.cpp | 6 | ||||
| -rw-r--r-- | src/extension/internal/filter/filter.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/grid.cpp | 5 | ||||
| -rw-r--r-- | src/extension/internal/pdfinput/svg-builder.cpp | 10 | ||||
| -rw-r--r-- | src/extension/param/parameter.cpp | 2 | ||||
| -rw-r--r-- | src/extension/patheffect.cpp | 2 |
8 files changed, 28 insertions, 23 deletions
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index b1b671026..63181d0c4 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -96,23 +96,26 @@ Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc* return; } /* Implementation::save */ -Gtk::Widget * -Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal<void> * changeSignal, ImplementationDocumentCache * docCache) { - if (module->param_visible_count() == 0) return NULL; +Gtk::Widget *Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal<void> * changeSignal, ImplementationDocumentCache * /*docCache*/) +{ + if (module->param_visible_count() == 0) { + return NULL; + } SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator<SPItem *> selected = sp_desktop_selection((SPDesktop *)view)->itemList(); - Inkscape::XML::Node * first_select = NULL; + Inkscape::XML::Node const* first_select = NULL; if (selected != NULL) { const SPItem * item = *selected; - first_select = SP_OBJECT_REPR(item); + first_select = item->getRepr(); } - return module->autogui(current_document, first_select, changeSignal); -} /* Implementation::prefs_effect */ + // TODO deal with this broken const correctness: + return module->autogui(current_document, const_cast<Inkscape::XML::Node *>(first_select), changeSignal); +} // Implementation::prefs_effect void Implementation::effect(Inkscape::Extension::Effect */*module*/, Inkscape::UI::View::View */*document*/, ImplementationDocumentCache * /*docCache*/) { diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index e907612fd..65968bdc4 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -226,8 +226,9 @@ ImageMagick::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::Vie using Inkscape::Util::GSListConstIterator; GSListConstIterator<SPItem *> selected = sp_desktop_selection((SPDesktop *)view)->itemList(); Inkscape::XML::Node * first_select = NULL; - if (selected != NULL) - first_select = SP_OBJECT_REPR(*selected); + if (selected != NULL) { + first_select = (*selected)->getRepr(); + } return module->autogui(current_document, first_select, changeSignal); } diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index ba6b8383c..8ec09d11e 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -74,9 +74,9 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View std::vector<Inkscape::XML::Node *> new_items(steps); Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc(); Inkscape::XML::Node * new_group = xml_doc->createElement("svg:g"); - (SP_OBJECT_REPR(spitem)->parent())->appendChild(new_group); + spitem->getRepr()->parent()->appendChild(new_group); - double orig_opacity = sp_repr_css_double_property(sp_repr_css_attr(SP_OBJECT_REPR(spitem), "style"), "opacity", 1.0); + double orig_opacity = sp_repr_css_double_property(sp_repr_css_attr(spitem->getRepr(), "style"), "opacity", 1.0); char opacity_string[64]; g_ascii_formatd(opacity_string, sizeof(opacity_string), "%f", orig_opacity / (steps)); @@ -84,7 +84,7 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View for (int i = 0; i < steps; i++) { double offset = (width / (float)(steps - 1) * (float)i) - (width / 2.0); - new_items[i] = (SP_OBJECT_REPR(spitem))->duplicate(xml_doc); + new_items[i] = spitem->getRepr()->duplicate(xml_doc); SPCSSAttr * css = sp_repr_css_attr(new_items[i], "style"); sp_repr_css_set_property(css, "opacity", opacity_string); diff --git a/src/extension/internal/filter/filter.cpp b/src/extension/internal/filter/filter.cpp index 90dc5dd6f..715278051 100644 --- a/src/extension/internal/filter/filter.cpp +++ b/src/extension/internal/filter/filter.cpp @@ -133,12 +133,12 @@ Filter::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *d items.insert<GSListConstIterator<SPItem *> >(items.end(), selection->itemList(), NULL); Inkscape::XML::Document * xmldoc = document->doc()->getReprDoc(); - Inkscape::XML::Node * defsrepr = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(document->doc())); + Inkscape::XML::Node * defsrepr = SP_DOCUMENT_DEFS(document->doc())->getRepr(); for(std::list<SPItem *>::iterator item = items.begin(); item != items.end(); item++) { SPItem * spitem = *item; - Inkscape::XML::Node * node = SP_OBJECT_REPR(spitem); + Inkscape::XML::Node * node = spitem->getRepr(); SPCSSAttr * css = sp_repr_css_attr(node, "style"); gchar const * filter = sp_repr_css_property(css, "filter", NULL); diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index a19ab7538..2e743d32a 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -183,8 +183,9 @@ Grid::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View using Inkscape::Util::GSListConstIterator; GSListConstIterator<SPItem *> selected = sp_desktop_selection((SPDesktop *)view)->itemList(); Inkscape::XML::Node * first_select = NULL; - if (selected != NULL) - first_select = SP_OBJECT_REPR(*selected); + if (selected != NULL) { + first_select = (*selected)->getRepr(); + } return module->autogui(current_document, first_select, changeSignal); } diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 8d7c95560..94edf826e 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -531,7 +531,7 @@ void SvgBuilder::setClipPath(GfxState *state, bool even_odd) { clip_path->appendChild(path); Inkscape::GC::release(path); // Append clipPath to defs and get id - SP_OBJECT_REPR (SP_DOCUMENT_DEFS (_doc))->appendChild(clip_path); + SP_DOCUMENT_DEFS(_doc)->getRepr()->appendChild(clip_path); gchar *urltext = g_strdup_printf ("url(#%s)", clip_path->attribute("id")); Inkscape::GC::release(clip_path); _container->setAttribute("clip-path", urltext); @@ -678,7 +678,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern, delete pattern_builder; // Append the pattern to defs - SP_OBJECT_REPR (SP_DOCUMENT_DEFS (_doc))->appendChild(pattern_node); + SP_DOCUMENT_DEFS(_doc)->getRepr()->appendChild(pattern_node); gchar *id = g_strdup(pattern_node->attribute("id")); Inkscape::GC::release(pattern_node); @@ -752,7 +752,7 @@ gchar *SvgBuilder::_createGradient(GfxShading *shading, double *matrix, bool for return NULL; } - Inkscape::XML::Node *defs = SP_OBJECT_REPR (SP_DOCUMENT_DEFS (_doc)); + Inkscape::XML::Node *defs = SP_DOCUMENT_DEFS(_doc)->getRepr(); defs->appendChild(gradient); gchar *id = g_strdup(gradient->attribute("id")); Inkscape::GC::release(gradient); @@ -1635,9 +1635,9 @@ Inkscape::XML::Node *SvgBuilder::_createMask(double width, double height) { sp_repr_set_svg_double(mask_node, "height", height); // Append mask to defs if (_is_top_level) { - SP_OBJECT_REPR (SP_DOCUMENT_DEFS (_doc))->appendChild(mask_node); + SP_DOCUMENT_DEFS(_doc)->getRepr()->appendChild(mask_node); Inkscape::GC::release(mask_node); - return SP_OBJECT_REPR (SP_DOCUMENT_DEFS (_doc))->lastChild(); + return SP_DOCUMENT_DEFS(_doc)->getRepr()->lastChild(); } else { // Work around for renderer bug when mask isn't defined in pattern static int mask_count = 0; Inkscape::XML::Node *defs = _root->firstChild(); diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index ac7c8b8dd..529d5a775 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -349,7 +349,7 @@ Parameter::new_child (Inkscape::XML::Node * parent) Inkscape::XML::Node *Parameter::document_param_node(SPDocument * doc) { Inkscape::XML::Document *xml_doc = doc->getReprDoc(); - Inkscape::XML::Node * defs = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc)); + Inkscape::XML::Node * defs = SP_DOCUMENT_DEFS(doc)->getRepr(); Inkscape::XML::Node * params = NULL; GQuark const name_quark = g_quark_from_string("inkscape:extension-params"); diff --git a/src/extension/patheffect.cpp b/src/extension/patheffect.cpp index 8e3fc13f1..09ee9be0b 100644 --- a/src/extension/patheffect.cpp +++ b/src/extension/patheffect.cpp @@ -42,7 +42,7 @@ PathEffect::processPathEffects (SPDocument * doc, Inkscape::XML::Node * path) return; gchar ** patheffects = g_strsplit(patheffectlist, ";", 128); - Inkscape::XML::Node * defs = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc)); + Inkscape::XML::Node * defs = SP_DOCUMENT_DEFS(doc)->getRepr(); for (int i = 0; patheffects[i] != NULL && i < 128; i++) { gchar * patheffect = patheffects[i]; |
