/**
* @file
* Style information for rendering.
*//*
* Authors:
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright (C) 2010 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "display/nr-style.h"
#include "style.h"
#include "sp-paint-server.h"
#include "display/canvas-bpath.h" // contains SPStrokeJoinType, SPStrokeCapType etc. (WTF!)
#include "display/drawing-context.h"
#include "display/drawing-pattern.h"
{
if (server) {
}
type = PAINT_NONE;
}
{
clear();
type = PAINT_COLOR;
color = c;
}
{
clear();
if (ps) {
type = PAINT_SERVER;
}
}
: fill()
, stroke()
, stroke_width(0.0)
, miter_limit(0.0)
, n_dash(0)
, dash_offset(0.0)
, fill_pattern(NULL)
, text_decoration_stroke_width(0.0)
, phase_length(0.0)
, tspan_line_start(false)
, tspan_line_end(false)
, tspan_width(0)
, ascender(0)
, descender(0)
, underline_thickness(0)
, underline_position(0)
, font_size(0)
{
}
{
if (dash){
delete [] dash;
}
}
{
// Handle 'context-fill' and 'context-stroke': Work in progress
if( context_style != NULL ) {
} else {
// A marker in the defs section will result in ending up here.
//std::cerr << "NRStyle::set: 'context-fill': 'context_style' is NULL" << std::endl;
}
if( context_style != NULL ) {
} else {
//std::cerr << "NRStyle::set: 'context-stroke': 'context_style' is NULL" << std::endl;
}
}
if ( style_fill->isPaintserver() ) {
} else if ( style_fill->colorSet ) {
} else {
}
} else if ( style_fill->isColor() ) {
} else if ( style_fill->isNone() ) {
// A marker in the defs section will result in ending up here.
//std::cerr << "NRStyle::set: fill: context-fill: Double" << std::endl;
//std::cerr << "NRStyle::set: fill: context-stroke: Double" << std::endl;
} else {
}
case SP_WIND_RULE_EVENODD:
break;
case SP_WIND_RULE_NONZERO:
break;
default:
}
if( context_style != NULL ) {
} else {
//std::cerr << "NRStyle::set: 'context-fill': 'context_style' is NULL" << std::endl;
}
if( context_style != NULL ) {
} else {
//std::cerr << "NRStyle::set: 'context-stroke': 'context_style' is NULL" << std::endl;
}
}
if ( style_stroke->isPaintserver() ) {
} else if ( style_stroke->isColor() ) {
} else {
}
} else if ( style_stroke->isColor() ) {
} else if ( style_stroke->isNone() ) {
//std::cerr << "NRStyle::set: stroke: context-fill: Double" << std::endl;
//std::cerr << "NRStyle::set: stroke: context-stroke: Double" << std::endl;
} else {
}
case SP_STROKE_LINECAP_ROUND:
break;
case SP_STROKE_LINECAP_SQUARE:
break;
case SP_STROKE_LINECAP_BUTT:
break;
default:
}
case SP_STROKE_LINEJOIN_ROUND:
break;
case SP_STROKE_LINEJOIN_BEVEL:
break;
case SP_STROKE_LINEJOIN_MITER:
break;
default:
}
if (dash){
delete [] dash;
}
if (n_dash != 0) {
for (unsigned int i = 0; i < n_dash; ++i) {
}
} else {
dash_offset = 0.0;
}
for( unsigned i = 0; i < PAINT_ORDER_LAYERS; ++i) {
break;
case SP_CSS_PAINT_ORDER_FILL:
break;
break;
break;
}
}
if(style->text_decoration_line.underline ){ text_decoration_line |= TEXT_DECORATION_LINE_UNDERLINE + TEXT_DECORATION_LINE_SET; }
if(style->text_decoration_line.overline ){ text_decoration_line |= TEXT_DECORATION_LINE_OVERLINE + TEXT_DECORATION_LINE_SET; }
if(style->text_decoration_line.line_through){ text_decoration_line |= TEXT_DECORATION_LINE_LINETHROUGH + TEXT_DECORATION_LINE_SET; }
if(style->text_decoration_line.blink ){ text_decoration_line |= TEXT_DECORATION_LINE_BLINK + TEXT_DECORATION_LINE_SET; }
if(style->text_decoration_style.inherit ){ text_decoration_style |= TEXT_DECORATION_STYLE_INHERIT; }
if(style->text_decoration_style.solid ){ text_decoration_style |= TEXT_DECORATION_STYLE_SOLID + TEXT_DECORATION_STYLE_SET; }
if(style->text_decoration_style.isdouble ){ text_decoration_style |= TEXT_DECORATION_STYLE_ISDOUBLE + TEXT_DECORATION_STYLE_SET; }
if(style->text_decoration_style.dotted ){ text_decoration_style |= TEXT_DECORATION_STYLE_DOTTED + TEXT_DECORATION_STYLE_SET; }
if(style->text_decoration_style.dashed ){ text_decoration_style |= TEXT_DECORATION_STYLE_DASHED + TEXT_DECORATION_STYLE_SET; }
if(style->text_decoration_style.wavy ){ text_decoration_style |= TEXT_DECORATION_STYLE_WAVY + TEXT_DECORATION_STYLE_SET; }
/* FIXME
The meaning of text-decoration-color in CSS3 for SVG is ambiguous (2014-05-06). Set
it for fill, for stroke, for both? Both would seem like the obvious choice but what happens
is that for text which is just fill (very common) it makes the lines fatter because it
enables stroke on the decorations when it wasn't present on the text. That contradicts the
The behavior here is that if color is defined it is applied to text_decoration_fill/stroke
Hopefully the standard will be clarified to resolve this issue.
*/
// SVG sets color specifically
} else {
// No decoration fill because no text fill
}
// SVG sets color specifically
} else {
// No decoration stroke because no text stroke
}
} else {
} else {
//g_assert_not_reached();
}
} else {
//g_assert_not_reached();
}
}
}
update();
}
bool NRStyle::prepareFill(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox, Inkscape::DrawingPattern *pattern)
{
// update fill pattern
if (!fill_pattern) {
case PAINT_SERVER:
if (pattern) {
} else {
}
break;
case PAINT_COLOR: {
}
break;
default:
break;
}
}
if (!fill_pattern) return false;
return true;
}
{
}
bool NRStyle::prepareTextDecorationFill(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox, Inkscape::DrawingPattern *pattern)
{
// update text decoration pattern
if (!text_decoration_fill_pattern) {
switch (text_decoration_fill.type) {
case PAINT_SERVER:
if (pattern) {
} else {
}
break;
case PAINT_COLOR: {
} break;
default: break;
}
}
if (!text_decoration_fill_pattern) return false;
return true;
}
{
// Fill rule does not matter, no intersections.
}
bool NRStyle::prepareStroke(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox, Inkscape::DrawingPattern *pattern)
{
if (!stroke_pattern) {
case PAINT_SERVER:
if (pattern) {
} else {
}
break;
case PAINT_COLOR: {
}
break;
default:
break;
}
}
if (!stroke_pattern) return false;
return true;
}
{
}
bool NRStyle::prepareTextDecorationStroke(Inkscape::DrawingContext &dc, Geom::OptRect const &paintbox, Inkscape::DrawingPattern *pattern)
{
if (!text_decoration_stroke_pattern) {
switch (text_decoration_stroke.type) {
case PAINT_SERVER:
if (pattern) {
} else {
}
break;
case PAINT_COLOR: {
} break;
default: break;
}
}
if (!text_decoration_stroke_pattern) return false;
return true;
}
{
}
{
// force pattern update
fill_pattern = NULL;
}
/*
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 :