diff options
| author | Peter Moulder <peter.moulder@monash.edu> | 2006-03-13 03:27:43 +0000 |
|---|---|---|
| committer | pjrm <pjrm@users.sourceforge.net> | 2006-03-13 03:27:43 +0000 |
| commit | 33371acda6eb7306995c26d09ff3d350eb37b2e2 (patch) | |
| tree | 1bab1de3d4112dea416182043cef691bd52de51f /src | |
| parent | Shift-drop of color now sets stroke. (diff) | |
| download | inkscape-33371acda6eb7306995c26d09ff3d350eb37b2e2.tar.gz inkscape-33371acda6eb7306995c26d09ff3d350eb37b2e2.zip | |
Move declaration of sp_svg_read_color,sp_svg_write_color from svg/svg.h to new file svg/svg-color.h.
svg/svg.h: Temporarily #include svg-color.h.
(bzr r231)
Diffstat (limited to 'src')
| -rw-r--r-- | src/svg/Makefile_insert | 1 | ||||
| -rw-r--r-- | src/svg/svg-color.cpp | 6 | ||||
| -rw-r--r-- | src/svg/svg-color.h | 10 | ||||
| -rw-r--r-- | src/svg/svg.h | 4 |
4 files changed, 15 insertions, 6 deletions
diff --git a/src/svg/Makefile_insert b/src/svg/Makefile_insert index f76abb0eb..c3219d705 100644 --- a/src/svg/Makefile_insert +++ b/src/svg/Makefile_insert @@ -26,6 +26,7 @@ svg_libspsvg_a_SOURCES = \ svg/strip-trailing-zeros.cpp \ svg/svg-affine.cpp \ svg/svg-color.cpp \ + svg/svg-color.h \ svg/svg-length.cpp \ svg/svg-length.h \ svg/svg-path.cpp \ diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 613d97c0b..89c273fe5 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -17,13 +17,13 @@ # include "config.h" #endif +#include "svg-color.h" #include <math.h> #include <glib/gmessages.h> #include <glib/gstrfuncs.h> #include <glib/ghash.h> #include <glib/gutils.h> - -#include "svg.h" +#include "strneq.h" struct SPSVGColor { unsigned long rgb; @@ -220,7 +220,7 @@ sp_svg_read_color(gchar const *str, guint32 def) /* must be either 3 or 6 digits. */ return def; } - } else if (!strncmp(str, "rgb(", 4)) { + } else if (strneq(str, "rgb(", 4)) { gboolean hasp, hasd; gchar *s, *e; gdouble r, g, b; diff --git a/src/svg/svg-color.h b/src/svg/svg-color.h new file mode 100644 index 000000000..09cac4f2e --- /dev/null +++ b/src/svg/svg-color.h @@ -0,0 +1,10 @@ +#ifndef SVG_SVG_COLOR_H_SEEN +#define SVG_SVG_COLOR_H_SEEN + +#include <glib/gtypes.h> + +unsigned int sp_svg_read_color(gchar const *str, unsigned int dfl); +int sp_svg_write_color(char *buf, unsigned buflen, unsigned int color); + + +#endif /* !SVG_SVG_COLOR_H_SEEN */ diff --git a/src/svg/svg.h b/src/svg/svg.h index 15d4f39a9..c79ff274e 100644 --- a/src/svg/svg.h +++ b/src/svg/svg.h @@ -13,6 +13,7 @@ */ #include <glib/gtypes.h> #include "svg/svg-length.h" +#include "svg/svg-color.h" #include <vector> struct NArtBpath; @@ -62,9 +63,6 @@ unsigned sp_svg_transform_write(gchar str[], unsigned size, NRMatrix const *tran double sp_svg_read_percentage (const char * str, double def); -unsigned int sp_svg_read_color (const gchar * str, unsigned int def); -int sp_svg_write_color(char *buf, unsigned buflen, unsigned int color); - /* NB! As paths can be long, we use here dynamic string */ NArtBpath * sp_svg_read_path (const char * str); |
