Code

since SP_VERB_XMPP_CLIENT is commented out in .h, it must be commented out here to...
[inkscape.git] / src / sp-polyline.cpp
index 54a38ccd1178f6ae97b2b8313a868ab82f5dd4aa..08f446d6124a5685c228de1c09e218ba46f2e33b 100644 (file)
 #include "display/curve.h"
 #include <glibmm/i18n.h>
 #include "xml/repr.h"
+#include "document.h"
 
 static void sp_polyline_class_init (SPPolyLineClass *klass);
 static void sp_polyline_init (SPPolyLine *polyline);
 
 static void sp_polyline_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr);
 static void sp_polyline_set (SPObject *object, unsigned int key, const gchar *value);
-static Inkscape::XML::Node *sp_polyline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
+static Inkscape::XML::Node *sp_polyline_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
 
 static gchar * sp_polyline_description (SPItem * item);
 
@@ -74,9 +75,9 @@ sp_polyline_class_init (SPPolyLineClass *klass)
 }
 
 static void
-sp_polyline_init (SPPolyLine * polyline)
+sp_polyline_init (SPPolyLine * /*polyline*/)
 {
-       /* Nothing here */
+    /* Nothing here */
 }
 
 static void
@@ -104,7 +105,7 @@ sp_polyline_set (SPObject *object, unsigned int key, const gchar *value)
                gboolean hascpt;
 
                if (!value) break;
-               curve = sp_curve_new ();
+               curve = new SPCurve ();
                hascpt = FALSE;
 
                cptr = value;
@@ -131,15 +132,15 @@ sp_polyline_set (SPObject *object, unsigned int key, const gchar *value)
                        if (eptr == cptr) break;
                        cptr = eptr;
                        if (hascpt) {
-                               sp_curve_lineto (curve, x, y);
+                               curve->lineto(x, y);
                        } else {
-                               sp_curve_moveto (curve, x, y);
+                               curve->moveto(x, y);
                                hascpt = TRUE;
                        }
                }
                
                sp_shape_set_curve (SP_SHAPE (polyline), curve, TRUE);
-               sp_curve_unref (curve);
+               curve->unref();
                break;
        }
        default:
@@ -150,14 +151,14 @@ sp_polyline_set (SPObject *object, unsigned int key, const gchar *value)
 }
 
 static Inkscape::XML::Node *
-sp_polyline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
+sp_polyline_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
 {
        SPPolyLine *polyline;
 
        polyline = SP_POLYLINE (object);
 
        if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
-               repr = sp_repr_new ("svg:polyline");
+               repr = xml_doc->createElement("svg:polyline");
        }
 
        if (repr != SP_OBJECT_REPR (object)) {
@@ -165,13 +166,13 @@ sp_polyline_write (SPObject *object, Inkscape::XML::Node *repr, guint flags)
        }
 
        if (((SPObjectClass *) (parent_class))->write)
-               ((SPObjectClass *) (parent_class))->write (object, repr, flags);
+               ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
 
        return repr;
 }
 
 static gchar *
-sp_polyline_description(SPItem *item)
+sp_polyline_description(SPItem */*item*/)
 {
-       return g_strdup(_("<b>Polyline</b>"));
+    return g_strdup(_("<b>Polyline</b>"));
 }