summaryrefslogtreecommitdiffstats
path: root/src/libnr
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-05-09 17:06:59 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-05-09 17:06:59 +0000
commitb5fbebdee9ad52de4b9b373998d91581b9fd9004 (patch)
tree31f6f2cdab11f3276ef6abad0775e8b6888e1d33 /src/libnr
parentApply Sas' patch to improve import of SVG as in LP#227472 and the bugs mentio... (diff)
downloadinkscape-b5fbebdee9ad52de4b9b373998d91581b9fd9004.tar.gz
inkscape-b5fbebdee9ad52de4b9b373998d91581b9fd9004.zip
complete adding const to have only NArtBpath const * get_bpath() const; for accessing the protected member of SPCurve. Nowhere in Inkscape source is the path data changed of SPCurve, except within SPCurve's own methods ! So removed the non-const NArtBpath* get_bpath.
(bzr r5642)
Diffstat (limited to 'src/libnr')
-rw-r--r--src/libnr/nr-forward.h1
-rw-r--r--src/libnr/nr-path.cpp19
-rw-r--r--src/libnr/nr-path.h17
3 files changed, 22 insertions, 15 deletions
diff --git a/src/libnr/nr-forward.h b/src/libnr/nr-forward.h
index b12d141df..112313b24 100644
--- a/src/libnr/nr-forward.h
+++ b/src/libnr/nr-forward.h
@@ -21,6 +21,7 @@ class translate;
class NArtBpath;
struct NRBPath;
+struct const_NRBPath;
struct NRPixBlock;
struct NRRect;
struct NRRectL;
diff --git a/src/libnr/nr-path.cpp b/src/libnr/nr-path.cpp
index 713cfe43d..734f3426d 100644
--- a/src/libnr/nr-path.cpp
+++ b/src/libnr/nr-path.cpp
@@ -20,7 +20,7 @@ static void nr_curve_bbox(NR::Point const p000, NR::Point const p001,
NR::Point const p011, NR::Point const p111,
NRRect *bbox);
-NRBPath *nr_path_duplicate_transform(NRBPath *d, NRBPath *s, NR::Matrix const *transform)
+NRBPath *nr_path_duplicate_transform(NRBPath *d, const_NRBPath *s, NR::Matrix const *transform)
{
int i;
@@ -49,16 +49,17 @@ NRBPath *nr_path_duplicate_transform(NRBPath *d, NRBPath *s, NR::Matrix const *t
return d;
}
-NRBPath *nr_path_duplicate_transform(NRBPath *d, NRBPath *s, NR::Matrix const transform) {
+NRBPath *nr_path_duplicate_transform(NRBPath *d, const_NRBPath *s, NR::Matrix const transform) {
NR::Matrix tr = transform;
return nr_path_duplicate_transform(d, s, &tr);
}
-NArtBpath* nr_artpath_affine(NArtBpath *s, NR::Matrix const &aff) {
- NRBPath bp, abp;
- bp.path = s;
- nr_path_duplicate_transform(&abp, &bp, aff);
- return abp.path;
+NArtBpath* nr_artpath_affine(NArtBpath const *s, NR::Matrix const &aff) {
+ const_NRBPath bp;
+ bp.path = s;
+ NRBPath abp;
+ nr_path_duplicate_transform(&abp, &bp, aff);
+ return abp.path;
}
static void
@@ -212,7 +213,7 @@ nr_curve_bbox_wind_distance (NR::Coord x000, NR::Coord y000,
}
void
-nr_path_matrix_point_bbox_wind_distance (NRBPath *bpath, NR::Matrix const &m, NR::Point &pt,
+nr_path_matrix_point_bbox_wind_distance (const_NRBPath const *bpath, NR::Matrix const &m, NR::Point &pt,
NRRect *bbox, int *wind, NR::Coord *dist,
NR::Coord tolerance, NR::Rect *viewbox)
{
@@ -449,7 +450,7 @@ nr_curve_bbox (NR::Coord x000, NR::Coord y000, NR::Coord x001, NR::Coord y001, N
}
void
-nr_path_matrix_bbox_union(NRBPath const *bpath, NR::Matrix const &m,
+nr_path_matrix_bbox_union(const_NRBPath *bpath, NR::Matrix const &m,
NRRect *bbox)
{
using NR::X;
diff --git a/src/libnr/nr-path.h b/src/libnr/nr-path.h
index bf7369be4..5e8b0e48e 100644
--- a/src/libnr/nr-path.h
+++ b/src/libnr/nr-path.h
@@ -30,21 +30,26 @@
#include <libnr/nr-forward.h>
#include <libnr/nr-coord.h>
-NArtBpath* nr_artpath_affine(NArtBpath *s, NR::Matrix const &transform);
+NArtBpath* nr_artpath_affine(NArtBpath const *s, NR::Matrix const &transform);
+struct const_NRBPath {
+ NArtBpath const *path;
+};
struct NRBPath {
- NArtBpath *path;
+ NArtBpath *path;
+ operator const_NRBPath() { const_NRBPath bp = { path }; return bp; };
};
-NRBPath *nr_path_duplicate_transform(NRBPath *d, NRBPath *s, NR::Matrix const *transform);
-NRBPath *nr_path_duplicate_transform(NRBPath *d, NRBPath *s, NR::Matrix const transform);
+NRBPath *nr_path_duplicate_transform(NRBPath *d, const_NRBPath *s, NR::Matrix const *transform);
+
+NRBPath *nr_path_duplicate_transform(NRBPath *d, const_NRBPath *s, NR::Matrix const transform);
-void nr_path_matrix_point_bbox_wind_distance (NRBPath *bpath, NR::Matrix const &m, NR::Point &pt,
+void nr_path_matrix_point_bbox_wind_distance (const_NRBPath const *bpath, NR::Matrix const &m, NR::Point &pt,
NRRect *bbox, int *wind, NR::Coord *dist,
NR::Coord tolerance, NR::Rect *viewbox);
-void nr_path_matrix_bbox_union(NRBPath const *bpath, NR::Matrix const &m, NRRect *bbox);
+void nr_path_matrix_bbox_union(const_NRBPath *bpath, NR::Matrix const &m, NRRect *bbox);
NArtBpath *nr_path_from_rect(NRRect const &r);