diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-07-07 07:41:42 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-07-07 07:41:42 +0000 |
| commit | 9562e69ff5bc24fdaed1bbbbf5691054a0b297e2 (patch) | |
| tree | 8fc8091cea1016c74ea8d14bc83da9472b8927fe /src/svg | |
| parent | Tuning fill-n-stroke to support non-solid swatches. (diff) | |
| download | inkscape-9562e69ff5bc24fdaed1bbbbf5691054a0b297e2.tar.gz inkscape-9562e69ff5bc24fdaed1bbbbf5691054a0b297e2.zip | |
Revert device-color for now.
"commit the awesomesauce"
(bzr r9587)
Diffstat (limited to 'src/svg')
| -rw-r--r-- | src/svg/Makefile_insert | 1 | ||||
| -rw-r--r-- | src/svg/svg-color.cpp | 105 | ||||
| -rw-r--r-- | src/svg/svg-color.h | 3 | ||||
| -rw-r--r-- | src/svg/svg-device-color.h | 26 |
4 files changed, 0 insertions, 135 deletions
diff --git a/src/svg/Makefile_insert b/src/svg/Makefile_insert index c27b2291c..265210a45 100644 --- a/src/svg/Makefile_insert +++ b/src/svg/Makefile_insert @@ -14,7 +14,6 @@ ink_common_sources += \ svg/svg-affine.cpp \ svg/svg-color.cpp \ svg/svg-color.h \ - svg/svg-device-color.h \ svg/svg-icc-color.h \ svg/svg-length.cpp \ svg/svg-length.h \ diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 7d43b68ee..04f387798 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -35,7 +35,6 @@ #include "preferences.h" #include "svg-color.h" #include "svg-icc-color.h" -#include "svg-device-color.h" #if ENABLE_LCMS #include <lcms.h> @@ -606,110 +605,6 @@ bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ) return sp_svg_read_icc_color(str, NULL, dest); } -bool sp_svg_read_device_color( gchar const *str, gchar const **end_ptr, SVGDeviceColor* dest) -{ - bool good = true; - unsigned int max_colors; - - if ( end_ptr ) { - *end_ptr = str; - } - if ( dest ) { - dest->colors.clear(); - } - - if ( !str ) { - // invalid input - good = false; - } else { - while ( g_ascii_isspace(*str) ) { - str++; - } - - dest->type = DEVICE_COLOR_INVALID; - if (strneq( str, "device-gray(", 12 )){ - dest->type = DEVICE_GRAY; - max_colors=1; - str += 12; - } - - if (strneq( str, "device-rgb(", 11 )){ - dest->type = DEVICE_RGB; - max_colors=3; - str += 11; - } - - if (strneq( str, "device-cmyk(", 12 )){ - dest->type = DEVICE_CMYK; - max_colors=4; - str += 12; - } - - if (strneq( str, "device-nchannel(", 16 )){ - dest->type = DEVICE_NCHANNEL; - max_colors=0; - str += 16; - } - - if ( dest->type != DEVICE_COLOR_INVALID ) { - while ( g_ascii_isspace(*str) ) { - str++; - } - - while ( *str && *str != ')' ) { - if ( g_ascii_isdigit(*str) || *str == '.' || *str == '-' || *str == '+') { - gchar* endPtr = 0; - gdouble dbl = g_ascii_strtod( str, &endPtr ); - if ( !errno ) { - if ( dest ) { - dest->colors.push_back( dbl ); - } - str = endPtr; - } else { - good = false; - break; - } - - while ( g_ascii_isspace(*str) || *str == ',' ) { - str++; - } - } else { - break; - } - } - } - - // We need to have ended on a closing parenthesis - if ( good ) { - while ( g_ascii_isspace(*str) ) { - str++; - } - good &= (*str == ')'); - } - } - - if ( dest->colors.size() == 0) good=false; - if ( dest->type != DEVICE_NCHANNEL && (dest->colors.size() != max_colors)) good=false; - - if ( good ) { - if ( end_ptr ) { - *end_ptr = str; - } - } else { - if ( dest ) { - dest->type = DEVICE_COLOR_INVALID; - dest->colors.clear(); - } - } - - return good; -} - - -bool sp_svg_read_device_color( gchar const *str, SVGDeviceColor* dest) -{ - return sp_svg_read_device_color(str, NULL, dest); -} /* Local Variables: diff --git a/src/svg/svg-color.h b/src/svg/svg-color.h index f4e534652..a3868c149 100644 --- a/src/svg/svg-color.h +++ b/src/svg/svg-color.h @@ -4,7 +4,6 @@ #include <glib/gtypes.h> class SVGICCColor; -class SVGDeviceColor; guint32 sp_svg_read_color(gchar const *str, unsigned int dfl); guint32 sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def); @@ -12,8 +11,6 @@ void sp_svg_write_color(char *buf, unsigned int buflen, unsigned int rgba32); bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor* dest ); bool sp_svg_read_icc_color( gchar const *str, SVGICCColor* dest ); -bool sp_svg_read_device_color( gchar const *str, gchar const **end_ptr, SVGDeviceColor* dest ); -bool sp_svg_read_device_color( gchar const *str, SVGDeviceColor* dest ); void icc_color_to_sRGB(SVGICCColor* dest, guchar* r, guchar* g, guchar* b); #endif /* !SVG_SVG_COLOR_H_SEEN */ diff --git a/src/svg/svg-device-color.h b/src/svg/svg-device-color.h deleted file mode 100644 index 305133ed3..000000000 --- a/src/svg/svg-device-color.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef SVG_DEVICE_COLOR_H_SEEN -#define SVG_DEVICE_COLOR_H_SEEN - -#include <string> -#include <vector> - -typedef enum {DEVICE_COLOR_INVALID, DEVICE_GRAY, DEVICE_RGB, DEVICE_CMYK, DEVICE_NCHANNEL} SVGDeviceColorType; - -struct SVGDeviceColor { - SVGDeviceColorType type; - std::vector<double> colors; -}; - - -#endif /* !SVG_DEVICE_COLOR_H_SEEN */ - -/* - 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:encoding=utf-8:textwidth=99 : |
