summaryrefslogtreecommitdiffstats
path: root/src/sp-polyline.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-01-30 08:33:01 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-01-30 08:33:01 +0000
commit267299811df952d08324a39008f52c19641de9e0 (patch)
tree28fef736a52cb7a72119d119be8eb663ad20a77f /src/sp-polyline.cpp
parentTranslations: update inkscape.pot (diff)
downloadinkscape-267299811df952d08324a39008f52c19641de9e0.tar.gz
inkscape-267299811df952d08324a39008f52c19641de9e0.zip
Move classes derived from SPObject to own directory.
A lot of header clean-up.
Diffstat (limited to 'src/sp-polyline.cpp')
-rw-r--r--src/sp-polyline.cpp132
1 files changed, 0 insertions, 132 deletions
diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp
deleted file mode 100644
index 29054f934..000000000
--- a/src/sp-polyline.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * SVG <polyline> implementation
- *
- * Authors:
- * Lauris Kaplinski <lauris@kaplinski.com>
- * Abhishek Sharma
- * Jon A. Cruz <jon@joncruz.org>
- *
- * Copyright (C) 1999-2002 Lauris Kaplinski
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#include "attributes.h"
-#include "sp-polyline.h"
-#include "display/curve.h"
-#include <glibmm/i18n.h>
-#include "xml/repr.h"
-#include "document.h"
-
-SPPolyLine::SPPolyLine() : SPShape() {
-}
-
-SPPolyLine::~SPPolyLine() {
-}
-
-void SPPolyLine::build(SPDocument * document, Inkscape::XML::Node * repr) {
- SPShape::build(document, repr);
-
- this->readAttr("points");
-}
-
-void SPPolyLine::set(unsigned int key, const gchar* value) {
- switch (key) {
- case SP_ATTR_POINTS: {
- SPCurve * curve;
- const gchar * cptr;
- char * eptr;
- gboolean hascpt;
-
- if (!value) {
- break;
- }
-
- curve = new SPCurve ();
- hascpt = FALSE;
-
- cptr = value;
- eptr = NULL;
-
- while (TRUE) {
- gdouble x, y;
-
- while (*cptr != '\0' && (*cptr == ',' || *cptr == '\x20' || *cptr == '\x9' || *cptr == '\xD' || *cptr == '\xA')) {
- cptr++;
- }
-
- if (!*cptr) {
- break;
- }
-
- x = g_ascii_strtod (cptr, &eptr);
-
- if (eptr == cptr) {
- break;
- }
-
- cptr = eptr;
-
- while (*cptr != '\0' && (*cptr == ',' || *cptr == '\x20' || *cptr == '\x9' || *cptr == '\xD' || *cptr == '\xA')) {
- cptr++;
- }
-
- if (!*cptr) {
- break;
- }
-
- y = g_ascii_strtod (cptr, &eptr);
-
- if (eptr == cptr) {
- break;
- }
-
- cptr = eptr;
-
- if (hascpt) {
- curve->lineto(x, y);
- } else {
- curve->moveto(x, y);
- hascpt = TRUE;
- }
- }
-
- this->setCurve(curve, TRUE);
- curve->unref();
- break;
- }
- default:
- SPShape::set(key, value);
- break;
- }
-}
-
-Inkscape::XML::Node* SPPolyLine::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
- if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = xml_doc->createElement("svg:polyline");
- }
-
- if (repr != this->getRepr()) {
- repr->mergeFrom(this->getRepr(), "id");
- }
-
- SPShape::write(xml_doc, repr, flags);
-
- return repr;
-}
-
-gchar* SPPolyLine::description() const {
- return g_strdup(_("<b>Polyline</b>"));
-}
-
-
-/*
- 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 :