diff options
| author | Liam P. White <inkscapebrony@gmail.com> | 2014-09-07 17:02:01 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebrony@gmail.com> | 2014-09-07 17:02:01 +0000 |
| commit | 0d0958e3b2aff0ed5f3ad7a98b4035213475c7f1 (patch) | |
| tree | 099d7926509e826b184def14a8e037e255fe36ab /src | |
| parent | Fix gtk3 build (diff) | |
| download | inkscape-0d0958e3b2aff0ed5f3ad7a98b4035213475c7f1.tar.gz inkscape-0d0958e3b2aff0ed5f3ad7a98b4035213475c7f1.zip | |
Update to experimental r13543
(bzr r13090.1.108)
Diffstat (limited to 'src')
124 files changed, 634 insertions, 599 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 282797a50..8fb7e23ef 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -105,7 +105,6 @@ endif # Include all partial makefiles from subdirectories include Makefile_insert -include dialogs/Makefile_insert include display/Makefile_insert include extension/Makefile_insert include extension/dbus/Makefile_insert @@ -144,7 +143,6 @@ include libdepixelize/Makefile_insert EXTRA_DIST += \ 2geom/makefile.in \ debug/makefile.in \ - dialogs/makefile.in \ display/makefile.in \ extension/implementation/makefile.in \ extension/internal/makefile.in \ diff --git a/src/axis-manip.h b/src/axis-manip.h index 619b9089c..5e245939e 100644 --- a/src/axis-manip.h +++ b/src/axis-manip.h @@ -78,18 +78,15 @@ inline int axis_to_int(Box3D::Axis axis) { switch (axis) { case Box3D::X: return 0; - break; case Box3D::Y: return 1; - break; case Box3D::Z: return 2; - break; case Box3D::NONE: return -1; - break; default: assert(false); + return -1; // help compiler's flow analysis (-Werror=return-value) } } @@ -105,6 +102,7 @@ inline Proj::Axis toProj(Box3D::Axis axis) { return Proj::NONE; default: assert(false); + return Proj::NONE; // help compiler's flow analysis (-Werror=return-value) } } @@ -128,6 +126,7 @@ inline Box3D::Axis toAffine(Proj::Axis axis) { return Box3D::NONE; default: assert(false); + return Box3D::NONE; // help compiler's flow analysis (-Werror=return-value) } } diff --git a/src/color.cpp b/src/color.cpp index da4406748..d7e8d25dd 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -12,13 +12,21 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <math.h> +#include <cmath> +#include <cstdio> + +#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) +#define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) + #include "color.h" #include "svg/svg-icc-color.h" #include "svg/svg-color.h" #include "svg/css-ostringstream.h" +#define return_if_fail(x) if (!(x)) { printf("assertion failed: " #x); return; } +#define return_val_if_fail(x, val) if (!(x)) { printf("assertion failed: " #x); return val; } + using Inkscape::CSSOStringStream; using std::vector; @@ -118,7 +126,7 @@ static bool profileMatches( SVGICCColor const* first, SVGICCColor const* second && (first->colorProfile == second->colorProfile) && (first->colors.size() == second->colors.size()); if ( match ) { - for ( guint i = 0; i < first->colors.size(); i++ ) { + for ( unsigned i = 0; i < first->colors.size(); i++ ) { match &= (fabs(first->colors[i] - second->colors[i]) < PROFILE_EPSILON); } } @@ -132,12 +140,12 @@ static bool profileMatches( SVGICCColor const* first, SVGICCColor const* second */ void SPColor::set( float r, float g, float b ) { - g_return_if_fail(r >= 0.0); - g_return_if_fail(r <= 1.0); - g_return_if_fail(g >= 0.0); - g_return_if_fail(g <= 1.0); - g_return_if_fail(b >= 0.0); - g_return_if_fail(b <= 1.0); + return_if_fail(r >= 0.0); + return_if_fail(r <= 1.0); + return_if_fail(g >= 0.0); + return_if_fail(g <= 1.0); + return_if_fail(b >= 0.0); + return_if_fail(b <= 1.0); // TODO clear icc if set? v.c[0] = r; @@ -162,7 +170,7 @@ void SPColor::set( guint32 value ) */ guint32 SPColor::toRGBA32( int alpha ) const { - g_return_val_if_fail (alpha <= 0xff, 0x0); + return_val_if_fail (alpha <= 0xff, 0x0); guint32 rgba = SP_RGBA32_U_COMPOSE( SP_COLOR_F_TO_U(v.c[0]), SP_COLOR_F_TO_U(v.c[1]), @@ -177,8 +185,8 @@ guint32 SPColor::toRGBA32( int alpha ) const */ guint32 SPColor::toRGBA32( double alpha ) const { - g_return_val_if_fail(alpha >= 0.0, 0x0); - g_return_val_if_fail(alpha <= 1.0, 0x0); + return_val_if_fail(alpha >= 0.0, 0x0); + return_val_if_fail(alpha <= 1.0, 0x0); return toRGBA32( static_cast<int>(SP_COLOR_F_TO_U(alpha)) ); } @@ -215,8 +223,8 @@ std::string SPColor::toString() const void sp_color_get_rgb_floatv(SPColor const *color, float *rgb) { - g_return_if_fail (color != NULL); - g_return_if_fail (rgb != NULL); + return_if_fail (color != NULL); + return_if_fail (rgb != NULL); rgb[0] = color->v.c[0]; rgb[1] = color->v.c[1]; @@ -230,8 +238,8 @@ sp_color_get_rgb_floatv(SPColor const *color, float *rgb) void sp_color_get_cmyk_floatv(SPColor const *color, float *cmyk) { - g_return_if_fail (color != NULL); - g_return_if_fail (cmyk != NULL); + return_if_fail (color != NULL); + return_if_fail (cmyk != NULL); sp_color_rgb_to_cmyk_floatv( cmyk, color->v.c[0], diff --git a/src/debug/gdk-event-latency-tracker.cpp b/src/debug/gdk-event-latency-tracker.cpp index b21675f53..4679f05f1 100644 --- a/src/debug/gdk-event-latency-tracker.cpp +++ b/src/debug/gdk-event-latency-tracker.cpp @@ -9,6 +9,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include <gdk/gdk.h> + #include "debug/gdk-event-latency-tracker.h" #include "preferences.h" diff --git a/src/debug/gdk-event-latency-tracker.h b/src/debug/gdk-event-latency-tracker.h index c3624e74f..0fdb18790 100644 --- a/src/debug/gdk-event-latency-tracker.h +++ b/src/debug/gdk-event-latency-tracker.h @@ -12,7 +12,7 @@ #ifndef SEEN_INKSCAPE_DEBUG_GDK_EVENT_LATENCY_TRACKER_H #define SEEN_INKSCAPE_DEBUG_GDK_EVENT_LATENCY_TRACKER_H -#include <gdk/gdk.h> +typedef union _GdkEvent GdkEvent; #include <glibmm/timer.h> #include <boost/optional.hpp> diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 8be5e001b..332de3630 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -25,7 +25,7 @@ #include "desktop.h" #include "desktop-events.h" #include "desktop-handles.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "display/canvas-axonomgrid.h" #include "display/canvas-grid.h" #include "display/guideline.h" diff --git a/src/dialogs/CMakeLists.txt b/src/dialogs/CMakeLists.txt deleted file mode 100644 index ca19c0b72..000000000 --- a/src/dialogs/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ - -set(dialogs_SRC - dialog-events.cpp - - # ------- - # Headers - dialog-events.h -) - -# add_inkscape_lib(dialogs_LIB "${dialogs_SRC}") -add_inkscape_source("${dialogs_SRC}") diff --git a/src/dialogs/Makefile_insert b/src/dialogs/Makefile_insert deleted file mode 100644 index f1ed89314..000000000 --- a/src/dialogs/Makefile_insert +++ /dev/null @@ -1,5 +0,0 @@ -## Makefile.am fragment sourced by src/Makefile.am. - -ink_common_sources += \ - dialogs/dialog-events.cpp \ - dialogs/dialog-events.h diff --git a/src/dialogs/makefile.in b/src/dialogs/makefile.in deleted file mode 100644 index 9acaf79a0..000000000 --- a/src/dialogs/makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - -@SET_MAKE@ - -OBJEXT = @OBJEXT@ - -# Explicit so that it's the default rule. -all: - cd .. && $(MAKE) dialogs/all - -clean %.a %.$(OBJEXT): - cd .. && $(MAKE) dialogs/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) diff --git a/src/dir-util.h b/src/dir-util.h index 4865158bd..e78cad6a6 100644 --- a/src/dir-util.h +++ b/src/dir-util.h @@ -10,6 +10,7 @@ */ #include <cstdlib> +#include <string> /** * Returns a form of \a path relative to \a base if that is easy to construct (eg if \a path diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp index 0ba6c5860..e1f12b04b 100644 --- a/src/display/cairo-utils.cpp +++ b/src/display/cairo-utils.cpp @@ -26,6 +26,8 @@ #include <2geom/path.h> #include <2geom/transforms.h> #include <2geom/sbasis-to-bezier.h> +#include <gdk-pixbuf/gdk-pixbuf.h> + #include "color.h" #include "style.h" #include "helper/geom-curves.h" diff --git a/src/display/canvas-arena.h b/src/display/canvas-arena.h index 26f19732d..15bbc2ee0 100644 --- a/src/display/canvas-arena.h +++ b/src/display/canvas-arena.h @@ -13,15 +13,13 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <cairo.h> #include <2geom/rect.h> + #include "display/drawing.h" #include "display/drawing-item.h" #include "display/sp-canvas.h" #include "display/sp-canvas-item.h" -G_BEGIN_DECLS - #define SP_TYPE_CANVAS_ARENA (sp_canvas_arena_get_type ()) #define SP_CANVAS_ARENA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_CANVAS_ARENA, SPCanvasArena)) #define SP_CANVAS_ARENA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_CANVAS_ARENA, SPCanvasArenaClass)) @@ -30,6 +28,7 @@ G_BEGIN_DECLS typedef struct _SPCanvasArena SPCanvasArena; typedef struct _SPCanvasArenaClass SPCanvasArenaClass; +typedef struct _cairo_surface cairo_surface_t; struct CachePrefObserver; namespace Inkscape { @@ -39,7 +38,6 @@ class DrawingItem; } // namespace Inkscape - struct _SPCanvasArena { SPCanvasItem item; @@ -70,6 +68,4 @@ void sp_canvas_arena_set_sticky (SPCanvasArena *ca, gboolean sticky); void sp_canvas_arena_render_surface (SPCanvasArena *ca, cairo_surface_t *surface, Geom::IntRect const &area); -G_END_DECLS - #endif // SEEN_SP_CANVAS_ARENA_H diff --git a/src/display/canvas-axonomgrid.h b/src/display/canvas-axonomgrid.h index 3888a3dc4..92cdb4c50 100644 --- a/src/display/canvas-axonomgrid.h +++ b/src/display/canvas-axonomgrid.h @@ -26,11 +26,11 @@ public: CanvasAxonomGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc); virtual ~CanvasAxonomGrid(); - void Update (Geom::Affine const &affine, unsigned int flags); - void Render (SPCanvasBuf *buf); + virtual void Update (Geom::Affine const &affine, unsigned int flags); + virtual void Render (SPCanvasBuf *buf); - void readRepr(); - void onReprAttrChanged (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive); + virtual void readRepr(); + virtual void onReprAttrChanged (Inkscape::XML::Node * repr, char const *key, char const *oldval, char const *newval, bool is_interactive); double lengthy; /**< The lengths of the primary y-axis */ double angle_deg[3]; /**< Angle of each axis (note that angle[2] == 0) */ diff --git a/src/display/canvas-grid.h b/src/display/canvas-grid.h index 5a23dee52..557bd6dab 100644 --- a/src/display/canvas-grid.h +++ b/src/display/canvas-grid.h @@ -82,7 +82,7 @@ public: virtual void Render (SPCanvasBuf *buf) = 0; virtual void readRepr() = 0; - virtual void onReprAttrChanged (Inkscape::XML::Node * /*repr*/, const gchar */*key*/, const gchar */*oldval*/, const gchar */*newval*/, bool /*is_interactive*/) = 0; + virtual void onReprAttrChanged (Inkscape::XML::Node * /*repr*/, char const */*key*/, char const */*oldval*/, char const */*newval*/, bool /*is_interactive*/) = 0; Gtk::Widget * newWidget(); @@ -129,11 +129,11 @@ public: CanvasXYGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc); virtual ~CanvasXYGrid(); - void Update (Geom::Affine const &affine, unsigned int flags); - void Render (SPCanvasBuf *buf); + virtual void Update (Geom::Affine const &affine, unsigned int flags); + virtual void Render (SPCanvasBuf *buf); - void readRepr(); - void onReprAttrChanged (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive); + virtual void readRepr(); + virtual void onReprAttrChanged (Inkscape::XML::Node * repr, char const *key, char const *oldval, char const *newval, bool is_interactive); Geom::Point spacing; /**< Spacing between elements of the grid */ bool scaled[2]; /**< Whether the grid is in scaled mode, which can diff --git a/src/display/canvas-temporary-item-list.cpp b/src/display/canvas-temporary-item-list.cpp index b0fec98b5..60ead11ce 100644 --- a/src/display/canvas-temporary-item-list.cpp +++ b/src/display/canvas-temporary-item-list.cpp @@ -10,9 +10,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include "display/canvas-temporary-item-list.h" - #include "display/canvas-temporary-item.h" +#include "display/canvas-temporary-item-list.h" namespace Inkscape { namespace Display { @@ -35,7 +34,7 @@ TemporaryItemList::~TemporaryItemList() /* Note that TemporaryItem or TemporaryItemList is responsible for deletion and such, so this return pointer can safely be ignored. */ TemporaryItem * -TemporaryItemList::add_item(SPCanvasItem *item, guint lifetime) +TemporaryItemList::add_item(SPCanvasItem *item, unsigned int lifetime) { // beware of strange things happening due to very short timeouts TemporaryItem * tempitem = new TemporaryItem(item, lifetime); diff --git a/src/display/canvas-temporary-item-list.h b/src/display/canvas-temporary-item-list.h index d204c692f..471bb99b9 100644 --- a/src/display/canvas-temporary-item-list.h +++ b/src/display/canvas-temporary-item-list.h @@ -11,7 +11,6 @@ */ #include <list> -#include <glib.h> struct SPCanvasItem; class SPDesktop; @@ -22,14 +21,14 @@ namespace Display { class TemporaryItem; /** - * Provides a class that can contain active TemporaryItem's on a desktop. + * Provides a class that can contain active TemporaryItem[s] on a desktop. */ class TemporaryItemList { public: TemporaryItemList(SPDesktop *desktop); virtual ~TemporaryItemList(); - TemporaryItem* add_item (SPCanvasItem *item, guint lifetime); + TemporaryItem* add_item (SPCanvasItem *item, unsigned int lifetime); void delete_item (TemporaryItem * tempitem); protected: diff --git a/src/display/canvas-temporary-item.cpp b/src/display/canvas-temporary-item.cpp index 551ea1536..f55c8bf4e 100644 --- a/src/display/canvas-temporary-item.cpp +++ b/src/display/canvas-temporary-item.cpp @@ -16,7 +16,7 @@ #include "display/canvas-temporary-item.h" -#include <gtk/gtk.h> +#include <glib.h> #include "display/sp-canvas-item.h" namespace Inkscape { @@ -54,9 +54,9 @@ TemporaryItem::~TemporaryItem() } } -/* static method*/ -gboolean TemporaryItem::_timeout(gpointer data) { - TemporaryItem *tempitem = reinterpret_cast<TemporaryItem *>(data); +/* static method */ +int TemporaryItem::_timeout(void* data) { + TemporaryItem *tempitem = static_cast<TemporaryItem *>(data); tempitem->timeout_id = 0; tempitem->signal_timeout.emit(tempitem); delete tempitem; diff --git a/src/display/canvas-temporary-item.h b/src/display/canvas-temporary-item.h index 09d243fa1..39ca2fc65 100644 --- a/src/display/canvas-temporary-item.h +++ b/src/display/canvas-temporary-item.h @@ -11,9 +11,8 @@ */ -#include <stddef.h> -#include <sigc++/sigc++.h> -#include <glib.h> +#include <cstddef> +#include <sigc++/signal.h> struct SPCanvasItem; @@ -25,7 +24,7 @@ namespace Display { */ class TemporaryItem { public: - TemporaryItem(SPCanvasItem *item, guint lifetime, bool destroy_on_deselect = false); + TemporaryItem(SPCanvasItem *item, unsigned int lifetime, bool destroy_on_deselect = false); virtual ~TemporaryItem(); sigc::signal<void, TemporaryItem *> signal_timeout; @@ -34,10 +33,10 @@ protected: friend class TemporaryItemList; SPCanvasItem * canvasitem; /** The item we are holding on to */ - guint timeout_id; /** ID by which glib knows the timeout event */ + unsigned int timeout_id; /** ID by which glib knows the timeout event */ bool destroy_on_deselect; // only destroy when parent item is deselected, not when mouse leaves - static gboolean _timeout(gpointer data); ///< callback for when lifetime expired + static int _timeout(void* data); ///< callback for when lifetime expired private: TemporaryItem(const TemporaryItem&); diff --git a/src/display/curve.cpp b/src/display/curve.cpp index 0a39a8e7f..54a62939d 100644 --- a/src/display/curve.cpp +++ b/src/display/curve.cpp @@ -48,7 +48,7 @@ SPCurve::new_from_rect(Geom::Rect const &rect, bool all_four_sides) Geom::Point p = rect.corner(0); c->moveto(p); - for (int i=3; i>=1; i--) { + for (int i=3; i>=1; --i) { c->lineto(rect.corner(i)); } @@ -87,10 +87,10 @@ SPCurve::get_pathvector() const * Returns the number of segments of all paths summed * This count includes the closing line segment of a closed path. */ -guint +size_t SPCurve::get_segment_count() const { - guint nr = 0; + size_t nr = 0; for(Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) { nr += (*it).size(); @@ -200,7 +200,7 @@ SPCurve::reset() * Calls SPCurve::moveto() with point made of given coordinates. */ void -SPCurve::moveto(gdouble x, gdouble y) +SPCurve::moveto(double x, double y) { moveto(Geom::Point(x, y)); } @@ -229,7 +229,7 @@ SPCurve::lineto(Geom::Point const &p) * Calls SPCurve::lineto( Geom::Point(x,y) ) */ void -SPCurve::lineto(gdouble x, gdouble y) +SPCurve::lineto(double x, double y) { lineto(Geom::Point(x,y)); } @@ -249,7 +249,7 @@ SPCurve::quadto(Geom::Point const &p1, Geom::Point const &p2) * All coordinates must be finite. */ void -SPCurve::quadto(gdouble x1, gdouble y1, gdouble x2, gdouble y2) +SPCurve::quadto(double x1, double y1, double x2, double y2) { quadto( Geom::Point(x1,y1), Geom::Point(x2,y2) ); } @@ -269,7 +269,7 @@ SPCurve::curveto(Geom::Point const &p0, Geom::Point const &p1, Geom::Point const * All coordinates must be finite. */ void -SPCurve::curveto(gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble x2, gdouble y2) +SPCurve::curveto(double x0, double y0, double x1, double y1, double x2, double y2) { curveto( Geom::Point(x0,y0), Geom::Point(x1,y1), Geom::Point(x2,y2) ); } @@ -520,7 +520,7 @@ SPCurve::append(SPCurve const *curve2, * When one of the curves is empty, this curves path becomes the non-empty path. */ SPCurve * -SPCurve::append_continuous(SPCurve const *c1, gdouble tolerance) +SPCurve::append_continuous(SPCurve const *c1, double tolerance) { using Geom::X; using Geom::Y; @@ -630,10 +630,10 @@ SPCurve::move_endpoints(Geom::Point const &new_p0, Geom::Point const &new_p1) * Sum of nodes in all the paths. When a path is closed, and its closing line segment is of zero-length, * this function will not count the closing knot double (so basically ignores the closing line segment when it has zero length) */ -guint +size_t SPCurve::nodes_in_path() const { - guint nr = 0; + size_t nr = 0; for(Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) { nr += (*it).size(); diff --git a/src/display/curve.h b/src/display/curve.h index b3f1e3702..5fad75b18 100644 --- a/src/display/curve.h +++ b/src/display/curve.h @@ -13,10 +13,12 @@ #ifndef SEEN_DISPLAY_CURVE_H #define SEEN_DISPLAY_CURVE_H -#include <glib.h> #include <2geom/forward.h> +#include <cstddef> #include <boost/optional.hpp> +extern "C" { typedef struct _GSList GSList; } + /** * Wrapper around a Geom::PathVector object. */ @@ -37,8 +39,8 @@ public: SPCurve * copy() const; - guint get_segment_count() const; - guint nodes_in_path() const; + size_t get_segment_count() const; + size_t nodes_in_path() const; bool is_empty() const; bool is_closed() const; @@ -54,13 +56,13 @@ public: void reset(); void moveto(Geom::Point const &p); - void moveto(gdouble x, gdouble y); + void moveto(double x, double y); void lineto(Geom::Point const &p); - void lineto(gdouble x, gdouble y); + void lineto(double x, double y); void quadto(Geom::Point const &p1, Geom::Point const &p2); - void quadto(gdouble x1, gdouble y1, gdouble x2, gdouble y2); + void quadto(double x1, double y1, double x2, double y2); void curveto(Geom::Point const &p0, Geom::Point const &p1, Geom::Point const &p2); - void curveto(gdouble x0, gdouble y0, gdouble x1, gdouble y1, gdouble x2, gdouble y2); + void curveto(double x0, double y0, double x1, double y1, double x2, double y2); void closepath(); void closepath_current(); void backspace(); @@ -71,14 +73,14 @@ public: void last_point_additive_move(Geom::Point const & p); void append(SPCurve const *curve2, bool use_lineto); - SPCurve * append_continuous(SPCurve const *c1, gdouble tolerance); + SPCurve * append_continuous(SPCurve const *c1, double tolerance); SPCurve * create_reverse() const; GSList * split() const; static SPCurve * concat(GSList const *list); protected: - gint _refcount; + size_t _refcount; Geom::PathVector _pathv; diff --git a/src/display/drawing-context.h b/src/display/drawing-context.h index 0d82087c3..a15e0d0e5 100644 --- a/src/display/drawing-context.h +++ b/src/display/drawing-context.h @@ -12,13 +12,13 @@ #ifndef SEEN_INKSCAPE_DISPLAY_DRAWING_CONTEXT_H #define SEEN_INKSCAPE_DISPLAY_DRAWING_CONTEXT_H -#include <boost/utility.hpp> -#include <glib.h> -#include <cairo.h> #include <2geom/affine.h> #include <2geom/angle.h> #include <2geom/rect.h> #include <2geom/transforms.h> +#include <boost/utility.hpp> +#include <cairo.h> +typedef unsigned int guint32; namespace Inkscape { diff --git a/src/display/drawing-item.h b/src/display/drawing-item.h index 925bcbddb..dda5cd6ac 100644 --- a/src/display/drawing-item.h +++ b/src/display/drawing-item.h @@ -12,13 +12,13 @@ #ifndef SEEN_INKSCAPE_DISPLAY_DRAWING_ITEM_H #define SEEN_INKSCAPE_DISPLAY_DRAWING_ITEM_H -#include <list> -#include <exception> +#include <2geom/rect.h> +#include <2geom/affine.h> #include <boost/operators.hpp> #include <boost/utility.hpp> #include <boost/intrusive/list.hpp> -#include <2geom/rect.h> -#include <2geom/affine.h> +#include <exception> +#include <list> class SPStyle; diff --git a/src/display/drawing-surface.h b/src/display/drawing-surface.h index e937cca55..7bec1606a 100644 --- a/src/display/drawing-surface.h +++ b/src/display/drawing-surface.h @@ -14,11 +14,16 @@ #include <boost/shared_ptr.hpp> #include <cairo.h> -#include <gdk-pixbuf/gdk-pixbuf.h> #include <2geom/affine.h> #include <2geom/rect.h> #include <2geom/transforms.h> +extern "C" { +typedef struct _cairo cairo_t; +typedef struct _cairo_surface cairo_surface_t; +typedef struct _cairo_region cairo_region_t; +} + namespace Inkscape { class DrawingContext; diff --git a/src/display/drawing.h b/src/display/drawing.h index 88e35b03b..0c12b1510 100644 --- a/src/display/drawing.h +++ b/src/display/drawing.h @@ -12,11 +12,12 @@ #ifndef SEEN_INKSCAPE_DISPLAY_DRAWING_H #define SEEN_INKSCAPE_DISPLAY_DRAWING_H -#include <set> +#include <2geom/rect.h> #include <boost/operators.hpp> #include <boost/utility.hpp> +#include <set> #include <sigc++/sigc++.h> -#include <2geom/rect.h> + #include "display/drawing-item.h" #include "display/rendermode.h" #include "nr-filter-colormatrix.h" diff --git a/src/display/gnome-canvas-acetate.h b/src/display/gnome-canvas-acetate.h index 447c3a9c4..3e1ba7661 100644 --- a/src/display/gnome-canvas-acetate.h +++ b/src/display/gnome-canvas-acetate.h @@ -15,10 +15,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <glib.h> #include "display/sp-canvas-item.h" - #define GNOME_TYPE_CANVAS_ACETATE (sp_canvas_acetate_get_type ()) #define SP_CANVAS_ACETATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_CANVAS_ACETATE, SPCanvasAcetate)) #define SP_CANVAS_ACETATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_ACETATE, SPCanvasAcetateClass)) @@ -27,17 +25,15 @@ struct SPCanvasAcetate { - SPCanvasItem item; + SPCanvasItem item; }; struct SPCanvasAcetateClass { - SPCanvasItemClass parent_class; + SPCanvasItemClass parent_class; }; GType sp_canvas_acetate_get_type (void); - - #endif // SEEN_SP_CANVAS_ACETATE_H /* diff --git a/src/display/grayscale.cpp b/src/display/grayscale.cpp index f59cf6d23..3c0031e87 100644 --- a/src/display/grayscale.cpp +++ b/src/display/grayscale.cpp @@ -36,7 +36,7 @@ guint32 process(guint32 rgba) { return process(SP_RGBA32_R_U(rgba), SP_RGBA32_G_U(rgba), SP_RGBA32_B_U(rgba), SP_RGBA32_A_U(rgba)); } -guint32 process(guchar r, guchar g, guchar b, guchar a) { +guint32 process(unsigned char r, unsigned char g, unsigned char b, unsigned char a) { /** To reduce banding in gradients, this calculation is tweaked a bit * by outputing blue+1 or red+1 or both. The luminance is calculated @@ -62,7 +62,7 @@ guint32 process(guchar r, guchar g, guchar b, guchar a) { } } -guchar luminance(guchar r, guchar g, guchar b) { +unsigned char luminance(unsigned char r, unsigned char g, unsigned char b) { guint32 luminance = ( red_factor * r + green_factor * g + blue_factor * b ); diff --git a/src/display/grayscale.h b/src/display/grayscale.h index 18162e1f3..0ffe727da 100644 --- a/src/display/grayscale.h +++ b/src/display/grayscale.h @@ -10,15 +10,15 @@ * Released under GNU GPL */ -#include <gdk/gdk.h> +typedef unsigned int guint32; /** * Provide methods to calculate grayscale values (e.g. convert rgba value to grayscale rgba value). */ namespace Grayscale { guint32 process(guint32 rgba); - guint32 process(guchar r, guchar g, guchar b, guchar a); - guchar luminance(guchar r, guchar g, guchar b); + guint32 process(unsigned char r, unsigned char g, unsigned char b, unsigned char a); + unsigned char luminance(unsigned char r, unsigned char g, unsigned char b); bool activeDesktopIsGrayscale(); }; diff --git a/src/display/nr-3dutils.h b/src/display/nr-3dutils.h index c278c81c6..eb773a9ad 100644 --- a/src/display/nr-3dutils.h +++ b/src/display/nr-3dutils.h @@ -1,5 +1,5 @@ -#ifndef __NR_3DUTILS_H__ -#define __NR_3DUTILS_H__ +#ifndef SEEN_NR_3DUTILS_H +#define SEEN_NR_3DUTILS_H /* * 3D utils. Definition of gdouble vectors of dimension 3 and of some basic @@ -14,7 +14,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <gdk/gdk.h> #include <2geom/forward.h> namespace NR { @@ -51,7 +50,7 @@ const static Fvector EYE_VECTOR(0, 0, 1); * \param v a reference to a vector with double components * \return the euclidian norm of v */ -gdouble norm(const Fvector &v); +double norm(const Fvector &v); /** * Normalizes a vector @@ -67,7 +66,7 @@ void normalize_vector(Fvector &v); * \param b a Fvector reference * \return the scalar product of a and b */ -gdouble scalar_product(const Fvector &a, const Fvector &b); +double scalar_product(const Fvector &a, const Fvector &b); /** * Computes the normalized sum of two Fvectors @@ -88,7 +87,7 @@ void normalized_sum(Fvector &r, const Fvector &a, const Fvector &b); * \param z a reference to a z coordinate * \param z a reference to a transformation matrix */ -void convert_coord(gdouble &x, gdouble &y, gdouble &z, Geom::Affine const &trans); +void convert_coord(double &x, double &y, double &z, Geom::Affine const &trans); } /* namespace NR */ diff --git a/src/display/nr-filter-blend.h b/src/display/nr-filter-blend.h index c0504993b..30c9d6725 100644 --- a/src/display/nr-filter-blend.h +++ b/src/display/nr-filter-blend.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_BLEND_H__ -#define __NR_FILTER_BLEND_H__ +#ifndef SEEN_NR_FILTER_BLEND_H +#define SEEN_NR_FILTER_BLEND_H /* * SVG feBlend renderer diff --git a/src/display/nr-filter-colormatrix.h b/src/display/nr-filter-colormatrix.h index c7e5e91d9..cc43f4914 100644 --- a/src/display/nr-filter-colormatrix.h +++ b/src/display/nr-filter-colormatrix.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_COLOR_MATRIX_H__ -#define __NR_FILTER_COLOR_MATRIX_H__ +#ifndef SEEN_NR_FILTER_COLOR_MATRIX_H +#define SEEN_NR_FILTER_COLOR_MATRIX_H /* * feColorMatrix filter primitive renderer @@ -16,6 +16,9 @@ #include <2geom/forward.h> #include "display/nr-filter-primitive.h" +typedef unsigned int guint32; +typedef signed int gint32; + namespace Inkscape { namespace Filters { @@ -40,8 +43,8 @@ public: virtual double complexity(Geom::Affine const &ctm); virtual void set_type(FilterColorMatrixType type); - virtual void set_value(gdouble value); - virtual void set_values(std::vector<gdouble> const &values); + virtual void set_value(double value); + virtual void set_values(std::vector<double> const &values); public: struct ColorMatrixMatrix { @@ -52,8 +55,8 @@ public: }; private: - std::vector<gdouble> values; - gdouble value; + std::vector<double> values; + double value; FilterColorMatrixType type; }; diff --git a/src/display/nr-filter-component-transfer.h b/src/display/nr-filter-component-transfer.h index 558d097a8..7019dde37 100644 --- a/src/display/nr-filter-component-transfer.h +++ b/src/display/nr-filter-component-transfer.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_COMPONENT_TRANSFER_H__ -#define __NR_FILTER_COMPONENT_TRANSFER_H__ +#ifndef SEEN_NR_FILTER_COMPONENT_TRANSFER_H +#define SEEN_NR_FILTER_COMPONENT_TRANSFER_H /* * feComponentTransfer filter primitive renderer @@ -40,7 +40,7 @@ public: virtual double complexity(Geom::Affine const &ctm); FilterComponentTransferType type[4]; - std::vector<gdouble> tableValues[4]; + std::vector<double> tableValues[4]; double slope[4]; double intercept[4]; double amplitude[4]; diff --git a/src/display/nr-filter-composite.h b/src/display/nr-filter-composite.h index 95579cc0e..35756383b 100644 --- a/src/display/nr-filter-composite.h +++ b/src/display/nr-filter-composite.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_COMPOSITE_H__ -#define __NR_FILTER_COMPOSITE_H__ +#ifndef SEEN_NR_FILTER_COMPOSITE_H +#define SEEN_NR_FILTER_COMPOSITE_H /* * feComposite filter effect renderer diff --git a/src/display/nr-filter-convolve-matrix.h b/src/display/nr-filter-convolve-matrix.h index 4041ff96f..d2e38eb95 100644 --- a/src/display/nr-filter-convolve-matrix.h +++ b/src/display/nr-filter-convolve-matrix.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_CONVOLVE_MATRIX_H__ -#define __NR_FILTER_CONVOLVE_MATRIX_H__ +#ifndef SEEN_NR_FILTER_CONVOLVE_MATRIX_H +#define SEEN_NR_FILTER_CONVOLVE_MATRIX_H /* * feConvolveMatrix filter primitive renderer @@ -48,10 +48,10 @@ public: void set_preserveAlpha(bool pa); private: - std::vector<gdouble> kernelMatrix; + std::vector<double> kernelMatrix; int targetX, targetY; int orderX, orderY; - gdouble divisor, bias; + double divisor, bias; int dx, dy, kernelUnitLength; FilterConvolveMatrixEdgeMode edgeMode; bool preserveAlpha; diff --git a/src/display/nr-filter-diffuselighting.h b/src/display/nr-filter-diffuselighting.h index 043a5eb39..7739b3ea6 100644 --- a/src/display/nr-filter-diffuselighting.h +++ b/src/display/nr-filter-diffuselighting.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_DIFFUSELIGHTING_H__ -#define __NR_FILTER_DIFFUSELIGHTING_H__ +#ifndef SEEN_NR_FILTER_DIFFUSELIGHTING_H +#define SEEN_NR_FILTER_DIFFUSELIGHTING_H /* * feDiffuseLighting renderer @@ -13,7 +13,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <gdk/gdk.h> #include "display/nr-light-types.h" #include "display/nr-filter-primitive.h" #include "display/nr-filter-slot.h" @@ -23,6 +22,7 @@ class SPFeDistantLight; class SPFePointLight; class SPFeSpotLight; struct SVGICCColor; +typedef unsigned int guint32; namespace Inkscape { namespace Filters { @@ -43,8 +43,8 @@ public: SPFeSpotLight *spot; } light; LightType light_type; - gdouble diffuseConstant; - gdouble surfaceScale; + double diffuseConstant; + double surfaceScale; guint32 lighting_color; private: diff --git a/src/display/nr-filter-displacement-map.h b/src/display/nr-filter-displacement-map.h index a01930045..c4e2400fe 100644 --- a/src/display/nr-filter-displacement-map.h +++ b/src/display/nr-filter-displacement-map.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_DISPLACEMENT_MAP_H__ -#define __NR_FILTER_DISPLACEMENT_MAP_H__ +#ifndef SEEN_NR_FILTER_DISPLACEMENT_MAP_H +#define SEEN_NR_FILTER_DISPLACEMENT_MAP_H /* * feDisplacementMap filter primitive renderer diff --git a/src/display/nr-filter-flood.h b/src/display/nr-filter-flood.h index 9a968047d..826aa981a 100644 --- a/src/display/nr-filter-flood.h +++ b/src/display/nr-filter-flood.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_FLOOD_H__ -#define __NR_FILTER_FLOOD_H__ +#ifndef SEEN_NR_FILTER_FLOOD_H +#define SEEN_NR_FILTER_FLOOD_H /* * feFlood filter primitive renderer @@ -15,6 +15,7 @@ #include "display/nr-filter-primitive.h" struct SVGICCColor; +typedef unsigned int guint32; namespace Inkscape { namespace Filters { diff --git a/src/display/nr-filter-gaussian.h b/src/display/nr-filter-gaussian.h index 1c35a0f1d..88c38247f 100644 --- a/src/display/nr-filter-gaussian.h +++ b/src/display/nr-filter-gaussian.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_GAUSSIAN_H__ -#define __NR_FILTER_GAUSSIAN_H__ +#ifndef SEEN_NR_FILTER_GAUSSIAN_H +#define SEEN_NR_FILTER_GAUSSIAN_H /* * Gaussian blur renderer diff --git a/src/display/nr-filter-image.h b/src/display/nr-filter-image.h index 69691ac99..147a8ba6c 100644 --- a/src/display/nr-filter-image.h +++ b/src/display/nr-filter-image.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_IMAGE_H__ -#define __NR_FILTER_IMAGE_H__ +#ifndef SEEN_NR_FILTER_IMAGE_H +#define SEEN_NR_FILTER_IMAGE_H /* * feImage filter primitive renderer @@ -34,7 +34,7 @@ public: virtual double complexity(Geom::Affine const &ctm); void set_document( SPDocument *document ); - void set_href(const gchar *href); + void set_href(char const *href); void set_align( unsigned int align ); void set_clip( unsigned int clip ); bool from_element; @@ -42,7 +42,7 @@ public: private: SPDocument *document; - gchar *feImageHref; + char *feImageHref; Inkscape::Pixbuf *image; float feImageX, feImageY, feImageWidth, feImageHeight; unsigned int aspect_align, aspect_clip; diff --git a/src/display/nr-filter-merge.h b/src/display/nr-filter-merge.h index 238f9a3e7..b20d663ab 100644 --- a/src/display/nr-filter-merge.h +++ b/src/display/nr-filter-merge.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_MERGE_H__ -#define __NR_FILTER_MERGE_H__ +#ifndef SEEN_NR_FILTER_MERGE_H +#define SEEN_NR_FILTER_MERGE_H /* * feMerge filter effect renderer diff --git a/src/display/nr-filter-morphology.h b/src/display/nr-filter-morphology.h index 0574ff4ad..cd7dfe775 100644 --- a/src/display/nr-filter-morphology.h +++ b/src/display/nr-filter-morphology.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_MORPHOLOGY_H__ -#define __NR_FILTER_MORPHOLOGY_H__ +#ifndef SEEN_NR_FILTER_MORPHOLOGY_H +#define SEEN_NR_FILTER_MORPHOLOGY_H /* * feMorphology filter primitive renderer diff --git a/src/display/nr-filter-offset.h b/src/display/nr-filter-offset.h index 1ecc1621e..c1ee1d82a 100644 --- a/src/display/nr-filter-offset.h +++ b/src/display/nr-filter-offset.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_OFFSET_H__ -#define __NR_FILTER_OFFSET_H__ +#ifndef SEEN_NR_FILTER_OFFSET_H +#define SEEN_NR_FILTER_OFFSET_H /* * feOffset filter primitive renderer diff --git a/src/display/nr-filter-primitive.h b/src/display/nr-filter-primitive.h index 62f350844..4b7577159 100644 --- a/src/display/nr-filter-primitive.h +++ b/src/display/nr-filter-primitive.h @@ -11,9 +11,9 @@ #ifndef SEEN_NR_FILTER_PRIMITIVE_H #define SEEN_NR_FILTER_PRIMITIVE_H -#include <glib.h> #include <2geom/forward.h> #include <2geom/rect.h> + #include "display/nr-filter-types.h" #include "svg/svg-length.h" @@ -31,7 +31,7 @@ public: virtual ~FilterPrimitive(); virtual void render_cairo(FilterSlot &slot); - virtual int render(FilterSlot & /*slot*/, FilterUnits const & /*units*/) { return 0; } + virtual int render(FilterSlot & /*slot*/, FilterUnits const & /*units*/) { return 0; } // pure virtual? virtual void area_enlarge(Geom::IntRect &area, Geom::Affine const &m); /** diff --git a/src/display/nr-filter-skeleton.h b/src/display/nr-filter-skeleton.h index 049c0df80..e17c244c1 100644 --- a/src/display/nr-filter-skeleton.h +++ b/src/display/nr-filter-skeleton.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_SKELETON_H__ -#define __NR_FILTER_SKELETON_H__ +#ifndef SEEN_NR_FILTER_SKELETON_H +#define SEEN_NR_FILTER_SKELETON_H /* * Filter primitive renderer skeleton class diff --git a/src/display/nr-filter-slot.h b/src/display/nr-filter-slot.h index f3c98b8d9..987dedfd1 100644 --- a/src/display/nr-filter-slot.h +++ b/src/display/nr-filter-slot.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_SLOT_H__ -#define __NR_FILTER_SLOT_H__ +#ifndef SEEN_NR_FILTER_SLOT_H +#define SEEN_NR_FILTER_SLOT_H /* * A container class for filter slots. Allows for simple getting and @@ -15,10 +15,14 @@ */ #include <map> -#include <cairo.h> #include "display/nr-filter-types.h" #include "display/nr-filter-units.h" +extern "C" { +typedef struct _cairo cairo_t; +typedef struct _cairo_surface cairo_surface_t; +} + namespace Inkscape { class DrawingContext; class DrawingItem; diff --git a/src/display/nr-filter-specularlighting.h b/src/display/nr-filter-specularlighting.h index c57e3a9ff..ff9cda450 100644 --- a/src/display/nr-filter-specularlighting.h +++ b/src/display/nr-filter-specularlighting.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_SPECULARLIGHTING_H__ -#define __NR_FILTER_SPECULARLIGHTING_H__ +#ifndef SEEN_NR_FILTER_SPECULARLIGHTING_H +#define SEEN_NR_FILTER_SPECULARLIGHTING_H /* * feSpecularLighting renderer @@ -13,7 +13,6 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <gdk/gdk.h> #include "display/nr-light-types.h" #include "display/nr-filter-primitive.h" @@ -21,6 +20,7 @@ class SPFeDistantLight; class SPFePointLight; class SPFeSpotLight; struct SVGICCColor; +typedef unsigned int guint32; namespace Inkscape { namespace Filters { @@ -44,9 +44,9 @@ public: SPFeSpotLight *spot; } light; LightType light_type; - gdouble surfaceScale; - gdouble specularConstant; - gdouble specularExponent; + double surfaceScale; + double specularConstant; + double specularExponent; guint32 lighting_color; private: diff --git a/src/display/nr-filter-tile.h b/src/display/nr-filter-tile.h index dc5b99a42..29087f2d6 100644 --- a/src/display/nr-filter-tile.h +++ b/src/display/nr-filter-tile.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_TILE_H__ -#define __NR_FILTER_TILE_H__ +#ifndef SEEN_NR_FILTER_TILE_H +#define SEEN_NR_FILTER_TILE_H /* * feTile filter primitive renderer diff --git a/src/display/nr-filter-turbulence.h b/src/display/nr-filter-turbulence.h index 360853364..ee8079133 100644 --- a/src/display/nr-filter-turbulence.h +++ b/src/display/nr-filter-turbulence.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_TURBULENCE_H__ -#define __NR_FILTER_TURBULENCE_H__ +#ifndef SEEN_NR_FILTER_TURBULENCE_H +#define SEEN_NR_FILTER_TURBULENCE_H /* * feTurbulence filter primitive renderer @@ -22,6 +22,7 @@ */ #include <2geom/point.h> + #include "display/nr-filter-primitive.h" #include "display/nr-filter-slot.h" #include "display/nr-filter-units.h" diff --git a/src/display/nr-filter-types.h b/src/display/nr-filter-types.h index 502bfe348..2e35d6da8 100644 --- a/src/display/nr-filter-types.h +++ b/src/display/nr-filter-types.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_TYPES_H__ -#define __NR_FILTER_TYPES_H__ +#ifndef SEEN_NR_FILTER_TYPES_H +#define SEEN_NR_FILTER_TYPES_H namespace Inkscape { namespace Filters { diff --git a/src/display/nr-filter-units.h b/src/display/nr-filter-units.h index f918cf12e..0ee6c3707 100644 --- a/src/display/nr-filter-units.h +++ b/src/display/nr-filter-units.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_UNITS_H__ -#define __NR_FILTER_UNITS_H__ +#ifndef SEEN_NR_FILTER_UNITS_H +#define SEEN_NR_FILTER_UNITS_H /* * Utilities for handling coordinate system transformations in filters diff --git a/src/display/nr-filter-utils.h b/src/display/nr-filter-utils.h index 7e073168f..35a74d7c1 100644 --- a/src/display/nr-filter-utils.h +++ b/src/display/nr-filter-utils.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_UTILS_H__ -#define __NR_FILTER_UTILS_H__ +#ifndef SEEN_NR_FILTER_UTILS_H +#define SEEN_NR_FILTER_UTILS_H /** * @file @@ -26,7 +26,6 @@ namespace Filters { * \return 0 if the value is smaller than 0, 255 if it is greater 255, else v * \param v the value to clamp */ -__attribute__ ((const)) inline int clamp(int const val) { if (val < 0) return 0; if (val > 255) return 255; @@ -39,7 +38,6 @@ inline int clamp(int const val) { * \return 0 if the value is smaller than 0, 255^3 (16581375) if it is greater than 255^3, else v * \param v the value to clamp */ -__attribute__ ((const)) inline int clamp3(int const val) { if (val < 0) return 0; if (val > 16581375) return 16581375; @@ -59,7 +57,6 @@ inline int clamp3(int const val) { * \param val the value to clamp * \param alpha the maximum value to clamp to */ -__attribute__ ((const)) inline int clamp_alpha(int const val, int const alpha) { if (val < 0) return 0; if (val > alpha) return alpha; diff --git a/src/display/nr-filter.h b/src/display/nr-filter.h index f9dcf1d84..9a30efabd 100644 --- a/src/display/nr-filter.h +++ b/src/display/nr-filter.h @@ -1,5 +1,5 @@ -#ifndef __NR_FILTER_H__ -#define __NR_FILTER_H__ +#ifndef SEEN_NR_FILTER_H +#define SEEN_NR_FILTER_H /* * SVG filters rendering diff --git a/src/display/nr-light-types.h b/src/display/nr-light-types.h index 5c9acb324..8cc92db77 100644 --- a/src/display/nr-light-types.h +++ b/src/display/nr-light-types.h @@ -1,5 +1,5 @@ -#ifndef __NR_LIGHT_TYPES_H__ -#define __NR_LIGHT_TYPES_H__ +#ifndef SEEN_NR_LIGHT_TYPES_H +#define SEEN_NR_LIGHT_TYPES_H namespace Inkscape { namespace Filters { diff --git a/src/display/nr-light.cpp b/src/display/nr-light.cpp index 6331d1546..0e9a55a9f 100644 --- a/src/display/nr-light.cpp +++ b/src/display/nr-light.cpp @@ -51,7 +51,7 @@ PointLight::PointLight(SPFePointLight *light, guint32 lighting_color, const Geom PointLight::~PointLight() {} -void PointLight::light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z) { +void PointLight::light_vector(NR::Fvector &v, double x, double y, double z) { v[X_3D] = l_x - x; v[Y_3D] = l_y - y; v[Z_3D] = l_z - z; @@ -65,7 +65,7 @@ void PointLight::light_components(NR::Fvector &lc) { } SpotLight::SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::Affine &trans) { - gdouble p_x, p_y, p_z; + double p_x, p_y, p_z; color = lighting_color; l_x = light->x; l_y = light->y; @@ -86,7 +86,7 @@ SpotLight::SpotLight(SPFeSpotLight *light, guint32 lighting_color, const Geom::A SpotLight::~SpotLight() {} -void SpotLight::light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z) { +void SpotLight::light_vector(NR::Fvector &v, double x, double y, double z) { v[X_3D] = l_x - x; v[Y_3D] = l_y - y; v[Z_3D] = l_z - z; @@ -94,7 +94,7 @@ void SpotLight::light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z) { } void SpotLight::light_components(NR::Fvector &lc, const NR::Fvector &L) { - gdouble spmod = (-1) * NR::scalar_product(L, S); + double spmod = (-1) * NR::scalar_product(L, S); if (spmod <= cos_lca) spmod = 0; else diff --git a/src/display/nr-light.h b/src/display/nr-light.h index 0c1235483..94b573761 100644 --- a/src/display/nr-light.h +++ b/src/display/nr-light.h @@ -1,5 +1,6 @@ -#ifndef __NR_LIGHT_H__ -#define __NR_LIGHT_H__ +#ifndef SEEN_NR_LIGHT_H +#define SEEN_NR_LIGHT_H + /** \file * These classes provide tools to compute interesting objects relative to light * sources. Each class provides a constructor converting information contained @@ -8,14 +9,15 @@ * light color components (at a given point). */ -#include <gdk/gdk.h> +#include <2geom/forward.h> + #include "display/nr-3dutils.h" #include "display/nr-light-types.h" -#include <2geom/forward.h> class SPFeDistantLight; class SPFePointLight; class SPFeSpotLight; +typedef unsigned int guint32; namespace Inkscape { namespace Filters { @@ -53,8 +55,8 @@ class DistantLight { private: guint32 color; - gdouble azimuth; //azimuth in rad - gdouble elevation; //elevation in rad + double azimuth; //azimuth in rad + double elevation; //elevation in rad }; class PointLight { @@ -80,7 +82,7 @@ class PointLight { * \param y y coordinate of the current point * \param z z coordinate of the current point */ - void light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z); + void light_vector(NR::Fvector &v, double x, double y, double z); /** * Computes the light components of the distant light @@ -92,9 +94,9 @@ class PointLight { private: guint32 color; //light position coordinates in render setting - gdouble l_x; - gdouble l_y; - gdouble l_z; + double l_x; + double l_y; + double l_z; }; class SpotLight { @@ -121,7 +123,7 @@ class SpotLight { * \param y y coordinate of the current point * \param z z coordinate of the current point */ - void light_vector(NR::Fvector &v, gdouble x, gdouble y, gdouble z); + void light_vector(NR::Fvector &v, double x, double y, double z); /** * Computes the light components of the distant light at the current @@ -135,11 +137,11 @@ class SpotLight { private: guint32 color; //light position coordinates in render setting - gdouble l_x; - gdouble l_y; - gdouble l_z; - gdouble cos_lca; //cos of the limiting cone angle - gdouble speExp; //specular exponent; + double l_x; + double l_y; + double l_z; + double cos_lca; //cos of the limiting cone angle + double speExp; //specular exponent; NR::Fvector S; //unit vector from light position in the direction //the spot point at }; diff --git a/src/display/nr-svgfonts.h b/src/display/nr-svgfonts.h index e1bb047bb..21ab3ed02 100644 --- a/src/display/nr-svgfonts.h +++ b/src/display/nr-svgfonts.h @@ -1,4 +1,3 @@ -#include "config.h" #ifndef NR_SVGFONTS_H_SEEN #define NR_SVGFONTS_H_SEEN /* @@ -13,7 +12,7 @@ * Read the file 'COPYING' for more information. */ -#include "cairo.h" +#include <cairo.h> #include <sigc++/connection.h> class SvgFont; @@ -21,40 +20,50 @@ class SPFont; class SPGlyph; class SPMissingGlyph; -struct _GdkEventExpose; -typedef _GdkEventExpose GdkEventExpose; +extern "C" { typedef struct _GdkEventExpose GdkEventExpose; } namespace Gtk { class Widget; } -class UserFont{ +class UserFont { public: -UserFont(SvgFont* instance); -cairo_font_face_t* face; + UserFont(SvgFont* instance); + cairo_font_face_t* face; }; -class SvgFont{ +class SvgFont { public: -SvgFont(SPFont* spfont); -void refresh(); -cairo_font_face_t* get_font_face(); -cairo_status_t scaled_font_init (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *metrics); -cairo_status_t scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, const char *utf8, int utf8_len, cairo_glyph_t **glyphs, int *num_glyphs, cairo_text_cluster_t **clusters, int *num_clusters, cairo_text_cluster_flags_t *flags); -cairo_status_t scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *metrics); + SvgFont(SPFont* spfont); + void refresh(); + cairo_font_face_t* get_font_face(); + cairo_status_t scaled_font_init (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *metrics); + cairo_status_t scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, const char *utf8, int utf8_len, cairo_glyph_t **glyphs, int *num_glyphs, cairo_text_cluster_t **clusters, int *num_clusters, cairo_text_cluster_flags_t *flags); + cairo_status_t scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *metrics); -Geom::PathVector flip_coordinate_system(SPFont* spfont, Geom::PathVector pathv); -void render_glyph_path(cairo_t* cr, Geom::PathVector* pathv); -void glyph_modified(SPObject *, unsigned int); + Geom::PathVector flip_coordinate_system(SPFont* spfont, Geom::PathVector pathv); + void render_glyph_path(cairo_t* cr, Geom::PathVector* pathv); + void glyph_modified(SPObject *, unsigned int); private: -SPFont* font; -UserFont* userfont; -std::vector<SPGlyph*> glyphs; -SPMissingGlyph* missingglyph; -sigc::connection glyph_modified_connection; + SPFont* font; + UserFont* userfont; + std::vector<SPGlyph*> glyphs; + SPMissingGlyph* missingglyph; + sigc::connection glyph_modified_connection; -bool drawing_expose_cb (Gtk::Widget *widget, GdkEventExpose *event, gpointer data); + bool drawing_expose_cb (Gtk::Widget *widget, GdkEventExpose *event, void* data); }; #endif //#ifndef NR_SVGFONTS_H_SEEN + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 : diff --git a/src/display/sp-canvas-item.h b/src/display/sp-canvas-item.h index a388ffa91..3b7b7bd4f 100644 --- a/src/display/sp-canvas-item.h +++ b/src/display/sp-canvas-item.h @@ -23,8 +23,9 @@ # include "config.h" #endif -#include <glib-object.h> #include <2geom/rect.h> +#include <glib-object.h> + #include "ui/control-types.h" G_BEGIN_DECLS diff --git a/src/display/sp-canvas-util.h b/src/display/sp-canvas-util.h index 07323f31a..73135ed79 100644 --- a/src/display/sp-canvas-util.h +++ b/src/display/sp-canvas-util.h @@ -1,5 +1,5 @@ -#ifndef __SP_CANVAS_UTILS_H__ -#define __SP_CANVAS_UTILS_H__ +#ifndef SEEN_SP_CANVAS_UTILS_H +#define SEEN_SP_CANVAS_UTILS_H /* * Helper stuff for SPCanvas @@ -19,7 +19,7 @@ struct SPCanvasItem; struct SPCanvasBuf; namespace Geom { - class Affine; + class Affine; } /* Miscellaneous utility & convenience functions for general canvas objects */ diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h index adae30f35..48c3de2fc 100644 --- a/src/display/sp-canvas.h +++ b/src/display/sp-canvas.h @@ -22,15 +22,6 @@ # include "config.h" #endif -#ifdef HAVE_INTTYPES_H -# include <inttypes.h> -#else -# ifdef HAVE_STDINT_H -# include <stdint.h> -# endif -#endif - -#include <gdk/gdk.h> #include <gtk/gtk.h> #include <glibmm/ustring.h> #include <2geom/affine.h> diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 70a2ca672..cac11031f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -26,7 +26,7 @@ #include "desktop-handles.h" #include "desktop.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "extension/effect.h" #include "extension/output.h" #include "extension/input.h" diff --git a/src/extension/internal/bitmap/crop.cpp b/src/extension/internal/bitmap/crop.cpp index 0e633afd6..02d92668b 100644 --- a/src/extension/internal/bitmap/crop.cpp +++ b/src/extension/internal/bitmap/crop.cpp @@ -74,7 +74,7 @@ Crop::init(void) "<effects-menu>\n" "<submenu name=\"" N_("Raster") "\" />\n" "</effects-menu>\n" - "<menu-tip>" N_("Crop selected bitmap(s).") "</menu-tip>\n" + "<menu-tip>" N_("Crop selected bitmap(s)") "</menu-tip>\n" "</effect>\n" "</inkscape-extension>\n", new Crop()); } diff --git a/src/extension/internal/bitmap/opacity.cpp b/src/extension/internal/bitmap/opacity.cpp index 742cb7019..f9b4bbc27 100644 --- a/src/extension/internal/bitmap/opacity.cpp +++ b/src/extension/internal/bitmap/opacity.cpp @@ -43,7 +43,7 @@ Opacity::init(void) "<effects-menu>\n" "<submenu name=\"" N_("Raster") "\" />\n" "</effects-menu>\n" - "<menu-tip>" N_("Modify opacity channel(s) of selected bitmap(s).") "</menu-tip>\n" + "<menu-tip>" N_("Modify opacity channel(s) of selected bitmap(s)") "</menu-tip>\n" "</effect>\n" "</inkscape-extension>\n", new Opacity()); } diff --git a/src/extension/internal/cdr-input.cpp b/src/extension/internal/cdr-input.cpp index b8f429a87..239c99688 100644 --- a/src/extension/internal/cdr-input.cpp +++ b/src/extension/internal/cdr-input.cpp @@ -40,7 +40,7 @@ #include "document-undo.h" #include "inkscape.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include <gtk/gtk.h> #include "ui/widget/spinbutton.h" #include "ui/widget/frame.h" diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 63581bd8a..b2bf61321 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -48,7 +48,7 @@ #include "inkscape.h" #include "util/units.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include <gtk/gtk.h> #include "ui/widget/spinbutton.h" #include "ui/widget/frame.h" diff --git a/src/extension/internal/vsd-input.cpp b/src/extension/internal/vsd-input.cpp index 83bfb5a92..302a3a6f9 100644 --- a/src/extension/internal/vsd-input.cpp +++ b/src/extension/internal/vsd-input.cpp @@ -41,7 +41,7 @@ #include "inkscape.h" #include "util/units.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include <gtk/gtk.h> #include "ui/widget/spinbutton.h" #include "ui/widget/frame.h" diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index d1f83701f..af31f32b6 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -13,7 +13,7 @@ #include <gtkmm/separator.h> #include <glibmm/i18n.h> -#include "../dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "xml/repr.h" // Used to get SP_ACTIVE_DESKTOP diff --git a/src/filters/distantlight.h b/src/filters/distantlight.h index 0eebf768f..6490d987c 100644 --- a/src/filters/distantlight.h +++ b/src/filters/distantlight.h @@ -27,21 +27,21 @@ public: virtual ~SPFeDistantLight(); /** azimuth attribute */ - gfloat azimuth; - guint azimuth_set : 1; + float azimuth; + unsigned int azimuth_set : 1; /** elevation attribute */ - gfloat elevation; - guint elevation_set : 1; + float elevation; + unsigned int elevation_set : 1; protected: virtual void build(SPDocument* doc, Inkscape::XML::Node* repr); virtual void release(); - virtual void set(unsigned int key, const gchar* value); + virtual void set(unsigned int key, char const* value); virtual void update(SPCtx* ctx, unsigned int flags); - virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags); + virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags); }; #endif /* !SP_FEDISTANTLIGHT_H_SEEN */ diff --git a/src/filters/pointlight.h b/src/filters/pointlight.h index 3819d8ff5..1e26d45e7 100644 --- a/src/filters/pointlight.h +++ b/src/filters/pointlight.h @@ -26,24 +26,24 @@ public: virtual ~SPFePointLight(); /** x coordinate of the light source */ - gfloat x; - guint x_set : 1; + float x; + unsigned int x_set : 1; /** y coordinate of the light source */ - gfloat y; - guint y_set : 1; + float y; + unsigned int y_set : 1; /** z coordinate of the light source */ - gfloat z; - guint z_set : 1; + float z; + unsigned int z_set : 1; protected: virtual void build(SPDocument* doc, Inkscape::XML::Node* repr); virtual void release(); - virtual void set(unsigned int key, const gchar* value); + virtual void set(unsigned int key, char const* value); virtual void update(SPCtx* ctx, unsigned int flags); - virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags); + virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags); }; #endif /* !SP_FEPOINTLIGHT_H_SEEN */ diff --git a/src/filters/spotlight.h b/src/filters/spotlight.h index 8caf12858..7d5f6dd30 100644 --- a/src/filters/spotlight.h +++ b/src/filters/spotlight.h @@ -26,40 +26,40 @@ public: virtual ~SPFeSpotLight(); /** x coordinate of the light source */ - gfloat x; - guint x_set : 1; + float x; + unsigned int x_set : 1; /** y coordinate of the light source */ - gfloat y; - guint y_set : 1; + float y; + unsigned int y_set : 1; /** z coordinate of the light source */ - gfloat z; - guint z_set : 1; + float z; + unsigned int z_set : 1; /** x coordinate of the point the source is pointing at */ - gfloat pointsAtX; - guint pointsAtX_set : 1; + float pointsAtX; + unsigned int pointsAtX_set : 1; /** y coordinate of the point the source is pointing at */ - gfloat pointsAtY; - guint pointsAtY_set : 1; + float pointsAtY; + unsigned int pointsAtY_set : 1; /** z coordinate of the point the source is pointing at */ - gfloat pointsAtZ; - guint pointsAtZ_set : 1; + float pointsAtZ; + unsigned int pointsAtZ_set : 1; /** specular exponent (focus of the light) */ - gfloat specularExponent; - guint specularExponent_set : 1; + float specularExponent; + unsigned int specularExponent_set : 1; /** limiting cone angle */ - gfloat limitingConeAngle; - guint limitingConeAngle_set : 1; + float limitingConeAngle; + unsigned int limitingConeAngle_set : 1; //other fields protected: virtual void build(SPDocument* doc, Inkscape::XML::Node* repr); virtual void release(); - virtual void set(unsigned int key, const gchar* value); + virtual void set(unsigned int key, char const* value); virtual void update(SPCtx* ctx, unsigned int flags); - virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags); + virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags); }; #endif /* !SP_FESPOTLIGHT_H_SEEN */ diff --git a/src/interface.cpp b/src/interface.cpp index 9f7ee52cd..591887c3d 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -57,7 +57,7 @@ #include "helper/gnome-utils.h" #include "helper/window.h" #include "io/sys.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "message-context.h" #include "ui/uxmanager.h" #include "ui/clipboard.h" diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp index 973db0165..7eb53446f 100644 --- a/src/libnrtype/Layout-TNG-Compute.cpp +++ b/src/libnrtype/Layout-TNG-Compute.cpp @@ -854,6 +854,8 @@ void Layout::Calculator::BrokenSpan::setZero() end_glyph_index = start_glyph_index = 0; ends_with_whitespace = false; each_whitespace_width = 0.0; + letter_spacing = 0.0; + word_spacing = 0.0; } template<typename T> void Layout::Calculator::ParagraphInfo::free_sequence(T &seq) diff --git a/src/live_effects/lpe-interpolate_points.cpp b/src/live_effects/lpe-interpolate_points.cpp index 865b46ca7..4ac139752 100644 --- a/src/live_effects/lpe-interpolate_points.cpp +++ b/src/live_effects/lpe-interpolate_points.cpp @@ -40,7 +40,7 @@ LPEInterpolatePoints::LPEInterpolatePoints(LivePathEffectObject *lpeobject) { show_orig_path = false; - registerParameter( dynamic_cast<Parameter *>(&interpolator_type) ); + registerParameter( &interpolator_type ); } LPEInterpolatePoints::~LPEInterpolatePoints() diff --git a/src/prefix.cpp b/src/prefix.cpp index 630d6caa8..6bf5cb2cf 100644 --- a/src/prefix.cpp +++ b/src/prefix.cpp @@ -186,7 +186,7 @@ br_locate_prefix (void *symbol) * br_prepend_prefix (&argc, "/share/foo/data.png"); --> Returns "/usr/share/foo/data.png" */ char * -br_prepend_prefix (void *symbol, char *path) +br_prepend_prefix (void *symbol, char const *path) { char *tmp, *newpath; diff --git a/src/prefix.h b/src/prefix.h index af96fa746..7c5a1fd3c 100644 --- a/src/prefix.h +++ b/src/prefix.h @@ -80,7 +80,7 @@ extern "C" { const char *br_thread_local_store (char *str); char *br_locate (void *symbol); char *br_locate_prefix (void *symbol); -char *br_prepend_prefix (void *symbol, char *path); +char *br_prepend_prefix (void *symbol, char const *path); #endif /* ENABLE_BINRELOC */ diff --git a/src/proj_pt.cpp b/src/proj_pt.cpp index f5cca8fca..311b9a034 100644 --- a/src/proj_pt.cpp +++ b/src/proj_pt.cpp @@ -9,12 +9,14 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +#include <glib.h> + #include "proj_pt.h" #include "svg/stringstream.h" namespace Proj { -Pt2::Pt2(const gchar *coord_str) { +Pt2::Pt2(const char *coord_str) { if (!coord_str) { pt[0] = 0.0; pt[1] = 0.0; @@ -22,7 +24,7 @@ Pt2::Pt2(const gchar *coord_str) { g_warning ("Coordinate string is empty. Creating default Pt2\n"); return; } - gchar **coords = g_strsplit(coord_str, ":", 0); + char **coords = g_strsplit(coord_str, ":", 0); if (coords[0] == NULL || coords[1] == NULL || coords[2] == NULL) { g_strfreev (coords); g_warning ("Malformed coordinate string.\n"); @@ -52,7 +54,7 @@ Pt2::affine() { return Geom::Point (pt[0]/pt[2], pt[1]/pt[2]); } -gchar * +char * Pt2::coord_string() { Inkscape::SVGOStringStream os; os << pt[0] << " : " @@ -61,7 +63,7 @@ Pt2::coord_string() { return g_strdup(os.str().c_str()); } -Pt3::Pt3(const gchar *coord_str) { +Pt3::Pt3(const char *coord_str) { if (!coord_str) { pt[0] = 0.0; pt[1] = 0.0; @@ -70,7 +72,7 @@ Pt3::Pt3(const gchar *coord_str) { g_warning ("Coordinate string is empty. Creating default Pt2\n"); return; } - gchar **coords = g_strsplit(coord_str, ":", 0); + char **coords = g_strsplit(coord_str, ":", 0); if (coords[0] == NULL || coords[1] == NULL || coords[2] == NULL || coords[3] == NULL) { g_strfreev (coords); @@ -94,7 +96,7 @@ Pt3::normalize() { pt[3] = 1.0; } -gchar * +char * Pt3::coord_string() { Inkscape::SVGOStringStream os; os << pt[0] << " : " diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 67a0eac13..c3cbe531f 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -256,9 +256,13 @@ void SPItem::setCenter(Geom::Point const &object_centre) { document->ensureUpToDate(); // Copied from DocumentProperties::onDocUnitChange() - gdouble viewscale_w = this->document->getWidth().value("px") / this->document->getRoot()->viewBox.width(); - gdouble viewscale_h = this->document->getHeight().value("px")/ this->document->getRoot()->viewBox.height(); - gdouble viewscale = std::min(viewscale_h, viewscale_w); + gdouble viewscale = 1.0; + Geom::Rect vb = this->document->getRoot()->viewBox; + if ( !vb.hasZeroArea() ) { + gdouble viewscale_w = this->document->getWidth().value("px") / vb.width(); + gdouble viewscale_h = this->document->getHeight().value("px")/ vb.height(); + viewscale = std::min(viewscale_h, viewscale_w); + } // FIXME this is seriously wrong Geom::OptRect bbox = desktopGeometricBounds(); @@ -289,9 +293,13 @@ Geom::Point SPItem::getCenter() const { document->ensureUpToDate(); // Copied from DocumentProperties::onDocUnitChange() - gdouble viewscale_w = this->document->getWidth().value("px") / this->document->getRoot()->viewBox.width(); - gdouble viewscale_h = this->document->getHeight().value("px")/ this->document->getRoot()->viewBox.height(); - gdouble viewscale = std::min(viewscale_h, viewscale_w); + gdouble viewscale = 1.0; + Geom::Rect vb = this->document->getRoot()->viewBox; + if ( !vb.hasZeroArea() ) { + gdouble viewscale_w = this->document->getWidth().value("px") / vb.width(); + gdouble viewscale_h = this->document->getHeight().value("px")/ vb.height(); + viewscale = std::min(viewscale_h, viewscale_w); + } // FIXME this is seriously wrong Geom::OptRect bbox = desktopGeometricBounds(); diff --git a/src/svg/css-ostringstream.h b/src/svg/css-ostringstream.h index 8cedb0979..2c66dff16 100644 --- a/src/svg/css-ostringstream.h +++ b/src/svg/css-ostringstream.h @@ -1,7 +1,6 @@ #ifndef SVG_CSS_OSTRINGSTREAM_H_INKSCAPE #define SVG_CSS_OSTRINGSTREAM_H_INKSCAPE -#include <glib.h> #include <sstream> namespace Inkscape { @@ -42,8 +41,8 @@ public: #undef INK_CSS_STR_OP - gchar const *gcharp() const { - return reinterpret_cast<gchar const *>(ostr.str().c_str()); + char const *gcharp() const { + return ostr.str().c_str(); } std::string str() const { diff --git a/src/svg/path-string.h b/src/svg/path-string.h index 3a891873d..6c7e23017 100644 --- a/src/svg/path-string.h +++ b/src/svg/path-string.h @@ -15,10 +15,10 @@ #ifndef SEEN_INKSCAPE_SVG_PATH_STRING_H #define SEEN_INKSCAPE_SVG_PATH_STRING_H +#include <2geom/point.h> +#include <cstdio> #include <glibmm/ustring.h> #include <string> -#include <stdio.h> -#include <2geom/point.h> namespace Inkscape { diff --git a/src/svg/stringstream.h b/src/svg/stringstream.h index d143abee8..c9cfdd601 100644 --- a/src/svg/stringstream.h +++ b/src/svg/stringstream.h @@ -1,7 +1,6 @@ #ifndef INKSCAPE_STRINGSTREAM_H #define INKSCAPE_STRINGSTREAM_H -#include <glib.h> #include <sstream> #include <string> @@ -41,8 +40,8 @@ public: #undef INK_SVG_STR_OP - gchar const *gcharp() const { - return reinterpret_cast<gchar const *>(ostr.str().c_str()); + char const *gcharp() const { + return ostr.str().c_str(); } std::string str() const { diff --git a/src/svg/svg-color.h b/src/svg/svg-color.h index b8e317e3b..ea0896872 100644 --- a/src/svg/svg-color.h +++ b/src/svg/svg-color.h @@ -1,16 +1,15 @@ #ifndef SVG_SVG_COLOR_H_SEEN #define SVG_SVG_COLOR_H_SEEN -#include <glib.h> - +typedef unsigned int guint32; struct SVGICCColor; -guint32 sp_svg_read_color(gchar const *str, unsigned int dfl); -guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def); +guint32 sp_svg_read_color(char const *str, unsigned int dfl); +guint32 sp_svg_read_color(char const *str, char const **end_ptr, guint32 def); void sp_svg_write_color(char *buf, unsigned int buflen, unsigned int rgba32); -bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor* dest ); -bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ); -void icc_color_to_sRGB(SVGICCColor* dest, guchar* r, guchar* g, guchar* b); +bool sp_svg_read_icc_color( char const *str, char const **end_ptr, SVGICCColor* dest ); +bool sp_svg_read_icc_color( char const *str, SVGICCColor* dest ); +void icc_color_to_sRGB(SVGICCColor* dest, unsigned char* r, unsigned char* g, unsigned char* b); #endif /* !SVG_SVG_COLOR_H_SEEN */ diff --git a/src/svg/svg.h b/src/svg/svg.h index a7795b82e..6ce9db937 100644 --- a/src/svg/svg.h +++ b/src/svg/svg.h @@ -11,7 +11,7 @@ * * Released under GNU GPL, read the file 'COPYING' for more information */ -#include <glib.h> + #include <vector> #include <cstring> #include <string> @@ -28,13 +28,13 @@ * Return FALSE and let val untouched on error */ -unsigned int sp_svg_number_read_f( const gchar *str, float *val ); -unsigned int sp_svg_number_read_d( const gchar *str, double *val ); +unsigned int sp_svg_number_read_f( const char *str, float *val ); +unsigned int sp_svg_number_read_d( const char *str, double *val ); /* * No buffer overflow checking is done, so better wrap them if needed */ -unsigned int sp_svg_number_write_de( gchar *buf, int bufLen, double val, unsigned int tprec, int min_exp ); +unsigned int sp_svg_number_write_de( char *buf, int bufLen, double val, unsigned int tprec, int min_exp ); /* Length */ @@ -47,24 +47,24 @@ unsigned int sp_svg_number_write_de( gchar *buf, int bufLen, double val, unsigne * Any return value pointer can be NULL */ -unsigned int sp_svg_length_read_computed_absolute( const gchar *str, float *length ); -std::vector<SVGLength> sp_svg_length_list_read( const gchar *str ); -unsigned int sp_svg_length_read_ldd( const gchar *str, SVGLength::Unit *unit, double *value, double *computed ); +unsigned int sp_svg_length_read_computed_absolute( const char *str, float *length ); +std::vector<SVGLength> sp_svg_length_list_read( const char *str ); +unsigned int sp_svg_length_read_ldd( const char *str, SVGLength::Unit *unit, double *value, double *computed ); std::string sp_svg_length_write_with_units(SVGLength const &length); -bool sp_svg_transform_read(gchar const *str, Geom::Affine *transform); +bool sp_svg_transform_read(char const *str, Geom::Affine *transform); -gchar *sp_svg_transform_write(Geom::Affine const &transform); -gchar *sp_svg_transform_write(Geom::Affine const *transform); +char *sp_svg_transform_write(Geom::Affine const &transform); +char *sp_svg_transform_write(Geom::Affine const *transform); double sp_svg_read_percentage( const char * str, double def ); /* NB! As paths can be long, we use here dynamic string */ Geom::PathVector sp_svg_read_pathv( char const * str ); -gchar * sp_svg_write_path( Geom::PathVector const &p ); -gchar * sp_svg_write_path( Geom::Path const &p ); +char * sp_svg_write_path( Geom::PathVector const &p ); +char * sp_svg_write_path( Geom::Path const &p ); #endif // SEEN_SP_SVG_H diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 125755c48..56908f58e 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -2,6 +2,7 @@ set(ui_SRC clipboard.cpp control-manager.cpp + dialog-events.cpp previewholder.cpp uxmanager.cpp @@ -156,6 +157,7 @@ set(ui_SRC clipboard.h control-manager.h control-types.h + dialog-events.h icon-names.h previewable.h previewfillable.h diff --git a/src/ui/Makefile_insert b/src/ui/Makefile_insert index 4081f86f8..94064d0cf 100644 --- a/src/ui/Makefile_insert +++ b/src/ui/Makefile_insert @@ -6,6 +6,8 @@ ink_common_sources += \ ui/control-manager.cpp \ ui/control-manager.h \ ui/control-types.h \ + ui/dialog-events.cpp \ + ui/dialog-events.h \ ui/icon-names.h \ ui/previewable.h \ ui/previewfillable.h \ diff --git a/src/dialogs/dialog-events.cpp b/src/ui/dialog-events.cpp index cf3497c9b..6bd93bbc3 100644 --- a/src/dialogs/dialog-events.cpp +++ b/src/ui/dialog-events.cpp @@ -29,7 +29,7 @@ #include "preferences.h" #include "ui/tools/tool-base.h" -#include "dialog-events.h" +#include "ui/dialog-events.h" /** diff --git a/src/dialogs/dialog-events.h b/src/ui/dialog-events.h index b33eb3f38..b33eb3f38 100644 --- a/src/dialogs/dialog-events.h +++ b/src/ui/dialog-events.h diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index 44ed3b58f..7212fa372 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -254,6 +254,7 @@ void AboutBox::initStrings() { "Nicholas Bishop\n" "Joshua L. Blocher\n" "Hanno Böck\n" +"Tomasz Boczkowski\n" "Henrik Bohre\n" "Boldewyn\n" "Daniel Borgmann\n" @@ -270,6 +271,7 @@ void AboutBox::initStrings() { "Gail Carmichael\n" "Ed Catmur\n" "Chema Celorio\n" +"Jabiertxo Arraiza Cenoz\n" "Johan Ceuppens\n" "Zbigniew Chyla\n" "Alexander Clausen\n" @@ -311,6 +313,7 @@ void AboutBox::initStrings() { "Hannes Hochreiner\n" "Thomas Holder\n" "Joel Holdsworth\n" +"Christoffer Holmstedt\n" "Alan Horkan\n" "Karl Ove Hufthammer\n" "Richard Hughes\n" @@ -319,6 +322,7 @@ void AboutBox::initStrings() { "Thomas Ingham\n" "Jean-Olivier Irisson\n" "Bob Jamison\n" +"Ted Janeczko\n" "jEsuSdA\n" "Fernando Lucchesi Bastos Jurema\n" "Lauris Kaplinski\n" @@ -342,7 +346,9 @@ void AboutBox::initStrings() { "Aurel-Aimé Marmion\n" "Colin Marquardt\n" "Craig Marshall\n" +"Ivan Masár\n" "Dmitry G. Mastrukov\n" +"David Mathog\n" "Matiphas\n" "Michael Meeks\n" "Federico Mena\n" @@ -360,8 +366,10 @@ void AboutBox::initStrings() { "Nick\n" "Andreas Nilsson\n" "Mitsuru Oka\n" +"Vinícius dos Santos Oliveira\n" "Martin Owens\n" "Alvin Penner\n" +"Matthew Petroff\n" "Jon Phillips\n" "Zdenko Podobny\n" "Alexandre Prokoudine\n" @@ -398,6 +406,8 @@ void AboutBox::initStrings() { "Joakim Verona\n" "Lucas Vieites\n" "Daniel Wagenaar\n" +"Liam P. White\n" +"Sebastian Wüst\n" "Michael Wybrow\n" "Gellule Xg\n" "Daniel Yacob\n" @@ -482,6 +492,7 @@ void AboutBox::initStrings() { "Elias Norberg <elno0959 at student.su.se>, 2009.\n" "Equipe de Tradução Inkscape Brasil <www.inkscapebrasil.org>, 2007.\n" "Fatih Demir <kabalak@gtranslator.org>, 2000.\n" +"Firas Hanife <FirasHanife@gmail.com>, 2014.\n" "Foppe Benedictus <foppe.benedictus@gmail.com>, 2007-2009.\n" "Francesc Dorca <f.dorca@filnet.es>, 2003. Traducció sodipodi.\n" "Francisco Javier F. Serrador <serrador@arrakis.es>, 2003.\n" @@ -493,8 +504,9 @@ void AboutBox::initStrings() { "Hizkuntza Politikarako Sailburuordetza <hizkpol@ej-gv.es>, 2005.\n" "Ilia Penev <lichopicho@gmail.com>, 2006.\n" "Ivan Masár <helix84@centrum.sk>, 2006-2010. \n" +"Ivan Řihošek <irihosek@seznam.cz>, 2014.\n" "Iñaki Larrañaga <dooteo@euskalgnu.org>, 2006.\n" -"Jānis Eisaks <jancs@dv.lv>, 2012, 2013.\n" +"Jānis Eisaks <jancs@dv.lv>, 2012-2014.\n" "Jeffrey Steve Borbón Sanabria <jeff_kerokid@yahoo.com>, 2005.\n" "Jesper Öqvist <jesper@llbit.se>, 2010, 2011.\n" "Joaquim Perez i Noguer <noguer@gmail.com>, 2008-2009.\n" @@ -516,7 +528,7 @@ void AboutBox::initStrings() { "Kingsley Turner <kingsley@maddogsbreakfast.com.au>, 2006.\n" "Kitae <bluetux@gmail.com>, 2006.\n" "Kjartan Maraas <kmaraas@gnome.org>, 2000-2002.\n" -"Kris De Gussem <Kris.DeGussem@gmail.com>, 2008-2013.\n" +"Kris De Gussem <Kris.DeGussem@gmail.com>, 2008-2014.\n" "Lauris Kaplinski <lauris@ariman.ee>, 2000.\n" "Leandro Regueiro <leandro.regueiro@gmail.com>, 2006-2008, 2010.\n" "Liu Xiaoqin <liuxqsmile@gmail.com>, 2008.\n" @@ -536,7 +548,7 @@ void AboutBox::initStrings() { "Muhammad Bashir Al-Noimi <mhdbnoimi@gmail.com>, 2008.\n" "Myckel Habets <myckel@sdf.lonestar.org>, 2008.\n" "Nguyen Dinh Trung <nguyendinhtrung141@gmail.com>, 2007, 2008.\n" -"Nicolas Dufour <nicoduf@yahoo.fr>, 2008-2013.\n" +"Nicolas Dufour <nicoduf@yahoo.fr>, 2008-2014.\n" "Pawan Chitrakar <pchitrakar@gmail.com>, 2006.\n" "Przemysław Loesch <p_loesch@poczta.onet.pl>, 2005.\n" "Quico Llach <quico@softcatala.org>, 2000. Traducció sodipodi.\n" diff --git a/src/ui/dialog/dock-behavior.cpp b/src/ui/dialog/dock-behavior.cpp index 9b216e841..f65b298c9 100644 --- a/src/ui/dialog/dock-behavior.cpp +++ b/src/ui/dialog/dock-behavior.cpp @@ -24,7 +24,7 @@ #include "verbs.h" #include "dialog.h" #include "preferences.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include <gtkmm/invisible.h> #include <gtkmm/label.h> diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 5ad82644e..2a3a1dd86 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1736,9 +1736,13 @@ void DocumentProperties::onDocUnitChange() prefs->setBool("/options/transform/gradient", true); { ShapeEditor::blockSetItem(true); - gdouble viewscale_w = doc->getWidth().value("px")/doc->getRoot()->viewBox.width(); - gdouble viewscale_h = doc->getHeight().value("px")/doc->getRoot()->viewBox.height(); - gdouble viewscale = std::min(viewscale_h, viewscale_w); + gdouble viewscale = 1.0; + Geom::Rect vb = doc->getRoot()->viewBox; + if ( !vb.hasZeroArea() ) { + gdouble viewscale_w = doc->getWidth().value("px") / vb.width(); + gdouble viewscale_h = doc->getHeight().value("px")/ vb.height(); + viewscale = std::min(viewscale_h, viewscale_w); + } gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit); doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(-viewscale*doc->getRoot()->viewBox.min()[Geom::X] + (doc->getWidth().value("px") - viewscale*doc->getRoot()->viewBox.width())/2, diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 913713e5c..cd8fdbd92 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -62,7 +62,7 @@ #include "sp-namedview.h" #include "selection-chemistry.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "preferences.h" #include "verbs.h" #include "interface.h" diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp index e71605739..00ed09551 100644 --- a/src/ui/dialog/filedialog.cpp +++ b/src/ui/dialog/filedialog.cpp @@ -20,7 +20,7 @@ #include "filedialog.h" #include "gc-core.h" -#include <dialogs/dialog-events.h> +#include "ui/dialog-events.h" #include "extension/output.h" #include "preferences.h" diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index 575519848..5778b44db 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -22,7 +22,7 @@ #endif #include "filedialogimpl-gtkmm.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "interface.h" #include "io/sys.h" #include "path-prefix.h" diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index 06153a2d8..ee6a0ef3a 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -31,7 +31,7 @@ //Inkscape includes #include "inkscape.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "extension/input.h" #include "extension/output.h" #include "extension/db.h" diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 37f2761df..9b814bb9f 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -31,7 +31,7 @@ #include "selection.h" #include "desktop-handles.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "verbs.h" #include "interface.h" #include "preferences.h" diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index dd07f009a..f286588b2 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -28,7 +28,7 @@ #include "inkscape.h" #include "desktop.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "interface.h" #include "preferences.h" #include "verbs.h" diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp index 6e9ecc3c8..db7bdf222 100644 --- a/src/ui/dialog/font-substitution.cpp +++ b/src/ui/dialog/font-substitution.cpp @@ -27,7 +27,7 @@ #include "document.h" #include "selection.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "desktop-handles.h" #include "selection-chemistry.h" #include "preferences.h" diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 80740113c..76c26a3cb 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -28,7 +28,7 @@ #include "ui/tools/tool-base.h" #include "widgets/desktop-widget.h" #include <glibmm/i18n.h> -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "message-context.h" #include "xml/repr.h" #include "verbs.h" diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 2d558daae..ecd4ff42f 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -25,7 +25,7 @@ #include "desktop.h" #include "desktop-style.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "document.h" #include "document-undo.h" #include "filter-chemistry.h" diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index f676e75fd..607087f6d 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -27,7 +27,7 @@ #include "filedialogimpl-gtkmm.h" #include "interface.h" #include "gc-core.h" -#include <dialogs/dialog-events.h> +#include "ui/dialog-events.h" #include "io/sys.h" #include "preferences.h" diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h index e21030bcd..bd028c145 100644 --- a/src/ui/dialog/ocaldialogs.h +++ b/src/ui/dialog/ocaldialogs.h @@ -38,8 +38,7 @@ //Inkscape includes #include "ui/dialog/filedialog.h" - -#include <dialogs/dialog-events.h> +#include "ui/dialog-events.h" struct _xmlNode; typedef _xmlNode xmlNode; diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp index b2ca1b6da..127e4d95e 100644 --- a/src/ui/dialog/tags.cpp +++ b/src/ui/dialog/tags.cpp @@ -50,7 +50,7 @@ #include "sp-root.h" #include "ui/tools/tool-base.h" //"event-context.h" #include "selection.h" -#include "dialogs/dialog-events.h" +//#include "dialogs/dialog-events.h" #include "widgets/sp-color-notebook.h" #include "style.h" #include "filter-chemistry.h" diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index c87e42633..9a8c188b2 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -24,7 +24,7 @@ #include "desktop.h" #include "desktop-handles.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "document.h" #include "document-undo.h" #include "ui/tools/tool-base.h" diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 72250a550..bab6bc7e3 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -262,8 +262,9 @@ static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points sp_style_unref(style); } - char * width_str = new char[50]; - sprintf(width_str, "0,%f", stroke_width / 2.); + std::ostringstream s; + s.imbue(std::locale::classic()); + s << "0," << stroke_width / 2.; // write powerstroke parameters: lpe->getRepr()->setAttribute("start_linecap_type", "zerowidth"); @@ -272,9 +273,7 @@ static void spdc_apply_powerstroke_shape(const std::vector<Geom::Point> & points lpe->getRepr()->setAttribute("sort_points", "true"); lpe->getRepr()->setAttribute("interpolator_type", "CubicBezierJohan"); lpe->getRepr()->setAttribute("interpolator_beta", "0.2"); - lpe->getRepr()->setAttribute("offset_points", width_str); - - delete [] width_str; + lpe->getRepr()->setAttribute("offset_points", s.str().c_str()); } static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, SPCurve *curve) diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index 975894586..0b98bacc1 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -305,27 +305,23 @@ void NodeTool::update_helperpath () { if (SP_IS_LPE_ITEM(selection->singleItem())) { Inkscape::LivePathEffect::Effect *lpe = SP_LPE_ITEM(selection->singleItem())->getCurrentLPE(); if (lpe && lpe->isVisible()/* && lpe->showOrigPath()*/) { - if (lpe) { - SPCurve *c = new SPCurve(); - SPCurve *cc = new SPCurve(); - std::vector<Geom::PathVector> cs = lpe->getCanvasIndicators(SP_LPE_ITEM(selection->singleItem())); - for (std::vector<Geom::PathVector>::iterator p = cs.begin(); p != cs.end(); ++p) { - cc->set_pathvector(*p); - c->append(cc, false); - cc->reset(); - } - if (!c->is_empty()) { - c->transform(selection->singleItem()->i2dt_affine()); - SPCanvasItem *helperpath = sp_canvas_bpath_new(sp_desktop_tempgroup(this->desktop), c); - sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath), - 0x0000ff9A, 1.0, - SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); - sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath), 0, SP_WIND_RULE_NONZERO); - this->helperpath_tmpitem = this->desktop->add_temporary_canvasitem(helperpath,0); - } - c->unref(); - cc->unref(); - } + SPCurve *c = new SPCurve(); + SPCurve *cc = new SPCurve(); + std::vector<Geom::PathVector> cs = lpe->getCanvasIndicators(SP_LPE_ITEM(selection->singleItem())); + for (std::vector<Geom::PathVector>::iterator p = cs.begin(); p != cs.end(); ++p) { + cc->set_pathvector(*p); + c->append(cc, false); + cc->reset(); + } + if (!c->is_empty()) { + SPCanvasItem *helperpath = sp_canvas_bpath_new(sp_desktop_tempgroup(this->desktop), c); + sp_canvas_bpath_set_stroke(SP_CANVAS_BPATH(helperpath), 0x0000ff9A, 1.0, SP_STROKE_LINEJOIN_MITER, SP_STROKE_LINECAP_BUTT); + sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(helperpath), 0, SP_WIND_RULE_NONZERO); + sp_canvas_item_affine_absolute(helperpath, selection->singleItem()->i2dt_affine()); + this->helperpath_tmpitem = this->desktop->add_temporary_canvasitem(helperpath, 0); + } + c->unref(); + cc->unref(); } } } diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp index 5585f2db4..6b5a351f6 100644 --- a/src/ui/widget/color-picker.cpp +++ b/src/ui/widget/color-picker.cpp @@ -15,7 +15,7 @@ #include "desktop-handles.h" #include "document.h" #include "document-undo.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "widgets/sp-color-notebook.h" #include "verbs.h" diff --git a/src/widgets/dash-selector.cpp b/src/widgets/dash-selector.cpp index fce7a9d9f..479895022 100644 --- a/src/widgets/dash-selector.cpp +++ b/src/widgets/dash-selector.cpp @@ -25,7 +25,7 @@ #include <2geom/coord.h> #include "style.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "preferences.h" #include "ui/widget/spinbutton.h" #include "display/cairo-utils.h" diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 63978a711..fec46b188 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -98,6 +98,7 @@ enum { //--------------------------------------------------------------------- /* SPDesktopWidget */ +static void sp_desktop_widget_class_init (SPDesktopWidgetClass *klass); static void sp_desktop_widget_dispose(GObject *object); static void sp_desktop_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation); @@ -127,6 +128,8 @@ static void sp_dtw_zoom_drawing (GtkMenuItem *item, gpointer data); static void sp_dtw_zoom_selection (GtkMenuItem *item, gpointer data); static void sp_dtw_sticky_zoom_toggled (GtkMenuItem *item, gpointer data); +SPViewWidgetClass *dtw_parent_class; + class CMSPrefWatcher { public: CMSPrefWatcher() : @@ -265,19 +268,31 @@ SPDesktopWidget::window_get_pointer() static GTimer *overallTimer = 0; -struct SPDesktopWidgetPrivate -{ - GtkWidget *tool_toolbox; - GtkWidget *aux_toolbox; - GtkWidget *commands_toolbox; - GtkWidget *snap_toolbox; -}; - -G_DEFINE_TYPE_WITH_CODE(SPDesktopWidget, sp_desktop_widget, SP_TYPE_VIEW_WIDGET, - // Begin a timer to watch for the first desktop to appear on-screen - overallTimer = g_timer_new(); - G_ADD_PRIVATE(SPDesktopWidget); - ); +/** + * Registers SPDesktopWidget class and returns its type number. + */ +GType SPDesktopWidget::getType(void) +{ + static GType type = 0; + if (!type) { + GTypeInfo info = { + sizeof(SPDesktopWidgetClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_desktop_widget_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPDesktopWidget), + 0, // n_preallocs + (GInstanceInitFunc)SPDesktopWidget::init, + 0 // value_table + }; + type = g_type_register_static(SP_TYPE_VIEW_WIDGET, "SPDesktopWidget", &info, static_cast<GTypeFlags>(0)); + // Begin a timer to watch for the first desktop to appear on-screen + overallTimer = g_timer_new(); + } + return type; +} /** * SPDesktopWidget vtable initialization @@ -285,6 +300,8 @@ G_DEFINE_TYPE_WITH_CODE(SPDesktopWidget, sp_desktop_widget, SP_TYPE_VIEW_WIDGET, static void sp_desktop_widget_class_init (SPDesktopWidgetClass *klass) { + dtw_parent_class = SP_VIEW_WIDGET_CLASS(g_type_class_peek_parent(klass)); + GObjectClass *object_class = G_OBJECT_CLASS(klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); @@ -312,12 +329,10 @@ static void canvas_tbl_size_allocate(GtkWidget * /*widget*/, /** * Callback for SPDesktopWidget object initialization. */ -void sp_desktop_widget_init( SPDesktopWidget *dtw ) +void SPDesktopWidget::init( SPDesktopWidget *dtw ) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - dtw->priv = reinterpret_cast<SPDesktopWidgetPrivate *>(sp_desktop_widget_get_instance_private(dtw)); - new (&dtw->modified_connection) sigc::connection(); dtw->window = 0; @@ -362,19 +377,19 @@ void sp_desktop_widget_init( SPDesktopWidget *dtw ) gtk_box_pack_end( GTK_BOX (dtw->vbox), dtw->hbox, TRUE, TRUE, 0 ); gtk_widget_show(dtw->hbox); - dtw->priv->aux_toolbox = ToolboxFactory::createAuxToolbox(); - gtk_box_pack_end (GTK_BOX (dtw->vbox), dtw->priv->aux_toolbox, FALSE, TRUE, 0); + dtw->aux_toolbox = ToolboxFactory::createAuxToolbox(); + gtk_box_pack_end (GTK_BOX (dtw->vbox), dtw->aux_toolbox, FALSE, TRUE, 0); - dtw->priv->snap_toolbox = ToolboxFactory::createSnapToolbox(); - ToolboxFactory::setOrientation( dtw->priv->snap_toolbox, GTK_ORIENTATION_VERTICAL ); - gtk_box_pack_end( GTK_BOX(dtw->hbox), dtw->priv->snap_toolbox, FALSE, TRUE, 0 ); + dtw->snap_toolbox = ToolboxFactory::createSnapToolbox(); + ToolboxFactory::setOrientation( dtw->snap_toolbox, GTK_ORIENTATION_VERTICAL ); + gtk_box_pack_end( GTK_BOX(dtw->hbox), dtw->snap_toolbox, FALSE, TRUE, 0 ); - dtw->priv->commands_toolbox = ToolboxFactory::createCommandsToolbox(); - gtk_box_pack_end (GTK_BOX (dtw->vbox), dtw->priv->commands_toolbox, FALSE, TRUE, 0); + dtw->commands_toolbox = ToolboxFactory::createCommandsToolbox(); + gtk_box_pack_end (GTK_BOX (dtw->vbox), dtw->commands_toolbox, FALSE, TRUE, 0); - dtw->priv->tool_toolbox = ToolboxFactory::createToolToolbox(); - ToolboxFactory::setOrientation( dtw->priv->tool_toolbox, GTK_ORIENTATION_VERTICAL ); - gtk_box_pack_start( GTK_BOX(dtw->hbox), dtw->priv->tool_toolbox, FALSE, TRUE, 0 ); + dtw->tool_toolbox = ToolboxFactory::createToolToolbox(); + ToolboxFactory::setOrientation( dtw->tool_toolbox, GTK_ORIENTATION_VERTICAL ); + gtk_box_pack_start( GTK_BOX(dtw->hbox), dtw->tool_toolbox, FALSE, TRUE, 0 ); /* Horizontal ruler */ GtkWidget *eventbox = gtk_event_box_new (); @@ -789,8 +804,8 @@ static void sp_desktop_widget_dispose(GObject *object) dtw->modified_connection.~connection(); - if (G_OBJECT_CLASS (sp_desktop_widget_parent_class)->dispose) { - G_OBJECT_CLASS (sp_desktop_widget_parent_class)->dispose(object); + if (G_OBJECT_CLASS (dtw_parent_class)->dispose) { + (* G_OBJECT_CLASS (dtw_parent_class)->dispose) (object); } } @@ -893,8 +908,8 @@ sp_desktop_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation) (allocation->y == widg_allocation.y) && (allocation->width == widg_allocation.width) && (allocation->height == widg_allocation.height)) { - if (GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->size_allocate) - GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->size_allocate (widget, allocation); + if (GTK_WIDGET_CLASS (dtw_parent_class)->size_allocate) + GTK_WIDGET_CLASS (dtw_parent_class)->size_allocate (widget, allocation); return; } @@ -902,8 +917,8 @@ sp_desktop_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation) Geom::Rect const area = dtw->desktop->get_display_area(); double zoom = dtw->desktop->current_zoom(); - if (GTK_WIDGET_CLASS(sp_desktop_widget_parent_class)->size_allocate) { - GTK_WIDGET_CLASS(sp_desktop_widget_parent_class)->size_allocate (widget, allocation); + if (GTK_WIDGET_CLASS(dtw_parent_class)->size_allocate) { + GTK_WIDGET_CLASS(dtw_parent_class)->size_allocate (widget, allocation); } if (SP_BUTTON_IS_DOWN(dtw->sticky_zoom)) { @@ -921,8 +936,8 @@ sp_desktop_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation) dtw->desktop->show_dialogs(); } else { - if (GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->size_allocate) { - GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->size_allocate (widget, allocation); + if (GTK_WIDGET_CLASS (dtw_parent_class)->size_allocate) { + GTK_WIDGET_CLASS (dtw_parent_class)->size_allocate (widget, allocation); } // this->size_allocate (widget, allocation); } @@ -937,8 +952,8 @@ sp_desktop_widget_realize (GtkWidget *widget) SPDesktopWidget *dtw = SP_DESKTOP_WIDGET (widget); - if (GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->realize) - GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->realize(widget); + if (GTK_WIDGET_CLASS (dtw_parent_class)->realize) + (* GTK_WIDGET_CLASS (dtw_parent_class)->realize) (widget); Geom::Rect d = Geom::Rect::from_xywh(Geom::Point(0,0), (dtw->desktop->doc())->getDimensions()); @@ -983,8 +998,8 @@ sp_desktop_widget_event (GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dt } } - if (GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->event) { - return GTK_WIDGET_CLASS (sp_desktop_widget_parent_class)->event(widget, event); + if (GTK_WIDGET_CLASS (dtw_parent_class)->event) { + return (* GTK_WIDGET_CLASS (dtw_parent_class)->event) (widget, event); } else { // The key press/release events need to be passed to desktop handler explicitly, // because otherwise the event contexts only receive key events when the mouse cursor @@ -1484,29 +1499,29 @@ void SPDesktopWidget::layoutWidgets() } if (!prefs->getBool(pref_root + "commands/state", true)) { - gtk_widget_hide (dtw->priv->commands_toolbox); + gtk_widget_hide (dtw->commands_toolbox); } else { - gtk_widget_show_all (dtw->priv->commands_toolbox); + gtk_widget_show_all (dtw->commands_toolbox); } if (!prefs->getBool(pref_root + "snaptoolbox/state", true)) { - gtk_widget_hide (dtw->priv->snap_toolbox); + gtk_widget_hide (dtw->snap_toolbox); } else { - gtk_widget_show_all (dtw->priv->snap_toolbox); + gtk_widget_show_all (dtw->snap_toolbox); } if (!prefs->getBool(pref_root + "toppanel/state", true)) { - gtk_widget_hide (dtw->priv->aux_toolbox); + gtk_widget_hide (dtw->aux_toolbox); } else { // we cannot just show_all because that will show all tools' panels; // this is a function from toolbox.cpp that shows only the current tool's panel - ToolboxFactory::showAuxToolbox(dtw->priv->aux_toolbox); + ToolboxFactory::showAuxToolbox(dtw->aux_toolbox); } if (!prefs->getBool(pref_root + "toolbox/state", true)) { - gtk_widget_hide (dtw->priv->tool_toolbox); + gtk_widget_hide (dtw->tool_toolbox); } else { - gtk_widget_show_all (dtw->priv->tool_toolbox); + gtk_widget_show_all (dtw->tool_toolbox); } if (!prefs->getBool(pref_root + "statusbar/state", true)) { @@ -1543,7 +1558,7 @@ void SPDesktopWidget::layoutWidgets() void SPDesktopWidget::setToolboxFocusTo (const gchar* label) { - gpointer hb = sp_search_by_data_recursive(priv->aux_toolbox, (gpointer) label); + gpointer hb = sp_search_by_data_recursive(aux_toolbox, (gpointer) label); if (hb && GTK_IS_WIDGET(hb)) { gtk_widget_grab_focus(GTK_WIDGET(hb)); @@ -1554,7 +1569,7 @@ void SPDesktopWidget::setToolboxAdjustmentValue (gchar const *id, double value) { GtkAdjustment *a = NULL; - gpointer hb = sp_search_by_data_recursive (priv->aux_toolbox, (gpointer) id); + gpointer hb = sp_search_by_data_recursive (aux_toolbox, (gpointer) id); if (hb && GTK_IS_WIDGET(hb)) { if (GTK_IS_SPIN_BUTTON(hb)) a = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(hb)); @@ -1571,7 +1586,7 @@ SPDesktopWidget::setToolboxAdjustmentValue (gchar const *id, double value) void SPDesktopWidget::setToolboxSelectOneValue (gchar const *id, int value) { - gpointer hb = sp_search_by_data_recursive(priv->aux_toolbox, (gpointer) id); + gpointer hb = sp_search_by_data_recursive(aux_toolbox, (gpointer) id); if (hb) { ege_select_one_action_set_active(EGE_SELECT_ONE_ACTION(hb), value); } @@ -1582,7 +1597,7 @@ bool SPDesktopWidget::isToolboxButtonActive (const gchar* id) { bool isActive = false; - gpointer thing = sp_search_by_data_recursive(priv->aux_toolbox, (gpointer) id); + gpointer thing = sp_search_by_data_recursive(aux_toolbox, (gpointer) id); if ( !thing ) { //g_message( "Unable to locate item for {%s}", id ); } else if ( GTK_IS_TOGGLE_BUTTON(thing) ) { @@ -1603,13 +1618,13 @@ void SPDesktopWidget::setToolboxPosition(Glib::ustring const& id, GtkPositionTyp // Note - later on these won't be individual member variables. GtkWidget* toolbox = 0; if (id == "ToolToolbar") { - toolbox = priv->tool_toolbox; + toolbox = tool_toolbox; } else if (id == "AuxToolbar") { - toolbox = priv->aux_toolbox; + toolbox = aux_toolbox; } else if (id == "CommandsToolbar") { - toolbox = priv->commands_toolbox; + toolbox = commands_toolbox; } else if (id == "SnapToolbar") { - toolbox = priv->snap_toolbox; + toolbox = snap_toolbox; } @@ -1682,10 +1697,10 @@ SPDesktopWidget* SPDesktopWidget::createInstance(SPNamedView *namedview) dtw->layoutWidgets(); std::vector<GtkWidget *> toolboxes; - toolboxes.push_back(dtw->priv->tool_toolbox); - toolboxes.push_back(dtw->priv->aux_toolbox); - toolboxes.push_back(dtw->priv->commands_toolbox); - toolboxes.push_back(dtw->priv->snap_toolbox); + toolboxes.push_back(dtw->tool_toolbox); + toolboxes.push_back(dtw->aux_toolbox); + toolboxes.push_back(dtw->commands_toolbox); + toolboxes.push_back(dtw->snap_toolbox); dtw->panels->setDesktop( dtw->desktop ); @@ -1739,8 +1754,8 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) * * This should solve: https://bugs.launchpad.net/inkscape/+bug/362995 */ - if (GTK_IS_CONTAINER(priv->aux_toolbox)) { - GList *ch = gtk_container_get_children (GTK_CONTAINER(priv->aux_toolbox)); + if (GTK_IS_CONTAINER(aux_toolbox)) { + GList *ch = gtk_container_get_children (GTK_CONTAINER(aux_toolbox)); for (GList *i = ch; i != NULL; i = i->next) { if (GTK_IS_CONTAINER(i->data)) { GList *grch = gtk_container_get_children (GTK_CONTAINER(i->data)); @@ -1766,7 +1781,7 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) gtk_widget_set_tooltip_text(this->vruler_box, gettext(nv->doc_units->name_plural.c_str())); sp_desktop_widget_update_rulers(this); - ToolboxFactory::updateSnapToolbox(this->desktop, 0, priv->snap_toolbox); + ToolboxFactory::updateSnapToolbox(this->desktop, 0, this->snap_toolbox); } } diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 9a4834d3d..a77d56fc3 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -34,33 +34,15 @@ typedef struct _EgeColorProfTracker EgeColorProfTracker; struct SPCanvas; class SPDesktop; struct SPDesktopWidget; -struct SPDesktopWidgetPrivate; class SPObject; -namespace Inkscape { - namespace Widgets { - class LayerSelector; - } - namespace UI { - namespace Widget { - class SelectedStyle; - } - - namespace Dialogs { - class SwatchesPanel; - } - } -} - -#define SP_TYPE_DESKTOP_WIDGET (sp_desktop_widget_get_type ()) -#define SP_DESKTOP_WIDGET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SP_TYPE_DESKTOP_WIDGET, SPDesktopWidget)) -#define SP_DESKTOP_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SP_TYPE_DESKTOP_WIDGET, SPDesktopWidgetClass)) -#define SP_IS_DESKTOP_WIDGET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SP_TYPE_DESKTOP_WIDGET)) +#define SP_TYPE_DESKTOP_WIDGET SPDesktopWidget::getType() +#define SP_DESKTOP_WIDGET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SP_TYPE_DESKTOP_WIDGET, SPDesktopWidget)) +#define SP_DESKTOP_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SP_TYPE_DESKTOP_WIDGET, SPDesktopWidgetClass)) +#define SP_IS_DESKTOP_WIDGET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SP_TYPE_DESKTOP_WIDGET)) #define SP_IS_DESKTOP_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SP_TYPE_DESKTOP_WIDGET)) -GType sp_desktop_widget_get_type(); - void sp_desktop_widget_show_decorations(SPDesktopWidget *dtw, gboolean show); void sp_desktop_widget_iconify(SPDesktopWidget *dtw); void sp_desktop_widget_maximize(SPDesktopWidget *dtw); @@ -80,6 +62,12 @@ bool sp_desktop_widget_color_prof_adj_enabled( SPDesktopWidget *dtw ); void sp_dtw_desktop_activate (SPDesktopWidget *dtw); void sp_dtw_desktop_deactivate (SPDesktopWidget *dtw); +namespace Inkscape { namespace Widgets { class LayerSelector; } } + +namespace Inkscape { namespace UI { namespace Widget { class SelectedStyle; } } } + +namespace Inkscape { namespace UI { namespace Dialogs { class SwatchesPanel; } } } + /// A GtkEventBox on an SPDesktop. struct SPDesktopWidget { SPViewWidget viewwidget; @@ -260,15 +248,22 @@ struct SPDesktopWidget { Inkscape::UI::Widget::Dock* getDock(); + static GType getType(); static SPDesktopWidget* createInstance(SPNamedView *namedview); void updateNamedview(); - SPDesktopWidgetPrivate *priv; private: + GtkWidget *tool_toolbox; + GtkWidget *aux_toolbox; + GtkWidget *commands_toolbox; + GtkWidget *snap_toolbox; + + static void init(SPDesktopWidget *widget); void layoutWidgets(); void namedviewModified(SPObject *obj, guint flags); + }; /// The SPDesktopWidget vtable diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 53ce8ceac..6607c90d2 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -40,7 +40,7 @@ #include "xml/repr.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "preferences.h" #include "svg/css-ostringstream.h" #include "sp-stop.h" diff --git a/src/widgets/sp-color-icc-selector.cpp b/src/widgets/sp-color-icc-selector.cpp index d0d302ff4..6e910c582 100644 --- a/src/widgets/sp-color-icc-selector.cpp +++ b/src/widgets/sp-color-icc-selector.cpp @@ -10,7 +10,7 @@ #include <set> #include <vector> -#include "../dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "sp-color-icc-selector.h" #include "sp-color-scales.h" #include "sp-color-slider.h" diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index 9f927b51f..87cb7cae3 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -25,7 +25,7 @@ #include <gtk/gtk.h> #include <glibmm/i18n.h> -#include "../dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "../preferences.h" #include "sp-color-notebook.h" #include "spw-utilities.h" diff --git a/src/widgets/sp-color-scales.cpp b/src/widgets/sp-color-scales.cpp index 5fddacf59..60ba62ec5 100644 --- a/src/widgets/sp-color-scales.cpp +++ b/src/widgets/sp-color-scales.cpp @@ -8,7 +8,7 @@ #include <math.h> #include <gtk/gtk.h> #include <glibmm/i18n.h> -#include "../dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "sp-color-scales.h" #include "sp-color-slider.h" #include "svg/svg-icc-color.h" diff --git a/src/widgets/sp-color-wheel-selector.cpp b/src/widgets/sp-color-wheel-selector.cpp index 404874db7..6cfa7c14d 100644 --- a/src/widgets/sp-color-wheel-selector.cpp +++ b/src/widgets/sp-color-wheel-selector.cpp @@ -4,7 +4,7 @@ #include <math.h> #include <gtk/gtk.h> #include <glibmm/i18n.h> -#include "../dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "sp-color-wheel-selector.h" #include "sp-color-scales.h" #include "sp-color-slider.h" diff --git a/src/widgets/stroke-marker-selector.cpp b/src/widgets/stroke-marker-selector.cpp index 00b6b5c91..29c342f21 100644 --- a/src/widgets/stroke-marker-selector.cpp +++ b/src/widgets/stroke-marker-selector.cpp @@ -25,7 +25,7 @@ #include "style.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "desktop-handles.h" #include "desktop-style.h" #include "preferences.h" diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index 0e0a4fd72..3fa39da6f 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -18,7 +18,7 @@ #define noSP_SS_VERBOSE #include "stroke-style.h" -#include "../gradient-chemistry.h" +#include "gradient-chemistry.h" #include "sp-gradient.h" #include "sp-stop.h" #include "svg/svg-color.h" diff --git a/src/widgets/stroke-style.h b/src/widgets/stroke-style.h index 6f0fe583b..464e7d2d1 100644 --- a/src/widgets/stroke-style.h +++ b/src/widgets/stroke-style.h @@ -12,6 +12,8 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ +// WHOA! talk about header bloat! + #ifndef SEEN_DIALOGS_STROKE_STYLE_H #define SEEN_DIALOGS_STROKE_STYLE_H @@ -33,7 +35,7 @@ #include "desktop.h" #include "desktop-handles.h" #include "desktop-style.h" -#include "dialogs/dialog-events.h" +#include "ui/dialog-events.h" #include "display/canvas-bpath.h" // for SP_STROKE_LINEJOIN_* #include "display/drawing.h" #include "document-private.h" diff --git a/src/xml/event.h b/src/xml/event.h index 55e2add88..d25ea0e07 100644 --- a/src/xml/event.h +++ b/src/xml/event.h @@ -18,7 +18,7 @@ #ifndef SEEN_INKSCAPE_XML_SP_REPR_ACTION_H #define SEEN_INKSCAPE_XML_SP_REPR_ACTION_H -#include <glib.h> +typedef unsigned int GQuark; #include <glibmm/ustring.h> #include <iterator> diff --git a/src/xml/helper-observer.h b/src/xml/helper-observer.h index 2f70ba792..b4c0aba41 100644 --- a/src/xml/helper-observer.h +++ b/src/xml/helper-observer.h @@ -1,37 +1,49 @@ -#ifndef __XML_HELPER_OBSERVER__ -#define __XML_HELPER_OBSERVER__ +#ifndef SEEN_XML_HELPER_OBSERVER +#define SEEN_XML_HELPER_OBSERVER + +#include <cstddef> +#include <sigc++/sigc++.h> #include "node-observer.h" #include "node.h" -#include "../sp-object.h" -//#include "../sp-object-repr.h" -#include <stddef.h> -#include <sigc++/sigc++.h> +#include "sp-object.h" namespace Inkscape { - namespace XML { - class Node; - - // Very simple observer that just emits a signal if anything happens to a node - class SignalObserver : public NodeObserver - { - public: - SignalObserver(); - ~SignalObserver(); - - // Add this observer to the SPObject and remove it from any previous object - void set(SPObject* o); - void notifyChildAdded(Node&, Node&, Node*); - void notifyChildRemoved(Node&, Node&, Node*); - void notifyChildOrderChanged(Node&, Node&, Node*, Node*); - void notifyContentChanged(Node&, Util::ptr_shared<char>, Util::ptr_shared<char>); - void notifyAttributeChanged(Node&, GQuark, Util::ptr_shared<char>, Util::ptr_shared<char>); - sigc::signal<void>& signal_changed(); - private: - sigc::signal<void> _signal_changed; - SPObject* _oldsel; - }; - } +namespace XML { + +class Node; + +// Very simple observer that just emits a signal if anything happens to a node +class SignalObserver : public NodeObserver { +public: + SignalObserver(); + ~SignalObserver(); + + // Add this observer to the SPObject and remove it from any previous object + void set(SPObject* o); + void notifyChildAdded(Node&, Node&, Node*); + void notifyChildRemoved(Node&, Node&, Node*); + void notifyChildOrderChanged(Node&, Node&, Node*, Node*); + void notifyContentChanged(Node&, Util::ptr_shared<char>, Util::ptr_shared<char>); + void notifyAttributeChanged(Node&, GQuark, Util::ptr_shared<char>, Util::ptr_shared<char>); + sigc::signal<void>& signal_changed(); +private: + sigc::signal<void> _signal_changed; + SPObject* _oldsel; +}; + +} } #endif //#ifndef __XML_HELPER_OBSERVER__ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 : diff --git a/src/xml/node-event-vector.h b/src/xml/node-event-vector.h index e6396877d..416640b86 100644 --- a/src/xml/node-event-vector.h +++ b/src/xml/node-event-vector.h @@ -14,26 +14,11 @@ #ifndef SEEN_INKSCAPE_XML_SP_REPR_EVENT_VECTOR #define SEEN_INKSCAPE_XML_SP_REPR_EVENT_VECTOR -#include <glib.h> - #include "xml/node.h" namespace Inkscape { namespace XML { - -/** - * @brief Structure holding callbacks for node state changes - * @deprecated Derive an observer object from the NodeObserver class instead - */ -struct NodeEventVector { - /* Immediate signals */ - void (* child_added) (Node *repr, Node *child, Node *ref, void * data); - void (* child_removed) (Node *repr, Node *child, Node *ref, void * data); - void (* attr_changed) (Node *repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive, void * data); - void (* content_changed) (Node *repr, const gchar *oldcontent, const gchar *newcontent, void * data); - void (* order_changed) (Node *repr, Node *child, Node *oldref, Node *newref, void * data); -}; - +struct NodeEventVector; } } @@ -41,22 +26,45 @@ struct NodeEventVector { * @brief Generate events corresponding to the node's state * @deprecated Use Node::synthesizeEvents(NodeObserver &) instead */ -inline void sp_repr_synthesize_events (Inkscape::XML::Node *repr, const Inkscape::XML::NodeEventVector *vector, void * data) { +inline void sp_repr_synthesize_events (Inkscape::XML::Node *repr, const Inkscape::XML::NodeEventVector *vector, void* data) { repr->synthesizeEvents(vector, data); } /** * @brief Add a set of callbacks for node state changes and its associated data * @deprecated Use Node::addObserver() instead */ -inline void sp_repr_add_listener (Inkscape::XML::Node *repr, const Inkscape::XML::NodeEventVector *vector, void * data) { +inline void sp_repr_add_listener (Inkscape::XML::Node *repr, const Inkscape::XML::NodeEventVector *vector, void* data) { repr->addListener(vector, data); } /** * @brief Remove a set of callbacks based on associated data * @deprecated Use Node::removeObserver() instead */ -inline void sp_repr_remove_listener_by_data (Inkscape::XML::Node *repr, void * data) { +inline void sp_repr_remove_listener_by_data (Inkscape::XML::Node *repr, void* data) { repr->removeListenerByData(data); } +namespace Inkscape { +namespace XML { + +/** + * @brief Structure holding callbacks for node state changes + * @deprecated Derive an observer object from the NodeObserver class instead + */ +struct NodeEventVector { + /* Immediate signals */ + void (* child_added) (Node *repr, Node *child, Node *ref, void* data); + void (* child_removed) (Node *repr, Node *child, Node *ref, void* data); + void (* attr_changed) (Node *repr, char const *key, char const *oldval, char const *newval, bool is_interactive, void* data); + void (* content_changed) (Node *repr, char const *oldcontent, char const *newcontent, void * data); + void (* order_changed) (Node *repr, Node *child, Node *oldref, Node *newref, void* data); +} +#ifdef __GNUC__ +__attribute__((deprecated)) +#endif +; + +} +} + #endif diff --git a/src/xml/node-observer.h b/src/xml/node-observer.h index d0c85d1dd..9c7e096e5 100644 --- a/src/xml/node-observer.h +++ b/src/xml/node-observer.h @@ -18,8 +18,8 @@ #ifndef SEEN_INKSCAPE_XML_NODE_OBSERVER_H #define SEEN_INKSCAPE_XML_NODE_OBSERVER_H -#include <glib.h> #include "util/share.h" +typedef unsigned int GQuark; #ifndef INK_UNUSED #define INK_UNUSED(x) ((void)(x)) @@ -56,7 +56,9 @@ protected: NodeObserver() {} public: virtual ~NodeObserver() {} - + + // FIXME: somebody needs to learn what "pure virtual" means + /** * @brief Child addition callback * diff --git a/src/xml/node.h b/src/xml/node.h index c1977b0a8..8bb70acc0 100644 --- a/src/xml/node.h +++ b/src/xml/node.h @@ -18,7 +18,6 @@ #ifndef SEEN_INKSCAPE_XML_NODE_H #define SEEN_INKSCAPE_XML_NODE_H -#include <glibmm/value.h> #include <glibmm/ustring.h> #include "gc-anchored.h" #include "util/list.h" @@ -100,7 +99,7 @@ public: * * @return Name for element nodes, NULL for others */ - virtual gchar const *name() const=0; + virtual char const *name() const=0; /** * @brief Get the integer code corresponding to the node's name * @return GQuark code corresponding to the name @@ -131,7 +130,7 @@ public: * * @return The node's content */ - virtual gchar const *content() const=0; + virtual char const *content() const=0; /** * @brief Get the string representation of a node's attribute @@ -144,7 +143,7 @@ public: * * @param key The name of the node's attribute */ - virtual gchar const *attribute(gchar const *key) const=0; + virtual char const *attribute(char const *key) const=0; /** * @brief Get a list of the node's attributes @@ -168,7 +167,7 @@ public: * @param partial_name The string to match against all attributes * @return true if there is such an attribute, false otherwise */ - virtual bool matchAttributeName(gchar const *partial_name) const=0; + virtual bool matchAttributeName(char const *partial_name) const=0; /*@}*/ @@ -193,7 +192,7 @@ public: * * @param value The node's new content */ - virtual void setContent(gchar const *value)=0; + virtual void setContent(char const *value)=0; //@{ /** @@ -205,7 +204,7 @@ public: * @param value The new value of the attribute * @param is_interactive Ignored */ - virtual void setAttribute(gchar const *key, gchar const *value, bool is_interactive=false)=0; + virtual void setAttribute(char const *key, char const *value, bool is_interactive=false)=0; void setAttribute(char const *key, Glib::ustring const &value, bool is_interactive=false) { @@ -399,7 +398,7 @@ public: * @param src The node to merge into this node * @param key The attribute to use as the identity attribute */ - virtual void mergeFrom(Node const *src, gchar const *key)=0; + virtual void mergeFrom(Node const *src, char const *key)=0; /*@}*/ diff --git a/src/xml/pi-node.h b/src/xml/pi-node.h index 1f892f97a..76a3dc741 100644 --- a/src/xml/pi-node.h +++ b/src/xml/pi-node.h @@ -14,7 +14,6 @@ #ifndef SEEN_INKSCAPE_XML_PI_NODE_H #define SEEN_INKSCAPE_XML_PI_NODE_H -#include <glib.h> #include "xml/simple-node.h" namespace Inkscape { diff --git a/src/xml/quote.h b/src/xml/quote.h index 8e3bca0eb..393bdf46e 100644 --- a/src/xml/quote.h +++ b/src/xml/quote.h @@ -1,7 +1,7 @@ #ifndef SEEN_XML_QUOTE_H #define SEEN_XML_QUOTE_H -#include <stddef.h> +#include <cstddef> size_t xml_quoted_strlen(char const *val); char *xml_quote_strdup(char const *src); diff --git a/src/xml/rebase-hrefs.h b/src/xml/rebase-hrefs.h index 5baf96516..34afe6076 100644 --- a/src/xml/rebase-hrefs.h +++ b/src/xml/rebase-hrefs.h @@ -1,7 +1,6 @@ #ifndef REBASE_HREFS_H_SEEN #define REBASE_HREFS_H_SEEN -#include <glib.h> #include "util/list.h" #include "xml/attribute-record.h" class SPDocument; @@ -9,7 +8,7 @@ class SPDocument; namespace Inkscape { namespace XML { -std::string calc_abs_doc_base(gchar const *doc_base); +std::string calc_abs_doc_base(char const *doc_base); /** * Change relative hrefs in doc to be relative to \a new_base instead of doc.base. @@ -18,7 +17,7 @@ std::string calc_abs_doc_base(gchar const *doc_base); * * @param spns True if doc should contain sodipodi:absref attributes. */ -void rebase_hrefs(SPDocument *doc, gchar const *new_base, bool spns); +void rebase_hrefs(SPDocument *doc, char const *new_base, bool spns); /** * Change relative xlink:href attributes to be relative to \a new_abs_base instead of old_abs_base. @@ -26,8 +25,8 @@ void rebase_hrefs(SPDocument *doc, gchar const *new_base, bool spns); * Note that old_abs_base and new_abs_base must each be non-NULL, absolute directory paths. */ Inkscape::Util::List<AttributeRecord const> rebase_href_attrs( - gchar const *old_abs_base, - gchar const *new_abs_base, + char const *old_abs_base, + char const *new_abs_base, Inkscape::Util::List<AttributeRecord const> attributes); diff --git a/src/xml/repr.h b/src/xml/repr.h index e691eaa7f..e1d7fdfd6 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -14,7 +14,6 @@ #ifndef SEEN_SP_REPR_H #define SEEN_SP_REPR_H -#include <glib.h> #include <glibmm/quark.h> #include "xml/node.h" @@ -43,55 +42,55 @@ 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); +char const *sp_xml_ns_uri_prefix(char const *uri, char const *suggested); +char const *sp_xml_ns_prefix_uri(char const *prefix); -Inkscape::XML::Document *sp_repr_document_new(gchar const *rootname); +Inkscape::XML::Document *sp_repr_document_new(char const *rootname); /* IO */ -Inkscape::XML::Document *sp_repr_read_file(gchar const *filename, gchar const *default_ns); -Inkscape::XML::Document *sp_repr_read_mem(gchar const *buffer, int length, gchar const *default_ns); +Inkscape::XML::Document *sp_repr_read_file(char const *filename, char const *default_ns); +Inkscape::XML::Document *sp_repr_read_mem(char const *buffer, int length, char const *default_ns); void sp_repr_write_stream(Inkscape::XML::Node *repr, Inkscape::IO::Writer &out, - gint indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix, + int indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix, int inlineattrs, int indent, - gchar const *old_href_base = NULL, - gchar const *new_href_base = NULL); -Inkscape::XML::Document *sp_repr_read_buf (const Glib::ustring &buf, const gchar *default_ns); + char const *old_href_base = NULL, + char const *new_href_base = NULL); +Inkscape::XML::Document *sp_repr_read_buf (const Glib::ustring &buf, const char *default_ns); Glib::ustring sp_repr_save_buf(Inkscape::XML::Document *doc); // TODO convert to std::string void sp_repr_save_stream(Inkscape::XML::Document *doc, FILE *to_file, - gchar const *default_ns = NULL, bool compress = false, - gchar const *old_href_base = NULL, - gchar const *new_href_base = NULL); + char const *default_ns = NULL, bool compress = false, + char const *old_href_base = NULL, + char const *new_href_base = NULL); -bool sp_repr_save_file(Inkscape::XML::Document *doc, gchar const *filename, gchar const *default_ns=NULL); -bool sp_repr_save_rebased_file(Inkscape::XML::Document *doc, gchar const *filename_utf8, - gchar const *default_ns, - gchar const *old_base, gchar const *new_base_filename); +bool sp_repr_save_file(Inkscape::XML::Document *doc, char const *filename, char const *default_ns=NULL); +bool sp_repr_save_rebased_file(Inkscape::XML::Document *doc, char const *filename_utf8, + char const *default_ns, + char const *old_base, char const *new_base_filename); /* CSS stuff */ SPCSSAttr *sp_repr_css_attr_new(void); void sp_repr_css_attr_unref(SPCSSAttr *css); -SPCSSAttr *sp_repr_css_attr(Inkscape::XML::Node *repr, gchar const *attr); +SPCSSAttr *sp_repr_css_attr(Inkscape::XML::Node *repr, char const *attr); SPCSSAttr *sp_repr_css_attr_parse_color_to_fill(const Glib::ustring &text); -SPCSSAttr *sp_repr_css_attr_inherited(Inkscape::XML::Node *repr, gchar const *attr); +SPCSSAttr *sp_repr_css_attr_inherited(Inkscape::XML::Node *repr, char const *attr); -gchar const *sp_repr_css_property(SPCSSAttr *css, gchar const *name, gchar const *defval); -void sp_repr_css_set_property(SPCSSAttr *css, gchar const *name, gchar const *value); -void sp_repr_css_unset_property(SPCSSAttr *css, gchar const *name); -bool sp_repr_css_property_is_unset(SPCSSAttr *css, gchar const *name); -double sp_repr_css_double_property(SPCSSAttr *css, gchar const *name, double defval); +char const *sp_repr_css_property(SPCSSAttr *css, char const *name, char const *defval); +void sp_repr_css_set_property(SPCSSAttr *css, char const *name, char const *value); +void sp_repr_css_unset_property(SPCSSAttr *css, char const *name); +bool sp_repr_css_property_is_unset(SPCSSAttr *css, char const *name); +double sp_repr_css_double_property(SPCSSAttr *css, char const *name, double defval); void sp_repr_css_write_string(SPCSSAttr *css, Glib::ustring &str); -void sp_repr_css_set(Inkscape::XML::Node *repr, SPCSSAttr *css, gchar const *key); +void sp_repr_css_set(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key); void sp_repr_css_merge(SPCSSAttr *dst, SPCSSAttr *src); -void sp_repr_css_attr_add_from_string(SPCSSAttr *css, const gchar *data); -void sp_repr_css_change(Inkscape::XML::Node *repr, SPCSSAttr *css, gchar const *key); -void sp_repr_css_change_recursive(Inkscape::XML::Node *repr, SPCSSAttr *css, gchar const *key); +void sp_repr_css_attr_add_from_string(SPCSSAttr *css, const char *data); +void sp_repr_css_change(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key); +void sp_repr_css_change_recursive(Inkscape::XML::Node *repr, SPCSSAttr *css, char const *key); void sp_repr_css_print(SPCSSAttr *css); @@ -109,15 +108,15 @@ inline void sp_repr_unparent(Inkscape::XML::Node *repr) { bool sp_repr_is_meta_element(const Inkscape::XML::Node *node); /* Convenience */ -unsigned sp_repr_get_boolean(Inkscape::XML::Node *repr, gchar const *key, unsigned *val); -unsigned sp_repr_get_int(Inkscape::XML::Node *repr, gchar const *key, int *val); -unsigned sp_repr_get_double(Inkscape::XML::Node *repr, gchar const *key, double *val); -unsigned sp_repr_set_boolean(Inkscape::XML::Node *repr, gchar const *key, unsigned val); -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 const & val); -unsigned sp_repr_get_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point *val); +unsigned sp_repr_get_boolean(Inkscape::XML::Node *repr, char const *key, unsigned *val); +unsigned sp_repr_get_int(Inkscape::XML::Node *repr, char const *key, int *val); +unsigned sp_repr_get_double(Inkscape::XML::Node *repr, char const *key, double *val); +unsigned sp_repr_set_boolean(Inkscape::XML::Node *repr, char const *key, unsigned val); +unsigned sp_repr_set_int(Inkscape::XML::Node *repr, char const *key, int val); +unsigned sp_repr_set_css_double(Inkscape::XML::Node *repr, char const *key, double val); +unsigned sp_repr_set_svg_double(Inkscape::XML::Node *repr, char const *key, double val); +unsigned sp_repr_set_point(Inkscape::XML::Node *repr, char const *key, Geom::Point const & val); +unsigned sp_repr_get_point(Inkscape::XML::Node *repr, char const *key, Geom::Point *val); int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::Node const *second); @@ -135,16 +134,16 @@ int sp_repr_compare_position(Inkscape::XML::Node const *first, Inkscape::XML::No * @relatesalso Inkscape::XML::Node */ Inkscape::XML::Node *sp_repr_lookup_name(Inkscape::XML::Node *repr, - gchar const *name, - gint maxdepth = -1); + char const *name, + int maxdepth = -1); Inkscape::XML::Node const *sp_repr_lookup_name(Inkscape::XML::Node const *repr, - gchar const *name, - gint maxdepth = -1); + char const *name, + int maxdepth = -1); Inkscape::XML::Node *sp_repr_lookup_child(Inkscape::XML::Node *repr, - gchar const *key, - gchar const *value); + char const *key, + char const *value); inline Inkscape::XML::Node *sp_repr_document_first_child(Inkscape::XML::Document const *doc) { diff --git a/src/xml/simple-node.h b/src/xml/simple-node.h index 7c5eb8fbd..1fcb9193b 100644 --- a/src/xml/simple-node.h +++ b/src/xml/simple-node.h @@ -18,7 +18,7 @@ #ifndef SEEN_INKSCAPE_XML_SIMPLE_NODE_H #define SEEN_INKSCAPE_XML_SIMPLE_NODE_H -#include <glib.h> // g_assert() +#include <cassert> #include "xml/node.h" #include "xml/attribute-record.h" @@ -38,7 +38,7 @@ class SimpleNode : virtual public Node, public Inkscape::GC::Managed<> { public: - gchar const *name() const; + char const *name() const; int code() const { return _name; } void setCodeUnsafe(int code) { _name = code; @@ -83,14 +83,14 @@ public: unsigned position() const; void setPosition(int pos); - gchar const *attribute(gchar const *key) const; - void setAttribute(gchar const *key, gchar const *value, bool is_interactive=false); - bool matchAttributeName(gchar const *partial_name) const; + char const *attribute(char const *key) const; + void setAttribute(char const *key, char const *value, bool is_interactive=false); + bool matchAttributeName(char const *partial_name) const; - gchar const *content() const; - void setContent(gchar const *value); + char const *content() const; + void setContent(char const *value); - void mergeFrom(Node const *src, gchar const *key); + void mergeFrom(Node const *src, char const *key); Inkscape::Util::List<AttributeRecord const> attributeList() const { return _attributes; @@ -100,7 +100,7 @@ public: void synthesizeEvents(NodeObserver &observer); void addListener(NodeEventVector const *vector, void *data) { - g_assert(vector != NULL); + assert(vector != NULL); _observers.addListener(*vector, data); } void addObserver(NodeObserver &observer) { |
