Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

static gint sp_style_write_itextdecoration ( gchar *  p,
gint const   len,
gchar const *const   key,
SPITextDecoration const *const   val,
SPITextDecoration const *const   base,
guint const   flags 
) [static]

Write SPITextDecoration object into string.

Definition at line 3511 of file style.cpp.

References SPITextDecoration::blink, SPITextDecoration::inherit, SPITextDecoration::line_through, SPITextDecoration::overline, SPITextDecoration::set, Inkscape::CSSOStringStream::str(), and SPITextDecoration::underline.

Referenced by sp_style_write_difference(), and sp_style_write_string().

{
    Inkscape::CSSOStringStream os;

    if ((flags & SP_STYLE_FLAG_ALWAYS)
        || ((flags & SP_STYLE_FLAG_IFSET) && val->set)
        || ((flags & SP_STYLE_FLAG_IFDIFF) && val->set
            && (!base->set || sp_textdecoration_differ(val, base))))
    {
        if (val->inherit) {
            return g_snprintf(p, len, "%s:inherit;", key);
        } else {
            os << key << ":";
            if (val->underline || val->overline || val->line_through || val->blink) {
                if (val->underline) os << " underline";
                if (val->overline) os << " overline";
                if (val->line_through) os << " line-through";
                if (val->blink) os << " blink";
            } else
                os << "none";
            os << ";";
            return g_strlcpy(p, os.str().c_str(), len);
        }
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index