summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 157424f)
raw | patch | inline | side by side (parent: 157424f)
author | joncruz <joncruz@users.sourceforge.net> | |
Mon, 24 Sep 2007 16:10:40 +0000 (16:10 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Mon, 24 Sep 2007 16:10:40 +0000 (16:10 +0000) |
12 files changed:
index fe370c522dbc34148b7a65ec28fbef7ca4b61550..f6d3b030958859530d3f96b19157a2ab91df44fd 100644 (file)
Inkscape::XML::Node *repr = inkscape_get_repr(INKSCAPE, prefs_path);
gchar c[32];
- sp_svg_write_color(c, 32, rgba);
+ sp_svg_write_color(c, sizeof(c), rgba);
repr->setAttribute("initial_color", c);
is_updating = false;
float rgb[3];
sp_color_hsl_to_rgb_floatv (rgb, hsl[0], hsl[1], hsl[2]);
- sp_svg_write_color(color_string, 32, SP_RGBA32_F_COMPOSE(rgb[0], rgb[1], rgb[2], 1.0));
+ sp_svg_write_color(color_string, sizeof(color_string), SP_RGBA32_F_COMPOSE(rgb[0], rgb[1], rgb[2], 1.0));
}
// Blur
opacity *= val;
}
if (pick_to_color) {
- sp_svg_write_color(color_string, 32, rgba);
+ sp_svg_write_color(color_string, sizeof(color_string), rgba);
}
}
index 3a41c1ec4a4629b096f828952bd921657a997711..fb302c110c2af81d9012f7786e66f088140c7778 100644 (file)
--- a/src/dialogs/swatches.cpp
+++ b/src/dialogs/swatches.cpp
@@ -332,7 +332,7 @@ static bool bruteForce( SPDocument* document, Inkscape::XML::Node* node, Glib::u
SPObject *obj = document->getObjectByRepr( node );
gchar c[64] = {0};
- sp_svg_write_color( c, 64, SP_RGBA32_U_COMPOSE( r, g, b, 0xff ) );
+ sp_svg_write_color( c, sizeof(c), SP_RGBA32_U_COMPOSE( r, g, b, 0xff ) );
SPCSSAttr *css = sp_repr_css_attr_new();
sp_repr_css_set_property( css, "fill", c );
@@ -347,7 +347,7 @@ static bool bruteForce( SPDocument* document, Inkscape::XML::Node* node, Glib::u
SPObject *obj = document->getObjectByRepr( node );
gchar c[64] = {0};
- sp_svg_write_color( c, 64, SP_RGBA32_U_COMPOSE( r, g, b, 0xff ) );
+ sp_svg_write_color( c, sizoef(c), SP_RGBA32_U_COMPOSE( r, g, b, 0xff ) );
SPCSSAttr *css = sp_repr_css_attr_new();
sp_repr_css_set_property( css, "stroke", c );
char const * attrName = secondary ? "stroke" : "fill";
guint32 rgba = (def.getR() << 24) | (def.getG() << 16) | (def.getB() << 8) | 0xff;
gchar c[64];
- sp_svg_write_color(c, 64, rgba);
+ sp_svg_write_color(c, sizeof(c), rgba);
SPCSSAttr *css = sp_repr_css_attr_new();
sp_repr_css_set_property( css, attrName, c );
index b986569aedb0126a6f75e00927d6ca70c48eaf09..5c11aa50c5a554b0c3cfc118214bd5e6641b8ae9 100644 (file)
--- a/src/dropper-context.cpp
+++ b/src/dropper-context.cpp
@@ -346,7 +346,7 @@ static gint sp_dropper_context_root_handler(SPEventContext *event_context, GdkEv
guint32 c32 = SP_RGBA32_F_COMPOSE(R, G, B, alpha_to_set);
gchar c[64];
- sp_svg_write_color(c, 64, c32);
+ sp_svg_write_color(c, sizeof(c), c32);
// alpha of color under cursor, to show in the statusbar
// locale-sensitive printf is OK, since this goes to the UI, not into SVG
index d3b8f79114cd44ba3ddc9c3def17b4a8a6dda6d0..9a78a5293ec84455eaa03f87ab4564de786478ff 100644 (file)
Inkscape::XML::Node *stop = xml_doc->createElement("svg:stop");
gchar b[64];
- sp_svg_write_color(b, 64, color);
+ sp_svg_write_color(b, sizeof(b), color);
{
gchar *t = g_strdup_printf("stop-color:%s;stop-opacity:1;", b);
index f83625abea6b7531bdc1226de58373194bc4121c..3f643b2a9c1d012dd68e208c88df8bc9b06215d0 100644 (file)
--- a/src/gradient-context.cpp
+++ b/src/gradient-context.cpp
guint32 cnew = average_color (c1, c2, (offset - prev_stop->offset) / (next_stop->offset - prev_stop->offset));
Inkscape::CSSOStringStream os;
gchar c[64];
- sp_svg_write_color (c, 64, cnew);
+ sp_svg_write_color (c, sizeof(c), cnew);
gdouble opacity = (gdouble) SP_RGBA32_A_F (cnew);
os << "stop-color:" << c << ";stop-opacity:" << opacity <<";";
SP_OBJECT_REPR (newstop)->setAttribute("style", os.str().c_str());
diff --git a/src/interface.cpp b/src/interface.cpp
index a041f5cf582ce91a2ddf4480be158f7df0a4e308..43ba15f04a5b776a9e9ee963675c3c5e3f27d368 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
gchar c[64] = {0};
// Careful about endian issues.
guint16* dataVals = (guint16*)data->data;
- sp_svg_write_color( c, 64,
+ sp_svg_write_color( c, sizeof(c),
SP_RGBA32_U_COMPOSE(
0x0ff & (dataVals[0] >> 8),
0x0ff & (dataVals[1] >> 8),
index cdb771cd021375fd158e54dc11ef34637e74ab97..a44ac5894204a7c3cdd3bbe6434d970b6ea57c8c 100644 (file)
@@ -264,7 +264,7 @@ sp_feDiffuseLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint fl
/*TODO kernelUnits */
if (fediffuselighting->lighting_color_set) {
gchar c[64];
- sp_svg_write_color(c, 64, fediffuselighting->lighting_color);
+ sp_svg_write_color(c, sizeof(c), fediffuselighting->lighting_color);
repr->setAttribute("lighting-color", c);
} else
repr->setAttribute("lighting-color", NULL);
index 27f8cf8ba78471267aca0f8dfa8c7b0f46dd1795..3a21d9844db187e1fa548a66a2d2cfd082c2ae27 100644 (file)
@@ -288,7 +288,7 @@ sp_feSpecularLighting_write(SPObject *object, Inkscape::XML::Node *repr, guint f
/*TODO kernelUnits */
if (fespecularlighting->lighting_color_set) {
gchar c[64];
- sp_svg_write_color(c, 64, fespecularlighting->lighting_color);
+ sp_svg_write_color(c, sizeof(c), fespecularlighting->lighting_color);
repr->setAttribute("lighting-color", c);
}
if (((SPObjectClass *) feSpecularLighting_parent_class)->write) {
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index d86e3b0e3cd8c73c01e492b9ff2c055bc04476b7..b4c42e866d92950867f1685ef6de7a1d56cca1e5 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
os << "currentColor";
} else {
gchar c[64];
- sp_svg_write_color(c, 64, specifiedcolor);
+ sp_svg_write_color(c, sizeof(c), specifiedcolor);
os << c;
}
os << ";stop-opacity:" << opacity;
/* strictly speaking, offset an SVG <number> rather than a CSS one, but exponents make no
* sense for offset proportions. */
gchar c[64];
- sp_svg_write_color(c, 64, gr->vector.stops[i].color.toRGBA32( 0x00 ));
+ sp_svg_write_color(c, sizeof(c), gr->vector.stops[i].color.toRGBA32( 0x00 ));
os << "stop-color:" << c << ";stop-opacity:" << gr->vector.stops[i].opacity;
child->setAttribute("style", os.str().c_str());
/* Order will be reversed here */
index c99fcb5ffc2a3eedb46f99de7296b54e157696bf..5f59eff8fb89bf55dc49d0fa2b861faa155302c6 100644 (file)
}
gchar c[32];
- sp_svg_write_color(c, 32, rgba);
+ sp_svg_write_color(c, sizeof(c), rgba);
bool saved = sp_document_get_undo_sensitive (local_doc);
sp_document_set_undo_sensitive (local_doc, false);
local_repr->setAttribute(_ckey.c_str(), c);
index d4b0a203adda57c7aea2264924f4cb5625655482..139a431b9a70532af23c5e01017d63e418cb7db1 100644 (file)
gchar c[64];
// Careful about endian issues.
guint16* dataVals = (guint16*)data->data;
- sp_svg_write_color( c, 64,
+ sp_svg_write_color( c, sizeof(c),
SP_RGBA32_U_COMPOSE(
0x0ff & (dataVals[0] >> 8),
0x0ff & (dataVals[1] >> 8),
SPCSSAttr *css = sp_repr_css_attr_new ();
guint32 color = sp_desktop_get_color(_desktop, true);
gchar c[64];
- sp_svg_write_color (c, 64, color);
+ sp_svg_write_color (c, sizeof(c), color);
sp_repr_css_set_property (css, "fill", c);
sp_desktop_set_style (_desktop, css);
sp_repr_css_attr_unref (css);
SPCSSAttr *css = sp_repr_css_attr_new ();
guint32 color = sp_desktop_get_color(_desktop, false);
gchar c[64];
- sp_svg_write_color (c, 64, color);
+ sp_svg_write_color (c, sizeof(c), color);
sp_repr_css_set_property (css, "stroke", c);
sp_desktop_set_style (_desktop, css);
sp_repr_css_attr_unref (css);
void SelectedStyle::on_fill_lastselected() {
SPCSSAttr *css = sp_repr_css_attr_new ();
gchar c[64];
- sp_svg_write_color (c, 64, _lastselected[SS_FILL]);
+ sp_svg_write_color (c, sizeof(c), _lastselected[SS_FILL]);
sp_repr_css_set_property (css, "fill", c);
sp_desktop_set_style (_desktop, css);
sp_repr_css_attr_unref (css);
void SelectedStyle::on_stroke_lastselected() {
SPCSSAttr *css = sp_repr_css_attr_new ();
gchar c[64];
- sp_svg_write_color (c, 64, _lastselected[SS_STROKE]);
+ sp_svg_write_color (c, sizeof(c), _lastselected[SS_STROKE]);
sp_repr_css_set_property (css, "stroke", c);
sp_desktop_set_style (_desktop, css);
sp_repr_css_attr_unref (css);
guint32 color = _thisselected[SS_FILL];
gchar c[64];
if (_mode[SS_FILL] != SS_COLOR) return;
- sp_svg_write_color (c, 64,
+ sp_svg_write_color (c, sizeof(c),
SP_RGBA32_U_COMPOSE(
(255 - SP_RGBA32_R_U(color)),
(255 - SP_RGBA32_G_U(color)),
guint32 color = _thisselected[SS_STROKE];
gchar c[64];
if (_mode[SS_STROKE] != SS_COLOR) return;
- sp_svg_write_color (c, 64,
+ sp_svg_write_color (c, sizeof(c),
SP_RGBA32_U_COMPOSE(
(255 - SP_RGBA32_R_U(color)),
(255 - SP_RGBA32_G_U(color)),
void SelectedStyle::on_fill_white() {
SPCSSAttr *css = sp_repr_css_attr_new ();
gchar c[64];
- sp_svg_write_color (c, 64, 0xffffffff);
+ sp_svg_write_color (c, sizeof(c), 0xffffffff);
sp_repr_css_set_property (css, "fill", c);
sp_repr_css_set_property (css, "fill-opacity", "1");
sp_desktop_set_style (_desktop, css);
void SelectedStyle::on_stroke_white() {
SPCSSAttr *css = sp_repr_css_attr_new ();
gchar c[64];
- sp_svg_write_color (c, 64, 0xffffffff);
+ sp_svg_write_color (c, sizeof(c), 0xffffffff);
sp_repr_css_set_property (css, "stroke", c);
sp_repr_css_set_property (css, "stroke-opacity", "1");
sp_desktop_set_style (_desktop, css);
void SelectedStyle::on_fill_black() {
SPCSSAttr *css = sp_repr_css_attr_new ();
gchar c[64];
- sp_svg_write_color (c, 64, 0x000000ff);
+ sp_svg_write_color (c, sizeof(c), 0x000000ff);
sp_repr_css_set_property (css, "fill", c);
sp_repr_css_set_property (css, "fill-opacity", "1.0");
sp_desktop_set_style (_desktop, css);
void SelectedStyle::on_stroke_black() {
SPCSSAttr *css = sp_repr_css_attr_new ();
gchar c[64];
- sp_svg_write_color (c, 64, 0x000000ff);
+ sp_svg_write_color (c, sizeof(c), 0x000000ff);
sp_repr_css_set_property (css, "stroke", c);
sp_repr_css_set_property (css, "stroke-opacity", "1.0");
sp_desktop_set_style (_desktop, css);
void SelectedStyle::on_fill_copy() {
if (_mode[SS_FILL] == SS_COLOR) {
gchar c[64];
- sp_svg_write_color (c, 64, _thisselected[SS_FILL]);
+ sp_svg_write_color (c, sizeof(c), _thisselected[SS_FILL]);
Glib::ustring text;
text += c;
if (!text.empty()) {
void SelectedStyle::on_stroke_copy() {
if (_mode[SS_STROKE] == SS_COLOR) {
gchar c[64];
- sp_svg_write_color (c, 64, _thisselected[SS_STROKE]);
+ sp_svg_write_color (c, sizeof(c), _thisselected[SS_STROKE]);
Glib::ustring text;
text += c;
if (!text.empty()) {
break;
case SS_COLOR:
gchar c[64];
- sp_svg_write_color (c, 64, _thisselected[SS_FILL]);
+ sp_svg_write_color (c, sizeof(c), _thisselected[SS_FILL]);
sp_repr_css_set_property (css, "stroke", c);
break;
case SS_LGRADIENT:
break;
case SS_COLOR:
gchar c[64];
- sp_svg_write_color (c, 64, _thisselected[SS_STROKE]);
+ sp_svg_write_color (c, sizeof(c), _thisselected[SS_STROKE]);
sp_repr_css_set_property (css, "fill", c);
break;
case SS_LGRADIENT:
index f7a22cc43338ca8a8196495c4f87284bd6c4c0ae..991e415d5eef98544efd1cc618bf9094224a1ac7 100644 (file)
if (i < 1) {
gchar c[64];
- sp_svg_write_color (c, 64, 0x00000000);
+ sp_svg_write_color (c, sizeof(c), 0x00000000);
Inkscape::CSSOStringStream os;
os << "stop-color:" << c << ";stop-opacity:" << 1.0 << ";";
Inkscape::CSSOStringStream os;
gchar c[64];
- sp_svg_write_color (c, 64, cnew);
+ sp_svg_write_color (c, sizeof(c), cnew);
gdouble opacity = (gdouble) SP_RGBA32_A_F (cnew);
os << "stop-color:" << c << ";stop-opacity:" << opacity <<";";
SP_OBJECT_REPR (newstop)->setAttribute("style", os.str().c_str());
sp_repr_set_css_double (SP_OBJECT_REPR (stop), "offset", stop->offset);
Inkscape::CSSOStringStream os;
gchar c[64];
- sp_svg_write_color (c, 64, rgb);
+ sp_svg_write_color (c, sizeof(c), rgb);
os << "stop-color:" << c << ";stop-opacity:" << (gdouble) alpha <<";";
SP_OBJECT_REPR (stop)->setAttribute("style", os.str().c_str());
// g_snprintf (c, 256, "stop-color:#%06x;stop-opacity:%g;", rgb >> 8, (gdouble) alpha);