From: gouldtj Date: Mon, 21 Apr 2008 22:57:53 +0000 (+0000) Subject: r19076@shi: ted | 2008-04-21 15:42:45 -0700 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e4a9f366dbcb54f76b8c42869fa6873808132357;p=inkscape.git r19076@shi: ted | 2008-04-21 15:42:45 -0700 Core of having a real namespace for Inkscape extensions. r19077@shi: ted | 2008-04-21 15:50:12 -0700 First layer of adding NS r19078@shi: ted | 2008-04-21 15:56:03 -0700 Whew, doing the rest of them. --- diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 2010e253a..615aeac7a 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -52,7 +52,7 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * if (repr != NULL) { for (Inkscape::XML::Node *child = sp_repr_children(repr); child != NULL; child = child->next()) { - if (!strcmp(child->name(), "effect")) { + if (!strcmp(child->name(), INKSCAPE_EXTENSION_NS "effect")) { if (child->attribute("needs-document") && !strcmp(child->attribute("needs-document"), "false")) { no_doc = true; } @@ -60,20 +60,20 @@ Effect::Effect (Inkscape::XML::Node * in_repr, Implementation::Implementation * no_live_preview = true; } for (Inkscape::XML::Node *effect_child = sp_repr_children(child); effect_child != NULL; effect_child = effect_child->next()) { - if (!strcmp(effect_child->name(), "effects-menu")) { + if (!strcmp(effect_child->name(), INKSCAPE_EXTENSION_NS "effects-menu")) { // printf("Found local effects menu in %s\n", this->get_name()); local_effects_menu = sp_repr_children(effect_child); if (effect_child->attribute("hidden") && !strcmp(effect_child->attribute("hidden"), "true")) { hidden = true; } } - if (!strcmp(effect_child->name(), "menu-name") || - !strcmp(effect_child->name(), "_menu-name")) { + if (!strcmp(effect_child->name(), INKSCAPE_EXTENSION_NS "menu-name") || + !strcmp(effect_child->name(), INKSCAPE_EXTENSION_NS "_menu-name")) { // printf("Found local effects menu in %s\n", this->get_name()); _verb.set_name(sp_repr_children(effect_child)->content()); } - if (!strcmp(effect_child->name(), "menu-tip") || - !strcmp(effect_child->name(), "_menu-tip")) { + if (!strcmp(effect_child->name(), INKSCAPE_EXTENSION_NS "menu-tip") || + !strcmp(effect_child->name(), INKSCAPE_EXTENSION_NS "_menu-tip")) { // printf("Found local effects menu in %s\n", this->get_name()); _verb.set_tip(sp_repr_children(effect_child)->content()); } diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 1229749f5..52d5f5148 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -79,6 +79,9 @@ Extension::Extension (Inkscape::XML::Node * in_repr, Implementation::Implementat /* TODO: Handle what happens if we don't have these two */ while (child_repr != NULL) { char const * chname = child_repr->name(); + if (!strncmp(chname, INKSCAPE_EXTENSION_NS_NC, strlen(INKSCAPE_EXTENSION_NS_NC))) { + chname += strlen(INKSCAPE_EXTENSION_NS); + } if (chname[0] == '_') /* Allow _ for translation of tags */ chname++; if (!strcmp(chname, "id")) { diff --git a/src/extension/extension.h b/src/extension/extension.h index 6cdb1f44c..b05f67c5d 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -67,6 +67,11 @@ /** Name of the extension error file */ #define EXTENSION_ERROR_LOG_FILENAME "extension-errors.log" + +#define INKSCAPE_EXTENSION_URI "http://www.inkscape.org/namespace/inkscape/extension" +#define INKSCAPE_EXTENSION_NS_NC "extension" +#define INKSCAPE_EXTENSION_NS "extension:" + namespace Inkscape { namespace Extension { diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index cededca51..67e351496 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -366,10 +366,10 @@ Script::load(Inkscape::Extension::Extension *module) /* This should probably check to find the executable... */ Inkscape::XML::Node *child_repr = sp_repr_children(module->get_repr()); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "script")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "script")) { child_repr = sp_repr_children(child_repr); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "command")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "command")) { const gchar *interpretstr = child_repr->attribute("interpreter"); if (interpretstr != NULL) { Glib::ustring interpString = @@ -383,7 +383,7 @@ Script::load(Inkscape::Extension::Extension *module) command.insert(command.end(), tmp); } - if (!strcmp(child_repr->name(), "helper_extension")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "helper_extension")) { helper_extension = sp_repr_children(child_repr)->content(); } child_repr = sp_repr_next(child_repr); @@ -427,12 +427,14 @@ Script::unload(Inkscape::Extension::Extension */*module*/) bool Script::check(Inkscape::Extension::Extension *module) { + int script_count = 0; Inkscape::XML::Node *child_repr = sp_repr_children(module->get_repr()); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "script")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "script")) { + script_count++; child_repr = sp_repr_children(child_repr); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "check")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "check")) { Glib::ustring command_text = solve_reldir(child_repr); if (command_text.size() > 0) { /* I've got the command */ @@ -442,7 +444,7 @@ Script::check(Inkscape::Extension::Extension *module) } } - if (!strcmp(child_repr->name(), "helper_extension")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "helper_extension")) { gchar const *helper = sp_repr_children(child_repr)->content(); if (Inkscape::Extension::db.get(helper) == NULL) { return false; @@ -457,6 +459,10 @@ Script::check(Inkscape::Extension::Extension *module) child_repr = sp_repr_next(child_repr); } + if (script_count == 0) { + return false; + } + return true; } diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index 8b0ba97a8..9540b08e5 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -103,10 +103,10 @@ XSLT::load(Inkscape::Extension::Extension *module) Inkscape::XML::Node *child_repr = sp_repr_children(module->get_repr()); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "xslt")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "xslt")) { child_repr = sp_repr_children(child_repr); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "file")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "file")) { _filename = solve_reldir(child_repr); } child_repr = sp_repr_next(child_repr); diff --git a/src/extension/input.cpp b/src/extension/input.cpp index cdc4f32f4..689c1286f 100644 --- a/src/extension/input.cpp +++ b/src/extension/input.cpp @@ -52,10 +52,13 @@ Input::Input (Inkscape::XML::Node * in_repr, Implementation::Implementation * in child_repr = sp_repr_children(repr); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "input")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "input")) { child_repr = sp_repr_children(child_repr); while (child_repr != NULL) { char const * chname = child_repr->name(); + if (!strncmp(chname, INKSCAPE_EXTENSION_NS_NC, strlen(INKSCAPE_EXTENSION_NS_NC))) { + chname += strlen(INKSCAPE_EXTENSION_NS); + } if (chname[0] == '_') /* Allow _ for translation of tags */ chname++; if (!strcmp(chname, "extension")) { diff --git a/src/extension/internal/bitmap/adaptiveThreshold.cpp b/src/extension/internal/bitmap/adaptiveThreshold.cpp index df1c3ea82..8afbaa0ef 100644 --- a/src/extension/internal/bitmap/adaptiveThreshold.cpp +++ b/src/extension/internal/bitmap/adaptiveThreshold.cpp @@ -34,7 +34,7 @@ void AdaptiveThreshold::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Adaptive Threshold") "\n" "org.inkscape.effect.bitmap.adaptiveThreshold\n" "5\n" diff --git a/src/extension/internal/bitmap/addNoise.cpp b/src/extension/internal/bitmap/addNoise.cpp index 1726ffb43..d524faaff 100644 --- a/src/extension/internal/bitmap/addNoise.cpp +++ b/src/extension/internal/bitmap/addNoise.cpp @@ -40,7 +40,7 @@ void AddNoise::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Add Noise") "\n" "org.inkscape.effect.bitmap.addNoise\n" "\n" diff --git a/src/extension/internal/bitmap/blur.cpp b/src/extension/internal/bitmap/blur.cpp index 9349f4710..2aab4c012 100644 --- a/src/extension/internal/bitmap/blur.cpp +++ b/src/extension/internal/bitmap/blur.cpp @@ -33,7 +33,7 @@ void Blur::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Blur") "\n" "org.inkscape.effect.bitmap.blur\n" "1\n" diff --git a/src/extension/internal/bitmap/channel.cpp b/src/extension/internal/bitmap/channel.cpp index 7699365f3..77bc875a6 100644 --- a/src/extension/internal/bitmap/channel.cpp +++ b/src/extension/internal/bitmap/channel.cpp @@ -43,7 +43,7 @@ void Channel::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Channel") "\n" "org.inkscape.effect.bitmap.channel\n" "\n" diff --git a/src/extension/internal/bitmap/charcoal.cpp b/src/extension/internal/bitmap/charcoal.cpp index 442a5d480..e5a707374 100644 --- a/src/extension/internal/bitmap/charcoal.cpp +++ b/src/extension/internal/bitmap/charcoal.cpp @@ -33,7 +33,7 @@ void Charcoal::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Charcoal") "\n" "org.inkscape.effect.bitmap.charcoal\n" "1\n" diff --git a/src/extension/internal/bitmap/colorize.cpp b/src/extension/internal/bitmap/colorize.cpp index beb6d823b..33020ef43 100644 --- a/src/extension/internal/bitmap/colorize.cpp +++ b/src/extension/internal/bitmap/colorize.cpp @@ -45,7 +45,7 @@ void Colorize::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Colorize") "\n" "org.inkscape.effect.bitmap.colorize\n" "0\n" diff --git a/src/extension/internal/bitmap/contrast.cpp b/src/extension/internal/bitmap/contrast.cpp index f4803dda4..b024c8515 100644 --- a/src/extension/internal/bitmap/contrast.cpp +++ b/src/extension/internal/bitmap/contrast.cpp @@ -32,7 +32,7 @@ void Contrast::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Contrast") "\n" "org.inkscape.effect.bitmap.contrast\n" "1\n" diff --git a/src/extension/internal/bitmap/convolve.cpp b/src/extension/internal/bitmap/convolve.cpp index 83066cce9..2a27fc1ed 100644 --- a/src/extension/internal/bitmap/convolve.cpp +++ b/src/extension/internal/bitmap/convolve.cpp @@ -45,7 +45,7 @@ void Convolve::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" // TRANSLATORS: see http://docs.gimp.org/en/gimp-tool-convolve.html "" N_("Convolve") "\n" "org.inkscape.effect.bitmap.convolve\n" diff --git a/src/extension/internal/bitmap/cycleColormap.cpp b/src/extension/internal/bitmap/cycleColormap.cpp index 7282fa52e..2efb4445c 100644 --- a/src/extension/internal/bitmap/cycleColormap.cpp +++ b/src/extension/internal/bitmap/cycleColormap.cpp @@ -32,7 +32,7 @@ void CycleColormap::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Cycle Colormap") "\n" "org.inkscape.effect.bitmap.cycleColormap\n" "180\n" diff --git a/src/extension/internal/bitmap/despeckle.cpp b/src/extension/internal/bitmap/despeckle.cpp index 2a81d1b3d..1d4d4a785 100644 --- a/src/extension/internal/bitmap/despeckle.cpp +++ b/src/extension/internal/bitmap/despeckle.cpp @@ -31,7 +31,7 @@ void Despeckle::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Despeckle") "\n" "org.inkscape.effect.bitmap.despeckle\n" "\n" diff --git a/src/extension/internal/bitmap/edge.cpp b/src/extension/internal/bitmap/edge.cpp index 4bde1a779..0042e54e1 100644 --- a/src/extension/internal/bitmap/edge.cpp +++ b/src/extension/internal/bitmap/edge.cpp @@ -32,7 +32,7 @@ void Edge::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Edge") "\n" "org.inkscape.effect.bitmap.edge\n" "0\n" diff --git a/src/extension/internal/bitmap/emboss.cpp b/src/extension/internal/bitmap/emboss.cpp index cf47bee9e..f55fbebe9 100644 --- a/src/extension/internal/bitmap/emboss.cpp +++ b/src/extension/internal/bitmap/emboss.cpp @@ -33,7 +33,7 @@ void Emboss::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Emboss") "\n" "org.inkscape.effect.bitmap.emboss\n" "1.0\n" diff --git a/src/extension/internal/bitmap/enhance.cpp b/src/extension/internal/bitmap/enhance.cpp index 99ac4a171..2a1158d1d 100644 --- a/src/extension/internal/bitmap/enhance.cpp +++ b/src/extension/internal/bitmap/enhance.cpp @@ -30,7 +30,7 @@ void Enhance::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Enhance") "\n" "org.inkscape.effect.bitmap.enhance\n" "\n" diff --git a/src/extension/internal/bitmap/equalize.cpp b/src/extension/internal/bitmap/equalize.cpp index 9caf342b0..67f2f5a82 100644 --- a/src/extension/internal/bitmap/equalize.cpp +++ b/src/extension/internal/bitmap/equalize.cpp @@ -30,7 +30,7 @@ void Equalize::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Equalize") "\n" "org.inkscape.effect.bitmap.equalize\n" "\n" diff --git a/src/extension/internal/bitmap/gaussianBlur.cpp b/src/extension/internal/bitmap/gaussianBlur.cpp index 97a2482cb..e5e0db5f4 100644 --- a/src/extension/internal/bitmap/gaussianBlur.cpp +++ b/src/extension/internal/bitmap/gaussianBlur.cpp @@ -33,7 +33,7 @@ void GaussianBlur::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Gaussian Blur") "\n" "org.inkscape.effect.bitmap.gaussianBlur\n" "5.0\n" diff --git a/src/extension/internal/bitmap/implode.cpp b/src/extension/internal/bitmap/implode.cpp index e8fd2201c..75fa1b871 100644 --- a/src/extension/internal/bitmap/implode.cpp +++ b/src/extension/internal/bitmap/implode.cpp @@ -32,7 +32,7 @@ void Implode::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Implode") "\n" "org.inkscape.effect.bitmap.implode\n" "10\n" diff --git a/src/extension/internal/bitmap/level.cpp b/src/extension/internal/bitmap/level.cpp index 04f78d7e5..5890aa9f1 100644 --- a/src/extension/internal/bitmap/level.cpp +++ b/src/extension/internal/bitmap/level.cpp @@ -36,7 +36,7 @@ void Level::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Level") "\n" "org.inkscape.effect.bitmap.level\n" "0\n" diff --git a/src/extension/internal/bitmap/levelChannel.cpp b/src/extension/internal/bitmap/levelChannel.cpp index 601e4d693..dde0feff7 100644 --- a/src/extension/internal/bitmap/levelChannel.cpp +++ b/src/extension/internal/bitmap/levelChannel.cpp @@ -47,7 +47,7 @@ void LevelChannel::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Level (with Channel)") "\n" "org.inkscape.effect.bitmap.levelChannel\n" "\n" diff --git a/src/extension/internal/bitmap/medianFilter.cpp b/src/extension/internal/bitmap/medianFilter.cpp index 3255043ce..0985be3d6 100644 --- a/src/extension/internal/bitmap/medianFilter.cpp +++ b/src/extension/internal/bitmap/medianFilter.cpp @@ -32,7 +32,7 @@ void MedianFilter::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Median Filter") "\n" "org.inkscape.effect.bitmap.medianFilter\n" "0\n" diff --git a/src/extension/internal/bitmap/modulate.cpp b/src/extension/internal/bitmap/modulate.cpp index f8dbca86d..d8ea288ba 100644 --- a/src/extension/internal/bitmap/modulate.cpp +++ b/src/extension/internal/bitmap/modulate.cpp @@ -35,7 +35,7 @@ void Modulate::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Modulate") "\n" "org.inkscape.effect.bitmap.modulate\n" "1\n" diff --git a/src/extension/internal/bitmap/negate.cpp b/src/extension/internal/bitmap/negate.cpp index 8792883dc..0f85ac726 100644 --- a/src/extension/internal/bitmap/negate.cpp +++ b/src/extension/internal/bitmap/negate.cpp @@ -31,7 +31,7 @@ void Negate::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Negate") "\n" "org.inkscape.effect.bitmap.negate\n" "\n" diff --git a/src/extension/internal/bitmap/normalize.cpp b/src/extension/internal/bitmap/normalize.cpp index 0b2ddb303..318afb0da 100644 --- a/src/extension/internal/bitmap/normalize.cpp +++ b/src/extension/internal/bitmap/normalize.cpp @@ -31,7 +31,7 @@ void Normalize::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Normalize") "\n" "org.inkscape.effect.bitmap.normalize\n" "\n" diff --git a/src/extension/internal/bitmap/oilPaint.cpp b/src/extension/internal/bitmap/oilPaint.cpp index 6e8bacdae..5d47efc32 100644 --- a/src/extension/internal/bitmap/oilPaint.cpp +++ b/src/extension/internal/bitmap/oilPaint.cpp @@ -32,7 +32,7 @@ void OilPaint::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Oil Paint") "\n" "org.inkscape.effect.bitmap.oilPaint\n" "3\n" diff --git a/src/extension/internal/bitmap/opacity.cpp b/src/extension/internal/bitmap/opacity.cpp index e2db6792b..6033b5129 100644 --- a/src/extension/internal/bitmap/opacity.cpp +++ b/src/extension/internal/bitmap/opacity.cpp @@ -33,7 +33,7 @@ void Opacity::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Opacity") "\n" "org.inkscape.effect.bitmap.opacity\n" "80.0\n" diff --git a/src/extension/internal/bitmap/raise.cpp b/src/extension/internal/bitmap/raise.cpp index d3130a11d..5ae0339b1 100644 --- a/src/extension/internal/bitmap/raise.cpp +++ b/src/extension/internal/bitmap/raise.cpp @@ -35,7 +35,7 @@ void Raise::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Raise") "\n" "org.inkscape.effect.bitmap.raise\n" "6\n" diff --git a/src/extension/internal/bitmap/reduceNoise.cpp b/src/extension/internal/bitmap/reduceNoise.cpp index 972ab39be..6c483291b 100644 --- a/src/extension/internal/bitmap/reduceNoise.cpp +++ b/src/extension/internal/bitmap/reduceNoise.cpp @@ -35,7 +35,7 @@ void ReduceNoise::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Reduce Noise") "\n" "org.inkscape.effect.bitmap.reduceNoise\n" "-1\n" diff --git a/src/extension/internal/bitmap/sample.cpp b/src/extension/internal/bitmap/sample.cpp index 9c245432a..4c2e95a21 100644 --- a/src/extension/internal/bitmap/sample.cpp +++ b/src/extension/internal/bitmap/sample.cpp @@ -34,7 +34,7 @@ void Sample::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Sample") "\n" "org.inkscape.effect.bitmap.sample\n" "100\n" diff --git a/src/extension/internal/bitmap/shade.cpp b/src/extension/internal/bitmap/shade.cpp index 3ee83b43f..709149c54 100644 --- a/src/extension/internal/bitmap/shade.cpp +++ b/src/extension/internal/bitmap/shade.cpp @@ -35,7 +35,7 @@ void Shade::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Shade") "\n" "org.inkscape.effect.bitmap.shade\n" "30\n" diff --git a/src/extension/internal/bitmap/sharpen.cpp b/src/extension/internal/bitmap/sharpen.cpp index 4e21017ed..cd87785ec 100644 --- a/src/extension/internal/bitmap/sharpen.cpp +++ b/src/extension/internal/bitmap/sharpen.cpp @@ -33,7 +33,7 @@ void Sharpen::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Sharpen") "\n" "org.inkscape.effect.bitmap.sharpen\n" "1.0\n" diff --git a/src/extension/internal/bitmap/solarize.cpp b/src/extension/internal/bitmap/solarize.cpp index 744b09046..147c4f0b5 100644 --- a/src/extension/internal/bitmap/solarize.cpp +++ b/src/extension/internal/bitmap/solarize.cpp @@ -32,7 +32,7 @@ void Solarize::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Solarize") "\n" "org.inkscape.effect.bitmap.solarize\n" "50\n" diff --git a/src/extension/internal/bitmap/spread.cpp b/src/extension/internal/bitmap/spread.cpp index 1000d304d..60b4550de 100644 --- a/src/extension/internal/bitmap/spread.cpp +++ b/src/extension/internal/bitmap/spread.cpp @@ -32,7 +32,7 @@ void Spread::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Spread") "\n" "org.inkscape.effect.bitmap.spread\n" "3\n" diff --git a/src/extension/internal/bitmap/swirl.cpp b/src/extension/internal/bitmap/swirl.cpp index 668528616..a42047527 100644 --- a/src/extension/internal/bitmap/swirl.cpp +++ b/src/extension/internal/bitmap/swirl.cpp @@ -32,7 +32,7 @@ void Swirl::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Swirl") "\n" "org.inkscape.effect.bitmap.swirl\n" "30\n" diff --git a/src/extension/internal/bitmap/threshold.cpp b/src/extension/internal/bitmap/threshold.cpp index ee920a57f..8a6c8a6b0 100644 --- a/src/extension/internal/bitmap/threshold.cpp +++ b/src/extension/internal/bitmap/threshold.cpp @@ -32,7 +32,7 @@ void Threshold::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" // TRANSLATORS: see http://docs.gimp.org/en/gimp-tool-threshold.html "" N_("Threshold") "\n" "org.inkscape.effect.bitmap.threshold\n" diff --git a/src/extension/internal/bitmap/unsharpmask.cpp b/src/extension/internal/bitmap/unsharpmask.cpp index 1249345ba..fe44432eb 100644 --- a/src/extension/internal/bitmap/unsharpmask.cpp +++ b/src/extension/internal/bitmap/unsharpmask.cpp @@ -36,7 +36,7 @@ void Unsharpmask::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Unsharp Mask") "\n" "org.inkscape.effect.bitmap.unsharpmask\n" "5.0\n" diff --git a/src/extension/internal/bitmap/wave.cpp b/src/extension/internal/bitmap/wave.cpp index b654fa7e0..55993e982 100644 --- a/src/extension/internal/bitmap/wave.cpp +++ b/src/extension/internal/bitmap/wave.cpp @@ -33,7 +33,7 @@ void Wave::init(void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Wave") "\n" "org.inkscape.effect.bitmap.wave\n" "25\n" diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index 4a732fb49..f8f2f57bd 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -128,7 +128,7 @@ void BlurEdge::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Inset/Outset Halo") "\n" "org.inkscape.effect.bluredge\n" "1.0\n" diff --git a/src/extension/internal/cairo-pdf-out.cpp b/src/extension/internal/cairo-pdf-out.cpp index 71e9eda17..93dad1e64 100644 --- a/src/extension/internal/cairo-pdf-out.cpp +++ b/src/extension/internal/cairo-pdf-out.cpp @@ -235,7 +235,7 @@ void CairoPdfOutput::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Cairo PDF Output") "\n" "org.inkscape.output.pdf.cairo\n" "\n" diff --git a/src/extension/internal/cairo-png-out.cpp b/src/extension/internal/cairo-png-out.cpp index 6fd45d0d5..c9da645f0 100644 --- a/src/extension/internal/cairo-png-out.cpp +++ b/src/extension/internal/cairo-png-out.cpp @@ -114,7 +114,7 @@ void CairoRendererOutput::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "Cairo PNG Output\n" "org.inkscape.output.png.cairo\n" "\n" diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index 1a4a4a576..610f4fb70 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -218,7 +218,7 @@ void CairoPsOutput::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Cairo PS Output") "\n" "" SP_MODULE_KEY_PRINT_CAIRO_PS "\n" "\n" diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index f1975eb39..919bcd12a 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -114,7 +114,7 @@ void CairoRendererPdfOutput::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "Cairo PDF Output (experimental)\n" "org.inkscape.output.pdf.cairorenderer\n" "\n" diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index 7c0d7e724..3eac9e5fc 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -1681,7 +1681,7 @@ EmfWin32::init (void) /* EMF in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("EMF Input") "\n" "org.inkscape.input.emf.win32\n" "\n" @@ -1695,7 +1695,7 @@ EmfWin32::init (void) /* WMF in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("WMF Input") "\n" "org.inkscape.input.wmf.win32\n" "\n" @@ -1709,7 +1709,7 @@ EmfWin32::init (void) /* EMF out */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("EMF Output") "\n" "org.inkscape.output.emf.win32\n" "true\n" diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 2eac1ad9a..3d18e73b4 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -769,7 +769,7 @@ PrintEmfWin32::init (void) /* EMF print */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "Enhanced Metafile Print\n" "org.inkscape.print.emf.win32\n" "\n" diff --git a/src/extension/internal/eps-out.cpp b/src/extension/internal/eps-out.cpp index 4fd5541c2..550043c96 100644 --- a/src/extension/internal/eps-out.cpp +++ b/src/extension/internal/eps-out.cpp @@ -85,7 +85,7 @@ void EpsOutput::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Encapsulated Postscript Output") "\n" "org.inkscape.output.eps\n" "FALSE\n" diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 0b01a6ab1..14effbeb7 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -110,7 +110,7 @@ GdkpixbufInput::init(void) } gchar *xmlString = g_strdup_printf( - "\n" + "\n" "" N_("%s GDK pixbuf Input") "\n" "org.inkscape.input.gdkpixbuf.%s\n" "\n" diff --git a/src/extension/internal/gimpgrad.cpp b/src/extension/internal/gimpgrad.cpp index d46c1870a..5b3e0c16e 100644 --- a/src/extension/internal/gimpgrad.cpp +++ b/src/extension/internal/gimpgrad.cpp @@ -270,7 +270,7 @@ void GimpGrad::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("GIMP Gradients") "\n" "org.inkscape.input.gimpgrad\n" "\n" diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 57b124035..534d4bcda 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -188,7 +188,7 @@ void Grid::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Grid") "\n" "org.inkscape.effect.grid\n" "1.0\n" diff --git a/src/extension/internal/latex-pstricks-out.cpp b/src/extension/internal/latex-pstricks-out.cpp index 48eb475ba..2dced1d32 100644 --- a/src/extension/internal/latex-pstricks-out.cpp +++ b/src/extension/internal/latex-pstricks-out.cpp @@ -102,7 +102,7 @@ void LatexOutput::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("LaTeX Output") "\n" "org.inkscape.output.latex\n" "\n" diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index 1baa06991..e14d19929 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -343,7 +343,7 @@ PrintLatex::init (void) /* SVG in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("LaTeX Print") "\n" "" SP_MODULE_KEY_PRINT_LATEX "\n" "\n" diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index f94084e4f..3123faebb 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -2420,7 +2420,7 @@ void OdfOutput::init() { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("OpenDocument Drawing Output") "\n" "org.inkscape.output.odf\n" "\n" diff --git a/src/extension/internal/pdf-cairo.cpp b/src/extension/internal/pdf-cairo.cpp index f2a8483c2..0c77c27a6 100644 --- a/src/extension/internal/pdf-cairo.cpp +++ b/src/extension/internal/pdf-cairo.cpp @@ -1051,7 +1051,7 @@ PrintCairoPDF::init(void) { /* PDF out */ (void) Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("PDF Print") "\n" "" SP_MODULE_KEY_PRINT_CAIRO_PDF "\n" "FALSE\n" diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp index 06b680d2a..937fefb11 100644 --- a/src/extension/internal/pdf-input-cairo.cpp +++ b/src/extension/internal/pdf-input-cairo.cpp @@ -84,7 +84,7 @@ PdfInputCairo::init(void) { Inkscape::Extension::Extension * ext; ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "PDF Input\n" "org.inkscape.input.pdf\n" "\n" diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 4211e86ba..1de74541b 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -726,7 +726,7 @@ PdfInput::init(void) { /* PDF in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("PDF Input") "\n" "org.inkscape.input.pdf\n" "\n" @@ -739,7 +739,7 @@ PdfInput::init(void) { /* AI in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("AI Input") "\n" "org.inkscape.input.ai\n" "\n" diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp index 6c3cf4ea1..1e7d50548 100644 --- a/src/extension/internal/pov-out.cpp +++ b/src/extension/internal/pov-out.cpp @@ -679,7 +679,7 @@ void PovOutput::init() { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("PovRay Output") "\n" "org.inkscape.output.pov\n" "\n" diff --git a/src/extension/internal/ps-out.cpp b/src/extension/internal/ps-out.cpp index 8ccd3b593..1daa6514e 100644 --- a/src/extension/internal/ps-out.cpp +++ b/src/extension/internal/ps-out.cpp @@ -78,7 +78,7 @@ void PsOutput::init (void) { Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Postscript Output") "\n" "org.inkscape.output.ps\n" "true\n" diff --git a/src/extension/internal/ps.cpp b/src/extension/internal/ps.cpp index e6086aa81..63361348f 100644 --- a/src/extension/internal/ps.cpp +++ b/src/extension/internal/ps.cpp @@ -1749,7 +1749,7 @@ PrintPS::init(void) { /* SVG in */ (void) Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Postscript Print") "\n" "" SP_MODULE_KEY_PRINT_PS "\n" "FALSE\n" diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index 47f1ce31b..1e10a8066 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -51,7 +51,7 @@ Svg::init(void) /* SVG in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("SVG Input") "\n" "" SP_MODULE_KEY_INPUT_SVG "\n" "\n" @@ -65,7 +65,7 @@ Svg::init(void) /* SVG out Inkscape */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("SVG Output Inkscape") "\n" "" SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE "\n" "\n" @@ -79,7 +79,7 @@ Svg::init(void) /* SVG out */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("SVG Output") "\n" "" SP_MODULE_KEY_OUTPUT_SVG "\n" "\n" diff --git a/src/extension/internal/svgz.cpp b/src/extension/internal/svgz.cpp index 98d3fcfb2..2761fa1d7 100644 --- a/src/extension/internal/svgz.cpp +++ b/src/extension/internal/svgz.cpp @@ -43,7 +43,7 @@ Svgz::init(void) /* SVGZ in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("SVGZ Input") "\n" "" SP_MODULE_KEY_INPUT_SVGZ "\n" "" SP_MODULE_KEY_INPUT_SVG "\n" @@ -58,7 +58,7 @@ Svgz::init(void) /* SVGZ out Inkscape */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("SVGZ Output") "\n" "" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "\n" "\n" @@ -72,7 +72,7 @@ Svgz::init(void) /* SVGZ out */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("SVGZ Output") "\n" "" SP_MODULE_KEY_OUTPUT_SVGZ "\n" "\n" diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp index f0d2343e0..136463f8f 100644 --- a/src/extension/internal/win32.cpp +++ b/src/extension/internal/win32.cpp @@ -487,7 +487,7 @@ PrintWin32::init (void) /* SVG in */ ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("Windows 32-bit Print") "\n" "" SP_MODULE_KEY_PRINT_WIN32 "\n" "TRUE\n" diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp index c17eeffe0..c37d5705b 100644 --- a/src/extension/internal/wpg-input.cpp +++ b/src/extension/internal/wpg-input.cpp @@ -98,7 +98,7 @@ WpgInput::init(void) { Inkscape::Extension::Extension * ext; ext = Inkscape::Extension::build_from_mem( - "\n" + "\n" "" N_("WPG Input") "\n" "org.inkscape.input.wpg\n" "\n" diff --git a/src/extension/output.cpp b/src/extension/output.cpp index e4a7bc5fc..3220e574a 100644 --- a/src/extension/output.cpp +++ b/src/extension/output.cpp @@ -49,10 +49,13 @@ Output::Output (Inkscape::XML::Node * in_repr, Implementation::Implementation * child_repr = sp_repr_children(repr); while (child_repr != NULL) { - if (!strcmp(child_repr->name(), "output")) { + if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "output")) { child_repr = sp_repr_children(child_repr); while (child_repr != NULL) { char const * chname = child_repr->name(); + if (!strncmp(chname, INKSCAPE_EXTENSION_NS_NC, strlen(INKSCAPE_EXTENSION_NS_NC))) { + chname += strlen(INKSCAPE_EXTENSION_NS); + } if (chname[0] == '_') /* Allow _ for translation of tags */ chname++; if (!strcmp(chname, "extension")) { diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index 5c4f96759..1a2623fbf 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -71,6 +71,9 @@ ParamNotebookPage::ParamNotebookPage (const gchar * name, const gchar * guitext, Inkscape::XML::Node *child_repr = sp_repr_children(xml); while (child_repr != NULL) { char const * chname = child_repr->name(); + if (!strncmp(chname, INKSCAPE_EXTENSION_NS_NC, strlen(INKSCAPE_EXTENSION_NS_NC))) { + chname += strlen(INKSCAPE_EXTENSION_NS); + } if (chname[0] == '_') // Allow _ for translation of tags chname++; if (!strcmp(chname, "param") || !strcmp(chname, "_param")) { @@ -237,6 +240,9 @@ ParamNotebook::ParamNotebook (const gchar * name, const gchar * guitext, const g Inkscape::XML::Node *child_repr = sp_repr_children(xml); while (child_repr != NULL) { char const * chname = child_repr->name(); + if (!strncmp(chname, INKSCAPE_EXTENSION_NS_NC, strlen(INKSCAPE_EXTENSION_NS_NC))) { + chname += strlen(INKSCAPE_EXTENSION_NS); + } if (chname[0] == '_') // Allow _ for translation of tags chname++; if (!strcmp(chname, "page")) { diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index 1ab526d19..ba9648618 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -71,7 +71,7 @@ ParamRadioButton::ParamRadioButton (const gchar * name, const gchar * guitext, c Inkscape::XML::Node *child_repr = sp_repr_children(xml); while (child_repr != NULL) { char const * chname = child_repr->name(); - if (!strcmp(chname, "option") || !strcmp(chname, "_option")) { + if (!strcmp(chname, INKSCAPE_EXTENSION_NS "option") || !strcmp(chname, INKSCAPE_EXTENSION_NS "_option")) { Glib::ustring * newguitext = NULL; Glib::ustring * newvalue = NULL; const char * contents = sp_repr_children(child_repr)->content(); diff --git a/src/extension/system.cpp b/src/extension/system.cpp index b9976595a..16e13c94d 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -20,6 +20,7 @@ #include +#include "extension.h" #include "db.h" #include "input.h" #include "output.h" @@ -390,8 +391,8 @@ build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation /* sp_repr_print(repr); */ - if (strcmp(repr->name(), "inkscape-extension")) { - g_warning("Extension definition started with <%s> instead of . Extension will not be created.\n", repr->name()); + if (strcmp(repr->name(), INKSCAPE_EXTENSION_NS "inkscape-extension")) { + g_warning("Extension definition started with <%s> instead of <" INKSCAPE_EXTENSION_NS "inkscape-extension>. Extension will not be created.\n", repr->name()); return NULL; } @@ -399,19 +400,19 @@ build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation while (child_repr != NULL) { char const *element_name = child_repr->name(); /* printf("Child: %s\n", child_repr->name()); */ - if (!strcmp(element_name, "input")) { + if (!strcmp(element_name, INKSCAPE_EXTENSION_NS "input")) { module_functional_type = MODULE_INPUT; - } else if (!strcmp(element_name, "output")) { + } else if (!strcmp(element_name, INKSCAPE_EXTENSION_NS "output")) { module_functional_type = MODULE_OUTPUT; - } else if (!strcmp(element_name, "effect")) { + } else if (!strcmp(element_name, INKSCAPE_EXTENSION_NS "effect")) { module_functional_type = MODULE_FILTER; - } else if (!strcmp(element_name, "print")) { + } else if (!strcmp(element_name, INKSCAPE_EXTENSION_NS "print")) { module_functional_type = MODULE_PRINT; - } else if (!strcmp(element_name, "path-effect")) { + } else if (!strcmp(element_name, INKSCAPE_EXTENSION_NS "path-effect")) { module_functional_type = MODULE_PATH_EFFECT; - } else if (!strcmp(element_name, "script")) { + } else if (!strcmp(element_name, INKSCAPE_EXTENSION_NS "script")) { module_implementation_type = MODULE_EXTENSION; - } else if (!strcmp(element_name, "xslt")) { + } else if (!strcmp(element_name, INKSCAPE_EXTENSION_NS "xslt")) { module_implementation_type = MODULE_XSLT; #if 0 } else if (!strcmp(element_name, "plugin")) { @@ -496,7 +497,7 @@ build_from_file(gchar const *filename) { /* TODO: Need to define namespace here, need to write the DTD in general for this stuff */ - Inkscape::XML::Document *doc = sp_repr_read_file(filename, NULL); + Inkscape::XML::Document *doc = sp_repr_read_file(filename, INKSCAPE_EXTENSION_URI); Extension *ext = build_from_reprdoc(doc, NULL); if (ext != NULL) Inkscape::GC::release(doc); @@ -517,7 +518,7 @@ build_from_file(gchar const *filename) Extension * build_from_mem(gchar const *buffer, Implementation::Implementation *in_imp) { - Inkscape::XML::Document *doc = sp_repr_read_mem(buffer, strlen(buffer), NULL); + Inkscape::XML::Document *doc = sp_repr_read_mem(buffer, strlen(buffer), INKSCAPE_EXTENSION_URI); Extension *ext = build_from_reprdoc(doc, in_imp); Inkscape::GC::release(doc); return ext;