summaryrefslogtreecommitdiffstats
path: root/src/svg
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-08-18 20:19:55 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-08-18 20:19:55 +0000
commitdce3466274e04364e25c47b0b71007a65c9cf9dd (patch)
tree37d21bcfbc010d83221de713fb83d6e15e1546cf /src/svg
parentFix accidental regression in previous commit (diff)
downloadinkscape-dce3466274e04364e25c47b0b71007a65c9cf9dd.tar.gz
inkscape-dce3466274e04364e25c47b0b71007a65c9cf9dd.zip
Code cleanup.
(bzr r13341.1.145)
Diffstat (limited to 'src/svg')
-rw-r--r--src/svg/svg-length.cpp13
-rw-r--r--src/svg/svg-length.h24
-rw-r--r--src/svg/svg-path.cpp51
3 files changed, 32 insertions, 56 deletions
diff --git a/src/svg/svg-length.cpp b/src/svg/svg-length.cpp
index b9e8e6340..b9b475f4b 100644
--- a/src/svg/svg-length.cpp
+++ b/src/svg/svg-length.cpp
@@ -1,6 +1,4 @@
-#define __SP_SVG_LENGTH_C__
-
-/*
+/**
* SVG data parser
*
* Authors:
@@ -12,20 +10,15 @@
* This code is in public domain
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
+#include <cmath>
#include <cstring>
#include <string>
-#include <math.h>
#include <glib.h>
#include "svg.h"
#include "stringstream.h"
#include "util/units.h"
-
static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, float *val, float *computed, char **next);
#ifndef MAX
@@ -570,4 +563,4 @@ void SVGLength::readOrUnset(gchar const *str, Unit u, float v, float c)
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
diff --git a/src/svg/svg-length.h b/src/svg/svg-length.h
index 477b3ef81..c34905d07 100644
--- a/src/svg/svg-length.h
+++ b/src/svg/svg-length.h
@@ -1,11 +1,4 @@
-#ifndef SEEN_SP_SVG_LENGTH_H
-#define SEEN_SP_SVG_LENGTH_H
-
/**
- * \file src/svg/svg-length.h
- * \brief SVG length type
- */
-/*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Carl Hetherington <inkscape@carlh.net>
@@ -16,10 +9,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glib.h>
+#ifndef SEEN_SP_SVG_LENGTH_H
+#define SEEN_SP_SVG_LENGTH_H
-class SVGLength
-{
+/**
+ * SVG length type
+ */
+class SVGLength {
public:
SVGLength();
@@ -57,9 +53,9 @@ public:
return v;
}
- bool read(gchar const *str);
- void readOrUnset(gchar const *str, Unit u = NONE, float v = 0, float c = 0);
- bool readAbsolute(gchar const *str);
+ bool read(char const *str);
+ void readOrUnset(char const *str, Unit u = NONE, float v = 0, float c = 0);
+ bool readAbsolute(char const *str);
void set(Unit u, float v, float c);
void unset(Unit u = NONE, float v = 0, float c = 0);
void update(double em, double ex, double scale);
@@ -76,4 +72,4 @@ public:
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp
index 59dad9ead..9ba3c0ebd 100644
--- a/src/svg/svg-path.cpp
+++ b/src/svg/svg-path.cpp
@@ -1,41 +1,25 @@
-#define __SP_SVG_PARSE_C__
/*
- svg-path.c: Parse SVG path element data into bezier path.
-
- Copyright (C) 2000 Eazel, Inc.
- Copyright (C) 2000 Lauris Kaplinski
- Copyright (C) 2001 Ximian, Inc.
- Copyright (C) 2008 Johan Engelen
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public
- License along with this program; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors:
- Johan Engelen
- (old nartbpath code that has been deleted: Raph Levien <raph@artofcode.com>)
- (old nartbpath code that has been deleted: Lauris Kaplinski <lauris@ximian.com>)
-*/
+ * svg-path.cpp: Parse SVG path element data into bezier path.
+ * Authors:
+ * Johan Engelen
+ * (old nartbpath code that has been deleted: Raph Levien <raph@artofcode.com>)
+ * (old nartbpath code that has been deleted: Lauris Kaplinski <lauris@ximian.com>)
+ *
+ * Copyright (C) 2000 Eazel, Inc.
+ * Copyright (C) 2000 Lauris Kaplinski
+ * Copyright (C) 2001 Ximian, Inc.
+ * Copyright (C) 2008 Johan Engelen
+ *
+ * Copyright (C) 2000-2008 authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
#include <cstring>
#include <string>
#include <cassert>
#include <glib.h> // g_assert()
-#include "svg/svg.h"
-#include "svg/path-string.h"
-
#include <2geom/pathvector.h>
#include <2geom/path.h>
#include <2geom/curves.h>
@@ -45,6 +29,9 @@
#include <2geom/exception.h>
#include <2geom/angle.h>
+#include "svg/svg.h"
+#include "svg/path-string.h"
+
/*
* Parses the path in str. When an error is found in the pathstring, this method
* returns a truncated path up to where the error was found in the pathstring.
@@ -150,4 +137,4 @@ gchar * sp_svg_write_path(Geom::Path const &p) {
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :