From: pjrm Date: Mon, 13 Mar 2006 03:27:43 +0000 (+0000) Subject: Move declaration of sp_svg_read_color,sp_svg_write_color from svg/svg.h to new file... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3523d98045f7514c09c6823fb1771a236950c23b;p=inkscape.git 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. --- 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 #include #include #include #include - -#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 + +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 #include "svg/svg-length.h" +#include "svg/svg-color.h" #include 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);