/** @file
* @gradient stop class.
*/
/* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 1999,2005 authors
* Copyright (C) 2010 Jon A. Cruz
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "sp-stop.h"
#include "style.h"
#include "attributes.h"
#include "streq.h"
#include "svg/svg-color.h"
#include "svg/css-ostringstream.h"
this->path_string = NULL;
this->offset = 0.0;
this->currentColor = false;
this->opacity = 1.0;
}
}
this->readAttr( "offset" );
this->readAttr( "stop-color" );
this->readAttr( "stop-opacity" );
this->readAttr( "style" );
}
/**
* Virtual build: set stop attributes from its associated XML node.
*/
switch (key) {
case SP_ATTR_STYLE: {
/** \todo
* fixme: We are reading simple values 3 times during build (Lauris).
* \par
* We need presentation attributes etc.
* \par
* remove the hackish "style reading" from here: see comments in
* sp_object_get_style_property about the bugs in our current
* approach. However, note that SPStyle doesn't currently have
* stop-color and stop-opacity properties.
*/
{
if (streq(p, "currentColor")) {
this->currentColor = true;
} else {
}
}
{
}
break;
}
case SP_PROP_STOP_COLOR: {
{
if (streq(p, "currentColor")) {
this->currentColor = true;
} else {
this->currentColor = false;
}
}
break;
}
case SP_PROP_STOP_OPACITY: {
{
}
break;
}
case SP_ATTR_OFFSET: {
break;
}
case SP_PROP_STOP_PATH: {
if (value) {
//Geom::PathVector pv = sp_svg_read_pathv(value);
//SPCurve *curve = new SPCurve(pv);
//if( curve ) {
// std::cout << "Got Curve" << std::endl;
//curve->unref();
//}
}
break;
}
default: {
break;
}
}
}
/**
* Virtual set: set attribute to value.
*/
Inkscape::XML::Node* SPStop::write(Inkscape::XML::Document* xml_doc, Inkscape::XML::Node* repr, guint flags) {
}
// Since we do a hackish style setting here (because SPStyle does not support stop-color and
// stop-opacity), we must do it AFTER calling the parent write method; otherwise
// sp_object_write would clear our style= attribute (bug 1695287)
os << "stop-color:";
if (this->currentColor) {
os << "currentColor";
} else {
}
/* strictly speaking, offset an SVG <number> rather than a CSS one, but exponents make no sense
* for offset proportions. */
return repr;
}
/**
* Virtual write: write object attributes to repr.
*/
// A stop might have some non-stop siblings
if (SP_IS_STOP(obj)) {
}
}
return result;
}
// The closest previous SPObject that is an SPStop *should* be ourself.
if (SP_IS_STOP(obj)) {
// Sanity check to ensure we have a proper sibling structure.
if (stop->getNextStop() == this) {
} else {
}
break;
}
}
return result;
}
}
return color;
}
if (currentColor) {
/* Default value: arbitrarily black. (SVG1.1 and CSS2 both say that the initial
* value depends on user agent, and don't give any further restrictions that I can
* see.) */
} else {
}
return ret;
}
/**
* Return stop's color as 32bit value.
*/
/* Default value: arbitrarily black. (SVG1.1 and CSS2 both say that the initial
* value depends on user agent, and don't give any further restrictions that I can
* see.) */
if (this->currentColor) {
if (str) {
}
} else {
}
}
/*
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:fileencoding=utf-8:textwidth=99 :