summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-07-25 01:06:47 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-07-25 01:06:47 +0000
commit4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3 (patch)
tree75853d8eec5e85fb93a2a798b57f072e3c9eeb99 /src/extension
parentReplace direct use of Cairo contexts and surfaces in the rendering tree (diff)
parentRevert workarounds from 10501 - no longer necessary (diff)
downloadinkscape-4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3.tar.gz
inkscape-4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3.zip
Merge from trunk
(bzr r10347.1.18)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/internal/cairo-png-out.cpp4
-rw-r--r--src/extension/internal/cairo-ps-out.cpp2
-rw-r--r--src/extension/internal/cairo-renderer-pdf-out.cpp2
-rw-r--r--src/extension/internal/cairo-renderer.cpp8
-rw-r--r--src/extension/internal/emf-win32-print.cpp4
-rwxr-xr-xsrc/extension/internal/filter/color.h60
-rwxr-xr-xsrc/extension/internal/filter/experimental.h24
-rw-r--r--src/extension/internal/filter/image.h6
-rw-r--r--src/extension/internal/filter/shadows.h38
-rw-r--r--src/extension/internal/gdkpixbuf-input.cpp4
-rw-r--r--src/extension/internal/javafx-out.cpp8
-rw-r--r--src/extension/internal/latex-pstricks-out.cpp28
-rw-r--r--src/extension/internal/latex-pstricks.cpp2
-rw-r--r--src/extension/internal/latex-text-renderer.cpp8
-rw-r--r--src/extension/internal/odf.cpp6
-rw-r--r--src/extension/internal/pov-out.cpp2
-rw-r--r--src/extension/patheffect.cpp4
17 files changed, 121 insertions, 89 deletions
diff --git a/src/extension/internal/cairo-png-out.cpp b/src/extension/internal/cairo-png-out.cpp
index b30e22e7e..f741c9f39 100644
--- a/src/extension/internal/cairo-png-out.cpp
+++ b/src/extension/internal/cairo-png-out.cpp
@@ -57,8 +57,8 @@ png_render_document_to_file(SPDocument *doc, gchar const *filename)
doc->ensureUpToDate();
/* Start */
- /* Create new arena */
- SPItem *base = SP_ITEM(doc->getRoot());
+ // Create new arena
+ SPItem *base = doc->getRoot();
NRArena *arena = NRArena::create();
unsigned dkey = SPItem::display_key_new(1);
NRArenaItem *root = base->invoke_show(arena, dkey, SP_ITEM_SHOW_DISPLAY);
diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp
index a5b7b3237..7fdfaf8df 100644
--- a/src/extension/internal/cairo-ps-out.cpp
+++ b/src/extension/internal/cairo-ps-out.cpp
@@ -79,7 +79,7 @@ ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int l
}
else {
// we want to export the entire document from root
- base = SP_ITEM(doc->getRoot());
+ base = doc->getRoot();
pageBoundingBox = !exportDrawing;
}
diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp
index cdd9647e2..5d7c82bff 100644
--- a/src/extension/internal/cairo-renderer-pdf-out.cpp
+++ b/src/extension/internal/cairo-renderer-pdf-out.cpp
@@ -73,7 +73,7 @@ pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int
}
else {
// we want to export the entire document from root
- base = SP_ITEM(doc->getRoot());
+ base = doc->getRoot();
pageBoundingBox = !exportDrawing;
}
diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp
index 1e550f7d1..7eb7881dc 100644
--- a/src/extension/internal/cairo-renderer.cpp
+++ b/src/extension/internal/cairo-renderer.cpp
@@ -454,7 +454,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
// Get the bounding box of the selection in document coordinates.
Geom::OptRect bbox =
- item->getBounds(item->i2d_affine(), SPItem::RENDERING_BBOX);
+ item->getBounds(item->i2dt_affine(), SPItem::RENDERING_BBOX);
// no bbox, e.g. empty group
if (!bbox) {
@@ -502,7 +502,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx)
(Geom::Affine)(Geom::Translate (shift_x, shift_y));
// ctx matrix already includes item transformation. We must substract.
- Geom::Affine t_item = item->i2d_affine ();
+ Geom::Affine t_item = item->i2dt_affine ();
Geom::Affine t = t_on_document * t_item.inverse();
// Do the export
@@ -624,7 +624,7 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page
g_assert( ctx != NULL );
if (!base) {
- base = SP_ITEM(doc->getRoot());
+ base = doc->getRoot();
}
NRRect d;
@@ -633,7 +633,7 @@ CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool page
d.x1 = doc->getWidth();
d.y1 = doc->getHeight();
} else {
- base->invoke_bbox( &d, base->i2d_affine(), TRUE, SPItem::RENDERING_BBOX);
+ base->invoke_bbox( &d, base->i2dt_affine(), TRUE, SPItem::RENDERING_BBOX);
}
if (ctx->_vector_based_target) {
diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp
index e5d1b0681..7ed0f6fcf 100644
--- a/src/extension/internal/emf-win32-print.cpp
+++ b/src/extension/internal/emf-win32-print.cpp
@@ -144,7 +144,7 @@ PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc)
d.y1 = _height;
} else {
SPItem* doc_item = doc->getRoot();
- doc_item->invoke_bbox(&d, doc_item->i2d_affine(), TRUE);
+ doc_item->invoke_bbox(&d, doc_item->i2dt_affine(), TRUE);
}
d.x0 *= IN_PER_PX;
@@ -226,7 +226,7 @@ PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc)
g_free(local_fn);
g_free(unicode_fn);
- m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight()));
+ m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight())); /// @fixme hardcoded doc2dt transform
return 0;
}
diff --git a/src/extension/internal/filter/color.h b/src/extension/internal/filter/color.h
index 27b1fdda9..53734bee5 100755
--- a/src/extension/internal/filter/color.h
+++ b/src/extension/internal/filter/color.h
@@ -39,9 +39,10 @@ namespace Filter {
Brightness filter.
Filter's parameters:
- * Strength (-10.->10., default 1) -> colorMatrix (RVB entries)
- * Vibration (-10.->10., default 0.) -> colorMatrix (6 other entries)
+ * Brightness (1.->10., default 2.) -> colorMatrix (RVB entries)
+ * Over-saturation (0.->10., default 0.5) -> colorMatrix (6 other entries)
* Lightness (-10.->10., default 0.) -> colorMatrix (last column)
+ * Inverted (boolean, default false) -> colorMatrix
Matrix:
St Vi Vi 0 Li
@@ -62,9 +63,10 @@ public:
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("Brightness, custom (Color)") "</name>\n"
"<id>org.inkscape.effect.filter.Brightness</id>\n"
- "<param name=\"strength\" gui-text=\"" N_("Strength:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">1</param>\n"
- "<param name=\"vibration\" gui-text=\"" N_("Vibration:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">0</param>\n"
+ "<param name=\"brightness\" gui-text=\"" N_("Brightness:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"1\" max=\"10.00\">2</param>\n"
+ "<param name=\"sat\" gui-text=\"" N_("Over-saturation:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.0\" max=\"10.00\">0.5</param>\n"
"<param name=\"lightness\" gui-text=\"" N_("Lightness:") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"-10.00\" max=\"10.00\">0</param>\n"
+ "<param name=\"invert\" gui-text=\"" N_("Inverted") "\" type=\"boolean\">false</param>\n"
"<effect>\n"
"<object-type>all</object-type>\n"
"<effects-menu>\n"
@@ -83,21 +85,29 @@ Brightness::get_filter_text (Inkscape::Extension::Extension * ext)
{
if (_filter != NULL) g_free((void *)_filter);
- std::ostringstream strength;
- std::ostringstream vibration;
+ std::ostringstream brightness;
+ std::ostringstream sat;
std::ostringstream lightness;
- strength << ext->get_param_float("strength");
- vibration << ext->get_param_float("vibration");
- lightness << ext->get_param_float("lightness");
+ if (ext->get_param_bool("invert")) {
+ brightness << -ext->get_param_float("brightness");
+ sat << 1 + ext->get_param_float("sat");
+ lightness << -ext->get_param_float("lightness");
+ } else {
+ brightness << ext->get_param_float("brightness");
+ sat << -ext->get_param_float("sat");
+ lightness << ext->get_param_float("lightness");
+ }
+
+
_filter = g_strdup_printf(
"<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" color-interpolation-filters=\"sRGB\" height=\"1\" width=\"1\" y=\"0\" x=\"0\" inkscape:label=\"Brightness, custom\">\n"
"<feColorMatrix values=\"%s %s %s 0 %s %s %s %s 0 %s %s %s %s 0 %s 0 0 0 1 0 \" />\n"
- "</filter>\n", strength.str().c_str(), vibration.str().c_str(), vibration.str().c_str(),
- lightness.str().c_str(), vibration.str().c_str(), strength.str().c_str(),
- vibration.str().c_str(), lightness.str().c_str(), vibration.str().c_str(),
- vibration.str().c_str(), strength.str().c_str(), lightness.str().c_str());
+ "</filter>\n", brightness.str().c_str(), sat.str().c_str(), sat.str().c_str(),
+ lightness.str().c_str(), sat.str().c_str(), brightness.str().c_str(),
+ sat.str().c_str(), lightness.str().c_str(), sat.str().c_str(),
+ sat.str().c_str(), brightness.str().c_str(), lightness.str().c_str());
return _filter;
}; /* Brightness filter */
@@ -192,11 +202,12 @@ Colorize::get_filter_text (Inkscape::Extension::Extension * ext)
nlight << ext->get_param_float("nlight");
blend1 << ext->get_param_enum("blend1");
blend2 << ext->get_param_enum("blend2");
- if (ext->get_param_bool("duotone"))
+ if (ext->get_param_bool("duotone")) {
duotone << "0";
- else
+ } else {
duotone << "1";
-
+ }
+
_filter = g_strdup_printf(
"<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" color-interpolation-filters=\"sRGB\" height=\"1\" width=\"1\" y=\"0\" x=\"0\" inkscape:label=\"Colorize, custom\">\n"
"<feComposite in2=\"SourceGraphic\" operator=\"arithmetic\" k1=\"%s\" k2=\"%s\" result=\"composite1\" />\n"
@@ -297,17 +308,17 @@ Duochrome::get_filter_text (Inkscape::Extension::Extension * ext)
b2 << ((color2 >> 8) & 0xff);
fluo << fluorescence;
- if((g_ascii_strcasecmp("full", swaptype) == 0)) {
+ if ((g_ascii_strcasecmp("full", swaptype) == 0)) {
swap1 << "in";
swap2 << "out";
a1 << (color1 & 0xff) / 255.0F;
a2 << (color2 & 0xff) / 255.0F;
- } else if((g_ascii_strcasecmp("color", swaptype) == 0)) {
+ } else if ((g_ascii_strcasecmp("color", swaptype) == 0)) {
swap1 << "in";
swap2 << "out";
a1 << (color2 & 0xff) / 255.0F;
a2 << (color1 & 0xff) / 255.0F;
- } else if((g_ascii_strcasecmp("alpha", swaptype) == 0)) {
+ } else if ((g_ascii_strcasecmp("alpha", swaptype) == 0)) {
swap1 << "out";
swap2 << "in";
a1 << (color2 & 0xff) / 255.0F;
@@ -395,8 +406,9 @@ Electrize::get_filter_text (Inkscape::Extension::Extension * ext)
// TransfertComponent table values are calculated based on the effect level and inverted parameters.
int val = 0;
int levels = ext->get_param_int("levels") + 1;
- if (ext->get_param_bool("invert"))
+ if (ext->get_param_bool("invert")) {
val = 1;
+ }
values << val;
for ( int step = 1 ; step <= levels ; step++ ) {
if (val == 1) {
@@ -721,7 +733,7 @@ Solarize::get_filter_text (Inkscape::Extension::Extension * ext)
rotate << ext->get_param_int("rotate");
const gchar *type = ext->get_param_enum("type");
- if((g_ascii_strcasecmp("solarize", type) == 0)) {
+ if ((g_ascii_strcasecmp("solarize", type) == 0)) {
// Solarize
blend1 << "darken";
blend2 << "screen";
@@ -854,21 +866,21 @@ Tritone::get_filter_text (Inkscape::Extension::Extension * ext)
glight << ext->get_param_float("glight");
const gchar *type = ext->get_param_enum("type");
- if((g_ascii_strcasecmp("enhue", type) == 0)) {
+ if ((g_ascii_strcasecmp("enhue", type) == 0)) {
// Enhance hue
c1in << "qminp";
c1in2 << "flood";
c2in << "SourceGraphic";
c2in2 << "blend6";
b6in2 << "qminpc";
- } else if((g_ascii_strcasecmp("rad", type) == 0)) {
+ } else if ((g_ascii_strcasecmp("rad", type) == 0)) {
// Radiation
c1in << "qminp";
c1in2 << "flood";
c2in << "blend6";
c2in2 << "qminpc";
b6in2 << "SourceGraphic";
- } else if((g_ascii_strcasecmp("htb", type) == 0)) {
+ } else if ((g_ascii_strcasecmp("htb", type) == 0)) {
// Hue to background
c1in << "qminp";
c1in2 << "BackgroundImage";
diff --git a/src/extension/internal/filter/experimental.h b/src/extension/internal/filter/experimental.h
index 96485ad97..84b0eea3d 100755
--- a/src/extension/internal/filter/experimental.h
+++ b/src/extension/internal/filter/experimental.h
@@ -580,7 +580,7 @@ NeonDraw::get_filter_text (Inkscape::Extension::Extension * ext)
Normal = feComponentTransfer
Dented = Normal + intermediate values
* Transfer type (enum, default "descrete") -> component (type)
- * Levels (1->15, default 5) -> component (tableValues)
+ * Levels (0->15, default 5) -> component (tableValues)
* Blend mode (enum, default "Lighten") -> blend (mode)
* Primary simplify (0.01->100., default 4.) -> blur1 (stdDeviation)
* Secondary simplify (0.01->100., default 0.5) -> blur2 (stdDeviation)
@@ -609,11 +609,13 @@ public:
"<_item value=\"discrete\">Poster</_item>\n"
"<_item value=\"table\">Painting</_item>\n"
"</param>\n"
- "<param name=\"levels\" gui-text=\"" N_("Levels:") "\" type=\"int\" appearance=\"full\" min=\"1\" max=\"15\">5</param>\n"
+ "<param name=\"levels\" gui-text=\"" N_("Levels:") "\" type=\"int\" appearance=\"full\" min=\"0\" max=\"15\">5</param>\n"
"<param name=\"blend\" gui-text=\"" N_("Blend mode:") "\" type=\"enum\">\n"
"<_item value=\"lighten\">Lighten</_item>\n"
"<_item value=\"normal\">Normal</_item>\n"
"<_item value=\"darken\">Darken</_item>\n"
+ "<_item value=\"multiply\">Multiply</_item>\n"
+ "<_item value=\"screen\">Screen</_item>\n"
"</param>\n"
"<param name=\"blur1\" gui-text=\"" N_("Simplify (primary):") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"100.00\">4.0</param>\n"
"<param name=\"blur2\" gui-text=\"" N_("Simplify (secondary):") "\" type=\"float\" appearance=\"full\" precision=\"2\" min=\"0.01\" max=\"100.00\">0.5</param>\n"
@@ -659,11 +661,19 @@ Posterize::get_filter_text (Inkscape::Extension::Extension * ext)
int levels = ext->get_param_int("levels") + 1;
const gchar *effecttype = ext->get_param_enum("type");
float val = 0.0;
- for ( int step = 1 ; step <= levels ; step++ ) {
- val = (float) step / levels;
- transf << " " << val;
- if((g_ascii_strcasecmp("dented", effecttype) == 0)) {
- transf << " " << (val - ((float) 1 / (3 * levels))) << " " << (val + ((float) 1 / (2 * levels)));
+ if (levels == 1) {
+ if ((g_ascii_strcasecmp("dented", effecttype) == 0)) {
+ transf << " 1 0 1";
+ } else {
+ transf << " 1";
+ }
+ } else {
+ for ( int step = 1 ; step <= levels ; step++ ) {
+ val = (float) step / levels;
+ transf << " " << val;
+ if ((g_ascii_strcasecmp("dented", effecttype) == 0)) {
+ transf << " " << (val - ((float) 1 / (3 * levels))) << " " << (val + ((float) 1 / (2 * levels)));
+ }
}
}
transf << " 1";
diff --git a/src/extension/internal/filter/image.h b/src/extension/internal/filter/image.h
index 926c56a4d..f459466d5 100644
--- a/src/extension/internal/filter/image.h
+++ b/src/extension/internal/filter/image.h
@@ -53,7 +53,7 @@ public:
"<_item value=\"vertical\">" N_("Vertical lines") "</_item>\n"
"<_item value=\"horizontal\">" N_("Horizontal lines") "</_item>\n"
"</param>\n"
- "<param name=\"level\" gui-text=\"" N_("Level:") "\" type=\"float\" appearance=\"full\" min=\"0.01\" max=\"10.0\">1.0</param>\n"
+ "<param name=\"level\" gui-text=\"" N_("Level:") "\" type=\"float\" appearance=\"full\" min=\"0.1\" max=\"100.0\">1.0</param>\n"
"<param name=\"inverted\" gui-text=\"" N_("Invert colors") "\" type=\"boolean\" >false</param>\n"
"<effect>\n"
"<object-type>all</object-type>\n"
@@ -80,14 +80,14 @@ EdgeDetect::get_filter_text (Inkscape::Extension::Extension * ext)
const gchar *type = ext->get_param_enum("type");
- level << ext->get_param_float("level");
+ level << 1 / ext->get_param_float("level");
if ((g_ascii_strcasecmp("vertical", type) == 0)) {
matrix << "0 0 0 1 -2 1 0 0 0";
} else if ((g_ascii_strcasecmp("horizontal", type) == 0)) {
matrix << "0 1 0 0 -2 0 0 1 0";
} else {
- matrix << "1 1 1 1 -8 1 1 1 1";
+ matrix << "0 1 0 1 -4 1 0 1 0";
}
if (ext->get_param_bool("inverted")) {
diff --git a/src/extension/internal/filter/shadows.h b/src/extension/internal/filter/shadows.h
index bfc6cace6..3c964da34 100644
--- a/src/extension/internal/filter/shadows.h
+++ b/src/extension/internal/filter/shadows.h
@@ -37,7 +37,8 @@ namespace Filter {
* Blur type (enum, default outer) ->
outer = composite1 (operator="in"), composite2 (operator="over", in1="SourceGraphic", in2="offset")
inner = composite1 (operator="out"), composite2 (operator="atop", in1="offset", in2="SourceGraphic")
- cutout = composite1 (operator="in"), composite2 (operator="out", in1="offset", in2="SourceGraphic")
+ innercut = composite1 (operator="in"), composite2 (operator="out", in1="offset", in2="SourceGraphic")
+ outercut = composite1 (operator="out"), composite2 (operator="in", in1="SourceGraphic", in2="offset")
* Color (guint, default 0,0,0,127) -> flood (flood-opacity, flood-color)
* Use object's color (boolean, default false) -> composite1 (in1, in2)
*/
@@ -62,7 +63,8 @@ public:
"<param name=\"type\" gui-text=\"" N_("Blur type:") "\" type=\"enum\" >\n"
"<_item value=\"outer\">" N_("Outer") "</_item>\n"
"<_item value=\"inner\">" N_("Inner") "</_item>\n"
- "<_item value=\"cutout\">" N_("Cutout") "</_item>\n"
+ "<_item value=\"innercut\">" N_("Inner cutout") "</_item>\n"
+ "<_item value=\"outercut\">" N_("Outer cutout") "</_item>\n"
"</param>\n"
"</page>\n"
"<page name=\"coltab\" _gui-text=\"" N_("Blur color") "\">\n"
@@ -113,14 +115,26 @@ ColorizableDropShadow::get_filter_text (Inkscape::Extension::Extension * ext)
g << ((color >> 16) & 0xff);
b << ((color >> 8) & 0xff);
- if (ext->get_param_bool("objcolor")) {
- comp1in1 << "SourceGraphic";
- comp1in2 << "flood";
+ // Select object or user-defined color
+ if ((g_ascii_strcasecmp("outercut", type) == 0)) {
+ if (ext->get_param_bool("objcolor")) {
+ comp2in1 << "SourceGraphic";
+ comp2in2 << "offset";
+ } else {
+ comp2in1 << "offset";
+ comp2in2 << "SourceGraphic";
+ }
} else {
- comp1in1 << "flood";
- comp1in2 << "SourceGraphic";
+ if (ext->get_param_bool("objcolor")) {
+ comp1in1 << "SourceGraphic";
+ comp1in2 << "flood";
+ } else {
+ comp1in1 << "flood";
+ comp1in2 << "SourceGraphic";
+ }
}
+ // Shadow mode
if ((g_ascii_strcasecmp("outer", type) == 0)) {
comp1op << "in";
comp2op << "over";
@@ -131,14 +145,18 @@ ColorizableDropShadow::get_filter_text (Inkscape::Extension::Extension * ext)
comp2op << "atop";
comp2in1 << "offset";
comp2in2 << "SourceGraphic";
- } else {
+ } else if ((g_ascii_strcasecmp("innercut", type) == 0)) {
comp1op << "in";
comp2op << "out";
comp2in1 << "offset";
comp2in2 << "SourceGraphic";
+ } else { //outercut
+ comp1op << "out";
+ comp1in1 << "flood";
+ comp1in2 << "SourceGraphic";
+ comp2op << "in";
}
-
-
+
_filter = g_strdup_printf(
"<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" color-interpolation-filters=\"sRGB\" height=\"1.2\" width=\"1.2\" y=\"-0.1\" x=\"-0.1\" inkscape:label=\"Drop shadow, custom\">\n"
"<feFlood flood-opacity=\"%s\" flood-color=\"rgb(%s,%s,%s)\" result=\"flood\" />\n"
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index c3a30a2f0..8b4c8805b 100644
--- a/src/extension/internal/gdkpixbuf-input.cpp
+++ b/src/extension/internal/gdkpixbuf-input.cpp
@@ -150,8 +150,8 @@ GdkpixbufInput::init(void)
"<name>%s</name>\n"
"<id>org.inkscape.input.gdkpixbuf.%s</id>\n"
"<param name='link' type='optiongroup' appearance='full' _gui-text='" N_("Link or embed image:") "' >\n"
- "<_option value='embed'>" N_("embed") "</_option>\n"
- "<_option value='link'>" N_("link") "</_option>\n"
+ "<_option value='embed'>" N_("Embed") "</_option>\n"
+ "<_option value='link'>" N_("Link") "</_option>\n"
"</param>\n"
"<_param name='help' type='description'>" N_("Embed results in stand-alone, larger SVG files. Link references a file outside this SVG document and all files must be moved together.") "</_param>\n"
"<input>\n"
diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp
index 8399d602f..74b6a69ee 100644
--- a/src/extension/internal/javafx-out.cpp
+++ b/src/extension/internal/javafx-out.cpp
@@ -492,8 +492,8 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
}
// convert the path to only lineto's and cubic curveto's:
- Geom::Scale yflip(1.0, -1.0);
- Geom::Affine tf = item->i2d_affine() * yflip;
+ Geom::Scale yflip(1.0, -1.0); /// @fixme hardcoded desktop transform!
+ Geom::Affine tf = item->i2dt_affine() * yflip;
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
//Count the NR_CURVETOs/LINETOs (including closing line segment)
@@ -634,8 +634,8 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
}
// convert the path to only lineto's and cubic curveto's:
- Geom::Scale yflip(1.0, -1.0);
- Geom::Affine tf = item->i2d_affine() * yflip;
+ Geom::Scale yflip(1.0, -1.0); /// @fixme hardcoded desktop transform
+ Geom::Affine tf = item->i2dt_affine() * yflip;
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
//Count the NR_CURVETOs/LINETOs (including closing line segment)
diff --git a/src/extension/internal/latex-pstricks-out.cpp b/src/extension/internal/latex-pstricks-out.cpp
index 1477d5daf..376db7ee3 100644
--- a/src/extension/internal/latex-pstricks-out.cpp
+++ b/src/extension/internal/latex-pstricks-out.cpp
@@ -20,7 +20,7 @@
#include "extension/db.h"
#include "display/nr-arena.h"
#include "display/nr-arena-item.h"
-
+#include "sp-root.h"
@@ -39,36 +39,30 @@ LatexOutput::~LatexOutput (void) //The destructor
return;
}
-bool
-LatexOutput::check (Inkscape::Extension::Extension * module)
+bool LatexOutput::check(Inkscape::Extension::Extension * /*module*/)
{
- if (NULL == Inkscape::Extension::db.get("org.inkscape.print.latex"))
- return FALSE;
- return TRUE;
+ bool result = Inkscape::Extension::db.get("org.inkscape.print.latex") != NULL;
+ return result;
}
-void
-LatexOutput::save(Inkscape::Extension::Output *mod2, SPDocument *doc, gchar const *filename)
+void LatexOutput::save(Inkscape::Extension::Output * /*mod2*/, SPDocument *doc, gchar const *filename)
{
- Inkscape::Extension::Print *mod;
SPPrintContext context;
- const gchar * oldconst;
- gchar * oldoutput;
- unsigned int ret;
+ unsigned int ret = 0;
doc->ensureUpToDate();
- mod = Inkscape::Extension::get_print(SP_MODULE_KEY_PRINT_LATEX);
- oldconst = mod->get_param_string("destination");
- oldoutput = g_strdup(oldconst);
+ Inkscape::Extension::Print *mod = Inkscape::Extension::get_print(SP_MODULE_KEY_PRINT_LATEX);
+ const gchar * oldconst = mod->get_param_string("destination");
+ gchar * oldoutput = g_strdup(oldconst);
mod->set_param_string("destination", filename);
/* Start */
context.module = mod;
/* fixme: This has to go into module constructor somehow */
- /* Create new arena */
- mod->base = SP_ITEM(doc->getRoot());
+ // Create new arena
+ mod->base = doc->getRoot();
mod->arena = NRArena::create();
mod->dkey = SPItem::display_key_new (1);
mod->root = (mod->base)->invoke_show (mod->arena, mod->dkey, SP_ITEM_SHOW_DISPLAY);
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp
index e09e7c024..18950295c 100644
--- a/src/extension/internal/latex-pstricks.cpp
+++ b/src/extension/internal/latex-pstricks.cpp
@@ -141,7 +141,7 @@ PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc)
os << "\\begin{pspicture}(" << doc->getWidth() << "," << doc->getHeight() << ")\n";
}
- m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight()));
+ m_tr_stack.push( Geom::Scale(1, -1) * Geom::Translate(0, doc->getHeight())); /// @fixme hardcoded doc2dt transform
return fprintf(_stream, "%s", os.str().c_str());
}
diff --git a/src/extension/internal/latex-text-renderer.cpp b/src/extension/internal/latex-text-renderer.cpp
index 5d9fec905..02f0823d9 100644
--- a/src/extension/internal/latex-text-renderer.cpp
+++ b/src/extension/internal/latex-text-renderer.cpp
@@ -70,7 +70,7 @@ latex_render_document_text_to_file( SPDocument *doc, gchar const *filename,
}
else {
// we want to export the entire document from root
- base = SP_ITEM(doc->getRoot());
+ base = doc->getRoot();
pageBoundingBox = !exportDrawing;
}
@@ -585,7 +585,7 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *
// The boundingbox calculation here should be exactly the same as the one by CairoRenderer::setupDocument !
if (!base) {
- base = SP_ITEM(doc->getRoot());
+ base = doc->getRoot();
}
Geom::OptRect d;
@@ -593,7 +593,7 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *
d = Geom::Rect( Geom::Point(0,0),
Geom::Point(doc->getWidth(), doc->getHeight()) );
} else {
- base->invoke_bbox( d, base->i2d_affine(), TRUE, SPItem::RENDERING_BBOX);
+ base->invoke_bbox( d, base->i2dt_affine(), TRUE, SPItem::RENDERING_BBOX);
}
if (!d) {
g_message("LaTeXTextRenderer: could not retrieve boundingbox.");
@@ -612,7 +612,7 @@ LaTeXTextRenderer::setupDocument(SPDocument *doc, bool pageBoundingBox, SPItem *
}
// flip y-axis
- push_transform( Geom::Scale(1,-1) * Geom::Translate(0, doc->getHeight()) );
+ push_transform( Geom::Scale(1,-1) * Geom::Translate(0, doc->getHeight()) ); /// @fixme hardcoded desktop transform!
// write the info to LaTeX
Inkscape::SVGOStringStream os;
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 6a350ab48..568c804a0 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -946,10 +946,10 @@ static Glib::ustring formatTransform(Geom::Affine &tf)
static Geom::Affine getODFTransform(const SPItem *item)
{
//### Get SVG-to-ODF transform
- Geom::Affine tf (item->i2d_affine());
+ Geom::Affine tf (item->i2dt_affine());
//Flip Y into document coordinates
double doc_height = SP_ACTIVE_DOCUMENT->getHeight();
- Geom::Affine doc2dt_tf = Geom::Affine(Geom::Scale(1.0, -1.0));
+ Geom::Affine doc2dt_tf = Geom::Affine(Geom::Scale(1.0, -1.0)); /// @fixme hardcoded desktop transform
doc2dt_tf = doc2dt_tf * Geom::Affine(Geom::Translate(0, doc_height));
tf = tf * doc2dt_tf;
tf = tf * Geom::Affine(Geom::Scale(pxToCm));
@@ -986,7 +986,7 @@ static Geom::OptRect getODFBoundingBox(const SPItem *item)
*/
static Geom::Affine getODFItemTransform(const SPItem *item)
{
- Geom::Affine itemTransform (Geom::Scale(1, -1));
+ Geom::Affine itemTransform (Geom::Scale(1, -1)); /// @fixme hardcoded doc2dt transform?
itemTransform = itemTransform * (Geom::Affine)item->transform;
itemTransform = itemTransform * Geom::Scale(1, -1);
return itemTransform;
diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp
index 382f8cbfb..a29aade35 100644
--- a/src/extension/internal/pov-out.cpp
+++ b/src/extension/internal/pov-out.cpp
@@ -301,7 +301,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id)
povShapes.push_back(shapeInfo); //passed all tests. save the info
// convert the path to only lineto's and cubic curveto's:
- Geom::Affine tf = item->i2d_affine();
+ Geom::Affine tf = item->i2dt_affine();
Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers( curve->get_pathvector() * tf );
/*
diff --git a/src/extension/patheffect.cpp b/src/extension/patheffect.cpp
index 6da310d30..e093d20d7 100644
--- a/src/extension/patheffect.cpp
+++ b/src/extension/patheffect.cpp
@@ -65,11 +65,9 @@ PathEffect::processPathEffects (SPDocument * doc, Inkscape::XML::Node * path)
Inkscape::Extension::PathEffect * peffect;
peffect = dynamic_cast<Inkscape::Extension::PathEffect *>(Inkscape::Extension::db.get(ext_id));
if (peffect != NULL) {
-
+ peffect->processPath(doc, path, prefs);
continue;
}
-
- peffect->processPath(doc, path, prefs);
}
g_strfreev(patheffects);