nr-style.cpp revision 78b879113fc2eb8281b9f637719275ced0693ac2
/**
* @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"
{
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)
, phase_length(0.0)
, tspan_line_start(false)
, tspan_line_end(false)
, tspan_width(0)
, ascender(0)
, descender(0)
, line_gap(0)
, underline_thickness(0)
, underline_position(0)
, font_size(0)
{}
{
if (dash){
delete [] dash;
}
}
{
} else {
}
case SP_WIND_RULE_EVENODD:
break;
case SP_WIND_RULE_NONZERO:
break;
default:
}
} 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;
}
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; }
text_decoration_useColor = true;
}
else {
text_decoration_useColor = false;
}
}
update();
}
{
// update fill pattern
if (!fill_pattern) {
case PAINT_SERVER: {
//fill_pattern = sp_paint_server_create_pattern(fill.server, ct.raw(), paintbox, fill.opacity);
} break;
case PAINT_COLOR: {
} break;
default: break;
}
}
if (!fill_pattern) return false;
return true;
}
{
}
{
if (!stroke_pattern) {
case PAINT_SERVER: {
//stroke_pattern = sp_paint_server_create_pattern(stroke.server, ct.raw(), paintbox, stroke.opacity);
} break;
case PAINT_COLOR: {
} break;
default: break;
}
}
if (!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 :