From 80ba110d6d9475e3ce42d1563c74a980362bebf7 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Mon, 7 Jul 2008 20:23:57 +0000 Subject: [PATCH] replace separate forward declarations by proper forward.h inclusion --- src/event-context.h | 5 ++--- src/gradient-drag.h | 4 +--- src/knot-holder-entity.h | 4 +--- src/libnr/nr-point.h | 3 +-- src/libnr/nr-types.h | 9 +-------- src/live_effects/effect.h | 5 +---- src/satisfied-guide-cns.h | 2 +- src/shape-editor.h | 2 +- src/sp-item-transform.h | 6 +----- src/svg/stringstream.h | 5 ++--- src/text-editing.h | 4 ++-- src/ui/view/view.h | 6 +----- src/xml/repr-util.cpp | 4 ++-- src/xml/repr.h | 8 ++------ 14 files changed, 19 insertions(+), 48 deletions(-) diff --git a/src/event-context.h b/src/event-context.h index 3a745a6a2..9cff3a62f 100644 --- a/src/event-context.h +++ b/src/event-context.h @@ -21,13 +21,12 @@ #include #include +#include + struct GrDrag; struct SPDesktop; struct SPItem; class KnotHolder; -namespace NR { - class Point; -} namespace Inkscape { class MessageContext; diff --git a/src/gradient-drag.h b/src/gradient-drag.h index 81713e0ee..ed0887e98 100644 --- a/src/gradient-drag.h +++ b/src/gradient-drag.h @@ -19,13 +19,11 @@ #include #include +#include #include struct SPItem; struct SPKnot; -namespace NR { -class Point; -} /** This class represents a single draggable point of a gradient. It remembers the item diff --git a/src/knot-holder-entity.h b/src/knot-holder-entity.h index ea90c4254..e4564cd01 100644 --- a/src/knot-holder-entity.h +++ b/src/knot-holder-entity.h @@ -19,12 +19,10 @@ #include #include "knot.h" +#include struct SPItem; struct SPKnot; -namespace NR { -class Point; -} class SPDesktop; class KnotHolder; diff --git a/src/libnr/nr-point.h b/src/libnr/nr-point.h index c1ec3adc9..c0810bda1 100644 --- a/src/libnr/nr-point.h +++ b/src/libnr/nr-point.h @@ -12,6 +12,7 @@ #include #include +#include //#include "round.h" #include "decimal-round.h" @@ -20,8 +21,6 @@ namespace NR { -class Matrix; - /// Cartesian point. class Point { public: diff --git a/src/libnr/nr-types.h b/src/libnr/nr-types.h index 4802f5e0c..bf499e7ff 100644 --- a/src/libnr/nr-types.h +++ b/src/libnr/nr-types.h @@ -24,14 +24,7 @@ #include #include #include - -namespace NR { - -class Rect; -class Matrix; - -} /* namespace NR */ - +#include #endif /* !__NR_TYPES_H__ */ diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 07b58c87c..38c9ccdaa 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -14,6 +14,7 @@ #include #include #include <2geom/path.h> +#include <2geom/forward.h> #include "ui/widget/registry.h" #include "util/enums.h" #include "sp-lpe-item.h" @@ -37,10 +38,6 @@ namespace Gtk { class Tooltips; } -namespace Geom { - class Matrix; -} - namespace Inkscape { namespace XML { diff --git a/src/satisfied-guide-cns.h b/src/satisfied-guide-cns.h index 93097e021..eeadf48cd 100644 --- a/src/satisfied-guide-cns.h +++ b/src/satisfied-guide-cns.h @@ -2,7 +2,7 @@ #define __SATISFIED_GUIDE_CNS_H__ #include -namespace NR { class Point; } +#include #include class SPGuideConstraint; diff --git a/src/shape-editor.h b/src/shape-editor.h index 7ce0732a4..48d008b1f 100644 --- a/src/shape-editor.h +++ b/src/shape-editor.h @@ -13,9 +13,9 @@ */ #include +#include namespace Inkscape { namespace NodePath { class Path; } } -namespace NR { class Rect; } #include "libnr/nr-path-code.h" #include "libnr/nr-point.h" diff --git a/src/sp-item-transform.h b/src/sp-item-transform.h index df87da84c..8f6cdc24d 100644 --- a/src/sp-item-transform.h +++ b/src/sp-item-transform.h @@ -2,11 +2,7 @@ #define SP_ITEM_TRANSFORM_H #include "forward.h" -namespace NR { -class translate; -class rotate; -class Rect; -} +#include void sp_item_rotate_rel(SPItem *item, NR::rotate const &rotation); void sp_item_scale_rel (SPItem *item, NR::scale const &scale); diff --git a/src/svg/stringstream.h b/src/svg/stringstream.h index 4e19125b4..5fbf1976c 100644 --- a/src/svg/stringstream.h +++ b/src/svg/stringstream.h @@ -5,9 +5,8 @@ #include #include -namespace Geom { - class Point; -} +#include <2geom/forward.h> + namespace Inkscape { typedef std::ios_base &(*std_oct_type)(std::ios_base &); diff --git a/src/text-editing.h b/src/text-editing.h index 8cf948b60..d0bbc3051 100644 --- a/src/text-editing.h +++ b/src/text-editing.h @@ -16,12 +16,12 @@ #include #include // std::pair #include "libnrtype/Layout-TNG.h" +#include + class SPCSSAttr; struct SPItem; struct SPObject; struct SPStyle; -namespace NR { class Matrix; } -namespace NR { class Point; } typedef std::pair iterator_pair; diff --git a/src/ui/view/view.h b/src/ui/view/view.h index e1d4e491f..63a138f67 100644 --- a/src/ui/view/view.h +++ b/src/ui/view/view.h @@ -20,7 +20,7 @@ #include "gc-managed.h" #include "gc-finalized.h" #include "gc-anchored.h" - +#include /** * Iterates until true or returns false. @@ -52,10 +52,6 @@ struct StopOnNonZero { } }; - -namespace NR { - class Point; -} class SPDocument; namespace Inkscape { diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 193c1125c..59563a7fc 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -29,7 +29,7 @@ #include - +#include <2geom/point.h> #include "svg/stringstream.h" #include "svg/css-ostringstream.h" @@ -592,7 +592,7 @@ sp_repr_set_svg_double(Inkscape::XML::Node *repr, gchar const *key, double val) return true; } -unsigned sp_repr_set_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point val) +unsigned sp_repr_set_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point const & val) { g_return_val_if_fail(repr != NULL, FALSE); g_return_val_if_fail(key != NULL, FALSE); diff --git a/src/xml/repr.h b/src/xml/repr.h index f0a1dbeb6..a16a3c4f4 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -22,7 +22,7 @@ #include "xml/sp-css-attr.h" #include "io/inkscapestream.h" -#include <2geom/point.h> +#include <2geom/forward.h> #define SP_SODIPODI_NS_URI "http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" #define SP_BROKEN_SODIPODI_NS_URI "http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" @@ -130,10 +130,6 @@ * Kees Cook 2004-07-01, updated MenTaLguY 2005-01-25 */ -namespace Geom { -class Point; -} - /* SPXMLNs */ char const *sp_xml_ns_uri_prefix(gchar const *uri, gchar const *suggested); char const *sp_xml_ns_prefix_uri(gchar const *prefix); @@ -221,7 +217,7 @@ unsigned sp_repr_set_boolean(Inkscape::XML::Node *repr, gchar const *key, unsign unsigned sp_repr_set_int(Inkscape::XML::Node *repr, gchar const *key, int val); unsigned sp_repr_set_css_double(Inkscape::XML::Node *repr, gchar const *key, double val); unsigned sp_repr_set_svg_double(Inkscape::XML::Node *repr, gchar const *key, double val); -unsigned sp_repr_set_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point val); +unsigned sp_repr_set_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point const & val); unsigned sp_repr_get_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point *val); /// \deprecated ! -- 2.30.2