summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2016-12-10 18:29:40 +0000
committerJabiertxof <jtx@jtx>2016-12-10 18:29:40 +0000
commit1904ea574a4078d53bb297d5fbf0ea6bbb824d1b (patch)
treeffd88cee518044c2132c49511fe9616f2e1637a8 /src
parentUpdate to trunk (diff)
parentApply suv patch to handle containers https://bugs.launchpad.net/inkscape/+bug... (diff)
downloadinkscape-1904ea574a4078d53bb297d5fbf0ea6bbb824d1b.tar.gz
inkscape-1904ea574a4078d53bb297d5fbf0ea6bbb824d1b.zip
Update to trunk
(bzr r15295.1.21)
Diffstat (limited to 'src')
-rw-r--r--src/desktop-style.cpp2
-rw-r--r--src/live_effects/lpe-angle_bisector.cpp8
-rw-r--r--src/live_effects/lpe-attach-path.cpp5
-rw-r--r--src/live_effects/lpe-bendpath.cpp3
-rw-r--r--src/live_effects/lpe-bounding-box.cpp6
-rw-r--r--src/live_effects/lpe-bspline.h2
-rw-r--r--src/live_effects/lpe-circle_3pts.cpp2
-rw-r--r--src/live_effects/lpe-circle_with_radius.cpp2
-rw-r--r--src/live_effects/lpe-clone-original.cpp5
-rw-r--r--src/live_effects/lpe-constructgrid.cpp4
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp1
-rw-r--r--src/live_effects/lpe-copy_rotate.h2
-rw-r--r--src/live_effects/lpe-curvestitch.cpp5
-rw-r--r--src/live_effects/lpe-dynastroke.cpp2
-rw-r--r--src/live_effects/lpe-ellipse_5pts.cpp5
-rw-r--r--src/live_effects/lpe-envelope.cpp2
-rw-r--r--src/live_effects/lpe-extrude.cpp4
-rw-r--r--src/live_effects/lpe-fill-between-many.cpp2
-rw-r--r--src/live_effects/lpe-fill-between-strokes.cpp5
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp2
-rw-r--r--src/live_effects/lpe-gears.cpp5
-rw-r--r--src/live_effects/lpe-interpolate.cpp6
-rw-r--r--src/live_effects/lpe-interpolate_points.cpp3
-rw-r--r--src/live_effects/lpe-jointype.cpp2
-rw-r--r--src/live_effects/lpe-knot.cpp3
-rw-r--r--src/live_effects/lpe-lattice.cpp3
-rw-r--r--src/live_effects/lpe-lattice2.cpp3
-rw-r--r--src/live_effects/lpe-lattice2.h2
-rw-r--r--src/live_effects/lpe-line_segment.cpp2
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp3
-rw-r--r--src/live_effects/lpe-mirror_symmetry.h2
-rw-r--r--src/live_effects/lpe-offset.cpp5
-rw-r--r--src/live_effects/lpe-parallel.cpp5
-rw-r--r--src/live_effects/lpe-path_length.cpp4
-rw-r--r--src/live_effects/lpe-patternalongpath.cpp2
-rw-r--r--src/live_effects/lpe-perp_bisector.cpp6
-rw-r--r--src/live_effects/lpe-perspective-envelope.cpp3
-rw-r--r--src/live_effects/lpe-perspective_path.cpp5
-rw-r--r--src/live_effects/lpe-powerstroke.cpp3
-rw-r--r--src/live_effects/lpe-recursiveskeleton.cpp5
-rw-r--r--src/live_effects/lpe-rough-hatches.cpp3
-rw-r--r--src/live_effects/lpe-roughen.cpp3
-rw-r--r--src/live_effects/lpe-roughen.h1
-rw-r--r--src/live_effects/lpe-ruler.cpp3
-rw-r--r--src/live_effects/lpe-show_handles.cpp2
-rw-r--r--src/live_effects/lpe-show_handles.h1
-rw-r--r--src/live_effects/lpe-simplify.cpp2
-rw-r--r--src/live_effects/lpe-simplify.h1
-rw-r--r--src/live_effects/lpe-skeleton.cpp3
-rw-r--r--src/live_effects/lpe-sketch.cpp5
-rw-r--r--src/live_effects/lpe-tangent_to_curve.cpp4
-rw-r--r--src/live_effects/lpe-taperstroke.cpp2
-rw-r--r--src/live_effects/lpe-test-doEffect-stack.cpp5
-rw-r--r--src/live_effects/lpe-text_label.cpp5
-rw-r--r--src/live_effects/lpe-transform_2pts.cpp1
-rw-r--r--src/live_effects/lpe-vonkoch.cpp2
-rw-r--r--src/live_effects/parameter/fontbutton.cpp2
-rw-r--r--src/live_effects/parameter/fontbutton.h1
-rw-r--r--src/preferences-skeleton.h5
-rw-r--r--src/widgets/text-toolbar.cpp122
-rw-r--r--src/widgets/toolbox.cpp10
61 files changed, 227 insertions, 97 deletions
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index 65e511245..dee36d681 100644
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
@@ -209,7 +209,7 @@ sp_desktop_set_style(Inkscape::ObjectSet *set, SPDesktop *desktop, SPCSSAttr *cs
if (!change)
return;
-// 2. Emit signal
+// 2. Emit signal... See desktop->connectStyleSet in text-tool, tweak-tool, and gradient-drag.
bool intercepted = desktop->_set_style_signal.emit(css);
/** \todo
diff --git a/src/live_effects/lpe-angle_bisector.cpp b/src/live_effects/lpe-angle_bisector.cpp
index 9bfbf4ca8..56d33eb4b 100644
--- a/src/live_effects/lpe-angle_bisector.cpp
+++ b/src/live_effects/lpe-angle_bisector.cpp
@@ -8,15 +8,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-angle_bisector.h"
-
-#include <2geom/sbasis-to-bezier.h>
-
+#include "2geom/sbasis-to-bezier.h"
#include "sp-lpe-item.h"
#include "knot-holder-entity.h"
#include "knotholder.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-attach-path.cpp b/src/live_effects/lpe-attach-path.cpp
index d2b44dd4e..302165719 100644
--- a/src/live_effects/lpe-attach-path.cpp
+++ b/src/live_effects/lpe-attach-path.cpp
@@ -4,15 +4,14 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
#include <math.h>
-
#include "live_effects/lpe-attach-path.h"
-
#include "display/curve.h"
#include "sp-shape.h"
#include "sp-text.h"
#include "2geom/path-sink.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-bendpath.cpp b/src/live_effects/lpe-bendpath.cpp
index c24d38d7b..b1e133292 100644
--- a/src/live_effects/lpe-bendpath.cpp
+++ b/src/live_effects/lpe-bendpath.cpp
@@ -7,9 +7,10 @@
#include "live_effects/lpe-bendpath.h"
#include "sp-item-group.h"
-
#include "knot-holder-entity.h"
#include "knotholder.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using std::vector;
diff --git a/src/live_effects/lpe-bounding-box.cpp b/src/live_effects/lpe-bounding-box.cpp
index 2de768c3a..11fb34e04 100644
--- a/src/live_effects/lpe-bounding-box.cpp
+++ b/src/live_effects/lpe-bounding-box.cpp
@@ -3,14 +3,14 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-bounding-box.h"
#include "display/curve.h"
#include "sp-shape.h"
#include "sp-text.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-bspline.h b/src/live_effects/lpe-bspline.h
index 7823f00f0..90cf82c19 100644
--- a/src/live_effects/lpe-bspline.h
+++ b/src/live_effects/lpe-bspline.h
@@ -6,8 +6,8 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include "live_effects/effect.h"
+#include "live_effects/effect.h"
#include <vector>
namespace Inkscape {
diff --git a/src/live_effects/lpe-circle_3pts.cpp b/src/live_effects/lpe-circle_3pts.cpp
index 18252f6a0..3410b13f2 100644
--- a/src/live_effects/lpe-circle_3pts.cpp
+++ b/src/live_effects/lpe-circle_3pts.cpp
@@ -17,6 +17,8 @@
// You might need to include other 2geom files. You can add them here:
#include <2geom/circle.h>
#include <2geom/path-sink.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-circle_with_radius.cpp b/src/live_effects/lpe-circle_with_radius.cpp
index 6e03cb1ce..fcefc4ec6 100644
--- a/src/live_effects/lpe-circle_with_radius.cpp
+++ b/src/live_effects/lpe-circle_with_radius.cpp
@@ -17,6 +17,8 @@
// You might need to include other 2geom files. You can add them here:
#include <2geom/circle.h>
#include <2geom/path-sink.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using namespace Geom;
diff --git a/src/live_effects/lpe-clone-original.cpp b/src/live_effects/lpe-clone-original.cpp
index 7541c0be2..10418a02d 100644
--- a/src/live_effects/lpe-clone-original.cpp
+++ b/src/live_effects/lpe-clone-original.cpp
@@ -4,11 +4,10 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-clone-original.h"
-
#include "display/curve.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-constructgrid.cpp b/src/live_effects/lpe-constructgrid.cpp
index 4af8891e8..8d24f9f47 100644
--- a/src/live_effects/lpe-constructgrid.cpp
+++ b/src/live_effects/lpe-constructgrid.cpp
@@ -10,9 +10,9 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-constructgrid.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index a21d67078..5b94e9083 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -11,6 +11,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <gtkmm.h>
#include <gdk/gdk.h>
#include <2geom/path-intersection.h>
#include <2geom/sbasis-to-bezier.h>
diff --git a/src/live_effects/lpe-copy_rotate.h b/src/live_effects/lpe-copy_rotate.h
index f189ffa04..8f9fc12ac 100644
--- a/src/live_effects/lpe-copy_rotate.h
+++ b/src/live_effects/lpe-copy_rotate.h
@@ -13,7 +13,7 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
+
#include "live_effects/effect.h"
#include "live_effects/parameter/point.h"
#include "live_effects/lpegroupbbox.h"
diff --git a/src/live_effects/lpe-curvestitch.cpp b/src/live_effects/lpe-curvestitch.cpp
index 3beedaf57..38cbeaac0 100644
--- a/src/live_effects/lpe-curvestitch.cpp
+++ b/src/live_effects/lpe-curvestitch.cpp
@@ -13,8 +13,6 @@
*/
#include "ui/widget/scalar.h"
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-curvestitch.h"
#include "sp-path.h"
@@ -22,6 +20,9 @@
#include "xml/repr.h"
#include <2geom/bezier-to-sbasis.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-dynastroke.cpp b/src/live_effects/lpe-dynastroke.cpp
index 7e22f6e51..50bbe6451 100644
--- a/src/live_effects/lpe-dynastroke.cpp
+++ b/src/live_effects/lpe-dynastroke.cpp
@@ -16,6 +16,8 @@
#include <2geom/bezier-to-sbasis.h>
#include <2geom/sbasis-math.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-ellipse_5pts.cpp b/src/live_effects/lpe-ellipse_5pts.cpp
index 0371fc313..28e7058d7 100644
--- a/src/live_effects/lpe-ellipse_5pts.cpp
+++ b/src/live_effects/lpe-ellipse_5pts.cpp
@@ -12,15 +12,14 @@
*/
#include "live_effects/lpe-ellipse_5pts.h"
-
-// You might need to include other 2geom files. You can add them here:
-#include <glibmm/i18n.h>
#include <2geom/circle.h>
#include <2geom/ellipse.h>
#include <2geom/path-sink.h>
#include "inkscape.h"
#include "desktop.h"
#include "message-stack.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-envelope.cpp b/src/live_effects/lpe-envelope.cpp
index c3b0a7c10..61a696435 100644
--- a/src/live_effects/lpe-envelope.cpp
+++ b/src/live_effects/lpe-envelope.cpp
@@ -6,6 +6,8 @@
#include "live_effects/lpe-envelope.h"
#include "display/curve.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using std::vector;
diff --git a/src/live_effects/lpe-extrude.cpp b/src/live_effects/lpe-extrude.cpp
index d22007f76..daa30d45a 100644
--- a/src/live_effects/lpe-extrude.cpp
+++ b/src/live_effects/lpe-extrude.cpp
@@ -12,10 +12,10 @@
*/
#include "live_effects/lpe-extrude.h"
-
+#include "sp-item.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
-#include "sp-item.h"
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-fill-between-many.cpp b/src/live_effects/lpe-fill-between-many.cpp
index 2087925fa..1e2eadfdb 100644
--- a/src/live_effects/lpe-fill-between-many.cpp
+++ b/src/live_effects/lpe-fill-between-many.cpp
@@ -11,7 +11,7 @@
#include "display/curve.h"
#include "sp-shape.h"
#include "sp-text.h"
-
+// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
namespace Inkscape {
diff --git a/src/live_effects/lpe-fill-between-strokes.cpp b/src/live_effects/lpe-fill-between-strokes.cpp
index b1e328d18..0dbebdf26 100644
--- a/src/live_effects/lpe-fill-between-strokes.cpp
+++ b/src/live_effects/lpe-fill-between-strokes.cpp
@@ -3,14 +3,13 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-fill-between-strokes.h"
#include "display/curve.h"
#include "sp-shape.h"
#include "sp-text.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index 24ee2ccc3..1e2df7dc8 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -25,8 +25,8 @@
// for programmatically updating knots
#include "ui/tools-switch.h"
-
// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using namespace Geom;
namespace Inkscape {
diff --git a/src/live_effects/lpe-gears.cpp b/src/live_effects/lpe-gears.cpp
index 1d5398aa5..17579c64e 100644
--- a/src/live_effects/lpe-gears.cpp
+++ b/src/live_effects/lpe-gears.cpp
@@ -7,10 +7,9 @@
*/
#include "live_effects/lpe-gears.h"
-
-#include <glibmm/i18n.h>
-
#include <2geom/bezier-to-sbasis.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using std::vector;
using namespace Geom;
diff --git a/src/live_effects/lpe-interpolate.cpp b/src/live_effects/lpe-interpolate.cpp
index 43da4d105..e95dc5f38 100644
--- a/src/live_effects/lpe-interpolate.cpp
+++ b/src/live_effects/lpe-interpolate.cpp
@@ -9,15 +9,15 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-interpolate.h"
#include <2geom/sbasis-to-bezier.h>
#include "sp-path.h"
#include "display/curve.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-interpolate_points.cpp b/src/live_effects/lpe-interpolate_points.cpp
index ab0576174..0a0bcea14 100644
--- a/src/live_effects/lpe-interpolate_points.cpp
+++ b/src/live_effects/lpe-interpolate_points.cpp
@@ -12,8 +12,9 @@
*/
#include "live_effects/lpe-interpolate_points.h"
-
#include "live_effects/lpe-powerstroke-interpolators.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-jointype.cpp b/src/live_effects/lpe-jointype.cpp
index 3bfbd6288..dacb87dd9 100644
--- a/src/live_effects/lpe-jointype.cpp
+++ b/src/live_effects/lpe-jointype.cpp
@@ -19,6 +19,8 @@
#include <2geom/elliptical-arc.h>
#include "lpe-jointype.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index 474523aa3..c35da0601 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -33,6 +33,9 @@
#include "document.h"
#include "document-undo.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-lattice.cpp b/src/live_effects/lpe-lattice.cpp
index 091b6ddca..acffed000 100644
--- a/src/live_effects/lpe-lattice.cpp
+++ b/src/live_effects/lpe-lattice.cpp
@@ -20,7 +20,8 @@
#include <2geom/sbasis-2d.h>
#include <2geom/bezier-to-sbasis.h>
-
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using namespace Geom;
namespace Inkscape {
diff --git a/src/live_effects/lpe-lattice2.cpp b/src/live_effects/lpe-lattice2.cpp
index 9e9fc153a..e827491c0 100644
--- a/src/live_effects/lpe-lattice2.cpp
+++ b/src/live_effects/lpe-lattice2.cpp
@@ -16,12 +16,15 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <gtkmm.h>
#include "live_effects/lpe-lattice2.h"
#include "display/curve.h"
#include "helper/geom.h"
#include <2geom/sbasis-2d.h>
#include <2geom/bezier-to-sbasis.h>
+
// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using namespace Geom;
diff --git a/src/live_effects/lpe-lattice2.h b/src/live_effects/lpe-lattice2.h
index 4a025d182..59a0350d3 100644
--- a/src/live_effects/lpe-lattice2.h
+++ b/src/live_effects/lpe-lattice2.h
@@ -18,7 +18,7 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
+
#include "live_effects/effect.h"
#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/point.h"
diff --git a/src/live_effects/lpe-line_segment.cpp b/src/live_effects/lpe-line_segment.cpp
index 4c9edabd4..cc024fb92 100644
--- a/src/live_effects/lpe-line_segment.cpp
+++ b/src/live_effects/lpe-line_segment.cpp
@@ -13,6 +13,8 @@
#include "live_effects/lpe-line_segment.h"
#include "ui/tools/lpe-tool.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index 8225c152f..fa054a283 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -13,6 +13,8 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+
+#include <gtkmm.h>
#include "live_effects/lpe-mirror_symmetry.h"
#include "display/curve.h"
#include "svg/path-string.h"
@@ -27,6 +29,7 @@
#include "knotholder.h"
#include "style.h"
#include "xml/sp-css-attr.h"
+
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h
index fba16c750..03396fdf3 100644
--- a/src/live_effects/lpe-mirror_symmetry.h
+++ b/src/live_effects/lpe-mirror_symmetry.h
@@ -15,7 +15,7 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
+
#include "live_effects/effect.h"
#include "live_effects/parameter/text.h"
#include "live_effects/parameter/parameter.h"
diff --git a/src/live_effects/lpe-offset.cpp b/src/live_effects/lpe-offset.cpp
index a0fa46c3f..057f404e0 100644
--- a/src/live_effects/lpe-offset.cpp
+++ b/src/live_effects/lpe-offset.cpp
@@ -11,13 +11,12 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-offset.h"
#include "sp-shape.h"
#include "display/curve.h"
-
#include <2geom/elliptical-arc.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-parallel.cpp b/src/live_effects/lpe-parallel.cpp
index 9cd8ecf46..276749c43 100644
--- a/src/live_effects/lpe-parallel.cpp
+++ b/src/live_effects/lpe-parallel.cpp
@@ -11,14 +11,15 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-parallel.h"
#include "sp-shape.h"
#include "display/curve.h"
#include "knotholder.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-path_length.cpp b/src/live_effects/lpe-path_length.cpp
index 6ec1e0ede..a06dbde98 100644
--- a/src/live_effects/lpe-path_length.cpp
+++ b/src/live_effects/lpe-path_length.cpp
@@ -11,10 +11,10 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-path_length.h"
#include "util/units.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp
index 15c2817c4..9cfeffee7 100644
--- a/src/live_effects/lpe-patternalongpath.cpp
+++ b/src/live_effects/lpe-patternalongpath.cpp
@@ -12,6 +12,8 @@
#include "knotholder.h"
#include <algorithm>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using std::vector;
diff --git a/src/live_effects/lpe-perp_bisector.cpp b/src/live_effects/lpe-perp_bisector.cpp
index f69dae6a1..bce22250a 100644
--- a/src/live_effects/lpe-perp_bisector.cpp
+++ b/src/live_effects/lpe-perp_bisector.cpp
@@ -11,9 +11,6 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-perp_bisector.h"
#include "display/curve.h"
#include "sp-path.h"
@@ -21,6 +18,9 @@
#include "knotholder.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
namespace PB {
diff --git a/src/live_effects/lpe-perspective-envelope.cpp b/src/live_effects/lpe-perspective-envelope.cpp
index 6a6b59519..e834c0e86 100644
--- a/src/live_effects/lpe-perspective-envelope.cpp
+++ b/src/live_effects/lpe-perspective-envelope.cpp
@@ -20,6 +20,9 @@
#include "display/curve.h"
#include <gsl/gsl_linalg.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
using namespace Geom;
namespace Inkscape {
diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp
index cb4e43d87..2c6d66cee 100644
--- a/src/live_effects/lpe-perspective_path.cpp
+++ b/src/live_effects/lpe-perspective_path.cpp
@@ -11,8 +11,6 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gtkmm.h>
-#include <glibmm/i18n.h>
-
#include "persp3d.h"
//#include "transf_mat_3x4.h"
#include "document-private.h"
@@ -23,6 +21,9 @@
#include "desktop.h"
#include <util/units.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp
index 329a00756..e9f3975c7 100644
--- a/src/live_effects/lpe-powerstroke.cpp
+++ b/src/live_effects/lpe-powerstroke.cpp
@@ -25,6 +25,9 @@
#include <2geom/circle.h>
#include "helper/geom.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Geom {
// should all be moved to 2geom at some point
diff --git a/src/live_effects/lpe-recursiveskeleton.cpp b/src/live_effects/lpe-recursiveskeleton.cpp
index ed0c915ce..aa0db920b 100644
--- a/src/live_effects/lpe-recursiveskeleton.cpp
+++ b/src/live_effects/lpe-recursiveskeleton.cpp
@@ -10,12 +10,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-recursiveskeleton.h"
#include <2geom/bezier-to-sbasis.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-rough-hatches.cpp b/src/live_effects/lpe-rough-hatches.cpp
index 2fb65b349..3cc8658ea 100644
--- a/src/live_effects/lpe-rough-hatches.cpp
+++ b/src/live_effects/lpe-rough-hatches.cpp
@@ -13,7 +13,6 @@
*/
#include "ui/widget/scalar.h"
-#include <glibmm/i18n.h>
#include "live_effects/lpe-rough-hatches.h"
#include "sp-item.h"
@@ -23,6 +22,8 @@
#include <2geom/sbasis-math.h>
#include <2geom/bezier-to-sbasis.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-roughen.cpp b/src/live_effects/lpe-roughen.cpp
index 3a486ff10..c6edffd9b 100644
--- a/src/live_effects/lpe-roughen.cpp
+++ b/src/live_effects/lpe-roughen.cpp
@@ -13,11 +13,14 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <gtkmm.h>
#include "live_effects/lpe-roughen.h"
#include "display/curve.h"
#include <boost/functional/hash.hpp>
#include "helper/geom.h"
+
// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-roughen.h b/src/live_effects/lpe-roughen.h
index dbdb91e62..bab06022f 100644
--- a/src/live_effects/lpe-roughen.h
+++ b/src/live_effects/lpe-roughen.h
@@ -12,7 +12,6 @@
#ifndef INKSCAPE_LPE_ROUGHEN_H
#define INKSCAPE_LPE_ROUGHEN_H
-#include <gtkmm.h>
#include "live_effects/effect.h"
#include "live_effects/parameter/enum.h"
#include "live_effects/parameter/parameter.h"
diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp
index 3a2d78b2c..60c2a3e1c 100644
--- a/src/live_effects/lpe-ruler.cpp
+++ b/src/live_effects/lpe-ruler.cpp
@@ -12,7 +12,8 @@
*/
#include "live_effects/lpe-ruler.h"
-
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-show_handles.cpp b/src/live_effects/lpe-show_handles.cpp
index 170b6dccb..7c298d0e7 100644
--- a/src/live_effects/lpe-show_handles.cpp
+++ b/src/live_effects/lpe-show_handles.cpp
@@ -6,6 +6,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <gtkmm.h>
#include "live_effects/lpe-show_handles.h"
#include <2geom/sbasis-to-bezier.h>
#include <2geom/svg-path-parser.h>
@@ -13,6 +14,7 @@
#include "desktop-style.h"
#include "style.h"
#include "svg/svg.h"
+
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
diff --git a/src/live_effects/lpe-show_handles.h b/src/live_effects/lpe-show_handles.h
index 3eda04649..c46abd2c2 100644
--- a/src/live_effects/lpe-show_handles.h
+++ b/src/live_effects/lpe-show_handles.h
@@ -8,7 +8,6 @@
* Copyright (C) Jabier Arraiza Cenoz 2014 <jabier.arraiza@marker.es>
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
#include "helper/geom-nodetype.h"
#include "live_effects/effect.h"
#include "live_effects/lpegroupbbox.h"
diff --git a/src/live_effects/lpe-simplify.cpp b/src/live_effects/lpe-simplify.cpp
index ec21e10d2..8bdb19b4f 100644
--- a/src/live_effects/lpe-simplify.cpp
+++ b/src/live_effects/lpe-simplify.cpp
@@ -2,6 +2,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <gtkmm.h>
#include "live_effects/lpe-simplify.h"
#include "display/curve.h"
#include "helper/geom.h"
@@ -9,6 +10,7 @@
#include "svg/svg.h"
#include "ui/tools/node-tool.h"
#include "ui/icon-names.h"
+
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
diff --git a/src/live_effects/lpe-simplify.h b/src/live_effects/lpe-simplify.h
index 8135561af..6c407f572 100644
--- a/src/live_effects/lpe-simplify.h
+++ b/src/live_effects/lpe-simplify.h
@@ -6,7 +6,6 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
#include "live_effects/effect.h"
#include "live_effects/parameter/togglebutton.h"
#include "live_effects/lpegroupbbox.h"
diff --git a/src/live_effects/lpe-skeleton.cpp b/src/live_effects/lpe-skeleton.cpp
index 7d34db699..adc4a3493 100644
--- a/src/live_effects/lpe-skeleton.cpp
+++ b/src/live_effects/lpe-skeleton.cpp
@@ -20,8 +20,7 @@
#include "live_effects/lpe-skeleton.h"
-// You might need to include other 2geom files. You can add them here:
-
+// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
namespace Inkscape {
diff --git a/src/live_effects/lpe-sketch.cpp b/src/live_effects/lpe-sketch.cpp
index 95e2f6f0d..e01516f2e 100644
--- a/src/live_effects/lpe-sketch.cpp
+++ b/src/live_effects/lpe-sketch.cpp
@@ -13,13 +13,14 @@
#include "live_effects/lpe-sketch.h"
-#include <glibmm/i18n.h>
-
// You might need to include other 2geom files. You can add them here:
#include <2geom/sbasis-math.h>
#include <2geom/bezier-to-sbasis.h>
#include <2geom/path-intersection.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-tangent_to_curve.cpp b/src/live_effects/lpe-tangent_to_curve.cpp
index b308ef8d7..76d4ea71b 100644
--- a/src/live_effects/lpe-tangent_to_curve.cpp
+++ b/src/live_effects/lpe-tangent_to_curve.cpp
@@ -13,13 +13,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-tangent_to_curve.h"
#include "sp-path.h"
#include "display/curve.h"
#include "knotholder.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp
index f6f6b33dc..4ffc41691 100644
--- a/src/live_effects/lpe-taperstroke.cpp
+++ b/src/live_effects/lpe-taperstroke.cpp
@@ -26,6 +26,8 @@
#include "svg/svg.h"
#include "knotholder.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
template<typename T>
inline bool withinRange(T value, T low, T high) {
diff --git a/src/live_effects/lpe-test-doEffect-stack.cpp b/src/live_effects/lpe-test-doEffect-stack.cpp
index c7ecf6481..324893706 100644
--- a/src/live_effects/lpe-test-doEffect-stack.cpp
+++ b/src/live_effects/lpe-test-doEffect-stack.cpp
@@ -4,10 +4,11 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-test-doEffect-stack.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
using std::memcpy;
namespace Inkscape {
diff --git a/src/live_effects/lpe-text_label.cpp b/src/live_effects/lpe-text_label.cpp
index 602a6897c..709d05e18 100644
--- a/src/live_effects/lpe-text_label.cpp
+++ b/src/live_effects/lpe-text_label.cpp
@@ -11,10 +11,11 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-text_label.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-transform_2pts.cpp b/src/live_effects/lpe-transform_2pts.cpp
index 78db622f2..e1f36eee7 100644
--- a/src/live_effects/lpe-transform_2pts.cpp
+++ b/src/live_effects/lpe-transform_2pts.cpp
@@ -20,6 +20,7 @@
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
+
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp
index 2486f3366..47e2a1cec 100644
--- a/src/live_effects/lpe-vonkoch.cpp
+++ b/src/live_effects/lpe-vonkoch.cpp
@@ -5,7 +5,7 @@
*/
#include "live_effects/lpe-vonkoch.h"
-
+// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
//using std::vector;
diff --git a/src/live_effects/parameter/fontbutton.cpp b/src/live_effects/parameter/fontbutton.cpp
index ff8ab76a0..64c203093 100644
--- a/src/live_effects/parameter/fontbutton.cpp
+++ b/src/live_effects/parameter/fontbutton.cpp
@@ -4,7 +4,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
+#include <gtkmm.h>
#include "ui/widget/registered-widget.h"
#include "live_effects/parameter/fontbutton.h"
#include "live_effects/effect.h"
diff --git a/src/live_effects/parameter/fontbutton.h b/src/live_effects/parameter/fontbutton.h
index 387ad130b..df47251a2 100644
--- a/src/live_effects/parameter/fontbutton.h
+++ b/src/live_effects/parameter/fontbutton.h
@@ -8,7 +8,6 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <glib.h>
-#include <gtkmm.h>
#include "live_effects/parameter/parameter.h"
namespace Inkscape {
diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h
index ff43c2ca3..ed00092b2 100644
--- a/src/preferences-skeleton.h
+++ b/src/preferences-skeleton.h
@@ -74,8 +74,7 @@ static char const preferences_skeleton[] =
" </group>\n"
"\n"
" <group id=\"tools\"\n"
-" bounding_box=\"0\"\n"
-" style=\"fill:none;stroke:black;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;\">\n"
+" bounding_box=\"0\">\n"
" <group id=\"shapes\" style=\"fill-rule:evenodd;\" selcue=\"1\" gradientdrag=\"1\">\n"
" <eventcontext id=\"rect\" style=\"fill:blue;\" usecurrent=\"1\"/>\n"
" <eventcontext id=\"3dbox\" style=\"stroke:none;stroke-linejoin:round;\" usecurrent=\"1\">\n"
@@ -88,7 +87,7 @@ static char const preferences_skeleton[] =
" </eventcontext>\n"
" <eventcontext id=\"arc\" style=\"fill:red;\" end=\"0\" start=\"0\" usecurrent=\"1\"/>\n"
" <eventcontext id=\"star\" magnitude=\"5\" style=\"fill:yellow;\" usecurrent=\"1\"/>\n"
-" <eventcontext id=\"spiral\" style=\"fill:none;\" usecurrent=\"0\"/>\n"
+" <eventcontext id=\"spiral\" style=\"fill:none;stroke:black\" expansion=\"1\" usecurrent=\"0\"/>\n"
" </group>\n"
" <group id=\"freehand\"\n"
" style=\"fill:none;stroke:black;stroke-opacity:1;stroke-linejoin:miter;stroke-linecap:butt;\">\n"
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index 114d946bb..847ebd8c1 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -117,6 +117,8 @@ static void sp_print_fontstyle( SPStyle *query ) {
}
#endif
+static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/, GObject *tbl, bool subselection = false);
+
// Font family
static void sp_text_fontfamily_value_changed( Ink_ComboBoxEntry_Action *act, GObject *tbl )
{
@@ -225,8 +227,35 @@ static void sp_text_fontsize_value_changed( Ink_ComboBoxEntry_Action *act, GObje
sp_repr_css_set_property (css, "font-size", osfs.str().c_str());
// Apply font size to selected objects.
+ // Calling sp_desktop_set_style will result in a call to TextTool::_styleSet() which
+ // will set the style on selected text inside the <text> element. If we want to set
+ // the style on the outer <text> objects we need to bypass this call.
+ bool outer = prefs->getInt("/tools/text/outer_style", false);
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- sp_desktop_set_style (desktop, css, true, true);
+ if (outer) {
+ Inkscape::Selection *selection = desktop->getSelection();
+ auto itemlist= selection->items();
+ for(auto i=itemlist.begin();i!=itemlist.end(); ++i){
+ if (dynamic_cast<SPText *>(*i) || dynamic_cast<SPFlowtext *>(*i)) {
+ SPItem *item = *i;
+
+ // Scale by inverse of accumulated paraent transform
+ SPCSSAttr *css_set = sp_repr_css_attr_new();
+ sp_repr_css_merge(css_set, css);
+ Geom::Affine const local(item->i2doc_affine());
+ double const ex(local.descrim());
+ if ( (ex != 0.0) && (ex != 1.0) ) {
+ sp_css_attr_scale(css_set, 1/ex);
+ }
+
+ item->changeCSS(css_set,"style");
+
+ sp_repr_css_attr_unref(css_set);
+ }
+ }
+ } else {
+ sp_desktop_set_style (desktop, css, true, true);
+ }
// If no selected objects, set default.
SPStyle query(SP_ACTIVE_DOCUMENT);
@@ -281,6 +310,17 @@ static void sp_text_fontstyle_value_changed( Ink_ComboBoxEntry_Action *act, GObj
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
}
+// Changes selection to only text outer elements.
+static void sp_text_outer_style_changed( InkToggleAction*act, GObject *tbl )
+{
+ bool outer = gtk_toggle_action_get_active( GTK_TOGGLE_ACTION(act) );
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ prefs->setInt("/tools/text/outer_style", outer);
+
+ // Update widgets to reflect new state of Text Outer Style button.
+ sp_text_toolbox_selection_changed( NULL, tbl );
+}
+
// Handles both Superscripts and Subscripts
static void sp_text_script_changed( InkToggleAction* act, GObject *tbl )
{
@@ -549,9 +589,34 @@ static void sp_text_lineheight_value_changed( GtkAdjustment *adj, GObject *tbl )
sp_repr_css_set_property (css, "line-height", osfs.str().c_str());
- // Apply line-height to selected objects.
+ // Apply line-height to selected objects. See comment in font size function.
+ bool outer = prefs->getInt("/tools/text/outer_style", false);
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- sp_desktop_set_style (desktop, css, true, false);
+ if (outer) {
+ Inkscape::Selection *selection = desktop->getSelection();
+ auto itemlist= selection->items();
+ for(auto i=itemlist.begin();i!=itemlist.end(); ++i){
+ if (dynamic_cast<SPText *>(*i) || dynamic_cast<SPFlowtext *>(*i)) {
+ SPItem *item = *i;
+
+ // Scale by inverse of accumulated paraent transform
+ SPCSSAttr *css_set = sp_repr_css_attr_new();
+ sp_repr_css_merge(css_set, css);
+ Geom::Affine const local(item->i2doc_affine());
+ double const ex(local.descrim());
+ if ( (ex != 0.0) && (ex != 1.0) ) {
+ sp_css_attr_scale(css_set, 1/ex);
+ }
+
+ item->changeCSS(css_set,"style");
+
+ sp_repr_css_attr_unref(css_set);
+ }
+ }
+ } else {
+ sp_desktop_set_style (desktop, css, true, true);
+ }
+
// Only need to save for undo if a text item has been changed.
@@ -652,7 +717,7 @@ static void sp_text_lineheight_unit_changed( gpointer /* */, GObject *tbl )
double font_size = 0;
int count = 0;
for(auto i=itemlist.begin();i!=itemlist.end(); ++i){
- if (SP_IS_TEXT (*i)) {
+ if (SP_IS_TEXT (*i) || SP_IS_FLOWTEXT(*i)) {
double doc_scale = Geom::Affine((*i)->i2dt_affine()).descrim();
font_size += (*i)->style->font_size.computed * doc_scale;
++count;
@@ -681,7 +746,7 @@ static void sp_text_lineheight_unit_changed( gpointer /* */, GObject *tbl )
double font_size = 0;
int count = 0;
for(auto i=itemlist.begin();i!=itemlist.end(); ++i){
- if (SP_IS_TEXT (*i)) {
+ if (SP_IS_TEXT (*i) || SP_IS_FLOWTEXT (*i)) {
double doc_scale = Geom::Affine((*i)->i2dt_affine()).descrim();
font_size += (*i)->style->font_size.computed * doc_scale;
++count;
@@ -1073,7 +1138,7 @@ static void sp_text_set_sizes(GtkListStore* model_size, int unit)
* It is called whenever a text selection is changed, including stepping cursor
* through text, or setting focus to text.
*/
-static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/, GObject *tbl, bool subselection = false) // don't bother to update font list if subsel changed
+static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/, GObject *tbl, bool subselection) // don't bother to update font list if subsel changed
{
#ifdef DEBUG_TEXT
static int count = 0;
@@ -1082,12 +1147,11 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
std::cout << "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" << std::endl;
std::cout << "sp_text_toolbox_selection_changed: start " << count << std::endl;
- std::cout << " Selected items:" << std::endl;
- for (GSList const *items = SP_ACTIVE_DESKTOP->getSelection()->itemList();
- items != NULL;
- items = items->next)
- {
- const gchar* id = reinterpret_cast<SPItem *>(items->data)->getId();
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ Inkscape::Selection *selection = desktop->getSelection();
+ auto itemlist0= selection->items();
+ for(auto i=itemlist0.begin();i!=itemlist0.end(); ++i) {
+ const gchar* id = (*i)->getId();
std::cout << " " << id << std::endl;
}
Glib::ustring selected_text = sp_text_get_selected_text((SP_ACTIVE_DESKTOP)->event_context);
@@ -1129,8 +1193,7 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
gboolean isFlow = false;
auto itemlist= SP_ACTIVE_DESKTOP->getSelection()->items();
for(auto i=itemlist.begin();i!=itemlist.end(); ++i){
- // const gchar* id = reinterpret_cast<SPItem *>(items->data)->getId();
- // std::cout << " " << id << std::endl;
+ // std::cout << " " << ((*i)->getId()?(*i)->getId():"null") << std::endl;
if( SP_IS_FLOWTEXT(*i)) {
isFlow = true;
// std::cout << " Found flowed text" << std::endl;
@@ -1148,10 +1211,26 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
SPStyle query(SP_ACTIVE_DOCUMENT);
int result_family = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_FONTFAMILY);
int result_style = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_FONTSTYLE);
- int result_numbers = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_FONTNUMBERS);
int result_baseline = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_BASELINES);
int result_wmode = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_WRITINGMODES);
+ // Calling sp_desktop_query_style will result in a call to TextTool::_styleQueried().
+ // This returns the style of the selected text inside the <text> element... which
+ // is often the style of one or more <tspan>s. If we want the style of the outer
+ // <text> objects then we need to bypass the call to TextTool::_styleQueried().
+ // The desktop selection never includes the elements inside the <text> element.
+ int result_numbers = 0;
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ bool outer = prefs->getInt("/tools/text/outer_style", false);
+ if (outer) {
+ Inkscape::Selection *selection = desktop->getSelection();
+ std::vector<SPItem *> vec(selection->items().begin(), selection->items().end());
+ result_numbers = sp_desktop_query_style_from_list (vec, &query, QUERY_STYLE_PROPERTY_FONTNUMBERS);
+ } else {
+ result_numbers = sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_FONTNUMBERS);
+ }
+
/*
* If no text in selection (querying returned nothing), read the style from
* the /tools/text preferencess (default style for new texts). Return if
@@ -2021,6 +2100,19 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
g_object_set( G_OBJECT(eact), "iconId", "text_rotation", NULL );
}
+ /* Text outer style */
+ {
+ InkToggleAction* act = ink_toggle_action_new( "TextOuterStyleAction", // Name
+ _("Show outer style"), // Label
+ _("Show style of outermost text element. The 'font-size' and 'line-height' values of the outermost text element determine the minimum line spacing in the block."),
+ INKSCAPE_ICON("text_outer_style"),
+ secondarySize ); // Icon size
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act ) );
+ g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_text_outer_style_changed), holder );
+ gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/text/outer_style", false) );
+ g_object_set_data( holder, "TextOuterStyleAction", act );
+ }
+
// Is this necessary to call? Shouldn't hurt.
sp_text_toolbox_selection_changed(desktop->getSelection(), holder);
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 53de2d342..1f6cb136c 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -508,18 +508,18 @@ static gchar const * ui_descr =
" <toolbar name='TextToolbar'>"
" <toolitem action='TextFontFamilyAction' />"
- " <toolitem action='TextFontSizeAction' />"
" <toolitem action='TextFontStyleAction' />"
-// " <toolitem action='TextBoldAction' />"
-// " <toolitem action='TextItalicAction' />"
+ " <separator />"
+ " <toolitem action='TextOuterStyleAction' />"
+ " <toolitem action='TextFontSizeAction' />"
+ " <toolitem action='TextLineHeightAction' />"
+ " <toolitem action='TextLineHeightUnitsAction' />"
" <separator />"
" <toolitem action='TextAlignAction' />"
" <separator />"
" <toolitem action='TextSuperscriptAction' />"
" <toolitem action='TextSubscriptAction' />"
" <separator />"
- " <toolitem action='TextLineHeightAction' />"
- " <toolitem action='TextLineHeightUnitsAction' />"
" <toolitem action='TextLetterSpacingAction' />"
" <toolitem action='TextWordSpacingAction' />"
" <toolitem action='TextDxAction' />"